engine/public/javascripts/admin/aloha/aloha-nodeps.js

153 lines
157 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
*/
jQuery.fn.between=function(content,offset){if(this[0].nodeType!==3){if(offset>this.children().size()){offset=this.children().size()}if(offset<=0){this.prepend(content)}else{this.children().eq(offset-1).after(content)}}else{if(offset<=0){this.before(content)}else{if(offset>=this[0].length){this.after(content)}else{var fullText=this[0].data;this[0].data=fullText.substring(0,offset);this.after(fullText.substring(offset,fullText.length));this.after(content)}}}};
/*
* 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
*/
if(typeof GENTICS=="undefined"||!GENTICS){var GENTICS={}}if(typeof GENTICS.Utils=="undefined"||!GENTICS){GENTICS.Utils={}}GENTICS.Utils.applyProperties=function(target,properties){var name;for(name in properties){if(properties.hasOwnProperty(name)){target[name]=properties[name]}}};
/*
* 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
*/
if(typeof GENTICS=="undefined"||!GENTICS){var GENTICS={}}if(typeof GENTICS.Utils=="undefined"||!GENTICS){GENTICS.Utils={}}GENTICS.Utils.RangeObject=function(param){this.startContainer;this.startOffset;this.endContainer;this.endOffset;this.startParents=[];this.endParents=[];this.rangeTree=[];if(typeof param==="object"){if(param.startContainer!==undefined){this.startContainer=param.startContainer}if(param.startOffset!==undefined){this.startOffset=param.startOffset}if(param.endContainer!==undefined){this.endContainer=param.endContainer}if(param.endOffset!==undefined){this.endOffset=param.endOffset}}else{if(param===true){this.initializeFromUserSelection()}}};GENTICS.Utils.RangeObject.prototype.log=function(message,obj){if(GENTICS&&GENTICS.Aloha&&GENTICS.Aloha.Log){GENTICS.Aloha.Log.debug(this,message);return false}if(console){console.log(message);if(obj){console.log(obj)}}};GENTICS.Utils.RangeObject.prototype.isCollapsed=function(){return(!this.endContainer||(this.startContainer===this.endContainer&&this.startOffset===this.endOffset))};GENTICS.Utils.RangeObject.prototype.getCommonAncestorContainer=function(){if(this.commonAncestorContainer){return this.commonAncestorContainer}this.updateCommonAncestorContainer();return this.commonAncestorContainer};GENTICS.Utils.RangeObject.prototype.getContainerParents=function(limit,fromEnd){var container=fromEnd?this.endContainer:this.startContainer;var parentStore=fromEnd?this.endParents:this.startParents;if(!container){return false}if(typeof limit=="undefined"){limit=jQuery("body")}if(!parentStore[limit.get(0)]){var parents;if(container.nodeType==3){parents=jQuery(container).parents()}else{parents=jQuery(container).parents();for(var i=parents.length;i>0;--i){parents[i]=parents[i-1]}parents[0]=container}var limitIndex=parents.index(limit);if(limitIndex>=0){parents=parents.slice(0,limitIndex)}parentStore[limit.get(0)]=parents}return parentStore[limit.get(0)]};GENTICS.Utils.RangeObject.prototype.getStartContainerParents=function(limit){return this.getContainerParents(limit,false)};GENTICS.Utils.RangeObject.prototype.getEndContainerParents=function(limit){return this.getContainerParents(limit,true)};GENTICS.Utils.RangeObject.prototype.updateCommonAncestorContainer=function(commonAncestorContainer){var parentsStartContainer=this.getStartContainerParents();var parentsEndContainer=this.getEndContainerParents();if(!commonAncestorContainer){if(!(parentsStartContainer.length>0&&parentsEndContainer.length>0)){GENTICS.Utils.RangeObject.prototype.log("could not find commonAncestorContainer");return false}for(var i=0;i<parentsStartContainer.length;i++){if(parentsEndContainer.index(parentsStartContainer[i])!=-1){this.commonAncestorContainer=parentsStartContainer[i];break}}}else{this.commonAncestorContainer=commonAncestorContainer}GENTICS.Utils.RangeObject.prototype.log(commonAncestorContainer?"commonAncestorContainer was set successfully":"commonAncestorContainer was calculated successfully");return true};GENTICS.Utils.RangeObject.prototype.getCollapsedIERange=function(container,offset){var ieRange=document.body.createTextRange();var left=this.searchElementToLeft(container,offset);if(left.element){var tmpRange=document.body.createTextRange();tmpRange.moveToElementText(left.element);ieRange.setEndPoint("StartToEnd",tmpRange);if(left.characters!=0){ieRange.moveStart("character",left.characters)}else{ieRange.moveStart("character",1);ieRange.moveStart("character",-1)}}else{var right=this.searchElementToRight(container,offset);if(false&&right.element){var tmpRange=document.body.createTextRange();tmpRange.moveToElementText(right.element);ieRange.setEndPoint("StartToStart",tmpRange);if(right.characters!=0){ieRange.moveStart("character",-right.characters)}else{ieRange.moveStart("character",-1);ieRange.moveStart("character",1)}}else{var parent=container.nodeType==3?container.parentNode:container;var tmpRange=document.body.createTextRange();tmpRange.moveToElementText(parent);ieRange.setEndPoint("StartToStart",tmpRange);if(left.characters!=0){ieRange.moveStart("character",left.characters)}}}ieRange.collapse();r
/*
* 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
*/
if(typeof GENTICS=="undefined"||!GENTICS){var GENTICS={}}if(typeof GENTICS.Utils=="undefined"||!GENTICS){GENTICS.Utils={}}GENTICS.Utils.Position={};GENTICS.Utils.Position.w=jQuery(window);GENTICS.Utils.Position.Scroll={top:0,left:0,isScrolling:false};GENTICS.Utils.Position.Mouse={x:0,y:0,oldX:0,oldY:0,isMoving:false,triggeredMouseStop:true};GENTICS.Utils.Position.mouseStopCallbacks=new Array();GENTICS.Utils.Position.mouseMoveCallbacks=new Array();GENTICS.Utils.Position.update=function(){var st=this.w.scrollTop();var sl=this.w.scrollLeft();if(this.Scroll.isScrolling){if(this.Scroll.top==st&&this.Scroll.left==sl){this.Scroll.isScrolling=false}}else{if(this.Scroll.top!=st||this.Scroll.left!=sl){this.Scroll.isScrolling=true}}this.Scroll.top=st;this.Scroll.left=sl;if(this.Mouse.x==this.Mouse.oldX&&this.Mouse.y==this.Mouse.oldY){this.Mouse.isMoving=false;if(!this.Mouse.triggeredMouseStop){this.Mouse.triggeredMouseStop=true;for(var i=0;i<this.mouseStopCallbacks.length;i++){this.mouseStopCallbacks[i].call()}}}else{this.Mouse.isMoving=true;this.Mouse.triggeredMouseStop=false;for(var i=0;i<this.mouseMoveCallbacks.length;i++){this.mouseMoveCallbacks[i].call()}}this.Mouse.oldX=this.Mouse.x;this.Mouse.oldY=this.Mouse.y};GENTICS.Utils.Position.addMouseStopCallback=function(callback){this.mouseStopCallbacks.push(callback);return(this.mouseStopCallbacks.length-1)};GENTICS.Utils.Position.addMouseMoveCallback=function(callback){this.mouseMoveCallbacks.push(callback);return(this.mouseMoveCallbacks.length-1)};setInterval("GENTICS.Utils.Position.update()",500);jQuery("html").mousemove(function(e){GENTICS.Utils.Position.Mouse.x=e.pageX;GENTICS.Utils.Position.Mouse.y=e.pageY});
/*
* 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
*/
if(typeof GENTICS=="undefined"||!GENTICS){var GENTICS={}}if(typeof GENTICS.Utils=="undefined"||!GENTICS.Utils){GENTICS.Utils={}}if(typeof GENTICS.Utils.Dom=="undefined"||!GENTICS.Utils.Dom){GENTICS.Utils.Dom=function(){}}GENTICS.Utils.Dom.prototype.mergeableTags=["a","b","span","code","del","em","i","ins","strong","sub","sup","#text"];GENTICS.Utils.Dom.prototype.nonWordBoundaryTags=["a","b","span","code","del","em","i","ins","span","strong","sub","sup","#text"];GENTICS.Utils.Dom.prototype.nonEmptyTags=["br"];GENTICS.Utils.Dom.prototype.tags={flow:["a","abbr","address","area","article","aside","audio","b","bdo","blockquote","br","button","canvas","cite","code","command","datalist","del","details","dfn","div","dl","em","embed","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","menu","meter","nav","noscript","object","ol","output","p","pre","progress","q","ruby","samp","script","section","select","small","span","strong","style","sub","sup","svg","table","textarea","time","ul","var","video","wbr","#text"],phrasing:["a","abbr","area","audio","b","bdo","br","button","canvas","cite","code","command","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","samp","script","select","small","span","strong","sub","sup","svg","textarea","time","var","video","wbr","#text"]};GENTICS.Utils.Dom.prototype.children={a:"phrasing",b:"phrasing",blockquote:"flow",br:"empty",caption:"flow",cite:"phrasing",code:"phrasing",col:"empty",colgroup:"col",del:"phrasing",div:"flow",h1:"phrasing",h2:"phrasing",h3:"phrasing",h4:"phrasing",h5:"phrasing",h6:"phrasing",hr:"empty",i:"phrasing",img:"empty",ins:"phrasing",li:"flow",ol:"li",p:"phrasing",pre:"phrasing",small:"phrasing",span:"phrasing",strong:"phrasing",sub:"phrasing",sup:"phrasing",table:["caption","colgroup","thead","tbody","tfoot","tr"],tbody:"tr",td:"flow",tfoot:"tr",th:"phrasing",thead:"tr",tr:["th","td"],ul:"li"};GENTICS.Utils.Dom.prototype.blockLevelElements=["p","h1","h2","h3","h4","h5","h6","blockquote","div","pre"];GENTICS.Utils.Dom.prototype.listElements=["li","ol","ul"];GENTICS.Utils.Dom.prototype.split=function(range,limit,atEnd){var splitElement=jQuery(range.startContainer);var splitPosition=range.startOffset;if(atEnd){splitElement=jQuery(range.endContainer);splitPosition=range.endOffset}if(limit.length<1){limit=jQuery(document.body)}var updateRange=(!range.isCollapsed()&&!atEnd);var path;var parents=splitElement.parents().get();parents.unshift(splitElement.get(0));jQuery.each(parents,function(index,element){var isLimit=limit.filter(function(){return this==element}).length;if(isLimit){if(index>0){path=parents.slice(0,index)}return false}});if(!path){return}path=path.reverse();var newDom;var insertElement;for(var i=0;i<path.length;i++){var element=path[i];if(i===path.length-1){var secondPart;if(element.nodeType===3){secondPart=document.createTextNode(element.data.substring(splitPosition,element.data.length));element.data=element.data.substring(0,splitPosition)}else{var newElement=jQuery(element).clone(false).empty();var children=jQuery(element).contents();secondPart=newElement.append(children.slice(splitPosition,children.length)).get(0)}if(updateRange&&range.endContainer===element){range.endContainer=secondPart;range.endOffset-=splitPosition;range.clearCaches()}if(insertElement){insertElement.prepend(secondPart)}else{jQuery(element).after(secondPart)}}else{var newElement=jQuery(element).clone(false).empty();if(!newDom){newDom=newElement;insertElement=newElement}else{insertElement.prepend(newElement);insertElement=newElement}var next;while(next=path[i+1].nextSibling){insertElement.append(next)}if(updateRange&&range.endContainer===element){range.endContainer=newElement.get(0);var prev=path[i+1];var offset=0;while(prev=prev.previousSibling){offset++}range.endOffset-=offset;range.clearCaches()}}}jQuery(path[0]).after(newDom);return jQuery([path[0],newDom?newDom.
/*
* 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
*/
if(typeof GENTICS=="undefined"||!GENTICS){
/*
* The GENTICS global namespace object. If GENTICS is already defined, the
* existing GENTICS object will not be overwritten so that defined
* namespaces are preserved.
*/
var GENTICS={}}GENTICS.Aloha=function(){};GENTICS.Aloha.setAutobase=function(){var scriptTags=document.getElementsByTagName("script");var path=scriptTags[scriptTags.length-1].src.split("?")[0];path=path.split("/");var substitute=1;if("core"===path[path.length-2]){substitute=2}GENTICS.Aloha.prototype.autobase=path.slice(0,substitute*-1).join("/")+"/"};GENTICS.Aloha.setAutobase();GENTICS.Aloha.prototype.version="nightly";GENTICS.Aloha.prototype.editables=new Array();GENTICS.Aloha.prototype.activeEditable=null;GENTICS.Aloha.prototype.ready=false;GENTICS.Aloha.prototype.dictionaries={};GENTICS.Aloha.prototype.settings={};GENTICS.Aloha.prototype.OSName="Unknown";GENTICS.Aloha.prototype.init=function(){var that=this;jQuery("html").mousedown(function(){if(that.activeEditable&&!that.isMessageVisible()){that.activeEditable.blur();that.FloatingMenu.setScope("GENTICS.Aloha.empty");that.activeEditable=null}});if(typeof this.settings.base=="undefined"||!this.settings.base){this.settings.base=GENTICS.Aloha.autobase;if(typeof GENTICS_Aloha_base!="undefined"){this.settings.base=GENTICS_Aloha_base}}this.Log.init();if(!(this.settings.errorhandling==false)){window.onerror=function(msg,url,linenumber){GENTICS.Aloha.Log.error(GENTICS.Aloha,"Error message: "+msg+"\nURL: "+url+"\nLine Number: "+linenumber);return true}}if(navigator.appVersion.indexOf("Win")!=-1){this.OSName="Win"}if(navigator.appVersion.indexOf("Mac")!=-1){this.OSName="Mac"}if(navigator.appVersion.indexOf("X11")!=-1){this.OSName="Unix"}if(navigator.appVersion.indexOf("Linux")!=-1){this.OSName="Linux"}this.initI18n();this.PluginRegistry.init();this.Ribbon.init();this.FloatingMenu.init();Ext.MessageBox.buttonText.yes=GENTICS.Aloha.i18n(this,"yes");Ext.MessageBox.buttonText.no=GENTICS.Aloha.i18n(this,"no");Ext.MessageBox.buttonText.cancel=GENTICS.Aloha.i18n(this,"cancel");this.ready=true;for(var i=0;i<this.editables.length;i++){this.editables[i].init()}};GENTICS.Aloha.prototype.activateEditable=function(editable){for(var i=0;i<this.editables.length;i++){if(this.editables[i]!=editable&&this.editables[i].isActive){var oldActive=this.editables[i];this.editables[i].blur()}}this.activeEditable=editable};GENTICS.Aloha.prototype.getActiveEditable=function(){return this.activeEditable};GENTICS.Aloha.prototype.deactivateEditable=function(){if(typeof this.activeEditable=="undefined"||this.activeEditable==null){return}this.activeEditable.blur();this.FloatingMenu.setScope("GENTICS.Aloha.empty");this.activeEditable=null};GENTICS.Aloha.prototype.log=function(level,component,message){GENTICS.Aloha.Log.log(level,component,message)};GENTICS.Aloha.prototype.identStr=function(object){if(object instanceof jQuery){object=object[0]}if(!(object instanceof HTMLElement)){GENTICS.Aloha.Log.warn(this,"{"+object.toString()+"} provided is not an HTML element");return object.toString()}var out=object.tagName.toLowerCase();if(object.id){return out+"#"+object.id}if(object.className){return out+"."+object.className}return out};GENTICS.Aloha.prototype.trim=function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break}}return str};GENTICS.Aloha.prototype.initI18n=function(){if(typeof this.settings.i18n=="undefined"||!this.settings.i18n){this.settings.i18n={}}if(typeof this.settings.i18n.available=="undefined"||!this.settings.i18n.available||!this.settings.i18n.available instanceof Array){this.settings.i18n.available=["en","de","fr","eo","fi","ru","it"]}if((typeof this.settings.i18n.current=="undefined"||!this.settings.i18n.current)&&typeof this.settings.i18n.acceptLanguage=="string"){var acceptLanguage=[];var preferredLanugage=this.settings.i18n.acceptLanguage.split(",");for(i=0;i<preferredLanugage.length;i++){var lang=preferredLanugage[i].split(";");if(typeof lang[1]=="undefined"||!lang[1]){lang[1]=1}else{lang[1]=parseFloat(lang[1].substring(2,lang[1].length))}acceptLanguage.push(lang)}acceptLanguage.sort(function(a,b){return b[1]-a[1]});for(i=0;i<acceptLanguage.length;i++){if(jQuery.inArray(acceptLanguage[i][0],this.settings.i18n.available)
/*
* 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
*/
if(typeof GENTICS.Aloha.ui=="undefined"){GENTICS.Aloha.ui=function(){}}GENTICS.Aloha.ui.Button=function(properties){this.label;this.iconClass;this.icon;this.onclick;this.menu;this.toggle;this.pressed=false;this.visible=true;this.enabled=true;this.tooltip;this.extButton;GENTICS.Utils.applyProperties(this,properties);this.id=this.generateId()};GENTICS.Aloha.ui.Button.idCounter=0;GENTICS.Aloha.ui.Button.prototype.generateId=function(){GENTICS.Aloha.ui.Button.idCounter=GENTICS.Aloha.ui.Button.idCounter+1;return"GENTICS_Aloha_ui_Button_"+GENTICS.Aloha.ui.Button.idCounter};GENTICS.Aloha.ui.Button.prototype.setPressed=function(pressed){if(this.toggle){this.pressed=pressed;if(typeof this.extButton=="object"&&this.extButton.pressed!=pressed){this.extButton.toggle(this.pressed)}}};GENTICS.Aloha.ui.Button.prototype.isPressed=function(){if(this.toggle){return this.pressed}else{return false}};GENTICS.Aloha.ui.Button.prototype.show=function(){this.visible=true};GENTICS.Aloha.ui.Button.prototype.hide=function(){this.visible=false};GENTICS.Aloha.ui.Button.prototype.isVisible=function(){return this.visible};GENTICS.Aloha.ui.Button.prototype.enable=function(){this.enabled=true;if(typeof this.extButton=="object"){this.extButton.enable()}};GENTICS.Aloha.ui.Button.prototype.disable=function(){this.enabled=false;if(typeof this.extButton=="object"){this.extButton.disable()}};GENTICS.Aloha.ui.Button.prototype.isEnabled=function(){return this.enabled};GENTICS.Aloha.ui.Button.prototype.getExtMenu=function(){if(typeof this.menu==="object"){var menu=new Ext.menu.Menu();for(var i=0;i<this.menu.length;++i){var entry=this.menu[i];menu.addItem(new Ext.menu.Item(entry.getExtMenuConfigProperties()))}}return menu};GENTICS.Aloha.ui.Button.prototype.getExtMenuConfigProperties=function(){var that=this;var submenu=this.getExtMenu();return{text:this.label,icon:this.icon,iconCls:this.iconClass,handler:function(){if(typeof that.onclick=="function"){that.onclick()}},menu:submenu}};GENTICS.Aloha.ui.Button.prototype.getExtConfigProperties=function(){var that=this;var menu=this.getExtMenu();var buttonConfig={text:this.label,enableToggle:this.toggle,pressed:this.pressed,icon:this.icon,iconCls:this.iconClass,scale:this.size,rowspan:(this.size=="large"||this.size=="medium")?2:1,menu:menu,handler:function(element,event){if(typeof that.onclick==="function"){that.onclick.apply(that,[element,event])}that.pressed=!that.pressed},xtype:(menu&&typeof this.onclick=="function")?"splitbutton":"button",tooltipType:"qtip",tooltip:this.tooltip,id:this.id,arrowAlign:this.size=="large"||this.size=="small"?"right":"bottom"};return buttonConfig};Ext.ux.GENTICSMultiSplitButton=Ext.extend(Ext.Component,{autoEl:{cls:"GENTICS_multisplit-wrapper"},ulObj:null,panelButton:null,wrapper:null,panelOpened:false,onRender:function(){Ext.ux.GENTICSMultiSplitButton.superclass.onRender.apply(this,arguments);this.wrapper=jQuery(this.el.dom);var item;var html='<ul class="GENTICS_multisplit">';for(var i=0;i<this.items.length;i++){item=this.items[i];if(item.visible==undefined){item.visible=true}if(item.wide){continue}html+='<li><button xmlns:ext="http://www.extjs.com/" class="'+item.iconClass+'" ext:qtip="'+item.tooltip+'" gtxmultisplititem="'+i+'">&#160;</button></li>'}for(var i=0;i<this.items.length;i++){item=this.items[i];if(!item.wide){continue}html+='<li><button xmlns:ext="http://www.extjs.com/" class="GENTICS_multisplit-wide '+item.iconClass+'" ext:qtip="'+item.tooltip+'" gtxmultisplititem="'+i+'">'+item.text+"</button></li>"}html+="</ul>";var that=this;GENTICS.Aloha.FloatingMenu.extTabPanel.on("move",function(){that.closePanel()});GENTICS.Aloha.FloatingMenu.extTabPanel.on("tabchange",function(){that.closePanel()});this.ulObj=jQuery(this.el.createChild(html).dom);this.ulObj.click(function(event){that.onClick(event)});this.panelButton=jQuery(this.el.createChild('<button class="GENTICS_multisplit_toggle GENTICS_multisplit_toggle_open">&#160;</button>').dom);this.panelButton.click(function(){that.togglePanel()})},onClick:function(event){if(!event.target.attributes.gtxmultisplititem){return}var el=jQuer
/*
* 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.Editable=function(obj){this.obj=obj;this.ready=false;GENTICS.Aloha.registerEditable(this);this.init()};GENTICS.Aloha.Editable.prototype.isActive=false;GENTICS.Aloha.Editable.prototype.originalContent=null;GENTICS.Aloha.Editable.prototype.range=undefined;GENTICS.Aloha.Editable.prototype.init=function(){var that=this;if(GENTICS.Aloha.ready){this.obj.addClass("GENTICS_editable");this.obj.attr("contenteditable",true);this.obj.mousedown(function(e){that.activate(e);e.stopPropagation()});this.obj.focus(function(e){that.activate(e)});this.obj.keydown(function(event){return GENTICS.Aloha.Markup.preProcessKeyStrokes(event)});this.obj.keyup(function(event){if(event.keyCode==27){GENTICS.Aloha.deactivateEditable();return false}});this.obj.GENTICS_contentEditableSelectionChange(function(event){GENTICS.Aloha.Selection.onChange(that.obj,event);return that.obj});GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableCreated",GENTICS.Aloha,[this]));this.setUnmodified();this.ready=true}};GENTICS.Aloha.Editable.prototype.destroy=function(){var that=this;this.blur();this.ready=false;this.obj.removeClass("GENTICS_editable");this.obj.removeAttr("contenteditable");this.obj.unbind("mousedown");this.obj.unbind("focus");this.obj.unbind("keydown");this.obj.unbind("keyup");GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableDestroyed",GENTICS.Aloha,[this]));GENTICS.Aloha.unregisterEditable(this)};GENTICS.Aloha.Editable.prototype.setUnmodified=function(){this.originalContent=this.getContents()};GENTICS.Aloha.Editable.prototype.isModified=function(){if(this.originalContent!=this.getContents()){return true}else{return false}};GENTICS.Aloha.Editable.prototype.toString=function(){return"GENTICS.Aloha.Editable"};GENTICS.Aloha.Editable.prototype.activate=function(e){if(this.isActive){return}var oldActive=GENTICS.Aloha.getActiveEditable();GENTICS.Aloha.activateEditable(this);if(document.selection&&document.selection.createRange){this.obj.mouseup()}this.isActive=true;GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableActivated",GENTICS.Aloha,{oldActive:oldActive,editable:this}));GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableActivated",this,{oldActive:GENTICS.Aloha.getActiveEditable()}))};GENTICS.Aloha.Editable.prototype.blur=function(){this.obj.blur();this.isActive=false;GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableDeactivated",GENTICS.Aloha,{editable:this}));GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("editableDeactivated",this))};GENTICS.Aloha.Editable.prototype.empty=function(str){if(null===str){return true}return(GENTICS.Aloha.trim(str)==""||str=="<br>")};GENTICS.Aloha.Editable.prototype.getContents=function(){var clonedObj=this.obj.clone(true);GENTICS.Aloha.PluginRegistry.makeClean(clonedObj);return clonedObj.html()};GENTICS.Aloha.Editable.prototype.getId=function(){return this.obj.attr("id")};
/*
* 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.Ribbon=function(){var that=this;this.toolbar=new Ext.Toolbar({height:30,cls:"GENTICS_ribbon ext-root"});this.toolbar.add(new Ext.Toolbar.Spacer({width:"5"}));this.icon=new Ext.Toolbar.Spacer();this.toolbar.add(this.icon);this.toolbar.add(new Ext.Toolbar.Fill());this.toolbar.add(new Ext.Toolbar.Separator());var fadeButton=new Ext.Button({iconCls:"GENTICS_fade_out",handler:function(button){var toolbar=jQuery(that.toolbar.getEl().dom);if(button.iconCls=="GENTICS_fade_out"){toolbar.css("marginLeft","34px");toolbar.animate({left:"-100%"});jQuery("body").animate({paddingTop:0});button.setIconClass("GENTICS_fade_in")}else{toolbar.css("marginLeft","0px");toolbar.animate({left:"0%"});jQuery("body").animate({paddingTop:30});button.setIconClass("GENTICS_fade_out")}that.toolbar.doLayout()}});this.toolbar.add(fadeButton);this.toolbar.add(new Ext.Toolbar.Spacer({width:"5"}))};GENTICS.Aloha.Ribbon.prototype.setIcon=function(iconClass){if(typeof this.icon.cls!="undefined"){this.icon.removeClass(this.icon.cls)}this.icon.addClass(iconClass)};GENTICS.Aloha.Ribbon.prototype.addButton=function(button){if(typeof button.menu==="object"){var menu=new Ext.menu.Menu();jQuery.each(button.menu,function(index,entry){menu.addItem(new Ext.menu.Item({text:entry.label,icon:entry.icon,iconCls:entry.iconClass,handler:function(){entry.onclick.apply(entry)}}))})}var buttonConfig={text:button.label,enableToggle:button.toggle,icon:button.icon,pressed:button.pressed,iconCls:button.iconClass,menu:menu,handler:function(){if(typeof button.onclick==="function"){button.onclick.apply(button)}button.pressed=!button.pressed}};var extButton;if(menu&&typeof button.onclick=="function"){extButton=new Ext.SplitButton(buttonConfig)}else{extButton=new Ext.Button(buttonConfig)}this.toolbar.insert(this.toolbar.items.getCount()-3,extButton)};GENTICS.Aloha.Ribbon.prototype.addSeparator=function(){this.toolbar.insert(this.toolbar.items.getCount()-3,new Ext.Toolbar.Separator())};GENTICS.Aloha.Ribbon.prototype.init=function(){this.toolbar.render(document.body,0);if(GENTICS.Aloha.settings.ribbon!==false){jQuery("body").css("paddingTop","30px !important");this.show()}};GENTICS.Aloha.Ribbon.prototype.hide=function(){jQuery(".GENTICS_ribbon").fadeOut()};GENTICS.Aloha.Ribbon.prototype.show=function(){jQuery(".GENTICS_ribbon").fadeIn()};GENTICS.Aloha.Ribbon=new GENTICS.Aloha.Ribbon();
/*
* 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.Event=function(eventName,eventSource,properties){this.name=eventName;if(eventSource){this.source=eventSource}else{this.source=GENTICS.Aloha}this.properties=properties};GENTICS.Aloha.EventRegistry=function(){};GENTICS.Aloha.EventRegistry.prototype.subscribe=function(eventSource,eventName,handleMethod){jQuery(eventSource).bind(eventName,handleMethod)};GENTICS.Aloha.EventRegistry.prototype.trigger=function(event){jQuery(event.source).trigger(event.name,event.properties)};GENTICS.Aloha.EventRegistry=new GENTICS.Aloha.EventRegistry();
/*
* 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.FloatingMenu={};GENTICS.Aloha.FloatingMenu.scopes={"GENTICS.Aloha.empty":{name:"GENTICS.Aloha.empty",extendedScopes:[],buttons:[]},"GENTICS.Aloha.global":{name:"GENTICS.Aloha.global",extendedScopes:["GENTICS.Aloha.empty"],buttons:[]},"GENTICS.Aloha.continuoustext":{name:"GENTICS.Aloha.continuoustext",extendedScopes:["GENTICS.Aloha.global"],buttons:[]}};GENTICS.Aloha.FloatingMenu.tabs=new Array();GENTICS.Aloha.FloatingMenu.tabMap={};GENTICS.Aloha.FloatingMenu.initialized=false;GENTICS.Aloha.FloatingMenu.allButtons=new Array();GENTICS.Aloha.FloatingMenu.top=100;GENTICS.Aloha.FloatingMenu.left=100;GENTICS.Aloha.FloatingMenu.pinned=false;GENTICS.Aloha.FloatingMenu.init=function(){this.currentScope="GENTICS.Aloha.global";var that=this;jQuery(window).unload(function(){if(that.pinned){jQuery.cookie("GENTICS.Aloha.FloatingMenu.pinned","true");jQuery.cookie("GENTICS.Aloha.FloatingMenu.top",that.obj.offset().top);jQuery.cookie("GENTICS.Aloha.FloatingMenu.left",that.obj.offset().left);if(GENTICS.Aloha.Log.isInfoEnabled()){GENTICS.Aloha.Log.info(this,"stored FloatingMenu pinned position {"+that.obj.offset().left+", "+that.obj.offset().top+"}")}}else{jQuery.cookie("GENTICS.Aloha.FloatingMenu.pinned",null);jQuery.cookie("GENTICS.Aloha.FloatingMenu.top",null);jQuery.cookie("GENTICS.Aloha.FloatingMenu.left",null)}if(that.userActivatedTab){jQuery.cookie("GENTICS.Aloha.FloatingMenu.activeTab",that.userActivatedTab)}}).resize(function(){var target=that.calcFloatTarget(GENTICS.Aloha.Selection.getRangeObject());if(target){that.floatTo(target)}});this.generateComponent();this.initialized=true};GENTICS.Aloha.FloatingMenu.obj=null;GENTICS.Aloha.FloatingMenu.shadow=null;GENTICS.Aloha.FloatingMenu.panelBody=null;GENTICS.Aloha.FloatingMenu.generateComponent=function(){var that=this;Ext.QuickTips.init();Ext.apply(Ext.QuickTips.getQuickTip(),{minWidth:10});if(this.extTabPanel){}this.extTabPanel=new Ext.TabPanel({activeTab:0,width:400,plain:false,draggable:{insertProxy:false,onDrag:function(e){var pel=this.proxy.getEl();this.x=pel.getLeft(true);this.y=pel.getTop(true);GENTICS.Aloha.FloatingMenu.shadow.hide()},endDrag:function(e){if(GENTICS.Aloha.FloatingMenu.pinned){var top=this.y-jQuery(document).scrollTop()}else{var top=this.y}that.left=this.x;that.top=top;this.panel.setPosition(this.x,top);GENTICS.Aloha.FloatingMenu.refreshShadow();GENTICS.Aloha.FloatingMenu.shadow.show()}},floating:true,defaults:{autoScroll:true},layoutOnTabChange:true,shadow:false,cls:"GENTICS_floatingmenu ext-root",listeners:{tabchange:{fn:function(tabPanel,tab){if(tab.title!=that.autoActivatedTab){if(GENTICS.Aloha.Log.isDebugEnabled()){GENTICS.Aloha.Log.debug(that,"User selected tab "+tab.title)}that.userActivatedTab=tab.title}else{if(GENTICS.Aloha.Log.isDebugEnabled()){GENTICS.Aloha.Log.debug(that,"Tab "+tab.title+" was activated automatically")}}that.autoActivatedTab=undefined;jQuery.each(that.allButtons,function(index,buttonInfo){if(typeof buttonInfo.button!="undefined"&&typeof buttonInfo.button.extButton!="undefined"&&typeof buttonInfo.button.extButton.setActiveDOMElement=="function"){if(typeof buttonInfo.button.extButton.activeDOMElement!="undefined"){buttonInfo.button.extButton.setActiveDOMElement(buttonInfo.button.extButton.activeDOMElement)}}});GENTICS.Aloha.FloatingMenu.shadow.show();GENTICS.Aloha.FloatingMenu.refreshShadow()}}},enableTabScroll:true});jQuery.each(this.tabs,function(index,tab){that.extTabPanel.add(tab.getExtComponent())});jQuery("body").append('<div id="GENTICS_floatingmenu_shadow" class="GENTICS_shadow">&#160;</div>');this.shadow=jQuery("#GENTICS_floatingmenu_shadow");var pinTab=this.extTabPanel.add({title:"&#160;"});this.extTabPanel.render(document.body);jQuery(pinTab.tabEl).addClass("GENTICS_floatingmenu_pin").html("&#160;").mousedown(function(e){that.togglePin();e.stopPropagation()});this.panelBody=jQuery(".GENTICS_floatingmenu .x-tab-panel-bwrap");this.doLayout();this.obj=jQuery(this.extTabPanel.getEl().dom);if(jQuery.cookie("GENTICS.Aloha.FloatingMenu.pinned")=="true"){this.togglePin();this.top=parseInt(jQuery.cookie("GENTICS.Aloha
/*
* 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
*/
}jQuery.fn.aloha=function(){return this.each(function(){new GENTICS.Aloha.Editable(jQuery(this))})};jQuery.fn.GENTICS_aloha=function(){return this.each(function(){new GENTICS.Aloha.Editable(jQuery(this))})};jQuery.fn.mahalo=function(){return this.each(function(){if(jQuery(this).hasClass("GENTICS_editable")){for(var i=0;i<GENTICS.Aloha.editables.length;i++){if(GENTICS.Aloha.editables[i].obj.get(0)===this){GENTICS.Aloha.editables[i].destroy()}}}})};jQuery.fn.GENTICS_mahalo=function(){return this.each(function(){var that=this})};jQuery.fn.GENTICS_contentEditableSelectionChange=function(callback){var that=this;this.keyup(function(event){var rangeObject=GENTICS.Aloha.Selection.getRangeObject();callback(event)});this.dblclick(function(event){callback(event)});this.mousedown(function(event){that.selectionStarted=true});jQuery(document).mouseup(function(event){GENTICS.Aloha.Selection.eventOriginalTarget=that;if(that.selectionStarted){callback(event)}GENTICS.Aloha.Selection.eventOriginalTarget=false;that.selectionStarted=false});return this};jQuery.fn.outerHTML=function(s){if(s){return this.before(s).remove()}else{return jQuery("<p>").append(this.eq(0).clone()).html()}};
/*
* 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.Log=function(){};GENTICS.Aloha.Log.prototype.logHistory=null;GENTICS.Aloha.Log.prototype.highWaterMarkReached=false;GENTICS.Aloha.Log.prototype.init=function(){if(typeof GENTICS.Aloha.settings.logLevels=="undefined"||!GENTICS.Aloha.settings.logLevels){GENTICS.Aloha.settings.logLevels={error:true,warn:true}}if(typeof GENTICS.Aloha.settings.logHistory=="undefined"||!GENTICS.Aloha.settings.logHistory){GENTICS.Aloha.settings.logHistory={}}if(!GENTICS.Aloha.settings.logHistory.maxEntries){GENTICS.Aloha.settings.logHistory.maxEntries=100}if(!GENTICS.Aloha.settings.logHistory.highWaterMark){GENTICS.Aloha.settings.logHistory.highWaterMark=90}if(!GENTICS.Aloha.settings.logHistory.levels){GENTICS.Aloha.settings.logHistory.levels={error:true,warn:true}}this.flushLogHistory()};GENTICS.Aloha.Log.prototype.log=function(level,component,message){if(typeof level=="undefined"||!level){level="error"}level=level.toLowerCase();if(!GENTICS.Aloha.settings.logLevels[level]){return}this.addToLogHistory({level:level,component:component.toString(),message:message,date:new Date()});switch(level){case"error":if(window.console&&console.error){console.error(component.toString()+": "+message)}break;case"warn":if(window.console&&console.warn){console.warn(component.toString()+": "+message)}break;case"info":if(window.console&&console.info){console.info(component.toString()+": "+message)}break;case"debug":if(window.console&&console.log){console.log(component.toString()+" ["+level+"]: "+message)}break;default:if(window.console&&console.log){console.log(component.toString()+" ["+level+"]: "+message)}break}};GENTICS.Aloha.Log.prototype.error=function(component,message){this.log("error",component,message)};GENTICS.Aloha.Log.prototype.warn=function(component,message){this.log("warn",component,message)};GENTICS.Aloha.Log.prototype.info=function(component,message){this.log("info",component,message)};GENTICS.Aloha.Log.prototype.debug=function(component,message){this.log("debug",component,message)};GENTICS.Aloha.Log.prototype.isLogLevelEnabled=function(level){return GENTICS.Aloha.settings&&GENTICS.Aloha.settings.logLevels&&(GENTICS.Aloha.settings.logLevels[level]==true)};GENTICS.Aloha.Log.prototype.isErrorEnabled=function(){return this.isLogLevelEnabled("error")};GENTICS.Aloha.Log.prototype.isWarnEnabled=function(){return this.isLogLevelEnabled("warn")};GENTICS.Aloha.Log.prototype.isInfoEnabled=function(){return this.isLogLevelEnabled("info")};GENTICS.Aloha.Log.prototype.isDebugEnabled=function(){return this.isLogLevelEnabled("debug")};GENTICS.Aloha.Log.prototype.addToLogHistory=function(entry){if(GENTICS.Aloha.settings.logHistory.maxEntries<=0){return}if(!GENTICS.Aloha.settings.logHistory.levels[entry.level]){return}this.logHistory.push(entry);if(this.highWaterMarkReached==false){if(this.logHistory.length>=GENTICS.Aloha.settings.logHistory.maxEntries*GENTICS.Aloha.settings.logHistory.highWaterMark/100){GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("logFull",GENTICS.Aloha.Log));this.highWaterMarkReached=true}}while(this.logHistory.length>GENTICS.Aloha.settings.logHistory.maxEntries){this.logHistory.shift()}};GENTICS.Aloha.Log.prototype.getLogHistory=function(){return this.logHistory};GENTICS.Aloha.Log.prototype.flushLogHistory=function(){this.logHistory=new Array();this.highWaterMarkReached=false};GENTICS.Aloha.Log=new GENTICS.Aloha.Log();
/*
* 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.Markup=function(){};GENTICS.Aloha.Markup.prototype.keyHandlers={};GENTICS.Aloha.Markup.prototype.addKeyHandler=function(keyCode,handler){if(!this.keyHandlers[keyCode]){this.keyHandlers[keyCode]=[]}this.keyHandlers[keyCode].push(handler)};GENTICS.Aloha.Markup.prototype.insertBreak=function(){var range=GENTICS.Aloha.Selection.rangeObject;if(!range.isCollapsed()){this.removeSelectedMarkup()}var newBreak=jQuery("<br/>");GENTICS.Utils.Dom.insertIntoDOM(newBreak,range,GENTICS.Aloha.activeEditable.obj);var nextTextNode=GENTICS.Utils.Dom.searchAdjacentTextNode(newBreak.parent().get(0),GENTICS.Utils.Dom.getIndexInParent(newBreak.get(0))+1,false);if(nextTextNode){var nonWSIndex=nextTextNode.data.search(/\S/);if(nonWSIndex>0){nextTextNode.data=nextTextNode.data.substring(nonWSIndex)}}range.startContainer=range.endContainer=newBreak.get(0).parentNode;range.startOffset=range.endOffset=GENTICS.Utils.Dom.getIndexInParent(newBreak.get(0))+1;range.correctRange();range.clearCaches();range.select()};GENTICS.Aloha.Markup.prototype.preProcessKeyStrokes=function(event){if(event.type!="keydown"){return false}var rangeObject=GENTICS.Aloha.Selection.rangeObject;if(this.keyHandlers[event.keyCode]){var handlers=this.keyHandlers[event.keyCode];for(var i=0;i<handlers.length;++i){if(!handlers[i](event)){return false}}}switch(event.keyCode){case 13:if(event.shiftKey){GENTICS.Aloha.Log.debug(this,"... got a smoking Shift+Enter, Cowboy");if(!rangeObject.isCollapsed()){this.removeSelectedMarkup()}GENTICS.Aloha.Selection.updateSelection(false,true);this.processShiftEnter(rangeObject);return false}else{GENTICS.Aloha.Log.debug(this,"... got a lonely Enter, Mum");if(!rangeObject.isCollapsed()){this.removeSelectedMarkup()}GENTICS.Aloha.Selection.updateSelection(false,true);this.processEnter(rangeObject);return false}break}return true};GENTICS.Aloha.Markup.prototype.processShiftEnter=function(rangeObject){this.insertHTMLBreak(rangeObject.getSelectionTree(),rangeObject)};GENTICS.Aloha.Markup.prototype.processEnter=function(rangeObject){if(rangeObject.splitObject){if(jQuery.browser.msie&&GENTICS.Utils.Dom.isListElement(rangeObject.splitObject)){jQuery(rangeObject.splitObject).append(jQuery(document.createTextNode("")))}this.splitRangeObject(rangeObject)}else{this.insertHTMLBreak(rangeObject.getSelectionTree(),rangeObject)}};GENTICS.Aloha.Markup.prototype.insertHTMLCode=function(html){var rangeObject=GENTICS.Aloha.Selection.rangeObject;this.insertHTMLBreak(rangeObject.getSelectionTree(),rangeObject,jQuery(html))};GENTICS.Aloha.Markup.prototype.insertHTMLBreak=function(selectionTree,rangeObject,inBetweenMarkup){inBetweenMarkup=inBetweenMarkup?inBetweenMarkup:jQuery("<br />");for(var i=0;i<selectionTree.length;i++){var el=selectionTree[i];var jqEl=el.domobj?jQuery(el.domobj):undefined;if(el.selection!=="none"){if(el.selection=="collapsed"){if(i>0){var jqElBefore=jQuery(selectionTree[i-1].domobj);jqElBefore.after(inBetweenMarkup)}else{var jqElAfter=jQuery(selectionTree[1].domobj);jqElAfter.before(inBetweenMarkup)}rangeObject.startContainer=rangeObject.endContainer=inBetweenMarkup[0].parentNode;rangeObject.startOffset=rangeObject.endOffset=GENTICS.Utils.Dom.getIndexInParent(inBetweenMarkup[0])+1;rangeObject.correctRange()}else{if(el.domobj&&el.domobj.nodeType===3){if(el.domobj.nextSibling&&el.domobj.nextSibling.nodeType==1&&GENTICS.Aloha.Selection.replacingElements[el.domobj.nextSibling.nodeName.toLowerCase()]){jqEl.after("<br/>")}var checkObj=el.domobj;while(checkObj){if(checkObj.nextSibling){checkObj=false}else{checkObj=checkObj.parentNode;if(checkObj===rangeObject.limitObject){checkObj=false}if(GENTICS.Utils.Dom.isBlockLevelElement(checkObj)){break}}}if(checkObj){jQuery(checkObj).append("<br/>")}jqEl.between(inBetweenMarkup,el.startOffset);var offset=0;var tmpObject=inBetweenMarkup[0];while(tmpObject){tmpObject=tmpObject.previousSibling;offset++}rangeObject.startContainer=inBetweenMarkup[0].parentNode;rangeObject.endContainer=inBetweenMarkup[0].parentNode;rangeObject.startOffset=offset;rangeObject.endOffset=offset;rangeObject.correctRange()}else{if(
/*
* 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.Message=function(data){this.title=data.title;this.text=data.text;this.type=data.type;this.callback=data.callback};GENTICS.Aloha.Message.Type={CONFIRM:"confirm",ALERT:"alert",WAIT:"wait"};GENTICS.Aloha.Message.prototype.toString=function(){return this.type+": "+this.message};GENTICS.Aloha.MessageLine=function(){this.messages=new Array()};GENTICS.Aloha.MessageLine.prototype.add=function(message){this.messages[this.messages.length]=message;while(this.messages.length>4){this.messages.shift()}jQuery("#gtx_aloha_messageline").html("");for(var i=0;i<this.messages.length;i++){jQuery("#gtx_aloha_messageline").append((this.messages[i].toString()+"<br/>"))}};GENTICS.Aloha.MessageLine=new GENTICS.Aloha.MessageLine();
/*
* 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.PluginRegistry=function(){this.plugins=new Array()};GENTICS.Aloha.PluginRegistry.prototype.register=function(plugin){if(plugin instanceof GENTICS.Aloha.Plugin){this.plugins.push(plugin)}};GENTICS.Aloha.PluginRegistry.prototype.init=function(){for(var i=0;i<this.plugins.length;i++){var plugin=this.plugins[i];if(GENTICS.Aloha.settings.plugins==undefined){GENTICS.Aloha.settings.plugins={}}plugin.settings=GENTICS.Aloha.settings.plugins[plugin.prefix];if(plugin.settings==undefined){plugin.settings={}}if(plugin.settings.enabled==undefined){plugin.settings.enabled=true}var actualLanguage=plugin.languages?GENTICS.Aloha.getLanguage(GENTICS.Aloha.settings.i18n.current,plugin.languages):null;if(!actualLanguage){GENTICS.Aloha.Log.warn(this,"Could not determine actual language, no languages available for plugin "+plugin)}else{var fileUrl=GENTICS.Aloha.settings.base+"plugins/"+plugin.basePath+"/i18n/"+actualLanguage+".dict";GENTICS.Aloha.loadI18nFile(fileUrl,plugin)}if(plugin.settings.enabled==true){this.plugins[i].init()}}};GENTICS.Aloha.PluginRegistry.prototype.makeClean=function(obj){for(var i=0;i<this.plugins.length;i++){var plugin=this.plugins[i];if(GENTICS.Aloha.Log.isDebugEnabled()){GENTICS.Aloha.Log.debug(this,"Passing contents of HTML Element with id { "+obj.attr("id")+" } for cleaning to plugin { "+plugin.prefix+" }")}plugin.makeClean(obj)}};GENTICS.Aloha.PluginRegistry=new GENTICS.Aloha.PluginRegistry();GENTICS.Aloha.PluginRegistry.toString=function(){return"com.gentics.aloha.PluginRegistry"};GENTICS.Aloha.Plugin=function(pluginPrefix,basePath){this.prefix=pluginPrefix;this.basePath=basePath?basePath:pluginPrefix;GENTICS.Aloha.PluginRegistry.register(this)};GENTICS.Aloha.Plugin.prototype.settings=null;GENTICS.Aloha.Plugin.prototype.init=function(){};GENTICS.Aloha.Plugin.prototype.getEditableConfig=function(obj){var config=[];var configSpecified=false;if(this.settings.editables){jQuery.each(this.settings.editables,function(selector,selectorConfig){if(obj.is(selector)){configSpecified=true;config=jQuery.merge(config,selectorConfig)}})}if(!configSpecified){if(this.settings.config=="undefined"||!this.settings.config){config=this.config}else{config=this.settings.config}}return config};GENTICS.Aloha.Plugin.prototype.makeClean=function(obj){};GENTICS.Aloha.Plugin.prototype.getUID=function(id){return this.prefix+"."+id};GENTICS.Aloha.Plugin.prototype.i18n=function(key,replacements){return GENTICS.Aloha.i18n(this,key,replacements)};GENTICS.Aloha.Plugin.prototype.toString=function(){return this.prefix};GENTICS.Aloha.Plugin.prototype.log=function(level,message){GENTICS.Aloha.Log.log(level,this,message)};
/*
* 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
*/
jQuery.fn.zap=function(){return this.each(function(){jQuery(this.childNodes).insertBefore(this)}).remove()};jQuery.fn.textNodes=function(excludeBreaks,includeEmptyTextNodes){var ret=[];(function(el){if((el.nodeType==3&&jQuery.trim(el.data)!=""&&!includeEmptyTextNodes)||(el.nodeType==3&&includeEmptyTextNodes)||(el.nodeName=="BR"&&!excludeBreaks)){ret.push(el)}else{for(var i=0;i<el.childNodes.length;++i){arguments.callee(el.childNodes[i])}}})(this[0]);return jQuery(ret)};GENTICS.Aloha.Selection=function(){this.rangeObject=new Object();this.tagHierarchy={textNode:[],abbr:["textNode"],b:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u","cite","q","code","abbr","strong"],pre:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u","cite","q","code","abbr","code"],blockquote:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u","cite","q","code","abbr","p","h1","h2","h3","h4","h5","h6"],ins:["textNode","b","i","em","sup","sub","br","span","img","a","u","p","h1","h2","h3","h4","h5","h6"],ul:["li"],ol:["li"],li:["textNode","b","i","em","sup","sub","br","span","img","ul","ol","h1","h2","h3","h4","h5","h6","del","ins","u"],tr:["td","th"],table:["tr"],div:["textNode","b","i","em","sup","sub","br","span","img","ul","ol","table","h1","h2","h3","h4","h5","h6","del","ins","u","p","div","pre","blockquote"],h1:["textNode","b","i","em","sup","sub","br","span","img","a","del","ins","u"]};this.tagHierarchy={textNode:this.tagHierarchy.textNode,abbr:this.tagHierarchy.abbr,br:this.tagHierarchy.textNode,img:this.tagHierarchy.textNode,b:this.tagHierarchy.b,strong:this.tagHierarchy.b,code:this.tagHierarchy.b,q:this.tagHierarchy.b,blockquote:this.tagHierarchy.blockquote,cite:this.tagHierarchy.b,i:this.tagHierarchy.b,em:this.tagHierarchy.b,sup:this.tagHierarchy.b,sub:this.tagHierarchy.b,span:this.tagHierarchy.b,del:this.tagHierarchy.del,ins:this.tagHierarchy.ins,u:this.tagHierarchy.b,p:this.tagHierarchy.b,pre:this.tagHierarchy.pre,a:this.tagHierarchy.b,ul:this.tagHierarchy.ul,ol:this.tagHierarchy.ol,li:this.tagHierarchy.li,td:this.tagHierarchy.li,div:this.tagHierarchy.div,h1:this.tagHierarchy.h1,h2:this.tagHierarchy.h1,h3:this.tagHierarchy.h1,h4:this.tagHierarchy.h1,h5:this.tagHierarchy.h1,h6:this.tagHierarchy.h1,table:this.tagHierarchy.table};this.replacingElements={h1:["p","h1","h2","h3","h4","h5","h6","pre"],blockquote:["blockquote"]};this.replacingElements={h1:this.replacingElements.h1,h2:this.replacingElements.h1,h3:this.replacingElements.h1,h4:this.replacingElements.h1,h5:this.replacingElements.h1,h6:this.replacingElements.h1,pre:this.replacingElements.h1,p:this.replacingElements.h1,blockquote:this.replacingElements.blockquote};this.allowedToStealElements={h1:["textNode"]};this.allowedToStealElements={h1:this.allowedToStealElements.h1,h2:this.allowedToStealElements.h1,h3:this.allowedToStealElements.h1,h4:this.allowedToStealElements.h1,h5:this.allowedToStealElements.h1,h6:this.allowedToStealElements.h1,p:this.tagHierarchy.b}};GENTICS.Aloha.Selection.prototype.SelectionTree=function(){this.domobj=new Object();this.selection;this.children=new Array()};GENTICS.Aloha.Selection.prototype.onChange=function(objectClicked,event){if(this.updateSelectionTimeout){window.clearTimeout(this.updateSelectionTimeout);this.updateSelectionTimeout=undefined}this.updateSelectionTimeout=window.setTimeout(function(){GENTICS.Aloha.Selection.updateSelection(event)},5)};GENTICS.Aloha.Selection.prototype.updateSelection=function(event){var rangeObject=this.rangeObject=new GENTICS.Aloha.Selection.SelectionRange(true);rangeObject.update();GENTICS.Aloha.FloatingMenu.setScope("GENTICS.Aloha.continuoustext");GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("selectionChanged",GENTICS.Aloha,[rangeObject,event]));return true};GENTICS.Aloha.Selection.prototype.getSelectionTree=function(rangeObject){if(!rangeObject){return this.rangeObject.getSelectionTree()}if(!rangeObject.commonAncestorContainer){GENTICS.Aloha.Log.error(this,"the rangeObject is missing the commonAncestorContainer");return false}this.ins
/*
* 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.Sidebar=function(){};GENTICS.Aloha.Sidebar.prototype.add=function(panel){};GENTICS.Aloha.Sidebar.prototype.render=function(){};GENTICS.Aloha.Sidebar.prototype.openPanel=function(panel){};GENTICS.Aloha.Sidebar.prototype.closePanel=function(panel){};GENTICS.Aloha.Sidebar.prototype.togglePinPanel=function(panel){};GENTICS.Aloha.SidebarRight=new GENTICS.Aloha.Sidebar();GENTICS.Aloha.SidebarLeft=new GENTICS.Aloha.Sidebar();GENTICS.Aloha.Sidebar.Panel=function(){};GENTICS.Aloha.Sidebar.Panel.prototype.render=function(){};(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options)})},result:function(handler){return this.bind("result",handler)},search:function(handler){return this.trigger("search",[handler])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(options){return this.trigger("setOptions",[options])},unautocomplete:function(){return this.trigger("unautocomplete")}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev()}else{onChange(0,true)}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next()}else{onChange(0,true)}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp()}else{onChange(0,true)}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown()}else{onChange(0,true)}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break}}).focus(function(){hasFocus++}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults()}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true)}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break}}}if(typeof fn=="function"){fn(result)}else{$input.trigger("result",result&&[result.data,result.value])}}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback)})}).bind("flushCache",function(){cache.flush()}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data" in arguments[1]){cache.populate()}}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete")});function selectCurrent(){var selected=select.selected();if(!selected){return false}var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false}progress+=seperator});words[wordAt]=v;v=words.
/*
* 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.RessourceRegistry=function(){this.ressources=new Array()};GENTICS.Aloha.RessourceRegistry.prototype.register=function(ressource){if(ressource instanceof GENTICS.Aloha.Ressource){this.ressources.push(ressource)}};GENTICS.Aloha.RessourceRegistry.prototype.init=function(){for(var i=0;i<this.ressources.length;i++){var ressource=this.ressources[i];if(GENTICS.Aloha.settings.ressources==undefined){GENTICS.Aloha.settings.ressources={}}ressource.settings=GENTICS.Aloha.settings.ressources[ressource.prefix];if(ressource.settings==undefined){ressource.settings={}}if(ressource.settings.enabled==undefined){ressource.settings.enabled=true}if(ressource.settings.enabled==true){this.ressources[i].init()}}};GENTICS.Aloha.RessourceRegistry.toString=function(){return"com.gentics.aloha.RessourceRegistry"};GENTICS.Aloha.RessourceRegistry=new GENTICS.Aloha.RessourceRegistry();GENTICS.Aloha.Ressources={};
/*
* 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.Ressource=function(ressourcePrefix,basePath){this.prefix=ressourcePrefix;this.basePath=basePath?basePath:ressourcePrefix;GENTICS.Aloha.RessourceRegistry.register(this)};GENTICS.Aloha.Ressource.prototype.settings=null;GENTICS.Aloha.Ressource.prototype.init=function(){};GENTICS.Aloha.Ressource.prototype.query=function(attrs){return null};GENTICS.Aloha.Ressource.prototype.resolveRessource=function(obj){return null};
/*
* 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.Ressources.Dummy=new GENTICS.Aloha.Ressource("com.gentics.aloha.resources.Dummy");GENTICS.Aloha.Ressources.Dummy.init=function(){var data=[{id:1,text:"Link A",url:"/page1"},{id:2,text:"Link B",url:"/page2"},{id:3,text:"Link C",url:"/page3"},{id:4,text:"Link D",url:"/page4"}]};GENTICS.Aloha.Ressources.Dummy.query=function(attrs){return this.data};GENTICS.Aloha.Ressources.Dummy.resolve=function(obj){return null};