engine/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/plugin.js

7 lines
22 KiB
JavaScript
Raw Normal View History

/*
* Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH
* aloha-sales@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.GCN=new GENTICS.Aloha.Plugin("com.gentics.aloha.plugins.GCN");GENTICS.Aloha.GCN.languages=["en","de","fr","eo","fi","it"];GENTICS.Aloha.GCN.maximized=false;GENTICS.Aloha.GCN.buttons={};GENTICS.Aloha.GCN.lastActiveEditable={};GENTICS.Aloha.GCN.backendUrl="../CNPortletapp/";GENTICS.Aloha.GCN.restUrl=GENTICS.Aloha.GCN.backendUrl+"rest";GENTICS.Aloha.GCN.closeLightbox=function(){jQuery.prettyPhoto.close();GENTICS.Aloha.Ribbon.show();if(GENTICS.Aloha.GCN.lastActiveEditable!=undefined){GENTICS.Aloha.GCN.lastActiveEditable.activate();GENTICS.Aloha.GCN.lastActiveEditable.obj.focus()}};GENTICS.Aloha.GCN.init=function(){var that=this;jQuery().prettyPhoto({theme:"light_square",opacity:0.4,markup:'<div class="pp_pic_holder"> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_loaderIcon"></div> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div> <div class="ppt"></div>'});var maximizeOptions=null;if(this.isGCNFrame()){GENTICS.Aloha.settings.ribbon=false;jQuery("head").append('<link type="text/css" href="'+this.createGCNURL({url:that.settings.stag_prefix,params:{"do":20,url:"lib/css/gui.css"}})+'" rel="stylesheet">');jQuery("body").append('<div style="z-index: 999999; position: absolute; visibility: hidden" class="gentics_submenu" id="nodesubmenu1"> </div>');jQuery("head").append('<script type="text/javascript" src="'+this.createGCNURL({url:this.settings.stag_prefix,params:{"do":20,url:"lib/js/layer.js"}})+'"><\/script>');jQuery("head").append('<script type="text/javascript" src="'+this.createGCNURL({url:this.settings.stag_prefix,params:{"do":20,url:"lib/js/tools.js"}})+'"><\/script>');jQuery("head").append('<script type="text/javascript" src="'+this.createGCNURL({url:this.settings.stag_prefix,params:{"do":20,url:"lib/js/menu1.js"}})+'"><\/script>');if(top.menu){top.menu.location=this.createGCNURL({url:this.settings.stag_prefix,params:{"do":14004,MENU_LAYER:0,ass_pre_flapped:0,aloha:true}})}jQuery("html").click(function(){hide_layer(get_layer("nodesubmenu1"));if(top.menu){top.menu.nodesubmenu1_clicked=false}});jQuery("html").mouseover(function(){if(top.tree&&top.tree.frame_small){top.tree.frame_small()}})}GENTICS.Aloha.GCN.updateFrameUI();jQuery(window).unload(function(){that.restoreFrameUI();if(GENTICS.Aloha.isModified()){if(confirm(GENTICS.Aloha.i18n(GENTICS.Aloha,"confirm_editable_modified"))){that.savePage({silent:true,async:false});return false}}});this.alohaEditables(this.settings.editables);this.alohaBlocks(this.settings.blocks);if(this.settings.welcomeMessages){jQuery.each(this.settings.welcomeMessages,function(index,message){GENTICS.Aloha.showMessage(new GENTICS.Aloha.Message({title:"Gentics Content.Node",text:message.message,type:GENTICS.Aloha.Message.Type.ALERT}))})}if(GENTICS.Aloha.Log.isDebugEnabled()){var editables=0;var blocks=0;if(this.settings.editables){editables=this.settings.editables.length}if(this.settings.blocks){blocks=this.settings.blocks.length}GENTICS.Aloha.Log.debug(this,"Loaded page with id { "+this.settings.id+" }.");GENTICS.Aloha.Log.debug(this,"Found "+editables+" editables and "+blocks+" blocks.")}var pageMenu=new Array();pageMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.preview"),onclick:function(){that.previewPage()}}));pageMenu.push(new GENTICS.Aloha.ui.Button({label:this.i18n("button.edit"),onclick:function(){that.editPage()}}));pageMenu