code
stringlengths
1
2.08M
language
stringclasses
1 value
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang('uicolor','en',{uicolor:{title:'UI Color Picker',preview:'Live preview',config:'Paste this string into your config.js file',predefined:'Predefined color sets'}});
JavaScript
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */
JavaScript
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { config.language = 'zh-cn';//中文 config.uiColor = '#BFEE62';//编辑器颜色 config.font_names = '宋体;楷体_GB2312;新宋体;黑体;隶书;幼圆;微软雅黑;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana'; config.skin = 'v2'; //config.width =771;//宽度 //config.height = 250;//高度 config.toolbar_Full =[['Undo','Redo','Source','Preview','Table','-','FontName','FontSize','-','Image','-','Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','-','Link','Unlink','-','TextColor','BGColor','-','PasteText','PasteWord','-','RemoveFormat','Maximize']]; //config.toolbar_Basic =[['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']]; config.pasteFromWordPromptCleanup = true; };
JavaScript
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // Compressed version of core/ckeditor_base.js. See original for instructions. /*jsl:ignore*/ if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.2',revision:'5205',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})(); /*jsl:end*/ // Uncomment the following line to have a new timestamp generated for each // request, having clear cache load of the editor code. // CKEDITOR.timestamp = ( new Date() ).valueOf(); if ( CKEDITOR.loader ) CKEDITOR.loader.load( 'core/ckeditor' ); else { // Set the script name to be loaded by the loader. CKEDITOR._autoLoad = 'core/ckeditor'; // Include the loader script. document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' ); }
JavaScript
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'myDialog', function( editor ) { return { title : 'My Dialog', minWidth : 400, minHeight : 200, contents : [ { id : 'tab1', label : 'First Tab', title : 'First Tab', elements : [ { id : 'input1', type : 'text', label : 'Input 1' } ] } ] }; } );
JavaScript
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // This file is not required by CKEditor and may be safely ignored. // It is just a helper file that displays a red message about browser compatibility // at the top of the samples (if incompatible browser is detected). if ( window.CKEDITOR ) { (function() { var showCompatibilityMsg = function() { var env = CKEDITOR.env; var html = '<p><strong>Your browser is not compatible with CKEditor.</strong>'; var browsers = { gecko : 'Firefox 2.0', ie : 'Internet Explorer 6.0', opera : 'Opera 9.5', webkit : 'Safari 3.0' }; var alsoBrowsers = ''; for ( var key in env ) { if ( browsers[ key ] ) { if ( env[key] ) html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.'; else alsoBrowsers += browsers[ key ] + '+, '; } } alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' ); html += ' It is also compatible with ' + alsoBrowsers + '.'; html += '</p><p>With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.</p>'; var alertsEl = document.getElementById( 'alerts' ); alertsEl && ( alertsEl.innerHTML = html ); }; var onload = function() { // Show a friendly compatibility message as soon as the page is loaded, // for those browsers that are not compatible with CKEditor. if ( !CKEDITOR.env.isCompatible ) showCompatibilityMsg(); }; // Register the onload listener. if ( window.addEventListener ) window.addEventListener( 'load', onload, false ); else if ( window.attachEvent ) window.attachEvent( 'onload', onload ); })(); }
JavaScript
/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // Compressed version of core/ckeditor_base.js. See original for instructions. /*jsl:ignore*/ if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.2',revision:'5205',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})(); /*jsl:end*/ // Uncomment the following line to have a new timestamp generated for each // request, having clear cache load of the editor code. // CKEDITOR.timestamp = ( new Date() ).valueOf(); // Set the script name to be loaded by the loader. CKEDITOR._autoLoad = 'core/ckeditor_basic'; // Include the loader script. document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
JavaScript
/*----------------------------------------------------------------------------\ | xLoadTree 2.0 PRE RELEASE | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | This is a pre release and may not be redistributed. | | Watch http://webfx.eae.net for the final version | |-----------------------------------------------------------------------------| | Created by Erik Arvidsson & Emil A Eklund | | (http://webfx.eae.net/contact.html#erik) | | (http://webfx.eae.net/contact.html#emil) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------------------------------------------| | A tree menu system for IE 5.5+, Mozilla 1.4+, Opera 7.5+ | |-----------------------------------------------------------------------------| | Copyright (c) 2003, 2004, 2005, 2006 Erik Arvidsson & Emil A Eklund | |-----------------------------------------------------------------------------| | Licensed under the Apache License, Version 2.0 (the "License"); you may not | | use this file except in compliance with the License. You may obtain a copy | | of the License at http://www.apache.org/licenses/LICENSE-2.0 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | Unless required by applicable law or agreed to in writing, software | | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | | License for the specific language governing permissions and limitations | | under the License. | |-----------------------------------------------------------------------------| | Dependencies: xtree2.js - Supplies the tree control | | xtree2.css - Used to define the look and feel | |-----------------------------------------------------------------------------| | 2004-02-21 | Pre release distributed to a few selected tester | | 2005-06-06 | Removed dependency on XML Extras | | 2006-05-28 | Changed license to Apache Software License 2.0. | |-----------------------------------------------------------------------------| | Created 2003-??-?? | All changes are in the log above. | Updated 2006-05-28 | \----------------------------------------------------------------------------*/ webFXTreeConfig.loadingText = "Loading..."; webFXTreeConfig.loadingIcon = "images/loading.gif"; function WebFXLoadTree(sText, sXmlSrc, oAction, sBehavior, sIcon, sOpenIcon) { WebFXTree.call(this, sText, oAction, sBehavior, sIcon, sOpenIcon); // setup default property values this.src = sXmlSrc; this.loading = !sXmlSrc; this.loaded = !sXmlSrc; this.errorText = ""; if (this.src) { /// add loading Item this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); if (this.getExpanded()) { WebFXLoadTree.loadXmlDocument(this); } } } WebFXLoadTree.createLoadingItem = function () { return new WebFXTreeItem(webFXTreeConfig.loadingText, null, null, webFXTreeConfig.loadingIcon); }; _p = WebFXLoadTree.prototype = new WebFXTree; _p.setExpanded = function setExpanded(b) { WebFXTree.prototype.setExpanded.call(this, b); if (this.src && b) { if (!this.loaded && !this.loading) { // load WebFXLoadTree.loadXmlDocument(this); } } }; function WebFXLoadTreeItem(sText, sXmlSrc, oAction, eParent, sIcon, sOpenIcon) { WebFXTreeItem.call(this, sText, oAction, eParent, sIcon, sOpenIcon); // setup default property values this.src = sXmlSrc; this.loading = !sXmlSrc; this.loaded = !sXmlSrc; this.errorText = ""; if (this.src) { /// add loading Item this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); if (this.getExpanded()) { WebFXLoadTree.loadXmlDocument(this); } } } _p = WebFXLoadTreeItem.prototype = new WebFXTreeItem; _p.setExpanded = function setExpanded(b) { WebFXTreeItem.prototype.setExpanded.call(this, b); if (this.src && b) { if (!this.loaded && !this.loading) { // load WebFXLoadTree.loadXmlDocument(this); } } }; // reloads the src file if already loaded WebFXLoadTree.prototype.reload = _p.reload = function reload() { // if loading do nothing if (this.loaded) { var t = this.getTree(); var expanded = this.getExpanded(); var sr = t.getSuspendRedraw(); t.setSuspendRedraw(true); // remove while (this.childNodes.length > 0) { this.remove(this.childNodes[this.childNodes.length - 1]); } this.loaded = false; this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); if (expanded) { this.setExpanded(true); } t.setSuspendRedraw(sr); this.update(); } else if (this.open && !this.loading) { WebFXLoadTree.loadXmlDocument(this); } }; WebFXLoadTree.prototype.setSrc = _p.setSrc = function setSrc(sSrc) { var oldSrc = this.src; if (sSrc == oldSrc) return; var expanded = this.getExpanded(); // remove all this._callSuspended(function () { // remove while (this.childNodes.length > 0) this.remove(this.childNodes[this.childNodes.length - 1]); }); this.update(); this.loaded = false; this.loading = false; if (this._loadingItem) { this._loadingItem.dispose(); this._loadingItem = null; } this.src = sSrc; if (sSrc) { this._loadingItem = WebFXLoadTree.createLoadingItem(); this.add(this._loadingItem); } this.setExpanded(expanded); }; WebFXLoadTree.prototype.getSrc = _p.getSrc = function getSrc() { return this.src; }; WebFXLoadTree.prototype.dispose = function () { WebFXTree.prototype.dispose.call(this); if (this._xmlHttp) { if (this._xmlHttp.dispose) { this._xmlHttp.dispose(); } try { this._xmlHttp.onreadystatechange = null; this._xmlHttp.abort(); } catch (ex) {} this._xmlHttp = null; } }; _p.dispose = function dispose() { WebFXTreeItem.prototype.dispose.call(this); if (this._xmlHttp) { if (this._xmlHttp.dispose) { this._xmlHttp.dispose(); } try { this._xmlHttp.onreadystatechange = null; this._xmlHttp.abort(); } catch (ex) {} this._xmlHttp = null; } }; // The path is divided by '/' and the item is identified by the text WebFXLoadTree.prototype.openPath = _p.openPath = function openPath(sPath, bSelect, bFocus) { // remove any old pending paths to open delete this._pathToOpen; //delete this._pathToOpenById; this._selectPathOnLoad = bSelect; this._focusPathOnLoad = bFocus; if (sPath == "") { if (bSelect) { this.select(); } if (bFocus) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.getId() + "\")", 10); } return; } var parts = sPath.split("/"); var remainingPath = parts.slice(1).join("/"); if (sPath.charAt(0) == "/") { this.getTree().openPath(remainingPath, bSelect, bFocus); } else { // open this.setExpanded(true); if (this.loaded) { parts = sPath.split("/"); var ti = this.findChildByText(parts[0]); if (!ti) { throw "Could not find child node with text \"" + parts[0] + "\""; } ti.openPath(remainingPath, bSelect, bFocus); } else { this._pathToOpen = sPath; } } }; // Opera has some serious attribute problems. We need to use getAttribute // for certain attributes WebFXLoadTree._attrs = ["text", "src", "action", "id", "target"]; WebFXLoadTree.createItemFromElement = function (oNode) { var jsAttrs = {}; var domAttrs = oNode.attributes; var i, l; l = domAttrs.length; for (i = 0; i < l; i++) { if (domAttrs[i] == null) { continue; } jsAttrs[domAttrs[i].nodeName] = domAttrs[i].nodeValue; } var name, val; for (i = 0; i < WebFXLoadTree._attrs.length; i++) { name = WebFXLoadTree._attrs[i]; value = oNode.getAttribute(name); if (value) { jsAttrs[name] = value; } } var action; if (jsAttrs.onaction) { action = new Function(jsAttrs.onaction); } else if (jsAttrs.action) { action = jsAttrs.action; } var jsNode = new WebFXLoadTreeItem(jsAttrs.html || "", jsAttrs.src, action, null, jsAttrs.icon, jsAttrs.openIcon); if (jsAttrs.text) { jsNode.setText(jsAttrs.text); } if (jsAttrs.target) { jsNode.target = jsAttrs.target; } if (jsAttrs.id) { jsNode.setId(jsAttrs.id); } if (jsAttrs.toolTip) { jsNode.toolTip = jsAttrs.toolTip; } if (jsAttrs.expanded) { jsNode.setExpanded(jsAttrs.expanded != "false"); } if (jsAttrs.onload) { jsNode.onload = new Function(jsAttrs.onload); } if (jsAttrs.onerror) { jsNode.onerror = new Function(jsAttrs.onerror); } jsNode.attributes = jsAttrs; // go through childNodes var cs = oNode.childNodes; l = cs.length; for (i = 0; i < l; i++) { if (cs[i].tagName == "tree") { jsNode.add(WebFXLoadTree.createItemFromElement(cs[i])); } } return jsNode; }; WebFXLoadTree.loadXmlDocument = function (jsNode) { if (jsNode.loading || jsNode.loaded) { return; } jsNode.loading = true; var id = jsNode.getId(); jsNode._xmlHttp = window.XMLHttpRequest ? new XMLHttpRequest : new window.ActiveXObject("Microsoft.XmlHttp"); jsNode._xmlHttp.open("GET", jsNode.src, true); // async jsNode._xmlHttp.onreadystatechange = new Function("WebFXLoadTree._onload(\"" + id + "\")"); // call in new thread to allow ui to update window.setTimeout("WebFXLoadTree._ontimeout(\"" + id + "\")", 10); }; WebFXLoadTree._onload = function (sId) { var jsNode = webFXTreeHandler.all[sId]; if (jsNode._xmlHttp.readyState == 4) { WebFXLoadTree.documentLoaded(jsNode); webFXLoadTreeQueue.remove(jsNode); if (jsNode._xmlHttp.dispose) jsNode._xmlHttp.dispose(); jsNode._xmlHttp = null; } }; WebFXLoadTree._ontimeout = function (sId) { var jsNode = webFXTreeHandler.all[sId]; webFXLoadTreeQueue.add(jsNode); }; // Inserts an xml document as a subtree to the provided node WebFXLoadTree.documentLoaded = function (jsNode) { if (jsNode.loaded) { return; } jsNode.errorText = ""; jsNode.loaded = true; jsNode.loading = false; var t = jsNode.getTree(); var oldSuspend = t.getSuspendRedraw(); t.setSuspendRedraw(true); var doc = jsNode._xmlHttp.responseXML; // check that the load of the xml file went well if(!doc || doc.parserError && doc.parseError.errorCode != 0 || !doc.documentElement) { if (!doc || doc.parseError.errorCode == 0) { jsNode.errorText = "Error loading " + jsNode.src + " (" + jsNode._xmlHttp.status + ": " + jsNode._xmlHttp.statusText + ")"; } else { jsNode.errorText = "Error loading " + jsNode.src + " (" + doc.parseError.reason + ")"; } } else { // there is one extra level of tree elements var root = doc.documentElement; // loop through all tree children var cs = root.childNodes; var l = cs.length; for (var i = 0; i < l; i++) { if (cs[i].tagName == "tree") { jsNode.add(WebFXLoadTree.createItemFromElement(cs[i])); } } } if (jsNode.errorText != "") { jsNode._loadingItem.icon = contextPath + "/components/xtree/images/exclamation.16.gif"; jsNode._loadingItem.text = jsNode.errorText; jsNode._loadingItem.action = WebFXLoadTree._reloadParent; jsNode._loadingItem.toolTip = "Click to reload"; t.setSuspendRedraw(oldSuspend); jsNode._loadingItem.update(); if (typeof jsNode.onerror == "function") { jsNode.onerror(); } } else { // remove dummy if (jsNode._loadingItem != null) { jsNode.remove(jsNode._loadingItem); } if (jsNode._pathToOpen) { jsNode.openPath(jsNode._pathToOpen, jsNode._selectPathOnLoad, jsNode._focusPathOnLoad); } t.setSuspendRedraw(oldSuspend); jsNode.update(); if (typeof jsNode.onload == "function") { jsNode.onload(); } } }; WebFXLoadTree._reloadParent = function () { this.getParent().reload(); }; var webFXLoadTreeQueue = new function () { var nodes = []; var ie = /msie/i.test(navigator.userAgent); var opera = /opera/i.test(navigator.userAgent); this.add = function (jsNode) { if (ie || opera) { nodes.push(jsNode); if (nodes.length == 1) { send(); } } else { jsNode._xmlHttp.send(null); } }; this.remove = function (jsNode) { if (ie || opera) { arrayHelper.remove(nodes, jsNode); if (nodes.length > 0) { send(); } } }; // IE only function send() { var id = nodes[0].getId(); var jsNode = webFXTreeHandler.all[id]; if (!jsNode) { return; } // if no _xmlHttp then remove it if (!jsNode._xmlHttp) { this.remove(jsNode); } else { jsNode._xmlHttp.send(null); } } };
JavaScript
if (document.getElementById) { var tree = new WebFXTree('Root'); tree.setBehavior('classic'); var a = new WebFXTreeItem('1'); tree.add(a); var b = new WebFXTreeItem('1.1'); a.add(b); b.add(new WebFXTreeItem('1.1.1')); b.add(new WebFXTreeItem('1.1.2')); b.add(new WebFXTreeItem('1.1.3')); var f = new WebFXTreeItem('1.1.4'); b.add(f); f.add(new WebFXTreeItem('1.1.4.1')); f.add(new WebFXTreeItem('1.1.4.2')); f.add(new WebFXTreeItem('1.1.4.3')); var c = new WebFXTreeItem('1.2'); a.add(c); c.add(new WebFXTreeItem('1.5.1')); c.add(new WebFXTreeItem('1.5.2')); c.add(new WebFXTreeItem('1.5.3')); a.add(new WebFXTreeItem('1.3')); a.add(new WebFXTreeItem('1.4')); a.add(new WebFXTreeItem('1.5')); var d = new WebFXTreeItem('2'); tree.add(d); var e = new WebFXTreeItem('2.1'); d.add(e); e.add(new WebFXTreeItem('2.1.1')); e.add(new WebFXTreeItem('2.1.2')); e.add(new WebFXTreeItem('2.1.3')); d.add(new WebFXTreeItem('2.2')); d.add(new WebFXTreeItem('2.3')); d.add(new WebFXTreeItem('2.4')); //document.write(tree); tree.write(); }
JavaScript
/*----------------------------------------------------------------------------\ | xTree 2.0 PRE RELEASE | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | This is a pre release and may not be redistributed. | | Watch http://webfx.eae.net for the final version | |-----------------------------------------------------------------------------| | Created by Erik Arvidsson & Emil A Eklund | | (http://webfx.eae.net/contact.html#erik) | | (http://webfx.eae.net/contact.html#emil) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------------------------------------------| | A tree menu system for IE 5.5+, Mozilla 1.4+, Opera 7, KHTML | |-----------------------------------------------------------------------------| | Copyright (c) 2003, 2004, 2005, 2006 Erik Arvidsson & Emil A Eklund | |-----------------------------------------------------------------------------| | Licensed under the Apache License, Version 2.0 (the "License"); you may not | | use this file except in compliance with the License. You may obtain a copy | | of the License at http://www.apache.org/licenses/LICENSE-2.0 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | Unless required by applicable law or agreed to in writing, software | | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | | License for the specific language governing permissions and limitations | | under the License. | |-----------------------------------------------------------------------------| | Dependencies: xtree2.css - Used to define the look and feel | |-----------------------------------------------------------------------------| | 2004-02-21 | Pre release distributed to a few selected tester | | 2005-06-06 | Added single tab index to improve keyboard navigation | | 2006-05-28 | Changed license to Apache Software License 2.0. | |-----------------------------------------------------------------------------| | Created 2003-??-?? | All changes are in the log above. | Updated 2006-05-28 | \----------------------------------------------------------------------------*/ // // WebFXTreePersisitance function WebFXTreePersistence() {} var _p = WebFXTreePersistence.prototype; _p.getExpanded = function getExpanded(oNode) { return false; }; _p.setExpanded = function setExpanded(oNode, bOpen) {}; // Cookie handling function WebFXCookie() {} _p = WebFXCookie.prototype; _p.setCookie = function setCookie(sName, sValue, nDays) { var expires = ""; if (typeof nDays == "number") { var d = new Date(); d.setTime(d.getTime() + nDays * 24 * 60 * 60 * 1000); expires = "; expires=" + d.toGMTString(); } document.cookie = sName + "=" + escape(sValue) + expires + "; path=/"; }; _p.getCookie = function getCookie(sName) { var re = new RegExp("(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)"); var res = re.exec(document.cookie); return res != null ? unescape(res[3]) : null; }; _p.removeCookie = function removeCookie(name) { this.setCookie(name, "", -1); }; // // persistence using cookies // // This is uses one cookie with the ids of the expanded nodes separated using '+' // function WebFXTreeCookiePersistence() { this._openedMap = {}; this._cookies = new WebFXCookie; var s = this._cookies.getCookie(this.cookieName); if (s) { var a = s.split("+"); for (var i = a.length - 1; i >= 0; i--) this._openedMap[a[i]] = true; } } _p = WebFXTreeCookiePersistence.prototype = new WebFXTreePersistence; _p.cookieName = "webfx-tree-cookie-persistence" _p.getExpanded = function getExpanded(oNode) { return oNode.id in this._openedMap; }; _p.setExpanded = function setExpanded(oNode, bOpen) { var old = this.getExpanded(oNode); if (old != bOpen) { if (bOpen) { this._openedMap[oNode.id] = true; } else { delete this._openedMap[oNode.id]; } var res = []; var i = 0; for (var id in this._openedMap) res[i++] = id; this._cookies.setCookie(this.cookieName, res.join("+")); } }; // this object provides a few useful methods when working with arrays var arrayHelper = { indexOf: function (a, o) { for (var i = 0; i < a.length; i++) { if (a[i] == o) { return i; } } return -1; }, insertBefore: function (a, o, o2) { var i = this.indexOf(a, o2); if (i == -1) { a.push(o); } else { a.splice(i, 0, o); } }, remove: function (a, o) { var i = this.indexOf(a, o); if (i != -1) { a.splice(i, 1); } } }; /////////////////////////////////////////////////////////////////////////////// // WebFX Tree Config object // /////////////////////////////////////////////////////////////////////////////// var webFXTreeConfig = { rootIcon : contextPath + "/components/xtree/images/folder.png", openRootIcon : contextPath + "/components/xtree/images/openfolder.png", folderIcon : contextPath + "/components/xtree/images/folder.png", openFolderIcon : contextPath + "/components/xtree/images/openfolder.png", fileIcon : contextPath + "/components/xtree/images/file.png", iIcon : contextPath + "/components/xtree/images/I.png", lIcon : contextPath + "/components/xtree/images/L.png", lMinusIcon : contextPath + "/components/xtree/images/Lminus.png", lPlusIcon : contextPath + "/components/xtree/images/Lplus.png", tIcon : contextPath + "/components/xtree/images/T.png", tMinusIcon : contextPath + "/components/xtree/images/Tminus.png", tPlusIcon : contextPath + "/components/xtree/images/Tplus.png", plusIcon : contextPath + "/components/xtree/images/plus.png", minusIcon : contextPath + "/components/xtree/images/minus.png", blankIcon : contextPath + "/components/xtree/images/blank.png", defaultText : "Tree Item", defaultAction : null, defaultBehavior : "classic", usePersistence : true }; /////////////////////////////////////////////////////////////////////////////// // WebFX Tree Handler object // /////////////////////////////////////////////////////////////////////////////// var webFXTreeHandler = { ie: /msie/i.test(navigator.userAgent), opera: /opera/i.test(navigator.userAgent), idCounter: 0, idPrefix: "wfxt-", getUniqueId: function () { return this.idPrefix + this.idCounter++; }, all: {}, getNodeById: function (sId) { return all[sId]; }, addNode: function (oNode) { this.all[oNode.id] = oNode; }, removeNode: function (oNode) { delete this.all[oNode.id]; }, handleEvent: function (e) { var el = e.target || e.srcElement; while (el != null && !this.all[el.id]) { el = el.parentNode; } if (el == null) { return false; } var node = this.all[el.id]; if (typeof node["_on" + e.type] == "function") { return node["_on" + e.type](e); } return false; }, dispose: function () { if (this.disposed) return; for (var id in this.all) { this.all[id].dispose(); } this.disposed = true; }, htmlToText: function (s) { return String(s).replace(/\s+|<([^>])+>|&amp;|&lt;|&gt;|&quot;|&nbsp;/gi, this._htmlToText); }, _htmlToText: function (s) { switch (s) { case "&amp;": return "&"; case "&lt;": return "<"; case "&gt;": return ">"; case "&quot;": return "\""; case "&nbsp;": return String.fromCharCode(160); default: if (/\s+/.test(s)) { return " "; } if (/^<BR/gi.test(s)) { return "\n"; } return ""; } }, textToHtml: function (s) { return String(s).replace(/&|<|>|\n|\"\u00A0/g, this._textToHtml); }, _textToHtml: function (s) { switch (s) { case "&": return "&amp;"; case "<": return "&lt;"; case ">": return "&gt;"; case "\n": return "<BR>"; case "\"": return "&quot;"; // so we can use this in attributes default: return "&nbsp;"; } }, persistenceManager: new WebFXTreeCookiePersistence() }; /////////////////////////////////////////////////////////////////////////////// // WebFXTreeAbstractNode /////////////////////////////////////////////////////////////////////////////// function WebFXTreeAbstractNode(sText, oAction) { this.childNodes = []; if (sText) this.text = sText; if (oAction) this.action = oAction; this.id = webFXTreeHandler.getUniqueId(); if (webFXTreeConfig.usePersistence) { this.open = webFXTreeHandler.persistenceManager.getExpanded(this); } webFXTreeHandler.addNode(this); } _p = WebFXTreeAbstractNode.prototype; _p._selected = false; _p.indentWidth = 19; _p.open = false; _p.text = webFXTreeConfig.defaultText; _p.action = null; _p.target = null; _p.toolTip = null; _p._focused = false; /* begin tree model */ _p.add = function add(oChild, oBefore) { var oldLast; var emptyBefore = this.childNodes.length == 0; var p = oChild.parentNode; if (oBefore == null) { // append if (p != null) p.remove(oChild); oldLast = this.getLastChild(); this.childNodes.push(oChild); } else { // insertBefore if (oBefore.parentNode != this) { throw new Error("Can only add nodes before siblings"); } if (p != null) { p.remove(oChild); } arrayHelper.insertBefore(this.childNodes, oChild, oBefore); } if (oBefore) { if (oBefore == this.firstChild) { this.firstChild = oChild; } oChild.previousSibling = oBefore.previousSibling; oBefore.previousSibling = oChild; oChild.nextSibling = oBefore; } else { if (!this.firstChild) { this.firstChild = oChild; } if (this.lastChild) { this.lastChild.nextSibling = oChild; } oChild.previousSibling = this.lastChild; this.lastChild = oChild; } oChild.parentNode = this; var t = this.getTree(); if (t) { oChild.tree = t; } var d = this.getDepth(); if (d != null) { oChild.depth = d + 1; } if (this.getCreated() && !t.getSuspendRedraw()) { var el = this.getChildrenElement(); var newEl = oChild.create(); var refEl = oBefore ? oBefore.getElement() : null; el.insertBefore(newEl, refEl); if (oldLast) { oldLast.updateExpandIcon(); } if (emptyBefore) { this.setExpanded(this.getExpanded()); // if we are using classic expand will not update icon if (t && t.getBehavior() != "classic") this.updateIcon(); } } return oChild; }; _p.remove = function remove(oChild) { // backwards compatible. If no argument remove the node if (arguments.length == 0) { if (this.parentNode) { return this.parentNode.remove(this); } return null; } // if we remove selected or tree with the selected we should select this var t = this.getTree(); var si = t ? t.getSelected() : null; if (si == oChild || oChild.contains(si)) { if (si.getFocused()) { this.select(); window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } else { this.select(); } } if (oChild.parentNode != this) { throw new Error("Can only remove children"); } arrayHelper.remove(this.childNodes, oChild); if (this.lastChild == oChild) { this.lastChild = oChild.previousSibling; } if (this.firstChild == oChild) { this.firstChild = oChild.nextSibling; } if (oChild.previousSibling) { oChild.previousSibling.nextSibling = oChild.nextSibling; } if (oChild.nextSibling) { oChild.nextSibling.previousSibling = oChild.previousSibling; } var wasLast = oChild.isLastSibling(); oChild.parentNode = null; oChild.tree = null; oChild.depth = null; if (t && this.getCreated() && !t.getSuspendRedraw()) { var el = this.getChildrenElement(); var childEl = oChild.getElement(); el.removeChild(childEl); if (wasLast) { var newLast = this.getLastChild(); if (newLast) { newLast.updateExpandIcon(); } } if (!this.hasChildren()) { el.style.display = "none"; this.updateExpandIcon(); this.updateIcon(); } } return oChild; }; WebFXTreeAbstractNode._onTimeoutFocus = function (sId) { var jsNode = webFXTreeHandler.all[sId]; jsNode.focus(); }; _p.getId = function getId() { return this.id; }; _p.getTree = function getTree() { throw new Error("getTree called on Abstract Node"); }; _p.getDepth = function getDepth() { throw new Error("getDepth called on Abstract Node"); }; _p.getCreated = function getCreated() { var t = this.getTree(); return t && t.rendered; }; _p.getParent = function getParent() { return this.parentNode; }; _p.contains = function contains(oDescendant) { if (oDescendant == null) return false; if (oDescendant == this) return true; var p = oDescendant.parentNode; return this.contains(p); }; _p.getChildren = _p.getChildNodes = function getChildNodes() { return this.childNodes; }; _p.getFirstChild = function getFirstChild() { return this.childNodes[0]; }; _p.getLastChild = function getLastChild() { return this.childNodes[this.childNodes.length - 1]; }; _p.getPreviousSibling = function getPreviousSibling() { return this.previousSibling; //var p = this.parentNode; //if (p == null) return null; //var cs = p.childNodes; //return cs[arrayHelper.indexOf(cs, this) - 1] }; _p.getNextSibling = function getNextSibling() { return this.nextSibling; //var p = this.parentNode; //if (p == null) return null; //var cs = p.childNodes; //return cs[arrayHelper.indexOf(cs, this) + 1] }; _p.hasChildren = function hasChildren() { return this.childNodes.length > 0; }; _p.isLastSibling = function isLastSibling() { return this.nextSibling == null; //return this.parentNode && this == this.parentNode.getLastChild(); }; _p.findChildByText = function findChildByText(s, n) { if (!n) { n = 0; } var isRe = s instanceof RegExp; for (var i = 0; i < this.childNodes.length; i++) { if (isRe && s.test(this.childNodes[i].getText()) || this.childNodes[i].getText() == s) { if (n == 0) { return this.childNodes[i]; } n--; } } return null; }; _p.findNodeByText = function findNodeByText(s, n) { if (!n) { n = 0; } var isRe = s instanceof RegExp; if (isRe && s.test(this.getText()) || this.getText() == s) { if (n == 0) { return this.childNodes[i]; } n--; } var res; for (var i = 0; i < this.childNodes.length; i++) { res = this.childNodes[i].findNodeByText(s, n); if (res) { return res; } } return null; }; /* end tree model */ _p.setId = function setId(sId) { var el = this.getElement(); webFXTreeHandler.removeNode(this); this.id = sId; if (el) { el.id = sId; } webFXTreeHandler.addNode(this); }; _p.isSelected = function isSelected() { return this._selected; }; _p.select = function select() { this._setSelected(true); }; _p.deselect = function deselect() { this._setSelected(false); }; _p._setSelected = function _setSelected(b) { var t = this.getTree(); if (!t) return; if (this._selected != b) { this._selected = b; var wasFocused = false; // used to keep focus state var si = t.getSelected(); if (b && si != null && si != this) { var oldFireChange = t._fireChange; wasFocused = si._focused; t._fireChange = false; si._setSelected(false); t._fireChange = oldFireChange; } var el = this.getRowElement(); if (el) { el.className = this.getRowClassName(); } if (b) { this._setTabIndex(t.tabIndex); t._selectedItem = this; t._fireOnChange(); t.setSelected(this); if (wasFocused) { this.focus(); } } else { this._setTabIndex(-1); } if (t.getBehavior() != "classic") { this.updateIcon(); } } }; _p.getExpanded = function getExpanded() { return this.open; }; _p.setExpanded = function setExpanded(b) { var ce; this.open = b; var t = this.getTree(); if (this.hasChildren()) { var si = t ? t.getSelected() : null; if (!b && this.contains(si)) { this.select(); } var el = this.getElement(); if (el) { ce = this.getChildrenElement(); if (ce) { ce.style.display = b ? "block" : "none"; } var eie = this.getExpandIconElement(); if (eie) { eie.src = this.getExpandIconSrc(); } } if (webFXTreeConfig.usePersistence) { webFXTreeHandler.persistenceManager.setExpanded(this, b); } } else { ce = this.getChildrenElement(); if (ce) ce.style.display = "none"; } if (t && t.getBehavior() == "classic") { this.updateIcon(); } }; _p.toggle = function toggle() { this.setExpanded(!this.getExpanded()); }; _p.expand = function expand() { this.setExpanded(true); }; _p.collapse = function collapse() { this.setExpanded(false); }; _p.collapseChildren = function collapseChildren() { var cs = this.childNodes; for (var i = 0; i < cs.length; i++) { cs[i].collapseAll(); } }; _p.collapseAll = function collapseAll() { this.collapseChildren(); this.collapse(); }; _p.expandChildren = function expandChildren() { var cs = this.childNodes; for (var i = 0; i < cs.length; i++) { cs[i].expandAll(); } }; _p.expandAll = function expandAll() { this.expandChildren(); this.expand(); }; _p.reveal = function reveal() { var p = this.getParent(); if (p) { p.setExpanded(true); p.reveal(); } }; _p.openPath = function openPath(sPath, bSelect, bFocus) { if (sPath == "") { if (bSelect) { this.select(); } if (bFocus) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } return; } var parts = sPath.split("/"); var remainingPath = parts.slice(1).join("/"); var t = this.getTree(); if (sPath.charAt(0) == "/") { if (t) { t.openPath(remainingPath, bSelect, bFocus); } else { throw "Invalid path"; } } else { // open this.setExpanded(true); parts = sPath.split("/"); var ti = this.findChildByText(parts[0]); if (!ti) { throw "Could not find child node with text \"" + parts[0] + "\""; } ti.openPath(remainingPath, bSelect, bFocus); } }; _p.focus = function focus() { var el = this.getLabelElement(); if (el) { el.focus(); } }; _p.getFocused = function getFocused() { return this._focused; }; _p._setTabIndex = function _setTabIndex(i) { var a = this.getLabelElement(); if (a) { if (i == "") { a.removeAttribute("tabIndex"); } else { a.setAttribute("tabIndex", i); } } }; // HTML generation _p.toHtml = function toHtml() { var sb = []; var cs = this.childNodes; var l = cs.length; for (var y = 0; y < l; y++) { sb[y] = cs[y].toHtml(); } var t = this.getTree(); var hideLines = !t.getShowLines() || t == this.parentNode && !t.getShowRootLines(); return "<div class=\"webfx-tree-item\" id=\"" + this.id + "\"" + this.getEventHandlersHtml() + ">" + this.getRowHtml() + "<div class=\"webfx-tree-children" + (hideLines ? "-nolines" : "") + "\" style=\"" + this.getLineStyle() + (this.getExpanded() && this.hasChildren() ? "" : "display:none;") + "\">" + sb.join("") + "</div></div>"; }; _p.getRowHtml = function getRowHtml() { var t = this.getTree(); return "<div class=\"" + this.getRowClassName() + "\" style=\"padding-left:" + Math.max(0, (this.getDepth() - 1) * this.indentWidth) + "px\">" + this.getExpandIconHtml() + //"<span class=\"webfx-tree-icon-and-label\">" + this.getIconHtml() + this.getLabelHtml() + //"</span>" + "</div>"; }; _p.getRowClassName = function getRowClassName() { return "webfx-tree-row" + (this.isSelected() ? " selected" : "") + (this.action ? "" : " no-action"); }; _p.getLabelHtml = function getLabelHtml() { var toolTip = this.getToolTip(); var target = this.getTarget(); return "<a href=\"" + webFXTreeHandler.textToHtml(this._getHref()) + "\" class=\"webfx-tree-item-label\" tabindex=\"-1\"" + (toolTip ? " title=\"" + webFXTreeHandler.textToHtml(toolTip) + "\"" : "") + (target ? " target=\"" + target + "\"" : "") + " onfocus=\"webFXTreeHandler.handleEvent(event)\"" + " onblur=\"webFXTreeHandler.handleEvent(event)\">" + this.getHtml() + "</a>"; }; _p._getHref = function _getHref() { if (typeof this.action == "string") return this.action; else return "#"; }; _p.getEventHandlersHtml = function getEventHandlersHtml() { return ""; }; _p.getIconHtml = function getIconHtml() { // here we are not using textToHtml since the file names rarerly contains // HTML... return "<img class=\"webfx-tree-icon\" src=\"" + this.getIconSrc() + "\">"; }; _p.getIconSrc = function getIconSrc() { throw new Error("getIconSrc called on Abstract Node"); }; _p.getExpandIconHtml = function getExpandIconHtml() { // here we are not using textToHtml since the file names rarerly contains // HTML... return "<img class=\"webfx-tree-expand-icon\" src=\"" + this.getExpandIconSrc() + "\">"; }; _p.getExpandIconSrc = function getExpandIconSrc() { var src; var t = this.getTree(); var hideLines = !t.getShowLines() || t == this.parentNode && !t.getShowRootLines(); if (this.hasChildren()) { var bits = 0; /* Bitmap used to determine which icon to use 1 Plus 2 Minus 4 T Line 8 L Line */ if (t && t.getShowExpandIcons()) { if (this.getExpanded()) { bits = 2; } else { bits = 1; } } if (t && !hideLines) { if (this.isLastSibling()) { bits += 4; } else { bits += 8; } } switch (bits) { case 1: return webFXTreeConfig.plusIcon; case 2: return webFXTreeConfig.minusIcon; case 4: return webFXTreeConfig.lIcon; case 5: return webFXTreeConfig.lPlusIcon; case 6: return webFXTreeConfig.lMinusIcon; case 8: return webFXTreeConfig.tIcon; case 9: return webFXTreeConfig.tPlusIcon; case 10: return webFXTreeConfig.tMinusIcon; default: // 0 return webFXTreeConfig.blankIcon; } } else { if (t && hideLines) { return webFXTreeConfig.blankIcon; } else if (this.isLastSibling()) { return webFXTreeConfig.lIcon; } else { return webFXTreeConfig.tIcon; } } }; _p.getLineStyle = function getLineStyle() { return "background-position:" + this.getLineStyle2() + ";"; }; _p.getLineStyle2 = function getLineStyle2() { return (this.isLastSibling() ? "-100" : (this.getDepth() - 1) * this.indentWidth) + "px 0"; }; // End HTML generation // DOM // this returns the div for the tree node _p.getElement = function getElement() { return document.getElementById(this.id); }; // the row is the div that is used to draw the node without the children _p.getRowElement = function getRowElement() { var el = this.getElement(); if (!el) return null; return el.firstChild; }; // plus/minus image _p.getExpandIconElement = function getExpandIconElement() { var el = this.getRowElement(); if (!el) return null; return el.firstChild; }; _p.getIconElement = function getIconElement() { var el = this.getRowElement(); if (!el) return null; return el.childNodes[1]; }; // anchor element _p.getLabelElement = function getLabelElement() { var el = this.getRowElement(); if (!el) return null; return el.lastChild; }; // the div containing the children _p.getChildrenElement = function getChildrenElement() { var el = this.getElement(); if (!el) return null; return el.lastChild; }; // IE uses about:blank if not attached to document and this can cause Win2k3 // to fail if (webFXTreeHandler.ie) { _p.create = function create() { var dummy = document.createElement("div"); dummy.style.display = "none"; document.body.appendChild(dummy); dummy.innerHTML = this.toHtml(); var res = dummy.removeChild(dummy.firstChild); document.body.removeChild(dummy); return res; }; } else { _p.create = function create() { var dummy = document.createElement("div"); dummy.innerHTML = this.toHtml(); return dummy.removeChild(dummy.firstChild); }; } // Getters and setters for some common fields _p.setIcon = function setIcon(s) { this.icon = s; if (this.getCreated()) { this.updateIcon(); } }; _p.getIcon = function getIcon() { return this.icon; }; _p.setOpenIcon = function setOpenIcon(s) { this.openIcon = s; if (this.getCreated()) { this.updateIcon(); } }; _p.getOpenIcon = function getOpenIcon() { return this.openIcon; }; _p.setText = function setText(s) { this.setHtml(webFXTreeHandler.textToHtml(s)); }; _p.getText = function getText() { return webFXTreeHandler.htmlToText(this.getHtml()); }; _p.setHtml = function setHtml(s) { this.text = s; var el = this.getLabelElement(); if (el) { el.innerHTML = s; } }; _p.getHtml = function getHtml() { return this.text; }; _p.setTarget = function setTarget(s) { this.target = s; }; _p.getTarget = function getTarget() { return this.target; }; _p.setToolTip = function setToolTip(s) { this.toolTip = s; var el = this.getLabelElement(); if (el) { el.title = s; } }; _p.getToolTip = function getToolTip() { return this.toolTip; }; _p.setAction = function setAction(oAction) { this.action = oAction; var el = this.getLabelElement(); if (el) { el.href = this._getHref(); } el = this.getRowElement(); if (el) { el.className = this.getRowClassName(); } }; _p.getAction = function getAction() { return this.action; }; // update methods _p.update = function update() { var t = this.getTree(); if (t.suspendRedraw) return; var el = this.getElement(); if (!el || !el.parentNode) return; var newEl = this.create(); el.parentNode.replaceChild(newEl, el); this._setTabIndex(this.tabIndex); // in case root had the tab index var si = t.getSelected(); if (si && si.getFocused()) { si.focus(); } }; _p.updateExpandIcon = function updateExpandIcon() { var t = this.getTree(); if (t.suspendRedraw) return; var img = this.getExpandIconElement(); img.src = this.getExpandIconSrc(); var cel = this.getChildrenElement(); cel.style.backgroundPosition = this.getLineStyle2(); }; _p.updateIcon = function updateIcon() { var t = this.getTree(); if (t.suspendRedraw) return; var img = this.getIconElement(); if (img) { img.src = this.getIconSrc(); } }; // End DOM _p._callSuspended = function _callSuspended(f) { var t = this.getTree(); var sr = t.getSuspendRedraw(); t.setSuspendRedraw(true); f.call(this); t.setSuspendRedraw(sr); }; // Event handlers _p._onmousedown = function _onmousedown(e) { var el = e.target || e.srcElement; // expand icon if (/webfx-tree-expand-icon/.test(el.className) && this.hasChildren()) { this.toggle(); if (webFXTreeHandler.ie) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } return false; } this.select(); if (/*!/webfx-tree-item-label/.test(el.className) && */!webFXTreeHandler.opera) { // opera cancels the click if focus is called // in case we are not clicking on the label if (webFXTreeHandler.ie) { window.setTimeout("WebFXTreeAbstractNode._onTimeoutFocus(\"" + this.id + "\")", 10); } else { this.focus(); } } var rowEl = this.getRowElement(); if (rowEl) { rowEl.className = this.getRowClassName(); } return false; }; _p._onclick = function _onclick(e) { var el = e.target || e.srcElement; // expand icon if (/webfx-tree-expand-icon/.test(el.className) && this.hasChildren()) { return false; } if (typeof this.action == "function") { this.action(); } else if (this.action != null) { window.open(this.action, this.target || "_self"); } return false; }; _p._ondblclick = function _ondblclick(e) { var el = e.target || e.srcElement; // expand icon if (/webfx-tree-expand-icon/.test(el.className) && this.hasChildren()) { return; } this.toggle(); }; _p._onfocus = function _onfocus(e) { this.select(); this._focused = true; }; _p._onblur = function _onblur(e) { this._focused = false; }; _p._onkeydown = function _onkeydown(e) { var n; var rv = true; switch (e.keyCode) { case 39: // RIGHT if (e.altKey) { rv = true; break; } if (this.hasChildren()) { if (!this.getExpanded()) { this.setExpanded(true); } else { this.getFirstChild().focus(); } } rv = false; break; case 37: // LEFT if (e.altKey) { rv = true; break; } if (this.hasChildren() && this.getExpanded()) { this.setExpanded(false); } else { var p = this.getParent(); var t = this.getTree(); // don't go to root if hidden if (p && (t.showRootNode || p != t)) { p.focus(); } } rv = false; break; case 40: // DOWN n = this.getNextShownNode(); if (n) { n.focus(); } rv = false; break; case 38: // UP n = this.getPreviousShownNode() if (n) { n.focus(); } rv = false; break; } if (!rv && e.preventDefault) { e.preventDefault(); } e.returnValue = rv; return rv; }; _p._onkeypress = function _onkeypress(e) { if (!e.altKey && e.keyCode >= 37 && e.keyCode <= 40) { if (e.preventDefault) { e.preventDefault(); } e.returnValue = false; return false; } }; // End event handlers _p.dispose = function dispose() { if (this.disposed) return; for (var i = this.childNodes.length - 1; i >= 0; i--) { this.childNodes[i].dispose(); } this.tree = null; this.parentNode = null; this.childNodes = null; this.disposed = true; }; // Some methods that are usable when navigating the tree using the arrows _p.getLastShownDescendant = function getLastShownDescendant() { if (!this.getExpanded() || !this.hasChildren()) { return this; } // we know there is at least 1 child return this.getLastChild().getLastShownDescendant(); }; _p.getNextShownNode = function getNextShownNode() { if (this.hasChildren() && this.getExpanded()) { return this.getFirstChild(); } else { var p = this; var next; while (p != null) { next = p.getNextSibling(); if (next != null) { return next; } p = p.getParent(); } return null; } }; _p.getPreviousShownNode = function getPreviousShownNode() { var ps = this.getPreviousSibling(); if (ps != null) { return ps.getLastShownDescendant(); } var p = this.getParent(); var t = this.getTree(); if (!t.showRootNode && p == t) { return null; } return p; }; /////////////////////////////////////////////////////////////////////////////// // WebFXTree /////////////////////////////////////////////////////////////////////////////// function WebFXTree(sText, oAction, sBehavior, sIcon, sOpenIcon) { WebFXTreeAbstractNode.call(this, sText, oAction); if (sIcon) this.icon = sIcon; if (sOpenIcon) this.openIcon = sOpenIcon; if (sBehavior) this.behavior = sBehavior; } _p = WebFXTree.prototype = new WebFXTreeAbstractNode; _p.indentWidth = 19; _p.open = true; _p._selectedItem = null; _p._fireChange = true; _p.rendered = false; _p.suspendRedraw = false; _p.showLines = true; _p.showExpandIcons = true; _p.showRootNode = true; _p.showRootLines = true; _p.getTree = function getTree() { return this; }; _p.getDepth = function getDepth() { return 0; }; _p.getCreated = function getCreated() { return this.rendered; }; /* end tree model */ _p.getExpanded = function getExpanded() { return !this.showRootNode || WebFXTreeAbstractNode.prototype.getExpanded.call(this); }; _p.setExpanded = function setExpanded(b) { if (!this.showRootNode) { this.open = b; } else { WebFXTreeAbstractNode.prototype.setExpanded.call(this, b); } }; _p.getExpandIconHtml = function getExpandIconHtml() { return ""; }; // we don't have an expand icon here _p.getIconElement = function getIconElement() { var el = this.getRowElement(); if (!el) return null; return el.firstChild; }; // no expand icon for root element _p.getExpandIconElement = function getExpandIconElement(oDoc) { return null; }; _p.updateExpandIcon = function updateExpandIcon() { // no expand icon }; _p.getRowClassName = function getRowClassName() { return WebFXTreeAbstractNode.prototype.getRowClassName.call(this) + (this.showRootNode ? "" : " webfx-tree-hide-root"); }; // if classic then the openIcon is used for expanded, otherwise openIcon is used // for selected _p.getIconSrc = function getIconSrc() { var behavior = this.getTree() ? this.getTree().getBehavior() : webFXTreeConfig.defaultBehavior; var open = behavior == "classic" && this.getExpanded() || behavior != "classic" && this.isSelected(); if (open && this.openIcon) { return this.openIcon; } if (!open && this.icon) { return this.icon; } // fall back on default icons return open ? webFXTreeConfig.openRootIcon : webFXTreeConfig.rootIcon; }; _p.getEventHandlersHtml = function getEventHandlersHtml() { return " onclick=\"return webFXTreeHandler.handleEvent(event)\" " + "onmousedown=\"return webFXTreeHandler.handleEvent(event)\" " + "ondblclick=\"return webFXTreeHandler.handleEvent(event)\" " + "onkeydown=\"return webFXTreeHandler.handleEvent(event)\" " + "onkeypress=\"return webFXTreeHandler.handleEvent(event)\""; }; _p.setSelected = function setSelected(o) { if (this._selectedItem != o && o) { o._setSelected(true); } }; _p._fireOnChange = function _fireOnChange() { if (this._fireChange && typeof this.onchange == "function") { this.onchange(); } }; _p.getSelected = function getSelected() { return this._selectedItem; }; _p.tabIndex = ""; _p.setTabIndex = function setTabIndex(i) { var n = this._selectedItem || (this.showRootNode ? this : this.firstChild); this.tabIndex = i; if (n) { n._setTabIndex(i); } }; _p.getTabIndex = function getTabIndex() { return this.tabIndex; }; _p.setBehavior = function setBehavior(s) { this.behavior = s; }; _p.getBehavior = function getBehavior() { return this.behavior || webFXTreeConfig.defaultBehavior; }; _p.setShowLines = function setShowLines(b) { if (this.showLines != b) { this.showLines = b; if (this.rendered) { this.update(); } } }; _p.getShowLines = function getShowLines() { return this.showLines; }; _p.setShowRootLines = function setShowRootLines(b) { if (this.showRootLines != b) { this.showRootLines = b; if (this.rendered) { this.update(); } } }; _p.getShowRootLines = function getShowRootLines() { return this.showRootLines; }; _p.setShowExpandIcons = function setShowExpandIcons(b) { if (this.showExpandIcons != b) { this.showExpandIcons = b; if (this.rendered) { this.getTree().update(); } } }; _p.getShowExpandIcons = function getShowExpandIcons() { return this.showExpandIcons; }; _p.setShowRootNode = function setShowRootNode(b) { if (this.showRootNode != b) { this.showRootNode = b; if (this.rendered) { this.getTree().update(); } } }; _p.getShowRoootNode = function getShowRoootNode() { return this.showRootNode; }; _p.onchange = function onchange() {}; _p.create = function create() { var el = WebFXTreeAbstractNode.prototype.create.call(this); this.setTabIndex(this.tabIndex); this.rendered = true; return el; }; _p.write = function write() { document.write(this.toHtml()); this.setTabIndex(this.tabIndex); this.rendered = true; }; _p.setSuspendRedraw = function setSuspendRedraw(b) { this.suspendRedraw = b; }; _p.getSuspendRedraw = function getSuspendRedraw() { return this.suspendRedraw; }; /////////////////////////////////////////////////////////////////////////////// // WebFXTreeItem /////////////////////////////////////////////////////////////////////////////// function WebFXTreeItem(sText, oAction, eParent, sIcon, sOpenIcon) { WebFXTreeAbstractNode.call(this, sText, oAction); if (sIcon) this.icon = sIcon; if (sOpenIcon) this.openIcon = sOpenIcon; if (eParent) eParent.add(this); } _p = WebFXTreeItem.prototype = new WebFXTreeAbstractNode; _p.tree = null; /* tree model */ _p.getDepth = function getDepth() { if (this.depth != null) { return this.depth; } if (this.parentNode) { var pd = this.parentNode.getDepth(); return this.depth = (pd != null ? pd + 1 : null); } return null; }; _p.getTree = function getTree() { if (this.tree) { return this.tree; } if (this.parentNode) { return this.tree = this.parentNode.getTree(); } return null; }; _p.getCreated = function getCreated() { var t = this.getTree(); return t && t.getCreated(); }; // if classic then the openIcon is used for expanded, otherwise openIcon is used // for selected _p.getIconSrc = function getIconSrc() { var behavior = this.getTree() ? this.getTree().getBehavior() : webFXTreeConfig.defaultBehavior; var open = behavior == "classic" && this.getExpanded() || behavior != "classic" && this.isSelected(); if (open && this.openIcon) { return this.openIcon; } if (!open && this.icon) { return this.icon; } // fall back on default icons if (this.hasChildren()) { return open ? webFXTreeConfig.openFolderIcon : webFXTreeConfig.folderIcon; } return webFXTreeConfig.fileIcon; }; /* end tree model */ if (window.attachEvent) { window.attachEvent("onunload", function () { for (var id in webFXTreeHandler.all) webFXTreeHandler.all[id].dispose(); }); }
JavaScript
var langList = [ {name:'en', charset:'UTF-8'}, {name:'zh-cn', charset:'gb2312'}, {name:'zh-tw', charset:'GBK'} ]; var skinList = [ {name:'default', charset:'gb2312'}, {name:'whyGreen', charset:'gb2312'} ];
JavaScript
var $lang={ errAlertMsg: "Invalid date or the date out of range,redo or not?", aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], clearStr: "Clear", todayStr: "Today", okStr: "OK", updateStr: "OK", timeStr: "Time", quickStr: "Quick Selection", err_1: 'MinDate Cannot be bigger than MaxDate!' }
JavaScript
/* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */ var hexcase = 0; var b64pad = ""; var chrsz= 8; function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } function md5_vm_test() { return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; } function core_md5(x, len) { x[len >> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); c = md5_ff(c, d, a, b, x[i+10], 17, -42063); b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } function core_hmac_md5(key, data) { var bkey = str2binl(key); if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); var ipad = Array(16), opad = Array(16); for(var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5C5C5C5C; } var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); } function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for(var i = 0; i < str.length * chrsz; i += chrsz) bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); return bin; } function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for(var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); return str; } function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for(var i = 0; i < binarray.length * 4; i++) { str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); } return str; } function binl2b64(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for(var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i>> 2] >> 8 * ( i%4)) & 0xFF) << 16) | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); for(var j = 0; j < 4; j++) { if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); } } return str; } /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */ var hexcase = 0; var b64pad = ""; var chrsz= 8; function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } function md5_vm_test() { return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; } function core_md5(x, len) { x[len >> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); c = md5_ff(c, d, a, b, x[i+10], 17, -42063); b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } function core_hmac_md5(key, data) { var bkey = str2binl(key); if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); var ipad = Array(16), opad = Array(16); for(var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5C5C5C5C; } var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); } function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for(var i = 0; i < str.length * chrsz; i += chrsz) bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); return bin; } function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for(var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); return str; } function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for(var i = 0; i < binarray.length * 4; i++) { str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); } return str; } function binl2b64(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for(var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i>> 2] >> 8 * ( i%4)) & 0xFF) << 16) | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); for(var j = 0; j < 4; j++) { if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); } } return str; }
JavaScript
function create_menu(basepath) { var base = (basepath == 'null') ? '' : basepath; document.write( '<table cellpadding="0" cellspaceing="0" border="0" style="width:98%"><tr>' + '<td class="td" valign="top">' + '<ul>' + '<li><a href="'+base+'index.html">User Guide Home</a></li>' + '<li><a href="'+base+'toc.html">Table of Contents Page</a></li>' + '</ul>' + '<h3>Basic Info</h3>' + '<ul>' + '<li><a href="'+base+'general/requirements.html">Server Requirements</a></li>' + '<li><a href="'+base+'license.html">License Agreement</a></li>' + '<li><a href="'+base+'changelog.html">Change Log</a></li>' + '<li><a href="'+base+'general/credits.html">Credits</a></li>' + '</ul>' + '<h3>Installation</h3>' + '<ul>' + '<li><a href="'+base+'installation/downloads.html">Downloading CodeIgniter</a></li>' + '<li><a href="'+base+'installation/index.html">Installation Instructions</a></li>' + '<li><a href="'+base+'installation/upgrading.html">Upgrading from a Previous Version</a></li>' + '<li><a href="'+base+'installation/troubleshooting.html">Troubleshooting</a></li>' + '</ul>' + '<h3>Introduction</h3>' + '<ul>' + '<li><a href="'+base+'overview/getting_started.html">Getting Started</a></li>' + '<li><a href="'+base+'overview/at_a_glance.html">CodeIgniter at a Glance</a></li>' + '<li><a href="'+base+'overview/cheatsheets.html">CodeIgniter Cheatsheets</a></li>' + '<li><a href="'+base+'overview/features.html">Supported Features</a></li>' + '<li><a href="'+base+'overview/appflow.html">Application Flow Chart</a></li>' + '<li><a href="'+base+'overview/mvc.html">Model-View-Controller</a></li>' + '<li><a href="'+base+'overview/goals.html">Architectural Goals</a></li>' + '</ul>' + '<h3>Tutorial</h3>' + '<ul>' + '<li><a href="'+base+'tutorial/index.html">Introduction</a></li>' + '<li><a href="'+base+'tutorial/static_pages.html">Static pages</a></li>' + '<li><a href="'+base+'tutorial/news_section.html">News section</a></li>' + '<li><a href="'+base+'tutorial/create_news_items.html">Create news items</a></li>' + '<li><a href="'+base+'tutorial/conclusion.html">Conclusion</a></li>' + '</ul>' + '</td><td class="td_sep" valign="top">' + '<h3>General Topics</h3>' + '<ul>' + '<li><a href="'+base+'general/urls.html">CodeIgniter URLs</a></li>' + '<li><a href="'+base+'general/controllers.html">Controllers</a></li>' + '<li><a href="'+base+'general/reserved_names.html">Reserved Names</a></li>' + '<li><a href="'+base+'general/views.html">Views</a></li>' + '<li><a href="'+base+'general/models.html">Models</a></li>' + '<li><a href="'+base+'general/helpers.html">Helpers</a></li>' + '<li><a href="'+base+'general/libraries.html">Using CodeIgniter Libraries</a></li>' + '<li><a href="'+base+'general/creating_libraries.html">Creating Your Own Libraries</a></li>' + '<li><a href="'+base+'general/drivers.html">Using CodeIgniter Drivers</a></li>' + '<li><a href="'+base+'general/creating_drivers.html">Creating Your Own Drivers</a></li>' + '<li><a href="'+base+'general/core_classes.html">Creating Core Classes</a></li>' + '<li><a href="'+base+'general/hooks.html">Hooks - Extending the Core</a></li>' + '<li><a href="'+base+'general/autoloader.html">Auto-loading Resources</a></li>' + '<li><a href="'+base+'general/common_functions.html">Common Functions</a></li>' + '<li><a href="'+base+'general/routing.html">URI Routing</a></li>' + '<li><a href="'+base+'general/errors.html">Error Handling</a></li>' + '<li><a href="'+base+'general/caching.html">Caching</a></li>' + '<li><a href="'+base+'general/profiling.html">Profiling Your Application</a></li>' + '<li><a href="'+base+'general/cli.html">Running via the CLI</a></li>' + '<li><a href="'+base+'general/managing_apps.html">Managing Applications</a></li>' + '<li><a href="'+base+'general/environments.html">Handling Multiple Environments</a></li>' + '<li><a href="'+base+'general/alternative_php.html">Alternative PHP Syntax</a></li>' + '<li><a href="'+base+'general/security.html">Security</a></li>' + '<li><a href="'+base+'general/styleguide.html">PHP Style Guide</a></li>' + '<li><a href="'+base+'doc_style/index.html">Writing Documentation</a></li>' + '</ul>' + '<h3>Additional Resources</h3>' + '<ul>' + '<li><a href="http://codeigniter.com/forums/">Community Forums</a></li>' + '<li><a href="http://codeigniter.com/wiki/">Community Wiki</a></li>' + '</ul>' + '</td><td class="td_sep" valign="top">' + '<h3>Class Reference</h3>' + '<ul>' + '<li><a href="'+base+'libraries/benchmark.html">Benchmarking Class</a></li>' + '<li><a href="'+base+'libraries/calendar.html">Calendar Class</a></li>' + '<li><a href="'+base+'libraries/cart.html">Cart Class</a></li>' + '<li><a href="'+base+'libraries/config.html">Config Class</a></li>' + '<li><a href="'+base+'libraries/email.html">Email Class</a></li>' + '<li><a href="'+base+'libraries/encryption.html">Encryption Class</a></li>' + '<li><a href="'+base+'libraries/file_uploading.html">File Uploading Class</a></li>' + '<li><a href="'+base+'libraries/form_validation.html">Form Validation Class</a></li>' + '<li><a href="'+base+'libraries/ftp.html">FTP Class</a></li>' + '<li><a href="'+base+'libraries/table.html">HTML Table Class</a></li>' + '<li><a href="'+base+'libraries/image_lib.html">Image Manipulation Class</a></li>' + '<li><a href="'+base+'libraries/input.html">Input Class</a></li>' + '<li><a href="'+base+'libraries/javascript.html">Javascript Class</a></li>' + '<li><a href="'+base+'libraries/loader.html">Loader Class</a></li>' + '<li><a href="'+base+'libraries/language.html">Language Class</a></li>' + '<li><a href="'+base+'libraries/migration.html">Migration Class</a></li>' + '<li><a href="'+base+'libraries/output.html">Output Class</a></li>' + '<li><a href="'+base+'libraries/pagination.html">Pagination Class</a></li>' + '<li><a href="'+base+'libraries/security.html">Security Class</a></li>' + '<li><a href="'+base+'libraries/sessions.html">Session Class</a></li>' + '<li><a href="'+base+'libraries/trackback.html">Trackback Class</a></li>' + '<li><a href="'+base+'libraries/parser.html">Template Parser Class</a></li>' + '<li><a href="'+base+'libraries/typography.html">Typography Class</a></li>' + '<li><a href="'+base+'libraries/unit_testing.html">Unit Testing Class</a></li>' + '<li><a href="'+base+'libraries/uri.html">URI Class</a></li>' + '<li><a href="'+base+'libraries/user_agent.html">User Agent Class</a></li>' + '<li><a href="'+base+'libraries/xmlrpc.html">XML-RPC Class</a></li>' + '<li><a href="'+base+'libraries/zip.html">Zip Encoding Class</a></li>' + '</ul>' + '</td><td class="td_sep" valign="top">' + '<h3>Driver Reference</h3>' + '<ul>' + '<li><a href="'+base+'libraries/caching.html">Caching Class</a></li>' + '<li><a href="'+base+'database/index.html">Database Class</a></li>' + '<li><a href="'+base+'libraries/javascript.html">Javascript Class</a></li>' + '</ul>' + '<h3>Helper Reference</h3>' + '<ul>' + '<li><a href="'+base+'helpers/array_helper.html">Array Helper</a></li>' + '<li><a href="'+base+'helpers/captcha_helper.html">CAPTCHA Helper</a></li>' + '<li><a href="'+base+'helpers/cookie_helper.html">Cookie Helper</a></li>' + '<li><a href="'+base+'helpers/date_helper.html">Date Helper</a></li>' + '<li><a href="'+base+'helpers/directory_helper.html">Directory Helper</a></li>' + '<li><a href="'+base+'helpers/download_helper.html">Download Helper</a></li>' + '<li><a href="'+base+'helpers/email_helper.html">Email Helper</a></li>' + '<li><a href="'+base+'helpers/file_helper.html">File Helper</a></li>' + '<li><a href="'+base+'helpers/form_helper.html">Form Helper</a></li>' + '<li><a href="'+base+'helpers/html_helper.html">HTML Helper</a></li>' + '<li><a href="'+base+'helpers/inflector_helper.html">Inflector Helper</a></li>' + '<li><a href="'+base+'helpers/language_helper.html">Language Helper</a></li>' + '<li><a href="'+base+'helpers/number_helper.html">Number Helper</a></li>' + '<li><a href="'+base+'helpers/path_helper.html">Path Helper</a></li>' + '<li><a href="'+base+'helpers/security_helper.html">Security Helper</a></li>' + '<li><a href="'+base+'helpers/smiley_helper.html">Smiley Helper</a></li>' + '<li><a href="'+base+'helpers/string_helper.html">String Helper</a></li>' + '<li><a href="'+base+'helpers/text_helper.html">Text Helper</a></li>' + '<li><a href="'+base+'helpers/typography_helper.html">Typography Helper</a></li>' + '<li><a href="'+base+'helpers/url_helper.html">URL Helper</a></li>' + '<li><a href="'+base+'helpers/xml_helper.html">XML Helper</a></li>' + '</ul>' + '</td></tr></table>'); }
JavaScript
/* moo.fx, simple effects library built with prototype.js (http://prototype.conio.net). by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE. for more info (http://moofx.mad4milk.net). 10/24/2005 v(1.0.2) */ //base var fx = new Object(); fx.Base = function(){}; fx.Base.prototype = { setOptions: function(options) { this.options = { duration: 500, onComplete: '' } Object.extend(this.options, options || {}); }, go: function() { this.duration = this.options.duration; this.startTime = (new Date).getTime(); this.timer = setInterval (this.step.bind(this), 13); }, step: function() { var time = (new Date).getTime(); var Tpos = (time - this.startTime) / (this.duration); if (time >= this.duration+this.startTime) { this.now = this.to; clearInterval (this.timer); this.timer = null; if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10); } else { this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from; //this time-position, sinoidal transition thing is from script.aculo.us } this.increase(); }, custom: function(from, to) { if (this.timer != null) return; this.from = from; this.to = to; this.go(); }, hide: function() { this.now = 0; this.increase(); }, clearTimer: function() { clearInterval(this.timer); this.timer = null; } } //stretchers fx.Layout = Class.create(); fx.Layout.prototype = Object.extend(new fx.Base(), { initialize: function(el, options) { this.el = $(el); this.el.style.overflow = "hidden"; this.el.iniWidth = this.el.offsetWidth; this.el.iniHeight = this.el.offsetHeight; this.setOptions(options); } }); fx.Height = Class.create(); Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), { increase: function() { this.el.style.height = this.now + "px"; }, toggle: function() { if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0); else this.custom(0, this.el.scrollHeight); } });
JavaScript
window.onload = function() { myHeight = new fx.Height('nav', {duration: 400}); myHeight.hide(); }
JavaScript
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT // IT'S ALL JUST JUNK FOR OUR DOCS! // ++++++++++++++++++++++++++++++++++++++++++ !function ($) { $(function(){ var $window = $(window) // Disable certain links in docs $('section [href^=#]').click(function (e) { e.preventDefault() }) // side bar $('.bs-docs-sidenav').affix({ offset: { top: function () { return $window.width() <= 980 ? 290 : 210 } , bottom: 270 } }) // make code pretty window.prettyPrint && prettyPrint() // add-ons $('.add-on :checkbox').on('click', function () { var $this = $(this) , method = $this.attr('checked') ? 'addClass' : 'removeClass' $(this).parents('.add-on')[method]('active') }) // add tipsies to grid for scaffolding if ($('#gridSystem').length) { $('#gridSystem').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) } // tooltip demo $('.tooltip-demo').tooltip({ selector: "a[rel=tooltip]" }) $('.tooltip-test').tooltip() $('.popover-test').popover() // popover demo $("a[rel=popover]") .popover() .click(function(e) { e.preventDefault() }) // button state demo $('#fat-btn') .click(function () { var btn = $(this) btn.button('loading') setTimeout(function () { btn.button('reset') }, 3000) }) // carousel demo $('#myCarousel').carousel() // javascript build logic var inputsComponent = $("#components.download input") , inputsPlugin = $("#plugins.download input") , inputsVariables = $("#variables.download input") // toggle all plugin checkboxes $('#components.download .toggle-all').on('click', function (e) { e.preventDefault() inputsComponent.attr('checked', !inputsComponent.is(':checked')) }) $('#plugins.download .toggle-all').on('click', function (e) { e.preventDefault() inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) }) $('#variables.download .toggle-all').on('click', function (e) { e.preventDefault() inputsVariables.val('') }) // request built javascript $('.download-btn .btn').on('click', function () { var css = $("#components.download input:checked") .map(function () { return this.value }) .toArray() , js = $("#plugins.download input:checked") .map(function () { return this.value }) .toArray() , vars = {} , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] $("#variables.download input") .each(function () { $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) }) $.ajax({ type: 'POST' , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com' , dataType: 'jsonpi' , params: { js: js , css: css , vars: vars , img: img } }) }) }) // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { var url = opts.url; return { send: function(_, completeCallback) { var name = 'jQuery_iframe_' + jQuery.now() , iframe, form iframe = $('<iframe>') .attr('name', name) .appendTo('head') form = $('<form>') .attr('method', opts.type) // GET or POST .attr('action', url) .attr('target', name) $.each(opts.params, function(k, v) { $('<input>') .attr('type', 'hidden') .attr('name', k) .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) .appendTo(form) }) form.appendTo('body').submit() } } }) }(window.jQuery)
JavaScript
/* Holder - 1.6 - client side image placeholders (c) 2012 Ivan Malopinsky / http://imsky.co Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 Commercial use requires attribution. */ var Holder = Holder || {}; (function (app, win) { var preempted = false, fallback = false, canvas = document.createElement('canvas'); //getElementsByClassName polyfill document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s}) //getComputedStyle polyfill window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}) //http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}; //https://gist.github.com/991057 by Jed Schmidt with modifications function selector(a){ a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]); var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret; } //shallow object property extend function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c} function text_size(width, height, template) { var dimension_arr = [height, width].sort(); var maxFactor = Math.round(dimension_arr[1] / 16), minFactor = Math.round(dimension_arr[0] / 16); var text_height = Math.max(template.size, maxFactor); return { height: text_height } } function draw(ctx, dimensions, template, ratio) { var ts = text_size(dimensions.width, dimensions.height, template); var text_height = ts.height; var width = dimensions.width * ratio, height = dimensions.height * ratio; canvas.width = width; canvas.height = height; ctx.textAlign = "center"; ctx.textBaseline = "middle"; ctx.fillStyle = template.background; ctx.fillRect(0, 0, width, height); ctx.fillStyle = template.foreground; ctx.font = "bold " + text_height + "px sans-serif"; var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height); if (ctx.measureText(text).width / width > 1) { text_height = template.size / (ctx.measureText(text).width / width); } ctx.font = "bold " + (text_height * ratio) + "px sans-serif"; ctx.fillText(text, (width / 2), (height / 2), width); return canvas.toDataURL("image/png"); } function render(mode, el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var ratio = 1; if(window.devicePixelRatio && window.devicePixelRatio > 1){ ratio = window.devicePixelRatio; } if (mode == "image") { el.setAttribute("data-src", src); el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); el.style.width = dimensions.width + "px"; el.style.height = dimensions.height + "px"; if (fallback) { el.style.backgroundColor = theme.background; } else{ el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); } } else { if (!fallback) { el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; el.style.backgroundSize = dimensions.width+"px "+dimensions.height+"px"; } } }; function fluid(el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var fluid = document.createElement("table"); fluid.setAttribute("cellspacing",0) fluid.setAttribute("cellpadding",0) fluid.setAttribute("border",0) var row = document.createElement("tr") .appendChild(document.createElement("td") .appendChild(document.createTextNode(theme.text))); fluid.style.backgroundColor = theme.background; fluid.style.color = theme.foreground; fluid.className = el.className + " holderjs-fluid"; fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%")>0?"":"px"); fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px"); fluid.id = el.id; var frag = document.createDocumentFragment(), tbody = document.createElement("tbody"), tr = document.createElement("tr"), td = document.createElement("td"); tr.appendChild(td); tbody.appendChild(tr); frag.appendChild(tbody); if (theme.text) { td.appendChild(document.createTextNode(theme.text)) fluid.appendChild(frag); } else { td.appendChild(document.createTextNode(dimensions_caption)) fluid.appendChild(frag); fluid_images.push(fluid); setTimeout(fluid_update, 0); } el.parentNode.replaceChild(fluid, el); } function fluid_update() { for (i in fluid_images) { var el = fluid_images[i]; var label = el.getElementsByTagName("td")[0].firstChild; label.data = el.offsetWidth + "x" + el.offsetHeight; } } function parse_flags(flags, options) { var ret = { theme: settings.themes.gray }, render = false; for (sl = flags.length, j = 0; j < sl; j++) { var flag = flags[j]; if (app.flags.dimensions.match(flag)) { render = true; ret.dimensions = app.flags.dimensions.output(flag); } else if (app.flags.fluid.match(flag)) { render = true; ret.dimensions = app.flags.fluid.output(flag); ret.fluid = true; } else if (app.flags.colors.match(flag)) { ret.theme = app.flags.colors.output(flag); } else if (options.themes[flag]) { //If a theme is specified, it will override custom colors ret.theme = options.themes[flag]; } else if (app.flags.text.match(flag)) { ret.text = app.flags.text.output(flag); } } return render ? ret : false; }; if (!canvas.getContext) { fallback = true; } else { if (canvas.toDataURL("image/png") .indexOf("data:image/png") < 0) { //Android doesn't support data URI fallback = true; } else { var ctx = canvas.getContext("2d"); } } var fluid_images = []; var settings = { domain: "holder.js", images: "img", elements: ".holderjs", themes: { "gray": { background: "#eee", foreground: "#aaa", size: 12 }, "social": { background: "#3a5a97", foreground: "#fff", size: 12 }, "industrial": { background: "#434A52", foreground: "#C2F200", size: 12 } }, stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;border-collapse:collapse;border:0;vertical-align:middle;margin:0}" }; app.flags = { dimensions: { regex: /(\d+)x(\d+)/, output: function (val) { var exec = this.regex.exec(val); return { width: +exec[1], height: +exec[2] } } }, fluid: { regex: /([0-9%]+)x([0-9%]+)/, output: function (val) { var exec = this.regex.exec(val); return { width: exec[1], height: exec[2] } } }, colors: { regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, output: function (val) { var exec = this.regex.exec(val); return { size: settings.themes.gray.size, foreground: "#" + exec[2], background: "#" + exec[1] } } }, text: { regex: /text\:(.*)/, output: function (val) { return this.regex.exec(val)[1]; } } } for (var flag in app.flags) { app.flags[flag].match = function (val) { return val.match(this.regex) } } app.add_theme = function (name, theme) { name != null && theme != null && (settings.themes[name] = theme); return app; }; app.add_image = function (src, el) { var node = selector(el); if (node.length) { for (var i = 0, l = node.length; i < l; i++) { var img = document.createElement("img") img.setAttribute("data-src", src); node[i].appendChild(img); } } return app; }; app.run = function (o) { var options = extend(settings, o), images_nodes = selector(options.images), elements = selector(options.elements), preempted = true, images = []; for (i = 0, l = images_nodes.length; i < l; i++) images.push(images_nodes[i]); var holdercss = document.createElement("style"); holdercss.type = "text/css"; holdercss.styleSheet ? holdercss.styleSheet.cssText = options.stylesheet : holdercss.textContent = options.stylesheet; document.getElementsByTagName("head")[0].appendChild(holdercss); var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); for (var l = elements.length, i = 0; i < l; i++) { var src = window.getComputedStyle(elements[i], null) .getPropertyValue("background-image"); var flags = src.match(cssregex); if (flags) { var holder = parse_flags(flags[1].split("/"), options); if (holder) { render("background", elements[i], holder, src); } } } for (var l = images.length, i = 0; i < l; i++) { var src = images[i].getAttribute("src") || images[i].getAttribute("data-src"); if (src != null && src.indexOf(options.domain) >= 0) { var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) .split("/"), options); if (holder) { if (holder.fluid) { fluid(images[i], holder, src); } else { render("image", images[i], holder, src); } } } } return app; }; contentLoaded(win, function () { if (window.addEventListener) { window.addEventListener("resize", fluid_update, false); window.addEventListener("orientationchange", fluid_update, false); } else { window.attachEvent("onresize", fluid_update) } preempted || app.run(); }); })(Holder, window);
JavaScript
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT // IT'S ALL JUST JUNK FOR OUR DOCS! // ++++++++++++++++++++++++++++++++++++++++++ !function ($) { $(function(){ var $window = $(window) // Disable certain links in docs $('section [href^=#]').click(function (e) { e.preventDefault() }) // side bar $('.bs-docs-sidenav').affix({ offset: { top: function () { return $window.width() <= 980 ? 290 : 210 } , bottom: 270 } }) // make code pretty window.prettyPrint && prettyPrint() // add-ons $('.add-on :checkbox').on('click', function () { var $this = $(this) , method = $this.attr('checked') ? 'addClass' : 'removeClass' $(this).parents('.add-on')[method]('active') }) // add tipsies to grid for scaffolding if ($('#gridSystem').length) { $('#gridSystem').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) } // tooltip demo $('.tooltip-demo').tooltip({ selector: "a[rel=tooltip]" }) $('.tooltip-test').tooltip() $('.popover-test').popover() // popover demo $("a[rel=popover]") .popover() .click(function(e) { e.preventDefault() }) // button state demo $('#fat-btn') .click(function () { var btn = $(this) btn.button('loading') setTimeout(function () { btn.button('reset') }, 3000) }) // carousel demo $('#myCarousel').carousel() // javascript build logic var inputsComponent = $("#components.download input") , inputsPlugin = $("#plugins.download input") , inputsVariables = $("#variables.download input") // toggle all plugin checkboxes $('#components.download .toggle-all').on('click', function (e) { e.preventDefault() inputsComponent.attr('checked', !inputsComponent.is(':checked')) }) $('#plugins.download .toggle-all').on('click', function (e) { e.preventDefault() inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) }) $('#variables.download .toggle-all').on('click', function (e) { e.preventDefault() inputsVariables.val('') }) // request built javascript $('.download-btn .btn').on('click', function () { var css = $("#components.download input:checked") .map(function () { return this.value }) .toArray() , js = $("#plugins.download input:checked") .map(function () { return this.value }) .toArray() , vars = {} , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] $("#variables.download input") .each(function () { $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) }) $.ajax({ type: 'POST' , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com' , dataType: 'jsonpi' , params: { js: js , css: css , vars: vars , img: img } }) }) }) // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { var url = opts.url; return { send: function(_, completeCallback) { var name = 'jQuery_iframe_' + jQuery.now() , iframe, form iframe = $('<iframe>') .attr('name', name) .appendTo('head') form = $('<form>') .attr('method', opts.type) // GET or POST .attr('action', url) .attr('target', name) $.each(opts.params, function(k, v) { $('<input>') .attr('type', 'hidden') .attr('name', k) .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) .appendTo(form) }) form.appendTo('body').submit() } } }) }(window.jQuery)
JavaScript
/* Holder - 1.6 - client side image placeholders (c) 2012 Ivan Malopinsky / http://imsky.co Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 Commercial use requires attribution. */ var Holder = Holder || {}; (function (app, win) { var preempted = false, fallback = false, canvas = document.createElement('canvas'); //getElementsByClassName polyfill document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s}) //getComputedStyle polyfill window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}) //http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}; //https://gist.github.com/991057 by Jed Schmidt with modifications function selector(a){ a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]); var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret; } //shallow object property extend function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c} function text_size(width, height, template) { var dimension_arr = [height, width].sort(); var maxFactor = Math.round(dimension_arr[1] / 16), minFactor = Math.round(dimension_arr[0] / 16); var text_height = Math.max(template.size, maxFactor); return { height: text_height } } function draw(ctx, dimensions, template, ratio) { var ts = text_size(dimensions.width, dimensions.height, template); var text_height = ts.height; var width = dimensions.width * ratio, height = dimensions.height * ratio; canvas.width = width; canvas.height = height; ctx.textAlign = "center"; ctx.textBaseline = "middle"; ctx.fillStyle = template.background; ctx.fillRect(0, 0, width, height); ctx.fillStyle = template.foreground; ctx.font = "bold " + text_height + "px sans-serif"; var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height); if (ctx.measureText(text).width / width > 1) { text_height = template.size / (ctx.measureText(text).width / width); } ctx.font = "bold " + (text_height * ratio) + "px sans-serif"; ctx.fillText(text, (width / 2), (height / 2), width); return canvas.toDataURL("image/png"); } function render(mode, el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var ratio = 1; if(window.devicePixelRatio && window.devicePixelRatio > 1){ ratio = window.devicePixelRatio; } if (mode == "image") { el.setAttribute("data-src", src); el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); el.style.width = dimensions.width + "px"; el.style.height = dimensions.height + "px"; if (fallback) { el.style.backgroundColor = theme.background; } else{ el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); } } else { if (!fallback) { el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; el.style.backgroundSize = dimensions.width+"px "+dimensions.height+"px"; } } }; function fluid(el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var fluid = document.createElement("table"); fluid.setAttribute("cellspacing",0) fluid.setAttribute("cellpadding",0) fluid.setAttribute("border",0) var row = document.createElement("tr") .appendChild(document.createElement("td") .appendChild(document.createTextNode(theme.text))); fluid.style.backgroundColor = theme.background; fluid.style.color = theme.foreground; fluid.className = el.className + " holderjs-fluid"; fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%")>0?"":"px"); fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px"); fluid.id = el.id; var frag = document.createDocumentFragment(), tbody = document.createElement("tbody"), tr = document.createElement("tr"), td = document.createElement("td"); tr.appendChild(td); tbody.appendChild(tr); frag.appendChild(tbody); if (theme.text) { td.appendChild(document.createTextNode(theme.text)) fluid.appendChild(frag); } else { td.appendChild(document.createTextNode(dimensions_caption)) fluid.appendChild(frag); fluid_images.push(fluid); setTimeout(fluid_update, 0); } el.parentNode.replaceChild(fluid, el); } function fluid_update() { for (i in fluid_images) { var el = fluid_images[i]; var label = el.getElementsByTagName("td")[0].firstChild; label.data = el.offsetWidth + "x" + el.offsetHeight; } } function parse_flags(flags, options) { var ret = { theme: settings.themes.gray }, render = false; for (sl = flags.length, j = 0; j < sl; j++) { var flag = flags[j]; if (app.flags.dimensions.match(flag)) { render = true; ret.dimensions = app.flags.dimensions.output(flag); } else if (app.flags.fluid.match(flag)) { render = true; ret.dimensions = app.flags.fluid.output(flag); ret.fluid = true; } else if (app.flags.colors.match(flag)) { ret.theme = app.flags.colors.output(flag); } else if (options.themes[flag]) { //If a theme is specified, it will override custom colors ret.theme = options.themes[flag]; } else if (app.flags.text.match(flag)) { ret.text = app.flags.text.output(flag); } } return render ? ret : false; }; if (!canvas.getContext) { fallback = true; } else { if (canvas.toDataURL("image/png") .indexOf("data:image/png") < 0) { //Android doesn't support data URI fallback = true; } else { var ctx = canvas.getContext("2d"); } } var fluid_images = []; var settings = { domain: "holder.js", images: "img", elements: ".holderjs", themes: { "gray": { background: "#eee", foreground: "#aaa", size: 12 }, "social": { background: "#3a5a97", foreground: "#fff", size: 12 }, "industrial": { background: "#434A52", foreground: "#C2F200", size: 12 } }, stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;border-collapse:collapse;border:0;vertical-align:middle;margin:0}" }; app.flags = { dimensions: { regex: /(\d+)x(\d+)/, output: function (val) { var exec = this.regex.exec(val); return { width: +exec[1], height: +exec[2] } } }, fluid: { regex: /([0-9%]+)x([0-9%]+)/, output: function (val) { var exec = this.regex.exec(val); return { width: exec[1], height: exec[2] } } }, colors: { regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, output: function (val) { var exec = this.regex.exec(val); return { size: settings.themes.gray.size, foreground: "#" + exec[2], background: "#" + exec[1] } } }, text: { regex: /text\:(.*)/, output: function (val) { return this.regex.exec(val)[1]; } } } for (var flag in app.flags) { app.flags[flag].match = function (val) { return val.match(this.regex) } } app.add_theme = function (name, theme) { name != null && theme != null && (settings.themes[name] = theme); return app; }; app.add_image = function (src, el) { var node = selector(el); if (node.length) { for (var i = 0, l = node.length; i < l; i++) { var img = document.createElement("img") img.setAttribute("data-src", src); node[i].appendChild(img); } } return app; }; app.run = function (o) { var options = extend(settings, o), images_nodes = selector(options.images), elements = selector(options.elements), preempted = true, images = []; for (i = 0, l = images_nodes.length; i < l; i++) images.push(images_nodes[i]); var holdercss = document.createElement("style"); holdercss.type = "text/css"; holdercss.styleSheet ? holdercss.styleSheet.cssText = options.stylesheet : holdercss.textContent = options.stylesheet; document.getElementsByTagName("head")[0].appendChild(holdercss); var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); for (var l = elements.length, i = 0; i < l; i++) { var src = window.getComputedStyle(elements[i], null) .getPropertyValue("background-image"); var flags = src.match(cssregex); if (flags) { var holder = parse_flags(flags[1].split("/"), options); if (holder) { render("background", elements[i], holder, src); } } } for (var l = images.length, i = 0; i < l; i++) { var src = images[i].getAttribute("src") || images[i].getAttribute("data-src"); if (src != null && src.indexOf(options.domain) >= 0) { var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) .split("/"), options); if (holder) { if (holder.fluid) { fluid(images[i], holder, src); } else { render("image", images[i], holder, src); } } } } return app; }; contentLoaded(win, function () { if (window.addEventListener) { window.addEventListener("resize", fluid_update, false); window.addEventListener("orientationchange", fluid_update, false); } else { window.attachEvent("onresize", fluid_update) } preempted || app.run(); }); })(Holder, window);
JavaScript
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT // IT'S ALL JUST JUNK FOR OUR DOCS! // ++++++++++++++++++++++++++++++++++++++++++ !function ($) { $(function(){ var $window = $(window) // Disable certain links in docs $('section [href^=#]').click(function (e) { e.preventDefault() }) // side bar $('.bs-docs-sidenav').affix({ offset: { top: function () { return $window.width() <= 980 ? 290 : 210 } , bottom: 270 } }) // make code pretty window.prettyPrint && prettyPrint() // add-ons $('.add-on :checkbox').on('click', function () { var $this = $(this) , method = $this.attr('checked') ? 'addClass' : 'removeClass' $(this).parents('.add-on')[method]('active') }) // add tipsies to grid for scaffolding if ($('#gridSystem').length) { $('#gridSystem').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) } // tooltip demo $('.tooltip-demo').tooltip({ selector: "a[rel=tooltip]" }) $('.tooltip-test').tooltip() $('.popover-test').popover() // popover demo $("a[rel=popover]") .popover() .click(function(e) { e.preventDefault() }) // button state demo $('#fat-btn') .click(function () { var btn = $(this) btn.button('loading') setTimeout(function () { btn.button('reset') }, 3000) }) // carousel demo $('#myCarousel').carousel() // javascript build logic var inputsComponent = $("#components.download input") , inputsPlugin = $("#plugins.download input") , inputsVariables = $("#variables.download input") // toggle all plugin checkboxes $('#components.download .toggle-all').on('click', function (e) { e.preventDefault() inputsComponent.attr('checked', !inputsComponent.is(':checked')) }) $('#plugins.download .toggle-all').on('click', function (e) { e.preventDefault() inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) }) $('#variables.download .toggle-all').on('click', function (e) { e.preventDefault() inputsVariables.val('') }) // request built javascript $('.download-btn .btn').on('click', function () { var css = $("#components.download input:checked") .map(function () { return this.value }) .toArray() , js = $("#plugins.download input:checked") .map(function () { return this.value }) .toArray() , vars = {} , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] $("#variables.download input") .each(function () { $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) }) $.ajax({ type: 'POST' , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com' , dataType: 'jsonpi' , params: { js: js , css: css , vars: vars , img: img } }) }) }) // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { var url = opts.url; return { send: function(_, completeCallback) { var name = 'jQuery_iframe_' + jQuery.now() , iframe, form iframe = $('<iframe>') .attr('name', name) .appendTo('head') form = $('<form>') .attr('method', opts.type) // GET or POST .attr('action', url) .attr('target', name) $.each(opts.params, function(k, v) { $('<input>') .attr('type', 'hidden') .attr('name', k) .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) .appendTo(form) }) form.appendTo('body').submit() } } }) }(window.jQuery)
JavaScript
/* Holder - 1.6 - client side image placeholders (c) 2012 Ivan Malopinsky / http://imsky.co Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 Commercial use requires attribution. */ var Holder = Holder || {}; (function (app, win) { var preempted = false, fallback = false, canvas = document.createElement('canvas'); //getElementsByClassName polyfill document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s}) //getComputedStyle polyfill window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}) //http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}; //https://gist.github.com/991057 by Jed Schmidt with modifications function selector(a){ a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]); var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret; } //shallow object property extend function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c} function text_size(width, height, template) { var dimension_arr = [height, width].sort(); var maxFactor = Math.round(dimension_arr[1] / 16), minFactor = Math.round(dimension_arr[0] / 16); var text_height = Math.max(template.size, maxFactor); return { height: text_height } } function draw(ctx, dimensions, template, ratio) { var ts = text_size(dimensions.width, dimensions.height, template); var text_height = ts.height; var width = dimensions.width * ratio, height = dimensions.height * ratio; canvas.width = width; canvas.height = height; ctx.textAlign = "center"; ctx.textBaseline = "middle"; ctx.fillStyle = template.background; ctx.fillRect(0, 0, width, height); ctx.fillStyle = template.foreground; ctx.font = "bold " + text_height + "px sans-serif"; var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height); if (ctx.measureText(text).width / width > 1) { text_height = template.size / (ctx.measureText(text).width / width); } ctx.font = "bold " + (text_height * ratio) + "px sans-serif"; ctx.fillText(text, (width / 2), (height / 2), width); return canvas.toDataURL("image/png"); } function render(mode, el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var ratio = 1; if(window.devicePixelRatio && window.devicePixelRatio > 1){ ratio = window.devicePixelRatio; } if (mode == "image") { el.setAttribute("data-src", src); el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); el.style.width = dimensions.width + "px"; el.style.height = dimensions.height + "px"; if (fallback) { el.style.backgroundColor = theme.background; } else{ el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); } } else { if (!fallback) { el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; el.style.backgroundSize = dimensions.width+"px "+dimensions.height+"px"; } } }; function fluid(el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var fluid = document.createElement("table"); fluid.setAttribute("cellspacing",0) fluid.setAttribute("cellpadding",0) fluid.setAttribute("border",0) var row = document.createElement("tr") .appendChild(document.createElement("td") .appendChild(document.createTextNode(theme.text))); fluid.style.backgroundColor = theme.background; fluid.style.color = theme.foreground; fluid.className = el.className + " holderjs-fluid"; fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%")>0?"":"px"); fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px"); fluid.id = el.id; var frag = document.createDocumentFragment(), tbody = document.createElement("tbody"), tr = document.createElement("tr"), td = document.createElement("td"); tr.appendChild(td); tbody.appendChild(tr); frag.appendChild(tbody); if (theme.text) { td.appendChild(document.createTextNode(theme.text)) fluid.appendChild(frag); } else { td.appendChild(document.createTextNode(dimensions_caption)) fluid.appendChild(frag); fluid_images.push(fluid); setTimeout(fluid_update, 0); } el.parentNode.replaceChild(fluid, el); } function fluid_update() { for (i in fluid_images) { var el = fluid_images[i]; var label = el.getElementsByTagName("td")[0].firstChild; label.data = el.offsetWidth + "x" + el.offsetHeight; } } function parse_flags(flags, options) { var ret = { theme: settings.themes.gray }, render = false; for (sl = flags.length, j = 0; j < sl; j++) { var flag = flags[j]; if (app.flags.dimensions.match(flag)) { render = true; ret.dimensions = app.flags.dimensions.output(flag); } else if (app.flags.fluid.match(flag)) { render = true; ret.dimensions = app.flags.fluid.output(flag); ret.fluid = true; } else if (app.flags.colors.match(flag)) { ret.theme = app.flags.colors.output(flag); } else if (options.themes[flag]) { //If a theme is specified, it will override custom colors ret.theme = options.themes[flag]; } else if (app.flags.text.match(flag)) { ret.text = app.flags.text.output(flag); } } return render ? ret : false; }; if (!canvas.getContext) { fallback = true; } else { if (canvas.toDataURL("image/png") .indexOf("data:image/png") < 0) { //Android doesn't support data URI fallback = true; } else { var ctx = canvas.getContext("2d"); } } var fluid_images = []; var settings = { domain: "holder.js", images: "img", elements: ".holderjs", themes: { "gray": { background: "#eee", foreground: "#aaa", size: 12 }, "social": { background: "#3a5a97", foreground: "#fff", size: 12 }, "industrial": { background: "#434A52", foreground: "#C2F200", size: 12 } }, stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;border-collapse:collapse;border:0;vertical-align:middle;margin:0}" }; app.flags = { dimensions: { regex: /(\d+)x(\d+)/, output: function (val) { var exec = this.regex.exec(val); return { width: +exec[1], height: +exec[2] } } }, fluid: { regex: /([0-9%]+)x([0-9%]+)/, output: function (val) { var exec = this.regex.exec(val); return { width: exec[1], height: exec[2] } } }, colors: { regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, output: function (val) { var exec = this.regex.exec(val); return { size: settings.themes.gray.size, foreground: "#" + exec[2], background: "#" + exec[1] } } }, text: { regex: /text\:(.*)/, output: function (val) { return this.regex.exec(val)[1]; } } } for (var flag in app.flags) { app.flags[flag].match = function (val) { return val.match(this.regex) } } app.add_theme = function (name, theme) { name != null && theme != null && (settings.themes[name] = theme); return app; }; app.add_image = function (src, el) { var node = selector(el); if (node.length) { for (var i = 0, l = node.length; i < l; i++) { var img = document.createElement("img") img.setAttribute("data-src", src); node[i].appendChild(img); } } return app; }; app.run = function (o) { var options = extend(settings, o), images_nodes = selector(options.images), elements = selector(options.elements), preempted = true, images = []; for (i = 0, l = images_nodes.length; i < l; i++) images.push(images_nodes[i]); var holdercss = document.createElement("style"); holdercss.type = "text/css"; holdercss.styleSheet ? holdercss.styleSheet.cssText = options.stylesheet : holdercss.textContent = options.stylesheet; document.getElementsByTagName("head")[0].appendChild(holdercss); var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); for (var l = elements.length, i = 0; i < l; i++) { var src = window.getComputedStyle(elements[i], null) .getPropertyValue("background-image"); var flags = src.match(cssregex); if (flags) { var holder = parse_flags(flags[1].split("/"), options); if (holder) { render("background", elements[i], holder, src); } } } for (var l = images.length, i = 0; i < l; i++) { var src = images[i].getAttribute("src") || images[i].getAttribute("data-src"); if (src != null && src.indexOf(options.domain) >= 0) { var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) .split("/"), options); if (holder) { if (holder.fluid) { fluid(images[i], holder, src); } else { render("image", images[i], holder, src); } } } } return app; }; contentLoaded(win, function () { if (window.addEventListener) { window.addEventListener("resize", fluid_update, false); window.addEventListener("orientationchange", fluid_update, false); } else { window.attachEvent("onresize", fluid_update) } preempted || app.run(); }); })(Holder, window);
JavaScript
/* jqBootstrapValidation * A plugin for automating validation on Twitter Bootstrap formatted forms. * * v1.3.6 * * License: MIT <http://opensource.org/licenses/mit-license.php> - see LICENSE file * * http://ReactiveRaven.github.com/jqBootstrapValidation/ */ (function( $ ){ var createdElements = []; var defaults = { options: { prependExistingHelpBlock: false, sniffHtml: true, // sniff for 'required', 'maxlength', etc preventSubmit: true, // stop the form submit event from firing if validation fails submitError: false, // function called if there is an error when trying to submit submitSuccess: false, // function called just before a successful submit event is sent to the server semanticallyStrict: false, // set to true to tidy up generated HTML output autoAdd: { helpBlocks: true }, filter: function () { // return $(this).is(":visible"); // only validate elements you can see return true; // validate everything } }, methods: { init : function( options ) { var settings = $.extend(true, {}, defaults); settings.options = $.extend(true, settings.options, options); var $siblingElements = this; var uniqueForms = $.unique( $siblingElements.map( function () { return $(this).parents("form")[0]; }).toArray() ); $(uniqueForms).bind("submit", function (e) { var $form = $(this); var warningsFound = 0; var $inputs = $form.find("input,textarea,select").not("[type=submit],[type=image]").filter(settings.options.filter); $inputs.trigger("submit.validation").trigger("validationLostFocus.validation"); $inputs.each(function (i, el) { var $this = $(el), $controlGroup = $this.parents(".control-group").first(); if ( $controlGroup.hasClass("warning") ) { $controlGroup.removeClass("warning").addClass("error"); warningsFound++; } }); $inputs.trigger("validationLostFocus.validation"); if (warningsFound) { if (settings.options.preventSubmit) { e.preventDefault(); } $form.addClass("error"); if ($.isFunction(settings.options.submitError)) { settings.options.submitError($form, e, $inputs.jqBootstrapValidation("collectErrors", true)); } } else { $form.removeClass("error"); if ($.isFunction(settings.options.submitSuccess)) { settings.options.submitSuccess($form, e); } } }); return this.each(function(){ // Get references to everything we're interested in var $this = $(this), $controlGroup = $this.parents(".control-group").first(), $helpBlock = $controlGroup.find(".help-block").first(), $form = $this.parents("form").first(), validatorNames = []; // create message container if not exists if (!$helpBlock.length && settings.options.autoAdd && settings.options.autoAdd.helpBlocks) { $helpBlock = $('<div class="help-block" />'); $controlGroup.find('.controls').append($helpBlock); createdElements.push($helpBlock[0]); } // ============================================================= // SNIFF HTML FOR VALIDATORS // ============================================================= // *snort sniff snuffle* if (settings.options.sniffHtml) { var message = ""; // --------------------------------------------------------- // PATTERN // --------------------------------------------------------- if ($this.attr("pattern") !== undefined) { message = "Not in the expected format<!-- data-validation-pattern-message to override -->"; if ($this.data("validationPatternMessage")) { message = $this.data("validationPatternMessage"); } $this.data("validationPatternMessage", message); $this.data("validationPatternRegex", $this.attr("pattern")); } // --------------------------------------------------------- // MAX // --------------------------------------------------------- if ($this.attr("max") !== undefined || $this.attr("aria-valuemax") !== undefined) { var max = ($this.attr("max") !== undefined ? $this.attr("max") : $this.attr("aria-valuemax")); message = "Too high: Maximum of '" + max + "'<!-- data-validation-max-message to override -->"; if ($this.data("validationMaxMessage")) { message = $this.data("validationMaxMessage"); } $this.data("validationMaxMessage", message); $this.data("validationMaxMax", max); } // --------------------------------------------------------- // MIN // --------------------------------------------------------- if ($this.attr("min") !== undefined || $this.attr("aria-valuemin") !== undefined) { var min = ($this.attr("min") !== undefined ? $this.attr("min") : $this.attr("aria-valuemin")); message = "Too low: Minimum of '" + min + "'<!-- data-validation-min-message to override -->"; if ($this.data("validationMinMessage")) { message = $this.data("validationMinMessage"); } $this.data("validationMinMessage", message); $this.data("validationMinMin", min); } // --------------------------------------------------------- // MAXLENGTH // --------------------------------------------------------- if ($this.attr("maxlength") !== undefined) { message = "Too long: Maximum of '" + $this.attr("maxlength") + "' characters<!-- data-validation-maxlength-message to override -->"; if ($this.data("validationMaxlengthMessage")) { message = $this.data("validationMaxlengthMessage"); } $this.data("validationMaxlengthMessage", message); $this.data("validationMaxlengthMaxlength", $this.attr("maxlength")); } // --------------------------------------------------------- // MINLENGTH // --------------------------------------------------------- if ($this.attr("minlength") !== undefined) { message = "Too short: Minimum of '" + $this.attr("minlength") + "' characters<!-- data-validation-minlength-message to override -->"; if ($this.data("validationMinlengthMessage")) { message = $this.data("validationMinlengthMessage"); } $this.data("validationMinlengthMessage", message); $this.data("validationMinlengthMinlength", $this.attr("minlength")); } // --------------------------------------------------------- // REQUIRED // --------------------------------------------------------- if ($this.attr("required") !== undefined || $this.attr("aria-required") !== undefined) { message = settings.builtInValidators.required.message; if ($this.data("validationRequiredMessage")) { message = $this.data("validationRequiredMessage"); } $this.data("validationRequiredMessage", message); } // --------------------------------------------------------- // NUMBER // --------------------------------------------------------- if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "number") { message = settings.builtInValidators.number.message; if ($this.data("validationNumberMessage")) { message = $this.data("validationNumberMessage"); } $this.data("validationNumberMessage", message); } // --------------------------------------------------------- // EMAIL // --------------------------------------------------------- if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "email") { message = "Not a valid email address<!-- data-validator-validemail-message to override -->"; if ($this.data("validationValidemailMessage")) { message = $this.data("validationValidemailMessage"); } else if ($this.data("validationEmailMessage")) { message = $this.data("validationEmailMessage"); } $this.data("validationValidemailMessage", message); } // --------------------------------------------------------- // MINCHECKED // --------------------------------------------------------- if ($this.attr("minchecked") !== undefined) { message = "Not enough options checked; Minimum of '" + $this.attr("minchecked") + "' required<!-- data-validation-minchecked-message to override -->"; if ($this.data("validationMincheckedMessage")) { message = $this.data("validationMincheckedMessage"); } $this.data("validationMincheckedMessage", message); $this.data("validationMincheckedMinchecked", $this.attr("minchecked")); } // --------------------------------------------------------- // MAXCHECKED // --------------------------------------------------------- if ($this.attr("maxchecked") !== undefined) { message = "Too many options checked; Maximum of '" + $this.attr("maxchecked") + "' required<!-- data-validation-maxchecked-message to override -->"; if ($this.data("validationMaxcheckedMessage")) { message = $this.data("validationMaxcheckedMessage"); } $this.data("validationMaxcheckedMessage", message); $this.data("validationMaxcheckedMaxchecked", $this.attr("maxchecked")); } } // ============================================================= // COLLECT VALIDATOR NAMES // ============================================================= // Get named validators if ($this.data("validation") !== undefined) { validatorNames = $this.data("validation").split(","); } // Get extra ones defined on the element's data attributes $.each($this.data(), function (i, el) { var parts = i.replace(/([A-Z])/g, ",$1").split(","); if (parts[0] === "validation" && parts[1]) { validatorNames.push(parts[1]); } }); // ============================================================= // NORMALISE VALIDATOR NAMES // ============================================================= var validatorNamesToInspect = validatorNames; var newValidatorNamesToInspect = []; do // repeatedly expand 'shortcut' validators into their real validators { // Uppercase only the first letter of each name $.each(validatorNames, function (i, el) { validatorNames[i] = formatValidatorName(el); }); // Remove duplicate validator names validatorNames = $.unique(validatorNames); // Pull out the new validator names from each shortcut newValidatorNamesToInspect = []; $.each(validatorNamesToInspect, function(i, el) { if ($this.data("validation" + el + "Shortcut") !== undefined) { // Are these custom validators? // Pull them out! $.each($this.data("validation" + el + "Shortcut").split(","), function(i2, el2) { newValidatorNamesToInspect.push(el2); }); } else if (settings.builtInValidators[el.toLowerCase()]) { // Is this a recognised built-in? // Pull it out! var validator = settings.builtInValidators[el.toLowerCase()]; if (validator.type.toLowerCase() === "shortcut") { $.each(validator.shortcut.split(","), function (i, el) { el = formatValidatorName(el); newValidatorNamesToInspect.push(el); validatorNames.push(el); }); } } }); validatorNamesToInspect = newValidatorNamesToInspect; } while (validatorNamesToInspect.length > 0) // ============================================================= // SET UP VALIDATOR ARRAYS // ============================================================= var validators = {}; $.each(validatorNames, function (i, el) { // Set up the 'override' message var message = $this.data("validation" + el + "Message"); var hasOverrideMessage = (message !== undefined); var foundValidator = false; message = ( message ? message : "'" + el + "' validation failed <!-- Add attribute 'data-validation-" + el.toLowerCase() + "-message' to input to change this message -->" ) ; $.each( settings.validatorTypes, function (validatorType, validatorTemplate) { if (validators[validatorType] === undefined) { validators[validatorType] = []; } if (!foundValidator && $this.data("validation" + el + formatValidatorName(validatorTemplate.name)) !== undefined) { validators[validatorType].push( $.extend( true, { name: formatValidatorName(validatorTemplate.name), message: message }, validatorTemplate.init($this, el) ) ); foundValidator = true; } } ); if (!foundValidator && settings.builtInValidators[el.toLowerCase()]) { var validator = $.extend(true, {}, settings.builtInValidators[el.toLowerCase()]); if (hasOverrideMessage) { validator.message = message; } var validatorType = validator.type.toLowerCase(); if (validatorType === "shortcut") { foundValidator = true; } else { $.each( settings.validatorTypes, function (validatorTemplateType, validatorTemplate) { if (validators[validatorTemplateType] === undefined) { validators[validatorTemplateType] = []; } if (!foundValidator && validatorType === validatorTemplateType.toLowerCase()) { $this.data("validation" + el + formatValidatorName(validatorTemplate.name), validator[validatorTemplate.name.toLowerCase()]); validators[validatorType].push( $.extend( validator, validatorTemplate.init($this, el) ) ); foundValidator = true; } } ); } } if (! foundValidator) { $.error("Cannot find validation info for '" + el + "'"); } }); // ============================================================= // STORE FALLBACK VALUES // ============================================================= $helpBlock.data( "original-contents", ( $helpBlock.data("original-contents") ? $helpBlock.data("original-contents") : $helpBlock.html() ) ); $helpBlock.data( "original-role", ( $helpBlock.data("original-role") ? $helpBlock.data("original-role") : $helpBlock.attr("role") ) ); $controlGroup.data( "original-classes", ( $controlGroup.data("original-clases") ? $controlGroup.data("original-classes") : $controlGroup.attr("class") ) ); $this.data( "original-aria-invalid", ( $this.data("original-aria-invalid") ? $this.data("original-aria-invalid") : $this.attr("aria-invalid") ) ); // ============================================================= // VALIDATION // ============================================================= $this.bind( "validation.validation", function (event, params) { var value = getValue($this); // Get a list of the errors to apply var errorsFound = []; $.each(validators, function (validatorType, validatorTypeArray) { if (value || value.length || (params && params.includeEmpty) || (!!settings.validatorTypes[validatorType].blockSubmit && params && !!params.submitting)) { $.each(validatorTypeArray, function (i, validator) { if (settings.validatorTypes[validatorType].validate($this, value, validator)) { errorsFound.push(validator.message); } }); } }); return errorsFound; } ); $this.bind( "getValidators.validation", function () { return validators; } ); // ============================================================= // WATCH FOR CHANGES // ============================================================= $this.bind( "submit.validation", function () { return $this.triggerHandler("change.validation", {submitting: true}); } ); $this.bind( [ "keyup", "focus", "blur", "click", "keydown", "keypress", "change" ].join(".validation ") + ".validation", function (e, params) { var value = getValue($this); var errorsFound = []; $controlGroup.find("input,textarea,select").each(function (i, el) { var oldCount = errorsFound.length; $.each($(el).triggerHandler("validation.validation", params), function (j, message) { errorsFound.push(message); }); if (errorsFound.length > oldCount) { $(el).attr("aria-invalid", "true"); } else { var original = $this.data("original-aria-invalid"); $(el).attr("aria-invalid", (original !== undefined ? original : false)); } }); $form.find("input,select,textarea").not($this).not("[name=\"" + $this.attr("name") + "\"]").trigger("validationLostFocus.validation"); errorsFound = $.unique(errorsFound.sort()); // Were there any errors? if (errorsFound.length) { // Better flag it up as a warning. $controlGroup.removeClass("success error").addClass("warning"); // How many errors did we find? if (settings.options.semanticallyStrict && errorsFound.length === 1) { // Only one? Being strict? Just output it. $helpBlock.html(errorsFound[0] + ( settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : "" )); } else { // Multiple? Being sloppy? Glue them together into an UL. $helpBlock.html("<ul role=\"alert\"><li>" + errorsFound.join("</li><li>") + "</li></ul>" + ( settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : "" )); } } else { $controlGroup.removeClass("warning error success"); if (value.length > 0) { $controlGroup.addClass("success"); } $helpBlock.html($helpBlock.data("original-contents")); } if (e.type === "blur") { $controlGroup.removeClass("success"); } } ); $this.bind("validationLostFocus.validation", function () { $controlGroup.removeClass("success"); }); }); }, destroy : function( ) { return this.each( function() { var $this = $(this), $controlGroup = $this.parents(".control-group").first(), $helpBlock = $controlGroup.find(".help-block").first(); // remove our events $this.unbind('.validation'); // events are namespaced. // reset help text $helpBlock.html($helpBlock.data("original-contents")); // reset classes $controlGroup.attr("class", $controlGroup.data("original-classes")); // reset aria $this.attr("aria-invalid", $this.data("original-aria-invalid")); // reset role $helpBlock.attr("role", $this.data("original-role")); // remove all elements we created if (createdElements.indexOf($helpBlock[0]) > -1) { $helpBlock.remove(); } } ); }, collectErrors : function(includeEmpty) { var errorMessages = {}; this.each(function (i, el) { var $el = $(el); var name = $el.attr("name"); var errors = $el.triggerHandler("validation.validation", {includeEmpty: true}); errorMessages[name] = $.extend(true, errors, errorMessages[name]); }); $.each(errorMessages, function (i, el) { if (el.length === 0) { delete errorMessages[i]; } }); return errorMessages; }, hasErrors: function() { var errorMessages = []; this.each(function (i, el) { errorMessages = errorMessages.concat( $(el).triggerHandler("getValidators.validation") ? $(el).triggerHandler("validation.validation", {submitting: true}) : [] ); }); return (errorMessages.length > 0); }, override : function (newDefaults) { defaults = $.extend(true, defaults, newDefaults); } }, validatorTypes: { callback: { name: "callback", init: function ($this, name) { return { validatorName: name, callback: $this.data("validation" + name + "Callback"), lastValue: $this.val(), lastValid: true, lastFinished: true }; }, validate: function ($this, value, validator) { if (validator.lastValue === value && validator.lastFinished) { return !validator.lastValid; } if (validator.lastFinished === true) { validator.lastValue = value; validator.lastValid = true; validator.lastFinished = false; var rrjqbvValidator = validator; var rrjqbvThis = $this; executeFunctionByName( validator.callback, window, $this, value, function (data) { if (rrjqbvValidator.lastValue === data.value) { rrjqbvValidator.lastValid = data.valid; if (data.message) { rrjqbvValidator.message = data.message; } rrjqbvValidator.lastFinished = true; rrjqbvThis.data("validation" + rrjqbvValidator.validatorName + "Message", rrjqbvValidator.message); // Timeout is set to avoid problems with the events being considered 'already fired' setTimeout(function () { rrjqbvThis.trigger("change.validation"); }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst } } ); } return false; } }, ajax: { name: "ajax", init: function ($this, name) { return { validatorName: name, url: $this.data("validation" + name + "Ajax"), lastValue: $this.val(), lastValid: true, lastFinished: true }; }, validate: function ($this, value, validator) { if (""+validator.lastValue === ""+value && validator.lastFinished === true) { return validator.lastValid === false; } if (validator.lastFinished === true) { validator.lastValue = value; validator.lastValid = true; validator.lastFinished = false; $.ajax({ url: validator.url, data: "value=" + value + "&field=" + $this.attr("name"), dataType: "json", success: function (data) { if (""+validator.lastValue === ""+data.value) { validator.lastValid = !!(data.valid); if (data.message) { validator.message = data.message; } validator.lastFinished = true; $this.data("validation" + validator.validatorName + "Message", validator.message); // Timeout is set to avoid problems with the events being considered 'already fired' setTimeout(function () { $this.trigger("change.validation"); }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst } }, failure: function () { validator.lastValid = true; validator.message = "ajax call failed"; validator.lastFinished = true; $this.data("validation" + validator.validatorName + "Message", validator.message); // Timeout is set to avoid problems with the events being considered 'already fired' setTimeout(function () { $this.trigger("change.validation"); }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst } }); } return false; } }, regex: { name: "regex", init: function ($this, name) { return {regex: regexFromString($this.data("validation" + name + "Regex"))}; }, validate: function ($this, value, validator) { return (!validator.regex.test(value) && ! validator.negative) || (validator.regex.test(value) && validator.negative); } }, required: { name: "required", init: function ($this, name) { return {}; }, validate: function ($this, value, validator) { return !!(value.length === 0 && ! validator.negative) || !!(value.length > 0 && validator.negative); }, blockSubmit: true }, match: { name: "match", init: function ($this, name) { var element = $this.parents("form").first().find("[name=\"" + $this.data("validation" + name + "Match") + "\"]").first(); element.bind("validation.validation", function () { $this.trigger("change.validation", {submitting: true}); }); return {"element": element}; }, validate: function ($this, value, validator) { return (value !== validator.element.val() && ! validator.negative) || (value === validator.element.val() && validator.negative); }, blockSubmit: true }, max: { name: "max", init: function ($this, name) { return {max: $this.data("validation" + name + "Max")}; }, validate: function ($this, value, validator) { return (parseFloat(value, 10) > parseFloat(validator.max, 10) && ! validator.negative) || (parseFloat(value, 10) <= parseFloat(validator.max, 10) && validator.negative); } }, min: { name: "min", init: function ($this, name) { return {min: $this.data("validation" + name + "Min")}; }, validate: function ($this, value, validator) { return (parseFloat(value) < parseFloat(validator.min) && ! validator.negative) || (parseFloat(value) >= parseFloat(validator.min) && validator.negative); } }, maxlength: { name: "maxlength", init: function ($this, name) { return {maxlength: $this.data("validation" + name + "Maxlength")}; }, validate: function ($this, value, validator) { return ((value.length > validator.maxlength) && ! validator.negative) || ((value.length <= validator.maxlength) && validator.negative); } }, minlength: { name: "minlength", init: function ($this, name) { return {minlength: $this.data("validation" + name + "Minlength")}; }, validate: function ($this, value, validator) { return ((value.length < validator.minlength) && ! validator.negative) || ((value.length >= validator.minlength) && validator.negative); } }, maxchecked: { name: "maxchecked", init: function ($this, name) { var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]"); elements.bind("click.validation", function () { $this.trigger("change.validation", {includeEmpty: true}); }); return {maxchecked: $this.data("validation" + name + "Maxchecked"), elements: elements}; }, validate: function ($this, value, validator) { return (validator.elements.filter(":checked").length > validator.maxchecked && ! validator.negative) || (validator.elements.filter(":checked").length <= validator.maxchecked && validator.negative); }, blockSubmit: true }, minchecked: { name: "minchecked", init: function ($this, name) { var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]"); elements.bind("click.validation", function () { $this.trigger("change.validation", {includeEmpty: true}); }); return {minchecked: $this.data("validation" + name + "Minchecked"), elements: elements}; }, validate: function ($this, value, validator) { return (validator.elements.filter(":checked").length < validator.minchecked && ! validator.negative) || (validator.elements.filter(":checked").length >= validator.minchecked && validator.negative); }, blockSubmit: true } }, builtInValidators: { email: { name: "Email", type: "shortcut", shortcut: "validemail" }, validemail: { name: "Validemail", type: "regex", regex: "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\.[A-Za-z]{2,4}", message: "Not a valid email address<!-- data-validator-validemail-message to override -->" }, passwordagain: { name: "Passwordagain", type: "match", match: "password", message: "Does not match the given password<!-- data-validator-paswordagain-message to override -->" }, positive: { name: "Positive", type: "shortcut", shortcut: "number,positivenumber" }, negative: { name: "Negative", type: "shortcut", shortcut: "number,negativenumber" }, number: { name: "Number", type: "regex", regex: "([+-]?\\\d+(\\\.\\\d*)?([eE][+-]?[0-9]+)?)?", message: "Must be a number<!-- data-validator-number-message to override -->" }, integer: { name: "Integer", type: "regex", regex: "[+-]?\\\d+", message: "No decimal places allowed<!-- data-validator-integer-message to override -->" }, positivenumber: { name: "Positivenumber", type: "min", min: 0, message: "Must be a positive number<!-- data-validator-positivenumber-message to override -->" }, negativenumber: { name: "Negativenumber", type: "max", max: 0, message: "Must be a negative number<!-- data-validator-negativenumber-message to override -->" }, required: { name: "Required", type: "required", message: "This is required<!-- data-validator-required-message to override -->" }, checkone: { name: "Checkone", type: "minchecked", minchecked: 1, message: "Check at least one option<!-- data-validation-checkone-message to override -->" } } }; var formatValidatorName = function (name) { return name .toLowerCase() .replace( /(^|\s)([a-z])/g , function(m,p1,p2) { return p1+p2.toUpperCase(); } ) ; }; var getValue = function ($this) { // Extract the value we're talking about var value = $this.val(); var type = $this.attr("type"); if (type === "checkbox") { value = ($this.is(":checked") ? value : ""); } if (type === "radio") { value = ($('input[name="' + $this.attr("name") + '"]:checked').length > 0 ? value : ""); } return value; }; function regexFromString(inputstring) { return new RegExp("^" + inputstring + "$"); } /** * Thanks to Jason Bunting via StackOverflow.com * * http://stackoverflow.com/questions/359788/how-to-execute-a-javascript-function-when-i-have-its-name-as-a-string#answer-359910 * Short link: http://tinyurl.com/executeFunctionByName **/ function executeFunctionByName(functionName, context /*, args*/) { var args = Array.prototype.slice.call(arguments).splice(2); var namespaces = functionName.split("."); var func = namespaces.pop(); for(var i = 0; i < namespaces.length; i++) { context = context[namespaces[i]]; } return context[func].apply(this, args); } $.fn.jqBootstrapValidation = function( method ) { if ( defaults.methods[method] ) { return defaults.methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return defaults.methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.jqBootstrapValidation' ); return null; } }; $.jqBootstrapValidation = function (options) { $(":input").not("[type=image],[type=submit]").jqBootstrapValidation.apply(this,arguments); }; })( jQuery );
JavaScript
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT // IT'S ALL JUST JUNK FOR OUR DOCS! // ++++++++++++++++++++++++++++++++++++++++++ !function ($) { $(function(){ var $window = $(window) // Disable certain links in docs $('section [href^=#]').click(function (e) { e.preventDefault() }) // side bar $('.bs-docs-sidenav').affix({ offset: { top: function () { return $window.width() <= 980 ? 290 : 210 } , bottom: 270 } }) // make code pretty window.prettyPrint && prettyPrint() // add-ons $('.add-on :checkbox').on('click', function () { var $this = $(this) , method = $this.attr('checked') ? 'addClass' : 'removeClass' $(this).parents('.add-on')[method]('active') }) // add tipsies to grid for scaffolding if ($('#gridSystem').length) { $('#gridSystem').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) } // tooltip demo $('.tooltip-demo').tooltip({ selector: "a[rel=tooltip]" }) $('.tooltip-test').tooltip() $('.popover-test').popover() // popover demo $("a[rel=popover]") .popover() .click(function(e) { e.preventDefault() }) // button state demo $('#fat-btn') .click(function () { var btn = $(this) btn.button('loading') setTimeout(function () { btn.button('reset') }, 3000) }) // carousel demo $('#myCarousel').carousel() // javascript build logic var inputsComponent = $("#components.download input") , inputsPlugin = $("#plugins.download input") , inputsVariables = $("#variables.download input") // toggle all plugin checkboxes $('#components.download .toggle-all').on('click', function (e) { e.preventDefault() inputsComponent.attr('checked', !inputsComponent.is(':checked')) }) $('#plugins.download .toggle-all').on('click', function (e) { e.preventDefault() inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) }) $('#variables.download .toggle-all').on('click', function (e) { e.preventDefault() inputsVariables.val('') }) // request built javascript $('.download-btn .btn').on('click', function () { var css = $("#components.download input:checked") .map(function () { return this.value }) .toArray() , js = $("#plugins.download input:checked") .map(function () { return this.value }) .toArray() , vars = {} , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] $("#variables.download input") .each(function () { $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) }) $.ajax({ type: 'POST' , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com' , dataType: 'jsonpi' , params: { js: js , css: css , vars: vars , img: img } }) }) }) // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { var url = opts.url; return { send: function(_, completeCallback) { var name = 'jQuery_iframe_' + jQuery.now() , iframe, form iframe = $('<iframe>') .attr('name', name) .appendTo('head') form = $('<form>') .attr('method', opts.type) // GET or POST .attr('action', url) .attr('target', name) $.each(opts.params, function(k, v) { $('<input>') .attr('type', 'hidden') .attr('name', k) .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) .appendTo(form) }) form.appendTo('body').submit() } } }) }(window.jQuery)
JavaScript
/* Holder - 1.6 - client side image placeholders (c) 2012 Ivan Malopinsky / http://imsky.co Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 Commercial use requires attribution. */ var Holder = Holder || {}; (function (app, win) { var preempted = false, fallback = false, canvas = document.createElement('canvas'); //getElementsByClassName polyfill document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s}) //getComputedStyle polyfill window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}) //http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}; //https://gist.github.com/991057 by Jed Schmidt with modifications function selector(a){ a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]); var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret; } //shallow object property extend function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c} function text_size(width, height, template) { var dimension_arr = [height, width].sort(); var maxFactor = Math.round(dimension_arr[1] / 16), minFactor = Math.round(dimension_arr[0] / 16); var text_height = Math.max(template.size, maxFactor); return { height: text_height } } function draw(ctx, dimensions, template, ratio) { var ts = text_size(dimensions.width, dimensions.height, template); var text_height = ts.height; var width = dimensions.width * ratio, height = dimensions.height * ratio; canvas.width = width; canvas.height = height; ctx.textAlign = "center"; ctx.textBaseline = "middle"; ctx.fillStyle = template.background; ctx.fillRect(0, 0, width, height); ctx.fillStyle = template.foreground; ctx.font = "bold " + text_height + "px sans-serif"; var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height); if (ctx.measureText(text).width / width > 1) { text_height = template.size / (ctx.measureText(text).width / width); } ctx.font = "bold " + (text_height * ratio) + "px sans-serif"; ctx.fillText(text, (width / 2), (height / 2), width); return canvas.toDataURL("image/png"); } function render(mode, el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var ratio = 1; if(window.devicePixelRatio && window.devicePixelRatio > 1){ ratio = window.devicePixelRatio; } if (mode == "image") { el.setAttribute("data-src", src); el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); el.style.width = dimensions.width + "px"; el.style.height = dimensions.height + "px"; if (fallback) { el.style.backgroundColor = theme.background; } else{ el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); } } else { if (!fallback) { el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; el.style.backgroundSize = dimensions.width+"px "+dimensions.height+"px"; } } }; function fluid(el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var fluid = document.createElement("table"); fluid.setAttribute("cellspacing",0) fluid.setAttribute("cellpadding",0) fluid.setAttribute("border",0) var row = document.createElement("tr") .appendChild(document.createElement("td") .appendChild(document.createTextNode(theme.text))); fluid.style.backgroundColor = theme.background; fluid.style.color = theme.foreground; fluid.className = el.className + " holderjs-fluid"; fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%")>0?"":"px"); fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px"); fluid.id = el.id; var frag = document.createDocumentFragment(), tbody = document.createElement("tbody"), tr = document.createElement("tr"), td = document.createElement("td"); tr.appendChild(td); tbody.appendChild(tr); frag.appendChild(tbody); if (theme.text) { td.appendChild(document.createTextNode(theme.text)) fluid.appendChild(frag); } else { td.appendChild(document.createTextNode(dimensions_caption)) fluid.appendChild(frag); fluid_images.push(fluid); setTimeout(fluid_update, 0); } el.parentNode.replaceChild(fluid, el); } function fluid_update() { for (i in fluid_images) { var el = fluid_images[i]; var label = el.getElementsByTagName("td")[0].firstChild; label.data = el.offsetWidth + "x" + el.offsetHeight; } } function parse_flags(flags, options) { var ret = { theme: settings.themes.gray }, render = false; for (sl = flags.length, j = 0; j < sl; j++) { var flag = flags[j]; if (app.flags.dimensions.match(flag)) { render = true; ret.dimensions = app.flags.dimensions.output(flag); } else if (app.flags.fluid.match(flag)) { render = true; ret.dimensions = app.flags.fluid.output(flag); ret.fluid = true; } else if (app.flags.colors.match(flag)) { ret.theme = app.flags.colors.output(flag); } else if (options.themes[flag]) { //If a theme is specified, it will override custom colors ret.theme = options.themes[flag]; } else if (app.flags.text.match(flag)) { ret.text = app.flags.text.output(flag); } } return render ? ret : false; }; if (!canvas.getContext) { fallback = true; } else { if (canvas.toDataURL("image/png") .indexOf("data:image/png") < 0) { //Android doesn't support data URI fallback = true; } else { var ctx = canvas.getContext("2d"); } } var fluid_images = []; var settings = { domain: "holder.js", images: "img", elements: ".holderjs", themes: { "gray": { background: "#eee", foreground: "#aaa", size: 12 }, "social": { background: "#3a5a97", foreground: "#fff", size: 12 }, "industrial": { background: "#434A52", foreground: "#C2F200", size: 12 } }, stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;border-collapse:collapse;border:0;vertical-align:middle;margin:0}" }; app.flags = { dimensions: { regex: /(\d+)x(\d+)/, output: function (val) { var exec = this.regex.exec(val); return { width: +exec[1], height: +exec[2] } } }, fluid: { regex: /([0-9%]+)x([0-9%]+)/, output: function (val) { var exec = this.regex.exec(val); return { width: exec[1], height: exec[2] } } }, colors: { regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, output: function (val) { var exec = this.regex.exec(val); return { size: settings.themes.gray.size, foreground: "#" + exec[2], background: "#" + exec[1] } } }, text: { regex: /text\:(.*)/, output: function (val) { return this.regex.exec(val)[1]; } } } for (var flag in app.flags) { app.flags[flag].match = function (val) { return val.match(this.regex) } } app.add_theme = function (name, theme) { name != null && theme != null && (settings.themes[name] = theme); return app; }; app.add_image = function (src, el) { var node = selector(el); if (node.length) { for (var i = 0, l = node.length; i < l; i++) { var img = document.createElement("img") img.setAttribute("data-src", src); node[i].appendChild(img); } } return app; }; app.run = function (o) { var options = extend(settings, o), images_nodes = selector(options.images), elements = selector(options.elements), preempted = true, images = []; for (i = 0, l = images_nodes.length; i < l; i++) images.push(images_nodes[i]); var holdercss = document.createElement("style"); holdercss.type = "text/css"; holdercss.styleSheet ? holdercss.styleSheet.cssText = options.stylesheet : holdercss.textContent = options.stylesheet; document.getElementsByTagName("head")[0].appendChild(holdercss); var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); for (var l = elements.length, i = 0; i < l; i++) { var src = window.getComputedStyle(elements[i], null) .getPropertyValue("background-image"); var flags = src.match(cssregex); if (flags) { var holder = parse_flags(flags[1].split("/"), options); if (holder) { render("background", elements[i], holder, src); } } } for (var l = images.length, i = 0; i < l; i++) { var src = images[i].getAttribute("src") || images[i].getAttribute("data-src"); if (src != null && src.indexOf(options.domain) >= 0) { var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) .split("/"), options); if (holder) { if (holder.fluid) { fluid(images[i], holder, src); } else { render("image", images[i], holder, src); } } } } return app; }; contentLoaded(win, function () { if (window.addEventListener) { window.addEventListener("resize", fluid_update, false); window.addEventListener("orientationchange", fluid_update, false); } else { window.attachEvent("onresize", fluid_update) } preempted || app.run(); }); })(Holder, window);
JavaScript
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT // IT'S ALL JUST JUNK FOR OUR DOCS! // ++++++++++++++++++++++++++++++++++++++++++ !function ($) { $(function(){ var $window = $(window) // Disable certain links in docs $('section [href^=#]').click(function (e) { e.preventDefault() }) // side bar $('.bs-docs-sidenav').affix({ offset: { top: function () { return $window.width() <= 980 ? 290 : 210 } , bottom: 270 } }) // make code pretty window.prettyPrint && prettyPrint() // add-ons $('.add-on :checkbox').on('click', function () { var $this = $(this) , method = $this.attr('checked') ? 'addClass' : 'removeClass' $(this).parents('.add-on')[method]('active') }) // add tipsies to grid for scaffolding if ($('#gridSystem').length) { $('#gridSystem').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) } // tooltip demo $('.tooltip-demo').tooltip({ selector: "a[rel=tooltip]" }) $('.tooltip-test').tooltip() $('.popover-test').popover() // popover demo $("a[rel=popover]") .popover() .click(function(e) { e.preventDefault() }) // button state demo $('#fat-btn') .click(function () { var btn = $(this) btn.button('loading') setTimeout(function () { btn.button('reset') }, 3000) }) // carousel demo $('#myCarousel').carousel() // javascript build logic var inputsComponent = $("#components.download input") , inputsPlugin = $("#plugins.download input") , inputsVariables = $("#variables.download input") // toggle all plugin checkboxes $('#components.download .toggle-all').on('click', function (e) { e.preventDefault() inputsComponent.attr('checked', !inputsComponent.is(':checked')) }) $('#plugins.download .toggle-all').on('click', function (e) { e.preventDefault() inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) }) $('#variables.download .toggle-all').on('click', function (e) { e.preventDefault() inputsVariables.val('') }) // request built javascript $('.download-btn .btn').on('click', function () { var css = $("#components.download input:checked") .map(function () { return this.value }) .toArray() , js = $("#plugins.download input:checked") .map(function () { return this.value }) .toArray() , vars = {} , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] $("#variables.download input") .each(function () { $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) }) $.ajax({ type: 'POST' , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com' , dataType: 'jsonpi' , params: { js: js , css: css , vars: vars , img: img } }) }) }) // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { var url = opts.url; return { send: function(_, completeCallback) { var name = 'jQuery_iframe_' + jQuery.now() , iframe, form iframe = $('<iframe>') .attr('name', name) .appendTo('head') form = $('<form>') .attr('method', opts.type) // GET or POST .attr('action', url) .attr('target', name) $.each(opts.params, function(k, v) { $('<input>') .attr('type', 'hidden') .attr('name', k) .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) .appendTo(form) }) form.appendTo('body').submit() } } }) }(window.jQuery)
JavaScript
/* Holder - 1.6 - client side image placeholders (c) 2012 Ivan Malopinsky / http://imsky.co Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 Commercial use requires attribution. */ var Holder = Holder || {}; (function (app, win) { var preempted = false, fallback = false, canvas = document.createElement('canvas'); //getElementsByClassName polyfill document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s}) //getComputedStyle polyfill window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this}) //http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}}; //https://gist.github.com/991057 by Jed Schmidt with modifications function selector(a){ a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]); var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret; } //shallow object property extend function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c} function text_size(width, height, template) { var dimension_arr = [height, width].sort(); var maxFactor = Math.round(dimension_arr[1] / 16), minFactor = Math.round(dimension_arr[0] / 16); var text_height = Math.max(template.size, maxFactor); return { height: text_height } } function draw(ctx, dimensions, template, ratio) { var ts = text_size(dimensions.width, dimensions.height, template); var text_height = ts.height; var width = dimensions.width * ratio, height = dimensions.height * ratio; canvas.width = width; canvas.height = height; ctx.textAlign = "center"; ctx.textBaseline = "middle"; ctx.fillStyle = template.background; ctx.fillRect(0, 0, width, height); ctx.fillStyle = template.foreground; ctx.font = "bold " + text_height + "px sans-serif"; var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height); if (ctx.measureText(text).width / width > 1) { text_height = template.size / (ctx.measureText(text).width / width); } ctx.font = "bold " + (text_height * ratio) + "px sans-serif"; ctx.fillText(text, (width / 2), (height / 2), width); return canvas.toDataURL("image/png"); } function render(mode, el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var ratio = 1; if(window.devicePixelRatio && window.devicePixelRatio > 1){ ratio = window.devicePixelRatio; } if (mode == "image") { el.setAttribute("data-src", src); el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); el.style.width = dimensions.width + "px"; el.style.height = dimensions.height + "px"; if (fallback) { el.style.backgroundColor = theme.background; } else{ el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); } } else { if (!fallback) { el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; el.style.backgroundSize = dimensions.width+"px "+dimensions.height+"px"; } } }; function fluid(el, holder, src) { var dimensions = holder.dimensions, theme = holder.theme, text = holder.text; var dimensions_caption = dimensions.width + "x" + dimensions.height; theme = (text ? extend(theme, { text: text }) : theme); var fluid = document.createElement("table"); fluid.setAttribute("cellspacing",0) fluid.setAttribute("cellpadding",0) fluid.setAttribute("border",0) var row = document.createElement("tr") .appendChild(document.createElement("td") .appendChild(document.createTextNode(theme.text))); fluid.style.backgroundColor = theme.background; fluid.style.color = theme.foreground; fluid.className = el.className + " holderjs-fluid"; fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%")>0?"":"px"); fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px"); fluid.id = el.id; var frag = document.createDocumentFragment(), tbody = document.createElement("tbody"), tr = document.createElement("tr"), td = document.createElement("td"); tr.appendChild(td); tbody.appendChild(tr); frag.appendChild(tbody); if (theme.text) { td.appendChild(document.createTextNode(theme.text)) fluid.appendChild(frag); } else { td.appendChild(document.createTextNode(dimensions_caption)) fluid.appendChild(frag); fluid_images.push(fluid); setTimeout(fluid_update, 0); } el.parentNode.replaceChild(fluid, el); } function fluid_update() { for (i in fluid_images) { var el = fluid_images[i]; var label = el.getElementsByTagName("td")[0].firstChild; label.data = el.offsetWidth + "x" + el.offsetHeight; } } function parse_flags(flags, options) { var ret = { theme: settings.themes.gray }, render = false; for (sl = flags.length, j = 0; j < sl; j++) { var flag = flags[j]; if (app.flags.dimensions.match(flag)) { render = true; ret.dimensions = app.flags.dimensions.output(flag); } else if (app.flags.fluid.match(flag)) { render = true; ret.dimensions = app.flags.fluid.output(flag); ret.fluid = true; } else if (app.flags.colors.match(flag)) { ret.theme = app.flags.colors.output(flag); } else if (options.themes[flag]) { //If a theme is specified, it will override custom colors ret.theme = options.themes[flag]; } else if (app.flags.text.match(flag)) { ret.text = app.flags.text.output(flag); } } return render ? ret : false; }; if (!canvas.getContext) { fallback = true; } else { if (canvas.toDataURL("image/png") .indexOf("data:image/png") < 0) { //Android doesn't support data URI fallback = true; } else { var ctx = canvas.getContext("2d"); } } var fluid_images = []; var settings = { domain: "holder.js", images: "img", elements: ".holderjs", themes: { "gray": { background: "#eee", foreground: "#aaa", size: 12 }, "social": { background: "#3a5a97", foreground: "#fff", size: 12 }, "industrial": { background: "#434A52", foreground: "#C2F200", size: 12 } }, stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;border-collapse:collapse;border:0;vertical-align:middle;margin:0}" }; app.flags = { dimensions: { regex: /(\d+)x(\d+)/, output: function (val) { var exec = this.regex.exec(val); return { width: +exec[1], height: +exec[2] } } }, fluid: { regex: /([0-9%]+)x([0-9%]+)/, output: function (val) { var exec = this.regex.exec(val); return { width: exec[1], height: exec[2] } } }, colors: { regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, output: function (val) { var exec = this.regex.exec(val); return { size: settings.themes.gray.size, foreground: "#" + exec[2], background: "#" + exec[1] } } }, text: { regex: /text\:(.*)/, output: function (val) { return this.regex.exec(val)[1]; } } } for (var flag in app.flags) { app.flags[flag].match = function (val) { return val.match(this.regex) } } app.add_theme = function (name, theme) { name != null && theme != null && (settings.themes[name] = theme); return app; }; app.add_image = function (src, el) { var node = selector(el); if (node.length) { for (var i = 0, l = node.length; i < l; i++) { var img = document.createElement("img") img.setAttribute("data-src", src); node[i].appendChild(img); } } return app; }; app.run = function (o) { var options = extend(settings, o), images_nodes = selector(options.images), elements = selector(options.elements), preempted = true, images = []; for (i = 0, l = images_nodes.length; i < l; i++) images.push(images_nodes[i]); var holdercss = document.createElement("style"); holdercss.type = "text/css"; holdercss.styleSheet ? holdercss.styleSheet.cssText = options.stylesheet : holdercss.textContent = options.stylesheet; document.getElementsByTagName("head")[0].appendChild(holdercss); var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); for (var l = elements.length, i = 0; i < l; i++) { var src = window.getComputedStyle(elements[i], null) .getPropertyValue("background-image"); var flags = src.match(cssregex); if (flags) { var holder = parse_flags(flags[1].split("/"), options); if (holder) { render("background", elements[i], holder, src); } } } for (var l = images.length, i = 0; i < l; i++) { var src = images[i].getAttribute("src") || images[i].getAttribute("data-src"); if (src != null && src.indexOf(options.domain) >= 0) { var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) .split("/"), options); if (holder) { if (holder.fluid) { fluid(images[i], holder, src); } else { render("image", images[i], holder, src); } } } } return app; }; contentLoaded(win, function () { if (window.addEventListener) { window.addEventListener("resize", fluid_update, false); window.addEventListener("orientationchange", fluid_update, false); } else { window.attachEvent("onresize", fluid_update) } preempted || app.run(); }); })(Holder, window);
JavaScript
window.onload = function() { var copyP = document.createElement( 'p' ) ; copyP.className = 'copyright' ; copyP.innerHTML = '&copy; 2007-2011 <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben . All rights reserved.<br /><br />' ; document.body.appendChild( document.createElement( 'hr' ) ) ; document.body.appendChild( copyP ) ; window.top.SetActiveTopic( window.location.pathname ) ; }
JavaScript
window.onload = function() { var copyP = document.createElement( 'p' ) ; copyP.className = 'copyright' ; copyP.innerHTML = '&copy; 2007-2011 <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben . Todos los derechos reservados.<br /><br />' ; document.body.appendChild( document.createElement( 'hr' ) ) ; document.body.appendChild( copyP ) ; window.top.SetActiveTopic( window.location.pathname ) ; }
JavaScript
window.onload = function() { var copyP = document.createElement( 'p' ) ; copyP.className = 'copyright' ; copyP.innerHTML = '&copy; 2007-2011 <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben . Todos los derechos reservados.<br /><br />' ; document.body.appendChild( document.createElement( 'hr' ) ) ; document.body.appendChild( copyP ) ; window.top.SetActiveTopic( window.location.pathname ) ; }
JavaScript
window.onload = function() { var copyP = document.createElement( 'p' ) ; copyP.className = 'copyright' ; copyP.innerHTML = '&copy; 2007-2011 <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben . Kaikki oikeudet pidätetään.<br /><br />' ; document.body.appendChild( document.createElement( 'hr' ) ) ; document.body.appendChild( copyP ) ; window.top.SetActiveTopic( window.location.pathname ) ; }
JavaScript
window.onload = function() { var copyP = document.createElement( 'p' ) ; copyP.className = 'copyright' ; copyP.innerHTML = '&copy; 2007-2011 <a href="http://cksource.com" target="_blank">CKSource</a> - Frederico Knabben . Wszystkie prawa zastrzeżone.<br /><br />' ; document.body.appendChild( document.createElement( 'hr' ) ) ; document.body.appendChild( copyP ) ; window.top.SetActiveTopic( window.location.pathname ) ; }
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['nl'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'nl', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'm/d/yyyy h:MM aa', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mappen', FolderLoading : 'Laden...', FolderNew : 'Vul de mapnaam in: ', FolderRename : 'Vul de nieuwe mapnaam in: ', FolderDelete : 'Weet je het zeker dat je de map "%1" wilt verwijderen?', FolderRenaming : ' (Aanpassen...)', FolderDeleting : ' (Verwijderen...)', // Files FileRename : 'Vul de nieuwe bestandsnaam in: ', FileRenameExt : 'Weet je zeker dat je de extensie wilt veranderen? Het bestand kan onbruikbaar worden.', FileRenaming : 'Aanpassen...', FileDelete : 'Weet je zeker dat je het bestand "%1" wilt verwijderen?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Uploaden', UploadTip : 'Nieuw bestand uploaden', Refresh : 'Vernieuwen', Settings : 'Instellingen', Help : 'Help', HelpTip : 'Help', // Context Menus Select : 'Selecteer', SelectThumbnail : 'Selecteer miniatuur afbeelding', View : 'Weergave', Download : 'Downloaden', NewSubFolder : 'Nieuwe subfolder', Rename : 'Hernoemen', Delete : 'Verwijderen', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Annuleren', CloseBtn : 'Sluiten', // Upload Panel UploadTitle : 'Nieuw bestand uploaden', UploadSelectLbl : 'Selecteer het bestand om te uploaden', UploadProgressLbl : '(Bezig met uploaden, even geduld...)', UploadBtn : 'Upload geselecteerde bestand', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Kies een bestand van je computer.', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Instellingen', SetView : 'Bekijken:', SetViewThumb : 'Miniatuur afbeelding', SetViewList : 'Lijst', SetDisplay : 'Weergeef:', SetDisplayName : 'Bestandsnaam', SetDisplayDate : 'Datum', SetDisplaySize : 'Bestandsgrootte', SetSort : 'Sorteren op:', SetSortName : 'Op bestandsnaam', SetSortDate : 'Op datum', SetSortSize : 'Op grootte', // Status Bar FilesCountEmpty : '<Lege map>', FilesCountOne : '1 bestand', FilesCountMany : '%1 bestanden', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Het was niet mogelijk om deze actie uit te voeren. (Fout %1)', Errors : { 10 : 'Ongeldige commando.', 11 : 'De bestandstype komt niet voor in de aanvraag.', 12 : 'De gevraagde brontype is niet geldig.', 102 : 'Ongeldig bestands- of mapnaam.', 103 : 'Het verzoek kon niet worden voltooid vanwege autorisatie beperkingen.', 104 : 'Het verzoek kon niet worden voltooid door beperkingen in de permissies van het bestandssysteem.', 105 : 'Ongeldige bestandsextensie.', 109 : 'Ongeldige aanvraag.', 110 : 'Onbekende fout.', 115 : 'Er bestaat al een bestand of map met deze naam.', 116 : 'Map niet gevonden, vernieuw de mappenlijst of kies een andere map.', 117 : 'Bestand niet gevonden, vernieuw de mappenlijst of kies een andere folder.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Er bestaat al een bestand met dezelfde naam. Het geüploade bestand is hernoemd naar: "%1"', 202 : 'Ongeldige bestand', 203 : 'Ongeldige bestand. Het bestand is te groot.', 204 : 'De geüploade file is kapot.', 205 : 'Er is geen hoofdmap gevonden.', 206 : 'Het uploaden van het bestand is om veiligheidsredenen afgebroken. Er is HTML in het bestand aangetroffen.', 207 : 'Het geuploade bestand is hernoemd naar: "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Het uploaden van een bestand is momenteel niet mogelijk. Contacteer de beheerder en controleer het CKFinder configuratiebestand..', 501 : 'De ondersteuning voor miniatuur afbeeldingen is uitgeschakeld.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'De bestandsnaam mag niet leeg zijn.', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'De mapnaam mag niet leeg zijn.', FileInvChar : 'De bestandsnaam mag niet de volgende tekens bevatten: \n\\ / : * ? " < > |', FolderInvChar : 'De folder mag niet de volgende tekens bevatten: \n\\ / : * ? " < > |', PopupBlockView : 'Het was niet mogelijk om dit bestand in een nieuw venster te openen. Configureer de browser zo dat het de popups van deze website niet blokkeert.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Italian * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['it'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', cancel : 'Annulla', confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Annulla', redo : 'Ripristina', skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', HelpLang : 'en', LangCode : 'it', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Cartelle', FolderLoading : 'Caricando...', FolderNew : 'Nome della cartella: ', FolderRename : 'Nuovo nome della cartella: ', FolderDelete : 'Se sicuro di voler eliminare la cartella "%1"?', FolderRenaming : ' (Rinominando...)', FolderDeleting : ' (Eliminando...)', // Files FileRename : 'Nuovo nome del file: ', FileRenameExt : 'Sei sicure di voler cambiare la estensione del file? Il file può risultare inusabile', FileRenaming : 'Rinominando...', FileDelete : 'Sei sicuro di voler eliminare il file "%1"?', FilesLoading : 'Caricamento in corso...', FilesEmpty : 'Cartella vuota', FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Upload', UploadTip : 'Carica Nuovo File', Refresh : 'Aggiorna', Settings : 'Configurazioni', Help : 'Aiuto', HelpTip : 'Aiuto (Inglese)', // Context Menus Select : 'Seleziona', SelectThumbnail : 'Seleziona la miniatura', View : 'Vedi', Download : 'Scarica', NewSubFolder : 'Nuova Sottocartella', Rename : 'Rinomina', Delete : 'Elimina', CopyDragDrop : 'Copia file qui', MoveDragDrop : 'Muove file qui', // Dialogs RenameDlgTitle : 'Rinomina', NewNameDlgTitle : 'Nuovo nome', FileExistsDlgTitle : 'Il file già esiste', SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Sovrascrivere', FileAutorename : 'Rinomina automaticamente', // Generic OkBtn : 'OK', CancelBtn : 'Anulla', CloseBtn : 'Chiudi', // Upload Panel UploadTitle : 'Carica Nuovo File', UploadSelectLbl : 'Seleziona il file', UploadProgressLbl : '(Caricamento in corso, attendere prego...)', UploadBtn : 'Carica File', UploadBtnCancel : 'Annulla', UploadNoFileMsg : 'Seleziona il file da caricare', UploadNoFolder : 'Seleziona il file prima di caricare.', UploadNoPerms : 'Non è permesso il caricamento di file.', UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'In questa cartella non sono permessi file con questa estensione.', // Settings Panel SetTitle : 'Configurazioni', SetView : 'Vedi:', SetViewThumb : 'Anteprima', SetViewList : 'Lista', SetDisplay : 'Informazioni:', SetDisplayName : 'Nome del File', SetDisplayDate : 'Data', SetDisplaySize : 'Dimensione', SetSort : 'Ordina:', SetSortName : 'per Nome', SetSortDate : 'per Data', SetSortSize : 'per Dimensione', // Status Bar FilesCountEmpty : '<Nessun file>', FilesCountOne : '1 file', FilesCountMany : '%1 file', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Impossibile completare la richiesta. (Errore %1)', Errors : { 10 : 'Commando non valido.', 11 : 'Il tipo di risorsa non è stato specificato nella richiesta.', 12 : 'Il tipo di risorsa richiesto non è valido.', 102 : 'Nome di file o cartella non valido.', 103 : 'Non è stato possibile completare la richiesta a causa di restrizioni di autorizazione.', 104 : 'Non è stato possibile completare la richiesta a causa di restrizioni nei permessi del file system.', 105 : 'L\'estensione del file non è valida.', 109 : 'Richiesta invalida.', 110 : 'Errore sconosciuto.', 115 : 'Un file o cartella con lo stesso nome è già esistente.', 116 : 'Cartella non trovata. Prego aggiornare e riprovare.', 117 : 'File non trovato. Prego aggirnare la lista dei file e riprovare.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Un file con lo stesso nome è già disponibile. Il file caricato è stato rinominato in "%1".', 202 : 'File invalido', 203 : 'File invalido. La dimensione del file eccede i limiti del sistema.', 204 : 'Il file caricato è corrotto.', 205 : 'Il folder temporario non è disponibile new server.', 206 : 'Upload annullato per motivi di sicurezza. Il file contiene dati in formatto HTML.', 207 : 'El fichero subido ha sido renombrado como "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Questo programma è disabilitato per motivi di sicurezza. Prego contattare l\'amministratore del sistema e verificare le configurazioni di CKFinder.', 501 : 'Il supporto alle anteprime non è attivo.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Il nome del file non può essere vuoto', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Il nome della cartella non può essere vuoto', FileInvChar : 'I seguenti caratteri non possono essere usati per comporre il nome del file: \n\\ / : * ? " < > |', FolderInvChar : 'I seguenti caratteri non possono essere usati per comporre il nome della cartella: \n\\ / : * ? " < > |', PopupBlockView : 'Non è stato possile aprire il file in una nuova finestra. Prego configurare il browser e disabilitare i blocchi delle popup.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Ridimensiona %s', sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Piccolo (%s)', thumbnailMedium : 'Medio (%s)', thumbnailLarge : 'Grande (%s)', newSize : 'Nuove dimensioni', width : 'Larghezza', height : 'Altezza', invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Crea nuova immagine', noExtensionChange : 'L\'estensione del file non può essere cambiata.', imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Ridimensiona' }, // Fileeditor plugin Fileeditor : { save : 'Salva', fileOpenError : 'Non è stato possibile aprire il file.', fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Modifica', loadingFile : 'Attendere prego. Caricamento del file in corso...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the German * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['de'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'de', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'd.m.yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Verzeichnisse', FolderLoading : 'Laden...', FolderNew : 'Bitte geben Sie den neuen Verzeichnisnamen an: ', FolderRename : 'Bitte geben Sie den neuen Verzeichnisnamen an: ', FolderDelete : 'Wollen Sie wirklich den Ordner "%1" löschen?', FolderRenaming : ' (Umbenennen...)', FolderDeleting : ' (Löschen...)', // Files FileRename : 'Bitte geben Sie den neuen Dateinamen an: ', FileRenameExt : 'Wollen Sie wirklich die Dateierweiterung ändern? Die Datei könnte unbrauchbar werden!', FileRenaming : 'Umbennenen...', FileDelete : 'Wollen Sie wirklich die Datei "%1" löschen?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Hochladen', UploadTip : 'Neue Datei hochladen', Refresh : 'Aktualisieren', Settings : 'Einstellungen', Help : 'Hilfe', HelpTip : 'Hilfe', // Context Menus Select : 'Auswählen', SelectThumbnail : 'Miniatur auswählen', View : 'Ansehen', Download : 'Herunterladen', NewSubFolder : 'Neues Unterverzeichnis', Rename : 'Umbenennen', Delete : 'Löschen', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Abbrechen', CloseBtn : 'Schließen', // Upload Panel UploadTitle : 'Neue Datei hochladen', UploadSelectLbl : 'Bitte wählen Sie die Datei aus', UploadProgressLbl : '(Die Daten werden übertragen, bitte warten...)', UploadBtn : 'Ausgewählte Datei hochladen', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Bitte wählen Sie eine Datei auf Ihrem Computer aus', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Einstellungen', SetView : 'Ansicht:', SetViewThumb : 'Miniaturansicht', SetViewList : 'Liste', SetDisplay : 'Anzeige:', SetDisplayName : 'Dateiname', SetDisplayDate : 'Datum', SetDisplaySize : 'Dateigröße', SetSort : 'Sortierung:', SetSortName : 'nach Dateinamen', SetSortDate : 'nach Datum', SetSortSize : 'nach Größe', // Status Bar FilesCountEmpty : '<Leeres Verzeichnis>', FilesCountOne : '1 Datei', FilesCountMany : '%1 Datei', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Ihre Anfrage konnte nicht bearbeitet werden. (Fehler %1)', Errors : { 10 : 'Unbekannter Befehl.', 11 : 'Der Ressourcentyp wurde nicht spezifiziert.', 12 : 'Der Ressourcentyp ist nicht gültig.', 102 : 'Ungültiger Datei oder Verzeichnisname.', 103 : 'Ihre Anfrage konnte wegen Authorisierungseinschränkungen nicht durchgeführt werden.', 104 : 'Ihre Anfrage konnte wegen Dateisystemeinschränkungen nicht durchgeführt werden.', 105 : 'Invalid file extension.', 109 : 'Unbekannte Anfrage.', 110 : 'Unbekannter Fehler.', 115 : 'Es existiert bereits eine Datei oder ein Ordner mit dem gleichen Namen.', 116 : 'Verzeichnis nicht gefunden. Bitte aktualisieren Sie die Anzeige und versuchen es noch einmal.', 117 : 'Datei nicht gefunden. Bitte aktualisieren Sie die Dateiliste und versuchen es noch einmal.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Es existiert bereits eine Datei unter gleichem Namen. Die hochgeladene Datei wurde unter "%1" gespeichert.', 202 : 'Ungültige Datei', 203 : 'ungültige Datei. Die Dateigröße ist zu groß.', 204 : 'Die hochgeladene Datei ist korrupt.', 205 : 'Es existiert kein temp. Ordner für das Hochladen auf den Server.', 206 : 'Das Hochladen wurde aus Sicherheitsgründen abgebrochen. Die Datei enthält HTML-Daten.', 207 : 'Die hochgeladene Datei wurde unter "%1" gespeichert.', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Der Dateibrowser wurde aus Sicherheitsgründen deaktiviert. Bitte benachrichtigen Sie Ihren Systemadministrator und prüfen Sie die Konfigurationsdatei.', 501 : 'Die Miniaturansicht wurde deaktivert.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Der Dateinamen darf nicht leer sein', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Der Verzeichnisname darf nicht leer sein', FileInvChar : 'Der Dateinamen darf nicht eines der folgenden Zeichen enthalten: \n\\ / : * ? " < > |', FolderInvChar : 'Der Verzeichnisname darf nicht eines der folgenden Zeichen enthalten: \n\\ / : * ? " < > |', PopupBlockView : 'Die Datei konnte nicht in einem neuen Fenster geöffnet werden. Bitte deaktivieren Sie in Ihrem Browser alle Popup-Blocker für diese Seite.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Polish * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['pl'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, wyłączone</span>', confirmCancel : 'Pewne opcje zostały zmienione. Czy na pewno zamknąć okno dialogowe?', ok : 'OK', cancel : 'Anuluj', confirmationTitle : 'Potwierdzenie', messageTitle : 'Informacja', inputTitle : 'Pytanie', undo : 'Cofnij', redo : 'Ponów', skip : 'Pomiń', skipAll : 'Pomiń wszystkie', makeDecision : 'Wybierz jedną z opcji:', rememberDecision: 'Zapamiętaj mój wybór' }, dir : 'ltr', HelpLang : 'pl', LangCode : 'pl', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'yyyy-mm-dd HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Katalogi', FolderLoading : 'Ładowanie...', FolderNew : 'Podaj nazwę nowego katalogu: ', FolderRename : 'Podaj nową nazwę katalogu: ', FolderDelete : 'Czy na pewno chcesz usunąć katalog "%1"?', FolderRenaming : ' (Zmieniam nazwę...)', FolderDeleting : ' (Kasowanie...)', // Files FileRename : 'Podaj nową nazwę pliku: ', FileRenameExt : 'Czy na pewno chcesz zmienić rozszerzenie pliku? Może to spowodować problemy z otwieraniem pliku przez innych użytkowników', FileRenaming : 'Zmieniam nazwę...', FileDelete : 'Czy na pewno chcesz usunąć plik "%1"?', FilesLoading : 'Ładowanie...', FilesEmpty : 'Katalog jest pusty', FilesMoved : 'Plik %1 został przeniesiony do %2:%3', FilesCopied : 'Plik %1 został skopiowany do %2:%3', // Basket BasketFolder : 'Koszyk', BasketClear : 'Wyczyść koszyk', BasketRemove : 'Usuń z koszyka', BasketOpenFolder : 'Otwórz katalog z plikiem', BasketTruncateConfirm : 'Czy naprawdę chcesz usunąć wszystkie pliki z koszyka?', BasketRemoveConfirm : 'Czy naprawdę chcesz usunąć plik "%1" z koszyka?', BasketEmpty : 'Brak plików w koszyku, aby dodać plik, przeciągnij i upuść (drag\'n\'drop) dowolny plik do koszyka.', BasketCopyFilesHere : 'Skopiuj pliki z koszyka', BasketMoveFilesHere : 'Przenieś pliki z koszyka', BasketPasteErrorOther : 'Plik: %s błąd: %e', BasketPasteMoveSuccess : 'Następujące pliki zostały przeniesione: %s', BasketPasteCopySuccess : 'Następujące pliki zostały skopiowane: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Wyślij', UploadTip : 'Wyślij plik', Refresh : 'Odśwież', Settings : 'Ustawienia', Help : 'Pomoc', HelpTip : 'Wskazówka', // Context Menus Select : 'Wybierz', SelectThumbnail : 'Wybierz miniaturkę', View : 'Zobacz', Download : 'Pobierz', NewSubFolder : 'Nowy podkatalog', Rename : 'Zmień nazwę', Delete : 'Usuń', CopyDragDrop : 'Skopiuj tutaj plik', MoveDragDrop : 'Przenieś tutaj plik', // Dialogs RenameDlgTitle : 'Zmiana nazwy', NewNameDlgTitle : 'Nowa nazwa', FileExistsDlgTitle : 'Plik już istnieje', SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Nadpisz', FileAutorename : 'Zmień automatycznie nazwę', // Generic OkBtn : 'OK', CancelBtn : 'Anuluj', CloseBtn : 'Zamknij', // Upload Panel UploadTitle : 'Wyślij plik', UploadSelectLbl : 'Wybierz plik', UploadProgressLbl : '(Trwa wysyłanie pliku, proszę czekać...)', UploadBtn : 'Wyślij wybrany plik', UploadBtnCancel : 'Anuluj', UploadNoFileMsg : 'Wybierz plik ze swojego komputera', UploadNoFolder : 'Wybierz katalog przed wysłaniem pliku.', UploadNoPerms : 'Wysyłanie plików nie jest dozwolone.', UploadUnknError : 'Błąd podczas wysyłania pliku.', UploadExtIncorrect : 'Rozszerzenie pliku nie jest dozwolone w tym katalogu.', // Settings Panel SetTitle : 'Ustawienia', SetView : 'Widok:', SetViewThumb : 'Miniaturki', SetViewList : 'Lista', SetDisplay : 'Wyświetlanie:', SetDisplayName : 'Nazwa pliku', SetDisplayDate : 'Data', SetDisplaySize : 'Rozmiar pliku', SetSort : 'Sortowanie:', SetSortName : 'wg nazwy pliku', SetSortDate : 'wg daty', SetSortSize : 'wg rozmiaru', // Status Bar FilesCountEmpty : '<Pusty katalog>', FilesCountOne : '1 plik', FilesCountMany : 'Ilość plików: %1', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Wykonanie operacji zakończyło się niepowodzeniem. (Błąd %1)', Errors : { 10 : 'Nieprawidłowe polecenie (command).', 11 : 'Brak wymaganego parametru: źródło danych (type).', 12 : 'Nieprawidłowe źródło danych (type).', 102 : 'Nieprawidłowa nazwa pliku lub katalogu.', 103 : 'Wykonanie operacji nie jest możliwe: brak autoryzacji.', 104 : 'Wykonanie operacji nie powiodło się z powodu niewystarczających uprawnień do systemu plików.', 105 : 'Nieprawidłowe rozszerzenie.', 109 : 'Nieprawiłowe polecenie.', 110 : 'Niezidentyfikowany błąd.', 115 : 'Plik lub katalog o podanej nazwie już istnieje.', 116 : 'Nie znaleziono katalogu. Odśwież panel i spróbuj ponownie.', 117 : 'Nie znaleziono pliku. Odśwież listę plików i spróbuj ponownie.', 118 : 'Ścieżki źródłowa i docelowa są jednakowe.', 201 : 'Plik o podanej nazwie już istnieje. Nazwa przesłanego pliku została zmieniona na "%1"', 202 : 'Nieprawidłowy plik.', 203 : 'Nieprawidłowy plik. Plik przekroczył dozwolony rozmiar.', 204 : 'Przesłany plik jest uszkodzony.', 205 : 'Brak folderu tymczasowego na serwerze do przesyłania plików.', 206 : 'Przesyłanie pliku zakończyło się niepowodzeniem z powodów bezpieczeństwa. Plik zawiera dane przypominające HTML.', 207 : 'Nazwa przesłanego pliku została zmieniona na "%1"', 300 : 'Przenoszenie nie powiodło się.', 301 : 'Kopiowanie nie powiodo się.', 500 : 'Menedżer plików jest wyłączony z powodów bezpieczeństwa. Skontaktuj się z administratorem oraz sprawdź plik konfiguracyjny CKFindera.', 501 : 'Tworzenie miniaturek jest wyłączone.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Nazwa pliku nie może być pusta', FileExists : 'Plik %s już istnieje', FolderEmpty : 'Nazwa katalogu nie może być pusta', FileInvChar : 'Nazwa pliku nie może zawierać żadnego z podanych znaków: \n\\ / : * ? " < > |', FolderInvChar : 'Nazwa katalogu nie może zawierać żadnego z podanych znaków: \n\\ / : * ? " < > |', PopupBlockView : 'Otwarcie pliku w nowym oknie nie powiodło się. Proszę zmienić konfigurację przeglądarki i wyłączyć wszelkie blokady okienek popup dla tej strony.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Zmiana rozmiaru %s', sizeTooBig : 'Nie możesz zmienić wysokości lub szerokości na wartośc wyższą niż oryginalny rozmiar (%size).', resizeSuccess : 'Obrazek został pomyślnie przeskalowany.', thumbnailNew : 'Utwórz nową miniaturkę', thumbnailSmall : 'Mały (%s)', thumbnailMedium : 'Średni (%s)', thumbnailLarge : 'Duży (%s)', newSize : 'Podaj nowe wymiary', width : 'Szerokość', height : 'Wysokość', invalidHeight : 'Nieprawidłowa wysokość.', invalidWidth : 'Nieprawidłowa szerokość.', invalidName : 'Nieprawidłowa nazwa pliku.', newImage : 'Utwórz nowy obrazek', noExtensionChange : 'Rozszerzenie pliku nie może zostac zmienione.', imageSmall : 'Plik źródłowy jest zbyt mały', contextMenuName : 'Zmień rozmiar' }, // Fileeditor plugin Fileeditor : { save : 'Zapisz', fileOpenError : 'Nie udało się otworzyć pliku.', fileSaveSuccess : 'Plik został zapisany pomyślnie.', contextMenuName : 'Edytuj', loadingFile : 'Trwa ładowanie pliku, proszę czekać...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['hu'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'hu', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'yyyy. m. d. HH:MM', DateAmPm : ['de.', 'du.'], // Folders FoldersTitle : 'Mappák', FolderLoading : 'Betöltés...', FolderNew : 'Kérjük adja meg a mappa nevét: ', FolderRename : 'Kérjük adja meg a mappa új nevét: ', FolderDelete : 'Biztosan törölni szeretné a következő mappát: "%1"?', FolderRenaming : ' (átnevezés...)', FolderDeleting : ' (törlés...)', // Files FileRename : 'Kérjük adja meg a fájl új nevét: ', FileRenameExt : 'Biztosan szeretné módosítani a fájl kiterjesztését? A fájl esetleg használhatatlan lesz.', FileRenaming : 'Átnevezés...', FileDelete : 'Biztosan törölni szeretné a következő fájlt: "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Feltöltés', UploadTip : 'Új fájl feltöltése', Refresh : 'Frissítés', Settings : 'Beállítások', Help : 'Súgó', HelpTip : 'Súgó (angolul)', // Context Menus Select : 'Kiválaszt', SelectThumbnail : 'Bélyegkép kiválasztása', View : 'Megtekintés', Download : 'Letöltés', NewSubFolder : 'Új almappa', Rename : 'Átnevezés', Delete : 'Törlés', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Mégsem', CloseBtn : 'Bezárás', // Upload Panel UploadTitle : 'Új fájl feltöltése', UploadSelectLbl : 'Válassza ki a feltölteni kívánt fájlt', UploadProgressLbl : '(A feltöltés folyamatban, kérjük várjon...)', UploadBtn : 'A kiválasztott fájl feltöltése', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Kérjük válassza ki a fájlt a számítógépéről', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Beállítások', SetView : 'Nézet:', SetViewThumb : 'bélyegképes', SetViewList : 'listás', SetDisplay : 'Megjelenik:', SetDisplayName : 'fájl neve', SetDisplayDate : 'dátum', SetDisplaySize : 'fájlméret', SetSort : 'Rendezés:', SetSortName : 'fájlnév', SetSortDate : 'dátum', SetSortSize : 'méret', // Status Bar FilesCountEmpty : '<üres mappa>', FilesCountOne : '1 fájl', FilesCountMany : '%1 fájl', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'A parancsot nem sikerült végrehajtani. (Hiba: %1)', Errors : { 10 : 'Érvénytelen parancs.', 11 : 'A fájl típusa nem lett a kérés során beállítva.', 12 : 'A kívánt fájl típus érvénytelen.', 102 : 'Érvénytelen fájl vagy könyvtárnév.', 103 : 'Hitelesítési problémák miatt nem sikerült a kérést teljesíteni.', 104 : 'Jogosultsági problémák miatt nem sikerült a kérést teljesíteni.', 105 : 'Érvénytelen fájl kiterjesztés.', 109 : 'Érvénytelen kérés.', 110 : 'Ismeretlen hiba.', 115 : 'A fálj vagy mappa már létezik ezen a néven.', 116 : 'Mappa nem található. Kérjük frissítsen és próbálja újra.', 117 : 'Fájl nem található. Kérjük frissítsen és próbálja újra.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Ilyen nevű fájl már létezett. A feltöltött fájl a következőre lett átnevezve: "%1"', 202 : 'Érvénytelen fájl', 203 : 'Érvénytelen fájl. A fájl mérete túl nagy.', 204 : 'A feltöltött fájl hibás.', 205 : 'A szerveren nem található a feltöltéshez ideiglenes mappa.', 206 : 'A feltöltés biztonsági okok miatt meg lett szakítva. The file contains HTML like data.', 207 : 'El fichero subido ha sido renombrado como "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'A fájl-tallózó biztonsági okok miatt nincs engedélyezve. Kérjük vegye fel a kapcsolatot a rendszer üzemeltetőjével és ellenőrizze a CKFinder konfigurációs fájlt.', 501 : 'A bélyegkép támogatás nincs engedélyezve.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'A fájl neve nem lehet üres', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'A mappa neve nem lehet üres', FileInvChar : 'A fájl neve nem tartalmazhatja a következő karaktereket: \n\\ / : * ? " < > |', FolderInvChar : 'A mappa neve nem tartalmazhatja a következő karaktereket: \n\\ / : * ? " < > |', PopupBlockView : 'A felugró ablak megnyitása nem sikerült. Kérjük ellenőrizze a böngészője beállításait és tiltsa le a felugró ablakokat blokkoló alkalmazásait erre a honlapra.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Russian * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['ru'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, недоступно</span>', confirmCancel : 'Внесенные вами изменения будут утеряны. Вы уверены?', ok : 'OK', cancel : 'Отмена', confirmationTitle : 'Подтверждение', messageTitle : 'Информация', inputTitle : 'Вопрос', undo : 'Отменить', redo : 'Повторить', skip : 'Пропустить', skipAll : 'Пропустить все', makeDecision : 'Что следует сделать?', rememberDecision: 'Запомнить мой выбор' }, dir : 'ltr', HelpLang : 'en', LangCode : 'ru', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd.mm.yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Папки', FolderLoading : 'Загрузка...', FolderNew : 'Пожалуйста, введите новое имя папки: ', FolderRename : 'Пожалуйста, введите новое имя папки: ', FolderDelete : 'Вы уверены, что хотите удалить папку "%1"?', FolderRenaming : ' (Переименовываю...)', FolderDeleting : ' (Удаляю...)', // Files FileRename : 'Пожалуйста, введите новое имя файла: ', FileRenameExt : 'Вы уверены, что хотите изменить расширение файла? Файл может стать недоступным', FileRenaming : 'Переименовываю...', FileDelete : 'Вы уверены, что хотите удалить файл "%1"?', FilesLoading : 'Загрузка...', FilesEmpty : 'Пустая папка', FilesMoved : 'Файл %1 перемещен в %2:%3', FilesCopied : 'Файл %1 скопирован в %2:%3', // Basket BasketFolder : 'Корзина', BasketClear : 'Очистить корзину', BasketRemove : 'Убрать из корзины', BasketOpenFolder : 'Перейти в папку этого файла', BasketTruncateConfirm : 'Вы точно хотите очистить корзину?', BasketRemoveConfirm : 'Вы точно хотите убрать файл "%1" из корзины?', BasketEmpty : 'В корзине пока нет файлов, добавьте новые с помощью драг-н-дропа (перетащите файл в корзину).', BasketCopyFilesHere : 'Скопировать файл из корзины', BasketMoveFilesHere : 'Переместить файл из корзины', BasketPasteErrorOther : 'Произошла ошибка при обработке файла %s: %e', BasketPasteMoveSuccess : 'Файлы перемещены: %s', BasketPasteCopySuccess : 'Файлы скопированы: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Загрузка', UploadTip : 'Загрузить новый файл', Refresh : 'Обновить', Settings : 'Установки', Help : 'Помощь', HelpTip : 'Помощь', // Context Menus Select : 'Выбрать', SelectThumbnail : 'Выбрать миниатюру', View : 'Посмотреть', Download : 'Сохранить', NewSubFolder : 'Новая папка', Rename : 'Переименовать', Delete : 'Удалить', CopyDragDrop : 'Копировать', MoveDragDrop : 'Переместить', // Dialogs RenameDlgTitle : 'Переименовать', NewNameDlgTitle : 'Новое имя', FileExistsDlgTitle : 'Файл уже существует', SysErrorDlgTitle : 'Системная ошибка', FileOverwrite : 'Заменить файл', FileAutorename : 'Автоматически переименовывать', // Generic OkBtn : 'ОК', CancelBtn : 'Отмена', CloseBtn : 'Закрыть', // Upload Panel UploadTitle : 'Загрузить новый файл', UploadSelectLbl : 'Выбрать файл для загрузки', UploadProgressLbl : '(Загрузка в процессе, пожалуйста подождите...)', UploadBtn : 'Загрузить выбранный файл', UploadBtnCancel : 'Отмена', UploadNoFileMsg : 'Пожалуйста, выберите файл на вашем компьютере', UploadNoFolder : 'Пожалуйста, выберите папку, в которую вы хотите закачать файл.', UploadNoPerms : 'Загрузка файлов запрещена.', UploadUnknError : 'Ошибка при передаче файла.', UploadExtIncorrect : 'В эту папку нельзя закачивать файлы с таким расширением.', // Settings Panel SetTitle : 'Установки', SetView : 'Просмотр:', SetViewThumb : 'Миниатюры', SetViewList : 'Список', SetDisplay : 'Отобразить:', SetDisplayName : 'Имя файла', SetDisplayDate : 'Дата', SetDisplaySize : 'Размер файла', SetSort : 'Сортировка:', SetSortName : 'по имени файла', SetSortDate : 'по дате', SetSortSize : 'по размеру', // Status Bar FilesCountEmpty : '<Пустая папка>', FilesCountOne : '1 файл', FilesCountMany : '%1 файлов', // Size and Speed Kb : '%1 кБ', KbPerSecond : '%1 кБ/с', // Connector Error Messages. ErrorUnknown : 'Невозможно завершить запрос. (Ошибка %1)', Errors : { 10 : 'Неверная команда.', 11 : 'Тип ресурса не указан в запросе.', 12 : 'Неверный запрошенный тип ресурса.', 102 : 'Неверное имя файла или папки.', 103 : 'Невозможно завершить запрос из-за ограничений авторизации.', 104 : 'Невозможно завершить запрос из-за ограничения разрешений файловой системы.', 105 : 'Неверное расширение файла.', 109 : 'Неверный запрос.', 110 : 'Неизвестная ошибка.', 115 : 'Файл или папка с таким именем уже существует.', 116 : 'Папка не найдена. Пожалуйста, обновите вид папок и попробуйте еще раз.', 117 : 'Файл не найден. Пожалуйста, обновите список файлов и попробуйте еще раз.', 118 : 'Исходное расположение файла совпадает с указанным.', 201 : 'Файл с таким именем уже существует. Загруженный файл был переименован в "%1"', 202 : 'Неверный файл', 203 : 'Неверный файл. Размер файла слишком большой.', 204 : 'Загруженный файл поврежден.', 205 : 'Недоступна временная папка для загрузки файлов на сервер.', 206 : 'Загрузка отменена из-за соображений безопасности. Файл содержит похожие на HTML данные.', 207 : 'Загруженный файл был переименован в "%1"', 300 : 'Произошла ошибка при перемещении файла(ов).', 301 : 'Произошла ошибка при копировании файла(ов).', 500 : 'Браузер файлов отключен из-за соображений безопасности. Пожалуйста, сообщите вашему системному администратру и проверьте конфигурационный файл CKFinder.', 501 : 'Поддержка миниатюр отключена.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Имя файла не может быть пустым', FileExists : 'Файл %s уже существует', FolderEmpty : 'Имя папки не может быть пустым', FileInvChar : 'Имя файла не может содержать любой из перечисленных символов: \n\\ / : * ? " < > |', FolderInvChar : 'Имя папки не может содержать любой из перечисленных символов: \n\\ / : * ? " < > |', PopupBlockView : 'Невозможно открыть файл в новом окне. Пожалуйста, проверьте настройки браузера и отключите все блокировки всплывающих окон для этого сайта.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Изменить размеры %s', sizeTooBig : 'Нельзя указывать размеры больше, чем у оригинального файла (%size).', resizeSuccess : 'Размеры успешно изменены.', thumbnailNew : 'Создать миниатюру(ы)', thumbnailSmall : 'Маленькая (%s)', thumbnailMedium : 'Средняя (%s)', thumbnailLarge : 'Большая (%s)', newSize : 'Установить новые размеры', width : 'Ширина', height : 'Высота', invalidHeight : 'Высота должна быть числом больше нуля.', invalidWidth : 'Ширина должна быть числом больше нуля.', invalidName : 'Неверное имя файла.', newImage : 'Сохранить как новый файл', noExtensionChange : 'Не удалось поменять расширение файла.', imageSmall : 'Исходная картинка слишком маленькая', contextMenuName : 'Изменить размер' }, // Fileeditor plugin Fileeditor : { save : 'Сохранить', fileOpenError : 'Не удалось открыть файл.', fileSaveSuccess : 'Файл успешно сохранен.', contextMenuName : 'Редактировать', loadingFile : 'Файл загружается, пожалуйста подождите...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Swedish * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['sv'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'en', // MISSING // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'yyyy-mm-dd HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mappar', FolderLoading : 'Laddar...', FolderNew : 'Skriv namnet på den nya mappen: ', FolderRename : 'Skriv det nya namnet på mappen: ', FolderDelete : 'Är du säker på att du vill radera mappen "%1"?', FolderRenaming : ' (Byter mappens namn...)', FolderDeleting : ' (Raderar...)', // Files FileRename : 'Skriv det nya filnamnet: ', FileRenameExt : 'Är du säker på att du fill ändra på filändelsen? Filen kan bli oanvändbar', FileRenaming : 'Byter filnamn...', FileDelete : 'Är du säker på att du vill radera filen "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Ladda upp', UploadTip : 'Ladda upp en ny fil', Refresh : 'Uppdatera', Settings : 'Inställningar', Help : 'Hjälp', HelpTip : 'Hjälp', // Context Menus Select : 'Infoga bild', SelectThumbnail : 'Infoga som tumnagel', View : 'Visa', Download : 'Ladda ner', NewSubFolder : 'Ny Undermapp', Rename : 'Byt namn', Delete : 'Radera', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Avbryt', CloseBtn : 'Stäng', // Upload Panel UploadTitle : 'Ladda upp en ny fil', UploadSelectLbl : 'Välj fil att ladda upp', UploadProgressLbl : '(Laddar upp filen, var god vänta...)', UploadBtn : 'Ladda upp den valda filen', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Välj en fil från din dator', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Inställningar', SetView : 'Visa:', SetViewThumb : 'Tumnaglar', SetViewList : 'Lista', SetDisplay : 'Visa:', SetDisplayName : 'Filnamn', SetDisplayDate : 'Datum', SetDisplaySize : 'Filstorlek', SetSort : 'Sortering:', SetSortName : 'Filnamn', SetSortDate : 'Datum', SetSortSize : 'Storlek', // Status Bar FilesCountEmpty : '<Tom Mapp>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 kB', // MISSING KbPerSecond : '%1 kB/s', // MISSING // Connector Error Messages. ErrorUnknown : 'Begäran kunde inte utföras eftersom ett fel uppstod. (Error %1)', Errors : { 10 : 'Ogiltig begäran.', 11 : 'Resursens typ var inte specificerad i förfrågan.', 12 : 'Den efterfrågade resurstypen är inte giltig.', 102 : 'Ogiltigt fil- eller mappnamn.', 103 : 'Begäran kunde inte utföras p.g.a. restriktioner av rättigheterna.', 104 : 'Begäran kunde inte utföras p.g.a. restriktioner av rättigheter i filsystemet.', 105 : 'Ogiltig filändelse.', 109 : 'Ogiltig begäran.', 110 : 'Okänt fel.', 115 : 'En fil eller mapp med aktuellt namn finns redan.', 116 : 'Mappen kunde inte hittas. Var god uppdatera sidan och försök igen.', 117 : 'Filen kunde inte hittas. Var god uppdatera sidan och försök igen.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'En fil med aktuellt namn fanns redan. Den uppladdade filen har döpts om till "%1"', 202 : 'Ogiltig fil', 203 : 'Ogiltig fil. Filen var för stor.', 204 : 'Den uppladdade filen var korrupt.', 205 : 'En tillfällig mapp för uppladdning är inte tillgänglig på servern.', 206 : 'Uppladdningen stoppades av säkerhetsskäl. Filen innehåller HTML-liknande data.', 207 : 'Den uppladdade filen har döpts om till "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Filhanteraren har stoppats av säkerhetsskäl. Var god kontakta administratören för att kontrollera konfigurationsfilen för CKFinder.', 501 : 'Stöd för tumnaglar har stängts av.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Filnamnet får inte vara tomt', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Mappens namn får inte vara tomt', FileInvChar : 'Filnamnet får inte innehålla något av följande tecken: \n\\ / : * ? " < > |', FolderInvChar : 'Mappens namn får inte innehålla något av följande tecken: \n\\ / : * ? " < > |', PopupBlockView : 'Det gick inte att öppna filen i ett nytt fönster. Ändra inställningarna i din webbläsare och tillåt popupfönster för den här hemsidan.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the French * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['fr'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, Inaccessible</span>', confirmCancel : 'Certaines options ont été modifiées. Êtes vous sûr de vouloir fermer cette fenêtre ?', ok : 'OK', cancel : 'Annuler', confirmationTitle : 'Confirmation', messageTitle : 'Information', inputTitle : 'Question', undo : 'Annuler', redo : 'Rétablir', skip : 'Passer', skipAll : 'passer tout', makeDecision : 'Quelle action choisir ?', rememberDecision: 'Se rappeller de la décision' }, dir : 'ltr', HelpLang : 'en', LangCode : 'fr', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Dossiers', FolderLoading : 'Chargement...', FolderNew : 'Entrez le nouveau nom du dossier: ', FolderRename : 'Entrez le nouveau nom du dossier: ', FolderDelete : 'Êtes-vous sûr de vouloir effacer le dossier "%1" ?', FolderRenaming : ' (Renommage en cours...)', FolderDeleting : ' (Suppression en cours...)', // Files FileRename : 'Entrez le nouveau nom du fichier: ', FileRenameExt : 'Êtes-vous sûr de vouloir ¨changer l\'extension de ce fichier? Le fichier pourrait devenir inutilisable', FileRenaming : 'Renommage en cours...', FileDelete : 'Êtes-vous sûr de vouloir effacer le fichier "%1" ?', FilesLoading : 'Chargement...', FilesEmpty : 'Répertoire vide', FilesMoved : 'Fichier %1 déplacé vers %2:%3', FilesCopied : 'Fichier %1 copié vers %2:%3', // Basket BasketFolder : 'Corbeille', BasketClear : 'Vider la corbeille', BasketRemove : 'Retirer de la corbeille', BasketOpenFolder : 'Ouvrir le répertiore parent', BasketTruncateConfirm : 'Êtes vous sûr de vouloir supprimer tous les fichiers de la corbeille ?', BasketRemoveConfirm : 'Êtes vous sûr de vouloir supprimer le fichier "%1" de la corbeille ?', BasketEmpty : 'Aucun fichier dans la corbeille, déposez en queques uns.', BasketCopyFilesHere : 'Copier des fichiers depuis la corbeille', BasketMoveFilesHere : 'Déplacer des fichiers depuis la corbeille', BasketPasteErrorOther : 'Fichier %s erreur: %e', BasketPasteMoveSuccess : 'Les fichiers suivant ont été déplacés: %s', BasketPasteCopySuccess : 'Les fichiers suivant ont été copiés: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Envoyer', UploadTip : 'Envoyer un nouveau fichier', Refresh : 'Rafraîchir', Settings : 'Configuration', Help : 'Aide', HelpTip : 'Aide', // Context Menus Select : 'Choisir', SelectThumbnail : 'Choisir une miniature', View : 'Voir', Download : 'Télécharger', NewSubFolder : 'Nouveau sous-dossier', Rename : 'Renommer', Delete : 'Effacer', CopyDragDrop : 'Copier les fichiers ici', MoveDragDrop : 'Déplacer les fichiers ici', // Dialogs RenameDlgTitle : 'Renommer', NewNameDlgTitle : 'Nouveau fichier', FileExistsDlgTitle : 'Fichier déjà existant', SysErrorDlgTitle : 'Erreur système', FileOverwrite : 'Ré-écrire', FileAutorename : 'Re-nommage automatique', // Generic OkBtn : 'OK', CancelBtn : 'Annuler', CloseBtn : 'Fermer', // Upload Panel UploadTitle : 'Envoyer un nouveau fichier', UploadSelectLbl : 'Sélectionner le fichier à télécharger', UploadProgressLbl : '(Envoi en cours, veuillez patienter...)', UploadBtn : 'Envoyer le fichier sélectionné', UploadBtnCancel : 'Annuler', UploadNoFileMsg : 'Sélectionner un fichier sur votre ordinateur', UploadNoFolder : 'Merci de sélectionner un répertoire avant l\'envoi.', UploadNoPerms : 'L\'envoi de fichier n\'est pas autorisé', UploadUnknError : 'Erreur pendant l\'envoi du fichier.', UploadExtIncorrect : 'L\'extension du fichier n\'est pas autorisée dans ce dossier.', // Settings Panel SetTitle : 'Configuration', SetView : 'Voir:', SetViewThumb : 'Miniatures', SetViewList : 'Liste', SetDisplay : 'Affichage:', SetDisplayName : 'Nom du fichier', SetDisplayDate : 'Date', SetDisplaySize : 'Taille du fichier', SetSort : 'Classement:', SetSortName : 'par Nom de Fichier', SetSortDate : 'par Date', SetSortSize : 'par Taille', // Status Bar FilesCountEmpty : '<Dossier Vide>', FilesCountOne : '1 fichier', FilesCountMany : '%1 fichiers', // Size and Speed Kb : '%1 ko', KbPerSecond : '%1 ko/s', // Connector Error Messages. ErrorUnknown : 'La demande n\'a pas abouti. (Erreur %1)', Errors : { 10 : 'Commande invalide.', 11 : 'Le type de ressource n\'a pas été spécifié dans la commande.', 12 : 'Le type de ressource n\'est pas valide.', 102 : 'Nom de fichier ou de dossier invalide.', 103 : 'La demande n\'a pas abouti : problème d\'autorisations.', 104 : 'La demande n\'a pas abouti : problème de restrictions de permissions.', 105 : 'Extension de fichier invalide.', 109 : 'Demande invalide.', 110 : 'Erreur inconnue.', 115 : 'Un fichier ou un dossier avec ce nom existe déjà.', 116 : 'Ce dossier n\'existe pas. Veuillez rafraîchir la page et réessayer.', 117 : 'Ce fichier n\'existe pas. Veuillez rafraîchir la page et réessayer.', 118 : 'Les chemins vers la source et la cible sont les mêmes.', 201 : 'Un fichier avec ce nom existe déjà. Le fichier téléversé a été renommé en "%1"', 202 : 'Fichier invalide', 203 : 'Fichier invalide. La taille est trop grande.', 204 : 'Le fichier téléversé est corrompu.', 205 : 'Aucun dossier temporaire n\'est disponible sur le serveur.', 206 : 'Envoi interrompu pour raisons de sécurité. Le fichier contient des données de type HTML.', 207 : 'El fichero subido ha sido renombrado como "%1"', 300 : 'Le déplacement des fichiers a échoué.', 301 : 'La copie des fichiers a échoué.', 500 : 'L\'interface de gestion des fichiers est désactivé. Contactez votre administrateur et vérifier le fichier de configuration de CKFinder.', 501 : 'La fonction "miniatures" est désactivée.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Le nom du fichier ne peut être vide', FileExists : 'Le fichier %s existes déjà', FolderEmpty : 'Le nom du dossier ne peut être vide', FileInvChar : 'Le nom du fichier ne peut pas contenir les charactères suivants : \n\\ / : * ? " < > |', FolderInvChar : 'Le nom du dossier ne peut pas contenir les charactères suivants : \n\\ / : * ? " < > |', PopupBlockView : 'Il n\'a pas été possible d\'ouvrir la nouvelle fenêtre. Désactiver votre bloqueur de fenêtres pour ce site.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Redimensionner %s', sizeTooBig : 'Impossible de modifier la hauteur ou la largeur de cette image pour une valeur plus grande que l\'original (%size).', resizeSuccess : 'L\'image a été redimensionné avec succès.', thumbnailNew : 'Créer une nouvelle vignette', thumbnailSmall : 'Petit (%s)', thumbnailMedium : 'Moyen (%s)', thumbnailLarge : 'Gros (%s)', newSize : 'Déterminer les nouvelles dimensions', width : 'Largeur', height : 'Hauteur', invalidHeight : 'Hauteur invalide.', invalidWidth : 'Largeur invalide.', invalidName : 'Nom de fichier incorrect.', newImage : 'Créer une nouvelle image', noExtensionChange : 'L\'extension du fichier ne peut pas être changé.', imageSmall : 'L\'image est trop petit', contextMenuName : 'Redimensionner' }, // Fileeditor plugin Fileeditor : { save : 'Sauvegarder', fileOpenError : 'Impossible d\'ouvrir le fichier', fileSaveSuccess : 'Fichier sauvegardé avec succès.', contextMenuName : 'Edition', loadingFile : 'Chargement du fichier, veuillez patientez...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Chinese-Simplified * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['zh-cn'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : '部分内容尚未保存,确定关闭对话框么?', ok : '确定', cancel : '取消', confirmationTitle : '确认', messageTitle : '提示', inputTitle : '询问', undo : '撤销', redo : '重做', skip : '跳过', skipAll : '全部跳过', makeDecision : '应采取何样措施?', rememberDecision: '下次不再询问' }, dir : '自左向右', HelpLang : 'en', LangCode : 'zh-cn', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'yyyy年m月d日 h:MM aa', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : '文件夹', FolderLoading : '正在加载文件夹...', FolderNew : '请输入新文件夹名称: ', FolderRename : '请输入新文件夹名称: ', FolderDelete : '您确定要删除文件夹 "%1" 吗?', FolderRenaming : ' (正在重命名...)', FolderDeleting : ' (正在删除...)', // Files FileRename : '请输入新文件名: ', FileRenameExt : '如果改变文件扩展名,可能会导致文件不可用。\r\n确定要更改吗?', FileRenaming : '正在重命名...', FileDelete : '您确定要删除文件 "%1" 吗?', FilesLoading : '加载中...', FilesEmpty : '空文件夹', FilesMoved : '文件 %1 已移动至 %2:%3', FilesCopied : '文件 %1 已拷贝至 %2:%3', // Basket BasketFolder : '临时文件夹', BasketClear : '清空临时文件夹', BasketRemove : '从临时文件夹移除', BasketOpenFolder : '打开临时文件夹', BasketTruncateConfirm : '确认清空临时文件夹?', BasketRemoveConfirm : '确认从临时文件夹中移除文件 "%1" ?', BasketEmpty : '临时文件夹为空, 可拖放文件至其中.', BasketCopyFilesHere : '从临时文件夹复制至此', BasketMoveFilesHere : '从临时文件夹移动至此', BasketPasteErrorOther : '文件 %s 出错: %e', BasketPasteMoveSuccess : '已移动以下文件: %s', BasketPasteCopySuccess : '已拷贝以下文件: %s', // Toolbar Buttons (some used elsewhere) Upload : '上传', UploadTip : '上传文件', Refresh : '刷新', Settings : '设置', Help : '帮助', HelpTip : '查看在线帮助', // Context Menus Select : '选择', SelectThumbnail : '选中缩略图', View : '查看', Download : '下载', NewSubFolder : '创建子文件夹', Rename : '重命名', Delete : '删除', CopyDragDrop : '将文件复制至此', MoveDragDrop : '将文件移动至此', // Dialogs RenameDlgTitle : '重命名', NewNameDlgTitle : '文件名', FileExistsDlgTitle : '文件已存在', SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : '自动覆盖重名', FileAutorename : '自动重命名重名', // Generic OkBtn : '确定', CancelBtn : '取消', CloseBtn : '关闭', // Upload Panel UploadTitle : '上传文件', UploadSelectLbl : '选定要上传的文件', UploadProgressLbl : '(正在上传文件,请稍候...)', UploadBtn : '上传选定的文件', UploadBtnCancel : '取消', UploadNoFileMsg : '请选择一个要上传的文件', UploadNoFolder : '需先选择一个文件.', UploadNoPerms : '无文件上传权限.', UploadUnknError : '上传文件出错.', UploadExtIncorrect : '此文件后缀在当前文件夹中不可用.', // Settings Panel SetTitle : '设置', SetView : '查看:', SetViewThumb : '缩略图', SetViewList : '列表', SetDisplay : '显示:', SetDisplayName : '文件名', SetDisplayDate : '日期', SetDisplaySize : '大小', SetSort : '排列顺序:', SetSortName : '按文件名', SetSortDate : '按日期', SetSortSize : '按大小', // Status Bar FilesCountEmpty : '<空文件夹>', FilesCountOne : '1 个文件', FilesCountMany : '%1 个文件', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : '请求的操作未能完成. (错误 %1)', Errors : { 10 : '无效的指令.', 11 : '文件类型不在许可范围之内.', 12 : '文件类型无效.', 102 : '无效的文件名或文件夹名称.', 103 : '由于作者限制,该请求不能完成.', 104 : '由于文件系统的限制,该请求不能完成.', 105 : '无效的扩展名.', 109 : '无效请求.', 110 : '未知错误.', 115 : '存在重名的文件或文件夹.', 116 : '文件夹不存在. 请刷新后再试.', 117 : '文件不存在. 请刷新列表后再试.', 118 : '目标位置与当前位置相同.', 201 : '文件与现有的重名. 新上传的文件改名为 "%1"', 202 : '无效的文件', 203 : '无效的文件. 文件尺寸太大.', 204 : '上传文件已损失.', 205 : '服务器中的上传临时文件夹无效.', 206 : '因为安全原因,上传中断. 上传文件包含不能 HTML 类型数据.', 207 : '新上传的文件改名为 "%1"', 300 : '移动文件失败.', 301 : '复制文件失败.', 500 : '因为安全原因,文件不可浏览. 请联系系统管理员并检查CKFinder配置文件.', 501 : '不支持缩略图方式.' }, // Other Error Messages. ErrorMsg : { FileEmpty : '文件名不能为空', FileExists : '文件 %s 已存在.', FolderEmpty : '文件夹名称不能为空', FileInvChar : '文件名不能包含以下字符: \n\\ / : * ? " < > |', FolderInvChar : '文件夹名称不能包含以下字符: \n\\ / : * ? " < > |', PopupBlockView : '未能在新窗口中打开文件. 请修改浏览器配置解除对本站点的锁定.' }, // Imageresize plugin Imageresize : { dialogTitle : '改变尺寸 %s', sizeTooBig : '无法大于原图尺寸 (%size).', resizeSuccess : '图像尺寸已修改.', thumbnailNew : '创建缩略图', thumbnailSmall : '小 (%s)', thumbnailMedium : '中 (%s)', thumbnailLarge : '大 (%s)', newSize : '设置新尺寸', width : '宽度', height : '高度', invalidHeight : '无效高度.', invalidWidth : '无效宽度.', invalidName : '文件名无效.', newImage : '创建图像', noExtensionChange : '无法改变文件后缀.', imageSmall : '原文件尺寸过小', contextMenuName : '改变尺寸' }, // Fileeditor plugin Fileeditor : { save : '保存', fileOpenError : '无法打开文件.', fileSaveSuccess : '成功保存文件.', contextMenuName : '编辑', loadingFile : '加载文件中...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the English * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['ja'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, は利用できません。</span>', confirmCancel : '変更された項目があります。ウィンドウを閉じてもいいですか?', ok : '適用', cancel : 'キャンセル', confirmationTitle : '確認', messageTitle : 'インフォメーション', inputTitle : '質問', undo : '元に戻す', redo : 'やり直す', skip : 'スキップ', skipAll : 'すべてスキップ', makeDecision : 'どうしますか?', rememberDecision: '注意:' }, dir : 'ltr', HelpLang : 'en', LangCode : 'ja', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'm/d/yyyy h:MM aa', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Folders', FolderLoading : '読み込み中...', FolderNew : '新しいフォルダ名を入力してください: ', FolderRename : '新しいフォルダ名を入力してください: ', FolderDelete : '本当にフォルダ「"%1"」を削除してもよろしいですか?', FolderRenaming : ' (リネーム中...)', FolderDeleting : ' (削除中...)', // Files FileRename : '新しいファイル名を入力してください: ', FileRenameExt : 'ファイルが使えなくなる可能性がありますが、本当に拡張子を変更してもよろしいですか?', FileRenaming : 'リネーム中...', FileDelete : '本当に「"%1"」を削除してもよろしいですか?', FilesLoading : '読み込み中...', FilesEmpty : 'ファイルがありません', FilesMoved : ' %1 は %2:%3 に移動されました', FilesCopied : ' %1 cは %2:%3 にコピーされました', // Basket BasketFolder : 'Basket', BasketClear : 'バスケットを空にする', BasketRemove : 'バスケットから削除', BasketOpenFolder : '親フォルダを開く', BasketTruncateConfirm : '本当にバスケットの中身を空にしますか?', BasketRemoveConfirm : '本当に「"%1"」をバスケットから削除しますか?', BasketEmpty : 'バスケットの中にファイルがありません。このエリアにドラッグ&ドロップして追加することができます。', BasketCopyFilesHere : 'バスケットからファイルをコピー', BasketMoveFilesHere : 'バスケットからファイルを移動', BasketPasteErrorOther : 'ファイル %s のエラー: %e', BasketPasteMoveSuccess : '以下のファイルが移動されました: %s', BasketPasteCopySuccess : '以下のファイルがコピーされました: %s', // Toolbar Buttons (some used elsewhere) Upload : 'アップロード', UploadTip : '新しいファイルのアップロード', Refresh : '表示の更新', Settings : 'カスタマイズ', Help : 'ヘルプ', HelpTip : 'ヘルプ', // Context Menus Select : 'この画像を選択', SelectThumbnail : 'この画像のサムネイルを選択', View : '画像だけを表示', Download : 'ダウンロード', NewSubFolder : '新しいフォルダに入れる', Rename : 'ファイル名の変更', Delete : '削除', CopyDragDrop : 'コピーするファイルをここにドロップしてください', MoveDragDrop : '移動するファイルをここにドロップしてください', // Dialogs RenameDlgTitle : 'リネーム', NewNameDlgTitle : '新しい名前', FileExistsDlgTitle : 'ファイルはすでに存在します。', SysErrorDlgTitle : 'システムエラー', FileOverwrite : '上書き', FileAutorename : 'A自動でリネーム', // Generic OkBtn : 'OK', CancelBtn : 'キャンセル', CloseBtn : '閉じる', // Upload Panel UploadTitle : 'ファイルのアップロード', UploadSelectLbl : 'アップロードするファイルを選択してください', UploadProgressLbl : '(ファイルのアップロード中...)', UploadBtn : 'アップロード', UploadBtnCancel : 'キャンセル', UploadNoFileMsg : 'ファイルを選んでください。', UploadNoFolder : 'アップロードの前にフォルダを選択してください。', UploadNoPerms : 'ファイルのアップロード権限がありません。', UploadUnknError : 'ファイルの送信に失敗しました。', UploadExtIncorrect : '選択されたファイルの拡張子は許可されていません。', // Settings Panel SetTitle : '表示のカスタマイズ', SetView : '表示方法:', SetViewThumb : 'サムネイル', SetViewList : '表示形式', SetDisplay : '表示する項目:', SetDisplayName : 'ファイル名', SetDisplayDate : '日時', SetDisplaySize : 'ファイルサイズ', SetSort : '表示の順番:', SetSortName : 'ファイル名', SetSortDate : '日付', SetSortSize : 'サイズ', // Status Bar FilesCountEmpty : '<フォルダ内にファイルがありません>', FilesCountOne : '1つのファイル', FilesCountMany : '%1個のファイル', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'リクエストの処理に失敗しました。 (Error %1)', Errors : { 10 : '不正なコマンドです。', 11 : 'リソースタイプが特定できませんでした。', 12 : '要求されたリソースのタイプが正しくありません。', 102 : 'ファイル名/フォルダ名が正しくありません。', 103 : 'リクエストを完了できませんでした。認証エラーです。', 104 : 'リクエストを完了できませんでした。ファイルのパーミッションが許可されていません。', 105 : '拡張子が正しくありません。', 109 : '不正なリクエストです。', 110 : '不明なエラーが発生しました。', 115 : '同じ名前のファイル/フォルダがすでに存在しています。', 116 : 'フォルダが見つかりませんでした。ページを更新して再度お試し下さい。', 117 : 'ファイルが見つかりませんでした。ページを更新して再度お試し下さい。', 118 : '対象が移動元と同じ場所を指定されています。', 201 : '同じ名前のファイルがすでに存在しています。"%1" にリネームして保存されました。', 202 : '不正なファイルです。', 203 : 'ファイルのサイズが大きすぎます。', 204 : 'アップロードされたファイルは壊れています。', 205 : 'サーバ内の一時作業フォルダが利用できません。', 206 : 'セキュリティ上の理由からアップロードが取り消されました。このファイルにはHTMLに似たデータが含まれています。', 207 : 'ファイルは "%1" にリネームして保存されました。', 300 : 'ファイルの移動に失敗しました。', 301 : 'ファイルのコピーに失敗しました。', 500 : 'ファイルブラウザはセキュリティ上の制限から無効になっています。システム担当者に連絡をして、CKFinderの設定をご確認下さい。', 501 : 'サムネイル機能は無効になっています。' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'ファイル名を入力してください', FileExists : ' %s はすでに存在しています。別の名前を入力してください。', FolderEmpty : 'フォルダ名を入力してください', FileInvChar : 'ファイルに以下の文字は使えません: \n\\ / : * ? " < > |', FolderInvChar : 'フォルダに以下の文字は使えません: \n\\ / : * ? " < > |', PopupBlockView : 'ファイルを新しいウィンドウで開くことに失敗しました。 お使いのブラウザの設定でポップアップをブロックする設定を解除してください。' }, // Imageresize plugin Imageresize : { dialogTitle : 'リサイズ: %s', sizeTooBig : 'オリジナルの画像よりも大きいサイズは指定できません。 (%size).', resizeSuccess : '画像のリサイズに成功しました', thumbnailNew : 'サムネイルをつくる', thumbnailSmall : '小 (%s)', thumbnailMedium : '中 (%s)', thumbnailLarge : '大 (%s)', newSize : 'Set new size', width : '幅', height : '高さ', invalidHeight : '高さの値が不正です。', invalidWidth : '幅の値が不正です。', invalidName : 'ファイル名が不正です。', newImage : '新しい画像を作成', noExtensionChange : '拡張子は変更できません。', imageSmall : '元画像が小さすぎます。', contextMenuName : 'リサイズ' }, // Fileeditor plugin Fileeditor : { save : '保存', fileOpenError : 'ファイルを開けませんでした。', fileSaveSuccess : 'ファイルの保存が完了しました。', contextMenuName : '編集', loadingFile : 'ファイルの読み込み中...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Slovak * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['sk'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'sk', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'mm/dd/yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Adresáre', FolderLoading : 'Nahrávam...', FolderNew : 'Zadajte prosím meno nového adresára: ', FolderRename : 'Zadajte prosím meno nového adresára: ', FolderDelete : 'Skutočne zmazať adresár "%1" ?', FolderRenaming : ' (Prebieha premenovanie adresára...)', FolderDeleting : ' (Prebieha zmazanie adresára...)', // Files FileRename : 'Zadajte prosím meno nového súboru: ', FileRenameExt : 'Skutočne chcete zmeniť príponu súboru? Upozornenie: zmenou prípony sa súbor môže stať nepoužiteľným, pokiaľ prípona nie je podporovaná.', FileRenaming : 'Prebieha premenovanie súboru...', FileDelete : 'Skutočne chcete odstrániť súbor "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Prekopírovať na server (Upload)', UploadTip : 'Prekopírovať nový súbor', Refresh : 'Znovunačítať (Refresh)', Settings : 'Nastavenia', Help : 'Pomoc', HelpTip : 'Pomoc', // Context Menus Select : 'Vybrať', SelectThumbnail : 'Select Thumbnail', // MISSING View : 'Náhľad', Download : 'Stiahnuť', NewSubFolder : 'Nový podadresár', Rename : 'Premenovať', Delete : 'Zmazať', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Zrušiť', CloseBtn : 'Zatvoriť', // Upload Panel UploadTitle : 'Nahrať nový súbor', UploadSelectLbl : 'Vyberte súbor, ktorý chcete prekopírovať na server', UploadProgressLbl : '(Prebieha kopírovanie, čakajte prosím...)', UploadBtn : 'Prekopírovať vybratý súbor', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Vyberte prosím súbor na Vašom počítači!', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Nastavenia', SetView : 'Náhľad:', SetViewThumb : 'Miniobrázky', SetViewList : 'Zoznam', SetDisplay : 'Zobraziť:', SetDisplayName : 'Názov súboru', SetDisplayDate : 'Dátum', SetDisplaySize : 'Veľkosť súboru', SetSort : 'Zoradenie:', SetSortName : 'podľa názvu súboru', SetSortDate : 'podľa dátumu', SetSortSize : 'podľa veľkosti', // Status Bar FilesCountEmpty : '<Prázdny adresár>', FilesCountOne : '1 súbor', FilesCountMany : '%1 súborov', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Server nemohol dokončiť spracovanie požiadavky. (Chyba %1)', Errors : { 10 : 'Neplatný príkaz.', 11 : 'V požiadavke nebol špecifikovaný typ súboru.', 12 : 'Nepodporovaný typ súboru.', 102 : 'Neplatný názov súboru alebo adresára.', 103 : 'Nebolo možné dokončiť spracovanie požiadavky kvôli nepostačujúcej úrovni oprávnení.', 104 : 'Nebolo možné dokončiť spracovanie požiadavky kvôli obmedzeniam v prístupových právach ku súborom.', 105 : 'Neplatná prípona súboru.', 109 : 'Neplatná požiadavka.', 110 : 'Neidentifikovaná chyba.', 115 : 'Zadaný súbor alebo adresár už existuje.', 116 : 'Adresár nebol nájdený. Aktualizujte obsah adresára (Znovunačítať) a skúste znovu.', 117 : 'Súbor nebol nájdený. Aktualizujte obsah adresára (Znovunačítať) a skúste znovu.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Súbor so zadaným názvom už existuje. Prekopírovaný súbor bol premenovaný na "%1"', 202 : 'Neplatný súbor', 203 : 'Neplatný súbor - súbor presahuje maximálnu povolenú veľkosť.', 204 : 'Kopírovaný súbor je poškodený.', 205 : 'Server nemá špecifikovaný dočasný adresár pre kopírované súbory.', 206 : 'Kopírovanie prerušené kvôli nedostatočnému zabezpečeniu. Súbor obsahuje HTML data.', 207 : 'Prekopírovaný súbor bol premenovaný na "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Prehliadanie súborov je zakázané kvôli bezpečnosti. Kontaktujte prosím administrátora a overte nastavenia v konfiguračnom súbore pre CKFinder.', 501 : 'Momentálne nie je zapnutá podpora pre generáciu miniobrázkov.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Názov súbor nesmie prázdny', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Názov adresára nesmie byť prázdny', FileInvChar : 'Súbor nesmie obsahovať žiadny z nasledujúcich znakov: \n\\ / : * ? " < > |', FolderInvChar : 'Adresár nesmie obsahovať žiadny z nasledujúcich znakov: \n\\ / : * ? " < > |', PopupBlockView : 'Nebolo možné otvoriť súbor v novom okne. Overte nastavenia Vášho prehliadača a zakážte všetky blokovače popup okien pre túto webstránku.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the English * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['en'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', ok : 'OK', cancel : 'Cancel', confirmationTitle : 'Confirmation', messageTitle : 'Information', inputTitle : 'Question', undo : 'Undo', redo : 'Redo', skip : 'Skip', skipAll : 'Skip all', makeDecision : 'What action should be taken?', rememberDecision: 'Remember my decision' }, dir : 'ltr', HelpLang : 'en', LangCode : 'en', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'm/d/yyyy h:MM aa', DateAmPm : ['AM','PM'], // Folders FoldersTitle : 'Folders', FolderLoading : 'Loading...', FolderNew : 'Please type the new folder name: ', FolderRename : 'Please type the new folder name: ', FolderDelete : 'Are you sure you want to delete the "%1" folder?', FolderRenaming : ' (Renaming...)', FolderDeleting : ' (Deleting...)', // Files FileRename : 'Please type the new file name: ', FileRenameExt : 'Are you sure you want to change the file name extension? The file may become unusable', FileRenaming : 'Renaming...', FileDelete : 'Are you sure you want to delete the file "%1"?', FilesLoading : 'Loading...', FilesEmpty : 'Empty folder', FilesMoved : 'File %1 moved into %2:%3', FilesCopied : 'File %1 copied into %2:%3', // Basket BasketFolder : 'Basket', BasketClear : 'Clear Basket', BasketRemove : 'Remove from basket', BasketOpenFolder : 'Open parent folder', BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', BasketEmpty : 'No files in the basket, drag\'n\'drop some.', BasketCopyFilesHere : 'Copy Files from Basket', BasketMoveFilesHere : 'Move Files from Basket', BasketPasteErrorOther : 'File %s error: %e', BasketPasteMoveSuccess : 'The following files were moved: %s', BasketPasteCopySuccess : 'The following files were copied: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Upload', UploadTip : 'Upload New File', Refresh : 'Refresh', Settings : 'Settings', Help : 'Help', HelpTip : 'Help', // Context Menus Select : 'Select', SelectThumbnail : 'Select Thumbnail', View : 'View', Download : 'Download', NewSubFolder : 'New Subfolder', Rename : 'Rename', Delete : 'Delete', CopyDragDrop : 'Copy file here', MoveDragDrop : 'Move file here', // Dialogs RenameDlgTitle : 'Rename', NewNameDlgTitle : 'New name', FileExistsDlgTitle : 'File already exists', SysErrorDlgTitle : 'System error', FileOverwrite : 'Overwrite', FileAutorename : 'Auto-rename', // Generic OkBtn : 'OK', CancelBtn : 'Cancel', CloseBtn : 'Close', // Upload Panel UploadTitle : 'Upload New File', UploadSelectLbl : 'Select the file to upload', UploadProgressLbl : '(Upload in progress, please wait...)', UploadBtn : 'Upload Selected File', UploadBtnCancel : 'Cancel', UploadNoFileMsg : 'Please select a file from your computer', UploadNoFolder : 'Please select folder before uploading.', UploadNoPerms : 'File upload not allowed.', UploadUnknError : 'Error sending the file.', UploadExtIncorrect : 'File extension not allowed in this folder.', // Settings Panel SetTitle : 'Settings', SetView : 'View:', SetViewThumb : 'Thumbnails', SetViewList : 'List', SetDisplay : 'Display:', SetDisplayName : 'File Name', SetDisplayDate : 'Date', SetDisplaySize : 'File Size', SetSort : 'Sorting:', SetSortName : 'by File Name', SetSortDate : 'by Date', SetSortSize : 'by Size', // Status Bar FilesCountEmpty : '<Empty Folder>', FilesCountOne : '1 file', FilesCountMany : '%1 files', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'It was not possible to complete the request. (Error %1)', Errors : { 10 : 'Invalid command.', 11 : 'The resource type was not specified in the request.', 12 : 'The requested resource type is not valid.', 102 : 'Invalid file or folder name.', 103 : 'It was not possible to complete the request due to authorization restrictions.', 104 : 'It was not possible to complete the request due to file system permission restrictions.', 105 : 'Invalid file extension.', 109 : 'Invalid request.', 110 : 'Unknown error.', 115 : 'A file or folder with the same name already exists.', 116 : 'Folder not found. Please refresh and try again.', 117 : 'File not found. Please refresh the files list and try again.', 118 : 'Source and target paths are equal.', 201 : 'A file with the same name is already available. The uploaded file has been renamed to "%1"', 202 : 'Invalid file', 203 : 'Invalid file. The file size is too big.', 204 : 'The uploaded file is corrupt.', 205 : 'No temporary folder is available for upload in the server.', 206 : 'Upload cancelled for security reasons. The file contains HTML like data.', 207 : 'The uploaded file has been renamed to "%1"', 300 : 'Moving file(s) failed.', 301 : 'Copying file(s) failed.', 500 : 'The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.', 501 : 'The thumbnails support is disabled.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'The file name cannot be empty', FileExists : 'File %s already exists', FolderEmpty : 'The folder name cannot be empty', FileInvChar : 'The file name cannot contain any of the following characters: \n\\ / : * ? " < > |', FolderInvChar : 'The folder name cannot contain any of the following characters: \n\\ / : * ? " < > |', PopupBlockView : 'It was not possible to open the file in a new window. Please configure your browser and disable all popup blockers for this site.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', resizeSuccess : 'Image resized successfully.', thumbnailNew : 'Create new thumbnail', thumbnailSmall : 'Small (%s)', thumbnailMedium : 'Medium (%s)', thumbnailLarge : 'Large (%s)', newSize : 'Set new size', width : 'Width', height : 'Height', invalidHeight : 'Invalid height.', invalidWidth : 'Invalid width.', invalidName : 'Invalid file name.', newImage : 'Create new image', noExtensionChange : 'The file extension cannot be changed.', imageSmall : 'Source image is too small', contextMenuName : 'Resize' }, // Fileeditor plugin Fileeditor : { save : 'Save', fileOpenError : 'Unable to open file.', fileSaveSuccess : 'File saved successfully.', contextMenuName : 'Edit', loadingFile : 'Loading file, please wait...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Danish * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['da'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, ikke tilgængelig</span>', confirmCancel : 'Nogle af indstillingerne er blevet ændret. Er du sikker på at lukke dialogen?', ok : 'OK', cancel : 'Annuller', confirmationTitle : 'Bekræftelse', messageTitle : 'Information', inputTitle : 'Spørgsmål', undo : 'Fortryd', redo : 'Annuller fortryd', skip : 'Skip', skipAll : 'Skip alle', makeDecision : 'Hvad skal der foretages?', rememberDecision: 'Husk denne indstilling' }, dir : 'ltr', HelpLang : 'en', LangCode : 'da', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd-mm-yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mapper', FolderLoading : 'Indlæser...', FolderNew : 'Skriv navnet på den nye mappe: ', FolderRename : 'Skriv det nye navn på mappen: ', FolderDelete : 'Er du sikker på, at du vil slette mappen "%1" ?', FolderRenaming : ' (Omdøber...)', FolderDeleting : ' (Sletter...)', // Files FileRename : 'Skriv navnet på den nye fil: ', FileRenameExt : 'Er du sikker på, at du vil ændre filtypen? Filen kan muligvis ikke bruges bagefter.', FileRenaming : '(Omdøber...)', FileDelete : 'Er du sikker på, at du vil slette filen "%1" ?', FilesLoading : 'Indlæser...', FilesEmpty : 'Tom mappe', FilesMoved : 'Filen %1 flyttet til %2:%3', FilesCopied : 'Filen %1 kopieret til %2:%3', // Basket BasketFolder : 'Kurv', BasketClear : 'Tøm kurv', BasketRemove : 'Fjern fra kurv', BasketOpenFolder : 'Åben overordnet mappe', BasketTruncateConfirm : 'Er du sikker på at du vil tømme kurven?', BasketRemoveConfirm : 'Er du sikker på at du vil slette filen "%1" fra kurven?', BasketEmpty : 'Ingen filer i kurven, brug musen til at trække filer til kurven.', BasketCopyFilesHere : 'Kopier Filer fra kurven', BasketMoveFilesHere : 'Flyt Filer fra kurven', BasketPasteErrorOther : 'Fil fejl: %e', BasketPasteMoveSuccess : 'Følgende filer blev flyttet: %s', BasketPasteCopySuccess : 'Følgende filer blev kopieret: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Upload', UploadTip : 'Upload ny fil', Refresh : 'Opdatér', Settings : 'Indstillinger', Help : 'Hjælp', HelpTip : 'Hjælp', // Context Menus Select : 'Vælg', SelectThumbnail : 'Vælg thumbnail', View : 'Vis', Download : 'Download', NewSubFolder : 'Ny undermappe', Rename : 'Omdøb', Delete : 'Slet', CopyDragDrop : 'Kopier hertil', MoveDragDrop : 'Flyt hertil', // Dialogs RenameDlgTitle : 'Omdøb', NewNameDlgTitle : 'Nyt navn', FileExistsDlgTitle : 'Filen eksisterer allerede', SysErrorDlgTitle : 'System fejl', FileOverwrite : 'Overskriv', FileAutorename : 'Auto-omdøb', // Generic OkBtn : 'OK', CancelBtn : 'Annullér', CloseBtn : 'Luk', // Upload Panel UploadTitle : 'Upload ny fil', UploadSelectLbl : 'Vælg den fil, som du vil uploade', UploadProgressLbl : '(Uploader, vent venligst...)', UploadBtn : 'Upload filen', UploadBtnCancel : 'Annuller', UploadNoFileMsg : 'Vælg en fil på din computer', UploadNoFolder : 'Venligst vælg en mappe før upload startes.', UploadNoPerms : 'Upload er ikke tilladt.', UploadUnknError : 'Fejl ved upload.', UploadExtIncorrect : 'Denne filtype er ikke tilladt i denne mappe.', // Settings Panel SetTitle : 'Indstillinger', SetView : 'Vis:', SetViewThumb : 'Thumbnails', SetViewList : 'Liste', SetDisplay : 'Thumbnails:', SetDisplayName : 'Filnavn', SetDisplayDate : 'Dato', SetDisplaySize : 'Størrelse', SetSort : 'Sortering:', SetSortName : 'efter filnavn', SetSortDate : 'efter dato', SetSortSize : 'efter størrelse', // Status Bar FilesCountEmpty : '<tom mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Det var ikke muligt at fuldføre handlingen. (Fejl: %1)', Errors : { 10 : 'Ugyldig handling.', 11 : 'Ressourcetypen blev ikke angivet i anmodningen.', 12 : 'Ressourcetypen er ikke gyldig.', 102 : 'Ugyldig fil eller mappenavn.', 103 : 'Det var ikke muligt at fuldføre handlingen på grund af en begrænsning i rettigheder.', 104 : 'Det var ikke muligt at fuldføre handlingen på grund af en begrænsning i filsystem rettigheder.', 105 : 'Ugyldig filtype.', 109 : 'Ugyldig anmodning.', 110 : 'Ukendt fejl.', 115 : 'En fil eller mappe med det samme navn eksisterer allerede.', 116 : 'Mappen blev ikke fundet. Opdatér listen eller prøv igen.', 117 : 'Filen blev ikke fundet. Opdatér listen eller prøv igen.', 118 : 'Originalplacering og destination er ens', 201 : 'En fil med det samme filnavn eksisterer allerede. Den uploadede fil er blevet omdøbt til "%1"', 202 : 'Ugyldig fil.', 203 : 'Ugyldig fil. Filstørrelsen er for stor.', 204 : 'Den uploadede fil er korrupt.', 205 : 'Der er ikke en midlertidig mappe til upload til rådighed på serveren.', 206 : 'Upload annulleret af sikkerhedsmæssige årsager. Filen indeholder HTML-lignende data.', 207 : 'Den uploadede fil er blevet omdøbt til "%1"', 300 : 'Flytning af fil(er) fejlede.', 301 : 'Kopiering af fil(er) fejlede.', 500 : 'Filbrowseren er deaktiveret af sikkerhedsmæssige årsager. Kontakt systemadministratoren eller kontrollér CKFinders konfigurationsfil.', 501 : 'Understøttelse af thumbnails er deaktiveret.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Filnavnet må ikke være tomt', FileExists : 'Fil %erne eksisterer allerede', FolderEmpty : 'Mappenavnet må ikke være tomt', FileInvChar : 'Filnavnet må ikke indeholde et af følgende tegn: \n\\ / : * ? " < > |', FolderInvChar : 'Mappenavnet må ikke indeholde et af følgende tegn: \n\\ / : * ? " < > |', PopupBlockView : 'Det var ikke muligt at åbne filen i et nyt vindue. Kontrollér konfigurationen i din browser, og deaktivér eventuelle popup-blokkere for denne hjemmeside.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Rediger størrelse %s', sizeTooBig : 'Kan ikke ændre billedets højde eller bredde til en værdi større end dets originale størrelse (%size).', resizeSuccess : 'Størrelsen er nu ændret.', thumbnailNew : 'Opret ny thumbnail', thumbnailSmall : 'Lille (%s)', thumbnailMedium : 'Mellem (%s)', thumbnailLarge : 'Stor (%s)', newSize : 'Rediger størrelse', width : 'Bredde', height : 'Højde', invalidHeight : 'Ugyldig højde.', invalidWidth : 'Ugyldig bredde.', invalidName : 'Ugyldigt filenavn.', newImage : 'Opret nyt billede.', noExtensionChange : 'Filtypen kan ikke ændres.', imageSmall : 'Originalfilen er for lille', contextMenuName : 'Rediger størrelse' }, // Fileeditor plugin Fileeditor : { save : 'Gem', fileOpenError : 'Filen kan ikke åbnes.', fileSaveSuccess : 'Filen er nu gemt.', contextMenuName : 'Rediger', loadingFile : 'Henter fil, vent venligst...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['nb'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'no', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mapper', FolderLoading : 'Laster...', FolderNew : 'Skriv inn det nye mappenavnet: ', FolderRename : 'Skriv inn det nye mappenavnet: ', FolderDelete : 'Er du sikker på at du vil slette mappen "%1"?', FolderRenaming : ' (Endrer mappenavn...)', FolderDeleting : ' (Sletter...)', // Files FileRename : 'Skriv inn det nye filnavnet: ', FileRenameExt : 'Er du sikker på at du vil endre filtypen? Filen kan bli ubrukelig', FileRenaming : 'Endrer filnavn...', FileDelete : 'Er du sikker på at du vil slette denne filen "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Last opp', UploadTip : 'Last opp en ny fil', Refresh : 'Oppdater', Settings : 'Innstillinger', Help : 'Hjelp', HelpTip : 'Hjelp finnes kun på engelsk', // Context Menus Select : 'Velg', SelectThumbnail : 'Velg Miniatyr', View : 'Vis fullversjon', Download : 'Last ned', NewSubFolder : 'Ny Undermappe', Rename : 'Endre navn', Delete : 'Slett', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Avbryt', CloseBtn : 'Lukk', // Upload Panel UploadTitle : 'Last opp ny fil', UploadSelectLbl : 'Velg filen du vil laste opp', UploadProgressLbl : '(Laster opp filen, vennligst vent...)', UploadBtn : 'Last opp valgt fil', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Du må velge en fil fra din datamaskin', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Innstillinger', SetView : 'Filvisning:', SetViewThumb : 'Miniatyrbilder', SetViewList : 'Liste', SetDisplay : 'Vis:', SetDisplayName : 'Filnavn', SetDisplayDate : 'Dato', SetDisplaySize : 'Filstørrelse', SetSort : 'Sorter etter:', SetSortName : 'Filnavn', SetSortDate : 'Dato', SetSortSize : 'Størrelse', // Status Bar FilesCountEmpty : '<Tom Mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Det var ikke mulig å utføre forespørselen. (Feil %1)', Errors : { 10 : 'Ugyldig kommando.', 11 : 'Ressurstypen ble ikke spesifisert i forepørselen.', 12 : 'Ugyldig ressurstype.', 102 : 'Ugyldig fil- eller mappenavn.', 103 : 'Kunne ikke utføre forespørselen pga manglende autorisasjon.', 104 : 'Kunne ikke utføre forespørselen pga manglende tilgang til filsystemet.', 105 : 'Ugyldig filtype.', 109 : 'Ugyldig forespørsel.', 110 : 'Ukjent feil.', 115 : 'Det finnes allerede en fil eller mappe med dette navnet.', 116 : 'Kunne ikke finne mappen. Oppdater vinduet og prøv igjen.', 117 : 'Kunne ikke finne filen. Oppdater vinduet og prøv igjen.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Det fantes allerede en fil med dette navnet. Den opplastede filens navn har blitt endret til "%1"', 202 : 'Ugyldig fil', 203 : 'Ugyldig fil. Filen er for stor.', 204 : 'Den opplastede filen er korrupt.', 205 : 'Det finnes ingen midlertidig mappe for filopplastinger.', 206 : 'Opplastingen ble avbrutt av sikkerhetshensyn. Filen inneholder HTML-aktig data.', 207 : 'Den opplastede filens navn har blitt endret til "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Filvelgeren ikke tilgjengelig av sikkerhetshensyn. Kontakt systemansvarlig og be han sjekke CKFinder\'s konfigurasjonsfil.', 501 : 'Funksjon for minityrbilder er skrudd av.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Filnavnet kan ikke være tomt', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Mappenavnet kan ikke være tomt', FileInvChar : 'Filnavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |', FolderInvChar : 'Mappenavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |', PopupBlockView : 'Du må skru av popup-blockeren for å se bildet i nytt vindu.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Chinese (Taiwan) * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['zh-tw'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'zh-tw', LangCode : 'zh-tw', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'mm/dd/yyyy HH:MM', DateAmPm : ['上午', '下午'], // Folders FoldersTitle : '目錄', FolderLoading : '載入中...', FolderNew : '請輸入新目錄名稱: ', FolderRename : '請輸入新目錄名稱: ', FolderDelete : '確定刪除 "%1" 這個目錄嗎?', FolderRenaming : ' (修改目錄...)', FolderDeleting : ' (刪除目錄...)', // Files FileRename : '請輸入新檔案名稱: ', FileRenameExt : '確定變更這個檔案的副檔名嗎? 變更後 , 此檔案可能會無法使用 !', FileRenaming : '修改檔案名稱...', FileDelete : '確定要刪除這個檔案 "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : '上傳檔案', UploadTip : '上傳一個新檔案', Refresh : '重新整理', Settings : '偏好設定', Help : '說明', HelpTip : '說明', // Context Menus Select : '選擇', SelectThumbnail : 'Select Thumbnail', // MISSING View : '瀏覽', Download : '下載', NewSubFolder : '建立新子目錄', Rename : '重新命名', Delete : '刪除', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : '確定', CancelBtn : '取消', CloseBtn : '關閉', // Upload Panel UploadTitle : '上傳新檔案', UploadSelectLbl : '請選擇要上傳的檔案', UploadProgressLbl : '(檔案上傳中 , 請稍候...)', UploadBtn : '將檔案上傳到伺服器', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : '請從你的電腦選擇一個檔案', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : '設定', SetView : '瀏覽方式:', SetViewThumb : '縮圖預覽', SetViewList : '清單列表', SetDisplay : '顯示欄位:', SetDisplayName : '檔案名稱', SetDisplayDate : '檔案日期', SetDisplaySize : '檔案大小', SetSort : '排序方式:', SetSortName : '依 檔案名稱', SetSortDate : '依 檔案日期', SetSortSize : '依 檔案大小', // Status Bar FilesCountEmpty : '<此目錄沒有任何檔案>', FilesCountOne : '1 個檔案', FilesCountMany : '%1 個檔案', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : '無法連接到伺服器 ! (錯誤代碼 %1)', Errors : { 10 : '不合法的指令.', 11 : '連接過程中 , 未指定資源形態 !', 12 : '連接過程中出現不合法的資源形態 !', 102 : '不合法的檔案或目錄名稱 !', 103 : '無法連接:可能是使用者權限設定錯誤 !', 104 : '無法連接:可能是伺服器檔案權限設定錯誤 !', 105 : '無法上傳:不合法的副檔名 !', 109 : '不合法的請求 !', 110 : '不明錯誤 !', 115 : '檔案或目錄名稱重複 !', 116 : '找不到目錄 ! 請先重新整理 , 然後再試一次 !', 117 : '找不到檔案 ! 請先重新整理 , 然後再試一次 !', 118 : 'Source and target paths are equal.', // MISSING 201 : '伺服器上已有相同的檔案名稱 ! 您上傳的檔案名稱將會自動更改為 "%1"', 202 : '不合法的檔案 !', 203 : '不合法的檔案 ! 檔案大小超過預設值 !', 204 : '您上傳的檔案已經損毀 !', 205 : '伺服器上沒有預設的暫存目錄 !', 206 : '檔案上傳程序因為安全因素已被系統自動取消 ! 可能是上傳的檔案內容包含 HTML 碼 !', 207 : '您上傳的檔案名稱將會自動更改為 "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : '因為安全因素 , 檔案瀏覽器已被停用 ! 請聯絡您的系統管理者並檢查 CKFinder 的設定檔 config.php !', 501 : '縮圖預覽功能已被停用 !' }, // Other Error Messages. ErrorMsg : { FileEmpty : '檔案名稱不能空白 !', FileExists : 'File %s already exists', // MISSING FolderEmpty : '目錄名稱不能空白 !', FileInvChar : '檔案名稱不能包含以下字元: \n\\ / : * ? " < > |', FolderInvChar : '目錄名稱不能包含以下字元: \n\\ / : * ? " < > |', PopupBlockView : '無法在新視窗開啟檔案 ! 請檢查瀏覽器的設定並且針對這個網站 關閉 <封鎖彈跳視窗> 這個功能 !' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['el'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'el', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy HH:MM', DateAmPm : ['ΜΜ', 'ΠΜ'], // Folders FoldersTitle : 'Φάκελοι', FolderLoading : 'Φόρτωση...', FolderNew : 'Παρακαλούμε πληκτρολογήστε την ονομασία του νέου φακέλου: ', FolderRename : 'Παρακαλούμε πληκτρολογήστε την νέα ονομασία του φακέλου: ', FolderDelete : 'Είστε σίγουροι ότι θέλετε να διαγράψετε το φάκελο "%1";', FolderRenaming : ' (Μετονομασία...)', FolderDeleting : ' (Διαγραφή...)', // Files FileRename : 'Παρακαλούμε πληκτρολογήστε την νέα ονομασία του αρχείου: ', FileRenameExt : 'Είστε σίγουροι ότι θέλετε να αλλάξετε την επέκταση του αρχείου; Μετά από αυτή την ενέργεια το αρχείο μπορεί να μην μπορεί να χρησιμοποιηθεί', FileRenaming : 'Μετονομασία...', FileDelete : 'Είστε σίγουροι ότι θέλετε να διαγράψετε το αρχείο "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Μεταφόρτωση', UploadTip : 'Μεταφόρτωση Νέου Αρχείου', Refresh : 'Ανανέωση', Settings : 'Ρυθμίσεις', Help : 'Βοήθεια', HelpTip : 'Βοήθεια', // Context Menus Select : 'Επιλογή', SelectThumbnail : 'Επιλογή Μικρογραφίας', View : 'Προβολή', Download : 'Λήψη Αρχείου', NewSubFolder : 'Νέος Υποφάκελος', Rename : 'Μετονομασία', Delete : 'Διαγραφή', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Ακύρωση', CloseBtn : 'Κλείσιμο', // Upload Panel UploadTitle : 'Μεταφόρτωση Νέου Αρχείου', UploadSelectLbl : 'επιλέξτε το αρχείο που θέλετε να μεταφερθεί κάνοντας κλίκ στο κουμπί', UploadProgressLbl : '(Η μεταφόρτωση εκτελείται, παρακαλούμε περιμένετε...)', UploadBtn : 'Μεταφόρτωση Επιλεγμένου Αρχείου', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Παρακαλούμε επιλέξτε ένα αρχείο από τον υπολογιστή σας', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Ρυθμίσεις', SetView : 'Προβολή:', SetViewThumb : 'Μικρογραφίες', SetViewList : 'Λίστα', SetDisplay : 'Εμφάνιση:', SetDisplayName : 'Όνομα Αρχείου', SetDisplayDate : 'Ημερομηνία', SetDisplaySize : 'Μέγεθος Αρχείου', SetSort : 'Ταξινόμηση:', SetSortName : 'βάσει Όνοματος Αρχείου', SetSortDate : 'βάσει Ημερομήνιας', SetSortSize : 'βάσει Μεγέθους', // Status Bar FilesCountEmpty : '<Κενός Φάκελος>', FilesCountOne : '1 αρχείο', FilesCountMany : '%1 αρχεία', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Η ενέργεια δεν ήταν δυνατόν να εκτελεστεί. (Σφάλμα %1)', Errors : { 10 : 'Λανθασμένη Εντολή.', 11 : 'Το resource type δεν ήταν δυνατόν να προσδιορίστεί.', 12 : 'Το resource type δεν είναι έγκυρο.', 102 : 'Το όνομα αρχείου ή φακέλου δεν είναι έγκυρο.', 103 : 'Δεν ήταν δυνατή η εκτέλεση της ενέργειας λόγω έλλειψης δικαιωμάτων ασφαλείας.', 104 : 'Δεν ήταν δυνατή η εκτέλεση της ενέργειας λόγω περιορισμών του συστήματος αρχείων.', 105 : 'Λανθασμένη Επέκταση Αρχείου.', 109 : 'Λανθασμένη Ενέργεια.', 110 : 'Άγνωστο Λάθος.', 115 : 'Το αρχείο ή φάκελος υπάρχει ήδη.', 116 : 'Ο φάκελος δεν βρέθηκε. Παρακαλούμε ανανεώστε τη σελίδα και προσπαθήστε ξανά.', 117 : 'Το αρχείο δεν βρέθηκε. Παρακαλούμε ανανεώστε τη σελίδα και προσπαθήστε ξανά.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Ένα αρχείο με την ίδια ονομασία υπάρχει ήδη. Το μεταφορτωμένο αρχείο μετονομάστηκε σε "%1"', 202 : 'Λανθασμένο Αρχείο', 203 : 'Λανθασμένο Αρχείο. Το μέγεθος του αρχείου είναι πολύ μεγάλο.', 204 : 'Το μεταφορτωμένο αρχείο είναι χαλασμένο.', 205 : 'Δεν υπάρχει προσωρινός φάκελος για να χρησιμοποιηθεί για τις μεταφορτώσεις των αρχείων.', 206 : 'Η μεταφόρτωση ακυρώθηκε για λόγους ασφαλείας. Το αρχείο περιέχει δεδομένα μορφής HTML.', 207 : 'Το μεταφορτωμένο αρχείο μετονομάστηκε σε "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Ο πλοηγός αρχείων έχει απενεργοποιηθεί για λόγους ασφαλείας. Παρακαλούμε επικοινωνήστε με τον διαχειριστή της ιστοσελίδας και ελέγξτε το αρχείο ρυθμίσεων του πλοηγού (CKFinder).', 501 : 'Η υποστήριξη των μικρογραφιών έχει απενεργοποιηθεί.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Η ονομασία του αρχείου δεν μπορεί να είναι κενή', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Η ονομασία του φακέλου δεν μπορεί να είναι κενή', FileInvChar : 'Η ονομασία του αρχείου δεν μπορεί να περιέχει τους ακόλουθους χαρακτήρες: \n\\ / : * ? " < > |', FolderInvChar : 'Η ονομασία του φακέλου δεν μπορεί να περιέχει τους ακόλουθους χαρακτήρες: \n\\ / : * ? " < > |', PopupBlockView : 'Δεν ήταν εφικτό να ανοίξει το αρχείο σε νέο παράθυρο. Παρακαλώ, ελέγξτε τις ρυθμίσεις τους πλοηγού σας και απενεργοποιήστε όλους τους popup blockers για αυτή την ιστοσελίδα.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Spanish * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['es'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, no disponible</span>', confirmCancel : 'Algunas opciones se han cambiado\r\n¿Está seguro de querer cerrar el diálogo?', ok : 'Aceptar', cancel : 'Cancelar', confirmationTitle : 'Confirmación', messageTitle : 'Información', inputTitle : 'Pregunta', undo : 'Deshacer', redo : 'Rehacer', skip : 'Omitir', skipAll : 'Omitir todos', makeDecision : '¿Qué acción debe realizarse?', rememberDecision: 'Recordar mi decisión' }, dir : 'ltr', HelpLang : 'es', LangCode : 'es', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Carpetas', FolderLoading : 'Cargando...', FolderNew : 'Por favor, escriba el nombre para la nueva carpeta: ', FolderRename : 'Por favor, escriba el nuevo nombre para la carpeta: ', FolderDelete : '¿Está seguro de que quiere borrar la carpeta "%1"?', FolderRenaming : ' (Renombrando...)', FolderDeleting : ' (Borrando...)', // Files FileRename : 'Por favor, escriba el nuevo nombre del fichero: ', FileRenameExt : '¿Está seguro de querer cambiar la extensión del fichero? El fichero puede dejar de ser usable', FileRenaming : 'Renombrando...', FileDelete : '¿Está seguro de que quiere borrar el fichero "%1"?', FilesLoading : 'Cargando...', FilesEmpty : 'Carpeta vacía', FilesMoved : 'Fichero %1 movido a %2:%3', FilesCopied : 'Fichero %1 copiado a %2:%3', // Basket BasketFolder : 'Cesta', BasketClear : 'Vaciar cesta', BasketRemove : 'Quitar de la cesta', BasketOpenFolder : 'Abrir carpeta padre', BasketTruncateConfirm : '¿Está seguro de querer quitar todos los ficheros de la cesta?', BasketRemoveConfirm : '¿Está seguro de querer quitar el fichero "%1" de la cesta?', BasketEmpty : 'No hay ficheros en la cesta, arrastra y suelta algunos.', BasketCopyFilesHere : 'Copiar ficheros de la cesta', BasketMoveFilesHere : 'Mover ficheros de la cesta', BasketPasteErrorOther : 'Fichero %s error: %e', BasketPasteMoveSuccess : 'Los siguientes ficheros han sido movidos: %s', BasketPasteCopySuccess : 'Los siguientes ficheros han sido copiados: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Añadir', UploadTip : 'Añadir nuevo fichero', Refresh : 'Actualizar', Settings : 'Configuración', Help : 'Ayuda', HelpTip : 'Ayuda', // Context Menus Select : 'Seleccionar', SelectThumbnail : 'Seleccionar el icono', View : 'Ver', Download : 'Descargar', NewSubFolder : 'Nueva Subcarpeta', Rename : 'Renombrar', Delete : 'Borrar', CopyDragDrop : 'Copiar fichero aquí', MoveDragDrop : 'Mover fichero aquí', // Dialogs RenameDlgTitle : 'Renombrar', NewNameDlgTitle : 'Nuevo nombre', FileExistsDlgTitle : 'Fichero existente', SysErrorDlgTitle : 'Error de sistema', FileOverwrite : 'Sobreescribir', FileAutorename : 'Auto-renombrar', // Generic OkBtn : 'Aceptar', CancelBtn : 'Cancelar', CloseBtn : 'Cerrar', // Upload Panel UploadTitle : 'Añadir nuevo fichero', UploadSelectLbl : 'Elija el fichero a subir', UploadProgressLbl : '(Subida en progreso, por favor espere...)', UploadBtn : 'Subir el fichero elegido', UploadBtnCancel : 'Cancelar', UploadNoFileMsg : 'Por favor, elija un fichero de su ordenador', UploadNoFolder : 'Por favor, escoja la carpeta antes de iniciar la subida.', UploadNoPerms : 'No puede subir ficheros.', UploadUnknError : 'Error enviando el fichero.', UploadExtIncorrect : 'La extensión del fichero no está permitida en esta carpeta.', // Settings Panel SetTitle : 'Configuración', SetView : 'Vista:', SetViewThumb : 'Iconos', SetViewList : 'Lista', SetDisplay : 'Mostrar:', SetDisplayName : 'Nombre de fichero', SetDisplayDate : 'Fecha', SetDisplaySize : 'Peso del fichero', SetSort : 'Ordenar:', SetSortName : 'por Nombre', SetSortDate : 'por Fecha', SetSortSize : 'por Peso', // Status Bar FilesCountEmpty : '<Carpeta vacía>', FilesCountOne : '1 fichero', FilesCountMany : '%1 ficheros', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'No ha sido posible completar la solicitud. (Error %1)', Errors : { 10 : 'Comando incorrecto.', 11 : 'El tipo de recurso no ha sido especificado en la solicitud.', 12 : 'El tipo de recurso solicitado no es válido.', 102 : 'Nombre de fichero o carpeta no válido.', 103 : 'No se ha podido completar la solicitud debido a las restricciones de autorización.', 104 : 'No ha sido posible completar la solicitud debido a restricciones en el sistema de ficheros.', 105 : 'La extensión del archivo no es válida.', 109 : 'Petición inválida.', 110 : 'Error desconocido.', 115 : 'Ya existe un fichero o carpeta con ese nombre.', 116 : 'No se ha encontrado la carpeta. Por favor, actualice y pruebe de nuevo.', 117 : 'No se ha encontrado el fichero. Por favor, actualice la lista de ficheros y pruebe de nuevo.', 118 : 'Las rutas origen y destino son iguales.', 201 : 'Ya existía un fichero con ese nombre. El fichero subido ha sido renombrado como "%1"', 202 : 'Fichero inválido', 203 : 'Fichero inválido. El peso es demasiado grande.', 204 : 'El fichero subido está corrupto.', 205 : 'La carpeta temporal no está disponible en el servidor para las subidas.', 206 : 'La subida se ha cancelado por razones de seguridad. El fichero contenía código HTML.', 207 : 'El fichero subido ha sido renombrado como "%1"', 300 : 'Ha fallado el mover el(los) fichero(s).', 301 : 'Ha fallado el copiar el(los) fichero(s).', 500 : 'El navegador de archivos está deshabilitado por razones de seguridad. Por favor, contacte con el administrador de su sistema y compruebe el fichero de configuración de CKFinder.', 501 : 'El soporte para iconos está deshabilitado.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'El nombre del fichero no puede estar vacío', FileExists : 'El fichero %s ya existe', FolderEmpty : 'El nombre de la carpeta no puede estar vacío', FileInvChar : 'El nombre del fichero no puede contener ninguno de los caracteres siguientes: \n\\ / : * ? " < > |', FolderInvChar : 'El nombre de la carpeta no puede contener ninguno de los caracteres siguientes: \n\\ / : * ? " < > |', PopupBlockView : 'No ha sido posible abrir el fichero en una nueva ventana. Por favor, configure su navegador y desactive todos los bloqueadores de ventanas para esta página.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Redimensionar %s', sizeTooBig : 'No se puede poner la altura o anchura de la imagen mayor que las dimensiones originales (%size).', resizeSuccess : 'Imagen redimensionada correctamente.', thumbnailNew : 'Crear nueva minuatura', thumbnailSmall : 'Pequeña (%s)', thumbnailMedium : 'Mediana (%s)', thumbnailLarge : 'Grande (%s)', newSize : 'Establecer nuevo tamaño', width : 'Ancho', height : 'Alto', invalidHeight : 'Altura inválida.', invalidWidth : 'Anchura inválida.', invalidName : 'Nombre no válido.', newImage : 'Crear nueva imagen', noExtensionChange : 'La extensión no se puede cambiar.', imageSmall : 'La imagen original es demasiado pequeña', contextMenuName : 'Redimensionar' }, // Fileeditor plugin Fileeditor : { save : 'Guardar', fileOpenError : 'No se puede abrir el fichero.', fileSaveSuccess : 'Fichero guardado correctamente.', contextMenuName : 'Editar', loadingFile : 'Cargando fichero, por favor espere...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Finnish * language. Translated in Finnish 2010-12-15 by Petteri Salmela. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['fi'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, ei käytettävissä</span>', confirmCancel : 'Valintoja on muutettu. Suljetaanko ikkuna kuitenkin?', ok : 'OK', cancel : 'Peru', confirmationTitle : 'Varmistus', messageTitle : 'Ilmoitus', inputTitle : 'Kysymys', undo : 'Peru', redo : 'Tee uudelleen', skip : 'Ohita', skipAll : 'Ohita kaikki', makeDecision : 'Mikä toiminto suoritetaan?', rememberDecision: 'Muista valintani' }, dir : 'ltr', HelpLang : 'fi', LangCode : 'fi', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'yyyy-mm-dd HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Kansiot', FolderLoading : 'Lataan...', FolderNew : 'Kirjoita uuden kansion nimi: ', FolderRename : 'Kirjoita uusi nimi kansiolle ', FolderDelete : 'Haluatko varmasti poistaa kansion "%1"?', FolderRenaming : ' (Uudelleennimeää...)', FolderDeleting : ' (Poistaa...)', // Files FileRename : 'Kirjoita uusi tiedostonimi: ', FileRenameExt : 'Haluatko varmasti muuttaa tiedostotarkennetta? Tiedosto voi muuttua käyttökelvottomaksi.', FileRenaming : 'Uudelleennimeää...', FileDelete : 'Haluatko varmasti poistaa tiedoston "%1"?', FilesLoading : 'Lataa...', FilesEmpty : 'Tyhjä kansio.', FilesMoved : 'Tiedosto %1 siirretty nimelle %2:%3', FilesCopied : 'Tiedosto %1 kopioitu nimelle %2:%3', // Basket BasketFolder : 'Kori', BasketClear : 'Tyhjennä kori', BasketRemove : 'Poista korista', BasketOpenFolder : 'Avaa ylemmän tason kansio', BasketTruncateConfirm : 'Haluatko todella poistaa kaikki tiedostot korista?', BasketRemoveConfirm : 'Haluatko todella poistaa tiedoston "%1" korista?', BasketEmpty : 'Korissa ei ole tiedostoja. Lisää raahaamalla.', BasketCopyFilesHere : 'Kopioi tiedostot korista.', BasketMoveFilesHere : 'Siirrä tiedostot korista.', BasketPasteErrorOther : 'Tiedoston %s virhe: %e', BasketPasteMoveSuccess : 'Seuraavat tiedostot siirrettiin: %s', BasketPasteCopySuccess : 'Seuraavat tiedostot kopioitiin: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Lataa palvelimelle', UploadTip : 'Lataa uusi tiedosto palvelimelle', Refresh : 'Päivitä', Settings : 'Asetukset', Help : 'Apua', HelpTip : 'Apua', // Context Menus Select : 'Valitse', SelectThumbnail : 'Valitse esikatselukuva', View : 'Näytä', Download : 'Lataa palvelimelta', NewSubFolder : 'Uusi alikansio', Rename : 'Uudelleennimeä ', Delete : 'Poista', CopyDragDrop : 'Kopioi tiedosto tähän', MoveDragDrop : 'Siirrä tiedosto tähän', // Dialogs RenameDlgTitle : 'Nimeä uudelleen', NewNameDlgTitle : 'Uusi nimi', FileExistsDlgTitle : 'Tiedostonimi on jo olemassa!', SysErrorDlgTitle : 'Järjestelmävirhe', FileOverwrite : 'Ylikirjoita', FileAutorename : 'Nimeä uudelleen automaattisesti', // Generic OkBtn : 'OK', CancelBtn : 'Peru', CloseBtn : 'Sulje', // Upload Panel UploadTitle : 'Lataa uusi tiedosto palvelimelle', UploadSelectLbl : 'Valitse ladattava tiedosto', UploadProgressLbl : '(Lataaminen palvelimelle käynnissä...)', UploadBtn : 'Lataa valittu tiedosto palvelimelle', UploadBtnCancel : 'Peru', UploadNoFileMsg : 'Valitse tiedosto tietokoneeltasi.', UploadNoFolder : 'Valitse kansio ennen palvelimelle lataamista.', UploadNoPerms : 'Tiedoston lataaminen palvelimelle evätty.', UploadUnknError : 'Tiedoston siirrossa tapahtui virhe.', UploadExtIncorrect : 'Tiedostotarkenne ei ole sallittu valitussa kansiossa.', // Settings Panel SetTitle : 'Asetukset', SetView : 'Näkymä:', SetViewThumb : 'Esikatselukuvat', SetViewList : 'Luettelo', SetDisplay : 'Näytä:', SetDisplayName : 'Tiedostonimi', SetDisplayDate : 'Päivämäärä', SetDisplaySize : 'Tiedostokoko', SetSort : 'Lajittele:', SetSortName : 'aakkosjärjestykseen', SetSortDate : 'päivämäärän mukaan', SetSortSize : 'tiedostokoon mukaan', // Status Bar FilesCountEmpty : '<Tyhjä kansio>', FilesCountOne : '1 tiedosto', FilesCountMany : '%1 tiedostoa', // Size and Speed Kb : '%1 kt', KbPerSecond : '%1 kt/s', // Connector Error Messages. ErrorUnknown : 'Pyyntöä ei voitu suorittaa. (Virhe %1)', Errors : { 10 : 'Virheellinen komento.', 11 : 'Pyynnön resurssityyppi on määrittelemättä.', 12 : 'Pyynnön resurssityyppi on virheellinen.', 102 : 'Virheellinen tiedosto- tai kansionimi.', 103 : 'Oikeutesi eivät riitä pyynnön suorittamiseen.', 104 : 'Tiedosto-oikeudet eivät riitä pyynnön suorittamiseen.', 105 : 'Virheellinen tiedostotarkenne.', 109 : 'Virheellinen pyyntö.', 110 : 'Tuntematon virhe.', 115 : 'Samanniminen tiedosto tai kansio on jo olemassa.', 116 : 'Kansiota ei löydy. Yritä uudelleen kansiopäivityksen jälkeen.', 117 : 'Tiedostoa ei löydy. Yritä uudelleen kansiopäivityksen jälkeen.', 118 : 'Lähde- ja kohdekansio on sama!', 201 : 'Samanniminen tiedosto on jo olemassa. Palvelimelle ladattu tiedosto on nimetty: "%1"', 202 : 'Virheellinen tiedosto', 203 : 'Virheellinen tiedosto. Tiedostokoko on liian suuri.', 204 : 'Palvelimelle ladattu tiedosto on vioittunut.', 205 : 'Väliaikaishakemistoa ei ole määritetty palvelimelle lataamista varten.', 206 : 'Palvelimelle lataaminen on peruttu turvallisuussyistä. Tiedosto sisältää HTML-tyylistä dataa.', 207 : 'Palvelimelle ladattu tiedosto on nimetty: "%1"', 300 : 'Tiedostosiirto epäonnistui.', 301 : 'Tiedostokopiointi epäonnistui.', 500 : 'Tiedostoselain on kytketty käytöstä turvallisuussyistä. Pyydä pääkäyttäjää tarkastamaan CKFinderin asetustiedosto.', 501 : 'Esikatselukuvien tuki on kytketty toiminnasta.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Tiedosto on nimettävä!', FileExists : 'Tiedosto %s on jo olemassa', FolderEmpty : 'Kansio on nimettävä!', FileInvChar : 'Tiedostonimi ei voi sisältää seuraavia merkkejä: \n\\ / : * ? " < > |', FolderInvChar : 'Kansionimi ei voi sisältää seuraavia merkkejä: \n\\ / : * ? " < > |', PopupBlockView : 'Tiedostoa ei voitu avata uuteen ikkunaan. Salli selaimesi asetuksissa ponnahdusikkunat tälle sivulle.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Muuta kokoa %s', sizeTooBig : 'Kuvan mittoja ei voi asettaa alkuperäistä suuremmiksi(%size).', resizeSuccess : 'Kuvan koon muuttaminen onnistui.', thumbnailNew : 'Luo uusi esikatselukuva.', thumbnailSmall : 'Pieni (%s)', thumbnailMedium : 'Keskikokoinen (%s)', thumbnailLarge : 'Suuri (%s)', newSize : 'Aseta uusi koko', width : 'Leveys', height : 'Korkeus', invalidHeight : 'Viallinen korkeus.', invalidWidth : 'Viallinen leveys.', invalidName : 'Viallinen tiedostonimi.', newImage : 'Luo uusi kuva', noExtensionChange : 'Tiedostomäärettä ei voi vaihtaa.', imageSmall : 'Lähdekuva on liian pieni', contextMenuName : 'Muuta kokoa' }, // Fileeditor plugin Fileeditor : { save : 'Tallenna', fileOpenError : 'Tiedostoa ei voi avata.', fileSaveSuccess : 'Tiedoston tallennus onnistui.', contextMenuName : 'Muokkaa', loadingFile : 'Tiedostoa ladataan ...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['no'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'no', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mapper', FolderLoading : 'Laster...', FolderNew : 'Skriv inn det nye mappenavnet: ', FolderRename : 'Skriv inn det nye mappenavnet: ', FolderDelete : 'Er du sikker på at du vil slette mappen "%1"?', FolderRenaming : ' (Endrer mappenavn...)', FolderDeleting : ' (Sletter...)', // Files FileRename : 'Skriv inn det nye filnavnet: ', FileRenameExt : 'Er du sikker på at du vil endre filtypen? Filen kan bli ubrukelig', FileRenaming : 'Endrer filnavn...', FileDelete : 'Er du sikker på at du vil slette denne filen "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Last opp', UploadTip : 'Last opp en ny fil', Refresh : 'Oppdater', Settings : 'Innstillinger', Help : 'Hjelp', HelpTip : 'Hjelp finnes kun på engelsk', // Context Menus Select : 'Velg', SelectThumbnail : 'Velg Miniatyr', View : 'Vis fullversjon', Download : 'Last ned', NewSubFolder : 'Ny Undermappe', Rename : 'Endre navn', Delete : 'Slett', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Avbryt', CloseBtn : 'Lukk', // Upload Panel UploadTitle : 'Last opp ny fil', UploadSelectLbl : 'Velg filen du vil laste opp', UploadProgressLbl : '(Laster opp filen, vennligst vent...)', UploadBtn : 'Last opp valgt fil', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Du må velge en fil fra din datamaskin', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Innstillinger', SetView : 'Filvisning:', SetViewThumb : 'Miniatyrbilder', SetViewList : 'Liste', SetDisplay : 'Vis:', SetDisplayName : 'Filnavn', SetDisplayDate : 'Dato', SetDisplaySize : 'Filstørrelse', SetSort : 'Sorter etter:', SetSortName : 'Filnavn', SetSortDate : 'Dato', SetSortSize : 'Størrelse', // Status Bar FilesCountEmpty : '<Tom Mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Det var ikke mulig å utføre forespørselen. (Feil %1)', Errors : { 10 : 'Ugyldig kommando.', 11 : 'Ressurstypen ble ikke spesifisert i forepørselen.', 12 : 'Ugyldig ressurstype.', 102 : 'Ugyldig fil- eller mappenavn.', 103 : 'Kunne ikke utføre forespørselen pga manglende autorisasjon.', 104 : 'Kunne ikke utføre forespørselen pga manglende tilgang til filsystemet.', 105 : 'Ugyldig filtype.', 109 : 'Ugyldig forespørsel.', 110 : 'Ukjent feil.', 115 : 'Det finnes allerede en fil eller mappe med dette navnet.', 116 : 'Kunne ikke finne mappen. Oppdater vinduet og prøv igjen.', 117 : 'Kunne ikke finne filen. Oppdater vinduet og prøv igjen.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Det fantes allerede en fil med dette navnet. Den opplastede filens navn har blitt endret til "%1"', 202 : 'Ugyldig fil', 203 : 'Ugyldig fil. Filen er for stor.', 204 : 'Den opplastede filen er korrupt.', 205 : 'Det finnes ingen midlertidig mappe for filopplastinger.', 206 : 'Opplastingen ble avbrutt av sikkerhetshensyn. Filen inneholder HTML-aktig data.', 207 : 'Den opplastede filens navn har blitt endret til "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Filvelgeren ikke tilgjengelig av sikkerhetshensyn. Kontakt systemansvarlig og be han sjekke CKFinder\'s konfigurasjonsfil.', 501 : 'Funksjon for minityrbilder er skrudd av.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Filnavnet kan ikke være tomt', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Mappenavnet kan ikke være tomt', FileInvChar : 'Filnavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |', FolderInvChar : 'Mappenavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |', PopupBlockView : 'Du må skru av popup-blockeren for å se bildet i nytt vindu.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Latvian * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['lv'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'lv', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mapes', FolderLoading : 'Ielādē...', FolderNew : 'Lūdzu ierakstiet mapes nosaukumu: ', FolderRename : 'Lūdzu ierakstiet jauno mapes nosaukumu: ', FolderDelete : 'Vai tiešām vēlaties neatgriezeniski dzēst mapi "%1"?', FolderRenaming : ' (Pārsauc...)', FolderDeleting : ' (Dzēš...)', // Files FileRename : 'Lūdzu ierakstiet jauno faila nosaukumu: ', FileRenameExt : 'Vai tiešām vēlaties mainīt faila paplašinājumu? Fails var palikt nelietojams.', FileRenaming : 'Pārsauc...', FileDelete : 'Vai tiešām vēlaties neatgriezeniski dzēst failu "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Augšupielādēt', UploadTip : 'Augšupielādēt jaunu failu', Refresh : 'Pārlādēt', Settings : 'Uzstādījumi', Help : 'Palīdzība', HelpTip : 'Palīdzība', // Context Menus Select : 'Izvēlēties', SelectThumbnail : 'Izvēlēties sīkbildi', View : 'Skatīt', Download : 'Lejupielādēt', NewSubFolder : 'Jauna apakšmape', Rename : 'Pārsaukt', Delete : 'Dzēst', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'Labi', CancelBtn : 'Atcelt', CloseBtn : 'Aizvērt', // Upload Panel UploadTitle : 'Jauna faila augšupielādēšana', UploadSelectLbl : 'Izvēlaties failu, ko augšupielādēt', UploadProgressLbl : '(Augšupielādē, lūdzu uzgaidiet...)', UploadBtn : 'Augšupielādēt izvēlēto failu', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Lūdzu izvēlaties failu no sava datora', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Uzstādījumi', SetView : 'Attēlot:', SetViewThumb : 'Sīkbildes', SetViewList : 'Failu Sarakstu', SetDisplay : 'Rādīt:', SetDisplayName : 'Faila Nosaukumu', SetDisplayDate : 'Datumu', SetDisplaySize : 'Faila Izmēru', SetSort : 'Kārtot:', SetSortName : 'pēc Faila Nosaukuma', SetSortDate : 'pēc Datuma', SetSortSize : 'pēc Izmēra', // Status Bar FilesCountEmpty : '<Tukša mape>', FilesCountOne : '1 fails', FilesCountMany : '%1 faili', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Nebija iespējams pabeigt pieprasījumu. (Kļūda %1)', Errors : { 10 : 'Nederīga komanda.', 11 : 'Resursa veids netika norādīts pieprasījumā.', 12 : 'Pieprasītais resursa veids nav derīgs.', 102 : 'Nederīgs faila vai mapes nosaukums.', 103 : 'Nav iespējams pabeigt pieprasījumu, autorizācijas aizliegumu dēļ.', 104 : 'Nav iespējams pabeigt pieprasījumu, failu sistēmas atļauju ierobežojumu dēļ.', 105 : 'Neatļauts faila paplašinājums.', 109 : 'Nederīgs pieprasījums.', 110 : 'Nezināma kļūda.', 115 : 'Fails vai mape ar šādu nosaukumu jau pastāv.', 116 : 'Mape nav atrasta. Lūdzu pārlādējiet šo logu un mēģiniet vēlreiz.', 117 : 'Fails nav atrasts. Lūdzu pārlādējiet failu sarakstu un mēģiniet vēlreiz.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Fails ar šādu nosaukumu jau eksistē. Augšupielādētais fails tika pārsaukts par "%1"', 202 : 'Nederīgs fails', 203 : 'Nederīgs fails. Faila izmērs pārsniedz pieļaujamo.', 204 : 'Augšupielādētais fails ir bojāts.', 205 : 'Neviena pagaidu mape nav pieejama priekš augšupielādēšanas uz servera.', 206 : 'Augšupielāde atcelta drošības apsvērumu dēļ. Fails satur HTML veida datus.', 207 : 'Augšupielādētais fails tika pārsaukts par "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Failu pārlūks ir atslēgts drošības apsvērumu dēļ. Lūdzu sazinieties ar šīs sistēmas tehnisko administratoru vai pārbaudiet CKFinder konfigurācijas failu.', 501 : 'Sīkbilžu atbalsts ir atslēgts.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Faila nosaukumā nevar būt tukšums', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Mapes nosaukumā nevar būt tukšums', FileInvChar : 'Faila nosaukums nedrīkst saturēt nevienu no sekojošajām zīmēm: \n\\ / : * ? " < > |', FolderInvChar : 'Mapes nosaukums nedrīkst saturēt nevienu no sekojošajām zīmēm: \n\\ / : * ? " < > |', PopupBlockView : 'Nav iespējams failu atvērt jaunā logā. Lūdzu veiciet izmaiņas uzstādījumos savai interneta pārlūkprogrammai un izslēdziet visus uznirstošo logu bloķētājus šai adresei.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the English * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['he'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, לא נגיש</span>', confirmCancel : 'חקל ממאפיינים שונו. ברצונך לסגור חלון?', ok : 'אישור', cancel : 'ביטול', confirmationTitle : 'אישור', messageTitle : 'מידע', inputTitle : 'שאלה', undo : 'לבטל', redo : 'לעשות שוב', skip : 'דלג', skipAll : 'דלג הכל', makeDecision : 'איזו פעולה לבצע?', rememberDecision: 'זכור החלטתי' }, dir : 'rtl', HelpLang : 'en', LangCode : 'he', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'm/d/yyyy h:MM aa', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'תיקיות', FolderLoading : 'טוען...', FolderNew : 'הקלד שם חדש לתיקיה: ', FolderRename : 'הקלד שם חדש לתיקיה: ', FolderDelete : 'האם ברצונך למחוק תיקיה "%1" ?', FolderRenaming : ' (משנה שם...)', FolderDeleting : ' (מוחק...)', // Files FileRename : 'הקלש שם חדש לקובץ: ', FileRenameExt : 'האם ברוצונך לשנות טיפוס של הקובץ', FileRenaming : 'משנה שם...', FileDelete : 'האם ברצונך למחוק קובץ "%1"?', FilesLoading : 'טוען...', FilesEmpty : 'תיקיה ריקה', FilesMoved : 'קובץ %1 הוזז ל- %2:%3', FilesCopied : 'קובץ %1 הועתק ל- %2:%3', // Basket BasketFolder : 'סל', BasketClear : 'נקה סל', BasketRemove : 'הורד מסל', BasketOpenFolder : 'פתח תיקיית אב', BasketTruncateConfirm : 'האם ברוצונך למחוק את כל הקבצים מסל?', BasketRemoveConfirm : 'האם ברוצונך למחוק את קובץ "%1" מסל?', BasketEmpty : 'אין קבצים בסל, גרור ושחרר משהוא.', BasketCopyFilesHere : 'העתק קבצים מסל', BasketMoveFilesHere : 'הזז קבצים מסל', BasketPasteErrorOther : 'קובץ %s שגיאה: %e', BasketPasteMoveSuccess : 'קבצים הבאים הוזזו: %s', BasketPasteCopySuccess : 'קבצים הבאים הועתקו: %s', // Toolbar Buttons (some used elsewhere) Upload : 'העלאה', UploadTip : 'לעלות קובץ חדש', Refresh : 'רענון', Settings : 'הגדרות', Help : 'עזרה', HelpTip : 'עזרה', // Context Menus Select : 'בחר', SelectThumbnail : 'בחר תמונה קטנה', View : 'צפה', Download : 'הורד', NewSubFolder : 'תת-תיקיה חדשה', Rename : 'שנה שם', Delete : 'מחק', CopyDragDrop : 'העתק קבצים לכאן', MoveDragDrop : 'הזז קבצים לכאן', // Dialogs RenameDlgTitle : 'שנה שם', NewNameDlgTitle : 'שם חדש', FileExistsDlgTitle : 'קובץ כבר קיים', SysErrorDlgTitle : 'שגיעת מערכת', FileOverwrite : 'החלף', FileAutorename : 'אוטומטית לשנות שם', // Generic OkBtn : 'אישור', CancelBtn : 'ביטול', CloseBtn : 'סגור', // Upload Panel UploadTitle : 'העלאת קובץ חדש', UploadSelectLbl : 'בחר קובץ להעלאה', UploadProgressLbl : '(העלאה בתהליך, אנא המתן...)', UploadBtn : 'לעלות קובץ', UploadBtnCancel : 'ביטול', UploadNoFileMsg : 'נא לבחור קובץ מהמחשב שלך', UploadNoFolder : 'נא לבחור תיקיה לפני העלאה.', UploadNoPerms : 'העלאת קובץ אסורה.', UploadUnknError : 'שגיעה בשליחת קובץ.', UploadExtIncorrect : 'סוג קובץ זה לא מאושר בתיקיה זאת.', // Settings Panel SetTitle : 'הגדרות', SetView : 'צפה:', SetViewThumb : 'תמונות קטנות', SetViewList : 'רשימה', SetDisplay : 'תצוגה:', SetDisplayName : 'שם קובץ', SetDisplayDate : 'תאריך', SetDisplaySize : 'גודל קובץ', SetSort : 'מיון:', SetSortName : 'לפי שם', SetSortDate : 'לפי תאריך', SetSortSize : 'לפי גודל', // Status Bar FilesCountEmpty : '<תיקיה ריקה>', FilesCountOne : 'קובץ 1', FilesCountMany : '%1 קבצים', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'בקשה נכשלה. שגיאה. (Error %1)', Errors : { 10 : 'Invalid command.', 11 : 'The resource type was not specified in the request.', 12 : 'The requested resource type is not valid.', 102 : 'Invalid file or folder name.', 103 : 'It was not possible to complete the request due to authorization restrictions.', 104 : 'It was not possible to complete the request due to file system permission restrictions.', 105 : 'Invalid file extension.', 109 : 'Invalid request.', 110 : 'Unknown error.', 115 : 'A file or folder with the same name already exists.', 116 : 'Folder not found. Please refresh and try again.', 117 : 'File not found. Please refresh the files list and try again.', 118 : 'Source and target paths are equal.', 201 : 'A file with the same name is already available. The uploaded file has been renamed to "%1"', 202 : 'Invalid file', 203 : 'Invalid file. The file size is too big.', 204 : 'The uploaded file is corrupt.', 205 : 'No temporary folder is available for upload in the server.', 206 : 'Upload cancelled for security reasons. The file contains HTML like data.', 207 : 'The uploaded file has been renamed to "%1"', 300 : 'Moving file(s) failed.', 301 : 'Copying file(s) failed.', 500 : 'The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.', 501 : 'The thumbnails support is disabled.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'שם קובץ לא יכול להיות ריק', FileExists : 'קובץ %s already exists', FolderEmpty : 'שם תיקיה לא יכול להיות ריק', FileInvChar : 'שם הקובץ לא יכול לכלול תווים הבאים: \n\\ / : * ? " < > |', FolderInvChar : 'שם התיקיה לא יכול לכלול תווים הבאים: \n\\ / : * ? " < > |', PopupBlockView : 'בלתי אפשרי לפתוח קובץ בחלון חדש. נא לבדוק הגדרות דפדפן ולבטל כל החוסמים חלונות קופצות.' }, // Imageresize plugin Imageresize : { dialogTitle : 'שנה גודל %s', sizeTooBig : 'לא יכול לקבוע גובה ורוחב של תמונה יותר גדול מדודל מקורי (%size).', resizeSuccess : 'גודל שונה שהצלחה.', thumbnailNew : 'ליצור תמונה קטנה)טומבנייל(', thumbnailSmall : 'קטן (%s)', thumbnailMedium : 'בינוני (%s)', thumbnailLarge : 'גדול (%s)', newSize : 'קבע גודל חדש', width : 'רוחב', height : 'גובה', invalidHeight : 'גובה לא חוקי.', invalidWidth : 'רוחב לא חוקי.', invalidName : 'שם קובץ לא חוקי.', newImage : 'ליצור תמונה חדשה', noExtensionChange : 'לא ניתן לשנות סוג קובץ.', imageSmall : 'מקור תמונה קטן מדי', contextMenuName : 'שנה גודל' }, // Fileeditor plugin Fileeditor : { save : 'שמור', fileOpenError : 'לא מצליח לפתוח קובץ.', fileSaveSuccess : 'קובץ משמר בהצלחה.', contextMenuName : 'עריכה', loadingFile : 'טוען קובץ, אנא המתן...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Slovenian * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['sl'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nedostopen</span>', confirmCancel : 'Nekatere opcije so bile spremenjene. Ali res želite zapreti pogovorno okno?', ok : 'Potrdi', cancel : 'Prekliči', confirmationTitle : 'Potrditev', messageTitle : 'Informacija', inputTitle : 'Vprašanje', undo : 'Razveljavi', redo : 'Obnovi', skip : 'Preskoči', skipAll : 'Preskoči vse', makeDecision : 'Katera aktivnost naj se izvede?', rememberDecision: 'Zapomni si mojo izbiro' }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'sl', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'd.m.yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mape', FolderLoading : 'Nalagam...', FolderNew : 'Vnesite ime za novo mapo: ', FolderRename : 'Vnesite ime nove mape: ', FolderDelete : 'Ali ste prepričani, da želite zbrisati mapo "%1"?', FolderRenaming : ' (Preimenujem...)', FolderDeleting : ' (Brišem...)', // Files FileRename : 'Vnesite novo ime datoteke: ', FileRenameExt : 'Ali ste prepričani, da želite spremeniti končnico datoteke? Možno je, da potem datoteka ne bo uporabna.', FileRenaming : 'Preimenujem...', FileDelete : 'Ali ste prepričani, da želite izbrisati datoteko "%1"?', FilesLoading : 'Nalagam...', FilesEmpty : 'Prazna mapa', FilesMoved : 'Datoteka %1 je bila premaknjena v %2:%3', FilesCopied : 'Datoteka %1 je bila kopirana v %2:%3', // Basket BasketFolder : 'Koš', BasketClear : 'Izprazni koš', BasketRemove : 'Odstrani iz koša', BasketOpenFolder : 'Odpri izvorno mapo', BasketTruncateConfirm : 'Ali res želite odstraniti vse datoteke iz koša?', BasketRemoveConfirm : 'Ali res želite odstraniti datoteko "%1" iz koša?', BasketEmpty : 'V košu ni datotek. Lahko jih povlečete in spustite.', BasketCopyFilesHere : 'Kopiraj datoteke iz koša', BasketMoveFilesHere : 'Premakni datoteke iz koša', BasketPasteErrorOther : 'Napaka z datoteko %s: %e', BasketPasteMoveSuccess : 'Seznam premaknjenih datotek: %s', BasketPasteCopySuccess : 'Seznam kopiranih datotek: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Naloži na strežnik', UploadTip : 'Naloži novo datoteko na strežnik', Refresh : 'Osveži', Settings : 'Nastavitve', Help : 'Pomoč', HelpTip : 'Pomoč', // Context Menus Select : 'Izberi', SelectThumbnail : 'Izberi malo sličico (predogled)', View : 'Predogled', Download : 'Prenesi na svoj računalnik', NewSubFolder : 'Nova podmapa', Rename : 'Preimenuj', Delete : 'Zbriši', CopyDragDrop : 'Kopiraj datoteko', MoveDragDrop : 'Premakni datoteko', // Dialogs RenameDlgTitle : 'Preimenuj', NewNameDlgTitle : 'Novo ime', FileExistsDlgTitle : 'Datoteka že obstaja', SysErrorDlgTitle : 'Sistemska napaka', FileOverwrite : 'Prepiši', FileAutorename : 'Avtomatsko preimenuj', // Generic OkBtn : 'Potrdi', CancelBtn : 'Prekliči', CloseBtn : 'Zapri', // Upload Panel UploadTitle : 'Naloži novo datoteko na strežnik', UploadSelectLbl : 'Izberi datoteko za prenos na strežnik', UploadProgressLbl : '(Prenos na strežnik poteka, prosimo počakajte...)', UploadBtn : 'Prenesi izbrano datoteko na strežnik', UploadBtnCancel : 'Prekliči', UploadNoFileMsg : 'Prosimo izberite datoteko iz svojega računalnika za prenos na strežnik', UploadNoFolder : 'Izberite mapo v katero se bo naložilo datoteko!', UploadNoPerms : 'Nalaganje datotek ni dovoljeno.', UploadUnknError : 'Napaka pri pošiljanju datoteke.', UploadExtIncorrect : 'V tej mapi ta vrsta datoteke ni dovoljena.', // Settings Panel SetTitle : 'Nastavitve', SetView : 'Pogled:', SetViewThumb : 'majhne sličice', SetViewList : 'seznam', SetDisplay : 'Prikaz:', SetDisplayName : 'ime datoteke', SetDisplayDate : 'datum', SetDisplaySize : 'velikost datoteke', SetSort : 'Razvrščanje:', SetSortName : 'po imenu datoteke', SetSortDate : 'po datumu', SetSortSize : 'po velikosti', // Status Bar FilesCountEmpty : '<Prazna mapa>', FilesCountOne : '1 datoteka', FilesCountMany : '%1 datotek(e)', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/sek', // Connector Error Messages. ErrorUnknown : 'Prišlo je do napake. (Napaka %1)', Errors : { 10 : 'Napačen ukaz.', 11 : 'V poizvedbi ni bil jasen tip (resource type).', 12 : 'Tip datoteke ni primeren.', 102 : 'Napačno ime mape ali datoteke.', 103 : 'Vašega ukaza se ne da izvesti zaradi težav z avtorizacijo.', 104 : 'Vašega ukaza se ne da izvesti zaradi težav z nastavitvami pravic v datotečnem sistemu.', 105 : 'Napačna končnica datoteke.', 109 : 'Napačna zahteva.', 110 : 'Neznana napaka.', 115 : 'Datoteka ali mapa s tem imenom že obstaja.', 116 : 'Mapa ni najdena. Prosimo osvežite okno in poskusite znova.', 117 : 'Datoteka ni najdena. Prosimo osvežite seznam datotek in poskusite znova.', 118 : 'Začetna in končna pot je ista.', 201 : 'Datoteka z istim imenom že obstaja. Naložena datoteka je bila preimenovana v "%1"', 202 : 'Neprimerna datoteka.', 203 : 'Datoteka je prevelika in zasede preveč prostora.', 204 : 'Naložena datoteka je okvarjena.', 205 : 'Na strežniku ni na voljo začasna mapa za prenos datotek.', 206 : 'Nalaganje je bilo prekinjeno zaradi varnostnih razlogov. Datoteka vsebuje podatke, ki spominjajo na HTML kodo.', 207 : 'Naložena datoteka je bila preimenovana v "%1"', 300 : 'Premikanje datotek(e) ni uspelo.', 301 : 'Kopiranje datotek(e) ni uspelo.', 500 : 'Brskalnik je onemogočen zaradi varnostnih razlogov. Prosimo kontaktirajte upravljalca spletnih strani.', 501 : 'Ni podpore za majhne sličice (predogled).' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Ime datoteke ne more biti prazno', FileExists : 'Datoteka %s že obstaja', FolderEmpty : 'Mapa ne more biti prazna', FileInvChar : 'Ime datoteke ne sme vsebovati naslednjih znakov: \n\\ / : * ? " < > |', FolderInvChar : 'Ime mape ne sme vsebovati naslednjih znakov: \n\\ / : * ? " < > |', PopupBlockView : 'Datoteke ni možno odpreti v novem oknu. Prosimo nastavite svoj brskalnik tako, da bo dopuščal odpiranje oken (popups) oz. izklopite filtre za blokado odpiranja oken.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Spremeni velikost slike %s', sizeTooBig : 'Širina ali višina slike ne moreta biti večji kot je originalna velikost (%size).', resizeSuccess : 'Velikost slike je bila uspešno spremenjena.', thumbnailNew : 'Kreiraj novo majhno sličico', thumbnailSmall : 'majhna (%s)', thumbnailMedium : 'srednja (%s)', thumbnailLarge : 'velika (%s)', newSize : 'Določite novo velikost', width : 'Širina', height : 'Višina', invalidHeight : 'Nepravilna višina.', invalidWidth : 'Nepravilna širina.', invalidName : 'Nepravilno ime datoteke.', newImage : 'Kreiraj novo sliko', noExtensionChange : 'Končnica datoteke se ne more spremeniti.', imageSmall : 'Izvorna slika je premajhna', contextMenuName : 'Spremeni velikost' }, // Fileeditor plugin Fileeditor : { save : 'Shrani', fileOpenError : 'Datoteke ni mogoče odpreti.', fileSaveSuccess : 'Datoteka je bila shranjena.', contextMenuName : 'Uredi', loadingFile : 'Nalaganje datoteke, prosimo počakajte ...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['cs'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'cs', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'm/d/yyyy h:MM aa', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Složky', FolderLoading : 'Načítání...', FolderNew : 'Zadejte jméno nové složky: ', FolderRename : 'Zadejte nové jméno složky: ', FolderDelete : 'Opravdu chcete smazat složku "%1" ?', FolderRenaming : ' (Přejmenovávám...)', FolderDeleting : ' (Mažu...)', // Files FileRename : 'Zadejte jméno novéhho souboru: ', FileRenameExt : 'Opravdu chcete změnit příponu souboru, může se stát nečitelným', FileRenaming : 'Přejmenovávám...', FileDelete : 'Opravdu chcete smazat soubor "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Nahrát', UploadTip : 'Nahrát nový soubor', Refresh : 'Načíst znova', Settings : 'Nastavení', Help : 'Pomoc', HelpTip : 'Pomoc', // Context Menus Select : 'Vybrat', SelectThumbnail : 'Vybrat náhled', View : 'Zobrazit', Download : 'Uložit jako', NewSubFolder : 'Nová podsložka', Rename : 'Přejmenovat', Delete : 'Smazat', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Zrušit', CloseBtn : 'Zavřít', // Upload Panel UploadTitle : 'Nahrát nový soubor', UploadSelectLbl : 'Zvolit soubor k nahrání', UploadProgressLbl : '(Nahrávám, čekejte...)', UploadBtn : 'Nahrát zvolený soubor', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Vyberte prosím soubor', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Nastavení', SetView : 'Zobrazení:', SetViewThumb : 'Náhledy', SetViewList : 'Seznam', SetDisplay : 'Informace:', SetDisplayName : 'Název', SetDisplayDate : 'Datum', SetDisplaySize : 'Velikost', SetSort : 'Seřazení:', SetSortName : 'Podle jména', SetSortDate : 'Podle data', SetSortSize : 'Podle velikosti', // Status Bar FilesCountEmpty : '<Prázdná složka>', FilesCountOne : '1 soubor', FilesCountMany : '%1 soubor', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Nebylo možno dokončit příkaz. (Error %1)', Errors : { 10 : 'Neplatný příkaz.', 11 : 'Požadovaný typ prostředku nebyl specifikován v dotazu.', 12 : 'Požadovaný typ prostředku není validní.', 102 : 'Šatné jméno souboru, nebo složky.', 103 : 'Nebylo možné dokončit příkaz kvůli autorizačním omezením.', 104 : 'Nebylo možné dokončit příkaz kvůli omezeným přístupovým právům k souborům.', 105 : 'Špatná přípona souboru.', 109 : 'Neplatný příkaz.', 110 : 'Neznámá chyba.', 115 : 'Již existuje soubor nebo složka se stejným jménem.', 116 : 'Složka nenalezena, prosím obnovte stránku.', 117 : 'Soubor nenalezen, prosím obnovte stránku.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Již existoval soubor se stejným jménem, nahraný soubor byl přejmenován na "%1"', 202 : 'Špatný soubor', 203 : 'Špatný soubor. Příliš velký.', 204 : 'Nahraný soubor je poškozen.', 205 : 'Na serveru není dostupná dočasná složka.', 206 : 'Nahrávání zrušeno z bezpečnostních důvodů. Soubor obsahuje data podobná HTML.', 207 : 'Nahraný soubor byl přejmenován na "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Nahrávání zrušeno z bezpečnostních důvodů. Zdělte to prosím administrátorovi a zkontrolujte nastavení CKFinderu.', 501 : 'Podpora náhledů je vypnuta.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Název souboru nemůže být prázdný', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Název složky nemůže být prázdný', FileInvChar : 'Název souboru nesmí obsahovat následující znaky: \n\\ / : * ? " < > |', FolderInvChar : 'Název složky nesmí obsahovat následující znaky: \n\\ / : * ? " < > |', PopupBlockView : 'Nebylo možné otevřít soubor do nového okna. Prosím nastavte si prohlížeč aby neblokoval vyskakovací okna.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Latin American Spanish * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['es-mx'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, no disponible</span>', confirmCancel : 'Algunas opciones se han cambiado\r\n¿Está seguro de querer cerrar el diálogo?', ok : 'Aceptar', cancel : 'Cancelar', confirmationTitle : 'Confirmación', messageTitle : 'Información', inputTitle : 'Pregunta', undo : 'Deshacer', redo : 'Rehacer', skip : 'Omitir', skipAll : 'Omitir todos', makeDecision : '¿Qué acción debe realizarse?', rememberDecision: 'Recordar mi decisión' }, dir : 'ltr', HelpLang : 'es-mx', LangCode : 'es-mx', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Carpetas', FolderLoading : 'Cargando...', FolderNew : 'Por favor, escriba el nombre para la nueva carpeta: ', FolderRename : 'Por favor, escriba el nuevo nombre para la carpeta: ', FolderDelete : '¿Está seguro de que quiere borrar la carpeta "%1"?', FolderRenaming : ' (Renombrando...)', FolderDeleting : ' (Borrando...)', // Files FileRename : 'Por favor, escriba el nuevo nombre del archivo: ', FileRenameExt : '¿Está seguro de querer cambiar la extensión del archivo? El archivo puede dejar de ser usable', FileRenaming : 'Renombrando...', FileDelete : '¿Está seguro de que quiere borrar el archivo "%1"?', FilesLoading : 'Cargando...', FilesEmpty : 'Carpeta vacía', FilesMoved : 'Archivo %1 movido a %2:%3', FilesCopied : 'Archivo %1 copiado a %2:%3', // Basket BasketFolder : 'Cesta', BasketClear : 'Vaciar cesta', BasketRemove : 'Quitar de la cesta', BasketOpenFolder : 'Abrir carpeta padre', BasketTruncateConfirm : '¿Está seguro de querer quitar todos los archivos de la cesta?', BasketRemoveConfirm : '¿Está seguro de querer quitar el archivo "%1" de la cesta?', BasketEmpty : 'No hay archivos en la cesta, arrastra y suelta algunos.', BasketCopyFilesHere : 'Copiar archivos de la cesta', BasketMoveFilesHere : 'Mover archivos de la cesta', BasketPasteErrorOther : 'Fichero %s error: %e', BasketPasteMoveSuccess : 'Los siguientes ficheros han sido movidos: %s', BasketPasteCopySuccess : 'Los siguientes ficheros han sido copiados: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Añadir', UploadTip : 'Añadir nuevo archivo', Refresh : 'Actualizar', Settings : 'Configuración', Help : 'Ayuda', HelpTip : 'Ayuda', // Context Menus Select : 'Seleccionar', SelectThumbnail : 'Seleccionar el icono', View : 'Ver', Download : 'Descargar', NewSubFolder : 'Nueva Subcarpeta', Rename : 'Renombrar', Delete : 'Borrar', CopyDragDrop : 'Copiar archivo aquí', MoveDragDrop : 'Mover archivo aquí', // Dialogs RenameDlgTitle : 'Renombrar', NewNameDlgTitle : 'Nuevo nombre', FileExistsDlgTitle : 'Archivo existente', SysErrorDlgTitle : 'Error de sistema', FileOverwrite : 'Sobreescribir', FileAutorename : 'Auto-renombrar', // Generic OkBtn : 'Aceptar', CancelBtn : 'Cancelar', CloseBtn : 'Cerrar', // Upload Panel UploadTitle : 'Añadir nuevo archivo', UploadSelectLbl : 'Elija el archivo a subir', UploadProgressLbl : '(Subida en progreso, por favor espere...)', UploadBtn : 'Subir el archivo elegido', UploadBtnCancel : 'Cancelar', UploadNoFileMsg : 'Por favor, elija un archivo de su computadora', UploadNoFolder : 'Por favor, escoja la carpeta antes de iniciar la subida.', UploadNoPerms : 'No puede subir archivos.', UploadUnknError : 'Error enviando el archivo.', UploadExtIncorrect : 'La extensión del archivo no está permitida en esta carpeta.', // Settings Panel SetTitle : 'Configuración', SetView : 'Vista:', SetViewThumb : 'Iconos', SetViewList : 'Lista', SetDisplay : 'Mostrar:', SetDisplayName : 'Nombre de archivo', SetDisplayDate : 'Fecha', SetDisplaySize : 'Tamaño del archivo', SetSort : 'Ordenar:', SetSortName : 'por Nombre', SetSortDate : 'por Fecha', SetSortSize : 'por Tamaño', // Status Bar FilesCountEmpty : '<Carpeta vacía>', FilesCountOne : '1 archivo', FilesCountMany : '%1 archivos', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'No ha sido posible completar la solicitud. (Error %1)', Errors : { 10 : 'Comando incorrecto.', 11 : 'El tipo de recurso no ha sido especificado en la solicitud.', 12 : 'El tipo de recurso solicitado no es válido.', 102 : 'Nombre de archivo o carpeta no válido.', 103 : 'No se ha podido completar la solicitud debido a las restricciones de autorización.', 104 : 'No ha sido posible completar la solicitud debido a restricciones en el sistema de archivos.', 105 : 'La extensión del archivo no es válida.', 109 : 'Petición inválida.', 110 : 'Error desconocido.', 115 : 'Ya existe un archivo o carpeta con ese nombre.', 116 : 'No se ha encontrado la carpeta. Por favor, actualice y pruebe de nuevo.', 117 : 'No se ha encontrado el archivo. Por favor, actualice la lista de archivos y pruebe de nuevo.', 118 : 'Las rutas origen y destino son iguales.', 201 : 'Ya existía un archivo con ese nombre. El archivo subido ha sido renombrado como "%1"', 202 : 'Archivo inválido', 203 : 'Archivo inválido. El tamaño es demasiado grande.', 204 : 'El archivo subido está corrupto.', 205 : 'La carpeta temporal no está disponible en el servidor para las subidas.', 206 : 'La subida se ha cancelado por razones de seguridad. El archivo contenía código HTML.', 207 : 'El archivo subido ha sido renombrado como "%1"', 300 : 'Ha fallado el mover el(los) archivo(s).', 301 : 'Ha fallado el copiar el(los) archivo(s).', 500 : 'El navegador de archivos está deshabilitado por razones de seguridad. Por favor, contacte con el administrador de su sistema y compruebe el archivo de configuración de CKFinder.', 501 : 'El soporte para iconos está deshabilitado.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'El nombre del archivo no puede estar vacío', FileExists : 'El archivo %s ya existe', FolderEmpty : 'El nombre de la carpeta no puede estar vacío', FileInvChar : 'El nombre del archivo no puede contener ninguno de los caracteres siguientes: \n\\ / : * ? " < > |', FolderInvChar : 'El nombre de la carpeta no puede contener ninguno de los caracteres siguientes: \n\\ / : * ? " < > |', PopupBlockView : 'No ha sido posible abrir el archivo en una nueva ventana. Por favor, configure su navegador y desactive todos los bloqueadores de ventanas para esta página.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Redimensionar %s', sizeTooBig : 'No se puede poner la altura o anchura de la imagen mayor que las dimensiones originales (%size).', resizeSuccess : 'Imagen redimensionada correctamente.', thumbnailNew : 'Crear nueva minuatura', thumbnailSmall : 'Pequeña (%s)', thumbnailMedium : 'Mediana (%s)', thumbnailLarge : 'Grande (%s)', newSize : 'Establecer nuevo tamaño', width : 'Ancho', height : 'Alto', invalidHeight : 'Altura inválida.', invalidWidth : 'Anchura inválida.', invalidName : 'Nombre no válido.', newImage : 'Crear nueva imagen', noExtensionChange : 'La extensión no se puede cambiar.', imageSmall : 'La imagen original es demasiado pequeña', contextMenuName : 'Redimensionar' }, // Fileeditor plugin Fileeditor : { save : 'Guardar', fileOpenError : 'No se puede abrir el archivo.', fileSaveSuccess : 'Archivo guardado correctamente.', contextMenuName : 'Editar', loadingFile : 'Cargando archivo, por favor espere...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview Defines the {@link CKFinder.lang} object, for the Portuguese (Brazilian) * language. This is the base file for all translations. */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['pt-br'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Algumas opções foram modificadas. Deseja fechar a janela realmente?', ok : 'OK', cancel : 'Cancelar', confirmationTitle : 'Confirmação', messageTitle : 'Informação', inputTitle : 'Pergunta', undo : 'Desfazer', redo : 'Refazer', skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', HelpLang : 'en', LangCode : 'pt-br', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Pastas', FolderLoading : 'Carregando...', FolderNew : 'Favor informar o nome da nova pasta: ', FolderRename : 'Favor informar o nome da nova pasta: ', FolderDelete : 'Você tem certeza que deseja apagar a pasta "%1"?', FolderRenaming : ' (Renomeando...)', FolderDeleting : ' (Apagando...)', // Files FileRename : 'Favor informar o nome do novo arquivo: ', FileRenameExt : 'Você tem certeza que deseja alterar a extensão do arquivo? O arquivo pode ser danificado', FileRenaming : 'Renomeando...', FileDelete : 'Você tem certeza que deseja apagar o arquivo "%1"?', FilesLoading : 'Carregando...', FilesEmpty : 'Pasta vazia', FilesMoved : 'Arquivo %1 movido para %2:%3', FilesCopied : 'Arquivo %1 copiado em %2:%3', // Basket BasketFolder : 'Cesta', BasketClear : 'Limpa Cesta', BasketRemove : 'Remove da cesta', BasketOpenFolder : 'Abre a pasta original', BasketTruncateConfirm : 'Remover todos os arquivas da cesta?', BasketRemoveConfirm : 'Remover o arquivo "%1" da cesta?', BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copia Arquivos da Cesta', BasketMoveFilesHere : 'Move os Arquivos da Cesta', BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'Os seguintes arquivos foram movidos: %s', BasketPasteCopySuccess : 'Os sequintes arquivos foram copiados: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Enviar arquivo', UploadTip : 'Enviar novo arquivo', Refresh : 'Atualizar', Settings : 'Configurações', Help : 'Ajuda', HelpTip : 'Ajuda', // Context Menus Select : 'Selecionar', SelectThumbnail : 'Selecionar miniatura', View : 'Visualizar', Download : 'Download', NewSubFolder : 'Nova sub-pasta', Rename : 'Renomear', Delete : 'Apagar', CopyDragDrop : 'Copia arquivo aqui', MoveDragDrop : 'Move arquivo aqui', // Dialogs RenameDlgTitle : 'Renomeia', NewNameDlgTitle : 'Novo nome', FileExistsDlgTitle : 'O arquivo já existe', SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Sobrescrever', FileAutorename : 'Renomeia automaticamente', // Generic OkBtn : 'OK', CancelBtn : 'Cancelar', CloseBtn : 'Fechar', // Upload Panel UploadTitle : 'Enviar novo arquivo', UploadSelectLbl : 'Selecione o arquivo para enviar', UploadProgressLbl : '(Enviado arquivo, favor aguardar...)', UploadBtn : 'Enviar arquivo selecionado', UploadBtnCancel : 'Cancelar', UploadNoFileMsg : 'Favor selecionar o arquivo no seu computador', UploadNoFolder : 'Favor selecionar a pasta antes the enviar o arquivo.', UploadNoPerms : 'Não é permitido o envio de arquivos.', UploadUnknError : 'Erro no envio do arquivo.', UploadExtIncorrect : 'A extensão deste arquivo não é permitida nesat pasta.', // Settings Panel SetTitle : 'Configurações', SetView : 'Visualizar:', SetViewThumb : 'Miniaturas', SetViewList : 'Lista', SetDisplay : 'Exibir:', SetDisplayName : 'Arquivo', SetDisplayDate : 'Data', SetDisplaySize : 'Tamanho', SetSort : 'Ordenar:', SetSortName : 'por Nome do arquivo', SetSortDate : 'por Data', SetSortSize : 'por Tamanho', // Status Bar FilesCountEmpty : '<Pasta vazia>', FilesCountOne : '1 arquivo', FilesCountMany : '%1 arquivos', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Não foi possível completer o seu pedido. (Erro %1)', Errors : { 10 : 'Comando inválido.', 11 : 'O tipo de recurso não foi especificado na solicitação.', 12 : 'O recurso solicitado não é válido.', 102 : 'Nome do arquivo ou pasta inválido.', 103 : 'Não foi possível completar a solicitação por restrições de acesso.', 104 : 'Não foi possível completar a solicitação por restrições de acesso do sistema de arquivos.', 105 : 'Extensão de arquivo inválida.', 109 : 'Solicitação inválida.', 110 : 'Erro desconhecido.', 115 : 'Uma arquivo ou pasta já existe com esse nome.', 116 : 'Pasta não encontrada. Atualize e tente novamente.', 117 : 'Arquivo não encontrado. Atualize a lista de arquivos e tente novamente.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Um arquivo com o mesmo nome já está disponível. O arquivo enviado foi renomeado para "%1"', 202 : 'Arquivo inválido', 203 : 'Arquivo inválido. O tamanho é muito grande.', 204 : 'O arquivo enviado está corrompido.', 205 : 'Nenhuma pasta temporária para envio está disponível no servidor.', 206 : 'Transmissão cancelada por razões de segurança. O arquivo contem dados HTML.', 207 : 'O arquivo enviado foi renomeado para "%1"', 300 : 'Não foi possível mover o(s) arquivo(s).', 301 : 'Não foi possível copiar o(s) arquivos(s).', 500 : 'A navegação de arquivos está desativada por razões de segurança. Contacte o administrador do sistema.', 501 : 'O suporte a miniaturas está desabilitado.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'O nome do arquivo não pode ser vazio', FileExists : 'O nome %s já é em uso', FolderEmpty : 'O nome da pasta não pode ser vazio', FileInvChar : 'O nome do arquivo não pode conter nenhum desses caracteres: \n\\ / : * ? " < > |', FolderInvChar : 'O nome da pasta não pode conter nenhum desses caracteres: \n\\ / : * ? " < > |', PopupBlockView : 'Não foi possível abrir o arquivo em outra janela. Configure seu navegador e desabilite o bloqueio a popups para esse site.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Redimensionar %s', sizeTooBig : 'Não possível usar dimensões maiores do que as originais (%size).', resizeSuccess : 'Imagem redimensionada corretamente.', thumbnailNew : 'Cria nova anteprima', thumbnailSmall : 'Pequeno (%s)', thumbnailMedium : 'Médio (%s)', thumbnailLarge : 'Grande (%s)', newSize : 'Novas dimensões', width : 'Largura', height : 'Altura', invalidHeight : 'Altura incorreta.', invalidWidth : 'Largura incorreta.', invalidName : 'O nome do arquivo não é válido.', newImage : 'Cria nova imagem', noExtensionChange : 'A extensão do arquivo não pode ser modificada.', imageSmall : 'A imagem original é muito pequena', contextMenuName : 'Redimensionar' }, // Fileeditor plugin Fileeditor : { save : 'Salva', fileOpenError : 'Não é possível abrir o arquivo.', fileSaveSuccess : 'Arquivo salvado corretamente.', contextMenuName : 'Modificar', loadingFile : 'Carregando arquivo. Por favor aguarde...' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, * modifying or distribute this file or part of its contents. The contents of * this file is part of the Source Code of CKFinder. * */ /** * @fileOverview */ /** * Constains the dictionary of language entries. * @namespace */ CKFinder.lang['nn'] = { appTitle : 'CKFinder', // MISSING // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING ok : 'OK', // MISSING cancel : 'Cancel', // MISSING confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Undo', // MISSING redo : 'Redo', // MISSING skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, dir : 'ltr', // MISSING HelpLang : 'en', LangCode : 'no', // Date Format // d : Day // dd : Day (padding zero) // m : Month // mm : Month (padding zero) // yy : Year (two digits) // yyyy : Year (four digits) // h : Hour (12 hour clock) // hh : Hour (12 hour clock, padding zero) // H : Hour (24 hour clock) // HH : Hour (24 hour clock, padding zero) // M : Minute // MM : Minute (padding zero) // a : Firt char of AM/PM // aa : AM/PM DateTime : 'dd/mm/yyyy HH:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Mapper', FolderLoading : 'Laster...', FolderNew : 'Skriv inn det nye mappenavnet: ', FolderRename : 'Skriv inn det nye mappenavnet: ', FolderDelete : 'Er du sikker på at du vil slette mappen "%1"?', FolderRenaming : ' (Endrer mappenavn...)', FolderDeleting : ' (Sletter...)', // Files FileRename : 'Skriv inn det nye filnavnet: ', FileRenameExt : 'Er du sikker på at du vil endre filtypen? Filen kan bli ubrukelig', FileRenaming : 'Endrer filnavn...', FileDelete : 'Er du sikker på at du vil slette denne filen "%1"?', FilesLoading : 'Loading...', // MISSING FilesEmpty : 'Empty folder', // MISSING FilesMoved : 'File %1 moved into %2:%3', // MISSING FilesCopied : 'File %1 copied into %2:%3', // MISSING // Basket BasketFolder : 'Basket', // MISSING BasketClear : 'Clear Basket', // MISSING BasketRemove : 'Remove from basket', // MISSING BasketOpenFolder : 'Open parent folder', // MISSING BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING BasketCopyFilesHere : 'Copy Files from Basket', // MISSING BasketMoveFilesHere : 'Move Files from Basket', // MISSING BasketPasteErrorOther : 'File %s error: %e', // MISSING BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING // Toolbar Buttons (some used elsewhere) Upload : 'Last opp', UploadTip : 'Last opp en ny fil', Refresh : 'Oppdater', Settings : 'Innstillinger', Help : 'Hjelp', HelpTip : 'Hjelp finnes kun på engelsk', // Context Menus Select : 'Velg', SelectThumbnail : 'Velg Miniatyr', View : 'Vis fullversjon', Download : 'Last ned', NewSubFolder : 'Ny Undermappe', Rename : 'Endre navn', Delete : 'Slett', CopyDragDrop : 'Copy file here', // MISSING MoveDragDrop : 'Move file here', // MISSING // Dialogs RenameDlgTitle : 'Rename', // MISSING NewNameDlgTitle : 'New name', // MISSING FileExistsDlgTitle : 'File already exists', // MISSING SysErrorDlgTitle : 'System error', // MISSING FileOverwrite : 'Overwrite', // MISSING FileAutorename : 'Auto-rename', // MISSING // Generic OkBtn : 'OK', CancelBtn : 'Avbryt', CloseBtn : 'Lukk', // Upload Panel UploadTitle : 'Last opp ny fil', UploadSelectLbl : 'Velg filen du vil laste opp', UploadProgressLbl : '(Laster opp filen, vennligst vent...)', UploadBtn : 'Last opp valgt fil', UploadBtnCancel : 'Cancel', // MISSING UploadNoFileMsg : 'Du må velge en fil fra din datamaskin', UploadNoFolder : 'Please select folder before uploading.', // MISSING UploadNoPerms : 'File upload not allowed.', // MISSING UploadUnknError : 'Error sending the file.', // MISSING UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING // Settings Panel SetTitle : 'Innstillinger', SetView : 'Filvisning:', SetViewThumb : 'Miniatyrbilder', SetViewList : 'Liste', SetDisplay : 'Vis:', SetDisplayName : 'Filnavn', SetDisplayDate : 'Dato', SetDisplaySize : 'Filstørrelse', SetSort : 'Sorter etter:', SetSortName : 'Filnavn', SetSortDate : 'Dato', SetSortSize : 'Størrelse', // Status Bar FilesCountEmpty : '<Tom Mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 kB', KbPerSecond : '%1 kB/s', // Connector Error Messages. ErrorUnknown : 'Det var ikke mulig å utføre forespørselen. (Feil %1)', Errors : { 10 : 'Ugyldig kommando.', 11 : 'Ressurstypen ble ikke spesifisert i forepørselen.', 12 : 'Ugyldig ressurstype.', 102 : 'Ugyldig fil- eller mappenavn.', 103 : 'Kunne ikke utføre forespørselen pga manglende autorisasjon.', 104 : 'Kunne ikke utføre forespørselen pga manglende tilgang til filsystemet.', 105 : 'Ugyldig filtype.', 109 : 'Ugyldig forespørsel.', 110 : 'Ukjent feil.', 115 : 'Det finnes allerede en fil eller mappe med dette navnet.', 116 : 'Kunne ikke finne mappen. Oppdater vinduet og prøv igjen.', 117 : 'Kunne ikke finne filen. Oppdater vinduet og prøv igjen.', 118 : 'Source and target paths are equal.', // MISSING 201 : 'Det fantes allerede en fil med dette navnet. Den opplastede filens navn har blitt endret til "%1"', 202 : 'Ugyldig fil', 203 : 'Ugyldig fil. Filen er for stor.', 204 : 'Den opplastede filen er korrupt.', 205 : 'Det finnes ingen midlertidig mappe for filopplastinger.', 206 : 'Opplastingen ble avbrutt av sikkerhetshensyn. Filen inneholder HTML-aktig data.', 207 : 'Den opplastede filens navn har blitt endret til "%1"', 300 : 'Moving file(s) failed.', // MISSING 301 : 'Copying file(s) failed.', // MISSING 500 : 'Filvelgeren ikke tilgjengelig av sikkerhetshensyn. Kontakt systemansvarlig og be han sjekke CKFinder\'s konfigurasjonsfil.', 501 : 'Funksjon for minityrbilder er skrudd av.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Filnavnet kan ikke være tomt', FileExists : 'File %s already exists', // MISSING FolderEmpty : 'Mappenavnet kan ikke være tomt', FileInvChar : 'Filnavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |', FolderInvChar : 'Mappenavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |', PopupBlockView : 'Du må skru av popup-blockeren for å se bildet i nytt vindu.' }, // Imageresize plugin Imageresize : { dialogTitle : 'Resize %s', // MISSING sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING resizeSuccess : 'Image resized successfully.', // MISSING thumbnailNew : 'Create new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create new image', // MISSING noExtensionChange : 'The file extension cannot be changed.', // MISSING imageSmall : 'Source image is too small', // MISSING contextMenuName : 'Resize' // MISSING }, // Fileeditor plugin Fileeditor : { save : 'Save', // MISSING fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING } };
JavaScript
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckfinder.com/license */ CKFinder.customConfig = function (config) { // Define changes to default configuration here. For example: // config.skin = 'v1'; config.language = 'zh-cn'; };
JavaScript
CKFinder.addPlugin( 'imageresize', { connectorInitialized : function( api, xml ) { var node = xml.selectSingleNode( 'Connector/PluginsInfo/imageresize/@smallThumb' ); if ( node ) CKFinder.config.imageresize_thumbSmall = node.value; node = xml.selectSingleNode( 'Connector/PluginsInfo/imageresize/@mediumThumb' ); if ( node ) CKFinder.config.imageresize_thumbMedium = node.value; node = xml.selectSingleNode( 'Connector/PluginsInfo/imageresize/@largeThumb' ); if ( node ) CKFinder.config.imageresize_thumbLarge = node.value; }, uiReady : function( api ) { var regexExt = /^(.*)\.([^\.]+)$/, regexFileName = /^(.*?)(?:_\d+x\d+)?\.([^\.]+)$/, regexGetSize = /^\s*(\d+)(px)?\s*$/i, regexGetSizeOrEmpty = /(^\s*(\d+)(px)?\s*$)|^$/i, imageDimension = { width : 0, height : 0 }, file, doc; var updateFileName = function( dialog ) { var width = dialog.getValueOf( 'tab1', 'width' ) || 0, height = dialog.getValueOf( 'tab1', 'height' ) || 0, e = dialog.getContentElement('tab1', 'createNewBox'); if ( width && height ) { var matches = file.name.match( regexFileName ); dialog.setValueOf( 'tab1', 'fileName', matches[1] + "_" + width + "x" + height + "." + matches[2]); e.getElement().show(); } else e.getElement().hide(); }; var onSizeChange = function() { var value = this.getValue(), // This = input element. dialog = this.getDialog(), maxWidth = api.config.imagesMaxWidth, maxHeight = api.config.imagesMaxHeight, aMatch = value.match( regexGetSize ), width = imageDimension.width, height = imageDimension.height; if ( aMatch ) value = aMatch[1]; if ( !api.config.imageresize_allowEnlarging ) { if ( width && width < maxWidth ) maxWidth = width; if ( height && height < maxHeight ) maxHeight = height; } if ( maxHeight > 0 && this.id == 'height' && value > maxHeight ) { value = maxHeight; dialog.setValueOf( 'tab1', 'height', value ); } if ( maxWidth > 0 && this.id == 'width' && value > maxWidth ) { value = maxWidth; dialog.setValueOf( 'tab1', 'width', value ); } // Only if ratio is locked if ( dialog.lockRatio && width && height ) { if ( this.id == 'height' ) { if ( value && value != '0' ) value = Math.round( width * ( value / height ) ); if ( !isNaN( value ) ) { // newWidth > maxWidth if ( maxWidth > 0 && value > maxWidth ) { value = maxWidth; newHeight = Math.round( height * ( value / width ) ); dialog.setValueOf( 'tab1', 'height', newHeight ); } dialog.setValueOf( 'tab1', 'width', value ); } } else //this.id = txtWidth. { if ( value && value != '0' ) value = Math.round( height * ( value / width ) ); if ( !isNaN( value ) ) { // newHeight > maxHeight if ( maxHeight > 0 && value > maxHeight ) { value = maxHeight; newWidth = Math.round( width * ( value / height ) ); dialog.setValueOf( 'tab1', 'width', newWidth ); } dialog.setValueOf( 'tab1', 'height', value ); } } } updateFileName( dialog ); }; var resetSize = function( dialog ) { if ( imageDimension.width && imageDimension.height ) { dialog.setValueOf( 'tab1', 'width', imageDimension.width ); dialog.setValueOf( 'tab1', 'height', imageDimension.height ); updateFileName( dialog ); } }; var switchLockRatio = function( dialog, value ) { var doc = dialog.getElement().getDocument(), ratioButton = doc.getById( 'btnLockSizes' ); if ( imageDimension.width && imageDimension.height ) { if ( value == 'check' ) // Check image ratio and original image ratio. { var width = dialog.getValueOf( 'tab1', 'width' ), height = dialog.getValueOf( 'tab1', 'height' ), originalRatio = imageDimension.width * 1000 / imageDimension.height, thisRatio = width * 1000 / height; dialog.lockRatio = false; // Default: unlock ratio if ( !width && !height ) dialog.lockRatio = true; // If someone didn't start typing, lock ratio. else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) ) { if ( Math.round( originalRatio ) == Math.round( thisRatio ) ) dialog.lockRatio = true; } } else if ( value != undefined ) dialog.lockRatio = value; else dialog.lockRatio = !dialog.lockRatio; } else if ( value != 'check' ) // I can't lock ratio if ratio is unknown. dialog.lockRatio = false; if ( dialog.lockRatio ) ratioButton.removeClass( 'ckf_btn_unlocked' ); else ratioButton.addClass( 'ckf_btn_unlocked' ); return dialog.lockRatio; }; CKFinder.dialog.add( 'resizeDialog', function( api ) { return { title : api.lang.Imageresize.dialogTitle.replace( '%s', api.getSelectedFile().name ), // TODO resizable : CKFINDER.DIALOG_RESIZE_BOTH minWidth : 390, minHeight : 230, onShow : function() { var dialog = this, thumbSmall = CKFinder.config.imageresize_thumbSmall, thumbMedium = CKFinder.config.imageresize_thumbMedium, thumbLarge = CKFinder.config.imageresize_thumbLarge; doc = dialog.getElement().getDocument(); file = api.getSelectedFile(); this.setTitle( api.lang.Imageresize.dialogTitle.replace( '%s', file.name ) ); var previewImg = doc.getById('previewImage'); var sizeSpan = doc.getById('imageSize'); previewImg.setAttribute('src', file.getThumbnailUrl( true )); var updateImgDimension = function( width, height ) { if ( !width || !height ) { sizeSpan.setText( '' ); return; } imageDimension.width = width; imageDimension.height = height; sizeSpan.setText( width + " x " + height + " px" ); CKFinder.tools.setTimeout( function(){ switchLockRatio( dialog, 'check' ); }, 0, dialog ); }; api.connector.sendCommand( "ImageResizeInfo", { fileName : file.name }, function( xml ) { if ( xml.checkError() ) return; var width = xml.selectSingleNode( 'Connector/ImageInfo/@width' ), height = xml.selectSingleNode( 'Connector/ImageInfo/@height' ); if ( width && height ) { width = parseInt( width.value, 10 ); height = parseInt( height.value, 10 ); updateImgDimension( width, height ); var checkThumbs = function( id, size ) { if ( !size ) return; var reThumb = /^(\d+)x(\d+)$/; result = reThumb.exec( size ); var el = dialog.getContentElement( 'tab1', id ); if ( 0 + result[1] > width && 0 + result[2] > height ) { el.disable(); el.getElement().setAttribute('title', api.lang.Imageresize.imageSmall).addClass('cke_disabled'); } else { el.enable(); el.getElement().setAttribute('title', '').removeClass('cke_disabled'); } }; checkThumbs('smallThumb', thumbSmall ); checkThumbs('mediumThumb', thumbMedium ); checkThumbs('largeThumb', thumbLarge ); } }, file.folder.type, file.folder ); if ( !thumbSmall ) dialog.getContentElement('tab1', 'smallThumb').getElement().hide(); if ( !thumbMedium ) dialog.getContentElement('tab1', 'mediumThumb').getElement().hide(); if ( !thumbLarge ) dialog.getContentElement('tab1', 'largeThumb').getElement().hide(); if ( !thumbSmall && !thumbMedium && !thumbLarge ) dialog.getContentElement('tab1', 'thumbsLabel').getElement().hide(); dialog.setValueOf( 'tab1', 'fileName', file.name ); dialog.getContentElement('tab1', 'width').focus(); dialog.getContentElement('tab1', 'fileName').setValue(''); dialog.getContentElement('tab1', 'createNewBox').getElement().hide(); updateImgDimension( 0,0 ); }, onOk : function() { var dialog = this, width = dialog.getValueOf( 'tab1', 'width' ), height = dialog.getValueOf( 'tab1', 'height' ), small = dialog.getValueOf( 'tab1', 'smallThumb' ), medium = dialog.getValueOf( 'tab1', 'mediumThumb' ), large = dialog.getValueOf( 'tab1', 'largeThumb' ), fileName = dialog.getValueOf( 'tab1', 'fileName' ), createNew = dialog.getValueOf( 'tab1', 'createNew' ); if ( width && !height ) { api.openMsgDialog( '', api.lang.Imageresize.invalidHeight ); return false; } else if ( !width && height ) { api.openMsgDialog( '', api.lang.Imageresize.invalidWidth ); return false; } if ( !api.config.imageresize_allowEnlarging && ( parseInt( width, 10 ) > imageDimension.width || parseInt( height, 10 ) > imageDimension.height ) ) { var str = api.lang.Imageresize.sizeTooBig; api.openMsgDialog( '', str.replace( "%size", imageDimension.width + "x" + imageDimension.height ) ); return false; } if ( ( width && height ) || small || medium || large ) { if ( !createNew ) fileName = file.name; api.connector.sendCommandPost( "ImageResize", null, { width : width, height : height, fileName : file.name, newFileName : fileName, overwrite : createNew ? 0 : 1, small : small ? 1 : 0, medium : medium ? 1 : 0, large : large ? 1 : 0 }, function( xml ) { if ( xml.checkError() ) return; api.openMsgDialog( '', api.lang.Imageresize.resizeSuccess ); api.refreshOpenedFolder(); }, file.folder.type, file.folder ); } return undefined; }, contents : [ { id : 'tab1', label : '', title : '', expand : true, padding : 0, elements : [ { type : 'hbox', widths : [ '180px', '280px' ], children: [ { type : 'vbox', children: [ { type : 'html', html : '' + '<style type="text/css">' + 'a.ckf_btn_reset' + '{' + 'float: right;' + 'background-position: 0 -32px;' + 'background-image: url("' + CKFinder.getPluginPath('imageresize') + 'images/mini.gif");' + 'width: 16px;' + 'height: 16px;' + 'background-repeat: no-repeat;' + 'border: 1px none;' + 'font-size: 1px;' + '}' + 'a.ckf_btn_locked,' + 'a.ckf_btn_unlocked' + '{' + 'float: left;' + 'background-position: 0 0;' + 'background-image: url("' + CKFinder.getPluginPath('imageresize') + 'images/mini.gif");' + 'width: 16px;' + 'height: 16px;' + 'background-repeat: no-repeat;' + 'border: none 1px;' + 'font-size: 1px;' + '}' + 'a.ckf_btn_unlocked' + '{' + 'background-position: 0 -16px;' + 'background-image: url("' + CKFinder.getPluginPath('imageresize') + '/images/mini.gif");' + '}' + '.ckf_btn_over' + '{' + 'border: outset 1px;' + 'cursor: pointer;' + 'cursor: hand;' + '}' + '</style>' + '<div style="height:100px;padding:7px">' + '<img id="previewImage" src="" style="margin-bottom:4px;" /><br />' + '<span style="font-size:9px;" id="imageSize"></span>' + '</div>' }, { type : 'html', id : 'thumbsLabel', html : '<strong>' + api.lang.Imageresize.thumbnailNew + '</strong>' }, { type : 'checkbox', id : 'smallThumb', checked : false, label : api.lang.Imageresize.thumbnailSmall.replace( '%s', CKFinder.config.imageresize_thumbSmall ) }, { type : 'checkbox', id : 'mediumThumb', checked : false, label : api.lang.Imageresize.thumbnailMedium.replace( '%s', CKFinder.config.imageresize_thumbMedium ) }, { type : 'checkbox', id : 'largeThumb', checked : false, label : api.lang.Imageresize.thumbnailLarge.replace( '%s', CKFinder.config.imageresize_thumbLarge ) } ] }, { type : 'vbox', children : [ { type : 'html', html : '<strong>' + api.lang.Imageresize.newSize + '</strong>' }, { type : 'hbox', widths : [ '80%', '20%' ], children: [ { type : 'vbox', children: [ { type : 'text', labelLayout : 'horizontal', label : api.lang.Imageresize.width, onKeyUp : onSizeChange, validate: function() { var value = this.getValue(); if ( value ) { var aMatch = value.match( regexGetSize ); if ( !aMatch || parseInt( aMatch[1], 10 ) < 1 ) { api.openMsgDialog( '', api.lang.Imageresize.invalidWidth ); return false; } } return true; }, id : 'width' }, { type : 'text', labelLayout : 'horizontal', label : api.lang.Imageresize.height, onKeyUp : onSizeChange, validate: function() { var value = this.getValue(); if ( value ) { var aMatch = value.match( regexGetSize ); if ( !aMatch || parseInt( aMatch[1], 10 ) < 1 ) { api.openMsgDialog( '', api.lang.Imageresize.invalidHeight ); return false; } } return true; }, id : 'height' } ] }, { type : 'html', onLoad : function() { var doc = this.getElement().getDocument(), dialog = this.getDialog(); // Activate Reset button var resetButton = doc.getById( 'btnResetSize' ), ratioButton = doc.getById( 'btnLockSizes' ); if ( resetButton ) { resetButton.on( 'click', function(evt) { resetSize( this ); evt.data.preventDefault(); }, dialog ); resetButton.on( 'mouseover', function() { this.addClass( 'ckf_btn_over' ); }, resetButton ); resetButton.on( 'mouseout', function() { this.removeClass( 'ckf_btn_over' ); }, resetButton ); } // Activate (Un)LockRatio button if ( ratioButton ) { ratioButton.on( 'click', function(evt) { var locked = switchLockRatio( this ), width = this.getValueOf( 'tab1', 'width' ); if ( imageDimension.width && width ) { var height = imageDimension.height / imageDimension.width * width; if ( !isNaN( height ) ) { this.setValueOf( 'tab1', 'height', Math.round( height ) ); updateFileName( dialog ); } } evt.data.preventDefault(); }, dialog ); ratioButton.on( 'mouseover', function() { this.addClass( 'ckf_btn_over' ); }, ratioButton ); ratioButton.on( 'mouseout', function() { this.removeClass( 'ckf_btn_over' ); }, ratioButton ); } }, html : '<div style="margin-top:4px">'+ '<a href="javascript:void(0)" tabindex="-1" title="Lock ration" class="ckf_btn_locked ckf_btn_unlocked" id="btnLockSizes"></a>' + '<a href="javascript:void(0)" tabindex="-1" title="Reset size" class="ckf_btn_reset" id="btnResetSize"></a>'+ '</div>' } ] }, { type : 'vbox', id : 'createNewBox', hidden : true, children: [ { type : 'checkbox', checked : true, id : 'createNew', label : api.lang.Imageresize.newImage, 'default' : true, onChange : function() { var dialog = this.getDialog(); var filenameInput = dialog.getContentElement('tab1', 'fileName'); if ( filenameInput ) { if (!this.getValue()) filenameInput.getElement().hide(); else filenameInput.getElement().show(); } } }, { type : 'text', label : '', validate : function() { var dialog = this.getDialog(), createNew = dialog.getContentElement('tab1', 'createNew'), value = this.getValue(), matches = value.match( regexExt ); if ( createNew && dialog.getValueOf( 'tab1', 'width' ) && dialog.getValueOf( 'tab1', 'height' ) ) { if ( !value || !matches ) { api.openMsgDialog( '', api.lang.Imageresize.invalidName ); return false; } if ( file.ext != matches[2] ) { api.openMsgDialog( '', api.lang.Imageresize.noExtensionChange ); return false; } } return true; }, id : 'fileName' } ] } ] } ] } ] } ], // TODO http://dev.fckeditor.net/ticket/4750 buttons : [ CKFinder.dialog.okButton, CKFinder.dialog.cancelButton ] }; } ); api.addFileContextMenuOption( { label : api.lang.Imageresize.contextMenuName, command : "resizeImage" } , function( api, file ) { api.openDialog( 'resizeDialog' ); }, function ( file ) { // Disable for files other than images. if ( !file.isImage() || !api.getSelectedFolder().type ) return false; if ( file.folder.acl.fileDelete && file.folder.acl.fileUpload ) return true; else return -1; }); } } );
JavaScript
/* Demonstration of embedding CodeMirror in a bigger application. The * interface defined here is a mess of prompts and confirms, and * should probably not be used in a real project. */ function MirrorFrame(place, options) { this.home = document.createElement("div"); if (place.appendChild) place.appendChild(this.home); else place(this.home); var self = this; function makeButton(name, action) { var button = document.createElement("input"); button.type = "button"; button.value = name; self.home.appendChild(button); button.onclick = function(){self[action].call(self);}; } makeButton("Search", "search"); makeButton("Replace", "replace"); makeButton("Current line", "line"); makeButton("Jump to line", "jump"); makeButton("Insert constructor", "macro"); makeButton("Indent all", "reindent"); this.mirror = new CodeMirror(this.home, options); } MirrorFrame.prototype = { search: function() { var text = prompt("Enter search term:", ""); if (!text) return; var first = true; do { var cursor = this.mirror.getSearchCursor(text, first); first = false; while (cursor.findNext()) { cursor.select(); if (!confirm("Search again?")) return; } } while (confirm("End of document reached. Start over?")); }, replace: function() { // This is a replace-all, but it is possible to implement a // prompting replace. var from = prompt("Enter search string:", ""), to; if (from) to = prompt("What should it be replaced with?", ""); if (to == null) return; var cursor = this.mirror.getSearchCursor(from, false); while (cursor.findNext()) cursor.replace(to); }, jump: function() { var line = prompt("Jump to line:", ""); if (line && !isNaN(Number(line))) this.mirror.jumpToLine(Number(line)); }, line: function() { alert("The cursor is currently at line " + this.mirror.currentLine()); this.mirror.focus(); }, macro: function() { var name = prompt("Name your constructor:", ""); if (name) this.mirror.replaceSelection("function " + name + "() {\n \n}\n\n" + name + ".prototype = {\n \n};\n"); }, reindent: function() { this.mirror.reindent(); } };
JavaScript
var HTMLMixedParser = Editor.Parser = (function() { // tags that trigger seperate parsers var triggers = { "script": "JSParser", "style": "CSSParser" }; function checkDependencies() { var parsers = ['XMLParser']; for (var p in triggers) parsers.push(triggers[p]); for (var i in parsers) { if (!window[parsers[i]]) throw new Error(parsers[i] + " parser must be loaded for HTML mixed mode to work."); } XMLParser.configure({useHTMLKludges: true}); } function parseMixed(stream) { checkDependencies(); var htmlParser = XMLParser.make(stream), localParser = null, inTag = false; var iter = {next: top, copy: copy}; function top() { var token = htmlParser.next(); if (token.content == "<") inTag = true; else if (token.style == "xml-tagname" && inTag === true) inTag = token.content.toLowerCase(); else if (token.content == ">") { if (triggers[inTag]) { var parser = window[triggers[inTag]]; iter.next = local(parser, "</" + inTag); } inTag = false; } return token; } function local(parser, tag) { var baseIndent = htmlParser.indentation(); localParser = parser.make(stream, baseIndent + indentUnit); return function() { if (stream.lookAhead(tag, false, false, true)) { localParser = null; iter.next = top; return top(); } var token = localParser.next(); var lt = token.value.lastIndexOf("<"), sz = Math.min(token.value.length - lt, tag.length); if (lt != -1 && token.value.slice(lt, lt + sz).toLowerCase() == tag.slice(0, sz) && stream.lookAhead(tag.slice(sz), false, false, true)) { stream.push(token.value.slice(lt)); token.value = token.value.slice(0, lt); } if (token.indentation) { var oldIndent = token.indentation; token.indentation = function(chars) { if (chars == "</") return baseIndent; else return oldIndent(chars); }; } return token; }; } function copy() { var _html = htmlParser.copy(), _local = localParser && localParser.copy(), _next = iter.next, _inTag = inTag; return function(_stream) { stream = _stream; htmlParser = _html(_stream); localParser = _local && _local(_stream); iter.next = _next; inTag = _inTag; return iter; }; } return iter; } return { make: parseMixed, electricChars: "{}/:", configure: function(obj) { if (obj.triggers) triggers = obj.triggers; } }; })();
JavaScript
/* Simple parser for CSS */ var CSSParser = Editor.Parser = (function() { var tokenizeCSS = (function() { function normal(source, setState) { var ch = source.next(); if (ch == "@") { source.nextWhileMatches(/\w/); return "css-at"; } else if (ch == "/" && source.equals("*")) { setState(inCComment); return null; } else if (ch == "<" && source.equals("!")) { setState(inSGMLComment); return null; } else if (ch == "=") { return "css-compare"; } else if (source.equals("=") && (ch == "~" || ch == "|")) { source.next(); return "css-compare"; } else if (ch == "\"" || ch == "'") { setState(inString(ch)); return null; } else if (ch == "#") { source.nextWhileMatches(/\w/); return "css-hash"; } else if (ch == "!") { source.nextWhileMatches(/[ \t]/); source.nextWhileMatches(/\w/); return "css-important"; } else if (/\d/.test(ch)) { source.nextWhileMatches(/[\w.%]/); return "css-unit"; } else if (/[,.+>*\/]/.test(ch)) { return "css-select-op"; } else if (/[;{}:\[\]]/.test(ch)) { return "css-punctuation"; } else { source.nextWhileMatches(/[\w\\\-_]/); return "css-identifier"; } } function inCComment(source, setState) { var maybeEnd = false; while (!source.endOfLine()) { var ch = source.next(); if (maybeEnd && ch == "/") { setState(normal); break; } maybeEnd = (ch == "*"); } return "css-comment"; } function inSGMLComment(source, setState) { var dashes = 0; while (!source.endOfLine()) { var ch = source.next(); if (dashes >= 2 && ch == ">") { setState(normal); break; } dashes = (ch == "-") ? dashes + 1 : 0; } return "css-comment"; } function inString(quote) { return function(source, setState) { var escaped = false; while (!source.endOfLine()) { var ch = source.next(); if (ch == quote && !escaped) break; escaped = !escaped && ch == "\\"; } if (!escaped) setState(normal); return "css-string"; }; } return function(source, startState) { return tokenizer(source, startState || normal); }; })(); function indentCSS(inBraces, inRule, base) { return function(nextChars) { if (!inBraces || /^\}/.test(nextChars)) return base; else if (inRule) return base + indentUnit * 2; else return base + indentUnit; }; } // This is a very simplistic parser -- since CSS does not really // nest, it works acceptably well, but some nicer colouroing could // be provided with a more complicated parser. function parseCSS(source, basecolumn) { basecolumn = basecolumn || 0; var tokens = tokenizeCSS(source); var inBraces = false, inRule = false, inDecl = false;; var iter = { next: function() { var token = tokens.next(), style = token.style, content = token.content; if (style == "css-hash") style = token.style = inRule ? "css-colorcode" : "css-identifier"; if (style == "css-identifier") { if (inRule) token.style = "css-value"; else if (!inBraces && !inDecl) token.style = "css-selector"; } if (content == "\n") token.indentation = indentCSS(inBraces, inRule, basecolumn); if (content == "{" && inDecl == "@media") inDecl = false; else if (content == "{") inBraces = true; else if (content == "}") inBraces = inRule = inDecl = false; else if (content == ";") inRule = inDecl = false; else if (inBraces && style != "css-comment" && style != "whitespace") inRule = true; else if (!inBraces && style == "css-at") inDecl = content; return token; }, copy: function() { var _inBraces = inBraces, _inRule = inRule, _tokenState = tokens.state; return function(source) { tokens = tokenizeCSS(source, _tokenState); inBraces = _inBraces; inRule = _inRule; return iter; }; } }; return iter; } return {make: parseCSS, electricChars: "}"}; })();
JavaScript
/* Functionality for finding, storing, and restoring selections * * This does not provide a generic API, just the minimal functionality * required by the CodeMirror system. */ // Namespace object. var select = {}; (function() { select.ie_selection = document.selection && document.selection.createRangeCollection; // Find the 'top-level' (defined as 'a direct child of the node // passed as the top argument') node that the given node is // contained in. Return null if the given node is not inside the top // node. function topLevelNodeAt(node, top) { while (node && node.parentNode != top) node = node.parentNode; return node; } // Find the top-level node that contains the node before this one. function topLevelNodeBefore(node, top) { while (!node.previousSibling && node.parentNode != top) node = node.parentNode; return topLevelNodeAt(node.previousSibling, top); } var fourSpaces = "\u00a0\u00a0\u00a0\u00a0"; select.scrollToNode = function(node, cursor) { if (!node) return; var element = node, body = document.body, html = document.documentElement, atEnd = !element.nextSibling || !element.nextSibling.nextSibling || !element.nextSibling.nextSibling.nextSibling; // In Opera (and recent Webkit versions), BR elements *always* // have a offsetTop property of zero. var compensateHack = 0; while (element && !element.offsetTop) { compensateHack++; element = element.previousSibling; } // atEnd is another kludge for these browsers -- if the cursor is // at the end of the document, and the node doesn't have an // offset, just scroll to the end. if (compensateHack == 0) atEnd = false; // WebKit has a bad habit of (sometimes) happily returning bogus // offsets when the document has just been changed. This seems to // always be 5/5, so we don't use those. if (webkit && element && element.offsetTop == 5 && element.offsetLeft == 5) return; var y = compensateHack * (element ? element.offsetHeight : 0), x = 0, width = (node ? node.offsetWidth : 0), pos = element; while (pos && pos.offsetParent) { y += pos.offsetTop; // Don't count X offset for <br> nodes if (!isBR(pos)) x += pos.offsetLeft; pos = pos.offsetParent; } var scroll_x = body.scrollLeft || html.scrollLeft || 0, scroll_y = body.scrollTop || html.scrollTop || 0, scroll = false, screen_width = window.innerWidth || html.clientWidth || 0; if (cursor || width < screen_width) { if (cursor) { var off = select.offsetInNode(node), size = nodeText(node).length; if (size) x += width * (off / size); } var screen_x = x - scroll_x; if (screen_x < 0 || screen_x > screen_width) { scroll_x = x; scroll = true; } } var screen_y = y - scroll_y; if (screen_y < 0 || atEnd || screen_y > (window.innerHeight || html.clientHeight || 0) - 50) { scroll_y = atEnd ? 1e6 : y; scroll = true; } if (scroll) window.scrollTo(scroll_x, scroll_y); }; select.scrollToCursor = function(container) { select.scrollToNode(select.selectionTopNode(container, true) || container.firstChild, true); }; // Used to prevent restoring a selection when we do not need to. var currentSelection = null; select.snapshotChanged = function() { if (currentSelection) currentSelection.changed = true; }; // Find the 'leaf' node (BR or text) after the given one. function baseNodeAfter(node) { var next = node.nextSibling; if (next) { while (next.firstChild) next = next.firstChild; if (next.nodeType == 3 || isBR(next)) return next; else return baseNodeAfter(next); } else { var parent = node.parentNode; while (parent && !parent.nextSibling) parent = parent.parentNode; return parent && baseNodeAfter(parent); } } // This is called by the code in editor.js whenever it is replacing // a text node. The function sees whether the given oldNode is part // of the current selection, and updates this selection if it is. // Because nodes are often only partially replaced, the length of // the part that gets replaced has to be taken into account -- the // selection might stay in the oldNode if the newNode is smaller // than the selection's offset. The offset argument is needed in // case the selection does move to the new object, and the given // length is not the whole length of the new node (part of it might // have been used to replace another node). select.snapshotReplaceNode = function(from, to, length, offset) { if (!currentSelection) return; function replace(point) { if (from == point.node) { currentSelection.changed = true; if (length && point.offset > length) { point.offset -= length; } else { point.node = to; point.offset += (offset || 0); } } else if (select.ie_selection && point.offset == 0 && point.node == baseNodeAfter(from)) { currentSelection.changed = true; } } replace(currentSelection.start); replace(currentSelection.end); }; select.snapshotMove = function(from, to, distance, relative, ifAtStart) { if (!currentSelection) return; function move(point) { if (from == point.node && (!ifAtStart || point.offset == 0)) { currentSelection.changed = true; point.node = to; if (relative) point.offset = Math.max(0, point.offset + distance); else point.offset = distance; } } move(currentSelection.start); move(currentSelection.end); }; // Most functions are defined in two ways, one for the IE selection // model, one for the W3C one. if (select.ie_selection) { function selRange() { var sel = document.selection; return sel && (sel.createRange || sel.createTextRange)(); } function selectionNode(start) { var range = selRange(); range.collapse(start); function nodeAfter(node) { var found = null; while (!found && node) { found = node.nextSibling; node = node.parentNode; } return nodeAtStartOf(found); } function nodeAtStartOf(node) { while (node && node.firstChild) node = node.firstChild; return {node: node, offset: 0}; } var containing = range.parentElement(); if (!isAncestor(document.body, containing)) return null; if (!containing.firstChild) return nodeAtStartOf(containing); var working = range.duplicate(); working.moveToElementText(containing); working.collapse(true); for (var cur = containing.firstChild; cur; cur = cur.nextSibling) { if (cur.nodeType == 3) { var size = cur.nodeValue.length; working.move("character", size); } else { working.moveToElementText(cur); working.collapse(false); } var dir = range.compareEndPoints("StartToStart", working); if (dir == 0) return nodeAfter(cur); if (dir == 1) continue; if (cur.nodeType != 3) return nodeAtStartOf(cur); working.setEndPoint("StartToEnd", range); return {node: cur, offset: size - working.text.length}; } return nodeAfter(containing); } select.markSelection = function() { currentSelection = null; var sel = document.selection; if (!sel) return; var start = selectionNode(true), end = selectionNode(false); if (!start || !end) return; currentSelection = {start: start, end: end, changed: false}; }; select.selectMarked = function() { if (!currentSelection || !currentSelection.changed) return; function makeRange(point) { var range = document.body.createTextRange(), node = point.node; if (!node) { range.moveToElementText(document.body); range.collapse(false); } else if (node.nodeType == 3) { range.moveToElementText(node.parentNode); var offset = point.offset; while (node.previousSibling) { node = node.previousSibling; offset += (node.innerText || "").length; } range.move("character", offset); } else { range.moveToElementText(node); range.collapse(true); } return range; } var start = makeRange(currentSelection.start), end = makeRange(currentSelection.end); start.setEndPoint("StartToEnd", end); start.select(); }; select.offsetInNode = function(node) { var range = selRange(); if (!range) return 0; var range2 = range.duplicate(); try {range2.moveToElementText(node);} catch(e){return 0;} range.setEndPoint("StartToStart", range2); return range.text.length; }; // Get the top-level node that one end of the cursor is inside or // after. Note that this returns false for 'no cursor', and null // for 'start of document'. select.selectionTopNode = function(container, start) { var range = selRange(); if (!range) return false; var range2 = range.duplicate(); range.collapse(start); var around = range.parentElement(); if (around && isAncestor(container, around)) { // Only use this node if the selection is not at its start. range2.moveToElementText(around); if (range.compareEndPoints("StartToStart", range2) == 1) return topLevelNodeAt(around, container); } // Move the start of a range to the start of a node, // compensating for the fact that you can't call // moveToElementText with text nodes. function moveToNodeStart(range, node) { if (node.nodeType == 3) { var count = 0, cur = node.previousSibling; while (cur && cur.nodeType == 3) { count += cur.nodeValue.length; cur = cur.previousSibling; } if (cur) { try{range.moveToElementText(cur);} catch(e){return false;} range.collapse(false); } else range.moveToElementText(node.parentNode); if (count) range.move("character", count); } else { try{range.moveToElementText(node);} catch(e){return false;} } return true; } // Do a binary search through the container object, comparing // the start of each node to the selection var start = 0, end = container.childNodes.length - 1; while (start < end) { var middle = Math.ceil((end + start) / 2), node = container.childNodes[middle]; if (!node) return false; // Don't ask. IE6 manages this sometimes. if (!moveToNodeStart(range2, node)) return false; if (range.compareEndPoints("StartToStart", range2) == 1) start = middle; else end = middle - 1; } if (start == 0) { var test1 = selRange(), test2 = test1.duplicate(); try { test2.moveToElementText(container); } catch(exception) { return null; } if (test1.compareEndPoints("StartToStart", test2) == 0) return null; } return container.childNodes[start] || null; }; // Place the cursor after this.start. This is only useful when // manually moving the cursor instead of restoring it to its old // position. select.focusAfterNode = function(node, container) { var range = document.body.createTextRange(); range.moveToElementText(node || container); range.collapse(!node); range.select(); }; select.somethingSelected = function() { var range = selRange(); return range && (range.text != ""); }; function insertAtCursor(html) { var range = selRange(); if (range) { range.pasteHTML(html); range.collapse(false); range.select(); } } // Used to normalize the effect of the enter key, since browsers // do widely different things when pressing enter in designMode. select.insertNewlineAtCursor = function() { insertAtCursor("<br>"); }; select.insertTabAtCursor = function() { insertAtCursor(fourSpaces); }; // Get the BR node at the start of the line on which the cursor // currently is, and the offset into the line. Returns null as // node if cursor is on first line. select.cursorPos = function(container, start) { var range = selRange(); if (!range) return null; var topNode = select.selectionTopNode(container, start); while (topNode && !isBR(topNode)) topNode = topNode.previousSibling; var range2 = range.duplicate(); range.collapse(start); if (topNode) { range2.moveToElementText(topNode); range2.collapse(false); } else { // When nothing is selected, we can get all kinds of funky errors here. try { range2.moveToElementText(container); } catch (e) { return null; } range2.collapse(true); } range.setEndPoint("StartToStart", range2); return {node: topNode, offset: range.text.length}; }; select.setCursorPos = function(container, from, to) { function rangeAt(pos) { var range = document.body.createTextRange(); if (!pos.node) { range.moveToElementText(container); range.collapse(true); } else { range.moveToElementText(pos.node); range.collapse(false); } range.move("character", pos.offset); return range; } var range = rangeAt(from); if (to && to != from) range.setEndPoint("EndToEnd", rangeAt(to)); range.select(); } // Some hacks for storing and re-storing the selection when the editor loses and regains focus. select.getBookmark = function (container) { var from = select.cursorPos(container, true), to = select.cursorPos(container, false); if (from && to) return {from: from, to: to}; }; // Restore a stored selection. select.setBookmark = function(container, mark) { if (!mark) return; select.setCursorPos(container, mark.from, mark.to); }; } // W3C model else { // Find the node right at the cursor, not one of its // ancestors with a suitable offset. This goes down the DOM tree // until a 'leaf' is reached (or is it *up* the DOM tree?). function innerNode(node, offset) { while (node.nodeType != 3 && !isBR(node)) { var newNode = node.childNodes[offset] || node.nextSibling; offset = 0; while (!newNode && node.parentNode) { node = node.parentNode; newNode = node.nextSibling; } node = newNode; if (!newNode) break; } return {node: node, offset: offset}; } // Store start and end nodes, and offsets within these, and refer // back to the selection object from those nodes, so that this // object can be updated when the nodes are replaced before the // selection is restored. select.markSelection = function () { var selection = window.getSelection(); if (!selection || selection.rangeCount == 0) return (currentSelection = null); var range = selection.getRangeAt(0); currentSelection = { start: innerNode(range.startContainer, range.startOffset), end: innerNode(range.endContainer, range.endOffset), changed: false }; }; select.selectMarked = function () { var cs = currentSelection; // on webkit-based browsers, it is apparently possible that the // selection gets reset even when a node that is not one of the // endpoints get messed with. the most common situation where // this occurs is when a selection is deleted or overwitten. we // check for that here. function focusIssue() { if (cs.start.node == cs.end.node && cs.start.offset == cs.end.offset) { var selection = window.getSelection(); if (!selection || selection.rangeCount == 0) return true; var range = selection.getRangeAt(0), point = innerNode(range.startContainer, range.startOffset); return cs.start.node != point.node || cs.start.offset != point.offset; } } if (!cs || !(cs.changed || (webkit && focusIssue()))) return; var range = document.createRange(); function setPoint(point, which) { if (point.node) { // Some magic to generalize the setting of the start and end // of a range. if (point.offset == 0) range["set" + which + "Before"](point.node); else range["set" + which](point.node, point.offset); } else { range.setStartAfter(document.body.lastChild || document.body); } } setPoint(cs.end, "End"); setPoint(cs.start, "Start"); selectRange(range); }; // Helper for selecting a range object. function selectRange(range) { var selection = window.getSelection(); if (!selection) return; selection.removeAllRanges(); selection.addRange(range); } function selectionRange() { var selection = window.getSelection(); if (!selection || selection.rangeCount == 0) return false; else return selection.getRangeAt(0); } // Finding the top-level node at the cursor in the W3C is, as you // can see, quite an involved process. select.selectionTopNode = function(container, start) { var range = selectionRange(); if (!range) return false; var node = start ? range.startContainer : range.endContainer; var offset = start ? range.startOffset : range.endOffset; // Work around (yet another) bug in Opera's selection model. if (window.opera && !start && range.endContainer == container && range.endOffset == range.startOffset + 1 && container.childNodes[range.startOffset] && isBR(container.childNodes[range.startOffset])) offset--; // For text nodes, we look at the node itself if the cursor is // inside, or at the node before it if the cursor is at the // start. if (node.nodeType == 3){ if (offset > 0) return topLevelNodeAt(node, container); else return topLevelNodeBefore(node, container); } // Occasionally, browsers will return the HTML node as // selection. If the offset is 0, we take the start of the frame // ('after null'), otherwise, we take the last node. else if (node.nodeName.toUpperCase() == "HTML") { return (offset == 1 ? null : container.lastChild); } // If the given node is our 'container', we just look up the // correct node by using the offset. else if (node == container) { return (offset == 0) ? null : node.childNodes[offset - 1]; } // In any other case, we have a regular node. If the cursor is // at the end of the node, we use the node itself, if it is at // the start, we use the node before it, and in any other // case, we look up the child before the cursor and use that. else { if (offset == node.childNodes.length) return topLevelNodeAt(node, container); else if (offset == 0) return topLevelNodeBefore(node, container); else return topLevelNodeAt(node.childNodes[offset - 1], container); } }; select.focusAfterNode = function(node, container) { var range = document.createRange(); range.setStartBefore(container.firstChild || container); // In Opera, setting the end of a range at the end of a line // (before a BR) will cause the cursor to appear on the next // line, so we set the end inside of the start node when // possible. if (node && !node.firstChild) range.setEndAfter(node); else if (node) range.setEnd(node, node.childNodes.length); else range.setEndBefore(container.firstChild || container); range.collapse(false); selectRange(range); }; select.somethingSelected = function() { var range = selectionRange(); return range && !range.collapsed; }; select.offsetInNode = function(node) { var range = selectionRange(); if (!range) return 0; range = range.cloneRange(); range.setStartBefore(node); return range.toString().length; }; select.insertNodeAtCursor = function(node) { var range = selectionRange(); if (!range) return; range.deleteContents(); range.insertNode(node); webkitLastLineHack(document.body); // work around weirdness where Opera will magically insert a new // BR node when a BR node inside a span is moved around. makes // sure the BR ends up outside of spans. if (window.opera && isBR(node) && isSpan(node.parentNode)) { var next = node.nextSibling, p = node.parentNode, outer = p.parentNode; outer.insertBefore(node, p.nextSibling); var textAfter = ""; for (; next && next.nodeType == 3; next = next.nextSibling) { textAfter += next.nodeValue; removeElement(next); } outer.insertBefore(makePartSpan(textAfter, document), node.nextSibling); } range = document.createRange(); range.selectNode(node); range.collapse(false); selectRange(range); } select.insertNewlineAtCursor = function() { select.insertNodeAtCursor(document.createElement("BR")); }; select.insertTabAtCursor = function() { select.insertNodeAtCursor(document.createTextNode(fourSpaces)); }; select.cursorPos = function(container, start) { var range = selectionRange(); if (!range) return; var topNode = select.selectionTopNode(container, start); while (topNode && !isBR(topNode)) topNode = topNode.previousSibling; range = range.cloneRange(); range.collapse(start); if (topNode) range.setStartAfter(topNode); else range.setStartBefore(container); var text = range.toString(); return {node: topNode, offset: text.length}; }; select.setCursorPos = function(container, from, to) { var range = document.createRange(); function setPoint(node, offset, side) { if (offset == 0 && node && !node.nextSibling) { range["set" + side + "After"](node); return true; } if (!node) node = container.firstChild; else node = node.nextSibling; if (!node) return; if (offset == 0) { range["set" + side + "Before"](node); return true; } var backlog = [] function decompose(node) { if (node.nodeType == 3) backlog.push(node); else forEach(node.childNodes, decompose); } while (true) { while (node && !backlog.length) { decompose(node); node = node.nextSibling; } var cur = backlog.shift(); if (!cur) return false; var length = cur.nodeValue.length; if (length >= offset) { range["set" + side](cur, offset); return true; } offset -= length; } } to = to || from; if (setPoint(to.node, to.offset, "End") && setPoint(from.node, from.offset, "Start")) selectRange(range); }; } })();
JavaScript
/* A few useful utility functions. */ // Capture a method on an object. function method(obj, name) { return function() {obj[name].apply(obj, arguments);}; } // The value used to signal the end of a sequence in iterators. var StopIteration = {toString: function() {return "StopIteration"}}; // Apply a function to each element in a sequence. function forEach(iter, f) { if (iter.next) { try {while (true) f(iter.next());} catch (e) {if (e != StopIteration) throw e;} } else { for (var i = 0; i < iter.length; i++) f(iter[i]); } } // Map a function over a sequence, producing an array of results. function map(iter, f) { var accum = []; forEach(iter, function(val) {accum.push(f(val));}); return accum; } // Create a predicate function that tests a string againsts a given // regular expression. No longer used but might be used by 3rd party // parsers. function matcher(regexp){ return function(value){return regexp.test(value);}; } // Test whether a DOM node has a certain CSS class. function hasClass(element, className) { var classes = element.className; return classes && new RegExp("(^| )" + className + "($| )").test(classes); } function removeClass(element, className) { element.className = element.className.replace(new RegExp(" " + className + "\\b", "g"), ""); return element; } // Insert a DOM node after another node. function insertAfter(newNode, oldNode) { var parent = oldNode.parentNode; parent.insertBefore(newNode, oldNode.nextSibling); return newNode; } function removeElement(node) { if (node.parentNode) node.parentNode.removeChild(node); } function clearElement(node) { while (node.firstChild) node.removeChild(node.firstChild); } // Check whether a node is contained in another one. function isAncestor(node, child) { while (child = child.parentNode) { if (node == child) return true; } return false; } // The non-breaking space character. var nbsp = "\u00a0"; var matching = {"{": "}", "[": "]", "(": ")", "}": "{", "]": "[", ")": "("}; // Standardize a few unportable event properties. function normalizeEvent(event) { if (!event.stopPropagation) { event.stopPropagation = function() {this.cancelBubble = true;}; event.preventDefault = function() {this.returnValue = false;}; } if (!event.stop) { event.stop = function() { this.stopPropagation(); this.preventDefault(); }; } if (event.type == "keypress") { event.code = (event.charCode == null) ? event.keyCode : event.charCode; event.character = String.fromCharCode(event.code); } return event; } // Portably register event handlers. function addEventHandler(node, type, handler, removeFunc) { function wrapHandler(event) { handler(normalizeEvent(event || window.event)); } if (typeof node.addEventListener == "function") { node.addEventListener(type, wrapHandler, false); if (removeFunc) return function() {node.removeEventListener(type, wrapHandler, false);}; } else { node.attachEvent("on" + type, wrapHandler); if (removeFunc) return function() {node.detachEvent("on" + type, wrapHandler);}; } } function nodeText(node) { return node.textContent || node.innerText || node.nodeValue || ""; } function nodeTop(node) { var top = 0; while (node.offsetParent) { top += node.offsetTop; node = node.offsetParent; } return top; } function isBR(node) { var nn = node.nodeName; return nn == "BR" || nn == "br"; } function isSpan(node) { var nn = node.nodeName; return nn == "SPAN" || nn == "span"; }
JavaScript
var SparqlParser = Editor.Parser = (function() { function wordRegexp(words) { return new RegExp("^(?:" + words.join("|") + ")$", "i"); } var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", "isblank", "isliteral", "union", "a"]); var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", "graph", "by", "asc", "desc"]); var operatorChars = /[*+\-<>=&|]/; var tokenizeSparql = (function() { function normal(source, setState) { var ch = source.next(); if (ch == "$" || ch == "?") { source.nextWhileMatches(/[\w\d]/); return "sp-var"; } else if (ch == "<" && !source.matches(/[\s\u00a0=]/)) { source.nextWhileMatches(/[^\s\u00a0>]/); if (source.equals(">")) source.next(); return "sp-uri"; } else if (ch == "\"" || ch == "'") { setState(inLiteral(ch)); return null; } else if (/[{}\(\),\.;\[\]]/.test(ch)) { return "sp-punc"; } else if (ch == "#") { while (!source.endOfLine()) source.next(); return "sp-comment"; } else if (operatorChars.test(ch)) { source.nextWhileMatches(operatorChars); return "sp-operator"; } else if (ch == ":") { source.nextWhileMatches(/[\w\d\._\-]/); return "sp-prefixed"; } else { source.nextWhileMatches(/[_\w\d]/); if (source.equals(":")) { source.next(); source.nextWhileMatches(/[\w\d_\-]/); return "sp-prefixed"; } var word = source.get(), type; if (ops.test(word)) type = "sp-operator"; else if (keywords.test(word)) type = "sp-keyword"; else type = "sp-word"; return {style: type, content: word}; } } function inLiteral(quote) { return function(source, setState) { var escaped = false; while (!source.endOfLine()) { var ch = source.next(); if (ch == quote && !escaped) { setState(normal); break; } escaped = !escaped && ch == "\\"; } return "sp-literal"; }; } return function(source, startState) { return tokenizer(source, startState || normal); }; })(); function indentSparql(context) { return function(nextChars) { var firstChar = nextChars && nextChars.charAt(0); if (/[\]\}]/.test(firstChar)) while (context && context.type == "pattern") context = context.prev; var closing = context && firstChar == matching[context.type]; if (!context) return 0; else if (context.type == "pattern") return context.col; else if (context.align) return context.col - (closing ? context.width : 0); else return context.indent + (closing ? 0 : indentUnit); } } function parseSparql(source) { var tokens = tokenizeSparql(source); var context = null, indent = 0, col = 0; function pushContext(type, width) { context = {prev: context, indent: indent, col: col, type: type, width: width}; } function popContext() { context = context.prev; } var iter = { next: function() { var token = tokens.next(), type = token.style, content = token.content, width = token.value.length; if (content == "\n") { token.indentation = indentSparql(context); indent = col = 0; if (context && context.align == null) context.align = false; } else if (type == "whitespace" && col == 0) { indent = width; } else if (type != "sp-comment" && context && context.align == null) { context.align = true; } if (content != "\n") col += width; if (/[\[\{\(]/.test(content)) { pushContext(content, width); } else if (/[\]\}\)]/.test(content)) { while (context && context.type == "pattern") popContext(); if (context && content == matching[context.type]) popContext(); } else if (content == "." && context && context.type == "pattern") { popContext(); } else if ((type == "sp-word" || type == "sp-prefixed" || type == "sp-uri" || type == "sp-var" || type == "sp-literal") && context && /[\{\[]/.test(context.type)) { pushContext("pattern", width); } return token; }, copy: function() { var _context = context, _indent = indent, _col = col, _tokenState = tokens.state; return function(source) { tokens = tokenizeSparql(source, _tokenState); context = _context; indent = _indent; col = _col; return iter; }; } }; return iter; } return {make: parseSparql, electricChars: "}]"}; })();
JavaScript
/* This file defines an XML parser, with a few kludges to make it * useable for HTML. autoSelfClosers defines a set of tag names that * are expected to not have a closing tag, and doNotIndent specifies * the tags inside of which no indentation should happen (see Config * object). These can be disabled by passing the editor an object like * {useHTMLKludges: false} as parserConfig option. */ var XMLParser = Editor.Parser = (function() { var Kludges = { autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true, "meta": true, "col": true, "frame": true, "base": true, "area": true}, doNotIndent: {"pre": true, "!cdata": true} }; var NoKludges = {autoSelfClosers: {}, doNotIndent: {"!cdata": true}}; var UseKludges = Kludges; var alignCDATA = false; // Simple stateful tokenizer for XML documents. Returns a // MochiKit-style iterator, with a state property that contains a // function encapsulating the current state. See tokenize.js. var tokenizeXML = (function() { function inText(source, setState) { var ch = source.next(); if (ch == "<") { if (source.equals("!")) { source.next(); if (source.equals("[")) { if (source.lookAhead("[CDATA[", true)) { setState(inBlock("xml-cdata", "]]>")); return null; } else { return "xml-text"; } } else if (source.lookAhead("--", true)) { setState(inBlock("xml-comment", "-->")); return null; } else if (source.lookAhead("DOCTYPE", true)) { source.nextWhileMatches(/[\w\._\-]/); setState(inBlock("xml-doctype", ">")); return "xml-doctype"; } else { return "xml-text"; } } else if (source.equals("?")) { source.next(); source.nextWhileMatches(/[\w\._\-]/); setState(inBlock("xml-processing", "?>")); return "xml-processing"; } else { if (source.equals("/")) source.next(); setState(inTag); return "xml-punctuation"; } } else if (ch == "&") { while (!source.endOfLine()) { if (source.next() == ";") break; } return "xml-entity"; } else { source.nextWhileMatches(/[^&<\n]/); return "xml-text"; } } function inTag(source, setState) { var ch = source.next(); if (ch == ">") { setState(inText); return "xml-punctuation"; } else if (/[?\/]/.test(ch) && source.equals(">")) { source.next(); setState(inText); return "xml-punctuation"; } else if (ch == "=") { return "xml-punctuation"; } else if (/[\'\"]/.test(ch)) { setState(inAttribute(ch)); return null; } else { source.nextWhileMatches(/[^\s\u00a0=<>\"\'\/?]/); return "xml-name"; } } function inAttribute(quote) { return function(source, setState) { while (!source.endOfLine()) { if (source.next() == quote) { setState(inTag); break; } } return "xml-attribute"; }; } function inBlock(style, terminator) { return function(source, setState) { while (!source.endOfLine()) { if (source.lookAhead(terminator, true)) { setState(inText); break; } source.next(); } return style; }; } return function(source, startState) { return tokenizer(source, startState || inText); }; })(); // The parser. The structure of this function largely follows that of // parseJavaScript in parsejavascript.js (there is actually a bit more // shared code than I'd like), but it is quite a bit simpler. function parseXML(source) { var tokens = tokenizeXML(source), token; var cc = [base]; var tokenNr = 0, indented = 0; var currentTag = null, context = null; var consume; function push(fs) { for (var i = fs.length - 1; i >= 0; i--) cc.push(fs[i]); } function cont() { push(arguments); consume = true; } function pass() { push(arguments); consume = false; } function markErr() { token.style += " xml-error"; } function expect(text) { return function(style, content) { if (content == text) cont(); else {markErr(); cont(arguments.callee);} }; } function pushContext(tagname, startOfLine) { var noIndent = UseKludges.doNotIndent.hasOwnProperty(tagname) || (context && context.noIndent); context = {prev: context, name: tagname, indent: indented, startOfLine: startOfLine, noIndent: noIndent}; } function popContext() { context = context.prev; } function computeIndentation(baseContext) { return function(nextChars, current) { var context = baseContext; if (context && context.noIndent) return current; if (alignCDATA && /<!\[CDATA\[/.test(nextChars)) return 0; if (context && /^<\//.test(nextChars)) context = context.prev; while (context && !context.startOfLine) context = context.prev; if (context) return context.indent + indentUnit; else return 0; }; } function base() { return pass(element, base); } var harmlessTokens = {"xml-text": true, "xml-entity": true, "xml-comment": true, "xml-processing": true, "xml-doctype": true}; function element(style, content) { if (content == "<") cont(tagname, attributes, endtag(tokenNr == 1)); else if (content == "</") cont(closetagname, expect(">")); else if (style == "xml-cdata") { if (!context || context.name != "!cdata") pushContext("!cdata"); if (/\]\]>$/.test(content)) popContext(); cont(); } else if (harmlessTokens.hasOwnProperty(style)) cont(); else {markErr(); cont();} } function tagname(style, content) { if (style == "xml-name") { currentTag = content.toLowerCase(); token.style = "xml-tagname"; cont(); } else { currentTag = null; pass(); } } function closetagname(style, content) { if (style == "xml-name") { token.style = "xml-tagname"; if (context && content.toLowerCase() == context.name) popContext(); else markErr(); } cont(); } function endtag(startOfLine) { return function(style, content) { if (content == "/>" || (content == ">" && UseKludges.autoSelfClosers.hasOwnProperty(currentTag))) cont(); else if (content == ">") {pushContext(currentTag, startOfLine); cont();} else {markErr(); cont(arguments.callee);} }; } function attributes(style) { if (style == "xml-name") {token.style = "xml-attname"; cont(attribute, attributes);} else pass(); } function attribute(style, content) { if (content == "=") cont(value); else if (content == ">" || content == "/>") pass(endtag); else pass(); } function value(style) { if (style == "xml-attribute") cont(value); else pass(); } return { indentation: function() {return indented;}, next: function(){ token = tokens.next(); if (token.style == "whitespace" && tokenNr == 0) indented = token.value.length; else tokenNr++; if (token.content == "\n") { indented = tokenNr = 0; token.indentation = computeIndentation(context); } if (token.style == "whitespace" || token.type == "xml-comment") return token; while(true){ consume = false; cc.pop()(token.style, token.content); if (consume) return token; } }, copy: function(){ var _cc = cc.concat([]), _tokenState = tokens.state, _context = context; var parser = this; return function(input){ cc = _cc.concat([]); tokenNr = indented = 0; context = _context; tokens = tokenizeXML(input, _tokenState); return parser; }; } }; } return { make: parseXML, electricChars: "/", configure: function(config) { if (config.useHTMLKludges != null) UseKludges = config.useHTMLKludges ? Kludges : NoKludges; if (config.alignCDATA) alignCDATA = config.alignCDATA; } }; })();
JavaScript
/* Tokenizer for JavaScript code */ var tokenizeJavaScript = (function() { // Advance the stream until the given character (not preceded by a // backslash) is encountered, or the end of the line is reached. function nextUntilUnescaped(source, end) { var escaped = false; while (!source.endOfLine()) { var next = source.next(); if (next == end && !escaped) return false; escaped = !escaped && next == "\\"; } return escaped; } // A map of JavaScript's keywords. The a/b/c keyword distinction is // very rough, but it gives the parser enough information to parse // correct code correctly (we don't care that much how we parse // incorrect code). The style information included in these objects // is used by the highlighter to pick the correct CSS style for a // token. var keywords = function(){ function result(type, style){ return {type: type, style: "js-" + style}; } // keywords that take a parenthised expression, and then a // statement (if) var keywordA = result("keyword a", "keyword"); // keywords that take just a statement (else) var keywordB = result("keyword b", "keyword"); // keywords that optionally take an expression, and form a // statement (return) var keywordC = result("keyword c", "keyword"); var operator = result("operator", "keyword"); var atom = result("atom", "atom"); return { "if": keywordA, "while": keywordA, "with": keywordA, "else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB, "return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "delete": keywordC, "throw": keywordC, "in": operator, "typeof": operator, "instanceof": operator, "var": result("var", "keyword"), "function": result("function", "keyword"), "catch": result("catch", "keyword"), "for": result("for", "keyword"), "switch": result("switch", "keyword"), "case": result("case", "keyword"), "default": result("default", "keyword"), "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom }; }(); // Some helper regexps var isOperatorChar = /[+\-*&%=<>!?|]/; var isHexDigit = /[0-9A-Fa-f]/; var isWordChar = /[\w\$_]/; // Wrapper around jsToken that helps maintain parser state (whether // we are inside of a multi-line comment and whether the next token // could be a regular expression). function jsTokenState(inside, regexp) { return function(source, setState) { var newInside = inside; var type = jsToken(inside, regexp, source, function(c) {newInside = c;}); var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/); if (newRegexp != regexp || newInside != inside) setState(jsTokenState(newInside, newRegexp)); return type; }; } // The token reader, intended to be used by the tokenizer from // tokenize.js (through jsTokenState). Advances the source stream // over a token, and returns an object containing the type and style // of that token. function jsToken(inside, regexp, source, setInside) { function readHexNumber(){ source.next(); // skip the 'x' source.nextWhileMatches(isHexDigit); return {type: "number", style: "js-atom"}; } function readNumber() { source.nextWhileMatches(/[0-9]/); if (source.equals(".")){ source.next(); source.nextWhileMatches(/[0-9]/); } if (source.equals("e") || source.equals("E")){ source.next(); if (source.equals("-")) source.next(); source.nextWhileMatches(/[0-9]/); } return {type: "number", style: "js-atom"}; } // Read a word, look it up in keywords. If not found, it is a // variable, otherwise it is a keyword of the type found. function readWord() { source.nextWhileMatches(isWordChar); var word = source.get(); var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word]; return known ? {type: known.type, style: known.style, content: word} : {type: "variable", style: "js-variable", content: word}; } function readRegexp() { nextUntilUnescaped(source, "/"); source.nextWhileMatches(/[gimy]/); // 'y' is "sticky" option in Mozilla return {type: "regexp", style: "js-string"}; } // Mutli-line comments are tricky. We want to return the newlines // embedded in them as regular newline tokens, and then continue // returning a comment token for every line of the comment. So // some state has to be saved (inside) to indicate whether we are // inside a /* */ sequence. function readMultilineComment(start){ var newInside = "/*"; var maybeEnd = (start == "*"); while (true) { if (source.endOfLine()) break; var next = source.next(); if (next == "/" && maybeEnd){ newInside = null; break; } maybeEnd = (next == "*"); } setInside(newInside); return {type: "comment", style: "js-comment"}; } function readOperator() { source.nextWhileMatches(isOperatorChar); return {type: "operator", style: "js-operator"}; } function readString(quote) { var endBackSlash = nextUntilUnescaped(source, quote); setInside(endBackSlash ? quote : null); return {type: "string", style: "js-string"}; } // Fetch the next token. Dispatches on first character in the // stream, or first two characters when the first is a slash. if (inside == "\"" || inside == "'") return readString(inside); var ch = source.next(); if (inside == "/*") return readMultilineComment(ch); else if (ch == "\"" || ch == "'") return readString(ch); // with punctuation, the type of the token is the symbol itself else if (/[\[\]{}\(\),;\:\.]/.test(ch)) return {type: ch, style: "js-punctuation"}; else if (ch == "0" && (source.equals("x") || source.equals("X"))) return readHexNumber(); else if (/[0-9]/.test(ch)) return readNumber(); else if (ch == "/"){ if (source.equals("*")) { source.next(); return readMultilineComment(ch); } else if (source.equals("/")) { nextUntilUnescaped(source, null); return {type: "comment", style: "js-comment"};} else if (regexp) return readRegexp(); else return readOperator(); } else if (isOperatorChar.test(ch)) return readOperator(); else return readWord(); } // The external interface to the tokenizer. return function(source, startState) { return tokenizer(source, startState || jsTokenState(false, true)); }; })();
JavaScript
// A framework for simple tokenizers. Takes care of newlines and // white-space, and of getting the text from the source stream into // the token object. A state is a function of two arguments -- a // string stream and a setState function. The second can be used to // change the tokenizer's state, and can be ignored for stateless // tokenizers. This function should advance the stream over a token // and return a string or object containing information about the next // token, or null to pass and have the (new) state be called to finish // the token. When a string is given, it is wrapped in a {style, type} // object. In the resulting object, the characters consumed are stored // under the content property. Any whitespace following them is also // automatically consumed, and added to the value property. (Thus, // content is the actual meaningful part of the token, while value // contains all the text it spans.) function tokenizer(source, state) { // Newlines are always a separate token. function isWhiteSpace(ch) { // The messy regexp is because IE's regexp matcher is of the // opinion that non-breaking spaces are no whitespace. return ch != "\n" && /^[\s\u00a0]*$/.test(ch); } var tokenizer = { state: state, take: function(type) { if (typeof(type) == "string") type = {style: type, type: type}; type.content = (type.content || "") + source.get(); if (!/\n$/.test(type.content)) source.nextWhile(isWhiteSpace); type.value = type.content + source.get(); return type; }, next: function () { if (!source.more()) throw StopIteration; var type; if (source.equals("\n")) { source.next(); return this.take("whitespace"); } if (source.applies(isWhiteSpace)) type = "whitespace"; else while (!type) type = this.state(source, function(s) {tokenizer.state = s;}); return this.take(type); } }; return tokenizer; }
JavaScript
/* CodeMirror main module (http://codemirror.net/) * * Implements the CodeMirror constructor and prototype, which take care * of initializing the editor frame, and providing the outside interface. */ // The CodeMirrorConfig object is used to specify a default // configuration. If you specify such an object before loading this // file, the values you put into it will override the defaults given // below. You can also assign to it after loading. var CodeMirrorConfig = window.CodeMirrorConfig || {}; var CodeMirror = (function(){ function setDefaults(object, defaults) { for (var option in defaults) { if (!object.hasOwnProperty(option)) object[option] = defaults[option]; } } function forEach(array, action) { for (var i = 0; i < array.length; i++) action(array[i]); } function createHTMLElement(el) { if (document.createElementNS && document.documentElement.namespaceURI !== null) return document.createElementNS("http://www.w3.org/1999/xhtml", el) else return document.createElement(el) } // These default options can be overridden by passing a set of // options to a specific CodeMirror constructor. See manual.html for // their meaning. setDefaults(CodeMirrorConfig, { stylesheet: [], path: "", parserfile: [], basefiles: ["util.js", "stringstream.js", "select.js", "undo.js", "editor.js", "tokenize.js"], iframeClass: null, passDelay: 200, passTime: 50, lineNumberDelay: 200, lineNumberTime: 50, continuousScanning: false, saveFunction: null, onLoad: null, onChange: null, undoDepth: 50, undoDelay: 800, disableSpellcheck: true, textWrapping: true, readOnly: false, width: "", height: "300px", minHeight: 100, autoMatchParens: false, markParen: null, unmarkParen: null, parserConfig: null, tabMode: "indent", // or "spaces", "default", "shift" enterMode: "indent", // or "keep", "flat" electricChars: true, reindentOnLoad: false, activeTokens: null, onCursorActivity: null, lineNumbers: false, firstLineNumber: 1, onLineNumberClick: null, indentUnit: 2, domain: null, noScriptCaching: false, incrementalLoading: false }); function addLineNumberDiv(container, firstNum) { var nums = createHTMLElement("div"), scroller = createHTMLElement("div"); nums.style.position = "absolute"; nums.style.height = "100%"; if (nums.style.setExpression) { try {nums.style.setExpression("height", "this.previousSibling.offsetHeight + 'px'");} catch(e) {} // Seems to throw 'Not Implemented' on some IE8 versions } nums.style.top = "0px"; nums.style.left = "0px"; nums.style.overflow = "hidden"; container.appendChild(nums); scroller.className = "CodeMirror-line-numbers"; nums.appendChild(scroller); scroller.innerHTML = "<div>" + firstNum + "</div>"; return nums; } function frameHTML(options) { if (typeof options.parserfile == "string") options.parserfile = [options.parserfile]; if (typeof options.basefiles == "string") options.basefiles = [options.basefiles]; if (typeof options.stylesheet == "string") options.stylesheet = [options.stylesheet]; var html = ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head>"]; // Hack to work around a bunch of IE8-specific problems. html.push("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/>"); var queryStr = options.noScriptCaching ? "?nocache=" + new Date().getTime().toString(16) : ""; forEach(options.stylesheet, function(file) { html.push("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + file + queryStr + "\"/>"); }); forEach(options.basefiles.concat(options.parserfile), function(file) { if (!/^https?:/.test(file)) file = options.path + file; html.push("<script type=\"text/javascript\" src=\"" + file + queryStr + "\"><" + "/script>"); }); html.push("</head><body style=\"border-width: 0;\" class=\"editbox\" spellcheck=\"" + (options.disableSpellcheck ? "false" : "true") + "\"></body></html>"); return html.join(""); } var internetExplorer = document.selection && window.ActiveXObject && /MSIE/.test(navigator.userAgent); function CodeMirror(place, options) { // Use passed options, if any, to override defaults. this.options = options = options || {}; setDefaults(options, CodeMirrorConfig); // Backward compatibility for deprecated options. if (options.dumbTabs) options.tabMode = "spaces"; else if (options.normalTab) options.tabMode = "default"; if (options.cursorActivity) options.onCursorActivity = options.cursorActivity; var frame = this.frame = createHTMLElement("iframe"); if (options.iframeClass) frame.className = options.iframeClass; frame.frameBorder = 0; frame.style.border = "0"; frame.style.width = '100%'; frame.style.height = '100%'; // display: block occasionally suppresses some Firefox bugs, so we // always add it, redundant as it sounds. frame.style.display = "block"; var div = this.wrapping = createHTMLElement("div"); div.style.position = "relative"; div.className = "CodeMirror-wrapping"; div.style.width = options.width; div.style.height = (options.height == "dynamic") ? options.minHeight + "px" : options.height; // This is used by Editor.reroutePasteEvent var teHack = this.textareaHack = createHTMLElement("textarea"); div.appendChild(teHack); teHack.style.position = "absolute"; teHack.style.left = "-10000px"; teHack.style.width = "10px"; teHack.tabIndex = 100000; // Link back to this object, so that the editor can fetch options // and add a reference to itself. frame.CodeMirror = this; if (options.domain && internetExplorer) { this.html = frameHTML(options); frame.src = "javascript:(function(){document.open();" + (options.domain ? "document.domain=\"" + options.domain + "\";" : "") + "document.write(window.frameElement.CodeMirror.html);document.close();})()"; } else { frame.src = "javascript:;"; } if (place.appendChild) place.appendChild(div); else place(div); div.appendChild(frame); if (options.lineNumbers) this.lineNumbers = addLineNumberDiv(div, options.firstLineNumber); this.win = frame.contentWindow; if (!options.domain || !internetExplorer) { this.win.document.open(); this.win.document.write(frameHTML(options)); this.win.document.close(); } } CodeMirror.prototype = { init: function() { // Deprecated, but still supported. if (this.options.initCallback) this.options.initCallback(this); if (this.options.onLoad) this.options.onLoad(this); if (this.options.lineNumbers) this.activateLineNumbers(); if (this.options.reindentOnLoad) this.reindent(); if (this.options.height == "dynamic") this.setDynamicHeight(); }, getCode: function() {return this.editor.getCode();}, setCode: function(code) {this.editor.importCode(code);}, selection: function() {this.focusIfIE(); return this.editor.selectedText();}, reindent: function() {this.editor.reindent();}, reindentSelection: function() {this.focusIfIE(); this.editor.reindentSelection(null);}, focusIfIE: function() { // in IE, a lot of selection-related functionality only works when the frame is focused if (this.win.select.ie_selection && document.activeElement != this.frame) this.focus(); }, focus: function() { this.win.focus(); if (this.editor.selectionSnapshot) // IE hack this.win.select.setBookmark(this.win.document.body, this.editor.selectionSnapshot); }, replaceSelection: function(text) { this.focus(); this.editor.replaceSelection(text); return true; }, replaceChars: function(text, start, end) { this.editor.replaceChars(text, start, end); }, getSearchCursor: function(string, fromCursor, caseFold) { return this.editor.getSearchCursor(string, fromCursor, caseFold); }, undo: function() {this.editor.history.undo();}, redo: function() {this.editor.history.redo();}, historySize: function() {return this.editor.history.historySize();}, clearHistory: function() {this.editor.history.clear();}, grabKeys: function(callback, filter) {this.editor.grabKeys(callback, filter);}, ungrabKeys: function() {this.editor.ungrabKeys();}, setParser: function(name, parserConfig) {this.editor.setParser(name, parserConfig);}, setSpellcheck: function(on) {this.win.document.body.spellcheck = on;}, setStylesheet: function(names) { if (typeof names === "string") names = [names]; var activeStylesheets = {}; var matchedNames = {}; var links = this.win.document.getElementsByTagName("link"); // Create hashes of active stylesheets and matched names. // This is O(n^2) but n is expected to be very small. for (var x = 0, link; link = links[x]; x++) { if (link.rel.indexOf("stylesheet") !== -1) { for (var y = 0; y < names.length; y++) { var name = names[y]; if (link.href.substring(link.href.length - name.length) === name) { activeStylesheets[link.href] = true; matchedNames[name] = true; } } } } // Activate the selected stylesheets and disable the rest. for (var x = 0, link; link = links[x]; x++) { if (link.rel.indexOf("stylesheet") !== -1) { link.disabled = !(link.href in activeStylesheets); } } // Create any new stylesheets. for (var y = 0; y < names.length; y++) { var name = names[y]; if (!(name in matchedNames)) { var link = this.win.document.createElement("link"); link.rel = "stylesheet"; link.type = "text/css"; link.href = name; this.win.document.getElementsByTagName('head')[0].appendChild(link); } } }, setTextWrapping: function(on) { if (on == this.options.textWrapping) return; this.win.document.body.style.whiteSpace = on ? "" : "nowrap"; this.options.textWrapping = on; if (this.lineNumbers) { this.setLineNumbers(false); this.setLineNumbers(true); } }, setIndentUnit: function(unit) {this.win.indentUnit = unit;}, setUndoDepth: function(depth) {this.editor.history.maxDepth = depth;}, setTabMode: function(mode) {this.options.tabMode = mode;}, setEnterMode: function(mode) {this.options.enterMode = mode;}, setLineNumbers: function(on) { if (on && !this.lineNumbers) { this.lineNumbers = addLineNumberDiv(this.wrapping,this.options.firstLineNumber); this.activateLineNumbers(); } else if (!on && this.lineNumbers) { this.wrapping.removeChild(this.lineNumbers); this.wrapping.style.paddingLeft = ""; this.lineNumbers = null; } }, cursorPosition: function(start) {this.focusIfIE(); return this.editor.cursorPosition(start);}, firstLine: function() {return this.editor.firstLine();}, lastLine: function() {return this.editor.lastLine();}, nextLine: function(line) {return this.editor.nextLine(line);}, prevLine: function(line) {return this.editor.prevLine(line);}, lineContent: function(line) {return this.editor.lineContent(line);}, setLineContent: function(line, content) {this.editor.setLineContent(line, content);}, removeLine: function(line){this.editor.removeLine(line);}, insertIntoLine: function(line, position, content) {this.editor.insertIntoLine(line, position, content);}, selectLines: function(startLine, startOffset, endLine, endOffset) { this.win.focus(); this.editor.selectLines(startLine, startOffset, endLine, endOffset); }, nthLine: function(n) { var line = this.firstLine(); for (; n > 1 && line !== false; n--) line = this.nextLine(line); return line; }, lineNumber: function(line) { var num = 0; while (line !== false) { num++; line = this.prevLine(line); } return num; }, jumpToLine: function(line) { if (typeof line == "number") line = this.nthLine(line); this.selectLines(line, 0); this.win.focus(); }, currentLine: function() { // Deprecated, but still there for backward compatibility return this.lineNumber(this.cursorLine()); }, cursorLine: function() { return this.cursorPosition().line; }, cursorCoords: function(start) {return this.editor.cursorCoords(start);}, activateLineNumbers: function() { var frame = this.frame, win = frame.contentWindow, doc = win.document, body = doc.body, nums = this.lineNumbers, scroller = nums.firstChild, self = this; var barWidth = null; nums.onclick = function(e) { var handler = self.options.onLineNumberClick; if (handler) { var div = (e || window.event).target || (e || window.event).srcElement; var num = div == nums ? NaN : Number(div.innerHTML); if (!isNaN(num)) handler(num, div); } }; function sizeBar() { if (frame.offsetWidth == 0) return; for (var root = frame; root.parentNode; root = root.parentNode){} if (!nums.parentNode || root != document || !win.Editor) { // Clear event handlers (their nodes might already be collected, so try/catch) try{clear();}catch(e){} clearInterval(sizeInterval); return; } if (nums.offsetWidth != barWidth) { barWidth = nums.offsetWidth; frame.parentNode.style.paddingLeft = barWidth + "px"; } } function doScroll() { nums.scrollTop = body.scrollTop || doc.documentElement.scrollTop || 0; } // Cleanup function, registered by nonWrapping and wrapping. var clear = function(){}; sizeBar(); var sizeInterval = setInterval(sizeBar, 500); function ensureEnoughLineNumbers(fill) { var lineHeight = scroller.firstChild.offsetHeight; if (lineHeight == 0) return; var targetHeight = 50 + Math.max(body.offsetHeight, Math.max(frame.offsetHeight, body.scrollHeight || 0)), lastNumber = Math.ceil(targetHeight / lineHeight); for (var i = scroller.childNodes.length; i <= lastNumber; i++) { var div = createHTMLElement("div"); div.appendChild(document.createTextNode(fill ? String(i + self.options.firstLineNumber) : "\u00a0")); scroller.appendChild(div); } } function nonWrapping() { function update() { ensureEnoughLineNumbers(true); doScroll(); } self.updateNumbers = update; var onScroll = win.addEventHandler(win, "scroll", doScroll, true), onResize = win.addEventHandler(win, "resize", update, true); clear = function(){ onScroll(); onResize(); if (self.updateNumbers == update) self.updateNumbers = null; }; update(); } function wrapping() { var node, lineNum, next, pos, changes = [], styleNums = self.options.styleNumbers; function setNum(n, node) { // Does not typically happen (but can, if you mess with the // document during the numbering) if (!lineNum) lineNum = scroller.appendChild(createHTMLElement("div")); if (styleNums) styleNums(lineNum, node, n); // Changes are accumulated, so that the document layout // doesn't have to be recomputed during the pass changes.push(lineNum); changes.push(n); pos = lineNum.offsetHeight + lineNum.offsetTop; lineNum = lineNum.nextSibling; } function commitChanges() { for (var i = 0; i < changes.length; i += 2) changes[i].innerHTML = changes[i + 1]; changes = []; } function work() { if (!scroller.parentNode || scroller.parentNode != self.lineNumbers) return; var endTime = new Date().getTime() + self.options.lineNumberTime; while (node) { setNum(next++, node.previousSibling); for (; node && !win.isBR(node); node = node.nextSibling) { var bott = node.offsetTop + node.offsetHeight; while (scroller.offsetHeight && bott - 3 > pos) { var oldPos = pos; setNum("&nbsp;"); if (pos <= oldPos) break; } } if (node) node = node.nextSibling; if (new Date().getTime() > endTime) { commitChanges(); pending = setTimeout(work, self.options.lineNumberDelay); return; } } while (lineNum) setNum(next++); commitChanges(); doScroll(); } function start(firstTime) { doScroll(); ensureEnoughLineNumbers(firstTime); node = body.firstChild; lineNum = scroller.firstChild; pos = 0; next = self.options.firstLineNumber; work(); } start(true); var pending = null; function update() { if (pending) clearTimeout(pending); if (self.editor.allClean()) start(); else pending = setTimeout(update, 200); } self.updateNumbers = update; var onScroll = win.addEventHandler(win, "scroll", doScroll, true), onResize = win.addEventHandler(win, "resize", update, true); clear = function(){ if (pending) clearTimeout(pending); if (self.updateNumbers == update) self.updateNumbers = null; onScroll(); onResize(); }; } (this.options.textWrapping || this.options.styleNumbers ? wrapping : nonWrapping)(); }, setDynamicHeight: function() { var self = this, activity = self.options.onCursorActivity, win = self.win, body = win.document.body, lineHeight = null, timeout = null, vmargin = 2 * self.frame.offsetTop; body.style.overflowY = "hidden"; win.document.documentElement.style.overflowY = "hidden"; this.frame.scrolling = "no"; function updateHeight() { var trailingLines = 0, node = body.lastChild, computedHeight; while (node && win.isBR(node)) { if (!node.hackBR) trailingLines++; node = node.previousSibling; } if (node) { lineHeight = node.offsetHeight; computedHeight = node.offsetTop + (1 + trailingLines) * lineHeight; } else if (lineHeight) { computedHeight = trailingLines * lineHeight; } if (computedHeight) self.wrapping.style.height = Math.max(vmargin + computedHeight, self.options.minHeight) + "px"; } setTimeout(updateHeight, 300); self.options.onCursorActivity = function(x) { if (activity) activity(x); clearTimeout(timeout); timeout = setTimeout(updateHeight, 100); }; } }; CodeMirror.InvalidLineHandle = {toString: function(){return "CodeMirror.InvalidLineHandle";}}; CodeMirror.replace = function(element) { if (typeof element == "string") element = document.getElementById(element); return function(newElement) { element.parentNode.replaceChild(newElement, element); }; }; CodeMirror.fromTextArea = function(area, options) { if (typeof area == "string") area = document.getElementById(area); options = options || {}; if (area.style.width && options.width == null) options.width = area.style.width; if (area.style.height && options.height == null) options.height = area.style.height; if (options.content == null) options.content = area.value; function updateField() { area.value = mirror.getCode(); } if (area.form) { if (typeof area.form.addEventListener == "function") area.form.addEventListener("submit", updateField, false); else area.form.attachEvent("onsubmit", updateField); var realSubmit = area.form.submit; function wrapSubmit() { updateField(); // Can't use realSubmit.apply because IE6 is too stupid area.form.submit = realSubmit; area.form.submit(); area.form.submit = wrapSubmit; } area.form.submit = wrapSubmit; } function insert(frame) { if (area.nextSibling) area.parentNode.insertBefore(frame, area.nextSibling); else area.parentNode.appendChild(frame); } area.style.display = "none"; var mirror = new CodeMirror(insert, options); mirror.save = updateField; mirror.toTextArea = function() { updateField(); area.parentNode.removeChild(mirror.wrapping); area.style.display = ""; if (area.form) { area.form.submit = realSubmit; if (typeof area.form.removeEventListener == "function") area.form.removeEventListener("submit", updateField, false); else area.form.detachEvent("onsubmit", updateField); } }; return mirror; }; CodeMirror.isProbablySupported = function() { // This is rather awful, but can be useful. var match; if (window.opera) return Number(window.opera.version()) >= 9.52; else if (/Apple Computer, Inc/.test(navigator.vendor) && (match = navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./))) return Number(match[1]) >= 3; else if (document.selection && window.ActiveXObject && (match = navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/))) return Number(match[1]) >= 6; else if (match = navigator.userAgent.match(/gecko\/(\d{8})/i)) return Number(match[1]) >= 20050901; else if (match = navigator.userAgent.match(/AppleWebKit\/(\d+)/)) return Number(match[1]) >= 525; else return null; }; return CodeMirror; })();
JavaScript
// Minimal framing needed to use CodeMirror-style parsers to highlight // code. Load this along with tokenize.js, stringstream.js, and your // parser. Then call highlightText, passing a string as the first // argument, and as the second argument either a callback function // that will be called with an array of SPAN nodes for every line in // the code, or a DOM node to which to append these spans, and // optionally (not needed if you only loaded one parser) a parser // object. // Stuff from util.js that the parsers are using. var StopIteration = {toString: function() {return "StopIteration"}}; var Editor = {}; var indentUnit = 2; (function(){ function normaliseString(string) { var tab = ""; for (var i = 0; i < indentUnit; i++) tab += " "; string = string.replace(/\t/g, tab).replace(/\u00a0/g, " ").replace(/\r\n?/g, "\n"); var pos = 0, parts = [], lines = string.split("\n"); for (var line = 0; line < lines.length; line++) { if (line != 0) parts.push("\n"); parts.push(lines[line]); } return { next: function() { if (pos < parts.length) return parts[pos++]; else throw StopIteration; } }; } window.highlightText = function(string, callback, parser) { parser = (parser || Editor.Parser).make(stringStream(normaliseString(string))); var line = []; if (callback.nodeType == 1) { var node = callback; callback = function(line) { for (var i = 0; i < line.length; i++) node.appendChild(line[i]); node.appendChild(document.createElement("br")); }; } try { while (true) { var token = parser.next(); if (token.value == "\n") { callback(line); line = []; } else { var span = document.createElement("span"); span.className = token.style; span.appendChild(document.createTextNode(token.value)); line.push(span); } } } catch (e) { if (e != StopIteration) throw e; } if (line.length) callback(line); } })();
JavaScript
/* The Editor object manages the content of the editable frame. It * catches events, colours nodes, and indents lines. This file also * holds some functions for transforming arbitrary DOM structures into * plain sequences of <span> and <br> elements */ var internetExplorer = document.selection && window.ActiveXObject && /MSIE/.test(navigator.userAgent); var webkit = /AppleWebKit/.test(navigator.userAgent); var safari = /Apple Computer, Inc/.test(navigator.vendor); var gecko = navigator.userAgent.match(/gecko\/(\d{8})/i); if (gecko) gecko = Number(gecko[1]); var mac = /Mac/.test(navigator.platform); // TODO this is related to the backspace-at-end-of-line bug. Remove // this if Opera gets their act together, make the version check more // broad if they don't. var brokenOpera = window.opera && /Version\/10.[56]/.test(navigator.userAgent); // TODO remove this once WebKit 533 becomes less common. var slowWebkit = /AppleWebKit\/533/.test(navigator.userAgent); // Make sure a string does not contain two consecutive 'collapseable' // whitespace characters. function makeWhiteSpace(n) { var buffer = [], nb = true; for (; n > 0; n--) { buffer.push((nb || n == 1) ? nbsp : " "); nb ^= true; } return buffer.join(""); } // Create a set of white-space characters that will not be collapsed // by the browser, but will not break text-wrapping either. function fixSpaces(string) { if (string.charAt(0) == " ") string = nbsp + string.slice(1); return string.replace(/\t/g, function() {return makeWhiteSpace(indentUnit);}) .replace(/[ \u00a0]{2,}/g, function(s) {return makeWhiteSpace(s.length);}); } function cleanText(text) { return text.replace(/\u00a0/g, " ").replace(/\u200b/g, ""); } // Create a SPAN node with the expected properties for document part // spans. function makePartSpan(value) { var text = value; if (value.nodeType == 3) text = value.nodeValue; else value = document.createTextNode(text); var span = document.createElement("span"); span.isPart = true; span.appendChild(value); span.currentText = text; return span; } function alwaysZero() {return 0;} // On webkit, when the last BR of the document does not have text // behind it, the cursor can not be put on the line after it. This // makes pressing enter at the end of the document occasionally do // nothing (or at least seem to do nothing). To work around it, this // function makes sure the document ends with a span containing a // zero-width space character. The traverseDOM iterator filters such // character out again, so that the parsers won't see them. This // function is called from a few strategic places to make sure the // zwsp is restored after the highlighting process eats it. var webkitLastLineHack = webkit ? function(container) { var last = container.lastChild; if (!last || !last.hackBR) { var br = document.createElement("br"); br.hackBR = true; container.appendChild(br); } } : function() {}; function asEditorLines(string) { var tab = makeWhiteSpace(indentUnit); return map(string.replace(/\t/g, tab).replace(/\u00a0/g, " ").replace(/\r\n?/g, "\n").split("\n"), fixSpaces); } var Editor = (function(){ // The HTML elements whose content should be suffixed by a newline // when converting them to flat text. var newlineElements = {"P": true, "DIV": true, "LI": true}; // Helper function for traverseDOM. Flattens an arbitrary DOM node // into an array of textnodes and <br> tags. function simplifyDOM(root, atEnd) { var result = []; var leaving = true; function simplifyNode(node, top) { if (node.nodeType == 3) { var text = node.nodeValue = fixSpaces(node.nodeValue.replace(/[\r\u200b]/g, "").replace(/\n/g, " ")); if (text.length) leaving = false; result.push(node); } else if (isBR(node) && node.childNodes.length == 0) { leaving = true; result.push(node); } else { for (var n = node.firstChild; n; n = n.nextSibling) simplifyNode(n); if (!leaving && newlineElements.hasOwnProperty(node.nodeName.toUpperCase())) { leaving = true; if (!atEnd || !top) result.push(document.createElement("br")); } } } simplifyNode(root, true); return result; } // Creates a MochiKit-style iterator that goes over a series of DOM // nodes. The values it yields are strings, the textual content of // the nodes. It makes sure that all nodes up to and including the // one whose text is being yielded have been 'normalized' to be just // <span> and <br> elements. function traverseDOM(start){ var nodeQueue = []; // Create a function that can be used to insert nodes after the // one given as argument. function pointAt(node){ var parent = node.parentNode; var next = node.nextSibling; return function(newnode) { parent.insertBefore(newnode, next); }; } var point = null; // This an Opera-specific hack -- always insert an empty span // between two BRs, because Opera's cursor code gets terribly // confused when the cursor is between two BRs. var afterBR = true; // Insert a normalized node at the current point. If it is a text // node, wrap it in a <span>, and give that span a currentText // property -- this is used to cache the nodeValue, because // directly accessing nodeValue is horribly slow on some browsers. // The dirty property is used by the highlighter to determine // which parts of the document have to be re-highlighted. function insertPart(part){ var text = "\n"; if (part.nodeType == 3) { select.snapshotChanged(); part = makePartSpan(part); text = part.currentText; afterBR = false; } else { if (afterBR && window.opera) point(makePartSpan("")); afterBR = true; } part.dirty = true; nodeQueue.push(part); point(part); return text; } // Extract the text and newlines from a DOM node, insert them into // the document, and return the textual content. Used to replace // non-normalized nodes. function writeNode(node, end) { var simplified = simplifyDOM(node, end); for (var i = 0; i < simplified.length; i++) simplified[i] = insertPart(simplified[i]); return simplified.join(""); } // Check whether a node is a normalized <span> element. function partNode(node){ if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { var text = node.firstChild.nodeValue; node.dirty = node.dirty || text != node.currentText; node.currentText = text; return !/[\n\t\r]/.test(node.currentText); } return false; } // Advance to next node, return string for current node. function next() { if (!start) throw StopIteration; var node = start; start = node.nextSibling; if (partNode(node)){ nodeQueue.push(node); afterBR = false; return node.currentText; } else if (isBR(node)) { if (afterBR && window.opera) node.parentNode.insertBefore(makePartSpan(""), node); nodeQueue.push(node); afterBR = true; return "\n"; } else { var end = !node.nextSibling; point = pointAt(node); removeElement(node); return writeNode(node, end); } } // MochiKit iterators are objects with a next function that // returns the next value or throws StopIteration when there are // no more values. return {next: next, nodes: nodeQueue}; } // Determine the text size of a processed node. function nodeSize(node) { return isBR(node) ? 1 : node.currentText.length; } // Search backwards through the top-level nodes until the next BR or // the start of the frame. function startOfLine(node) { while (node && !isBR(node)) node = node.previousSibling; return node; } function endOfLine(node, container) { if (!node) node = container.firstChild; else if (isBR(node)) node = node.nextSibling; while (node && !isBR(node)) node = node.nextSibling; return node; } function time() {return new Date().getTime();} // Client interface for searching the content of the editor. Create // these by calling CodeMirror.getSearchCursor. To use, call // findNext on the resulting object -- this returns a boolean // indicating whether anything was found, and can be called again to // skip to the next find. Use the select and replace methods to // actually do something with the found locations. function SearchCursor(editor, pattern, from, caseFold) { this.editor = editor; this.history = editor.history; this.history.commit(); this.valid = !!pattern; this.atOccurrence = false; if (caseFold == undefined) caseFold = typeof pattern == "string" && pattern == pattern.toLowerCase(); function getText(node){ var line = cleanText(editor.history.textAfter(node)); return (caseFold ? line.toLowerCase() : line); } var topPos = {node: null, offset: 0}, self = this; if (from && typeof from == "object" && typeof from.character == "number") { editor.checkLine(from.line); var pos = {node: from.line, offset: from.character}; this.pos = {from: pos, to: pos}; } else if (from) { this.pos = {from: select.cursorPos(editor.container, true) || topPos, to: select.cursorPos(editor.container, false) || topPos}; } else { this.pos = {from: topPos, to: topPos}; } if (typeof pattern != "string") { // Regexp match this.matches = function(reverse, node, offset) { if (reverse) { var line = getText(node).slice(0, offset), match = line.match(pattern), start = 0; while (match) { var ind = line.indexOf(match[0]); start += ind; line = line.slice(ind + 1); var newmatch = line.match(pattern); if (newmatch) match = newmatch; else break; } } else { var line = getText(node).slice(offset), match = line.match(pattern), start = match && offset + line.indexOf(match[0]); } if (match) { self.currentMatch = match; return {from: {node: node, offset: start}, to: {node: node, offset: start + match[0].length}}; } }; return; } if (caseFold) pattern = pattern.toLowerCase(); // Create a matcher function based on the kind of string we have. var target = pattern.split("\n"); this.matches = (target.length == 1) ? // For one-line strings, searching can be done simply by calling // indexOf or lastIndexOf on the current line. function(reverse, node, offset) { var line = getText(node), len = pattern.length, match; if (reverse ? (offset >= len && (match = line.lastIndexOf(pattern, offset - len)) != -1) : (match = line.indexOf(pattern, offset)) != -1) return {from: {node: node, offset: match}, to: {node: node, offset: match + len}}; } : // Multi-line strings require internal iteration over lines, and // some clunky checks to make sure the first match ends at the // end of the line and the last match starts at the start. function(reverse, node, offset) { var idx = (reverse ? target.length - 1 : 0), match = target[idx], line = getText(node); var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); if (reverse ? offsetA >= offset || offsetA != match.length : offsetA <= offset || offsetA != line.length - match.length) return; var pos = node; while (true) { if (reverse && !pos) return; pos = (reverse ? this.history.nodeBefore(pos) : this.history.nodeAfter(pos) ); if (!reverse && !pos) return; line = getText(pos); match = target[reverse ? --idx : ++idx]; if (idx > 0 && idx < target.length - 1) { if (line != match) return; else continue; } var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); if (reverse ? offsetB != line.length - match.length : offsetB != match.length) return; return {from: {node: reverse ? pos : node, offset: reverse ? offsetB : offsetA}, to: {node: reverse ? node : pos, offset: reverse ? offsetA : offsetB}}; } }; } SearchCursor.prototype = { findNext: function() {return this.find(false);}, findPrevious: function() {return this.find(true);}, find: function(reverse) { if (!this.valid) return false; var self = this, pos = reverse ? this.pos.from : this.pos.to, node = pos.node, offset = pos.offset; // Reset the cursor if the current line is no longer in the DOM tree. if (node && !node.parentNode) { node = null; offset = 0; } function savePosAndFail() { var pos = {node: node, offset: offset}; self.pos = {from: pos, to: pos}; self.atOccurrence = false; return false; } while (true) { if (this.pos = this.matches(reverse, node, offset)) { this.atOccurrence = true; return true; } if (reverse) { if (!node) return savePosAndFail(); node = this.history.nodeBefore(node); offset = this.history.textAfter(node).length; } else { var next = this.history.nodeAfter(node); if (!next) { offset = this.history.textAfter(node).length; return savePosAndFail(); } node = next; offset = 0; } } }, select: function() { if (this.atOccurrence) { select.setCursorPos(this.editor.container, this.pos.from, this.pos.to); select.scrollToCursor(this.editor.container); } }, replace: function(string) { if (this.atOccurrence) { var fragments = this.currentMatch; if (fragments) string = string.replace(/\\(\d)/, function(m, i){return fragments[i];}); var end = this.editor.replaceRange(this.pos.from, this.pos.to, string); this.pos.to = end; this.atOccurrence = false; } }, position: function() { if (this.atOccurrence) return {line: this.pos.from.node, character: this.pos.from.offset}; } }; // The Editor object is the main inside-the-iframe interface. function Editor(options) { this.options = options; window.indentUnit = options.indentUnit; var container = this.container = document.body; this.history = new UndoHistory(container, options.undoDepth, options.undoDelay, this); var self = this; if (!Editor.Parser) throw "No parser loaded."; if (options.parserConfig && Editor.Parser.configure) Editor.Parser.configure(options.parserConfig); if (!options.readOnly && !internetExplorer) select.setCursorPos(container, {node: null, offset: 0}); this.dirty = []; this.importCode(options.content || ""); this.history.onChange = options.onChange; if (!options.readOnly) { if (options.continuousScanning !== false) { this.scanner = this.documentScanner(options.passTime); this.delayScanning(); } function setEditable() { // Use contentEditable instead of designMode on IE, since designMode frames // can not run any scripts. It would be nice if we could use contentEditable // everywhere, but it is significantly flakier than designMode on every // single non-IE browser. if (document.body.contentEditable != undefined && internetExplorer) document.body.contentEditable = "true"; else document.designMode = "on"; // Work around issue where you have to click on the actual // body of the document to focus it in IE, making focusing // hard when the document is small. if (internetExplorer && options.height != "dynamic") document.body.style.minHeight = ( window.frameElement.clientHeight - 2 * document.body.offsetTop - 5) + "px"; document.documentElement.style.borderWidth = "0"; if (!options.textWrapping) container.style.whiteSpace = "nowrap"; } // If setting the frame editable fails, try again when the user // focus it (happens when the frame is not visible on // initialisation, in Firefox). try { setEditable(); } catch(e) { var focusEvent = addEventHandler(document, "focus", function() { focusEvent(); setEditable(); }, true); } addEventHandler(document, "keydown", method(this, "keyDown")); addEventHandler(document, "keypress", method(this, "keyPress")); addEventHandler(document, "keyup", method(this, "keyUp")); function cursorActivity() {self.cursorActivity(false);} addEventHandler(internetExplorer ? document.body : window, "mouseup", cursorActivity); addEventHandler(document.body, "cut", cursorActivity); // workaround for a gecko bug [?] where going forward and then // back again breaks designmode (no more cursor) if (gecko) addEventHandler(window, "pagehide", function(){self.unloaded = true;}); addEventHandler(document.body, "paste", function(event) { cursorActivity(); var text = null; try { var clipboardData = event.clipboardData || window.clipboardData; if (clipboardData) text = clipboardData.getData('Text'); } catch(e) {} if (text !== null) { event.stop(); self.replaceSelection(text); select.scrollToCursor(self.container); } }); if (this.options.autoMatchParens) addEventHandler(document.body, "click", method(this, "scheduleParenHighlight")); } else if (!options.textWrapping) { container.style.whiteSpace = "nowrap"; } } function isSafeKey(code) { return (code >= 16 && code <= 18) || // shift, control, alt (code >= 33 && code <= 40); // arrows, home, end } Editor.prototype = { // Import a piece of code into the editor. importCode: function(code) { var lines = asEditorLines(code), chunk = 1000; if (!this.options.incrementalLoading || lines.length < chunk) { this.history.push(null, null, lines); this.history.reset(); } else { var cur = 0, self = this; function addChunk() { var chunklines = lines.slice(cur, cur + chunk); chunklines.push(""); self.history.push(self.history.nodeBefore(null), null, chunklines); self.history.reset(); cur += chunk; if (cur < lines.length) parent.setTimeout(addChunk, 1000); } addChunk(); } }, // Extract the code from the editor. getCode: function() { if (!this.container.firstChild) return ""; var accum = []; select.markSelection(); forEach(traverseDOM(this.container.firstChild), method(accum, "push")); select.selectMarked(); // On webkit, don't count last (empty) line if the webkitLastLineHack BR is present if (webkit && this.container.lastChild.hackBR) accum.pop(); webkitLastLineHack(this.container); return cleanText(accum.join("")); }, checkLine: function(node) { if (node === false || !(node == null || node.parentNode == this.container || node.hackBR)) throw parent.CodeMirror.InvalidLineHandle; }, cursorPosition: function(start) { if (start == null) start = true; var pos = select.cursorPos(this.container, start); if (pos) return {line: pos.node, character: pos.offset}; else return {line: null, character: 0}; }, firstLine: function() { return null; }, lastLine: function() { var last = this.container.lastChild; if (last) last = startOfLine(last); if (last && last.hackBR) last = startOfLine(last.previousSibling); return last; }, nextLine: function(line) { this.checkLine(line); var end = endOfLine(line, this.container); if (!end || end.hackBR) return false; else return end; }, prevLine: function(line) { this.checkLine(line); if (line == null) return false; return startOfLine(line.previousSibling); }, visibleLineCount: function() { var line = this.container.firstChild; while (line && isBR(line)) line = line.nextSibling; // BR heights are unreliable if (!line) return false; var innerHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight); return Math.floor(innerHeight / line.offsetHeight); }, selectLines: function(startLine, startOffset, endLine, endOffset) { this.checkLine(startLine); var start = {node: startLine, offset: startOffset}, end = null; if (endOffset !== undefined) { this.checkLine(endLine); end = {node: endLine, offset: endOffset}; } select.setCursorPos(this.container, start, end); select.scrollToCursor(this.container); }, lineContent: function(line) { var accum = []; for (line = line ? line.nextSibling : this.container.firstChild; line && !isBR(line); line = line.nextSibling) accum.push(nodeText(line)); return cleanText(accum.join("")); }, setLineContent: function(line, content) { this.history.commit(); this.replaceRange({node: line, offset: 0}, {node: line, offset: this.history.textAfter(line).length}, content); this.addDirtyNode(line); this.scheduleHighlight(); }, removeLine: function(line) { var node = line ? line.nextSibling : this.container.firstChild; while (node) { var next = node.nextSibling; removeElement(node); if (isBR(node)) break; node = next; } this.addDirtyNode(line); this.scheduleHighlight(); }, insertIntoLine: function(line, position, content) { var before = null; if (position == "end") { before = endOfLine(line, this.container); } else { for (var cur = line ? line.nextSibling : this.container.firstChild; cur; cur = cur.nextSibling) { if (position == 0) { before = cur; break; } var text = nodeText(cur); if (text.length > position) { before = cur.nextSibling; content = text.slice(0, position) + content + text.slice(position); removeElement(cur); break; } position -= text.length; } } var lines = asEditorLines(content); for (var i = 0; i < lines.length; i++) { if (i > 0) this.container.insertBefore(document.createElement("BR"), before); this.container.insertBefore(makePartSpan(lines[i]), before); } this.addDirtyNode(line); this.scheduleHighlight(); }, // Retrieve the selected text. selectedText: function() { var h = this.history; h.commit(); var start = select.cursorPos(this.container, true), end = select.cursorPos(this.container, false); if (!start || !end) return ""; if (start.node == end.node) return h.textAfter(start.node).slice(start.offset, end.offset); var text = [h.textAfter(start.node).slice(start.offset)]; for (var pos = h.nodeAfter(start.node); pos != end.node; pos = h.nodeAfter(pos)) text.push(h.textAfter(pos)); text.push(h.textAfter(end.node).slice(0, end.offset)); return cleanText(text.join("\n")); }, // Replace the selection with another piece of text. replaceSelection: function(text) { this.history.commit(); var start = select.cursorPos(this.container, true), end = select.cursorPos(this.container, false); if (!start || !end) return; end = this.replaceRange(start, end, text); select.setCursorPos(this.container, end); webkitLastLineHack(this.container); }, cursorCoords: function(start, internal) { var sel = select.cursorPos(this.container, start); if (!sel) return null; var off = sel.offset, node = sel.node, self = this; function measureFromNode(node, xOffset) { var y = -(document.body.scrollTop || document.documentElement.scrollTop || 0), x = -(document.body.scrollLeft || document.documentElement.scrollLeft || 0) + xOffset; forEach([node, internal ? null : window.frameElement], function(n) { while (n) {x += n.offsetLeft; y += n.offsetTop;n = n.offsetParent;} }); return {x: x, y: y, yBot: y + node.offsetHeight}; } function withTempNode(text, f) { var node = document.createElement("SPAN"); node.appendChild(document.createTextNode(text)); try {return f(node);} finally {if (node.parentNode) node.parentNode.removeChild(node);} } while (off) { node = node ? node.nextSibling : this.container.firstChild; var txt = nodeText(node); if (off < txt.length) return withTempNode(txt.substr(0, off), function(tmp) { tmp.style.position = "absolute"; tmp.style.visibility = "hidden"; tmp.className = node.className; self.container.appendChild(tmp); return measureFromNode(node, tmp.offsetWidth); }); off -= txt.length; } if (node && isSpan(node)) return measureFromNode(node, node.offsetWidth); else if (node && node.nextSibling && isSpan(node.nextSibling)) return measureFromNode(node.nextSibling, 0); else return withTempNode("\u200b", function(tmp) { if (node) node.parentNode.insertBefore(tmp, node.nextSibling); else self.container.insertBefore(tmp, self.container.firstChild); return measureFromNode(tmp, 0); }); }, reroutePasteEvent: function() { if (this.capturingPaste || window.opera || (gecko && gecko >= 20101026)) return; this.capturingPaste = true; var te = window.frameElement.CodeMirror.textareaHack; var coords = this.cursorCoords(true, true); te.style.top = coords.y + "px"; if (internetExplorer) { var snapshot = select.getBookmark(this.container); if (snapshot) this.selectionSnapshot = snapshot; } parent.focus(); te.value = ""; te.focus(); var self = this; parent.setTimeout(function() { self.capturingPaste = false; window.focus(); if (self.selectionSnapshot) // IE hack window.select.setBookmark(self.container, self.selectionSnapshot); var text = te.value; if (text) { self.replaceSelection(text); select.scrollToCursor(self.container); } }, 10); }, replaceRange: function(from, to, text) { var lines = asEditorLines(text); lines[0] = this.history.textAfter(from.node).slice(0, from.offset) + lines[0]; var lastLine = lines[lines.length - 1]; lines[lines.length - 1] = lastLine + this.history.textAfter(to.node).slice(to.offset); var end = this.history.nodeAfter(to.node); this.history.push(from.node, end, lines); return {node: this.history.nodeBefore(end), offset: lastLine.length}; }, getSearchCursor: function(string, fromCursor, caseFold) { return new SearchCursor(this, string, fromCursor, caseFold); }, // Re-indent the whole buffer reindent: function() { if (this.container.firstChild) this.indentRegion(null, this.container.lastChild); }, reindentSelection: function(direction) { if (!select.somethingSelected()) { this.indentAtCursor(direction); } else { var start = select.selectionTopNode(this.container, true), end = select.selectionTopNode(this.container, false); if (start === false || end === false) return; this.indentRegion(start, end, direction); } }, grabKeys: function(eventHandler, filter) { this.frozen = eventHandler; this.keyFilter = filter; }, ungrabKeys: function() { this.frozen = "leave"; }, setParser: function(name, parserConfig) { Editor.Parser = window[name]; parserConfig = parserConfig || this.options.parserConfig; if (parserConfig && Editor.Parser.configure) Editor.Parser.configure(parserConfig); if (this.container.firstChild) { forEach(this.container.childNodes, function(n) { if (n.nodeType != 3) n.dirty = true; }); this.addDirtyNode(this.firstChild); this.scheduleHighlight(); } }, // Intercept enter and tab, and assign their new functions. keyDown: function(event) { if (this.frozen == "leave") {this.frozen = null; this.keyFilter = null;} if (this.frozen && (!this.keyFilter || this.keyFilter(event.keyCode, event))) { event.stop(); this.frozen(event); return; } var code = event.keyCode; // Don't scan when the user is typing. this.delayScanning(); // Schedule a paren-highlight event, if configured. if (this.options.autoMatchParens) this.scheduleParenHighlight(); // The various checks for !altKey are there because AltGr sets both // ctrlKey and altKey to true, and should not be recognised as // Control. if (code == 13) { // enter if (event.ctrlKey && !event.altKey) { this.reparseBuffer(); } else { select.insertNewlineAtCursor(); var mode = this.options.enterMode; if (mode != "flat") this.indentAtCursor(mode == "keep" ? "keep" : undefined); select.scrollToCursor(this.container); } event.stop(); } else if (code == 9 && this.options.tabMode != "default" && !event.ctrlKey) { // tab this.handleTab(!event.shiftKey); event.stop(); } else if (code == 32 && event.shiftKey && this.options.tabMode == "default") { // space this.handleTab(true); event.stop(); } else if (code == 36 && !event.shiftKey && !event.ctrlKey) { // home if (this.home()) event.stop(); } else if (code == 35 && !event.shiftKey && !event.ctrlKey) { // end if (this.end()) event.stop(); } // Only in Firefox is the default behavior for PgUp/PgDn correct. else if (code == 33 && !event.shiftKey && !event.ctrlKey && !gecko) { // PgUp if (this.pageUp()) event.stop(); } else if (code == 34 && !event.shiftKey && !event.ctrlKey && !gecko) { // PgDn if (this.pageDown()) event.stop(); } else if ((code == 219 || code == 221) && event.ctrlKey && !event.altKey) { // [, ] this.highlightParens(event.shiftKey, true); event.stop(); } else if (event.metaKey && !event.shiftKey && (code == 37 || code == 39)) { // Meta-left/right var cursor = select.selectionTopNode(this.container); if (cursor === false || !this.container.firstChild) return; if (code == 37) select.focusAfterNode(startOfLine(cursor), this.container); else { var end = endOfLine(cursor, this.container); select.focusAfterNode(end ? end.previousSibling : this.container.lastChild, this.container); } event.stop(); } else if ((event.ctrlKey || event.metaKey) && !event.altKey) { if ((event.shiftKey && code == 90) || code == 89) { // shift-Z, Y select.scrollToNode(this.history.redo()); event.stop(); } else if (code == 90 || (safari && code == 8)) { // Z, backspace select.scrollToNode(this.history.undo()); event.stop(); } else if (code == 83 && this.options.saveFunction) { // S this.options.saveFunction(); event.stop(); } else if (code == 86 && !mac) { // V this.reroutePasteEvent(); } } }, // Check for characters that should re-indent the current line, // and prevent Opera from handling enter and tab anyway. keyPress: function(event) { var electric = this.options.electricChars && Editor.Parser.electricChars, self = this; // Hack for Opera, and Firefox on OS X, in which stopping a // keydown event does not prevent the associated keypress event // from happening, so we have to cancel enter and tab again // here. if ((this.frozen && (!this.keyFilter || this.keyFilter(event.keyCode || event.code, event))) || event.code == 13 || (event.code == 9 && this.options.tabMode != "default") || (event.code == 32 && event.shiftKey && this.options.tabMode == "default")) event.stop(); else if (mac && (event.ctrlKey || event.metaKey) && event.character == "v") { this.reroutePasteEvent(); } else if (electric && electric.indexOf(event.character) != -1) parent.setTimeout(function(){self.indentAtCursor(null);}, 0); // Work around a bug where pressing backspace at the end of a // line, or delete at the start, often causes the cursor to jump // to the start of the line in Opera 10.60. else if (brokenOpera) { if (event.code == 8) { // backspace var sel = select.selectionTopNode(this.container), self = this, next = sel ? sel.nextSibling : this.container.firstChild; if (sel !== false && next && isBR(next)) parent.setTimeout(function(){ if (select.selectionTopNode(self.container) == next) select.focusAfterNode(next.previousSibling, self.container); }, 20); } else if (event.code == 46) { // delete var sel = select.selectionTopNode(this.container), self = this; if (sel && isBR(sel)) { parent.setTimeout(function(){ if (select.selectionTopNode(self.container) != sel) select.focusAfterNode(sel, self.container); }, 20); } } } // In 533.* WebKit versions, when the document is big, typing // something at the end of a line causes the browser to do some // kind of stupid heavy operation, creating delays of several // seconds before the typed characters appear. This very crude // hack inserts a temporary zero-width space after the cursor to // make it not be at the end of the line. else if (slowWebkit) { var sel = select.selectionTopNode(this.container), next = sel ? sel.nextSibling : this.container.firstChild; // Doesn't work on empty lines, for some reason those always // trigger the delay. if (sel && next && isBR(next) && !isBR(sel)) { var cheat = document.createTextNode("\u200b"); this.container.insertBefore(cheat, next); parent.setTimeout(function() { if (cheat.nodeValue == "\u200b") removeElement(cheat); else cheat.nodeValue = cheat.nodeValue.replace("\u200b", ""); }, 20); } } // Magic incantation that works abound a webkit bug when you // can't type on a blank line following a line that's wider than // the window. if (webkit && !this.options.textWrapping) setTimeout(function () { var node = select.selectionTopNode(self.container, true); if (node && node.nodeType == 3 && node.previousSibling && isBR(node.previousSibling) && node.nextSibling && isBR(node.nextSibling)) node.parentNode.replaceChild(document.createElement("BR"), node.previousSibling); }, 50); }, // Mark the node at the cursor dirty when a non-safe key is // released. keyUp: function(event) { this.cursorActivity(isSafeKey(event.keyCode)); }, // Indent the line following a given <br>, or null for the first // line. If given a <br> element, this must have been highlighted // so that it has an indentation method. Returns the whitespace // element that has been modified or created (if any). indentLineAfter: function(start, direction) { function whiteSpaceAfter(node) { var ws = node ? node.nextSibling : self.container.firstChild; if (!ws || !hasClass(ws, "whitespace")) return null; return ws; } // whiteSpace is the whitespace span at the start of the line, // or null if there is no such node. var self = this, whiteSpace = whiteSpaceAfter(start); var newIndent = 0, curIndent = whiteSpace ? whiteSpace.currentText.length : 0; var firstText = whiteSpace ? whiteSpace.nextSibling : (start ? start.nextSibling : this.container.firstChild); if (direction == "keep") { if (start) { var prevWS = whiteSpaceAfter(startOfLine(start.previousSibling)) if (prevWS) newIndent = prevWS.currentText.length; } } else { // Sometimes the start of the line can influence the correct // indentation, so we retrieve it. var nextChars = (start && firstText && firstText.currentText) ? firstText.currentText : ""; // Ask the lexical context for the correct indentation, and // compute how much this differs from the current indentation. if (direction != null && this.options.tabMode == "shift") newIndent = direction ? curIndent + indentUnit : Math.max(0, curIndent - indentUnit) else if (start) newIndent = start.indentation(nextChars, curIndent, direction, firstText); else if (Editor.Parser.firstIndentation) newIndent = Editor.Parser.firstIndentation(nextChars, curIndent, direction, firstText); } var indentDiff = newIndent - curIndent; // If there is too much, this is just a matter of shrinking a span. if (indentDiff < 0) { if (newIndent == 0) { if (firstText) select.snapshotMove(whiteSpace.firstChild, firstText.firstChild || firstText, 0); removeElement(whiteSpace); whiteSpace = null; } else { select.snapshotMove(whiteSpace.firstChild, whiteSpace.firstChild, indentDiff, true); whiteSpace.currentText = makeWhiteSpace(newIndent); whiteSpace.firstChild.nodeValue = whiteSpace.currentText; } } // Not enough... else if (indentDiff > 0) { // If there is whitespace, we grow it. if (whiteSpace) { whiteSpace.currentText = makeWhiteSpace(newIndent); whiteSpace.firstChild.nodeValue = whiteSpace.currentText; select.snapshotMove(whiteSpace.firstChild, whiteSpace.firstChild, indentDiff, true); } // Otherwise, we have to add a new whitespace node. else { whiteSpace = makePartSpan(makeWhiteSpace(newIndent)); whiteSpace.className = "whitespace"; if (start) insertAfter(whiteSpace, start); else this.container.insertBefore(whiteSpace, this.container.firstChild); select.snapshotMove(firstText && (firstText.firstChild || firstText), whiteSpace.firstChild, newIndent, false, true); } } // Make sure cursor ends up after the whitespace else if (whiteSpace) { select.snapshotMove(whiteSpace.firstChild, whiteSpace.firstChild, newIndent, false); } if (indentDiff != 0) this.addDirtyNode(start); }, // Re-highlight the selected part of the document. highlightAtCursor: function() { var pos = select.selectionTopNode(this.container, true); var to = select.selectionTopNode(this.container, false); if (pos === false || to === false) return false; select.markSelection(); if (this.highlight(pos, endOfLine(to, this.container), true, 20) === false) return false; select.selectMarked(); return true; }, // When tab is pressed with text selected, the whole selection is // re-indented, when nothing is selected, the line with the cursor // is re-indented. handleTab: function(direction) { if (this.options.tabMode == "spaces") select.insertTabAtCursor(); else this.reindentSelection(direction); }, // Custom home behaviour that doesn't land the cursor in front of // leading whitespace unless pressed twice. home: function() { var cur = select.selectionTopNode(this.container, true), start = cur; if (cur === false || !(!cur || cur.isPart || isBR(cur)) || !this.container.firstChild) return false; while (cur && !isBR(cur)) cur = cur.previousSibling; var next = cur ? cur.nextSibling : this.container.firstChild; if (next && next != start && next.isPart && hasClass(next, "whitespace")) select.focusAfterNode(next, this.container); else select.focusAfterNode(cur, this.container); select.scrollToCursor(this.container); return true; }, // Some browsers (Opera) don't manage to handle the end key // properly in the face of vertical scrolling. end: function() { var cur = select.selectionTopNode(this.container, true); if (cur === false) return false; cur = endOfLine(cur, this.container); if (!cur) return false; select.focusAfterNode(cur.previousSibling, this.container); select.scrollToCursor(this.container); return true; }, pageUp: function() { var line = this.cursorPosition().line, scrollAmount = this.visibleLineCount(); if (line === false || scrollAmount === false) return false; // Try to keep one line on the screen. scrollAmount -= 2; for (var i = 0; i < scrollAmount; i++) { line = this.prevLine(line); if (line === false) break; } if (i == 0) return false; // Already at first line select.setCursorPos(this.container, {node: line, offset: 0}); select.scrollToCursor(this.container); return true; }, pageDown: function() { var line = this.cursorPosition().line, scrollAmount = this.visibleLineCount(); if (line === false || scrollAmount === false) return false; // Try to move to the last line of the current page. scrollAmount -= 2; for (var i = 0; i < scrollAmount; i++) { var nextLine = this.nextLine(line); if (nextLine === false) break; line = nextLine; } if (i == 0) return false; // Already at last line select.setCursorPos(this.container, {node: line, offset: 0}); select.scrollToCursor(this.container); return true; }, // Delay (or initiate) the next paren highlight event. scheduleParenHighlight: function() { if (this.parenEvent) parent.clearTimeout(this.parenEvent); var self = this; this.parenEvent = parent.setTimeout(function(){self.highlightParens();}, 300); }, // Take the token before the cursor. If it contains a character in // '()[]{}', search for the matching paren/brace/bracket, and // highlight them in green for a moment, or red if no proper match // was found. highlightParens: function(jump, fromKey) { var self = this, mark = this.options.markParen; if (typeof mark == "string") mark = [mark, mark]; // give the relevant nodes a colour. function highlight(node, ok) { if (!node) return; if (!mark) { node.style.fontWeight = "bold"; node.style.color = ok ? "#8F8" : "#F88"; } else if (mark.call) mark(node, ok); else node.className += " " + mark[ok ? 0 : 1]; } function unhighlight(node) { if (!node) return; if (mark && !mark.call) removeClass(removeClass(node, mark[0]), mark[1]); else if (self.options.unmarkParen) self.options.unmarkParen(node); else { node.style.fontWeight = ""; node.style.color = ""; } } if (!fromKey && self.highlighted) { unhighlight(self.highlighted[0]); unhighlight(self.highlighted[1]); } if (!window || !window.parent || !window.select) return; // Clear the event property. if (this.parenEvent) parent.clearTimeout(this.parenEvent); this.parenEvent = null; // Extract a 'paren' from a piece of text. function paren(node) { if (node.currentText) { var match = node.currentText.match(/^[\s\u00a0]*([\(\)\[\]{}])[\s\u00a0]*$/); return match && match[1]; } } // Determine the direction a paren is facing. function forward(ch) { return /[\(\[\{]/.test(ch); } var ch, cursor = select.selectionTopNode(this.container, true); if (!cursor || !this.highlightAtCursor()) return; cursor = select.selectionTopNode(this.container, true); if (!(cursor && ((ch = paren(cursor)) || (cursor = cursor.nextSibling) && (ch = paren(cursor))))) return; // We only look for tokens with the same className. var className = cursor.className, dir = forward(ch), match = matching[ch]; // Since parts of the document might not have been properly // highlighted, and it is hard to know in advance which part we // have to scan, we just try, and when we find dirty nodes we // abort, parse them, and re-try. function tryFindMatch() { var stack = [], ch, ok = true; for (var runner = cursor; runner; runner = dir ? runner.nextSibling : runner.previousSibling) { if (runner.className == className && isSpan(runner) && (ch = paren(runner))) { if (forward(ch) == dir) stack.push(ch); else if (!stack.length) ok = false; else if (stack.pop() != matching[ch]) ok = false; if (!stack.length) break; } else if (runner.dirty || !isSpan(runner) && !isBR(runner)) { return {node: runner, status: "dirty"}; } } return {node: runner, status: runner && ok}; } while (true) { var found = tryFindMatch(); if (found.status == "dirty") { this.highlight(found.node, endOfLine(found.node)); // Needed because in some corner cases a highlight does not // reach a node. found.node.dirty = false; continue; } else { highlight(cursor, found.status); highlight(found.node, found.status); if (fromKey) parent.setTimeout(function() {unhighlight(cursor); unhighlight(found.node);}, 500); else self.highlighted = [cursor, found.node]; if (jump && found.node) select.focusAfterNode(found.node.previousSibling, this.container); break; } } }, // Adjust the amount of whitespace at the start of the line that // the cursor is on so that it is indented properly. indentAtCursor: function(direction) { if (!this.container.firstChild) return; // The line has to have up-to-date lexical information, so we // highlight it first. if (!this.highlightAtCursor()) return; var cursor = select.selectionTopNode(this.container, false); // If we couldn't determine the place of the cursor, // there's nothing to indent. if (cursor === false) return; select.markSelection(); this.indentLineAfter(startOfLine(cursor), direction); select.selectMarked(); }, // Indent all lines whose start falls inside of the current // selection. indentRegion: function(start, end, direction) { var current = (start = startOfLine(start)), before = start && startOfLine(start.previousSibling); if (!isBR(end)) end = endOfLine(end, this.container); this.addDirtyNode(start); do { var next = endOfLine(current, this.container); if (current) this.highlight(before, next, true); this.indentLineAfter(current, direction); before = current; current = next; } while (current != end); select.setCursorPos(this.container, {node: start, offset: 0}, {node: end, offset: 0}); }, // Find the node that the cursor is in, mark it as dirty, and make // sure a highlight pass is scheduled. cursorActivity: function(safe) { // pagehide event hack above if (this.unloaded) { window.document.designMode = "off"; window.document.designMode = "on"; this.unloaded = false; } if (internetExplorer) { this.container.createTextRange().execCommand("unlink"); clearTimeout(this.saveSelectionSnapshot); var self = this; this.saveSelectionSnapshot = setTimeout(function() { var snapshot = select.getBookmark(self.container); if (snapshot) self.selectionSnapshot = snapshot; }, 200); } var activity = this.options.onCursorActivity; if (!safe || activity) { var cursor = select.selectionTopNode(this.container, false); if (cursor === false || !this.container.firstChild) return; cursor = cursor || this.container.firstChild; if (activity) activity(cursor); if (!safe) { this.scheduleHighlight(); this.addDirtyNode(cursor); } } }, reparseBuffer: function() { forEach(this.container.childNodes, function(node) {node.dirty = true;}); if (this.container.firstChild) this.addDirtyNode(this.container.firstChild); }, // Add a node to the set of dirty nodes, if it isn't already in // there. addDirtyNode: function(node) { node = node || this.container.firstChild; if (!node) return; for (var i = 0; i < this.dirty.length; i++) if (this.dirty[i] == node) return; if (node.nodeType != 3) node.dirty = true; this.dirty.push(node); }, allClean: function() { return !this.dirty.length; }, // Cause a highlight pass to happen in options.passDelay // milliseconds. Clear the existing timeout, if one exists. This // way, the passes do not happen while the user is typing, and // should as unobtrusive as possible. scheduleHighlight: function() { // Timeouts are routed through the parent window, because on // some browsers designMode windows do not fire timeouts. var self = this; parent.clearTimeout(this.highlightTimeout); this.highlightTimeout = parent.setTimeout(function(){self.highlightDirty();}, this.options.passDelay); }, // Fetch one dirty node, and remove it from the dirty set. getDirtyNode: function() { while (this.dirty.length > 0) { var found = this.dirty.pop(); // IE8 sometimes throws an unexplainable 'invalid argument' // exception for found.parentNode try { // If the node has been coloured in the meantime, or is no // longer in the document, it should not be returned. while (found && found.parentNode != this.container) found = found.parentNode; if (found && (found.dirty || found.nodeType == 3)) return found; } catch (e) {} } return null; }, // Pick dirty nodes, and highlight them, until options.passTime // milliseconds have gone by. The highlight method will continue // to next lines as long as it finds dirty nodes. It returns // information about the place where it stopped. If there are // dirty nodes left after this function has spent all its lines, // it shedules another highlight to finish the job. highlightDirty: function(force) { // Prevent FF from raising an error when it is firing timeouts // on a page that's no longer loaded. if (!window || !window.parent || !window.select) return false; if (!this.options.readOnly) select.markSelection(); var start, endTime = force ? null : time() + this.options.passTime; while ((time() < endTime || force) && (start = this.getDirtyNode())) { var result = this.highlight(start, endTime); if (result && result.node && result.dirty) this.addDirtyNode(result.node.nextSibling); } if (!this.options.readOnly) select.selectMarked(); if (start) this.scheduleHighlight(); return this.dirty.length == 0; }, // Creates a function that, when called through a timeout, will // continuously re-parse the document. documentScanner: function(passTime) { var self = this, pos = null; return function() { // FF timeout weirdness workaround. if (!window || !window.parent || !window.select) return; // If the current node is no longer in the document... oh // well, we start over. if (pos && pos.parentNode != self.container) pos = null; select.markSelection(); var result = self.highlight(pos, time() + passTime, true); select.selectMarked(); var newPos = result ? (result.node && result.node.nextSibling) : null; pos = (pos == newPos) ? null : newPos; self.delayScanning(); }; }, // Starts the continuous scanning process for this document after // a given interval. delayScanning: function() { if (this.scanner) { parent.clearTimeout(this.documentScan); this.documentScan = parent.setTimeout(this.scanner, this.options.continuousScanning); } }, // The function that does the actual highlighting/colouring (with // help from the parser and the DOM normalizer). Its interface is // rather overcomplicated, because it is used in different // situations: ensuring that a certain line is highlighted, or // highlighting up to X milliseconds starting from a certain // point. The 'from' argument gives the node at which it should // start. If this is null, it will start at the beginning of the // document. When a timestamp is given with the 'target' argument, // it will stop highlighting at that time. If this argument holds // a DOM node, it will highlight until it reaches that node. If at // any time it comes across two 'clean' lines (no dirty nodes), it // will stop, except when 'cleanLines' is true. maxBacktrack is // the maximum number of lines to backtrack to find an existing // parser instance. This is used to give up in situations where a // highlight would take too long and freeze the browser interface. highlight: function(from, target, cleanLines, maxBacktrack){ var container = this.container, self = this, active = this.options.activeTokens; var endTime = (typeof target == "number" ? target : null); if (!container.firstChild) return false; // Backtrack to the first node before from that has a partial // parse stored. while (from && (!from.parserFromHere || from.dirty)) { if (maxBacktrack != null && isBR(from) && (--maxBacktrack) < 0) return false; from = from.previousSibling; } // If we are at the end of the document, do nothing. if (from && !from.nextSibling) return false; // Check whether a part (<span> node) and the corresponding token // match. function correctPart(token, part){ return !part.reduced && part.currentText == token.value && part.className == token.style; } // Shorten the text associated with a part by chopping off // characters from the front. Note that only the currentText // property gets changed. For efficiency reasons, we leave the // nodeValue alone -- we set the reduced flag to indicate that // this part must be replaced. function shortenPart(part, minus){ part.currentText = part.currentText.substring(minus); part.reduced = true; } // Create a part corresponding to a given token. function tokenPart(token){ var part = makePartSpan(token.value); part.className = token.style; return part; } function maybeTouch(node) { if (node) { var old = node.oldNextSibling; if (lineDirty || old === undefined || node.nextSibling != old) self.history.touch(node); node.oldNextSibling = node.nextSibling; } else { var old = self.container.oldFirstChild; if (lineDirty || old === undefined || self.container.firstChild != old) self.history.touch(null); self.container.oldFirstChild = self.container.firstChild; } } // Get the token stream. If from is null, we start with a new // parser from the start of the frame, otherwise a partial parse // is resumed. var traversal = traverseDOM(from ? from.nextSibling : container.firstChild), stream = stringStream(traversal), parsed = from ? from.parserFromHere(stream) : Editor.Parser.make(stream); function surroundedByBRs(node) { return (node.previousSibling == null || isBR(node.previousSibling)) && (node.nextSibling == null || isBR(node.nextSibling)); } // parts is an interface to make it possible to 'delay' fetching // the next DOM node until we are completely done with the one // before it. This is necessary because often the next node is // not yet available when we want to proceed past the current // one. var parts = { current: null, // Fetch current node. get: function(){ if (!this.current) this.current = traversal.nodes.shift(); return this.current; }, // Advance to the next part (do not fetch it yet). next: function(){ this.current = null; }, // Remove the current part from the DOM tree, and move to the // next. remove: function(){ container.removeChild(this.get()); this.current = null; }, // Advance to the next part that is not empty, discarding empty // parts. getNonEmpty: function(){ var part = this.get(); // Allow empty nodes when they are alone on a line, needed // for the FF cursor bug workaround (see select.js, // insertNewlineAtCursor). while (part && isSpan(part) && part.currentText == "") { // Leave empty nodes that are alone on a line alone in // Opera, since that browsers doesn't deal well with // having 2 BRs in a row. if (window.opera && surroundedByBRs(part)) { this.next(); part = this.get(); } else { var old = part; this.remove(); part = this.get(); // Adjust selection information, if any. See select.js for details. select.snapshotMove(old.firstChild, part && (part.firstChild || part), 0); } } return part; } }; var lineDirty = false, prevLineDirty = true, lineNodes = 0; // This forEach loops over the tokens from the parsed stream, and // at the same time uses the parts object to proceed through the // corresponding DOM nodes. forEach(parsed, function(token){ var part = parts.getNonEmpty(); if (token.value == "\n"){ // The idea of the two streams actually staying synchronized // is such a long shot that we explicitly check. if (!isBR(part)) throw "Parser out of sync. Expected BR."; if (part.dirty || !part.indentation) lineDirty = true; maybeTouch(from); from = part; // Every <br> gets a copy of the parser state and a lexical // context assigned to it. The first is used to be able to // later resume parsing from this point, the second is used // for indentation. part.parserFromHere = parsed.copy(); part.indentation = token.indentation || alwaysZero; part.dirty = false; // If the target argument wasn't an integer, go at least // until that node. if (endTime == null && part == target) throw StopIteration; // A clean line with more than one node means we are done. // Throwing a StopIteration is the way to break out of a // MochiKit forEach loop. if ((endTime != null && time() >= endTime) || (!lineDirty && !prevLineDirty && lineNodes > 1 && !cleanLines)) throw StopIteration; prevLineDirty = lineDirty; lineDirty = false; lineNodes = 0; parts.next(); } else { if (!isSpan(part)) throw "Parser out of sync. Expected SPAN."; if (part.dirty) lineDirty = true; lineNodes++; // If the part matches the token, we can leave it alone. if (correctPart(token, part)){ if (active && part.dirty) active(part, token, self); part.dirty = false; parts.next(); } // Otherwise, we have to fix it. else { lineDirty = true; // Insert the correct part. var newPart = tokenPart(token); container.insertBefore(newPart, part); if (active) active(newPart, token, self); var tokensize = token.value.length; var offset = 0; // Eat up parts until the text for this token has been // removed, adjusting the stored selection info (see // select.js) in the process. while (tokensize > 0) { part = parts.get(); var partsize = part.currentText.length; select.snapshotReplaceNode(part.firstChild, newPart.firstChild, tokensize, offset); if (partsize > tokensize){ shortenPart(part, tokensize); tokensize = 0; } else { tokensize -= partsize; offset += partsize; parts.remove(); } } } } }); maybeTouch(from); webkitLastLineHack(this.container); // The function returns some status information that is used by // hightlightDirty to determine whether and where it has to // continue. return {node: parts.getNonEmpty(), dirty: lineDirty}; } }; return Editor; })(); addEventHandler(window, "load", function() { var CodeMirror = window.frameElement.CodeMirror; var e = CodeMirror.editor = new Editor(CodeMirror.options); parent.setTimeout(method(CodeMirror, "init"), 0); });
JavaScript
/* String streams are the things fed to parsers (which can feed them * to a tokenizer if they want). They provide peek and next methods * for looking at the current character (next 'consumes' this * character, peek does not), and a get method for retrieving all the * text that was consumed since the last time get was called. * * An easy mistake to make is to let a StopIteration exception finish * the token stream while there are still characters pending in the * string stream (hitting the end of the buffer while parsing a * token). To make it easier to detect such errors, the stringstreams * throw an exception when this happens. */ // Make a stringstream stream out of an iterator that returns strings. // This is applied to the result of traverseDOM (see codemirror.js), // and the resulting stream is fed to the parser. var stringStream = function(source){ // String that's currently being iterated over. var current = ""; // Position in that string. var pos = 0; // Accumulator for strings that have been iterated over but not // get()-ed yet. var accum = ""; // Make sure there are more characters ready, or throw // StopIteration. function ensureChars() { while (pos == current.length) { accum += current; current = ""; // In case source.next() throws pos = 0; try {current = source.next();} catch (e) { if (e != StopIteration) throw e; else return false; } } return true; } return { // peek: -> character // Return the next character in the stream. peek: function() { if (!ensureChars()) return null; return current.charAt(pos); }, // next: -> character // Get the next character, throw StopIteration if at end, check // for unused content. next: function() { if (!ensureChars()) { if (accum.length > 0) throw "End of stringstream reached without emptying buffer ('" + accum + "')."; else throw StopIteration; } return current.charAt(pos++); }, // get(): -> string // Return the characters iterated over since the last call to // .get(). get: function() { var temp = accum; accum = ""; if (pos > 0){ temp += current.slice(0, pos); current = current.slice(pos); pos = 0; } return temp; }, // Push a string back into the stream. push: function(str) { current = current.slice(0, pos) + str + current.slice(pos); }, lookAhead: function(str, consume, skipSpaces, caseInsensitive) { function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} str = cased(str); var found = false; var _accum = accum, _pos = pos; if (skipSpaces) this.nextWhileMatches(/[\s\u00a0]/); while (true) { var end = pos + str.length, left = current.length - pos; if (end <= current.length) { found = str == cased(current.slice(pos, end)); pos = end; break; } else if (str.slice(0, left) == cased(current.slice(pos))) { accum += current; current = ""; try {current = source.next();} catch (e) {if (e != StopIteration) throw e; break;} pos = 0; str = str.slice(left); } else { break; } } if (!(found && consume)) { current = accum.slice(_accum.length) + current; pos = _pos; accum = _accum; } return found; }, // Wont't match past end of line. lookAheadRegex: function(regex, consume) { if (regex.source.charAt(0) != "^") throw new Error("Regexps passed to lookAheadRegex must start with ^"); // Fetch the rest of the line while (current.indexOf("\n", pos) == -1) { try {current += source.next();} catch (e) {if (e != StopIteration) throw e; break;} } var matched = current.slice(pos).match(regex); if (matched && consume) pos += matched[0].length; return matched; }, // Utils built on top of the above // more: -> boolean // Produce true if the stream isn't empty. more: function() { return this.peek() !== null; }, applies: function(test) { var next = this.peek(); return (next !== null && test(next)); }, nextWhile: function(test) { var next; while ((next = this.peek()) !== null && test(next)) this.next(); }, matches: function(re) { var next = this.peek(); return (next !== null && re.test(next)); }, nextWhileMatches: function(re) { var next; while ((next = this.peek()) !== null && re.test(next)) this.next(); }, equals: function(ch) { return ch === this.peek(); }, endOfLine: function() { var next = this.peek(); return next == null || next == "\n"; } }; };
JavaScript
/** * Storage and control for undo information within a CodeMirror * editor. 'Why on earth is such a complicated mess required for * that?', I hear you ask. The goal, in implementing this, was to make * the complexity of storing and reverting undo information depend * only on the size of the edited or restored content, not on the size * of the whole document. This makes it necessary to use a kind of * 'diff' system, which, when applied to a DOM tree, causes some * complexity and hackery. * * In short, the editor 'touches' BR elements as it parses them, and * the UndoHistory stores these. When nothing is touched in commitDelay * milliseconds, the changes are committed: It goes over all touched * nodes, throws out the ones that did not change since last commit or * are no longer in the document, and assembles the rest into zero or * more 'chains' -- arrays of adjacent lines. Links back to these * chains are added to the BR nodes, while the chain that previously * spanned these nodes is added to the undo history. Undoing a change * means taking such a chain off the undo history, restoring its * content (text is saved per line) and linking it back into the * document. */ // A history object needs to know about the DOM container holding the // document, the maximum amount of undo levels it should store, the // delay (of no input) after which it commits a set of changes, and, // unfortunately, the 'parent' window -- a window that is not in // designMode, and on which setTimeout works in every browser. function UndoHistory(container, maxDepth, commitDelay, editor) { this.container = container; this.maxDepth = maxDepth; this.commitDelay = commitDelay; this.editor = editor; // This line object represents the initial, empty editor. var initial = {text: "", from: null, to: null}; // As the borders between lines are represented by BR elements, the // start of the first line and the end of the last one are // represented by null. Since you can not store any properties // (links to line objects) in null, these properties are used in // those cases. this.first = initial; this.last = initial; // Similarly, a 'historyTouched' property is added to the BR in // front of lines that have already been touched, and 'firstTouched' // is used for the first line. this.firstTouched = false; // History is the set of committed changes, touched is the set of // nodes touched since the last commit. this.history = []; this.redoHistory = []; this.touched = []; this.lostundo = 0; } UndoHistory.prototype = { // Schedule a commit (if no other touches come in for commitDelay // milliseconds). scheduleCommit: function() { var self = this; parent.clearTimeout(this.commitTimeout); this.commitTimeout = parent.setTimeout(function(){self.tryCommit();}, this.commitDelay); }, // Mark a node as touched. Null is a valid argument. touch: function(node) { this.setTouched(node); this.scheduleCommit(); }, // Undo the last change. undo: function() { // Make sure pending changes have been committed. this.commit(); if (this.history.length) { // Take the top diff from the history, apply it, and store its // shadow in the redo history. var item = this.history.pop(); this.redoHistory.push(this.updateTo(item, "applyChain")); this.notifyEnvironment(); return this.chainNode(item); } }, // Redo the last undone change. redo: function() { this.commit(); if (this.redoHistory.length) { // The inverse of undo, basically. var item = this.redoHistory.pop(); this.addUndoLevel(this.updateTo(item, "applyChain")); this.notifyEnvironment(); return this.chainNode(item); } }, clear: function() { this.history = []; this.redoHistory = []; this.lostundo = 0; }, // Ask for the size of the un/redo histories. historySize: function() { return {undo: this.history.length, redo: this.redoHistory.length, lostundo: this.lostundo}; }, // Push a changeset into the document. push: function(from, to, lines) { var chain = []; for (var i = 0; i < lines.length; i++) { var end = (i == lines.length - 1) ? to : document.createElement("br"); chain.push({from: from, to: end, text: cleanText(lines[i])}); from = end; } this.pushChains([chain], from == null && to == null); this.notifyEnvironment(); }, pushChains: function(chains, doNotHighlight) { this.commit(doNotHighlight); this.addUndoLevel(this.updateTo(chains, "applyChain")); this.redoHistory = []; }, // Retrieve a DOM node from a chain (for scrolling to it after undo/redo). chainNode: function(chains) { for (var i = 0; i < chains.length; i++) { var start = chains[i][0], node = start && (start.from || start.to); if (node) return node; } }, // Clear the undo history, make the current document the start // position. reset: function() { this.history = []; this.redoHistory = []; this.lostundo = 0; }, textAfter: function(br) { return this.after(br).text; }, nodeAfter: function(br) { return this.after(br).to; }, nodeBefore: function(br) { return this.before(br).from; }, // Commit unless there are pending dirty nodes. tryCommit: function() { if (!window || !window.parent || !window.UndoHistory) return; // Stop when frame has been unloaded if (this.editor.highlightDirty()) this.commit(true); else this.scheduleCommit(); }, // Check whether the touched nodes hold any changes, if so, commit // them. commit: function(doNotHighlight) { parent.clearTimeout(this.commitTimeout); // Make sure there are no pending dirty nodes. if (!doNotHighlight) this.editor.highlightDirty(true); // Build set of chains. var chains = this.touchedChains(), self = this; if (chains.length) { this.addUndoLevel(this.updateTo(chains, "linkChain")); this.redoHistory = []; this.notifyEnvironment(); } }, // [ end of public interface ] // Update the document with a given set of chains, return its // shadow. updateFunc should be "applyChain" or "linkChain". In the // second case, the chains are taken to correspond the the current // document, and only the state of the line data is updated. In the // first case, the content of the chains is also pushed iinto the // document. updateTo: function(chains, updateFunc) { var shadows = [], dirty = []; for (var i = 0; i < chains.length; i++) { shadows.push(this.shadowChain(chains[i])); dirty.push(this[updateFunc](chains[i])); } if (updateFunc == "applyChain") this.notifyDirty(dirty); return shadows; }, // Notify the editor that some nodes have changed. notifyDirty: function(nodes) { forEach(nodes, method(this.editor, "addDirtyNode")) this.editor.scheduleHighlight(); }, notifyEnvironment: function() { if (this.onChange) this.onChange(this.editor); // Used by the line-wrapping line-numbering code. if (window.frameElement && window.frameElement.CodeMirror.updateNumbers) window.frameElement.CodeMirror.updateNumbers(); }, // Link a chain into the DOM nodes (or the first/last links for null // nodes). linkChain: function(chain) { for (var i = 0; i < chain.length; i++) { var line = chain[i]; if (line.from) line.from.historyAfter = line; else this.first = line; if (line.to) line.to.historyBefore = line; else this.last = line; } }, // Get the line object after/before a given node. after: function(node) { return node ? node.historyAfter : this.first; }, before: function(node) { return node ? node.historyBefore : this.last; }, // Mark a node as touched if it has not already been marked. setTouched: function(node) { if (node) { if (!node.historyTouched) { this.touched.push(node); node.historyTouched = true; } } else { this.firstTouched = true; } }, // Store a new set of undo info, throw away info if there is more of // it than allowed. addUndoLevel: function(diffs) { this.history.push(diffs); if (this.history.length > this.maxDepth) { this.history.shift(); lostundo += 1; } }, // Build chains from a set of touched nodes. touchedChains: function() { var self = this; // The temp system is a crummy hack to speed up determining // whether a (currently touched) node has a line object associated // with it. nullTemp is used to store the object for the first // line, other nodes get it stored in their historyTemp property. var nullTemp = null; function temp(node) {return node ? node.historyTemp : nullTemp;} function setTemp(node, line) { if (node) node.historyTemp = line; else nullTemp = line; } function buildLine(node) { var text = []; for (var cur = node ? node.nextSibling : self.container.firstChild; cur && (!isBR(cur) || cur.hackBR); cur = cur.nextSibling) if (!cur.hackBR && cur.currentText) text.push(cur.currentText); return {from: node, to: cur, text: cleanText(text.join(""))}; } // Filter out unchanged lines and nodes that are no longer in the // document. Build up line objects for remaining nodes. var lines = []; if (self.firstTouched) self.touched.push(null); forEach(self.touched, function(node) { if (node && (node.parentNode != self.container || node.hackBR)) return; if (node) node.historyTouched = false; else self.firstTouched = false; var line = buildLine(node), shadow = self.after(node); if (!shadow || shadow.text != line.text || shadow.to != line.to) { lines.push(line); setTemp(node, line); } }); // Get the BR element after/before the given node. function nextBR(node, dir) { var link = dir + "Sibling", search = node[link]; while (search && !isBR(search)) search = search[link]; return search; } // Assemble line objects into chains by scanning the DOM tree // around them. var chains = []; self.touched = []; forEach(lines, function(line) { // Note that this makes the loop skip line objects that have // been pulled into chains by lines before them. if (!temp(line.from)) return; var chain = [], curNode = line.from, safe = true; // Put any line objects (referred to by temp info) before this // one on the front of the array. while (true) { var curLine = temp(curNode); if (!curLine) { if (safe) break; else curLine = buildLine(curNode); } chain.unshift(curLine); setTemp(curNode, null); if (!curNode) break; safe = self.after(curNode); curNode = nextBR(curNode, "previous"); } curNode = line.to; safe = self.before(line.from); // Add lines after this one at end of array. while (true) { if (!curNode) break; var curLine = temp(curNode); if (!curLine) { if (safe) break; else curLine = buildLine(curNode); } chain.push(curLine); setTemp(curNode, null); safe = self.before(curNode); curNode = nextBR(curNode, "next"); } chains.push(chain); }); return chains; }, // Find the 'shadow' of a given chain by following the links in the // DOM nodes at its start and end. shadowChain: function(chain) { var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to; while (true) { shadows.push(next); var nextNode = next.to; if (!nextNode || nextNode == end) break; else next = nextNode.historyAfter || this.before(end); // (The this.before(end) is a hack -- FF sometimes removes // properties from BR nodes, in which case the best we can hope // for is to not break.) } return shadows; }, // Update the DOM tree to contain the lines specified in a given // chain, link this chain into the DOM nodes. applyChain: function(chain) { // Some attempt is made to prevent the cursor from jumping // randomly when an undo or redo happens. It still behaves a bit // strange sometimes. var cursor = select.cursorPos(this.container, false), self = this; // Remove all nodes in the DOM tree between from and to (null for // start/end of container). function removeRange(from, to) { var pos = from ? from.nextSibling : self.container.firstChild; while (pos != to) { var temp = pos.nextSibling; removeElement(pos); pos = temp; } } var start = chain[0].from, end = chain[chain.length - 1].to; // Clear the space where this change has to be made. removeRange(start, end); // Insert the content specified by the chain into the DOM tree. for (var i = 0; i < chain.length; i++) { var line = chain[i]; // The start and end of the space are already correct, but BR // tags inside it have to be put back. if (i > 0) self.container.insertBefore(line.from, end); // Add the text. var node = makePartSpan(fixSpaces(line.text)); self.container.insertBefore(node, end); // See if the cursor was on this line. Put it back, adjusting // for changed line length, if it was. if (cursor && cursor.node == line.from) { var cursordiff = 0; var prev = this.after(line.from); if (prev && i == chain.length - 1) { // Only adjust if the cursor is after the unchanged part of // the line. for (var match = 0; match < cursor.offset && line.text.charAt(match) == prev.text.charAt(match); match++){} if (cursor.offset > match) cursordiff = line.text.length - prev.text.length; } select.setCursorPos(this.container, {node: line.from, offset: Math.max(0, cursor.offset + cursordiff)}); } // Cursor was in removed line, this is last new line. else if (cursor && (i == chain.length - 1) && cursor.node && cursor.node.parentNode != this.container) { select.setCursorPos(this.container, {node: line.from, offset: line.text.length}); } } // Anchor the chain in the DOM tree. this.linkChain(chain); return start; } };
JavaScript
/* Parse function for JavaScript. Makes use of the tokenizer from * tokenizejavascript.js. Note that your parsers do not have to be * this complicated -- if you don't want to recognize local variables, * in many languages it is enough to just look for braces, semicolons, * parentheses, etc, and know when you are inside a string or comment. * * See manual.html for more info about the parser interface. */ var JSParser = Editor.Parser = (function() { // Token types that can be considered to be atoms. var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; // Setting that can be used to have JSON data indent properly. var json = false; // Constructor for the lexical context objects. function JSLexical(indented, column, type, align, prev, info) { // indentation at start of this line this.indented = indented; // column at which this scope was opened this.column = column; // type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(') this.type = type; // '[', '{', or '(' blocks that have any text after their opening // character are said to be 'aligned' -- any lines below are // indented all the way to the opening character. if (align != null) this.align = align; // Parent scope, if any. this.prev = prev; this.info = info; } // My favourite JavaScript indentation rules. function indentJS(lexical) { return function(firstChars) { var firstChar = firstChars && firstChars.charAt(0), type = lexical.type; var closing = firstChar == type; if (type == "vardef") return lexical.indented + 4; else if (type == "form" && firstChar == "{") return lexical.indented; else if (type == "stat" || type == "form") return lexical.indented + indentUnit; else if (lexical.info == "switch" && !closing) return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit); else if (lexical.align) return lexical.column - (closing ? 1 : 0); else return lexical.indented + (closing ? 0 : indentUnit); }; } // The parser-iterator-producing function itself. function parseJS(input, basecolumn) { // Wrap the input in a token stream var tokens = tokenizeJavaScript(input); // The parser state. cc is a stack of actions that have to be // performed to finish the current statement. For example we might // know that we still need to find a closing parenthesis and a // semicolon. Actions at the end of the stack go first. It is // initialized with an infinitely looping action that consumes // whole statements. var cc = [json ? expressions : statements]; // Context contains information about the current local scope, the // variables defined in that, and the scopes above it. var context = null; // The lexical scope, used mostly for indentation. var lexical = new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false); // Current column, and the indentation at the start of the current // line. Used to create lexical scope objects. var column = 0; var indented = 0; // Variables which are used by the mark, cont, and pass functions // below to communicate with the driver loop in the 'next' // function. var consume, marked; // The iterator object. var parser = {next: next, copy: copy}; function next(){ // Start by performing any 'lexical' actions (adjusting the // lexical variable), or the operations below will be working // with the wrong lexical state. while(cc[cc.length - 1].lex) cc.pop()(); // Fetch a token. var token = tokens.next(); // Adjust column and indented. if (token.type == "whitespace" && column == 0) indented = token.value.length; column += token.value.length; if (token.content == "\n"){ indented = column = 0; // If the lexical scope's align property is still undefined at // the end of the line, it is an un-aligned scope. if (!("align" in lexical)) lexical.align = false; // Newline tokens get an indentation function associated with // them. token.indentation = indentJS(lexical); } // No more processing for meaningless tokens. if (token.type == "whitespace" || token.type == "comment") return token; // When a meaningful token is found and the lexical scope's // align is undefined, it is an aligned scope. if (!("align" in lexical)) lexical.align = true; // Execute actions until one 'consumes' the token and we can // return it. while(true) { consume = marked = false; // Take and execute the topmost action. cc.pop()(token.type, token.content); if (consume){ // Marked is used to change the style of the current token. if (marked) token.style = marked; // Here we differentiate between local and global variables. else if (token.type == "variable" && inScope(token.content)) token.style = "js-localvariable"; return token; } } } // This makes a copy of the parser state. It stores all the // stateful variables in a closure, and returns a function that // will restore them when called with a new input stream. Note // that the cc array has to be copied, because it is contantly // being modified. Lexical objects are not mutated, and context // objects are not mutated in a harmful way, so they can be shared // between runs of the parser. function copy(){ var _context = context, _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state; return function copyParser(input){ context = _context; lexical = _lexical; cc = _cc.concat([]); // copies the array column = indented = 0; tokens = tokenizeJavaScript(input, _tokenState); return parser; }; } // Helper function for pushing a number of actions onto the cc // stack in reverse order. function push(fs){ for (var i = fs.length - 1; i >= 0; i--) cc.push(fs[i]); } // cont and pass are used by the action functions to add other // actions to the stack. cont will cause the current token to be // consumed, pass will leave it for the next action. function cont(){ push(arguments); consume = true; } function pass(){ push(arguments); consume = false; } // Used to change the style of the current token. function mark(style){ marked = style; } // Push a new scope. Will automatically link the current scope. function pushcontext(){ context = {prev: context, vars: {"this": true, "arguments": true}}; } // Pop off the current scope. function popcontext(){ context = context.prev; } // Register a variable in the current scope. function register(varname){ if (context){ mark("js-variabledef"); context.vars[varname] = true; } } // Check whether a variable is defined in the current scope. function inScope(varname){ var cursor = context; while (cursor) { if (cursor.vars[varname]) return true; cursor = cursor.prev; } return false; } // Push a new lexical context of the given type. function pushlex(type, info) { var result = function(){ lexical = new JSLexical(indented, column, type, null, lexical, info) }; result.lex = true; return result; } // Pop off the current lexical context. function poplex(){ if (lexical.type == ")") indented = lexical.indented; lexical = lexical.prev; } poplex.lex = true; // The 'lex' flag on these actions is used by the 'next' function // to know they can (and have to) be ran before moving on to the // next token. // Creates an action that discards tokens until it finds one of // the given type. function expect(wanted){ return function expecting(type){ if (type == wanted) cont(); else if (wanted == ";") pass(); else cont(arguments.callee); }; } // Looks for a statement, and then calls itself. function statements(type){ return pass(statement, statements); } function expressions(type){ return pass(expression, expressions); } // Dispatches various types of statements based on the type of the // current token. function statement(type){ if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex); else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex); else if (type == "keyword b") cont(pushlex("form"), statement, poplex); else if (type == "{") cont(pushlex("}"), block, poplex); else if (type == ";") cont(); else if (type == "function") cont(functiondef); else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex); else if (type == "variable") cont(pushlex("stat"), maybelabel); else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex); else if (type == "case") cont(expression, expect(":")); else if (type == "default") cont(expect(":")); else if (type == "catch") cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext); else pass(pushlex("stat"), expression, expect(";"), poplex); } // Dispatch expression types. function expression(type){ if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator); else if (type == "function") cont(functiondef); else if (type == "keyword c") cont(expression); else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator); else if (type == "operator") cont(expression); else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); else cont(); } // Called for places where operators, function calls, or // subscripts are valid. Will skip on to the next action if none // is found. function maybeoperator(type, value){ if (type == "operator" && /\+\+|--/.test(value)) cont(maybeoperator); else if (type == "operator") cont(expression); else if (type == ";") pass(); else if (type == "(") cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); else if (type == ".") cont(property, maybeoperator); else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); } // When a statement starts with a variable name, it might be a // label. If no colon follows, it's a regular statement. function maybelabel(type){ if (type == ":") cont(poplex, statement); else pass(maybeoperator, expect(";"), poplex); } // Property names need to have their style adjusted -- the // tokenizer thinks they are variables. function property(type){ if (type == "variable") {mark("js-property"); cont();} } // This parses a property and its value in an object literal. function objprop(type){ if (type == "variable") mark("js-property"); if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression); } // Parses a comma-separated list of the things that are recognized // by the 'what' argument. function commasep(what, end){ function proceed(type) { if (type == ",") cont(what, proceed); else if (type == end) cont(); else cont(expect(end)); } return function commaSeparated(type) { if (type == end) cont(); else pass(what, proceed); }; } // Look for statements until a closing brace is found. function block(type){ if (type == "}") cont(); else pass(statement, block); } // Variable definitions are split into two actions -- 1 looks for // a name or the end of the definition, 2 looks for an '=' sign or // a comma. function vardef1(type, value){ if (type == "variable"){register(value); cont(vardef2);} else cont(); } function vardef2(type, value){ if (value == "=") cont(expression, vardef2); else if (type == ",") cont(vardef1); } // For loops. function forspec1(type){ if (type == "var") cont(vardef1, forspec2); else if (type == ";") pass(forspec2); else if (type == "variable") cont(formaybein); else pass(forspec2); } function formaybein(type, value){ if (value == "in") cont(expression); else cont(maybeoperator, forspec2); } function forspec2(type, value){ if (type == ";") cont(forspec3); else if (value == "in") cont(expression); else cont(expression, expect(";"), forspec3); } function forspec3(type) { if (type == ")") pass(); else cont(expression); } // A function definition creates a new context, and the variables // in its argument list have to be added to this context. function functiondef(type, value){ if (type == "variable"){register(value); cont(functiondef);} else if (type == "(") cont(pushcontext, commasep(funarg, ")"), statement, popcontext); } function funarg(type, value){ if (type == "variable"){register(value); cont();} } return parser; } return { make: parseJS, electricChars: "{}:", configure: function(obj) { if (obj.json != null) json = obj.json; } }; })();
JavaScript
var DummyParser = Editor.Parser = (function() { function tokenizeDummy(source) { while (!source.endOfLine()) source.next(); return "text"; } function parseDummy(source) { function indentTo(n) {return function() {return n;}} source = tokenizer(source, tokenizeDummy); var space = 0; var iter = { next: function() { var tok = source.next(); if (tok.type == "whitespace") { if (tok.value == "\n") tok.indentation = indentTo(space); else space = tok.value.length; } return tok; }, copy: function() { var _space = space; return function(_source) { space = _space; source = tokenizer(_source, tokenizeDummy); return iter; }; } }; return iter; } return {make: parseDummy}; })();
JavaScript
/* Tokenizer for CSharp code */ var tokenizeCSharp = (function() { // Advance the stream until the given character (not preceded by a // backslash) is encountered, or the end of the line is reached. function nextUntilUnescaped(source, end) { var escaped = false; var next; while (!source.endOfLine()) { var next = source.next(); if (next == end && !escaped) return false; escaped = !escaped && next == "\\"; } return escaped; } // A map of JavaScript's keywords. The a/b/c keyword distinction is // very rough, but it gives the parser enough information to parse // correct code correctly (we don't care that much how we parse // incorrect code). The style information included in these objects // is used by the highlighter to pick the correct CSS style for a // token. var keywords = function(){ function result(type, style){ return {type: type, style: "csharp-" + style}; } // keywords that take a parenthised expression, and then a // statement (if) var keywordA = result("keyword a", "keyword"); // keywords that take just a statement (else) var keywordB = result("keyword b", "keyword"); // keywords that optionally take an expression, and form a // statement (return) var keywordC = result("keyword c", "keyword"); var operator = result("operator", "keyword"); var atom = result("atom", "atom"); // just a keyword with no indentation implications var keywordD = result("keyword d", "keyword"); return { "if": keywordA, "while": keywordA, "with": keywordA, "else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB, "return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "delete": keywordC, "throw": keywordC, "in": operator, "typeof": operator, "instanceof": operator, "var": result("var", "keyword"), "function": result("function", "keyword"), "catch": result("catch", "keyword"), "for": result("for", "keyword"), "switch": result("switch", "keyword"), "case": result("case", "keyword"), "default": result("default", "keyword"), "true": atom, "false": atom, "null": atom, "class": result("class", "keyword"), "namespace": result("class", "keyword"), "public": keywordD, "private": keywordD, "protected": keywordD, "internal": keywordD, "extern": keywordD, "override": keywordD, "virtual": keywordD, "abstract": keywordD, "static": keywordD, "out": keywordD, "ref": keywordD, "const": keywordD, "foreach": result("for", "keyword"), "using": keywordC, "int": keywordD, "double": keywordD, "long": keywordD, "bool": keywordD, "char": keywordD, "void": keywordD, "string": keywordD, "byte": keywordD, "sbyte": keywordD, "decimal": keywordD, "float": keywordD, "uint": keywordD, "ulong": keywordD, "object": keywordD, "short": keywordD, "ushort": keywordD, "get": keywordD, "set": keywordD, "value": keywordD }; }(); // Some helper regexps var isOperatorChar = /[+\-*&%=<>!?|]/; var isHexDigit = /[0-9A-Fa-f]/; var isWordChar = /[\w\$_]/; // Wrapper around jsToken that helps maintain parser state (whether // we are inside of a multi-line comment and whether the next token // could be a regular expression). function jsTokenState(inside, regexp) { return function(source, setState) { var newInside = inside; var type = jsToken(inside, regexp, source, function(c) {newInside = c;}); var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/); if (newRegexp != regexp || newInside != inside) setState(jsTokenState(newInside, newRegexp)); return type; }; } // The token reader, inteded to be used by the tokenizer from // tokenize.js (through jsTokenState). Advances the source stream // over a token, and returns an object containing the type and style // of that token. function jsToken(inside, regexp, source, setInside) { function readHexNumber(){ source.next(); // skip the 'x' source.nextWhileMatches(isHexDigit); return {type: "number", style: "csharp-atom"}; } function readNumber() { source.nextWhileMatches(/[0-9]/); if (source.equals(".")){ source.next(); source.nextWhileMatches(/[0-9]/); } if (source.equals("e") || source.equals("E")){ source.next(); if (source.equals("-")) source.next(); source.nextWhileMatches(/[0-9]/); } return {type: "number", style: "csharp-atom"}; } // Read a word, look it up in keywords. If not found, it is a // variable, otherwise it is a keyword of the type found. function readWord() { source.nextWhileMatches(isWordChar); var word = source.get(); var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word]; return known ? {type: known.type, style: known.style, content: word} : {type: "variable", style: "csharp-variable", content: word}; } function readRegexp() { nextUntilUnescaped(source, "/"); source.nextWhileMatches(/[gi]/); return {type: "regexp", style: "csharp-string"}; } // Mutli-line comments are tricky. We want to return the newlines // embedded in them as regular newline tokens, and then continue // returning a comment token for every line of the comment. So // some state has to be saved (inside) to indicate whether we are // inside a /* */ sequence. function readMultilineComment(start){ var newInside = "/*"; var maybeEnd = (start == "*"); while (true) { if (source.endOfLine()) break; var next = source.next(); if (next == "/" && maybeEnd){ newInside = null; break; } maybeEnd = (next == "*"); } setInside(newInside); return {type: "comment", style: "csharp-comment"}; } function readOperator() { source.nextWhileMatches(isOperatorChar); return {type: "operator", style: "csharp-operator"}; } function readString(quote) { var endBackSlash = nextUntilUnescaped(source, quote); setInside(endBackSlash ? quote : null); return {type: "string", style: "csharp-string"}; } // Fetch the next token. Dispatches on first character in the // stream, or first two characters when the first is a slash. if (inside == "\"" || inside == "'") return readString(inside); var ch = source.next(); if (inside == "/*") return readMultilineComment(ch); else if (ch == "\"" || ch == "'") return readString(ch); // with punctuation, the type of the token is the symbol itself else if (/[\[\]{}\(\),;\:\.]/.test(ch)) return {type: ch, style: "csharp-punctuation"}; else if (ch == "0" && (source.equals("x") || source.equals("X"))) return readHexNumber(); else if (/[0-9]/.test(ch)) return readNumber(); else if (ch == "/"){ if (source.equals("*")) { source.next(); return readMultilineComment(ch); } else if (source.equals("/")) { nextUntilUnescaped(source, null); return {type: "comment", style: "csharp-comment"};} else if (regexp) return readRegexp(); else return readOperator(); } else if (ch == "#") { // treat c# regions like comments nextUntilUnescaped(source, null); return {type: "comment", style: "csharp-comment"}; } else if (isOperatorChar.test(ch)) return readOperator(); else return readWord(); } // The external interface to the tokenizer. return function(source, startState) { return tokenizer(source, startState || jsTokenState(false, true)); }; })();
JavaScript
/* Parse function for JavaScript. Makes use of the tokenizer from * tokenizecsharp.js. Note that your parsers do not have to be * this complicated -- if you don't want to recognize local variables, * in many languages it is enough to just look for braces, semicolons, * parentheses, etc, and know when you are inside a string or comment. * * See manual.html for more info about the parser interface. */ var JSParser = Editor.Parser = (function() { // Token types that can be considered to be atoms. var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; // Setting that can be used to have JSON data indent properly. var json = false; // Constructor for the lexical context objects. function CSharpLexical(indented, column, type, align, prev, info) { // indentation at start of this line this.indented = indented; // column at which this scope was opened this.column = column; // type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(') this.type = type; // '[', '{', or '(' blocks that have any text after their opening // character are said to be 'aligned' -- any lines below are // indented all the way to the opening character. if (align != null) this.align = align; // Parent scope, if any. this.prev = prev; this.info = info; } // CSharp indentation rules. function indentCSharp(lexical) { return function(firstChars) { var firstChar = firstChars && firstChars.charAt(0), type = lexical.type; var closing = firstChar == type; if (type == "vardef") return lexical.indented + 4; else if (type == "form" && firstChar == "{") return lexical.indented; else if (type == "stat" || type == "form") return lexical.indented + indentUnit; else if (lexical.info == "switch" && !closing) return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit); else if (lexical.align) return lexical.column - (closing ? 1 : 0); else return lexical.indented + (closing ? 0 : indentUnit); }; } // The parser-iterator-producing function itself. function parseCSharp(input, basecolumn) { // Wrap the input in a token stream var tokens = tokenizeCSharp(input); // The parser state. cc is a stack of actions that have to be // performed to finish the current statement. For example we might // know that we still need to find a closing parenthesis and a // semicolon. Actions at the end of the stack go first. It is // initialized with an infinitely looping action that consumes // whole statements. var cc = [statements]; // The lexical scope, used mostly for indentation. var lexical = new CSharpLexical((basecolumn || 0) - indentUnit, 0, "block", false); // Current column, and the indentation at the start of the current // line. Used to create lexical scope objects. var column = 0; var indented = 0; // Variables which are used by the mark, cont, and pass functions // below to communicate with the driver loop in the 'next' // function. var consume, marked; // The iterator object. var parser = {next: next, copy: copy}; function next(){ // Start by performing any 'lexical' actions (adjusting the // lexical variable), or the operations below will be working // with the wrong lexical state. while(cc[cc.length - 1].lex) cc.pop()(); // Fetch a token. var token = tokens.next(); // Adjust column and indented. if (token.type == "whitespace" && column == 0) indented = token.value.length; column += token.value.length; if (token.content == "\n"){ indented = column = 0; // If the lexical scope's align property is still undefined at // the end of the line, it is an un-aligned scope. if (!("align" in lexical)) lexical.align = false; // Newline tokens get an indentation function associated with // them. token.indentation = indentCSharp(lexical); } // No more processing for meaningless tokens. if (token.type == "whitespace" || token.type == "comment") return token; // When a meaningful token is found and the lexical scope's // align is undefined, it is an aligned scope. if (!("align" in lexical)) lexical.align = true; // Execute actions until one 'consumes' the token and we can // return it. while(true) { consume = marked = false; // Take and execute the topmost action. cc.pop()(token.type, token.content); if (consume){ // Marked is used to change the style of the current token. if (marked) token.style = marked; return token; } } } // This makes a copy of the parser state. It stores all the // stateful variables in a closure, and returns a function that // will restore them when called with a new input stream. Note // that the cc array has to be copied, because it is contantly // being modified. Lexical objects are not mutated, and context // objects are not mutated in a harmful way, so they can be shared // between runs of the parser. function copy(){ var _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state; return function copyParser(input){ lexical = _lexical; cc = _cc.concat([]); // copies the array column = indented = 0; tokens = tokenizeCSharp(input, _tokenState); return parser; }; } // Helper function for pushing a number of actions onto the cc // stack in reverse order. function push(fs){ for (var i = fs.length - 1; i >= 0; i--) cc.push(fs[i]); } // cont and pass are used by the action functions to add other // actions to the stack. cont will cause the current token to be // consumed, pass will leave it for the next action. function cont(){ push(arguments); consume = true; } function pass(){ push(arguments); consume = false; } // Used to change the style of the current token. function mark(style){ marked = style; } // Push a new lexical context of the given type. function pushlex(type, info) { var result = function(){ lexical = new CSharpLexical(indented, column, type, null, lexical, info) }; result.lex = true; return result; } // Pop off the current lexical context. function poplex(){ lexical = lexical.prev; } poplex.lex = true; // The 'lex' flag on these actions is used by the 'next' function // to know they can (and have to) be ran before moving on to the // next token. // Creates an action that discards tokens until it finds one of // the given type. function expect(wanted){ return function expecting(type){ if (type == wanted) cont(); else cont(arguments.callee); }; } // Looks for a statement, and then calls itself. function statements(type){ return pass(statement, statements); } // Dispatches various types of statements based on the type of the // current token. function statement(type){ if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex); else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex); else if (type == "keyword b") cont(pushlex("form"), statement, poplex); else if (type == "{" && json) cont(pushlex("}"), commasep(objprop, "}"), poplex); else if (type == "{") cont(pushlex("}"), block, poplex); else if (type == "function") cont(functiondef); else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex); else if (type == "variable") cont(pushlex("stat"), maybelabel); else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex); else if (type == "case") cont(expression, expect(":")); else if (type == "default") cont(expect(":")); else if (type == "catch") cont(pushlex("form"), expect("("), funarg, expect(")"), statement, poplex); else if (type == "class") cont(classdef); else if (type == "keyword d") cont(statement); else pass(pushlex("stat"), expression, expect(";"), poplex); } // Dispatch expression types. function expression(type){ if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator); else if (type == "function") cont(functiondef); else if (type == "keyword c") cont(expression); else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator); else if (type == "operator") cont(expression); else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); } // Called for places where operators, function calls, or // subscripts are valid. Will skip on to the next action if none // is found. function maybeoperator(type){ if (type == "operator") cont(expression); else if (type == "(") cont(pushlex(")"), expression, commasep(expression, ")"), poplex, maybeoperator); else if (type == ".") cont(property, maybeoperator); else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); } // When a statement starts with a variable name, it might be a // label. If no colon follows, it's a regular statement. function maybelabel(type){ if (type == ":") cont(poplex, statement); else if (type == "(") cont(commasep(funarg, ")"), poplex, statement); // method definition else if (type == "{") cont(poplex, pushlex("}"), block, poplex); // property definition else pass(maybeoperator, expect(";"), poplex); } // Property names need to have their style adjusted -- the // tokenizer thinks they are variables. function property(type){ if (type == "variable") {mark("csharp-property"); cont();} } // This parses a property and its value in an object literal. function objprop(type){ if (type == "variable") mark("csharp-property"); if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression); } // Parses a comma-separated list of the things that are recognized // by the 'what' argument. function commasep(what, end){ function proceed(type) { if (type == ",") cont(what, proceed); else if (type == end) cont(); else cont(expect(end)); }; return function commaSeparated(type) { if (type == end) cont(); else pass(what, proceed); }; } // Look for statements until a closing brace is found. function block(type){ if (type == "}") cont(); else pass(statement, block); } // Variable definitions are split into two actions -- 1 looks for // a name or the end of the definition, 2 looks for an '=' sign or // a comma. function vardef1(type, value){ if (type == "variable"){cont(vardef2);} else cont(); } function vardef2(type, value){ if (value == "=") cont(expression, vardef2); else if (type == ",") cont(vardef1); } // For loops. function forspec1(type){ if (type == "var") cont(vardef1, forspec2); else if (type == "keyword d") cont(vardef1, forspec2); else if (type == ";") pass(forspec2); else if (type == "variable") cont(formaybein); else pass(forspec2); } function formaybein(type, value){ if (value == "in") cont(expression); else cont(maybeoperator, forspec2); } function forspec2(type, value){ if (type == ";") cont(forspec3); else if (value == "in") cont(expression); else cont(expression, expect(";"), forspec3); } function forspec3(type) { if (type == ")") pass(); else cont(expression); } // A function definition creates a new context, and the variables // in its argument list have to be added to this context. function functiondef(type, value){ if (type == "variable") cont(functiondef); else if (type == "(") cont(commasep(funarg, ")"), statement); } function funarg(type, value){ if (type == "variable"){cont();} } function classdef(type) { if (type == "variable") cont(classdef, statement); else if (type == ":") cont(classdef, statement); } return parser; } return { make: parseCSharp, electricChars: "{}:", configure: function(obj) { if (obj.json != null) json = obj.json; } }; })();
JavaScript
/* Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. The copyrights embodied in the content of this file are licensed by Yahoo! Inc. under the BSD (revised) open source license @author Dan Vlad Dascalescu <dandv@yahoo-inc.com> Parse function for PHP. Makes use of the tokenizer from tokenizephp.js. Based on parsejavascript.js by Marijn Haverbeke. Features: + special "deprecated" style for PHP4 keywords like 'var' + support for PHP 5.3 keywords: 'namespace', 'use' + 911 predefined constants, 1301 predefined functions, 105 predeclared classes from a typical PHP installation in a LAMP environment + new feature: syntax error flagging, thus enabling strict parsing of: + function definitions with explicitly or implicitly typed arguments and default values + modifiers (public, static etc.) applied to method and member definitions + foreach(array_expression as $key [=> $value]) loops + differentiation between single-quoted strings and double-quoted interpolating strings */ // add the Array.indexOf method for JS engines that don't support it (e.g. IE) // code from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array/IndexOf if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(elt /*, from*/) { var len = this.length; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); if (from < 0) from += len; for (; from < len; from++) { if (from in this && this[from] === elt) return from; } return -1; }; } var PHPParser = Editor.Parser = (function() { // Token types that can be considered to be atoms, part of operator expressions var atomicTypes = { "atom": true, "number": true, "variable": true, "string": true }; // Constructor for the lexical context objects. function PHPLexical(indented, column, type, align, prev, info) { // indentation at start of this line this.indented = indented; // column at which this scope was opened this.column = column; // type of scope ('stat' (statement), 'form' (special form), '[', '{', or '(') this.type = type; // '[', '{', or '(' blocks that have any text after their opening // character are said to be 'aligned' -- any lines below are // indented all the way to the opening character. if (align != null) this.align = align; // Parent scope, if any. this.prev = prev; this.info = info; } // PHP indentation rules function indentPHP(lexical) { return function(firstChars) { var firstChar = firstChars && firstChars.charAt(0), type = lexical.type; var closing = firstChar == type; if (type == "form" && firstChar == "{") return lexical.indented; else if (type == "stat" || type == "form") return lexical.indented + indentUnit; else if (lexical.info == "switch" && !closing) return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit); else if (lexical.align) return lexical.column - (closing ? 1 : 0); else return lexical.indented + (closing ? 0 : indentUnit); }; } // The parser-iterator-producing function itself. function parsePHP(input, basecolumn) { // Wrap the input in a token stream var tokens = tokenizePHP(input); // The parser state. cc is a stack of actions that have to be // performed to finish the current statement. For example we might // know that we still need to find a closing parenthesis and a // semicolon. Actions at the end of the stack go first. It is // initialized with an infinitely looping action that consumes // whole statements. var cc = [statements]; // The lexical scope, used mostly for indentation. var lexical = new PHPLexical((basecolumn || 0) - indentUnit, 0, "block", false); // Current column, and the indentation at the start of the current // line. Used to create lexical scope objects. var column = 0; var indented = 0; // Variables which are used by the mark, cont, and pass functions // below to communicate with the driver loop in the 'next' function. var consume, marked; // The iterator object. var parser = {next: next, copy: copy}; // parsing is accomplished by calling next() repeatedly function next(){ // Start by performing any 'lexical' actions (adjusting the // lexical variable), or the operations below will be working // with the wrong lexical state. while(cc[cc.length - 1].lex) cc.pop()(); // Fetch the next token. var token = tokens.next(); // Adjust column and indented. if (token.type == "whitespace" && column == 0) indented = token.value.length; column += token.value.length; if (token.content == "\n"){ indented = column = 0; // If the lexical scope's align property is still undefined at // the end of the line, it is an un-aligned scope. if (!("align" in lexical)) lexical.align = false; // Newline tokens get an indentation function associated with // them. token.indentation = indentPHP(lexical); } // No more processing for meaningless tokens. if (token.type == "whitespace" || token.type == "comment" || token.type == "string_not_terminated" ) return token; // When a meaningful token is found and the lexical scope's // align is undefined, it is an aligned scope. if (!("align" in lexical)) lexical.align = true; // Execute actions until one 'consumes' the token and we can // return it. 'marked' is used to change the style of the current token. while(true) { consume = marked = false; // Take and execute the topmost action. var action = cc.pop(); action(token); if (consume){ if (marked) token.style = marked; // Here we differentiate between local and global variables. return token; } } return 1; // Firebug workaround for http://code.google.com/p/fbug/issues/detail?id=1239#c1 } // This makes a copy of the parser state. It stores all the // stateful variables in a closure, and returns a function that // will restore them when called with a new input stream. Note // that the cc array has to be copied, because it is contantly // being modified. Lexical objects are not mutated, so they can // be shared between runs of the parser. function copy(){ var _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state; return function copyParser(input){ lexical = _lexical; cc = _cc.concat([]); // copies the array column = indented = 0; tokens = tokenizePHP(input, _tokenState); return parser; }; } // Helper function for pushing a number of actions onto the cc // stack in reverse order. function push(fs){ for (var i = fs.length - 1; i >= 0; i--) cc.push(fs[i]); } // cont and pass are used by the action functions to add other // actions to the stack. cont will cause the current token to be // consumed, pass will leave it for the next action. function cont(){ push(arguments); consume = true; } function pass(){ push(arguments); consume = false; } // Used to change the style of the current token. function mark(style){ marked = style; } // Add a lyer of style to the current token, for example syntax-error function mark_add(style){ marked = marked + ' ' + style; } // Push a new lexical context of the given type. function pushlex(type, info) { var result = function pushlexing() { lexical = new PHPLexical(indented, column, type, null, lexical, info) }; result.lex = true; return result; } // Pop off the current lexical context. function poplex(){ if (lexical.prev) lexical = lexical.prev; } poplex.lex = true; // The 'lex' flag on these actions is used by the 'next' function // to know they can (and have to) be ran before moving on to the // next token. // Creates an action that discards tokens until it finds one of // the given type. This will ignore (and recover from) syntax errors. function expect(wanted){ return function expecting(token){ if (token.type == wanted) cont(); // consume the token else { cont(arguments.callee); // continue expecting() - call itself } }; } // Require a specific token type, or one of the tokens passed in the 'wanted' array // Used to detect blatant syntax errors. 'execute' is used to pass extra code // to be executed if the token is matched. For example, a '(' match could // 'execute' a cont( compasep(funcarg), require(")") ) function require(wanted, execute){ return function requiring(token){ var ok; var type = token.type; if (typeof(wanted) == "string") ok = (type == wanted) -1; else ok = wanted.indexOf(type); if (ok >= 0) { if (execute && typeof(execute[ok]) == "function") pass(execute[ok]); else cont(); } else { if (!marked) mark(token.style); mark_add("syntax-error"); cont(arguments.callee); } }; } // Looks for a statement, and then calls itself. function statements(token){ return pass(statement, statements); } // Dispatches various types of statements based on the type of the current token. function statement(token){ var type = token.type; if (type == "keyword a") cont(pushlex("form"), expression, altsyntax, statement, poplex); else if (type == "keyword b") cont(pushlex("form"), altsyntax, statement, poplex); else if (type == "{") cont(pushlex("}"), block, poplex); else if (type == "function") funcdef(); // technically, "class implode {...}" is correct, but we'll flag that as an error because it overrides a predefined function else if (type == "class") classdef(); else if (type == "foreach") cont(pushlex("form"), require("("), pushlex(")"), expression, require("as"), require("variable"), /* => $value */ expect(")"), altsyntax, poplex, statement, poplex); else if (type == "for") cont(pushlex("form"), require("("), pushlex(")"), expression, require(";"), expression, require(";"), expression, require(")"), altsyntax, poplex, statement, poplex); // public final function foo(), protected static $bar; else if (type == "modifier") cont(require(["modifier", "variable", "function", "abstract"], [null, commasep(require("variable")), funcdef, absfun])); else if (type == "abstract") abs(); else if (type == "switch") cont(pushlex("form"), require("("), expression, require(")"), pushlex("}", "switch"), require([":", "{"]), block, poplex, poplex); else if (type == "case") cont(expression, require(":")); else if (type == "default") cont(require(":")); else if (type == "catch") cont(pushlex("form"), require("("), require("t_string"), require("variable"), require(")"), statement, poplex); else if (type == "const") cont(require("t_string")); // 'const static x=5' is a syntax error // technically, "namespace implode {...}" is correct, but we'll flag that as an error because it overrides a predefined function else if (type == "namespace") cont(namespacedef, require(";")); // $variables may be followed by operators, () for variable function calls, or [] subscripts else pass(pushlex("stat"), expression, require(";"), poplex); } // Dispatch expression types. function expression(token){ var type = token.type; if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator); else if (type == "<<<") cont(require("string"), maybeoperator); // heredoc/nowdoc else if (type == "t_string") cont(maybe_double_colon, maybeoperator); else if (type == "keyword c" || type == "operator") cont(expression); // lambda else if (type == "function") lambdadef(); // function call or parenthesized expression: $a = ($b + 1) * 2; else if (type == "(") cont(pushlex(")"), commasep(expression), require(")"), poplex, maybeoperator); } // Called for places where operators, function calls, or subscripts are // valid. Will skip on to the next action if none is found. function maybeoperator(token){ var type = token.type; if (type == "operator") { if (token.content == "?") cont(expression, require(":"), expression); // ternary operator else cont(expression); } else if (type == "(") cont(pushlex(")"), expression, commasep(expression), require(")"), poplex, maybeoperator /* $varfunc() + 3 */); else if (type == "[") cont(pushlex("]"), expression, require("]"), maybeoperator /* for multidimensional arrays, or $func[$i]() */, poplex); } // A regular use of the double colon to specify a class, as in self::func() or myclass::$var; // Differs from `namespace` or `use` in that only one class can be the parent; chains (A::B::$var) are a syntax error. function maybe_double_colon(token) { if (token.type == "t_double_colon") // A::$var, A::func(), A::const cont(require(["t_string", "variable"]), maybeoperator); else { // a t_string wasn't followed by ::, such as in a function call: foo() pass(expression) } } // the declaration or definition of a function function funcdef() { cont(require("t_string"), require("("), pushlex(")"), commasep(funcarg), require(")"), poplex, block); } // the declaration or definition of a lambda function lambdadef() { cont(require("("), pushlex(")"), commasep(funcarg), require(")"), maybe_lambda_use, poplex, require("{"), pushlex("}"), block, poplex); } // optional lambda 'use' statement function maybe_lambda_use(token) { if(token.type == "namespace") { cont(require('('), commasep(funcarg), require(')')); } else { pass(expression); } } // the definition of a class function classdef() { cont(require("t_string"), expect("{"), pushlex("}"), block, poplex); } // either funcdef if the current token is "function", or the keyword "function" + funcdef function absfun(token) { if(token.type == "function") funcdef(); else cont(require(["function"], [funcdef])); } // the abstract class or function (with optional modifier) function abs(token) { cont(require(["modifier", "function", "class"], [absfun, funcdef, classdef])); } // Parses a comma-separated list of the things that are recognized // by the 'what' argument. function commasep(what){ function proceed(token) { if (token.type == ",") cont(what, proceed); } return function commaSeparated() { pass(what, proceed); }; } // Look for statements until a closing brace is found. function block(token) { if (token.type == "}") cont(); else pass(statement, block); } function empty_parens_if_array(token) { if(token.content == "array") cont(require("("), require(")")); } function maybedefaultparameter(token){ if (token.content == "=") cont(require(["t_string", "string", "number", "atom"], [empty_parens_if_array, null, null])); } function var_or_reference(token) { if(token.type == "variable") cont(maybedefaultparameter); else if(token.content == "&") cont(require("variable"), maybedefaultparameter); } // support for default arguments: http://us.php.net/manual/en/functions.arguments.php#functions.arguments.default function funcarg(token){ // function foo(myclass $obj) {...} or function foo(myclass &objref) {...} if (token.type == "t_string") cont(var_or_reference); // function foo($var) {...} or function foo(&$ref) {...} else var_or_reference(token); } // A namespace definition or use function maybe_double_colon_def(token) { if (token.type == "t_double_colon") cont(namespacedef); } function namespacedef(token) { pass(require("t_string"), maybe_double_colon_def); } function altsyntax(token){ if(token.content==':') cont(altsyntaxBlock,poplex); } function altsyntaxBlock(token){ if (token.type == "altsyntaxend") cont(require(';')); else pass(statement, altsyntaxBlock); } return parser; } return {make: parsePHP, electricChars: "{}:"}; })();
JavaScript
/* Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. The copyrights embodied in the content of this file are licensed by Yahoo! Inc. under the BSD (revised) open source license @author Dan Vlad Dascalescu <dandv@yahoo-inc.com> Based on parsehtmlmixed.js by Marijn Haverbeke. */ var PHPHTMLMixedParser = Editor.Parser = (function() { var processingInstructions = ["<?php"]; if (!(PHPParser && CSSParser && JSParser && XMLParser)) throw new Error("PHP, CSS, JS, and XML parsers must be loaded for PHP+HTML mixed mode to work."); XMLParser.configure({useHTMLKludges: true}); function parseMixed(stream) { var htmlParser = XMLParser.make(stream), localParser = null, inTag = false, lastAtt = null, phpParserState = null; var iter = {next: top, copy: copy}; function top() { var token = htmlParser.next(); if (token.content == "<") inTag = true; else if (token.style == "xml-tagname" && inTag === true) inTag = token.content.toLowerCase(); else if (token.style == "xml-attname") lastAtt = token.content; else if (token.type == "xml-processing") { // see if this opens a PHP block for (var i = 0; i < processingInstructions.length; i++) if (processingInstructions[i] == token.content) { iter.next = local(PHPParser, "?>"); break; } } else if (token.style == "xml-attribute" && token.content == "\"php\"" && inTag == "script" && lastAtt == "language") inTag = "script/php"; // "xml-processing" tokens are ignored, because they should be handled by a specific local parser else if (token.content == ">") { if (inTag == "script/php") iter.next = local(PHPParser, "</script>"); else if (inTag == "script") iter.next = local(JSParser, "</script"); else if (inTag == "style") iter.next = local(CSSParser, "</style"); lastAtt = null; inTag = false; } return token; } function local(parser, tag) { var baseIndent = htmlParser.indentation(); if (parser == PHPParser && phpParserState) localParser = phpParserState(stream); else localParser = parser.make(stream, baseIndent + indentUnit); return function() { if (stream.lookAhead(tag, false, false, true)) { if (parser == PHPParser) phpParserState = localParser.copy(); localParser = null; iter.next = top; return top(); // pass the ending tag to the enclosing parser } var token = localParser.next(); var lt = token.value.lastIndexOf("<"), sz = Math.min(token.value.length - lt, tag.length); if (lt != -1 && token.value.slice(lt, lt + sz).toLowerCase() == tag.slice(0, sz) && stream.lookAhead(tag.slice(sz), false, false, true)) { stream.push(token.value.slice(lt)); token.value = token.value.slice(0, lt); } if (token.indentation) { var oldIndent = token.indentation; token.indentation = function(chars) { if (chars == "</") return baseIndent; else return oldIndent(chars); } } return token; }; } function copy() { var _html = htmlParser.copy(), _local = localParser && localParser.copy(), _next = iter.next, _inTag = inTag, _lastAtt = lastAtt, _php = phpParserState; return function(_stream) { stream = _stream; htmlParser = _html(_stream); localParser = _local && _local(_stream); phpParserState = _php; iter.next = _next; inTag = _inTag; lastAtt = _lastAtt; return iter; }; } return iter; } return { make: parseMixed, electricChars: "{}/:", configure: function(conf) { if (conf.opening != null) processingInstructions = conf.opening; } }; })();
JavaScript
/* Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. The copyrights embodied in the content of this file are licensed by Yahoo! Inc. under the BSD (revised) open source license @author Vlad Dan Dascalescu <dandv@yahoo-inc.com> Tokenizer for PHP code References: + http://php.net/manual/en/reserved.php + http://php.net/tokens + get_defined_constants(), get_defined_functions(), get_declared_classes() executed on a realistic (not vanilla) PHP installation with typical LAMP modules. Specifically, the PHP bundled with the Uniform Web Server (www.uniformserver.com). */ // add the forEach method for JS engines that don't support it (e.g. IE) // code from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference:Objects:Array:forEach if (!Array.prototype.forEach) { Array.prototype.forEach = function(fun /*, thisp*/) { var len = this.length; if (typeof fun != "function") throw new TypeError(); var thisp = arguments[1]; for (var i = 0; i < len; i++) { if (i in this) fun.call(thisp, this[i], i, this); } }; } var tokenizePHP = (function() { /* A map of PHP's reserved words (keywords, predefined classes, functions and constants. Each token has a type ('keyword', 'operator' etc.) and a style. The style corresponds to the CSS span class in phpcolors.css. Keywords can be of three types: a - takes an expression and forms a statement - e.g. if b - takes just a statement - e.g. else c - takes an optinoal expression, but no statement - e.g. return This distinction gives the parser enough information to parse correct code correctly (we don't care that much how we parse incorrect code). Reference: http://us.php.net/manual/en/reserved.php */ var keywords = function(){ function token(type, style){ return {type: type, style: style}; } var result = {}; // for each(var element in ["...", "..."]) can pick up elements added to // Array.prototype, so we'll use the loop structure below. See also // http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each...in // keywords that take an expression and form a statement ["if", "elseif", "while", "declare"].forEach(function(element, index, array) { result[element] = token("keyword a", "php-keyword"); }); // keywords that take just a statement ["do", "else", "try" ].forEach(function(element, index, array) { result[element] = token("keyword b", "php-keyword"); }); // keywords that take an optional expression, but no statement ["return", "break", "continue", // the expression is optional "new", "clone", "throw" // the expression is mandatory ].forEach(function(element, index, array) { result[element] = token("keyword c", "php-keyword"); }); ["__CLASS__", "__DIR__", "__FILE__", "__FUNCTION__", "__METHOD__", "__NAMESPACE__"].forEach(function(element, index, array) { result[element] = token("atom", "php-compile-time-constant"); }); ["true", "false", "null"].forEach(function(element, index, array) { result[element] = token("atom", "php-atom"); }); ["and", "or", "xor", "instanceof"].forEach(function(element, index, array) { result[element] = token("operator", "php-keyword php-operator"); }); ["class", "interface"].forEach(function(element, index, array) { result[element] = token("class", "php-keyword"); }); ["namespace", "use", "extends", "implements"].forEach(function(element, index, array) { result[element] = token("namespace", "php-keyword"); }); // reserved "language constructs"... http://php.net/manual/en/reserved.php [ "die", "echo", "empty", "exit", "eval", "include", "include_once", "isset", "list", "require", "require_once", "return", "print", "unset", "array" // a keyword rather, but mandates a parenthesized parameter list ].forEach(function(element, index, array) { result[element] = token("t_string", "php-reserved-language-construct"); }); result["switch"] = token("switch", "php-keyword"); result["case"] = token("case", "php-keyword"); result["default"] = token("default", "php-keyword"); result["catch"] = token("catch", "php-keyword"); result["function"] = token("function", "php-keyword"); // http://php.net/manual/en/control-structures.alternative-syntax.php must be followed by a ':' ["endif", "endwhile", "endfor", "endforeach", "endswitch", "enddeclare"].forEach(function(element, index, array) { result[element] = token("altsyntaxend", "php-keyword"); }); result["const"] = token("const", "php-keyword"); ["final", "private", "protected", "public", "global", "static"].forEach(function(element, index, array) { result[element] = token("modifier", "php-keyword"); }); result["var"] = token("modifier", "php-keyword deprecated"); result["abstract"] = token("abstract", "php-keyword"); result["foreach"] = token("foreach", "php-keyword"); result["as"] = token("as", "php-keyword"); result["for"] = token("for", "php-keyword"); // PHP built-in functions - output of get_defined_functions()["internal"] [ "zend_version", "func_num_args", "func_get_arg", "func_get_args", "strlen", "strcmp", "strncmp", "strcasecmp", "strncasecmp", "each", "error_reporting", "define", "defined", "get_class", "get_parent_class", "method_exists", "property_exists", "class_exists", "interface_exists", "function_exists", "get_included_files", "get_required_files", "is_subclass_of", "is_a", "get_class_vars", "get_object_vars", "get_class_methods", "trigger_error", "user_error", "set_error_handler", "restore_error_handler", "set_exception_handler", "restore_exception_handler", "get_declared_classes", "get_declared_interfaces", "get_defined_functions", "get_defined_vars", "create_function", "get_resource_type", "get_loaded_extensions", "extension_loaded", "get_extension_funcs", "get_defined_constants", "debug_backtrace", "debug_print_backtrace", "bcadd", "bcsub", "bcmul", "bcdiv", "bcmod", "bcpow", "bcsqrt", "bcscale", "bccomp", "bcpowmod", "jdtogregorian", "gregoriantojd", "jdtojulian", "juliantojd", "jdtojewish", "jewishtojd", "jdtofrench", "frenchtojd", "jddayofweek", "jdmonthname", "easter_date", "easter_days", "unixtojd", "jdtounix", "cal_to_jd", "cal_from_jd", "cal_days_in_month", "cal_info", "variant_set", "variant_add", "variant_cat", "variant_sub", "variant_mul", "variant_and", "variant_div", "variant_eqv", "variant_idiv", "variant_imp", "variant_mod", "variant_or", "variant_pow", "variant_xor", "variant_abs", "variant_fix", "variant_int", "variant_neg", "variant_not", "variant_round", "variant_cmp", "variant_date_to_timestamp", "variant_date_from_timestamp", "variant_get_type", "variant_set_type", "variant_cast", "com_create_guid", "com_event_sink", "com_print_typeinfo", "com_message_pump", "com_load_typelib", "com_get_active_object", "ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit", "ctype_lower", "ctype_graph", "ctype_print", "ctype_punct", "ctype_space", "ctype_upper", "ctype_xdigit", "strtotime", "date", "idate", "gmdate", "mktime", "gmmktime", "checkdate", "strftime", "gmstrftime", "time", "localtime", "getdate", "date_create", "date_parse", "date_format", "date_modify", "date_timezone_get", "date_timezone_set", "date_offset_get", "date_time_set", "date_date_set", "date_isodate_set", "timezone_open", "timezone_name_get", "timezone_name_from_abbr", "timezone_offset_get", "timezone_transitions_get", "timezone_identifiers_list", "timezone_abbreviations_list", "date_default_timezone_set", "date_default_timezone_get", "date_sunrise", "date_sunset", "date_sun_info", "filter_input", "filter_var", "filter_input_array", "filter_var_array", "filter_list", "filter_has_var", "filter_id", "ftp_connect", "ftp_login", "ftp_pwd", "ftp_cdup", "ftp_chdir", "ftp_exec", "ftp_raw", "ftp_mkdir", "ftp_rmdir", "ftp_chmod", "ftp_alloc", "ftp_nlist", "ftp_rawlist", "ftp_systype", "ftp_pasv", "ftp_get", "ftp_fget", "ftp_put", "ftp_fput", "ftp_size", "ftp_mdtm", "ftp_rename", "ftp_delete", "ftp_site", "ftp_close", "ftp_set_option", "ftp_get_option", "ftp_nb_fget", "ftp_nb_get", "ftp_nb_continue", "ftp_nb_put", "ftp_nb_fput", "ftp_quit", "hash", "hash_file", "hash_hmac", "hash_hmac_file", "hash_init", "hash_update", "hash_update_stream", "hash_update_file", "hash_final", "hash_algos", "iconv", "ob_iconv_handler", "iconv_get_encoding", "iconv_set_encoding", "iconv_strlen", "iconv_substr", "iconv_strpos", "iconv_strrpos", "iconv_mime_encode", "iconv_mime_decode", "iconv_mime_decode_headers", "json_encode", "json_decode", "odbc_autocommit", "odbc_binmode", "odbc_close", "odbc_close_all", "odbc_columns", "odbc_commit", "odbc_connect", "odbc_cursor", "odbc_data_source", "odbc_execute", "odbc_error", "odbc_errormsg", "odbc_exec", "odbc_fetch_array", "odbc_fetch_object", "odbc_fetch_row", "odbc_fetch_into", "odbc_field_len", "odbc_field_scale", "odbc_field_name", "odbc_field_type", "odbc_field_num", "odbc_free_result", "odbc_gettypeinfo", "odbc_longreadlen", "odbc_next_result", "odbc_num_fields", "odbc_num_rows", "odbc_pconnect", "odbc_prepare", "odbc_result", "odbc_result_all", "odbc_rollback", "odbc_setoption", "odbc_specialcolumns", "odbc_statistics", "odbc_tables", "odbc_primarykeys", "odbc_columnprivileges", "odbc_tableprivileges", "odbc_foreignkeys", "odbc_procedures", "odbc_procedurecolumns", "odbc_do", "odbc_field_precision", "preg_match", "preg_match_all", "preg_replace", "preg_replace_callback", "preg_split", "preg_quote", "preg_grep", "preg_last_error", "session_name", "session_module_name", "session_save_path", "session_id", "session_regenerate_id", "session_decode", "session_register", "session_unregister", "session_is_registered", "session_encode", "session_start", "session_destroy", "session_unset", "session_set_save_handler", "session_cache_limiter", "session_cache_expire", "session_set_cookie_params", "session_get_cookie_params", "session_write_close", "session_commit", "spl_classes", "spl_autoload", "spl_autoload_extensions", "spl_autoload_register", "spl_autoload_unregister", "spl_autoload_functions", "spl_autoload_call", "class_parents", "class_implements", "spl_object_hash", "iterator_to_array", "iterator_count", "iterator_apply", "constant", "bin2hex", "sleep", "usleep", "flush", "wordwrap", "htmlspecialchars", "htmlentities", "html_entity_decode", "htmlspecialchars_decode", "get_html_translation_table", "sha1", "sha1_file", "md5", "md5_file", "crc32", "iptcparse", "iptcembed", "getimagesize", "image_type_to_mime_type", "image_type_to_extension", "phpinfo", "phpversion", "phpcredits", "php_logo_guid", "php_real_logo_guid", "php_egg_logo_guid", "zend_logo_guid", "php_sapi_name", "php_uname", "php_ini_scanned_files", "strnatcmp", "strnatcasecmp", "substr_count", "strspn", "strcspn", "strtok", "strtoupper", "strtolower", "strpos", "stripos", "strrpos", "strripos", "strrev", "hebrev", "hebrevc", "nl2br", "basename", "dirname", "pathinfo", "stripslashes", "stripcslashes", "strstr", "stristr", "strrchr", "str_shuffle", "str_word_count", "str_split", "strpbrk", "substr_compare", "strcoll", "substr", "substr_replace", "quotemeta", "ucfirst", "ucwords", "strtr", "addslashes", "addcslashes", "rtrim", "str_replace", "str_ireplace", "str_repeat", "count_chars", "chunk_split", "trim", "ltrim", "strip_tags", "similar_text", "explode", "implode", "setlocale", "localeconv", "soundex", "levenshtein", "chr", "ord", "parse_str", "str_pad", "chop", "strchr", "sprintf", "printf", "vprintf", "vsprintf", "fprintf", "vfprintf", "sscanf", "fscanf", "parse_url", "urlencode", "urldecode", "rawurlencode", "rawurldecode", "http_build_query", "unlink", "exec", "system", "escapeshellcmd", "escapeshellarg", "passthru", "shell_exec", "proc_open", "proc_close", "proc_terminate", "proc_get_status", "rand", "srand", "getrandmax", "mt_rand", "mt_srand", "mt_getrandmax", "getservbyname", "getservbyport", "getprotobyname", "getprotobynumber", "getmyuid", "getmygid", "getmypid", "getmyinode", "getlastmod", "base64_decode", "base64_encode", "convert_uuencode", "convert_uudecode", "abs", "ceil", "floor", "round", "sin", "cos", "tan", "asin", "acos", "atan", "atan2", "sinh", "cosh", "tanh", "pi", "is_finite", "is_nan", "is_infinite", "pow", "exp", "log", "log10", "sqrt", "hypot", "deg2rad", "rad2deg", "bindec", "hexdec", "octdec", "decbin", "decoct", "dechex", "base_convert", "number_format", "fmod", "ip2long", "long2ip", "getenv", "putenv", "microtime", "gettimeofday", "uniqid", "quoted_printable_decode", "convert_cyr_string", "get_current_user", "set_time_limit", "get_cfg_var", "magic_quotes_runtime", "set_magic_quotes_runtime", "get_magic_quotes_gpc", "get_magic_quotes_runtime", "import_request_variables", "error_log", "error_get_last", "call_user_func", "call_user_func_array", "call_user_method", "call_user_method_array", "serialize", "unserialize", "var_dump", "var_export", "debug_zval_dump", "print_r", "memory_get_usage", "memory_get_peak_usage", "register_shutdown_function", "register_tick_function", "unregister_tick_function", "highlight_file", "show_source", "highlight_string", "php_strip_whitespace", "ini_get", "ini_get_all", "ini_set", "ini_alter", "ini_restore", "get_include_path", "set_include_path", "restore_include_path", "setcookie", "setrawcookie", "header", "headers_sent", "headers_list", "connection_aborted", "connection_status", "ignore_user_abort", "parse_ini_file", "is_uploaded_file", "move_uploaded_file", "gethostbyaddr", "gethostbyname", "gethostbynamel", "intval", "floatval", "doubleval", "strval", "gettype", "settype", "is_null", "is_resource", "is_bool", "is_long", "is_float", "is_int", "is_integer", "is_double", "is_real", "is_numeric", "is_string", "is_array", "is_object", "is_scalar", "is_callable", "ereg", "ereg_replace", "eregi", "eregi_replace", "split", "spliti", "join", "sql_regcase", "dl", "pclose", "popen", "readfile", "rewind", "rmdir", "umask", "fclose", "feof", "fgetc", "fgets", "fgetss", "fread", "fopen", "fpassthru", "ftruncate", "fstat", "fseek", "ftell", "fflush", "fwrite", "fputs", "mkdir", "rename", "copy", "tempnam", "tmpfile", "file", "file_get_contents", "file_put_contents", "stream_select", "stream_context_create", "stream_context_set_params", "stream_context_set_option", "stream_context_get_options", "stream_context_get_default", "stream_filter_prepend", "stream_filter_append", "stream_filter_remove", "stream_socket_client", "stream_socket_server", "stream_socket_accept", "stream_socket_get_name", "stream_socket_recvfrom", "stream_socket_sendto", "stream_socket_enable_crypto", "stream_socket_shutdown", "stream_copy_to_stream", "stream_get_contents", "fgetcsv", "fputcsv", "flock", "get_meta_tags", "stream_set_write_buffer", "set_file_buffer", "set_socket_blocking", "stream_set_blocking", "socket_set_blocking", "stream_get_meta_data", "stream_get_line", "stream_wrapper_register", "stream_register_wrapper", "stream_wrapper_unregister", "stream_wrapper_restore", "stream_get_wrappers", "stream_get_transports", "get_headers", "stream_set_timeout", "socket_set_timeout", "socket_get_status", "realpath", "fsockopen", "pfsockopen", "pack", "unpack", "get_browser", "crypt", "opendir", "closedir", "chdir", "getcwd", "rewinddir", "readdir", "dir", "scandir", "glob", "fileatime", "filectime", "filegroup", "fileinode", "filemtime", "fileowner", "fileperms", "filesize", "filetype", "file_exists", "is_writable", "is_writeable", "is_readable", "is_executable", "is_file", "is_dir", "is_link", "stat", "lstat", "chown", "chgrp", "chmod", "touch", "clearstatcache", "disk_total_space", "disk_free_space", "diskfreespace", "mail", "ezmlm_hash", "openlog", "syslog", "closelog", "define_syslog_variables", "lcg_value", "metaphone", "ob_start", "ob_flush", "ob_clean", "ob_end_flush", "ob_end_clean", "ob_get_flush", "ob_get_clean", "ob_get_length", "ob_get_level", "ob_get_status", "ob_get_contents", "ob_implicit_flush", "ob_list_handlers", "ksort", "krsort", "natsort", "natcasesort", "asort", "arsort", "sort", "rsort", "usort", "uasort", "uksort", "shuffle", "array_walk", "array_walk_recursive", "count", "end", "prev", "next", "reset", "current", "key", "min", "max", "in_array", "array_search", "extract", "compact", "array_fill", "array_fill_keys", "range", "array_multisort", "array_push", "array_pop", "array_shift", "array_unshift", "array_splice", "array_slice", "array_merge", "array_merge_recursive", "array_keys", "array_values", "array_count_values", "array_reverse", "array_reduce", "array_pad", "array_flip", "array_change_key_case", "array_rand", "array_unique", "array_intersect", "array_intersect_key", "array_intersect_ukey", "array_uintersect", "array_intersect_assoc", "array_uintersect_assoc", "array_intersect_uassoc", "array_uintersect_uassoc", "array_diff", "array_diff_key", "array_diff_ukey", "array_udiff", "array_diff_assoc", "array_udiff_assoc", "array_diff_uassoc", "array_udiff_uassoc", "array_sum", "array_product", "array_filter", "array_map", "array_chunk", "array_combine", "array_key_exists", "pos", "sizeof", "key_exists", "assert", "assert_options", "version_compare", "str_rot13", "stream_get_filters", "stream_filter_register", "stream_bucket_make_writeable", "stream_bucket_prepend", "stream_bucket_append", "stream_bucket_new", "output_add_rewrite_var", "output_reset_rewrite_vars", "sys_get_temp_dir", "token_get_all", "token_name", "readgzfile", "gzrewind", "gzclose", "gzeof", "gzgetc", "gzgets", "gzgetss", "gzread", "gzopen", "gzpassthru", "gzseek", "gztell", "gzwrite", "gzputs", "gzfile", "gzcompress", "gzuncompress", "gzdeflate", "gzinflate", "gzencode", "ob_gzhandler", "zlib_get_coding_type", "libxml_set_streams_context", "libxml_use_internal_errors", "libxml_get_last_error", "libxml_clear_errors", "libxml_get_errors", "dom_import_simplexml", "simplexml_load_file", "simplexml_load_string", "simplexml_import_dom", "wddx_serialize_value", "wddx_serialize_vars", "wddx_packet_start", "wddx_packet_end", "wddx_add_vars", "wddx_deserialize", "xml_parser_create", "xml_parser_create_ns", "xml_set_object", "xml_set_element_handler", "xml_set_character_data_handler", "xml_set_processing_instruction_handler", "xml_set_default_handler", "xml_set_unparsed_entity_decl_handler", "xml_set_notation_decl_handler", "xml_set_external_entity_ref_handler", "xml_set_start_namespace_decl_handler", "xml_set_end_namespace_decl_handler", "xml_parse", "xml_parse_into_struct", "xml_get_error_code", "xml_error_string", "xml_get_current_line_number", "xml_get_current_column_number", "xml_get_current_byte_index", "xml_parser_free", "xml_parser_set_option", "xml_parser_get_option", "utf8_encode", "utf8_decode", "xmlwriter_open_uri", "xmlwriter_open_memory", "xmlwriter_set_indent", "xmlwriter_set_indent_string", "xmlwriter_start_comment", "xmlwriter_end_comment", "xmlwriter_start_attribute", "xmlwriter_end_attribute", "xmlwriter_write_attribute", "xmlwriter_start_attribute_ns", "xmlwriter_write_attribute_ns", "xmlwriter_start_element", "xmlwriter_end_element", "xmlwriter_full_end_element", "xmlwriter_start_element_ns", "xmlwriter_write_element", "xmlwriter_write_element_ns", "xmlwriter_start_pi", "xmlwriter_end_pi", "xmlwriter_write_pi", "xmlwriter_start_cdata", "xmlwriter_end_cdata", "xmlwriter_write_cdata", "xmlwriter_text", "xmlwriter_write_raw", "xmlwriter_start_document", "xmlwriter_end_document", "xmlwriter_write_comment", "xmlwriter_start_dtd", "xmlwriter_end_dtd", "xmlwriter_write_dtd", "xmlwriter_start_dtd_element", "xmlwriter_end_dtd_element", "xmlwriter_write_dtd_element", "xmlwriter_start_dtd_attlist", "xmlwriter_end_dtd_attlist", "xmlwriter_write_dtd_attlist", "xmlwriter_start_dtd_entity", "xmlwriter_end_dtd_entity", "xmlwriter_write_dtd_entity", "xmlwriter_output_memory", "xmlwriter_flush", "gd_info", "imagearc", "imageellipse", "imagechar", "imagecharup", "imagecolorat", "imagecolorallocate", "imagepalettecopy", "imagecreatefromstring", "imagecolorclosest", "imagecolordeallocate", "imagecolorresolve", "imagecolorexact", "imagecolorset", "imagecolortransparent", "imagecolorstotal", "imagecolorsforindex", "imagecopy", "imagecopymerge", "imagecopymergegray", "imagecopyresized", "imagecreate", "imagecreatetruecolor", "imageistruecolor", "imagetruecolortopalette", "imagesetthickness", "imagefilledarc", "imagefilledellipse", "imagealphablending", "imagesavealpha", "imagecolorallocatealpha", "imagecolorresolvealpha", "imagecolorclosestalpha", "imagecolorexactalpha", "imagecopyresampled", "imagegrabwindow", "imagegrabscreen", "imagerotate", "imageantialias", "imagesettile", "imagesetbrush", "imagesetstyle", "imagecreatefrompng", "imagecreatefromgif", "imagecreatefromjpeg", "imagecreatefromwbmp", "imagecreatefromxbm", "imagecreatefromgd", "imagecreatefromgd2", "imagecreatefromgd2part", "imagepng", "imagegif", "imagejpeg", "imagewbmp", "imagegd", "imagegd2", "imagedestroy", "imagegammacorrect", "imagefill", "imagefilledpolygon", "imagefilledrectangle", "imagefilltoborder", "imagefontwidth", "imagefontheight", "imageinterlace", "imageline", "imageloadfont", "imagepolygon", "imagerectangle", "imagesetpixel", "imagestring", "imagestringup", "imagesx", "imagesy", "imagedashedline", "imagettfbbox", "imagettftext", "imageftbbox", "imagefttext", "imagepsloadfont", "imagepsfreefont", "imagepsencodefont", "imagepsextendfont", "imagepsslantfont", "imagepstext", "imagepsbbox", "imagetypes", "jpeg2wbmp", "png2wbmp", "image2wbmp", "imagelayereffect", "imagecolormatch", "imagexbm", "imagefilter", "imageconvolution", "mb_convert_case", "mb_strtoupper", "mb_strtolower", "mb_language", "mb_internal_encoding", "mb_http_input", "mb_http_output", "mb_detect_order", "mb_substitute_character", "mb_parse_str", "mb_output_handler", "mb_preferred_mime_name", "mb_strlen", "mb_strpos", "mb_strrpos", "mb_stripos", "mb_strripos", "mb_strstr", "mb_strrchr", "mb_stristr", "mb_strrichr", "mb_substr_count", "mb_substr", "mb_strcut", "mb_strwidth", "mb_strimwidth", "mb_convert_encoding", "mb_detect_encoding", "mb_list_encodings", "mb_convert_kana", "mb_encode_mimeheader", "mb_decode_mimeheader", "mb_convert_variables", "mb_encode_numericentity", "mb_decode_numericentity", "mb_send_mail", "mb_get_info", "mb_check_encoding", "mb_regex_encoding", "mb_regex_set_options", "mb_ereg", "mb_eregi", "mb_ereg_replace", "mb_eregi_replace", "mb_split", "mb_ereg_match", "mb_ereg_search", "mb_ereg_search_pos", "mb_ereg_search_regs", "mb_ereg_search_init", "mb_ereg_search_getregs", "mb_ereg_search_getpos", "mb_ereg_search_setpos", "mbregex_encoding", "mbereg", "mberegi", "mbereg_replace", "mberegi_replace", "mbsplit", "mbereg_match", "mbereg_search", "mbereg_search_pos", "mbereg_search_regs", "mbereg_search_init", "mbereg_search_getregs", "mbereg_search_getpos", "mbereg_search_setpos", "mysql_connect", "mysql_pconnect", "mysql_close", "mysql_select_db", "mysql_query", "mysql_unbuffered_query", "mysql_db_query", "mysql_list_dbs", "mysql_list_tables", "mysql_list_fields", "mysql_list_processes", "mysql_error", "mysql_errno", "mysql_affected_rows", "mysql_insert_id", "mysql_result", "mysql_num_rows", "mysql_num_fields", "mysql_fetch_row", "mysql_fetch_array", "mysql_fetch_assoc", "mysql_fetch_object", "mysql_data_seek", "mysql_fetch_lengths", "mysql_fetch_field", "mysql_field_seek", "mysql_free_result", "mysql_field_name", "mysql_field_table", "mysql_field_len", "mysql_field_type", "mysql_field_flags", "mysql_escape_string", "mysql_real_escape_string", "mysql_stat", "mysql_thread_id", "mysql_client_encoding", "mysql_ping", "mysql_get_client_info", "mysql_get_host_info", "mysql_get_proto_info", "mysql_get_server_info", "mysql_info", "mysql_set_charset", "mysql", "mysql_fieldname", "mysql_fieldtable", "mysql_fieldlen", "mysql_fieldtype", "mysql_fieldflags", "mysql_selectdb", "mysql_freeresult", "mysql_numfields", "mysql_numrows", "mysql_listdbs", "mysql_listtables", "mysql_listfields", "mysql_db_name", "mysql_dbname", "mysql_tablename", "mysql_table_name", "mysqli_affected_rows", "mysqli_autocommit", "mysqli_change_user", "mysqli_character_set_name", "mysqli_close", "mysqli_commit", "mysqli_connect", "mysqli_connect_errno", "mysqli_connect_error", "mysqli_data_seek", "mysqli_debug", "mysqli_disable_reads_from_master", "mysqli_disable_rpl_parse", "mysqli_dump_debug_info", "mysqli_enable_reads_from_master", "mysqli_enable_rpl_parse", "mysqli_embedded_server_end", "mysqli_embedded_server_start", "mysqli_errno", "mysqli_error", "mysqli_stmt_execute", "mysqli_execute", "mysqli_fetch_field", "mysqli_fetch_fields", "mysqli_fetch_field_direct", "mysqli_fetch_lengths", "mysqli_fetch_array", "mysqli_fetch_assoc", "mysqli_fetch_object", "mysqli_fetch_row", "mysqli_field_count", "mysqli_field_seek", "mysqli_field_tell", "mysqli_free_result", "mysqli_get_charset", "mysqli_get_client_info", "mysqli_get_client_version", "mysqli_get_host_info", "mysqli_get_proto_info", "mysqli_get_server_info", "mysqli_get_server_version", "mysqli_get_warnings", "mysqli_init", "mysqli_info", "mysqli_insert_id", "mysqli_kill", "mysqli_set_local_infile_default", "mysqli_set_local_infile_handler", "mysqli_master_query", "mysqli_more_results", "mysqli_multi_query", "mysqli_next_result", "mysqli_num_fields", "mysqli_num_rows", "mysqli_options", "mysqli_ping", "mysqli_prepare", "mysqli_report", "mysqli_query", "mysqli_real_connect", "mysqli_real_escape_string", "mysqli_real_query", "mysqli_rollback", "mysqli_rpl_parse_enabled", "mysqli_rpl_probe", "mysqli_rpl_query_type", "mysqli_select_db", "mysqli_set_charset", "mysqli_stmt_attr_get", "mysqli_stmt_attr_set", "mysqli_stmt_field_count", "mysqli_stmt_init", "mysqli_stmt_prepare", "mysqli_stmt_result_metadata", "mysqli_stmt_send_long_data", "mysqli_stmt_bind_param", "mysqli_stmt_bind_result", "mysqli_stmt_fetch", "mysqli_stmt_free_result", "mysqli_stmt_get_warnings", "mysqli_stmt_insert_id", "mysqli_stmt_reset", "mysqli_stmt_param_count", "mysqli_send_query", "mysqli_slave_query", "mysqli_sqlstate", "mysqli_ssl_set", "mysqli_stat", "mysqli_stmt_affected_rows", "mysqli_stmt_close", "mysqli_stmt_data_seek", "mysqli_stmt_errno", "mysqli_stmt_error", "mysqli_stmt_num_rows", "mysqli_stmt_sqlstate", "mysqli_store_result", "mysqli_stmt_store_result", "mysqli_thread_id", "mysqli_thread_safe", "mysqli_use_result", "mysqli_warning_count", "mysqli_bind_param", "mysqli_bind_result", "mysqli_client_encoding", "mysqli_escape_string", "mysqli_fetch", "mysqli_param_count", "mysqli_get_metadata", "mysqli_send_long_data", "mysqli_set_opt", "pdo_drivers", "socket_select", "socket_create", "socket_create_listen", "socket_accept", "socket_set_nonblock", "socket_set_block", "socket_listen", "socket_close", "socket_write", "socket_read", "socket_getsockname", "socket_getpeername", "socket_connect", "socket_strerror", "socket_bind", "socket_recv", "socket_send", "socket_recvfrom", "socket_sendto", "socket_get_option", "socket_set_option", "socket_shutdown", "socket_last_error", "socket_clear_error", "socket_getopt", "socket_setopt", "eaccelerator_put", "eaccelerator_get", "eaccelerator_rm", "eaccelerator_gc", "eaccelerator_lock", "eaccelerator_unlock", "eaccelerator_caching", "eaccelerator_optimizer", "eaccelerator_clear", "eaccelerator_clean", "eaccelerator_info", "eaccelerator_purge", "eaccelerator_cached_scripts", "eaccelerator_removed_scripts", "eaccelerator_list_keys", "eaccelerator_encode", "eaccelerator_load", "_eaccelerator_loader_file", "_eaccelerator_loader_line", "eaccelerator_set_session_handlers", "_eaccelerator_output_handler", "eaccelerator_cache_page", "eaccelerator_rm_page", "eaccelerator_cache_output", "eaccelerator_cache_result", "xdebug_get_stack_depth", "xdebug_get_function_stack", "xdebug_print_function_stack", "xdebug_get_declared_vars", "xdebug_call_class", "xdebug_call_function", "xdebug_call_file", "xdebug_call_line", "xdebug_var_dump", "xdebug_debug_zval", "xdebug_debug_zval_stdout", "xdebug_enable", "xdebug_disable", "xdebug_is_enabled", "xdebug_break", "xdebug_start_trace", "xdebug_stop_trace", "xdebug_get_tracefile_name", "xdebug_get_profiler_filename", "xdebug_dump_aggr_profiling_data", "xdebug_clear_aggr_profiling_data", "xdebug_memory_usage", "xdebug_peak_memory_usage", "xdebug_time_index", "xdebug_start_error_collection", "xdebug_stop_error_collection", "xdebug_get_collected_errors", "xdebug_start_code_coverage", "xdebug_stop_code_coverage", "xdebug_get_code_coverage", "xdebug_get_function_count", "xdebug_dump_superglobals", "_", /* alias for gettext()*/ "get_called_class","class_alias","gc_collect_cycles","gc_enabled","gc_enable", "gc_disable","date_create_from_format","date_parse_from_format", "date_get_last_errors","date_add","date_sub","date_diff","date_timestamp_set", "date_timestamp_get","timezone_location_get","timezone_version_get", "date_interval_create_from_date_string","date_interval_format", "libxml_disable_entity_loader","openssl_pkey_free","openssl_pkey_new", "openssl_pkey_export","openssl_pkey_export_to_file","openssl_pkey_get_private", "openssl_pkey_get_public","openssl_pkey_get_details","openssl_free_key", "openssl_get_privatekey","openssl_get_publickey","openssl_x509_read", "openssl_x509_free","openssl_x509_parse","openssl_x509_checkpurpose", "openssl_x509_check_private_key","openssl_x509_export","openssl_x509_export_to_file", "openssl_pkcs12_export","openssl_pkcs12_export_to_file","openssl_pkcs12_read", "openssl_csr_new","openssl_csr_export","openssl_csr_export_to_file", "openssl_csr_sign","openssl_csr_get_subject","openssl_csr_get_public_key", "openssl_digest","openssl_encrypt","openssl_decrypt","openssl_cipher_iv_length", "openssl_sign","openssl_verify","openssl_seal","openssl_open","openssl_pkcs7_verify", "openssl_pkcs7_decrypt","openssl_pkcs7_sign","openssl_pkcs7_encrypt", "openssl_private_encrypt","openssl_private_decrypt","openssl_public_encrypt", "openssl_public_decrypt","openssl_get_md_methods","openssl_get_cipher_methods", "openssl_dh_compute_key","openssl_random_pseudo_bytes","openssl_error_string", "preg_filter","bzopen","bzread","bzwrite","bzflush","bzclose","bzerrno", "bzerrstr","bzerror","bzcompress","bzdecompress","curl_init","curl_copy_handle", "curl_version","curl_setopt","curl_setopt_array","curl_exec","curl_getinfo", "curl_error","curl_errno","curl_close","curl_multi_init","curl_multi_add_handle", "curl_multi_remove_handle","curl_multi_select","curl_multi_exec","curl_multi_getcontent", "curl_multi_info_read","curl_multi_close","exif_read_data","read_exif_data", "exif_tagname","exif_thumbnail","exif_imagetype","ftp_ssl_connect", "imagecolorclosesthwb","imagecreatefromxpm","textdomain","gettext","dgettext", "dcgettext","bindtextdomain","ngettext","dngettext","dcngettext", "bind_textdomain_codeset","hash_copy","imap_open","imap_reopen","imap_close", "imap_num_msg","imap_num_recent","imap_headers","imap_headerinfo", "imap_rfc822_parse_headers","imap_rfc822_write_address","imap_rfc822_parse_adrlist", "imap_body","imap_bodystruct","imap_fetchbody","imap_savebody","imap_fetchheader", "imap_fetchstructure","imap_gc","imap_expunge","imap_delete","imap_undelete", "imap_check","imap_listscan","imap_mail_copy","imap_mail_move","imap_mail_compose", "imap_createmailbox","imap_renamemailbox","imap_deletemailbox","imap_subscribe", "imap_unsubscribe","imap_append","imap_ping","imap_base64","imap_qprint","imap_8bit", "imap_binary","imap_utf8","imap_status","imap_mailboxmsginfo","imap_setflag_full", "imap_clearflag_full","imap_sort","imap_uid","imap_msgno","imap_list","imap_lsub", "imap_fetch_overview","imap_alerts","imap_errors","imap_last_error","imap_search", "imap_utf7_decode","imap_utf7_encode","imap_mime_header_decode","imap_thread", "imap_timeout","imap_get_quota","imap_get_quotaroot","imap_set_quota","imap_setacl", "imap_getacl","imap_mail","imap_header","imap_listmailbox","imap_getmailboxes", "imap_scanmailbox","imap_listsubscribed","imap_getsubscribed","imap_fetchtext", "imap_scan","imap_create","imap_rename","json_last_error","mb_encoding_aliases", "mcrypt_ecb","mcrypt_cbc","mcrypt_cfb","mcrypt_ofb","mcrypt_get_key_size", "mcrypt_get_block_size","mcrypt_get_cipher_name","mcrypt_create_iv","mcrypt_list_algorithms", "mcrypt_list_modes","mcrypt_get_iv_size","mcrypt_encrypt","mcrypt_decrypt", "mcrypt_module_open","mcrypt_generic_init","mcrypt_generic","mdecrypt_generic", "mcrypt_generic_end","mcrypt_generic_deinit","mcrypt_enc_self_test", "mcrypt_enc_is_block_algorithm_mode","mcrypt_enc_is_block_algorithm", "mcrypt_enc_is_block_mode","mcrypt_enc_get_block_size","mcrypt_enc_get_key_size", "mcrypt_enc_get_supported_key_sizes","mcrypt_enc_get_iv_size", "mcrypt_enc_get_algorithms_name","mcrypt_enc_get_modes_name","mcrypt_module_self_test", "mcrypt_module_is_block_algorithm_mode","mcrypt_module_is_block_algorithm", "mcrypt_module_is_block_mode","mcrypt_module_get_algo_block_size", "mcrypt_module_get_algo_key_size","mcrypt_module_get_supported_key_sizes", "mcrypt_module_close","mysqli_refresh","posix_kill","posix_getpid","posix_getppid", "posix_getuid","posix_setuid","posix_geteuid","posix_seteuid","posix_getgid", "posix_setgid","posix_getegid","posix_setegid","posix_getgroups","posix_getlogin", "posix_getpgrp","posix_setsid","posix_setpgid","posix_getpgid","posix_getsid", "posix_uname","posix_times","posix_ctermid","posix_ttyname","posix_isatty", "posix_getcwd","posix_mkfifo","posix_mknod","posix_access","posix_getgrnam", "posix_getgrgid","posix_getpwnam","posix_getpwuid","posix_getrlimit", "posix_get_last_error","posix_errno","posix_strerror","posix_initgroups", "pspell_new","pspell_new_personal","pspell_new_config","pspell_check", "pspell_suggest","pspell_store_replacement","pspell_add_to_personal", "pspell_add_to_session","pspell_clear_session","pspell_save_wordlist", "pspell_config_create","pspell_config_runtogether","pspell_config_mode", "pspell_config_ignore","pspell_config_personal","pspell_config_dict_dir", "pspell_config_data_dir","pspell_config_repl","pspell_config_save_repl", "snmpget","snmpgetnext","snmpwalk","snmprealwalk","snmpwalkoid", "snmp_get_quick_print","snmp_set_quick_print","snmp_set_enum_print", "snmp_set_oid_output_format","snmp_set_oid_numeric_print","snmpset", "snmp2_get","snmp2_getnext","snmp2_walk","snmp2_real_walk","snmp2_set", "snmp3_get","snmp3_getnext","snmp3_walk","snmp3_real_walk","snmp3_set", "snmp_set_valueretrieval","snmp_get_valueretrieval","snmp_read_mib", "use_soap_error_handler","is_soap_fault","socket_create_pair","time_nanosleep", "time_sleep_until","strptime","php_ini_loaded_file","money_format","lcfirst", "nl_langinfo","str_getcsv","readlink","linkinfo","symlink","link","proc_nice", "atanh","asinh","acosh","expm1","log1p","inet_ntop","inet_pton","getopt", "sys_getloadavg","getrusage","quoted_printable_encode","forward_static_call", "forward_static_call_array","header_remove","parse_ini_string","gethostname", "dns_check_record","checkdnsrr","dns_get_mx","getmxrr","dns_get_record", "stream_context_get_params","stream_context_set_default","stream_socket_pair", "stream_supports_lock","stream_set_read_buffer","stream_resolve_include_path", "stream_is_local","fnmatch","chroot","lchown","lchgrp","realpath_cache_size", "realpath_cache_get","array_replace","array_replace_recursive","ftok","xmlrpc_encode", "xmlrpc_decode","xmlrpc_decode_request","xmlrpc_encode_request","xmlrpc_get_type", "xmlrpc_set_type","xmlrpc_is_fault","xmlrpc_server_create","xmlrpc_server_destroy", "xmlrpc_server_register_method","xmlrpc_server_call_method", "xmlrpc_parse_method_descriptions","xmlrpc_server_add_introspection_data", "xmlrpc_server_register_introspection_callback","zip_open","zip_close", "zip_read","zip_entry_open","zip_entry_close","zip_entry_read","zip_entry_filesize", "zip_entry_name","zip_entry_compressedsize","zip_entry_compressionmethod", "svn_checkout","svn_cat","svn_ls","svn_log","svn_auth_set_parameter", "svn_auth_get_parameter","svn_client_version","svn_config_ensure","svn_diff", "svn_cleanup","svn_revert","svn_resolved","svn_commit","svn_lock","svn_unlock", "svn_add","svn_status","svn_update","svn_import","svn_info","svn_export", "svn_copy","svn_switch","svn_blame","svn_delete","svn_mkdir","svn_move", "svn_proplist","svn_propget","svn_repos_create","svn_repos_recover", "svn_repos_hotcopy","svn_repos_open","svn_repos_fs", "svn_repos_fs_begin_txn_for_commit","svn_repos_fs_commit_txn", "svn_fs_revision_root","svn_fs_check_path","svn_fs_revision_prop", "svn_fs_dir_entries","svn_fs_node_created_rev","svn_fs_youngest_rev", "svn_fs_file_contents","svn_fs_file_length","svn_fs_txn_root","svn_fs_make_file", "svn_fs_make_dir","svn_fs_apply_text","svn_fs_copy","svn_fs_delete", "svn_fs_begin_txn2","svn_fs_is_dir","svn_fs_is_file","svn_fs_node_prop", "svn_fs_change_node_prop","svn_fs_contents_changed","svn_fs_props_changed", "svn_fs_abort_txn","sqlite_open","sqlite_popen","sqlite_close","sqlite_query", "sqlite_exec","sqlite_array_query","sqlite_single_query","sqlite_fetch_array", "sqlite_fetch_object","sqlite_fetch_single","sqlite_fetch_string", "sqlite_fetch_all","sqlite_current","sqlite_column","sqlite_libversion", "sqlite_libencoding","sqlite_changes","sqlite_last_insert_rowid", "sqlite_num_rows","sqlite_num_fields","sqlite_field_name","sqlite_seek", "sqlite_rewind","sqlite_next","sqlite_prev","sqlite_valid","sqlite_has_more", "sqlite_has_prev","sqlite_escape_string","sqlite_busy_timeout","sqlite_last_error", "sqlite_error_string","sqlite_unbuffered_query","sqlite_create_aggregate", "sqlite_create_function","sqlite_factory","sqlite_udf_encode_binary", "sqlite_udf_decode_binary","sqlite_fetch_column_types" ].forEach(function(element, index, array) { result[element] = token("t_string", "php-predefined-function"); }); // output of get_defined_constants(). Differs significantly from http://php.net/manual/en/reserved.constants.php [ "E_ERROR", "E_RECOVERABLE_ERROR", "E_WARNING", "E_PARSE", "E_NOTICE", "E_STRICT", "E_CORE_ERROR", "E_CORE_WARNING", "E_COMPILE_ERROR", "E_COMPILE_WARNING", "E_USER_ERROR", "E_USER_WARNING", "E_USER_NOTICE", "E_ALL", "TRUE", "FALSE", "NULL", "ZEND_THREAD_SAFE", "PHP_VERSION", "PHP_OS", "PHP_SAPI", "DEFAULT_INCLUDE_PATH", "PEAR_INSTALL_DIR", "PEAR_EXTENSION_DIR", "PHP_EXTENSION_DIR", "PHP_PREFIX", "PHP_BINDIR", "PHP_LIBDIR", "PHP_DATADIR", "PHP_SYSCONFDIR", "PHP_LOCALSTATEDIR", "PHP_CONFIG_FILE_PATH", "PHP_CONFIG_FILE_SCAN_DIR", "PHP_SHLIB_SUFFIX", "PHP_EOL", "PHP_EOL", "PHP_INT_MAX", "PHP_INT_SIZE", "PHP_OUTPUT_HANDLER_START", "PHP_OUTPUT_HANDLER_CONT", "PHP_OUTPUT_HANDLER_END", "UPLOAD_ERR_OK", "UPLOAD_ERR_INI_SIZE", "UPLOAD_ERR_FORM_SIZE", "UPLOAD_ERR_PARTIAL", "UPLOAD_ERR_NO_FILE", "UPLOAD_ERR_NO_TMP_DIR", "UPLOAD_ERR_CANT_WRITE", "UPLOAD_ERR_EXTENSION", "CAL_GREGORIAN", "CAL_JULIAN", "CAL_JEWISH", "CAL_FRENCH", "CAL_NUM_CALS", "CAL_DOW_DAYNO", "CAL_DOW_SHORT", "CAL_DOW_LONG", "CAL_MONTH_GREGORIAN_SHORT", "CAL_MONTH_GREGORIAN_LONG", "CAL_MONTH_JULIAN_SHORT", "CAL_MONTH_JULIAN_LONG", "CAL_MONTH_JEWISH", "CAL_MONTH_FRENCH", "CAL_EASTER_DEFAULT", "CAL_EASTER_ROMAN", "CAL_EASTER_ALWAYS_GREGORIAN", "CAL_EASTER_ALWAYS_JULIAN", "CAL_JEWISH_ADD_ALAFIM_GERESH", "CAL_JEWISH_ADD_ALAFIM", "CAL_JEWISH_ADD_GERESHAYIM", "CLSCTX_INPROC_SERVER", "CLSCTX_INPROC_HANDLER", "CLSCTX_LOCAL_SERVER", "CLSCTX_REMOTE_SERVER", "CLSCTX_SERVER", "CLSCTX_ALL", "VT_NULL", "VT_EMPTY", "VT_UI1", "VT_I1", "VT_UI2", "VT_I2", "VT_UI4", "VT_I4", "VT_R4", "VT_R8", "VT_BOOL", "VT_ERROR", "VT_CY", "VT_DATE", "VT_BSTR", "VT_DECIMAL", "VT_UNKNOWN", "VT_DISPATCH", "VT_VARIANT", "VT_INT", "VT_UINT", "VT_ARRAY", "VT_BYREF", "CP_ACP", "CP_MACCP", "CP_OEMCP", "CP_UTF7", "CP_UTF8", "CP_SYMBOL", "CP_THREAD_ACP", "VARCMP_LT", "VARCMP_EQ", "VARCMP_GT", "VARCMP_NULL", "NORM_IGNORECASE", "NORM_IGNORENONSPACE", "NORM_IGNORESYMBOLS", "NORM_IGNOREWIDTH", "NORM_IGNOREKANATYPE", "DISP_E_DIVBYZERO", "DISP_E_OVERFLOW", "DISP_E_BADINDEX", "MK_E_UNAVAILABLE", "INPUT_POST", "INPUT_GET", "INPUT_COOKIE", "INPUT_ENV", "INPUT_SERVER", "INPUT_SESSION", "INPUT_REQUEST", "FILTER_FLAG_NONE", "FILTER_REQUIRE_SCALAR", "FILTER_REQUIRE_ARRAY", "FILTER_FORCE_ARRAY", "FILTER_NULL_ON_FAILURE", "FILTER_VALIDATE_INT", "FILTER_VALIDATE_BOOLEAN", "FILTER_VALIDATE_FLOAT", "FILTER_VALIDATE_REGEXP", "FILTER_VALIDATE_URL", "FILTER_VALIDATE_EMAIL", "FILTER_VALIDATE_IP", "FILTER_DEFAULT", "FILTER_UNSAFE_RAW", "FILTER_SANITIZE_STRING", "FILTER_SANITIZE_STRIPPED", "FILTER_SANITIZE_ENCODED", "FILTER_SANITIZE_SPECIAL_CHARS", "FILTER_SANITIZE_EMAIL", "FILTER_SANITIZE_URL", "FILTER_SANITIZE_NUMBER_INT", "FILTER_SANITIZE_NUMBER_FLOAT", "FILTER_SANITIZE_MAGIC_QUOTES", "FILTER_CALLBACK", "FILTER_FLAG_ALLOW_OCTAL", "FILTER_FLAG_ALLOW_HEX", "FILTER_FLAG_STRIP_LOW", "FILTER_FLAG_STRIP_HIGH", "FILTER_FLAG_ENCODE_LOW", "FILTER_FLAG_ENCODE_HIGH", "FILTER_FLAG_ENCODE_AMP", "FILTER_FLAG_NO_ENCODE_QUOTES", "FILTER_FLAG_EMPTY_STRING_NULL", "FILTER_FLAG_ALLOW_FRACTION", "FILTER_FLAG_ALLOW_THOUSAND", "FILTER_FLAG_ALLOW_SCIENTIFIC", "FILTER_FLAG_SCHEME_REQUIRED", "FILTER_FLAG_HOST_REQUIRED", "FILTER_FLAG_PATH_REQUIRED", "FILTER_FLAG_QUERY_REQUIRED", "FILTER_FLAG_IPV4", "FILTER_FLAG_IPV6", "FILTER_FLAG_NO_RES_RANGE", "FILTER_FLAG_NO_PRIV_RANGE", "FTP_ASCII", "FTP_TEXT", "FTP_BINARY", "FTP_IMAGE", "FTP_AUTORESUME", "FTP_TIMEOUT_SEC", "FTP_AUTOSEEK", "FTP_FAILED", "FTP_FINISHED", "FTP_MOREDATA", "HASH_HMAC", "ICONV_IMPL", "ICONV_VERSION", "ICONV_MIME_DECODE_STRICT", "ICONV_MIME_DECODE_CONTINUE_ON_ERROR", "ODBC_TYPE", "ODBC_BINMODE_PASSTHRU", "ODBC_BINMODE_RETURN", "ODBC_BINMODE_CONVERT", "SQL_ODBC_CURSORS", "SQL_CUR_USE_DRIVER", "SQL_CUR_USE_IF_NEEDED", "SQL_CUR_USE_ODBC", "SQL_CONCURRENCY", "SQL_CONCUR_READ_ONLY", "SQL_CONCUR_LOCK", "SQL_CONCUR_ROWVER", "SQL_CONCUR_VALUES", "SQL_CURSOR_TYPE", "SQL_CURSOR_FORWARD_ONLY", "SQL_CURSOR_KEYSET_DRIVEN", "SQL_CURSOR_DYNAMIC", "SQL_CURSOR_STATIC", "SQL_KEYSET_SIZE", "SQL_FETCH_FIRST", "SQL_FETCH_NEXT", "SQL_CHAR", "SQL_VARCHAR", "SQL_LONGVARCHAR", "SQL_DECIMAL", "SQL_NUMERIC", "SQL_BIT", "SQL_TINYINT", "SQL_SMALLINT", "SQL_INTEGER", "SQL_BIGINT", "SQL_REAL", "SQL_FLOAT", "SQL_DOUBLE", "SQL_BINARY", "SQL_VARBINARY", "SQL_LONGVARBINARY", "SQL_DATE", "SQL_TIME", "SQL_TIMESTAMP", "PREG_PATTERN_ORDER", "PREG_SET_ORDER", "PREG_OFFSET_CAPTURE", "PREG_SPLIT_NO_EMPTY", "PREG_SPLIT_DELIM_CAPTURE", "PREG_SPLIT_OFFSET_CAPTURE", "PREG_GREP_INVERT", "PREG_NO_ERROR", "PREG_INTERNAL_ERROR", "PREG_BACKTRACK_LIMIT_ERROR", "PREG_RECURSION_LIMIT_ERROR", "PREG_BAD_UTF8_ERROR", "DATE_ATOM", "DATE_COOKIE", "DATE_ISO8601", "DATE_RFC822", "DATE_RFC850", "DATE_RFC1036", "DATE_RFC1123", "DATE_RFC2822", "DATE_RFC3339", "DATE_RSS", "DATE_W3C", "SUNFUNCS_RET_TIMESTAMP", "SUNFUNCS_RET_STRING", "SUNFUNCS_RET_DOUBLE", "LIBXML_VERSION", "LIBXML_DOTTED_VERSION", "LIBXML_NOENT", "LIBXML_DTDLOAD", "LIBXML_DTDATTR", "LIBXML_DTDVALID", "LIBXML_NOERROR", "LIBXML_NOWARNING", "LIBXML_NOBLANKS", "LIBXML_XINCLUDE", "LIBXML_NSCLEAN", "LIBXML_NOCDATA", "LIBXML_NONET", "LIBXML_COMPACT", "LIBXML_NOXMLDECL", "LIBXML_NOEMPTYTAG", "LIBXML_ERR_NONE", "LIBXML_ERR_WARNING", "LIBXML_ERR_ERROR", "LIBXML_ERR_FATAL", "CONNECTION_ABORTED", "CONNECTION_NORMAL", "CONNECTION_TIMEOUT", "INI_USER", "INI_PERDIR", "INI_SYSTEM", "INI_ALL", "PHP_URL_SCHEME", "PHP_URL_HOST", "PHP_URL_PORT", "PHP_URL_USER", "PHP_URL_PASS", "PHP_URL_PATH", "PHP_URL_QUERY", "PHP_URL_FRAGMENT", "M_E", "M_LOG2E", "M_LOG10E", "M_LN2", "M_LN10", "M_PI", "M_PI_2", "M_PI_4", "M_1_PI", "M_2_PI", "M_SQRTPI", "M_2_SQRTPI", "M_LNPI", "M_EULER", "M_SQRT2", "M_SQRT1_2", "M_SQRT3", "INF", "NAN", "INFO_GENERAL", "INFO_CREDITS", "INFO_CONFIGURATION", "INFO_MODULES", "INFO_ENVIRONMENT", "INFO_VARIABLES", "INFO_LICENSE", "INFO_ALL", "CREDITS_GROUP", "CREDITS_GENERAL", "CREDITS_SAPI", "CREDITS_MODULES", "CREDITS_DOCS", "CREDITS_FULLPAGE", "CREDITS_QA", "CREDITS_ALL", "HTML_SPECIALCHARS", "HTML_ENTITIES", "ENT_COMPAT", "ENT_QUOTES", "ENT_NOQUOTES", "STR_PAD_LEFT", "STR_PAD_RIGHT", "STR_PAD_BOTH", "PATHINFO_DIRNAME", "PATHINFO_BASENAME", "PATHINFO_EXTENSION", "PATHINFO_FILENAME", "CHAR_MAX", "LC_CTYPE", "LC_NUMERIC", "LC_TIME", "LC_COLLATE", "LC_MONETARY", "LC_ALL", "SEEK_SET", "SEEK_CUR", "SEEK_END", "LOCK_SH", "LOCK_EX", "LOCK_UN", "LOCK_NB", "STREAM_NOTIFY_CONNECT", "STREAM_NOTIFY_AUTH_REQUIRED", "STREAM_NOTIFY_AUTH_RESULT", "STREAM_NOTIFY_MIME_TYPE_IS", "STREAM_NOTIFY_FILE_SIZE_IS", "STREAM_NOTIFY_REDIRECTED", "STREAM_NOTIFY_PROGRESS", "STREAM_NOTIFY_FAILURE", "STREAM_NOTIFY_COMPLETED", "STREAM_NOTIFY_RESOLVE", "STREAM_NOTIFY_SEVERITY_INFO", "STREAM_NOTIFY_SEVERITY_WARN", "STREAM_NOTIFY_SEVERITY_ERR", "STREAM_FILTER_READ", "STREAM_FILTER_WRITE", "STREAM_FILTER_ALL", "STREAM_CLIENT_PERSISTENT", "STREAM_CLIENT_ASYNC_CONNECT", "STREAM_CLIENT_CONNECT", "STREAM_CRYPTO_METHOD_SSLv2_CLIENT", "STREAM_CRYPTO_METHOD_SSLv3_CLIENT", "STREAM_CRYPTO_METHOD_SSLv23_CLIENT", "STREAM_CRYPTO_METHOD_TLS_CLIENT", "STREAM_CRYPTO_METHOD_SSLv2_SERVER", "STREAM_CRYPTO_METHOD_SSLv3_SERVER", "STREAM_CRYPTO_METHOD_SSLv23_SERVER", "STREAM_CRYPTO_METHOD_TLS_SERVER", "STREAM_SHUT_RD", "STREAM_SHUT_WR", "STREAM_SHUT_RDWR", "STREAM_PF_INET", "STREAM_PF_INET6", "STREAM_PF_UNIX", "STREAM_IPPROTO_IP", "STREAM_IPPROTO_TCP", "STREAM_IPPROTO_UDP", "STREAM_IPPROTO_ICMP", "STREAM_IPPROTO_RAW", "STREAM_SOCK_STREAM", "STREAM_SOCK_DGRAM", "STREAM_SOCK_RAW", "STREAM_SOCK_SEQPACKET", "STREAM_SOCK_RDM", "STREAM_PEEK", "STREAM_OOB", "STREAM_SERVER_BIND", "STREAM_SERVER_LISTEN", "FILE_USE_INCLUDE_PATH", "FILE_IGNORE_NEW_LINES", "FILE_SKIP_EMPTY_LINES", "FILE_APPEND", "FILE_NO_DEFAULT_CONTEXT", "PSFS_PASS_ON", "PSFS_FEED_ME", "PSFS_ERR_FATAL", "PSFS_FLAG_NORMAL", "PSFS_FLAG_FLUSH_INC", "PSFS_FLAG_FLUSH_CLOSE", "CRYPT_SALT_LENGTH", "CRYPT_STD_DES", "CRYPT_EXT_DES", "CRYPT_MD5", "CRYPT_BLOWFISH", "DIRECTORY_SEPARATOR", "PATH_SEPARATOR", "GLOB_BRACE", "GLOB_MARK", "GLOB_NOSORT", "GLOB_NOCHECK", "GLOB_NOESCAPE", "GLOB_ERR", "GLOB_ONLYDIR", "LOG_EMERG", "LOG_ALERT", "LOG_CRIT", "LOG_ERR", "LOG_WARNING", "LOG_NOTICE", "LOG_INFO", "LOG_DEBUG", "LOG_KERN", "LOG_USER", "LOG_MAIL", "LOG_DAEMON", "LOG_AUTH", "LOG_SYSLOG", "LOG_LPR", "LOG_NEWS", "LOG_UUCP", "LOG_CRON", "LOG_AUTHPRIV", "LOG_PID", "LOG_CONS", "LOG_ODELAY", "LOG_NDELAY", "LOG_NOWAIT", "LOG_PERROR", "EXTR_OVERWRITE", "EXTR_SKIP", "EXTR_PREFIX_SAME", "EXTR_PREFIX_ALL", "EXTR_PREFIX_INVALID", "EXTR_PREFIX_IF_EXISTS", "EXTR_IF_EXISTS", "EXTR_REFS", "SORT_ASC", "SORT_DESC", "SORT_REGULAR", "SORT_NUMERIC", "SORT_STRING", "SORT_LOCALE_STRING", "CASE_LOWER", "CASE_UPPER", "COUNT_NORMAL", "COUNT_RECURSIVE", "ASSERT_ACTIVE", "ASSERT_CALLBACK", "ASSERT_BAIL", "ASSERT_WARNING", "ASSERT_QUIET_EVAL", "STREAM_USE_PATH", "STREAM_IGNORE_URL", "STREAM_ENFORCE_SAFE_MODE", "STREAM_REPORT_ERRORS", "STREAM_MUST_SEEK", "STREAM_URL_STAT_LINK", "STREAM_URL_STAT_QUIET", "STREAM_MKDIR_RECURSIVE", "IMAGETYPE_GIF", "IMAGETYPE_JPEG", "IMAGETYPE_PNG", "IMAGETYPE_SWF", "IMAGETYPE_PSD", "IMAGETYPE_BMP", "IMAGETYPE_TIFF_II", "IMAGETYPE_TIFF_MM", "IMAGETYPE_JPC", "IMAGETYPE_JP2", "IMAGETYPE_JPX", "IMAGETYPE_JB2", "IMAGETYPE_SWC", "IMAGETYPE_IFF", "IMAGETYPE_WBMP", "IMAGETYPE_JPEG2000", "IMAGETYPE_XBM", "T_INCLUDE", "T_INCLUDE_ONCE", "T_EVAL", "T_REQUIRE", "T_REQUIRE_ONCE", "T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "T_PLUS_EQUAL", "T_MINUS_EQUAL", "T_MUL_EQUAL", "T_DIV_EQUAL", "T_CONCAT_EQUAL", "T_MOD_EQUAL", "T_AND_EQUAL", "T_OR_EQUAL", "T_XOR_EQUAL", "T_SL_EQUAL", "T_SR_EQUAL", "T_BOOLEAN_OR", "T_BOOLEAN_AND", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", "T_IS_NOT_IDENTICAL", "T_IS_SMALLER_OR_EQUAL", "T_IS_GREATER_OR_EQUAL", "T_SL", "T_SR", "T_INC", "T_DEC", "T_INT_CAST", "T_DOUBLE_CAST", "T_STRING_CAST", "T_ARRAY_CAST", "T_OBJECT_CAST", "T_BOOL_CAST", "T_UNSET_CAST", "T_NEW", "T_EXIT", "T_IF", "T_ELSEIF", "T_ELSE", "T_ENDIF", "T_LNUMBER", "T_DNUMBER", "T_STRING", "T_STRING_VARNAME", "T_VARIABLE", "T_NUM_STRING", "T_INLINE_HTML", "T_CHARACTER", "T_BAD_CHARACTER", "T_ENCAPSED_AND_WHITESPACE", "T_CONSTANT_ENCAPSED_STRING", "T_ECHO", "T_DO", "T_WHILE", "T_ENDWHILE", "T_FOR", "T_ENDFOR", "T_FOREACH", "T_ENDFOREACH", "T_DECLARE", "T_ENDDECLARE", "T_AS", "T_SWITCH", "T_ENDSWITCH", "T_CASE", "T_DEFAULT", "T_BREAK", "T_CONTINUE", "T_FUNCTION", "T_CONST", "T_RETURN", "T_USE", "T_GLOBAL", "T_STATIC", "T_VAR", "T_UNSET", "T_ISSET", "T_EMPTY", "T_CLASS", "T_EXTENDS", "T_INTERFACE", "T_IMPLEMENTS", "T_OBJECT_OPERATOR", "T_DOUBLE_ARROW", "T_LIST", "T_ARRAY", "T_CLASS_C", "T_FUNC_C", "T_METHOD_C", "T_LINE", "T_FILE", "T_COMMENT", "T_DOC_COMMENT", "T_OPEN_TAG", "T_OPEN_TAG_WITH_ECHO", "T_CLOSE_TAG", "T_WHITESPACE", "T_START_HEREDOC", "T_END_HEREDOC", "T_DOLLAR_OPEN_CURLY_BRACES", "T_CURLY_OPEN", "T_PAAMAYIM_NEKUDOTAYIM", "T_DOUBLE_COLON", "T_ABSTRACT", "T_CATCH", "T_FINAL", "T_INSTANCEOF", "T_PRIVATE", "T_PROTECTED", "T_PUBLIC", "T_THROW", "T_TRY", "T_CLONE", "T_HALT_COMPILER", "FORCE_GZIP", "FORCE_DEFLATE", "XML_ELEMENT_NODE", "XML_ATTRIBUTE_NODE", "XML_TEXT_NODE", "XML_CDATA_SECTION_NODE", "XML_ENTITY_REF_NODE", "XML_ENTITY_NODE", "XML_PI_NODE", "XML_COMMENT_NODE", "XML_DOCUMENT_NODE", "XML_DOCUMENT_TYPE_NODE", "XML_DOCUMENT_FRAG_NODE", "XML_NOTATION_NODE", "XML_HTML_DOCUMENT_NODE", "XML_DTD_NODE", "XML_ELEMENT_DECL_NODE", "XML_ATTRIBUTE_DECL_NODE", "XML_ENTITY_DECL_NODE", "XML_NAMESPACE_DECL_NODE", "XML_LOCAL_NAMESPACE", "XML_ATTRIBUTE_CDATA", "XML_ATTRIBUTE_ID", "XML_ATTRIBUTE_IDREF", "XML_ATTRIBUTE_IDREFS", "XML_ATTRIBUTE_ENTITY", "XML_ATTRIBUTE_NMTOKEN", "XML_ATTRIBUTE_NMTOKENS", "XML_ATTRIBUTE_ENUMERATION", "XML_ATTRIBUTE_NOTATION", "DOM_PHP_ERR", "DOM_INDEX_SIZE_ERR", "DOMSTRING_SIZE_ERR", "DOM_HIERARCHY_REQUEST_ERR", "DOM_WRONG_DOCUMENT_ERR", "DOM_INVALID_CHARACTER_ERR", "DOM_NO_DATA_ALLOWED_ERR", "DOM_NO_MODIFICATION_ALLOWED_ERR", "DOM_NOT_FOUND_ERR", "DOM_NOT_SUPPORTED_ERR", "DOM_INUSE_ATTRIBUTE_ERR", "DOM_INVALID_STATE_ERR", "DOM_SYNTAX_ERR", "DOM_INVALID_MODIFICATION_ERR", "DOM_NAMESPACE_ERR", "DOM_INVALID_ACCESS_ERR", "DOM_VALIDATION_ERR", "XML_ERROR_NONE", "XML_ERROR_NO_MEMORY", "XML_ERROR_SYNTAX", "XML_ERROR_NO_ELEMENTS", "XML_ERROR_INVALID_TOKEN", "XML_ERROR_UNCLOSED_TOKEN", "XML_ERROR_PARTIAL_CHAR", "XML_ERROR_TAG_MISMATCH", "XML_ERROR_DUPLICATE_ATTRIBUTE", "XML_ERROR_JUNK_AFTER_DOC_ELEMENT", "XML_ERROR_PARAM_ENTITY_REF", "XML_ERROR_UNDEFINED_ENTITY", "XML_ERROR_RECURSIVE_ENTITY_REF", "XML_ERROR_ASYNC_ENTITY", "XML_ERROR_BAD_CHAR_REF", "XML_ERROR_BINARY_ENTITY_REF", "XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF", "XML_ERROR_MISPLACED_XML_PI", "XML_ERROR_UNKNOWN_ENCODING", "XML_ERROR_INCORRECT_ENCODING", "XML_ERROR_UNCLOSED_CDATA_SECTION", "XML_ERROR_EXTERNAL_ENTITY_HANDLING", "XML_OPTION_CASE_FOLDING", "XML_OPTION_TARGET_ENCODING", "XML_OPTION_SKIP_TAGSTART", "XML_OPTION_SKIP_WHITE", "XML_SAX_IMPL", "IMG_GIF", "IMG_JPG", "IMG_JPEG", "IMG_PNG", "IMG_WBMP", "IMG_XPM", "IMG_COLOR_TILED", "IMG_COLOR_STYLED", "IMG_COLOR_BRUSHED", "IMG_COLOR_STYLEDBRUSHED", "IMG_COLOR_TRANSPARENT", "IMG_ARC_ROUNDED", "IMG_ARC_PIE", "IMG_ARC_CHORD", "IMG_ARC_NOFILL", "IMG_ARC_EDGED", "IMG_GD2_RAW", "IMG_GD2_COMPRESSED", "IMG_EFFECT_REPLACE", "IMG_EFFECT_ALPHABLEND", "IMG_EFFECT_NORMAL", "IMG_EFFECT_OVERLAY", "GD_BUNDLED", "IMG_FILTER_NEGATE", "IMG_FILTER_GRAYSCALE", "IMG_FILTER_BRIGHTNESS", "IMG_FILTER_CONTRAST", "IMG_FILTER_COLORIZE", "IMG_FILTER_EDGEDETECT", "IMG_FILTER_GAUSSIAN_BLUR", "IMG_FILTER_SELECTIVE_BLUR", "IMG_FILTER_EMBOSS", "IMG_FILTER_MEAN_REMOVAL", "IMG_FILTER_SMOOTH", "PNG_NO_FILTER", "PNG_FILTER_NONE", "PNG_FILTER_SUB", "PNG_FILTER_UP", "PNG_FILTER_AVG", "PNG_FILTER_PAETH", "PNG_ALL_FILTERS", "MB_OVERLOAD_MAIL", "MB_OVERLOAD_STRING", "MB_OVERLOAD_REGEX", "MB_CASE_UPPER", "MB_CASE_LOWER", "MB_CASE_TITLE", "MYSQL_ASSOC", "MYSQL_NUM", "MYSQL_BOTH", "MYSQL_CLIENT_COMPRESS", "MYSQL_CLIENT_SSL", "MYSQL_CLIENT_INTERACTIVE", "MYSQL_CLIENT_IGNORE_SPACE", "MYSQLI_READ_DEFAULT_GROUP", "MYSQLI_READ_DEFAULT_FILE", "MYSQLI_OPT_CONNECT_TIMEOUT", "MYSQLI_OPT_LOCAL_INFILE", "MYSQLI_INIT_COMMAND", "MYSQLI_CLIENT_SSL", "MYSQLI_CLIENT_COMPRESS", "MYSQLI_CLIENT_INTERACTIVE", "MYSQLI_CLIENT_IGNORE_SPACE", "MYSQLI_CLIENT_NO_SCHEMA", "MYSQLI_CLIENT_FOUND_ROWS", "MYSQLI_STORE_RESULT", "MYSQLI_USE_RESULT", "MYSQLI_ASSOC", "MYSQLI_NUM", "MYSQLI_BOTH", "MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", "MYSQLI_STMT_ATTR_CURSOR_TYPE", "MYSQLI_CURSOR_TYPE_NO_CURSOR", "MYSQLI_CURSOR_TYPE_READ_ONLY", "MYSQLI_CURSOR_TYPE_FOR_UPDATE", "MYSQLI_CURSOR_TYPE_SCROLLABLE", "MYSQLI_STMT_ATTR_PREFETCH_ROWS", "MYSQLI_NOT_NULL_FLAG", "MYSQLI_PRI_KEY_FLAG", "MYSQLI_UNIQUE_KEY_FLAG", "MYSQLI_MULTIPLE_KEY_FLAG", "MYSQLI_BLOB_FLAG", "MYSQLI_UNSIGNED_FLAG", "MYSQLI_ZEROFILL_FLAG", "MYSQLI_AUTO_INCREMENT_FLAG", "MYSQLI_TIMESTAMP_FLAG", "MYSQLI_SET_FLAG", "MYSQLI_NUM_FLAG", "MYSQLI_PART_KEY_FLAG", "MYSQLI_GROUP_FLAG", "MYSQLI_TYPE_DECIMAL", "MYSQLI_TYPE_TINY", "MYSQLI_TYPE_SHORT", "MYSQLI_TYPE_LONG", "MYSQLI_TYPE_FLOAT", "MYSQLI_TYPE_DOUBLE", "MYSQLI_TYPE_NULL", "MYSQLI_TYPE_TIMESTAMP", "MYSQLI_TYPE_LONGLONG", "MYSQLI_TYPE_INT24", "MYSQLI_TYPE_DATE", "MYSQLI_TYPE_TIME", "MYSQLI_TYPE_DATETIME", "MYSQLI_TYPE_YEAR", "MYSQLI_TYPE_NEWDATE", "MYSQLI_TYPE_ENUM", "MYSQLI_TYPE_SET", "MYSQLI_TYPE_TINY_BLOB", "MYSQLI_TYPE_MEDIUM_BLOB", "MYSQLI_TYPE_LONG_BLOB", "MYSQLI_TYPE_BLOB", "MYSQLI_TYPE_VAR_STRING", "MYSQLI_TYPE_STRING", "MYSQLI_TYPE_CHAR", "MYSQLI_TYPE_INTERVAL", "MYSQLI_TYPE_GEOMETRY", "MYSQLI_TYPE_NEWDECIMAL", "MYSQLI_TYPE_BIT", "MYSQLI_RPL_MASTER", "MYSQLI_RPL_SLAVE", "MYSQLI_RPL_ADMIN", "MYSQLI_NO_DATA", "MYSQLI_DATA_TRUNCATED", "MYSQLI_REPORT_INDEX", "MYSQLI_REPORT_ERROR", "MYSQLI_REPORT_STRICT", "MYSQLI_REPORT_ALL", "MYSQLI_REPORT_OFF", "AF_UNIX", "AF_INET", "AF_INET6", "SOCK_STREAM", "SOCK_DGRAM", "SOCK_RAW", "SOCK_SEQPACKET", "SOCK_RDM", "MSG_OOB", "MSG_WAITALL", "MSG_PEEK", "MSG_DONTROUTE", "SO_DEBUG", "SO_REUSEADDR", "SO_KEEPALIVE", "SO_DONTROUTE", "SO_LINGER", "SO_BROADCAST", "SO_OOBINLINE", "SO_SNDBUF", "SO_RCVBUF", "SO_SNDLOWAT", "SO_RCVLOWAT", "SO_SNDTIMEO", "SO_RCVTIMEO", "SO_TYPE", "SO_ERROR", "SOL_SOCKET", "SOMAXCONN", "PHP_NORMAL_READ", "PHP_BINARY_READ", "SOCKET_EINTR", "SOCKET_EBADF", "SOCKET_EACCES", "SOCKET_EFAULT", "SOCKET_EINVAL", "SOCKET_EMFILE", "SOCKET_EWOULDBLOCK", "SOCKET_EINPROGRESS", "SOCKET_EALREADY", "SOCKET_ENOTSOCK", "SOCKET_EDESTADDRREQ", "SOCKET_EMSGSIZE", "SOCKET_EPROTOTYPE", "SOCKET_ENOPROTOOPT", "SOCKET_EPROTONOSUPPORT", "SOCKET_ESOCKTNOSUPPORT", "SOCKET_EOPNOTSUPP", "SOCKET_EPFNOSUPPORT", "SOCKET_EAFNOSUPPORT", "SOCKET_EADDRINUSE", "SOCKET_EADDRNOTAVAIL", "SOCKET_ENETDOWN", "SOCKET_ENETUNREACH", "SOCKET_ENETRESET", "SOCKET_ECONNABORTED", "SOCKET_ECONNRESET", "SOCKET_ENOBUFS", "SOCKET_EISCONN", "SOCKET_ENOTCONN", "SOCKET_ESHUTDOWN", "SOCKET_ETOOMANYREFS", "SOCKET_ETIMEDOUT", "SOCKET_ECONNREFUSED", "SOCKET_ELOOP", "SOCKET_ENAMETOOLONG", "SOCKET_EHOSTDOWN", "SOCKET_EHOSTUNREACH", "SOCKET_ENOTEMPTY", "SOCKET_EPROCLIM", "SOCKET_EUSERS", "SOCKET_EDQUOT", "SOCKET_ESTALE", "SOCKET_EREMOTE", "SOCKET_EDISCON", "SOCKET_SYSNOTREADY", "SOCKET_VERNOTSUPPORTED", "SOCKET_NOTINITIALISED", "SOCKET_HOST_NOT_FOUND", "SOCKET_TRY_AGAIN", "SOCKET_NO_RECOVERY", "SOCKET_NO_DATA", "SOCKET_NO_ADDRESS", "SOL_TCP", "SOL_UDP", "EACCELERATOR_VERSION", "EACCELERATOR_SHM_AND_DISK", "EACCELERATOR_SHM", "EACCELERATOR_SHM_ONLY", "EACCELERATOR_DISK_ONLY", "EACCELERATOR_NONE", "XDEBUG_TRACE_APPEND", "XDEBUG_TRACE_COMPUTERIZED", "XDEBUG_TRACE_HTML", "XDEBUG_CC_UNUSED", "XDEBUG_CC_DEAD_CODE", "STDIN", "STDOUT", "STDERR", "DNS_HINFO", "DNS_PTR", "SQLITE_EMPTY", "SVN_SHOW_UPDATES", "SVN_NO_IGNORE", "MSG_EOF", "DNS_MX", "GD_EXTRA_VERSION", "PHP_VERSION_ID", "SQLITE_OK", "LIBXML_LOADED_VERSION", "RADIXCHAR", "OPENSSL_VERSION_TEXT", "OPENSSL_VERSION_NUMBER", "PCRE_VERSION", "CURLOPT_FILE", "CURLOPT_INFILE", "CURLOPT_URL", "CURLOPT_PROXY", "CURLE_FUNCTION_NOT_FOUND", "SOCKET_ENOMSG", "CURLOPT_HTTPHEADER", "SOCKET_EIDRM", "CURLOPT_PROGRESSFUNCTION", "SOCKET_ECHRNG", "SOCKET_EL2NSYNC", "SOCKET_EL3HLT", "SOCKET_EL3RST", "SOCKET_ELNRNG", "SOCKET_ENOCSI", "SOCKET_EL2HLT", "SOCKET_EBADE", "SOCKET_EXFULL", "CURLOPT_USERPWD", "CURLOPT_PROXYUSERPWD", "CURLOPT_RANGE", "CURLOPT_TIMEOUT_MS", "CURLOPT_POSTFIELDS", "CURLOPT_REFERER", "CURLOPT_USERAGENT", "CURLOPT_FTPPORT", "SOCKET_ERESTART", "SQLITE_CONSTRAINT", "SQLITE_MISMATCH", "SQLITE_MISUSE", "CURLOPT_COOKIE", "CURLE_SSL_CERTPROBLEM", "CURLOPT_SSLCERT", "CURLOPT_KEYPASSWD", "CURLOPT_WRITEHEADER", "CURLOPT_SSL_VERIFYHOST", "CURLOPT_COOKIEFILE", "CURLE_HTTP_RANGE_ERROR", "CURLE_HTTP_POST_ERROR", "CURLOPT_CUSTOMREQUEST", "CURLOPT_STDERR", "SOCKET_EBADR", "CURLOPT_RETURNTRANSFER", "CURLOPT_QUOTE", "CURLOPT_POSTQUOTE", "CURLOPT_INTERFACE", "CURLOPT_KRB4LEVEL", "SOCKET_ENODATA", "SOCKET_ESRMNT", "CURLOPT_WRITEFUNCTION", "CURLOPT_READFUNCTION", "CURLOPT_HEADERFUNCTION", "SOCKET_EADV", "SOCKET_EPROTO", "SOCKET_EMULTIHOP", "SOCKET_EBADMSG", "CURLOPT_FORBID_REUSE", "CURLOPT_RANDOM_FILE", "CURLOPT_EGDSOCKET", "SOCKET_EREMCHG", "CURLOPT_CONNECTTIMEOUT_MS", "CURLOPT_CAINFO", "CURLOPT_CAPATH", "CURLOPT_COOKIEJAR", "CURLOPT_SSL_CIPHER_LIST", "CURLOPT_BINARYTRANSFER", "SQLITE_DONE", "CURLOPT_HTTP_VERSION", "CURLOPT_SSLKEY", "CURLOPT_SSLKEYTYPE", "CURLOPT_SSLENGINE", "CURLOPT_SSLCERTTYPE", "CURLE_OUT_OF_MEMORY", "CURLOPT_ENCODING", "CURLE_SSL_CIPHER", "SOCKET_EREMOTEIO", "CURLOPT_HTTP200ALIASES", "CURLAUTH_ANY", "CURLAUTH_ANYSAFE", "CURLOPT_PRIVATE", "CURLINFO_EFFECTIVE_URL", "CURLINFO_HTTP_CODE", "CURLINFO_HEADER_SIZE", "CURLINFO_REQUEST_SIZE", "CURLINFO_TOTAL_TIME", "CURLINFO_NAMELOOKUP_TIME", "CURLINFO_CONNECT_TIME", "CURLINFO_PRETRANSFER_TIME", "CURLINFO_SIZE_UPLOAD", "CURLINFO_SIZE_DOWNLOAD", "CURLINFO_SPEED_DOWNLOAD", "CURLINFO_SPEED_UPLOAD", "CURLINFO_FILETIME", "CURLINFO_SSL_VERIFYRESULT", "CURLINFO_CONTENT_LENGTH_DOWNLOAD", "CURLINFO_CONTENT_LENGTH_UPLOAD", "CURLINFO_STARTTRANSFER_TIME", "CURLINFO_CONTENT_TYPE", "CURLINFO_REDIRECT_TIME", "CURLINFO_REDIRECT_COUNT", "CURLINFO_PRIVATE", "CURLINFO_CERTINFO", "SQLITE_PROTOCOL", "SQLITE_SCHEMA", "SQLITE_TOOBIG", "SQLITE_NOLFS", "SQLITE_AUTH", "SQLITE_FORMAT", "SOCKET_ENOTTY", "SQLITE_NOTADB", "SOCKET_ENOSPC", "SOCKET_ESPIPE", "SOCKET_EROFS", "SOCKET_EMLINK", "GD_RELEASE_VERSION", "SOCKET_ENOLCK", "SOCKET_ENOSYS", "SOCKET_EUNATCH", "SOCKET_ENOANO", "SOCKET_EBADRQC", "SOCKET_EBADSLT", "SOCKET_ENOSTR", "SOCKET_ETIME", "SOCKET_ENOSR", "SVN_REVISION_HEAD", "XSD_ENTITY", "XSD_NOTATION", "CURLOPT_CERTINFO", "CURLOPT_POSTREDIR", "CURLOPT_SSH_AUTH_TYPES", "CURLOPT_SSH_PUBLIC_KEYFILE", "CURLOPT_SSH_PRIVATE_KEYFILE", "CURLOPT_SSH_HOST_PUBLIC_KEY_MD5", "CURLE_SSH", "CURLOPT_REDIR_PROTOCOLS", "CURLOPT_PROTOCOLS", "XSD_NONNEGATIVEINTEGER", "XSD_BYTE","DNS_SRV","DNS_A6", "DNS_NAPTR", "DNS_AAAA", "FILTER_SANITIZE_FULL_SPECIAL_CHARS", "ABDAY_1", "SVN_REVISION_UNSPECIFIED", "SVN_REVISION_BASE", "SVN_REVISION_COMMITTED", "SVN_REVISION_PREV", "GD_VERSION", "MCRYPT_TRIPLEDES", "MCRYPT_ARCFOUR_IV", "MCRYPT_ARCFOUR", "MCRYPT_BLOWFISH", "MCRYPT_BLOWFISH_COMPAT", "MCRYPT_CAST_128", "MCRYPT_CAST_256", "MCRYPT_ENIGNA", "MCRYPT_DES", "MCRYPT_GOST", "MCRYPT_LOKI97", "MCRYPT_PANAMA", "MCRYPT_RC2", "MCRYPT_RIJNDAEL_128", "MCRYPT_RIJNDAEL_192", "MCRYPT_RIJNDAEL_256", "MCRYPT_SAFER64", "MCRYPT_SAFER128","MCRYPT_SAFERPLUS", "MCRYPT_SERPENT", "MCRYPT_THREEWAY", "MCRYPT_TWOFISH", "MCRYPT_WAKE", "MCRYPT_XTEA", "MCRYPT_IDEA", "MCRYPT_MARS", "MCRYPT_RC6", "MCRYPT_SKIPJACK", "MCRYPT_MODE_CBC", "MCRYPT_MODE_CFB", "MCRYPT_MODE_ECB", "MCRYPT_MODE_NOFB", "MCRYPT_MODE_OFB", "MCRYPT_MODE_STREAM", "CL_EXPUNGE", "SQLITE_ROW", "POSIX_S_IFBLK", "POSIX_S_IFSOCK", "XSD_IDREF", "ABDAY_2", "ABDAY_3", "ABDAY_4", "ABDAY_5", "ABDAY_6", "ABDAY_7", "DAY_1", "DAY_2", "DAY_3", "DAY_4", "DAY_5", "DAY_6", "DAY_7", "ABMON_1", "ABMON_2", "ABMON_3", "ABMON_4", "ABMON_5", "ABMON_6", "ABMON_7","ABMON_8", "ABMON_9", "ABMON_10", "ABMON_11", "ABMON_12", "MON_1", "MON_2", "MON_3", "MON_4", "MON_5", "MON_6", "MON_7", "MON_8", "MON_9", "MON_10", "MON_11", "MON_12", "AM_STR", "PM_STR", "D_T_FMT", "D_FMT", "T_FMT", "T_FMT_AMPM", "ERA", "ERA_D_T_FMT", "ERA_D_FMT", "ERA_T_FMT", "ALT_DIGITS", "CRNCYSTR", "THOUSEP", "YESEXPR", "NOEXPR", "SOCKET_ENOMEDIUM", "GLOB_AVAILABLE_FLAGS", "XSD_SHORT", "XSD_NMTOKENS", "LOG_LOCAL3", "LOG_LOCAL4", "LOG_LOCAL5", "LOG_LOCAL6", "LOG_LOCAL7", "DNS_ANY", "DNS_ALL", "SOCKET_ENOLINK", "SOCKET_ECOMM", "SOAP_FUNCTIONS_ALL", "UNKNOWN_TYPE", "XSD_BASE64BINARY", "XSD_ANYURI", "XSD_QNAME", "SOCKET_EISNAM", "SOCKET_EMEDIUMTYPE", "XSD_NCNAME", "XSD_ID", "XSD_ENTITIES", "XSD_INTEGER", "XSD_NONPOSITIVEINTEGER", "XSD_NEGATIVEINTEGER", "XSD_LONG", "XSD_INT", "XSD_UNSIGNEDLONG", "XSD_UNSIGNEDINT", "XSD_UNSIGNEDSHORT", "XSD_UNSIGNEDBYTE", "XSD_POSITIVEINTEGER", "XSD_ANYTYPE", "XSD_ANYXML", "APACHE_MAP", "XSD_1999_TIMEINSTANT", "XSD_NAMESPACE", "XSD_1999_NAMESPACE", "SOCKET_ENOTUNIQ", "SOCKET_EBADFD", "SOCKET_ESTRPIPE", "T_GOTO", "T_NAMESPACE", "T_NS_C", "T_DIR", "T_NS_SEPARATOR", "LIBXSLT_VERSION","LIBEXSLT_DOTTED_VERSION", "LIBEXSLT_VERSION", "SVN_AUTH_PARAM_DEFAULT_USERNAME", "SVN_AUTH_PARAM_DEFAULT_PASSWORD", "SVN_AUTH_PARAM_NON_INTERACTIVE", "SVN_AUTH_PARAM_DONT_STORE_PASSWORDS", "SVN_AUTH_PARAM_NO_AUTH_CACHE", "SVN_AUTH_PARAM_SSL_SERVER_FAILURES", "SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO", "SVN_AUTH_PARAM_CONFIG", "SVN_AUTH_PARAM_SERVER_GROUP", "SVN_AUTH_PARAM_CONFIG_DIR", "PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS", "SVN_FS_CONFIG_FS_TYPE", "SVN_FS_TYPE_BDB", "SVN_FS_TYPE_FSFS", "SVN_PROP_REVISION_DATE", "SVN_PROP_REVISION_ORIG_DATE", "SVN_PROP_REVISION_AUTHOR", "SVN_PROP_REVISION_LOG" ].forEach(function(element, index, array) { result[element] = token("atom", "php-predefined-constant"); }); // PHP declared classes - output of get_declared_classes(). Differs from http://php.net/manual/en/reserved.classes.php [ "stdClass", "Exception", "ErrorException", "COMPersistHelper", "com_exception", "com_safearray_proxy", "variant", "com", "dotnet", "ReflectionException", "Reflection", "ReflectionFunctionAbstract", "ReflectionFunction", "ReflectionParameter", "ReflectionMethod", "ReflectionClass", "ReflectionObject", "ReflectionProperty", "ReflectionExtension", "DateTime", "DateTimeZone", "LibXMLError", "__PHP_Incomplete_Class", "php_user_filter", "Directory", "SimpleXMLElement", "DOMException", "DOMStringList", "DOMNameList", "DOMImplementationList", "DOMImplementationSource", "DOMImplementation", "DOMNode", "DOMNameSpaceNode", "DOMDocumentFragment", "DOMDocument", "DOMNodeList", "DOMNamedNodeMap", "DOMCharacterData", "DOMAttr", "DOMElement", "DOMText", "DOMComment", "DOMTypeinfo", "DOMUserDataHandler", "DOMDomError", "DOMErrorHandler", "DOMLocator", "DOMConfiguration", "DOMCdataSection", "DOMDocumentType", "DOMNotation", "DOMEntity", "DOMEntityReference", "DOMProcessingInstruction", "DOMStringExtend", "DOMXPath", "RecursiveIteratorIterator", "IteratorIterator", "FilterIterator", "RecursiveFilterIterator", "ParentIterator", "LimitIterator", "CachingIterator", "RecursiveCachingIterator", "NoRewindIterator", "AppendIterator", "InfiniteIterator", "RegexIterator", "RecursiveRegexIterator", "EmptyIterator", "ArrayObject", "ArrayIterator", "RecursiveArrayIterator", "SplFileInfo", "DirectoryIterator", "RecursiveDirectoryIterator", "SplFileObject", "SplTempFileObject", "SimpleXMLIterator", "LogicException", "BadFunctionCallException", "BadMethodCallException", "DomainException", "InvalidArgumentException", "LengthException", "OutOfRangeException", "RuntimeException", "OutOfBoundsException", "OverflowException", "RangeException", "UnderflowException", "UnexpectedValueException", "SplObjectStorage", "XMLReader", "XMLWriter", "mysqli_sql_exception", "mysqli_driver", "mysqli", "mysqli_warning", "mysqli_result", "mysqli_stmt", "PDOException", "PDO", "PDOStatement", "PDORow","Closure", "DateInterval", "DatePeriod", "FilesystemIterator", "GlobIterator", "MultipleIterator", "RecursiveTreeIterator", "SoapClient", "SoapFault", "SoapHeader", "SoapParam", "SoapServer", "SoapVar", "SplDoublyLinkedList", "SplFixedArray", "SplHeap", "SplMaxHeap", "SplMinHeap", "SplPriorityQueue", "SplQueue", "SplStack", "SQLite3", "SQLite3Result", "SQLite3Stmt", "SQLiteDatabase", "SQLiteException", "SQLiteResult", "SQLiteUnbuffered", "Svn", "SvnNode", "SvnWc", "SvnWcSchedule", "XSLTProcessor", "ZipArchive", ].forEach(function(element, index, array) { result[element] = token("t_string", "php-predefined-class"); }); return result; }(); // Helper regexps var isOperatorChar = /[+*&%\/=<>!?.|^@-]/; var isHexDigit = /[0-9A-Fa-f]/; var isWordChar = /[\w\$_\\]/; // Wrapper around phpToken that helps maintain parser state (whether // we are inside of a multi-line comment) function phpTokenState(inside) { return function(source, setState) { var newInside = inside; var type = phpToken(inside, source, function(c) {newInside = c;}); if (newInside != inside) setState(phpTokenState(newInside)); return type; }; } // The token reader, inteded to be used by the tokenizer from // tokenize.js (through phpTokenState). Advances the source stream // over a token, and returns an object containing the type and style // of that token. function phpToken(inside, source, setInside) { function readHexNumber(){ source.next(); // skip the 'x' source.nextWhileMatches(isHexDigit); return {type: "number", style: "php-atom"}; } function readNumber() { source.nextWhileMatches(/[0-9]/); if (source.equals(".")){ source.next(); source.nextWhileMatches(/[0-9]/); } if (source.equals("e") || source.equals("E")){ source.next(); if (source.equals("-")) source.next(); source.nextWhileMatches(/[0-9]/); } return {type: "number", style: "php-atom"}; } // Read a word and look it up in the keywords array. If found, it's a // keyword of that type; otherwise it's a PHP T_STRING. function readWord() { source.nextWhileMatches(isWordChar); var word = source.get(); var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word]; // since we called get(), tokenize::take won't get() anything. Thus, we must set token.content return known ? {type: known.type, style: known.style, content: word} : {type: "t_string", style: "php-t_string", content: word}; } function readVariable() { source.nextWhileMatches(isWordChar); var word = source.get(); // in PHP, '$this' is a reserved word, but 'this' isn't. You can have function this() {...} if (word == "$this") return {type: "variable", style: "php-keyword", content: word}; else return {type: "variable", style: "php-variable", content: word}; } // Advance the stream until the given character (not preceded by a // backslash) is encountered, or the end of the line is reached. function nextUntilUnescaped(source, end) { var escaped = false; while(!source.endOfLine()){ var next = source.next(); if (next == end && !escaped) return false; escaped = next == "\\" && !escaped; } return escaped; } function readSingleLineComment() { // read until the end of the line or until ?>, which terminates single-line comments // `<?php echo 1; // comment ?> foo` will display "1 foo" while(!source.lookAhead("?>") && !source.endOfLine()) source.next(); return {type: "comment", style: "php-comment"}; } /* For multi-line comments, we want to return a comment token for every line of the comment, but we also want to return the newlines in them as regular newline tokens. We therefore need to save a state variable ("inside") to indicate whether we are inside a multi-line comment. */ function readMultilineComment(start){ var newInside = "/*"; var maybeEnd = (start == "*"); while (true) { if (source.endOfLine()) break; var next = source.next(); if (next == "/" && maybeEnd){ newInside = null; break; } maybeEnd = (next == "*"); } setInside(newInside); return {type: "comment", style: "php-comment"}; } // similar to readMultilineComment and nextUntilUnescaped // unlike comments, strings are not stopped by ?> function readMultilineString(start){ var newInside = start; var escaped = false; while (true) { if (source.endOfLine()) break; var next = source.next(); if (next == start && !escaped){ newInside = null; // we're outside of the string now break; } escaped = (next == "\\" && !escaped); } setInside(newInside); return { type: newInside == null? "string" : "string_not_terminated", style: (start == "'"? "php-string-single-quoted" : "php-string-double-quoted") }; } // http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc // See also 'nowdoc' on the page. Heredocs are not interrupted by the '?>' token. function readHeredoc(identifier){ var token = {}; if (identifier == "<<<") { // on our first invocation after reading the <<<, we must determine the closing identifier if (source.equals("'")) { // nowdoc source.nextWhileMatches(isWordChar); identifier = "'" + source.get() + "'"; source.next(); // consume the closing "'" } else if (source.matches(/[A-Za-z_]/)) { // heredoc source.nextWhileMatches(isWordChar); identifier = source.get(); } else { // syntax error setInside(null); return { type: "error", style: "syntax-error" }; } setInside(identifier); token.type = "string_not_terminated"; token.style = identifier.charAt(0) == "'"? "php-string-single-quoted" : "php-string-double-quoted"; token.content = identifier; } else { token.style = identifier.charAt(0) == "'"? "php-string-single-quoted" : "php-string-double-quoted"; // consume a line of heredoc and check if it equals the closing identifier plus an optional semicolon if (source.lookAhead(identifier, true) && (source.lookAhead(";\n") || source.endOfLine())) { // the closing identifier can only appear at the beginning of the line // note that even whitespace after the ";" is forbidden by the PHP heredoc syntax token.type = "string"; token.content = source.get(); // don't get the ";" if there is one setInside(null); } else { token.type = "string_not_terminated"; source.nextWhileMatches(/[^\n]/); token.content = source.get(); } } return token; } function readOperator() { source.nextWhileMatches(isOperatorChar); return {type: "operator", style: "php-operator"}; } function readStringSingleQuoted() { var endBackSlash = nextUntilUnescaped(source, "'", false); setInside(endBackSlash ? "'" : null); return {type: "string", style: "php-string-single-quoted"}; } function readStringDoubleQuoted() { var endBackSlash = nextUntilUnescaped(source, "\"", false); setInside(endBackSlash ? "\"": null); return {type: "string", style: "php-string-double-quoted"}; } // Fetch the next token. Dispatches on first character in the // stream, or first two characters when the first is a slash. switch (inside) { case null: case false: break; case "'": case "\"": return readMultilineString(inside); case "/*": return readMultilineComment(source.next()); default: return readHeredoc(inside); } var ch = source.next(); if (ch == "'" || ch == "\"") return readMultilineString(ch); else if (ch == "#") return readSingleLineComment(); else if (ch == "$") return readVariable(); else if (ch == ":" && source.equals(":")) { source.next(); // the T_DOUBLE_COLON can only follow a T_STRING (class name) return {type: "t_double_colon", style: "php-operator"}; } // with punctuation, the type of the token is the symbol itself else if (/[\[\]{}\(\),;:]/.test(ch)) { return {type: ch, style: "php-punctuation"}; } else if (ch == "0" && (source.equals("x") || source.equals("X"))) return readHexNumber(); else if (/[0-9]/.test(ch)) return readNumber(); else if (ch == "/") { if (source.equals("*")) { source.next(); return readMultilineComment(ch); } else if (source.equals("/")) return readSingleLineComment(); else return readOperator(); } else if (ch == "<") { if (source.lookAhead("<<", true)) { setInside("<<<"); return {type: "<<<", style: "php-punctuation"}; } else return readOperator(); } else if (isOperatorChar.test(ch)) return readOperator(); else return readWord(); } // The external interface to the tokenizer. return function(source, startState) { return tokenizer(source, startState || phpTokenState(false, true)); }; })();
JavaScript
function waitForStyles() { for (var i = 0; i < document.styleSheets.length; i++) if (/googleapis/.test(document.styleSheets[i].href)) return document.body.className += " droid"; setTimeout(waitForStyles, 100); } setTimeout(function() { if (/AppleWebKit/.test(navigator.userAgent) && /iP[oa]d|iPhone/.test(navigator.userAgent)) return; var link = document.createElement("LINK"); link.type = "text/css"; link.rel = "stylesheet"; link.href = "http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"; document.documentElement.getElementsByTagName("HEAD")[0].appendChild(link); waitForStyles(); }, 20);
JavaScript
CKFinder.addPlugin( 'fileeditor', function( api ) { var regexExt = /^(.*)\.([^\.]+)$/, regexTextExt = /^(txt|css|html|htm|js|asp|cfm|cfc|ascx|php|inc|xml|xslt|xsl)$/i, regexCodeMirrorExt = /^(css|html|htm|js|xml|xsl|php)$/i, codemirror, file, fileLoaded = false, doc; var codemirrorPath = CKFinder.getPluginPath('fileeditor') + 'codemirror/'; var codeMirrorParsers = { css : 'parsecss.js', js : [ 'tokenizejavascript.js', 'parsejavascript.js' ], xml : 'parsexml.js', php : ['parsexml.js', 'parsecss.js', 'tokenizejavascript.js', 'parsejavascript.js', '../contrib/php/js/tokenizephp.js', '../contrib/php/js/parsephp.js', '../contrib/php/js/parsephphtmlmixed.js'] }; var codeMirrorCss = { css : codemirrorPath + 'css/csscolors.css', js : codemirrorPath + 'css/jscolors.css', xml : codemirrorPath + 'css/xmlcolors.css', php : [ codemirrorPath + 'css/xmlcolors.css', codemirrorPath + 'css/jscolors.css', codemirrorPath + 'css/csscolors.css', codemirrorPath + 'contrib/php/css/phpcolors.css' ] }; codeMirrorCss.xsl = codeMirrorCss.xml; codeMirrorCss.htm = codeMirrorCss.xml; codeMirrorCss.html = codeMirrorCss.xml; codeMirrorParsers.xsl = codeMirrorParsers.xml; codeMirrorParsers.htm = codeMirrorParsers.xml; codeMirrorParsers.html = codeMirrorParsers.xml; var isTextFile = function( file ) { return regexTextExt.test( file.ext ); }; CKFinder.dialog.add( 'fileEditor', function( api ) { var height, width; var saveButton = (function() { return { id : 'save', label : api.lang.Fileeditor.save, type : 'button', onClick : function ( evt ) { if ( !fileLoaded ) return true; var dialog = evt.data.dialog; var content = codemirror ? codemirror.getCode() : doc.getById( 'fileContent' ).getValue(); api.connector.sendCommandPost( "SaveFile", null, { content : content, fileName : file.name }, function( xml ) { if ( xml.checkError() ) return false; api.openMsgDialog( '', api.lang.Fileeditor.fileSaveSuccess ); dialog.hide(); return undefined; }, file.folder.type, file.folder ); return false; } }; })(); if ( api.inPopup ) { width = api.document.documentElement.offsetWidth; height = api.document.documentElement.offsetHeight; } else { var parentWindow = ( api.document.parentWindow || api.document.defaultView ).parent; width = parentWindow.innerWidth ? parentWindow.innerWidth : parentWindow.document.documentElement.clientWidth; height = parentWindow.innerHeight ? parentWindow.innerHeight : parentWindow.document.documentElement.clientHeight; } return { title : api.getSelectedFile().name, // TODO CKFINDER.DIALOG_RESIZE_BOTH // resizable : CKFINDER.DIALOG_RESIZE_BOTH, minWidth : parseInt( width, 10 ) * 0.6, minHeight : parseInt( height, 10 ) * 0.7, onHide : function() { if ( fileLoaded ) { var fileContent = doc.getById( 'fileContent' ); if ( fileContent ) fileContent.remove(); } }, onShow : function() { var dialog = this; var cssWidth = parseInt( width, 10 ) * 0.6 - 10; var cssHeight = parseInt( height, 10 ) * 0.7 - 20; doc = dialog.getElement().getDocument(); var win = doc.getWindow(); doc.getById( 'fileArea' ).setHtml( '<div class="ckfinder_loader_32" style="margin: 100px auto 0 auto;text-align:center;"><p style="height:' + cssHeight + 'px;width:' + cssWidth + 'px;">' + api.lang.Fileeditor.loadingFile + '</p></div>' ); file = api.getSelectedFile(); var enableCodeMirror = regexCodeMirrorExt.test( file.ext ); this.setTitle( file.name ); if ( enableCodeMirror && win.$.CodeMirror === undefined ) { var head= doc.$.getElementsByTagName( 'head' )[0]; var script= doc.$.createElement( 'script' ); script.type= 'text/javascript'; script.src = CKFinder.getPluginPath( 'fileeditor' ) + 'codemirror/js/codemirror.js'; head.appendChild( script ); } // If CKFinder is runninng under a different domain than baseUrl, then the following call will fail: // CKFinder.ajax.load( file.getUrl() + '?t=' + (new Date().getTime()), function( data )... var url = api.connector.composeUrl( 'DownloadFile', { FileName : file.name, format : 'text', t : new Date().getTime() }, file.folder.type, file.folder ); CKFinder.ajax.load( url, function( data ) { if ( data === null || ( file.size > 0 && data === '' ) ) { api.openMsgDialog( '', api.lang.Fileeditor.fileOpenError ); dialog.hide(); return; } else fileLoaded = true; var fileArea = doc.getById( 'fileArea' ); fileArea.setStyle('height', '100%'); fileArea.setHtml( '<textarea id="fileContent" style="height:' + cssHeight + 'px; width:' + cssWidth + 'px"></textarea>' ); doc.getById( 'fileContent' ).setText( data ); codemirror = null; if ( enableCodeMirror && win.$.CodeMirror !== undefined ) { codemirror = win.$.CodeMirror.fromTextArea( doc.getById( 'fileContent').$, { height : cssHeight + 'px', parserfile : codeMirrorParsers[ file.ext.toLowerCase() ], stylesheet : codeMirrorCss[ file.ext.toLowerCase() ], path : codemirrorPath + "js/" } ); // TODO get rid of ugly buttons and provide something better var undoB = doc.createElement( "button", { attributes: { "label" : api.lang.common.undo } } ); undoB.on( 'click', function() { codemirror.undo(); }); undoB.setHtml( api.lang.common.undo ); undoB.appendTo( doc.getById( 'fileArea' ) ); var redoB = doc.createElement( 'button', { attributes: { "label" : api.lang.common.redo } } ); redoB.on('click', function() { codemirror.redo(); }); redoB.setHtml( api.lang.common.redo ); redoB.appendTo( doc.getById( 'fileArea' ) ); } }); }, contents : [ { id : 'tab1', label : '', title : '', expand : true, padding : 0, elements : [ { type : 'html', id : 'htmlLoader', html : '' + '<style type="text/css">' + '.CodeMirror-wrapping {background:white;}' + '</style>' + '<div id="fileArea"></div>' } ] } ], // TODO http://dev.fckeditor.net/ticket/4750 buttons : [ saveButton, CKFinder.dialog.cancelButton ] }; } ); api.addFileContextMenuOption( { label : api.lang.Fileeditor.contextMenuName, command : "fileEditor" } , function( api, file ) { api.openDialog( 'fileEditor' ); }, function ( file ) { var maxSize = 1024; if ( typeof (CKFinder.config.fileeditorMaxSize) != 'undefined' ) maxSize = CKFinder.config.fileeditorMaxSize; // Disable for images, binary files, large files etc. if ( isTextFile( file ) && file.size <= maxSize ) { if ( file.folder.acl.fileDelete ) return true; else return -1; } return false; }); } );
JavaScript
/** * Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://ckeditor.com/license * * CKFinder 2.x - sample "dummy" plugin. * * To enable it, add the following line to config.js: * config.extraPlugins = 'dummy'; */ /** * See http://docs.cksource.com/ckfinder_2.x_api/symbols/CKFinder.html#.addPlugin */ CKFinder.addPlugin( 'dummy', { lang : [ 'en', 'pl' ], appReady : function( api ) { CKFinder.dialog.add( 'dummydialog', function( api ) { // CKFinder.dialog.definition var dialogDefinition = { title : api.lang.dummy.title, minWidth : 390, minHeight : 230, onOk : function() { // "this" is now a CKFinder.dialog object. var value = this.getValueOf( 'tab1', 'textareaId' ); if ( !value ) { api.openMsgDialog( '', api.lang.dummy.typeText ); return false; } else { alert( "You have entered: " + value ); } }, contents : [ { id : 'tab1', label : '', title : '', expand : true, padding : 0, elements : [ { type : 'html', html : '<h3>' + api.lang.dummy.typeText + '</h3>' }, { type : 'textarea', id : 'textareaId', rows : 10, cols : 40 } ] } ], buttons : [ CKFinder.dialog.cancelButton, CKFinder.dialog.okButton ] }; return dialogDefinition; } ); api.addFileContextMenuOption( { label : api.lang.dummy.menuItem, command : "dummycommand" } , function( api, file ) { api.openDialog('dummydialog'); }); } });
JavaScript
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKFinder.setPluginLang( 'dummy', 'pl', { dummy : { title : 'Testowe okienko', menuItem : 'Otwórz okienko dummy', typeText : 'Podaj jakiś tekst.' } });
JavaScript
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKFinder.setPluginLang( 'dummy', 'en', { dummy : { title : 'Dummy dialog', menuItem : 'Open dummy dialog', typeText : 'Please type some text.' } });
JavaScript
function AfterLogin() { $.ajax({ type: 'POST', url: 'user/info/', success: function (msg) { msg = $.trim(msg); var username = msg.split(',')[0]; var type = msg.split(',')[1]; $("#name").html(username); $("#my-microbloging").attr("href", "http://weibo.com/n/" + encodeURIComponent(username)); $("#name").attr("href", "profile/" + encodeURIComponent(username)); if (type == 1) { $(".jobs").show(); } else if (type == 2) { $(".recruitment").show(); } else if (type == 99) { $(".recruitment").show(); $(".admin").show(); } } }); } $(function () { $("div#feedback-info").dialog({ autoOpen: false, buttons: { "确定": function () { $(this).dialog("close"); } } }); $("div#inner-content a").click(function () { question: $("#question").val(""); description: $("#description").val(""); email: $("#email").val(""); $("div#feedback-info").dialog("open"); $.ajax({ type: 'POST', url: 'feedback/post', data: { question: $("#question").val(), description: $("#description").val(), email: $("#email").val() }, success: function (msg) { } }); }); });
JavaScript
var MR = false; var ML = false; var position = 0; var length = 0; $(function () { SetCompany(); }); var appyId = ""; var theItem; function SentResume() { $(theItem).hide(); $(theItem).next().show(); $("#popBox_apply1").hide(); $.ajax({ type: 'GET', url: 'apply_sent/add/' + appyId, success: function (msg) { } }); } function JobApply(item, id, name) { var userid; appyId = id; theItem = item; $.ajax({ type: 'GET', url: 'resume/current', success: function (msg) { userid = $.trim(msg); $.ajax({ type: 'GET', url: 'resume/show/' + userid, success: function (resume) { if (resume.indexOf("<html") != -1) { $("#default-resume").attr("href", "resume/show/" + userid); $("#at-name").html("@" + name); $("#popBox_apply1").show(); } else { $("#popBox_apply0").show(); } } }); } }); } function JobUnApply(item, id) { $.ajax({ type: 'GET', url: 'apply_sent/delete/' + id, success: function (msg) { $(item).hide(); $(item).prev().show(); } }); } function UpdateResumeText(e) { if (115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) { $("#remain-number").html((115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2))); } else { $("#remain-number").html((Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2 - 115))); } } function CompanyMR() { if (position + 840 < length) { $("#companies-inner").animate({ "left": "-=2" }, 10, "linear", function () { position += 2; if (MR) { CompanyMR(); } }); } } function CompanyML() { if (position > 0) { $("#companies-inner").animate({ "left": "+=2" }, 10, "linear", function () { position -= 2; if (ML) { CompanyML(); } }); } } function SetCompany() { $("#company-control-right").animate({ opacity: 0.4 }, 0); $("#company-control-left").animate({ opacity: 0.4 }, 0); $("#company-control-right").mouseover(function () { if (!MR) { MR = true; CompanyMR(); } $(this).stop().animate({ opacity: 1 }, 0); }); $("#company-control-right").mouseout(function () { if (MR) { MR = false; } $(this).stop().animate({ opacity: 0.4 }, 0); }); $("#company-control-left").mouseover(function () { if (!ML) { ML = true; CompanyML(); } $(this).stop().animate({ opacity: 1 }, 0); }); $("#company-control-left").mouseout(function () { if (ML) { ML = false; } $(this).stop().animate({ opacity: 0.4 }, 0); }); length = $("a.company-name:last").position().left + $("a.company-name:last").outerWidth("ture"); } function SetTheSorts() { $("div#sorts").position({ of: $("a#sort"), my: "left top", at: "left top", offset: "-5 -10", collision: "none none" }); $("div#sorts").css("top", "78px"); $.ajax({ type: "POST", url: 'cate', success: function (msg) { $("#sorts-content").html(msg); $(".sorts-item").mouseover(function () { $(this).addClass("sorts-item-over") }); $(".sorts-item").mouseout(function () { $(this).removeClass("sorts-item-over") }); $(".sorts-item a").click(function () { $("a#sorts-name").html($(this).html()); $("a#sort").html($(this).html()); $("#sorts").fadeOut(200); cate = $(this).attr("id"); }); } }); $("#sorts-name").click(function () { $("#sorts").fadeOut(200) }); $("#sorts-triangle").click(function () { $("#sorts").fadeOut(200) }); $("#sort-triangle").click(function () { $("#sorts").fadeIn(200) }); $("#sort").click(function () { $("#sorts").fadeIn(200) }); $("body").click(function (e) { if (e.pageX >= $("#sorts").offset().left && e.pageX <= $("#sorts").offset().left + $("#sorts").width() && e.pageY >= $("#sorts").offset().top && e.pageY <= $("#sorts").offset().top + $("#sorts").height()) { } else { $("#sorts").fadeOut(200); } }); } function SetSorts() { $.ajax({ type: 'GET', url: 'cate', success: function (msg) { $("#sorts-content").html(msg); $(".sorts-item").mouseover(function () { $(this).addClass("sorts-item-over") }); $(".sorts-item").mouseout(function () { $(this).removeClass("sorts-item-over") }); $(".sorts-item a").click(function () { $("a#sorts-name").html($(this).html()); $("a#sort").html($(this).html() + "▼"); $("a#sort").attr("name", $(this).attr("id")); $("a#sort").attr("title", $(this).html()); $("#sorts").fadeOut(200); cate = $(this).attr("id"); }); } }); $("div#sorts").position({ of: $("a#sort"), my: "left top", at: "left top", offset: "-5 -10", collision: "none none" }); $("#sorts-name").click(function () { $("#sorts").fadeOut(200) }); $("#sorts-triangle").click(function () { $("#sorts").fadeOut(200) }); $("#sort-triangle").click(function () { $("#sorts").fadeIn(200) }); $("#sort").click(function () { $("#sorts").fadeIn(200) }); $("body").click(function (e) { if (e.pageX >= $("#sorts").offset().left && e.pageX <= $("#sorts").offset().left + $("#sorts").width() && e.pageY >= $("#sorts").offset().top && e.pageY <= $("#sorts").offset().top + $("#sorts").height()) { } else { $("#sorts").fadeOut(200); } }); } function ShowSorts() { $("div#sorts").show(); }
JavaScript
//Init - default.js currentsearch = 0; function guidGenerator() { var S4 = function () { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); } function ShowMiddlePic(url) { $("#LPic").html('<img style="margin-top:9px;margin-left:9px;" src="images/loading.gif" alt="" />'); loagflag = false; var obj = new Image(); obj.src = url; var $window = jQuery(window); var temp = ($window.width() - 50) / 2; var controlx = temp >= 0 ? temp : 0; temp = ($window.height() - 50) / 2; var controly = $window.scrollTop() + (temp >= 0 ? temp : 0); $("#LPic").css({ left: controlx + 'px', top: controly + 'px', height: '50px', width: '50px' }); CoverResize(); $("div#cover").fadeIn(200); $("#LPic").fadeIn(200); $("div#cover").click(function () { HidePic(); }); $("body").keyup(function (e) { if (e.which == 27) { HidePic(); } }); $("body").css("overflow", "hidden"); obj.onload = function () { temp = ($window.width() - obj.width) / 2; controlx = temp >= 0 ? temp : 0; temp = ($window.height() - obj.height) / 2; controly = $window.scrollTop() + (temp >= 0 ? temp : 0); $("#LPic").css({ left: controlx + 'px', top: controly + 'px', height: obj.height + 'px', width: obj.width + 'px' }); if (!loagflag) { $("#LPic").html('<a target="_blank" href="' + url.replace("bmiddle", "large") + '"><img src="' + url + '" alt="" /></a>'); } } } var loagflag = false; function HidePic() { loagflag = true; $("div#cover").unbind("click"); $("body").unbind("keyup"); $("body").css("overflow", "auto"); $("div#cover").fadeOut(200); $("#LPic").fadeOut(200); $("#LPic").html(""); } $(function () { $("#LPic").draggable(); $("#history-pic").animate({ opacity: 0.6 }, 0); SetHot(); SetSorts(); InitBoxes(); $.ajax({ type: 'GET', url: 'count/show', success: function (msg) { $("div#radio").html("本周新增职位" + $.trim(msg).split(',')[0] + "个,今日新增职位" + $.trim(msg).split(',')[1] + "个"); } }); $("#search-text").keypress(function (e) { if (e.which == 13) { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") { SearchContent(false, $("#search-text").val(), $("#sort").attr("name"), 0); } } }); $("#search-text").keydown(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } //if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) { // $(this).val($(this).val().replace("#", "").replace("&", "").replace("?", "")); //} }); $("#search-text").keyup(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } //if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) { // $(this).val($(this).val().replace("#", "").replace("&", "").replace("?", "")); //} }); $("a#search-button").click(function () { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") { SearchContent(false, $("#search-text").val(), $("#sort").attr("name"), 0); } }); $("div#backTop").click(function () { $("html, body").animate({ scrollTop: 0 }, 1000); }); $("div#backTop").animate({ opacity: 0.6 }, 0); $("div#backTop").mouseover(function () { $("div#backTop").stop().animate({ opacity: 1 }, 200); }); $("div#backTop").mouseout(function () { $("div#backTop").stop().animate({ opacity: 0.6 }, 200); }); setTimeout(function () { GetNewerBlogs(); }, 60000); SetRolePicker(); if ($.cookie("athere") == null) { $.cookie("athere", "here", { path: '/' }); setTimeout(function () { $("#radio").slideUp(200); }, 30000); } else { $("#radio").hide(); } $("a.btn_goresume").click(function () { document.location = "manager?type=profile"; }); if($.query.get("errormsg") != ""){ showError(decodeURI($.query.get("errormsg"))); } if ($.query.get("search") != "") { var text = $.trim($.query.get("search")); var cate = $.trim($.query.get("cat")); SetCate(cate); if (text != "职位关键字,如:北京 产品经理 阿里巴巴" && text != "") { SearchContent(false, text, cate, 0); } } else { SearchContent(true, "all", 0, 0); } var $window = jQuery(window); var temp = ($window.scrollLeft() + $window.width() - 962) / 2; var controlx = 944 + (temp >= 0 ? temp : 0); var controly = $window.scrollTop() + $window.height() - 100; $("div#backTop").css({ left: controlx + 'px', top: controly + 'px' }); $("div#backTop").css("position", "fixed"); // if (!($.browser.msie && $.browser.version == "6.0")) { // $("div#backTop").position({ // of: $("div#microblogs"), // my: "left top", // at: "right top", // offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), // collision: "none none" // }); // $("div#backTop").css("position", "absolute"); // } $(window).resize(function () { var $window = jQuery(window); var temp = ($window.scrollLeft() + $window.width() - 962) / 2; var controlx = 944 + (temp >= 0 ? temp : 0); var controly = $window.height() - 100; $("div#backTop").css({ left: controlx + 'px', top: controly + 'px' }); }); }); //End of Init function CloseMTips() { $("#manager-tips").fadeOut(200); } function CloseCTips() { $("#concern-tips").fadeOut(200); } function CloseATips() { $("#apply-tips").fadeOut(200); } //After User Login - default.js function AfterLogin() { $.ajax({ type: 'POST', url: '/user/info/', success: function (msg) { msg = $.trim(msg); var username = msg.split(',')[0]; var type = msg.split(',')[1]; $("#name").html(username); $("#my-microbloging").attr("href", "http://weibo.com/n/" + encodeURIComponent(username)); $("#name").attr("href", "profile/" + encodeURIComponent(username)); if (type == -1) { CoverResize(); $("div#cover").show(); $("div#role-choose").show(); } else if (type == 1) { $(".jobs").show(); } else if (type == 2) { $(".recruitment").show(); } else if (type == 99) { $(".recruitment").show(); $(".admin").show(); } } }); RefreshConcern(); RefreshHistory(); } //End of After User Login //Concern Event - default.js function ConcernMouseOver(item) { $(item).addClass("concern-item-over"); } function ConcernMouseOut(item) { $(item).removeClass("concern-item-over"); } function ConcernDeleteClick(id, content, item) { $.ajax({ type: 'GET', url: 'follow/delete/' + id, success: function (msg) { $(item).parent().hide(); if (searchContent == content) { concernFlag = false; $("#search-result-concern").attr("class", "right search-result-concern"); } } }); } function ConcernContentClick(cate, content) { SetCate(cate); SearchContent(false, content, cate, 0); } function RefreshConcern() { $("#concern").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("#concern").height() - 32) / 2) + 'px;margin-bottom:' + (($("#concern").height() - 32) / 2) + 'px;" />'); $.ajax({ type: 'GET', url: 'follow/show', success: function (msg) { if (msg == null || msg == "") { $("#concern").html("尚未有关注项?试试搜索,有新发现哟!"); $("#concern").css("color", "#878787"); $("#concern").css("text-align", "center"); } else { $("#concern").html(msg); } } }); } //End of Concern Event function SetCate(cate) { switch (cate) { case "0": $("#sort").html("全部分类▼"); $("#sorts-name").html("全部分类"); $("a#sort").attr("title", "全部分类"); break; case "1": $("#sort").html("互联网▼"); $("#sorts-name").html("互联网"); $("a#sort").attr("title", "互联网"); break; case "2": $("#sort").html("移动互联网▼"); $("#sorts-name").html("移动互联网"); $("a#sort").attr("title", "移动互联网"); break; case "3": $("#sort").html("网络游戏▼"); $("#sorts-name").html("网络游戏"); $("a#sort").attr("title", "网络游戏"); break; case "4": $("#sort").html("电子商务▼"); $("#sorts-name").html("电子商务"); $("a#sort").attr("title", "电子商务"); break; case "5": $("#sort").html("软件·电信▼"); $("#sorts-name").html("软件·电信"); $("a#sort").attr("title", "软件·电信"); break; case "6": $("#sort").html("新媒体▼"); $("#sorts-name").html("新媒体"); $("a#sort").attr("title", "新媒体"); break; case "7": $("#sort").html("投资·银行▼"); $("#sorts-name").html("投资·银行"); $("a#sort").attr("title", "投资·银行"); break; case "8": $("#sort").html("其他▼"); $("#sorts-name").html("其他"); $("a#sort").attr("title", "其他"); break; } } //History Event - default.js function HistoryMouseOver(item) { $(item).addClass("history-item-over"); } function HistoryMouseOut(item) { $(item).removeClass("history-item-over"); } function HistoryPicMouseOver(item) { $(item).animate({ opacity: 1 }, 0); } function HistoryPicMouseOut(item) { $(item).animate({ opacity: 0.6 }, 0); } function HistoryPicClick() { $.ajax({ type: 'GET', url: 'history/deleteall', success: function (msg) { $("#history").html(""); } }); } function HistoryClick(cate, content) { SetCate(cate); SearchContent(false, content, cate, 0); } function RefreshHistory() { $("#history").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("#history").height() - 32) / 2) + 'px;margin-bottom:' + (($("#history").height() - 32) / 2) + 'px;" />'); $.ajax({ type: 'GET', url: 'history/show/5', success: function (msg) { $("#history").html(msg); } }); } //End of History Event //Hot Event - default.js function SetHot() { $.ajax({ type: 'GET', url: 'hot/tag', success: function (msg) { $("#hot").html(msg); } }); } function HotClick(content) { SetCate(0); SearchContent(false, content, 0, 0); } //End of Hot Event //Search Event - default.js var concernFlag = true; var searchContent = ""; var cateContent = 0; var page = 0; function SearchConcernMouseOver(item) { if (!concernFlag) { $(item).attr("class", "right search-result-concern-over"); } } function SearchConcernMouseOut(item) { if (!concernFlag) { $(item).attr("class", "right search-result-concern"); } } function SearchConcernMouseDown(item) { if (!concernFlag) { $(item).attr("class", "right search-result-concern-click"); } } function SearchConcernClick() { if (!concernFlag) { $.ajax({ type: 'POST', url: 'follow/add/' + cateContent, data: { search: encodeURIComponent(searchContent) }, success: function (msg) { $("#search-result-concern").attr("class", "right search-result-concern-have"); concernFlag = true; RefreshConcern(); } }); } } function SearchContent(noresult, content, cate, pagenum, callback) { $("div#pages").hide(); var thissearch; thissearch = guidGenerator(); currentsearch = thissearch; if (!noresult && pagenum == 0) { content = $.trim(content); content = $('<div/>').text(content).html(); var result = ""; for (s in content.split(' ')) { if (content.split(' ')[s] != "") { result += '#<a class="keyword">' + content.split(' ')[s] + '</a>#'; } } $("div#search-result div.left").html("正在搜索" + result + "..."); $("#search-result-outer").show(); } if (pagenum == 0) { firstTime = true; } else { firstTime = false; } $(window).unbind("scroll"); $("#fresh-blogs").hide(); $("#blogs").html('<img src="images/loading.gif" style="margin-left:275px;margin-top:100px;margin-bottom:100px;" />'); $.ajax({ type: 'POST', url: 'search/show/' + cate, data: { search: encodeURIComponent(content), page: pagenum }, success: function (msg) { if (currentsearch != thissearch) return; var c; var f; if (pagenum == 0) { tt = msg.split(','); c = tt[0]; countpage = Math.floor(c); f = tt[1]; var str = ""; for (s in tt) { if (s == 2) { str += tt[s]; } else if (s >= 2) { str += ',' + tt[s]; } } msg = str; } searchContent = content; cateContent = cate; $("#blogs").html(msg); if (pagenum == 0) { nowFirst = $(".microblog-item:first").attr("id"); } if (callback != null) { callback(); } RefreshHistory(); page = pagenum / 5; $("html, body").scrollTop(0); prevLess = false; nextLess = false; var allPage; if (countpage % 50 == 0) { allPage = Math.floor(countpage / 50); } else { allPage = Math.floor(countpage / 50) + 1; } if (allPage > 1) { var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (pagenum - 5) + ')">上一页</a>'; } for (i = 0; i < allPage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>'; } } if (i == allPage - 1 && i - page > 2) { str += '<a class="page-number left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allPage - 1) { str += '<a class="page-control left" id="nextPage" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (pagenum + 5) + ')">下一页</a>'; } str += '</div>'; $("div#pages").html(str); } else { $("div#pages").html(""); } $("div#pages").show(); if (!noresult && pagenum == 0) { content = $.trim(content); content = $('<div/>').text(content).html(); var result = ""; if ($("a#sort").attr("title") != "全部分类") { result = $("a#sort").attr("title") + "中:"; } for (s in content.split(' ')) { if (content.split(' ')[s] != "") { result += '#<a class="keyword">' + content.split(' ')[s] + '</a>#'; } } result += "的搜索结果,共有" + countpage + "条结果"; $("div#search-result div.left").html(result); if (f == '0') { concernFlag = false; $("#search-result-concern").attr("class", "right search-result-concern"); } else { concernFlag = true; $("#search-result-concern").attr("class", "right search-result-concern-have"); } $("#search-result-outer").show(); $("a#search-result-rss").attr("href", 'http://www.ybole.com/search/rss/' + cate + '/' + searchContent); } // if (!($.browser.msie && $.browser.version == "6.0")) { // if ($("div#backTop").css("position") != "fixed") { // $("div#backTop").position({ // of: $("div#microblogs"), // my: "left top", // at: "right top", // offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), // collision: "none none" // }); // $("div#backTop").css("position", "absolute"); // } // } page = pagenum; count = 0; $(window).scroll(function () { DocumenScroll(); }); } }); } //End of Search Event //Other Event function InitBoxes() { $("#popBox_apply1").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#popBox_apply1").css("position", "fixed"); $("#popBox_apply0").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#popBox_apply0").css("position", "fixed"); } function JobLike(item, id) { $.ajax({ type: 'GET', url: 'like/add/' + id, success: function (msg) { $(item).hide(); $(item).next().show(); } }); } function JobUnLike(item, id) { $.ajax({ type: 'GET', url: 'like/delete/' + id, success: function (msg) { $(item).hide(); $(item).prev().show(); } }); } function HotCompany(item) { SetCate(0); SearchContent(false, $(item).html(), 0, 0); } function HideSorts() { $("div#sorts").hide(); } function SetRolePicker() { $("div#role-choose").position({ of: $("body"), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("a#role-jobs").position({ of: $("div#role-choose"), my: "left top", at: "left top", offset: "48 54", collision: "none none" }); $("a#role-recruitment").position({ of: $("div#role-choose"), my: "left top", at: "left top", offset: "328 54", collision: "none none" }); $("a#role-confirm").position({ of: $("div#role-choose"), my: "left top", at: "left top", offset: "190 276", collision: "none none" }); $("a#role-jobs").click(function () { $("div#role-choose").removeClass("role-recruitment"); $("div#role-choose").addClass("role-jobs"); rolekind = "jobs"; }); $("a#role-recruitment").click(function () { $("div#role-choose").removeClass("role-jobs"); $("div#role-choose").addClass("role-recruitment"); rolekind = "recruitment"; }); $("a#role-confirm").click(function () { if (rolekind == "jobs") { $(".logined").show(); $(".jobs").show(); $.ajax({ type: 'POST', url: 'user/set_role/1', success: function (msg) { $("body").css("overflow", "auto"); SearchContent(true, "all", 0, 0, function () { $("#manager-tips").position({ of: $("#manager-center"), my: "center top", at: "center bottom", offset: "0 0", collision: "none none" }); $("#concern-tips").position({ of: $("#concern-title"), my: "left center", at: "right center", offset: "0 0", collision: "none none" }); $("#apply-tips").position({ of: $(".apply:first"), my: "center bottom", at: "center top", offset: "0 0", collision: "none none" }); $("#manager-tips").show(); $("#concern-tips").show(); $("#apply-tips").show(); }); } }); } else if (rolekind == "recruitment") { $(".logined").show(); $(".recruitment").show(); $.ajax({ type: 'POST', url: 'user/set_role/2', success: function (msg) { $("body").css("overflow", "auto"); $("#manager-tips").position({ of: $("#manager-center"), my: "center top", at: "center bottom", offset: "0 0", collision: "none none" }); $("#concern-tips").position({ of: $("#concern-title"), my: "left center", at: "right center", offset: "0 0", collision: "none none" }); $("#manager-tips").show(); $("#concern-tips").show(); } }); } $("div#cover").hide(); $("div#role-choose").hide(); }); } var count = 0; var scrollflag = false; var countpage = 100; function DocumenScroll() { // if ($.browser.msie && $.browser.version == "6.0") { // //$("div#backTop").attr("position","absolute"); // $("div#backTop").position({ // of: $("div#microblogs"), // my: "left top", // at: "right top", // offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), // collision: "none none" // }); // } // if (!($.browser.msie && $.browser.version == "6.0")) { // if ($("div#backTop").css("position") != "fixed") { // $("div#backTop").position({ // of: $("div#microblogs"), // my: "left top", // at: "right top", // offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), // collision: "none none" // }); // $("div#backTop").css("position", "fixed"); // } // } if ($(window).scrollTop() != 0) { $("div#backTop").fadeIn(200); } else { $("div#backTop").fadeOut(200); } if (($(window).scrollTop() + $(window).height()) >= $(document).height() - 200 && count < 4 && !scrollflag && countpage >= 10) { $(window).unbind("scroll"); count++; page++; $("#flower").fadeIn(200); $("#pages").hide(); $.ajax({ type: 'POST', url: 'search/show/' + cateContent, data: { search: encodeURIComponent(searchContent), page: page }, //, time: '-' + $(".microblog-item:last").attr("id") //url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/-' + $(".microblog-item:last").attr("id"), success: function (msg) { if (msg == "" || msg.split('"microblog-item"').length < 11) { scrollflag = true; } $("#flower").fadeOut(200); $("#pages").show(); $("div#blogs").html($("div#blogs").html() + msg); // if (!($.browser.msie && $.browser.version == "6.0")) { // $("div#backTop").position({ // of: $("div#microblogs"), // my: "left top", // at: "right top", // offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), // collision: "none none" // }); // $("div#backTop").css("position", "fixed"); // } /* $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(text), success: function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); //SetSearch(msg, text, thissearch); nowFirst = $(".microblog-item:first").attr("id"); } }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; //SetSearch(msg, text, thissearch); }); }); $("a.like").unbind("click"); $("a.unlike").unbind("click"); $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); StartSearch('like/add/' + id, function () { item.hide(); item.next("a.unlike").show(); }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind && rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); */ $(window).scroll(function () { DocumenScroll(); }); } }); } } var nowFirst; var firstTime = true; var isFreshed = false; var preContent = ""; function GetNewerBlogs() { if (firstTime) { nowFirst = ""; nowFirst = $(".microblog-item:first").attr("id"); firstTime = false; } if (nowFirst != "") { preContent = searchContent; $.ajax({ type: 'POST', url: 'search/show/' + cateContent, data: { search: encodeURIComponent(searchContent), time: nowFirst }, //url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/' + nowFirst, success: function (msg) { if (preContent == searchContent) { if (msg != "") { $.ajax({ type: 'POST', url: 'count/', success: function (msg) { $("div#radio").html("本周新增职位" + msg.split(',')[0] + "个,今日新增职位" + msg.split(',')[1] + "个"); } }); if (!isFreshed) { $("div#blogs").html($("div#fresh-blogs").html() + $("div#blogs").html()); $("div#fresh-blogs").hide(); isFreshed = true; /* $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); SetSearch(msg, text, thissearch); nowFirst = $(".microblog-item:first").attr("id"); }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.like").unbind("click"); $("a.unlike").unbind("click"); $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/add/' + id, success: function () { item.hide(); item.next("a.unlike").show(); } }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); */ } if (msg.split("id=").length - 1 <= 0) return; $("div#fresh-blogs").html(msg); $("div#fresh").html('有' + (msg.split("id=").length - 1) + '条更新,点击查看'); $("div#fresh-outer").slideDown(300, null, function () { $("div#fresh-outer").animate({ opacity: 1 }, 200); }); $("div#fresh").click(function () { isFreshed = false; $("div#fresh-blogs").slideDown(500, null, function () { $("div#fresh-blogs").animate({ opacity: 1 }, 200); }); nowFirst = $(".microblog-item:first").attr("id"); $("div#fresh-outer").animate({ opacity: 0 }, 0, null, function () { $("div#fresh-outer").slideUp(300); }); /* $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); SetSearch(msg, text, thissearch); nowFirst = $(".microblog-item:first").attr("id"); }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.like").unbind("click"); $("a.unlike").unbind("click"); $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/add/' + id, success: function () { item.hide(); item.next("a.unlike").show(); } }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); */ }); } } } }); } setTimeout(function () { GetNewerBlogs(); }, 60000); } //End of Other Event
JavaScript
var currentsearch = 0; var issearch = false; var SearchResult = "all"; var count = 0; var page = 0; var prevLess = false; var nextLess = false; var nowFirst = ""; var isFreshed = false; var isTurn = false; var name = ""; var item; var id; var haveResume = false; function CloseMTips() { $("#manager-tips").fadeOut(200); } function CloseCTips() { $("#concern-tips").fadeOut(200); } function CloseATips() { $("#apply-tips").fadeOut(200); } function guidGenerator() { var S4 = function () { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); } function ApplyJob() { $.ajax({ type: "POST", url: 'apply/add/' + id, data: { text: $("#msgBox_resume .content textarea").val() }, success: function (msg) { if (msg != "") { alert(msg); } item.hide(); item.next("a.unapply").show(); } }); HideResume(); } function ShowNoresume() { $("div#cover").fadeIn(200); $("div#msgBox_noresume").fadeIn(200); } function HideNoresume() { $("div#cover").fadeOut(200); $("div#msgBox_noresume").fadeOut(200); } function ShowResume() { $(".info span:first").html("@" + item.parent().prev(".microblog-item-blog").children(".microblog-item-blog-name").html()); $("div#cover").fadeIn(200); $("div#msgBox_resume").fadeIn(200); } function HideResume() { $("div#cover").fadeOut(200); $("div#msgBox_resume").fadeOut(200); } function UpdateApply(e) { if (115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) { $(".info span:last").html("还可输入" + (115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字"); } else { $(".info span:last").html("已超出" + (Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2 - 115)) + "个字"); } } $(function () { $("div#msgBox_noresume").position({ of: $(window), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("div#msgBox_resume").position({ of: $(window), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("div#msgBox_noresume").css("position", "fixed"); $("div#msgBox_resume").css("position", "fixed"); $.ajax({ type: 'POST', url: 'resume/current', success: function (msg) { $.ajax({ type: 'POST', url: 'resume/show/' + msg, success: function (e) { if (e.indexOf('<html') != -1) { haveResume = true; $("#msgBox_resume .content a:first").attr("href", "resume/show/" + msg); } else { haveResume = false; } } }) } }); if ($.cookie("athere") == null) { $.cookie("athere", "here", { path: '/' }); setTimeout(function () { $("#radio").slideUp(200); }, 30000); } else { $("#radio").hide(); } $("a.company-name").click(function () { var text = $.trim($(this).html()); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("#concern-pic").animate({ opacity: 0.6 }, 0); $("#concern-pic").mouseover(function () { $(this).animate({ opacity: 1 }, 200); }); $("#concern-pic").mouseout(function () { $(this).animate({ opacity: 0.6 }, 200); }); $("#history-pic").animate({ opacity: 0.6 }, 0); $("#history-pic").mouseover(function () { $(this).stop().animate({ opacity: 1 }, 200); }); $("#history-pic").mouseout(function () { $(this).stop().animate({ opacity: 0.6 }, 200); }); $("a#history-pic").click(function () { $.ajax({ type: 'POST', url: 'history/deleteall', success: function (msg) { $.ajax({ type: 'GET', url: 'history/show/5', success: function (msg) { $(".history-item").animate({ opacity: 0 }, 200, function () { $(this).slideUp(100, null, function () { $("#history").html(msg); SetHistory(); }); }); } }); } }); }); SetRolePicker(); GetNewerCount(); $("#error-info").dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, buttons: { "确定": function () { $(this).dialog("close"); } } }); if ($.query.get("errormsg") == "") { if ($.query.get("search") != "") { var text = $.trim($.query.get("search")); var cat = $.trim($.query.get("cat")); StartSearch('search/' + encodeURIComponent(text) + '/' + cat, function (msg, thissearch) { page = 0; cate = cat; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); setTimeout(function () { GetNewerBlogs(); }, 60000); $("div#backTop").position({ of: $("div#microblogs"), my: "left top", at: "right top", offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), collision: "none none" }); $("div#backTop").css("position", "fixed"); }); } else { $.ajax({ type: 'GET', url: 'search/all/0', success: function (msg) { isTurn = false; SetAllSearch(msg); $("div#backTop").position({ of: $("div#microblogs"), my: "left top", at: "right top", offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), collision: "none none" }); $("div#backTop").css("position", "fixed"); setTimeout(function () { GetNewerBlogs(); }, 60000); } }); } } else { $("#errormsg").html(decodeURI($.query.get("errormsg"))); $("#error-info").dialog("open"); $.ajax({ type: 'GET', url: 'search/all/0', success: function (msg) { isTurn = false; SetAllSearch(msg); $("div#backTop").position({ of: $("div#microblogs"), my: "left top", at: "right top", offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100), collision: "none none" }); $("div#backTop").css("position", "fixed"); setTimeout(function () { GetNewerBlogs(); }, 60000); } }); } $.ajax({ type: 'POST', url: 'hot/', success: function (msg) { $("div#hot").html(msg); $("a.hot-content-item").click(function () { var text = $(this).html().split('(')[0]; StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); } }); $("div#backTop").click(function () { $("html, body").animate({ scrollTop: 0 }, 1000); }); $("div#backTop").animate({ opacity: 0.6 }, 0); $("div#backTop").mouseover(function () { $("div#backTop").stop().animate({ opacity: 1 }, 200); }); $("div#backTop").mouseout(function () { $("div#backTop").stop().animate({ opacity: 0.6 }, 200); }); $("#search-text").keypress(function (e) { if (e.which == 13) { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") { StartSearch('search/' + encodeURIComponent($.trim($("#search-text").val())) + '/' + cate, function (msg, thissearch) { isTurn = false; SetSearch(msg, $("#search-text").val(), thissearch); }); } } }); $("#search-text").keydown(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) { $(this).val($(this).val().replace("#", "").replace("&", "").replace("?", "")); } }); $("#search-text").keyup(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) { $(this).val($(this).val().replace("#", "").replace("&", "").replace("?", "")); } }); $("a#search-button").click(function () { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") { StartSearch('search/' + encodeURIComponent($.trim($("#search-text").val())) + '/' + cate, function (msg, thissearch) { isTurn = false; SetSearch(msg, $("#search-text").val(), thissearch); }); } }); }); function SetAllSearch(msg) { scrollflag = false; $("div#fresh-outer").animate({ opacity: 0 }, 0); $("div#fresh-outer").hide(); $("div#fresh-blogs").animate({ opacity: 0 }, 0); $("div#fresh-blogs").hide(); $("div#pages").fadeOut(50); $("div#blogs").animate({ opacity: 0 }, 200, null, function () { $("div#blogs").slideUp(100, null, function () { $("div#blogs").html('<img src="images/loading.gif" style="margin-left:280px;" />'); $("div#blogs").slideDown(100, null, function () { $("div#blogs").animate({ opacity: 1 }, 200, null, function () { $("div#blogs").animate({ opacity: 0 }, 200, null, function () { $("div#blogs").slideUp(100, null, function () { $("div#blogs").html(msg); $("div#blogs").slideDown(100, null, function () { $("div#blogs").animate({ opacity: 1 }, 200); $(window).unbind("scroll"); $(window).scroll(function () { DocumenScroll(); }); count = 0; }); $.ajax({ type: "POST", url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/count', success: function (msg) { $(window).scrollTop(0); prevLess = false; nextLess = false; var allPage; if (msg % 50 == 0) { allPage = Math.floor(msg / 50); } else { allPage = Math.floor(msg / 50) + 1; } var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allPage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allPage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allPage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5), success: function (msg) { isTurn = true; SetAllSearch(msg); } }); }); $("a#prevPage").click(function () { page--; $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5), success: function (msg) { isTurn = true; SetAllSearch(msg); } }); }); $("a#nextPage").click(function () { page++; $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5), success: function (msg) { isTurn = true; SetAllSearch(msg); } }); }); } }); if (!isTurn) { nowFirst = $(".microblog-item:first").attr("id"); } $("a.tag").click(function () { var text = $(this).attr("title"); $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(text), success: function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); } }); }); $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/add/' + id, success: function () { item.hide(); item.next("a.unlike").show(); } }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); }); }); }); }); }); }); } function GetNewerCount() { $.ajax({ type: 'POST', url: 'count/', success: function (msg) { if (!issearch) { $("div#radio").html("本周新增职位" + $.trim(msg).split(',')[0] + "个,今日新增职位" + $.trim(msg).split(',')[1] + "个"); setTimeout(function () { GetNewerCount(); }, 1200000); } } }); } function SetResult(msg) { msg = $.trim(msg); SearchResult = msg var str = $("a#sort").html() + "中:"; for (s in msg.split(' ')) { if (msg.split(' ')[s] != "") { str += '#<a class="keyword">' + msg.split(' ')[s] + '</a>#'; } } str += "的搜索结果"; $("div#search-result div.left").html(str); $.ajax({ type: 'POST', url: 'follow/exist/' + encodeURIComponent(msg), success: function (e) { if (e[0] == '0') { $("a#search-result-concern").attr("class", "right search-result-concern"); $("a#search-result-concern").click(function () { $.ajax({ type: 'POST', url: 'follow/add/' + encodeURIComponent(SearchResult), success: function () { $("a#search-result-concern").attr("class", "right search-result-concern-have"); $("a#search-result-concern").unbind("mouseover"); $("a#search-result-concern").unbind("mousedown"); $("a#search-result-concern").unbind("mouseout"); $("a#search-result-concern").unbind("click"); $("div#concern").animate({ opacity: 0 }, 200, null, function () { $("div#concern").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("div#concern").height() - 32) / 2) + 'px;margin-bottom:' + (($("div#concern").height() - 32) / 2) + 'px;" />'); $("div#concern").animate({ opacity: 1 }, 200, null, function () { $.ajax({ type: 'POST', url: 'follow/show', success: function (msg) { $("div#concern").animate({ opacity: 0 }, 200, null, function () { $("#concern").html(msg); if (msg == "") { $("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>"); } SetConcern(); $("div#concern").animate({ opacity: 1 }, 200); }); } }); }); }); } }); }); } else { $("a#search-result-concern").attr("class", "right search-result-concern-have"); $("a#search-result-concern").unbind("mouseover"); $("a#search-result-concern").unbind("mousedown"); $("a#search-result-concern").unbind("mouseout"); } } }); $("a#search-result-rss").attr("href", 'rss/' + encodeURIComponent(msg)); } function SetRolePicker() { $("div#role-choose").position({ of: $("body"), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("a#role-jobs").position({ of: $("div#role-choose"), my: "left top", at: "left top", offset: "48 54", collision: "none none" }); $("a#role-recruitment").position({ of: $("div#role-choose"), my: "left top", at: "left top", offset: "328 54", collision: "none none" }); $("a#role-confirm").position({ of: $("div#role-choose"), my: "left top", at: "left top", offset: "190 276", collision: "none none" }); $("a#role-jobs").click(function () { $("div#role-choose").removeClass("role-recruitment"); $("div#role-choose").addClass("role-jobs"); rolekind = "jobs"; }); $("a#role-recruitment").click(function () { $("div#role-choose").removeClass("role-jobs"); $("div#role-choose").addClass("role-recruitment"); rolekind = "recruitment"; }); $("a#role-confirm").click(function () { if (rolekind == "jobs") { $(".logined").fadeIn(300); $(".recruitment").hide(); $(".admin").hide(); $.ajax({ type: 'POST', url: 'role/set/1', success: function (msg) { $("#manager-tips").position({ of: $("#manager-center"), my: "center top", at: "center bottom", offset: "0 0", collision: "none none" }); $("#concern-tips").position({ of: $("#concern-title"), my: "left center", at: "right center", offset: "0 0", collision: "none none" }); $("#apply-tips").position({ of: $(".apply:first"), my: "center bottom", at: "center top", offset: "0 0", collision: "none none" }); $("#manager-tips").fadeIn(200); $("#concern-tips").fadeIn(200); $("#apply-tips").fadeIn(200); } }); } else if (rolekind == "recruitment") { $(".logined").fadeIn(300); $(".jobs").hide(); $(".admin").hide(); $.ajax({ type: 'POST', url: 'role/set/2', success: function (msg) { $("#manager-tips").position({ of: $("#manager-center"), my: "center top", at: "center bottom", offset: "0 0", collision: "none none" }); $("#concern-tips").position({ of: $("#concern-title"), my: "left center", at: "right center", offset: "0 0", collision: "none none" }); $("#manager-tips").fadeIn(200); $("#concern-tips").fadeIn(200); } }); } $("div#cover").fadeOut(200); $("div#role-choose").fadeOut(200); }); } function SetConcern() { $(".concern-item").mouseover(function () { $(this).addClass("concern-item-over"); }); $(".concern-item").mouseout(function () { $(this).removeClass("concern-item-over"); }); $(".concern-item-delete").click(function () { var item = $(this); $.ajax({ type: 'POST', url: 'follow/delete/' + $(this).attr("id"), success: function () { var text = item.next(".concern-item-content").children(".concern-item-content-info").html(); if (text == SearchResult) { $("a#search-result-concern").attr("class", "right search-result-concern"); $("a#search-result-concern").mouseover(function () { $(this).attr("class", "right search-result-concern-over"); }); $("a#search-result-concern").mousedown(function () { $(this).attr("class", "right search-result-concern-click"); }); $("a#search-result-concern").mouseout(function () { $(this).attr("class", "right search-result-concern"); }); $("a#search-result-concern").click(function () { $.ajax({ type: 'POST', url: 'follow/add/' + encodeURIComponent(SearchResult), success: function () { $("a#search-result-concern").attr("class", "right search-result-concern-have"); $("a#search-result-concern").unbind("mouseover"); $("a#search-result-concern").unbind("mousedown"); $("a#search-result-concern").unbind("mouseout"); $("a#search-result-concern").unbind("click"); $("div#concern").animate({ opacity: 0 }, 200, null, function () { $("div#concern").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("div#concern").height() - 32) / 2) + 'px;margin-bottom:' + (($("div#concern").height() - 32) / 2) + 'px;" />'); $("div#concern").animate({ opacity: 1 }, 200, null, function () { $.ajax({ type: 'POST', url: 'follow/show', success: function (msg) { $("div#concern").animate({ opacity: 0 }, 200, null, function () { $("#concern").html(msg); if (msg == "") { $("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>"); } SetConcern(); $("div#concern").animate({ opacity: 1 }, 200); }); } }); }); }); } }); }); } } }); $(this).parent().animate({ opacity: 0 }, 200, function () { $(this).slideUp(100, null, function () { $.ajax({ type: 'POST', url: 'follow/show', success: function (msg) { if (msg == "") { $("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>"); } } }); }); }); }); $(".concern-item-content").click(function () { var text = $(this).children(".concern-item-content-info").html(); $(this).children(".concern-item-content-number").fadeOut(200, function () { $(this).parent().removeClass("concern-item-content-new"); }); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); } var countpage = 100; function StartSearch(url, func) { var thissearch; currentsearch = guidGenerator(); thissearch = currentsearch; $("div#fresh-outer").animate({ opacity: 0 }, 0); $("div#fresh-outer").hide(); $("div#fresh-blogs").animate({ opacity: 0 }, 0); $("div#fresh-blogs").hide(); $("div#pages").fadeOut(50); $("div#blogs").animate({ opacity: 0 }, 200, null, function () { $("div#blogs").slideUp(100, null, function () { $("div#blogs").html('<img src="images/loading.gif" style="margin-left:280px;" />'); $("div#blogs").slideDown(100, null, function () { if (currentsearch != thissearch) return; $("div#blogs").animate({ opacity: 1 }, 200, null, function () { if (currentsearch != thissearch) return; }); }); }); }); $.ajax({ type: "GET", url: url, success: function (msg) { func(msg, thissearch); } } ); } function SetSearch(msg, e, thissearch) { scrollflag = false; SearchResult = e; if (currentsearch != thissearch) return; $("div#blogs").animate({ opacity: 0 }, 200, null, function () { if (currentsearch != thissearch) return; $("div#blogs").slideUp(100, null, function () { if (currentsearch != thissearch) return; $("div#blogs").html(msg); $("div#blogs").slideDown(100, null, function () { if (currentsearch != thissearch) return; $("div#blogs").animate({ opacity: 1 }, 200); $(window).unbind("scroll"); $(window).scroll(function () { DocumenScroll(); }); count = 0; }); $.ajax({ type: "POST", url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/count', success: function (msg) { if (currentsearch != thissearch) return; $(window).scrollTop(0); $("div#search-result div.left").html($("div#search-result div.left").html() + ",共有" + msg + "条结果"); var allPage; if (msg % 50 == 0) { allPage = Math.floor(msg / 50); } else { allPage = Math.floor(msg / 50) + 1; } countpage = Math.floor(msg); if (allPage > 1) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allPage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allPage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allPage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; StartSearch('search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5), function (msg, thissearch) { isTurn = true; SetSearch(msg, SearchResult, thissearch); }); }); $("a#prevPage").click(function () { page--; StartSearch('search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5), function (msg, thissearch) { isTurn = true; SetSearch(msg, SearchResult, thissearch); }); }); $("a#nextPage").click(function () { page++; StartSearch('search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5), function (msg, thissearch) { isTurn = true; SetSearch(msg, SearchResult, thissearch); }); }); } } }); if (!isTurn) { nowFirst = $(".microblog-item:first").attr("id"); } $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); if (logined) { $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/add/' + id, success: function () { item.hide(); item.next("a.unlike").show(); } }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); } }); }); $("div#search-result-outer").slideDown(200); if (logined) { $("a#search-result-concern").mouseover(function () { $(this).attr("class", "right search-result-concern-over"); }); $("a#search-result-concern").mousedown(function () { $(this).attr("class", "right search-result-concern-click"); }); $("a#search-result-concern").mouseout(function () { $(this).attr("class", "right search-result-concern"); }); $("div#history").animate({ opacity: 0 }, 200, null, function () { $("div#history").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("div#history").height() - 32) / 2) + 'px;margin-bottom:' + (($("div#history").height() - 32) / 2) + 'px;" />'); $("div#history").animate({ opacity: 1 }, 200, null, function () { $.ajax({ type: 'GET', url: 'history/show/5', success: function (msg) { $("div#history").animate({ opacity: 0 }, 200, null, function () { $("div#history").html(msg); SetHistory(); $("div#history").animate({ opacity: 1 }, 200); }); } }); }); }); } SetResult(e); if (!logined) { $("a#search-result-concern").hide(); } else { $("a#search-result-concern").show(); } } function GetOlderBlogs() { } function SetHistory() { $(".history-item").mouseover(function () { $(this).addClass("history-item-over"); }); $(".history-item").mouseout(function () { $(this).removeClass("history-item-over"); }); $(".history-item").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { cate = 0; page = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); } var scrollflag = false; function DocumenScroll() { if ($(window).scrollTop() != 0) { $("div#backTop").fadeIn(200) } else { $("div#backTop").fadeOut(200); } if (($(window).scrollTop() + $(window).height()) >= $(document).height() - 200 && count < 4 && !scrollflag && countpage >= 10) { $(window).unbind("scroll"); count++; $("#flower").fadeIn(200); $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/-' + $(".microblog-item:last").attr("id"), success: function (msg) { if (msg == "" || msg.split('"microblog-item"').length < 11) { scrollflag = true; } $("#flower").fadeOut(200); $("div#blogs").html($("div#blogs").html() + msg); $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(text), success: function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); SetSearch(msg, text, thissearch); nowFirst = $(".microblog-item:first").attr("id"); } }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.like").unbind("click"); $("a.unlike").unbind("click"); $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); StartSearch('like/add/' + id, function () { item.hide(); item.next("a.unlike").show(); }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); $(window).scroll(function () { DocumenScroll(); }); } }); } } function GetNewerBlogs() { $.ajax({ type: 'GET', url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/' + nowFirst, success: function (msg) { if (msg != "") { $.ajax({ type: 'POST', url: 'count/', success: function (msg) { if (!issearch) { $("div#radio").html("本周新增职位" + msg.split(',')[0] + "个,今日新增职位" + msg.split(',')[1] + "个"); } } }); if (!isFreshed) { $("div#blogs").html($("div#fresh-blogs").html() + $("div#blogs").html()); $("div#fresh-blogs").hide(); isFreshed = true; $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); SetSearch(msg, text, thissearch); nowFirst = $(".microblog-item:first").attr("id"); }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.like").unbind("click"); $("a.unlike").unbind("click"); $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/add/' + id, success: function () { item.hide(); item.next("a.unlike").show(); } }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); } $("div#fresh-blogs").html(msg); $("div#fresh").html('有' + (msg.split("id=").length - 1) + '条更新,点击查看'); $("div#fresh-outer").slideDown(300, null, function () { $("div#fresh-outer").animate({ opacity: 1 }, 200); }); $("div#fresh").click(function () { isFreshed = false; $("div#fresh-blogs").slideDown(500, null, function () { $("div#fresh-blogs").animate({ opacity: 1 }, 200); }); nowFirst = $(".microblog-item:first").attr("id"); $("div#fresh-outer").animate({ opacity: 0 }, 0, null, function () { $("div#fresh-outer").slideUp(300); }); $("a.microblog-item-relate").unbind("click"); $("a.microblog-item-relate").click(function () { var text = $(this).html(); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); SetSearch(msg, text, thissearch); nowFirst = $(".microblog-item:first").attr("id"); }); }); $("a.tag").unbind("click"); $("a.tag").click(function () { var text = $(this).attr("title"); StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) { page = 0; cate = 0; $("#sort").html($("a#" + cate).html()); $("#sorts-name").html($("a#" + cate).html()); isTurn = false; SetSearch(msg, text, thissearch); }); }); $("a.like").unbind("click"); $("a.unlike").unbind("click"); $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("a.like").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/add/' + id, success: function () { item.hide(); item.next("a.unlike").show(); } }); }); $("a.unlike").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'like/delete/' + id, success: function () { item.hide(); item.prev("a.like").show(); } }); }); $("a.apply").click(function () { item = $(this); id = $(this).parent().parent().parent().attr("name"); if (haveResume) { ShowResume(); } else { ShowNoresume(); } }); if (rolekind != "jobs") { $("a.apply").hide(); } $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("name"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); }); } } }); setTimeout(function () { GetNewerBlogs(); }, 60000); } function AfterLogin() { $.ajax({ type: 'POST', url: 'info/', success: function (msg) { $("a#name").html(msg.split(',')[0]); name = msg.split(',')[0]; $("div#links a:last").attr("href", "profile/" + msg.split(',')[0]); var type = msg.split(',')[1]; if (type == -1) { $("div#cover").fadeIn(200); $("div#role-choose").fadeIn(200); } else if (type == 1) { $(".logined").fadeIn(300); $(".recruitment").hide(); $(".admin").hide(); rolekind = "jobs"; } else if (type == 2) { $(".logined").fadeIn(300); $(".jobs").hide(); $(".admin").hide(); rolekind = "recruitment"; } else if (type == 0) { $(".logined").fadeIn(300); $(".jobs").hide(); rolekind = "admin"; } $("#concern").html('<img src="images/loading.gif" style="margin-left:134px;" />'); $.ajax({ type: 'POST', url: 'follow/show', success: function (msg) { $("#concern").animate({ opacity: 0 }, 200, null, function () { $("#concern").slideUp(100, null, function () { $("#concern").html(msg); if (msg == "") { $("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>"); } SetConcern(); $("#concern").slideDown(100, null, function () { $("#concern").animate({ opacity: 1 }, 200); }); }); }); } }); $("#history").html('<img src="images/loading.gif" style="margin-left:134px;" />'); $.ajax({ type: 'GET', url: 'history/show/5', success: function (msg) { $("#history").animate({ opacity: 0 }, 200, null, function () { $("#history").slideUp(100, null, function () { $("#history").html(msg); SetHistory(); $("#history").slideDown(100, null, function () { $("#history").animate({ opacity: 1 }, 200); }); }); }); } }); } }); }
JavaScript
var logined = true; var rolekind = "jobs"; var auth = ""; var length = 0; var position = 0; var cate = 0; $(function () { $("a#logo").mouseover(function () { $(this).html("回首页"); }); $("a#logo").mouseout(function () { $(this).html("测试版"); }); Init(); CoverResize(); SetPublish(); }); function SetPublish() { $("div#published-info").dialog({ autoOpen: false, draggable: false, resizable: false, buttons: { "好的,我知道了": function () { $(this).dialog("close"); } } }); $("div#jobs-publish").position({ of: $("body"), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("div#recruitment-publish").position({ of: $("body"), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("div#jobs-publish-title a").click(function () { HideJobsPublish(); }); $("div#recruitment-publish-title a").click(function () { HideRecruitmentPublish(); }); $("div#jobs-publish-confirm a").click(function () { $.ajax({ type: 'POST', url: 'post/1', data: { text: $("div#jobs-publish-text textarea").val() }, success: function (msg) { if ($.trim(msg) != "0") { alert(msg); } HideJobsPublish(); $("div#published-info").dialog("open"); } }); }); $("div#recruitment-publish-confirm a").click(function () { $.ajax({ type: 'POST', url: 'post/2', data: { text: $("div#recruitment-publish-text textarea").val() }, success: function (msg) { if ($.trim(msg) != "0") { alert(msg); } HideRecruitmentPublish(); $("div#published-info").dialog("open"); } }); }); //Jobs Hot Tags $.ajax({ type: 'POST', url: 'hot/1', success: function (msg) { $("div#jobs-publish-tags-hot").html(msg); $("a.jobs-publish-tags-hot-item").click(function () { $("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val() + " " + $(this).attr("title")); UpdateJobsText(); }); } }); //Recruitment Hot Tags $.ajax({ type: 'POST', url: 'hot/2', success: function (msg) { $("div#recruitment-publish-tags-hot").html(msg); $("a.recruitment-publish-tags-hot-item").click(function () { $("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val() + " " + $(this).attr("title")); UpdateRecruitmentText(); }); } }); $("div#jobs-publish-text textarea").keydown(function () { UpdateJobsText(); }); $("div#recruitment-publish-text textarea").keydown(function () { UpdateRecruitmentText(); }); $("div#jobs-publish-text textarea").keyup(function () { UpdateJobsText(); }); $("div#recruitment-publish-text textarea").keyup(function () { UpdateRecruitmentText(); }); $("a#jobs-publish-quick").click(function () { ShowJobsPublish(); }); $("a#recruitment-publish-quick").click(function () { ShowRecruitmentPublish(); }); UpdateJobsText(); UpdateRecruitmentText(); } function UpdateJobsText() { if (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) { $("div#jobs-publish-remain").html("还可输入" + (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字"); } else { $("div#jobs-publish-remain").html("已超出" + (Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字"); } } function UpdateRecruitmentText() { if (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) { $("div#recruitment-publish-remain").html("还可输入" + (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字"); } else { $("div#recruitment-publish-remain").html("已超出" + (Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字"); } } function ShowJobsPublish() { $("div#cover").fadeIn(200); $("div#jobs-publish").fadeIn(200); $("div#jobs-publish-text textarea").focus(); } function HideJobsPublish() { $("div#cover").fadeOut(200); $("div#jobs-publish").fadeOut(200); } function ShowRecruitmentPublish() { $("div#cover").fadeIn(200); $("div#recruitment-publish").fadeIn(200); $("div#recruitment-publish-text textarea").focus(); } function HideRecruitmentPublish() { $("div#cover").fadeOut(200); $("div#recruitment-publish").fadeOut(200); } function Init() { auth = $.cookie("USER_AUTH"); if (auth == null) { logined = false; } else { logined = true; } if (logined) { AfterLogin(); } else { $(".logouted").fadeIn(300); } $("input#search-text").focusin(function () { $("#sorts").fadeOut(200); $(this).css("color", "#000000"); if ($(this).val() == "职位关键字,如:北京 产品经理 阿里巴巴") { $(this).val(""); } }); $("input#search-text").focusout(function () { $(this).css("color", "#adadad"); if ($(this).val() == "") { $(this).val("职位关键字,如:北京 产品经理 阿里巴巴"); } }); } function CoverResize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { if (document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; } if (xScroll < windowWidth) { pageWidth = xScroll; } else { pageWidth = windowWidth; } $("div#cover").css("height", "5000px"); $("div#cover").css("width", pageWidth + "px"); $("div#cover").animate({ opacity: 0.4 }, 0); }
JavaScript
var deleteitem; var deleteid; var deleteurl; var page = 0; var allpage = 0; var type = ""; $(function () { $("a#logo").mouseover(function () { $(this).html("回首页"); }); $("a#logo").mouseout(function () { $(this).html("测试版"); }); ShowNormal(0); $("a.manager-control").click(function () { $("a.manager-control").removeClass("manager-control-choose"); $(this).addClass("manager-control-choose"); }); $(".logined").show(); $("#delete-dialog").dialog({ autoOpen: false, draggable: false, resizable: false, width: 180, buttons: { "确定": function () { $(this).dialog("close"); var flag = false; $("div#pages").fadeOut(50); if (allpage > 1) { flag = true; } $.ajax({ type: "POST", url: deleteurl + deleteid, success: function (msg) { msg = $.trim(msg); if (msg == "" || msg == "0") { deleteitem.animate({ opacity: 0 }, 300, null, function () { deleteitem.slideUp(200, null, function () { if (type == "feedback") { if (flag) { $.ajax({ type: 'POST', url: 'feedback/show/' + page, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); $(".item-blog-title").unbind("click"); $(".item-blog-title").click(function () { var item = $(this).parent().next(".item-blog-content"); if (item.hasClass("close")) { item.slideDown(200); item.removeClass("close"); } else { item.slideUp(200); item.addClass("close"); } }); } }); } UpdateFeedback(); } else if (type == "tweet") { if (flag) { $.ajax({ type: 'POST', url: 'search/0', data: { page: page, admin: 1 }, success: function (msg) { var str = '<div class="microblog-item newer" style="display:none;"'; str += msg.split('<div class="microblog-item"')[10]; $("div.microblog-item:last").after(str); $(".newer:last").slideDown(200); } }); } UpdateNormal(); } }); }); } else { alert(msg); } } }); }, "取消": function () { $(this).dialog("close"); } } }); }); function ShowNormal(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'search/show/0/', data: { admin: 1, page: e }, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); //$("a.delete").click(function () { // deleteitem = $(this).parent().parent().parent(); // deleteid = deleteitem.attr("name"); // deleteurl = 'tweet/delete/'; // type = "tweet"; // $("#delete-dialog").dialog("open"); //}); UpdateNormal(); } }); } function DeleteTweet(id, d) { deleteitem = $(d).parent().parent().parent(); deleteid = id; deleteurl = 'tweet/delete/'; type = "tweet"; $("#delete-dialog").dialog("open"); } function UpdateNormal() { $.ajax({ type: "POST", url: 'search/count/0/', success: function (msg) { msg = $.trim(msg); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowNormal(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowNormal(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowNormal(page); $(window).scrollTop(0); }); } } }); } function ShowFeedback(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'feedback/show/' + e, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'feedback/delete/'; type = "feedback"; $("#delete-dialog").dialog("open"); }); $(".item-blog-title").click(function () { var item = $(this).parent().next(".item-blog-content"); if (item.hasClass("close")) { item.slideDown(200); item.removeClass("close"); } else { item.slideUp(200); item.addClass("close"); } }); UpdateFeedback(); } }); } function UpdateFeedback() { $.ajax({ type: "POST", url: 'feedback/show/count', success: function (msg) { msg = $.trim(msg); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowFeedback(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowFeedback(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowFeedback(page); $(window).scrollTop(0); }); } } }); } function ShowHot() { }
JavaScript
var allpage; var page; $(function () { $("#confirmBox_ok").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#confirmBox_ok").css("position", "fixed"); $("#confirmBox_del").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#confirmBox_del").css("position", "fixed"); $.ajax({ type: 'POST', url: 'avatar/', success: function (msg) { $("#headpic").attr("src", msg); } }); $("a.manager-control").click(function () { $("a.manager-control").removeClass("manager-control-choose"); $(this).addClass("manager-control-choose"); }); $("a#jobs-publish-button").click(function () { ShowJobsPublish(); }); $("a#recruitment-publish-button").click(function () { ShowRecruitmentPublish(); }); $("input.info-content-words").focusin(function () { $(this).addClass("info-content-words-focus"); if ($(this).val() == $(this).attr("title")) { $(this).val(""); } }); $("input.info-content-words").focusout(function () { $(this).removeClass("info-content-words-focus"); if ($(this).val() == "") { $(this).val($(this).attr("title")); } }); $("#search-text").keydown(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } }); $("#search-text").keyup(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } }); $("#search-text").keypress(function (e) { if (e.which == 13) { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") { location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + $("#sort").attr("name"); } } }); $("a#search-button").click(function () { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") { location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + $("#sort").attr("name"); } }); $("a.company-name").click(function () { var text = $(this).html(); location = "/?search=" + encodeURIComponent(text) + "&cat=0"; }); $("#birthday").datepicker({ changeMonth: true, changeYear: true }); editor = CKEDITOR.replace('profile-detail', { uiColor: '#d1e9f1', language: 'zh-cn', toolbar: [['NewPage', 'Save', 'Preview', '-', 'Templates'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], '/', ['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor']], resize_enabled: false, filebrowserBrowseUrl: 'ckfinder/ckfinder.html', filebrowserImageBrowseUrl: 'ckfinder/ckfinder.html?Type=Images', filebrowserImageUploadUrl: 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images' }); CKFinder.setupCKEditor(editor, "ckfinder/"); var sort = $.query.get("type"); if (sort == "profile") { ShowProfile(); $("a.manager-control").removeClass("manager-control-choose"); $("#myprofile").addClass("manager-control-choose"); } else { ShowNormal(0); } $("a#profile-save").click(function () { var show = 0; if ($("#info-pic-control input").attr("checked")) { show = 1; } else { show = 0; } $.ajax({ type: 'POST', url: 'resume/update', data: { name: $("#u-name").val(), sex: $("input[name='dsex']:checked=\"checked\"").val(), date_birth: $("#birthday").val(), live_in_now: $("#n-positon").val(), live_in: $("#o-positon").val(), cellphone: $("#m-phone").val(), email: $("#email").val(), show_avatar: show, content: editor.document.getBody().getHtml() }, success: function (msg) { $('#confirmBox_ok').show(); } }); }); $("a#profile-preview").click(function () { $("#h-name").val($("#u-name").val()); $("#h-sex").val($("input[name='dsex']:checked").val()); $("#date_birth").val($("#birthday").val()); $("#live_in_now").val($("#n-positon").val()); $("#live_in").val($("#o-positon").val()); $("#cellphone").val($("#m-phone").val()); $("#h-email").val($("#email").val()); $("#h-content").val(editor.document.getBody().getHtml()); if ($("#info-pic-control input").attr("checked")) { $("#h-avatar").val(1); } else { $("#h-avatar").val(0); } $("#ResumeForm").submit(); }); $("div.item").live("mouseover", function () { if ($(this).hasClass("item-noclose")) { $(this).addClass("item-over-noclose"); } else { $(this).addClass("item-over"); } }); $("div.item").live("mouseout", function () { if ($(this).hasClass("item-noclose")) { $(this).removeClass("item-over-noclose"); } else { $(this).removeClass("item-over"); } }); SetSorts(); $("#popBox_apply1").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#popBox_apply1").css("position", "fixed"); $("#popBox_apply0").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#popBox_apply0").css("position", "fixed"); }); function Delete() { var flag = false; $("div#pages").fadeOut(50); if (allpage > 1) { flag = true; } $.ajax({ type: "POST", url: deleteurl + deleteid, success: function () { deleteitem.animate({ opacity: 0 }, 300, null, function () { deleteitem.slideUp(200, null, function () { if (type == "apply") { if (flag) { $.ajax({ type: 'POST', url: 'apply_sent/show/', data: { page: page }, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); $("div.item-delete a").unbind("click"); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'apply_sent/delete/'; type = "apply"; $('#confirmBox_del').show(); }); } }); } UpdateApply(); } else if (type == "like") { if (flag) { $.ajax({ type: 'POST', url: 'like/show/', data: { page: page }, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); $("a.delete").unbind("click"); $("div.item-delete a").unbind("click"); $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $('#confirmBox_del').show(); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $('#confirmBox_del').show(); }); } }); } UpdateFavourite(); } else if (type == "tweet") { if (flag) { $.ajax({ type: 'POST', url: 'user/show/', data: { page: page }, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); $("a.delete").unbind("click"); $("div.item-delete a").unbind("click"); $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; type = "tweet"; $('#confirmBox_del').show(); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; $('#confirmBox_del').show(); }); } }); } UpdateTweet(); } }); }); $("#confirmBox_del").hide(); } }); } function AfterLogin() { $.ajax({ type: 'POST', url: '/user/info/', success: function (msg) { msg = $.trim(msg); var username = msg.split(',')[0]; var type = msg.split(',')[1]; $("#name").html(username); $("#my-microbloging").attr("href", "http://weibo.com/n/" + encodeURIComponent(username)); $("#name").attr("href", "profile/" + encodeURIComponent(username)); if (type == 1) { $(".jobs").show(); } else if (type == 2) { $(".recruitment").show(); } else if (type == 99) { $(".recruitment").show(); $(".admin").show(); } } }); } function ShowProfile() { $("div#profile").show(); $("div#blogs").hide(); $("div#profile-control").show(); $("div#ads").hide(); $.ajax({ type: 'GET', url: 'resume/show', success: function (msg) { if ($.trim(msg).indexOf('|') != -1) { $("#u-name").val(msg.split('|')[0]); $("input[name='dsex']").each(function () { if ($(this).val() == msg.split('|')[1]) { $(this).attr("checked", "checked"); } }); $("#birthday").val(msg.split('|')[2]); $("#n-positon").val(msg.split('|')[3]); $("#o-positon").val(msg.split('|')[4]); $("#m-phone").val(msg.split('|')[5]); $("#email").val(msg.split('|')[6]); if (msg.split('|')[7] == 0) { $("#info-pic-control input").removeAttr("checked"); } else { $("#info-pic-control input").attr("checked", "checked"); } var str = ""; for (s in msg.split('|')) { if (s == 8) { str += msg.split('|')[s]; } else if (s >= 8) { str += '|' + msg.split('|')[s]; } } editor.setData(str); } } }); } function SetContent(id, datas, item, count) { var current = datas.attr("name"); $.ajax({ type: 'POST', url: 'apply_received/show_tweet/' + id, data: { page: current }, success: function (msg) { item.html(msg); $("a.item-applys-read").each(function () { $(this).attr("href", "resume/show/" + $(this).parent().attr("id")); $(this).attr("target", "_blank"); $(this).click(function () { $(this).prev("span.item-applys-time:first").html($(this).prev("span.item-applys-time:first").html() + "(已阅)"); }); }); var allpage = 0; if (count % 10 == 0) { allpage = Math.floor(count / 10); } else { allpage = Math.floor(count / 10) + 1; } item.next(".item-page").html(''); if (allpage > 1) { if (current != allpage - 1) { item.next(".item-page").html('<a class="right">下一页</a>'); item.next(".item-page").children("a:first").click(function () { datas.attr("name", current + 1); SetContent(id, datas, item, count); }); } if (current != 0) { item.next(".item-page").html(item.next(".item-page").html() + '<a class="right">上一页</a>'); item.next(".item-page").children("a:last").click(function () { datas.attr("name", current - 1); SetContent(id, datas, item, count); }); } } item.slideDown(200); item.next(".item-page").slideDown(200); item.removeClass("close"); } }); } function UpdateApplys() { $.ajax({ type: "POST", url: 'apply_received/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowApplys(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowApplys(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowApplys(page); $(window).scrollTop(0); }); } } }); } function ShowApplys(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'apply_received/show/', data: { page: page }, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); $("a.applys").click(function () { var datas = $(this); var count = $(this).attr("id"); $(this).attr("name", "0"); var id = $(this).parent().parent().parent().attr("id"); var item = $(this).parent().next(".item-applys"); if (item.hasClass("close")) { SetContent(id, datas, item, count); } else { item.slideUp(200); item.next(".item-page").slideUp(200); item.addClass("close"); } }); UpdateApplys(); } }); } function ShowApply(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'apply_sent/show/', data: { page: page }, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'apply_sent/delete/'; type = "apply"; $('#confirmBox_del').show(); }); $(".job-closed").animate({ opacity: 0.4 }, 0); UpdateApply(); } }); } function UpdateApply() { $.ajax({ type: "POST", url: 'apply_sent/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowApply(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowApply(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowApply(page); $(window).scrollTop(0); }); } } }); } function ShowFavourite(e) { $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'like/show/', data: { page: e }, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $('#confirmBox_del').show(); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $('#confirmBox_del').show(); }); UpdateFavourite(); } }); } function UpdateFavourite() { $.ajax({ type: "POST", url: 'like/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowFavourite(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowFavourite(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowFavourite(page); $(window).scrollTop(0); }); } } }); } function ShowNormal(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'user/show', data: { page: page }, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; type = "tweet"; $('#confirmBox_del').show(); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; $('#confirmBox_del').show(); }); UpdateTweet(); } }); } function UpdateTweet() { $.ajax({ type: "POST", url: 'user/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowNormal(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowNormal(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowNormal(page); $(window).scrollTop(0); }); } } }); }
JavaScript
/** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ /** * Create a cookie with the given name and value and other optional parameters. * * @example $.cookie('the_cookie', 'the_value'); * @desc Set the value of a cookie. * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); * @desc Create a cookie with all available options. * @example $.cookie('the_cookie', 'the_value'); * @desc Create a session cookie. * @example $.cookie('the_cookie', null); * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain * used when the cookie was set. * * @param String name The name of the cookie. * @param String value The value of the cookie. * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. * If set to null or omitted, the cookie will be a session cookie and will not be retained * when the the browser exits. * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will * require a secure protocol (like HTTPS). * @type undefined * * @name $.cookie * @cat Plugins/Cookie * @author Klaus Hartl/klaus.hartl@stilbuero.de */ /** * Get the value of a cookie with the given name. * * @example $.cookie('the_cookie'); * @desc Get the value of a cookie. * * @param String name The name of the cookie. * @return The value of the cookie. * @type String * * @name $.cookie * @cat Plugins/Cookie * @author Klaus Hartl/klaus.hartl@stilbuero.de */ jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { // name and value given, set cookie options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE } // CAUTION: Needed to parenthesize options.path and options.domain // in the following expressions, otherwise they evaluate to undefined // in the packed version for some reason... var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { // only name given, get cookie var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } };
JavaScript
/** * jQuery.query - Query String Modification and Creation for jQuery * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). * Date: 2009/8/13 * * @author Blair Mitchelmore * @version 2.1.7 * **/ new function(settings) { // Various Settings var $separator = settings.separator || '&'; var $spaces = settings.spaces === false ? false : true; var $suffix = settings.suffix === false ? '' : '[]'; var $prefix = settings.prefix === false ? false : true; var $hash = $prefix ? settings.hash === true ? "#" : "?" : ""; var $numbers = settings.numbers === false ? false : true; jQuery.query = new function() { var is = function(o, t) { return o != undefined && o !== null && (!!t ? o.constructor == t : true); }; var parse = function(path) { var m, rx = /\[([^[]*)\]/g, match = /^([^[]+)(\[.*\])?$/.exec(path), base = match[1], tokens = []; while (m = rx.exec(match[2])) tokens.push(m[1]); return [base, tokens]; }; var set = function(target, tokens, value) { var o, token = tokens.shift(); if (typeof target != 'object') target = null; if (token === "") { if (!target) target = []; if (is(target, Array)) { target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value)); } else if (is(target, Object)) { var i = 0; while (target[i++] != null); target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value); } else { target = []; target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value)); } } else if (token && token.match(/^\s*[0-9]+\s*$/)) { var index = parseInt(token, 10); if (!target) target = []; target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value); } else if (token) { var index = token.replace(/^\s*|\s*$/g, ""); if (!target) target = {}; if (is(target, Array)) { var temp = {}; for (var i = 0; i < target.length; ++i) { temp[i] = target[i]; } target = temp; } target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value); } else { return value; } return target; }; var queryObject = function(a) { var self = this; self.keys = {}; if (a.queryObject) { jQuery.each(a.get(), function(key, val) { self.SET(key, val); }); } else { jQuery.each(arguments, function() { var q = "" + this; q = q.replace(/^[?#]/,''); // remove any leading ? || # q = q.replace(/[;&]$/,''); // remove any trailing & || ; if ($spaces) q = q.replace(/[+]/g,' '); // replace +'s with spaces jQuery.each(q.split(/[&;]/), function(){ var key = decodeURIComponent(this.split('=')[0] || ""); var val = decodeURIComponent(this.split('=')[1] || ""); if (!key) return; if ($numbers) { if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) // simple float regex val = parseFloat(val); else if (/^[+-]?[0-9]+$/.test(val)) // simple int regex val = parseInt(val, 10); } val = (!val && val !== 0) ? true : val; if (val !== false && val !== true && typeof val != 'number') val = val; self.SET(key, val); }); }); } return self; }; queryObject.prototype = { queryObject: true, has: function(key, type) { var value = this.get(key); return is(value, type); }, GET: function(key) { if (!is(key)) return this.keys; var parsed = parse(key), base = parsed[0], tokens = parsed[1]; var target = this.keys[base]; while (target != null && tokens.length != 0) { target = target[tokens.shift()]; } return typeof target == 'number' ? target : target || ""; }, get: function(key) { var target = this.GET(key); if (is(target, Object)) return jQuery.extend(true, {}, target); else if (is(target, Array)) return target.slice(0); return target; }, SET: function(key, val) { var value = !is(val) ? null : val; var parsed = parse(key), base = parsed[0], tokens = parsed[1]; var target = this.keys[base]; this.keys[base] = set(target, tokens.slice(0), value); return this; }, set: function(key, val) { return this.copy().SET(key, val); }, REMOVE: function(key) { return this.SET(key, null).COMPACT(); }, remove: function(key) { return this.copy().REMOVE(key); }, EMPTY: function() { var self = this; jQuery.each(self.keys, function(key, value) { delete self.keys[key]; }); return self; }, load: function(url) { var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1"); var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1"); return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash); }, empty: function() { return this.copy().EMPTY(); }, copy: function() { return new queryObject(this); }, COMPACT: function() { function build(orig) { var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig; if (typeof orig == 'object') { function add(o, key, value) { if (is(o, Array)) o.push(value); else o[key] = value; } jQuery.each(orig, function(key, value) { if (!is(value)) return true; add(obj, key, build(value)); }); } return obj; } this.keys = build(this.keys); return this; }, compact: function() { return this.copy().COMPACT(); }, toString: function() { var i = 0, queryString = [], chunks = [], self = this; var encode = function(str) { str = str + ""; if ($spaces) str = str.replace(/ /g, "+"); return encodeURIComponent(str); }; var addFields = function(arr, key, value) { if (!is(value) || value === false) return; var o = [encode(key)]; if (value !== true) { o.push("="); o.push(encode(value)); } arr.push(o.join("")); }; var build = function(obj, base) { var newKey = function(key) { return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join(""); }; jQuery.each(obj, function(key, value) { if (typeof value == 'object') build(value, newKey(key)); else addFields(chunks, newKey(key), value); }); }; build(this.keys); if (chunks.length > 0) queryString.push($hash); queryString.push(chunks.join($separator)); return queryString.join(""); } }; return new queryObject(location.search, location.hash); }; }(jQuery.query || {}); // Pass in jQuery.query as settings object
JavaScript
var deleteitem; var deleteid; var deleteurl; var page = 0; var allpage = 0; var type = ""; var editor; $(function () { $.ajax({ type: 'POST', url: 'avatar/', success: function (msg) { $("#headpic").attr("src", msg); } }); $("div#profile-info").dialog({ autoOpen: false, draggable: false, resizable: false, buttons: { "确定": function () { $(this).dialog("close"); } } }); // $("div#content-middle-delete a").animate({ opacity: 0.6 }, 0); // $("div#content-middle-delete a").mouseover(function () { // $(this).stop().animate({ opacity: 1 }, 200); // }); // $("div#content-middle-delete a").mouseout(function () { // $(this).stop().animate({ opacity: 0.6 }, 200); // }); $("a.manager-control").click(function () { $("a.manager-control").removeClass("manager-control-choose"); $(this).addClass("manager-control-choose"); }); $("a#jobs-publish-button").click(function () { ShowJobsPublish(); }); $("a#recruitment-publish-button").click(function () { ShowRecruitmentPublish(); }); $("input.info-content-words").focusin(function () { $(this).addClass("info-content-words-focus"); if ($(this).val() == $(this).attr("title")) { $(this).val(""); } }); $("input.info-content-words").focusout(function () { $(this).removeClass("info-content-words-focus"); if ($(this).val() == "") { $(this).val($(this).attr("title")); } }); $("#search-text").keydown(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } }); $("#search-text").keyup(function () { if ($(this).val().length > 32) { $(this).val($(this).val().substring(0, 32)); } }); $("#search-text").keypress(function (e) { if (e.which == 13) { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") { location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + cate; } } }); $("a#search-button").click(function () { if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") { location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + cate; } }); $("a.company-name").click(function () { var text = $(this).html(); location = "/?search=" + encodeURIComponent(text) + "&cat=0"; }); $("#birthday").datepicker({ changeMonth: true, changeYear: true }); editor = CKEDITOR.replace('profile-detail', { uiColor: '#d1e9f1', language: 'zh-cn', toolbar: [['NewPage', 'Save', 'Preview', '-', 'Templates'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], ['Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'], '/', ['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor']], resize_enabled: false, filebrowserBrowseUrl: 'ckfinder/ckfinder.html', filebrowserImageBrowseUrl: 'ckfinder/ckfinder.html?Type=Images', filebrowserImageUploadUrl: 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images' }); CKFinder.setupCKEditor(editor, "ckfinder/"); // $("div#info-pic a").click(function () { // var finder = new CKFinder(); // finder.basePath = 'ckfinder/'; // finder.selectActionFunction = SetFileField; // finder.popup(); // }); $("a#profile-save").click(function () { $.ajax({ type: 'POST', url: 'resume/add', data: { name: $("#u-name").val(), sex: $("input[name='dsex']:checked=\"checked\"").val(), date_birth: $("#birthday").val(), live_in_now: $("#n-positon").val(), live_in: $("#o-positon").val(), cellphone: $("#m-phone").val(), email: $("#email").val(), content: editor.document.getBody().getHtml() }, success: function (msg) { $("div#profile-info").dialog("open"); } }); }); $("a#profile-preview").click(function () { // $.ajax({ // type: 'POST', // url: 'resume/preview', // data: { // name: $("#u-name").val(), // sex: $("input[name='sex']:checked").val(), // date_birth: $("#birthday").val(), // live_in_now: $("#n-positon").val(), // live_in: $("#o-positon").val(), // cellphone: $("#m-phone").val(), // email: $("#email").val(), // content: editor.document.getBody().getHtml() // }, // success: function (msg) { // var obj = window.open("/resume"); // obj.document.write(msg); // } // }); $("#h-name").val($("#u-name").val()); $("#h-sex").val($("input[name='dsex']:checked").val()); $("#date_birth").val($("#birthday").val()); $("#live_in_now").val($("#n-positon").val()); $("#live_in").val($("#o-positon").val()); $("#cellphone").val($("#m-phone").val()); $("#h-email").val($("#email").val()); $("#h-content").val(editor.document.getBody().getHtml()); alert($("input[name='dsex']:checked").title); $("#ResumeForm").submit(); }); $("a.applys").click(function () { var item = $(this).parent().next(".item-applys"); if (item.hasClass("close")) { item.slideDown(200); item.removeClass("close"); } else { item.slideUp(200); item.addClass("close"); } }); // added 20110415 $("a.apply").live("click", function () { var item = $(this); var id = $(this).parent().parent().parent().attr("id"); $.ajax({ type: "POST", url: 'apply/add/' + id, success: function () { item.hide(); item.next("a.unapply").show(); } }); }); $("a.unapply").live("click", function () { var item = $(this); var id = $(this).parent().parent().parent().attr("id"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); $("div.item").live("mouseover", function () { $(this).addClass("item-over"); }); $("div.item").live("mouseout", function () { $(this).removeClass("item-over"); }); $("#delete-dialog").dialog({ autoOpen: false, draggable: false, resizable: false, width: 180, buttons: { "确定": function () { $(this).dialog("close"); var flag = false; $("div#pages").fadeOut(50); if (allpage > 1) { flag = true; } $.ajax({ type: "POST", url: deleteurl + deleteid, success: function () { deleteitem.animate({ opacity: 0 }, 300, null, function () { deleteitem.slideUp(200, null, function () { if (type == "apply") { if (flag) { $.ajax({ type: 'POST', url: 'apply/show/' + page, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); /* $("div.item").unbind("mouseover"); $("div.item").unbind("mouseout"); */ $("div.item-delete a").unbind("click"); /* $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); */ $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'apply/delete/'; type = "apply"; $("#delete-dialog").dialog("open"); }); } }); } UpdateApply(); } else if (type == "like") { if (flag) { $.ajax({ type: 'POST', url: 'like/show/' + page, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); /* $("a.apply").unbind("click"); $("a.unapply").unbind("click"); $("div.item").unbind("mouseover"); $("div.item").unbind("mouseout"); */ $("a.delete").unbind("click"); $("div.item-delete a").unbind("click"); /* $("a.apply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("id"); $.ajax({ type: "POST", url: 'apply/add/' + id, success: function () { item.hide(); item.next("a.unapply").show(); } }); }); $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("id"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); */ $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $("#delete-dialog").dialog("open"); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $("#delete-dialog").dialog("open"); }); } }); } UpdateFavourite(); } else if (type == "tweet") { if (flag) { $.ajax({ type: 'POST', url: 'user/current/0/' + page, success: function (msg) { var str = '<div class="item newer" style="display:none;"'; str += msg.split('<div class="item"')[10]; $("div.item:last").after(str); $(".newer:last").slideDown(200); /* $("div.item").unbind("mouseover"); $("div.item").unbind("mouseout"); */ $("a.delete").unbind("click"); $("div.item-delete a").unbind("click"); /* $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); */ $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; type = "tweet"; $("#delete-dialog").dialog("open"); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; $("#delete-dialog").dialog("open"); }); } }); } UpdateTweet(); } }); }); } }); }, "取消": function () { $(this).dialog("close"); } } }); var sort = $.query.get("type"); if (sort == "profile") { ShowProfile(); $("a.manager-control").removeClass("manager-control-choose"); $("#myprofile").addClass("manager-control-choose"); } else { ShowNormal(0); } }); function ShowProfile() { $("div#profile").show(); $("div#blogs").hide(); $("div#profile-control").show(); $("div#ads").hide(); $.ajax({ type: 'GET', url: 'resume/show', success: function (msg) { if ($.trim(msg).indexOf('|') != -1) { $("#u-name").val(msg.split('|')[0]); $("input[name='dsex']").val(msg.split('|')[1]); $("#birthday").val(msg.split('|')[2]); $("#n-positon").val(msg.split('|')[3]); $("#o-positon").val(msg.split('|')[4]); $("#m-phone").val(msg.split('|')[5]); $("#email").val(msg.split('|')[6]); var str = ""; for (s in msg.split('|')) { if (s == 7) { str += msg.split('|')[s]; } else if (s >= 7) { str += '|' + msg.split('|')[s]; } } editor.setData(str); } } }); } function SetContent(id, datas, item, count) { var current = datas.attr("name"); $.ajax({ type: 'POST', url: 'received/apply/' + id + "/" + current, success: function (msg) { item.html(msg); $("a.item-applys-read").each(function () { $(this).attr("href", "resume/show/" + $(this).parent().attr("id")); $(this).attr("target", "_blank"); }); var allpage = 0; if (count % 10 == 0) { allpage = Math.floor(count / 10); } else { allpage = Math.floor(count / 10) + 1; } item.next(".item-page").html(''); if (allpage > 1) { if (current != allpage - 1) { item.next(".item-page").html('<a class="right">下一页</a>'); item.next(".item-page").children("a:first").click(function () { datas.attr("name", current + 1); SetContent(id, datas, item, count); }); } if (current != 0) { item.next(".item-page").html(item.next(".item-page").html() + '<a class="right">上一页</a>'); item.next(".item-page").children("a:last").click(function () { datas.attr("name", current - 1); SetContent(id, datas, item, count); }); } } item.slideDown(200); item.next(".item-page").slideUp(200); item.removeClass("close"); } }); } function UpdateApplys() { $.ajax({ type: "POST", url: 'received/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowApplys(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowApplys(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowApplys(page); $(window).scrollTop(0); }); } } }); } function ShowApplys(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'received/' + e, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); $("a.applys").click(function () { var datas = $(this); var count = $(this).attr("id"); $(this).attr("name", "0"); var id = $(this).parent().parent().parent().attr("id"); var item = $(this).parent().next(".item-applys"); if (item.hasClass("close")) { SetContent(id, datas, item, count); } else { item.slideUp(200); item.next(".item-page").slideUp(200); item.addClass("close"); } }); UpdateApplys(); // $("div.item").mouseover(function () { // $(this).addClass("item-over"); // }); // $("div.item").mouseout(function () { // $(this).removeClass("item-over"); // }); // $("div.item-delete a").click(function () { // deleteitem = $(this).parent().parent(); // deleteid = deleteitem.attr("id"); // deleteurl = 'apply/delete/'; // type = "apply"; // $("#delete-dialog").dialog("open"); // }); // UpdateApply(); } }); } function ShowApply(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'apply/show/' + e, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); /* $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); */ $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'apply/delete/'; type = "apply"; $("#delete-dialog").dialog("open"); }); $(".job-closed").animate({ opacity: 0.4 }, 0); UpdateApply(); } }); } function UpdateApply() { $.ajax({ type: "POST", url: 'apply/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowApply(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowApply(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowApply(page); $(window).scrollTop(0); }); } } }); } function ShowFavourite(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'like/show/' + e, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); /* $("a.apply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("id"); $.ajax({ type: "POST", url: 'apply/add/' + id, success: function () { item.hide(); item.next("a.unapply").show(); } }); }); $("a.unapply").click(function () { var item = $(this); var id = $(this).parent().parent().parent().attr("id"); $.ajax({ type: "POST", url: 'apply/delete/' + id, success: function () { item.hide(); item.prev("a.apply").show(); } }); }); $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); */ $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $("#delete-dialog").dialog("open"); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'like/delete/'; type = "like"; $("#delete-dialog").dialog("open"); }); UpdateFavourite(); } }); } function UpdateFavourite() { $.ajax({ type: "POST", url: 'like/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowFavourite(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowFavourite(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowFavourite(page); $(window).scrollTop(0); }); } } }); } function ShowNormal(e) { page = e; $("div#profile").hide(); $("div#blogs").show(); $("div#profile-control").hide(); $("div#ads").show(); $.ajax({ type: 'POST', url: 'user/current/0/' + e, success: function (msg) { $("div#pages").fadeOut(50); $("div#blogsinner").html(msg); /* $("div.item").mouseover(function () { $(this).addClass("item-over"); }); $("div.item").mouseout(function () { $(this).removeClass("item-over"); }); */ $("a.delete").click(function () { deleteitem = $(this).parent().parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; type = "tweet"; $("#delete-dialog").dialog("open"); }); $("div.item-delete a").click(function () { deleteitem = $(this).parent().parent(); deleteid = deleteitem.attr("id"); deleteurl = 'tweet/delete/'; $("#delete-dialog").dialog("open"); }); UpdateTweet(); } }); } function UpdateTweet() { $.ajax({ type: "POST", url: 'user/current/0/count', success: function (msg) { msg = $.trim(msg); $("span#blogs-count").html("共有" + msg + "条记录"); if (msg % 10 == 0) { allpage = Math.floor(msg / 10); } else { allpage = Math.floor(msg / 10) + 1; } if (allpage > 0) { prevLess = false; nextLess = false; var str = '<div id="pages-inner" class="right">'; if (page != 0) { str += '<a class="page-control left" id="prevPage">上一页</a>'; } for (i = 0; i < allpage; i++) { if (!prevLess && i - page < -2) { if (i == 0) { str += '<a class="page-number left">' + (i + 1) + '</a>'; } else { prevLess = true; str += '<span class="left">...</span>'; } } if (Math.abs(i - page) <= 2) { if (i == page) { str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>'; } else { str += '<a class="page-number left">' + (i + 1) + '</a>'; } } if (i == allpage - 1 && i - page > 2) { str += '<a class="page-number left">' + (i + 1) + '</a>'; nextLess = true; } if (!nextLess && i - page > 2) { nextLess = true; str += '<span class="left">...</span>'; } } if (page != allpage - 1) { str += '<a class="page-control left" id="nextPage">下一页</a>'; } str += '</div>'; $("div#pages").html(str); $("div#pages").fadeIn(200); $("a.page-number").click(function () { page = $(this).html() - 1; ShowNormal(page); $(window).scrollTop(0); }); $("a#prevPage").click(function () { page--; ShowNormal(page); $(window).scrollTop(0); }); $("a#nextPage").click(function () { page++; ShowNormal(page); $(window).scrollTop(0); }); } } }); } function AfterLogin() { $.ajax({ type: 'POST', url: 'info/', success: function (msg) { $(".logined").fadeIn(300); $("a#name").html(msg.split(',')[0]); $("div#links a:last").attr("href", "profile/" + msg.split(',')[0]); var type = msg.split(',')[1]; if (type == 1) { $(".jobs").fadeIn(300); $(".recruitment").hide(); $(".admin").hide(); } else if (type == 2) { $(".recruitment").fadeIn(300); $(".jobs").hide(); $(".admin").hide(); } else if (type == 0) { $(".admin").show(); $(".jobs").hide(); $(".recruitment").show(); } } }); } function SetFileField(fileUrl) { $("div#info-pic img").attr("src", fileUrl); }
JavaScript
//User Login - share.js var logined = false; var rolekind = ""; function showError(msg){ $("#errormsg").html(msg); $("#error-info").dialog("open"); } $(function () { $("#error-info").dialog({ autoOpen: false, draggable: false, resizable: false, modal: true, buttons: { "确定": function () { $(this).dialog("close"); } } }); $("#logo").mouseover(function () { $(this).html("回首页"); }); $("#logo").mouseout(function () { $(this).html("测试版"); }); InitUser(); SetPublish(); $("input#search-text").focusin(function () { $("#sorts").fadeOut(200); $(this).css("color", "#000000"); if ($(this).val() == "职位关键字,如:北京 产品经理 阿里巴巴") { $(this).val(""); } }); $("input#search-text").focusout(function () { $(this).css("color", "#adadad"); if ($(this).val() == "") { $(this).val("职位关键字,如:北京 产品经理 阿里巴巴"); } }); }); function InitUser() { auth = $.cookie("USER_AUTH"); if (auth == null) { logined = false; } else { logined = true; } if (logined) { $(".logined").show(); AfterLogin(); } else { $(".logouted").show(); } } //End of User Login function CoverResize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { if (document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; } if (xScroll < windowWidth) { pageWidth = xScroll; } else { pageWidth = windowWidth; } $("body").css("overflow", "hidden"); $("div#cover").css("height", pageHeight + "px"); $("div#cover").css("width", pageWidth + "px"); $("div#cover").animate({ opacity: 0.4 }, 0); } function SetPublish() { $("#popBox_publishok").position({ of: $("html"), my: "center top", at: "center top", offset: "0 200", collision: "none none" }); $("#popBox_publishok").css("position", "fixed"); $("div#jobs-publish").position({ of: $("body"), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("div#recruitment-publish").position({ of: $("body"), my: "center top", at: "center top", offset: "0 130", collision: "none none" }); $("div#jobs-publish-title a").click(function () { HideJobsPublish(); }); $("div#recruitment-publish-title a").click(function () { HideRecruitmentPublish(); }); $("div#jobs-publish-confirm a").click(function () { $.ajax({ type: 'POST', url: 'tweet/post/1', data: { text: $("div#jobs-publish-text textarea").val() }, success: function (msg) { if ($.trim(msg) != "0" && $.trim(msg) != "") { showError(msg); } HideJobsPublish(); $("#popBox_publishok").show(); } }); }); $("div#recruitment-publish-confirm a").click(function () { $("#RecruitmentForm").submit(); HideRecruitmentPublish(); var $window = jQuery(window); var temp = ($window.width() - 50) / 2; var controlx = temp >= 0 ? temp : 0; temp = ($window.height() - 50) / 2; var controly = $window.scrollTop() + (temp >= 0 ? temp : 0); $("#LFlower").html('<img style="margin-top:9px;margin-left:9px;" src="images/loading.gif" alt="" />'); $("#LFlower").css({ left: controlx + 'px', top: controly + 'px', height: '50px', width: '50px' }); $("#LFlower").fadeIn(200); $("div#cover").fadeIn(200); $("#hf").load(function(){ if ($.trim($("#hf").contents().find("body").html()) != "0" && $.trim($("#hf").contents().find("body").html()) != "") { showError($.trim($("#hf").contents().find("body").html())); //alert(msg); }else{ $("#LFlower").fadeOut(200); $("div#cover").fadeOut(200); $("#popBox_publishok").show(); } }); }); //Jobs Hot Tags $.ajax({ type: 'POST', url: 'hot/tag/1', success: function (msg) { $("div#jobs-publish-tags-hot").html(msg); $("a.jobs-publish-tags-hot-item").click(function () { $("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val() + " " + $(this).attr("title")); UpdateJobsText(); $("div#jobs-publish-text textarea").focus(); $("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val()); }); } }); //Recruitment Hot Tags $.ajax({ type: 'POST', url: 'hot/tag/2', success: function (msg) { $("div#recruitment-publish-tags-hot").html(msg); $("a.recruitment-publish-tags-hot-item").click(function () { $("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val() + " " + $(this).attr("title")); UpdateRecruitmentText(); $("div#recruitment-publish-text textarea").focus(); $("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val()); }); } }); $("div#jobs-publish-text textarea").keydown(function () { UpdateJobsText(); }); $("div#recruitment-publish-text textarea").keydown(function () { UpdateRecruitmentText(); }); $("div#jobs-publish-text textarea").keyup(function () { UpdateJobsText(); }); $("div#recruitment-publish-text textarea").keyup(function () { UpdateRecruitmentText(); }); $("a#jobs-publish-quick").click(function () { ShowJobsPublish(); }); $("a#recruitment-publish-quick").click(function () { ShowRecruitmentPublish(); }); UpdateJobsText(); UpdateRecruitmentText(); } function UpdateJobsText() { if (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) { $("div#jobs-publish-remain").html("还可输入" + (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字"); } else { $("div#jobs-publish-remain").html("已超出" + (Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字"); } } function UpdateRecruitmentText() { if (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) { $("div#recruitment-publish-remain").html("还可输入" + (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字"); } else { $("div#recruitment-publish-remain").html("已超出" + (Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字"); } } function ShowJobsPublish() { CoverResize(); $("div#cover").fadeIn(200); $("body").css("overflow", "hidden"); $("div#jobs-publish").fadeIn(200); $("div#jobs-publish-text textarea").focus(); $("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val()); // $("div#jobs-publish-text textarea").val("??"); } function HideJobsPublish() { $("div#cover").fadeOut(200); $("body").css("overflow", "auto"); $("div#jobs-publish").fadeOut(200); } function ShowRecruitmentPublish() { CoverResize(); $("div#cover").fadeIn(200); $("body").css("overflow", "hidden"); $("div#recruitment-publish").fadeIn(200); $("div#recruitment-publish-text textarea").focus(); $("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val()); } function HideRecruitmentPublish() { $("div#cover").fadeOut(200); $("body").css("overflow", "auto"); $("div#recruitment-publish").fadeOut(200); }
JavaScript
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ // Compressed version of core/ckeditor_base.js. See original for instructions. /*jsl:ignore*/ if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.5.2',revision:'6450',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})(); /*jsl:end*/ // Uncomment the following line to have a new timestamp generated for each // request, having clear cache load of the editor code. // CKEDITOR.timestamp = ( new Date() ).valueOf(); if ( CKEDITOR.loader ) CKEDITOR.loader.load( 'core/ckeditor' ); else { // Set the script name to be loaded by the loader. CKEDITOR._autoLoad = 'core/ckeditor'; // Include the loader script. document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' ); }
JavaScript
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function (config) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.font_names = '宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;' + config.font_names; };
JavaScript
/* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang('placeholder','en',{placeholder:{title:'Placeholder Properties',toolbar:'Create Placeholder',text:'Placeholder Text',edit:'Edit Placeholder',textMissing:'The placeholder must contain text.'}});
JavaScript