| 1 |
- COMMON=window.COMMON||{};var href=window.location.href;if(href.indexOf("debugger")!==-1)COMMON["debugger"]=true;COMMON.contentPath="";COMMON.version="1.0.6";COMMON.setContentPath=function(e){COMMON.contentPath=e;window.CKEDITOR_BASEPATH=e+"/res/framework/htmleditor/ckeditor/";COMMON.AjaxModule.init()};Function.attempt=function(){for(var e=0,t=arguments.length;e<t;e++){try{return arguments[e]()}catch(e){}}return null};(function(){var r=this.document;var n=r.window=this;var e=navigator.userAgent.toLowerCase(),t=navigator.platform.toLowerCase(),o=e.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0],s=o[1]=="ie"&&r.documentMode;COMMON.Browser={extend:Function.prototype.extend,name:o[1]=="version"?o[3]:o[1],version:s||parseFloat(o[1]=="opera"&&o[4]?o[4]:o[2]),Platform:{name:e.match(/ip(?:ad|od|hone)/)?"ios":(e.match(/(?:webos|android)/)||e.match(/(?:windows\sphone)/)||t.match(/mac|win|linux/)||["other"])[0]},Features:{xpath:!!r.evaluate,air:!!n.runtime,query:!!r.querySelector,json:!!n.JSON},Plugins:{}};COMMON.Browser[COMMON.Browser.name]=true;COMMON.Browser[COMMON.Browser.name+parseInt(COMMON.Browser.version,10)]=true;COMMON.Browser.Platform[COMMON.Browser.Platform.name]=true;COMMON.Browser.Platform.isMobile=!!COMMON.Browser.Platform.name.match(/(?:ios|webos|android|windows\sphone)/);COMMON.Browser.Request=function(){var e=function(){return new XMLHttpRequest};var t=function(){return new ActiveXObject("MSXML2.XMLHTTP")};var r=function(){return new ActiveXObject("Microsoft.XMLHTTP")};return Function.attempt(function(){e();return e},function(){t();return t},function(){r();return r})}();COMMON.Browser.Features.xhr=!!COMMON.Browser.Request;var i=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);COMMON.Browser.Plugins.Flash={version:Number(i[0]||"0."+i[1])||0,build:Number(i[2])||0};COMMON.Browser.exec=function(e){if(!e)return e;if(n.execScript){n.execScript(e)}else{var t=r.createElement("script");t.setAttribute("type","text/javascript");t.text=e;r.head.appendChild(t);r.head.removeChild(t)}return e};COMMON.typeOf=function(e){if(e==null)return"null";if(e.$family!=null)return e.$family();if(e.constructor==n.Array)return"array";if(e.nodeName){if(e.nodeType==1)return"element";if(e.nodeType==3)return/\S/.test(e.nodeValue)?"textnode":"whitespace"}else if(typeof e.length=="number"){if(e.callee)return"arguments"}return typeof e}})();if(COMMON.Browser.name=="ie"&&COMMON.Browser.version<10){COMMON["debugger"]=true}COMMON.Class={create:function(e){var t=function(){this.initialize.apply(this,arguments)};COMMON.copyPrototype(t,e);return t}};COMMON.copyPrototype=function(e,t){if(!t){return e}if(!e){return e}if((typeof e).toLowerCase()=="object"){for(var r in t){e[r]=t[r]}}if((typeof e).toLowerCase()=="function"){for(var r in t){e.prototype[r]=t[r]}}return e};if(typeof JSON=="undefined"){COMMON.JSON={}}else{COMMON.JSON=JSON}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var escape=function(e){return special[e]||"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)};COMMON.JSON.validate=function(e){e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(e)};COMMON.JSON.encode=COMMON.JSON.stringify?function(e){return COMMON.JSON.stringify(e)}:function(e){if(e&&e.toJSON)e=e.toJSON();switch(COMMON.typeOf(e)){case"string":return'"'+e.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":var t=[];for(var r=0;r<e.length;r++){var n=COMMON.JSON.encode(e[r]);if(n)t.push(n)}return"["+t+"]";case"object":case"hash":var t=[];for(key in e){var n=COMMON.JSON.encode(e[key]);if(n)t.push(COMMON.JSON.encode(key)+":"+n)}return"{"+t+"}";case"number":case"boolean":return""+e;case"null":return"null"}return null};COMMON.JSON.decode=function(string,secure){if(!string||COMMON.typeOf(string)!="string")return null;if(secure||COMMON.JSON.secure){if(COMMON.JSON.parse)return COMMON.JSON.parse(string);if(!COMMON.JSON.validate(string))throw new Error("JSON could not decode the input; security is enabled and the value is not secure.")}return eval("("+string+")")};COMMON.JSON.get=function(e,t,r){var n=null;var o=new COMMON.Request({url:e,async:r==false?false:true,method:"get",onSuccess:function(e){n=COMMON.JSON.decode(e);if(COMMON.typeOf(t).toLowerCase()=="function"){t(n)}else{COMMON.runCallback(t,"onSuccess",[n])}},onFailure:function(e){COMMON.runCallback(t,"onRequestFailure",[e])}});o.send();return n}})();COMMON.XML=COMMON.Class.create({initialize:function(e){this.xml=e||null;this.request=null},get:function(e,r,t){var n=this;this.request=new COMMON.Request({url:e,async:t!==false,method:"get",onSuccess:function(e,t){n.xml=t;if(COMMON.typeOf(r).toLowerCase()=="function"){r.apply(n,[n])}else{COMMON.runCallback(r,"onSuccess",[n])}},onFailure:function(e){COMMON.runCallback(r,"onRequestFailure",[n])}});this.request.send();return this},queryNode:function(t){if(COMMON.Browser.Features.xpath){var e=this.xml.evaluate(t,this.xml,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(e.snapshotLength){return new COMMON.XML.Element(e.snapshotItem(0))}else{return null}}else{try{return new COMMON.XML.Element(this.xml.selectSingleNode(t))}catch(e){try{t=t.replace(/\//g,">");t=t.replace(/\\/g,">");return new COMMON.XML.Element(this.xml.querySelector(t))}catch(e){return null}}}},queryNodes:function(t){if(COMMON.Browser.Features.xpath){var e=this.xml.evaluate(t,this.xml,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(e.snapshotLength){return new COMMON.XML.Elements(e)}else{return null}}else{try{return new COMMON.XML.Elements(this.xml.selectNodes(t))}catch(e){var r=[];t=t.replace(/\//g,">");t=t.replace(/\\/g,">");var n=this.xml.querySelector(t);if(n)r.push(n);var o=n.nextSibling;while(o){if(o.tagName==t){r.push(o)}o=o.nextSibling}return new COMMON.XML.Elements(r)}}}});COMMON.XML.Element=COMMON.Class.create({initialize:function(e){this.node=e;if(this.node){for(p in this.node){this[p]=this.node[p]}}},queryNode:function(t){if(COMMON.Browser.Features.xpath){var e=this.node.ownerDocument.evaluate(t,this.node,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(e.snapshotLength){return new COMMON.XML.Element(e.snapshotItem(0))}else{return null}}else{try{return new COMMON.XML.Element(this.node.selectSingleNode(t))}catch(e){try{t=t.replace(/\//g,">");t=t.replace(/\\/g,">");return new COMMON.XML.Element(this.node.querySelector(t))}catch(e){return null}}}},queryNodes:function(t){if(COMMON.Browser.Features.xpath){var e=this.node.ownerDocument.evaluate(t,this.node,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(e.snapshotLength){return new COMMON.XML.Elements(e)}else{return null}}else{try{return new COMMON.XML.Elements(this.node.selectNodes(t))}catch(e){var r=[];t=t.replace(/\//g,">");t=t.replace(/\\/g,">");var n=this.node.querySelector(t);if(n){r.push(n);var o=n.nextSibling;while(o){if(o.tagName==t){r.push(o)}o=o.nextSibling}}return new COMMON.XML.Elements(r)}}},text:function(){try{var t=this.node.textContent;if(t){return t}else{try{return this.node.text}catch(e){return t}}}catch(e){try{return this.node.text}catch(e){return""}}},attr:function(e){return this.node.getAttribute(e)}});COMMON.XML.Elements=COMMON.Class.create({initialize:function(e){this.nodes=e},length:function(){if(this.nodes.snapshotLength){return this.nodes.snapshotLength}else{return this.nodes.length}},items:function(t){if(this.nodes.snapshotItem){return new COMMON.XML.Element(this.nodes.snapshotItem(t))}else{try{return new COMMON.XML.Element(this.nodes.item(t))}catch(e){try{return new COMMON.XML.Element(this.nodes[t])}catch(e){return null}}}},each:function(e){if(this.length()){for(var t=0;t<this.length();t++){e.apply(this,[this.items(t),t])}}}});COMMON.Request=function(e){this.url=e.url;if(!e.cache){if(this.url.indexOf("?")==-1){this.url=this.url+"?d="+new String((new Date).getTime())}else{this.url=this.url+"&d="+new String((new Date).getTime())}}this.async=e.async!==false;this.method=e.method;this.onSuccess=e.onSuccess;this.onFailure=e.onFailure;this.data=e.data;this.xhr=new COMMON.Browser.Request;this.headers={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"};this.encoding="utf-8"};COMMON.Request.prototype.send=function(e){var t=this.xhr;t.open(this.method.toUpperCase(),this.url,this.async);var r=this;if(this.method.toLowerCase()=="post"){var n=this.encoding?"; charset="+this.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+n}for(key in this.headers){try{t.setRequestHeader(key,this.headers[key])}catch(e){}}var o=function(){if(t.readyState!=4)return;var e=t.status;e=e==1223?204:e;r.response={text:t.responseText||"",xml:t.responseXML};if(e>=200&&e<300)r.success(r.response.text,r.response.xml);else if(e>=300&&e<400)r.redirect(r);else r.failure(t);r.async=true};t.onreadystatechange=o;var s=e||this.data;t.send(s)};COMMON.Request.prototype.processScripts=function(e){return e};COMMON.Request.prototype.success=function(e,t){var r=this.processScripts(e);if(this.onSuccess)this.onSuccess(r,t)};COMMON.Request.prototype.failure=function(e){if(this.onFailure)this.onFailure(e)};COMMON.Request.prototype.redirect=function(e){if(this.onRedirect)this.onRedirect(e)};COMMON.Request.prototype.getHeader=function(e){return this.xhr.getResponseHeader(e)};COMMON.Request.prototype.setHeader=function(e,t){this.headers[e]=t;return this};COMMON.runCallback=function(e,t,r){if(COMMON.typeOf(e).toLowerCase()=="object"){if(e[t]){e[t].apply(e,r?r:[])}}};COMMON.Request.prototype.getText=function(e){var t="";var r=new COMMON.Request({url:e,async:false,method:"get",onSuccess:function(e){t=e}}).send();return t};COMMON.AjaxModule={jquery:COMMON.contentPath+"/res/framework/jquery/jquery.min.js","jquery-ui":COMMON.contentPath+"/res/framework/jquery/jquery-ui.custom/js/jquery-ui.custom.min.js",mootools:COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js","mootools-more":COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js",mwf:COMMON.contentPath+"/res/mwf4/MWF.min.js",ckeditor:COMMON.contentPath+"/res/framework/htmleditor/ckeditor451/ckeditor.js",nicEdit:COMMON.contentPath+"/res/framework/htmleditor/nicEdit/nicEdit.js",kindeditor:COMMON.contentPath+"/res/framework/htmleditor/kindeditor/kindeditor-all-min.js",tinymce:COMMON.contentPath+"/res/framework/htmleditor/tinymce/tinymce.min.js",bmap:"http://api.map.baidu.com/api?v=2.0&ak=fpzGqedB7e8CA8WB8jUgxlOx",amap:"http://webapi.amap.com/maps?v=1.3&key=d7c7ce03a219fa4df4c7a30ba8e68888",raphael:COMMON.contentPath+"/res/framework/raphael/raphael.js",codemirror:COMMON.contentPath+"/res/framework/codemirror/lib/codemirror.js",codemirror_javascript:COMMON.contentPath+"/res/framework/codemirror/mode/javascript/javascript.js",d3:COMMON.contentPath+"/res/framework/d3/d3.min.js",ace:COMMON.contentPath+"/res/framework/ace/src-min-noconflict/ace.js","ace-tools":COMMON.contentPath+"/res/framework/ace/src-min-noconflict/ext-language_tools.js",kity:COMMON.contentPath+"/res/framework/kityminder/kity/kity.min.js",kityminder:COMMON.contentPath+"/res/framework/kityminder/core/dist/kityminder.core.js",JSONTemplate:COMMON.contentPath+"/res/framework/mootools/plugin/Template.js",ie_adapter:COMMON.contentPath+"/res/mwf4/ie_adapter.js",init:function(){this["jquery"]=COMMON.contentPath+"/res/framework/jquery/jquery.min.js";this["jquery-ui"]=COMMON.contentPath+"/res/framework/jquery/jquery-ui.custom/js/jquery-ui.custom.min.js";this["mootools"]=COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js";this["mootools-more"]=COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js";this["mwf"]=COMMON.contentPath+"/res/mwf4/MWF.js";this["ckeditor"]=COMMON.contentPath+"/res/framework/htmleditor/ckeditor451/ckeditor.js";this["nicEdit"]=COMMON.contentPath+"/res/framework/htmleditor/nicEdit/nicEdit.js";this["kindeditor"]=COMMON.contentPath+"/res/framework/htmleditor/kindeditor/kindeditor.js";this["tinymce"]=COMMON.contentPath+"/res/framework/htmleditor/tinymce/tinymce.full.js";this["bmap"]="http://api.map.baidu.com/api?v=2.0&ak=fpzGqedB7e8CA8WB8jUgxlOx";this["amap"]="http://webapi.amap.com/maps?v=1.3&key=d7c7ce03a219fa4df4c7a30ba8e68888";this["raphael"]=COMMON.contentPath+"/res/framework/raphael/raphael.js";this["codemirror"]=COMMON.contentPath+"/res/framework/codemirror/lib/codemirror.js";this["codemirror_javascript"]=COMMON.contentPath+"/res/framework/codemirror/mode/javascript/javascript.js";this["d3"]=COMMON.contentPath+"/res/framework/d3/d3.min.js";this["ace"]=COMMON.contentPath+"/res/framework/ace/src-min-noconflict/ace.js";this["ace-tools"]=COMMON.contentPath+"/res/framework/ace/src-min-noconflict/ext-language_tools.js";this["kity"]=COMMON.contentPath+"/res/framework/kityminder/kity/kity.min.js";this["kityminder"]=COMMON.contentPath+"/res/framework/kityminder/core/dist/kityminder.core.js";this["JSONTemplate"]=COMMON.contentPath+"/res/framework/mootools/plugin/Template.js";this["ie_adapter"]=COMMON.contentPath+"/res/mwf4/ie_adapter.js"},loaded:{},loadedCss:{},loadDom:function(t,r,n,o){if(COMMON.typeOf(t)==="array"){var s=[];t.each(function(e){this.loadDomSingle(e,function(){s.push(e);if(s.length===t.length){if(COMMON.typeOf(r).toLowerCase()==="function"){r()}else{COMMON.runCallback(r,"onSuccess")}}},n,o)}.bind(this))}if(COMMON.typeOf(t)==="string"){this.loadDomSingle(t,r,n,o)}},loadDomSingle:function(e,r,t,n){var o=this[e];if(!o){o=e;if(!COMMON["debugger"]){o=o.replace(/\.js/,".min.js")}}o=o.indexOf("?")!==-1?o+"&v="+COMMON.version:o+"?v="+COMMON.version;if(!n){if(this.loaded[s]){if(COMMON.typeOf(r).toLowerCase()==="function"){r()}else{COMMON.runCallback(r,"onSuccess")}return}}var s=encodeURIComponent(e);var i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;var a=document.createElement("script");a.src=o;i.appendChild(a);a.onload=a.onreadystatechange=function(e,t){if(t||!a.readyState||a.readyState==="loaded"||a.readyState==="complete"){COMMON.AjaxModule.loaded[s]=true;a=a.onload=a.onreadystatechange=null;if(!t)r()}}},load:function(t,r,n,o){if(COMMON.typeOf(t)==="array"){var s=[];t.each(function(e){this.loadSingle(e,function(){s.push(e);if(s.length===t.length){if(COMMON.typeOf(r).toLowerCase()==="function"){r()}else{COMMON.runCallback(r,"onSuccess")}}},n,o)}.bind(this))}if(COMMON.typeOf(t)==="string"){this.loadSingle(t,r,n,o)}},loadSingle:function(e,n,t,r){var o=this[e];if(!o){o=e;if(!COMMON["debugger"]){o=o.replace(/\.js/,".min.js")}}o=o.indexOf("?")!=-1?o+"&v="+COMMON.version:o+"?v="+COMMON.version;var s=encodeURIComponent(e);if(!r){if(this.loaded[s]){if(COMMON.typeOf(n).toLowerCase()=="function"){n()}else{COMMON.runCallback(n,"onSuccess")}return}}var i=true;if(t===false){i=false}var a=new COMMON.Request({url:o,async:i,method:"get",cache:true,onSuccess:function(e,t){var r=e;try{COMMON.Browser.exec(r);COMMON.AjaxModule.loaded[s]=true}catch(e){COMMON.runCallback(n,"onFailure",e);return}if(COMMON.typeOf(n).toLowerCase()=="function"){n()}else{COMMON.runCallback(n,"onSuccess")}},onFailure:function(e){COMMON.runCallback(n,"onRequestFailure",e)}});a.send()},loadCss:function(t,r,n,o,e){if(COMMON.typeOf(t)=="array"){var s=[];t.each(function(e){this.loadSingleCss(e,function(){s.push(e);if(s.length==t.length){if(COMMON.typeOf(r).toLowerCase()=="function"){r()}else{COMMON.runCallback(r,"onSuccess")}}},n,o)}.bind(this))}if(COMMON.typeOf(t)=="string"){this.loadSingleCss(t,r,n,o)}},loadSingleCss:function(e,O,t,r,c){var M=encodeURIComponent(e);if(!r){if(this.loadedCss[M]){if(COMMON.typeOf(O).toLowerCase()=="function"){O()}else{COMMON.runCallback(O,"onSuccess")}return}}var t=true;if(t===false){t=false}var n=this[e]||e;var o=new COMMON.Request({url:n,async:t,method:"get",cache:true,onSuccess:function(e,t){var r=e;try{if(r){var n=c||document;var o=n.createElement("style");o.setAttribute("type","text/css");var s=n.getElementsByTagName("head")[0];s.appendChild(o);if(o.styleSheet){var i=function(){o.styleSheet.cssText=r};if(o.styleSheet.disabled){setTimeout(i,10)}else{i()}}else{var a=n.createTextNode(r);o.appendChild(a)}}COMMON.AjaxModule.loadedCss[M]=true;if(COMMON.typeOf(O).toLowerCase()=="function"){O()}else{COMMON.runCallback(O,"onSuccess")}}catch(e){COMMON.runCallback(O,"onFailure",e);return}},onFailure:function(e){COMMON.runCallback(O,"onRequestFailure",e)}});o.send()}};COMMON.onReady=function(){return true};COMMON.DOM={ready:false,loaded:false,checks:[],shouldPoll:false,timer:null,testElement:document.createElement("div"),readys:[],domready:function(){clearTimeout(this.timer);if(COMMON.DOM.ready)return;COMMON.DOM.loaded=COMMON.DOM.ready=true;COMMON.DOM.removeListener(document,"DOMContentLoaded",COMMON.DOM.domready);COMMON.DOM.removeListener(document,"readystatechange",COMMON.DOM.check);COMMON.DOM.onReady()},check:function(){for(var e=COMMON.DOM.checks.length;e--;)if(COMMON.DOM.checks[e]()){COMMON.DOM.domready();return true}return false},poll:function(){clearTimeout(COMMON.DOM.timer);if(!COMMON.DOM.check())COMMON.DOM.timer=setTimeout(COMMON.DOM.poll,10)},doScrollWorks:function(){try{this.testElement.doScroll();return true}catch(e){}return false},addListener:function(e,t,r){if(t=="unload"){var n=r,o=this;r=function(){o.removeListener(e,"unload",r);n()}}if(e.addEventListener)e.addEventListener(t,r,!!arguments[2]);else e.attachEvent("on"+t,r)},removeListener:function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!!arguments[2]);else e.detachEvent("on"+t,r);return this},onReady:function(){for(var e=0;e<COMMON.DOM.readys.length;e++){COMMON.DOM.readys[e].apply(COMMON)}},addReady:function(e){if(COMMON.DOM.loaded){if(e)e.apply(COMMON)}else{if(e)COMMON.DOM.readys.push(e)}return COMMON.DOM}};(function(e,t){COMMON.DOM.addListener(t,"DOMContentLoaded",COMMON.DOM.domready);if(COMMON.DOM.testElement.doScroll&&!COMMON.DOM.doScrollWorks()){COMMON.DOM.checks.push(COMMON.DOM.doScrollWorks);COMMON.DOM.shouldPoll=true}if(t.readyState)COMMON.DOM.checks.push(function(){var e=t.readyState;return e=="loaded"||e=="complete"});if("onreadystatechange"in t)COMMON.DOM.addListener(t,"readystatechange",COMMON.DOM.check);else COMMON.DOM.shouldPoll=true;if(COMMON.DOM.shouldPoll)COMMON.DOM.poll()})(window,document);(function(){Array.prototype.arrayIndexOf=function(e){for(var t=0;t<this.length;t++){if(this[t]==e){return t}}return null};Array.prototype.arrayLastIndexOf=function(e){for(var t=this.length-1;t>=0;t--){if(this[t]==e){return t}}return null};Array.prototype.arrayInStr=function(e){var t=[];if(e.toString()!=""){for(var r=0;r<this.length;r++){if(this[r].toString().indexOf(e.toString())!=-1){t.push(this[r])}}}return t};Array.prototype.isIntersection=function(e){if(e){for(var t=0;t<e.length;t++){if(this.arrayIndexOf(e[t])!=null){return true}}}return false}})();COMMON.getUserCN=function(e){var t=e;t=t.substr(3,t.length);t=t.substr(0,t.indexOf("/"));return t};COMMON.getNowDateString=function(){var e=new Date;m=e.getMonth()+1;return e.getYear()+"年"+m+"月"+e.getDate()+"日 "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()};
|