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

334 lines
988 KiB
JavaScript
Raw Normal View History

/*
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu Nov 11 19:04:53 2010 -0500
*/
(function(window,undefined){var document=window.document;var jQuery=(function(){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},_jQuery=window.jQuery,_$=window.$,rootjQuery,quickExpr=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rwhite=/\s/,trimLeft=/^\s+/,trimRight=/\s+$/,rnonword=/\W/,rdigit=/\d/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,rvalidchars=/^[\],:{}\s]*$/,rvalidescape=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rvalidtokens=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rwebkit=/(webkit)[ \/]([\w.]+)/,ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/,rmsie=/(msie) ([\w.]+)/,rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwn=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,trim=String.prototype.trim,indexOf=Array.prototype.indexOf,class2type={};jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}if(selector==="body"&&!context&&document.body){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true)}else{selector=[doc.createElement(ret[1])]}}else{ret=jQuery.buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes}return jQuery.merge(this,selector)}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootjQuery.find(selector)}this.length=1;this[0]=elem}this.context=document;this.selector=selector;return this}}else{if(!context&&!rnonword.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector)}else{if(!context||context.jquery){return(context||rootjQuery).find(selector)}else{return jQuery(context).find(selector)}}}}else{if(jQuery.isFunction(selector)){return rootjQuery.ready(selector)}}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.makeArray(selector,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},toArray:function(){return slice.call(this,0)},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num])},pushStack:function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems)}else{jQuery.merge(ret,elems)}ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")"}}return ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{if(readyList){readyList.push(fn)}}return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},end:function(){return this.prevObject||jQuery(null)},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}if(typeof target!=="object"&&!jQuery.isFu
/*
* Sizzle CSS Selector Engine - v1.0
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;var origContext=context;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var m,set,checkSet,extra,ret,cur,pop,i,prune=true,contextXML=Sizzle.isXML(context),parts=[],soFar=selector;do{chunker.exec("");m=chunker.exec(soFar);if(m){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}}while(m);if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){cur=parts.pop();pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){Sizzle.error(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else{if(context&&context.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&Sizzle.contains(context,checkSet[i]))){results.push(set[i])}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results)}return results};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.matchesSelector=function(node,expr){return Sizzle(expr,null,null,[node]).length>0};Sizzle.find=function(expr,context,isXML){var set;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var match,type=Expr.order[i];if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var match,anyFound,old=expr,result=[],curLoop=set,isXMLFilter=set&&set[0]&&Sizzle.isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var found,item,filter=Expr.filter[type],left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else{if(match===true){continue}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else{if(pass){result.push(item);anyFound=true}}
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
window.undefined=window.undefined;Ext={version:"3.2.1",versionDetail:{major:3,minor:2,patch:1}};Ext.apply=function(o,c,defaults){if(defaults){Ext.apply(o,defaults)}if(o&&c&&typeof c=="object"){for(var p in c){o[p]=c[p]}}return o};(function(){var idSeed=0,toString=Object.prototype.toString,ua=navigator.userAgent.toLowerCase(),check=function(r){return r.test(ua)},DOC=document,isStrict=DOC.compatMode=="CSS1Compat",isOpera=check(/opera/),isChrome=check(/\bchrome\b/),isWebKit=check(/webkit/),isSafari=!isChrome&&check(/safari/),isSafari2=isSafari&&check(/applewebkit\/4/),isSafari3=isSafari&&check(/version\/3/),isSafari4=isSafari&&check(/version\/4/),isIE=!isOpera&&check(/msie/),isIE7=isIE&&check(/msie 7/),isIE8=isIE&&check(/msie 8/),isIE6=isIE&&!isIE7&&!isIE8,isGecko=!isWebKit&&check(/gecko/),isGecko2=isGecko&&check(/rv:1\.8/),isGecko3=isGecko&&check(/rv:1\.9/),isBorderBox=isIE&&!isStrict,isWindows=check(/windows|win32/),isMac=check(/macintosh|mac os x/),isAir=check(/adobeair/),isLinux=check(/linux/),isSecure=/^https/i.test(window.location.protocol);if(isIE6){try{DOC.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{SSL_SECURE_URL:isSecure&&isIE?'javascript:""':"about:blank",isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,enableNestedListenerRemoval:false,USE_NATIVE_JSON:false,applyIf:function(o,c){if(o){for(var p in c){if(!Ext.isDefined(o[p])){o[p]=c[p]}}}return o},id:function(el,prefix){el=Ext.getDom(el,true)||{};if(!el.id){el.id=(prefix||"ext-gen")+(++idSeed)}return el.id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.superclass=sbp.supr=(function(){return spp});sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){return Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;Ext.apply(p,overrides);if(Ext.isIE&&overrides.hasOwnProperty("toString")){p.toString=overrides.toString}}},namespace:function(){var o,d;Ext.each(arguments,function(v){d=v.split(".");o=window[d[0]]=window[d[0]]||{};Ext.each(d.slice(1),function(v2){o=o[v2]=o[v2]||{}})});return o},urlEncode:function(o,pre){var empty,buf=[],e=encodeURIComponent;Ext.iterate(o,function(key,item){empty=Ext.isEmpty(item);Ext.each(empty?key:item,function(val){buf.push("&",e(key),"=",(!Ext.isEmpty(val)&&(val!=key||!empty))?(Ext.isDate(val)?Ext.encode(val).replace(/"/g,""):e(val)):"")})});if(!pre){buf.shift();pre=""}return pre+buf.join("")},urlDecode:function(string,overwrite){if(Ext.isEmpty(string)){return{}}var obj={},pairs=string.split("&"),d=decodeURIComponent,name,value;Ext.each(pairs,function(pair){pair=pair.split("=");name=d(pair[0]);value=d(pair[1]);obj[name]=overwrite||!obj[name]?value:[].concat(obj[name]).concat(value)});return obj},urlAppend:function(url,s){if(!Ext.isEmpty(s)){return url+(url.indexOf("?")===-1?"?":"&")+s}return url},toArray:function(){return isIE?function(a,i,j,res){res=[];for(var x=0,len=a.length;x<len;x++){res.push(a[x])}return res.slice(i||0,j||res.length)}:function(a,i,j){return Array.prototype.slice.call(a,i||0,j||a.length)}}(),isIterable:function(v){if(Ext.isArray(v)||v.callee){return true}if(/NodeList|HTMLCollection/.test(toString.call(v))){return true}return((typeof v.nextNode!="undefined"||v.item)&&Ext.isNumber(v.length))},each:function(array,fn,scope){if(Ext.isEmpty(array,true)){return}if(!Ext.isIterable(array)||Ext.isPrimitive(array)){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},iterate:function(obj,fn,scope){if(Ext.isEmpty(obj)){return}if(Ext.isIterable(obj)){Ext.each(obj,fn,scope);return}else{i
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.DomHelper=function(){var tempTableEl=null,emptyTags=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,tableRe=/^table|tbody|tr|td$/i,confRe=/tag|children|cn|html$/i,tableElRe=/td|tr|tbody/i,cssRe=/([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi,endRe=/end/i,pub,afterbegin="afterbegin",afterend="afterend",beforebegin="beforebegin",beforeend="beforeend",ts="<table>",te="</table>",tbs=ts+"<tbody>",tbe="</tbody>"+te,trs=tbs+"<tr>",tre="</tr>"+tbe;function doInsert(el,o,returnElement,pos,sibling,append){var newNode=pub.insertHtml(pos,Ext.getDom(el),createHtml(o));return returnElement?Ext.get(newNode,true):newNode}function createHtml(o){var b="",attr,val,key,keyVal,cn;if(typeof o=="string"){b=o}else{if(Ext.isArray(o)){for(var i=0;i<o.length;i++){if(o[i]){b+=createHtml(o[i])}}}else{b+="<"+(o.tag=o.tag||"div");for(attr in o){val=o[attr];if(!confRe.test(attr)){if(typeof val=="object"){b+=" "+attr+'="';for(key in val){b+=key+":"+val[key]+";"}b+='"'}else{b+=" "+({cls:"class",htmlFor:"for"}[attr]||attr)+'="'+val+'"'}}}if(emptyTags.test(o.tag)){b+="/>"}else{b+=">";if((cn=o.children||o.cn)){b+=createHtml(cn)}else{if(o.html){b+=o.html}}b+="</"+o.tag+">"}}}return b}function ieTable(depth,s,h,e){tempTableEl.innerHTML=[s,h,e].join("");var i=-1,el=tempTableEl,ns;while(++i<depth){el=el.firstChild}if(ns=el.nextSibling){var df=document.createDocumentFragment();while(el){ns=el.nextSibling;df.appendChild(el);el=ns}el=df}return el}function insertIntoTable(tag,where,el,html){var node,before;tempTableEl=tempTableEl||document.createElement("div");if(tag=="td"&&(where==afterbegin||where==beforeend)||!tableElRe.test(tag)&&(where==beforebegin||where==afterend)){return}before=where==beforebegin?el:where==afterend?el.nextSibling:where==afterbegin?el.firstChild:null;if(where==beforebegin||where==afterend){el=el.parentNode}if(tag=="td"||(tag=="tr"&&(where==beforeend||where==afterbegin))){node=ieTable(4,trs,html,tre)}else{if((tag=="tbody"&&(where==beforeend||where==afterbegin))||(tag=="tr"&&(where==beforebegin||where==afterend))){node=ieTable(3,tbs,html,tbe)}else{node=ieTable(2,ts,html,te)}}el.insertBefore(node,before);return node}pub={markup:function(o){return createHtml(o)},applyStyles:function(el,styles){if(styles){var i=0,len,style,matches;el=Ext.fly(el);if(typeof styles=="function"){styles=styles.call()}if(typeof styles=="string"){while((matches=cssRe.exec(styles))){el.setStyle(matches[1],matches[2])}}else{if(typeof styles=="object"){el.setStyle(styles)}}}},insertHtml:function(where,el,html){var hash={},hashVal,setStart,range,frag,rangeEl,rs;where=where.toLowerCase();hash[beforebegin]=["BeforeBegin","previousSibling"];hash[afterend]=["AfterEnd","nextSibling"];if(el.insertAdjacentHTML){if(tableRe.test(el.tagName)&&(rs=insertIntoTable(el.tagName.toLowerCase(),where,el,html))){return rs}hash[afterbegin]=["AfterBegin","firstChild"];hash[beforeend]=["BeforeEnd","lastChild"];if((hashVal=hash[where])){el.insertAdjacentHTML(hashVal[0],html);return el[hashVal[1]]}}else{range=el.ownerDocument.createRange();setStart="setStart"+(endRe.test(where)?"After":"Before");if(hash[where]){range[setStart](el);frag=range.createContextualFragment(html);el.parentNode.insertBefore(frag,where==beforebegin?el:el.nextSibling);return el[(where==beforebegin?"previous":"next")+"Sibling"]}else{rangeEl=(where==afterbegin?"first":"last")+"Child";if(el.firstChild){range[setStart](el[rangeEl]);frag=range.createContextualFragment(html);if(where==afterbegin){el.insertBefore(frag,el.firstChild)}else{el.appendChild(frag)}}else{el.innerHTML=html}return el[rangeEl]}}throw'Illegal insertion point -> "'+where+'"'},insertBefore:function(el,o,returnElement){return doInsert(el,o,returnElement,beforebegin)},insertAfter:function(el,o,returnElement){return doInsert(el,o,returnElement,afterend,"nextSibling")},insertFirst:function(el,o,returnElement){return doInsert(el,o,returnElement,afterbegin,"firstChild")},append:function(el,o,returnElement){return doInsert(el,o,returnElement,beforeend,"",true)},overwrite:function(el,o,returnElement){el=Ext.getDom(el);el.innerHTML=create
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ComponentMgr=function(){var all=new Ext.util.MixedCollection();var types={};var ptypes={};return{register:function(c){all.add(c)},unregister:function(c){all.remove(c)},get:function(id){return all.get(id)},onAvailable:function(id,fn,scope){all.on("add",function(index,o){if(o.id==id){fn.call(scope||o,o);all.un("add",fn,scope)}})},all:all,types:types,ptypes:ptypes,isRegistered:function(xtype){return types[xtype]!==undefined},isPluginRegistered:function(ptype){return ptypes[ptype]!==undefined},registerType:function(xtype,cls){types[xtype]=cls;cls.xtype=xtype},create:function(config,defaultType){return config.render?config:new types[config.xtype||defaultType](config)},registerPlugin:function(ptype,cls){ptypes[ptype]=cls;cls.ptype=ptype},createPlugin:function(config,defaultType){var PluginCls=ptypes[config.ptype||defaultType];if(PluginCls.init){return PluginCls}else{return new PluginCls(config)}}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.preg=Ext.ComponentMgr.registerPlugin;Ext.create=Ext.ComponentMgr.create;Ext.Component=function(config){config=config||{};if(config.initialConfig){if(config.isAction){this.baseAction=config}config=config.initialConfig}else{if(config.tagName||config.dom||Ext.isString(config)){config={applyTo:config,id:config.id||config}}}this.initialConfig=config;Ext.apply(this,config);this.addEvents("added","disable","enable","beforeshow","show","beforehide","hide","removed","beforerender","render","afterrender","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var i=0,len=this.plugins.length;i<len;i++){this.plugins[i]=this.initPlugin(this.plugins[i])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState()}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabled:false,hidden:false,autoEl:"div",disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,rendered:false,tplWriteMode:"overwrite",bubbleEvents:[],ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(p){if(p.ptype&&!Ext.isFunction(p.init)){p=Ext.ComponentMgr.createPlugin(p)}else{if(Ext.isString(p)){p=Ext.ComponentMgr.createPlugin({ptype:p})}}p.init(this);return p},initComponent:function(){if(this.listeners){this.on(this.listeners);delete this.listeners}this.enableBubble(this.bubbleEvents)},render:function(container,position){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!container&&this.el){this.el=Ext.get(this.el);container=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(container);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(position!==undefined){if(Ext.isNumber(position)){position=this.container.dom.childNodes[position]}else{position=Ext.getDom(position)}}this.onRender(this.container,position||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);var contentTarget=this.getContentTarget();if(this.html){contentTarget.update(Ext.DomHelper.markup(this.html));delete this.html}if(this.contentEl){var ce=Ext.getDom(this.contentEl);Ext.fly(ce).removeClass(["x-hidden","x-hide-display"]);contentTarget.appendChild(ce)}if(this.tpl){if(!this.tpl.compile){this.tpl=new Ext.XTemplate(this.tpl)}if(this.data){this.tpl[this.tplWriteMode](contentTarget,this.data);delete this.data}}this.afterRender(this.container);if(this.hidden){this.doHide()}if(this.disabled){this.disable(true)}if(this.stateful!==false){t
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.data.Api=(function(){var validActions={};return{actions:{create:"create",read:"read",update:"update",destroy:"destroy"},restActions:{create:"POST",read:"GET",update:"PUT",destroy:"DELETE"},isAction:function(action){return(Ext.data.Api.actions[action])?true:false},getVerb:function(name){if(validActions[name]){return validActions[name]}for(var verb in this.actions){if(this.actions[verb]===name){validActions[name]=verb;break}}return(validActions[name]!==undefined)?validActions[name]:null},isValid:function(api){var invalid=[];var crud=this.actions;for(var action in api){if(!(action in crud)){invalid.push(action)}}return(!invalid.length)?true:invalid},hasUniqueUrl:function(proxy,verb){var url=(proxy.api[verb])?proxy.api[verb].url:null;var unique=true;for(var action in proxy.api){if((unique=(action===verb)?true:(proxy.api[action].url!=url)?true:false)===false){break}}return unique},prepare:function(proxy){if(!proxy.api){proxy.api={}}for(var verb in this.actions){var action=this.actions[verb];proxy.api[action]=proxy.api[action]||proxy.url||proxy.directFn;if(typeof(proxy.api[action])=="string"){proxy.api[action]={url:proxy.api[action],method:(proxy.restful===true)?Ext.data.Api.restActions[action]:undefined}}}},restify:function(proxy){proxy.restful=true;for(var verb in this.restActions){proxy.api[this.actions[verb]].method||(proxy.api[this.actions[verb]].method=this.restActions[verb])}proxy.onWrite=proxy.onWrite.createInterceptor(function(action,o,response,rs){var reader=o.reader;var res=new Ext.data.Response({action:action,raw:response});switch(response.status){case 200:return true;break;case 201:if(Ext.isEmpty(res.raw.responseText)){res.success=true}else{return true}break;case 204:res.success=true;res.data=null;break;default:return true;break}if(res.success===true){this.fireEvent("write",this,action,res.data,res,rs,o.request.arg)}else{this.fireEvent("exception",this,"remote",action,o,res,rs)}o.request.callback.call(o.request.scope,res.data,res,res.success);return false},proxy)}}})();Ext.data.Response=function(params,response){Ext.apply(this,params,{raw:response})};Ext.data.Response.prototype={message:null,success:false,status:null,root:null,raw:null,getMessage:function(){return this.message},getSuccess:function(){return this.success},getStatus:function(){return this.status},getRoot:function(){return this.root},getRawResponse:function(){return this.raw}};Ext.data.Api.Error=Ext.extend(Ext.Error,{constructor:function(message,arg){this.arg=arg;Ext.Error.call(this,message)},name:"Ext.data.Api"});Ext.apply(Ext.data.Api.Error.prototype,{lang:{"action-url-undefined":"No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.",invalid:"received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions","invalid-url":"Invalid url. Please review your proxy configuration.",execute:'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"'}});Ext.data.SortTypes={none:function(s){return s},stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"")},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(s){return String(s).toUpperCase()},asDate:function(s){if(!s){return 0}if(Ext.isDate(s)){return s.getTime()}return Date.parse(String(s))},asFloat:function(s){var val=parseFloat(String(s).replace(/,/g,""));return isNaN(val)?0:val},asInt:function(s){var val=parseInt(String(s).replace(/,/g,""),10);return isNaN(val)?0:val}};Ext.data.Record=function(data,id){this.id=(id||id===0)?id:Ext.data.Record.id(this);this.data=data||{}};Ext.data.Record.create=function(o){var f=Ext.extend(Ext.data.Record,{});var p=f.prototype;p.fields=new Ext.util.MixedCollection(false,function(field){return field.name});for(var i=0,len=o.length;i<len;i++){p.fields.add(new Ext.data.Field(o[i]))}f.getField=function(name){return p.fi
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.data.JsonWriter=Ext.extend(Ext.data.DataWriter,{encode:true,encodeDelete:false,constructor:function(config){Ext.data.JsonWriter.superclass.constructor.call(this,config)},render:function(params,baseParams,data){if(this.encode===true){Ext.apply(params,baseParams);params[this.meta.root]=Ext.encode(data)}else{var jdata=Ext.apply({},baseParams);jdata[this.meta.root]=data;params.jsonData=jdata}},createRecord:function(rec){return this.toHash(rec)},updateRecord:function(rec){return this.toHash(rec)},destroyRecord:function(rec){if(this.encodeDelete){var data={};data[this.meta.idProperty]=rec.id;return data}else{return rec.id}}});Ext.data.JsonReader=function(meta,recordType){meta=meta||{};Ext.applyIf(meta,{idProperty:"id",successProperty:"success",totalProperty:"total"});Ext.data.JsonReader.superclass.constructor.call(this,meta,recordType||meta.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(response){var json=response.responseText;var o=Ext.decode(json);if(!o){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(o)},readResponse:function(action,response){var o=(response.responseText!==undefined)?Ext.decode(response.responseText):response;if(!o){throw new Ext.data.JsonReader.Error("response")}var root=this.getRoot(o);if(action===Ext.data.Api.actions.create){var def=Ext.isDefined(root);if(def&&Ext.isEmpty(root)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!def){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}var res=new Ext.data.Response({action:action,success:this.getSuccess(o),data:(root)?this.extractData(root,false):[],message:this.getMessage(o),raw:o});if(Ext.isEmpty(res.success)){throw new Ext.data.JsonReader.Error("successProperty-response",this.meta.successProperty)}return res},readRecords:function(o){this.jsonData=o;if(o.metaData){this.onMetaChange(o.metaData)}var s=this.meta,Record=this.recordType,f=Record.prototype.fields,fi=f.items,fl=f.length,v;var root=this.getRoot(o),c=root.length,totalRecords=c,success=true;if(s.totalProperty){v=parseInt(this.getTotal(o),10);if(!isNaN(v)){totalRecords=v}}if(s.successProperty){v=this.getSuccess(o);if(v===false||v==="false"){success=false}}return{success:success,records:this.extractData(root,true),totalRecords:totalRecords}},buildExtractors:function(){if(this.ef){return}var s=this.meta,Record=this.recordType,f=Record.prototype.fields,fi=f.items,fl=f.length;if(s.totalProperty){this.getTotal=this.createAccessor(s.totalProperty)}if(s.successProperty){this.getSuccess=this.createAccessor(s.successProperty)}if(s.messageProperty){this.getMessage=this.createAccessor(s.messageProperty)}this.getRoot=s.root?this.createAccessor(s.root):function(p){return p};if(s.id||s.idProperty){var g=this.createAccessor(s.id||s.idProperty);this.getId=function(rec){var r=g(rec);return(r===undefined||r==="")?null:r}}else{this.getId=function(){return null}}var ef=[];for(var i=0;i<fl;i++){f=fi[i];var map=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;ef.push(this.createAccessor(map))}this.ef=ef},simpleAccess:function(obj,subsc){return obj[subsc]},createAccessor:function(){var re=/[\[\.]/;return function(expr){if(Ext.isEmpty(expr)){return Ext.emptyFn}if(Ext.isFunction(expr)){return expr}var i=String(expr).search(re);if(i>=0){return new Function("obj","return obj"+(i>0?".":"")+expr)}return function(obj){return obj[expr]}}}(),extractValues:function(data,items,len){var f,values={};for(var j=0;j<len;j++){f=items[j];var v=this.ef[j](data);values[f.name]=f.convert((v!==undefined)?v:f.defaultValue,data)}return values}});Ext.data.JsonReader.Error=Ext.extend(Ext.Error,{constructor:function(message,arg){this.arg=arg;Ext.Error.call(this,message)},name:"Ext.data.JsonReader"});Ext.apply(Ext.data.JsonReader.Error.prototype,{lang:{response:"An error occurred while json-decoding your server response","successProperty-response":'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in yo
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,blockRefresh:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(Ext.isString(this.tpl)||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","containercontextmenu","selectionchange","beforeselect");this.store=Ext.StoreMgr.lookup(this.store);this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.mon(this.getTemplateTarget(),{click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.mon(this.getTemplateTarget(),{mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.bindStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);var el=this.getTemplateTarget();el.update("");var records=this.store.getRange();if(records.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){el.update(this.emptyText)}this.all.clear()}else{this.tpl.overwrite(el,this.collectData(records,0));this.all.fill(Ext.query(this.itemSelector,el.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},getTemplateTarget:function(){return this.el},prepareData:function(data){return data},collectData:function(records,startIndex){var r=[];for(var i=0,len=records.length;i<len;i++){r[r.length]=this.prepareData(records[i].data,startIndex+i,records[i])}return r},bufferRender:function(records){var div=document.createElement("div");this.tpl.overwrite(div,this.collectData(records));return Ext.query(this.itemSelector,div)},onUpdate:function(ds,record){var index=this.store.indexOf(record);if(index>-1){var sel=this.isSelected(index);var original=this.all.elements[index];var node=this.bufferRender([record],index)[0];this.all.replaceElement(index,node,true);if(sel){this.selected.replaceElement(original,node);this.all.item(index).addClass(this.selectedClass)}this.updateIndexes(index,index)}},onAdd:function(ds,records,index){if(this.all.getCount()===0){this.refresh();return}var nodes=this.bufferRender(records,index),n,a=this.all.elements;if(index<this.all.getCount()){n=this.all.item(index).insertSibling(nodes,"before",true);a.splice.apply(a,[index,0].concat(nodes))}else{n=this.all.last().insertSibling(nodes,"after",true);a.push.apply(a,nodes)}this.updateIndexes(index)},onRemove:function(ds,record,index){this.deselect(index);this.all.removeElement(index,true);this.updateIndexes(index);if(this.store.getCount()===0){this.refresh()}},refreshNode:function(index){this.onUpdate(this.store,this.store.getAt(index))},updateIndexes:function(startIndex,endIndex){var ns=this.all.elements;startIndex=startIndex||0;endIndex=endIndex||((endIndex===0)?0:(ns.length-1));for(var i=startIndex;i<=endIndex;i++){ns[i].viewIndex=i}},getStore:function(){return this.store},bindStore:function(store,initial){if(!initial&&this.store){if(store!==this.store&&this.store.autoDestroy){this.store.destroy()}else{this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.onDataChanged,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(!store){this.store=null}}if(store){store=Ext.StoreMgr.lookup(store);store.on({scope:this,beforeload:this.onBeforeLoad,datachanged:this.onDataChanged,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,clear:this.refresh})}this.store=store;if(store){this.refresh()}},onDataChanged:function(){if(this.blockRefresh!==true){this.refresh.apply(this,arguments)}},findItemFromChild:function(node){return Ext.fly(node).findParent(this.itemSelector,this.getTemplateTarget())},onClick:function(e){var item=e.getTarget(this.itemSelector,this.getTemplateTarget());if(item){var index=this.indexOf(item);if(this.onItemClick(item,index,e)!==false){this.fi
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
(function(){var Event=Ext.EventManager;var Dom=Ext.lib.Dom;Ext.dd.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(constrainTo,pad,inContent){if(Ext.isNumber(pad)){pad={left:pad,right:pad,top:pad,bottom:pad}}pad=pad||this.defaultPadding;var b=Ext.get(this.getEl()).getBox(),ce=Ext.get(constrainTo),s=ce.getScroll(),c,cd=ce.dom;if(cd==document.body){c={x:s.left,y:s.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var xy=ce.getXY();c={x:xy[0],y:xy[1],width:cd.clientWidth,height:cd.clientHeight}}var topSpace=b.y-c.y,leftSpace=b.x-c.x;this.resetConstraints();this.setXConstraint(leftSpace-(pad.left||0),c.width-leftSpace-b.width-(pad.right||0),this.xTickSize);this.setYConstraint(topSpace-(pad.top||0),c.height-topSpace-b.height-(pad.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof id!=="string"){id=Ext.id(id)}this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop]}else{if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight]}else{this.padding=[iTop,iRight,iBot,iLeft]}}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return}var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p)},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1]},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup)},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup]}this.DDM.removeDDFromGroup(this,sGroup)},setDragElId:function(id){this.dragElId=id},setHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id)}this.handleElId=id;this.DDM.regHandle(this.id,id)},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id)}Event.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true},unreg:function(){Event.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:fu
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,closeAction:"close",constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,collapsible:false,initHidden:undefined,hidden:true,elements:"header,body",frame:true,floating:true,initComponent:function(){this.initTools();Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore");if(Ext.isDefined(this.initHidden)){this.hidden=this.initHidden}if(this.hidden===false){this.hidden=true;this.show()}},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox(true))},onRender:function(ct,position){Ext.Window.superclass.onRender.call(this,ct,position);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mon(this.mask,"click",this.focus,this)}if(this.maximizable){this.mon(this.header,"dblclick",this.toggleMaximize,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction,handleCls:"x-window-handle"});this.resizer.window=this;this.mon(this.resizer,"beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.mon(this.el,"mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var km=this.getKeyMap();km.on(27,this.onEsc,this);km.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(k,e){e.stopEvent();this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();this.clearAnchor();Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true})}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var box=this.proxy.getBox();this.proxy.hide();this.window.handleResize(box);return box},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(box){var rz=this.resizeBox;if(rz.x!=box.x||rz.y!=box.y){this.updateBox(box)}else{this.setSize(box);if(Ext.isIE6&&Ext.isStrict){this.doLayout()}}this.focus();this.updateHandles();this.saveState()},focus:function(){var f=this.focusEl,db=this.defaultButton,t=typeof db,el,ct;if(Ext.isDefined(db)){if(Ext.isNumber(db)&&this.fbar){f=this.fbar.items.get(db)}else{if(Ext.isString(db)){f=Ext.getCmp(db)}else{f=db}}el=f.getEl();ct=Ext.getDom(this.container);if(el&&ct){if(!Ext.lib.Region.getRegion(ct).contains(Ext.lib.Region.getRegion(el.dom))){return}}}f=f||this.focusEl;f.focus.defer(10,f)},setAnimateTarget:function(el){el=Ext.get(el);this.animateTarget=el},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||th
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.Resizable=Ext.extend(Ext.util.Observable,{constructor:function(el,config){this.el=Ext.get(el);if(config&&config.wrap){config.resizeChild=this.el;this.el=this.el.wrap(typeof config.wrap=="object"?config.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=config.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(config.resizeChild.getPositioning());config.resizeChild.clearPositioning();if(!config.width||!config.height){var csize=config.resizeChild.getSize();this.el.setSize(csize.width,csize.height)}if(config.pinned&&!config.adjustments){config.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,config);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var position=this.el.getStyle("position");if(position!="absolute"&&position!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var hs=this.handles.split(/\s*?[,;]\s*?| /);var ps=Ext.Resizable.positions;for(var i=0,len=hs.length;i<len;i++){if(hs[i]&&ps[hs[i]]){var pos=ps[hs[i]];this[pos]=new Ext.Resizable.Handle(this,pos,this.disableTrackOver,this.transparent,this.handleCls)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var rc=this.resizeChild;var hw=this.west,he=this.east,hn=this.north,hs=this.south;if(rc&&(hw||hn)){rc.position("relative");rc.setLeft(hw?hw.el.getWidth():0);rc.setTop(hn?hn.el.getHeight():0)}this.adjustments=[(he?-he.el.getWidth():0)+(hw?-hw.el.getWidth():0),(hn?-hn.el.getHeight():0)+(hs?-hs.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id);if(this.constrainTo){this.dd.constrainTo(this.constrainTo)}}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)},adjustments:[0,0],animate:false,disableTrackOver:false,draggable:false,duration:0.35,dynamic:false,easing:"easeOutStrong",enabled:true,handles:false,multiDirectional:false,height:null,width:null,heightIncrement:0,widthIncrement:0,minHeight:5,minWidth:5,maxHeight:10000,maxWidth:10000,minX:0,minY:0,pinned:false,preserveRatio:false,resizeChild:false,transparent:false,resizeTo:function(width,height){this.el.setSize(width,height);this.updateChildSize();this.fireEvent("resize",this,width,height,null)},startSizing:function(e,handle){this.fireEvent("beforeresize",this,e);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on({scope:this,mousemove:this.onMouseMove,mouseup:this.onMouseUp})}this.overlay.setStyle("cursor",handle.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=e.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var ct=Ext.get(this.constrainTo);this.resizeRegion=ct.getRegion().adjust(ct.getFrameWidth("t"),ct.getFrameWidth("l"),-ct.getFrameWidth("b"),-ct.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visi
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.Button=Ext.extend(Ext.BoxComponent,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr:nth(2)",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",scale:"small",iconAlign:"left",arrowAlign:"right",initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}if(Ext.isString(this.toggleGroup)){this.enableToggle=true}},getTemplateArgs:function(){return[this.type,"x-btn-"+this.scale+" x-btn-icon-"+this.scale+"-"+this.iconAlign,this.getMenuClass(),this.cls,this.id]},setButtonClass:function(){if(this.useSetClass){if(!Ext.isEmpty(this.oldCls)){this.el.removeClass([this.oldCls,"x-btn-pressed"])}this.oldCls=(this.iconCls||this.icon)?(this.text?"x-btn-text-icon":"x-btn-icon"):"x-btn-noicon";this.el.addClass([this.oldCls,this.pressed?"x-btn-pressed":null])}},getMenuClass:function(){return this.menu?(this.arrowAlign!="bottom"?"x-btn-arrow":"x-btn-arrow-bottom"):""},onRender:function(ct,position){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">','<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><button type="{0}"></button></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>','<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',"</tbody></table>");Ext.Button.buttonTemplate.compile()}this.template=Ext.Button.buttonTemplate}var btn,targs=this.getTemplateArgs();if(position){btn=this.template.insertBefore(position,targs,true)}else{btn=this.template.append(ct,targs,true)}this.btnEl=btn.child(this.buttonSelector);this.mon(this.btnEl,{scope:this,focus:this.onFocus,blur:this.onBlur});this.initButtonEl(btn,this.btnEl);Ext.ButtonToggleMgr.register(this)},initButtonEl:function(btn,btnEl){this.el=btn;this.setIcon(this.icon);this.setText(this.text);this.setIconClass(this.iconCls);if(Ext.isDefined(this.tabIndex)){btnEl.dom.tabIndex=this.tabIndex}if(this.tooltip){this.setTooltip(this.tooltip,true)}if(this.handleMouseEvents){this.mon(btn,{scope:this,mouseover:this.onMouseOver,mousedown:this.onMouseDown})}if(this.menu){this.mon(this.menu,{scope:this,show:this.onMenuShow,hide:this.onMenuHide})}if(this.repeat){var repeater=new Ext.util.ClickRepeater(btn,Ext.isObject(this.repeat)?this.repeat:{});this.mon(repeater,"click",this.onClick,this)}this.mon(btn,this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);this.useSetClass=true;this.setButtonClass();this.doc=Ext.getDoc();this.doAutoWidth()},setIconClass:function(cls){this.iconCls=cls;if(this.el){this.btnEl.dom.className="";this.btnEl.addClass(["x-btn-text",cls||""]);this.setButtonClass()}return this},setTooltip:function(tooltip,initial){if(this.rendered){if(!initial){this.clearTip()}if(Ext.isObject(tooltip)){Ext.QuickTips.register(Ext.apply({target:this.btnEl.id},tooltip));this.tooltip=tooltip}else{this.btnEl.dom[this.tooltipType]=tooltip}}else{this.tooltip=tooltip}return this},clearTip:function(){if(Ext.isObject(this.tooltip)){Ext.QuickTips.unregister(this.btnEl)}},beforeDestroy:function(){if(this.rendered){this.clearTip()}if(this.menu&&this.destroyMenu!==false){Ext.destroy(this.menu)}Ext.destroy(this.repeater)},onDestroy:function(){if(this.rendered){this.doc.un("mouseover",this.monitorMouseOver,this);this.doc.un("mouseup",this.onMouseUp,this);delete this.doc;delete this.btnEl;Ext.ButtonToggleMgr.unregister(this)}Ext.Button.superclass.onDestroy.call(this)},doAutoWidth:function(){if(this.autoWidth!==false&&this.el&&this.text&&this.width===undefined){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.btnEl;if(ib&&ib.g
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.TabPanel=Ext.extend(Ext.Panel,{deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:undefined,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout(Ext.apply({layoutOnCardChange:this.layoutOnTabChange,deferredRender:this.deferredRender},this.layoutConfig)));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},onRender:function(ct,position){Ext.TabPanel.superclass.onRender.call(this,ct,position);if(this.plain){var pos=this.tabPosition=="top"?"header":"footer";this[pos].addClass("x-tab-panel-"+pos+"-plain")}var st=this[this.stripTarget];this.stripWrap=st.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var beforeEl=(this.tabPosition=="bottom"?this.stripWrap:null);st.createChild({cls:"x-tab-strip-spacer"},beforeEl);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge",cn:[{tag:"span",cls:"x-tab-strip-text",cn:"&#160;"}]});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var tt=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close"></a>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");tt.disableFormats=true;tt.compile();Ext.TabPanel.prototype.itemTpl=tt}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}if(this.activeTab!==undefined){var item=Ext.isObject(this.activeTab)?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(item)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.mon(this.strip,{scope:this,mousedown:this.onStripMouseDown,contextmenu:this.onStripContextMenu});if(this.enableTabScroll){this.mon(this.strip,"mousewheel",this.onWheel,this)}},findTargets:function(e){var item=null,itemEl=e.getTarget("li:not(.x-tab-edge)",this.strip);if(itemEl){item=this.getComponent(itemEl.id.split(this.idDelimiter)[1]);if(item.disabled){return{close:null,item:null,el:null}}}return{close:e.getTarget(".x-tab-strip-close",this.strip),item:item,el:itemEl}},onStripMouseDown:function(e){if(e.button!==0){return}e.preventDefault();var t=this.findTargets(e);if(t.close){if(t.item.fireEvent("beforeclose",t.item)!==false){t.item.fireEvent("close",t.item);this.remove(t.item)}return}if(t.item&&t.item!=this.activeTab){this.setActiveTab(t.item)}},onStripContextMenu:function(e){e.preventDefault();var t=this.findTargets(e);if(t.item){this.fireEvent("contextmenu",this,t.item,e)}},readTabs:function(removeExisting){if(removeExisting===true){this.items.each(function(item){this.remove(item)},this)}var tabs=this.el.query(this.autoTabSelector);for(var i=0,len=tabs.length;i<len;i++){var tab=tabs[i],title=tab.getAttribute("title");tab.removeAttribute("title");this.add({title:title,contentEl:tab})}},initTab:function(item,index){var before=this.strip.dom.childNodes[index],p=this.getTemplateArgs(item),el=before?this.itemTpl.insertBefore(before,p):this.itemTpl.append(this.strip,p),cls="x-tab-strip-over",tabEl=Ext.get(el);tabEl.hover(function(){if(!item.disabled){tabEl.addClass(cls)}},function(){tabEl.removeClass(cls)});if(item.tabTip){tabEl.child("span.x-tab-strip-text",true).qtip=item.tabTip}item.tabEl=el;tabEl.select("a").on("click",function(e){if(!e.getPageX(
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,closeAction:"hide",initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this[this.closeAction],scope:this})}},showAt:function(xy){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){xy=this.el.adjustForConstraints(xy)}this.setPagePosition(xy[0],xy[1])},doAutoWidth:function(adjust){adjust=adjust||0;var bw=this.body.getTextWidth();if(this.title){bw=Math.max(bw,this.header.child("span").getTextWidth(this.title))}bw+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr")+adjust;this.setWidth(bw.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(el,pos){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(el,pos||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.reg("tip",Ext.Tip);Ext.Tip.DD=function(tip,config){Ext.apply(this,config);this.tip=tip;Ext.Tip.DD.superclass.constructor.call(this,tip.el.id,"WindowDD-"+tip.id);this.setHandleElId(tip.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(e){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,trackMouse:false,anchorToTarget:true,anchorOffset:0,targetCounter:0,constrainPosition:false,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget(this.target);this.origAnchor=this.anchor},onRender:function(ct,position){Ext.ToolTip.superclass.onRender.call(this,ct,position);this.anchorCls="x-tip-anchor-"+this.getAnchorPosition();this.anchorEl=this.el.createChild({cls:"x-tip-anchor "+this.anchorCls})},afterRender:function(){Ext.ToolTip.superclass.afterRender.call(this);this.anchorEl.setStyle("z-index",this.el.getZIndex()+1)},initTarget:function(target){var t;if((t=Ext.get(target))){if(this.target){var tg=Ext.get(this.target);this.mun(tg,"mouseover",this.onTargetOver,this);this.mun(tg,"mouseout",this.onTargetOut,this);this.mun(tg,"mousemove",this.onMouseMove,this)}this.mon(t,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=t}if(this.anchor){this.anchorTarget=this.target}},onMouseMove:function(e){var t=this.delegate?e.getTarget(this.delegate):this.triggerElement=true;if(t){this.targetXY=e.getXY();if(t===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(e)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},getTargetXY:function(){if(this.delegate){this.anchorTarget=this.triggerElement}if(this.anchor){this.targetCounter++;var offsets=this.getOffsets(),xy=(this.anchorToTarget&&!this.trackMouse)?this.el.getAlignToXY(this.anchorTarget,this.getAnchorAlign()):this.targetXY,dw=Ext.lib.Dom.getViewWidth()-5,dh=Ext.lib.Dom.getViewHeight()-5,de=document.documentElement,bd=document.body,scrollX=(de.scrollLeft||bd.scrollLeft||0)+5,scrollY=(de.scrollTop||bd.scrollTop||0)+5,axy=[xy[0]+offsets[0],xy[1]+offsets[1]],sz=this.getSize();this.anchorEl.removeClass(this.anchorCls);if(this.targetCounter<2){if(axy[0]<scrollX){if(this.anchorToTarget){this.defaultAlign="l-r";if(this.mouseOffset){this.mouseOffset[0]*=-1}}this.anchor="left";return this.getTargetXY()}if(axy[0]+sz.width>dw){if(this.anchorToTarge
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",bubbleEvents:[],initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var l=this.loader;if(!l){l=new Ext.tree.TreeLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod})}else{if(Ext.isObject(l)&&!l.load){l=new Ext.tree.TreeLoader(l)}}this.loader=l;this.nodeHash={};if(this.root){var r=this.root;delete this.root;this.setRootNode(r)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","containerclick","checkchange","beforedblclick","dblclick","containerdblclick","contextmenu","containercontextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(ename,a1,a2,a3,a4,a5,a6){if(ename=="collapse"||ename=="expand"||ename=="beforecollapse"||ename=="beforeexpand"||ename=="move"||ename=="beforemove"){ename=ename+"node"}return this.fireEvent(ename,a1,a2,a3,a4,a5,a6)},getRootNode:function(){return this.root},setRootNode:function(node){this.destroyRoot();if(!node.render){node=this.loader.createNode(node)}this.root=node;node.ownerTree=this;node.isRoot=true;this.registerNode(node);if(!this.rootVisible){var uiP=node.attributes.uiProvider;node.ui=uiP?new uiP(node):new Ext.tree.RootTreeNodeUI(node)}if(this.innerCt){this.clearInnerCt();this.renderRoot()}return node},clearInnerCt:function(){this.innerCt.update("")},renderRoot:function(){this.root.render();if(!this.rootVisible){this.root.renderChildren()}},getNodeById:function(id){return this.nodeHash[id]},registerNode:function(node){this.nodeHash[node.id]=node},unregisterNode:function(node){delete this.nodeHash[node.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(node){var p=node.parentNode;if(p){if(p.expandedChild&&p.expandedChild.parentNode==p){p.expandedChild.collapse()}p.expandedChild=node}},getChecked:function(a,startNode){startNode=startNode||this.root;var r=[];var f=function(){if(this.attributes.checked){r.push(!a?this:(a=="id"?this.id:this.attributes[a]))}};startNode.cascade(f);return r},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(path,attr,callback){attr=attr||"id";var keys=path.split(this.pathSeparator);var curNode=this.root;if(curNode.attributes[attr]!=keys[1]){if(callback){callback(false,null)}return}var index=1;var f=function(){if(++index==keys.length){if(callback){callback(true,curNode)}return}var c=curNode.findChild(attr,keys[index]);if(!c){if(callback){callback(false,curNode)}return}curNode=c;c.expand(false,false,f)};curNode.expand(false,false,f)},selectPath:function(path,attr,callback){attr=attr||"id";var keys=path.split(this.pathSeparator),v=keys.pop();if(keys.length>1){var f=function(success,node){if(success&&node){var n=node.findChild(attr,v);if(n){n.select();if(callback){callback(true,n)}}else{if(callback){callback(false,n)}}}else{if(callback){callback(false,n)}}};this.expandPath(keys.join(this.pathSeparator),attr,f)}else{this.root.select();if(callback){callback(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(ct,position){Ext.tree.TreePanel.superclass.onRender.call(this,ct,position);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.grid.GridPanel=Ext.extend(Ext.Panel,{autoExpandColumn:false,autoExpandMax:1000,autoExpandMin:50,columnLines:false,ddText:"{0} selected row{1}",deferRowRender:true,enableColumnHide:true,enableColumnMove:true,enableDragDrop:false,enableHdMenu:true,loadMask:false,minColumnWidth:25,stripeRows:false,trackMouseOver:true,stateEvents:["columnmove","columnresize","sortchange","groupchange"],view:null,bubbleEvents:[],rendered:false,viewReady:false,initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);if(this.columnLines){this.cls=(this.cls||"")+" x-grid-with-col-lines"}this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","groupmousedown","rowbodymousedown","containermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","groupclick","groupdblclick","containerclick","containerdblclick","rowbodyclick","rowbodydblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","groupcontextmenu","containercontextmenu","rowbodycontextmenu","bodyscroll","columnresize","columnmove","sortchange","groupchange","reconfigure","viewready")},onRender:function(ct,position){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var c=this.getGridEl();this.el.addClass("x-grid-panel");this.mon(c,{scope:this,mousedown:this.onMouseDown,click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu});this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress","keydown"]);var view=this.getView();view.init(this);view.render();this.getSelectionModel().init(this)},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.mon(this.colModel,"hiddenchange",this.saveState,this,{delay:100})},applyState:function(state){var cm=this.colModel,cs=state.columns,store=this.store,s,c,oldIndex;if(cs){for(var i=0,len=cs.length;i<len;i++){s=cs[i];c=cm.getColumnById(s.id);if(c){c.hidden=s.hidden;c.width=s.width;oldIndex=cm.getIndexById(s.id);if(oldIndex!=i){cm.moveColumn(oldIndex,i)}}}}if(store){s=state.sort;if(s){store[store.remoteSort?"setDefaultSort":"sort"](s.field,s.direction)}s=state.group;if(store.groupBy){if(s){store.groupBy(s)}else{store.clearGrouping()}}}var o=Ext.apply({},state);delete o.columns;delete o.sort;Ext.grid.GridPanel.superclass.applyState.call(this,o)},getState:function(){var o={columns:[]},store=this.store,ss,gs;for(var i=0,c;(c=this.colModel.config[i]);i++){o.columns[i]={id:c.id,width:c.width};if(c.hidden){o.columns[i].hidden=true}}if(store){ss=store.getSortState();if(ss){o.sort=ss}if(store.getGroupState){gs=store.getGroupState();if(gs){o.group=gs}}}return o},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);var v=this.view;this.on("bodyresize",v.layout,v);v.layout();if(this.deferRowRender){if(!this.deferRowRenderTask){this.deferRowRenderTask=new Ext.util.DelayedTask(v.afterRender,this.view)}this.deferRowRenderTask.delay(10)}else{v.afterRender()}this.viewReady=true},reconfigure:function(store,colModel){var rendered=this.rendered;if(rendered){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:store},this.initialConfig.loadMask))}}if(this.view){this.view.initData(store,colModel)}this.store=store;this.colModel=colModel;if(rendered){this.view.refresh(true)}this.fireEvent("reconfigure",this,store,colModel)},onDestroy:function(){if(this.deferRowRenderTask&&this.deferRowRenderTask.cancel){this.deferRowRenderTask.cancel()}if(this.rende
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.Toolbar=function(config){if(Ext.isArray(config)){config={items:config,layout:"toolbar"}}else{config=Ext.apply({layout:"toolbar"},config);if(config.buttons){config.items=config.buttons}}Ext.Toolbar.superclass.constructor.call(this,config)};(function(){var T=Ext.Toolbar;Ext.extend(T,Ext.Container,{defaultType:"button",enableOverflow:false,trackMenus:true,internalDefaults:{removeMode:"container",hideParent:true},toolbarCls:"x-toolbar",initComponent:function(){T.superclass.initComponent.call(this);this.addEvents("overflowchange")},onRender:function(ct,position){if(!this.el){if(!this.autoCreate){this.autoCreate={cls:this.toolbarCls+" x-small-editor"}}this.el=ct.createChild(Ext.apply({id:this.id},this.autoCreate),position);Ext.Toolbar.superclass.onRender.apply(this,arguments)}},lookupComponent:function(c){if(Ext.isString(c)){if(c=="-"){c=new T.Separator()}else{if(c==" "){c=new T.Spacer()}else{if(c=="->"){c=new T.Fill()}else{c=new T.TextItem(c)}}}this.applyDefaults(c)}else{if(c.isFormField||c.render){c=this.createComponent(c)}else{if(c.tag){c=new T.Item({autoEl:c})}else{if(c.tagName){c=new T.Item({el:c})}else{if(Ext.isObject(c)){c=c.xtype?this.createComponent(c):this.constructButton(c)}}}}}return c},applyDefaults:function(c){if(!Ext.isString(c)){c=Ext.Toolbar.superclass.applyDefaults.call(this,c);var d=this.internalDefaults;if(c.events){Ext.applyIf(c.initialConfig,d);Ext.apply(c,d)}else{Ext.applyIf(c,d)}}return c},addSeparator:function(){return this.add(new T.Separator())},addSpacer:function(){return this.add(new T.Spacer())},addFill:function(){this.add(new T.Fill())},addElement:function(el){return this.addItem(new T.Item({el:el}))},addItem:function(item){return this.add.apply(this,arguments)},addButton:function(config){if(Ext.isArray(config)){var buttons=[];for(var i=0,len=config.length;i<len;i++){buttons.push(this.addButton(config[i]))}return buttons}return this.add(this.constructButton(config))},addText:function(text){return this.addItem(new T.TextItem(text))},addDom:function(config){return this.add(new T.Item({autoEl:config}))},addField:function(field){return this.add(field)},insertButton:function(index,item){if(Ext.isArray(item)){var buttons=[];for(var i=0,len=item.length;i<len;i++){buttons.push(this.insertButton(index+i,item[i]))}return buttons}return Ext.Toolbar.superclass.insert.call(this,index,item)},trackMenu:function(item,remove){if(this.trackMenus&&item.menu){var method=remove?"mun":"mon";this[method](item,"menutriggerover",this.onButtonTriggerOver,this);this[method](item,"menushow",this.onButtonMenuShow,this);this[method](item,"menuhide",this.onButtonMenuHide,this)}},constructButton:function(item){var b=item.events?item:this.createComponent(item,item.split?"splitbutton":this.defaultType);return b},onAdd:function(c){Ext.Toolbar.superclass.onAdd.call(this);this.trackMenu(c);if(this.disabled){c.disable()}},onRemove:function(c){Ext.Toolbar.superclass.onRemove.call(this);this.trackMenu(c,true)},onDisable:function(){this.items.each(function(item){if(item.disable){item.disable()}})},onEnable:function(){this.items.each(function(item){if(item.enable){item.enable()}})},onButtonTriggerOver:function(btn){if(this.activeMenuBtn&&this.activeMenuBtn!=btn){this.activeMenuBtn.hideMenu();btn.showMenu();this.activeMenuBtn=btn}},onButtonMenuShow:function(btn){this.activeMenuBtn=btn},onButtonMenuHide:function(btn){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);T.Item=Ext.extend(Ext.BoxComponent,{hideParent:true,enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbitem",T.Item);T.Separator=Ext.extend(T.Item,{onRender:function(ct,position){this.el=ct.createChild({tag:"span",cls:"xtb-sep"},position)}});Ext.reg("tbseparator",T.Separator);T.Spacer=Ext.extend(T.Item,{onRender:function(ct,position){this.el=ct.createChild({tag:"div",cls:"xtb-spacer",style:this.width?"width:"+this.width+"px":""},position)}});Ext.reg("tbspacer",T.Spacer);T.Fill=Ext.extend(T.Item,{render:Ext.emptyFn,isFill:true});Ext.reg("tbfill",T.Fill);T.TextItem=Ext.extend(T.Item,{constructor:function(config){T.TextItem.superclass.constructor.
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.menu.Menu=Ext.extend(Ext.Container,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,enableScrolling:true,maxHeight:null,scrollIncrement:24,showSeparator:true,defaultOffsets:[0,0],plain:false,floating:true,zIndex:15000,hidden:true,layout:"menu",hideMode:"offsets",scrollerHeight:8,autoLayout:true,defaultType:"menuitem",bufferResize:false,initComponent:function(){if(Ext.isArray(this.initialConfig)){Ext.apply(this,{items:this.initialConfig})}this.addEvents("click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);if(this.floating){Ext.EventManager.onWindowResize(this.hide,this)}else{if(this.initialConfig.hidden!==false){this.hidden=false}this.internalDefaults={hideOnClick:false}}Ext.menu.Menu.superclass.initComponent.call(this);if(this.autoLayout){var fn=this.doLayout.createDelegate(this,[]);this.on({add:fn,remove:fn})}},getLayoutTarget:function(){return this.ul},onRender:function(ct,position){if(!ct){ct=Ext.getBody()}var dh={id:this.getId(),cls:"x-menu "+((this.floating)?"x-menu-floating x-layer ":"")+(this.cls||"")+(this.plain?" x-menu-plain":"")+(this.showSeparator?"":" x-menu-nosep"),style:this.style,cn:[{tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"},{tag:"ul",cls:"x-menu-list"}]};if(this.floating){this.el=new Ext.Layer({shadow:this.shadow,dh:dh,constrain:false,parentEl:ct,zindex:this.zIndex})}else{this.el=ct.createChild(dh)}Ext.menu.Menu.superclass.onRender.call(this,ct,position);if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}this.focusEl=this.el.child("a.x-menu-focus");this.ul=this.el.child("ul.x-menu-list");this.mon(this.ul,{scope:this,click:this.onClick,mouseover:this.onMouseOver,mouseout:this.onMouseOut});if(this.enableScrolling){this.mon(this.el,{scope:this,delegate:".x-menu-scroller",click:this.onScroll,mouseover:this.deactivateActive})}},findTargetItem:function(e){var t=e.getTarget(".x-menu-list-item",this.ul,true);if(t&&t.menuItemId){return this.items.get(t.menuItemId)}},onClick:function(e){var t=this.findTargetItem(e);if(t){if(t.isFormField){this.setActiveItem(t)}else{if(t instanceof Ext.menu.BaseItem){if(t.menu&&this.ignoreParentClicks){t.expandMenu();e.preventDefault()}else{if(t.onClick){t.onClick(e);this.fireEvent("click",this,t,e)}}}}}},setActiveItem:function(item,autoExpand){if(item!=this.activeItem){this.deactivateActive();if((this.activeItem=item).isFormField){item.focus()}else{item.activate(autoExpand)}}else{if(autoExpand){item.expandMenu()}}},deactivateActive:function(){var a=this.activeItem;if(a){if(a.isFormField){if(a.collapse){a.collapse()}}else{a.deactivate()}delete this.activeItem}},tryActivate:function(start,step){var items=this.items;for(var i=start,len=items.length;i>=0&&i<len;i+=step){var item=items.get(i);if(!item.disabled&&(item.canActivate||item.isFormField)){this.setActiveItem(item,false);return item}}return false},onMouseOver:function(e){var t=this.findTargetItem(e);if(t){if(t.canActivate&&!t.disabled){this.setActiveItem(t,true)}}this.over=true;this.fireEvent("mouseover",this,e,t)},onMouseOut:function(e){var t=this.findTargetItem(e);if(t){if(t==this.activeItem&&t.shouldDeactivate&&t.shouldDeactivate(e)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,e,t)},onScroll:function(e,t){if(e){e.stopEvent()}var ul=this.ul.dom,top=Ext.fly(t).is(".x-menu-scroller-top");ul.scrollTop+=this.scrollIncrement*(top?-1:1);if(top?ul.scrollTop<=0:ul.scrollTop+this.activeMax>=ul.scrollHeight){this.onScrollerOut(null,t)}},onScrollerIn:function(e,t){var ul=this.ul.dom,top=Ext.fly(t).is(".x-menu-scroller-top");if(top?ul.scrollTop>0:ul.scrollTop+this.activeMax<ul.scrollHeight){Ext.fly(t).addClass(["x-menu-item-active","x-menu-scroller-active"])}},onScrollerOut:function(e,t){Ext.fly(t).removeClass(["x-menu-item-active","x-menu-scroller-active"])},show:function(el,pos,parentMenu){if(this.floating){this.parentMenu=parentMenu;if(!this.el){this.render();this.doLayout(false,true)}this.showAt(this.el.getAlignToXY(el,pos||this.defaultAlign,t
/*
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,submitValue:true,isFormField:true,msgDisplay:"",hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:this.name||this.id||""},onRender:function(ct,position){if(!this.el){var cfg=this.getAutoCreate();if(!cfg.name){cfg.name=this.name||this.id}if(this.inputType){cfg.type=this.inputType}this.autoEl=cfg}Ext.form.Field.superclass.onRender.call(this,ct,position);if(this.submitValue===false){this.el.dom.removeAttribute("name")}var type=this.el.dom.type;if(type){if(type=="password"){type="text"}this.el.addClass("x-form-"+type)}if(this.readOnly){this.setReadOnly(true)}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},getItemCt:function(){return this.itemCt},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(!Ext.isEmpty(this.el.dom.value)&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled||!this.rendered){return false}return String(this.getValue())!==String(this.originalValue)},setReadOnly:function(readOnly){if(this.rendered){this.el.dom.readOnly=readOnly}this.readOnly=readOnly},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(e){if(e.isSpecialKey()){this.fireEvent("specialkey",this,e)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.mon(this.el,Ext.EventManager.useKeydown?"keydown":"keypress",this.fireKey,this);this.mon(this.el,"focus",this.onFocus,this);this.mon(this.el,"blur",this.onBlur,this,this.inEditor?{buffer:10}:null)},preFocus:Ext.emptyFn,onFocus:function(){this.preFocus();if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&(this.validateOnBlur||this.validationEvent=="blur")){this.validate()}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent("change",this,v,this.startValue)}this.fireEvent("blur",this);this.postBlur()},postBlur:Ext.emptyFn,isValid:function(preventMark){if(this.disabled){return true}var restore=this.preventMark;this.preventMark=preventMark===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=restore;return v},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(value){return value},validateValue:function(value){var error=this.getErrors(value)[0];if(error==undefined){return true}else{this.markInvalid(error);return false}},getErrors:function(){return[]},getActiveError:function(){return this.activeError||""},markInvalid:function(msg){if(this.rendered&&!this.preventMark){msg=msg||this.invalidText;var mt=this.getMessageHandler();if(mt){mt.mark(this,msg)}else{if(this.msgTarget){this.el.addClass(this.invalidClass);var t=Ext.getDom(this.msgTarget);if(t){t.innerHTML=msg;t.style.display=this.msgDisplay}}}}this.setActiveError(msg)},clearInvalid:function(){if(this.rendered&&!this.preventMark){this.el.removeClass(this.invalidClass);var mt=this.getMessageHandler();if(mt){mt.clear(this)}else{if(this.msgTarget){this.el.removeClass(this.invalidClass);var t=Ext.getDom(this.msgTarget);if(t){t.innerHTML="";t.style.displa
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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)}}}};jQuery.fn.removeCss=function(cssName){return this.each(function(){var oldstyle=jQuery(this).attr("style");var style=jQuery.grep(jQuery(this).attr("style").split(";"),function(curStyleAttr){var curStyleAttrName=curStyleAttr.split(":");if(curStyleAttrName[0]){if(curStyleAttrName[0].toUpperCase().trim().indexOf(cssName.toUpperCase())==-1){return curStyleAttr}}}).join(";").trim();jQuery(this).removeAttr("style");if(style.trim()){jQuery(this).attr("style",style)}return jQuery(this)})};jQuery.fn.contentEditable=function(b){var ce="contenteditable";if(jQuery.browser.msie&&parseInt(jQuery.browser.version)==7){ce="contentEditable"}if(b==undefined){return jQuery(this).attr(ce)}else{if(b===""){jQuery(this).removeAttr(ce)}else{if(b&&b!=="false"){b="true"}else{b="false"}jQuery(this).attr(ce,b)}}};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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]}}};GENTICS.Utils.uniqeString4=function(){return(((1+Math.random())*65536)|0).toString(16).substring(1)};GENTICS.Utils.guid=function(){var S4=GENTICS.Utils.uniqeString4;return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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});
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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","code","del","em","i","ins","strong","sub","sup","#text"];GENTICS.Utils.Dom.prototype.nonWordBoundaryTags=["a","b","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",abbr:"phrasing",address:"flow",area:"empty",article:"flow",aside:"flow",audio:"source",b:"phrasing",base:"empty",bdo:"phrasing",blockquote:"flow",body:"flow",br:"empty",button:"phrasing",canvas:"phrasing",caption:"flow",cite:"phrasing",code:"phrasing",col:"empty",colgroup:"col",command:"empty",datalist:["phrasing","option"],dd:"flow",del:"phrasing",div:"flow",details:["summary","flow"],dfn:"flow",div:"flow",dl:["dt","dd"],dt:"phrasing",em:"phrasing",embed:"empty",fieldset:["legend","flow"],figcaption:"flow",figure:["figcaption","flow"],footer:"flow",form:"flow",h1:"phrasing",h2:"phrasing",h3:"phrasing",h4:"phrasing",h5:"phrasing",h6:"phrasing",header:"flow",hgroup:["h1","h2","h3","h4","h5","h6"],hr:"empty",i:"phrasing",iframe:"#text",img:"empty",input:"empty",ins:"phrasing",kbd:"phrasing",keygen:"empty",label:"phrasing",legend:"phrasing",li:"flow",link:"empty",map:"area",mark:"phrasing",menu:["li","flow"],meta:"empty",meter:"phrasing",nav:"flow",noscript:"phrasing",object:"param",ol:"li",optgroup:"option",option:"#text",output:"phrasing",p:"phrasing",param:"empty",pre:"phrasing",progress:"phrasing",q:"phrasing",rp:"phrasing",rt:"phrasing",ruby:["phrasing","rt","rp"],s:"phrasing",samp:"pharsing",script:"#script",section:"flow",select:["option","optgroup"],small:"phrasing",source:"empty",span:"phrasing",strong:"phrasing",style:"phrasing",sub:"phrasing",summary:"phrasing",sup:"phrasing",table:["caption","colgroup","thead","tbody","tfoot","tr"],tbody:"tr",td:"flow",textarea:"#text",tfoot:"tr",th:"phrasing",thead:"tr",time:"phrasing",title:"#text",tr:["th","td"],track:"empty",ul:"li","var":"phrasing",video:"source",wbr:"empty"};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 true}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
/*
* Aloha Editor is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.*
* Aloha Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* 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(!Array.indexOf){Array.prototype.indexOf=function(obj){for(var i=0;i<this.length;i++){if(this[i]===obj){return i}}return -1};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
}Ext.data.AlohaProxy=function(){var api={};api[Ext.data.Api.actions.read]=true;Ext.data.AlohaProxy.superclass.constructor.call(this,{api:api});this.params={queryString:null,objectTypeFilter:null,filter:null,inFolderId:null,orderBy:null,maxItems:null,skipCount:null,renditionFilter:null,repositoryId:null}};Ext.extend(Ext.data.AlohaProxy,Ext.data.DataProxy,{doRequest:function(action,rs,params,reader,cb,scope,arg){var p=this.params;jQuery.extend(p,params);try{GENTICS.Aloha.RepositoryManager.query(p,function(items){var result=reader.readRecords(items);cb.call(scope,result,arg,true)})}catch(e){this.fireEvent("loadexception",this,null,arg,e);this.fireEvent("exception",this,"response",action,arg,null,e);return false}},setObjectTypeFilter:function(otFilter){this.params.objectTypeFilter=otFilter},getObjectTypeFilter:function(){return this.params.objectTypeFilter},setParams:function(p){jQuery.extend(this.params,p)}});
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
Ext.data.AlohaObjectReader=function(meta,recordType){meta={};Ext.applyIf(meta,{idProperty:"id",root:"items",totalProperty:"results",fields:["id","url","name","type","weight","repositoryId"]});Ext.data.JsonReader.superclass.constructor.call(this,meta,meta.fields)};Ext.extend(Ext.data.AlohaObjectReader,Ext.data.JsonReader,{});
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
Ext.tree.AlohaTreeLoader=function(config){Ext.apply(this,config);Ext.tree.AlohaTreeLoader.superclass.constructor.call(this)};Ext.extend(Ext.tree.AlohaTreeLoader,Ext.tree.TreeLoader,{paramOrder:["node","id"],nodeParameter:"id",directFn:function(node,id,callback){var params={inFolderId:node.id,objectTypeFilter:this.objectTypeFilter,repositoryId:node.repositoryId};GENTICS.Aloha.RepositoryManager.getChildren(params,function(items){var response={};response={status:true,scope:this,argument:{callback:callback,node:node}};if(typeof callback=="function"){callback(items,response)}})},createNode:function(node){if(node.name){node.text=node.name}if(node.hasMoreItems){node.leaf=!node.hasMoreItems}if(node.objectType){node.cls=node.objectType}return Ext.tree.TreeLoader.prototype.createNode.call(this,node)},objectTypeFilter:null,setObjectTypeFilter:function(otFilter){this.objectTypeFilter=otFilter},getObjectTypeFilter:function(){return this.objectTypeFilter}});
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
if(typeof GENTICS=="undefined"||!GENTICS){var GENTICS={}}GENTICS.Aloha=function(){};GENTICS.Aloha.setAutobase=function(){var scriptTags=jQuery("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=[];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.readyCallbacks=[];GENTICS.Aloha.prototype.init=function(){if(jQuery.browser.webkit&&parseFloat(jQuery.browser.version)<532.5||jQuery.browser.mozilla&&parseFloat(jQuery.browser.version)<1.9||jQuery.browser.msie&&jQuery.browser.version<7||jQuery.browser.opera){alert("Sorry, your browser is not supported at the moment.");return}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.RepositoryManager.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");Ext.ux.AlohaAttributeField.prototype.listEmptyText=GENTICS.Aloha.i18n(GENTICS.Aloha,"repository.no_item_found");Ext.ux.AlohaAttributeField.prototype.loadingText=GENTICS.Aloha.i18n(GENTICS.Aloha,"repository.loading")+"...";this.ready=true;for(var i=0;i<this.editables.length;i++){if(!this.editables[i].ready){this.editables[i].init()}}GENTICS.Aloha.EventRegistry.trigger(new GENTICS.Aloha.Event("ready",GENTICS.Aloha,null))};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.getEditableById=function(id){for(var i=0;i<GENTICS.Aloha.editables.length;i++){if(GENTICS.Aloha.editables[i].getId()==id){return GENTICS.Aloha.editables[i]}}return 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(){
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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.init(properties)};GENTICS.Aloha.ui.Button.prototype.init=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;this.listenerQueue=[];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}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.scale||this.size,width:this.width||undefined,rowspan:this.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.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(typeof 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).click(function(event){that.onClick(event)});this.panelButton=jQuery(this.el.createChild('<button class="GENTICS_multisplit_toggle GENTICS_multisplit_toggle_ope
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
Ext.ux.AlohaAttributeField=Ext.extend(Ext.form.ComboBox,{typeAhead:false,mode:"remote",triggerAction:"all",width:300,hideTrigger:true,minChars:3,valueField:"id",displayField:"url",enableKeyEvents:true,store:new Ext.data.Store({proxy:new Ext.data.AlohaProxy(),reader:new Ext.data.AlohaObjectReader()}),tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item">',"<span><b>{name}</b><br />{url}</span>","</div></tpl>"),onSelect:function(item){this.setItem(item.data);if(typeof this.alohaButton.onSelect=="function"){this.alohaButton.onSelect.call(this.alohaButton,item.data)}this.collapse()},listeners:{beforequery:function(event){if(this.noQuery){event.cancel=true;return}if(this.store!=null&&this.store.proxy!=null){this.store.proxy.setParams({objectTypeFilter:this.getObjectTypeFilter(),queryString:event.query})}},afterrender:function(obj,event){var that=this;jQuery(this.wrap.dom.children[0]).blur(function(e){that.triggerBlur()})},keydown:function(obj,event){if(event.keyCode==13||event.keyCode==27){if(this.isExpanded()){this.ALOHAwasExpanded=true}else{this.ALOHAwasExpanded=false}}},keyup:function(obj,event){if((event.keyCode==13||event.keyCode==27)&&!this.ALOHAwasExpanded){setTimeout(function(){GENTICS.Aloha.activeEditable.obj[0].focus();GENTICS.Aloha.Selection.getRangeObject().select()},0)}var v=this.wrap.dom.children[0].value;this.setAttribute(this.targetAttribute,v)},focus:function(obj,event){var target=jQuery(this.getTargetObject());var s=target.css("background-color");if(target&&target.context.style&&target.context.style["background-color"]){target.attr("data-original-background-color",target.context.style["background-color"])}target.css("background-color","Highlight")},blur:function(obj,event){var target=jQuery(this.getTargetObject());if(target){if(color=target.attr("data-original-background-color")){jQuery(target).css("background-color",color)}else{jQuery(target).removeCss("background-color")}jQuery(target).removeAttr("data-original-background-color")}},expand:function(combo){if(this.noQuery){this.collapse()}}},setItem:function(item,displayField){this.resourceItem=item;if(item){displayField=(displayField)?displayField:this.displayField;var v=item[displayField];this.setValue(v);this.setAttribute(this.targetAttribute,v);GENTICS.Aloha.RepositoryManager.markObject(this.targetObject,item)}},getItem:function(){return this.resourceItem},setAttribute:function(attr,value,regex,reference){if(this.targetObject){var setAttr=true;if(typeof reference!="undefined"){var regxp=new RegExp(regex);if(!reference.match(regxp)){setAttr=false}}if(setAttr){jQuery(this.targetObject).attr(attr,value)}else{jQuery(this.targetObject).removeAttr(attr)}}},setTargetObject:function(obj,attr){this.targetObject=obj;this.targetAttribute=attr;if(this.targetObject&&this.targetAttribute){this.setValue(jQuery(this.targetObject).attr(this.targetAttribute))}else{this.setValue("")}},getTargetObject:function(){return this.targetObject},setObjectTypeFilter:function(otFilter){this.objectTypeFilter=otFilter},getObjectTypeFilter:function(){return this.objectTypeFilter},noQuery:true});Ext.reg("alohaattributefield",Ext.ux.AlohaAttributeField);GENTICS.Aloha.ui.AttributeField=function(properties){this.onSelect=null;this.listenerQueue=[];this.objectTypeFilter=null;this.tpl=null;this.displayField=null;this.init(properties)};GENTICS.Aloha.ui.AttributeField.prototype=new GENTICS.Aloha.ui.Button();GENTICS.Aloha.ui.AttributeField.prototype.getExtConfigProperties=function(){return{alohaButton:this,xtype:"alohaattributefield",rowspan:this.rowspan||undefined,width:this.width||undefined,id:this.id}};GENTICS.Aloha.ui.AttributeField.prototype.setTargetObject=function(obj,attr){if(this.extButton){this.extButton.setTargetObject(obj,attr)}};GENTICS.Aloha.ui.AttributeField.prototype.getTargetObject=function(){if(this.extButton){return this.extButton.getTargetObject()}else{return null}};GENTICS.Aloha.ui.AttributeField.prototype.focus=function(){if(this.extButton){this.extButton.focus();if(this.extButton.getValue().length>0){this.extButton.selectText(0,this.extButton.getValue().lengt
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.ui.Browser=function(){this.onSelect=null;var that=this;this.grid=new Ext.grid.GridPanel({region:"center",autoScroll:true,store:new Ext.data.Store({proxy:new Ext.data.AlohaProxy(),reader:new Ext.data.AlohaObjectReader()}),columns:[{id:"name",header:"Name",width:100,sortable:true,dataIndex:"name"},{header:"URL",renderer:function(val){return val},width:300,sortable:true,dataIndex:"url"}],stripeRows:true,autoExpandColumn:"name",height:350,width:600,title:"Objectlist",stateful:true,stateId:"grid",selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),listeners:{dblclick:function(e){that.onItemSelect()}}});this.grid.getSelectionModel().on({selectionchange:function(sm,n,node){var resourceItem=that.grid.getSelectionModel().getSelected();if(resourceItem){this.win.buttons[1].enable()}else{this.win.buttons[1].disable()}},scope:this});this.tree=new Ext.tree.TreePanel({region:"center",useArrows:true,autoScroll:true,animate:true,enableDD:true,containerScroll:true,border:false,loader:new Ext.tree.AlohaTreeLoader(),root:{nodeType:"async",text:"Aloha Repositories",draggable:false,id:"aloha"},rootVisible:false,listeners:{beforeload:function(node){this.loader.baseParams={node:node.attributes}}}});this.tree.getSelectionModel().on({selectionchange:function(sm,node){if(node){var resourceItem=node.attributes;that.grid.store.load({params:{inFolderId:resourceItem.id,objectTypeFilter:that.objectTypeFilter,repositoryId:resourceItem.repositoryId}})}},scope:this});this.nav=new Ext.Panel({title:"Navigation",region:"west",width:300,layout:"fit",collapsible:true,items:[this.tree]});this.win=new Ext.Window({title:"Resource Selector",layout:"border",width:800,height:300,closeAction:"hide",onEsc:function(){this.hide()},defaultButton:this.nav,plain:true,initHidden:true,items:[this.nav,this.grid],buttons:[{text:"Close",handler:function(){that.win.hide()}},{text:"Select",disabled:true,handler:function(){that.onItemSelect()}}],toFront:function(e){this.manager=this.manager||Ext.WindowMgr;this.manager.bringToFront(this);this.setZIndex(9999999999);return this}});this.onItemSelect=function(){var sm=this.grid.getSelectionModel();var sel=(sm)?sm.getSelected():null;var resourceItem=(sel)?sel.data:null;this.win.hide();if(typeof this.onSelect=="function"){this.onSelect.call(this,resourceItem)}}};GENTICS.Aloha.ui.Browser.prototype.setObjectTypeFilter=function(otf){this.objectTypeFilter=otf};GENTICS.Aloha.ui.Browser.prototype.getObjectTypeFilter=function(){return this.objectTypeFilter};GENTICS.Aloha.ui.Browser.prototype.show=function(){this.win.show();this.win.toFront(true);this.win.focus()};(function(){if(typeof this.GENTICS_Aloha_autoloadcss=="undefined"||!(this.GENTICS_Aloha_autoloadcss==false)){var base=GENTICS.Aloha.autobase;if(typeof GENTICS_Aloha_base!="undefined"){base=GENTICS_Aloha_base}var header=document.getElementsByTagName("head")[0];header.appendChild(cssElement(base+"css/aloha.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"deps/extjs/resources/css/ext-all.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"deps/extjs/resources/css/xtheme-gray.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"deps/prettyPhoto/resources/css/prettyPhoto.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"plugins/com.gentics.aloha.plugins.Table/resources/table.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"plugins/com.gentics.aloha.plugins.Link/css/Link.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"plugins/com.gentics.aloha.plugins.HighlightEditables/css/HighlightEditables.css?v="+GENTICS.Aloha.version));header.appendChild(cssElement(base+"plugins/com.gentics.aloha.plugins.LinkChecker/css/LinkChecker.css?v="+GENTICS.Aloha.version))}function cssElement(link){var csslink=document.createElement("link");csslink.setAttribute("rel","stylesheet");csslink.setAttribute("type","text/css");csslink.setAttribute("href",link);csslink.setAttribute("media","all");return csslink}})();
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.Editable=function(obj){if(!obj.attr("id")){obj.attr("id",GENTICS.Utils.guid())}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.check=function(){var obj=this.obj,el=obj.get(0),nodeName=el.nodeName.toLowerCase();var textElements=["a","abbr","address","article","aside","b","bdo","blockquote","cite","code","command","del","details","dfn","div","dl","em","footer","h1","h2","h3","h4","h5","h6","header","i","ins","menu","nav","p","pre","q","ruby","section","small","span","strong","sub","sup","var"];for(var i=0;i<textElements.length;i++){if(nodeName==textElements[i]){return true}}switch(nodeName){case"label":case"button":break;case"textarea":var div=jQuery("<div/>").insertAfter(obj);div.html(obj.val());obj.hide();var updateFunction=function(){var val=div.html();obj.val(val)};obj.parents("form:first").submit(updateFunction);this.obj=div;return true;default:break}return false};GENTICS.Aloha.Editable.prototype.init=function(){var that=this;if(!this.check(this.obj)){this.destroy();return}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(){return this.originalContent!=this.getContents()};GENTICS.Aloha.Editable.prototype.toString=function(){return"GENTICS.Aloha.Editable"};GENTICS.Aloha.Editable.prototype.isDisabled=function(){return this.obj.attr("contentEditable")=="false"||!this.obj.attr("contentEditable")};GENTICS.Aloha.Editable.prototype.disable=function(){if(!this.isDisabled()){this.obj.attr("contentEditable","false")}};GENTICS.Aloha.Editable.prototype.enable=function(){if(this.isDisabled()){this.obj.attr("contentEditable","true")}};GENTICS.Aloha.Editable.prototype.activate=function(e){if(this.isActive||this.isDisabled()){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){return(null===str)||(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.h
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.Ribbon=function(){var that=this;this.visible=false;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.animate({left:"-100%",marginLeft:"34px"});jQuery("body").animate({paddingTop:0});button.setIconClass("GENTICS_fade_in")}else{toolbar.animate({left:"0%",marginLeft: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===true){jQuery("body").css("paddingTop","30px !important");this.show()}};GENTICS.Aloha.Ribbon.prototype.hide=function(){jQuery(".GENTICS_ribbon").fadeOut();this.visible=false};GENTICS.Aloha.Ribbon.prototype.show=function(){jQuery(".GENTICS_ribbon").fadeIn();this.visible=true};GENTICS.Aloha.Ribbon.prototype.isVisible=function(){return this.visible};GENTICS.Aloha.Ribbon=new GENTICS.Aloha.Ribbon();
/*
*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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();
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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=[];GENTICS.Aloha.FloatingMenu.tabMap={};GENTICS.Aloha.FloatingMenu.initialized=false;GENTICS.Aloha.FloatingMenu.allButtons=[];GENTICS.Aloha.FloatingMenu.top=100;GENTICS.Aloha.FloatingMenu.left=100;GENTICS.Aloha.FloatingMenu.pinned=false;GENTICS.Aloha.FloatingMenu.window=jQuery(window);GENTICS.Aloha.FloatingMenu.init=function(){this.currentScope="GENTICS.Aloha.global";var that=this;this.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(
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
if(document.attachEvent&&document.selection){
/*
* DOM Ranges for Internet Explorer (m2)
*
* Copyright (c) 2009 Tim Cameron Ryan
* Released under the MIT/X License
* available at http://code.google.com/p/ierange/
*/
(function(){var DOMUtils={findChildPosition:function(node){for(var i=0;node=node.previousSibling;i++){continue}return i},isDataNode:function(node){return node&&node.nodeValue!==null&&node.data!==null},isAncestorOf:function(parent,node){return !DOMUtils.isDataNode(parent)&&(parent.contains(DOMUtils.isDataNode(node)?node.parentNode:node)||node.parentNode==parent)},isAncestorOrSelf:function(root,node){return DOMUtils.isAncestorOf(root,node)||root==node},findClosestAncestor:function(root,node){if(DOMUtils.isAncestorOf(root,node)){while(node&&node.parentNode!=root){node=node.parentNode}}return node},getNodeLength:function(node){return DOMUtils.isDataNode(node)?node.length:node.childNodes.length},splitDataNode:function(node,offset){if(!DOMUtils.isDataNode(node)){return false}var newNode=node.cloneNode(false);node.deleteData(offset,node.length);newNode.deleteData(0,offset);node.parentNode.insertBefore(newNode,node.nextSibling)}};var TextRangeUtils={convertToDOMRange:function(textRange,document){function adoptBoundary(domRange,textRange,bStart){var cursorNode=document.createElement("a"),cursor=textRange.duplicate();cursor.collapse(bStart);var parent=cursor.parentElement();do{parent.insertBefore(cursorNode,cursorNode.previousSibling);cursor.moveToElementText(cursorNode)}while(cursor.compareEndPoints(bStart?"StartToStart":"StartToEnd",textRange)>0&&cursorNode.previousSibling);if(cursor.compareEndPoints(bStart?"StartToStart":"StartToEnd",textRange)==-1&&cursorNode.nextSibling){cursor.setEndPoint(bStart?"EndToStart":"EndToEnd",textRange);domRange[bStart?"setStart":"setEnd"](cursorNode.nextSibling,cursor.text.length)}else{domRange[bStart?"setStartBefore":"setEndBefore"](cursorNode)}cursorNode.parentNode.removeChild(cursorNode)}var domRange=new DOMRange(document);adoptBoundary(domRange,textRange,true);adoptBoundary(domRange,textRange,false);return domRange},convertFromDOMRange:function(domRange){function adoptEndPoint(textRange,domRange,bStart){var container=domRange[bStart?"startContainer":"endContainer"];var offset=domRange[bStart?"startOffset":"endOffset"],textOffset=0;var anchorNode=DOMUtils.isDataNode(container)?container:container.childNodes[offset];var anchorParent=DOMUtils.isDataNode(container)?container.parentNode:container;if(container.nodeType==3||container.nodeType==4){textOffset=offset}var cursorNode=domRange._document.createElement("a");anchorParent.insertBefore(cursorNode,anchorNode);var cursor=domRange._document.body.createTextRange();cursor.moveToElementText(cursorNode);cursorNode.parentNode.removeChild(cursorNode);textRange.setEndPoint(bStart?"StartToStart":"EndToStart",cursor);textRange[bStart?"moveStart":"moveEnd"]("character",textOffset)}var textRange=domRange._document.body.createTextRange();adoptEndPoint(textRange,domRange,true);adoptEndPoint(textRange,domRange,false);return textRange}};function DOMRange(document){this._document=document;this.startContainer=this.endContainer=document.body;this.endOffset=DOMUtils.getNodeLength(document.body)}DOMRange.START_TO_START=0;DOMRange.START_TO_END=1;DOMRange.END_TO_END=2;DOMRange.END_TO_START=3;DOMRange.prototype={startContainer:null,startOffset:0,endContainer:null,endOffset:0,commonAncestorContainer:null,collapsed:false,_document:null,_refreshProperties:function(){this.collapsed=(this.startContainer==this.endContainer&&this.startOffset==this.endOffset);var node=this.startContainer;while(node&&node!=this.endContainer&&!DOMUtils.isAncestorOf(node,this.endContainer)){node=node.parentNode}this.commonAncestorContainer=node},setStart:function(container,offset){this.startContainer=container;this.startOffset=offset;this._refreshProperties()},setEnd:function(container,offset){this.endContainer=container;this.endOffset=offset;this._refreshProperties()},setStartBefore:function(refNode){this.setStart(refNode.parentNode,DOMUtils.findChildPosition(refNode))},setStartAfter:function(refNode){this.setStart(refNode.parentNode,DOMUtils.findChildPosition(refNode)+1)},setEndBefore:function(refNode){this.setEnd(refNode.parentNode,DOMUtils.findChildPosition(refNode))},setEndAfter:function(ref
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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()}};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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||!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=[];this.highWaterMarkReached=false};GENTICS.Aloha.Log=new GENTICS.Aloha.Log();
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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(
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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=[]};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").empty();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();
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.PluginRegistry=function(){this.plugins=[]};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(typeof 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)};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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={};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={};this.selection;this.children=[]};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.inselection=false;if(GENTICS.Uti
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@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(){};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.RepositoryManager=function(){this.repositories=[]};GENTICS.Aloha.RepositoryManager.prototype.openCallbacks=[];GENTICS.Aloha.RepositoryManager.prototype.init=function(){if(GENTICS.Aloha.settings.repositories==undefined){GENTICS.Aloha.settings.repositories={}}for(var i=0;i<this.repositories.length;i++){var repository=this.repositories[i];if(repository.settings==undefined){repository.settings={}}if(GENTICS.Aloha.settings.repositories[repository.repositoryId]){jQuery.extend(repository.settings,GENTICS.Aloha.settings.repositories[repository.repositoryId])}repository.init()}};GENTICS.Aloha.RepositoryManager.prototype.register=function(repository){if(repository instanceof GENTICS.Aloha.Repository){if(!this.getRepository(repository.repositoryId)){this.repositories.push(repository)}else{GENTICS.Aloha.Log.warn(this,"A repository with name { "+repository.repositoryId+" } already registerd. Ignoring this.")}}else{GENTICS.Aloha.Log.error(this,"Trying to register a repository which is not an instance of GENTICS.Aloha.Repository.")}};GENTICS.Aloha.RepositoryManager.prototype.getRepository=function(repositoryId){for(var i=0;i<this.repositories.length;i++){if(this.repositories[i].repositoryId==repositoryId){return this.repositories[i]}}return null};GENTICS.Aloha.RepositoryManager.prototype.query=function(params,callback){var that=this;var allitems=[];var repositories=[];this.openCallbacks=[];var timer=setTimeout(function(){that.openCallbacks=[];that.queryCallback(callback,allitems,timer)},5000);if(params.repositoryId){repositories.push(this.getRepository(params.repositoryId))}else{repositories=this.repositories}for(var i=0;i<repositories.length;i++){this.openCallbacks.push(repositories[i].repositoryId);try{var notImplemented=repositories[i].query(params,function(items){var id=that.openCallbacks.indexOf(this.repositoryId);if(id!=-1){that.openCallbacks.splice(id,1)}if(!items.length==0&&!items[0].repositoryId){for(var j=0;j<items.length;j++){items[j].repositoryId=this.repositoryId}}jQuery.merge(allitems,items);that.queryCallback(callback,allitems,timer)})}catch(e){notImplemented=true}if(notImplemented){var id=that.openCallbacks.indexOf(repositories[i].repositoryId);if(id!=-1){this.openCallbacks.splice(id,1);if(i==repositories.length-1){this.queryCallback(callback,allitems,timer)}}}}};GENTICS.Aloha.RepositoryManager.prototype.queryCallback=function(cb,items,timer){if(this.openCallbacks.length==0){clearTimeout(timer);items.sort(function(a,b){return b.weight-a.weight});var result={results:items.length,items:items};cb.call(this,result)}};GENTICS.Aloha.RepositoryManager.prototype.getChildren=function(params,callback){var that=this;var allitems=[];var repositories=[];this.openChildrenCallbacks=[];if(params.inFolderId=="aloha"&&this.repositories.length>0){var repos=[];for(var i=0;i<this.repositories.length;i++){repos.push(new GENTICS.Aloha.Repository.Folder({id:this.repositories[i].repositoryId,name:this.repositories[i].repositoryName,repositoryId:this.repositories[i].repositoryId,type:"repository",hasMoreItems:true}))}that.getChildrenCallback(callback,repos,null);return}var timer=setTimeout(function(){that.openChildrenCallbacks=[];that.getChildrenCallback(callback,allitems,timer)},5000);if(params.repositoryId){repositories.push(this.getRepository(params.repositoryId))}else{repositories=this.repositories}for(var i=0;i<repositories.length;i++){this.openChildrenCallbacks.push(repositories[i].repositoryId);try{var notImplemented=repositories[i].getChildren(params,function(items){var id=that.openChildrenCallbacks.indexOf(this.repositoryId);if(id!=-1){that.openChildrenCallbacks.splice(id,1)}jQuery.merge(allitems,items);that.getChildrenCallback(callback,allitems,timer)})}catch(e){notImplemented=true}if(notImplemented){var id=that.openChildrenCallbacks.indexOf(repositories[i].repositoryId);if(id!=-1){this.openChildrenCallbacks.splice(id,1);if(i==repositories.length-1){this.getChildrenCallback(callback,allitems,timer)}}}}};GENTICS.Aloha.RepositoryManager.prototype.getChildrenCallback=function(cb,items,timer){if(this.openChildrenCallbacks.le
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.Repository=function(repositoryId,repositoryName){this.repositoryId=repositoryId;this.settings={};this.repositoryName=(repositoryName)?repositoryName:repositoryId;GENTICS.Aloha.RepositoryManager.register(this)};GENTICS.Aloha.Repository.prototype.init=function(){};GENTICS.Aloha.Repository.prototype.query=function(params,callback){return true};GENTICS.Aloha.Repository.prototype.getChildren=function(params,callback){return true};GENTICS.Aloha.Repository.prototype.makeClean=function(obj){};GENTICS.Aloha.Repository.prototype.markObject=function(obj,repositoryItem){};
/*
* This file is part of Aloha Editor
* Author & Copyright (c) 2010 Gentics Software GmbH, aloha@gentics.com
* Licensed unter the terms of http://www.aloha-editor.com/license.html
*/
GENTICS.Aloha.Repository.Document=function(properties){var p=properties;this.type="document";if(!p.id||!p.name||!p.repositoryId){return}GENTICS.Utils.applyProperties(this,properties);this.baseType="document"};GENTICS.Aloha.Repository.Folder=function(properties){var p=properties;this.type="folder";if(!p.id||!p.name||!p.repositoryId){return}GENTICS.Utils.applyProperties(this,properties);this.baseType="folder"};