diff --git a/ccm-core/web/assets/jquery.js b/ccm-core/web/assets/jquery.js index 16ad06c5a..da4170647 100644 --- a/ccm-core/web/assets/jquery.js +++ b/ccm-core/web/assets/jquery.js @@ -1,4 +1,6 @@ -/*! jQuery v1.7.2 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( -a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f -.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery-1.10.2.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x(" + + +
+ + diff --git a/ccm-core/web/assets/xinha/plugins/ExtendedFileManager/editorFrame.php b/ccm-core/web/assets/xinha/plugins/ExtendedFileManager/editorFrame.php new file mode 100644 index 000000000..30fb3109d --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/ExtendedFileManager/editorFrame.php @@ -0,0 +1,84 @@ +processImage(); + +?> + + + + + + + + + + + + +
+ +isGDEditable() == -1) { ?> +
GIF format is not supported, image editing not supported.
+ + + + + +
+ 0 && is_file($imageInfo['fullpath'])) { ?> + alt="" id="theImage" name="theImage"> + + No Image Available + +
+ + diff --git a/ccm-core/web/assets/xinha/plugins/ExtendedFileManager/file-picker.js b/ccm-core/web/assets/xinha/plugins/ExtendedFileManager/file-picker.js new file mode 100644 index 000000000..09777279c --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/ExtendedFileManager/file-picker.js @@ -0,0 +1,164 @@ +/** + * An input field File Picker utilising the Xinha ExtendedFileManager. + * + * Hijack the Xinha ExtendedFileManager plugin to provide a file URL picker + * for any form input field in the form of a "Browse" button to the + * right of the field, in the same manner as a file type input field + * except it opens the familiar ExtendedFileManager dialog to upload/select + * a file and returns the URL of the file to the field's value. + * + * Example Usage: + * + * + * + * + * + * @author $Author$ + * @version $Id$ + * @package ImageManager + */ + + +function FilePicker(field) +{ + this.field = field; + var picker = this; + + var but = document.createElement('input'); + but.type = 'button'; + but.value = 'Browse'; + but.onclick = function() { picker.popup_picker(); } + + field.parentNode.insertBefore(but,field.nextSibling); + field.size = '20'; + field.style.textAlign = 'right'; +}; + +FilePicker.prototype.backend = _editor_url + 'plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&'; +FilePicker.prototype.backend_data = null; + +FilePicker.prototype.append_query_string = true; + +FilePicker.prototype.popup_picker = function() +{ + var picker = this; // closure for later + var outparam = null; + if(picker.field.value) + { + outparam = + { + f_href : picker.field.value, + f_title : '', + f_target : '', + f_usetarget : false, + baseHref: null + }; + + } + + var manager = this.backend + '__function=manager&mode=link'; + if(this.backend_config != null) + { + manager += '&backend_config=' + + encodeURIComponent(this.backend_config); + manager += '&backend_config_hash=' + + encodeURIComponent(this.backend_config_hash); + manager += '&backend_config_secret_key_location=' + + encodeURIComponent(this.backend_config_secret_key_location); + } + + if(this.backend_data != null) + { + for ( var i in this.backend_data ) + { + manager += '&' + i + '=' + encodeURIComponent(this.backend_data[i]); + } + } + + Dialog(manager, function(param) { + if (!param) { // user must have pressed Cancel + return false; + } + + picker.field.value = param.f_href; + + }, outparam); +} + +// Dialog is part of Xinha, but we'll provide it here incase Xinha's not being +// loaded. +if(typeof Dialog == 'undefined') +{ + // htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc. + // This copyright notice MUST stay intact for use (see license.txt). + // + // Portions (c) dynarch.com, 2003-2004 + // + // A free WYSIWYG editor replacement for '); + }, + 'form' + ]; + + this.editor.config.btnList.insert_select_field = + [ this._lc("Insert a select field."), + [buttonsImage, 3, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; + + this.editor.config.btnList.insert_cb_field = + [ this._lc("Insert a check box."), + [buttonsImage, 4, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; + + this.editor.config.btnList.insert_rb_field = + [ this._lc("Insert a radio button."), + [buttonsImage, 5, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; + + this.editor.config.btnList.insert_button = + [ this._lc("Insert a submit/reset button."), + [buttonsImage, 6, 0], + false, + function() + { + pasteAndSelect(''); + }, + 'form' + ]; +} + +FormOperations.prototype.onGenerate = function() +{ + // Gecko does not register click events on select lists inside the iframe + // so the only way of detecting that is to do an event on mouse move. + if( Xinha.is_gecko) + { + var editor = this.editor; + var doc = this.editor._doc; + Xinha._addEvents + (doc, ["mousemove"], + function (event) { + return editor._editorEvent(event); + }); + } +}; + +FormOperations.prototype._preparePanel = function () +{ + var fo = this; + if(this.html == false) + { + + Xinha._getback(Xinha.getPluginDir('FormOperations') + '/panel.html', + function(txt) + { + fo.html = txt; + fo._preparePanel(); + } + ); + return false; + } + + if(typeof Xinha.Dialog == 'undefined') + { + Xinha._loadback + (_editor_url + 'modules/Dialogs/XinhaDialog.js', function() { fo._preparePanel(); } ); + return false; + } + + if(typeof Xinha.PanelDialog == 'undefined') + { + Xinha._loadback + (_editor_url + 'modules/Dialogs/panel-dialog.js', function() { fo._preparePanel(); } ); + return false; + } + + + + this.panel = new Xinha.PanelDialog(this.editor,'bottom',this.html,'FormOperations'); + this.panel.hide(); + this.ready = true; +}; + +FormOperations.prototype.onUpdateToolbar = function() +{ + if(!this.ready) return true; + var activeElement = this.editor._activeElement(this.editor._getSelection()); + if(activeElement != null) + { + if(activeElement == this.activeElement) return true; + + var tag = activeElement.tagName.toLowerCase(); + + this.hideAll(); + if(tag === 'form') + { + if(this.editor.config.FormOperations.allow_edit_form) + { + this.showForm(activeElement); + } + else + { + this.panel.hide(); + this.activeElement = null; + this.panel.hide(); + return true; + } + } + else + { + + if(this.editor.config.FormOperations.allow_edit_form && typeof activeElement.form != 'undefined' && activeElement.form) + { + this.showForm(activeElement.form); + } + + switch(tag) + { + case 'form': + { + this.showForm(activeElement); + } + break; + + case 'input': + { + switch(activeElement.getAttribute('type').toLowerCase()) + { + case 'text' : + case 'password': + case 'hidden' : + { + this.showText(activeElement); + } + break; + + case 'radio' : + case 'checkbox': + { + this.showCbRd(activeElement); + } + break; + + case 'submit' : + case 'reset' : + case 'button' : + { + this.showButton(activeElement); + } + break; + } + } + break; + + case 'textarea': + { + this.showTextarea(activeElement); + } + break; + + case 'select': + { + this.showSelect(activeElement); + } + break; + + default: + { + this.activeElement = null; + this.panel.hide(); + return true; + } + } + } + + this.panel.show(); + + //this.editor.scrollToElement(activeElement); + this.activeElement = activeElement; + return true; + } + else + { + this.activeElement = null; + this.panel.hide(); + return true; + } +}; + + +FormOperations.prototype.hideAll = function() +{ + this.panel.getElementById('fs_form').style.display = 'none'; + this.panel.getElementById('fs_text').style.display = 'none'; + this.panel.getElementById('fs_textarea').style.display = 'none'; + this.panel.getElementById('fs_select').style.display = 'none'; + this.panel.getElementById('fs_cbrd').style.display = 'none'; + this.panel.getElementById('fs_button').style.display = 'none'; +}; + +FormOperations.prototype.showForm = function(form) +{ + this.panel.getElementById('fs_form').style.display = ''; + var vals = + { + 'action' : form.action, + 'method' : form.method.toUpperCase() + } + this.panel.setValues(vals); + var f = form; + this.panel.getElementById('action').onkeyup = function () { f.action = this.value; }; + this.panel.getElementById('method').onchange = function () { f.method = this.options[this.selectedIndex].value; }; +}; + +FormOperations.prototype.showText = function (input) +{ + this.panel.getElementById('fs_text').style.display = ''; + + var vals = + { + 'text_name' : this.deformatName(input, input.name), + 'text_value' : input.value, + 'text_type' : input.type.toLowerCase(), + 'text_width' : input.style.width ? parseFloat(input.style.width.replace(/[^0-9.]/, '')) : '', + 'text_width_units': input.style.width ? input.style.width.replace(/[0-9.]/, '').toLowerCase() : 'ex', + 'text_maxlength' : input.maxlength ? input.maxlength : '' + } + this.panel.setValues(vals); + + var i = input; + var fo = this; + + this.panel.getElementById('text_name').onkeyup = function () { i.name = fo.formatName(i, this.value); } + this.panel.getElementById('text_value').onkeyup = function () { i.value = this.value; } + this.panel.getElementById('text_type').onchange = function () + { + if(!Xinha.is_ie) + { + i.type = this.options[this.selectedIndex].value; + } + else + { + // IE does not permit modifications of the type of a form field once it is set + // We therefor have to destroy and recreate it. I swear, if I ever + // meet any of the Internet Explorer development team I'm gonna + // kick them in the nuts! + var tmpContainer = fo.editor._doc.createElement('div'); + if(!/type=/.test(i.outerHTML)) + { + tmpContainer.innerHTML = i.outerHTML.replace(/ 0 ? input.size : 1), + 'select_height_units': input.style.height ? input.style.height.replace(/[0-9.]/, '').toLowerCase() : 'items' + }; + + this.panel.setValues(vals); + + var i = input; + var fo = this; + this.panel.getElementById('select_name').onkeyup = function () { i.name = fo.formatName(i, this.value); }; + this.panel.getElementById('select_multiple').onclick = function () { i.multiple = this.checked; }; + + var w = this.panel.getElementById('select_width'); + var wu = this.panel.getElementById('select_width_units'); + + this.panel.getElementById('select_width').onkeyup = + this.panel.getElementById('select_width_units').onchange = + function () + { + if(!w.value || isNaN(parseFloat(w.value))) + { + i.style.width = ''; + } + i.style.width = parseFloat(w.value) + wu.options[wu.selectedIndex].value; + }; + + var h = this.panel.getElementById('select_height'); + var hu = this.panel.getElementById('select_height_units'); + + this.panel.getElementById('select_height').onkeyup = + this.panel.getElementById('select_height_units').onchange = + function () + { + if(!h.value || isNaN(parseFloat(h.value))) + { + i.style.height = ''; + return; + } + + if(hu.selectedIndex == 0) + { + i.style.height = ''; + i.size = parseInt(h.value); + } + else + { + i.style.height = parseFloat(h.value) + hu.options[hu.selectedIndex].value; + } + }; + + + var fo_sel = this.panel.getElementById('select_options'); + this.arrayToOpts(this.optsToArray(input.options), fo_sel.options); + + this.panel.getElementById('add_option').onclick = + function() + { + var txt = prompt(Xinha._lc("Enter the name for new option.", 'FormOperations')); + if(txt == null) return; + var newOpt = new Option(txt); + var opts = fo.optsToArray(fo_sel.options); + if(fo_sel.selectedIndex >= 0) + { + opts.splice(fo_sel.selectedIndex, 0, newOpt); + } + else + { + opts.push(newOpt); + } + fo.arrayToOpts(opts, input.options); + fo.arrayToOpts(opts, fo_sel.options); + }; + + this.panel.getElementById('del_option').onclick = + function() + { + var opts = fo.optsToArray(fo_sel.options); + var newOpts = [ ]; + for(var i = 0; i < opts.length; i++) + { + if(opts[i].selected) continue; + newOpts.push(opts[i]); + } + fo.arrayToOpts(newOpts, input.options); + fo.arrayToOpts(newOpts, fo_sel.options); + }; + + this.panel.getElementById('up_option').onclick = + function() + { + if(!(fo_sel.selectedIndex > 0)) return; + var opts = fo.optsToArray(fo_sel.options); + var move = opts.splice(fo_sel.selectedIndex, 1).pop(); + opts.splice(fo_sel.selectedIndex - 1, 0, move); + fo.arrayToOpts(opts, input.options); + fo.arrayToOpts(opts, fo_sel.options); + }; + + this.panel.getElementById('down_option').onclick = + function() + { + if(fo_sel.selectedIndex == fo_sel.options.length - 1) return; + var opts = fo.optsToArray(fo_sel.options); + var move = opts.splice(fo_sel.selectedIndex, 1).pop(); + opts.splice(fo_sel.selectedIndex+1, 0, move); + fo.arrayToOpts(opts, input.options); + fo.arrayToOpts(opts, fo_sel.options); + }; + + this.panel.getElementById('select_options').onchange = + function() + { + fo.arrayToOpts(fo.optsToArray(fo_sel.options), input.options); + }; +}; + +FormOperations.prototype.optsToArray = function(o) +{ + var a = [ ]; + for(var i = 0; i < o.length; i++) + { + a.push( + { + 'text' : o[i].text, + 'value' : o[i].value, + 'defaultSelected' : o[i].defaultSelected, + 'selected' : o[i].selected + } + ); + } + return a; +}; + +FormOperations.prototype.arrayToOpts = function(a, o) +{ + for(var i = o.length -1; i >= 0; i--) + { + o[i] = null; + } + + for(var i = 0; i < a.length; i++) + { + o[i] = new Option(a[i].text, a[i].value, a[i].defaultSelected, a[i].selected); + } +}; + +FormOperations.prototype.formatName = function(input, name) +{ + + // Multiple name + var mname = name; + switch(this.editor.config.FormOperations.multiple_field_format) + { + case 'php': + { + mname += '[]'; + } + break; + + case 'unmodified': + { + // Leave as is. + } + break; + + default: + { + throw("Unknown multiple field format " + this.editor.config.FormOperations.multiple_field_format); + } + } + + if + ( + (input.tagName.toLowerCase() == 'select' && input.multiple) + || (input.tagName.toLowerCase() == 'input' && input.type.toLowerCase() == 'checkbox') + ) + { + name = mname; + } + + return name; +}; + +FormOperations.prototype.deformatName = function(input, name) +{ + if(this.editor.config.FormOperations.multiple_field_format == 'php') + { + name = name.replace(/\[\]$/, ''); + } + + return name; +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/README b/ccm-core/web/assets/xinha/plugins/FormOperations/README new file mode 100644 index 000000000..d816c67e2 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/README @@ -0,0 +1,32 @@ +Form Operations Plugin +---------------------- + +Usage: + 1. Follow the standard procedure for loading a plugin. + 2. You may configure the plugin by setting the following configuration variables, or leave them as the defaults. + + xinha_config.FormOperations.multiple_field_format + = 'php' + this will cause checkbox and "multiple" select fields to have [] + appended to thier field names silently + = 'unmodified' + field names will not be silently modified + + xinha_config.FormOperations.allow_edit_form + = true + the user will be able to edit the action, and method of forms + = false + neither action, nor method is editable + + xinha_config.FormOperations.default_form_action + = 'whatever you want' + the default form action to set when inserting a form. The standard one is a php file in the Form Operations directory which will email the form post to enquiries@ + + xinha_config.FormOperations.default_form_html + = '
whatever you want here
' + the default html to insert when inserting a form. The standard one is a basic contact form. If you would like to specify an external file which contains the HTML for the form, you may do so via + = HTMLArea._geturlcontent('http://absolute/url/to/file.html') + see default_form.html for a suitable example, pay attention to the form tag. + + + diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/default_form.html b/ccm-core/web/assets/xinha/plugins/FormOperations/default_form.html new file mode 100644 index 000000000..9e7d4e12a --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/default_form.html @@ -0,0 +1,36 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Contact Us
Your name:
Your email:
Message Subject:
What are your hobbies? + Marbles
+ Conkers
+ Jacks +
Message Body:
+ +
+    +
\ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/formmail.php b/ccm-core/web/assets/xinha/plugins/FormOperations/formmail.php new file mode 100644 index 000000000..5d8b32832 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/formmail.php @@ -0,0 +1,95 @@ +'; + + $emailfield = NULL; + $subjectfield = NULL; + $namefield = NULL; + + $when_done_goto = isset($_REQUEST['when_done_goto']) ? $_REQUEST['when_done_goto'] : NULL; + + if($_POST) + { + unset($_POST['when_done_goto']); + $message = ''; + $longestKey = 0; + foreach(array_keys($_POST) as $key) + { + $longestKey = max(strlen($key), $longestKey); + } + $longestKey = max($longestKey, 15); + + foreach($_POST as $Var => $Val) + { + if(!$emailfield) + { + if(preg_match('/(^|\s)e-?mail(\s|$)/i', $Var)) + { + $emailfield = $Var; + } + } + + if(!$subjectfield) + { + if(preg_match('/(^|\s)subject(\s|$)/i', $Var)) + { + $subjectfield = $Var; + } + } + + if(!$namefield) + { + if(preg_match('/(^|\s)from(\s|$)/i', $Var) || preg_match('/(^|\s)name(\s|$)/i', $Var)) + { + $namefield = $Var; + } + } + + if(is_array($Val)) + { + $Val = implode(', ', $Val); + } + + $message .= $Var; + if(strlen($Var) < $longestKey) + { + $message .= str_repeat('.', $longestKey - strlen($Var)); + } + $message .= ':'; + if((64 - max(strlen($Var), $longestKey) < strlen($Val)) || preg_match('/\r?\n/', $Val)) + { + $message .= "\r\n "; + $message .= preg_replace('/\r?\n/', "\r\n ", wordwrap($Val, 62)); + } + else + { + $message .= ' ' . $Val . "\r\n"; + } + } + + $subject = $subjectfield ? $_POST[$subjectfield] : 'Enquiry'; + $email = $emailfield ? $_POST[$emailfield] : $send_to; + if($namefield) + { + $from = $_POST[$namefield] . ' <' . $email . '>'; + } + else + { + $from = 'Website Visitor' . ' <' . $email . '>'; + } + + mail($send_to, $subject, $message, "From: $from"); + + if(!$when_done_goto) + { + ?> + Message Sent

Message Sent

+ diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/iframe.css b/ccm-core/web/assets/xinha/plugins/FormOperations/iframe.css new file mode 100644 index 000000000..2ee1dceff --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/iframe.css @@ -0,0 +1 @@ +form { border: 1px red dotted; } \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/img/buttons.gif b/ccm-core/web/assets/xinha/plugins/FormOperations/img/buttons.gif new file mode 100644 index 000000000..f414171a3 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/FormOperations/img/buttons.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/lang/de.js b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/de.js new file mode 100644 index 000000000..1ae24c45c --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/de.js @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +// translated: Udo Schmal (gocher), http://www.schaffrath-neuemedien.de/, udo.schmal@t-online.de +{ + "Insert a Form.": "Email Form einfügen.", + "Insert a text, password or hidden field.": "Passwort oder unsichtbares Feld einfügen.", + "Insert a multi-line text field.": "Mehrzeiliges Textfeld einfügen.", + "Insert a select field.": "Auswahlfeld einfügen.", + "Insert a check box.": "Häkchenfeld einfügen", + "Insert a radio button.": "Optionsfeld einfügen", + "Insert a submit/reset button.": "Senden/zurücksetzen Schaltfläche" +}; diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/lang/fr.js b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/fr.js new file mode 100644 index 000000000..a02208e92 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/fr.js @@ -0,0 +1,11 @@ +// I18N constants +// LANG: "fr", ENCODING: UTF-8 +{ + "Insert a Form.": "Insérer un formulaire", + "Insert a text, password or hidden field.": "Insérer un texte, un mot de passe ou un champ invisible", + "Insert a multi-line text field.": "Insérer un champ texte à lignes multiples", + "Insert a select field.": "Insérer une boite de sélection", + "Insert a check box.": "Insérer une case à cocher", + "Insert a radio button.": "Insérer un bouton radio", + "Insert a submit/reset button.": "Insérer un bouton de soumission/annulation" +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/lang/ja.js b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/ja.js new file mode 100644 index 000000000..d716a4a51 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/ja.js @@ -0,0 +1,51 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Insert a Form.": "フォームを挿入", + "Insert a text, password or hidden field.": "テキスト/パスワード/非表示フィールドを挿入", + "Insert a multi-line text field.": "複数行テキストフィールドを挿入", + "Insert a select field.": "選択リストを挿入", + "Insert a check box.": "チェックボックスを挿入", + "Insert a radio button.": "ラジオボタンを挿入", + "Insert a submit/reset button.": "送信/リセットボタンを挿入", + "Form Editor": "フォームエディタ", + "Form": "フォーム", + "Text Field": "テキストフィールド", + "Check Box/Radio Button": "チェックボックス/ラジオボタン", + "Button": "ボタン", + "Multi-line Field": "複数行フィールド", + "Drop-Down/List Field": "ドロップダウン/リスト", + "Action:": "アクション:", + "Method:": "メソッド:", + "Name:": "名前:", + "Type:": "タイプ:", + "Label:": "ラベル:", + "Value:": "値:", + "Width:": "幅:", + "Height:": "高さ:", + "Initial Value:": "初期値:", + "Initial Value": "初期値", + "Max Length:": "最大長:", + "Selected by default:": "デフォルト選択:", + "May Choose Multiple:": "複数選択可能:", + "Options": "選択肢", + "POST": "POST", + "GET": "GET", + 'Check Box ("Select Many")': "チェックボックス(複数選択)", + 'Radio Button ("Select One")': "ラジオボタン(単一選択)", + "normal text field": "標準テキストフィールド", + "password": "パスワード", + "hidden field": "非表示フィールド", + "Submit": "送信", + "Reset": "リセット", + "chars": "文字", + "px": "ピクセル", + "%": "%", + "items": "項目", + "Add": "追加", + "Delete": "削除", + "Move Up": "上へ", + "Move Down": "下へ", + "Tip: Check boxes (select many) and radio buttons (select one only) that are choices for a single question should have the same Name to work correctly.": "ヒント:ひとつの質問について、複数のチェックボックス(複数選択)、または複数のラジオボタン(単一選択)がある場合、すべてに同じ名前を付けなければ正しく機能しません。", + "Enter the name for new option.": "新しい選択肢に名前をつけてください。" +}; diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/lang/nb.js b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/nb.js new file mode 100644 index 000000000..9a47a66c7 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/nb.js @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nb", ENCODING: UTF-8 +// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com +{ + "Insert a Form.": "Sett inn skjema", + "Insert a text, password or hidden field.": "Sett inn formfelt", + "Insert a multi-line text field.": "Sett inn tekstfelt med flere linjer", + "Insert a select field.": "Sett inn valgboks/ netrekksboks", + "Insert a check box.": "Hakeboks", + "Insert a radio button.": "Sett inn en radioknapp", + "Insert a submit/reset button.": "Sett inn send-/nullstill knapp for skjemaet" +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/lang/nl.js b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/nl.js new file mode 100644 index 000000000..375afe423 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/nl.js @@ -0,0 +1,12 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Insert a Form.": "Formulier invoegen", + "Insert a text, password or hidden field.": "Tekst, wachtwoord of verborgen veld invoegen", + "Insert a multi-line text field.": "Een tekstveld met meerdere lijnen invoegen", + "Insert a select field.": "Een selectielijst invoegen", + "Insert a check box.": "Een checkbox invoegen", + "Insert a radio button.": "Een radio knop invoegen", + "Insert a submit/reset button.": "Een verzend/wis knop invoegen" +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/lang/pt_br.js b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/pt_br.js new file mode 100644 index 000000000..bc3ac5ab9 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/lang/pt_br.js @@ -0,0 +1,26 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Enter the name for new option.": "Entre com o nome para nova opção", + "Form Editor": "Editor de Formulários", + "Insert a Form.": "Inserir um Formulário.", + "Insert a check box.": "Inserir uma caixa de opção", + "Insert a multi-line text field.": "Inserir um texto multi-linha.", + "Insert a radio button.": "Inserir um campo de escolha", + "Insert a select field.": "Inserir seleção.", + "Insert a submit/reset button.": "Inserir um botão de envio/reset", + "Insert a text, password or hidden field.": "Inserir um texto, senha ou campo escondido." +} diff --git a/ccm-core/web/assets/xinha/plugins/FormOperations/panel.html b/ccm-core/web/assets/xinha/plugins/FormOperations/panel.html new file mode 100644 index 000000000..661b77547 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/FormOperations/panel.html @@ -0,0 +1,213 @@ +
+

Form Editor

+
+ Form + + + + + + + + +
+
+ +
+ Text Field + + + + + + + + + + + + + + + + + + + + +
Name: + +   
Type: + + Initial Value: + +
Width: + + + Max Length: + +
+
+ +
+ Check Box/Radio Button + + + + + + + + + + + + + + + + +
Name: + + Value: + +
Type: + + Selected by default:
+

+ Tip: Check boxes (select many) and radio buttons (select one only) that are choices for a single question should have the same Name to work correctly. +

+
+
+ +
+ Button + + + + + + + + + + + + + +
Name: + + Label: + +
Type: + +   
+
+ + +
+ Multi-line Field + + + + + + + + + + + + + + + + + + + +
Name:Initial Value
Width: + + +
Height: + + +
+
+ +
+ Drop-Down/List Field + + + + + + + + + + + + + + + + + + + + + +
Name: + + Options
May Choose Multiple: + + + + + +
+ +
+ +
+ +
Width: + + +
Height: + + +
+
+
\ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/Forms/Forms.js b/ccm-core/web/assets/xinha/plugins/Forms/Forms.js new file mode 100644 index 000000000..a1f2129cc --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/Forms.js @@ -0,0 +1,353 @@ +// Form plugin for Xinha +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). + + +function Forms(editor) { + this.editor = editor; + var cfg = editor.config; + var bl = Forms.btnList; + var self = this; + // register the toolbar buttons provided by this plugin + var toolbar = ["linebreak"]; + for (var i = 0; i < bl.length; ++i) { + var btn = bl[i]; + if (!btn) { + toolbar.push("separator"); + } else { + var id = btn[0]; + if (i<3) + cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + }); + else + cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "Forms"), false, + function(editor, id) { + // dispatch button press event + self.buttonPress(editor, id); + },"form"); + toolbar.push(id); + } + } + // add a new line in the toolbar + cfg.toolbar.push(toolbar); +} + +Forms._pluginInfo = { + name : "Forms", + origin : "version: 1.0, by Nelson Bright, BrightWork, Inc., http://www.brightworkweb.com", + version : "2.0", + developer : "Udo Schmal", + developer_url : "", + sponsor : "L.N.Schaffrath NeueMedien", + sponsor_url : "http://www.schaffrath-neuemedien.de/", + c_owner : "Udo Schmal & Schaffrath-NeueMedien", + license : "htmlArea" +}; + +// the list of buttons added by this plugin +Forms.btnList = [ + // form properties button + null, // separator + ["form", "Form"], + null, // separator + // form elements + ["textarea", "Textarea"], + ["select", "Selection Field"], + ["checkbox", "Checkbox"], + ["radio", "Radio Button"], + ["text", "Text Field"], + ["password", "Password Field"], + ["file", "File Field"], + ["button", "Button"], + ["submit", "Submit Button"], + ["reset", "Reset Button"], + ["image", "Image Button"], + ["hidden", "Hidden Field"], + ["label", "Label"], + ["fieldset", "Field Set"] + ]; + +Forms.prototype._lc = function(string) { + return Xinha._lc(string, 'Forms'); +}; + +Forms.prototype.onGenerate = function() { + this.editor.addEditorStylesheet(Xinha.getPluginDir("Forms") + '/forms.css'); +}; + +Forms.prototype.buttonPress = function(editor,button_id, node) { + function optionValues(text,value) { + this.text = text; + this.value = value; + } + var outparam = new Object(); + var type = button_id; + var sel = editor._getSelection(); + var range = editor._createRange(sel); + if (button_id=="form") { //Form + // see if selection is inside an existing 'form' tag + var pe = editor.getParentElement(); + var frm = null; + while (pe && (pe.nodeType == 1) && (pe.tagName.toLowerCase() != 'body')) { + if(pe.tagName.toLowerCase() == "form") { + frm = pe; + break; + } else + pe = pe.parentNode; + } + if (frm) { + outparam.f_name = frm.name; + outparam.f_action = frm.action; + outparam.f_method = frm.method; + outparam.f_enctype = frm.enctype; + outparam.f_target = frm.target; + } else {; + outparam.f_name = ""; + outparam.f_action = ""; + outparam.f_method = ""; + outparam.f_enctype = ""; + outparam.f_target = ""; + } + editor._popupDialog("plugin://Forms/form", function(param) { + if (param) { + if(frm) { + frm.name = param["f_name"]; + frm.setAttribute("action", param["f_action"]); + frm.setAttribute("method", param["f_method"]); + frm.setAttribute("enctype",param["f_enctype"]); + frm.setAttribute("target", param["f_target"]); + } else { + frm = '
'); + } + } + }, outparam); + + } else { // form element (checkbox, radio, text, password, textarea, select, button, submit, reset, image, hidden) + var tagName = ""; + // see if selection is an form element + if (typeof node == "undefined") { + node = editor.getParentElement(); + var tag = node.tagName.toLowerCase() + if (node && (tag == "legend")) { + node = node.parentElement; + tag = node.tagName.toLowerCase(); + } + if (node && !(tag == "textarea" || tag == "select" || tag == "input" || tag == "label" || tag == "fieldset")) + node = null; + } + + if(node) { + type = node.tagName.toLowerCase(); + outparam.f_name = node.name; + tagName = node.tagName; + if (type == "input") { + outparam.f_type = node.type; + type = node.type; + } + switch (type) { + case "textarea": + outparam.f_cols = node.cols; + outparam.f_rows = node.rows; + outparam.f_text = node.innerHTML; + outparam.f_wrap = node.getAttribute("wrap"); + outparam.f_readOnly = node.getAttribute("readOnly"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "select": + outparam.f_size = parseInt(node.size); + outparam.f_multiple = node.getAttribute("multiple"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + var a_options = new Array(); + for (var i=0; i<=node.options.length-1; i++) { + a_options[i] = new optionValues(node.options[i].text, node.options[i].value); + } + outparam.f_options = a_options; + break; + case "text": + case "password": + outparam.f_value = node.value; + outparam.f_size = node.size; + outparam.f_maxLength = node.maxLength; + outparam.f_readOnly = node.getAttribute("readOnly"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "hidden": + outparam.f_value = node.value; + break; + case "submit": + case "reset": + outparam.f_value = node.value; + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "checkbox": + case "radio": + outparam.f_value = node.value; + outparam.f_checked = node.checked; + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "button": + outparam.f_value = node.value; + outparam.f_onclick = node.getAttribute("onclick"); + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "image": + outparam.f_value = node.value; + outparam.f_src = node.src; + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "file": + outparam.f_disabled = node.getAttribute("disabled"); + outparam.f_tabindex = node.getAttribute("tabindex"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "label": + outparam.f_text = node.innerHTML; + outparam.f_for = node.getAttribute("for"); + outparam.f_accesskey = node.getAttribute("accesskey"); + break; + case "fieldset": + if(node.firstChild.tagName.toLowerCase()=="legend") + outparam.f_text = node.firstChild.innerHTML; + else + outparam.f_text = ""; + break; + } + } else { + outparam.f_name = ""; + switch (button_id) { + case "textarea": + case "select": + case "label": + case "fieldset": + tagName = button_id; + break; + default: + tagName = "input"; + outparam.f_type = button_id; + break; + } + outparam.f_options = ""; + outparam.f_cols = "20"; + outparam.f_rows = "4"; + outparam.f_multiple = "false"; + outparam.f_value = ""; + outparam.f_size = ""; + outparam.f_maxLength = ""; + outparam.f_checked = ""; + outparam.f_src = ""; + outparam.f_onclick = ""; + outparam.f_wrap = ""; + outparam.f_readOnly = "false"; + outparam.f_disabled = "false"; + outparam.f_tabindex = ""; + outparam.f_accesskey = ""; + outparam.f_for = ""; + outparam.f_text = ""; + outparam.f_legend = ""; + } + editor._popupDialog("plugin://Forms/" + tagName + ".html", function(param) { + if (param) { + if(param["f_cols"]) + if (isNaN(parseInt(param["f_cols"],10)) || parseInt(param["f_cols"],10) <= 0) + param["f_cols"] = ""; + if(param["f_rows"]) + if(isNaN(parseInt(param["f_rows"],10)) || parseInt(param["f_rows"],10) <= 0) + param["f_rows"] = ""; + if(param["f_size"]) + if(isNaN(parseInt(param["f_size"],10)) || parseInt(param["f_size"],10) <= 0) + param["f_size"] = ""; + if(param["f_maxlength"]) + if(isNaN(parseInt(param["f_maxLength"],10)) || parseInt(param["f_maxLength"],10) <= 0) + param["f_maxLength"] = ""; + if(node) { + //prepare existing Element + for (field in param) { + //alert(field.substring(2,20) + '=' + param[field]); //to be silent! by htanaka + if ((field=="f_text") || (field=="f_options") || (field=="f_onclick") || (field=="f_checked"))continue; + if (param[field] != "") + node.setAttribute(field.substring(2,20), param[field]); + else + node.removeAttribute(field.substring(2,20)); + } + if (type == "textarea") { + node.innerHTML = param["f_text"]; + } else if(type == "select") { + node.options.length = 0; + var optionsList = param["f_options"]; + for (i=0; i<= optionsList.length-1; i++) { + node.options[i] = new Option(optionsList[i].text, optionsList[i].value) + } + } else if(type == "label") { + node.innerHTML = param["f_text"]; + } else if(type == "fieldset") { + if(outparam.f_text != "") { + if(node.firstChild.tagName.toLowerCase()=="legend") + node.firstChild.innerHTML = param["f_text"]; + } else {}// not implemented jet + } else if((type == "checkbox") || (type == "radio")) { //input + if(param["f_checked"]!="") + node.checked = true; + else + node.checked = false; + } else { + if(param["f_onclick"]){ + node.onclick = ""; + if(param["f_onclick"]!="") + node.onclick = param["f_onclick"]; + } + } + } else { + //create Element + var text = ""; + for (field in param) { + if (!param[field]) continue; + if ((param[field]=="") || (field=="f_text")|| (field=="f_options"))continue; + text += " " + field.substring(2,20) + '="' + param[field] + '"'; + } + + if(type == "textarea") { + text = '' + param["f_text"] + ''; + } else if(type == "select") { + text = ''; + var optionsList = param["f_options"]; + for (i=0; i<= optionsList.length-1; i++) { + text += ''; + } + text += ''; + } else if(type == "label") { + text = '' + param["f_text"] + ''; + } else if(type == "fieldset") { + text = ''; + if (param["f_legend"] != "") text += '' + param["f_text"] + ''; + text += ''; + } else { + text = ''; + } + editor.insertHTML(text); + } + } + }, outparam); + } +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/Forms/forms.css b/ccm-core/web/assets/xinha/plugins/Forms/forms.css new file mode 100644 index 000000000..ba0fca64d --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/forms.css @@ -0,0 +1,3 @@ +form { + border: 1px dotted red; +} diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_button.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_button.gif new file mode 100644 index 000000000..cfa4e7d71 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_button.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_checkbox.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_checkbox.gif new file mode 100644 index 000000000..ea7affae5 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_checkbox.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_fieldset.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_fieldset.gif new file mode 100644 index 000000000..af358e53a Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_fieldset.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_file.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_file.gif new file mode 100644 index 000000000..7f61ce137 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_file.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_form.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_form.gif new file mode 100644 index 000000000..a2c293e53 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_form.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_hidden.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_hidden.gif new file mode 100644 index 000000000..26b325de6 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_hidden.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_image.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_image.gif new file mode 100644 index 000000000..3c8c88ece Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_image.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_label.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_label.gif new file mode 100644 index 000000000..f93fce7df Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_label.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_password.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_password.gif new file mode 100644 index 000000000..a799218fd Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_password.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_radio.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_radio.gif new file mode 100644 index 000000000..5b72ef6e8 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_radio.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_reset.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_reset.gif new file mode 100644 index 000000000..68fee8e22 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_reset.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_select.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_select.gif new file mode 100644 index 000000000..3ea59f5c9 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_select.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_submit.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_submit.gif new file mode 100644 index 000000000..0b12a19a0 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_submit.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_text.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_text.gif new file mode 100644 index 000000000..fb8159c01 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_text.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/img/ed_textarea.gif b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_textarea.gif new file mode 100644 index 000000000..c2c874a1c Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/Forms/img/ed_textarea.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/Forms/lang/ja.js b/ccm-core/web/assets/xinha/plugins/Forms/lang/ja.js new file mode 100644 index 000000000..05409f3ff --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/lang/ja.js @@ -0,0 +1,86 @@ +// I18N constants +// LANG: "ja", ENCODING: UTF-8 +{ + "Form": "フォーム", + "Textarea": "テキストエリア", + "Selection Field": "選択肢フィールド", + "Checkbox": "チェックボックス", + "Radio Button": "ラジオボタン", + "Text Field": "テキストフィールド", + "Password Field": "パスワードフィールド", + "File Field": "ファイルフィールド", + "Submit Button": "送信ボタン", + "Reset Button": "リセットボタン", + "Image Button": "画像ボタン", + "Button": "ボタン", + "Hidden Field": "非表示フィールド", + "Label": "ラベル", + "Field Set": "フィールドセット", + "Form Element: INPUT": "フォーム要素: INPUT", + "Form Element: SELECT": "フォーム要素: SELECT", + "Form Element: TEXTAREA": "フォーム要素: TEXTAREA", + "Form Element: LABEL": "フォーム要素: LABEL", + "Form Element: FIELDSET": "フォーム要素: FIELDSET", + "Form Name:": "フォーム名:", + "Form handler script": "フォーム処理スクリプト", + "Action URL:": "アクションURL:", + "Method:": "メソッド:", + "Post": "POST", + "Get": "GET", + "Encoding:": "エンコード:", + "HTML-Form to CGI (default)": "HTMLフォームからCGIへ(デフォルト)", + "multipart Form Data (File-Upload)": "マルチパート(ファイルアップロード用)", + "Target Frame:": "ターゲット:", + "Name/ID:": "名前/ID:", + "Value:": "値:", + "Disabled": "無効", + "Checked": "チェック済み", + "Tab Index:": "タブ順序:", + "Access Key:": "アクセスキー:", + "Read Only": "読み取り専用", + "Dimensions": "大きさ", + "Size:": "サイズ:", + "Max length:": "最大長:", + "Button Script": "ボタンスクリプト", + "'onClick'=": "'onClick'=", + "Image source": "画像ソース", + "Image URL:": "画像URL:", + "Multiple Select": "複数選択", + "Options": "選択肢", + "Lable:": "ラベル:", + "Move Up": "上へ", + "Move Down": "下へ", + "Delete": "削除", + "Add": "追加", + "Columns:": "列数:", + "Rows:": "行数:", + "Wrap Mode:": "折り返し:", + "Off": "オフ", + "Soft": "ソフト", + "Hard": "ハード", + "Physical": "物理的", + "Virtual": "仮想", + "normal": "標準", + "nowrap": "折り返しなし", + "pre": "フォーマット済み", + "Initial Text:": "初期テキスト:", + "Text:": "テキスト:", + "For Control:": "制御対象:", + "Legend:": "グループ名:", + "Cancel": "中止", + "Name": "名前", + "Name of the form input": "フォーム入力の名前", + "Value of the form input": "フォーム入力の値", + "Size of text box in characters": "文字数によるテキストボックスの大きさ", + "Maximum number of characters accepted": "入力可能な最大文字数", + "Javascript for button click": "ボタンクリック時のJavaScritp", + "URL of image": "画像のURL", + "Name of the form select": "", + "name of the textarea": "テキストエリアの名前", + "Width in number of characters": "文字数による幅", + "Height in number of rows": "行数による高さ", + "Default text (optional)": "テキスト初期値(オプション)", + "You must enter the form name": "フォーム名が必要です", + "You must enter a Name": "名前が必要です", + "Please enter a Label": "ラベルを入力してください" +}; diff --git a/ccm-core/web/assets/xinha/plugins/Forms/lang/nl.js b/ccm-core/web/assets/xinha/plugins/Forms/lang/nl.js new file mode 100644 index 000000000..fc5c58286 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/lang/nl.js @@ -0,0 +1,87 @@ +// I18N constants +// LANG: "nl", ENCODING: UTF-8 +// Author: Maarten Molenschot, maarten@nrgmm.nl +{ + "Form": "Formulier", + "Textarea": "Tekstgebied", + "Selection Field": "Selectielijst", + "Checkbox": "Checkbox", + "Radio Button": "Radio knop", + "Text Field": "Tekstveld", + "Password Field": "Wachtwoordveld", + "File Field": "Bestandsveld", + "Submit Button": "Verzend knop", + "Reset Button": "Wis knop", + "Image Button": "Afbeelding knop", + "Button": "Knop", + "Hidden Field": "Verborgen veld", + "Label": "Label", + "Field Set": "Veldset", + "Form Element: INPUT": "Formulier element: INPUT", + "Form Element: SELECT": "Formulier element: SELECT", + "Form Element: TEXTAREA": "Formulier element: TEXTAREA", + "Form Element: LABEL": "Formulier element: LABEL", + "Form Element: FIELDSET": "Formulier element: FIELDSET", + "Form Name:": "Formulier naame:", + "Form handler script": "Formulier script", + "Action URL:": "Actie URL:", + "Method:": "Methode:", + "Post": "POST", + "Get": "GET", + "Encoding:": "Encodering:", + "HTML-Form to CGI (default)": "HTML formulier naar CGI (standaard)", + "multipart Form Data (File-Upload)": "Multipart formulier data(Bestands upload)", + "Target Frame:": "Doel venster:", + "Name/ID:": "Naam/ID:", + "Value:": "Waarde:", + "Disabled": "Uitgeschakeld", + "Checked": "Checked", + "Tab Index:": "Tab volgorde:", + "Access Key:": "Toegangs toets:", + "Read Only": "Alleen lezen", + "Dimensions": "Dimenties", + "Size:": "Grootte:", + "Max length:": "Maximale lengte:", + "Button Script": "Knop script", + "'onClick'=": "'onClick'=", + "Image source": "Afbeelding bron", + "Image URL:": "Afbeelding URL:", + "Multiple Select": "Meerdere selectie mogelijkheden", + "Options": "Opties", + "Lable:": "Label:", + "Move Up": "Omhoog", + "Move Down": "Omlaag", + "Delete": "Verwijderen", + "Add": "Toevoegen", + "Columns:": "Kolommen:", + "Rows:": "Rijen:", + "Wrap Mode:": "Terugloop:", + "Off": "Uit", + "Soft": "Zacht", + "Hard": "Hard", + "Physical": "Fysiek", + "Virtual": "Virtueel", + "normal": "normaal", + "nowrap": "geen terugloop", + "pre": "pre", + "Initial Text:": "Start tekst:", + "Text:": "Tekst:", + "For Control:": "Voor controle:", + "Legend:": "Legend:", + "Cancel": "Annuleren", + "Name": "Naame", + "Name of the form input": "Naam van formulier invoer", + "Value of the form input": "Waarde van formulier invoer", + "Size of text box in characters": "Grootte van tekstveld in tekens", + "Maximum number of characters accepted": "Maximaal aantal tekens toegestaan", + "Javascript for button click": "Knop klik met JavaScript", + "URL of image": "Afbeelding URL", + "Name of the form select": "Naam van formulier select", + "name of the textarea": "Naam van tekst gebied", + "Width in number of characters": "Breedte in aantal tekens", + "Height in number of rows": "Hoogte in aantal tekens", + "Default text (optional)": "Standaard tekst (optioneel)", + "You must enter the form name": "Voer een formulier Naam in", + "You must enter a Name": "Voer een Naam in", + "Please enter a Label": "Voer een Label in" +}; diff --git a/ccm-core/web/assets/xinha/plugins/Forms/lang/pt_br.js b/ccm-core/web/assets/xinha/plugins/Forms/lang/pt_br.js new file mode 100644 index 000000000..640bf61d4 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/lang/pt_br.js @@ -0,0 +1,83 @@ +// I18N constants + +// LANG: "pt_br", ENCODING: UTF-8 +// Portuguese Brazilian Translation + +// Author: Marcio Barbosa, +// MSN: tomarshall@msn.com - ICQ: 69419933 +// Site: http://www.mpg.com.br + +// Last revision: 05 september 2007 +// Please don´t remove this information +// If you modify any source, please insert a comment with your name and e-mail + +// Distributed under the same terms as HTMLArea itself. +// This notice MUST stay intact for use (see license.txt). +{ + "Access Key:": "Tecla de Acesso:", + "Action URL:": "Ação - URL:", + "Button Script": "Script de Botão", + "Cancel": "Cancelar", + "Checked": "Definido", + "Columns:": "Colunas:", + "Default text (optional)": "Texto padrão (opcional)", + "Dimensions": "Dimensões", + "Disabled": "Desativado", + "Encoding:": "Codificação:", + "For Control:": "Para Controle:", + "Form": "Formulário", + "Form Element: FIELDSET": "Elemento do formulário: FIELDSET", + "Form Element: INPUT": "Elemento do formulário: INPUT", + "Form Element: LABEL": "Elemento do formulário: LABEL", + "Form Element: SELECT": "Elemento do formulário: SELECT", + "Form Element: TEXTAREA": "Elemento do formulário: TEXTAREA", + "Form Name:": "Nome do Formulário:", + "Form handler script": "Script do Formulário", + "HTML-Form to CGI (default)": "Formulário para CGI (padrão)", + "Hard": "Difícil", + "Height in number of rows": "Altura em número de linhas", + "Image URL:": "URL da imagem:", + "Image source": "Imagem de Origem", + "Initial Text:": "Texto Inicial:", + "Insert/Edit Form": "Inserir/Editar Formulário", + "Insert/Edit Form Element FIELDSET": "Inserir/Editar Elemento FIELDSET", + "Insert/Edit Form Element INPUT": "Inserir/Editar Elemento INPUT", + "Insert/Edit Form Element LABEL": "Inserir/Editar Elemento LABEL", + "Insert/Edit Form Element SELECT": "Inserir/Editar Elemento SELECT", + "Insert/Edit Form Element TEXTAREA": "Inserir/Editar Elemento TEXTAREA", + "Javascript for button click": "Javascript para botão de clicar", + "Label:": "Etiqueta:", + "Legend:": "Legenda:", + "Max length:": "Comprimento Máx.:", + "Maximum number of characters accepted": "Máximo número de caracteres aceitos", + "Method:": "Método:", + "Name": "Nome", + "Name of the form input": "Nome do formulário de entrada", + "Name of the form select": "Nome do formulário de seleção", + "Name/ID:": "Nome/ID:", + "OK": "OK", + "Off": "Desligado", + "Options": "Opções", + "Physical": "Físico", + "Please enter a Label": "Por favor, entre uma Etiqueta", + "Post": "Post", + "Read Only": "Somente Leitura", + "Rows:": "Linhas:", + "Size of text box in characters": "Tamanho da caixa de texto em caracteres", + "Size:": "Tamanho:", + "Soft": "Fácil", + "Tab Index:": "Ordem de Tabulação:", + "Target Frame:": "Frame de destino:", + "Text:": "Texto:", + "URL of image": "URL da imagem", + "Value of the form input": "Valor do formulário de entrada", + "Value:": "Valor:", + "Virtual": "Virtual", + "Width in number of characters": "Largura em número de caracteres", + "Wrap Mode:": "Modo de quebras:", + "You must enter a Name": "Você precisa entrar com um Nome", + "multipart Form Data (File-Upload)": "Formulário de dados multipart (Enviar arquivo)", + "name of the textarea": "nome da área de texto", + "normal": "normal", + "nowrap": "sem quebras" +} diff --git a/ccm-core/web/assets/xinha/plugins/Forms/popups/fieldset.html b/ccm-core/web/assets/xinha/plugins/Forms/popups/fieldset.html new file mode 100644 index 000000000..2f38d4d88 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/popups/fieldset.html @@ -0,0 +1,45 @@ + + + + Insert/Edit Form Element FIELDSET + + + + + + + +
Form Element: FIELDSET
+ +
Legend:
+ +

+

+ + +
+ + + \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/Forms/popups/form.html b/ccm-core/web/assets/xinha/plugins/Forms/popups/form.html new file mode 100644 index 000000000..daf377f1a --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/popups/form.html @@ -0,0 +1,89 @@ + + + + Insert/Edit Form + + + + + + + +
Form
+
+
Form Name:
+ +

+ +

+ Form handler script +
+
Action URL:
+ +

+

Method:
+ +
+
Encoding:
+ +

+

Target Frame:
+ +

+

+ +
+ + +
+
+ + + diff --git a/ccm-core/web/assets/xinha/plugins/Forms/popups/input.html b/ccm-core/web/assets/xinha/plugins/Forms/popups/input.html new file mode 100644 index 000000000..7bb45f0df --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/popups/input.html @@ -0,0 +1,179 @@ + + + + Insert/Edit Form Element INPUT + + + + + + + + +
+
+
Name/ID:
+ +

+

Value:
+ +

+

Disabled
+ +

+ +

+
Checked
+ +

+

+ +
Tab Index:
+ +

+

Access Key:
+ +

+ +

+
Read Only
+ +

+ +

+ Dimensions +
+
Size:
+ +
+
Max length:
+ +
+
+
+
+
+ Button Script +
+
'onClick'=
+ +
+
+
+
+
+ Image source +
+
Image URL:
+ +
+
+
+
+ + +
+
+ + + diff --git a/ccm-core/web/assets/xinha/plugins/Forms/popups/label.html b/ccm-core/web/assets/xinha/plugins/Forms/popups/label.html new file mode 100644 index 000000000..ada1e8e12 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/popups/label.html @@ -0,0 +1,58 @@ + + + + Insert/Edit Form Element LABEL + + + + + + + +
Form Element: LABEL
+
+
Text:
+ +

+

For Control:
+ +

+

Access Key:
+ +

+

+ + +
+
+ + \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/Forms/popups/select.html b/ccm-core/web/assets/xinha/plugins/Forms/popups/select.html new file mode 100644 index 000000000..72345d11a --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/popups/select.html @@ -0,0 +1,208 @@ + + + + Insert/Edit Form Element SELECT + + + + + + + +
Form Element: SELECT
+
+
Name/ID:
+ +

+

Size:
+ +

+

Multiple Select
+ +

+

Disabled
+ +

+

Tab Index:
+ +

+

+
+ Options + + + + + +
+ + +
+
+ +
+
+ + + + + + + + +
Label:Value:
+
+
+ + +
+
+ + diff --git a/ccm-core/web/assets/xinha/plugins/Forms/popups/textarea.html b/ccm-core/web/assets/xinha/plugins/Forms/popups/textarea.html new file mode 100644 index 000000000..f59125122 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/Forms/popups/textarea.html @@ -0,0 +1,112 @@ + + + + Insert/Edit Form Element TEXTAREA + + + + + + + +
Form Element: TEXTAREA
+
+
Name/ID:
+ +

+

+ Dimensions +
Columns:
+ +

+

Rows:
+ +

+

+
+
Wrap Mode:
+ +

+

Read Only
+ +

+

Disabled
+ +

+

Tab Index:
+ +

+

Access Key:
+ +

+ +

Initial Text:
+ +
+ + +
+
+ + + diff --git a/ccm-core/web/assets/xinha/plugins/FullPage/FullPage.js b/ccm-core/web/assets/xinha/plugins/FullPage/FullPage.js index 83f3e48bd..66a7f7c7f 100644 --- a/ccm-core/web/assets/xinha/plugins/FullPage/FullPage.js +++ b/ccm-core/web/assets/xinha/plugins/FullPage/FullPage.js @@ -1,2 +1,209 @@ -/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ -function FullPage(c){this.editor=c;var a=c.config;a.fullPage=true;var b=this;a.registerButton("FP-docprop",this._lc("Document properties"),c.imgURL("docprop.gif","FullPage"),false,function(d,e){b.buttonPress(d,e)});a.addToolbarElement(["separator","FP-docprop"],"separator",-1)}FullPage._pluginInfo={name:"FullPage",version:"1.0",developer:"Mihai Bazon",developer_url:"http://dynarch.com/mishoo/",c_owner:"Mihai Bazon",sponsor:"Thycotic Software Ltd.",sponsor_url:"http://thycotic.com",license:"htmlArea"};FullPage.prototype._lc=function(a){return Xinha._lc(a,"FullPage")};FullPage.prototype.buttonPress=function(b,a){var q=this;switch(a){case"FP-docprop":var j=b._doc;var m=j.getElementsByTagName("link");var l="";var p="";var e="";var k="";var c="";for(var d=m.length;--d>=0;){var g=m[d];if(/stylesheet/i.test(g.rel)){if(/alternate/i.test(g.rel)){p=g.href}else{l=g.href}}}var f=j.getElementsByTagName("meta");for(var d=f.length;--d>=0;){var o=f[d];if(/content-type/i.test(o.httpEquiv)){r=/^text\/html; *charset=(.*)$/i.exec(o.content);c=r[1]}else{if((/keywords/i.test(o.name))||(/keywords/i.test(o.id))){e=o.content}else{if((/description/i.test(o.name))||(/description/i.test(o.id))){k=o.content}}}}var h=j.getElementsByTagName("title")[0];h=h?h.innerHTML:"";var n={f_doctype:b.doctype,f_title:h,f_body_bgcolor:Xinha._colorToRgb(j.body.style.backgroundColor),f_body_fgcolor:Xinha._colorToRgb(j.body.style.color),f_base_style:l,f_alt_style:p,f_charset:c,f_keywords:e,f_description:k,editor:b};b._popupDialog("plugin://FullPage/docprop",function(i){q.setDocProp(i)},n);break}};FullPage.prototype.setDocProp=function(l){var j="";var u=this.editor._doc;var d=u.getElementsByTagName("head")[0];var b=u.getElementsByTagName("link");var a=u.getElementsByTagName("meta");var m=null;var o=null;var c=null;var f=null;var g=null;var p=null;for(var n=b.length;--n>=0;){var e=b[n];if(/stylesheet/i.test(e.rel)){if(/alternate/i.test(e.rel)){o=e}else{m=e}}}for(var n=a.length;--n>=0;){var h=a[n];if(/content-type/i.test(h.httpEquiv)){r=/^text\/html; *charset=(.*)$/i.exec(h.content);c=r[1];f=h}else{if((/keywords/i.test(h.name))||(/keywords/i.test(h.id))){g=h}else{if((/description/i.test(h.name))||(/description/i.test(h.id))){p=h}}}}function k(v){var i=u.createElement("link");i.rel=v?"alternate stylesheet":"stylesheet";d.appendChild(i);return i}function q(i,v,w){var x=u.createElement("meta");if(i!=""){x.httpEquiv=i}if(v!=""){x.name=v}if(v!=""){x.id=v}x.content=w;d.appendChild(x);return x}if(!m&&l.f_base_style){m=k(false)}if(l.f_base_style){m.href=l.f_base_style}else{if(m){d.removeChild(m)}}if(!o&&l.f_alt_style){o=k(true)}if(l.f_alt_style){o.href=l.f_alt_style}else{if(o){d.removeChild(o)}}if(f){d.removeChild(f);f=null}if(!f&&l.f_charset){f=q("Content-Type","","text/html; charset="+l.f_charset)}if(!g&&l.f_keywords){g=q("","keywords",l.f_keywords)}else{if(l.f_keywords){g.content=l.f_keywords}else{if(g){d.removeChild(g)}}}if(!p&&l.f_description){p=q("","description",l.f_description)}else{if(l.f_description){p.content=l.f_description}else{if(p){d.removeChild(p)}}}for(var n in l){var t=l[n];switch(n){case"f_title":var s=u.getElementsByTagName("title")[0];if(!s){s=u.createElement("title");d.appendChild(s)}else{while(node=s.lastChild){s.removeChild(node)}}if(!Xinha.is_ie){s.appendChild(u.createTextNode(t))}else{u.title=t}break;case"f_doctype":this.editor.setDoctype(t);break;case"f_body_bgcolor":u.body.style.backgroundColor=t;break;case"f_body_fgcolor":u.body.style.color=t;break}}}; \ No newline at end of file +// FullPage Plugin for HTMLArea-3.0 +// Implementation by Mihai Bazon. Sponsored by http://thycotic.com +// +// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc. +// This notice MUST stay intact for use (see license.txt). +// +// A free WYSIWYG editor replacement for + + +
+ + + \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/LICENSE b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/LICENSE new file mode 100644 index 000000000..693e20761 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/LICENSE @@ -0,0 +1,24 @@ +MooTools FileManager - MIT License + +Copyright (c) 2009 Christoph Pojer + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.br.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.br.js new file mode 100644 index 000000000..8ac039924 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.br.js @@ -0,0 +1,72 @@ +/* +Script: Language.br.js + MooTools FileManager - Language Strings in Brazilian Portuguese + +Translation: + [Fabiana Pires](http://twitter.com/nervosinha) +*/ + +FileManager.Language.br = { + more: 'Detalhes', + width: 'Largura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Selecione o arquivo', + upload: 'Upload', + create: 'Criar pasta', + createdir: 'Por favor especifique o nome da pasta:', + cancel: 'Cancelar', + + information: 'Informao', + type: 'Tipo:', + size: 'Tamanho:', + dir: 'Caminho:', + modified: 'ltima modificao:', + preview: 'Pr-visualizao', + close: 'Fechar', + destroy: 'Apagar', + destroyfile: 'Tem certeza que deseja apagar este arquivo?', + + rename: 'Renomear', + renamefile: 'Por favor especifique o novo nome do arquivo:', + + download: 'Download', + nopreview: 'Pr-visualizao indisponvel', + + title: 'Ttulo:', + artist: 'Artista:', + album: 'Album:', + length: 'Tamanho:', + bitrate: 'Bitrate:', + + deselect: 'Desfazer', + + nodestroy: 'Apagar arquivos est desabilitado neste servidor.', + + 'upload.disabled': 'No permitido enviar arquivos neste servidor.', + 'upload.authenticated': 'Voc no est autenticado para enviar arquivos neste servidor.', + 'upload.path': 'A pasta especificada no existe. Por favor contate o administrador do site.', + 'upload.exists': 'A pasta especificada j existe. Por favor contate o administrador do site.', + 'upload.mime': 'O tipo de arquivo especificado no permitido.', + 'upload.extension': 'O arquivo enviado de tipo desconhecido ou proibido.', + 'upload.size': 'O tamanho do arquivo enviado muito grande para ser processado neste servidor. Por favor, envie um arquivo menor.', + 'upload.partial': 'O arquivo enviado foi corrompido, por favor envie o arquivo novamente.', + 'upload.nofile': 'No existe arquivo especificado para ser enviado.', + 'upload.default': 'Erro no envio do arquivo.', + + /* FU */ + uploader: { + unknown: 'Erro desconhecido', + sizeLimitMin: 'No permitido anexar "${name}" (${size}), o tamanho mnimo para o arquivo de ${size_min}!', + sizeLimitMax: 'No permitido anexar "${name}" (${size}), o tamanho mximo para o arquivo de ${size_max}!' + }, + + flash: { + hidden: 'Para habilitar o uploader, desbloqueie a funo em seu browser e recarregue a pgina (veja Adblock).', + disabled: 'Para habilitar o uploader, habilite o arquivo Flash e recarregue a pgina (veja Flashblock).', + flash: 'Para enviar arquivos necessrio instalar o Adobe Flash Player.' + }, + + resizeImages: 'Redimensionar imagens grandes ao enviar' +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.cs.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.cs.js new file mode 100644 index 000000000..f68220bdb --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.cs.js @@ -0,0 +1,73 @@ +/* +Script: Language.cs.js + MooTools FileManager - Language Strings in Czech + +Translation: + [Matěj Grabovský](http://mgrabovsky.is-game.com) +*/ + +FileManager.Language.cs = { + more: 'Podrobnosti', + width: 'Šířka:', + height: 'Výška:', + + ok: 'Ok', + open: 'Vybrat soubor', + upload: 'Nahrát', + create: 'Vytvořit složku', + createdir: 'Prosím zadejte název složky:', + cancel: 'Storno', + + information: 'Informace', + type: 'Typ:', + size: 'Velikost:', + dir: 'Cesta:', + modified: 'Naposledy změněno:', + preview: 'Náhled', + close: 'Zavřít', + destroy: 'Smazat', + destroyfile: 'Určitě chcete smazat tento soubor?', + + rename: 'Přejmenovat', + renamefile: 'Prosím zadejte název nového souboru:', + + download: 'Stáhnout', + nopreview: 'Náhled není dostupný', + + title: 'Název:', + artist: 'Umělec:', + album: 'Album:', + length: 'Délka:', + bitrate: 'Přenosová rychlost:', + + deselect: 'Odstranit z výběru', + + nodestroy: 'Mazání souborů je na tomto serveru zakázáno.', + + 'upload.disabled': 'Nahrávání souborů je na tomto serveru zakázáno.', + 'upload.authenticated': 'Nemáte právo nahrávat soubory.', + 'upload.path': 'Specifikovaná složka pro nahrávání neexistuje. Prosím kontaktujte správce těchto stránek.', + 'upload.exists': 'Specifikovaný soubor již existuje. Prosím kontaktujte správce těchto stránek.', + 'upload.mime': 'Specifikovaný typ souboru není povolen.', + 'upload.extension': 'Nahrávaný soubor má neznámou nebo zakázanou příponu.', + 'upload.size': 'Velikost nahrávaného souboru je přílíš velká. Prosím nahrajte menší soubor.', + 'upload.partial': 'Nahrávaný soubor byl nahrán jen zčásti. Prosím nahrajte ho znovu.', + 'upload.nofile': 'Nebyl vybrán žádný soubor pro nahrání.', + 'upload.default': 'Něco se nepovedlo při nahrávání souboru.', + + /* FU */ + uploader: { + unknown: 'Neznámá chyba', + duplicate: 'Nelze přidat soubor „${name}“ (${size}), byl již přidán!', + sizeLimitMin: 'Nelze přidat soubor „${name}“ (${size}), minimální povolená velikost souboru je ${size_min}!', + sizeLimitMax: 'Nelze přidat soubor „${name}“ (${size}), maximální povolená velikost souboru je ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Pokud chcete nahrávat soubory, musíte mít nainstalovaný Adobe Flash' + }, + + resizeImages: 'Změnšit velké obrázky při nahrávání' +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.da.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.da.js new file mode 100644 index 000000000..add408044 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.da.js @@ -0,0 +1,73 @@ +/* +Script: Language.da.js + MooTools FileManager - Language Strings in Danish + +Translation: + Jan Ebsen +*/ + +FileManager.Language.da = { + more: 'Detaljer', + width: 'Bredde:', + height: 'Højde:', + + ok: 'Ok', + open: 'Vælg fil', + upload: 'Upload', + create: 'Opret mappe', + createdir: 'Angiv venligst mappe navn:', + cancel: 'Anuller', + + information: 'Information', + type: 'Type:', + size: 'Størrelse:', + dir: 'Sti:', + modified: 'Sidst ændret:', + preview: 'Miniature', + close: 'Luk', + destroy: 'Slet', + destroyfile: 'Er du sikker på du vil slette denne fil?', + + rename: 'Omdøb', + renamefile: 'Skriv nyt filnavn:', + + download: 'Download', + nopreview: 'Ingen miniature tilgængelig', + + title: 'Titel:', + artist: 'Kunstner:', + album: 'Album:', + length: 'Længde:', + bitrate: 'Bitrate:', + + deselect: 'Fravælg', + + nodestroy: 'Det er ikke muligt at slette filer på serveren.', + + 'upload.disabled': 'Det er ikke muligt at uploade filer på serveren.', + 'upload.authenticated': 'Du har ikke rettigheder til at uploade filer.', + 'upload.path': 'Upload mappen findes ikke. Kontakt venligst sidens administrator.', + 'upload.exists': 'Upload mappen findes allerede. Kontakt venligst sidens administrator.', + 'upload.mime': 'Fil-typen er ikke tilladt.', + 'upload.extension': 'Filen er af en ukendt, eller ulovlig type.', + 'upload.size': 'Filen er for stor, upload venligst en mindre fil.', + 'upload.partial': 'Filen blev kun delvist uploaded, prøv venligst igen.', + 'upload.nofile': 'Der er ikke angivet nogen fil til upload.', + 'upload.default': 'Noget gik galt med fil-uploaderen.', + + /* FU */ + uploader: { + unknown: 'Ukendt fejl', + duplicate: 'Du kan ikke tilføje "${name}" (${size}), den er allerede tilføjet!', + sizeLimitMin: 'Du kan ikke tilføje "${name}" (${size}), mindst tilladte filstørrelse er ${size_min}!', + sizeLimitMax: 'Du kan ikke tilføje "${name}" (${size}), højst tilladte filstørrelse er ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'For at uploade filer skal du installere Adobe Flash.' + }, + + resizeImages: 'Scaler store billeder ved upload' +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.de.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.de.js new file mode 100644 index 000000000..d4160caa3 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.de.js @@ -0,0 +1,80 @@ +/* +Script: Language.de.js + MooTools FileManager - Language Strings in German + +Translation: + [Christoph Pojer](http://cpojer.net) +*/ + +FileManager.Language.de = { + more: 'Details', + width: 'Breite:', + height: 'Höhe:', + + ok: 'Ok', + open: 'Datei wählen', + upload: 'Datei hochladen', + create: 'Ordner erstellen', + createdir: 'Bitte gib einen Ordnernamen ein:', + cancel: 'Abbrechen', + + information: 'Information', + type: 'Typ:', + size: 'Größe:', + dir: 'Verzeichnis:', + modified: 'Zuletzt bearbeitet:', + preview: 'Vorschau', + close: 'Schließen', + destroy: 'Löschen', + destroyfile: 'Bist du sicher, dass du diese Datei löschen möchtest?', + + rename: 'Umbenennen', + renamefile: 'Gib einen neuen Dateinamen ein:', + + download: 'Download', + nopreview: 'Keine Vorschau verfügbar', + + title: 'Titel:', + artist: 'Artist:', + album: 'Album:', + length: 'Länge:', + bitrate: 'Bitrate:', + + deselect: 'Entfernen', + + nodestroy: 'Dateien löschen wurde auf diesem Server deaktiviert.', + + 'upload.disabled': 'Der Datei-Upload wurde auf diesem Server deaktiviert.', + 'upload.authenticated': 'Upload fehlgeschlagen: Du bist nicht authentifiziert.', + 'upload.path': 'Der angegebene Upload-Ordner existiert nicht. Bitte kontaktiere den Administrator dieser Website.', + 'upload.exists': 'Der angegebene Upload-Speicherort existiert bereits. Bitte kontaktiere den Administrator dieser Website.', + 'upload.mime': 'Der angegebene Dateityp ist nicht erlaubt.', + 'upload.extension': 'Die Datei hat eine unbekannte oder unerlaubte Datei-Erweiterung.', + 'upload.size': 'Die Datei, die du hochgeladen hast, ist zu groß um sie auf diesem Server zu verarbeiten. Bitte lade eine kleinere Datei hoch.', + 'upload.partial': 'Die Datei wurde nur teilweise hochgeladen. Bitte lade sie erneut hoch.', + 'upload.nofile': 'Es wurde keine Datei hochgeladen.', + 'upload.default': 'Der Datei-Upload ist fehlgeschlagen.', + + /* FU */ + uploader: { + unknown: 'Unbekannter Fehler', + sizeLimitMin: 'Die Datei "${name}" (${size}), ist zu klein. Minimaldateigröße: ${size_min}!', + sizeLimitMax: 'Die Datei "${name}" (${size}), ist zu groß. Dateigrößen-Limit: ${size_max}!' + }, + + flash: { + hidden: 'Um den Uploader benutzen zu können, muss er im Browser freigegeben werden und die Seite muss neu geladen werden (Adblock).', + disabled: 'Um den Uploader benutzen zu können, muss die geblockte Flash Datei freigegeben werden und die Seite muss neu geladen werden (Flashblock).', + flash: 'Um Dateien hochzuladen muss Adobe Flash installiert werden.' + }, + + resizeImages: 'Große Bilder bei Upload verkleinern', + + serialize: 'Galerie speichern', + gallery: { + text: 'Bildtext', + save: 'Speichern', + remove: 'Entfernen', + drag: 'Verschiebe Bilder in diesen Bereich um eine Galerie zu erstellen...' + } +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.en.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.en.js new file mode 100644 index 000000000..c90648678 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.en.js @@ -0,0 +1,80 @@ +/* +Script: Language.en.js + MooTools FileManager - Language Strings in English + +Translation: + [Christoph Pojer](http://cpojer.net) +*/ + +FileManager.Language.en = { + more: 'Details', + width: 'Width:', + height: 'Height:', + + ok: 'Ok', + open: 'Select file', + upload: 'Upload', + create: 'Create folder', + createdir: 'Please specify a folder name:', + cancel: 'Cancel', + + information: 'Information', + type: 'Type:', + size: 'Size:', + dir: 'Path:', + modified: 'Created:', + preview: 'Preview', + close: 'Close', + destroy: 'Delete', + destroyfile: 'Are you sure to delete this file?', + + rename: 'Rename', + renamefile: 'Please enter a new file name:', + + download: 'Download', + nopreview: 'No preview available', + + title: 'Title:', + artist: 'Artist:', + album: 'Album:', + length: 'Length:', + bitrate: 'Bitrate:', + + deselect: 'Deselect', + + nodestroy: 'Deleting files has been disabled on this Server.', + + 'upload.disabled': 'Uploading has been disabled on this Server.', + 'upload.authenticated': 'You are not authenticated to upload files.', + 'upload.path': 'The specified Upload-Folder does not exist. Please contact the administrator of this Website.', + 'upload.exists': 'The specified Upload-Location does already exist. Please contact the administrator of this Website.', + 'upload.mime': 'The specified file-type is not allowed.', + 'upload.extension': 'The uploaded file has an unknown or forbidden file extension.', + 'upload.size': 'The size of the file you uploaded is too big to be processed on this server. Please upload a smaller file.', + 'upload.partial': 'The file you uploaded was only partially uploaded, please upload the file again.', + 'upload.nofile': 'There was no file specified to be uploaded.', + 'upload.default': 'Something went wrong with the File-Upload.', + + /* FU */ + uploader: { + unknown: 'Unknown Error', + sizeLimitMin: 'You can not attach "${name}" (${size}), the file size minimum is ${size_min}!', + sizeLimitMax: 'You can not attach "${name}" (${size}), the file size limit is ${size_max}!' + }, + + flash: { + hidden: 'To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).', + disabled: 'To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).', + flash: 'In order to upload files you need to install Adobe Flash.' + }, + + resizeImages: 'Resize big images on upload', + + serialize: 'Save gallery', + gallery: { + text: 'Image caption', + save: 'Save', + remove: 'Remove from gallery', + drag: 'Drag items here to create a gallery...' + } +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.es.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.es.js new file mode 100644 index 000000000..eae5e6bfc --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.es.js @@ -0,0 +1,73 @@ +/* +Script: Language.es.js + MooTools FileManager - Language Strings in Spanish + +Translation: + [Sergio Rubio](http://rubiojr.netcorex.org) +*/ + +FileManager.Language.es = { + more: 'Detalles', + width: 'Anchura:', + height: 'Altura:', + + ok: 'Ok', + open: 'Seleccionar Fichero', + upload: 'Subir ficheros', + create: 'Crear carpeta', + createdir: 'Especifica el nombre de la carpeta:', + cancel: 'Cancelar', + + information: 'Información', + type: 'Tipo:', + size: 'Tamaño:', + dir: 'Ruta:', + modified: 'Última modificación:', + preview: 'Previsualización', + close: 'Cerrar', + destroy: 'Borrar', + destroyfile: '¿Seguro que deseas borrar el fichero?', + + rename: 'Renombrar', + renamefile: 'Especifica un nuevo nombre para el fichero:', + + download: 'Descargar', + nopreview: 'No hay previsualizacion disponible', + + title: 'Título:', + artist: 'Artista:', + album: 'Album:', + length: 'Duración:', + bitrate: 'Bitrate:', + + deselect: 'Desmarcar', + + nodestroy: 'El borrado de ficheros ha sido deshabilitado.', + + 'upload.disabled': 'La carga de archivos ha sido deshabilitada.', + 'upload.authenticated': 'Necesitas autorización para subir ficheros.', + 'upload.path': 'La carpeta destino especificada no existe. Contacta con el administrador del sitio web.', + 'upload.exists': 'El la ruta destino ya existe. Por favor, contacta con el administrador del sitio web.', + 'upload.mime': 'No se permite subir el tipo de fichero especificado.', + 'upload.extension': 'El fichero subido tienen una extensión no permitida o desconocida.', + 'upload.size': 'El tamaño del fichero que intentas subir es demasiado grande para ser procesado por el servidor. Por favor, sube un fichero mas pequeño.', + 'upload.partial': 'El fichero se ha subido parcialmente, por favor, sube el fichero de nuevo.', + 'upload.nofile': 'No se especificó el fichero a subir.', + 'upload.default': 'Algo falló durante la carga del fichero.', + + /* FU */ + uploader: { + unknown: 'Error desconocido', + duplicate: 'No se puede subir "${name}" (${size}), ya ha sido añadido!', + sizeLimitMin: 'No se puede subir "${name}" (${size}), el tamaño mínimo de fichero es ${size_min}!', + sizeLimitMax: 'No se puede subir "${name}" (${size}), el tamaño máximo de fichero es ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Para poder subir ficheros necesitas instalar Adobe Flash.' + }, + + resizeImages: 'Redimensionar las imágenes grandes al subirlas' +}; diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fi.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fi.js new file mode 100644 index 000000000..613ec37e8 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fi.js @@ -0,0 +1,73 @@ +/* +Script: Language.fi.js + MooTools FileManager - Language Strings in Finnish + +Translation: + [Jabis Sevón](http://pumppumedia.com) +*/ + +FileManager.Language.fi = { + more: 'Lisätiedot', + width: 'Leveys:', + height: 'Korkeus:', + + ok: 'Ok', + open: 'Valitse tiedosto', + upload: 'Lähetä', + create: 'Luo kansio', + createdir: 'Kansion nimi:', + cancel: 'Peruuta', + + information: 'Tiedot', + type: 'Tyyppi:', + size: 'Koko:', + dir: 'Polku:', + modified: 'Viimeksi muokattu:', + preview: 'Esikatselu', + close: 'Sulje', + destroy: 'Poista', + destroyfile: 'Haluatko varmasti poistaa tiedoston?', + + rename: 'Nimeä uudelleen', + renamefile: 'Syötä tiedoston uusi nimi:', + + download: 'Lataa', + nopreview: 'Esikatselua ei voida näyttää', + + title: 'Kappaleen nimi:', + artist: 'Artisti:', + album: 'Albumi:', + length: 'Pituus:', + bitrate: 'Bitrate:', + + deselect: 'Poista valinta', + + nodestroy: 'Tiedostojen poisto otettu käytöstä.', + + 'upload.disabled': 'Tiedostojen lähetys otettu käytöstä.', + 'upload.authenticated': 'Sinulla ei ole oikeuksia tiedostojen lähettämiseen.', + 'upload.path': 'Määritettyä kansiota ei löydy. Ole hyvä ja ota yhteyttä sivuston ylläpitäjään.', + 'upload.exists': 'Tiedosto on jo olemassa - siirto peruttu. Ole hyvä ja ota yhteyttä sivuston ylläpitäjään.', + 'upload.mime': 'Tiedostotyyppi ei ole sallittujen listalla - siirto peruttu.', + 'upload.extension': 'Tiedostopääte tuntematon, tai ei sallittujen listalla - siirto peruttu.', + 'upload.size': 'Tiedostokoko liian suuri palvelimelle. Ole hyvä ja siirrä pienempiä tiedostoja.', + 'upload.partial': 'Tiedonsiirto onnistui vain osittain - siirto epäonnistui. Ole hyvä ja siirrä tiedosto uudestaan', + 'upload.nofile': 'Tiedostoa ei määritetty.', + 'upload.default': 'Tiedonsiirto epäonnistui tunnistamattomasta syystä.', + + /* FU */ + uploader: { + unknown: 'Tunnistamaton virhe', + duplicate: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}), koska se on jo siirtolistalla!', + sizeLimitMin: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}). Tiedostojen minimikoko on ${size_min}!', + sizeLimitMax: 'Et voi lisätä seuraavaa tiedostoa: "${name}" (${size}). Tiedostojen maksimikoko on ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Käyttääksesi FileManageria, tarvitset Adobe Flash Playerin. Lataa tästä.' + }, + + resizeImages: 'Pienennä liian suuret kuvat automaattisesti siirron yhteydessä' +}; diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fr.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fr.js new file mode 100644 index 000000000..6e253546d --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.fr.js @@ -0,0 +1,73 @@ +/* +Script: Language.fr.js + MooTools FileManager - Language Strings in French + +Translation: + [Samuel Sanchez](http://www.kromack.com) +*/ + +FileManager.Language.fr = { + more: 'Détails', + width: 'Largeur :', + height: 'Hauteur :', + + ok: 'Ok', + open: 'Sélectionner un fichier', + upload: 'Téléverser', + create: 'Créer un dossier', + createdir: 'Merci de spécifier un nom de dossier :', + cancel: 'Annuler', + + information: 'Informations', + type: 'Type :', + size: 'Taille :', + dir: 'Chemin :', + modified: 'Modifié le :', + preview: 'Aperçu', + close: 'Fermer', + destroy: 'Supprimer', + destroyfile: 'Voulez-vous vraiment supprimer ce fichier ?', + + rename: 'Renommer', + renamefile: 'Merci de spécifier un nouveau nom de fichier :', + + download: 'Télécharger', + nopreview: 'Aucun aperçu disponible', + + title: 'Titre :', + artist: 'Artiste :', + album: 'Album :', + length: 'Durée :', + bitrate: 'Débit :', + + deselect: 'Désélectionner', + + nodestroy: 'La suppression de fichier a été désactivée sur ce serveur.', + + 'upload.disabled': 'Le téléversement de fichier a été désactivé sur ce serveur.', + 'upload.authenticated': 'Vous n\'êtes pas authentifié et ne pouvez pas téléverser de fichier.', + 'upload.path': 'Le répertoire de téléversement spécifié n\'existe pas. Merci de contacter l\'administrateur de ce site Internet.', + 'upload.exists': 'Le chemin de téléversement spécifié existe déjà. Merci de contacter l\'administrateur de ce site Internet.', + 'upload.mime': 'Le type de fichier spécifié n\'est pas autorisé.', + 'upload.extension': 'Le fichier téléversé a une extension inconnue ou interdite.', + 'upload.size': 'La taille de votre fichier est trop grande pour être téléversée sur ce serveur. Merci de sélectionner un fichier moins lourd.', + 'upload.partial': 'Le fichier a été partiellement téléversé, merci de recommencer l\'opération.', + 'upload.nofile': 'Aucun fichier n\'a été spécifié.', + 'upload.default': 'Une erreur s\'est produite.', + + /* FU */ + uploader: { + unknown: 'Erreur inconnue', + duplicate: 'Vous ne pouvez pas ajouter "${name}" (${size}), car l\'élément est déjà ajoutée !', + sizeLimitMin: 'Vous ne pouvez pas ajouter "${name}" (${size}), la taille minimale des fichiers est de ${size_min}!', + sizeLimitMax: 'Vous ne pouvez pas ajouter "${name}" (${size}), la taille maximale des fichiers est de ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'Dans le but de téléverser des fichiers, vous devez installer Adobe Flash.' + }, + + resizeImages: 'Redimensionner les images pendant le téléversement' +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.it.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.it.js new file mode 100644 index 000000000..eaf492222 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.it.js @@ -0,0 +1,80 @@ +/* +Script: Language.it.js + MooTools FileManager - Language Strings in English + +Translation: + Moreno Monga +*/ + +FileManager.Language.it = { + more: 'Dettagli', + width: 'Larghezza:', + height: 'Altezza:', + + ok: 'Ok', + open: 'Seleziona file', + upload: 'Upload', + create: 'Crea cartella', + createdir: 'Specifica il nome della cartella:', + cancel: 'Annulla', + + information: 'Informazioni', + type: 'Tipo:', + size: 'Dimensione:', + dir: 'Percorso:', + modified: 'Ultima modifica:', + preview: 'Anteprima', + close: 'Chiudi', + destroy: 'Cancella', + destroyfile: 'Sei sicuro di voler cancellare questo file?', + + rename: 'Rinomina', + renamefile: 'Scrivi un nuovo nome per il file:', + + download: 'Download', + nopreview: 'Non sono disponibili anteprime', + + title: 'Titolo:', + artist: 'Artista:', + album: 'Album:', + length: 'Lunghezza:', + bitrate: 'Bitrate:', + + deselect: 'Deseleziona', + + nodestroy: 'La cancellazioni dei file è disabilitata.', + + 'upload.disabled': 'L Upload dei file è disabilitato.', + 'upload.authenticated': 'Non sei autorizzato a fare l upload dei file.', + 'upload.path': 'La cartella degli upload non esiste. Contattare il webmaster.', + 'upload.exists': 'La cartella specificata per gli upload esiste già. Contattare il webmaster.', + 'upload.mime': 'Il tipo del file specificato non è consentito.', + 'upload.extension': 'Il tipo di file che si vuole caricare non è consentito o è sconosciuto.', + 'upload.size': 'La dimensione del file è troppo grande per essere processato. Ricarica un file con dimensioni ridotte.', + 'upload.partial': 'Il file è stato parzialmente caricato. Per favore, prova a ricaricarlo.', + 'upload.nofile': 'Non è stato specificato alcun file da caricare.', + 'upload.default': 'Mi spiace, l operazione non è andata a buon fine.', + + /* FU */ + uploader: { + unknown: 'Errore sconosciuto', + sizeLimitMin: 'Non puoi caricare "${name}" (${size}), la dimensione minima del file è ${size_min}!', + sizeLimitMax: 'Non puoi caricare "${name}" (${size}), la dimensione massima del file è ${size_max}!' + }, + + flash: { + hidden: 'To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).', + disabled: 'To enable the embedded uploader, enable the blocked Flash movie and refresh (see Flashblock).', + flash: 'In order to upload files you need to install Adobe Flash.' + }, + + resizeImages: 'Ridimensiona immagini grandi', + + serialize: 'Salva galleria', + gallery: { + text: 'Titolo immagine', + save: 'Salva', + remove: 'Rimuovi dalla galleria', + drag: 'Sposta gli oggetti qui per creare una galleria...' + } +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.nl.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.nl.js new file mode 100644 index 000000000..78f7dffdf --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.nl.js @@ -0,0 +1,72 @@ +/* +Script: Language.nl.js + MooTools FileManager - Language Strings in Dutch + +Translation: + [Dave De Vos](http://wnz.be) +*/ + +FileManager.Language.nl = { + more: 'Details', + width: 'Breedte:', + height: 'Hoogte:', + + ok: 'Ok', + open: 'Kies bestand', + upload: 'Uploaden', + create: 'Maak map', + createdir: 'Geef een map-naam op:', + cancel: 'Annuleren', + + information: 'Informatie', + type: 'Type:', + size: 'Grootte:', + dir: 'Locatie:', + modified: 'Laatste wijziging:', + preview: 'Voorbeeld', + close: 'Sluiten', + destroy: 'Verwijderen', + destroyfile: 'Ben je zeker dat je dit bestand wil verwijderen?', + + rename: 'Naam wijzigen', + renamefile: 'Geef een nieuwe bestandsnaam op:', + + download: 'Downloaden', + nopreview: 'Gn voorbeeld beschikbaar', + + title: 'Titel:', + artist: 'Artiest:', + album: 'Album:', + length: 'Lengte:', + bitrate: 'Bitrate:', + + deselect: 'Deselecteren', + + nodestroy: 'Het is niet mogelijk bestanden te verwijderen op deze server.', + + 'upload.disabled': 'Uploaden is uitgeschakeld op deze server.', + 'upload.authenticated': 'Je hebt geen toelating om bestanden te uploaden.', + 'upload.path': 'Deze upload-map bestaat niet. Contacteer de beheerder van deze website voor hulp.', + 'upload.exists': 'Deze upload-locatie bestaat reeds. Contacteer de beheerder van deze website voor hulp.', + 'upload.mime': 'Dit bestandstype is niet toegelaten.', + 'upload.extension': 'Het verstuurde bestand heeft een onbekende of niet-toegelaten extensie.', + 'upload.size': 'Het verstuurde bestand is te groot voor verwerking. Probeer opnieuw met een kleiner bestand.', + 'upload.partial': 'Het bestand dat je verstuurde werd slechts gedeeltelijk ontvangen, probeer het bestand opnieuw te versturen.', + 'upload.nofile': 'Er werd gn bestand verstuurd.', + 'upload.default': 'Er ging iets fout bij het uploaden van het bestand.', + + /* FU */ + uploader: { + unknown: 'Onbekende fout', + sizeLimitMin: 'Je kan het bestand "${name}" (${size}) niet toevoegen, de minimum bestandsgrootte voor upload is ${size_min}!', + sizeLimitMax: 'Je kan het bestand "${name}" (${size}) niet toevoegen, de minimum bestandsgrootte voor upload is ${size_max}!' + }, + + flash: { + hidden: 'Om de ingebouwde uploader in te schakelen, deblokkeer deze in je browser en vernieuw de pagina (zie Adblock).', + disabled: 'Om de ingebouwde uploader in te schakelen, schakel het geblokkeerde Flash-component in en vernieuw de pagina (zie Flashblock).', + flash: 'Om bestanden te kunnen uploaden dien je Adobe Flash te installeren.' + }, + + resizeImages: 'Pas de dimensies van grote afbeeldingen aan' +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pl.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pl.js new file mode 100644 index 000000000..fceba03c5 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.pl.js @@ -0,0 +1,72 @@ +/* +Script: Language.pl.js + MooTools FileManager - Language Strings in Polish + +Translation: + [Marek Kalucki](http://www.webdeco.pl) +*/ + +FileManager.Language.pl = { + more: 'Szczegóły', + width: 'Szerokość:', + height: 'Wysokość:', + + ok: 'Ok', + open: 'Wybierz plik', + upload: 'Wyślij', + create: 'Stwórz folder', + createdir: 'Podaj nazwe folderu:', + cancel: 'Anuluj', + + information: 'Informacje', + type: 'Typ:', + size: 'Rozmiar:', + dir: 'Ścieżka:', + modified: 'Ost. modyfikacja:', + preview: 'Podgląd', + close: 'Zamknij', + destroy: 'Usuń', + destroyfile: 'Na pewno chcesz usunąć ten plik?', + + rename: 'Zmień nazwe', + renamefile: 'Podaj nową nazwę pliku:', + + download: 'Ściągnij', + nopreview: 'Podgląd niedostępny', + + title: 'Tytuł:', + artist: 'Wykonawca:', + album: 'Płyta:', + length: 'Długość:', + bitrate: 'Bitrate:', + + deselect: 'Odznacz', + + nodestroy: 'Usuwanie plików z serwera zostało wyłączone.', + + 'upload.disabled': 'Wysyłanie plików na serwer zostało wyłączone.', + 'upload.authenticated': 'Nie jesteś upoważniony do wysyłania plików na serwer.', + 'upload.path': 'Folder do wysyłania plików nie istnieje. Skontaktuj się z administratorem.', + 'upload.exists': 'Folder do wysyłania plików istnieje. Skontaktuj się z administratorem.', + 'upload.mime': 'Typ wybranego pliku jest niedozwolony.', + 'upload.extension': 'Wysyłany plik ma nieznane lub niedozwolone rozszerzenie.', + 'upload.size': 'Rozmiar wysyłanego pliku jest zbyt duży. Wyślij mniejszy plik (jeśli wysyłasz obrazy-zmniejsz obraz na swoim komputerze i ponów wysyłanie).', + 'upload.partial': 'Plik nie został wysłany w całości. Ponów próbę wysyłki pliku.', + 'upload.nofile': 'Nie wybrano pliku do wysyłki.', + 'upload.default': 'Wystąpił błąd w trakcie wysyłki.', + + /* FU */ + uploader: { + unknown: 'Wystąpił nieznany błąd.', + sizeLimitMin: 'Nie można wybrać "${name}" (${size}), minimalny rozmiar pliku to ${size_min}!', + sizeLimitMax: 'Nie można wybrać "${name}" (${size}), maksymalny rozmiar pliku to ${size_max}!' + }, + + flash: { + hidden: 'Aby włączyć wysyłanie plików, odblokuj go w swojej przeglądarce i odśwież stronę (prawdopodobnie wysyłanie plików jest blokowane przez wtyczkę Adblock).', + disabled: 'Aby włączyć wysyłanie plików, odblokuj obiekt flash i odśwież stronę (prawdopodobnie wysyłanie plików blokowane jest przez wtyczkę Flashblock).', + flash: 'Aby wysyłać pliki na serwer, należy zainstalować w przeglądarce wtyczkę Adobe Flash.' + }, + + resizeImages: 'Zmniejsz duże obrazy w trakcie wysyłania' +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.ru.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.ru.js new file mode 100644 index 000000000..493a546ab --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.ru.js @@ -0,0 +1,72 @@ +/* +Script: Language.ru.js + MooTools FileManager - Language Strings in Russian + +Translation: + [Ilya V. Goryachev](http://cok-studio.ru/) +*/ + +FileManager.Language.ru = { + more: 'Подробнее', + width: 'Ширина:', + height: 'Высота:', + + ok: 'Ok', + open: 'Выбрать файл', + upload: 'Загрузка', + create: 'Создать папку', + createdir: 'Пожалуйста укажите имя папки:', + cancel: 'Отмена', + + information: 'Информация', + type: 'Тип:', + size: 'Размер:', + dir: 'Путь:', + modified: 'Последнее изменение:', + preview: 'Предпросмотр', + close: 'Закрыть', + destroy: 'Удалить', + destroyfile: 'Уверены, что хотите удалить этот файл?', + + rename: 'Переименовать', + renamefile: 'Пожалуйста укажите имя файла:', + + download: 'Скачать', + nopreview: 'Предпросмотр недоступен', + + title: 'Название:', + artist: 'Исполнитель:', + album: 'Альбом:', + length: 'Продолжительность:', + bitrate: 'Битрэйт:', + + deselect: 'Снять выделение', + + nodestroy: 'Удаление файлов отключено на сервере.', + + 'upload.disabled': 'Загрузка файлов отключена на сервере.', + 'upload.authenticated': 'Вам не разрешено загружать файлы.', + 'upload.path': 'Указанная директория для загрузки файлов не существует. Пожалуйста обратитесь к администратору сайта.', + 'upload.exists': 'Указанная директория для загрузки файлов уже существует. Пожалуйста обратитесь к администратору сайта', + 'upload.mime': 'Такой тип файла не поддерживается.', + 'upload.extension': 'Загруженный файл не опознан или такое расширение не разрешено.', + 'upload.size': 'Размер загружаемого файла слишком велик. Пожалуйста загрузите файл поменьше.', + 'upload.partial': 'Файл был загружен частично, пожалуйста загрузите этот файл еще раз.', + 'upload.nofile': 'Не указаны файлы для загрузки.', + 'upload.default': 'При загрузке файлов что-то пошло не так.', + + /* FU */ + uploader: { + unknown: 'Неизвестная ошибка', + sizeLimitMin: 'Невозможно прикрепить файл "${name}" (${size}), минимальный размер фала ${size_min}!', + sizeLimitMax: 'Невозможно прикрепить файл "${name}" (${size}), максимальный размер файла ${size_max}!' + }, + + flash: { + hidden: 'Чтобы включить embedded загрузчик, разблокируйте подключаемые элементы в вашем браузере (см. Блокировку рекламы).', + disabled: 'Чтобы включить embedded загрузчик, снимите блокировку флеш и обновите страницу (см. Блокировка флеш).', + flash: 'Чтобы загружать файлы, Вам необходимо установить Adobe Flash.' + }, + + resizeImages: 'Менять размер больших изображений при загрузке' +}; diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.se.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.se.js new file mode 100644 index 000000000..8a0b6a52f --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Language/Language.se.js @@ -0,0 +1,73 @@ +/* +Script: Language.se.js + MooTools FileManager - Language Strings in Swedish + +Translation: + [Marcus *xintron* Carlsson](http://xintron.se) +*/ + +FileManager.Language.se = { + more: 'Detaljer', + width: 'Bredd:', + height: 'Höjd:', + + ok: 'Ok', + open: 'Välj fil', + upload: 'Ladda upp', + create: 'Skapa mapp', + createdir: 'Vänligen ange ett mapp-namn:', + cancel: 'Avbryt', + + information: 'Information', + type: 'Typ:', + size: 'Storlek:', + dir: 'Sökväg:', + modified: 'Senast ändad:', + preview: 'Förhandsgranska', + close: 'Stäng', + destroy: 'Ta bort', + destroyfile: 'Är du säker på att du vill ta bort filen?', + + rename: 'Döp om', + renamefile: 'Vänligen ange ett nytt filnamn:', + + download: 'Ladda ner', + nopreview: 'Ingen förhandsgranskning tillgänglig', + + title: 'Titel:', + artist: 'Artist:', + album: 'Album:', + length: 'Längd:', + bitrate: 'Bitrate:', + + deselect: 'Avmarkera', + + nodestroy: 'Funktionen ta bort filer är avstängd på denna server.', + + 'upload.disabled': 'Uppladdning är avstängt på denna server.', + 'upload.authenticated': 'Du har inte behörighet att ladda upp filer.', + 'upload.path': 'Den angivna uppladdnings-mappen existerar inte. Vänligen kontakta serveradministratören.', + 'upload.exists': 'Den angivna uppladdnings-mappen existerar redan. Vänligen kontakta serveradministratören.', + 'upload.mime': 'Denna filtyp accepteras inte på denna server.', + 'upload.extension': 'Den uppladdade filen har en okänd eller förbjuden filändelse.', + 'upload.size': 'Filen är för stor för denna server. Vänligen ladda upp en mindre fil.', + 'upload.partial': 'Ett fel uppstod och hela filen kunde inte laddas upp. Vänligen försök igen.', + 'upload.nofile': 'Du måste välja en fil att ladda upp.', + 'upload.default': 'Ett fel inträffade under uppladdningen.', + + /* FU */ + uploader: { + unknown: 'Okänt fel', + duplicate: 'Du kan inte ladda upp "${name}" (${size}), filen existerar redan!', + sizeLimitMin: 'Du kan inte ladda upp "${name}" (${size}), minsta storlek som accepteras är ${size_min}!', + sizeLimitMax: 'Du kan inte ladda upp "${name}" (${size}), filens storlek får inte överstiga ${size_max}!' + }, + + flash: { + hidden: null, + disabled: null, + flash: 'För att kunna ladda upp filer behöver du ha Adobe Flash installerat.' + }, + + resizeImages: 'Ändra storleken på bilden under uppladdningen' +}; diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/README.md b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/README.md new file mode 100644 index 000000000..1cbe46d87 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/README.md @@ -0,0 +1,43 @@ +MooTools FileManager - Copyright (c) 2009 [Christoph Pojer](http://og5.net/christoph) +===================================================================================== + +A filemanager for the web based on MooTools that allows you to (pre)view, upload and modify files and folders via your browser. + +![Screenshot](http://cpojer.net/Forge/FileManager.png) + +*Please Note:* This is currently a pre-release. The final 1.0 version is going to be released "soon". + +### Features + +* Browse through Files and Folders on your Server +* Rename, Delete, Move (Drag&Drop), Copy (Drag + hold CTRL) and Download Files +* View detailed Previews of Images, Text-Files, Compressed-Files or Audio Content +* Nice User Interface ;) +* Upload Files via FancyUpload (integrated Feature) +* Option to automatically resize big Images when uploading +* Use it to select a File anywhere you need to specify one inside your Application's Backend +* Use as a FileManager in TinyMCE +* Provides your client with the most possible convenience ( ;D ) +* Create galleries using the Gallery-Plugin + +How to use +---------- + +### Demos + +* Open the "Demos/" folder and have fun +* To test TinyMCE Download and extract it to "Demos/TinyMCE" and access "Demos/tinymce.html" +* Demo of 1.0rc2 (old): http://cpojer.net/Scripts/FileManager/Demos/ + +### Configurable Options + +* See Source/FileManager.js and Backend/FileManager.php for all available options on the client- and server-side + +### Installation + +* See "Demos/index.html" for the clientside integration +* See "Demos/manager.php" or "Demos/selectImage.php" for serverside integration + +### Custom Authentication + +* As Flash and therefore the Uploader ignores authenticated clients you need to specify your own authentication. In order to do this you need to provide a custom "UploadIsAuthenticated" function on the serverside and you need to specify "uploadAuthData" on the client. \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js new file mode 100644 index 000000000..34697a261 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Additions.js @@ -0,0 +1,204 @@ +/* +--- +description: FileManager Additions + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.additions + +license: + MIT-style license + +contains: + - Element.appearOn: Can be used to show an element when another one is hovered: $(myElement).appearOn(myWrapper) + - Element.center: Centers an element + - Dialog, Overlay: Classes used by the FileManager +... +*/ + +(function(){ + +Element.implement({ + + appearOn: function(el, opacity, options){ + opacity = $type(opacity) == 'array' ? [opacity[0] || 1, opacity[1] || 0] : [opacity || 1, 0]; + + this.set({ + opacity: opacity[1], + tween: options || {duration: 200} + }); + + $(el).addEvents({ + mouseenter: this.fade.bind(this, opacity[0]), + mouseleave: this.fade.bind(this, opacity[1]) + }); + + return this; + }, + + center: function(offsets){ + var scroll = document.getScroll(), + offset = document.getSize(), + size = this.getSize(), + values = {x: 'left', y: 'top'}; + + if (!offsets) offsets = {}; + + for (var z in values){ + var style = scroll[z] + (offset[z] - size[z]) / 2 + (offsets[z] || 0); + this.setStyle(values[z], style < 10 ? 10 : style); + } + + return this; + } + +}); + +this.Dialog = new Class({ + + Implements: [Options, Events], + + options: { + /*onShow: $empty, + onOpen: $empty, + onConfirm: $empty, + onDecline: $empty, + onClose: $empty,*/ + request: null, + buttons: ['confirm', 'decline'], + language: {} + }, + + initialize: function(text, options){ + this.setOptions(options); + + this.el = new Element('div', { + 'class': 'fm-dialog fm-dialog-engine-' + Browser.Engine.name + ' fm-dialog-engine-' + Browser.Engine.name + (Browser.Engine.trident ? Browser.Engine.version : ''), + opacity: 0, + tween: {duration: 250} + }).adopt([ + $type(text) == 'string' ? new Element('div', {text: text}) : text + ]); + + if (this.options.content) this.el.getElement('div').adopt(this.options.content); + + Array.each(this.options.buttons, function(v){ + new Element('button', {'class': 'fm-dialog-' + v, text: this.options.language[v]}).addEvent('click', (function(e){ + if (e) e.stop(); + this.fireEvent(v).fireEvent('close'); + this.overlay.hide(); + this.destroy(); + }).bind(this)).inject(this.el); + }, this); + + this.overlay = new Overlay({ + 'class': 'fm-overlay fm-overlay-dialog', + events: {click: this.fireEvent.bind(this, ['close'])}, + tween: {duration: 250} + }); + + this.bound = { + scroll: (function(){ + if (!this.el) this.destroy(); + else this.el.center(); + }).bind(this), + keyesc: (function(e){ + if (e.key == 'esc') this.fireEvent('close').destroy(); + }).bind(this) + }; + + this.show(); + }, + + show: function(){ + this.overlay.show(); + var self = this.fireEvent('open'); + this.el.setStyle('display', 'block').inject(document.body).center().fade(1).get('tween').chain(function(){ + var button = this.element.getElement('button.fm-dialog-confirm') || this.element.getElement('button'); + if (button) button.focus(); + self.fireEvent('show'); + }); + + window.addEvents({ + scroll: this.bound.scroll, + resize: this.bound.scroll, + keyup: this.bound.keyesc + }); + }, + + destroy: function(){ + if (this.el) this.el.fade(0).get('tween').chain((function(){ + this.overlay.destroy(); + this.el.destroy(); + }).bind(this)); + + window.removeEvent('scroll', this.bound.scroll).removeEvent('resize', this.bound.scroll).removeEvent('keyup', this.bound.keyesc); + } + +}); + +this.Overlay = new Class({ + + initialize: function(options){ + this.el = new Element('div', $extend({ + 'class': 'fm-overlay' + }, options)).inject(document.body); + }, + + show: function(){ + this.objects = $$('object, select, embed').filter(function(el){ + return el.id == 'SwiffFileManagerUpload' || el.style.visibility == 'hidden' ? false : !!(el.style.visibility = 'hidden'); + }); + + this.resize = (function(){ + if (!this.el) this.destroy(); + else this.el.setStyles({ + width: document.getScrollWidth(), + height: document.getScrollHeight() + }); + }).bind(this); + + this.resize(); + + this.el.setStyles({ + opacity: 0, + display: 'block' + }).get('tween').pause().start('opacity', 0.5); + + window.addEvent('resize', this.resize); + + return this; + }, + + hide: function(){ + this.el.fade(0).get('tween').chain((function(){ + this.revertObjects(); + this.el.setStyle('display', 'none'); + }).bind(this)); + + window.removeEvent('resize', this.resize); + + return this; + }, + + destroy: function(){ + this.revertObjects().el.destroy(); + }, + + revertObjects: function(){ + if (this.objects && this.objects.length) + this.objects.each(function(el){ + el.style.visibility = 'visible'; + }); + + return this; + } + +}); + +})(); \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.TinyMCE.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.TinyMCE.js new file mode 100644 index 000000000..408e71ee6 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.TinyMCE.js @@ -0,0 +1,56 @@ +/* +--- +description: FileManager.TinyMCE +longdescription: MooTools FileManager for integration with [TinyMCE](http://tinymce.moxiecode.com/) + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.tinymce + +license: + MIT-style license + +Usage: + - Pass this to the "file_browser_callback"-option of TinyMCE: FileManager.TinyMCE(function(){ return {FileManagerOptions}; }); + - See the Demo for an example. +... +*/ + +FileManager.TinyMCE = function(options){ + return function(field, url, type, win){ + var manager = new FileManager($extend({ + onComplete: function(path){ + if (!win.document) return; + win.document.getElementById(field).value = path; + if (win.ImageDialog) win.ImageDialog.showPreviewImage(path, 1); + this.container.destroy(); + } + }, options(type))); + manager.dragZIndex = 400002; + manager.SwiffZIndex = 400003; + manager.el.setStyle('zIndex', 400001); + manager.overlay.el.setStyle('zIndex', 400000); + document.id(manager.tips).setStyle('zIndex', 400010); + manager.show(); + return manager; + }; +}; + +FileManager.implement('SwiffZIndex', 400003); + +var Dialog = new Class({ + + Extends: Dialog, + + initialize: function(text, options){ + this.parent(text, options); + this.el.setStyle('zIndex', 400010); + this.overlay.el.setStyle('zIndex', 400009); + } + +}); \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js new file mode 100644 index 000000000..5f93e5486 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/FileManager.js @@ -0,0 +1,701 @@ +/* +--- +description: FileManager + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + more/1.2.4.2: [Drag, Drag.Move, Tips, Assets, Element.Delegation] + +provides: + - filemanager + +license: + MIT-style license + +version: + 1.0 + +todo: + - Add Scroller.js (optional) for Drag&Drop in the Filelist + +inspiration: + - Loosely based on a Script by [Yannick Croissant](http://dev.k1der.net/dev/brooser-un-browser-de-fichier-pour-mootools/) + +options: + - url: (string) The base url to the Backend FileManager, without QueryString + - baseURL: (string) Absolute URL to the FileManager files + - assetBasePath: (string) The path to all images and swf files + - selectable: (boolean, defaults to *false*) If true, provides a button to select a file + - language: (string, defaults to *en*) The language used for the FileManager + - hideOnClick: (boolean, defaults to *false*) When true, hides the FileManager when the area outside of it is clicked + - directory: (string) Can be used to load a subfolder instead of the base folder + +events: + - onComplete(path, file): fired when a file gets selected via the "Select file" button + - onModify(file): fired when a file gets renamed/deleted or modified in another way + - onShow: fired when the FileManager opens + - onHide: event fired when FileManager closes + - onPreview: event fired when the user clicks an image in the preview + - onDetails: event fired when the details are updated after user picking a file + - onHidePreview: event fired when the "preview" is hidden (usually, user uploading file, or changing directory) +... +*/ + +var FileManager = new Class({ + + Implements: [Options, Events], + + Request: null, + Directory: null, + Current: null, + + options: { + /*onComplete: $empty, + onModify: $empty, + onShow: $empty, + onHide: $empty, + onPreview: $empty, + onDetails: $empty, // Xinha: Fired when an item is picked form the files list, supplied object (eg {width: 123, height:456} ) + onHidePreview: $empty, // Xinha: Fired when the preview is hidden (eg when uploading) */ + directory: '', + url: null, + baseURL: '', + assetBasePath: null, + selectable: false, + hideOnClick: false, + language: 'en' + }, + + hooks: { + show: {}, + cleanup: {} + }, + + initialize: function(options){ + this.setOptions(options); + this.options.assetBasePath = this.options.assetBasePath.replace(/(\/|\\)*$/, '/'); + this.dragZIndex = 1300; + this.droppables = []; + this.Directory = this.options.directory; + + this.language = $unlink(FileManager.Language.en); + if (this.options.language != 'en') this.language = $merge(this.language, FileManager.Language[this.options.language]); + + this.container = new Element('div', {'class': 'filemanager-container filemanager-engine-' + Browser.Engine.name + (Browser.Engine.trident ? Browser.Engine.version : '')}); + this.el = new Element('div', {'class': 'filemanager'}).inject(this.container); + this.menu = new Element('div', {'class': 'filemanager-menu'}).inject(this.el); + this.loader = new Element('div', {'class': 'loader', opacity: 0, tween: {duration: 200}}).inject(this.menu); + + var self = this; + this.relayClick = function(e){ + if(e) e.stop(); + var file = this.retrieve('file'); + if (this.retrieve('block') && !Browser.Engine.trident){ + this.eliminate('block'); + return; + } + + if (file.mime == 'text/directory'){ + this.addClass('selected'); + self.load(self.Directory + '/' + file.name); + return; + } + + + if (self.Current) self.Current.removeClass('selected'); + self.Current = this.addClass('selected'); // NB: Also sets self.Current + + // Xinha: We need to have Current assigned before fillInfo because fillInfo adds to it + self.fillInfo(file); + self.switchButton(); + }; + this.browser = new Element('ul', {'class': 'filemanager-browser'}).addEvents({ + click: (function(){ + // return self.deselect(); + }), + 'click:relay(li span.fi)': this.relayClick + }).inject(this.el); + + if (this.options.upload) this.addMenuButton('create'); // Xinha: Create directory permission = upload + if (this.options.selectable) this.addMenuButton('open'); + + this.info = new Element('div', {'class': 'filemanager-infos', opacity: 0}).inject(this.el); + + var head = new Element('div', {'class': 'filemanager-head'}).adopt([ + new Element('img', {'class': 'filemanager-icon'}), + new Element('h1') + ]); + + // Xinha: We need to groupt he headers and lists togethor because we will + // use some CSS to reorganise a bit. So we create "infoarea" which + // will contain the h2 and list for the "Information", that is + // modification date, size, directory etc... + var infoarea = new Element('div', {'class': 'filemanager-info-area'}); + + this.info.adopt([head, infoarea.adopt(new Element('h2', {text: this.language.information}))]); + + new Element('dl').adopt([ + new Element('dt', {text: this.language.modified}), + new Element('dd', {'class': 'filemanager-modified'}), + new Element('dt', {text: this.language.type}), + new Element('dd', {'class': 'filemanager-type'}), + new Element('dt', {text: this.language.size}), + new Element('dd', {'class': 'filemanager-size'}), + new Element('dt', {text: this.language.dir}), + new Element('dd', {'class': 'filemanager-dir'}) + ]).inject(infoarea); + + this.preview = new Element('div', {'class': 'filemanager-preview'}).addEvent('click:relay(img.preview)', function(){ + self.fireEvent('preview', [this.get('src')]); + }); + + // Xinha: We need to group the headers and lists togethor because we will + // use some CSS to reorganise a bit. So we create "filemanager-preview-area" which + // will contain the h2 for the preview and also the preview content returned from + // Backend/FileManager.php + this.info.adopt((new Element('div', {'class': 'filemanager-preview-area'})).adopt([ + new Element('h2', {'class': 'filemanager-headline', text: this.language.preview}), + this.preview + ])); + + this.closeIcon = new Element('div', { + 'class': 'filemanager-close', + title: this.language.close, + events: {click: this.hide.bind(this)} + }).adopt(new Asset.image(this.options.assetBasePath + 'destroy.png')).inject(this.el); + + this.tips = new Tips({ + className: 'tip-filebrowser', + offsets: {x: 15, y: 0}, + text: null, + showDelay: 50, + hideDelay: 50, + onShow: function(){ + this.tip.set('tween', {duration: 250}).setStyle('display', 'block').fade(1); + }, + onHide: function(){ + this.tip.fade(0).get('tween').chain(function(){ + this.element.setStyle('display', 'none'); + }); + } + }); + this.tips.attach(this.closeIcon.appearOn(this.closeIcon, [1, 0.8]).appearOn(this.el, 0.8)); + + this.imageadd = new Asset.image(this.options.assetBasePath + 'add.png', { + 'class': 'browser-add' + }).set('opacity', 0).inject(this.container); + + this.container.inject(document.body); + this.overlay = new Overlay(this.options.hideOnClick ? { + events: {click: this.hide.bind(this)} + } : null); + + this.bound = { + keydown: (function(e){ + if (e.control || e.meta) this.imageadd.fade(1); + }).bind(this), + keyup: (function(){ + this.imageadd.fade(0); + }).bind(this), + keyesc: (function(e){ + if (e.key=='esc') this.hide(); + }).bind(this), + scroll: (function(){ + this.el.center(this.offsets); + this.fireEvent('scroll'); + }).bind(this) + }; + }, + + show: function(e){ + if (e) e.stop(); + + this.load(this.Directory); + this.overlay.show(); + + this.info.set('opacity', 0); + + (function(){ + this.container.setStyles({ + opacity: 0, + display: 'block' + }); + + this.el.center(this.offsets); + this.fireEvent('show'); + this.container.set('opacity', 1); + this.fireHooks('show'); + + window.addEvents({ + scroll: this.bound.scroll, + resize: this.bound.scroll, + keyup: this.bound.keyesc + }); + }).delay(500, this); + }, + + hide: function(e){ + if (e) e.stop(); + + this.overlay.hide(); + this.tips.hide(); + this.browser.empty(); + this.container.setStyle('display', 'none'); + + this.fireHooks('cleanup').fireEvent('hide'); + window.removeEvent('scroll', this.bound.scroll).removeEvent('resize', this.bound.scroll).removeEvent('keyup', this.bound.keyesc); + }, + + open: function(e){ + e.stop(); + + if (!this.Current) return false; + + this.fireEvent('complete', [ + // Xinha: The URL path returned by normal MootoolsFileManager is odd, it includes the last component + // of the base directory, that is, if your base is /foo/bar/images then we get something like + // images/narf.jpg. + // To work around this we take the URL which was worked out by Backend/FileManager.php + // and return that as the url. + this.normalize(this.Current.file_data ? this.Current.file_data.url : this.Directory + '/' + this.Current.retrieve('file').name), + this.Current.retrieve('file') + ]); + this.hide(); + }, + + create: function(e){ + e.stop(); + + var self = this; + new Dialog(this.language.createdir, { + language: { + confirm: this.language.create, + decline: this.language.cancel + }, + content: [ + new Element('input', {'class': 'createDirectory'}) + ], + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onShow: function(){ + var self = this; + this.el.getElement('input').addEvent('keyup', function(e){ + if (e.key == 'enter') self.el.getElement('button-confirm').fireEvent('click'); + }).focus(); + }, + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url + '?event=create', + onSuccess: self.fill.bind(self), + data: { + file: this.el.getElement('input').get('value'), + directory: self.Directory + } + }, self).post(); + } + }); + }, + + deselect: function(el){ + if (el && this.Current != el) return; + + if (el) this.fillInfo(); + if (this.Current) this.Current.removeClass('selected'); + this.Current = null; + + this.switchButton(); + }, + + load: function(dir, nofade){ + this.deselect(); + if (!nofade) this.info.fade(0); + + if (this.Request) this.Request.cancel(); + + this.Request = new FileManager.Request({ + url: this.options.url, + onSuccess: (function(j){ + this.fill(j, nofade); + }).bind(this), + data: { + directory: dir + } + }, this).post(); + }, + + destroy: function(e, file){ + e.stop(); + this.tips.hide(); + + var self = this; + new Dialog(this.language.destroyfile, { + language: { + confirm: this.language.destroy, + decline: this.language.cancel + }, + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url + '?event=destroy', + data: { + file: file.name, + directory: self.Directory + }, + onSuccess: function(j){ + if (!j || j.content!='destroyed'){ + new Dialog(self.language.nodestroy, {language: {confirm: self.language.ok}, buttons: ['confirm']}); + return; + } + + self.fireEvent('modify', [$unlink(file)]); + file.element.getParent().fade(0).get('tween').chain(function(){ + self.deselect(file.element); + this.element.destroy(); + }); + } + }, self).post(); + } + }); + + }, + + rename: function(e, file){ + e.stop(); + this.tips.hide(); + + var name = file.name; + if (file.mime != 'text/directory') name = name.replace(/\..*$/, ''); + + var self = this; + new Dialog(this.language.renamefile, { + language: { + confirm: this.language.rename, + decline: this.language.cancel + }, + content: [ + new Element('input', {'class': 'rename', value: name}) + ], + onOpen: this.onDialogOpen.bind(this), + onClose: this.onDialogClose.bind(this), + onShow: function(){ + var self = this; + this.el.getElement('input').addEvent('keyup', function(e){ + if (e.key=='enter') self.el.getElement('button-confirm').fireEvent('click'); + }).focus(); + }, + onConfirm: function(){ + new FileManager.Request({ + url: self.options.url + '?event=move', + onSuccess: (function(j){ + if (!j || !j.name) return; + + self.fireEvent('modify', [$unlink(file)]); + + file.element.getElement('span').set('text', j.name); + file.name = j.name; + self.fillInfo(file); + }).bind(this), + data: { + file: file.name, + name: this.el.getElement('input').get('value'), + directory: self.Directory + } + }, self).post(); + } + }); + }, + + fill: function(j, nofade){ + this.Directory = j.path; + this.CurrentDir = j.dir; + if (!nofade) this.fillInfo(j.dir); + this.browser.empty(); + + if (!j.files) return; + + var els = [[], []]; + $each(j.files, function(file){ + file.dir = j.path; + var el = file.element = new Element('span', {'class': 'fi', href: '#'}).adopt( + new Asset.image(this.options.assetBasePath + 'Icons/' + file.icon + '.png'), + new Element('span', {text: file.name}) + ).store('file', file); + + var icons = []; + if (file.mime!='text/directory') + icons.push(new Asset.image(this.options.assetBasePath + 'disk.png', {title: this.language.download}).addClass('browser-icon').addEvent('click', (function(e){ + this.tips.hide(); + e.stop(); + window.open(this.options.baseURL + this.normalize(this.Directory + '/' + file.name)); + }).bind(this)).inject(el, 'top')); + + if (file.name != '..') + ['rename', 'destroy'].each(function(v){ + icons.push(new Asset.image(this.options.assetBasePath + v + '.png', {title: this.language[v]}).addClass('browser-icon').addEvent('click', this[v].bindWithEvent(this, [file])).injectTop(el)); + }, this); + + els[file.mime == 'text/directory' ? 1 : 0].push(el); + if (file.name == '..') el.set('opacity', 0.7); + el.inject(new Element('li').inject(this.browser)).store('parent', el.getParent()); + icons = $$(icons.map(function(icon){ return icon.appearOn(icon, [1, 0.7]); })).appearOn(el.getParent('li'), 0.7); + }, this); + + var self = this, revert = function(el){ + el.set('opacity', 1).store('block', true).removeClass('drag').removeClass('move').setStyles({ + opacity: 1, + zIndex: '', + position: 'relative', + width: 'auto', + left: 0, + top: 0 + }).inject(el.retrieve('parent')); + el.getElements('img.browser-icon').set('opacity', 0); + + document.removeEvents('keydown', self.bound.keydown).removeEvents('keyup', self.bound.keydown); + self.imageadd.fade(0); + + self.relayClick.apply(el); + }; + + if(0) // This (drag to move into subdirectory) is breaking IE, we don't need it that badly + // See: http://github.com/cpojer/mootools-filemanager/issues#issue/11 + $$(els[0]).makeDraggable({ + droppables: $$(this.droppables, els[1]), + + onDrag: function(el, e){ + self.imageadd.setStyles({ + left: e.page.x + 15, + top: e.page.y + 15 + }); + }, + + onBeforeStart: function(el){ + self.deselect(); + self.tips.hide(); + var position = el.getPosition(); + el.addClass('drag').setStyles({ + zIndex: self.dragZIndex, + position: 'absolute', + width: el.getWidth() - el.getStyle('paddingLeft').toInt(), + left: position.x, + top: position.y + }).inject(self.container); + }, + + onCancel: revert, + + onStart: function(el){ + el.set('opacity', 0.7).addClass('move'); + document.addEvents({ + keydown: self.bound.keydown, + keyup: self.bound.keyup + }); + }, + + onEnter: function(el, droppable){ + droppable.addClass('droppable'); + }, + + onLeave: function(el, droppable){ + droppable.removeClass('droppable'); + }, + + onDrop: function(el, droppable, e){ + revert(el); + + if (e.control || e.meta || !droppable) el.setStyles({left: 0, top: 0}); + if (!droppable && !e.control && !e.meta) return; + + var dir; + if (droppable){ + droppable.addClass('selected').removeClass('droppable'); + (function(){ droppable.removeClass('selected'); }).delay(300); + if (self.onDragComplete(el, droppable)) return; + + dir = droppable.retrieve('file'); + } + var file = el.retrieve('file'); + + new FileManager.Request({ + url: self.options.url + '?event=move', + data: { + file: file.name, + directory: self.Directory, + newDirectory: dir ? dir.dir + '/' + dir.name : self.Directory, + copy: e.control || e.meta ? 1 : 0 + }, + onSuccess: function(){ + if (!dir) self.load(self.Directory); + } + }, self).post(); + + self.fireEvent('modify', [$unlink(file)]); + + if (!e.control && !e.meta) + el.fade(0).get('tween').chain(function(){ + self.deselect(el); + el.getParent().destroy(); + }); + } + }); + + $$(els).setStyles({left: 0, top: 0}); + + this.tips.attach(this.browser.getElements('img.browser-icon')); + }, + + fillInfo: function(file, path){ + if (!file) file = this.CurrentDir; + if (!path) path = this.Directory; + + if (!file) return; + var size = this.size(file.size); + + this.info.fade(1).getElement('img').set({ + src: this.options.assetBasePath + 'Icons/' + file.icon + '.png', + alt: file.mime + }); + + this.fireHooks('cleanup'); + this.preview.empty(); + + // Xinha: We need to remove our custom attributes form when the preview is hidden + this.fireEvent('hidePreview'); + + this.info.getElement('h1').set('text', file.name); + this.info.getElement('dd.filemanager-modified').set('text', file.date); + this.info.getElement('dd.filemanager-type').set('text', file.mime); + this.info.getElement('dd.filemanager-size').set('text', !size[0] && size[1] == 'Bytes' ? '-' : (size.join(' ') + (size[1] != 'Bytes' ? ' (' + file.size + ' Bytes)' : ''))); + this.info.getElement('h2.filemanager-headline').setStyle('display', file.mime == 'text/directory' ? 'none' : 'block'); + + var text = [], pre = []; + + path.split('/').each(function(v){ + if (!v) return; + + pre.push(v); + text.push(new Element('a', { + 'class': 'icon', + href: '#', + text: v + }).addEvent('click', (function(e, dir){ + e.stop(); + + this.load(dir); + }).bindWithEvent(this, [pre.join('/')])) + ); + text.push(new Element('span', {text: ' / '})); + }, this); + + text.pop(); + text[text.length-1].addClass('selected').removeEvents('click').addEvent('click', function(e){ e.stop(); }); + + this.info.getElement('dd.filemanager-dir').empty().adopt(new Element('span', {text: '/ '}), text); + + if (file.mime=='text/directory') return; + + if (this.Request) this.Request.cancel(); + + this.Request = new FileManager.Request({ + url: this.options.url + '?event=detail', + onSuccess: (function(j){ + var prev = this.preview.removeClass('filemanager-loading').set('html', j && j.content ? j.content.substitute(this.language, /\\?\$\{([^{}]+)\}/g) : '').getElement('img.prev'); + if (prev) prev.addEvent('load', function(){ + this.setStyle('background', 'none'); + }); + + var els = this.preview.getElements('button'); + if (els) els.addEvent('click', function(e){ + e.stop(); + window.open(this.get('value')); + }); + + // Xinha: We need to add in a form for setting the attributes of images etc, + // so we add this event and pass it the information we have about the item + // as returned by Backend/FileManager.php + this.fireEvent('details', [j]); + + // Xinha: We also want to hold onto the data so we can access it + // when selecting the image. + if(this.Current) this.Current.file_data = j; + }).bind(this), + data: { + directory: this.Directory, + file: file.name + } + }, this).post(); + }, + + size: function(size){ + var tab = ['Bytes', 'KB', 'MB', 'GB', 'TB']; + for(var i = 0; size > 1024; i++) + size = size/1024; + + return [Math.round(size), tab[i]]; + }, + + normalize: function(str){ + return str.replace(/\/+/g, '/'); + }, + + switchButton: function(){ + var chk = !!this.Current; + var el = this.menu.getElement('button.filemanager-open'); + if (el) el.set('disabled', !chk)[(chk ? 'remove' : 'add') + 'Class']('disabled'); + }, + + addMenuButton: function(name){ + var el = new Element('button', { + 'class': 'filemanager-' + name, + text: this.language[name] + }).inject(this.menu, 'top'); + if (this[name]) el.addEvent('click', this[name].bind(this)); + return el; + }, + + fireHooks: function(hook){ + var args = Array.slice(arguments, 1); + for(var key in this.hooks[hook]) this.hooks[hook][key].apply(this, args); + return this; + }, + + onRequest: function(){ this.loader.set('opacity', 1); }, + onComplete: function(){ this.loader.fade(0); }, + onDialogOpen: $empty, + onDialogClose: $empty, + onDragComplete: $lambda(false) + +}); + +FileManager.Request = new Class({ + + Extends: Request.JSON, + + initialize: function(options, filebrowser){ + // Xinha: We need ALL requests from the FileManager to have our authorisation data on it + // normal MootoolsFileManager only has the flash send it :-( + if(filebrowser) + { + options.url += (options.url.match(/\?/) ? '&' : '?') +Hash.toQueryString(filebrowser.options.uploadAuthData); + } + + // Xinha: We also need to clean up the url because our backend already includes a query string + // and MootoolsFileManager adds ?event=..... indiscriminately, our query string always + // ends in an ampersand, so we can just clean up '&?event=' to be '&event=' + options.url = options.url.replace(/&\?event=/, '&event='); + + this.parent(options); + + if (filebrowser) this.addEvents({ + request: filebrowser.onRequest.bind(filebrowser), + complete: filebrowser.onComplete.bind(filebrowser) + }); + } + +}); + +FileManager.Language = {}; diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Gallery.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Gallery.js new file mode 100644 index 000000000..156e32c91 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Gallery.js @@ -0,0 +1,305 @@ +/* +--- +description: FileManager.Gallery +longdescription: Adds functionality to create a gallery out of a list of images + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.gallery + +license: + MIT-style license +... +*/ + +(function(){ + +FileManager.Gallery = new Class({ + + Extends: FileManager, + + initialize: function(options){ + this.offsets = {y: -72}; + this.parent(options); + + var show = function(){ + this.galleryContainer.setStyles({ + opacity: 0, + display: 'block' + }); + + var size = this.el.getSize(), + pos = this.el.getPosition(); + + this.galleryContainer.setStyles({ + top: pos.y + size.y - 1, + left: pos.x + (size.x - this.galleryContainer.getWidth()) / 2, + opacity: 1 + }); + + this.hideClone(); + this.wrapper.setStyle('display', 'none'); + + if (this.howto){ + var self = this; + (function(){ + if (self.howto && self.howto.fade) self.howto.fade(0).get('tween').chain(function(){ + this.element.destroy(); + self.howto = null; + }); + }).delay(2000); + } + }; + + this.addEvents({ + + scroll: show, + show: (function(){ + show.apply(this); + this.populate(); + }), + + hide: function(){ + this.gallery.empty(); + + this.captions = {}; + this.files = []; + + this.hideClone(); + this.wrapper.setStyle('display', 'none'); + }, + + modify: function(file){ + var name = this.normalize(file.dir + '/' + file.name); + var el = (this.gallery.getElements('li').filter(function(el){ + var f = el.retrieve('file'); + return name == this.normalize(f.dir + '/' + f.name); + }, this) || null)[0]; + + if (el) this.erasePicture(name, el); + } + }); + + this.addMenuButton('serialize'); + this.galleryContainer = new Element('div', {'class': 'filemanager-gallery'}).inject(this.container); + this.gallery = new Element('ul').inject(this.galleryContainer); + + var timer, removeClone = this.removeClone.bind(this); + + this.input = new Element('input', {name: 'imgCaption'}).addEvent('keyup', function(e){ + if (e.key == 'enter') removeClone(e); + }); + this.wrapper = new Element('div', { + 'class': 'filemanager-wrapper', + tween: {duration: 200}, + opacity: 0, + events: { + mouseenter: function(){ + $clear(timer); + }, + mouseleave: function(e){ + timer = (function(){ + removeClone(e); + }).delay(500); + } + } + }).adopt( + new Element('span', {text: this.language.gallery.text}), + this.input, + new Element('div', {'class': 'img'}), + new Element('button', {text: this.language.gallery.save}).addEvent('click', removeClone) + ).inject(document.body); + + this.droppables.push(this.gallery); + + this.captions = {}; + this.files = []; + this.animation = {}; + + this.howto = new Element('div', {'class': 'howto', text: this.language.gallery.drag}).inject(this.galleryContainer); + this.switchButton(); + }, + + onDragComplete: function(el, droppable){ + if (!droppable || droppable != this.gallery) return false; + + var file; + if ($type(el) == 'string'){ + var part = el.split('/'); + file = { + name: part.pop(), + dir: part.join('/') + }; + }else{ + el.setStyles({left: '', top: ''}); + file = el.retrieve('file'); + } + + var self = this, name = this.normalize(file.dir + '/' + file.name); + + if (this.files.contains(name)) return true; + this.files.push(name); + + var img = new Asset.image(this.options.assetBasePath + 'destroy.png').set({ + 'class': 'filemanager-remove', + title: this.language.gallery.remove, + events: {click: this.removePicture} + }).store('gallery', this); + + var li = new Element('li').store('file', file).adopt( + img, + new Asset.image(this.options.baseURL + name, { + onload: function(){ + var el = this; + li.setStyle('background', 'none').addEvent('click', function(e){ + if (e) e.stop(); + + var pos = el.getCoordinates(); + pos.left += el.getStyle('paddingLeft').toInt(); + pos.top += el.getStyle('paddingTop').toInt(); + + self.hideClone(); + self.animation = { + from: { + width: 75, + height: 56, + left: pos.left, + top: pos.top + }, + to: { + width: 200, + height: 150, + left: pos.left - 75, + top: pos.top + pos.height - 150 + } + }; + + self.hideClone(); + self.input.removeEvents('blur').addEvent('blur', function(){ + self.captions[name] = this.get('value') || ''; + }); + + li.set('opacity', 0); + self.clone = el.clone(); + self.clone.store('file', file).store('parent', li).addClass('filemanager-clone').setStyles(self.animation.from).set({ + morph: {link: 'chain'}, + styles: { + position: 'absolute', + zIndex: 1100 + }, + events: { + click: function(e){ + self.fireEvent('preview', [self.options.baseURL + name, self.captions[name], li]); + } + } + }).inject(document.body).morph(self.animation.to).get('morph').chain(function(){ + self.input.set('value', self.captions[name] || ''); + self.wrapper.setStyles({ + opacity: 0, + display: 'block', + left: self.animation.to.left - 12, + top: self.animation.to.top - 53 + }).fade(1).get('tween').chain(function(){ + self.input.focus(); + }); + }); + }); + } + }) + ).inject(this.gallery); + + this.tips.attach(img.appearOn(li)); + this.switchButton(); + + return true; + }, + + removeClone: function(e){ + if (!this.clone || (e.relatedTarget && ([this.clone, this.wrapper].contains(e.relatedTarget) || this.wrapper.hasChild(e.relatedTarget)))) return; + if (this.clone.get('morph').timer) return; + + var file = this.clone.retrieve('file'); + if (!file) return; + + this.captions[this.normalize(file.dir + '/' + file.name)] = this.input.get('value') || ''; + + this.clone.morph(this.animation.from).get('morph').clearChain().chain((function(){ + this.clone.retrieve('parent').set('opacity', 1); + this.clone.destroy(); + }).bind(this)); + + this.wrapper.fade(0).get('tween').chain(function(){ + this.element.setStyle('display', 'none'); + }); + }, + + hideClone: function(){ + if (!this.clone) return; + + this.clone.get('morph').cancel(); + var parent = this.clone.retrieve('parent'); + if (parent) parent.set('opacity', 1); + this.clone.destroy(); + this.wrapper.setStyles({ + opacity: 0, + display: 'none' + }); + }, + + removePicture: function(e){ + if(e) e.stop(); + + var self = this.retrieve('gallery'), + parent = this.getParent('li'), + file = parent.retrieve('file'), + name = self.normalize(file.dir + '/' + file.name); + + self.erasePicture(name, parent); + }, + + erasePicture: function(name, element){ + this.captions[name] = ''; + this.files.erase(name); + this.tips.hide(); + + var self = this; + element.set('tween', {duration: 250}).removeEvents('click').fade(0).get('tween').chain(function(){ + this.element.destroy(); + self.switchButton(); + }); + }, + + switchButton: function(){ + var chk = !!this.gallery.getChildren().length; + + this.menu.getElement('button.filemanager-serialize').set('disabled', !chk)[(chk ? 'remove' : 'add') + 'Class']('disabled'); + }, + + populate: function(data){ + Hash.each(data || {}, function(v, i){ + this.captions[i] = v; + + this.onDragComplete(i, this.gallery); + }, this); + }, + + serialize: function(e){ + if(e) e.stop(); + + var serialized = {}; + this.files.each(function(v){ + serialized[v] = this.captions[v] || ''; + }, this); + + this.hide(); + this.fireEvent('complete', [serialized]); + } + +}); + +})(); \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader.js new file mode 100644 index 000000000..faaffd1d4 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader.js @@ -0,0 +1,238 @@ +/* +--- +description: FileManager Uploader +longdescription: Implements Upload functionality into the FileManager based on [FancyUpload](http://digitarald.de) + +authors: + - Christoph Pojer + +requires: + core/1.2.4: '*' + +provides: + - filemanager.uploader + +license: + MIT-style license + +options: + - upload: (boolean, defaults to *true*) + - uploadAuthData: (object) Data to be send with the GET-Request of an Upload as Flash ignores authenticated clients + - resizeImages: (boolean, defaults to *true*) Whether to show the option to resize big images or not +... +*/ + +FileManager.implement({ + + options: { + resizeImages: true, + upload: true, + uploadAuthData: {} + }, + + hooks: { + show: { + upload: function(){ + this.startUpload(); + } + }, + + cleanup: { + upload: function(){ + if (!this.options.upload || !this.upload) return; + + if (this.upload.uploader) this.upload.uploader.set('opacity', 0).dispose(); + } + } + }, + + onDialogOpen: function(){ + if (this.swf && this.swf.box) this.swf.box.setStyle('visibility', 'hidden'); + }, + + onDialogClose: function(){ + if (this.swf && this.swf.box) this.swf.box.setStyle('visibility', 'visible'); + }, + + startUpload: function(){ + if (!this.options.upload || this.swf) return; + + var self = this; + this.upload = { + button: this.addMenuButton('upload').inject(this.menu, 'bottom').addEvents({ + click: function(){ + return false; + }, + mouseenter: function(){ + this.addClass('hover'); + }, + mouseleave: function(){ + this.removeClass('hover'); + this.blur(); + }, + mousedown: function(){ + this.focus(); + } + }), + list: new Element('ul', {'class': 'filemanager-uploader-list'}), + uploader: new Element('div', {opacity: 0, 'class': 'filemanager-uploader-area'}).adopt( + new Element('h2', {text: this.language.upload}), + new Element('div', {'class': 'filemanager-uploader'}) + ) + }; + this.upload.uploader.getElement('div').adopt(this.upload.list); + this.closeIcon.appearOn(this.upload.button, 0.8); + + if (this.options.resizeImages){ + var resizer = new Element('div', {'class': 'checkbox'}), + check = (function(){ this.toggleClass('checkboxChecked'); }).bind(resizer); + check(); + this.upload.label = new Element('label').adopt( + resizer, new Element('span', {text: this.language.resizeImages}) + ).addEvent('click', check).inject(this.menu); + } + + var File = new Class({ + + Extends: Swiff.Uploader.File, + + initialize: function(base, data){ + this.parent(base, data); + this.setOptions({ + url: self.options.url + (self.options.url.indexOf('?') == -1 ? '?' : '&') + Hash.toQueryString($merge({}, self.options.uploadAuthData, { + event: 'upload', + directory: self.normalize(self.Directory), + resize: self.options.resizeImages && resizer.hasClass('checkboxChecked') ? 1 : 0 + })) + }); + }, + + render: function(){ + if (this.invalid){ + var message = self.language.uploader.unknown, sub = { + name: this.name, + size: Swiff.Uploader.formatUnit(this.size, 'b') + }; + + if (self.language.uploader[this.validationError]) + message = self.language.uploader[this.validationError]; + + if (this.validationError == 'sizeLimitMin') + sub.size_min = Swiff.Uploader.formatUnit(this.base.options.fileSizeMin, 'b'); + else if (this.validationError == 'sizeLimitMax') + sub.size_max = Swiff.Uploader.formatUnit(this.base.options.fileSizeMax, 'b'); + + new Dialog(new Element('div', {html: message.substitute(sub, /\\?\$\{([^{}]+)\}/g)}) , {language: {confirm: self.language.ok}, buttons: ['confirm']}); + return this; + } + + this.addEvents({ + open: this.onOpen, + remove: this.onRemove, + requeue: this.onRequeue, + progress: this.onProgress, + stop: this.onStop, + complete: this.onComplete + }); + + this.ui = {}; + this.ui.icon = new Asset.image(self.options.assetBasePath+'Icons/' + this.extension + '.png', { + onerror: function(){ new Asset.image(self.options.assetBasePath + 'Icons/default.png').replaces(this); } + }); + this.ui.element = new Element('li', {'class': 'file', id: 'file-' + this.id}); + this.ui.title = new Element('span', {'class': 'file-title', text: this.name}); + this.ui.size = new Element('span', {'class': 'file-size', text: Swiff.Uploader.formatUnit(this.size, 'b')}); + + var file = this; + this.ui.cancel = new Asset.image(self.options.assetBasePath+'cancel.png', {'class': 'file-cancel', title: self.language.cancel}).addEvent('click', function(){ + file.remove(); + self.tips.hide(); + self.tips.detach(this); + }); + self.tips.attach(this.ui.cancel); + + var progress = new Element('img', {'class': 'file-progress', src: self.options.assetBasePath+'bar.gif'}); + + this.ui.element.adopt( + this.ui.cancel, + progress, + this.ui.icon, + this.ui.title, + this.ui.size + ).inject(self.upload.list).highlight(); + + this.ui.progress = new Fx.ProgressBar(progress).set(0); + + this.base.reposition(); + + return this.parent(); + }, + + onOpen: function(){ + this.ui.element.addClass('file-running'); + }, + + onRemove: function(){ + this.ui = this.ui.element.destroy(); + }, + + onProgress: function(){ + this.ui.progress.start(this.progress.percentLoaded); + }, + + onStop: function(){ + this.remove(); + }, + + onComplete: function(){ + this.ui.progress = this.ui.progress.cancel().element.destroy(); + this.ui.cancel = this.ui.cancel.destroy(); + + var response = JSON.decode(this.response.text); + if (!response.status) + new Dialog(('' + response.error).substitute(self.language, /\\?\$\{([^{}]+)\}/g) , {language: {confirm: self.language.ok}, buttons: ['confirm']}); + + this.ui.element.set('tween', {duration: 2000}).highlight(response.status ? '#e6efc2' : '#f0c2c2'); + (function(){ + this.ui.element.setStyle('overflow', 'hidden').morph({ + opacity: 0, + height: 0 + }).get('morph').chain(function(){ + this.element.destroy(); + if (!self.upload.list.getElements('li').length) + self.upload.uploader.fade(0).get('tween').chain(function(){ + self.fillInfo(); + }); + }); + }).delay(5000, this); + } + + }); + + this.swf = new Swiff.Uploader({ + id: 'SwiffFileManagerUpload', + path: this.options.assetBasePath + 'Swiff.Uploader.swf', + queued: false, + target: this.upload.button, + allowDuplicates: true, + instantStart: true, + fileClass: File, + fileSizeMax: 25 * 1024 * 1024, + zIndex: this.SwiffZIndex || 9999, + onSelectSuccess: function(){ + self.fillInfo(); + self.info.getElement('h2.filemanager-headline').setStyle('display', 'none'); + self.info.adopt(self.upload.uploader); + self.upload.uploader.fade(1); + }, + onComplete: function(){ + self.load(self.Directory, true); + }, + onFail: function(error){ + $$(self.upload.button, self.upload.label).dispose(); + new Dialog(new Element('div', {html: self.language.flash[error] || self.language.flash.flash}), {language: {confirm: self.language.ok}, buttons: ['confirm']}); + } + }); + } + +}); \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Fx.ProgressBar.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Fx.ProgressBar.js new file mode 100644 index 000000000..4416b334c --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Fx.ProgressBar.js @@ -0,0 +1,78 @@ +/* +--- +description: Fx.Progressbar + +authors: + - Harald Kirschner + +requires: + core/1.2.4: '*' + +provides: + - filemanager.swiff.progressbar + +license: + MIT-style license +... +*/ + +Fx.ProgressBar = new Class({ + + Extends: Fx, + + options: { + text: null, + url: null, + transition: Fx.Transitions.Circ.easeOut, + fit: true, + link: 'cancel' + }, + + initialize: function(element, options) { + this.element = $(element); + this.parent(options); + + var url = this.options.url; + if (url) { + this.element.setStyles({ + 'background-image': 'url(' + url + ')', + 'background-repeat': 'no-repeat' + }); + } + + if (this.options.fit) { + url = url || this.element.getStyle('background-image').replace(/^url\(["']?|["']?\)$/g, ''); + if (url) { + var fill = new Image(); + fill.onload = function() { + this.fill = fill.width; + fill = fill.onload = null; + this.set(this.now || 0); + }.bind(this); + fill.src = url; + if (!this.fill && fill.width) fill.onload(); + } + } else { + this.set(0); + } + }, + + start: function(to, total) { + return this.parent(this.now, (arguments.length == 1) ? to.limit(0, 100) : to / total * 100); + }, + + set: function(to) { + this.now = to; + var css = (this.fill) + ? (((this.fill / -2) + (to / 100) * (this.element.width || 1) || 0).round() + 'px') + : ((100 - to) + '%'); + + this.element.setStyle('backgroundPosition', css + ' 0px').title = Math.round(to) + '%'; + + var text = $(this.options.text); + if (text) text.set('text', Math.round(to) + '%'); + + return this; + } + +}); \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js new file mode 100644 index 000000000..069e8455b --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/Source/Uploader/Swiff.Uploader.js @@ -0,0 +1,494 @@ +/* +--- +description: Swiff.Uploader + +authors: + - Harald Kirschner + +requires: + core/1.2.4: '*' + +provides: + - filemanager.swiff.uploader + +license: + MIT-style license +... +*/ + +Swiff.Uploader = new Class({ + + Extends: Swiff, + + Implements: Events, + + options: { + path: 'Swiff.Uploader.swf', + + target: null, + zIndex: 9999, + + height: 30, + width: 100, + callBacks: null, + params: { + wMode: 'opaque', + menu: 'false', + allowScriptAccess: 'always' + }, + + typeFilter: null, + multiple: true, + queued: true, + verbose: false, + + url: null, + method: null, + data: null, + mergeData: true, + fieldName: null, + + fileSizeMin: 1, + fileSizeMax: null, // Official limit is 100 MB for FileReference, but I tested up to 2Gb! + allowDuplicates: false, + timeLimit: (Browser.Platform.linux) ? 0 : 30, + + buttonImage: null, + policyFile: null, + + fileListMax: 0, + fileListSizeMax: 0, + + instantStart: false, + appendCookieData: false, + + fileClass: null + /* + onLoad: $empty, + onFail: $empty, + onStart: $empty, + onQueue: $empty, + onComplete: $empty, + onBrowse: $empty, + onDisabledBrowse: $empty, + onCancel: $empty, + onSelect: $empty, + onSelectSuccess: $empty, + onSelectFail: $empty, + + onButtonEnter: $empty, + onButtonLeave: $empty, + onButtonDown: $empty, + onButtonDisable: $empty, + + onFileStart: $empty, + onFileStop: $empty, + onFileRequeue: $empty, + onFileOpen: $empty, + onFileProgress: $empty, + onFileComplete: $empty, + onFileRemove: $empty, + + onBeforeStart: $empty, + onBeforeStop: $empty, + onBeforeRemove: $empty + */ + }, + + initialize: function(options) { + // protected events to control the class, added + // before setting options (which adds own events) + this.addEvent('load', this.initializeSwiff, true) + .addEvent('select', this.processFiles, true) + .addEvent('complete', this.update, true) + .addEvent('fileRemove', function(file) { + this.fileList.erase(file); + }.bind(this), true); + + this.setOptions(options); + + // callbacks are no longer in the options, every callback + // is fired as event, this is just compat + if (this.options.callBacks) { + Hash.each(this.options.callBacks, function(fn, name) { + this.addEvent(name, fn); + }, this); + } + + this.options.callBacks = { + fireCallback: this.fireCallback.bind(this) + }; + + var path = this.options.path; + if (!path.contains('?')) path += '?noCache=' + $time(); // cache in IE + + // container options for Swiff class + this.options.container = this.box = new Element('span', {'class': 'swiff-uploader-box'}).inject($(this.options.container) || document.body); + + // target + this.target = $(this.options.target); + if (this.target) { + var scroll = window.getScroll(); + this.box.setStyles({ + position: 'absolute', + visibility: 'visible', + zIndex: this.options.zIndex, + overflow: 'hidden', + height: 1, width: 1, + top: scroll.y, left: scroll.x + }); + + // we force wMode to transparent for the overlay effect + this.parent(path, { + params: { + wMode: 'transparent' + }, + height: '100%', + width: '100%' + }); + + this.target.addEvent('mouseenter', this.reposition.bind(this, [])); + + // button interactions, relayed to to the target + this.addEvents({ + buttonEnter: this.targetRelay.bind(this, ['mouseenter']), + buttonLeave: this.targetRelay.bind(this, ['mouseleave']), + buttonDown: this.targetRelay.bind(this, ['mousedown']), + buttonDisable: this.targetRelay.bind(this, ['disable']) + }); + + this.reposition(); + window.addEvent('resize', this.reposition.bind(this, [])); + } else { + this.parent(path); + } + + this.inject(this.box); + + this.fileList = []; + + this.size = this.uploading = this.bytesLoaded = this.percentLoaded = 0; + + if (Browser.Plugins.Flash.version < 9) { + this.fireEvent('fail', ['flash']); + } else { + this.verifyLoad.delay(1000, this); + } + }, + + verifyLoad: function() { + if (this.loaded) return; + if (!this.object.parentNode) { + this.fireEvent('fail', ['disabled']); + } else if (this.object.style.display == 'none') { + this.fireEvent('fail', ['hidden']); + } else if (!this.object.offsetWidth) { + this.fireEvent('fail', ['empty']); + } + }, + + fireCallback: function(name, args) { + // file* callbacks are relayed to the specific file + if (name.substr(0, 4) == 'file') { + // updated queue data is the second argument + if (args.length > 1) this.update(args[1]); + var data = args[0]; + + var file = this.findFile(data.id); + this.fireEvent(name, file || data, 5); + if (file) { + var fire = name.replace(/^file([A-Z])/, function($0, $1) { + return $1.toLowerCase(); + }); + file.update(data).fireEvent(fire, [data], 10); + } + } else { + this.fireEvent(name, args, 5); + } + }, + + update: function(data) { + // the data is saved right to the instance + $extend(this, data); + this.fireEvent('queue', [this], 10); + return this; + }, + + findFile: function(id) { + for (var i = 0; i < this.fileList.length; i++) { + if (this.fileList[i].id == id) return this.fileList[i]; + } + return null; + }, + + initializeSwiff: function() { + // extracted options for the swf + this.remote('initialize', { + width: this.options.width, + height: this.options.height, + typeFilter: this.options.typeFilter, + multiple: this.options.multiple, + queued: this.options.queued, + url: this.options.url, + method: this.options.method, + data: this.options.data, + mergeData: this.options.mergeData, + fieldName: this.options.fieldName, + verbose: this.options.verbose, + fileSizeMin: this.options.fileSizeMin, + fileSizeMax: this.options.fileSizeMax, + allowDuplicates: this.options.allowDuplicates, + timeLimit: this.options.timeLimit, + buttonImage: this.options.buttonImage, + policyFile: this.options.policyFile + }); + + this.loaded = true; + + this.appendCookieData(); + }, + + targetRelay: function(name) { + if (this.target) this.target.fireEvent(name); + }, + + reposition: function(coords) { + // update coordinates, manual or automatically + coords = coords || (this.target && this.target.offsetHeight) + ? this.target.getCoordinates(this.box.getOffsetParent()) + : {top: window.getScrollTop(), left: 0, width: 40, height: 40}; + this.box.setStyles(coords); + this.fireEvent('reposition', [coords, this.box, this.target]); + }, + + setOptions: function(options) { + if (options) { + if (options.url) options.url = Swiff.Uploader.qualifyPath(options.url); + if (options.buttonImage) options.buttonImage = Swiff.Uploader.qualifyPath(options.buttonImage); + this.parent(options); + if (this.loaded) this.remote('setOptions', options); + } + return this; + }, + + setEnabled: function(status) { + this.remote('setEnabled', status); + }, + + start: function() { + this.fireEvent('beforeStart'); + this.remote('start'); + }, + + stop: function() { + this.fireEvent('beforeStop'); + this.remote('stop'); + }, + + remove: function() { + this.fireEvent('beforeRemove'); + this.remote('remove'); + }, + + fileStart: function(file) { + this.remote('fileStart', file.id); + }, + + fileStop: function(file) { + this.remote('fileStop', file.id); + }, + + fileRemove: function(file) { + this.remote('fileRemove', file.id); + }, + + fileRequeue: function(file) { + this.remote('fileRequeue', file.id); + }, + + appendCookieData: function() { + var append = this.options.appendCookieData; + if (!append) return; + + var hash = {}; + document.cookie.split(/;\s*/).each(function(cookie) { + cookie = cookie.split('='); + if (cookie.length == 2) { + hash[decodeURIComponent(cookie[0])] = decodeURIComponent(cookie[1]); + } + }); + + var data = this.options.data || {}; + if ($type(append) == 'string') data[append] = hash; + else $extend(data, hash); + + this.setOptions({data: data}); + }, + + processFiles: function(successraw, failraw, queue) { + var cls = this.options.fileClass || Swiff.Uploader.File; + + var fail = [], success = []; + + if (successraw) { + successraw.each(function(data) { + var ret = new cls(this, data); + if (!ret.validate()) { + ret.remove.delay(10, ret); + fail.push(ret); + } else { + this.size += data.size; + this.fileList.push(ret); + success.push(ret); + ret.render(); + } + }, this); + + this.fireEvent('selectSuccess', [success], 10); + } + + if (failraw || fail.length) { + fail.extend((failraw) ? failraw.map(function(data) { + return new cls(this, data); + }, this) : []).each(function(file) { + file.invalidate().render(); + }); + + this.fireEvent('selectFail', [fail], 10); + } + + this.update(queue); + + if (this.options.instantStart && success.length) this.start(); + } + +}); + +$extend(Swiff.Uploader, { + + STATUS_QUEUED: 0, + STATUS_RUNNING: 1, + STATUS_ERROR: 2, + STATUS_COMPLETE: 3, + STATUS_STOPPED: 4, + + log: function() { + if (window.console && console.info) console.info.apply(console, arguments); + }, + + unitLabels: { + b: [{min: 1, unit: 'B'}, {min: 1024, unit: 'kB'}, {min: 1048576, unit: 'MB'}, {min: 1073741824, unit: 'GB'}], + s: [{min: 1, unit: 's'}, {min: 60, unit: 'm'}, {min: 3600, unit: 'h'}, {min: 86400, unit: 'd'}] + }, + + formatUnit: function(base, type, join) { + var labels = Swiff.Uploader.unitLabels[(type == 'bps') ? 'b' : type]; + var append = (type == 'bps') ? '/s' : ''; + var i, l = labels.length, value; + + if (base < 1) return '0 ' + labels[0].unit + append; + + if (type == 's') { + var units = []; + + for (i = l - 1; i >= 0; i--) { + value = Math.floor(base / labels[i].min); + if (value) { + units.push(value + ' ' + labels[i].unit); + base -= value * labels[i].min; + if (!base) break; + } + } + + return (join === false) ? units : units.join(join || ', '); + } + + for (i = l - 1; i >= 0; i--) { + value = labels[i].min; + if (base >= value) break; + } + + return (base / value).toFixed(1) + ' ' + labels[i].unit + append; + } + +}); + +Swiff.Uploader.qualifyPath = (function() { + + var anchor; + + return function(path) { + (anchor || (anchor = new Element('a'))).href = path; + return anchor.href; + }; + +})(); + +Swiff.Uploader.File = new Class({ + + Implements: Events, + + initialize: function(base, data) { + this.base = base; + this.update(data); + }, + + update: function(data) { + return $extend(this, data); + }, + + validate: function() { + var options = this.base.options; + + if (options.fileListMax && this.base.fileList.length >= options.fileListMax) { + this.validationError = 'fileListMax'; + return false; + } + + if (options.fileListSizeMax && (this.base.size + this.size) > options.fileListSizeMax) { + this.validationError = 'fileListSizeMax'; + return false; + } + + return true; + }, + + invalidate: function() { + this.invalid = true; + this.base.fireEvent('fileInvalid', this, 10); + return this.fireEvent('invalid', this, 10); + }, + + render: function() { + return this; + }, + + setOptions: function(options) { + if (options) { + if (options.url) options.url = Swiff.Uploader.qualifyPath(options.url); + this.base.remote('fileSetOptions', this.id, options); + this.options = $merge(this.options, options); + } + return this; + }, + + start: function() { + this.base.fileStart(this); + return this; + }, + + stop: function() { + this.base.fileStop(this); + return this; + }, + + remove: function() { + this.base.fileRemove(this); + return this; + }, + + requeue: function() { + this.base.fileRequeue(this); + } + +}); diff --git a/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/package.yml b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/package.yml new file mode 100644 index 000000000..14171cc4b --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/MootoolsFileManager/mootools-filemanager/package.yml @@ -0,0 +1,5 @@ +name: MooTools FileManager +author: cpojer +category: Interface +tags: [filemanager, upload, gallery, images, navigation] +demo: http://cpojer.net/Scripts/FileManager1-0/Demos \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/OpenCCM.js b/ccm-core/web/assets/xinha/plugins/OpenCCM/OpenCCM.js new file mode 100644 index 000000000..07d39175b --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/OpenCCM.js @@ -0,0 +1,123 @@ +/** xinha editor plugin for OpenCCM **/ + +OpenCCM._pluginInfo = { + name : "OpenCCM", + version : "0.3", + developer : "Sören Bernstein", + developer_url : "http://", + sponsor : "", + sponsor_url : "", + license : "htmlArea" +} + +function OpenCCM(editor) +{ + this.editor = editor; + this.dialogs = new Array(); + + var cfg = editor.config; + var self = this; + + var hasLinkButton = false; + var hasImageButton = false; + + cfg.registerButton( + { + id : "createlink", + tooltip : this._lc("OpenCCMInsertLink"), + image : ["ed_buttons_main.png", 6, 1], + textMode : false, + action : function(e, objname, obj) { self.showLinkDialog(self._getSelectedAnchor()); } + } + ); + + cfg.registerButton( + { + id : "insertimage", + tooltip : this._lc("OpenCCMInsertImage"), + image : ["ed_buttons_main.png", 6, 3], + textMode : false, + action : function(e, objname, obj) { self.showImageDialog(); } + } + ); + + if(this.findButton("createlink")) + { + hasLinkButton = true; + cfg.addToolbarElement("createlink", "createlink", 0); + } else { + cfg.addToolbarElement("createlink", "undo", -1); + } + + if(this.findButton("insertimage")) + { + hasImageButton = true; + cfg.addToolbarElement("insertimage", "insertimage", 0); + } + else + { + cfg.addToolbarElement("insertimage", "createlink", 1); + } + + if(!hasLinkButton && !hasImageButton) + { + cfg.addToolbarElement(["separator"], "insertimage", 1); + } + + if(typeof editor._insertImage == 'undefined') + { + editor._insertImage = function() { self.showImageDialog(); }; + // editor.config.btnList.insertimage[3] = function() { self.show(); } + } + + // Register double click action + cfg.dblclickList["a"][0] = function(e, target) { self.showLinkDialog(self._getSelectedAnchor()); }; +} + +OpenCCM.prototype.findButton = function(string) +{ + var toolbar = this.editor.config.toolbar; + + for(i = 0; i < toolbar.length; i++) + { + for(j = 0; j < toolbar[i].length; j++) + { + if(toolbar[i][j] == string) + { + return true; + } + } + } + + return false; +} + +OpenCCM.prototype._lc = function(string) +{ + return Xinha._lc(string, 'OpenCCM'); +} + +OpenCCM.prototype.onGenerateOnce = function () +{ + this.loadAssets(); +} + +OpenCCM.prototype.loadAssets = function() +{ + var self = OpenCCM; + + if (self.loading) + { + return; + } + self.loading = true; + + // Link + Xinha._getback(Xinha.getPluginDir("OpenCCM") + '/links/links.js', function(getback) { eval(getback); self.linksMethodsReady = true; }); + Xinha._getback(Xinha.getPluginDir("OpenCCM") + '/links/links.html', function(getback) { OpenCCM.linksHtml = getback; self.linksDialogReady = true; } ); + + // Image + Xinha._getback(Xinha.getPluginDir("OpenCCM") + '/images/images.js', function(getback) { eval(getback); self.imagesMethodsReady = true; } ); + Xinha._getback(Xinha.getPluginDir("OpenCCM") + '/images/images.html', function(getback) { OpenCCM.imagesHtml = getback; self.imagesDialogReady = true; } ); +} + diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/images/images.html b/ccm-core/web/assets/xinha/plugins/OpenCCM/images/images.html new file mode 100644 index 000000000..36c7b51ad --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/images/images.html @@ -0,0 +1,179 @@ + +

+ Insert/Modify Image +

+
+
+
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ + +
+ + Layout + + +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ + Dimension + + +
+ +
+ +
+ +
+ +
+ +
+ + Preview + + +
+
+
+ + + +
+
diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/images/images.js b/ccm-core/web/assets/xinha/plugins/OpenCCM/images/images.js new file mode 100644 index 000000000..309035a8b --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/images/images.js @@ -0,0 +1,431 @@ +OpenCCM.prototype.showImageDialog = function(image) +{ + if (!this.dialogs["images"]) + { + this.prepareImageDialog(); + } + + var editor = this.editor; + this.image = image; + + var data = + { + src : "", + name : "", + alt : "", + title : "", + width : "", + height : "", + caption : "", + + alignment : "", + caption : "", + fancybox : "", + + aspect : "" + }; + + if (typeof image == "undefined" ) + { + image = editor.getParentElement(); + if ( image && image.tagName.toLowerCase() != "img" ) + { + image = null; + } + } + + this.image = image; + + if (image && image.tagName.toLowerCase() == "img") + { + data.src = this.editor.fixRelativeLinks(image.getAttribute("src")); + data.alt = image.getAttribute("alt"); + data.name = image.getAttribute("name"); + data.title = image.getAttribute("title"); + data.width = image.getAttribute("width"); + data.height = image.getAttribute("height"); + + if (image.parentNode.tagName.toLowerCase() == "div") + { + // Parent node is not a link, so there is not zoom or gallery function + alignment = image.parentNode.getAttribute("class"); + if (alignment != "image none") + { + data.alignment = alignment.substring(alignment.indexOf(" ") + 1); + } + else + { + data.alignment = "none"; + } + data.caption = (image.nextSibling.tagName.toLowerCase() == "span" && image.nextSibling.firstChild) ? image.nextSibling.firstChild.nodeValue : ""; + + data.fancybox = "none"; +// data.galleryName = ""; + } + else + { + // Parent node is a link + alignment = image.parentNode.parentNode.getAttribute("class"); + if (alignment != "image none") + { + data.alignment = alignment.substring(alignment.indexOf(" ") + 1); + } + else + { + data.alignment="none"; + } + + data.fancybox = image.parentNode.getAttribute("class"); +// data.galleryName = (image.parentNode.getAttribute("class") == "imageGallery") ? image.parentNode.getAttribute("rel") : ""; + + data.caption = (image.parentNode.nextSibling.tagName.toLowerCase() == "span" && image.parentNode.nextSibling.firstChild) ? image.parentNode.nextSibling.firstChild.nodeValue : ""; + } + + // Calculate aspect ratio + data.aspect = data.width / data.height; + } + else + { + data.alignment = "none"; +// data.caption = ""; + data.fancybox = "none"; +// data.galleryName = ""; + } + + // now calling the show method of the Xinha.Dialog object to set the values and show the actual dialog + this.dialogs["images"].show(data); + + // If image set, show preview + if(data.src != "") + { + this.dialogs["images"].getElementById(this.dialogs["images"].id["ipreview"]).src = data.src; + this.resizePreview(this.dialogs["images"]); + this.dialogs["images"].getElementById(this.dialogs["images"].id["preview"]).style.display = "block"; + } + else + { + // Preview dekativieren + this.dialogs["images"].getElementById(this.dialogs["images"].id["ipreview"]).src = "about:blank"; + this.dialogs["images"].getElementById(this.dialogs["images"].id["preview"]).style.display = "none"; + } + +}; + +OpenCCM.prototype.prepareImageDialog = function() +{ + var self = this; + var editor = this.editor; + + var dialog = this.dialogs["images"] = new Xinha.Dialog(editor, OpenCCM.imagesHtml, 'Xinha',{width:410}) + + // Connect the OK and Cancel buttons + dialog.getElementById("ok").onclick = function() {self.imageApply();} + dialog.getElementById("remove").onclick = function() { self.imageRemove(); }; + dialog.getElementById("cancel").onclick = function() { self.dialogs["images"].hide(); }; + + // Connect the Select button + dialog.getElementById("browse").onclick = function() { self.imageBrowse(window); }; + + // Connect onkeyup event handler with dimension filed to recalculate the size according to aspect ratio + dialog.getElementById("width").onkeyup = function() { self.calcHeight(); }; + dialog.getElementById("height").onkeyup = function() { self.calcWidth(); }; + + // OnResize + this.dialogs["images"].onresize = function () + { + self.resizeDialog(this); + }; + + this.imageDialogReady = true; +}; + +// Write HTML code +OpenCCM.prototype.imageApply = function() +{ + + var values = this.dialogs["images"].hide(); + var image = this.image; + var editor = this.editor; + var modifyImage = (image != null && image.tagName.toLowerCase() == "img"); + + var imgAttr = + { + src : "", + alt : "", + title : "", + name : "", + width : "", + height : "" + }; + + var spanAttr = + { + class : "caption", + style : "", + } + + var linkAttr = + { + href : "", + title : "", + rel : "", + class : "" + }; + + var divAttr = + { + class : "image" + }; + + // If not all mandatory informations are set + if (!values.src) + { + // don't do anything at all + return false; + } + + // Read form values for image + imgAttr.src = values.src; + imgAttr.alt = values.alt; + imgAttr.name = values.name; + imgAttr.title = values.title; + imgAttr.width = values.width; + imgAttr.height = values.height; + + // Read form values for caption + if(values.caption) + { + spanAttr.style = "width:" + imgAttr.width + "px"; + } + + // Read form values for link + if(values.fancybox.value == "imageZoom") + { + linkAttr.href = values.src; + linkAttr.title = values.title; + linkAttr.rel = ""; + linkAttr.class = "imageZoom"; + } + + else if(values.fancybox.value == "imageGallery") + { + linkAttr.href = values.src; + linkAttr.title = values.title; + linkAttr.rel = "imageGallery"; + linkAttr.class = "imageGallery"; + } + + // Read form values for div + if(values.alignment.value != "") + { + divAttr.class += " " + values.alignment.value; + } + + var div; + + // Modify Image + if(modifyImage) + { + // Get the parent for img node + div = image.parentNode; + + // if the tagname of div is "a" + if(div.tagName.toLowerCase() == "a") + { + // go up one level to find the real div + div = div.parentNode; + } + + // remove all childs from div.image + while (div.childNodes.length > 0) + { + div.removeChild(div.firstChild); + } + } + + // Add Image + else + { + // create new div.image + div = document.createElement("div"); + } + + // set attributes for div + for(var attr in divAttr) + { + div.setAttribute(attr, divAttr[attr]); + } + + // the folling has to be done for both cases + // insert link, if fancybox features are activated + if(values.fancybox.value != "none") + { + link = document.createElement("a"); + for(var attr in linkAttr) + { + link.setAttribute(attr, linkAttr[attr]); + } + div.appendChild(link); + } + + // insert the image, obviously + var img = document.createElement("img"); + for(var attr in imgAttr) + { + img.setAttribute(attr, imgAttr[attr]); + } + if(values.fancybox.value != "none") + { + link.appendChild(img); + } + else + { + div.appendChild(img); + } + + // insert caption if selected + if(values.caption) + { + var span = document.createElement("span"); + for(var attr in spanAttr) + { + span.setAttribute(attr, spanAttr[attr]); + } + span.appendChild(document.createTextNode(imgAttr.title)); + + div.appendChild(span); + } + + // insert new div only if we not modifying an image + if(!modifyImage) { + editor.insertNodeAtSelection(div); + } + + // set cursor after div + this.editor.selectNodeContents(div.nextSibling, 0); +}; + +OpenCCM.prototype.imageRemove = function() +{ + + // Close the dialog + this.dialogs["images"].hide(); + + // Get the parent div for img node + var div = this.image.parentNode; + + // if the tagname of div is "a" + if(div.tagName.toLowerCase() == "a") + { + // go up one level to find the real div + div = div.parentNode; + } + + // remove this div + div.parentNode.removeChild(div); + + return true; +}; + +OpenCCM.prototype.imageBrowse = function(window) +{ + var baseURL = window.location.href; + var offset = baseURL.lastIndexOf("/"); + var destURL = baseURL.slice(0, offset+1) + "image_select.jsp"; + +// var searchDialog = new Xinha.Dialog(this.editor, destURL, '');//,{width:800, height:600}, {'closable':true}); +// searchDialog.show(); + var selectWindow = window.open(destURL, "_blank", "scrollbars=yes,directories=no,toolbar=no,width=800,height=600,status=no,menubar=no"); + window.openCCM = this; + return false; +}; + +OpenCCM.prototype.imageSet = function(imageData) +{ + var dialog = this.dialogs["images"]; + dialog.getElementById(dialog.id["src"]).value = imageData.src; + dialog.getElementById(dialog.id["ipreview"]).src = imageData.src; + dialog.getElementById(dialog.id["width"]).value = imageData.width; + dialog.getElementById(dialog.id["height"]).value = imageData.height; + dialog.getElementById(dialog.id["name"]).value = imageData.name; + dialog.getElementById(dialog.id["aspect"]).value = imageData.width / imageData.height; + + if(imageData.src != "") + { +// this.resizePreview(dialog); + dialog.getElementById(dialog.id["preview"]).style.display = "block"; + this.resizeDialog(dialog); + } else { + dialog.getElementById(dialog.id["preview"]).style.display = "none"; + } +}; + +OpenCCM.prototype._getCombinedComponentHeight = function() +{ + var dialog = this.dialogs["images"]; + return dialog.getElementById(dialog.id["h1"]).offsetHeight + + dialog.getElementById(dialog.id["common"]).offsetHeight + + dialog.getElementById(dialog.id["layout"]).offsetHeight + + dialog.getElementById(dialog.id["dimensions"]).offsetHeight + + dialog.getElementById(dialog.id["buttons"]).offsetHeight + + parseInt(dialog.rootElem.style.paddingBottom,10) + + 10; +}; + +OpenCCM.prototype.resizeDialog = function(dialog) +{ + if(dialog.getElementById(dialog.id["preview"]).style.display == "block") + { + + + // Recalculate height of preview + dialog.getElementById(dialog.id["preview"]).style.height = Math.min(Math.max(0, dialog.height - this._getCombinedComponentHeight() - 20), Math.round((window.innerHeight * 0.8) - this._getCombinedComponentHeight())) + "px"; + // Resize preview image + this.resizePreview(dialog); + } + dialog.width = Math.min(Math.max(10, dialog.width), Math.round((window.innerWidth * 0.8))); + dialog.height = Math.min(Math.max(10, dialog.height), Math.round((window.innerHeight * 0.8))); +}; + +OpenCCM.prototype.resizePreview = function(dialog) +{ + var layoutElem = dialog.getElementById(dialog.id["layout"]); + var previewElem = dialog.getElementById(dialog.id["preview"]); + + var maxWidth = layoutElem.offsetWidth - 5; + var maxHeight = previewElem.offsetHeight && previewElem.offsetHeight - 15 < Math.round((window.innerHeight * 0.8) - this._getCombinedComponentHeight()) + ? previewElem.offsetHeight - 15 + : Math.round((window.innerHeight * 0.8) - this._getCombinedComponentHeight()); + + dialog.getElementById(dialog.id["ipreview"]).style.width = "auto"; + dialog.getElementById(dialog.id["ipreview"]).style.height = "auto"; + + var width = parseInt(dialog.getElementById(dialog.id["ipreview"]).width,10); + var height = parseInt(dialog.getElementById(dialog.id["ipreview"]).height,10); + +// alert("W: " + maxWidth +" "+ width + "H: " + maxHeight +" "+ height); + + var zoom = height > 0 + ? Math.min(maxWidth / width, maxHeight / height) + : maxWidth / width; + +// alert("Zoom: " + zoom); + + var w = dialog.getElementById(dialog.id["ipreview"]).style.width = Math.round(width * zoom) + "px"; + var h = dialog.getElementById(dialog.id["ipreview"]).style.height = Math.round(height * zoom) + "px"; +}; + +OpenCCM.prototype.calcWidth = function() +{ + var dialog = this.dialogs["images"]; + dialog.getElementById(dialog.id["width"]).value = + Math.round(dialog.getElementById("height").value * dialog.getElementById("aspect").value); +}; + +OpenCCM.prototype.calcHeight = function() +{ + var dialog = this.dialogs["images"]; + dialog.getElementById(dialog.id["height"]).value = + Math.round(dialog.getElementById("width").value / dialog.getElementById("aspect").value); +}; + diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/lang/de.js b/ccm-core/web/assets/xinha/plugins/OpenCCM/lang/de.js new file mode 100644 index 000000000..4345bd1fa --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/lang/de.js @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "OpenCCMInsertLink" : "Link einfügen / bearbeiten", + "OpenCCMInsertImage" : "Bild einfügen / bearbeiten", + "Name:" : "Name:", + "Alternate:" : "Alt-Text", + "Title:" : "Titel:", + "Layout" : "Darstellung", + "Alignment:" : "Ausrichtung:", + "Center" : "zentriert", + "Show Caption:" : "Zeige Bildunterschrift:", + "Fancybox" : "Fancybox:", + "Disabled" : "Deaktiviert", + "Zoom" : "Zoom", + "Gallery" : "Gallerie", + "Dimension" : "Dimensionen", + "Width:" : "Breite:", + "Height:" : "Höhe:", + "Preview" : "Vorschau" +} diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/lang/en.js b/ccm-core/web/assets/xinha/plugins/OpenCCM/lang/en.js new file mode 100644 index 000000000..eb9c0ca21 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/lang/en.js @@ -0,0 +1,21 @@ +// I18N constants +// LANG: "de", ENCODING: UTF-8 +{ + "OpenCCMInsertLink" : "Create / modify link", + "OpenCCMInsertImage" : "Insert / modify image", + "Name:" : "Name:", + "Alternate:" : "Alternate", + "Title:" : "Title:", + "Layout" : "Layout", + "Alignment:" : "Alignment:", + "Center" : "zentriert", + "Show Caption:" : "Show Caption:", + "Fancybox" : "Fancybox:", + "Disabled" : "Disabled", + "Zoom" : "Zoom", + "Gallery" : "Gallery", + "Dimension" : "Dimension", + "Width:" : "Width:", + "Height:" : "Height:", + "Preview" : "Preview" +} diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/links/links.html b/ccm-core/web/assets/xinha/plugins/OpenCCM/links/links.html new file mode 100644 index 000000000..c729b6bac --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/links/links.html @@ -0,0 +1,155 @@ + +

+ Insert/Modify Link +

+
+
+
+ +
+ +
+
+
+ + + + +
+ + + + +
+ +
+
+ + + + +
+ +
+
+ + + + + +
+ + + +
+
+
+ + diff --git a/ccm-core/web/assets/xinha/plugins/OpenCCM/links/links.js b/ccm-core/web/assets/xinha/plugins/OpenCCM/links/links.js new file mode 100644 index 000000000..1a7223c24 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/OpenCCM/links/links.js @@ -0,0 +1,238 @@ +OpenCCM.prototype.showLinkDialog = function(link) +{ + if (!this.dialogs["links"]) + { + this.prepareLinkDialog(); + } + + if(!link && this.editor.selectionEmpty(this.editor.getSelection())) + { + alert(this._lc("You need to select some text before creating a link")); + return false; + } + + var editor = this.editor; + this.link = link; + + var data = + { + title : '', + type : 'internal', + ci_name : '', + ci_href : '', + href : '' + }; + + if(link && link.tagName.toLowerCase() == 'a') + { + var href =this.editor.fixRelativeLinks(link.getAttribute('href')); + var internal = href.match(/^(\/.*)$/); + var external = href.match(/^http(.*)$/); +/* + var mailto = href.match(/^mailto:(.*@[^?&]*)(\?(.*))?$/); + var anchor = href.match(/^#(.*)$/); +*/ + data.title = link.title; + + if(internal) + { + data.type = 'internal'; + data.ci_name = link.alt; + data.ci_href = href; + } + + if(external) + { + data.type = 'external'; + data.href = href; + } + + } + + // now calling the show method of the Xinha.Dialog object to set the values and show the actual dialog + this.dialogs["links"].show(data); + +}; + +// Prepare the link dialog +OpenCCM.prototype.prepareLinkDialog = function() +{ + var self = this; + var editor = this.editor; + + var dialog = this.dialogs["links"] = new Xinha.Dialog(editor, OpenCCM.linksHtml, 'Xinha',{width:400}) + + // Connect the OK and Cancel buttons + dialog.getElementById('ok').onclick = function() { self.linkApply(); }; + dialog.getElementById('clear').onclick = function() { self.linkRemove(); }; + dialog.getElementById('cancel').onclick = function() { self.dialogs["links"].hide()}; + + // Connect the Browse and Search button + dialog.getElementById('ci_browse').onclick = function() { self.linkBrowse(window); }; +/* Suche deaktivert, bis eine bessere JSP / Java-Klasse vorhanden ist + dialog.getElementById('ci_search').onclick = function() { alert("Das geht auch noch nicht.");}; +*/ + + this.linkDialogReady = true; +}; + +// +OpenCCM.prototype.linkApply = function() +{ + + var values = this.dialogs["links"].hide(); + var link = this.link; + var editor = this.editor; + + var linkAttr = + { + href : '', + alt : '', + title : '', + class : '' + }; + + // Read needed form values + switch(values.type) + { + case "internal": //alert("Internal"); + linkAttr.href = values.ci_href; + /* Deaktiviert bis es eine bessere JSP / Java-Klasse gibt + linkAttr.alt = values.ci_name; + */ + linkAttr.title = values.title; + linkAttr.class = "linkInternal"; + break; + + case "external": //alert("External"); + linkAttr.href = values.href; + linkAttr.title = values.title; + linkAttr.class = "linkExternal"; + + // Make absolute url + + break; + + default: //alert("Mist"); + return false; + } + + // If not all mandatory informations are set + if(linkAttr.href == "" || linkAttr.title == "") + { + // don't do anything at all + return false; + } + + // Modify Link + if(link && link.tagName.toLowerCase() == "a") + { + + for(var i in linkAttr) + { + link.setAttribute(i, linkAttr[i]); + } + +/* from Linker-Plugin + // If we change a mailto link in IE for some hitherto unknown + // reason it sets the innerHTML of the link to be the + // href of the link. Stupid IE. + if(Xinha.is_ie) + { + if(/mailto:([^?<>]*)(\?[^<]*)?$/i.test(link.innerHTML)) + { + link.innerHTML = RegExp.$1; + } + } +*/ + + } + // Add Link + else + { + + // Insert a link, we let the editor do this, we figure it knows best + var tmp = Xinha.uniq("http://www.example.com/Link"); + editor._doc.execCommand("createlink", false, tmp); + + // Fix it up + var anchors = editor._doc.getElementsByTagName('a'); + for(var i = 0; i < anchors.length; i++) + { + var anchor = anchors[i]; + if(anchor.href == tmp) + { + // Found one. + if (!link) link = anchor; + for(var j in linkAttr) + { + anchor.setAttribute(j, linkAttr[j]); + } + } + } + + } + + editor.selectNodeContents(link); + editor.updateToolbar(); +}; + +// Remove a link +OpenCCM.prototype.linkRemove = function() +{ + + var values = this.dialogs["links"].hide(); + var link = this.link; + var editor = this.editor; + + if(link && link.tagName.toLowerCase() == 'a') + { + if(confirm(this._lc('Are you sure you wish to remove this link?'))) + { + var parent = link.parentNode; + while(link.hasChildNodes()) + { + parent.insertBefore(link.removeChild(link.childNodes[0]), link); + } + + parent.removeChild(link); + editor.updateToolbar(); + return true; + } + } +}; + +OpenCCM.prototype.linkBrowse = function(window) +{ + var baseURL = window.location.href; + var offset = baseURL.lastIndexOf("/"); + var destURL = baseURL.slice(0, offset+1) + "search.jsp?useURL=true&widget=getElementById('" + this.dialogs["links"].id["ci_href"] + "')"; + +// var searchDialog = new Xinha.Dialog(this.editor, destURL, '');//,{width:800, height:600}, {'closable':true}); +// searchDialog.show(); + window.open(destURL, "_blank", "scrollbars=yes,directories=no,toolbar=no,width=800,height=600,status=no,menubar=no"); + + return false; +} + +// Get selected anchor +OpenCCM.prototype._getSelectedAnchor = function() +{ + var sel = this.editor.getSelection(); + var rng = this.editor.createRange(sel); + var link = this.editor.activeElement(sel); + + if(link != null && link.tagName.toLowerCase() == 'a') + { + return link; + } + else + { + link = this.editor._getFirstAncestor(sel, 'a'); + if(link != null) + { + return link; + } + } + return null; +}; diff --git a/ccm-core/web/assets/xinha/plugins/PSFixed/PSFixed.js b/ccm-core/web/assets/xinha/plugins/PSFixed/PSFixed.js new file mode 100644 index 000000000..ad41cf196 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSFixed/PSFixed.js @@ -0,0 +1,147 @@ +/** + * PSFixed PSFixed.js file. + * This plugin is a fake persistent storage backed. It is configured with a + * fixed list of stored objects and presents them to the user for insertion. + * A sample config is below: + * + * PSFixed.config = { + * 'xinha.png': { + * $type: 'image', + * URL: 'http://trac.xinha.org/chrome/common/trac_banner.png' + * }, + * 'browser': { + * $type: 'folder', + * 'firefox.png': { + * $type: 'image', + * URL: 'http://www.mozilla.com/img/tignish/firefox/vs-firefox-logo.png' + * } + * } + * } + */ +(function() { +var PSFixed = window.PSFixed = function PSFixed(editor) { + this.editor = editor; +} + +PSFixed._pluginInfo = { + name : "PSFixed", + version : "2.0", + developer : "Douglas Mayle", + developer_url : "http://xinha.org", + license : "BSD" +}; + +PSFixed.prototype.onGenerateOnce = function () { + // We use _prepareDialog to asynchronously load the dialog markup and then + // perform necessary processing. + this._registerBackend(); +}; + +PSFixed.prototype._registerBackend = function(timeWaited) { + var editor = this.editor; + var self = this; + + if (!timeWaited) { + timeWaited = 0; + } + + // Retry over a period of ten seconds to register. We back off exponentially + // to limit resouce usage in the case of misconfiguration. + var registerTimeout = 10000; + + if (timeWaited > registerTimeout) { + // This is most likely a configuration error. We're loaded and + // PersistentStorage is not. + return; + } + + if (!editor.plugins['PersistentStorage'] || + !editor.plugins['PersistentStorage'].instance || + !editor.plugins['PersistentStorage'].instance.ready) { + + window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50); + return; + } + editor.plugins['PersistentStorage'].instance.registerBackend('PSFixed', this); +} + +PSFixed.prototype.loadData = function (asyncCallback) { + // We don't expect the user to set the type on the root folder, so we set it + // ourselves. + if (!this.config.$type) { + this.config.$type = 'folder'; + } + asyncCallback(this.config); +} + +var treeRecurse = function treeRecurse(tree, callback, root) { + if (typeof root == 'undefined') { + root = '/'; + callback('/', '', tree); + } + + for (var key in tree) { + callback(root, key, tree[key]); + + if (tree[key].$type == 'folder') { + treeRecurse(tree[key], callback, root + key + '/'); + } + } +}; + +PSFixed.prototype.getFilters = function(dirTree) { + var filters = []; + + treeRecurse(dirTree, function(path, key, value) { + if (value.$type != 'folder') { + return; + } + + var filePath = key.length ? path + key + '/' : path; + filters.push({ + value: filePath, + display: filePath + }); + }); + + return filters; +} + +PSFixed.prototype.getMetadata = function(dirTree, filterPath) { + var editor = this.editor; + var self = this; + + var metadata = []; + + treeRecurse(dirTree, function(path, key, value) { + if (!value.$type || !key) { + // This is a builtin property of objects, not one returned by the + // backend. + return; + } + + if (path != filterPath) { + return; + } + + if (value.$type == 'folder') { + metadata.push({ + URL: self.editor.imgURL('folder.gif', 'PersistentStorage'), + name: key, + key: path + key, + $type: value.$type + }); + } else { + metadata.push({ + URL: value.URL, + name: key, + key: path + key, + $type: value.$type + }); + } + }); + + return metadata; +} + +})(); diff --git a/ccm-core/web/assets/xinha/plugins/PSLocal/PSLocal.js b/ccm-core/web/assets/xinha/plugins/PSLocal/PSLocal.js new file mode 100644 index 000000000..d9ebe53bc --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSLocal/PSLocal.js @@ -0,0 +1,355 @@ +/** + * PSLocal PSLocal.js file. + * This plugin is a Gears based local persistent storage backend. + */ +(function() { +var PSLocal = window.PSLocal = function PSLocal(editor) { + this.editor = editor; + + this.config = { + capabilities: { + directory_operations: true, + file_operations: true, + image_operations: false, + upload_operations: true, + import_operations: false, + user_publish: false, + shared_publish: false, + user_storage: true + }, + displayName: 'Local' + } +} + +PSLocal._pluginInfo = { + name : "PSLocal", + version : "2.0", + developer : "Douglas Mayle", + developer_url : "http://xinha.org", + license : "BSD" +}; + +PSLocal.prototype.onGenerateOnce = function () { + // We use _prepareBackend to asynchronously load the Gears backend. + this._prepareBackend(); +}; + +PSLocal.prototype._showGearsButton = function() { + var self = this; + var editor = this.editor; + + editor.config.registerButton({ + id : 'localstorage', + tooltip : Xinha._lc( 'Learn About Local Storage', 'PSLocal' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',2,8], + textMode : true, + action : function() { self.learnDialog(); } + } + ); + editor.config.addToolbarElement('localstorage', 'fullscreen', 1); + + // Since this is after the editor load, we have to trigger an udate manually... + editor._rebuildToolbar(); +} + +PSLocal.prototype._prepareBackend = function() { + var self = this; + var editor = this.editor; + + if (!this.gears_init) { + this.gears_init = true; + Xinha._loadback(Xinha.getPluginDir("PSLocal") + "/gears_init.js", + function() { + self._prepareBackend(); + }); + return; + } + + if (!window.google || !google.gears) { + // No gears, so no need to register. We'll register a button, however, to + // enable users to learn about the support we offer. + this._showGearsButton(); + return; + } + + if (!google.gears.factory.hasPermission) { + if (!google.gears.factory.getPermission('Xinha', editor.imgURL('/images/xinha-small-icon.gif'), Xinha._lc( 'Enable Gears in order to use local document storage and configuration.', 'PSLocal' ))) { + // The user has denied access to Gears. We'll give them a UI to allow + // them to change their mind. + this._showGearsButton(); + return; + } + } + + this.workerPool = google.gears.factory.create('beta.workerpool', '1.0'); + + this.remoteStorageWorker = this.workerPool.createWorkerFromUrl("http://xinhadocs.org/worker.js"); + + this._registerBackend(); +} + +PSLocal.prototype.learnDialog = function(timeWaited) { + var self = this; + var editor = this.editor; + + if (!this.html) { + Xinha._getback(Xinha.getPluginDir("PSLocal") + "/dialog.html", + function(getback) { + self.html = getback; + self.learnDialog(); + }); + return; + } + + if (this.dialog) { + this.dialog.show(); + return; + } + + this.dialog = new Xinha.Dialog(editor, this.html, "PersistentStorage", + {width: 700, + closeOnEscape: true, + resizable: true, + centered: true, + modal: true + }); + + var link = this.dialog.getElementById('GearsLink'); + + // Tack on our URL so that Google will return here after installation. + link.href += location.href; + + var button = this.dialog.getElementById("confirm"); + if (window.google && google.gears) { + Xinha._addClass(this.dialog.getElementById('InstallText'), 'hidden'); + // The user has gears installed, but has denied us access to it, so we'll + // give them the option to change their mind. + button.value = Xinha._lc('Enable', 'PSLocal'); + + button.onclick = function() { + // The user gave us permission, so we'll reload the page. + if (confirm(Xinha._lc('This will reload the page, causing you to lose any unsaved work. Press "OK" to reload.', 'PSLocal' ))) { + window.location.reload(true); + } + } + } else { + Xinha._addClass(this.dialog.getElementById('EnableText'), 'hidden'); + // Gears isn't installed, so we'll build the dialog to prompt installation. + button.value = Xinha._lc('Install', 'PSLocal'); + + button.onclick = function() { + location.href = link.href; + } + } + + var cancel = this.dialog.getElementById('cancel'); + cancel.onclick = function() { + self.dialog.hide(); + } + + this.dialog.show(); +} + +PSLocal.prototype._registerBackend = function(timeWaited) { + var editor = this.editor; + var self = this; + + if (!timeWaited) { + timeWaited = 0; + } + + // Retry over a period of ten seconds to register. We back off exponentially + // to limit resouce usage in the case of misconfiguration. + var registerTimeout = 10000; + + if (timeWaited > registerTimeout) { + // This is most likely a configuration error. We're loaded and + // PersistentStorage is not. + return; + } + + if (!editor.plugins['PersistentStorage'] || + !editor.plugins['PersistentStorage'].instance || + !editor.plugins['PersistentStorage'].instance.ready) { + + window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50); + return; + } + var PS = editor.plugins['PersistentStorage'].instance; + var self = this; + + this.config.thumbURL = this.editor.imgURL('images/tango/32x32/places/folder.png'); + this.loadDocument({URL:'', name:'config.js', key:'/config.js'}, function(json) { + var userconfig = json ? eval('(' + json + ')') : false; + PS.registerBackend('PSLocal', self, self.config, userconfig); + }); +} + +PSLocal.prototype.loadDocument = function(entry, asyncCallback) { + + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(''); + } + + if (message.body.response) { + asyncCallback(message.body.response); + } else if (entry.URL) { + Xinha._getback(entry.URL, + function(documentSource) { + asyncCallback(documentSource); + }); + } else { + // Oops, no data :-( + asyncCallback(''); + } + } + + this.workerPool.sendMessage({func: 'loadDocument', entry: entry}, this.remoteStorageWorker); +} + +PSLocal.prototype.loadData = function (asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(''); + } + + asyncCallback({dirs: message.body.dirs, files: message.body.files}); + } + + this.workerPool.sendMessage({func: 'loadData'}, this.remoteStorageWorker); +} + +PSLocal.prototype.getFilters = function(filedata) { + // Clear out the previous directory listing. + var filters = [], paths = {}; + var dirList = filedata.dirs; + + for (var index=0; index 2) { + pathpart = pathpart.slice(0,pathpart.length-1).join('/'); + } else { + pathpart = '/'; + } + + var filepart = fileList[index].fullpath.split('/').slice(-1)[0]; + if (filterPath == pathpart) { + metadata.push({ + URL: fileList[index].url, + thumbURL: editor.imgURL('images/tango/32x32/mimetypes/text-x-generic.png'), + name: filepart, + key: fileList[index].fullpath, + $type: fileList[index].filetype + }); + } + } + + var dirList = filedata.dirs; + + for (var index=0; index 1 && dirList[index].split('/').length == 2; + } else { + // Chop the last component of the directory and compare against the filter. + var matches = dirList[index].split('/').slice(0,-1).join('/') == filterPath; + } + if (matches) { + metadata.push({ + name: dirList[index].split('/').slice(-1), + key: dirList[index], + $type: 'folder' + }); + } + } + + return metadata; +} + +PSLocal.prototype.saveDocument = function(parentpath, filename, documentSource, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(message.body.response); + } + } + + this.workerPool.sendMessage({func: 'saveDocument', parentpath: parentpath, filename: filename, content:documentSource}, this.remoteStorageWorker); +} +PSLocal.prototype.deleteEntry = function(entry, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(message.body.response); + } + } + + this.workerPool.sendMessage({func: 'deleteEntry', entry: entry}, this.remoteStorageWorker); +} + +PSLocal.prototype.makeFolder = function(currentPath, folderName, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(true); + } + } + + this.workerPool.sendMessage({func: 'makeFolder', parentpath: currentPath, dirname: folderName}, this.remoteStorageWorker); +} + +PSLocal.prototype.copyEntry = function(entry, asyncCallback) { + this.workerPool.onmessage = function(a, b, message) { + if (!message.body || !message.body.authorized) { + // Fail + asyncCallback(false); + } + + if (asyncCallback) { + asyncCallback(message.body.response, message.body.entry); + } + } + + this.workerPool.sendMessage({func: 'copyEntry', entry: entry}, this.remoteStorageWorker); +} + +})(); diff --git a/ccm-core/web/assets/xinha/plugins/PSLocal/dialog.html b/ccm-core/web/assets/xinha/plugins/PSLocal/dialog.html new file mode 100644 index 000000000..8e8113852 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSLocal/dialog.html @@ -0,0 +1,6 @@ +

Enabling Local Storage

+

Xinha uses Google Gears to enable local document storage. With Gears installed, you can save drafts of your documents on your hard drive, configure Xinha to look the way you want, and carry this information wherever you use Xinha on the web.

+

To learn more about Gears, and enable this functionality on your system, please see http://gears.google.com or click "Install" below.

+

To enable Gears for this website, click "Enable" to reload the page then enable Gears.. Since the page will be refreshed, please be sure to save any unfinished work.

+ + diff --git a/ccm-core/web/assets/xinha/plugins/PSLocal/gears_init.js b/ccm-core/web/assets/xinha/plugins/PSLocal/gears_init.js new file mode 100644 index 000000000..5f44f09b4 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSLocal/gears_init.js @@ -0,0 +1,86 @@ +// Copyright 2007, Google Inc. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// 3. Neither the name of Google Inc. nor the names of its contributors may be +// used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Sets up google.gears.*, which is *the only* supported way to access Gears. +// +// Circumvent this file at your own risk! +// +// In the future, Gears may automatically define google.gears.* without this +// file. Gears may use these objects to transparently fix bugs and compatibility +// issues. Applications that use the code below will continue to work seamlessly +// when that happens. + +(function() { + // We are already defined. Hooray! + if (window.google && google.gears) { + return; + } + + var factory = null; + + // Firefox + if (typeof GearsFactory != 'undefined') { + factory = new GearsFactory(); + } else { + // IE + try { + factory = new ActiveXObject('Gears.Factory'); + // privateSetGlobalObject is only required and supported on WinCE. + if (factory.getBuildInfo().indexOf('ie_mobile') != -1) { + factory.privateSetGlobalObject(this); + } + } catch (e) { + // Safari + if ((typeof navigator.mimeTypes != 'undefined') + && navigator.mimeTypes["application/x-googlegears"]) { + factory = document.createElement("object"); + factory.style.display = "none"; + factory.width = 0; + factory.height = 0; + factory.type = "application/x-googlegears"; + document.documentElement.appendChild(factory); + } + } + } + + // *Do not* define any objects if Gears is not installed. This mimics the + // behavior of Gears defining the objects in the future. + if (!factory) { + return; + } + + // Now set up the objects, being careful not to overwrite anything. + // + // Note: In Internet Explorer for Windows Mobile, you can't add properties to + // the window object. However, global objects are automatically added as + // properties of the window object in all browsers. + if (!window.google) { + google = {}; + } + + if (!google.gears) { + google.gears = {factory: factory}; + } +})(); diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/PSServer.js b/ccm-core/web/assets/xinha/plugins/PSServer/PSServer.js new file mode 100644 index 000000000..639cec88c --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSServer/PSServer.js @@ -0,0 +1,282 @@ +/** + * PSServer PSServer.js file. + * This plugin is a server based persistent storage backend. + */ +(function() { +var PSServer = window.PSServer = function PSServer(editor) { + this.editor = editor; +} + +PSServer._pluginInfo = { + name : "PSServer", + version : "2.0", + developer : "Douglas Mayle", + developer_url : "http://xinha.org", + license : "MIT" +}; + +PSServer.prototype.onGenerateOnce = function () { + // We use _loadConfig to asynchronously load the config and then register the + // backend. + this._loadConfig(); +}; + +PSServer.prototype._loadConfig = function() { + var self = this; + if (!this._serverConfig) { + Xinha._getback(Xinha.getPluginDir("PSServer") + "/config.inc.php", + function(config) { + self._serverConfig = eval('(' + config + ')'); + self._serverConfig.user_affinity = 20; + self._serverConfig.displayName = 'Server'; + self._loadConfig(); + }); + return; + } + + this._registerBackend(); +} + +PSServer.prototype._registerBackend = function(timeWaited) { + var editor = this.editor; + var self = this; + + if (!timeWaited) { + timeWaited = 0; + } + + // Retry over a period of ten seconds to register. We back off exponentially + // to limit resouce usage in the case of misconfiguration. + var registerTimeout = 10000; + + if (timeWaited > registerTimeout) { + // This is most likely a configuration error. We're loaded and + // PersistentStorage is not. + return; + } + + if (!editor.plugins['PersistentStorage'] || + !editor.plugins['PersistentStorage'].instance || + !editor.plugins['PersistentStorage'].instance.ready) { + + window.setTimeout(function() {self._registerBackend(timeWaited ? timeWaited*2 : 50);}, timeWaited ? timeWaited : 50); + return; + } + editor.plugins['PersistentStorage'].instance.registerBackend('PSServer', this, this._serverConfig); +} + +PSServer.prototype.loadData = function (asyncCallback) { + var self = this; + Xinha._getback(Xinha.getPluginDir("PSServer") + "/backend.php?directory&listing", + function(json) { + self.dirTree = eval('(' + json + ')'); + asyncCallback(self.dirTree); + }); +} + +var treeRecurse = function treeRecurse(tree, callback, root) { + if (typeof root == 'undefined') { + root = '/'; + callback('/', '', tree); + } + + for (var key in tree) { + callback(root, key, tree[key]); + + if (tree[key].$type == 'folder') { + treeRecurse(tree[key], callback, root + key + '/'); + } + } +}; + +PSServer.prototype.getFilters = function(dirTree) { + // Clear out the previous directory listing. + var filters = []; + + treeRecurse(dirTree, function(path, key, value) { + if (value.$type != 'folder') { + return; + } + + var filePath = key.length ? path + key + '/' : path; + var filePathDisplay = key.length ? path + key + '/' : path; + if (filePathDisplay.length > 1) { + filePathDisplay = filePathDisplay.substring(0, filePathDisplay.length-1); + } + filters.push({ + value: filePath, + display: filePathDisplay + }); + }); + + return filters; +} + +PSServer.prototype.loadDocument = function(entry, asyncCallback) { + + Xinha._getback(entry.URL, + function(documentSource) { + asyncCallback(documentSource); + }); +} +PSServer.prototype.getMetadata = function(dirTree, pathFilter, typeFilter) { + var editor = this.editor; + var self = this; + + var metadata = []; + + var typeKeys = {}; + for (var index=0; index + // File: + // + // + var iframeID = dialog.createId('importFrame'); + + var form = document.createElement('form'); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('method', 'post'); + form.setAttribute('action', Xinha.getPluginDir("PSServer") + "/backend.php?upload&replace=true&"); + + var fileentry = document.createElement('input'); + fileentry.setAttribute('type', 'file'); + fileentry.setAttribute('name', 'filedata'); + + var submitbutton = document.createElement('input'); + submitbutton.setAttribute('type', 'submit'); + submitbutton.setAttribute('value',Xinha._lc('Import', 'PSServer')); + + var filetext = document.createTextNode(Xinha._lc('File: ', 'PSServer')); + filetext = form.appendChild(filetext); + + fileentry = form.appendChild(fileentry); + + submitbutton = form.appendChild(submitbutton); + + form = element.appendChild(form); + form.setAttribute('target', iframeID); + + // The iframe must be added to the document after the form has been, or the targeting fails. + var iframe = document.createElement('iframe'); + iframe.setAttribute('src', 'about:blank'); + iframe.style.display = 'none'; + iframe.id = iframe.name = iframeID; + iframe.onload = function() { + var docCheck = iframe.contentDocument || iframe.contentWindow; + if (docCheck.location.href == 'about:blank') { + return; + } + // What to do on import? Add an entry to the UI, I guess... + alert('Add entry here'); + } + iframe = element.appendChild(iframe); + +} + +PSServer.prototype.saveDocument = function(path, filename, documentSource, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?upload&replace=true&filedata=" + escape(documentSource)+"&filename="+escape(path + filename), + null, + function(response) { + asyncCallback(true); + }, + function(response) { + asyncCallback(false); + }); +} + +PSServer.prototype.makeFolder = function(currentPath, folderName, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?directory&create&dirname="+escape(currentPath + '/' + folderName), + null, + function(response) { + asyncCallback(true); + }, + function(response) { + asyncCallback(false); + }); +} + +PSServer.prototype.deleteEntry = function(entry, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?file&delete&filename="+escape(entry.key), + null, + function(response) { + asyncCallback(true); + }, + function(response) { + asyncCallback(false); + }); +} + +PSServer.prototype.moveEntry = function(entry, container, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?file&rename&filename="+escape(entry.key)+'&newname='+escape(container.key + '/' + entry.name), + null, + function(json) { + asyncCallback(true); + }, + function(json) { + asyncCallback(false); + }); +} + +PSServer.prototype.copyEntry = function(entry, asyncCallback) { + Xinha._postback(Xinha.getPluginDir("PSServer") + "/backend.php?file©&filename="+escape(entry.key), + null, + function(json) { + var newentry = eval('(' + json + ')'); + asyncCallback(true, newentry); + }, + function(json) { + var newentry = eval('(' + json + ')'); + asyncCallback(false, newentry); + }); +} + +})(); diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/backend.php b/ccm-core/web/assets/xinha/plugins/PSServer/backend.php new file mode 100644 index 000000000..f78ed9f28 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSServer/backend.php @@ -0,0 +1,830 @@ + + * @version 1.0 + * @package PersistentStorage + * + */ + +/** + * Config file + */ +require_once('config.inc.php'); + + +// Strip slashes if MQGPC is on +set_magic_quotes_runtime(0); +if(get_magic_quotes_gpc()) +{ + $to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE); + while(count($to_clean)) + { + $cleaning =& $to_clean[array_pop($junk = array_keys($to_clean))]; + unset($to_clean[array_pop($junk = array_keys($to_clean))]); + foreach(array_keys($cleaning) as $k) + { + if(is_array($cleaning[$k])) + { + $to_clean[] =& $cleaning[$k]; + } + else + { + $cleaning[$k] = stripslashes($cleaning[$k]); + } + } + } +} + +// Set the return headers for a JSON response. +header('Cache-Control: no-cache, must-revalidate'); +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +//header('Content-type: application/json'); + + +/**#@+ + * Constants + * + * Since this is being used as part of a web interface, we'll set some rather + * conservative limits to keep from overloading the user or the backend. + */ + +/** + * This is the maximum folder depth to present to the user + */ +define('MAX_DEPTH', 10); + +/** + * This is the maximum number of file entries per folder to show to the user, + */ +define('MAX_FILES_PER_FOLDER', 50); + +/** + * This array contains the default HTTP Response messages + * + */ +$HTTP_ERRORS = array( + 'HTTP_SUCCESS_OK' => array('code' => 200, 'message' => 'OK'), + 'HTTP_SUCCESS_CREATED' => array('code' => 201, 'message' => 'Created'), + 'HTTP_SUCCESS_ACCEPTED' => array('code' => 202, 'message' => 'Accepted'), + 'HTTP_SUCCESS_NON_AUTHORITATIVE' => array('code' => 203, 'message' => 'Non-Authoritative Information'), + 'HTTP_SUCCESS_NO_CONTENT' => array('code' => 204, 'message' => 'No Content'), + 'HTTP_SUCCESS_RESET_CONTENT' => array('code' => 205, 'message' => 'Reset Content'), + 'HTTP_SUCCESS_PARTIAL_CONTENT' => array('code' => 206, 'message' => 'Partial Content'), + + 'HTTP_REDIRECTION_MULTIPLE_CHOICES' => array('code' => 300, 'message' => 'Multiple Choices'), + 'HTTP_REDIRECTION_PERMANENT' => array('code' => 301, 'message' => 'Moved Permanently'), + 'HTTP_REDIRECTION_FOUND' => array('code' => 302, 'message' => 'Found'), + 'HTTP_REDIRECTION_SEE_OTHER' => array('code' => 303, 'message' => 'See Other'), + 'HTTP_REDIRECTION_NOT_MODIFIED' => array('code' => 304, 'message' => 'Not Modified'), + 'HTTP_REDIRECTION_USE_PROXY' => array('code' => 305, 'message' => 'Use Proxy'), + 'HTTP_REDIRECTION_UNUSED' => array('code' => 306, 'message' => '(Unused)'), + 'HTTP_REDIRECTION_TEMPORARY' => array('code' => 307, 'message' => 'Temporary Redirect'), + + 'HTTP_CLIENT_BAD_REQUEST' => array('code' => 400, 'message' => 'Bad Request'), + 'HTTP_CLIENT_UNAUTHORIZED' => array('code' => 401, 'message' => 'Unauthorized'), + 'HTTP_CLIENT_PAYMENT_REQUIRED' => array('code' => 402, 'message' => 'Payment Required'), + 'HTTP_CLIENT_FORBIDDEN' => array('code' => 403, 'message' => 'Forbidden'), + 'HTTP_CLIENT_NOT_FOUND' => array('code' => 404, 'message' => 'Not Found'), + 'HTTP_CLIENT_METHOD_NOT_ALLOWED' => array('code' => 405, 'message' => 'Method Not Allowed'), + 'HTTP_CLIENT_NOT_ACCEPTABLE' => array('code' => 406, 'message' => 'Not Acceptable'), + 'HTTP_CLIENT_PROXY_AUTH_REQUIRED' => array('code' => 407, 'message' => 'Proxy Authentication Required'), + 'HTTP_CLIENT_REQUEST_TIMEOUT' => array('code' => 408, 'message' => 'Request Timeout'), + 'HTTP_CLIENT_CONFLICT' => array('code' => 409, 'message' => 'Conflict'), + 'HTTP_CLIENT_GONE' => array('code' => 410, 'message' => 'Gone'), + 'HTTP_CLIENT_LENGTH_REQUIRED' => array('code' => 411, 'message' => 'Length Required'), + 'HTTP_CLIENT_PRECONDITION_FAILED' => array('code' => 412, 'message' => 'Precondition Failed'), + 'HTTP_CLIENT_REQUEST_TOO_LARGE' => array('code' => 413, 'message' => 'Request Entity Too Large'), + 'HTTP_CLIENT_REQUEST_URI_TOO_LARGE' => array('code' => 414, 'message' => 'Request-URI Too Long'), + 'HTTP_CLIENT_UNSUPPORTED_MEDIA_TYPE' => array('code' => 415, 'message' => 'Unsupported Media Type'), + 'HTTP_CLIENT_REQUESTED_RANGE_NOT_POSSIBLE' => array('code' => 416, 'message' => 'Requested Range Not Satisfiable'), + 'HTTP_CLIENT_EXPECTATION_FAILED' => array('code' => 417, 'message' => 'Expectation Failed'), + + 'HTTP_SERVER_INTERNAL' => array('code' => 500, 'message' => 'Internal Server Error'), + 'HTTP_SERVER_NOT_IMPLEMENTED' => array('code' => 501, 'message' => 'Not Implemented'), + 'HTTP_SERVER_BAD_GATEWAY' => array('code' => 502, 'message' => 'Bad Gateway'), + 'HTTP_SERVER_SERVICE_UNAVAILABLE' => array('code' => 503, 'message' => 'Service Unavailable'), + 'HTTP_SERVER_GATEWAY_TIMEOUT' => array('code' => 504, 'message' => 'Gateway Timeout'), + 'HTTP_SERVER_UNSUPPORTED_VERSION' => array('code' => 505, 'message' => 'HTTP Version not supported') + ); + +/** + * This is a regular expression used to detect reserved or dangerous filenames. + * Most NTFS special filenames begin with a dollar sign ('$'), and most Unix + * special filenames begin with a period (.), so we'll keep them out of this + * list and just prevent those two characters in the first position. The rest + * of the special filenames are included below. + */ +define('RESERVED_FILE_NAMES', 'pagefile\.sys|a\.out|core'); +/** + * This is a regular expression used to detect invalid file names. It's more + * strict than necessary, to be valid multi-platform, but not posix-strict + * because we want to allow unicode filenames. We do, however, allow path + * seperators in the filename because the file could exist in a subdirectory. + */ +define('INVALID_FILE_NAME','^[.$]|^(' . RESERVED_FILE_NAMES . ')$|[?%*:|"<>]'); +/**#@-*/ + +function main($arguments) { + $config = get_config(true); + + // Trigger authentication if it's configured. + if ($config['capabilities']['user_storage'] && empty($_SERVER['PHP_AUTH_USER'])) { + header('WWW-Authenticate: Basic realm="Xinha Persistent Storage"'); + header('HTTP/1.0 401 Unauthorized'); + echo "You must login in order to use Persistent Storage"; + exit; + } + if (!input_valid($arguments, $config['capabilities'])) { + http_error_exit(); + } + if (!method_valid($arguments)) { + http_error_exit('HTTP_CLIENT_METHOD_NOT_ALLOWED'); + } + if (!dispatch($arguments)) { + http_error_exit(); + } + exit(); +} + +main($_REQUEST + $_FILES); +// ************************************************************ +// ************************************************************ +// Helper Functions +// ************************************************************ +// ************************************************************ + +/** + * Take the call and properly dispatch it to the methods below. This method + * assumes valid input. + */ +function dispatch($arguments) { + if (array_key_exists('file', $arguments)) { + if (array_key_exists('rename', $arguments)) { + if (!file_directory_rename($arguments['filename'], $arguments['newname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + if (array_key_exists('copy', $arguments)) { + if (!$newentry = file_copy($arguments['filename'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + echo json_encode($newentry); + return true; + } + if (array_key_exists('delete', $arguments)) { + if (!file_delete($arguments['filename'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + } + if (array_key_exists('directory', $arguments)) { + if (array_key_exists('listing', $arguments)) { + echo json_encode(directory_listing()); + return true; + } + if (array_key_exists('create', $arguments)) { + if (!directory_create($arguments['dirname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + if (array_key_exists('delete', $arguments)) { + if (!directory_delete($arguments['dirname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + if (array_key_exists('rename', $arguments)) { + if (!file_directory_rename($arguments['dirname'], $arguments['newname'], working_directory())) { + http_error_exit('HTTP_CLIENT_FORBIDDEN'); + } + return true; + } + } + if (array_key_exists('image', $arguments)) { + } + if (array_key_exists('upload', $arguments)) { + store_uploaded_file($arguments['filename'], $arguments['filedata'], working_directory()); + return true; + } + + return false; +} + +/** + * Validation of the HTTP Method. For operations that make changes we require + * POST. To err on the side of safety, we'll only allow GET for known safe + * operations. This way, if the API is extended, and the method is not + * updated, we will not accidentally expose non-idempotent methods to GET. + * This method can only correctly validate the operation if the input is + * already known to be valid. + * + * @param array $arguments The arguments array received by the page. + * @return boolean Whether or not the HTTP method is correct for the given input. + */ +function method_valid($arguments) { + // We assume that the only + $method = $_SERVER['REQUEST_METHOD']; + + if ($method == 'GET') { + if (array_key_exists('directory', $arguments) && array_key_exists('listing', $arguments)) { + return true; + } + + return false; + } + + if ($method == 'POST') { + return true; + } + return false; +} + +/** + * Validation of the user input. We'll verify what we receive from the user, + * and send an error in the case of malformed input. + * + * Some examples of the URLS associated with this API: + * ** File Operations ** + * ?file&delete&filename='' + * ?file©&filename='' + * ?file&rename&filename=''&newname='' + * + * ** Directory Operations ** + * ?directory&listing + * ?directory&create&dirname='' + * ?directory&delete&dirname='' + * ?directory&rename&dirname=''&newname='' + * + * ** Image Operations ** + * ?image&filename=''&[scale|rotate|convert] + * + * ** Upload ** + * ?upload&filedata=[binary|text]&filename=''&replace=[true|false] + * + * @param array $arguments The arguments array received by the page. + * @param array $capabilities The capabilities config array used to limit operations. + * @return boolean Whether or not the input received is valid. + */ +function input_valid($arguments, $capabilities) { + // This is going to be really ugly code because it's basically a DFA for + // parsing arguments. To make things a little clearer, I'll put a + // pseudo-BNF for each block to show the decision structure. + // + // file[empty] filename[valid] (delete[empty] | copy[empty] | (rename[empty] newname[valid])) + if ($capabilities['file_operations'] && + array_key_exists('file', $arguments) && + empty($arguments['file']) && + array_key_exists('filename', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['filename'])) { + + if (array_key_exists('delete', $arguments) && + empty($arguments['delete']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('copy', $arguments) && + empty($arguments['copy']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('rename', $arguments) && + empty($arguments['rename']) && + 4 == count($arguments)) { + + if (array_key_exists('newname', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['newname'])) { + + return true; + } + } + + return false; + } elseif (array_key_exists('file', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + // directory[empty] (listing[empty] | (dirname[valid] (create[empty] | delete[empty] | (rename[empty] newname[valid])))) + if ($capabilities['directory_operations'] && + array_key_exists('directory', $arguments) && + empty($arguments['directory'])) { + + if (array_key_exists('listing', $arguments) && + empty($arguments['listing']) && + 2 == count($arguments)) { + + return true; + } + + if (array_key_exists('dirname', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['dirname'])) { + + if (array_key_exists('create', $arguments) && + empty($arguments['create']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('delete', $arguments) && + empty($arguments['delete']) && + 3 == count($arguments)) { + + return true; + } + + if (array_key_exists('rename', $arguments) && + empty($arguments['rename']) && + 4 == count($arguments)) { + + if (array_key_exists('newname', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['newname'])) { + + return true; + } + } + } + + return false; + } elseif (array_key_exists('directory', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + // image[empty] filename[valid] ((scale[empty] dimensions[valid]) | (rotate[empty] angle[valid]) | (convert[empty] imagetype[valid])) + if ($capabilities['image_operations'] && + array_key_exists('image', $arguments) && + empty($arguments['image']) && + array_key_exists('filename', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['filename']) && + 4 == count($arguments)) { + + if (array_key_exists('scale', $arguments) && + empty($arguments['scale']) && + !ereg(INVALID_FILE_NAME, $arguments['dimensions'])) { + // TODO: FIX REGEX + http_error_exit(); + + return true; + } + + if (array_key_exists('rotate', $arguments) && + empty($arguments['rotate']) && + !ereg(INVALID_FILE_NAME, $arguments['angle'])) { + // TODO: FIX REGEX + http_error_exit(); + + return true; + } + + if (array_key_exists('convert', $arguments) && + empty($arguments['convert']) && + !ereg(INVALID_FILE_NAME, $arguments['imagetype'])) { + // TODO: FIX REGEX + http_error_exit(); + + return true; + } + + return false; + } elseif (array_key_exists('image', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + // upload[empty] filedata[binary|text] replace[true|false] filename[valid]? + if ($capabilities['upload_operations'] && + array_key_exists('upload', $arguments) && + empty($arguments['upload']) && + array_key_exists('filedata', $arguments) && + !empty($arguments['filedata']) && + array_key_exists('replace', $arguments) && + ereg('true|false', $arguments['replace'])) { + + if (4 == count($arguments) && + array_key_exists('filename', $arguments) && + !ereg(INVALID_FILE_NAME, $arguments['filename'])) { + + return true; + } + + if (3 == count($arguments)) { + + return true; + } + + return false; + } elseif (array_key_exists('upload', $arguments)) { + // This isn't necessary because we'll fall through to false, but I'd + // rather return earlier than later. + return false; + } + + + return false; +} + +/** + * HTTP level error handling. + * @param integer $code The HTTP error code to return to the client. This defaults to 400. + * @param string $message Error message to send to the client. This defaults to the standard HTTP error messages. + */ +function http_error_exit($error = 'HTTP_CLIENT_BAD_REQUEST', $message='') { + global $HTTP_ERRORS; + $message = !empty($message) ? $message : "HTTP/1.0 {$HTTP_ERRORS[$error]['code']} {$HTTP_ERRORS[$error]['message']}"; + header($message); + exit($message); +} + +/** + * Process the config and return the absolute directory we should be working with, + * @return string contains the path of the directory all file operations are limited to. + */ +function working_directory() { + $config = get_config(true); + return realpath(getcwd() . DIRECTORY_SEPARATOR . $config['storage_dir'] . DIRECTORY_SEPARATOR); +} + +/** + * Check to see if the supplied filename is inside + */ +function directory_contains($container_directory, $checkfile) { + + // Get the canonical directory and canonical filename. We add a directory + // seperator to prevent the user from sidestepping into a sibling directory + // that starts with the same prefix. (e.g. from /home/john to + // /home/johnson) + $container_directory = realpath($container_directory) + DIRECTORY_SEPARATOR; + $checkfile = realpath($checkfile); + + // Now that we have the canonical versions, we can do a string comparison + // to see if checkfile is inside of container_directory. + if (strlen($checkfile) <= strlen($container_directory)) { + // We don't consider the directory to be inside of itself. This + // prevents users from trying to perform operations on the container + // directory itself. + return false; + } + + // PHP equivalent of string.startswith() + return substr($checkfile, 0, strlen($container_directory)) == $container_directory; +} + +/**#@+ + * Directory Operations + * {@internal ***************************************************************** + * **************************************************************************}} + */ + +/** + * Return a directory listing as a PHP array. + * @param string $directory The directory to return a listing of. + * @param integer $depth The private argument used to limit recursion depth. + * @return array representing the directory structure. + */ + +function directory_listing($directory='', $depth=1) { + // We return an empty array if the directory is empty + $result = array('$type'=>'folder'); + + // We won't recurse below MAX_DEPTH. + if ($depth > MAX_DEPTH) { + return $result; + } + + $path = empty($directory) ? working_directory() : $directory; + + // We'll open the directory to check each of the entries + if ($dir = opendir($path)) { + + // We'll keep track of how many file we process. + $count = 0; + + // For each entry in the file + while (($file = readdir($dir)) !== false) { + + // Limit the number of files we process in this folder + $count += 1; + if ($count > MAX_FILES_PER_FOLDER) { + return $result; + } + + // Ignore hidden files (this includes special files '.' and '..') + if (strlen($file) && ($file[0] == '.')) { + continue; + } + + $filepath = $path . DIRECTORY_SEPARATOR . $file; + + if (filetype($filepath) == 'dir') { + // We'll recurse and add those results + $result[$file] = directory_listing($filepath, $depth + 1); + } else { + // We'll check to see if we can read any image information from + // the file. If so, we know it's an image, and we can return + // it's metadata. + $imageinfo = @getimagesize($filepath); + if ($imageinfo) { + + $result[$file] = array('$type'=>'image','metadata'=>array( + 'width'=>$imageinfo[0], + 'height'=>$imageinfo[1], + 'mimetype'=>$imageinfo['mime'] + )); + + } elseif ($extension = strrpos($file, '.')) { + $extension = substr($file, $extension); + if (($extension == '.htm') || ($extension == '.html')) { + $result[$file] = array('$type'=>'html'); + } else { + $result[$file] = array('$type'=>'text'); + } + } else { + $result[$file] = array('$type'=>'document'); + } + } + } + + closedir($dir); + } + return $result; +} + +/** + * Create a directory, limiting operations to the chroot directory. + * @param string $dirname The path to the directory, relative to $chroot. + * @param string $chroot Only directories inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function directory_create($dirname, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // We have to take the dirname of the parent directory first, since + // realpath just returns false if the directory doesn't already exist on + // the filesystem. + $createparent = realpath(dirname($chroot . DIRECTORY_SEPARATOR . $dirname)); + $createsub = basename($chroot . DIRECTORY_SEPARATOR . $dirname); + + // The bailout rules for directories that don't exist are complicated + // because of having to work around realpath. If the parent directory is + // the same as the chroot, it won't be contained. For this case, we'll + // check to see if the chroot and the parent are the same and allow it only + // if the sub portion of dirname is not-empty. + if (!directory_contains($chroot, $createparent) && + !(($chroot == $createparent) && !empty($createsub))) { + return false; + } + + return @mkdir($createparent . DIRECTORY_SEPARATOR . $createsub); +} + +/** + * Delete a directory, limiting operations to the chroot directory. + * @param string $dirname The path to the directory, relative to $chroot. + * @param string $chroot Only directories inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function directory_delete($dirname, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $dirname is relative to $chroot. + $dirname = realpath($chroot . DIRECTORY_SEPARATOR . $dirname); + + // Limit directory operations to the supplied directory. + if (!directory_contains($chroot, $dirname)) { + return false; + } + + return @rmdir($dirname); +} + + +/**#@-*/ +/**#@+ + * File Operations + * {@internal ***************************************************************** + * **************************************************************************}} + */ + +/** + * Rename a file or directory, limiting operations to the chroot directory. + * @param string $filename The path to the file or directory, relative to $chroot. + * @param string $renameto The path to the renamed file or directory, relative to $chroot. + * @param string $chroot Only files and directories inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function file_directory_rename($filename, $renameto, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $filename is relative to $chroot. + $filename = realpath($chroot . DIRECTORY_SEPARATOR . $filename); + + // We have to take the dirname of the renamed file or directory first, + // since realpath just returns false if the file or direcotry doesn't + // already exist on the filesystem. + $renameparent = realpath(dirname($chroot . DIRECTORY_SEPARATOR . $renameto)); + $renamefile = basename($chroot . DIRECTORY_SEPARATOR . $renameto); + + // Limit file operations to the supplied directory. + if (!directory_contains($chroot, $filename)) { + return false; + } + + // The bailout rules for the renamed file or directory are more complicated + // because of having to work around realpath. If the renamed parent + // directory is the same as the chroot, it won't be contained. For this + // case, we'll check to see if they're the same and allow it only if the + // file portion of renameto is not-empty. + if (!directory_contains($chroot, $renameparent) && + !(($chroot == $renameparent) && !empty($renamefile))) { + return false; + } + + return @rename($filename, $renameparent . DIRECTORY_SEPARATOR . $renamefile); +} + + +/** + * Copy a file, limiting operations to the chroot directory. + * @param string $filename The path to the file, relative to $chroot. + * @param string $chroot Only files inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function file_copy($filename, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $filename is relative to $chroot. + $filename = realpath($chroot . DIRECTORY_SEPARATOR . $filename); + + // Limit file operations to the supplied directory. + if (!directory_contains($chroot, $filename)) { + return false; + } + + // The PHP copy function blindly copies over existing files. We don't wish + // this to happen, so we have to perform the copy a bit differently. If we + // do a check to make sure the file exists, there's always the chance of a + // race condition where someone else creates the file in between the check + // and the copy. The only safe way to ensure we don't overwrite an + // existing file is to call fopen in create-only mode (mode 'x'). If it + // succeeds, the file did not exist before, and we've successfully created + // it, meaning we own the file. After that, we can safely copy over our + // own file. + for ($count=1; $countarray('$type'=>'image')); + } + } + + return false; +} + +/** + * Delete a file, limiting operations to the chroot directory. + * @param string $filename The path to the file, relative to $chroot. + * @param string $chroot Only files inside this directory or its subdirectories can be affected. + * @return boolean Returns TRUE if successful, and FALSE otherwise. + */ +function file_delete($filename, $chroot) { + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // $filename is relative to $chroot. + $filename = realpath($chroot . DIRECTORY_SEPARATOR . $filename); + + // Limit file operations to the supplied directory. + if (!directory_contains($chroot, $filename)) { + return false; + } + + return @unlink($filename); +} +/**#@-*/ +/**#@+ + * Upload Operations + * {@internal ***************************************************************** + * **************************************************************************}} + */ + +function store_uploaded_file($filename, $filedata, $chroot) { + + // If chroot is empty, then we will not perform the operation. + if (empty($chroot)) { + return false; + } + + // If the filename is empty, it was possibly supplied as part of the + // upload. + $filename = empty($filename) ? $filedata['name'] : $filename; + + // We have to take the dirname of the parent directory first, since + // realpath just returns false if the directory doesn't already exist on + // the filesystem. + $uploadparent = realpath(dirname($chroot . DIRECTORY_SEPARATOR . $filename)); + $uploadfile = basename($chroot . DIRECTORY_SEPARATOR . $filename); + + // The bailout rules for directories that don't exist are complicated + // because of having to work around realpath. If the parent directory is + // the same as the chroot, it won't be contained. For this case, we'll + // check to see if the chroot and the parent are the same and allow it only + // if the sub portion of dirname is not-empty. + if (!directory_contains($chroot, $uploadparent) && + !(($chroot == $uploadparent) && !empty($uploadfile))) { + return false; + } + + $target_path = $uploadparent . DIRECTORY_SEPARATOR . $uploadfile; + + if (is_array($filedata)) { + // We've received the file as an upload, so it's been saved to a temp + // directory. We'll move it to where it belongs. + + if(move_uploaded_file($filedata['tmp_name'], $target_path)) { + return true; + } + } elseif ($file = @fopen($target_path, 'w')) { + // We've received the file as data. We'll create/open the file and + // save the data. + @fwrite($file, $filedata); + @fclose($file); + return true; + } + + return false; +} + +/**#@-*/ + +?> diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/config.inc.php b/ccm-core/web/assets/xinha/plugins/PSServer/config.inc.php new file mode 100644 index 000000000..11235e3c6 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSServer/config.inc.php @@ -0,0 +1,194 @@ + + * @version 1.0 + * @package PersistentStorage + */ + +/** + * If this file is being requested over the web, we display a JSON version of + * the publicly viewable config info. + */ +if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { + echo json_encode(get_config()); +} + +/** + * Gets the configuration information used by this package. + * {@source } + * @param boolean $getprivates Return private configuration info merged with the public. + * @returns array The configuration information for this package. + */ +function get_config($getprivates=False) { + + // We set up two different settings array, so that we can have settings + // that won't be shown to the public. + $Private = array(); + $Public = array(); + + /** + * For demo purposes, we can lie to the frontend and pretend to have user + * storage. Since we don't have a password mechanism, this simulation will + * accept any password. + */ + $Private['simulate_user_auth'] = false; + + /** + * The capabilities array contains directives about what major options to + * allow or disallow. + */ + $Public['capabilities'] = array( + // Allow directory operations (e.g. rename, create, delete directories) + 'directory_operations' => true, + // Allow file operations (e.g. copy, rename, delete files) + 'file_operations' => true, + // Allow image operations (e.g. scale, rotate, convert images) + 'image_operations' => true, + // Allow file uploads + 'upload_operations' => true, + // Stored files have a published URL + 'shared_publish' => true, + // By default, if the user is authenticated, we enable user storage. + // Set to false to disable. + 'user_storage' => !empty($_SERVER['PHP_AUTH_USER']) || $Private['simulate_user_auth'] + ); + + /** + * Directory exposed to user operations. Be sure that the web server has + * read and write access to this directory. + */ + $Private['storage_dir'] = 'demo_images'; + + /** + * The URL that the storage directory is exposed as. By default, we try + * and guess based on the URL used to access this page. Also, since we + * allow user upload, this directory should not be executable by the + * server. A sample .htaccess file is included in demo_images. + */ + $Private['storage_url'] = str_replace( array("backend.php","manager.php"), + "", $_SERVER["PHP_SELF"] ) . $Private['storage_dir']; + + /* + Possible values: true, false + + TRUE - If PHP on the web server is in safe mode, set this to true. + SAFE MODE restrictions: directory creation will not be possible, + only the GD library can be used, other libraries require + Safe Mode to be off. + + FALSE - Set to false if PHP on the web server is not in safe mode. + */ + $Private['safe_mode'] = ini_get('safe_mode'); + + /** + * If PHP Safe Mode is on than only the GD image library will function, so + * we force the default + */ + if ($Private['safe_mode']) { + @define('IMAGE_CLASS', 'GD'); + } else { + /* + Possible values: 'GD', 'IM', or 'NetPBM' + + The image manipulation library to use, either GD or ImageMagick or NetPBM. + */ + @define('IMAGE_CLASS', 'GD'); + + /* + After defining which library to use, if it is NetPBM or IM, you need to + specify where the binary for the selected library are. And of course + your server and PHP must be able to execute them (i.e. safe mode is OFF). + GD does not require the following definition. + */ + @define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/'); + } + + /* + The prefix for thumbnail files, something like .thumb will do. The + thumbnails files will be named as "prefix_imagefile.ext", that is, + prefix + orginal filename. + */ + $Private['thumbnail_prefix'] = 't_'; + + /** + * The thumbnail array groups all of the configuration related to thumbnail + * operations. + */ + $Private['thumbnails'] = array( + // The prefix to apply to all created thumbnails. + 'prefix' => 't_', + // A subdirectory to keep thumbnails in. If this is empty, thumbnails + // will be stored alongside the files. + 'directory' => '', + // Whether or not to filter thumbnails from the directory listing. + 'filter' => true, + // Filetypes which we restrict thumbnail operations to. + 'filetypes' => array("jpg", "gif", "png", "bmp"), + // What pixel sizes to save the thumbnails as. + 'width' => 84, + 'height' => 84 + ); + + + /** + * Resized prefix + * + * The prefix for resized files, something like .resized will do. The + * resized files will be named _x_ + * resized files are created when one changes the dimensions of an image + * in the image manager selection dialog - the image is scaled when the + * user clicks the ok button. + */ + + $Private['resized_prefix'] = '.resized'; + + // ------------------------------------------------------------------------- + + /** + * Resized Directory + * + * Resized images may also be stored in a directory, except in safe mode. + */ + + $Private['resized_dir'] = ''; + + /* Maximum upload file size + + Possible values: number, "max" + + number - maximum size in Kilobytes. + + "max" - the maximum allowed by the server (the value is retrieved from the server configuration). + */ + $Private['max_filesize_kb_image'] = 200; + + $Private['max_filesize_kb_link'] = 5000; + + /* Maximum upload folder size in Megabytes. Use 0 to disable limit */ + $Private['max_foldersize_mb'] = 0; + + /* + Allowed extensions that can be shown and allowed to upload. + Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip" + -Changed by AFRU. + */ + + $Private['allowed_image_extensions'] = array("jpg","gif","png","bmp"); + $Private['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls","doc"); + + + /* + Image Editor temporary filename prefix. + */ + $Private['tmp_prefix'] = '.editor_'; + + + // Config variables are finished, this returns our data to the caller. + if ($getprivates) { + return $Public+$Private; + } + + return $Public; +} +?> diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/.htaccess b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/.htaccess new file mode 100644 index 000000000..047113220 --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/.htaccess @@ -0,0 +1,2 @@ +php_flag engine off +AddType text/html .html .htm .shtml .php .php3 .phtml .phtm .pl .py .cgi \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/bikerpeep.jpg b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/bikerpeep.jpg new file mode 100644 index 000000000..a2e7028eb Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/bikerpeep.jpg differ diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/linux/linux.gif b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/linux/linux.gif new file mode 100644 index 000000000..3f42d2ce6 Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/linux/linux.gif differ diff --git a/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/wesnoth078.jpg b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/wesnoth078.jpg new file mode 100644 index 000000000..ea37d1aea Binary files /dev/null and b/ccm-core/web/assets/xinha/plugins/PSServer/demo_images/wesnoth078.jpg differ diff --git a/ccm-core/web/assets/xinha/plugins/PasteText/PasteText.js b/ccm-core/web/assets/xinha/plugins/PasteText/PasteText.js index 47bbb57db..2982e7022 100644 --- a/ccm-core/web/assets/xinha/plugins/PasteText/PasteText.js +++ b/ccm-core/web/assets/xinha/plugins/PasteText/PasteText.js @@ -1,2 +1,140 @@ -/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ -function PasteText(c){this.editor=c;var a=c.config;var b=this;a.registerButton({id:"pastetext",tooltip:this._lc("Paste as Plain Text"),image:c.imgURL("ed_paste_text.gif","PasteText"),textMode:false,action:function(){b.show()}});a.addToolbarElement("pastetext",["paste","killword"],1)}PasteText._pluginInfo={name:"PasteText",version:"1.2",developer:"Michael Harris",developer_url:"http://www.jonesadvisorygroup.com",c_owner:"Jones Advisory Group",sponsor:"Jones International University",sponsor_url:"http://www.jonesinternational.edu",license:"htmlArea"};PasteText.prototype._lc=function(a){return Xinha._lc(a,"PasteText")};Xinha.Config.prototype.PasteText={showParagraphOption:true,newParagraphDefault:true};PasteText.prototype.onGenerateOnce=function(){var a=PasteText;if(a.loading){return}a.loading=true;Xinha._getback(Xinha.getPluginDir("PasteText")+"/popups/paste_text.html",function(b){a.html=b})};PasteText.prototype._prepareDialog=function(){var b=this;var a=this.editor;var b=this;this.dialog=new Xinha.Dialog(a,PasteText.html,"PasteText",{width:350});this.dialog.getElementById("ok").onclick=function(){b.apply()};this.dialog.getElementById("cancel").onclick=function(){b.dialog.hide()};if(a.config.PasteText.showParagraphOption){this.dialog.getElementById("paragraphOption").style.display=""}if(a.config.PasteText.newParagraphDefault){this.dialog.getElementById("insertParagraphs").checked=true}this.dialog.onresize=function(){this.getElementById("inputArea").style.height=parseInt(this.height,10)-this.getElementById("h1").offsetHeight-this.getElementById("buttons").offsetHeight-parseInt(this.rootElem.style.paddingBottom,10)+"px";this.getElementById("inputArea").style.width=(this.width-2)+"px"}};PasteText.prototype.show=function(){if(!this.dialog){this._prepareDialog()}var a={inputArea:""};this.dialog.show(a);this.dialog.onresize();this.dialog.getElementById("inputArea").focus()};PasteText.prototype.apply=function(){var a=this.dialog.hide();var b=a.inputArea;var c=a.insertParagraphs;b=b.replace(//g,">");if(a.insertParagraphs){b=b.replace(/\t/g,"    ");b=b.replace(/\n/g,"

");b="

"+b+"

";if(Xinha.is_ie){this.editor.insertHTML(b)}else{this.editor.execCommand("inserthtml",false,b)}}else{b=b.replace(/\n/g,"
");this.editor.insertHTML(b)}}; \ No newline at end of file +// Paste Plain Text plugin for Xinha + +// Distributed under the same terms as Xinha itself. +// This notice MUST stay intact for use (see license.txt). + +function PasteText(editor) { + this.editor = editor; + var cfg = editor.config; + var self = this; + + cfg.registerButton({ + id : "pastetext", + tooltip : this._lc("Paste as Plain Text"), + image : editor.imgURL("ed_paste_text.gif", "PasteText"), + textMode : false, + action : function() { self.show(); } + }); + + cfg.addToolbarElement("pastetext", ["paste", "killword"], 1); +} + +PasteText._pluginInfo = { + name : "PasteText", + version : "1.2", + developer : "Michael Harris", + developer_url : "http://www.jonesadvisorygroup.com", + c_owner : "Jones Advisory Group", + sponsor : "Jones International University", + sponsor_url : "http://www.jonesinternational.edu", + license : "htmlArea" +}; + +PasteText.prototype._lc = function(string) { + return Xinha._lc(string, 'PasteText'); +}; + +Xinha.Config.prototype.PasteText = +{ + showParagraphOption : true, + newParagraphDefault :true +} + +PasteText.prototype.onGenerateOnce = function() +{ + var self = PasteText; + if (self.loading) return; + self.loading = true; + Xinha._getback(Xinha.getPluginDir("PasteText") + '/popups/paste_text.html', function(getback) { self.html = getback;}); +}; + +PasteText.prototype._prepareDialog = function() +{ + var self = this; + var editor = this.editor; + + var self = this; + +/// Now we have everything we need, so we can build the dialog. + this.dialog = new Xinha.Dialog(editor, PasteText.html, 'PasteText',{width:350}) + + // Connect the OK and Cancel buttons + this.dialog.getElementById('ok').onclick = function() {self.apply();} + + this.dialog.getElementById('cancel').onclick = function() { self.dialog.hide()}; + + // do some tweaking + if (editor.config.PasteText.showParagraphOption) + { + this.dialog.getElementById("paragraphOption").style.display = ""; + } + if (editor.config.PasteText.newParagraphDefault) + { + this.dialog.getElementById("insertParagraphs").checked = true; + } + + // we can setup a custom function that cares for sizes etc. when the dialog is resized + this.dialog.onresize = function () + { + this.getElementById("inputArea").style.height = + parseInt(this.height,10) // the actual height of the dialog + - this.getElementById('h1').offsetHeight // the title bar + - this.getElementById('buttons').offsetHeight // the buttons + - parseInt(this.rootElem.style.paddingBottom,10) // we have a padding at the bottom, gotta take this into acount + + 'px'; // don't forget this ;) + + this.getElementById("inputArea").style.width =(this.width - 2) + 'px'; // and the width + + } +}; + +PasteText.prototype.show = function() +{ + if (!this.dialog) this._prepareDialog(); + + // here we can pass values to the dialog + // each property pair consists of the "name" of the input we want to populate, and the value to be set + var inputs = + { + inputArea : '' // we want the textarea always to be empty on showing + } + // now calling the show method of the Xinha.Dialog object to set the values and show the actual dialog + this.dialog.show(inputs); + + // Init the sizes (only if we have set up the custom resize function) + this.dialog.onresize(); + + this.dialog.getElementById("inputArea").focus(); +}; + +// and finally ... take some action +PasteText.prototype.apply = function() +{ + // the hide method of the dialog object returns the values of the inputs AND hides the dialog + // could also use this.dialog.getValues() here and hide it at the end + var returnValues = this.dialog.hide(); + + var html = returnValues.inputArea; + var insertParagraphs = returnValues.insertParagraphs; + html = html.replace(//g, ">"); + if ( returnValues.insertParagraphs) + { + html = html.replace(/\t/g,"    "); + html = html.replace(/\n/g,"

"); + html="

" + html + "

"; + if (Xinha.is_ie) + { + this.editor.insertHTML(html); + } + else + { + this.editor.execCommand("inserthtml",false,html); + } + } + else + { + html = html.replace(/\n/g,"
"); + this.editor.insertHTML(html); + } +}; \ No newline at end of file diff --git a/ccm-core/web/assets/xinha/plugins/PersistentStorage/PersistentStorage.js b/ccm-core/web/assets/xinha/plugins/PersistentStorage/PersistentStorage.js new file mode 100644 index 000000000..1af4d215d --- /dev/null +++ b/ccm-core/web/assets/xinha/plugins/PersistentStorage/PersistentStorage.js @@ -0,0 +1,1135 @@ +/** + * @fileOverview PersistentStorage PersistentStorage.js file. + * This plugin is a rethinking of the ExtendFileManager plugin written and + * designed by Wei Zhuo, Afru, Krzysztof Kotowicz, Raimund Meyer. + * + * @author Douglas Mayle + * @version 1.0 + */ + +/** + * The global namespace + * @name window + */ +(function($) { +/** + * @name PersistentStorage + * @class Provides an interface for persistant storage options to the user. + * @param editor A reference to the Xinha Editor this plugin instance is attached to. + */ +var PersistentStorage = window.PersistentStorage = function (editor) { + /** + * @memberOf Xinha + */ + this.editor = editor; + var self = this; +} + +/** + * Plugin Metadata + * @namespace + * @static + */ +PersistentStorage._pluginInfo = { + /** Plugin name */ + name : "PersistentStorage", + /** Plugin version */ + version : "1.0", + /** Plugin author */ + developer : "Douglas Mayle", + /** Plugin author's website */ + developer_url : "http://douglas.mayle.org", + /** Plugin license */ + license : "BSD" +}; + +/** + * The list of backend modules registered with this instance. + */ +PersistentStorage.prototype._backends = {}; + +/** + * The list of user config files received from backends. + */ +PersistentStorage.prototype._userconfigs = []; + +/** + * The name of the currently active backend. + */ +PersistentStorage.prototype._activeBackend = ''; + +/** + * The value of the type filter that's currently in effect. + */ +PersistentStorage.prototype._typeFilter = ''; + +/** + * The currently displayed view type. + */ +PersistentStorage.prototype._viewType = 'thumbnail'; + +/** + * On Xinha activation, this get's called so that we can prepare any resources + * we need to function. + */ +PersistentStorage.prototype.onGenerateOnce = function () { + // We use _prepareDialog to asynchronously load the dialog markup and then + // perform necessary processing. + this._prepareDialog(); +}; + +function addClass(element, className) { + var classRegex = new RegExp(' ?' + className + ' ?'); + + if (!classRegex.test(element.className)) { + element.className += ' ' + className; + } +} + +function removeClass(element, className) { + var classRegex = new RegExp(' ?' + className + ' ?'); + + if (classRegex.test(element.className)) { + element.className = element.className.replace(classRegex, ' '); + } +} + +function toggleClass(element, className) { + var classRegex = new RegExp(' ?' + className + ' ?'); + + if (classRegex.test(element.className)) { + element.className = element.className.replace(classRegex, ' '); + } else { + element.className += ' ' + className; + } +} + +/** + * Once we're sure we have a backend that supports document functionality, + * we'll load the interface that exposes it. + */ +PersistentStorage.prototype._registerDocumentUI = function () { + if (this._documentEnabled) { + // No need to repeated rebuild the UI. + return; + } + + this._documentEnabled = true; + var self = this; + + var editor = this.editor; + + editor.config.registerButton({ + id : 'newdocument', + tooltip : Xinha._lc( 'New Document', 'PersistentStorage' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',0,5], + textMode : true, + action : function() { self.newDocument(); } + } + ); + editor.config.registerButton({ + id : 'opendocument', + tooltip : Xinha._lc( 'Open Document', 'PersistentStorage' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',1,5], + textMode : true, + action : function() { self.openDialog(); } + } + ); + editor.config.registerButton({ + id : 'savedocument', + tooltip : Xinha._lc( 'Save Document', 'PersistentStorage' ), + image : [_editor_url + editor.config.imgURL + 'ed_buttons_main.png',9,1], + textMode : true, + action : function() { self.saveDialog(); } + } + ); + editor.config.addToolbarElement('newdocument', 'fullscreen', 1); + editor.config.addToolbarElement('opendocument', 'newdocument', 1); + editor.config.addToolbarElement('savedocument', 'opendocument', 1); + + // Since this is after the editor load, we have to trigger an udate manually... + editor._rebuildToolbar(); +}; + +/** + * Backend storage plugins should call this method so that they can be exposed + * to the user. Because of possible quirks in plugin loading, you should use + * the following example code when registering. + * @param name The name of the module + * @param module The module instance + * @param config Configuration information that tells us about the module + * @param user_config AN object representing the user configuration loaded from + * this module. + * @example + + * PSBackend.prototype.onGenerateOnce = function () { + * // Register with the Persistent Storage plugin. + * this._registerBackend(); + * }; + * PSBackend.prototype._registerBackend = function(timeWaited) { + * var editor = this.editor; + * var self = this; + * + * if (!timeWaited) { + * timeWaited = 0; + * } + * + * // Retry over a period of ten seconds to register. We back off exponentially + * // to limit resouce usage in the case of misconfiguration. + * var registerTimeout = 10000; + * + * if (timeWaited > registerTimeout) { + * // This is most likely a configuration error. We're loaded and + * // PersistentStorage is not. + * return; + * } + * + * if (!editor.plugins['PersistentStorage'] || + * !editor.plugins['PersistentStorage'].instance || + * !editor.plugins['PersistentStorage'].instance.ready) { + * + * window.setTimeout(function() { + * self._registerBackend(timeWaited ? timeWaited*2 : 50); + * }, timeWaited ? timeWaited : 50); + * + * return; + * } + * var PS = editor.plugins['PersistentStorage'].instance; + * + * // Support user configuration. This loading should be moved into PersistentStorage... + * this.loadDocument({URL:'', name:'config.js', key:'/config.js'}, function(json) { + * var userconfig = json ? eval('(' + json + ')') : false; + * PS.registerBackend('PSLocal', self, self.config, userconfig); + * }); + */ +PersistentStorage.prototype.registerBackend = function (name, module, config, user_config) { + this._backends[name] = {module: module, config: config, name: name}; + + // TODO I'd like something more than just whoever calls back first wins for ordering. + if (!this._activeBackend) { + this.setBackend(name); + } + + if (config.capabilities.upload_operations && + config.capabilities.file_operations) { + this._registerDocumentUI(); + } + + // Handle user configuration + if (user_config) { + this._userconfigs.push(user_config); + this.configureUser(); + } + + this.updatePlacesDisplay(); +} + +/** + * Go through the list of user configs and reconfigure Xinha. + */ +PersistentStorage.prototype.configureUser = function () { + // Temp code does not handle user affinity + var self = this; + for (var index=0; index # # *(Delete) * *(Delete) * *(Delete) * *(Delete) * # * + * * # \/ # # *********** *********** *********** *********** # * + * * # Gears # # # * + * * # # ############################################################## * + * * # # * + * * # # *Import-(Collapsed)******************************************* * + * * # # * + * * # # #File Name -or- File Details################################## * + * * # # # # * + * * # # # # * + * * # # # # * + * * # # # # * + * * ######### ############################################################## * + * * * + * **************************************************************************** + */ + +PersistentStorage.prototype.showDialog = function (options) { + // Create a reference to this PS instance to allow for asynchronous + // continuation (if we're not ready.) + var self = this; + + if (!this.ready) { + window.setTimeout(function() {self.showDialog(options);}, 80); + return; + } + + // We hide and show the various elements of the dialog depending on usage. + removeClass(this.dialog.getElementById("WWW"), 'hidden'); + addClass(this.dialog.getElementById("namefield"), 'hidden'); + addClass(this.dialog.getElementById("placeWww"), 'hidden'); + addClass(this.dialog.getElementById("placeBackend"), 'hidden'); + + switch (options.styleFor) { + case 'link': + removeClass(this.dialog.getElementById("placeWww"), 'hidden'); + this.updatePlacesDisplay('shared_publish'); + break; + case 'insertion': + removeClass(this.dialog.getElementById("placeBackend"), 'hidden'); + this.updatePlacesDisplay('shared_publish'); + break; + case 'documentsave': + addClass(this.dialog.getElementById("WWW"), 'hidden'); + removeClass(this.dialog.getElementById("namefield"), 'hidden'); + removeClass(this.dialog.getElementById("placeBackend"), 'hidden'); + this.updatePlacesDisplay('file_operations'); + break; + case 'documentload': + addClass(this.dialog.getElementById("WWW"), 'hidden'); + removeClass(this.dialog.getElementById("placeBackend"), 'hidden'); + this.updatePlacesDisplay('file_operations'); + break; + } + + var directories = this.dialog.getElementById("filters"); + var fileBrowser = this.dialog.getElementById("fileList"); + + // Store the type filter so that view updates will correctly filter the contents. + this._typeFilter = options.typeFilter; + + var module = this._backends[this._activeBackend].module; + + this.updateFileBrowser(); +} + +/** + * Take the list of filters and build the contents of the select element. + * @param filters {Filter[]} An array of filter choices to display to the user. + * @param filters[n].value The unique key that represents this filter to the backend. + * @param filters[n].display {String} A text string to display to the user to + * represent the given filter. + * @param select {HTMLElement} The select node to update. + */ +PersistentStorage.prototype.displayFilters = function(filters, viewFilter) { + // Clear out the previous directory listing. + var select = this.dialog.getElementById("filters"); + while (select.lastChild) { + select.removeChild(select.lastChild); + } + + // For each element in the array, we extract out the display text and the + // value and put them into an option element to add to the select element. + for (var index=0; index