code
stringlengths
1
2.08M
language
stringclasses
1 value
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { /** * A lightweight representation of HTML text. * @constructor * @example */ CKEDITOR.htmlParser.cdata = function( value ) { /** * The CDATA value. * @type String * @example */ this.value = value; }; CKEDITOR.htmlParser.cdata.prototype = { /** * CDATA has the same type as {@link CKEDITOR.htmlParser.text} This is * a constant value set to {@link CKEDITOR.NODE_TEXT}. * @type Number * @example */ type : CKEDITOR.NODE_TEXT, /** * Writes write the CDATA with no special manipulations. * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. */ writeHtml : function( writer ) { writer.write( this.value ); } }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { /** * A lightweight representation of HTML text. * @constructor * @example */ CKEDITOR.htmlParser.text = function( value ) { /** * The text value. * @type String * @example */ this.value = value; /** @private */ this._ = { isBlockLike : false }; }; CKEDITOR.htmlParser.text.prototype = { /** * The node type. This is a constant value set to {@link CKEDITOR.NODE_TEXT}. * @type Number * @example */ type : CKEDITOR.NODE_TEXT, /** * Writes the HTML representation of this text to a CKEDITOR.htmlWriter. * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. * @example */ writeHtml : function( writer, filter ) { var text = this.value; if ( filter && !( text = filter.onText( text, this ) ) ) return; writer.text( text ); } }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass( { $ : function() { this._ = { output : [] }; }, proto : { /** * Writes the tag opening part for a opener tag. * @param {String} tagName The element name for this tag. * @param {Object} attributes The attributes defined for this tag. The * attributes could be used to inspect the tag. * @example * // Writes "&lt;p". * writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } ); */ openTag : function( tagName, attributes ) { this._.output.push( '<', tagName ); }, /** * Writes the tag closing part for a opener tag. * @param {String} tagName The element name for this tag. * @param {Boolean} isSelfClose Indicates that this is a self-closing tag, * like "br" or "img". * @example * // Writes "&gt;". * writer.openTagClose( 'p', false ); * @example * // Writes " /&gt;". * writer.openTagClose( 'br', true ); */ openTagClose : function( tagName, isSelfClose ) { if ( isSelfClose ) this._.output.push( ' />' ); else this._.output.push( '>' ); }, /** * Writes an attribute. This function should be called after opening the * tag with {@link #openTagClose}. * @param {String} attName The attribute name. * @param {String} attValue The attribute value. * @example * // Writes ' class="MyClass"'. * writer.attribute( 'class', 'MyClass' ); */ attribute : function( attName, attValue ) { // Browsers don't always escape special character in attribute values. (#4683, #4719). if ( typeof attValue == 'string' ) attValue = CKEDITOR.tools.htmlEncodeAttr( attValue ); this._.output.push( ' ', attName, '="', attValue, '"' ); }, /** * Writes a closer tag. * @param {String} tagName The element name for this tag. * @example * // Writes "&lt;/p&gt;". * writer.closeTag( 'p' ); */ closeTag : function( tagName ) { this._.output.push( '</', tagName, '>' ); }, /** * Writes text. * @param {String} text The text value * @example * // Writes "Hello Word". * writer.text( 'Hello Word' ); */ text : function( text ) { this._.output.push( text ); }, /** * Writes a comment. * @param {String} comment The comment text. * @example * // Writes "&lt;!-- My comment --&gt;". * writer.comment( ' My comment ' ); */ comment : function( comment ) { this._.output.push( '<!--', comment, '-->' ); }, /** * Writes any kind of data to the ouput. * @example * writer.write( 'This is an &lt;b&gt;example&lt;/b&gt;.' ); */ write : function( data ) { this._.output.push( data ); }, /** * Empties the current output buffer. * @example * writer.reset(); */ reset : function() { this._.output = []; this._.indent = false; }, /** * Empties the current output buffer. * @param {Boolean} reset Indicates that the {@link reset} function is to * be automatically called after retrieving the HTML. * @returns {String} The HTML written to the writer so far. * @example * var html = writer.getHtml(); */ getHtml : function( reset ) { var html = this._.output.join( '' ); if ( reset ) this.reset(); return html; } } });
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * A lightweight representation of an HTML DOM structure. * @constructor * @example */ CKEDITOR.htmlParser.fragment = function() { /** * The nodes contained in the root of this fragment. * @type Array * @example * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<b>Sample</b> Text' ); * alert( fragment.children.length ); "2" */ this.children = []; /** * Get the fragment parent. Should always be null. * @type Object * @default null * @example */ this.parent = null; /** @private */ this._ = { isBlockLike : true, hasInlineStarted : false }; }; (function() { // Block-level elements whose internal structure should be respected during // parser fixing. var nonBreakingBlocks = CKEDITOR.tools.extend( { table:1,ul:1,ol:1,dl:1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl ); // IE < 8 don't output the close tag on definition list items. (#6975) var optionalCloseTags = CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? { dd : 1, dt :1 } : {}; var listBlocks = { ol:1, ul:1 }; // Dtd of the fragment element, basically it accept anything except for intermediate structure, e.g. orphan <li>. var rootDtd = CKEDITOR.tools.extend( {}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style:1,script:1 } ); function isRemoveEmpty( node ) { // Empty link is to be removed when empty but not anchor. (#7894) return node.name == 'a' && node.attributes.href || CKEDITOR.dtd.$removeEmpty[ node.name ]; } /** * Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string. * @param {String} fragmentHtml The HTML to be parsed, filling the fragment. * @param {Number} [fixForBody=false] Wrap body with specified element if needed. * @param {CKEDITOR.htmlParser.element} contextNode Parse the html as the content of this element. * @returns CKEDITOR.htmlParser.fragment The fragment created. * @example * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<b>Sample</b> Text' ); * alert( fragment.children[0].name ); "b" * alert( fragment.children[1].value ); " Text" */ CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml, fixForBody, contextNode ) { var parser = new CKEDITOR.htmlParser(), fragment = contextNode || new CKEDITOR.htmlParser.fragment(), pendingInline = [], pendingBRs = [], currentNode = fragment, // Indicate we're inside a <textarea> element, spaces should be touched differently. inTextarea = false, // Indicate we're inside a <pre> element, spaces should be touched differently. inPre = false; function checkPending( newTagName ) { var pendingBRsSent; if ( pendingInline.length > 0 ) { for ( var i = 0 ; i < pendingInline.length ; i++ ) { var pendingElement = pendingInline[ i ], pendingName = pendingElement.name, pendingDtd = CKEDITOR.dtd[ pendingName ], currentDtd = currentNode.name && CKEDITOR.dtd[ currentNode.name ]; if ( ( !currentDtd || currentDtd[ pendingName ] ) && ( !newTagName || !pendingDtd || pendingDtd[ newTagName ] || !CKEDITOR.dtd[ newTagName ] ) ) { if ( !pendingBRsSent ) { sendPendingBRs(); pendingBRsSent = 1; } // Get a clone for the pending element. pendingElement = pendingElement.clone(); // Add it to the current node and make it the current, // so the new element will be added inside of it. pendingElement.parent = currentNode; currentNode = pendingElement; // Remove the pending element (back the index by one // to properly process the next entry). pendingInline.splice( i, 1 ); i--; } else { // Some element of the same type cannot be nested, flat them, // e.g. <a href="#">foo<a href="#">bar</a></a>. (#7894) if ( pendingName == currentNode.name ) addElement( currentNode, currentNode.parent, 1 ), i--; } } } } function sendPendingBRs() { while ( pendingBRs.length ) currentNode.add( pendingBRs.shift() ); } /* * Beside of simply append specified element to target, this function also takes * care of other dirty lifts like forcing block in body, trimming spaces at * the block boundaries etc. * * @param {Element} element The element to be added as the last child of {@link target}. * @param {Element} target The parent element to relieve the new node. * @param {Boolean} [moveCurrent=false] Don't change the "currentNode" global unless * there's a return point node specified on the element, otherwise move current onto {@link target} node. */ function addElement( element, target, moveCurrent ) { // Ignore any element that has already been added. if ( element.previous !== undefined ) return; target = target || currentNode || fragment; // Current element might be mangled by fix body below, // save it for restore later. var savedCurrent = currentNode; // If the target is the fragment and this inline element can't go inside // body (if fixForBody). if ( fixForBody && ( !target.type || target.name == 'body' ) ) { var elementName, realElementName; if ( element.attributes && ( realElementName = element.attributes[ 'data-cke-real-element-type' ] ) ) elementName = realElementName; else elementName = element.name; if ( elementName && !( elementName in CKEDITOR.dtd.$body || elementName == 'body' || element.isOrphan ) ) { // Create a <p> in the fragment. currentNode = target; parser.onTagOpen( fixForBody, {} ); // The new target now is the <p>. element.returnPoint = target = currentNode; } } // Rtrim empty spaces on block end boundary. (#3585) if ( element._.isBlockLike && element.name != 'pre' && element.name != 'textarea' ) { var length = element.children.length, lastChild = element.children[ length - 1 ], text; if ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT ) { if ( !( text = CKEDITOR.tools.rtrim( lastChild.value ) ) ) element.children.length = length -1; else lastChild.value = text; } } target.add( element ); if ( element.name == 'pre' ) inPre = false; if ( element.name == 'textarea' ) inTextarea = false; if ( element.returnPoint ) { currentNode = element.returnPoint; delete element.returnPoint; } else currentNode = moveCurrent ? target : savedCurrent; } parser.onTagOpen = function( tagName, attributes, selfClosing, optionalClose ) { var element = new CKEDITOR.htmlParser.element( tagName, attributes ); // "isEmpty" will be always "false" for unknown elements, so we // must force it if the parser has identified it as a selfClosing tag. if ( element.isUnknown && selfClosing ) element.isEmpty = true; // Check for optional closed elements, including browser quirks and manually opened blocks. element.isOptionalClose = tagName in optionalCloseTags || optionalClose; // This is a tag to be removed if empty, so do not add it immediately. if ( isRemoveEmpty( element ) ) { pendingInline.push( element ); return; } else if ( tagName == 'pre' ) inPre = true; else if ( tagName == 'br' && inPre ) { currentNode.add( new CKEDITOR.htmlParser.text( '\n' ) ); return; } else if ( tagName == 'textarea' ) inTextarea = true; if ( tagName == 'br' ) { pendingBRs.push( element ); return; } while( 1 ) { var currentName = currentNode.name; var currentDtd = currentName ? ( CKEDITOR.dtd[ currentName ] || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) ) : rootDtd; // If the element cannot be child of the current element. if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] ) { // Current node doesn't have a close tag, time for a close // as this element isn't fit in. (#7497) if ( currentNode.isOptionalClose ) parser.onTagClose( currentName ); // Fixing malformed nested lists by moving it into a previous list item. (#3828) else if ( tagName in listBlocks && currentName in listBlocks ) { var children = currentNode.children, lastChild = children[ children.length - 1 ]; // Establish the list item if it's not existed. if ( !( lastChild && lastChild.name == 'li' ) ) addElement( ( lastChild = new CKEDITOR.htmlParser.element( 'li' ) ), currentNode ); !element.returnPoint && ( element.returnPoint = currentNode ); currentNode = lastChild; } // Establish new list root for orphan list items. else if ( tagName in CKEDITOR.dtd.$listItem && currentName != tagName ) parser.onTagOpen( tagName == 'li' ? 'ul' : 'dl', {}, 0, 1 ); // We're inside a structural block like table and list, AND the incoming element // is not of the same type (e.g. <td>td1<td>td2</td>), we simply add this new one before it, // and most importantly, return back to here once this element is added, // e.g. <table><tr><td>td1</td><p>p1</p><td>td2</td></tr></table> else if ( currentName in nonBreakingBlocks && currentName != tagName ) { !element.returnPoint && ( element.returnPoint = currentNode ); currentNode = currentNode.parent; } else { // The current element is an inline element, which // need to be continued even after the close, so put // it in the pending list. if ( currentName in CKEDITOR.dtd.$inline ) pendingInline.unshift( currentNode ); // The most common case where we just need to close the // current one and append the new one to the parent. if ( currentNode.parent ) addElement( currentNode, currentNode.parent, 1 ); // We've tried our best to fix the embarrassment here, while // this element still doesn't find it's parent, mark it as // orphan and show our tolerance to it. else { element.isOrphan = 1; break; } } } else break; } checkPending( tagName ); sendPendingBRs(); element.parent = currentNode; if ( element.isEmpty ) addElement( element ); else currentNode = element; }; parser.onTagClose = function( tagName ) { // Check if there is any pending tag to be closed. for ( var i = pendingInline.length - 1 ; i >= 0 ; i-- ) { // If found, just remove it from the list. if ( tagName == pendingInline[ i ].name ) { pendingInline.splice( i, 1 ); return; } } var pendingAdd = [], newPendingInline = [], candidate = currentNode; while ( candidate != fragment && candidate.name != tagName ) { // If this is an inline element, add it to the pending list, if we're // really closing one of the parents element later, they will continue // after it. if ( !candidate._.isBlockLike ) newPendingInline.unshift( candidate ); // This node should be added to it's parent at this point. But, // it should happen only if the closing tag is really closing // one of the nodes. So, for now, we just cache it. pendingAdd.push( candidate ); // Make sure return point is properly restored. candidate = candidate.returnPoint || candidate.parent; } if ( candidate != fragment ) { // Add all elements that have been found in the above loop. for ( i = 0 ; i < pendingAdd.length ; i++ ) { var node = pendingAdd[ i ]; addElement( node, node.parent ); } currentNode = candidate; if ( candidate._.isBlockLike ) sendPendingBRs(); addElement( candidate, candidate.parent ); // The parent should start receiving new nodes now, except if // addElement changed the currentNode. if ( candidate == currentNode ) currentNode = currentNode.parent; pendingInline = pendingInline.concat( newPendingInline ); } if ( tagName == 'body' ) fixForBody = false; }; parser.onText = function( text ) { // Trim empty spaces at beginning of text contents except <pre> and <textarea>. if ( ( !currentNode._.hasInlineStarted || pendingBRs.length ) && !inPre && !inTextarea ) { text = CKEDITOR.tools.ltrim( text ); if ( text.length === 0 ) return; } var currentName = currentNode.name, currentDtd = currentName ? ( CKEDITOR.dtd[ currentName ] || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) ) : rootDtd; // Fix orphan text in list/table. (#8540) (#8870) if ( !inTextarea && !currentDtd [ '#' ] && currentName in nonBreakingBlocks ) { parser.onTagOpen( currentName in listBlocks ? 'li' : currentName == 'dl' ? 'dd' : currentName == 'table' ? 'tr' : currentName == 'tr' ? 'td' : '' ); parser.onText( text ); return; } sendPendingBRs(); checkPending(); if ( fixForBody && ( !currentNode.type || currentNode.name == 'body' ) && CKEDITOR.tools.trim( text ) ) { this.onTagOpen( fixForBody, {}, 0, 1 ); } // Shrinking consequential spaces into one single for all elements // text contents. if ( !inPre && !inTextarea ) text = text.replace( /[\t\r\n ]{2,}|[\t\r\n]/g, ' ' ); currentNode.add( new CKEDITOR.htmlParser.text( text ) ); }; parser.onCDATA = function( cdata ) { currentNode.add( new CKEDITOR.htmlParser.cdata( cdata ) ); }; parser.onComment = function( comment ) { sendPendingBRs(); checkPending(); currentNode.add( new CKEDITOR.htmlParser.comment( comment ) ); }; // Parse it. parser.parse( fragmentHtml ); // Send all pending BRs except one, which we consider a unwanted bogus. (#5293) sendPendingBRs( !CKEDITOR.env.ie && 1 ); // Close all pending nodes, make sure return point is properly restored. while ( currentNode != fragment ) addElement( currentNode, currentNode.parent, 1 ); return fragment; }; CKEDITOR.htmlParser.fragment.prototype = { /** * Adds a node to this fragment. * @param {Object} node The node to be added. It can be any of of the * following types: {@link CKEDITOR.htmlParser.element}, * {@link CKEDITOR.htmlParser.text} and * {@link CKEDITOR.htmlParser.comment}. * @param {Number} [index] From where the insertion happens. * @example */ add : function( node, index ) { isNaN( index ) && ( index = this.children.length ); var previous = index > 0 ? this.children[ index - 1 ] : null; if ( previous ) { // If the block to be appended is following text, trim spaces at // the right of it. if ( node._.isBlockLike && previous.type == CKEDITOR.NODE_TEXT ) { previous.value = CKEDITOR.tools.rtrim( previous.value ); // If we have completely cleared the previous node. if ( previous.value.length === 0 ) { // Remove it from the list and add the node again. this.children.pop(); this.add( node ); return; } } previous.next = node; } node.previous = previous; node.parent = this; this.children.splice( index, 0, node ); this._.hasInlineStarted = node.type == CKEDITOR.NODE_TEXT || ( node.type == CKEDITOR.NODE_ELEMENT && !node._.isBlockLike ); }, /** * Writes the fragment HTML to a CKEDITOR.htmlWriter. * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. * @example * var writer = new CKEDITOR.htmlWriter(); * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '&lt;P&gt;&lt;B&gt;Example' ); * fragment.writeHtml( writer ) * alert( writer.getHtml() ); "&lt;p&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/p&gt;" */ writeHtml : function( writer, filter ) { var isChildrenFiltered; this.filterChildren = function() { var writer = new CKEDITOR.htmlParser.basicWriter(); this.writeChildrenHtml.call( this, writer, filter, true ); var html = writer.getHtml(); this.children = new CKEDITOR.htmlParser.fragment.fromHtml( html ).children; isChildrenFiltered = 1; }; // Filtering the root fragment before anything else. !this.name && filter && filter.onFragment( this ); this.writeChildrenHtml( writer, isChildrenFiltered ? null : filter ); }, writeChildrenHtml : function( writer, filter ) { for ( var i = 0 ; i < this.children.length ; i++ ) this.children[i].writeHtml( writer, filter ); } }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * A lightweight representation of an HTML element. * @param {String} name The element name. * @param {Object} attributes And object holding all attributes defined for * this element. * @constructor * @example */ CKEDITOR.htmlParser.element = function( name, attributes ) { /** * The element name. * @type String * @example */ this.name = name; /** * Holds the attributes defined for this element. * @type Object * @example */ this.attributes = attributes || ( attributes = {} ); /** * The nodes that are direct children of this element. * @type Array * @example */ this.children = []; var tagName = attributes[ 'data-cke-real-element-type' ] || name || ''; // Reveal the real semantic of our internal custom tag name (#6639). var internalTag = tagName.match( /^cke:(.*)/ ); internalTag && ( tagName = internalTag[ 1 ] ); var dtd = CKEDITOR.dtd, isBlockLike = !!( dtd.$nonBodyContent[ tagName ] || dtd.$block[ tagName ] || dtd.$listItem[ tagName ] || dtd.$tableContent[ tagName ] || dtd.$nonEditable[ tagName ] || tagName == 'br' ), isEmpty = !!dtd.$empty[ name ]; this.isEmpty = isEmpty; this.isUnknown = !dtd[ name ]; /** @private */ this._ = { isBlockLike : isBlockLike, hasInlineStarted : isEmpty || !isBlockLike }; }; /** * Object presentation of CSS style declaration text. * @param {CKEDITOR.htmlParser.element|String} elementOrStyleText A html parser element or the inline style text. */ CKEDITOR.htmlParser.cssStyle = function() { var styleText, arg = arguments[ 0 ], rules = {}; styleText = arg instanceof CKEDITOR.htmlParser.element ? arg.attributes.style : arg; // html-encoded quote might be introduced by 'font-family' // from MS-Word which confused the following regexp. e.g. //'font-family: &quot;Lucida, Console&quot;' ( styleText || '' ) .replace( /&quot;/g, '"' ) .replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function( match, name, value ) { name == 'font-family' && ( value = value.replace( /["']/g, '' ) ); rules[ name.toLowerCase() ] = value; }); return { rules : rules, /** * Apply the styles onto the specified element or object. * @param {CKEDITOR.htmlParser.element|CKEDITOR.dom.element|Object} obj */ populate : function( obj ) { var style = this.toString(); if ( style ) { obj instanceof CKEDITOR.dom.element ? obj.setAttribute( 'style', style ) : obj instanceof CKEDITOR.htmlParser.element ? obj.attributes.style = style : obj.style = style; } }, toString : function() { var output = []; for ( var i in rules ) rules[ i ] && output.push( i, ':', rules[ i ], ';' ); return output.join( '' ); } }; }; (function() { // Used to sort attribute entries in an array, where the first element of // each object is the attribute name. var sortAttribs = function( a, b ) { a = a[0]; b = b[0]; return a < b ? -1 : a > b ? 1 : 0; }; CKEDITOR.htmlParser.element.prototype = { /** * The node type. This is a constant value set to {@link CKEDITOR.NODE_ELEMENT}. * @type Number * @example */ type : CKEDITOR.NODE_ELEMENT, /** * Adds a node to the element children list. * @param {Object} node The node to be added. It can be any of of the * following types: {@link CKEDITOR.htmlParser.element}, * {@link CKEDITOR.htmlParser.text} and * {@link CKEDITOR.htmlParser.comment}. * @function * @example */ add : CKEDITOR.htmlParser.fragment.prototype.add, /** * Clone this element. * @returns {CKEDITOR.htmlParser.element} The element clone. * @example */ clone : function() { return new CKEDITOR.htmlParser.element( this.name, this.attributes ); }, /** * Writes the element HTML to a CKEDITOR.htmlWriter. * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. * @example */ writeHtml : function( writer, filter ) { var attributes = this.attributes; // Ignore cke: prefixes when writing HTML. var element = this, writeName = element.name, a, newAttrName, value; var isChildrenFiltered; /** * Providing an option for bottom-up filtering order ( element * children to be pre-filtered before the element itself ). */ element.filterChildren = function() { if ( !isChildrenFiltered ) { var writer = new CKEDITOR.htmlParser.basicWriter(); CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.call( element, writer, filter ); element.children = new CKEDITOR.htmlParser.fragment.fromHtml( writer.getHtml(), 0, element.clone() ).children; isChildrenFiltered = 1; } }; if ( filter ) { while ( true ) { if ( !( writeName = filter.onElementName( writeName ) ) ) return; element.name = writeName; if ( !( element = filter.onElement( element ) ) ) return; element.parent = this.parent; if ( element.name == writeName ) break; // If the element has been replaced with something of a // different type, then make the replacement write itself. if ( element.type != CKEDITOR.NODE_ELEMENT ) { element.writeHtml( writer, filter ); return; } writeName = element.name; // This indicate that the element has been dropped by // filter but not the children. if ( !writeName ) { // Fix broken parent refs. for ( var c = 0, length = this.children.length ; c < length ; c++ ) this.children[ c ].parent = element.parent; this.writeChildrenHtml.call( element, writer, isChildrenFiltered ? null : filter ); return; } } // The element may have been changed, so update the local // references. attributes = element.attributes; } // Open element tag. writer.openTag( writeName, attributes ); // Copy all attributes to an array. var attribsArray = []; // Iterate over the attributes twice since filters may alter // other attributes. for ( var i = 0 ; i < 2; i++ ) { for ( a in attributes ) { newAttrName = a; value = attributes[ a ]; if ( i == 1 ) attribsArray.push( [ a, value ] ); else if ( filter ) { while ( true ) { if ( !( newAttrName = filter.onAttributeName( a ) ) ) { delete attributes[ a ]; break; } else if ( newAttrName != a ) { delete attributes[ a ]; a = newAttrName; continue; } else break; } if ( newAttrName ) { if ( ( value = filter.onAttribute( element, newAttrName, value ) ) === false ) delete attributes[ newAttrName ]; else attributes [ newAttrName ] = value; } } } } // Sort the attributes by name. if ( writer.sortAttributes ) attribsArray.sort( sortAttribs ); // Send the attributes. var len = attribsArray.length; for ( i = 0 ; i < len ; i++ ) { var attrib = attribsArray[ i ]; writer.attribute( attrib[0], attrib[1] ); } // Close the tag. writer.openTagClose( writeName, element.isEmpty ); if ( !element.isEmpty ) { this.writeChildrenHtml.call( element, writer, isChildrenFiltered ? null : filter ); // Close the element. writer.closeTag( writeName ); } }, writeChildrenHtml : function( writer, filter ) { // Send children. CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.apply( this, arguments ); } }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the "virtual" {@link CKEDITOR.commandDefinition} class, * which contains the defintion of a command. This file is for * documentation purposes only. */ /** * (Virtual Class) Do not call this constructor. This class is not really part * of the API. * @name CKEDITOR.commandDefinition * @class Virtual class that illustrates the features of command objects to be * passed to the {@link CKEDITOR.editor.prototype.addCommand} function. * @example */ /** * The function to be fired when the commend is executed. * @name CKEDITOR.commandDefinition.prototype.exec * @function * @param {CKEDITOR.editor} editor The editor within which run the command. * @param {Object} [data] Additional data to be used to execute the command. * @returns {Boolean} Whether the command has been successfully executed. * Defaults to "true", if nothing is returned. * @example * editorInstance.addCommand( 'sample', * { * exec : function( editor ) * { * alert( 'Executing a command for the editor name "' + editor.name + '"!' ); * } * }); */ /** * Whether the command need to be hooked into the redo/undo system. * @name CKEDITOR.commandDefinition.prototype.canUndo * @type {Boolean} * @default true * @field * @example * editorInstance.addCommand( 'alertName', * { * exec : function( editor ) * { * alert( editor.name ); * }, * canUndo : false // No support for undo/redo * }); */ /** * Whether the command is asynchronous, which means that the * {@link CKEDITOR.editor#event:afterCommandExec} event will be fired by the * command itself manually, and that the return value of this command is not to * be returned by the {@link CKEDITOR.command#exec} function. * @name CKEDITOR.commandDefinition.prototype.async * @default false * @type {Boolean} * @example * editorInstance.addCommand( 'loadOptions', * { * exec : function( editor ) * { * // Asynchronous operation below. * CKEDITOR.ajax.loadXml( 'data.xml', function() * { * editor.fire( 'afterCommandExec' ); * )); * }, * async : true // The command need some time to complete after exec function returns. * }); */ /** * Whether the command should give focus to the editor before execution. * @name CKEDITOR.commandDefinition.prototype.editorFocus * @type {Boolean} * @default true * @see CKEDITOR.command#editorFocus * @example * editorInstance.addCommand( 'maximize', * { * exec : function( editor ) * { * // ... * }, * editorFocus : false // The command doesn't require focusing the editing document. * }); */ /** * Whether the command state should be set to {@link CKEDITOR.TRISTATE_DISABLED} on startup. * @name CKEDITOR.commandDefinition.prototype.startDisabled * @type {Boolean} * @default false * @example * editorInstance.addCommand( 'unlink', * { * exec : function( editor ) * { * // ... * }, * startDisabled : true // Command is unavailable until selection is inside a link. * }); */ /** * The editor modes within which the command can be executed. The execution * will have no action if the current mode is not listed in this property. * @name CKEDITOR.commandDefinition.prototype.modes * @type Object * @default { wysiwyg : 1 } * @see CKEDITOR.command#modes * @example * editorInstance.addCommand( 'link', * { * exec : function( editor ) * { * // ... * }, * modes : { wysiwyg : 1 } // Command is available in wysiwyg mode only. * }); */
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * Creates a {@link CKEDITOR.htmlParser} class instance. * @class Provides an "event like" system to parse strings of HTML data. * @example * var parser = new CKEDITOR.htmlParser(); * parser.onTagOpen = function( tagName, attributes, selfClosing ) * { * alert( tagName ); * }; * parser.parse( '&lt;p&gt;Some &lt;b&gt;text&lt;/b&gt;.&lt;/p&gt;' ); */ CKEDITOR.htmlParser = function() { this._ = { htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:"[^"]*")|(?:\'[^\']*\')|[^"\'>])*)\\/?>))', 'g' ) }; }; (function() { var attribsRegex = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, emptyAttribs = {checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1}; CKEDITOR.htmlParser.prototype = { /** * Function to be fired when a tag opener is found. This function * should be overriden when using this class. * @param {String} tagName The tag name. The name is guarantted to be * lowercased. * @param {Object} attributes An object containing all tag attributes. Each * property in this object represent and attribute name and its * value is the attribute value. * @param {Boolean} selfClosing true if the tag closes itself, false if the * tag doesn't. * @example * var parser = new CKEDITOR.htmlParser(); * parser.onTagOpen = function( tagName, attributes, selfClosing ) * { * alert( tagName ); // e.g. "b" * }); * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" ); */ onTagOpen : function() {}, /** * Function to be fired when a tag closer is found. This function * should be overriden when using this class. * @param {String} tagName The tag name. The name is guarantted to be * lowercased. * @example * var parser = new CKEDITOR.htmlParser(); * parser.onTagClose = function( tagName ) * { * alert( tagName ); // e.g. "b" * }); * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" ); */ onTagClose : function() {}, /** * Function to be fired when text is found. This function * should be overriden when using this class. * @param {String} text The text found. * @example * var parser = new CKEDITOR.htmlParser(); * parser.onText = function( text ) * { * alert( text ); // e.g. "Hello" * }); * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" ); */ onText : function() {}, /** * Function to be fired when CDATA section is found. This function * should be overriden when using this class. * @param {String} cdata The CDATA been found. * @example * var parser = new CKEDITOR.htmlParser(); * parser.onCDATA = function( cdata ) * { * alert( cdata ); // e.g. "var hello;" * }); * parser.parse( "&lt;script&gt;var hello;&lt;/script&gt;" ); */ onCDATA : function() {}, /** * Function to be fired when a commend is found. This function * should be overriden when using this class. * @param {String} comment The comment text. * @example * var parser = new CKEDITOR.htmlParser(); * parser.onComment = function( comment ) * { * alert( comment ); // e.g. " Example " * }); * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" ); */ onComment : function() {}, /** * Parses text, looking for HTML tokens, like tag openers or closers, * or comments. This function fires the onTagOpen, onTagClose, onText * and onComment function during its execution. * @param {String} html The HTML to be parsed. * @example * var parser = new CKEDITOR.htmlParser(); * // The onTagOpen, onTagClose, onText and onComment should be overriden * // at this point. * parser.parse( "&lt;!-- Example --&gt;&lt;b&gt;Hello&lt;/b&gt;" ); */ parse : function( html ) { var parts, tagName, nextIndex = 0, cdata; // The collected data inside a CDATA section. while ( ( parts = this._.htmlPartsRegex.exec( html ) ) ) { var tagIndex = parts.index; if ( tagIndex > nextIndex ) { var text = html.substring( nextIndex, tagIndex ); if ( cdata ) cdata.push( text ); else this.onText( text ); } nextIndex = this._.htmlPartsRegex.lastIndex; /* "parts" is an array with the following items: 0 : The entire match for opening/closing tags and comments. 1 : Group filled with the tag name for closing tags. 2 : Group filled with the comment text. 3 : Group filled with the tag name for opening tags. 4 : Group filled with the attributes part of opening tags. */ // Closing tag if ( ( tagName = parts[ 1 ] ) ) { tagName = tagName.toLowerCase(); if ( cdata && CKEDITOR.dtd.$cdata[ tagName ] ) { // Send the CDATA data. this.onCDATA( cdata.join('') ); cdata = null; } if ( !cdata ) { this.onTagClose( tagName ); continue; } } // If CDATA is enabled, just save the raw match. if ( cdata ) { cdata.push( parts[ 0 ] ); continue; } // Opening tag if ( ( tagName = parts[ 3 ] ) ) { tagName = tagName.toLowerCase(); // There are some tag names that can break things, so let's // simply ignore them when parsing. (#5224) if ( /="/.test( tagName ) ) continue; var attribs = {}, attribMatch, attribsPart = parts[ 4 ], selfClosing = !!( attribsPart && attribsPart.charAt( attribsPart.length - 1 ) == '/' ); if ( attribsPart ) { while ( ( attribMatch = attribsRegex.exec( attribsPart ) ) ) { var attName = attribMatch[1].toLowerCase(), attValue = attribMatch[2] || attribMatch[3] || attribMatch[4] || ''; if ( !attValue && emptyAttribs[ attName ] ) attribs[ attName ] = attName; else attribs[ attName ] = attValue; } } this.onTagOpen( tagName, attribs, selfClosing ); // Open CDATA mode when finding the appropriate tags. if ( !cdata && CKEDITOR.dtd.$cdata[ tagName ] ) cdata = []; continue; } // Comment if ( ( tagName = parts[ 2 ] ) ) this.onComment( tagName ); } if ( html.length > nextIndex ) this.onText( html.substring( nextIndex, html.length ) ); } }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { var loadedLangs = {}; /** * @namespace Holds language related functions. */ CKEDITOR.lang = { /** * The list of languages available in the editor core. * @type Object * @example * alert( CKEDITOR.lang.en ); // "true" */ languages : { 'af' : 1, 'ar' : 1, 'bg' : 1, 'bn' : 1, 'bs' : 1, 'ca' : 1, 'cs' : 1, 'cy' : 1, 'da' : 1, 'de' : 1, 'el' : 1, 'en-au' : 1, 'en-ca' : 1, 'en-gb' : 1, 'en' : 1, 'eo' : 1, 'es' : 1, 'et' : 1, 'eu' : 1, 'fa' : 1, 'fi' : 1, 'fo' : 1, 'fr-ca' : 1, 'fr' : 1, 'gl' : 1, 'gu' : 1, 'he' : 1, 'hi' : 1, 'hr' : 1, 'hu' : 1, 'is' : 1, 'it' : 1, 'ja' : 1, 'ka' : 1, 'km' : 1, 'ko' : 1, 'lt' : 1, 'lv' : 1, 'mn' : 1, 'ms' : 1, 'nb' : 1, 'nl' : 1, 'no' : 1, 'pl' : 1, 'pt-br' : 1, 'pt' : 1, 'ro' : 1, 'ru' : 1, 'sk' : 1, 'sl' : 1, 'sr-latn' : 1, 'sr' : 1, 'sv' : 1, 'th' : 1, 'tr' : 1, 'uk' : 1, 'vi' : 1, 'zh-cn' : 1, 'zh' : 1 }, /** * Loads a specific language file, or auto detect it. A callback is * then called when the file gets loaded. * @param {String} languageCode The code of the language file to be * loaded. If null or empty, autodetection will be performed. The * same happens if the language is not supported. * @param {String} defaultLanguage The language to be used if * languageCode is not supported or if the autodetection fails. * @param {Function} callback A function to be called once the * language file is loaded. Two parameters are passed to this * function: the language code and the loaded language entries. * @example */ load : function( languageCode, defaultLanguage, callback ) { // If no languageCode - fallback to browser or default. // If languageCode - fallback to no-localized version or default. if ( !languageCode || !CKEDITOR.lang.languages[ languageCode ] ) languageCode = this.detect( defaultLanguage, languageCode ); if ( !this[ languageCode ] ) { CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( '_source/' + // @Packager.RemoveLine 'lang/' + languageCode + '.js' ), function() { callback( languageCode, this[ languageCode ] ); } , this ); } else callback( languageCode, this[ languageCode ] ); }, /** * Returns the language that best fit the user language. For example, * suppose that the user language is "pt-br". If this language is * supported by the editor, it is returned. Otherwise, if only "pt" is * supported, it is returned instead. If none of the previous are * supported, a default language is then returned. * @param {String} defaultLanguage The default language to be returned * if the user language is not supported. * @param {String} [probeLanguage] A language code to try to use, * instead of the browser based autodetection. * @returns {String} The detected language code. * @example * alert( CKEDITOR.lang.detect( 'en' ) ); // e.g., in a German browser: "de" */ detect : function( defaultLanguage, probeLanguage ) { var languages = this.languages; probeLanguage = probeLanguage || navigator.userLanguage || navigator.language || defaultLanguage; var parts = probeLanguage .toLowerCase() .match( /([a-z]+)(?:-([a-z]+))?/ ), lang = parts[1], locale = parts[2]; if ( languages[ lang + '-' + locale ] ) lang = lang + '-' + locale; else if ( !languages[ lang ] ) lang = null; CKEDITOR.lang.detect = lang ? function() { return lang; } : function( defaultLanguage ) { return defaultLanguage; }; return lang || defaultLanguage; } }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview API initialization code. */ (function() { // Disable HC detaction in WebKit. (#5429) if ( CKEDITOR.env.webkit ) { CKEDITOR.env.hc = false; return; } // Check whether high contrast is active by creating a colored border. var hcDetect = CKEDITOR.dom.element.createFromHtml( '<div style="width:0px;height:0px;position:absolute;left:-10000px;' + 'border: 1px solid;border-color: red blue;"></div>', CKEDITOR.document ); hcDetect.appendTo( CKEDITOR.document.getHead() ); // Update CKEDITOR.env. // Catch exception needed sometimes for FF. (#4230) try { CKEDITOR.env.hc = hcDetect.getComputedStyle( 'border-top-color' ) == hcDetect.getComputedStyle( 'border-right-color' ); } catch (e) { CKEDITOR.env.hc = false; } if ( CKEDITOR.env.hc ) CKEDITOR.env.cssClass += ' cke_hc'; hcDetect.remove(); })(); // Load core plugins. CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function() { CKEDITOR.status = 'loaded'; CKEDITOR.fire( 'loaded' ); // Process all instances created by the "basic" implementation. var pending = CKEDITOR._.pending; if ( pending ) { delete CKEDITOR._.pending; for ( var i = 0 ; i < pending.length ; i++ ) CKEDITOR.add( pending[ i ] ); } }); // Needed for IE6 to not request image (HTTP 200 or 304) for every CSS background. (#6187) if ( CKEDITOR.env.ie ) { // Remove IE mouse flickering on IE6 because of background images. try { document.execCommand( 'BackgroundImageCache', false, true ); } catch (e) { // We have been reported about loading problems caused by the above // line. For safety, let's just ignore errors. } } /** * Indicates that CKEditor is running on a High Contrast environment. * @name CKEDITOR.env.hc * @example * if ( CKEDITOR.env.hc ) * alert( 'You're running on High Contrast mode. The editor interface will get adapted to provide you a better experience.' ); */ /** * Fired when a CKEDITOR core object is fully loaded and ready for interaction. * @name CKEDITOR#loaded * @event */
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.comment} class, which represents * a DOM comment node. */ /** * Represents a DOM comment node. * @constructor * @augments CKEDITOR.dom.node * @param {Object|String} comment A native DOM comment node or a string containing * the text to use to create a new comment node. * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain * the node in case of new node creation. Defaults to the current document. * @example * var nativeNode = document.createComment( 'Example' ); * var comment = CKEDITOR.dom.comment( nativeNode ); * @example * var comment = CKEDITOR.dom.comment( 'Example' ); */ CKEDITOR.dom.comment = function( comment, ownerDocument ) { if ( typeof comment == 'string' ) comment = ( ownerDocument ? ownerDocument.$ : document ).createComment( comment ); CKEDITOR.dom.domObject.call( this, comment ); }; CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node(); CKEDITOR.tools.extend( CKEDITOR.dom.comment.prototype, /** @lends CKEDITOR.dom.comment.prototype */ { type : CKEDITOR.NODE_COMMENT, getOuterHtml : function() { return '<!--' + this.$.nodeValue + '-->'; } });
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.editor} class, which is the base * for other classes representing DOM objects. */ /** * Represents a DOM object. This class is not intended to be used directly. It * serves as the base class for other classes representing specific DOM * objects. * @constructor * @param {Object} nativeDomObject A native DOM object. * @augments CKEDITOR.event * @example */ CKEDITOR.dom.domObject = function( nativeDomObject ) { if ( nativeDomObject ) { /** * The native DOM object represented by this class instance. * @type Object * @example * var element = new CKEDITOR.dom.element( 'span' ); * alert( element.$.nodeType ); // "1" */ this.$ = nativeDomObject; } }; CKEDITOR.dom.domObject.prototype = (function() { // Do not define other local variables here. We want to keep the native // listener closures as clean as possible. var getNativeListener = function( domObject, eventName ) { return function( domEvent ) { // In FF, when reloading the page with the editor focused, it may // throw an error because the CKEDITOR global is not anymore // available. So, we check it here first. (#2923) if ( typeof CKEDITOR != 'undefined' ) domObject.fire( eventName, new CKEDITOR.dom.event( domEvent ) ); }; }; return /** @lends CKEDITOR.dom.domObject.prototype */ { getPrivate : function() { var priv; // Get the main private function from the custom data. Create it if not // defined. if ( !( priv = this.getCustomData( '_' ) ) ) this.setCustomData( '_', ( priv = {} ) ); return priv; }, /** @ignore */ on : function( eventName ) { // We customize the "on" function here. The basic idea is that we'll have // only one listener for a native event, which will then call all listeners // set to the event. // Get the listeners holder object. var nativeListeners = this.getCustomData( '_cke_nativeListeners' ); if ( !nativeListeners ) { nativeListeners = {}; this.setCustomData( '_cke_nativeListeners', nativeListeners ); } // Check if we have a listener for that event. if ( !nativeListeners[ eventName ] ) { var listener = nativeListeners[ eventName ] = getNativeListener( this, eventName ); if ( this.$.addEventListener ) this.$.addEventListener( eventName, listener, !!CKEDITOR.event.useCapture ); else if ( this.$.attachEvent ) this.$.attachEvent( 'on' + eventName, listener ); } // Call the original implementation. return CKEDITOR.event.prototype.on.apply( this, arguments ); }, /** @ignore */ removeListener : function( eventName ) { // Call the original implementation. CKEDITOR.event.prototype.removeListener.apply( this, arguments ); // If we don't have listeners for this event, clean the DOM up. if ( !this.hasListeners( eventName ) ) { var nativeListeners = this.getCustomData( '_cke_nativeListeners' ); var listener = nativeListeners && nativeListeners[ eventName ]; if ( listener ) { if ( this.$.removeEventListener ) this.$.removeEventListener( eventName, listener, false ); else if ( this.$.detachEvent ) this.$.detachEvent( 'on' + eventName, listener ); delete nativeListeners[ eventName ]; } } }, /** * Removes any listener set on this object. * To avoid memory leaks we must assure that there are no * references left after the object is no longer needed. */ removeAllListeners : function() { var nativeListeners = this.getCustomData( '_cke_nativeListeners' ); for ( var eventName in nativeListeners ) { var listener = nativeListeners[ eventName ]; if ( this.$.detachEvent ) this.$.detachEvent( 'on' + eventName, listener ); else if ( this.$.removeEventListener ) this.$.removeEventListener( eventName, listener, false ); delete nativeListeners[ eventName ]; } } }; })(); (function( domObjectProto ) { var customData = {}; CKEDITOR.on( 'reset', function() { customData = {}; }); /** * Determines whether the specified object is equal to the current object. * @name CKEDITOR.dom.domObject.prototype.equals * @function * @param {Object} object The object to compare with the current object. * @returns {Boolean} "true" if the object is equal. * @example * var doc = new CKEDITOR.dom.document( document ); * alert( doc.equals( CKEDITOR.document ) ); // "true" * alert( doc == CKEDITOR.document ); // "false" */ domObjectProto.equals = function( object ) { return ( object && object.$ === this.$ ); }; /** * Sets a data slot value for this object. These values are shared by all * instances pointing to that same DOM object. * <strong>Note:</strong> The created data slot is only guarantied to be available on this unique dom node, * thus any wish to continue access it from other element clones (either created by clone node or from innerHtml) * will fail, for such usage, please use {@link CKEDITOR.dom.element::setAttribute} instead. * @name CKEDITOR.dom.domObject.prototype.setCustomData * @function * @param {String} key A key used to identify the data slot. * @param {Object} value The value to set to the data slot. * @returns {CKEDITOR.dom.domObject} This DOM object instance. * @see CKEDITOR.dom.domObject.prototype.getCustomData * @example * var element = new CKEDITOR.dom.element( 'span' ); * element.setCustomData( 'hasCustomData', true ); */ domObjectProto.setCustomData = function( key, value ) { var expandoNumber = this.getUniqueId(), dataSlot = customData[ expandoNumber ] || ( customData[ expandoNumber ] = {} ); dataSlot[ key ] = value; return this; }; /** * Gets the value set to a data slot in this object. * @name CKEDITOR.dom.domObject.prototype.getCustomData * @function * @param {String} key The key used to identify the data slot. * @returns {Object} This value set to the data slot. * @see CKEDITOR.dom.domObject.prototype.setCustomData * @example * var element = new CKEDITOR.dom.element( 'span' ); * alert( element.getCustomData( 'hasCustomData' ) ); // e.g. 'true' */ domObjectProto.getCustomData = function( key ) { var expandoNumber = this.$[ 'data-cke-expando' ], dataSlot = expandoNumber && customData[ expandoNumber ]; return dataSlot && dataSlot[ key ]; }; /** * @name CKEDITOR.dom.domObject.prototype.removeCustomData */ domObjectProto.removeCustomData = function( key ) { var expandoNumber = this.$[ 'data-cke-expando' ], dataSlot = expandoNumber && customData[ expandoNumber ], retval = dataSlot && dataSlot[ key ]; if ( typeof retval != 'undefined' ) delete dataSlot[ key ]; return retval || null; }; /** * Removes any data stored on this object. * To avoid memory leaks we must assure that there are no * references left after the object is no longer needed. * @name CKEDITOR.dom.domObject.prototype.clearCustomData * @function */ domObjectProto.clearCustomData = function() { // Clear all event listeners this.removeAllListeners(); var expandoNumber = this.$[ 'data-cke-expando' ]; expandoNumber && delete customData[ expandoNumber ]; }; /** * Gets an ID that can be used to identiquely identify this DOM object in * the running session. * @name CKEDITOR.dom.domObject.prototype.getUniqueId * @function * @returns {Number} A unique ID. */ domObjectProto.getUniqueId = function() { return this.$[ 'data-cke-expando' ] || ( this.$[ 'data-cke-expando' ] = CKEDITOR.tools.getNextNumber() ); }; // Implement CKEDITOR.event. CKEDITOR.event.implementOn( domObjectProto ); })( CKEDITOR.dom.domObject.prototype );
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.node} class which is the base * class for classes that represent DOM nodes. */ /** * Base class for classes representing DOM nodes. This constructor may return * an instance of a class that inherits from this class, like * {@link CKEDITOR.dom.element} or {@link CKEDITOR.dom.text}. * @augments CKEDITOR.dom.domObject * @param {Object} domNode A native DOM node. * @constructor * @see CKEDITOR.dom.element * @see CKEDITOR.dom.text * @example */ CKEDITOR.dom.node = function( domNode ) { if ( domNode ) { var type = domNode.nodeType == CKEDITOR.NODE_DOCUMENT ? 'document' : domNode.nodeType == CKEDITOR.NODE_ELEMENT ? 'element' : domNode.nodeType == CKEDITOR.NODE_TEXT ? 'text' : domNode.nodeType == CKEDITOR.NODE_COMMENT ? 'comment' : 'domObject'; // Call the base constructor otherwise. return new CKEDITOR.dom[ type ]( domNode ); } return this; }; CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject(); /** * Element node type. * @constant * @example */ CKEDITOR.NODE_ELEMENT = 1; /** * Document node type. * @constant * @example */ CKEDITOR.NODE_DOCUMENT = 9; /** * Text node type. * @constant * @example */ CKEDITOR.NODE_TEXT = 3; /** * Comment node type. * @constant * @example */ CKEDITOR.NODE_COMMENT = 8; CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11; CKEDITOR.POSITION_IDENTICAL = 0; CKEDITOR.POSITION_DISCONNECTED = 1; CKEDITOR.POSITION_FOLLOWING = 2; CKEDITOR.POSITION_PRECEDING = 4; CKEDITOR.POSITION_IS_CONTAINED = 8; CKEDITOR.POSITION_CONTAINS = 16; CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype, /** @lends CKEDITOR.dom.node.prototype */ { /** * Makes this node a child of another element. * @param {CKEDITOR.dom.element} element The target element to which * this node will be appended. * @returns {CKEDITOR.dom.element} The target element. * @example * var p = new CKEDITOR.dom.element( 'p' ); * var strong = new CKEDITOR.dom.element( 'strong' ); * strong.appendTo( p ); * * // result: "&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;" */ appendTo : function( element, toStart ) { element.append( this, toStart ); return element; }, clone : function( includeChildren, cloneId ) { var $clone = this.$.cloneNode( includeChildren ); var removeIds = function( node ) { if ( node.nodeType != CKEDITOR.NODE_ELEMENT ) return; if ( !cloneId ) node.removeAttribute( 'id', false ); node.removeAttribute( 'data-cke-expando', false ); if ( includeChildren ) { var childs = node.childNodes; for ( var i=0; i < childs.length; i++ ) removeIds( childs[ i ] ); } }; // The "id" attribute should never be cloned to avoid duplication. removeIds( $clone ); return new CKEDITOR.dom.node( $clone ); }, hasPrevious : function() { return !!this.$.previousSibling; }, hasNext : function() { return !!this.$.nextSibling; }, /** * Inserts this element after a node. * @param {CKEDITOR.dom.node} node The node that will precede this element. * @returns {CKEDITOR.dom.node} The node preceding this one after * insertion. * @example * var em = new CKEDITOR.dom.element( 'em' ); * var strong = new CKEDITOR.dom.element( 'strong' ); * strong.insertAfter( em ); * * // result: "&lt;em&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;" */ insertAfter : function( node ) { node.$.parentNode.insertBefore( this.$, node.$.nextSibling ); return node; }, /** * Inserts this element before a node. * @param {CKEDITOR.dom.node} node The node that will succeed this element. * @returns {CKEDITOR.dom.node} The node being inserted. * @example * var em = new CKEDITOR.dom.element( 'em' ); * var strong = new CKEDITOR.dom.element( 'strong' ); * strong.insertBefore( em ); * * // result: "&lt;strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;" */ insertBefore : function( node ) { node.$.parentNode.insertBefore( this.$, node.$ ); return node; }, insertBeforeMe : function( node ) { this.$.parentNode.insertBefore( node.$, this.$ ); return node; }, /** * Retrieves a uniquely identifiable tree address for this node. * The tree address returned is an array of integers, with each integer * indicating a child index of a DOM node, starting from * <code>document.documentElement</code>. * * For example, assuming <code>&lt;body&gt;</code> is the second child * of <code>&lt;html&gt;</code> (<code>&lt;head&gt;</code> being the first), * and we would like to address the third child under the * fourth child of <code>&lt;body&gt;</code>, the tree address returned would be: * [1, 3, 2] * * The tree address cannot be used for finding back the DOM tree node once * the DOM tree structure has been modified. */ getAddress : function( normalized ) { var address = []; var $documentElement = this.getDocument().$.documentElement; var node = this.$; while ( node && node != $documentElement ) { var parentNode = node.parentNode; if ( parentNode ) { // Get the node index. For performance, call getIndex // directly, instead of creating a new node object. address.unshift( this.getIndex.call( { $ : node }, normalized ) ); } node = parentNode; } return address; }, /** * Gets the document containing this element. * @returns {CKEDITOR.dom.document} The document. * @example * var element = CKEDITOR.document.getById( 'example' ); * alert( <strong>element.getDocument().equals( CKEDITOR.document )</strong> ); // "true" */ getDocument : function() { return new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument ); }, getIndex : function( normalized ) { // Attention: getAddress depends on this.$ var current = this.$, index = 0; while ( ( current = current.previousSibling ) ) { // When normalizing, do not count it if this is an // empty text node or if it's a text node following another one. if ( normalized && current.nodeType == 3 && ( !current.nodeValue.length || ( current.previousSibling && current.previousSibling.nodeType == 3 ) ) ) { continue; } index++; } return index; }, getNextSourceNode : function( startFromSibling, nodeType, guard ) { // If "guard" is a node, transform it in a function. if ( guard && !guard.call ) { var guardNode = guard; guard = function( node ) { return !node.equals( guardNode ); }; } var node = ( !startFromSibling && this.getFirst && this.getFirst() ), parent; // Guarding when we're skipping the current element( no children or 'startFromSibling' ). // send the 'moving out' signal even we don't actually dive into. if ( !node ) { if ( this.type == CKEDITOR.NODE_ELEMENT && guard && guard( this, true ) === false ) return null; node = this.getNext(); } while ( !node && ( parent = ( parent || this ).getParent() ) ) { // The guard check sends the "true" paramenter to indicate that // we are moving "out" of the element. if ( guard && guard( parent, true ) === false ) return null; node = parent.getNext(); } if ( !node ) return null; if ( guard && guard( node ) === false ) return null; if ( nodeType && nodeType != node.type ) return node.getNextSourceNode( false, nodeType, guard ); return node; }, getPreviousSourceNode : function( startFromSibling, nodeType, guard ) { if ( guard && !guard.call ) { var guardNode = guard; guard = function( node ) { return !node.equals( guardNode ); }; } var node = ( !startFromSibling && this.getLast && this.getLast() ), parent; // Guarding when we're skipping the current element( no children or 'startFromSibling' ). // send the 'moving out' signal even we don't actually dive into. if ( !node ) { if ( this.type == CKEDITOR.NODE_ELEMENT && guard && guard( this, true ) === false ) return null; node = this.getPrevious(); } while ( !node && ( parent = ( parent || this ).getParent() ) ) { // The guard check sends the "true" paramenter to indicate that // we are moving "out" of the element. if ( guard && guard( parent, true ) === false ) return null; node = parent.getPrevious(); } if ( !node ) return null; if ( guard && guard( node ) === false ) return null; if ( nodeType && node.type != nodeType ) return node.getPreviousSourceNode( false, nodeType, guard ); return node; }, getPrevious : function( evaluator ) { var previous = this.$, retval; do { previous = previous.previousSibling; // Avoid returning the doc type node. // http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-412266927 retval = previous && previous.nodeType != 10 && new CKEDITOR.dom.node( previous ); } while ( retval && evaluator && !evaluator( retval ) ) return retval; }, /** * Gets the node that follows this element in its parent's child list. * @param {Function} evaluator Filtering the result node. * @returns {CKEDITOR.dom.node} The next node or null if not available. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;&lt;b&gt;Example&lt;/b&gt; &lt;i&gt;next&lt;/i&gt;&lt;/div&gt;' ); * var first = <strong>element.getFirst().getNext()</strong>; * alert( first.getName() ); // "i" */ getNext : function( evaluator ) { var next = this.$, retval; do { next = next.nextSibling; retval = next && new CKEDITOR.dom.node( next ); } while ( retval && evaluator && !evaluator( retval ) ) return retval; }, /** * Gets the parent element for this node. * @returns {CKEDITOR.dom.element} The parent element. * @example * var node = editor.document.getBody().getFirst(); * var parent = node.<strong>getParent()</strong>; * alert( node.getName() ); // "body" */ getParent : function() { var parent = this.$.parentNode; return ( parent && parent.nodeType == 1 ) ? new CKEDITOR.dom.node( parent ) : null; }, getParents : function( closerFirst ) { var node = this; var parents = []; do { parents[ closerFirst ? 'push' : 'unshift' ]( node ); } while ( ( node = node.getParent() ) ) return parents; }, getCommonAncestor : function( node ) { if ( node.equals( this ) ) return this; if ( node.contains && node.contains( this ) ) return node; var start = this.contains ? this : this.getParent(); do { if ( start.contains( node ) ) return start; } while ( ( start = start.getParent() ) ); return null; }, getPosition : function( otherNode ) { var $ = this.$; var $other = otherNode.$; if ( $.compareDocumentPosition ) return $.compareDocumentPosition( $other ); // IE and Safari have no support for compareDocumentPosition. if ( $ == $other ) return CKEDITOR.POSITION_IDENTICAL; // Only element nodes support contains and sourceIndex. if ( this.type == CKEDITOR.NODE_ELEMENT && otherNode.type == CKEDITOR.NODE_ELEMENT ) { if ( $.contains ) { if ( $.contains( $other ) ) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING; if ( $other.contains( $ ) ) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING; } if ( 'sourceIndex' in $ ) { return ( $.sourceIndex < 0 || $other.sourceIndex < 0 ) ? CKEDITOR.POSITION_DISCONNECTED : ( $.sourceIndex < $other.sourceIndex ) ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; } } // For nodes that don't support compareDocumentPosition, contains // or sourceIndex, their "address" is compared. var addressOfThis = this.getAddress(), addressOfOther = otherNode.getAddress(), minLevel = Math.min( addressOfThis.length, addressOfOther.length ); // Determinate preceed/follow relationship. for ( var i = 0 ; i <= minLevel - 1 ; i++ ) { if ( addressOfThis[ i ] != addressOfOther[ i ] ) { if ( i < minLevel ) { return addressOfThis[ i ] < addressOfOther[ i ] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; } break; } } // Determinate contains/contained relationship. return ( addressOfThis.length < addressOfOther.length ) ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING; }, /** * Gets the closest ancestor node of this node, specified by its name. * @param {String} reference The name of the ancestor node to search or * an object with the node names to search for. * @param {Boolean} [includeSelf] Whether to include the current * node in the search. * @returns {CKEDITOR.dom.node} The located ancestor node or null if not found. * @since 3.6.1 * @example * // Suppose we have the following HTML structure: * // &lt;div id="outer"&gt;&lt;div id="inner"&gt;&lt;p&gt;&lt;b&gt;Some text&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; * // If node == &lt;b&gt; * ascendant = node.getAscendant( 'div' ); // ascendant == &lt;div id="inner"&gt * ascendant = node.getAscendant( 'b' ); // ascendant == null * ascendant = node.getAscendant( 'b', true ); // ascendant == &lt;b&gt; * ascendant = node.getAscendant( { div: 1, p: 1} ); // Searches for the first 'div' or 'p': ascendant == &lt;div id="inner"&gt */ getAscendant : function( reference, includeSelf ) { var $ = this.$, name; if ( !includeSelf ) $ = $.parentNode; while ( $ ) { if ( $.nodeName && ( name = $.nodeName.toLowerCase(), ( typeof reference == 'string' ? name == reference : name in reference ) ) ) return new CKEDITOR.dom.node( $ ); $ = $.parentNode; } return null; }, hasAscendant : function( name, includeSelf ) { var $ = this.$; if ( !includeSelf ) $ = $.parentNode; while ( $ ) { if ( $.nodeName && $.nodeName.toLowerCase() == name ) return true; $ = $.parentNode; } return false; }, move : function( target, toStart ) { target.append( this.remove(), toStart ); }, /** * Removes this node from the document DOM. * @param {Boolean} [preserveChildren] Indicates that the children * elements must remain in the document, removing only the outer * tags. * @example * var element = CKEDITOR.dom.element.getById( 'MyElement' ); * <strong>element.remove()</strong>; */ remove : function( preserveChildren ) { var $ = this.$; var parent = $.parentNode; if ( parent ) { if ( preserveChildren ) { // Move all children before the node. for ( var child ; ( child = $.firstChild ) ; ) { parent.insertBefore( $.removeChild( child ), $ ); } } parent.removeChild( $ ); } return this; }, replace : function( nodeToReplace ) { this.insertBefore( nodeToReplace ); nodeToReplace.remove(); }, trim : function() { this.ltrim(); this.rtrim(); }, ltrim : function() { var child; while ( this.getFirst && ( child = this.getFirst() ) ) { if ( child.type == CKEDITOR.NODE_TEXT ) { var trimmed = CKEDITOR.tools.ltrim( child.getText() ), originalLength = child.getLength(); if ( !trimmed ) { child.remove(); continue; } else if ( trimmed.length < originalLength ) { child.split( originalLength - trimmed.length ); // IE BUG: child.remove() may raise JavaScript errors here. (#81) this.$.removeChild( this.$.firstChild ); } } break; } }, rtrim : function() { var child; while ( this.getLast && ( child = this.getLast() ) ) { if ( child.type == CKEDITOR.NODE_TEXT ) { var trimmed = CKEDITOR.tools.rtrim( child.getText() ), originalLength = child.getLength(); if ( !trimmed ) { child.remove(); continue; } else if ( trimmed.length < originalLength ) { child.split( trimmed.length ); // IE BUG: child.getNext().remove() may raise JavaScript errors here. // (#81) this.$.lastChild.parentNode.removeChild( this.$.lastChild ); } } break; } if ( !CKEDITOR.env.ie && !CKEDITOR.env.opera ) { child = this.$.lastChild; if ( child && child.type == 1 && child.nodeName.toLowerCase() == 'br' ) { // Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#324). child.parentNode.removeChild( child ) ; } } }, /** * Checks if this node is read-only (should not be changed). * @returns {Boolean} * @since 3.5 * @example * // For the following HTML: * // &lt;div contenteditable="false"&gt;Some &lt;b&gt;text&lt;/b&gt;&lt;/div&gt; * * // If "ele" is the above &lt;div&gt; * ele.isReadOnly(); // true */ isReadOnly : function() { var element = this; if ( this.type != CKEDITOR.NODE_ELEMENT ) element = this.getParent(); if ( element && typeof element.$.isContentEditable != 'undefined' ) return ! ( element.$.isContentEditable || element.data( 'cke-editable' ) ); else { // Degrade for old browsers which don't support "isContentEditable", e.g. FF3 var current = element; while( current ) { if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) ) break; if ( current.getAttribute( 'contentEditable' ) == 'false' ) return true; else if ( current.getAttribute( 'contentEditable' ) == 'true' ) break; current = current.getParent(); } return false; } } } );
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @class DocumentFragment is a "lightweight" or "minimal" Document object. It is * commonly used to extract a portion of a document's tree or to create a new * fragment of a document. Various operations may take DocumentFragment objects * as arguments and results in all the child nodes of the DocumentFragment being * moved to the child list of this node. * @param {Object} ownerDocument */ CKEDITOR.dom.documentFragment = function( ownerDocument ) { ownerDocument = ownerDocument || CKEDITOR.document; this.$ = ownerDocument.$.createDocumentFragment(); }; CKEDITOR.tools.extend( CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, { type : CKEDITOR.NODE_DOCUMENT_FRAGMENT, insertAfterNode : function( node ) { node = node.$; node.parentNode.insertBefore( this.$, node.nextSibling ); } }, true, { 'append' : 1, 'appendBogus' : 1, 'getFirst' : 1, 'getLast' : 1, 'appendTo' : 1, 'moveChildren' : 1, 'insertBefore' : 1, 'insertAfterNode' : 1, 'replace' : 1, 'trim' : 1, 'type' : 1, 'ltrim' : 1, 'rtrim' : 1, 'getDocument' : 1, 'getChildCount' : 1, 'getChild' : 1, 'getChildren' : 1 } );
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.text} class, which represents * a DOM text node. */ /** * Represents a DOM text node. * @constructor * @augments CKEDITOR.dom.node * @param {Object|String} text A native DOM text node or a string containing * the text to use to create a new text node. * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain * the node in case of new node creation. Defaults to the current document. * @example * var nativeNode = document.createTextNode( 'Example' ); * var text = CKEDITOR.dom.text( nativeNode ); * @example * var text = CKEDITOR.dom.text( 'Example' ); */ CKEDITOR.dom.text = function( text, ownerDocument ) { if ( typeof text == 'string' ) text = ( ownerDocument ? ownerDocument.$ : document ).createTextNode( text ); // Theoretically, we should call the base constructor here // (not CKEDITOR.dom.node though). But, IE doesn't support expando // properties on text node, so the features provided by domObject will not // work for text nodes (which is not a big issue for us). // // CKEDITOR.dom.domObject.call( this, element ); /** * The native DOM text node represented by this class instance. * @type Object * @example * var element = new CKEDITOR.dom.text( 'Example' ); * alert( element.$.nodeType ); // "3" */ this.$ = text; }; CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node(); CKEDITOR.tools.extend( CKEDITOR.dom.text.prototype, /** @lends CKEDITOR.dom.text.prototype */ { /** * The node type. This is a constant value set to * {@link CKEDITOR.NODE_TEXT}. * @type Number * @example */ type : CKEDITOR.NODE_TEXT, getLength : function() { return this.$.nodeValue.length; }, getText : function() { return this.$.nodeValue; }, setText : function( text ) { this.$.nodeValue = text; }, /** * Breaks this text node into two nodes at the specified offset, * keeping both in the tree as siblings. This node then only contains * all the content up to the offset point. A new text node, which is * inserted as the next sibling of this node, contains all the content * at and after the offset point. When the offset is equal to the * length of this node, the new node has no data. * @param {Number} The position at which to split, starting from zero. * @returns {CKEDITOR.dom.text} The new text node. */ split : function( offset ) { // If the offset is after the last char, IE creates the text node // on split, but don't include it into the DOM. So, we have to do // that manually here. if ( CKEDITOR.env.ie && offset == this.getLength() ) { var next = this.getDocument().createText( '' ); next.insertAfter( this ); return next; } var doc = this.getDocument(); var retval = new CKEDITOR.dom.text( this.$.splitText( offset ), doc ); // IE BUG: IE8 does not update the childNodes array in DOM after splitText(), // we need to make some DOM changes to make it update. (#3436) if ( CKEDITOR.env.ie8 ) { var workaround = new CKEDITOR.dom.text( '', doc ); workaround.insertAfter( retval ); workaround.remove(); } return retval; }, /** * Extracts characters from indexA up to but not including indexB. * @param {Number} indexA An integer between 0 and one less than the * length of the text. * @param {Number} [indexB] An integer between 0 and the length of the * string. If omitted, extracts characters to the end of the text. */ substring : function( indexA, indexB ) { // We need the following check due to a Firefox bug // https://bugzilla.mozilla.org/show_bug.cgi?id=458886 if ( typeof indexB != 'number' ) return this.$.nodeValue.substr( indexA ); else return this.$.nodeValue.substring( indexA, indexB ); } });
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * Creates a CKEDITOR.dom.range instance that can be used inside a specific * DOM Document. * @class Represents a delimited piece of content in a DOM Document. * It is contiguous in the sense that it can be characterized as selecting all * of the content between a pair of boundary-points.<br> * <br> * This class shares much of the W3C * <a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html">Document Object Model Range</a> * ideas and features, adding several range manipulation tools to it, but it's * not intended to be compatible with it. * @param {CKEDITOR.dom.document} document The document into which the range * features will be available. * @example * // Create a range for the entire contents of the editor document body. * var range = new CKEDITOR.dom.range( editor.document ); * range.selectNodeContents( editor.document.getBody() ); * // Delete the contents. * range.deleteContents(); */ CKEDITOR.dom.range = function( document ) { /** * Node within which the range begins. * @type {CKEDITOR.NODE_ELEMENT|CKEDITOR.NODE_TEXT} * @example * var range = new CKEDITOR.dom.range( editor.document ); * range.selectNodeContents( editor.document.getBody() ); * alert( range.startContainer.getName() ); // "body" */ this.startContainer = null; /** * Offset within the starting node of the range. * @type {Number} * @example * var range = new CKEDITOR.dom.range( editor.document ); * range.selectNodeContents( editor.document.getBody() ); * alert( range.startOffset ); // "0" */ this.startOffset = null; /** * Node within which the range ends. * @type {CKEDITOR.NODE_ELEMENT|CKEDITOR.NODE_TEXT} * @example * var range = new CKEDITOR.dom.range( editor.document ); * range.selectNodeContents( editor.document.getBody() ); * alert( range.endContainer.getName() ); // "body" */ this.endContainer = null; /** * Offset within the ending node of the range. * @type {Number} * @example * var range = new CKEDITOR.dom.range( editor.document ); * range.selectNodeContents( editor.document.getBody() ); * alert( range.endOffset ); // == editor.document.getBody().getChildCount() */ this.endOffset = null; /** * Indicates that this is a collapsed range. A collapsed range has it's * start and end boudaries at the very same point so nothing is contained * in it. * @example * var range = new CKEDITOR.dom.range( editor.document ); * range.selectNodeContents( editor.document.getBody() ); * alert( range.collapsed ); // "false" * range.collapse(); * alert( range.collapsed ); // "true" */ this.collapsed = true; /** * The document within which the range can be used. * @type {CKEDITOR.dom.document} * @example * // Selects the body contents of the range document. * range.selectNodeContents( range.document.getBody() ); */ this.document = document; }; (function() { // Updates the "collapsed" property for the given range object. var updateCollapsed = function( range ) { range.collapsed = ( range.startContainer && range.endContainer && range.startContainer.equals( range.endContainer ) && range.startOffset == range.endOffset ); }; // This is a shared function used to delete, extract and clone the range // contents. // V2 var execContentsAction = function( range, action, docFrag, mergeThen ) { range.optimizeBookmark(); var startNode = range.startContainer; var endNode = range.endContainer; var startOffset = range.startOffset; var endOffset = range.endOffset; var removeStartNode; var removeEndNode; // For text containers, we must simply split the node and point to the // second part. The removal will be handled by the rest of the code . if ( endNode.type == CKEDITOR.NODE_TEXT ) endNode = endNode.split( endOffset ); else { // If the end container has children and the offset is pointing // to a child, then we should start from it. if ( endNode.getChildCount() > 0 ) { // If the offset points after the last node. if ( endOffset >= endNode.getChildCount() ) { // Let's create a temporary node and mark it for removal. endNode = endNode.append( range.document.createText( '' ) ); removeEndNode = true; } else endNode = endNode.getChild( endOffset ); } } // For text containers, we must simply split the node. The removal will // be handled by the rest of the code . if ( startNode.type == CKEDITOR.NODE_TEXT ) { startNode.split( startOffset ); // In cases the end node is the same as the start node, the above // splitting will also split the end, so me must move the end to // the second part of the split. if ( startNode.equals( endNode ) ) endNode = startNode.getNext(); } else { // If the start container has children and the offset is pointing // to a child, then we should start from its previous sibling. // If the offset points to the first node, we don't have a // sibling, so let's use the first one, but mark it for removal. if ( !startOffset ) { // Let's create a temporary node and mark it for removal. startNode = startNode.getFirst().insertBeforeMe( range.document.createText( '' ) ); removeStartNode = true; } else if ( startOffset >= startNode.getChildCount() ) { // Let's create a temporary node and mark it for removal. startNode = startNode.append( range.document.createText( '' ) ); removeStartNode = true; } else startNode = startNode.getChild( startOffset ).getPrevious(); } // Get the parent nodes tree for the start and end boundaries. var startParents = startNode.getParents(); var endParents = endNode.getParents(); // Compare them, to find the top most siblings. var i, topStart, topEnd; for ( i = 0 ; i < startParents.length ; i++ ) { topStart = startParents[ i ]; topEnd = endParents[ i ]; // The compared nodes will match until we find the top most // siblings (different nodes that have the same parent). // "i" will hold the index in the parents array for the top // most element. if ( !topStart.equals( topEnd ) ) break; } var clone = docFrag, levelStartNode, levelClone, currentNode, currentSibling; // Remove all successive sibling nodes for every node in the // startParents tree. for ( var j = i ; j < startParents.length ; j++ ) { levelStartNode = startParents[j]; // For Extract and Clone, we must clone this level. if ( clone && !levelStartNode.equals( startNode ) ) // action = 0 = Delete levelClone = clone.append( levelStartNode.clone() ); currentNode = levelStartNode.getNext(); while ( currentNode ) { // Stop processing when the current node matches a node in the // endParents tree or if it is the endNode. if ( currentNode.equals( endParents[ j ] ) || currentNode.equals( endNode ) ) break; // Cache the next sibling. currentSibling = currentNode.getNext(); // If cloning, just clone it. if ( action == 2 ) // 2 = Clone clone.append( currentNode.clone( true ) ); else { // Both Delete and Extract will remove the node. currentNode.remove(); // When Extracting, move the removed node to the docFrag. if ( action == 1 ) // 1 = Extract clone.append( currentNode ); } currentNode = currentSibling; } if ( clone ) clone = levelClone; } clone = docFrag; // Remove all previous sibling nodes for every node in the // endParents tree. for ( var k = i ; k < endParents.length ; k++ ) { levelStartNode = endParents[ k ]; // For Extract and Clone, we must clone this level. if ( action > 0 && !levelStartNode.equals( endNode ) ) // action = 0 = Delete levelClone = clone.append( levelStartNode.clone() ); // The processing of siblings may have already been done by the parent. if ( !startParents[ k ] || levelStartNode.$.parentNode != startParents[ k ].$.parentNode ) { currentNode = levelStartNode.getPrevious(); while ( currentNode ) { // Stop processing when the current node matches a node in the // startParents tree or if it is the startNode. if ( currentNode.equals( startParents[ k ] ) || currentNode.equals( startNode ) ) break; // Cache the next sibling. currentSibling = currentNode.getPrevious(); // If cloning, just clone it. if ( action == 2 ) // 2 = Clone clone.$.insertBefore( currentNode.$.cloneNode( true ), clone.$.firstChild ) ; else { // Both Delete and Extract will remove the node. currentNode.remove(); // When Extracting, mode the removed node to the docFrag. if ( action == 1 ) // 1 = Extract clone.$.insertBefore( currentNode.$, clone.$.firstChild ); } currentNode = currentSibling; } } if ( clone ) clone = levelClone; } if ( action == 2 ) // 2 = Clone. { // No changes in the DOM should be done, so fix the split text (if any). var startTextNode = range.startContainer; if ( startTextNode.type == CKEDITOR.NODE_TEXT ) { startTextNode.$.data += startTextNode.$.nextSibling.data; startTextNode.$.parentNode.removeChild( startTextNode.$.nextSibling ); } var endTextNode = range.endContainer; if ( endTextNode.type == CKEDITOR.NODE_TEXT && endTextNode.$.nextSibling ) { endTextNode.$.data += endTextNode.$.nextSibling.data; endTextNode.$.parentNode.removeChild( endTextNode.$.nextSibling ); } } else { // Collapse the range. // If a node has been partially selected, collapse the range between // topStart and topEnd. Otherwise, simply collapse it to the start. (W3C specs). if ( topStart && topEnd && ( startNode.$.parentNode != topStart.$.parentNode || endNode.$.parentNode != topEnd.$.parentNode ) ) { var endIndex = topEnd.getIndex(); // If the start node is to be removed, we must correct the // index to reflect the removal. if ( removeStartNode && topEnd.$.parentNode == startNode.$.parentNode ) endIndex--; // Merge splitted parents. if ( mergeThen && topStart.type == CKEDITOR.NODE_ELEMENT ) { var span = CKEDITOR.dom.element.createFromHtml( '<span ' + 'data-cke-bookmark="1" style="display:none">&nbsp;</span>', range.document ); span.insertAfter( topStart ); topStart.mergeSiblings( false ); range.moveToBookmark( { startNode : span } ); } else range.setStart( topEnd.getParent(), endIndex ); } // Collapse it to the start. range.collapse( true ); } // Cleanup any marked node. if ( removeStartNode ) startNode.remove(); if ( removeEndNode && endNode.$.parentNode ) endNode.remove(); }; var inlineChildReqElements = { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 }; // Creates the appropriate node evaluator for the dom walker used inside // check(Start|End)OfBlock. function getCheckStartEndBlockEvalFunction( isStart ) { var hadBr = false, bookmarkEvaluator = CKEDITOR.dom.walker.bookmark( true ); return function( node ) { // First ignore bookmark nodes. if ( bookmarkEvaluator( node ) ) return true; if ( node.type == CKEDITOR.NODE_TEXT ) { // If there's any visible text, then we're not at the start. if ( node.hasAscendant( 'pre' ) || CKEDITOR.tools.trim( node.getText() ).length ) return false; } else if ( node.type == CKEDITOR.NODE_ELEMENT ) { // If there are non-empty inline elements (e.g. <img />), then we're not // at the start. if ( !inlineChildReqElements[ node.getName() ] ) { // If we're working at the end-of-block, forgive the first <br /> in non-IE // browsers. if ( !isStart && !CKEDITOR.env.ie && node.getName() == 'br' && !hadBr ) hadBr = true; else return false; } } return true; }; } var isBogus = CKEDITOR.dom.walker.bogus(); // Evaluator for CKEDITOR.dom.element::checkBoundaryOfElement, reject any // text node and non-empty elements unless it's being bookmark text. function elementBoundaryEval( checkStart ) { return function( node ) { // Tolerant bogus br when checking at the end of block. // Reject any text node unless it's being bookmark // OR it's spaces. // Reject any element unless it's being invisible empty. (#3883) return !checkStart && isBogus( node ) || ( node.type == CKEDITOR.NODE_TEXT ? !CKEDITOR.tools.trim( node.getText() ) || !!node.getParent().data( 'cke-bookmark' ) : node.getName() in CKEDITOR.dtd.$removeEmpty ); }; } var whitespaceEval = new CKEDITOR.dom.walker.whitespaces(), bookmarkEval = new CKEDITOR.dom.walker.bookmark(); function nonWhitespaceOrBookmarkEval( node ) { // Whitespaces and bookmark nodes are to be ignored. return !whitespaceEval( node ) && !bookmarkEval( node ); } CKEDITOR.dom.range.prototype = { clone : function() { var clone = new CKEDITOR.dom.range( this.document ); clone.startContainer = this.startContainer; clone.startOffset = this.startOffset; clone.endContainer = this.endContainer; clone.endOffset = this.endOffset; clone.collapsed = this.collapsed; return clone; }, collapse : function( toStart ) { if ( toStart ) { this.endContainer = this.startContainer; this.endOffset = this.startOffset; } else { this.startContainer = this.endContainer; this.startOffset = this.endOffset; } this.collapsed = true; }, /** * The content nodes of the range are cloned and added to a document fragment, which is returned. * <strong> Note: </strong> Text selection may lost after invoking this method. (caused by text node splitting). */ cloneContents : function() { var docFrag = new CKEDITOR.dom.documentFragment( this.document ); if ( !this.collapsed ) execContentsAction( this, 2, docFrag ); return docFrag; }, /** * Deletes the content nodes of the range permanently from the DOM tree. * @param {Boolean} [mergeThen] Merge any splitted elements result in DOM true due to partial selection. */ deleteContents : function( mergeThen ) { if ( this.collapsed ) return; execContentsAction( this, 0, null, mergeThen ); }, /** * The content nodes of the range are cloned and added to a document fragment, * meanwhile they're removed permanently from the DOM tree. * @param {Boolean} [mergeThen] Merge any splitted elements result in DOM true due to partial selection. */ extractContents : function( mergeThen ) { var docFrag = new CKEDITOR.dom.documentFragment( this.document ); if ( !this.collapsed ) execContentsAction( this, 1, docFrag, mergeThen ); return docFrag; }, /** * Creates a bookmark object, which can be later used to restore the * range by using the moveToBookmark function. * This is an "intrusive" way to create a bookmark. It includes <span> tags * in the range boundaries. The advantage of it is that it is possible to * handle DOM mutations when moving back to the bookmark. * Attention: the inclusion of nodes in the DOM is a design choice and * should not be changed as there are other points in the code that may be * using those nodes to perform operations. See GetBookmarkNode. * @param {Boolean} [serializable] Indicates that the bookmark nodes * must contain ids, which can be used to restore the range even * when these nodes suffer mutations (like a clonation or innerHTML * change). * @returns {Object} And object representing a bookmark. */ createBookmark : function( serializable ) { var startNode, endNode; var baseId; var clone; var collapsed = this.collapsed; startNode = this.document.createElement( 'span' ); startNode.data( 'cke-bookmark', 1 ); startNode.setStyle( 'display', 'none' ); // For IE, it must have something inside, otherwise it may be // removed during DOM operations. startNode.setHtml( '&nbsp;' ); if ( serializable ) { baseId = 'cke_bm_' + CKEDITOR.tools.getNextNumber(); startNode.setAttribute( 'id', baseId + 'S' ); } // If collapsed, the endNode will not be created. if ( !collapsed ) { endNode = startNode.clone(); endNode.setHtml( '&nbsp;' ); if ( serializable ) endNode.setAttribute( 'id', baseId + 'E' ); clone = this.clone(); clone.collapse(); clone.insertNode( endNode ); } clone = this.clone(); clone.collapse( true ); clone.insertNode( startNode ); // Update the range position. if ( endNode ) { this.setStartAfter( startNode ); this.setEndBefore( endNode ); } else this.moveToPosition( startNode, CKEDITOR.POSITION_AFTER_END ); return { startNode : serializable ? baseId + 'S' : startNode, endNode : serializable ? baseId + 'E' : endNode, serializable : serializable, collapsed : collapsed }; }, /** * Creates a "non intrusive" and "mutation sensible" bookmark. This * kind of bookmark should be used only when the DOM is supposed to * remain stable after its creation. * @param {Boolean} [normalized] Indicates that the bookmark must * normalized. When normalized, the successive text nodes are * considered a single node. To sucessful load a normalized * bookmark, the DOM tree must be also normalized before calling * moveToBookmark. * @returns {Object} An object representing the bookmark. */ createBookmark2 : function( normalized ) { var startContainer = this.startContainer, endContainer = this.endContainer; var startOffset = this.startOffset, endOffset = this.endOffset; var collapsed = this.collapsed; var child, previous; // If there is no range then get out of here. // It happens on initial load in Safari #962 and if the editor it's // hidden also in Firefox if ( !startContainer || !endContainer ) return { start : 0, end : 0 }; if ( normalized ) { // Find out if the start is pointing to a text node that will // be normalized. if ( startContainer.type == CKEDITOR.NODE_ELEMENT ) { child = startContainer.getChild( startOffset ); // In this case, move the start information to that text // node. if ( child && child.type == CKEDITOR.NODE_TEXT && startOffset > 0 && child.getPrevious().type == CKEDITOR.NODE_TEXT ) { startContainer = child; startOffset = 0; } // Get the normalized offset. if ( child && child.type == CKEDITOR.NODE_ELEMENT ) startOffset = child.getIndex( 1 ); } // Normalize the start. while ( startContainer.type == CKEDITOR.NODE_TEXT && ( previous = startContainer.getPrevious() ) && previous.type == CKEDITOR.NODE_TEXT ) { startContainer = previous; startOffset += previous.getLength(); } // Process the end only if not normalized. if ( !collapsed ) { // Find out if the start is pointing to a text node that // will be normalized. if ( endContainer.type == CKEDITOR.NODE_ELEMENT ) { child = endContainer.getChild( endOffset ); // In this case, move the start information to that // text node. if ( child && child.type == CKEDITOR.NODE_TEXT && endOffset > 0 && child.getPrevious().type == CKEDITOR.NODE_TEXT ) { endContainer = child; endOffset = 0; } // Get the normalized offset. if ( child && child.type == CKEDITOR.NODE_ELEMENT ) endOffset = child.getIndex( 1 ); } // Normalize the end. while ( endContainer.type == CKEDITOR.NODE_TEXT && ( previous = endContainer.getPrevious() ) && previous.type == CKEDITOR.NODE_TEXT ) { endContainer = previous; endOffset += previous.getLength(); } } } return { start : startContainer.getAddress( normalized ), end : collapsed ? null : endContainer.getAddress( normalized ), startOffset : startOffset, endOffset : endOffset, normalized : normalized, collapsed : collapsed, is2 : true // It's a createBookmark2 bookmark. }; }, moveToBookmark : function( bookmark ) { if ( bookmark.is2 ) // Created with createBookmark2(). { // Get the start information. var startContainer = this.document.getByAddress( bookmark.start, bookmark.normalized ), startOffset = bookmark.startOffset; // Get the end information. var endContainer = bookmark.end && this.document.getByAddress( bookmark.end, bookmark.normalized ), endOffset = bookmark.endOffset; // Set the start boundary. this.setStart( startContainer, startOffset ); // Set the end boundary. If not available, collapse it. if ( endContainer ) this.setEnd( endContainer, endOffset ); else this.collapse( true ); } else // Created with createBookmark(). { var serializable = bookmark.serializable, startNode = serializable ? this.document.getById( bookmark.startNode ) : bookmark.startNode, endNode = serializable ? this.document.getById( bookmark.endNode ) : bookmark.endNode; // Set the range start at the bookmark start node position. this.setStartBefore( startNode ); // Remove it, because it may interfere in the setEndBefore call. startNode.remove(); // Set the range end at the bookmark end node position, or simply // collapse it if it is not available. if ( endNode ) { this.setEndBefore( endNode ); endNode.remove(); } else this.collapse( true ); } }, getBoundaryNodes : function() { var startNode = this.startContainer, endNode = this.endContainer, startOffset = this.startOffset, endOffset = this.endOffset, childCount; if ( startNode.type == CKEDITOR.NODE_ELEMENT ) { childCount = startNode.getChildCount(); if ( childCount > startOffset ) startNode = startNode.getChild( startOffset ); else if ( childCount < 1 ) startNode = startNode.getPreviousSourceNode(); else // startOffset > childCount but childCount is not 0 { // Try to take the node just after the current position. startNode = startNode.$; while ( startNode.lastChild ) startNode = startNode.lastChild; startNode = new CKEDITOR.dom.node( startNode ); // Normally we should take the next node in DFS order. But it // is also possible that we've already reached the end of // document. startNode = startNode.getNextSourceNode() || startNode; } } if ( endNode.type == CKEDITOR.NODE_ELEMENT ) { childCount = endNode.getChildCount(); if ( childCount > endOffset ) endNode = endNode.getChild( endOffset ).getPreviousSourceNode( true ); else if ( childCount < 1 ) endNode = endNode.getPreviousSourceNode(); else // endOffset > childCount but childCount is not 0 { // Try to take the node just before the current position. endNode = endNode.$; while ( endNode.lastChild ) endNode = endNode.lastChild; endNode = new CKEDITOR.dom.node( endNode ); } } // Sometimes the endNode will come right before startNode for collapsed // ranges. Fix it. (#3780) if ( startNode.getPosition( endNode ) & CKEDITOR.POSITION_FOLLOWING ) startNode = endNode; return { startNode : startNode, endNode : endNode }; }, /** * Find the node which fully contains the range. * @param includeSelf * @param {Boolean} ignoreTextNode Whether ignore CKEDITOR.NODE_TEXT type. */ getCommonAncestor : function( includeSelf , ignoreTextNode ) { var start = this.startContainer, end = this.endContainer, ancestor; if ( start.equals( end ) ) { if ( includeSelf && start.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ) ancestor = start.getChild( this.startOffset ); else ancestor = start; } else ancestor = start.getCommonAncestor( end ); return ignoreTextNode && !ancestor.is ? ancestor.getParent() : ancestor; }, /** * Transforms the startContainer and endContainer properties from text * nodes to element nodes, whenever possible. This is actually possible * if either of the boundary containers point to a text node, and its * offset is set to zero, or after the last char in the node. */ optimize : function() { var container = this.startContainer; var offset = this.startOffset; if ( container.type != CKEDITOR.NODE_ELEMENT ) { if ( !offset ) this.setStartBefore( container ); else if ( offset >= container.getLength() ) this.setStartAfter( container ); } container = this.endContainer; offset = this.endOffset; if ( container.type != CKEDITOR.NODE_ELEMENT ) { if ( !offset ) this.setEndBefore( container ); else if ( offset >= container.getLength() ) this.setEndAfter( container ); } }, /** * Move the range out of bookmark nodes if they'd been the container. */ optimizeBookmark: function() { var startNode = this.startContainer, endNode = this.endContainer; if ( startNode.is && startNode.is( 'span' ) && startNode.data( 'cke-bookmark' ) ) this.setStartAt( startNode, CKEDITOR.POSITION_BEFORE_START ); if ( endNode && endNode.is && endNode.is( 'span' ) && endNode.data( 'cke-bookmark' ) ) this.setEndAt( endNode, CKEDITOR.POSITION_AFTER_END ); }, trim : function( ignoreStart, ignoreEnd ) { var startContainer = this.startContainer, startOffset = this.startOffset, collapsed = this.collapsed; if ( ( !ignoreStart || collapsed ) && startContainer && startContainer.type == CKEDITOR.NODE_TEXT ) { // If the offset is zero, we just insert the new node before // the start. if ( !startOffset ) { startOffset = startContainer.getIndex(); startContainer = startContainer.getParent(); } // If the offset is at the end, we'll insert it after the text // node. else if ( startOffset >= startContainer.getLength() ) { startOffset = startContainer.getIndex() + 1; startContainer = startContainer.getParent(); } // In other case, we split the text node and insert the new // node at the split point. else { var nextText = startContainer.split( startOffset ); startOffset = startContainer.getIndex() + 1; startContainer = startContainer.getParent(); // Check all necessity of updating the end boundary. if ( this.startContainer.equals( this.endContainer ) ) this.setEnd( nextText, this.endOffset - this.startOffset ); else if ( startContainer.equals( this.endContainer ) ) this.endOffset += 1; } this.setStart( startContainer, startOffset ); if ( collapsed ) { this.collapse( true ); return; } } var endContainer = this.endContainer; var endOffset = this.endOffset; if ( !( ignoreEnd || collapsed ) && endContainer && endContainer.type == CKEDITOR.NODE_TEXT ) { // If the offset is zero, we just insert the new node before // the start. if ( !endOffset ) { endOffset = endContainer.getIndex(); endContainer = endContainer.getParent(); } // If the offset is at the end, we'll insert it after the text // node. else if ( endOffset >= endContainer.getLength() ) { endOffset = endContainer.getIndex() + 1; endContainer = endContainer.getParent(); } // In other case, we split the text node and insert the new // node at the split point. else { endContainer.split( endOffset ); endOffset = endContainer.getIndex() + 1; endContainer = endContainer.getParent(); } this.setEnd( endContainer, endOffset ); } }, /** * Expands the range so that partial units are completely contained. * @param unit {Number} The unit type to expand with. * @param {Boolean} [excludeBrs=false] Whether include line-breaks when expanding. */ enlarge : function( unit, excludeBrs ) { switch ( unit ) { case CKEDITOR.ENLARGE_ELEMENT : if ( this.collapsed ) return; // Get the common ancestor. var commonAncestor = this.getCommonAncestor(); var body = this.document.getBody(); // For each boundary // a. Depending on its position, find out the first node to be checked (a sibling) or, if not available, to be enlarge. // b. Go ahead checking siblings and enlarging the boundary as much as possible until the common ancestor is not reached. After reaching the common ancestor, just save the enlargeable node to be used later. var startTop, endTop; var enlargeable, sibling, commonReached; // Indicates that the node can be added only if whitespace // is available before it. var needsWhiteSpace = false; var isWhiteSpace; var siblingText; // Process the start boundary. var container = this.startContainer; var offset = this.startOffset; if ( container.type == CKEDITOR.NODE_TEXT ) { if ( offset ) { // Check if there is any non-space text before the // offset. Otherwise, container is null. container = !CKEDITOR.tools.trim( container.substring( 0, offset ) ).length && container; // If we found only whitespace in the node, it // means that we'll need more whitespace to be able // to expand. For example, <i> can be expanded in // "A <i> [B]</i>", but not in "A<i> [B]</i>". needsWhiteSpace = !!container; } if ( container ) { if ( !( sibling = container.getPrevious() ) ) enlargeable = container.getParent(); } } else { // If we have offset, get the node preceeding it as the // first sibling to be checked. if ( offset ) sibling = container.getChild( offset - 1 ) || container.getLast(); // If there is no sibling, mark the container to be // enlarged. if ( !sibling ) enlargeable = container; } while ( enlargeable || sibling ) { if ( enlargeable && !sibling ) { // If we reached the common ancestor, mark the flag // for it. if ( !commonReached && enlargeable.equals( commonAncestor ) ) commonReached = true; if ( !body.contains( enlargeable ) ) break; // If we don't need space or this element breaks // the line, then enlarge it. if ( !needsWhiteSpace || enlargeable.getComputedStyle( 'display' ) != 'inline' ) { needsWhiteSpace = false; // If the common ancestor has been reached, // we'll not enlarge it immediately, but just // mark it to be enlarged later if the end // boundary also enlarges it. if ( commonReached ) startTop = enlargeable; else this.setStartBefore( enlargeable ); } sibling = enlargeable.getPrevious(); } // Check all sibling nodes preceeding the enlargeable // node. The node wil lbe enlarged only if none of them // blocks it. while ( sibling ) { // This flag indicates that this node has // whitespaces at the end. isWhiteSpace = false; if ( sibling.type == CKEDITOR.NODE_COMMENT ) { sibling = sibling.getPrevious(); continue; } else if ( sibling.type == CKEDITOR.NODE_TEXT ) { siblingText = sibling.getText(); if ( /[^\s\ufeff]/.test( siblingText ) ) sibling = null; isWhiteSpace = /[\s\ufeff]$/.test( siblingText ); } else { // If this is a visible element. // We need to check for the bookmark attribute because IE insists on // rendering the display:none nodes we use for bookmarks. (#3363) // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) { // We'll accept it only if we need // whitespace, and this is an inline // element with whitespace only. if ( needsWhiteSpace && CKEDITOR.dtd.$removeEmpty[ sibling.getName() ] ) { // It must contains spaces and inline elements only. siblingText = sibling.getText(); if ( (/[^\s\ufeff]/).test( siblingText ) ) // Spaces + Zero Width No-Break Space (U+FEFF) sibling = null; else { var allChildren = sibling.$.getElementsByTagName( '*' ); for ( var i = 0, child ; child = allChildren[ i++ ] ; ) { if ( !CKEDITOR.dtd.$removeEmpty[ child.nodeName.toLowerCase() ] ) { sibling = null; break; } } } if ( sibling ) isWhiteSpace = !!siblingText.length; } else sibling = null; } } // A node with whitespaces has been found. if ( isWhiteSpace ) { // Enlarge the last enlargeable node, if we // were waiting for spaces. if ( needsWhiteSpace ) { if ( commonReached ) startTop = enlargeable; else if ( enlargeable ) this.setStartBefore( enlargeable ); } else needsWhiteSpace = true; } if ( sibling ) { var next = sibling.getPrevious(); if ( !enlargeable && !next ) { // Set the sibling as enlargeable, so it's // parent will be get later outside this while. enlargeable = sibling; sibling = null; break; } sibling = next; } else { // If sibling has been set to null, then we // need to stop enlarging. enlargeable = null; } } if ( enlargeable ) enlargeable = enlargeable.getParent(); } // Process the end boundary. This is basically the same // code used for the start boundary, with small changes to // make it work in the oposite side (to the right). This // makes it difficult to reuse the code here. So, fixes to // the above code are likely to be replicated here. container = this.endContainer; offset = this.endOffset; // Reset the common variables. enlargeable = sibling = null; commonReached = needsWhiteSpace = false; if ( container.type == CKEDITOR.NODE_TEXT ) { // Check if there is any non-space text after the // offset. Otherwise, container is null. container = !CKEDITOR.tools.trim( container.substring( offset ) ).length && container; // If we found only whitespace in the node, it // means that we'll need more whitespace to be able // to expand. For example, <i> can be expanded in // "A <i> [B]</i>", but not in "A<i> [B]</i>". needsWhiteSpace = !( container && container.getLength() ); if ( container ) { if ( !( sibling = container.getNext() ) ) enlargeable = container.getParent(); } } else { // Get the node right after the boudary to be checked // first. sibling = container.getChild( offset ); if ( !sibling ) enlargeable = container; } while ( enlargeable || sibling ) { if ( enlargeable && !sibling ) { if ( !commonReached && enlargeable.equals( commonAncestor ) ) commonReached = true; if ( !body.contains( enlargeable ) ) break; if ( !needsWhiteSpace || enlargeable.getComputedStyle( 'display' ) != 'inline' ) { needsWhiteSpace = false; if ( commonReached ) endTop = enlargeable; else if ( enlargeable ) this.setEndAfter( enlargeable ); } sibling = enlargeable.getNext(); } while ( sibling ) { isWhiteSpace = false; if ( sibling.type == CKEDITOR.NODE_TEXT ) { siblingText = sibling.getText(); if ( /[^\s\ufeff]/.test( siblingText ) ) sibling = null; isWhiteSpace = /^[\s\ufeff]/.test( siblingText ); } else if ( sibling.type == CKEDITOR.NODE_ELEMENT ) { // If this is a visible element. // We need to check for the bookmark attribute because IE insists on // rendering the display:none nodes we use for bookmarks. (#3363) // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) { // We'll accept it only if we need // whitespace, and this is an inline // element with whitespace only. if ( needsWhiteSpace && CKEDITOR.dtd.$removeEmpty[ sibling.getName() ] ) { // It must contains spaces and inline elements only. siblingText = sibling.getText(); if ( (/[^\s\ufeff]/).test( siblingText ) ) sibling = null; else { allChildren = sibling.$.getElementsByTagName( '*' ); for ( i = 0 ; child = allChildren[ i++ ] ; ) { if ( !CKEDITOR.dtd.$removeEmpty[ child.nodeName.toLowerCase() ] ) { sibling = null; break; } } } if ( sibling ) isWhiteSpace = !!siblingText.length; } else sibling = null; } } else isWhiteSpace = 1; if ( isWhiteSpace ) { if ( needsWhiteSpace ) { if ( commonReached ) endTop = enlargeable; else this.setEndAfter( enlargeable ); } } if ( sibling ) { next = sibling.getNext(); if ( !enlargeable && !next ) { enlargeable = sibling; sibling = null; break; } sibling = next; } else { // If sibling has been set to null, then we // need to stop enlarging. enlargeable = null; } } if ( enlargeable ) enlargeable = enlargeable.getParent(); } // If the common ancestor can be enlarged by both boundaries, then include it also. if ( startTop && endTop ) { commonAncestor = startTop.contains( endTop ) ? endTop : startTop; this.setStartBefore( commonAncestor ); this.setEndAfter( commonAncestor ); } break; case CKEDITOR.ENLARGE_BLOCK_CONTENTS: case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS: // Enlarging the start boundary. var walkerRange = new CKEDITOR.dom.range( this.document ); body = this.document.getBody(); walkerRange.setStartAt( body, CKEDITOR.POSITION_AFTER_START ); walkerRange.setEnd( this.startContainer, this.startOffset ); var walker = new CKEDITOR.dom.walker( walkerRange ), blockBoundary, // The node on which the enlarging should stop. tailBr, // In case BR as block boundary. notBlockBoundary = CKEDITOR.dom.walker.blockBoundary( ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? { br : 1 } : null ), // Record the encountered 'blockBoundary' for later use. boundaryGuard = function( node ) { var retval = notBlockBoundary( node ); if ( !retval ) blockBoundary = node; return retval; }, // Record the encounted 'tailBr' for later use. tailBrGuard = function( node ) { var retval = boundaryGuard( node ); if ( !retval && node.is && node.is( 'br' ) ) tailBr = node; return retval; }; walker.guard = boundaryGuard; enlargeable = walker.lastBackward(); // It's the body which stop the enlarging if no block boundary found. blockBoundary = blockBoundary || body; // Start the range either after the end of found block (<p>...</p>[text) // or at the start of block (<p>[text...), by comparing the document position // with 'enlargeable' node. this.setStartAt( blockBoundary, !blockBoundary.is( 'br' ) && ( !enlargeable && this.checkStartOfBlock() || enlargeable && blockBoundary.contains( enlargeable ) ) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END ); // Avoid enlarging the range further when end boundary spans right after the BR. (#7490) if ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) { var theRange = this.clone(); walker = new CKEDITOR.dom.walker( theRange ); var whitespaces = CKEDITOR.dom.walker.whitespaces(), bookmark = CKEDITOR.dom.walker.bookmark(); walker.evaluator = function( node ) { return !whitespaces( node ) && !bookmark( node ); }; var previous = walker.previous(); if ( previous && previous.type == CKEDITOR.NODE_ELEMENT && previous.is( 'br' ) ) return; } // Enlarging the end boundary. walkerRange = this.clone(); walkerRange.collapse(); walkerRange.setEndAt( body, CKEDITOR.POSITION_BEFORE_END ); walker = new CKEDITOR.dom.walker( walkerRange ); // tailBrGuard only used for on range end. walker.guard = ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? tailBrGuard : boundaryGuard; blockBoundary = null; // End the range right before the block boundary node. enlargeable = walker.lastForward(); // It's the body which stop the enlarging if no block boundary found. blockBoundary = blockBoundary || body; // Close the range either before the found block start (text]<p>...</p>) or at the block end (...text]</p>) // by comparing the document position with 'enlargeable' node. this.setEndAt( blockBoundary, ( !enlargeable && this.checkEndOfBlock() || enlargeable && blockBoundary.contains( enlargeable ) ) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START ); // We must include the <br> at the end of range if there's // one and we're expanding list item contents if ( tailBr ) this.setEndAfter( tailBr ); } }, /** * Descrease the range to make sure that boundaries * always anchor beside text nodes or innermost element. * @param {Number} mode ( CKEDITOR.SHRINK_ELEMENT | CKEDITOR.SHRINK_TEXT ) The shrinking mode. * <dl> * <dt>CKEDITOR.SHRINK_ELEMENT</dt> * <dd>Shrink the range boundaries to the edge of the innermost element.</dd> * <dt>CKEDITOR.SHRINK_TEXT</dt> * <dd>Shrink the range boudaries to anchor by the side of enclosed text node, range remains if there's no text nodes on boundaries at all.</dd> * </dl> * @param {Boolean} selectContents Whether result range anchors at the inner OR outer boundary of the node. */ shrink : function( mode, selectContents ) { // Unable to shrink a collapsed range. if ( !this.collapsed ) { mode = mode || CKEDITOR.SHRINK_TEXT; var walkerRange = this.clone(); var startContainer = this.startContainer, endContainer = this.endContainer, startOffset = this.startOffset, endOffset = this.endOffset, collapsed = this.collapsed; // Whether the start/end boundary is moveable. var moveStart = 1, moveEnd = 1; if ( startContainer && startContainer.type == CKEDITOR.NODE_TEXT ) { if ( !startOffset ) walkerRange.setStartBefore( startContainer ); else if ( startOffset >= startContainer.getLength( ) ) walkerRange.setStartAfter( startContainer ); else { // Enlarge the range properly to avoid walker making // DOM changes caused by triming the text nodes later. walkerRange.setStartBefore( startContainer ); moveStart = 0; } } if ( endContainer && endContainer.type == CKEDITOR.NODE_TEXT ) { if ( !endOffset ) walkerRange.setEndBefore( endContainer ); else if ( endOffset >= endContainer.getLength( ) ) walkerRange.setEndAfter( endContainer ); else { walkerRange.setEndAfter( endContainer ); moveEnd = 0; } } var walker = new CKEDITOR.dom.walker( walkerRange ), isBookmark = CKEDITOR.dom.walker.bookmark(); walker.evaluator = function( node ) { return node.type == ( mode == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT ); }; var currentElement; walker.guard = function( node, movingOut ) { if ( isBookmark( node ) ) return true; // Stop when we're shrink in element mode while encountering a text node. if ( mode == CKEDITOR.SHRINK_ELEMENT && node.type == CKEDITOR.NODE_TEXT ) return false; // Stop when we've already walked "through" an element. if ( movingOut && node.equals( currentElement ) ) return false; if ( !movingOut && node.type == CKEDITOR.NODE_ELEMENT ) currentElement = node; return true; }; if ( moveStart ) { var textStart = walker[ mode == CKEDITOR.SHRINK_ELEMENT ? 'lastForward' : 'next'](); textStart && this.setStartAt( textStart, selectContents ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START ); } if ( moveEnd ) { walker.reset(); var textEnd = walker[ mode == CKEDITOR.SHRINK_ELEMENT ? 'lastBackward' : 'previous'](); textEnd && this.setEndAt( textEnd, selectContents ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END ); } return !!( moveStart || moveEnd ); } }, /** * Inserts a node at the start of the range. The range will be expanded * the contain the node. */ insertNode : function( node ) { this.optimizeBookmark(); this.trim( false, true ); var startContainer = this.startContainer; var startOffset = this.startOffset; var nextNode = startContainer.getChild( startOffset ); if ( nextNode ) node.insertBefore( nextNode ); else startContainer.append( node ); // Check if we need to update the end boundary. if ( node.getParent().equals( this.endContainer ) ) this.endOffset++; // Expand the range to embrace the new node. this.setStartBefore( node ); }, moveToPosition : function( node, position ) { this.setStartAt( node, position ); this.collapse( true ); }, selectNodeContents : function( node ) { this.setStart( node, 0 ); this.setEnd( node, node.type == CKEDITOR.NODE_TEXT ? node.getLength() : node.getChildCount() ); }, /** * Sets the start position of a Range. * @param {CKEDITOR.dom.node} startNode The node to start the range. * @param {Number} startOffset An integer greater than or equal to zero * representing the offset for the start of the range from the start * of startNode. */ setStart : function( startNode, startOffset ) { // W3C requires a check for the new position. If it is after the end // boundary, the range should be collapsed to the new start. It seams // we will not need this check for our use of this class so we can // ignore it for now. // Fixing invalid range start inside dtd empty elements. if( startNode.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[ startNode.getName() ] ) startOffset = startNode.getIndex(), startNode = startNode.getParent(); this.startContainer = startNode; this.startOffset = startOffset; if ( !this.endContainer ) { this.endContainer = startNode; this.endOffset = startOffset; } updateCollapsed( this ); }, /** * Sets the end position of a Range. * @param {CKEDITOR.dom.node} endNode The node to end the range. * @param {Number} endOffset An integer greater than or equal to zero * representing the offset for the end of the range from the start * of endNode. */ setEnd : function( endNode, endOffset ) { // W3C requires a check for the new position. If it is before the start // boundary, the range should be collapsed to the new end. It seams we // will not need this check for our use of this class so we can ignore // it for now. // Fixing invalid range end inside dtd empty elements. if( endNode.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[ endNode.getName() ] ) endOffset = endNode.getIndex() + 1, endNode = endNode.getParent(); this.endContainer = endNode; this.endOffset = endOffset; if ( !this.startContainer ) { this.startContainer = endNode; this.startOffset = endOffset; } updateCollapsed( this ); }, setStartAfter : function( node ) { this.setStart( node.getParent(), node.getIndex() + 1 ); }, setStartBefore : function( node ) { this.setStart( node.getParent(), node.getIndex() ); }, setEndAfter : function( node ) { this.setEnd( node.getParent(), node.getIndex() + 1 ); }, setEndBefore : function( node ) { this.setEnd( node.getParent(), node.getIndex() ); }, setStartAt : function( node, position ) { switch( position ) { case CKEDITOR.POSITION_AFTER_START : this.setStart( node, 0 ); break; case CKEDITOR.POSITION_BEFORE_END : if ( node.type == CKEDITOR.NODE_TEXT ) this.setStart( node, node.getLength() ); else this.setStart( node, node.getChildCount() ); break; case CKEDITOR.POSITION_BEFORE_START : this.setStartBefore( node ); break; case CKEDITOR.POSITION_AFTER_END : this.setStartAfter( node ); } updateCollapsed( this ); }, setEndAt : function( node, position ) { switch( position ) { case CKEDITOR.POSITION_AFTER_START : this.setEnd( node, 0 ); break; case CKEDITOR.POSITION_BEFORE_END : if ( node.type == CKEDITOR.NODE_TEXT ) this.setEnd( node, node.getLength() ); else this.setEnd( node, node.getChildCount() ); break; case CKEDITOR.POSITION_BEFORE_START : this.setEndBefore( node ); break; case CKEDITOR.POSITION_AFTER_END : this.setEndAfter( node ); } updateCollapsed( this ); }, fixBlock : function( isStart, blockTag ) { var bookmark = this.createBookmark(), fixedBlock = this.document.createElement( blockTag ); this.collapse( isStart ); this.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); this.extractContents().appendTo( fixedBlock ); fixedBlock.trim(); if ( !CKEDITOR.env.ie ) fixedBlock.appendBogus(); this.insertNode( fixedBlock ); this.moveToBookmark( bookmark ); return fixedBlock; }, splitBlock : function( blockTag ) { var startPath = new CKEDITOR.dom.elementPath( this.startContainer ), endPath = new CKEDITOR.dom.elementPath( this.endContainer ); var startBlockLimit = startPath.blockLimit, endBlockLimit = endPath.blockLimit; var startBlock = startPath.block, endBlock = endPath.block; var elementPath = null; // Do nothing if the boundaries are in different block limits. if ( !startBlockLimit.equals( endBlockLimit ) ) return null; // Get or fix current blocks. if ( blockTag != 'br' ) { if ( !startBlock ) { startBlock = this.fixBlock( true, blockTag ); endBlock = new CKEDITOR.dom.elementPath( this.endContainer ).block; } if ( !endBlock ) endBlock = this.fixBlock( false, blockTag ); } // Get the range position. var isStartOfBlock = startBlock && this.checkStartOfBlock(), isEndOfBlock = endBlock && this.checkEndOfBlock(); // Delete the current contents. // TODO: Why is 2.x doing CheckIsEmpty()? this.deleteContents(); if ( startBlock && startBlock.equals( endBlock ) ) { if ( isEndOfBlock ) { elementPath = new CKEDITOR.dom.elementPath( this.startContainer ); this.moveToPosition( endBlock, CKEDITOR.POSITION_AFTER_END ); endBlock = null; } else if ( isStartOfBlock ) { elementPath = new CKEDITOR.dom.elementPath( this.startContainer ); this.moveToPosition( startBlock, CKEDITOR.POSITION_BEFORE_START ); startBlock = null; } else { endBlock = this.splitElement( startBlock ); // In Gecko, the last child node must be a bogus <br>. // Note: bogus <br> added under <ul> or <ol> would cause // lists to be incorrectly rendered. if ( !CKEDITOR.env.ie && !startBlock.is( 'ul', 'ol') ) startBlock.appendBogus() ; } } return { previousBlock : startBlock, nextBlock : endBlock, wasStartOfBlock : isStartOfBlock, wasEndOfBlock : isEndOfBlock, elementPath : elementPath }; }, /** * Branch the specified element from the collapsed range position and * place the caret between the two result branches. * Note: The range must be collapsed and been enclosed by this element. * @param {CKEDITOR.dom.element} element * @return {CKEDITOR.dom.element} Root element of the new branch after the split. */ splitElement : function( toSplit ) { if ( !this.collapsed ) return null; // Extract the contents of the block from the selection point to the end // of its contents. this.setEndAt( toSplit, CKEDITOR.POSITION_BEFORE_END ); var documentFragment = this.extractContents(); // Duplicate the element after it. var clone = toSplit.clone( false ); // Place the extracted contents into the duplicated element. documentFragment.appendTo( clone ); clone.insertAfter( toSplit ); this.moveToPosition( toSplit, CKEDITOR.POSITION_AFTER_END ); return clone; }, /** * Check whether a range boundary is at the inner boundary of a given * element. * @param {CKEDITOR.dom.element} element The target element to check. * @param {Number} checkType The boundary to check for both the range * and the element. It can be CKEDITOR.START or CKEDITOR.END. * @returns {Boolean} "true" if the range boundary is at the inner * boundary of the element. */ checkBoundaryOfElement : function( element, checkType ) { var checkStart = ( checkType == CKEDITOR.START ); // Create a copy of this range, so we can manipulate it for our checks. var walkerRange = this.clone(); // Collapse the range at the proper size. walkerRange.collapse( checkStart ); // Expand the range to element boundary. walkerRange[ checkStart ? 'setStartAt' : 'setEndAt' ] ( element, checkStart ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END ); // Create the walker, which will check if we have anything useful // in the range. var walker = new CKEDITOR.dom.walker( walkerRange ); walker.evaluator = elementBoundaryEval( checkStart ); return walker[ checkStart ? 'checkBackward' : 'checkForward' ](); }, // Calls to this function may produce changes to the DOM. The range may // be updated to reflect such changes. checkStartOfBlock : function() { var startContainer = this.startContainer, startOffset = this.startOffset; // If the starting node is a text node, and non-empty before the offset, // then we're surely not at the start of block. if ( startOffset && startContainer.type == CKEDITOR.NODE_TEXT ) { var textBefore = CKEDITOR.tools.ltrim( startContainer.substring( 0, startOffset ) ); if ( textBefore.length ) return false; } // Antecipate the trim() call here, so the walker will not make // changes to the DOM, which would not get reflected into this // range otherwise. this.trim(); // We need to grab the block element holding the start boundary, so // let's use an element path for it. var path = new CKEDITOR.dom.elementPath( this.startContainer ); // Creates a range starting at the block start until the range start. var walkerRange = this.clone(); walkerRange.collapse( true ); walkerRange.setStartAt( path.block || path.blockLimit, CKEDITOR.POSITION_AFTER_START ); var walker = new CKEDITOR.dom.walker( walkerRange ); walker.evaluator = getCheckStartEndBlockEvalFunction( true ); return walker.checkBackward(); }, checkEndOfBlock : function() { var endContainer = this.endContainer, endOffset = this.endOffset; // If the ending node is a text node, and non-empty after the offset, // then we're surely not at the end of block. if ( endContainer.type == CKEDITOR.NODE_TEXT ) { var textAfter = CKEDITOR.tools.rtrim( endContainer.substring( endOffset ) ); if ( textAfter.length ) return false; } // Antecipate the trim() call here, so the walker will not make // changes to the DOM, which would not get reflected into this // range otherwise. this.trim(); // We need to grab the block element holding the start boundary, so // let's use an element path for it. var path = new CKEDITOR.dom.elementPath( this.endContainer ); // Creates a range starting at the block start until the range start. var walkerRange = this.clone(); walkerRange.collapse( false ); walkerRange.setEndAt( path.block || path.blockLimit, CKEDITOR.POSITION_BEFORE_END ); var walker = new CKEDITOR.dom.walker( walkerRange ); walker.evaluator = getCheckStartEndBlockEvalFunction( false ); return walker.checkForward(); }, /** * Check if elements at which the range boundaries anchor are read-only, * with respect to "contenteditable" attribute. */ checkReadOnly : ( function() { function checkNodesEditable( node, anotherEnd ) { while( node ) { if ( node.type == CKEDITOR.NODE_ELEMENT ) { if ( node.getAttribute( 'contentEditable' ) == 'false' && !node.data( 'cke-editable' ) ) { return 0; } // Range enclosed entirely in an editable element. else if ( node.is( 'html' ) || node.getAttribute( 'contentEditable' ) == 'true' && ( node.contains( anotherEnd ) || node.equals( anotherEnd ) ) ) { break; } } node = node.getParent(); } return 1; } return function() { var startNode = this.startContainer, endNode = this.endContainer; // Check if elements path at both boundaries are editable. return !( checkNodesEditable( startNode, endNode ) && checkNodesEditable( endNode, startNode ) ); }; })(), /** * Moves the range boundaries to the first/end editing point inside an * element. For example, in an element tree like * "&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt; Text&lt;/p&gt;", the start editing point is * "&lt;p&gt;&lt;b&gt;&lt;i&gt;^&lt;/i&gt;&lt;/b&gt; Text&lt;/p&gt;" (inside &lt;i&gt;). * @param {CKEDITOR.dom.element} el The element into which look for the * editing spot. * @param {Boolean} isMoveToEnd Whether move to the end editable position. */ moveToElementEditablePosition : function( el, isMoveToEnd ) { function nextDFS( node, childOnly ) { var next; if ( node.type == CKEDITOR.NODE_ELEMENT && node.isEditable( false ) && !CKEDITOR.dtd.$nonEditable[ node.getName() ] ) { next = node[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval ); } if ( !childOnly && !next ) next = node[ isMoveToEnd ? 'getPrevious' : 'getNext' ]( nonWhitespaceOrBookmarkEval ); return next; } var found = 0; while ( el ) { // Stop immediately if we've found a text node. if ( el.type == CKEDITOR.NODE_TEXT ) { this.moveToPosition( el, isMoveToEnd ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START ); found = 1; break; } // If an editable element is found, move inside it, but not stop the searching. if ( el.type == CKEDITOR.NODE_ELEMENT ) { if ( el.isEditable() ) { this.moveToPosition( el, isMoveToEnd ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START ); found = 1; } } el = nextDFS( el, found ); } return !!found; }, /** *@see {CKEDITOR.dom.range.moveToElementEditablePosition} */ moveToElementEditStart : function( target ) { return this.moveToElementEditablePosition( target ); }, /** *@see {CKEDITOR.dom.range.moveToElementEditablePosition} */ moveToElementEditEnd : function( target ) { return this.moveToElementEditablePosition( target, true ); }, /** * Get the single node enclosed within the range if there's one. */ getEnclosedNode : function() { var walkerRange = this.clone(); // Optimize and analyze the range to avoid DOM destructive nature of walker. (#5780) walkerRange.optimize(); if ( walkerRange.startContainer.type != CKEDITOR.NODE_ELEMENT || walkerRange.endContainer.type != CKEDITOR.NODE_ELEMENT ) return null; var walker = new CKEDITOR.dom.walker( walkerRange ), isNotBookmarks = CKEDITOR.dom.walker.bookmark( true ), isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), evaluator = function( node ) { return isNotWhitespaces( node ) && isNotBookmarks( node ); }; walkerRange.evaluator = evaluator; var node = walker.next(); walker.reset(); return node && node.equals( walker.previous() ) ? node : null; }, getTouchedStartNode : function() { var container = this.startContainer ; if ( this.collapsed || container.type != CKEDITOR.NODE_ELEMENT ) return container ; return container.getChild( this.startOffset ) || container ; }, getTouchedEndNode : function() { var container = this.endContainer ; if ( this.collapsed || container.type != CKEDITOR.NODE_ELEMENT ) return container ; return container.getChild( this.endOffset - 1 ) || container ; } }; })(); CKEDITOR.POSITION_AFTER_START = 1; // <element>^contents</element> "^text" CKEDITOR.POSITION_BEFORE_END = 2; // <element>contents^</element> "text^" CKEDITOR.POSITION_BEFORE_START = 3; // ^<element>contents</element> ^"text" CKEDITOR.POSITION_AFTER_END = 4; // <element>contents</element>^ "text" CKEDITOR.ENLARGE_ELEMENT = 1; CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2; CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3; // Check boundary types. // @see CKEDITOR.dom.range.prototype.checkBoundaryOfElement CKEDITOR.START = 1; CKEDITOR.END = 2; CKEDITOR.STARTEND = 3; // Shrink range types. // @see CKEDITOR.dom.range.prototype.shrink CKEDITOR.SHRINK_ELEMENT = 1; CKEDITOR.SHRINK_TEXT = 2;
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.document} class, which * represents a DOM document. */ /** * Represents a DOM window. * @constructor * @augments CKEDITOR.dom.domObject * @param {Object} domWindow A native DOM window. * @example * var document = new CKEDITOR.dom.window( window ); */ CKEDITOR.dom.window = function( domWindow ) { CKEDITOR.dom.domObject.call( this, domWindow ); }; CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject(); CKEDITOR.tools.extend( CKEDITOR.dom.window.prototype, /** @lends CKEDITOR.dom.window.prototype */ { /** * Moves the selection focus to this window. * @function * @example * var win = new CKEDITOR.dom.window( window ); * <b>win.focus()</b>; */ focus : function() { // Webkit is sometimes failed to focus iframe, blur it first(#3835). if ( CKEDITOR.env.webkit && this.$.parent ) this.$.parent.focus(); this.$.focus(); }, /** * Gets the width and height of this window's viewable area. * @function * @returns {Object} An object with the "width" and "height" * properties containing the size. * @example * var win = new CKEDITOR.dom.window( window ); * var size = <b>win.getViewPaneSize()</b>; * alert( size.width ); * alert( size.height ); */ getViewPaneSize : function() { var doc = this.$.document, stdMode = doc.compatMode == 'CSS1Compat'; return { width : ( stdMode ? doc.documentElement.clientWidth : doc.body.clientWidth ) || 0, height : ( stdMode ? doc.documentElement.clientHeight : doc.body.clientHeight ) || 0 }; }, /** * Gets the current position of the window's scroll. * @function * @returns {Object} An object with the "x" and "y" properties * containing the scroll position. * @example * var win = new CKEDITOR.dom.window( window ); * var pos = <b>win.getScrollPosition()</b>; * alert( pos.x ); * alert( pos.y ); */ getScrollPosition : function() { var $ = this.$; if ( 'pageXOffset' in $ ) { return { x : $.pageXOffset || 0, y : $.pageYOffset || 0 }; } else { var doc = $.document; return { x : doc.documentElement.scrollLeft || doc.body.scrollLeft || 0, y : doc.documentElement.scrollTop || doc.body.scrollTop || 0 }; } } });
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @class */ CKEDITOR.dom.nodeList = function( nativeList ) { this.$ = nativeList; }; CKEDITOR.dom.nodeList.prototype = { count : function() { return this.$.length; }, getItem : function( index ) { var $node = this.$[ index ]; return $node ? new CKEDITOR.dom.node( $node ) : null; } };
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.document} class, which * represents a DOM document. */ /** * Represents a DOM document. * @constructor * @augments CKEDITOR.dom.domObject * @param {Object} domDocument A native DOM document. * @example * var document = new CKEDITOR.dom.document( document ); */ CKEDITOR.dom.document = function( domDocument ) { CKEDITOR.dom.domObject.call( this, domDocument ); }; // PACKAGER_RENAME( CKEDITOR.dom.document ) CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject(); CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, /** @lends CKEDITOR.dom.document.prototype */ { /** * Appends a CSS file to the document. * @param {String} cssFileUrl The CSS file URL. * @example * <b>CKEDITOR.document.appendStyleSheet( '/mystyles.css' )</b>; */ appendStyleSheet : function( cssFileUrl ) { if ( this.$.createStyleSheet ) this.$.createStyleSheet( cssFileUrl ); else { var link = new CKEDITOR.dom.element( 'link' ); link.setAttributes( { rel :'stylesheet', type : 'text/css', href : cssFileUrl }); this.getHead().append( link ); } }, appendStyleText : function( cssStyleText ) { if ( this.$.createStyleSheet ) { var styleSheet = this.$.createStyleSheet( "" ); styleSheet.cssText = cssStyleText ; } else { var style = new CKEDITOR.dom.element( 'style', this ); style.append( new CKEDITOR.dom.text( cssStyleText, this ) ); this.getHead().append( style ); } }, createElement : function( name, attribsAndStyles ) { var element = new CKEDITOR.dom.element( name, this ); if ( attribsAndStyles ) { if ( attribsAndStyles.attributes ) element.setAttributes( attribsAndStyles.attributes ); if ( attribsAndStyles.styles ) element.setStyles( attribsAndStyles.styles ); } return element; }, createText : function( text ) { return new CKEDITOR.dom.text( text, this ); }, focus : function() { this.getWindow().focus(); }, /** * Gets and element based on its id. * @param {String} elementId The element id. * @returns {CKEDITOR.dom.element} The element instance, or null if not found. * @example * var element = <b>CKEDITOR.document.getById( 'myElement' )</b>; * alert( element.getId() ); // "myElement" */ getById : function( elementId ) { var $ = this.$.getElementById( elementId ); return $ ? new CKEDITOR.dom.element( $ ) : null; }, getByAddress : function( address, normalized ) { var $ = this.$.documentElement; for ( var i = 0 ; $ && i < address.length ; i++ ) { var target = address[ i ]; if ( !normalized ) { $ = $.childNodes[ target ]; continue; } var currentIndex = -1; for (var j = 0 ; j < $.childNodes.length ; j++ ) { var candidate = $.childNodes[ j ]; if ( normalized === true && candidate.nodeType == 3 && candidate.previousSibling && candidate.previousSibling.nodeType == 3 ) { continue; } currentIndex++; if ( currentIndex == target ) { $ = candidate; break; } } } return $ ? new CKEDITOR.dom.node( $ ) : null; }, getElementsByTag : function( tagName, namespace ) { if ( !( CKEDITOR.env.ie && ! ( document.documentMode > 8 ) ) && namespace ) tagName = namespace + ':' + tagName; return new CKEDITOR.dom.nodeList( this.$.getElementsByTagName( tagName ) ); }, /** * Gets the &lt;head&gt; element for this document. * @returns {CKEDITOR.dom.element} The &lt;head&gt; element. * @example * var element = <b>CKEDITOR.document.getHead()</b>; * alert( element.getName() ); // "head" */ getHead : function() { var head = this.$.getElementsByTagName( 'head' )[0]; if ( !head ) head = this.getDocumentElement().append( new CKEDITOR.dom.element( 'head' ), true ); else head = new CKEDITOR.dom.element( head ); return ( this.getHead = function() { return head; })(); }, /** * Gets the &lt;body&gt; element for this document. * @returns {CKEDITOR.dom.element} The &lt;body&gt; element. * @example * var element = <b>CKEDITOR.document.getBody()</b>; * alert( element.getName() ); // "body" */ getBody : function() { var body = new CKEDITOR.dom.element( this.$.body ); return ( this.getBody = function() { return body; })(); }, /** * Gets the DOM document element for this document. * @returns {CKEDITOR.dom.element} The DOM document element. */ getDocumentElement : function() { var documentElement = new CKEDITOR.dom.element( this.$.documentElement ); return ( this.getDocumentElement = function() { return documentElement; })(); }, /** * Gets the window object that holds this document. * @returns {CKEDITOR.dom.window} The window object. */ getWindow : function() { var win = new CKEDITOR.dom.window( this.$.parentWindow || this.$.defaultView ); return ( this.getWindow = function() { return win; })(); }, /** * Defines the document contents through document.write. Note that the * previous document contents will be lost (cleaned). * @since 3.5 * @param {String} html The HTML defining the document contents. * @example * document.write( * '&lt;html&gt;' + * '&lt;head&gt;&lt;title&gt;Sample Doc&lt;/title&gt;&lt;/head&gt;' + * '&lt;body&gt;Document contents created by code&lt;/body&gt;' + * '&lt;/html&gt;' ); */ write : function( html ) { // Don't leave any history log in IE. (#5657) this.$.open( 'text/html', 'replace' ); // Support for custom document.domain in IE. CKEDITOR.env.isCustomDomain() && ( this.$.domain = document.domain ); this.$.write( html ); this.$.close(); } });
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { // This function is to be called under a "walker" instance scope. function iterate( rtl, breakOnFalse ) { var range = this.range; // Return null if we have reached the end. if ( this._.end ) return null; // This is the first call. Initialize it. if ( !this._.start ) { this._.start = 1; // A collapsed range must return null at first call. if ( range.collapsed ) { this.end(); return null; } // Move outside of text node edges. range.optimize(); } var node, startCt = range.startContainer, endCt = range.endContainer, startOffset = range.startOffset, endOffset = range.endOffset, guard, userGuard = this.guard, type = this.type, getSourceNodeFn = ( rtl ? 'getPreviousSourceNode' : 'getNextSourceNode' ); // Create the LTR guard function, if necessary. if ( !rtl && !this._.guardLTR ) { // The node that stops walker from moving up. var limitLTR = endCt.type == CKEDITOR.NODE_ELEMENT ? endCt : endCt.getParent(); // The node that stops the walker from going to next. var blockerLTR = endCt.type == CKEDITOR.NODE_ELEMENT ? endCt.getChild( endOffset ) : endCt.getNext(); this._.guardLTR = function( node, movingOut ) { return ( ( !movingOut || !limitLTR.equals( node ) ) && ( !blockerLTR || !node.equals( blockerLTR ) ) && ( node.type != CKEDITOR.NODE_ELEMENT || !movingOut || node.getName() != 'body' ) ); }; } // Create the RTL guard function, if necessary. if ( rtl && !this._.guardRTL ) { // The node that stops walker from moving up. var limitRTL = startCt.type == CKEDITOR.NODE_ELEMENT ? startCt : startCt.getParent(); // The node that stops the walker from going to next. var blockerRTL = startCt.type == CKEDITOR.NODE_ELEMENT ? startOffset ? startCt.getChild( startOffset - 1 ) : null : startCt.getPrevious(); this._.guardRTL = function( node, movingOut ) { return ( ( !movingOut || !limitRTL.equals( node ) ) && ( !blockerRTL || !node.equals( blockerRTL ) ) && ( node.type != CKEDITOR.NODE_ELEMENT || !movingOut || node.getName() != 'body' ) ); }; } // Define which guard function to use. var stopGuard = rtl ? this._.guardRTL : this._.guardLTR; // Make the user defined guard function participate in the process, // otherwise simply use the boundary guard. if ( userGuard ) { guard = function( node, movingOut ) { if ( stopGuard( node, movingOut ) === false ) return false; return userGuard( node, movingOut ); }; } else guard = stopGuard; if ( this.current ) node = this.current[ getSourceNodeFn ]( false, type, guard ); else { // Get the first node to be returned. if ( rtl ) { node = endCt; if ( node.type == CKEDITOR.NODE_ELEMENT ) { if ( endOffset > 0 ) node = node.getChild( endOffset - 1 ); else node = ( guard ( node, true ) === false ) ? null : node.getPreviousSourceNode( true, type, guard ); } } else { node = startCt; if ( node.type == CKEDITOR.NODE_ELEMENT ) { if ( ! ( node = node.getChild( startOffset ) ) ) node = ( guard ( startCt, true ) === false ) ? null : startCt.getNextSourceNode( true, type, guard ) ; } } if ( node && guard( node ) === false ) node = null; } while ( node && !this._.end ) { this.current = node; if ( !this.evaluator || this.evaluator( node ) !== false ) { if ( !breakOnFalse ) return node; } else if ( breakOnFalse && this.evaluator ) return false; node = node[ getSourceNodeFn ]( false, type, guard ); } this.end(); return this.current = null; } function iterateToLast( rtl ) { var node, last = null; while ( ( node = iterate.call( this, rtl ) ) ) last = node; return last; } CKEDITOR.dom.walker = CKEDITOR.tools.createClass( { /** * Utility class to "walk" the DOM inside a range boundaries. If * necessary, partially included nodes (text nodes) are broken to * reflect the boundaries limits, so DOM and range changes may happen. * Outside changes to the range may break the walker. * * The walker may return nodes that are not totaly included into the * range boundaires. Let's take the following range representation, * where the square brackets indicate the boundaries: * * [&lt;p&gt;Some &lt;b&gt;sample] text&lt;/b&gt; * * While walking forward into the above range, the following nodes are * returned: &lt;p&gt;, "Some ", &lt;b&gt; and "sample". Going * backwards instead we have: "sample" and "Some ". So note that the * walker always returns nodes when "entering" them, but not when * "leaving" them. The guard function is instead called both when * entering and leaving nodes. * * @constructor * @param {CKEDITOR.dom.range} range The range within which walk. */ $ : function( range ) { this.range = range; /** * A function executed for every matched node, to check whether * it's to be considered into the walk or not. If not provided, all * matched nodes are considered good. * If the function returns "false" the node is ignored. * @name CKEDITOR.dom.walker.prototype.evaluator * @property * @type Function */ // this.evaluator = null; /** * A function executed for every node the walk pass by to check * whether the walk is to be finished. It's called when both * entering and exiting nodes, as well as for the matched nodes. * If this function returns "false", the walking ends and no more * nodes are evaluated. * @name CKEDITOR.dom.walker.prototype.guard * @property * @type Function */ // this.guard = null; /** @private */ this._ = {}; }, // statics : // { // /* Creates a CKEDITOR.dom.walker instance to walk inside DOM boundaries set by nodes. // * @param {CKEDITOR.dom.node} startNode The node from wich the walk // * will start. // * @param {CKEDITOR.dom.node} [endNode] The last node to be considered // * in the walk. No more nodes are retrieved after touching or // * passing it. If not provided, the walker stops at the // * &lt;body&gt; closing boundary. // * @returns {CKEDITOR.dom.walker} A DOM walker for the nodes between the // * provided nodes. // */ // createOnNodes : function( startNode, endNode, startInclusive, endInclusive ) // { // var range = new CKEDITOR.dom.range(); // if ( startNode ) // range.setStartAt( startNode, startInclusive ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_END ) ; // else // range.setStartAt( startNode.getDocument().getBody(), CKEDITOR.POSITION_AFTER_START ) ; // // if ( endNode ) // range.setEndAt( endNode, endInclusive ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START ) ; // else // range.setEndAt( startNode.getDocument().getBody(), CKEDITOR.POSITION_BEFORE_END ) ; // // return new CKEDITOR.dom.walker( range ); // } // }, // proto : { /** * Stop walking. No more nodes are retrieved if this function gets * called. */ end : function() { this._.end = 1; }, /** * Retrieves the next node (at right). * @returns {CKEDITOR.dom.node} The next node or null if no more * nodes are available. */ next : function() { return iterate.call( this ); }, /** * Retrieves the previous node (at left). * @returns {CKEDITOR.dom.node} The previous node or null if no more * nodes are available. */ previous : function() { return iterate.call( this, 1 ); }, /** * Check all nodes at right, executing the evaluation fuction. * @returns {Boolean} "false" if the evaluator function returned * "false" for any of the matched nodes. Otherwise "true". */ checkForward : function() { return iterate.call( this, 0, 1 ) !== false; }, /** * Check all nodes at left, executing the evaluation fuction. * @returns {Boolean} "false" if the evaluator function returned * "false" for any of the matched nodes. Otherwise "true". */ checkBackward : function() { return iterate.call( this, 1, 1 ) !== false; }, /** * Executes a full walk forward (to the right), until no more nodes * are available, returning the last valid node. * @returns {CKEDITOR.dom.node} The last node at the right or null * if no valid nodes are available. */ lastForward : function() { return iterateToLast.call( this ); }, /** * Executes a full walk backwards (to the left), until no more nodes * are available, returning the last valid node. * @returns {CKEDITOR.dom.node} The last node at the left or null * if no valid nodes are available. */ lastBackward : function() { return iterateToLast.call( this, 1 ); }, reset : function() { delete this.current; this._ = {}; } } }); /* * Anything whose display computed style is block, list-item, table, * table-row-group, table-header-group, table-footer-group, table-row, * table-column-group, table-column, table-cell, table-caption, or whose node * name is hr, br (when enterMode is br only) is a block boundary. */ var blockBoundaryDisplayMatch = { block : 1, 'list-item' : 1, table : 1, 'table-row-group' : 1, 'table-header-group' : 1, 'table-footer-group' : 1, 'table-row' : 1, 'table-column-group' : 1, 'table-column' : 1, 'table-cell' : 1, 'table-caption' : 1 }; CKEDITOR.dom.element.prototype.isBlockBoundary = function( customNodeNames ) { var nodeNameMatches = customNodeNames ? CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$block, customNodeNames || {} ) : CKEDITOR.dtd.$block; // Don't consider floated formatting as block boundary, fall back to dtd check in that case. (#6297) return this.getComputedStyle( 'float' ) == 'none' && blockBoundaryDisplayMatch[ this.getComputedStyle( 'display' ) ] || nodeNameMatches[ this.getName() ]; }; CKEDITOR.dom.walker.blockBoundary = function( customNodeNames ) { return function( node , type ) { return ! ( node.type == CKEDITOR.NODE_ELEMENT && node.isBlockBoundary( customNodeNames ) ); }; }; CKEDITOR.dom.walker.listItemBoundary = function() { return this.blockBoundary( { br : 1 } ); }; /** * Whether the to-be-evaluated node is a bookmark node OR bookmark node * inner contents. * @param {Boolean} contentOnly Whether only test againt the text content of * bookmark node instead of the element itself(default). * @param {Boolean} isReject Whether should return 'false' for the bookmark * node instead of 'true'(default). */ CKEDITOR.dom.walker.bookmark = function( contentOnly, isReject ) { function isBookmarkNode( node ) { return ( node && node.getName && node.getName() == 'span' && node.data( 'cke-bookmark' ) ); } return function( node ) { var isBookmark, parent; // Is bookmark inner text node? isBookmark = ( node && !node.getName && ( parent = node.getParent() ) && isBookmarkNode( parent ) ); // Is bookmark node? isBookmark = contentOnly ? isBookmark : isBookmark || isBookmarkNode( node ); return !! ( isReject ^ isBookmark ); }; }; /** * Whether the node is a text node containing only whitespaces characters. * @param isReject */ CKEDITOR.dom.walker.whitespaces = function( isReject ) { return function( node ) { var isWhitespace = node && ( node.type == CKEDITOR.NODE_TEXT ) && !CKEDITOR.tools.trim( node.getText() ); return !! ( isReject ^ isWhitespace ); }; }; /** * Whether the node is invisible in wysiwyg mode. * @param isReject */ CKEDITOR.dom.walker.invisible = function( isReject ) { var whitespace = CKEDITOR.dom.walker.whitespaces(); return function( node ) { // Nodes that take no spaces in wysiwyg: // 1. White-spaces but not including NBSP; // 2. Empty inline elements, e.g. <b></b> we're checking here // 'offsetHeight' instead of 'offsetWidth' for properly excluding // all sorts of empty paragraph, e.g. <br />. var isInvisible = whitespace( node ) || node.is && !node.$.offsetHeight; return !! ( isReject ^ isInvisible ); }; }; CKEDITOR.dom.walker.nodeType = function( type, isReject ) { return function( node ) { return !! ( isReject ^ ( node.type == type ) ); }; }; CKEDITOR.dom.walker.bogus = function( type, isReject ) { function nonEmpty( node ) { return !isWhitespaces( node ) && !isBookmark( node ); } return function( node ) { var parent = node.getParent(), isBogus = !CKEDITOR.env.ie ? node.is && node.is( 'br' ) : node.getText && tailNbspRegex.test( node.getText() ); isBogus = isBogus && parent.isBlockBoundary() && !!parent.getLast( nonEmpty ); return !! ( isReject ^ isBogus ); }; }; var tailNbspRegex = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/, isWhitespaces = CKEDITOR.dom.walker.whitespaces(), isBookmark = CKEDITOR.dom.walker.bookmark(), toSkip = function( node ) { return isBookmark( node ) || isWhitespaces( node ) || node.type == CKEDITOR.NODE_ELEMENT && node.getName() in CKEDITOR.dtd.$inline && !( node.getName() in CKEDITOR.dtd.$empty ); }; // Check if there's a filler node at the end of an element, and return it. CKEDITOR.dom.element.prototype.getBogus = function() { // Bogus are not always at the end, e.g. <p><a>text<br /></a></p> (#7070). var tail = this; do { tail = tail.getPreviousSourceNode(); } while ( toSkip( tail ) ) if ( tail && ( !CKEDITOR.env.ie ? tail.is && tail.is( 'br' ) : tail.getText && tailNbspRegex.test( tail.getText() ) ) ) { return tail; } return false; }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.element} class, which * represents a DOM element. */ /** * Represents a DOM element. * @constructor * @augments CKEDITOR.dom.node * @param {Object|String} element A native DOM element or the element name for * new elements. * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain * the element in case of element creation. * @example * // Create a new &lt;span&gt; element. * var element = new CKEDITOR.dom.element( 'span' ); * @example * // Create an element based on a native DOM element. * var element = new CKEDITOR.dom.element( document.getElementById( 'myId' ) ); */ CKEDITOR.dom.element = function( element, ownerDocument ) { if ( typeof element == 'string' ) element = ( ownerDocument ? ownerDocument.$ : document ).createElement( element ); // Call the base constructor (we must not call CKEDITOR.dom.node). CKEDITOR.dom.domObject.call( this, element ); }; // PACKAGER_RENAME( CKEDITOR.dom.element ) /** * The the {@link CKEDITOR.dom.element} representing and element. If the * element is a native DOM element, it will be transformed into a valid * CKEDITOR.dom.element object. * @returns {CKEDITOR.dom.element} The transformed element. * @example * var element = new CKEDITOR.dom.element( 'span' ); * alert( element == <b>CKEDITOR.dom.element.get( element )</b> ); "true" * @example * var element = document.getElementById( 'myElement' ); * alert( <b>CKEDITOR.dom.element.get( element )</b>.getName() ); e.g. "p" */ CKEDITOR.dom.element.get = function( element ) { return element && ( element.$ ? element : new CKEDITOR.dom.element( element ) ); }; CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node(); /** * Creates an instance of the {@link CKEDITOR.dom.element} class based on the * HTML representation of an element. * @param {String} html The element HTML. It should define only one element in * the "root" level. The "root" element can have child nodes, but not * siblings. * @returns {CKEDITOR.dom.element} The element instance. * @example * var element = <b>CKEDITOR.dom.element.createFromHtml( '&lt;strong class="anyclass"&gt;My element&lt;/strong&gt;' )</b>; * alert( element.getName() ); // "strong" */ CKEDITOR.dom.element.createFromHtml = function( html, ownerDocument ) { var temp = new CKEDITOR.dom.element( 'div', ownerDocument ); temp.setHtml( html ); // When returning the node, remove it from its parent to detach it. return temp.getFirst().remove(); }; CKEDITOR.dom.element.setMarker = function( database, element, name, value ) { var id = element.getCustomData( 'list_marker_id' ) || ( element.setCustomData( 'list_marker_id', CKEDITOR.tools.getNextNumber() ).getCustomData( 'list_marker_id' ) ), markerNames = element.getCustomData( 'list_marker_names' ) || ( element.setCustomData( 'list_marker_names', {} ).getCustomData( 'list_marker_names' ) ); database[id] = element; markerNames[name] = 1; return element.setCustomData( name, value ); }; CKEDITOR.dom.element.clearAllMarkers = function( database ) { for ( var i in database ) CKEDITOR.dom.element.clearMarkers( database, database[i], 1 ); }; CKEDITOR.dom.element.clearMarkers = function( database, element, removeFromDatabase ) { var names = element.getCustomData( 'list_marker_names' ), id = element.getCustomData( 'list_marker_id' ); for ( var i in names ) element.removeCustomData( i ); element.removeCustomData( 'list_marker_names' ); if ( removeFromDatabase ) { element.removeCustomData( 'list_marker_id' ); delete database[id]; } }; CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, /** @lends CKEDITOR.dom.element.prototype */ { /** * The node type. This is a constant value set to * {@link CKEDITOR.NODE_ELEMENT}. * @type Number * @example */ type : CKEDITOR.NODE_ELEMENT, /** * Adds a CSS class to the element. It appends the class to the * already existing names. * @param {String} className The name of the class to be added. * @example * var element = new CKEDITOR.dom.element( 'div' ); * element.addClass( 'classA' ); // &lt;div class="classA"&gt; * element.addClass( 'classB' ); // &lt;div class="classA classB"&gt; * element.addClass( 'classA' ); // &lt;div class="classA classB"&gt; */ addClass : function( className ) { var c = this.$.className; if ( c ) { var regex = new RegExp( '(?:^|\\s)' + className + '(?:\\s|$)', '' ); if ( !regex.test( c ) ) c += ' ' + className; } this.$.className = c || className; }, /** * Removes a CSS class name from the elements classes. Other classes * remain untouched. * @param {String} className The name of the class to remove. * @example * var element = new CKEDITOR.dom.element( 'div' ); * element.addClass( 'classA' ); // &lt;div class="classA"&gt; * element.addClass( 'classB' ); // &lt;div class="classA classB"&gt; * element.removeClass( 'classA' ); // &lt;div class="classB"&gt; * element.removeClass( 'classB' ); // &lt;div&gt; */ removeClass : function( className ) { var c = this.getAttribute( 'class' ); if ( c ) { var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', 'i' ); if ( regex.test( c ) ) { c = c.replace( regex, '' ).replace( /^\s+/, '' ); if ( c ) this.setAttribute( 'class', c ); else this.removeAttribute( 'class' ); } } }, hasClass : function( className ) { var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', '' ); return regex.test( this.getAttribute('class') ); }, /** * Append a node as a child of this element. * @param {CKEDITOR.dom.node|String} node The node or element name to be * appended. * @param {Boolean} [toStart] Indicates that the element is to be * appended at the start. * @returns {CKEDITOR.dom.node} The appended node. * @example * var p = new CKEDITOR.dom.element( 'p' ); * * var strong = new CKEDITOR.dom.element( 'strong' ); * <b>p.append( strong );</b> * * var em = <b>p.append( 'em' );</b> * * // result: "&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;" */ append : function( node, toStart ) { if ( typeof node == 'string' ) node = this.getDocument().createElement( node ); if ( toStart ) this.$.insertBefore( node.$, this.$.firstChild ); else this.$.appendChild( node.$ ); return node; }, appendHtml : function( html ) { if ( !this.$.childNodes.length ) this.setHtml( html ); else { var temp = new CKEDITOR.dom.element( 'div', this.getDocument() ); temp.setHtml( html ); temp.moveChildren( this ); } }, /** * Append text to this element. * @param {String} text The text to be appended. * @returns {CKEDITOR.dom.node} The appended node. * @example * var p = new CKEDITOR.dom.element( 'p' ); * p.appendText( 'This is' ); * p.appendText( ' some text' ); * * // result: "&lt;p&gt;This is some text&lt;/p&gt;" */ appendText : function( text ) { if ( this.$.text != undefined ) this.$.text += text; else this.append( new CKEDITOR.dom.text( text ) ); }, appendBogus : function() { var lastChild = this.getLast() ; // Ignore empty/spaces text. while ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim( lastChild.getText() ) ) lastChild = lastChild.getPrevious(); if ( !lastChild || !lastChild.is || !lastChild.is( 'br' ) ) { var bogus = CKEDITOR.env.opera ? this.getDocument().createText('') : this.getDocument().createElement( 'br' ); CKEDITOR.env.gecko && bogus.setAttribute( 'type', '_moz' ); this.append( bogus ); } }, /** * Breaks one of the ancestor element in the element position, moving * this element between the broken parts. * @param {CKEDITOR.dom.element} parent The anscestor element to get broken. * @example * // Before breaking: * // &lt;b&gt;This &lt;i&gt;is some&lt;span /&gt; sample&lt;/i&gt; test text&lt;/b&gt; * // If "element" is &lt;span /&gt; and "parent" is &lt;i&gt;: * // &lt;b&gt;This &lt;i&gt;is some&lt;/i&gt;&lt;span /&gt;&lt;i&gt; sample&lt;/i&gt; test text&lt;/b&gt; * element.breakParent( parent ); * @example * // Before breaking: * // &lt;b&gt;This &lt;i&gt;is some&lt;span /&gt; sample&lt;/i&gt; test text&lt;/b&gt; * // If "element" is &lt;span /&gt; and "parent" is &lt;b&gt;: * // &lt;b&gt;This &lt;i&gt;is some&lt;/i&gt;&lt;/b&gt;&lt;span /&gt;&lt;b&gt;&lt;i&gt; sample&lt;/i&gt; test text&lt;/b&gt; * element.breakParent( parent ); */ breakParent : function( parent ) { var range = new CKEDITOR.dom.range( this.getDocument() ); // We'll be extracting part of this element, so let's use our // range to get the correct piece. range.setStartAfter( this ); range.setEndAfter( parent ); // Extract it. var docFrag = range.extractContents(); // Move the element outside the broken element. range.insertNode( this.remove() ); // Re-insert the extracted piece after the element. docFrag.insertAfterNode( this ); }, contains : CKEDITOR.env.ie || CKEDITOR.env.webkit ? function( node ) { var $ = this.$; return node.type != CKEDITOR.NODE_ELEMENT ? $.contains( node.getParent().$ ) : $ != node.$ && $.contains( node.$ ); } : function( node ) { return !!( this.$.compareDocumentPosition( node.$ ) & 16 ); }, /** * Moves the selection focus to this element. * @function * @param {Boolean} defer Whether to asynchronously defer the * execution by 100 ms. * @example * var element = CKEDITOR.document.getById( 'myTextarea' ); * <b>element.focus()</b>; */ focus : ( function() { function exec() { // IE throws error if the element is not visible. try { this.$.focus(); } catch (e) {} } return function( defer ) { if ( defer ) CKEDITOR.tools.setTimeout( exec, 100, this ); else exec.call( this ); }; })(), /** * Gets the inner HTML of this element. * @returns {String} The inner HTML of this element. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/div&gt;' ); * alert( <b>p.getHtml()</b> ); // "&lt;b&gt;Example&lt;/b&gt;" */ getHtml : function() { var retval = this.$.innerHTML; // Strip <?xml:namespace> tags in IE. (#3341). return CKEDITOR.env.ie ? retval.replace( /<\?[^>]*>/g, '' ) : retval; }, getOuterHtml : function() { if ( this.$.outerHTML ) { // IE includes the <?xml:namespace> tag in the outerHTML of // namespaced element. So, we must strip it here. (#3341) return this.$.outerHTML.replace( /<\?[^>]*>/, '' ); } var tmpDiv = this.$.ownerDocument.createElement( 'div' ); tmpDiv.appendChild( this.$.cloneNode( true ) ); return tmpDiv.innerHTML; }, /** * Sets the inner HTML of this element. * @param {String} html The HTML to be set for this element. * @returns {String} The inserted HTML. * @example * var p = new CKEDITOR.dom.element( 'p' ); * <b>p.setHtml( '&lt;b&gt;Inner&lt;/b&gt; HTML' );</b> * * // result: "&lt;p&gt;&lt;b&gt;Inner&lt;/b&gt; HTML&lt;/p&gt;" */ setHtml : function( html ) { return ( this.$.innerHTML = html ); }, /** * Sets the element contents as plain text. * @param {String} text The text to be set. * @returns {String} The inserted text. * @example * var element = new CKEDITOR.dom.element( 'div' ); * element.setText( 'A > B & C < D' ); * alert( element.innerHTML ); // "A &amp;gt; B &amp;amp; C &amp;lt; D" */ setText : function( text ) { CKEDITOR.dom.element.prototype.setText = ( this.$.innerText != undefined ) ? function ( text ) { return this.$.innerText = text; } : function ( text ) { return this.$.textContent = text; }; return this.setText( text ); }, /** * Gets the value of an element attribute. * @function * @param {String} name The attribute name. * @returns {String} The attribute value or null if not defined. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;input type="text" /&gt;' ); * alert( <b>element.getAttribute( 'type' )</b> ); // "text" */ getAttribute : (function() { var standard = function( name ) { return this.$.getAttribute( name, 2 ); }; if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) { return function( name ) { switch ( name ) { case 'class': name = 'className'; break; case 'http-equiv': name = 'httpEquiv'; break; case 'name': return this.$.name; case 'tabindex': var tabIndex = standard.call( this, name ); // IE returns tabIndex=0 by default for all // elements. For those elements, // getAtrribute( 'tabindex', 2 ) returns 32768 // instead. So, we must make this check to give a // uniform result among all browsers. if ( tabIndex !== 0 && this.$.tabIndex === 0 ) tabIndex = null; return tabIndex; break; case 'checked': { var attr = this.$.attributes.getNamedItem( name ), attrValue = attr.specified ? attr.nodeValue // For value given by parser. : this.$.checked; // For value created via DOM interface. return attrValue ? 'checked' : null; } case 'hspace': case 'value': return this.$[ name ]; case 'style': // IE does not return inline styles via getAttribute(). See #2947. return this.$.style.cssText; } return standard.call( this, name ); }; } else return standard; })(), getChildren : function() { return new CKEDITOR.dom.nodeList( this.$.childNodes ); }, /** * Gets the current computed value of one of the element CSS style * properties. * @function * @param {String} propertyName The style property name. * @returns {String} The property value. * @example * var element = new CKEDITOR.dom.element( 'span' ); * alert( <b>element.getComputedStyle( 'display' )</b> ); // "inline" */ getComputedStyle : CKEDITOR.env.ie ? function( propertyName ) { return this.$.currentStyle[ CKEDITOR.tools.cssStyleToDomStyle( propertyName ) ]; } : function( propertyName ) { return this.getWindow().$.getComputedStyle( this.$, '' ).getPropertyValue( propertyName ); }, /** * Gets the DTD entries for this element. * @returns {Object} An object containing the list of elements accepted * by this element. */ getDtd : function() { var dtd = CKEDITOR.dtd[ this.getName() ]; this.getDtd = function() { return dtd; }; return dtd; }, getElementsByTag : CKEDITOR.dom.document.prototype.getElementsByTag, /** * Gets the computed tabindex for this element. * @function * @returns {Number} The tabindex value. * @example * var element = CKEDITOR.document.getById( 'myDiv' ); * alert( <b>element.getTabIndex()</b> ); // e.g. "-1" */ getTabIndex : CKEDITOR.env.ie ? function() { var tabIndex = this.$.tabIndex; // IE returns tabIndex=0 by default for all elements. In // those cases we must check that the element really has // the tabindex attribute set to zero, or it is one of // those element that should have zero by default. if ( tabIndex === 0 && !CKEDITOR.dtd.$tabIndex[ this.getName() ] && parseInt( this.getAttribute( 'tabindex' ), 10 ) !== 0 ) tabIndex = -1; return tabIndex; } : CKEDITOR.env.webkit ? function() { var tabIndex = this.$.tabIndex; // Safari returns "undefined" for elements that should not // have tabindex (like a div). So, we must try to get it // from the attribute. // https://bugs.webkit.org/show_bug.cgi?id=20596 if ( tabIndex == undefined ) { tabIndex = parseInt( this.getAttribute( 'tabindex' ), 10 ); // If the element don't have the tabindex attribute, // then we should return -1. if ( isNaN( tabIndex ) ) tabIndex = -1; } return tabIndex; } : function() { return this.$.tabIndex; }, /** * Gets the text value of this element. * * Only in IE (which uses innerText), &lt;br&gt; will cause linebreaks, * and sucessive whitespaces (including line breaks) will be reduced to * a single space. This behavior is ok for us, for now. It may change * in the future. * @returns {String} The text value. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;Sample &lt;i&gt;text&lt;/i&gt;.&lt;/div&gt;' ); * alert( <b>element.getText()</b> ); // "Sample text." */ getText : function() { return this.$.textContent || this.$.innerText || ''; }, /** * Gets the window object that contains this element. * @returns {CKEDITOR.dom.window} The window object. * @example */ getWindow : function() { return this.getDocument().getWindow(); }, /** * Gets the value of the "id" attribute of this element. * @returns {String} The element id, or null if not available. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;p id="myId"&gt;&lt;/p&gt;' ); * alert( <b>element.getId()</b> ); // "myId" */ getId : function() { return this.$.id || null; }, /** * Gets the value of the "name" attribute of this element. * @returns {String} The element name, or null if not available. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;input name="myName"&gt;&lt;/input&gt;' ); * alert( <b>element.getNameAtt()</b> ); // "myName" */ getNameAtt : function() { return this.$.name || null; }, /** * Gets the element name (tag name). The returned name is guaranteed to * be always full lowercased. * @returns {String} The element name. * @example * var element = new CKEDITOR.dom.element( 'span' ); * alert( <b>element.getName()</b> ); // "span" */ getName : function() { // Cache the lowercased name inside a closure. var nodeName = this.$.nodeName.toLowerCase(); if ( CKEDITOR.env.ie && ! ( document.documentMode > 8 ) ) { var scopeName = this.$.scopeName; if ( scopeName != 'HTML' ) nodeName = scopeName.toLowerCase() + ':' + nodeName; } return ( this.getName = function() { return nodeName; })(); }, /** * Gets the value set to this element. This value is usually available * for form field elements. * @returns {String} The element value. */ getValue : function() { return this.$.value; }, /** * Gets the first child node of this element. * @param {Function} evaluator Filtering the result node. * @returns {CKEDITOR.dom.node} The first child node or null if not * available. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/div&gt;' ); * var first = <b>element.getFirst()</b>; * alert( first.getName() ); // "b" */ getFirst : function( evaluator ) { var first = this.$.firstChild, retval = first && new CKEDITOR.dom.node( first ); if ( retval && evaluator && !evaluator( retval ) ) retval = retval.getNext( evaluator ); return retval; }, /** * @param {Function} evaluator Filtering the result node. */ getLast : function( evaluator ) { var last = this.$.lastChild, retval = last && new CKEDITOR.dom.node( last ); if ( retval && evaluator && !evaluator( retval ) ) retval = retval.getPrevious( evaluator ); return retval; }, getStyle : function( name ) { return this.$.style[ CKEDITOR.tools.cssStyleToDomStyle( name ) ]; }, /** * Checks if the element name matches one or more names. * @param {String} name[,name[,...]] One or more names to be checked. * @returns {Boolean} true if the element name matches any of the names. * @example * var element = new CKEDITOR.element( 'span' ); * alert( <b>element.is( 'span' )</b> ); "true" * alert( <b>element.is( 'p', 'span' )</b> ); "true" * alert( <b>element.is( 'p' )</b> ); "false" * alert( <b>element.is( 'p', 'div' )</b> ); "false" */ is : function() { var name = this.getName(); for ( var i = 0 ; i < arguments.length ; i++ ) { if ( arguments[ i ] == name ) return true; } return false; }, /** * Decide whether one element is able to receive cursor. * @param {Boolean} [textCursor=true] Only consider element that could receive text child. */ isEditable : function( textCursor ) { var name = this.getName(); if ( this.isReadOnly() || this.getComputedStyle( 'display' ) == 'none' || this.getComputedStyle( 'visibility' ) == 'hidden' || this.is( 'a' ) && this.data( 'cke-saved-name' ) && !this.getChildCount() || CKEDITOR.dtd.$nonEditable[ name ] ) { return false; } if ( textCursor !== false ) { // Get the element DTD (defaults to span for unknown elements). var dtd = CKEDITOR.dtd[ name ] || CKEDITOR.dtd.span; // In the DTD # == text node. return ( dtd && dtd[ '#'] ); } return true; }, isIdentical : function( otherElement ) { if ( this.getName() != otherElement.getName() ) return false; var thisAttribs = this.$.attributes, otherAttribs = otherElement.$.attributes; var thisLength = thisAttribs.length, otherLength = otherAttribs.length; for ( var i = 0 ; i < thisLength ; i++ ) { var attribute = thisAttribs[ i ]; if ( attribute.nodeName == '_moz_dirty' ) continue; if ( ( !CKEDITOR.env.ie || ( attribute.specified && attribute.nodeName != 'data-cke-expando' ) ) && attribute.nodeValue != otherElement.getAttribute( attribute.nodeName ) ) return false; } // For IE, we have to for both elements, because it's difficult to // know how the atttibutes collection is organized in its DOM. if ( CKEDITOR.env.ie ) { for ( i = 0 ; i < otherLength ; i++ ) { attribute = otherAttribs[ i ]; if ( attribute.specified && attribute.nodeName != 'data-cke-expando' && attribute.nodeValue != this.getAttribute( attribute.nodeName ) ) return false; } } return true; }, /** * Checks if this element is visible. May not work if the element is * child of an element with visibility set to "hidden", but works well * on the great majority of cases. * @return {Boolean} True if the element is visible. */ isVisible : function() { var isVisible = ( this.$.offsetHeight || this.$.offsetWidth ) && this.getComputedStyle( 'visibility' ) != 'hidden', elementWindow, elementWindowFrame; // Webkit and Opera report non-zero offsetHeight despite that // element is inside an invisible iframe. (#4542) if ( isVisible && ( CKEDITOR.env.webkit || CKEDITOR.env.opera ) ) { elementWindow = this.getWindow(); if ( !elementWindow.equals( CKEDITOR.document.getWindow() ) && ( elementWindowFrame = elementWindow.$.frameElement ) ) { isVisible = new CKEDITOR.dom.element( elementWindowFrame ).isVisible(); } } return !!isVisible; }, /** * Whether it's an empty inline elements which has no visual impact when removed. */ isEmptyInlineRemoveable : function() { if ( !CKEDITOR.dtd.$removeEmpty[ this.getName() ] ) return false; var children = this.getChildren(); for ( var i = 0, count = children.count(); i < count; i++ ) { var child = children.getItem( i ); if ( child.type == CKEDITOR.NODE_ELEMENT && child.data( 'cke-bookmark' ) ) continue; if ( child.type == CKEDITOR.NODE_ELEMENT && !child.isEmptyInlineRemoveable() || child.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim( child.getText() ) ) { return false; } } return true; }, /** * Checks if the element has any defined attributes. * @function * @returns {Boolean} True if the element has attributes. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div title="Test"&gt;Example&lt;/div&gt;' ); * alert( <b>element.hasAttributes()</b> ); // "true" * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;div&gt;Example&lt;/div&gt;' ); * alert( <b>element.hasAttributes()</b> ); // "false" */ hasAttributes : CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ? function() { var attributes = this.$.attributes; for ( var i = 0 ; i < attributes.length ; i++ ) { var attribute = attributes[i]; switch ( attribute.nodeName ) { case 'class' : // IE has a strange bug. If calling removeAttribute('className'), // the attributes collection will still contain the "class" // attribute, which will be marked as "specified", even if the // outerHTML of the element is not displaying the class attribute. // Note : I was not able to reproduce it outside the editor, // but I've faced it while working on the TC of #1391. if ( this.getAttribute( 'class' ) ) return true; // Attributes to be ignored. case 'data-cke-expando' : continue; /*jsl:fallthru*/ default : if ( attribute.specified ) return true; } } return false; } : function() { var attrs = this.$.attributes, attrsNum = attrs.length; // The _moz_dirty attribute might get into the element after pasting (#5455) var execludeAttrs = { 'data-cke-expando' : 1, _moz_dirty : 1 }; return attrsNum > 0 && ( attrsNum > 2 || !execludeAttrs[ attrs[0].nodeName ] || ( attrsNum == 2 && !execludeAttrs[ attrs[1].nodeName ] ) ); }, /** * Checks if the specified attribute is defined for this element. * @returns {Boolean} True if the specified attribute is defined. * @param {String} name The attribute name. * @example */ hasAttribute : (function() { function standard( name ) { var $attr = this.$.attributes.getNamedItem( name ); return !!( $attr && $attr.specified ); } return ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) ? function( name ) { // On IE < 8 the name attribute cannot be retrieved // right after the element creation and setting the // name with setAttribute. if ( name == 'name' ) return !!this.$.name; return standard.call( this, name ); } : standard; })(), /** * Hides this element (display:none). * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.hide()</b>; */ hide : function() { this.setStyle( 'display', 'none' ); }, moveChildren : function( target, toStart ) { var $ = this.$; target = target.$; if ( $ == target ) return; var child; if ( toStart ) { while ( ( child = $.lastChild ) ) target.insertBefore( $.removeChild( child ), target.firstChild ); } else { while ( ( child = $.firstChild ) ) target.appendChild( $.removeChild( child ) ); } }, /** * Merges sibling elements that are identical to this one.<br> * <br> * Identical child elements are also merged. For example:<br> * &lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt; =&gt; &lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt; * @function * @param {Boolean} [inlineOnly] Allow only inline elements to be merged. Defaults to "true". */ mergeSiblings : ( function() { function mergeElements( element, sibling, isNext ) { if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT ) { // Jumping over bookmark nodes and empty inline elements, e.g. <b><i></i></b>, // queuing them to be moved later. (#5567) var pendingNodes = []; while ( sibling.data( 'cke-bookmark' ) || sibling.isEmptyInlineRemoveable() ) { pendingNodes.push( sibling ); sibling = isNext ? sibling.getNext() : sibling.getPrevious(); if ( !sibling || sibling.type != CKEDITOR.NODE_ELEMENT ) return; } if ( element.isIdentical( sibling ) ) { // Save the last child to be checked too, to merge things like // <b><i></i></b><b><i></i></b> => <b><i></i></b> var innerSibling = isNext ? element.getLast() : element.getFirst(); // Move pending nodes first into the target element. while( pendingNodes.length ) pendingNodes.shift().move( element, !isNext ); sibling.moveChildren( element, !isNext ); sibling.remove(); // Now check the last inner child (see two comments above). if ( innerSibling && innerSibling.type == CKEDITOR.NODE_ELEMENT ) innerSibling.mergeSiblings(); } } } return function( inlineOnly ) { if ( ! ( inlineOnly === false || CKEDITOR.dtd.$removeEmpty[ this.getName() ] || this.is( 'a' ) ) ) // Merge empty links and anchors also. (#5567) { return; } mergeElements( this, this.getNext(), true ); mergeElements( this, this.getPrevious() ); }; } )(), /** * Shows this element (display it). * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.show()</b>; */ show : function() { this.setStyles( { display : '', visibility : '' }); }, /** * Sets the value of an element attribute. * @param {String} name The name of the attribute. * @param {String} value The value to be set to the attribute. * @function * @returns {CKEDITOR.dom.element} This element instance. * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.setAttribute( 'class', 'myClass' )</b>; * <b>element.setAttribute( 'title', 'This is an example' )</b>; */ setAttribute : (function() { var standard = function( name, value ) { this.$.setAttribute( name, value ); return this; }; if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) { return function( name, value ) { if ( name == 'class' ) this.$.className = value; else if ( name == 'style' ) this.$.style.cssText = value; else if ( name == 'tabindex' ) // Case sensitive. this.$.tabIndex = value; else if ( name == 'checked' ) this.$.checked = value; else standard.apply( this, arguments ); return this; }; } else if ( CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ) { return function( name, value ) { // IE8 throws error when setting src attribute to non-ssl value. (#7847) if ( name == 'src' && value.match( /^http:\/\// ) ) try { standard.apply( this, arguments ); } catch( e ){} else standard.apply( this, arguments ); return this; }; } else return standard; })(), /** * Sets the value of several element attributes. * @param {Object} attributesPairs An object containing the names and * values of the attributes. * @returns {CKEDITOR.dom.element} This element instance. * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.setAttributes({ * 'class' : 'myClass', * 'title' : 'This is an example' })</b>; */ setAttributes : function( attributesPairs ) { for ( var name in attributesPairs ) this.setAttribute( name, attributesPairs[ name ] ); return this; }, /** * Sets the element value. This function is usually used with form * field element. * @param {String} value The element value. * @returns {CKEDITOR.dom.element} This element instance. */ setValue : function( value ) { this.$.value = value; return this; }, /** * Removes an attribute from the element. * @param {String} name The attribute name. * @function * @example * var element = CKEDITOR.dom.element.createFromHtml( '<div class="classA"></div>' ); * element.removeAttribute( 'class' ); */ removeAttribute : (function() { var standard = function( name ) { this.$.removeAttribute( name ); }; if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) { return function( name ) { if ( name == 'class' ) name = 'className'; else if ( name == 'tabindex' ) name = 'tabIndex'; standard.call( this, name ); }; } else return standard; })(), removeAttributes : function ( attributes ) { if ( CKEDITOR.tools.isArray( attributes ) ) { for ( var i = 0 ; i < attributes.length ; i++ ) this.removeAttribute( attributes[ i ] ); } else { for ( var attr in attributes ) attributes.hasOwnProperty( attr ) && this.removeAttribute( attr ); } }, /** * Removes a style from the element. * @param {String} name The style name. * @function * @example * var element = CKEDITOR.dom.element.createFromHtml( '<div style="display:none"></div>' ); * element.removeStyle( 'display' ); */ removeStyle : function( name ) { this.setStyle( name, '' ); if ( this.$.style.removeAttribute ) this.$.style.removeAttribute( CKEDITOR.tools.cssStyleToDomStyle( name ) ); if ( !this.$.style.cssText ) this.removeAttribute( 'style' ); }, /** * Sets the value of an element style. * @param {String} name The name of the style. The CSS naming notation * must be used (e.g. "background-color"). * @param {String} value The value to be set to the style. * @returns {CKEDITOR.dom.element} This element instance. * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.setStyle( 'background-color', '#ff0000' )</b>; * <b>element.setStyle( 'margin-top', '10px' )</b>; * <b>element.setStyle( 'float', 'right' )</b>; */ setStyle : function( name, value ) { this.$.style[ CKEDITOR.tools.cssStyleToDomStyle( name ) ] = value; return this; }, /** * Sets the value of several element styles. * @param {Object} stylesPairs An object containing the names and * values of the styles. * @returns {CKEDITOR.dom.element} This element instance. * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.setStyles({ * 'position' : 'absolute', * 'float' : 'right' })</b>; */ setStyles : function( stylesPairs ) { for ( var name in stylesPairs ) this.setStyle( name, stylesPairs[ name ] ); return this; }, /** * Sets the opacity of an element. * @param {Number} opacity A number within the range [0.0, 1.0]. * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * <b>element.setOpacity( 0.75 )</b>; */ setOpacity : function( opacity ) { if ( CKEDITOR.env.ie ) { opacity = Math.round( opacity * 100 ); this.setStyle( 'filter', opacity >= 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + opacity + ')' ); } else this.setStyle( 'opacity', opacity ); }, /** * Makes the element and its children unselectable. * @function * @example * var element = CKEDITOR.dom.element.getById( 'myElement' ); * element.unselectable(); */ unselectable : CKEDITOR.env.gecko ? function() { this.$.style.MozUserSelect = 'none'; this.on( 'dragstart', function( evt ) { evt.data.preventDefault(); } ); } : CKEDITOR.env.webkit ? function() { this.$.style.KhtmlUserSelect = 'none'; this.on( 'dragstart', function( evt ) { evt.data.preventDefault(); } ); } : function() { if ( CKEDITOR.env.ie || CKEDITOR.env.opera ) { var element = this.$, elements = element.getElementsByTagName("*"), e, i = 0; element.unselectable = 'on'; while ( ( e = elements[ i++ ] ) ) { switch ( e.tagName.toLowerCase() ) { case 'iframe' : case 'textarea' : case 'input' : case 'select' : /* Ignore the above tags */ break; default : e.unselectable = 'on'; } } } }, getPositionedAncestor : function() { var current = this; while ( current.getName() != 'html' ) { if ( current.getComputedStyle( 'position' ) != 'static' ) return current; current = current.getParent(); } return null; }, getDocumentPosition : function( refDocument ) { var x = 0, y = 0, doc = this.getDocument(), body = doc.getBody(), quirks = doc.$.compatMode == 'BackCompat'; if ( document.documentElement[ "getBoundingClientRect" ] ) { var box = this.$.getBoundingClientRect(), $doc = doc.$, $docElem = $doc.documentElement; var clientTop = $docElem.clientTop || body.$.clientTop || 0, clientLeft = $docElem.clientLeft || body.$.clientLeft || 0, needAdjustScrollAndBorders = true; /* * #3804: getBoundingClientRect() works differently on IE and non-IE * browsers, regarding scroll positions. * * On IE, the top position of the <html> element is always 0, no matter * how much you scrolled down. * * On other browsers, the top position of the <html> element is negative * scrollTop. */ if ( CKEDITOR.env.ie ) { var inDocElem = doc.getDocumentElement().contains( this ), inBody = doc.getBody().contains( this ); needAdjustScrollAndBorders = ( quirks && inBody ) || ( !quirks && inDocElem ); } if ( needAdjustScrollAndBorders ) { x = box.left + ( !quirks && $docElem.scrollLeft || body.$.scrollLeft ); x -= clientLeft; y = box.top + ( !quirks && $docElem.scrollTop || body.$.scrollTop ); y -= clientTop; } } else { var current = this, previous = null, offsetParent; while ( current && !( current.getName() == 'body' || current.getName() == 'html' ) ) { x += current.$.offsetLeft - current.$.scrollLeft; y += current.$.offsetTop - current.$.scrollTop; // Opera includes clientTop|Left into offsetTop|Left. if ( !current.equals( this ) ) { x += ( current.$.clientLeft || 0 ); y += ( current.$.clientTop || 0 ); } var scrollElement = previous; while ( scrollElement && !scrollElement.equals( current ) ) { x -= scrollElement.$.scrollLeft; y -= scrollElement.$.scrollTop; scrollElement = scrollElement.getParent(); } previous = current; current = ( offsetParent = current.$.offsetParent ) ? new CKEDITOR.dom.element( offsetParent ) : null; } } if ( refDocument ) { var currentWindow = this.getWindow(), refWindow = refDocument.getWindow(); if ( !currentWindow.equals( refWindow ) && currentWindow.$.frameElement ) { var iframePosition = ( new CKEDITOR.dom.element( currentWindow.$.frameElement ) ).getDocumentPosition( refDocument ); x += iframePosition.x; y += iframePosition.y; } } if ( !document.documentElement[ "getBoundingClientRect" ] ) { // In Firefox, we'll endup one pixel before the element positions, // so we must add it here. if ( CKEDITOR.env.gecko && !quirks ) { x += this.$.clientLeft ? 1 : 0; y += this.$.clientTop ? 1 : 0; } } return { x : x, y : y }; }, /** * Make any page element visible inside the browser viewport. * @param {Boolean} [alignToTop] */ scrollIntoView : function( alignToTop ) { var parent = this.getParent(); if ( !parent ) return; // Scroll the element into parent container from the inner out. do { // Check ancestors that overflows. var overflowed = parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth || parent.$.clientHeight && parent.$.clientHeight < parent.$.scrollHeight; if ( overflowed ) this.scrollIntoParent( parent, alignToTop, 1 ); // Walk across the frame. if ( parent.is( 'html' ) ) { var win = parent.getWindow(); // Avoid security error. try { var iframe = win.$.frameElement; iframe && ( parent = new CKEDITOR.dom.element( iframe ) ); } catch(er){} } } while ( ( parent = parent.getParent() ) ); }, /** * Make any page element visible inside one of the ancestors by scrolling the parent. * @param {CKEDITOR.dom.element|CKEDITOR.dom.window} parent The container to scroll into. * @param {Boolean} [alignToTop] Align the element's top side with the container's * when <code>true</code> is specified; align the bottom with viewport bottom when * <code>false</code> is specified. Otherwise scroll on either side with the minimum * amount to show the element. * @param {Boolean} [hscroll] Whether horizontal overflow should be considered. */ scrollIntoParent : function( parent, alignToTop, hscroll ) { !parent && ( parent = this.getWindow() ); var doc = parent.getDocument(); var isQuirks = doc.$.compatMode == 'BackCompat'; // On window <html> is scrolled while quirks scrolls <body>. if ( parent instanceof CKEDITOR.dom.window ) parent = isQuirks ? doc.getBody() : doc.getDocumentElement(); // Scroll the parent by the specified amount. function scrollBy( x, y ) { // Webkit doesn't support "scrollTop/scrollLeft" // on documentElement/body element. if ( /body|html/.test( parent.getName() ) ) parent.getWindow().$.scrollBy( x, y ); else { parent.$[ 'scrollLeft' ] += x; parent.$[ 'scrollTop' ] += y; } } // Figure out the element position relative to the specified window. function screenPos( element, refWin ) { var pos = { x: 0, y: 0 }; if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) { var box = element.$.getBoundingClientRect(); pos.x = box.left, pos.y = box.top; } var win = element.getWindow(); if ( !win.equals( refWin ) ) { var outerPos = screenPos( CKEDITOR.dom.element.get( win.$.frameElement ), refWin ); pos.x += outerPos.x, pos.y += outerPos.y; } return pos; } // calculated margin size. function margin( element, side ) { return parseInt( element.getComputedStyle( 'margin-' + side ) || 0, 10 ) || 0; } var win = parent.getWindow(); var thisPos = screenPos( this, win ), parentPos = screenPos( parent, win ), eh = this.$.offsetHeight, ew = this.$.offsetWidth, ch = parent.$.clientHeight, cw = parent.$.clientWidth, lt, br; // Left-top margins. lt = { x : thisPos.x - margin( this, 'left' ) - parentPos.x || 0, y : thisPos.y - margin( this, 'top' ) - parentPos.y|| 0 }; // Bottom-right margins. br = { x : thisPos.x + ew + margin( this, 'right' ) - ( ( parentPos.x ) + cw ) || 0, y : thisPos.y + eh + margin( this, 'bottom' ) - ( ( parentPos.y ) + ch ) || 0 }; // 1. Do the specified alignment as much as possible; // 2. Otherwise be smart to scroll only the minimum amount; // 3. Never cut at the top; // 4. DO NOT scroll when already visible. if ( lt.y < 0 || br.y > 0 ) { scrollBy( 0, alignToTop === true ? lt.y : alignToTop === false ? br.y : lt.y < 0 ? lt.y : br.y ); } if ( hscroll && ( lt.x < 0 || br.x > 0 ) ) scrollBy( lt.x < 0 ? lt.x : br.x, 0 ); }, setState : function( state ) { switch ( state ) { case CKEDITOR.TRISTATE_ON : this.addClass( 'cke_on' ); this.removeClass( 'cke_off' ); this.removeClass( 'cke_disabled' ); break; case CKEDITOR.TRISTATE_DISABLED : this.addClass( 'cke_disabled' ); this.removeClass( 'cke_off' ); this.removeClass( 'cke_on' ); break; default : this.addClass( 'cke_off' ); this.removeClass( 'cke_on' ); this.removeClass( 'cke_disabled' ); break; } }, /** * Returns the inner document of this IFRAME element. * @returns {CKEDITOR.dom.document} The inner document. */ getFrameDocument : function() { var $ = this.$; try { // In IE, with custom document.domain, it may happen that // the iframe is not yet available, resulting in "Access // Denied" for the following property access. $.contentWindow.document; } catch ( e ) { // Trick to solve this issue, forcing the iframe to get ready // by simply setting its "src" property. $.src = $.src; // In IE6 though, the above is not enough, so we must pause the // execution for a while, giving it time to think. if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) { window.showModalDialog( 'javascript:document.write("' + '<script>' + 'window.setTimeout(' + 'function(){window.close();}' + ',50);' + '</script>")' ); } } return $ && new CKEDITOR.dom.document( $.contentWindow.document ); }, /** * Copy all the attributes from one node to the other, kinda like a clone * skipAttributes is an object with the attributes that must NOT be copied. * @param {CKEDITOR.dom.element} dest The destination element. * @param {Object} skipAttributes A dictionary of attributes to skip. * @example */ copyAttributes : function( dest, skipAttributes ) { var attributes = this.$.attributes; skipAttributes = skipAttributes || {}; for ( var n = 0 ; n < attributes.length ; n++ ) { var attribute = attributes[n]; // Lowercase attribute name hard rule is broken for // some attribute on IE, e.g. CHECKED. var attrName = attribute.nodeName.toLowerCase(), attrValue; // We can set the type only once, so do it with the proper value, not copying it. if ( attrName in skipAttributes ) continue; if ( attrName == 'checked' && ( attrValue = this.getAttribute( attrName ) ) ) dest.setAttribute( attrName, attrValue ); // IE BUG: value attribute is never specified even if it exists. else if ( attribute.specified || ( CKEDITOR.env.ie && attribute.nodeValue && attrName == 'value' ) ) { attrValue = this.getAttribute( attrName ); if ( attrValue === null ) attrValue = attribute.nodeValue; dest.setAttribute( attrName, attrValue ); } } // The style: if ( this.$.style.cssText !== '' ) dest.$.style.cssText = this.$.style.cssText; }, /** * Changes the tag name of the current element. * @param {String} newTag The new tag for the element. */ renameNode : function( newTag ) { // If it's already correct exit here. if ( this.getName() == newTag ) return; var doc = this.getDocument(); // Create the new node. var newNode = new CKEDITOR.dom.element( newTag, doc ); // Copy all attributes. this.copyAttributes( newNode ); // Move children to the new node. this.moveChildren( newNode ); // Replace the node. this.getParent() && this.$.parentNode.replaceChild( newNode.$, this.$ ); newNode.$[ 'data-cke-expando' ] = this.$[ 'data-cke-expando' ]; this.$ = newNode.$; }, /** * Gets a DOM tree descendant under the current node. * @param {Array|Number} indices The child index or array of child indices under the node. * @returns {CKEDITOR.dom.node} The specified DOM child under the current node. Null if child does not exist. * @example * var strong = p.getChild(0); */ getChild : function( indices ) { var rawNode = this.$; if ( !indices.slice ) rawNode = rawNode.childNodes[ indices ]; else { while ( indices.length > 0 && rawNode ) rawNode = rawNode.childNodes[ indices.shift() ]; } return rawNode ? new CKEDITOR.dom.node( rawNode ) : null; }, getChildCount : function() { return this.$.childNodes.length; }, disableContextMenu : function() { this.on( 'contextmenu', function( event ) { // Cancel the browser context menu. if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) ) event.data.preventDefault(); } ); }, /** * Gets element's direction. Supports both CSS 'direction' prop and 'dir' attr. */ getDirection : function( useComputed ) { return useComputed ? this.getComputedStyle( 'direction' ) // Webkit: offline element returns empty direction (#8053). || this.getDirection() || this.getDocument().$.dir || this.getDocument().getBody().getDirection( 1 ) : this.getStyle( 'direction' ) || this.getAttribute( 'dir' ); }, /** * Gets, sets and removes custom data to be stored as HTML5 data-* attributes. * @param {String} name The name of the attribute, excluding the 'data-' part. * @param {String} [value] The value to set. If set to false, the attribute will be removed. * @example * element.data( 'extra-info', 'test' ); // appended the attribute data-extra-info="test" to the element * alert( element.data( 'extra-info' ) ); // "test" * element.data( 'extra-info', false ); // remove the data-extra-info attribute from the element */ data : function ( name, value ) { name = 'data-' + name; if ( value === undefined ) return this.getAttribute( name ); else if ( value === false ) this.removeAttribute( name ); else this.setAttribute( name, value ); return null; } }); ( function() { var sides = { width : [ "border-left-width", "border-right-width","padding-left", "padding-right" ], height : [ "border-top-width", "border-bottom-width", "padding-top", "padding-bottom" ] }; function marginAndPaddingSize( type ) { var adjustment = 0; for ( var i = 0, len = sides[ type ].length; i < len; i++ ) adjustment += parseInt( this.getComputedStyle( sides [ type ][ i ] ) || 0, 10 ) || 0; return adjustment; } /** * Sets the element size considering the box model. * @name CKEDITOR.dom.element.prototype.setSize * @function * @param {String} type The dimension to set. It accepts "width" and "height". * @param {Number} size The length unit in px. * @param {Boolean} isBorderBox Apply the size based on the border box model. */ CKEDITOR.dom.element.prototype.setSize = function( type, size, isBorderBox ) { if ( typeof size == 'number' ) { if ( isBorderBox && !( CKEDITOR.env.ie && CKEDITOR.env.quirks ) ) size -= marginAndPaddingSize.call( this, type ); this.setStyle( type, size + 'px' ); } }; /** * Gets the element size, possibly considering the box model. * @name CKEDITOR.dom.element.prototype.getSize * @function * @param {String} type The dimension to get. It accepts "width" and "height". * @param {Boolean} isBorderBox Get the size based on the border box model. */ CKEDITOR.dom.element.prototype.getSize = function( type, isBorderBox ) { var size = Math.max( this.$[ 'offset' + CKEDITOR.tools.capitalize( type ) ], this.$[ 'client' + CKEDITOR.tools.capitalize( type ) ] ) || 0; if ( isBorderBox ) size -= marginAndPaddingSize.call( this, type ); return size; }; })();
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { /** * Represents a list os CKEDITOR.dom.range objects, which can be easily * iterated sequentially. * @constructor * @param {CKEDITOR.dom.range|Array} [ranges] The ranges contained on this list. * Note that, if an array of ranges is specified, the range sequence * should match its DOM order. This class will not help to sort them. */ CKEDITOR.dom.rangeList = function( ranges ) { if ( ranges instanceof CKEDITOR.dom.rangeList ) return ranges; if ( !ranges ) ranges = []; else if ( ranges instanceof CKEDITOR.dom.range ) ranges = [ ranges ]; return CKEDITOR.tools.extend( ranges, mixins ); }; var mixins = /** @lends CKEDITOR.dom.rangeList.prototype */ { /** * Creates an instance of the rangeList iterator, it should be used * only when the ranges processing could be DOM intrusive, which * means it may pollute and break other ranges in this list. * Otherwise, it's enough to just iterate over this array in a for loop. * @returns {CKEDITOR.dom.rangeListIterator} */ createIterator : function() { var rangeList = this, bookmark = CKEDITOR.dom.walker.bookmark(), guard = function( node ) { return ! ( node.is && node.is( 'tr' ) ); }, bookmarks = [], current; /** * @lends CKEDITOR.dom.rangeListIterator.prototype */ return { /** * Retrieves the next range in the list. * @param {Boolean} mergeConsequent Whether join two adjacent ranges into single, e.g. consequent table cells. */ getNextRange : function( mergeConsequent ) { current = current == undefined ? 0 : current + 1; var range = rangeList[ current ]; // Multiple ranges might be mangled by each other. if ( range && rangeList.length > 1 ) { // Bookmarking all other ranges on the first iteration, // the range correctness after it doesn't matter since we'll // restore them before the next iteration. if ( !current ) { // Make sure bookmark correctness by reverse processing. for ( var i = rangeList.length - 1; i >= 0; i-- ) bookmarks.unshift( rangeList[ i ].createBookmark( true ) ); } if ( mergeConsequent ) { // Figure out how many ranges should be merged. var mergeCount = 0; while ( rangeList[ current + mergeCount + 1 ] ) { var doc = range.document, found = 0, left = doc.getById( bookmarks[ mergeCount ].endNode ), right = doc.getById( bookmarks[ mergeCount + 1 ].startNode ), next; // Check subsequent range. while ( 1 ) { next = left.getNextSourceNode( false ); if ( !right.equals( next ) ) { // This could be yet another bookmark or // walking across block boundaries. if ( bookmark( next ) || ( next.type == CKEDITOR.NODE_ELEMENT && next.isBlockBoundary() ) ) { left = next; continue; } } else found = 1; break; } if ( !found ) break; mergeCount++; } } range.moveToBookmark( bookmarks.shift() ); // Merge ranges finally after moving to bookmarks. while( mergeCount-- ) { next = rangeList[ ++current ]; next.moveToBookmark( bookmarks.shift() ); range.setEnd( next.endContainer, next.endOffset ); } } return range; } }; }, createBookmarks : function( serializable ) { var retval = [], bookmark; for ( var i = 0; i < this.length ; i++ ) { retval.push( bookmark = this[ i ].createBookmark( serializable, true) ); // Updating the container & offset values for ranges // that have been touched. for ( var j = i + 1; j < this.length; j++ ) { this[ j ] = updateDirtyRange( bookmark, this[ j ] ); this[ j ] = updateDirtyRange( bookmark, this[ j ], true ); } } return retval; }, createBookmarks2 : function( normalized ) { var bookmarks = []; for ( var i = 0 ; i < this.length ; i++ ) bookmarks.push( this[ i ].createBookmark2( normalized ) ); return bookmarks; }, /** * Move each range in the list to the position specified by a list of bookmarks. * @param {Array} bookmarks The list of bookmarks, each one matching a range in the list. */ moveToBookmarks : function( bookmarks ) { for ( var i = 0 ; i < this.length ; i++ ) this[ i ].moveToBookmark( bookmarks[ i ] ); } }; // Update the specified range which has been mangled by previous insertion of // range bookmark nodes.(#3256) function updateDirtyRange( bookmark, dirtyRange, checkEnd ) { var serializable = bookmark.serializable, container = dirtyRange[ checkEnd ? 'endContainer' : 'startContainer' ], offset = checkEnd ? 'endOffset' : 'startOffset'; var bookmarkStart = serializable ? dirtyRange.document.getById( bookmark.startNode ) : bookmark.startNode; var bookmarkEnd = serializable ? dirtyRange.document.getById( bookmark.endNode ) : bookmark.endNode; if ( container.equals( bookmarkStart.getPrevious() ) ) { dirtyRange.startOffset = dirtyRange.startOffset - container.getLength() - bookmarkEnd.getPrevious().getLength(); container = bookmarkEnd.getNext(); } else if ( container.equals( bookmarkEnd.getPrevious() ) ) { dirtyRange.startOffset = dirtyRange.startOffset - container.getLength(); container = bookmarkEnd.getNext(); } container.equals( bookmarkStart.getParent() ) && dirtyRange[ offset ]++; container.equals( bookmarkEnd.getParent() ) && dirtyRange[ offset ]++; // Update and return this range. dirtyRange[ checkEnd ? 'endContainer' : 'startContainer' ] = container; return dirtyRange; } })(); /** * (Virtual Class) Do not call this constructor. This class is not really part * of the API. It just describes the return type of {@link CKEDITOR.dom.rangeList#createIterator}. * @name CKEDITOR.dom.rangeListIterator * @constructor * @example */
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { // Elements that may be considered the "Block boundary" in an element path. var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1, legend:1,caption:1 }; // Elements that may be considered the "Block limit" in an element path. var pathBlockLimitElements = { body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,form:1,fieldset:1 }; // Check if an element contains any block element. var checkHasBlock = function( element ) { var childNodes = element.getChildren(); for ( var i = 0, count = childNodes.count() ; i < count ; i++ ) { var child = childNodes.getItem( i ); if ( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] ) return true; } return false; }; /** * @class */ CKEDITOR.dom.elementPath = function( lastNode ) { var block = null; var blockLimit = null; var elements = []; var e = lastNode; while ( e ) { if ( e.type == CKEDITOR.NODE_ELEMENT ) { if ( !this.lastElement ) this.lastElement = e; var elementName = e.getName(); if ( !blockLimit ) { if ( !block && pathBlockElements[ elementName ] ) block = e; if ( pathBlockLimitElements[ elementName ] ) { // DIV is considered the Block, if no block is available (#525) // and if it doesn't contain other blocks. if ( !block && elementName == 'div' && !checkHasBlock( e ) ) block = e; else blockLimit = e; } } elements.push( e ); if ( elementName == 'body' ) break; } e = e.getParent(); } this.block = block; this.blockLimit = blockLimit; this.elements = elements; }; })(); CKEDITOR.dom.elementPath.prototype = { /** * Compares this element path with another one. * @param {CKEDITOR.dom.elementPath} otherPath The elementPath object to be * compared with this one. * @returns {Boolean} "true" if the paths are equal, containing the same * number of elements and the same elements in the same order. */ compare : function( otherPath ) { var thisElements = this.elements; var otherElements = otherPath && otherPath.elements; if ( !otherElements || thisElements.length != otherElements.length ) return false; for ( var i = 0 ; i < thisElements.length ; i++ ) { if ( !thisElements[ i ].equals( otherElements[ i ] ) ) return false; } return true; }, contains : function( tagNames ) { var elements = this.elements; for ( var i = 0 ; i < elements.length ; i++ ) { if ( elements[ i ].getName() in tagNames ) return elements[ i ]; } return null; } };
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.event} class, which * represents the a native DOM event object. */ /** * Represents a native DOM event object. * @constructor * @param {Object} domEvent A native DOM event object. * @example */ CKEDITOR.dom.event = function( domEvent ) { /** * The native DOM event object represented by this class instance. * @type Object * @example */ this.$ = domEvent; }; CKEDITOR.dom.event.prototype = { /** * Gets the key code associated to the event. * @returns {Number} The key code. * @example * alert( event.getKey() ); "65" is "a" has been pressed */ getKey : function() { return this.$.keyCode || this.$.which; }, /** * Gets a number represeting the combination of the keys pressed during the * event. It is the sum with the current key code and the {@link CKEDITOR.CTRL}, * {@link CKEDITOR.SHIFT} and {@link CKEDITOR.ALT} constants. * @returns {Number} The number representing the keys combination. * @example * alert( event.getKeystroke() == 65 ); // "a" key * alert( event.getKeystroke() == CKEDITOR.CTRL + 65 ); // CTRL + "a" key * alert( event.getKeystroke() == CKEDITOR.CTRL + CKEDITOR.SHIFT + 65 ); // CTRL + SHIFT + "a" key */ getKeystroke : function() { var keystroke = this.getKey(); if ( this.$.ctrlKey || this.$.metaKey ) keystroke += CKEDITOR.CTRL; if ( this.$.shiftKey ) keystroke += CKEDITOR.SHIFT; if ( this.$.altKey ) keystroke += CKEDITOR.ALT; return keystroke; }, /** * Prevents the original behavior of the event to happen. It can optionally * stop propagating the event in the event chain. * @param {Boolean} [stopPropagation] Stop propagating this event in the * event chain. * @example * var element = CKEDITOR.document.getById( 'myElement' ); * element.on( 'click', function( ev ) * { * // The DOM event object is passed by the "data" property. * var domEvent = ev.data; * // Prevent the click to chave any effect in the element. * domEvent.preventDefault(); * }); */ preventDefault : function( stopPropagation ) { var $ = this.$; if ( $.preventDefault ) $.preventDefault(); else $.returnValue = false; if ( stopPropagation ) this.stopPropagation(); }, stopPropagation : function() { var $ = this.$; if ( $.stopPropagation ) $.stopPropagation(); else $.cancelBubble = true; }, /** * Returns the DOM node where the event was targeted to. * @returns {CKEDITOR.dom.node} The target DOM node. * @example * var element = CKEDITOR.document.getById( 'myElement' ); * element.on( 'click', function( ev ) * { * // The DOM event object is passed by the "data" property. * var domEvent = ev.data; * // Add a CSS class to the event target. * domEvent.getTarget().addClass( 'clicked' ); * }); */ getTarget : function() { var rawNode = this.$.target || this.$.srcElement; return rawNode ? new CKEDITOR.dom.node( rawNode ) : null; } }; // For the followind constants, we need to go over the Unicode boundaries // (0x10FFFF) to avoid collision. /** * CTRL key (0x110000). * @constant * @example */ CKEDITOR.CTRL = 0x110000; /** * SHIFT key (0x220000). * @constant * @example */ CKEDITOR.SHIFT = 0x220000; /** * ALT key (0x440000). * @constant * @example */ CKEDITOR.ALT = 0x440000;
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.resourceManager} class, which is * the base for resource managers, like plugins and themes. */ /** * Base class for resource managers, like plugins and themes. This class is not * intended to be used out of the CKEditor core code. * @param {String} basePath The path for the resources folder. * @param {String} fileName The name used for resource files. * @namespace * @example */ CKEDITOR.resourceManager = function( basePath, fileName ) { /** * The base directory containing all resources. * @name CKEDITOR.resourceManager.prototype.basePath * @type String * @example */ this.basePath = basePath; /** * The name used for resource files. * @name CKEDITOR.resourceManager.prototype.fileName * @type String * @example */ this.fileName = fileName; /** * Contains references to all resources that have already been registered * with {@link #add}. * @name CKEDITOR.resourceManager.prototype.registered * @type Object * @example */ this.registered = {}; /** * Contains references to all resources that have already been loaded * with {@link #load}. * @name CKEDITOR.resourceManager.prototype.loaded * @type Object * @example */ this.loaded = {}; /** * Contains references to all resources that have already been registered * with {@link #addExternal}. * @name CKEDITOR.resourceManager.prototype.externals * @type Object * @example */ this.externals = {}; /** * @private */ this._ = { // List of callbacks waiting for plugins to be loaded. waitingList : {} }; }; CKEDITOR.resourceManager.prototype = { /** * Registers a resource. * @param {String} name The resource name. * @param {Object} [definition] The resource definition. * @example * CKEDITOR.plugins.add( 'sample', { ... plugin definition ... } ); * @see CKEDITOR.pluginDefinition */ add : function( name, definition ) { if ( this.registered[ name ] ) throw '[CKEDITOR.resourceManager.add] The resource name "' + name + '" is already registered.'; CKEDITOR.fire( name + CKEDITOR.tools.capitalize( this.fileName ) + 'Ready', this.registered[ name ] = definition || {} ); }, /** * Gets the definition of a specific resource. * @param {String} name The resource name. * @type Object * @example * var definition = <b>CKEDITOR.plugins.get( 'sample' )</b>; */ get : function( name ) { return this.registered[ name ] || null; }, /** * Get the folder path for a specific loaded resource. * @param {String} name The resource name. * @type String * @example * alert( <b>CKEDITOR.plugins.getPath( 'sample' )</b> ); // "&lt;editor path&gt;/plugins/sample/" */ getPath : function( name ) { var external = this.externals[ name ]; return CKEDITOR.getUrl( ( external && external.dir ) || this.basePath + name + '/' ); }, /** * Get the file path for a specific loaded resource. * @param {String} name The resource name. * @type String * @example * alert( <b>CKEDITOR.plugins.getFilePath( 'sample' )</b> ); // "&lt;editor path&gt;/plugins/sample/plugin.js" */ getFilePath : function( name ) { var external = this.externals[ name ]; return CKEDITOR.getUrl( this.getPath( name ) + ( ( external && ( typeof external.file == 'string' ) ) ? external.file : this.fileName + '.js' ) ); }, /** * Registers one or more resources to be loaded from an external path * instead of the core base path. * @param {String} names The resource names, separated by commas. * @param {String} path The path of the folder containing the resource. * @param {String} [fileName] The resource file name. If not provided, the * default name is used; If provided with a empty string, will implicitly indicates that {@param path} * is already the full path. * @example * // Loads a plugin from '/myplugin/samples/plugin.js'. * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' ); * @example * // Loads a plugin from '/myplugin/samples/my_plugin.js'. * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/', 'my_plugin.js' ); * @example * // Loads a plugin from '/myplugin/samples/my_plugin.js'. * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/my_plugin.js', '' ); */ addExternal : function( names, path, fileName ) { names = names.split( ',' ); for ( var i = 0 ; i < names.length ; i++ ) { var name = names[ i ]; this.externals[ name ] = { dir : path, file : fileName }; } }, /** * Loads one or more resources. * @param {String|Array} name The name of the resource to load. It may be a * string with a single resource name, or an array with several names. * @param {Function} callback A function to be called when all resources * are loaded. The callback will receive an array containing all * loaded names. * @param {Object} [scope] The scope object to be used for the callback * call. * @example * <b>CKEDITOR.plugins.load</b>( 'myplugin', function( plugins ) * { * alert( plugins['myplugin'] ); // "object" * }); */ load : function( names, callback, scope ) { // Ensure that we have an array of names. if ( !CKEDITOR.tools.isArray( names ) ) names = names ? [ names ] : []; var loaded = this.loaded, registered = this.registered, urls = [], urlsNames = {}, resources = {}; // Loop through all names. for ( var i = 0 ; i < names.length ; i++ ) { var name = names[ i ]; if ( !name ) continue; // If not available yet. if ( !loaded[ name ] && !registered[ name ] ) { var url = this.getFilePath( name ); urls.push( url ); if ( !( url in urlsNames ) ) urlsNames[ url ] = []; urlsNames[ url ].push( name ); } else resources[ name ] = this.get( name ); } CKEDITOR.scriptLoader.load( urls, function( completed, failed ) { if ( failed.length ) { throw '[CKEDITOR.resourceManager.load] Resource name "' + urlsNames[ failed[ 0 ] ].join( ',' ) + '" was not found at "' + failed[ 0 ] + '".'; } for ( var i = 0 ; i < completed.length ; i++ ) { var nameList = urlsNames[ completed[ i ] ]; for ( var j = 0 ; j < nameList.length ; j++ ) { var name = nameList[ j ]; resources[ name ] = this.get( name ); loaded[ name ] = 1; } } callback.call( scope, resources ); } , this); } };
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.editor} class, which represents an * editor instance. */ (function() { // The counter for automatic instance names. var nameCounter = 0; var getNewName = function() { var name = 'editor' + ( ++nameCounter ); return ( CKEDITOR.instances && CKEDITOR.instances[ name ] ) ? getNewName() : name; }; // ##### START: Config Privates // These function loads custom configuration files and cache the // CKEDITOR.editorConfig functions defined on them, so there is no need to // download them more than once for several instances. var loadConfigLoaded = {}; var loadConfig = function( editor ) { var customConfig = editor.config.customConfig; // Check if there is a custom config to load. if ( !customConfig ) return false; customConfig = CKEDITOR.getUrl( customConfig ); var loadedConfig = loadConfigLoaded[ customConfig ] || ( loadConfigLoaded[ customConfig ] = {} ); // If the custom config has already been downloaded, reuse it. if ( loadedConfig.fn ) { // Call the cached CKEDITOR.editorConfig defined in the custom // config file for the editor instance depending on it. loadedConfig.fn.call( editor, editor.config ); // If there is no other customConfig in the chain, fire the // "configLoaded" event. if ( CKEDITOR.getUrl( editor.config.customConfig ) == customConfig || !loadConfig( editor ) ) editor.fireOnce( 'customConfigLoaded' ); } else { // Load the custom configuration file. CKEDITOR.scriptLoader.load( customConfig, function() { // If the CKEDITOR.editorConfig function has been properly // defined in the custom configuration file, cache it. if ( CKEDITOR.editorConfig ) loadedConfig.fn = CKEDITOR.editorConfig; else loadedConfig.fn = function(){}; // Call the load config again. This time the custom // config is already cached and so it will get loaded. loadConfig( editor ); }); } return true; }; var initConfig = function( editor, instanceConfig ) { // Setup the lister for the "customConfigLoaded" event. editor.on( 'customConfigLoaded', function() { if ( instanceConfig ) { // Register the events that may have been set at the instance // configuration object. if ( instanceConfig.on ) { for ( var eventName in instanceConfig.on ) { editor.on( eventName, instanceConfig.on[ eventName ] ); } } // Overwrite the settings from the in-page config. CKEDITOR.tools.extend( editor.config, instanceConfig, true ); delete editor.config.on; } onConfigLoaded( editor ); }); // The instance config may override the customConfig setting to avoid // loading the default ~/config.js file. if ( instanceConfig && instanceConfig.customConfig != undefined ) editor.config.customConfig = instanceConfig.customConfig; // Load configs from the custom configuration files. if ( !loadConfig( editor ) ) editor.fireOnce( 'customConfigLoaded' ); }; // ##### END: Config Privates var onConfigLoaded = function( editor ) { // Set config related properties. var skin = editor.config.skin.split( ',' ), skinName = skin[ 0 ], skinPath = CKEDITOR.getUrl( skin[ 1 ] || ( '_source/' + // @Packager.RemoveLine 'skins/' + skinName + '/' ) ); /** * The name of the skin used by this editor instance. The skin name can * be set through the <code>{@link CKEDITOR.config.skin}</code> setting. * @name CKEDITOR.editor.prototype.skinName * @type String * @example * alert( editor.skinName ); // E.g. "kama" */ editor.skinName = skinName; /** * The full URL of the skin directory. * @name CKEDITOR.editor.prototype.skinPath * @type String * @example * alert( editor.skinPath ); // E.g. "http://example.com/ckeditor/skins/kama/" */ editor.skinPath = skinPath; /** * The CSS class name used for skin identification purposes. * @name CKEDITOR.editor.prototype.skinClass * @type String * @example * alert( editor.skinClass ); // E.g. "cke_skin_kama" */ editor.skinClass = 'cke_skin_' + skinName; /** * The <a href="http://en.wikipedia.org/wiki/Tabbing_navigation">tabbing * navigation</a> order that has been calculated for this editor * instance. This can be set by the <code>{@link CKEDITOR.config.tabIndex}</code> * setting or taken from the <code>tabindex</code> attribute of the * <code>{@link #element}</code> associated with the editor. * @name CKEDITOR.editor.prototype.tabIndex * @type Number * @default 0 (zero) * @example * alert( editor.tabIndex ); // E.g. "0" */ editor.tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0; /** * Indicates the read-only state of this editor. This is a read-only property. * @name CKEDITOR.editor.prototype.readOnly * @type Boolean * @since 3.6 * @see CKEDITOR.editor#setReadOnly */ editor.readOnly = !!( editor.config.readOnly || editor.element.getAttribute( 'disabled' ) ); // Fire the "configLoaded" event. editor.fireOnce( 'configLoaded' ); // Load language file. loadSkin( editor ); }; var loadLang = function( editor ) { CKEDITOR.lang.load( editor.config.language, editor.config.defaultLanguage, function( languageCode, lang ) { /** * The code for the language resources that have been loaded * for the user interface elements of this editor instance. * @name CKEDITOR.editor.prototype.langCode * @type String * @example * alert( editor.langCode ); // E.g. "en" */ editor.langCode = languageCode; /** * An object that contains all language strings used by the editor * interface. * @name CKEDITOR.editor.prototype.lang * @type CKEDITOR.lang * @example * alert( editor.lang.bold ); // E.g. "Negrito" (if the language is set to Portuguese) */ // As we'll be adding plugin specific entries that could come // from different language code files, we need a copy of lang, // not a direct reference to it. editor.lang = CKEDITOR.tools.prototypedCopy( lang ); // We're not able to support RTL in Firefox 2 at this time. if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' ) editor.lang.dir = 'ltr'; editor.fire( 'langLoaded' ); var config = editor.config; config.contentsLangDirection == 'ui' && ( config.contentsLangDirection = editor.lang.dir ); loadPlugins( editor ); }); }; var loadPlugins = function( editor ) { var config = editor.config, plugins = config.plugins, extraPlugins = config.extraPlugins, removePlugins = config.removePlugins; if ( extraPlugins ) { // Remove them first to avoid duplications. var removeRegex = new RegExp( '(?:^|,)(?:' + extraPlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' ); plugins = plugins.replace( removeRegex, '' ); plugins += ',' + extraPlugins; } if ( removePlugins ) { removeRegex = new RegExp( '(?:^|,)(?:' + removePlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' ); plugins = plugins.replace( removeRegex, '' ); } // Load the Adobe AIR plugin conditionally. CKEDITOR.env.air && ( plugins += ',adobeair' ); // Load all plugins defined in the "plugins" setting. CKEDITOR.plugins.load( plugins.split( ',' ), function( plugins ) { // The list of plugins. var pluginsArray = []; // The language code to get loaded for each plugin. Null // entries will be appended for plugins with no language files. var languageCodes = []; // The list of URLs to language files. var languageFiles = []; /** * An object that contains references to all plugins used by this * editor instance. * @name CKEDITOR.editor.prototype.plugins * @type Object * @example * alert( editor.plugins.dialog.path ); // E.g. "http://example.com/ckeditor/plugins/dialog/" */ editor.plugins = plugins; // Loop through all plugins, to build the list of language // files to get loaded. for ( var pluginName in plugins ) { var plugin = plugins[ pluginName ], pluginLangs = plugin.lang, pluginPath = CKEDITOR.plugins.getPath( pluginName ), lang = null; // Set the plugin path in the plugin. plugin.path = pluginPath; // If the plugin has "lang". if ( pluginLangs ) { // Resolve the plugin language. If the current language // is not available, get the first one (default one). lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] ); if ( !plugin.langEntries || !plugin.langEntries[ lang ] ) { // Put the language file URL into the list of files to // get downloaded. languageFiles.push( CKEDITOR.getUrl( pluginPath + 'lang/' + lang + '.js' ) ); } else { CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ lang ] ); lang = null; } } // Save the language code, so we know later which // language has been resolved to this plugin. languageCodes.push( lang ); pluginsArray.push( plugin ); } // Load all plugin specific language files in a row. CKEDITOR.scriptLoader.load( languageFiles, function() { // Initialize all plugins that have the "beforeInit" and "init" methods defined. var methods = [ 'beforeInit', 'init', 'afterInit' ]; for ( var m = 0 ; m < methods.length ; m++ ) { for ( var i = 0 ; i < pluginsArray.length ; i++ ) { var plugin = pluginsArray[ i ]; // Uses the first loop to update the language entries also. if ( m === 0 && languageCodes[ i ] && plugin.lang ) CKEDITOR.tools.extend( editor.lang, plugin.langEntries[ languageCodes[ i ] ] ); // Call the plugin method (beforeInit and init). if ( plugin[ methods[ m ] ] ) plugin[ methods[ m ] ]( editor ); } } // Load the editor skin. editor.fire( 'pluginsLoaded' ); loadTheme( editor ); }); }); }; var loadSkin = function( editor ) { CKEDITOR.skins.load( editor, 'editor', function() { loadLang( editor ); }); }; var loadTheme = function( editor ) { var theme = editor.config.theme; CKEDITOR.themes.load( theme, function() { /** * The theme used by this editor instance. * @name CKEDITOR.editor.prototype.theme * @type CKEDITOR.theme * @example * alert( editor.theme ); // E.g. "http://example.com/ckeditor/themes/default/" */ var editorTheme = editor.theme = CKEDITOR.themes.get( theme ); editorTheme.path = CKEDITOR.themes.getPath( theme ); editorTheme.build( editor ); if ( editor.config.autoUpdateElement ) attachToForm( editor ); }); }; var attachToForm = function( editor ) { var element = editor.element; // If are replacing a textarea, we must if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.is( 'textarea' ) ) { var form = element.$.form && new CKEDITOR.dom.element( element.$.form ); if ( form ) { function onSubmit() { editor.updateElement(); } form.on( 'submit',onSubmit ); // Setup the submit function because it doesn't fire the // "submit" event. if ( !form.$.submit.nodeName && !form.$.submit.length ) { form.$.submit = CKEDITOR.tools.override( form.$.submit, function( originalSubmit ) { return function() { editor.updateElement(); // For IE, the DOM submit function is not a // function, so we need thid check. if ( originalSubmit.apply ) originalSubmit.apply( this, arguments ); else originalSubmit(); }; }); } // Remove 'submit' events registered on form element before destroying.(#3988) editor.on( 'destroy', function() { form.removeListener( 'submit', onSubmit ); } ); } } }; function updateCommands() { var command, commands = this._.commands, mode = this.mode; if ( !mode ) return; for ( var name in commands ) { command = commands[ name ]; command[ command.startDisabled ? 'disable' : this.readOnly && !command.readOnly ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ](); } } /** * Initializes the editor instance. This function is called by the editor * contructor (<code>editor_basic.js</code>). * @private */ CKEDITOR.editor.prototype._init = function() { // Get the properties that have been saved in the editor_base // implementation. var element = CKEDITOR.dom.element.get( this._.element ), instanceConfig = this._.instanceConfig; delete this._.element; delete this._.instanceConfig; this._.commands = {}; this._.styles = []; /** * The DOM element that was replaced by this editor instance. This * element stores the editor data on load and post. * @name CKEDITOR.editor.prototype.element * @type CKEDITOR.dom.element * @example * var editor = CKEDITOR.instances.editor1; * alert( <strong>editor.element</strong>.getName() ); // E.g. "textarea" */ this.element = element; /** * The editor instance name. It may be the replaced element ID, name, or * a default name using the progressive counter (<code>editor1</code>, * <code>editor2</code>, ...). * @name CKEDITOR.editor.prototype.name * @type String * @example * var editor = CKEDITOR.instances.editor1; * alert( <strong>editor.name</strong> ); // "editor1" */ this.name = ( element && ( this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) && ( element.getId() || element.getNameAtt() ) ) || getNewName(); if ( this.name in CKEDITOR.instances ) throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.'; /** * A unique random string assigned to each editor instance on the page. * @name CKEDITOR.editor.prototype.id * @type String */ this.id = CKEDITOR.tools.getNextId(); /** * The configurations for this editor instance. It inherits all * settings defined in <code>(@link CKEDITOR.config}</code>, combined with settings * loaded from custom configuration files and those defined inline in * the page when creating the editor. * @name CKEDITOR.editor.prototype.config * @type Object * @example * var editor = CKEDITOR.instances.editor1; * alert( <strong>editor.config.theme</strong> ); // E.g. "default" */ this.config = CKEDITOR.tools.prototypedCopy( CKEDITOR.config ); /** * The namespace containing UI features related to this editor instance. * @name CKEDITOR.editor.prototype.ui * @type CKEDITOR.ui * @example */ this.ui = new CKEDITOR.ui( this ); /** * Controls the focus state of this editor instance. This property * is rarely used for normal API operations. It is mainly * intended for developers adding UI elements to the editor interface. * @name CKEDITOR.editor.prototype.focusManager * @type CKEDITOR.focusManager * @example */ this.focusManager = new CKEDITOR.focusManager( this ); CKEDITOR.fire( 'instanceCreated', null, this ); this.on( 'mode', updateCommands, null, null, 1 ); this.on( 'readOnly', updateCommands, null, null, 1 ); initConfig( this, instanceConfig ); }; })(); CKEDITOR.tools.extend( CKEDITOR.editor.prototype, /** @lends CKEDITOR.editor.prototype */ { /** * Adds a command definition to the editor instance. Commands added with * this function can be executed later with the <code>{@link #execCommand}</code> method. * @param {String} commandName The indentifier name of the command. * @param {CKEDITOR.commandDefinition} commandDefinition The command definition. * @example * editorInstance.addCommand( 'sample', * { * exec : function( editor ) * { * alert( 'Executing a command for the editor name "' + editor.name + '"!' ); * } * }); */ addCommand : function( commandName, commandDefinition ) { return this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition ); }, /** * Adds a piece of CSS code to the editor which will be applied to the WYSIWYG editing document. * This CSS would not be added to the output, and is there mainly for editor-specific editing requirements. * Note: This function should be called before the editor is loaded to take effect. * @param css {String} CSS text. * @example * editorInstance.addCss( 'body { background-color: grey; }' ); */ addCss : function( css ) { this._.styles.push( css ); }, /** * Destroys the editor instance, releasing all resources used by it. * If the editor replaced an element, the element will be recovered. * @param {Boolean} [noUpdate] If the instance is replacing a DOM * element, this parameter indicates whether or not to update the * element with the instance contents. * @example * alert( CKEDITOR.instances.editor1 ); // E.g "object" * <strong>CKEDITOR.instances.editor1.destroy()</strong>; * alert( CKEDITOR.instances.editor1 ); // "undefined" */ destroy : function( noUpdate ) { if ( !noUpdate ) this.updateElement(); this.fire( 'destroy' ); this.theme && this.theme.destroy( this ); CKEDITOR.remove( this ); CKEDITOR.fire( 'instanceDestroyed', null, this ); }, /** * Executes a command associated with the editor. * @param {String} commandName The indentifier name of the command. * @param {Object} [data] Data to be passed to the command. * @returns {Boolean} <code>true</code> if the command was executed * successfully, otherwise <code>false</code>. * @see CKEDITOR.editor.addCommand * @example * editorInstance.execCommand( 'bold' ); */ execCommand : function( commandName, data ) { var command = this.getCommand( commandName ); var eventData = { name: commandName, commandData: data, command: command }; if ( command && command.state != CKEDITOR.TRISTATE_DISABLED ) { if ( this.fire( 'beforeCommandExec', eventData ) !== true ) { eventData.returnValue = command.exec( eventData.commandData ); // Fire the 'afterCommandExec' immediately if command is synchronous. if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== true ) return eventData.returnValue; } } // throw 'Unknown command name "' + commandName + '"'; return false; }, /** * Gets one of the registered commands. Note that after registering a * command definition with <code>{@link #addCommand}</code>, it is * transformed internally into an instance of * <code>{@link CKEDITOR.command}</code>, which will then be returned * by this function. * @param {String} commandName The name of the command to be returned. * This is the same name that is used to register the command with * <code>addCommand</code>. * @returns {CKEDITOR.command} The command object identified by the * provided name. */ getCommand : function( commandName ) { return this._.commands[ commandName ]; }, /** * Gets the editor data. The data will be in raw format. It is the same * data that is posted by the editor. * @type String * @returns (String) The editor data. * @example * if ( CKEDITOR.instances.editor1.<strong>getData()</strong> == '' ) * alert( 'There is no data available' ); */ getData : function() { this.fire( 'beforeGetData' ); var eventData = this._.data; if ( typeof eventData != 'string' ) { var element = this.element; if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) eventData = element.is( 'textarea' ) ? element.getValue() : element.getHtml(); else eventData = ''; } eventData = { dataValue : eventData }; // Fire "getData" so data manipulation may happen. this.fire( 'getData', eventData ); return eventData.dataValue; }, /** * Gets the "raw data" currently available in the editor. This is a * fast method which returns the data as is, without processing, so it is * not recommended to use it on resulting pages. Instead it can be used * combined with the <code>{@link #loadSnapshot}</code> method in order * to be able to automatically save the editor data from time to time * while the user is using the editor, to avoid data loss, without risking * performance issues. * @see CKEDITOR.editor.getData * @example * alert( editor.getSnapshot() ); */ getSnapshot : function() { var data = this.fire( 'getSnapshot' ); if ( typeof data != 'string' ) { var element = this.element; if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) data = element.is( 'textarea' ) ? element.getValue() : element.getHtml(); } return data; }, /** * Loads "raw data" into the editor. The data is loaded with processing * straight to the editing area. It should not be used as a way to load * any kind of data, but instead in combination with * <code>{@link #getSnapshot}</code> produced data. * @see CKEDITOR.editor.setData * @example * var data = editor.getSnapshot(); * editor.<strong>loadSnapshot( data )</strong>; */ loadSnapshot : function( snapshot ) { this.fire( 'loadSnapshot', snapshot ); }, /** * Sets the editor data. The data must be provided in the raw format (HTML).<br /> * <br /> * Note that this method is asynchronous. The <code>callback</code> parameter must * be used if interaction with the editor is needed after setting the data. * @param {String} data HTML code to replace the curent content in the * editor. * @param {Function} callback Function to be called after the <code>setData</code> * is completed. *@param {Boolean} internal Whether to suppress any event firing when copying data * internally inside the editor. * @example * CKEDITOR.instances.editor1.<strong>setData</strong>( '&lt;p&gt;This is the editor data.&lt;/p&gt;' ); * @example * CKEDITOR.instances.editor1.<strong>setData</strong>( '&lt;p&gt;Some other editor data.&lt;/p&gt;', function() * { * this.checkDirty(); // true * }); */ setData : function( data , callback, internal ) { if( callback ) { this.on( 'dataReady', function( evt ) { evt.removeListener(); callback.call( evt.editor ); } ); } // Fire "setData" so data manipulation may happen. var eventData = { dataValue : data }; !internal && this.fire( 'setData', eventData ); this._.data = eventData.dataValue; !internal && this.fire( 'afterSetData', eventData ); }, /** * Puts or restores the editor into read-only state. When in read-only, * the user is not able to change the editor contents, but can still use * some editor features. This function sets the <code>{@link CKEDITOR.config.readOnly}</code> * property of the editor, firing the <code>{@link CKEDITOR.editor#readOnly}</code> event.<br><br> * <strong>Note:</strong> the current editing area will be reloaded. * @param {Boolean} [isReadOnly] Indicates that the editor must go * read-only (<code>true</code>, default) or be restored and made editable * (<code>false</code>). * @since 3.6 */ setReadOnly : function( isReadOnly ) { isReadOnly = ( isReadOnly == undefined ) || isReadOnly; if ( this.readOnly != isReadOnly ) { this.readOnly = isReadOnly; // Fire the readOnly event so the editor features can update // their state accordingly. this.fire( 'readOnly' ); } }, /** * Inserts HTML code into the currently selected position in the editor in WYSIWYG mode. * @param {String} data HTML code to be inserted into the editor. * @example * CKEDITOR.instances.editor1.<strong>insertHtml( '&lt;p&gt;This is a new paragraph.&lt;/p&gt;' )</strong>; */ insertHtml : function( data ) { this.fire( 'insertHtml', data ); }, /** * Insert text content into the currently selected position in the * editor in WYSIWYG mode. The styles of the selected element will be applied to the inserted text. * Spaces around the text will be leaving untouched. * <strong>Note:</strong> two subsequent line-breaks will introduce one paragraph. This depends on <code>{@link CKEDITOR.config.enterMode}</code>; * A single line-break will be instead translated into one &lt;br /&gt;. * @since 3.5 * @param {String} text Text to be inserted into the editor. * @example * CKEDITOR.instances.editor1.<strong>insertText( ' line1 \n\n line2' )</strong>; */ insertText : function( text ) { this.fire( 'insertText', text ); }, /** * Inserts an element into the currently selected position in the * editor in WYSIWYG mode. * @param {CKEDITOR.dom.element} element The element to be inserted * into the editor. * @example * var element = CKEDITOR.dom.element.createFromHtml( '&lt;img src="hello.png" border="0" title="Hello" /&gt;' ); * CKEDITOR.instances.editor1.<strong>insertElement( element )</strong>; */ insertElement : function( element ) { this.fire( 'insertElement', element ); }, /** * Checks whether the current editor contents contain changes when * compared to the contents loaded into the editor at startup, or to * the contents available in the editor when <code>{@link #resetDirty}</code> * was called. * @returns {Boolean} "true" is the contents contain changes. * @example * function beforeUnload( e ) * { * if ( CKEDITOR.instances.editor1.<strong>checkDirty()</strong> ) * return e.returnValue = "You will lose the changes made in the editor."; * } * * if ( window.addEventListener ) * window.addEventListener( 'beforeunload', beforeUnload, false ); * else * window.attachEvent( 'onbeforeunload', beforeUnload ); */ checkDirty : function() { return ( this.mayBeDirty && this._.previousValue !== this.getSnapshot() ); }, /** * Resets the "dirty state" of the editor so subsequent calls to * <code>{@link #checkDirty}</code> will return <code>false</code> if the user will not * have made further changes to the contents. * @example * alert( editor.checkDirty() ); // E.g. "true" * editor.<strong>resetDirty()</strong>; * alert( editor.checkDirty() ); // "false" */ resetDirty : function() { if ( this.mayBeDirty ) this._.previousValue = this.getSnapshot(); }, /** * Updates the <code>&lt;textarea&gt;</code> element that was replaced by the editor with * the current data available in the editor. * @see CKEDITOR.editor.element * @example * CKEDITOR.instances.editor1.updateElement(); * alert( document.getElementById( 'editor1' ).value ); // The current editor data. */ updateElement : function() { var element = this.element; if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) { var data = this.getData(); if ( this.config.htmlEncodeOutput ) data = CKEDITOR.tools.htmlEncode( data ); if ( element.is( 'textarea' ) ) element.setValue( data ); else element.setHtml( data ); } } }); CKEDITOR.on( 'loaded', function() { // Run the full initialization for pending editors. var pending = CKEDITOR.editor._pending; if ( pending ) { delete CKEDITOR.editor._pending; for ( var i = 0 ; i < pending.length ; i++ ) pending[ i ]._init(); } }); /** * Whether to escape HTML when the editor updates the original input element. * @name CKEDITOR.config.htmlEncodeOutput * @since 3.1 * @type Boolean * @default false * @example * config.htmlEncodeOutput = true; */ /** * If <code>true</code>, makes the editor start in read-only state. Otherwise, it will check * if the linked <code>&lt;textarea&gt;</code> element has the <code>disabled</code> attribute. * @name CKEDITOR.config.readOnly * @see CKEDITOR.editor#setReadOnly * @type Boolean * @default false * @since 3.6 * @example * config.readOnly = true; */ /** * Fired when a CKEDITOR instance is created, but still before initializing it. * To interact with a fully initialized instance, use the * <code>{@link CKEDITOR#instanceReady}</code> event instead. * @name CKEDITOR#instanceCreated * @event * @param {CKEDITOR.editor} editor The editor instance that has been created. */ /** * Fired when a CKEDITOR instance is destroyed. * @name CKEDITOR#instanceDestroyed * @event * @param {CKEDITOR.editor} editor The editor instance that has been destroyed. */ /** * Fired when the language is loaded into the editor instance. * @name CKEDITOR.editor#langLoaded * @event * @since 3.6.1 * @param {CKEDITOR.editor} editor This editor instance. */ /** * Fired when all plugins are loaded and initialized into the editor instance. * @name CKEDITOR.editor#pluginsLoaded * @event * @param {CKEDITOR.editor} editor This editor instance. */ /** * Fired before the command execution when <code>{@link #execCommand}</code> is called. * @name CKEDITOR.editor#beforeCommandExec * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} data.name The command name. * @param {Object} data.commandData The data to be sent to the command. This * can be manipulated by the event listener. * @param {CKEDITOR.command} data.command The command itself. */ /** * Fired after the command execution when <code>{@link #execCommand}</code> is called. * @name CKEDITOR.editor#afterCommandExec * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} data.name The command name. * @param {Object} data.commandData The data sent to the command. * @param {CKEDITOR.command} data.command The command itself. * @param {Object} data.returnValue The value returned by the command execution. */ /** * Fired when the custom configuration file is loaded, before the final * configurations initialization.<br /> * <br /> * Custom configuration files can be loaded thorugh the * <code>{@link CKEDITOR.config.customConfig}</code> setting. Several files can be loaded * by changing this setting. * @name CKEDITOR.editor#customConfigLoaded * @event * @param {CKEDITOR.editor} editor This editor instance. */ /** * Fired once the editor configuration is ready (loaded and processed). * @name CKEDITOR.editor#configLoaded * @event * @param {CKEDITOR.editor} editor This editor instance. */ /** * Fired when this editor instance is destroyed. The editor at this * point is not usable and this event should be used to perform the clean-up * in any plugin. * @name CKEDITOR.editor#destroy * @event */ /** * Internal event to get the current data. * @name CKEDITOR.editor#beforeGetData * @event */ /** * Internal event to perform the <code>#getSnapshot</code> call. * @name CKEDITOR.editor#getSnapshot * @event */ /** * Internal event to perform the <code>#loadSnapshot</code> call. * @name CKEDITOR.editor#loadSnapshot * @event */ /** * Event fired before the <code>#getData</code> call returns allowing additional manipulation. * @name CKEDITOR.editor#getData * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} data.dataValue The data that will be returned. */ /** * Event fired before the <code>#setData</code> call is executed allowing additional manipulation. * @name CKEDITOR.editor#setData * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} data.dataValue The data that will be used. */ /** * Event fired at the end of the <code>#setData</code> call execution. Usually it is better to use the * <code>{@link CKEDITOR.editor.prototype.dataReady}</code> event. * @name CKEDITOR.editor#afterSetData * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} data.dataValue The data that has been set. */ /** * Internal event to perform the <code>#insertHtml</code> call * @name CKEDITOR.editor#insertHtml * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} data The HTML to insert. */ /** * Internal event to perform the <code>#insertText</code> call * @name CKEDITOR.editor#insertText * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {String} text The text to insert. */ /** * Internal event to perform the <code>#insertElement</code> call * @name CKEDITOR.editor#insertElement * @event * @param {CKEDITOR.editor} editor This editor instance. * @param {Object} element The element to insert. */ /** * Event fired after the <code>{@link CKEDITOR.editor#readOnly}</code> property changes. * @name CKEDITOR.editor#readOnly * @event * @since 3.6 * @param {CKEDITOR.editor} editor This editor instance. */
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.event} class, which serves as the * base for classes and objects that require event handling features. */ if ( !CKEDITOR.event ) { /** * Creates an event class instance. This constructor is rearely used, being * the {@link #.implementOn} function used in class prototypes directly * instead. * @class This is a base class for classes and objects that require event * handling features.<br /> * <br /> * Do not confuse this class with {@link CKEDITOR.dom.event} which is * instead used for DOM events. The CKEDITOR.event class implements the * internal event system used by the CKEditor to fire API related events. * @example */ CKEDITOR.event = function() {}; /** * Implements the {@link CKEDITOR.event} features in an object. * @param {Object} targetObject The object into which implement the features. * @example * var myObject = { message : 'Example' }; * <b>CKEDITOR.event.implementOn( myObject }</b>; * myObject.on( 'testEvent', function() * { * alert( this.message ); // "Example" * }); * myObject.fire( 'testEvent' ); */ CKEDITOR.event.implementOn = function( targetObject ) { var eventProto = CKEDITOR.event.prototype; for ( var prop in eventProto ) { if ( targetObject[ prop ] == undefined ) targetObject[ prop ] = eventProto[ prop ]; } }; CKEDITOR.event.prototype = (function() { // Returns the private events object for a given object. var getPrivate = function( obj ) { var _ = ( obj.getPrivate && obj.getPrivate() ) || obj._ || ( obj._ = {} ); return _.events || ( _.events = {} ); }; var eventEntry = function( eventName ) { this.name = eventName; this.listeners = []; }; eventEntry.prototype = { // Get the listener index for a specified function. // Returns -1 if not found. getListenerIndex : function( listenerFunction ) { for ( var i = 0, listeners = this.listeners ; i < listeners.length ; i++ ) { if ( listeners[i].fn == listenerFunction ) return i; } return -1; } }; return /** @lends CKEDITOR.event.prototype */ { /** * Registers a listener to a specific event in the current object. * @param {String} eventName The event name to which listen. * @param {Function} listenerFunction The function listening to the * event. A single {@link CKEDITOR.eventInfo} object instanced * is passed to this function containing all the event data. * @param {Object} [scopeObj] The object used to scope the listener * call (the this object. If omitted, the current object is used. * @param {Object} [listenerData] Data to be sent as the * {@link CKEDITOR.eventInfo#listenerData} when calling the * listener. * @param {Number} [priority] The listener priority. Lower priority * listeners are called first. Listeners with the same priority * value are called in registration order. Defaults to 10. * @example * someObject.on( 'someEvent', function() * { * alert( this == someObject ); // "true" * }); * @example * someObject.on( 'someEvent', function() * { * alert( this == anotherObject ); // "true" * } * , anotherObject ); * @example * someObject.on( 'someEvent', function( event ) * { * alert( event.listenerData ); // "Example" * } * , null, 'Example' ); * @example * someObject.on( 'someEvent', function() { ... } ); // 2nd called * someObject.on( 'someEvent', function() { ... }, null, null, 100 ); // 3rd called * someObject.on( 'someEvent', function() { ... }, null, null, 1 ); // 1st called */ on : function( eventName, listenerFunction, scopeObj, listenerData, priority ) { // Get the event entry (create it if needed). var events = getPrivate( this ), event = events[ eventName ] || ( events[ eventName ] = new eventEntry( eventName ) ); if ( event.getListenerIndex( listenerFunction ) < 0 ) { // Get the listeners. var listeners = event.listeners; // Fill the scope. if ( !scopeObj ) scopeObj = this; // Default the priority, if needed. if ( isNaN( priority ) ) priority = 10; var me = this; // Create the function to be fired for this listener. var listenerFirer = function( editor, publisherData, stopFn, cancelFn ) { var ev = { name : eventName, sender : this, editor : editor, data : publisherData, listenerData : listenerData, stop : stopFn, cancel : cancelFn, removeListener : function() { me.removeListener( eventName, listenerFunction ); } }; listenerFunction.call( scopeObj, ev ); return ev.data; }; listenerFirer.fn = listenerFunction; listenerFirer.priority = priority; // Search for the right position for this new listener, based on its // priority. for ( var i = listeners.length - 1 ; i >= 0 ; i-- ) { // Find the item which should be before the new one. if ( listeners[ i ].priority <= priority ) { // Insert the listener in the array. listeners.splice( i + 1, 0, listenerFirer ); return; } } // If no position has been found (or zero length), put it in // the front of list. listeners.unshift( listenerFirer ); } }, /** * Fires an specific event in the object. All registered listeners are * called at this point. * @function * @param {String} eventName The event name to fire. * @param {Object} [data] Data to be sent as the * {@link CKEDITOR.eventInfo#data} when calling the * listeners. * @param {CKEDITOR.editor} [editor] The editor instance to send as the * {@link CKEDITOR.eventInfo#editor} when calling the * listener. * @returns {Boolean|Object} A booloan indicating that the event is to be * canceled, or data returned by one of the listeners. * @example * someObject.on( 'someEvent', function() { ... } ); * someObject.on( 'someEvent', function() { ... } ); * <b>someObject.fire( 'someEvent' )</b>; // both listeners are called * @example * someObject.on( 'someEvent', function( event ) * { * alert( event.data ); // "Example" * }); * <b>someObject.fire( 'someEvent', 'Example' )</b>; */ fire : (function() { // Create the function that marks the event as stopped. var stopped = false; var stopEvent = function() { stopped = true; }; // Create the function that marks the event as canceled. var canceled = false; var cancelEvent = function() { canceled = true; }; return function( eventName, data, editor ) { // Get the event entry. var event = getPrivate( this )[ eventName ]; // Save the previous stopped and cancelled states. We may // be nesting fire() calls. var previousStopped = stopped, previousCancelled = canceled; // Reset the stopped and canceled flags. stopped = canceled = false; if ( event ) { var listeners = event.listeners; if ( listeners.length ) { // As some listeners may remove themselves from the // event, the original array length is dinamic. So, // let's make a copy of all listeners, so we are // sure we'll call all of them. listeners = listeners.slice( 0 ); // Loop through all listeners. for ( var i = 0 ; i < listeners.length ; i++ ) { // Call the listener, passing the event data. var retData = listeners[i].call( this, editor, data, stopEvent, cancelEvent ); if ( typeof retData != 'undefined' ) data = retData; // No further calls is stopped or canceled. if ( stopped || canceled ) break; } } } var ret = canceled || ( typeof data == 'undefined' ? false : data ); // Restore the previous stopped and canceled states. stopped = previousStopped; canceled = previousCancelled; return ret; }; })(), /** * Fires an specific event in the object, releasing all listeners * registered to that event. The same listeners are not called again on * successive calls of it or of {@link #fire}. * @param {String} eventName The event name to fire. * @param {Object} [data] Data to be sent as the * {@link CKEDITOR.eventInfo#data} when calling the * listeners. * @param {CKEDITOR.editor} [editor] The editor instance to send as the * {@link CKEDITOR.eventInfo#editor} when calling the * listener. * @returns {Boolean|Object} A booloan indicating that the event is to be * canceled, or data returned by one of the listeners. * @example * someObject.on( 'someEvent', function() { ... } ); * someObject.fire( 'someEvent' ); // above listener called * <b>someObject.fireOnce( 'someEvent' )</b>; // above listener called * someObject.fire( 'someEvent' ); // no listeners called */ fireOnce : function( eventName, data, editor ) { var ret = this.fire( eventName, data, editor ); delete getPrivate( this )[ eventName ]; return ret; }, /** * Unregisters a listener function from being called at the specified * event. No errors are thrown if the listener has not been * registered previously. * @param {String} eventName The event name. * @param {Function} listenerFunction The listener function to unregister. * @example * var myListener = function() { ... }; * someObject.on( 'someEvent', myListener ); * someObject.fire( 'someEvent' ); // myListener called * <b>someObject.removeListener( 'someEvent', myListener )</b>; * someObject.fire( 'someEvent' ); // myListener not called */ removeListener : function( eventName, listenerFunction ) { // Get the event entry. var event = getPrivate( this )[ eventName ]; if ( event ) { var index = event.getListenerIndex( listenerFunction ); if ( index >= 0 ) event.listeners.splice( index, 1 ); } }, /** * Checks if there is any listener registered to a given event. * @param {String} eventName The event name. * @example * var myListener = function() { ... }; * someObject.on( 'someEvent', myListener ); * alert( someObject.<b>hasListeners( 'someEvent' )</b> ); // "true" * alert( someObject.<b>hasListeners( 'noEvent' )</b> ); // "false" */ hasListeners : function( eventName ) { var event = getPrivate( this )[ eventName ]; return ( event && event.listeners.length > 0 ) ; } }; })(); }
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @fileOverview Defines the "virtual" {@link CKEDITOR.dataProcessor} class, which * defines the basic structure of data processor objects to be * set to {@link CKEDITOR.editor.dataProcessor}. */ /** * If defined, points to the data processor which is responsible to translate * and transform the editor data on input and output. * Generaly it will point to an instance of {@link CKEDITOR.htmlDataProcessor}, * which handles HTML data. The editor may also handle other data formats by * using different data processors provided by specific plugins. * @name CKEDITOR.editor.prototype.dataProcessor * @type CKEDITOR.dataProcessor */ /** * This class is here for documentation purposes only and is not really part of * the API. It serves as the base ("interface") for data processors * implementation. * @name CKEDITOR.dataProcessor * @class Represents a data processor, which is responsible to translate and * transform the editor data on input and output. * @example */ /** * Transforms input data into HTML to be loaded in the editor. * While the editor is able to handle non HTML data (like BBCode), at runtime * it can handle HTML data only. The role of the data processor is transforming * the input data into HTML through this function. * @name CKEDITOR.dataProcessor.prototype.toHtml * @function * @param {String} data The input data to be transformed. * @param {String} [fixForBody] The tag name to be used if the data must be * fixed because it is supposed to be loaded direcly into the &lt;body&gt; * tag. This is generally not used by non-HTML data processors. * @example * // Tranforming BBCode data, having a custom BBCode data processor. * var data = 'This is [b]an example[/b].'; * var html = editor.dataProcessor.toHtml( data ); // '&lt;p&gt;This is &lt;b&gt;an example&lt;/b&gt;.&lt;/p&gt;' */ /** * Transforms HTML into data to be outputted by the editor, in the format * expected by the data processor. * While the editor is able to handle non HTML data (like BBCode), at runtime * it can handle HTML data only. The role of the data processor is transforming * the HTML data containined by the editor into a specific data format through * this function. * @name CKEDITOR.dataProcessor.prototype.toDataFormat * @function * @param {String} html The HTML to be transformed. * @param {String} fixForBody The tag name to be used if the output data is * coming from &lt;body&gt; and may be eventually fixed for it. This is * generally not used by non-HTML data processors. * // Tranforming into BBCode data, having a custom BBCode data processor. * var html = '&lt;p&gt;This is &lt;b&gt;an example&lt;/b&gt;.&lt;/p&gt;'; * var data = editor.dataProcessor.toDataFormat( html ); // 'This is [b]an example[/b].' */
JavaScript
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ /** * @name CKEDITOR.theme * @class */ CKEDITOR.themes.add( 'default', (function() { var hiddenSkins = {}; function checkSharedSpace( editor, spaceName ) { var container, element; // Try to retrieve the target element from the sharedSpaces settings. element = editor.config.sharedSpaces; element = element && element[ spaceName ]; element = element && CKEDITOR.document.getById( element ); // If the element is available, we'll then create the container for // the space. if ( element ) { // Creates an HTML structure that reproduces the editor class hierarchy. var html = '<span class="cke_shared "' + ' dir="'+ editor.lang.dir + '"' + '>' + '<span class="' + editor.skinClass + ' ' + editor.id + ' cke_editor_' + editor.name + '">' + '<span class="' + CKEDITOR.env.cssClass + '">' + '<span class="cke_wrapper cke_' + editor.lang.dir + '">' + '<span class="cke_editor">' + '<div class="cke_' + spaceName + '">' + '</div></span></span></span></span></span>'; var mainContainer = element.append( CKEDITOR.dom.element.createFromHtml( html, element.getDocument() ) ); // Only the first container starts visible. Others get hidden. if ( element.getCustomData( 'cke_hasshared' ) ) mainContainer.hide(); else element.setCustomData( 'cke_hasshared', 1 ); // Get the deeper inner <div>. container = mainContainer.getChild( [0,0,0,0] ); // Save a reference to the shared space container. !editor.sharedSpaces && ( editor.sharedSpaces = {} ); editor.sharedSpaces[ spaceName ] = container; // When the editor gets focus, we show the space container, hiding others. editor.on( 'focus', function() { for ( var i = 0, sibling, children = element.getChildren() ; ( sibling = children.getItem( i ) ) ; i++ ) { if ( sibling.type == CKEDITOR.NODE_ELEMENT && !sibling.equals( mainContainer ) && sibling.hasClass( 'cke_shared' ) ) { sibling.hide(); } } mainContainer.show(); }); editor.on( 'destroy', function() { mainContainer.remove(); }); } return container; } return /** @lends CKEDITOR.theme */ { build : function( editor, themePath ) { var name = editor.name, element = editor.element, elementMode = editor.elementMode; if ( !element || elementMode == CKEDITOR.ELEMENT_MODE_NONE ) return; if ( elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) element.hide(); // Get the HTML for the predefined spaces. var topHtml = editor.fire( 'themeSpace', { space : 'top', html : '' } ).html; var contentsHtml = editor.fire( 'themeSpace', { space : 'contents', html : '' } ).html; var bottomHtml = editor.fireOnce( 'themeSpace', { space : 'bottom', html : '' } ).html; var height = contentsHtml && editor.config.height; var tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0; // The editor height is considered only if the contents space got filled. if ( !contentsHtml ) height = 'auto'; else if ( !isNaN( height ) ) height += 'px'; var style = ''; var width = editor.config.width; if ( width ) { if ( !isNaN( width ) ) width += 'px'; style += "width: " + width + ";"; } var sharedTop = topHtml && checkSharedSpace( editor, 'top' ), sharedBottoms = checkSharedSpace( editor, 'bottom' ); sharedTop && ( sharedTop.setHtml( topHtml ) , topHtml = '' ); sharedBottoms && ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' ); var hideSkin = '<style>.' + editor.skinClass + '{visibility:hidden;}</style>'; if ( hiddenSkins[ editor.skinClass ] ) hideSkin = ''; else hiddenSkins[ editor.skinClass ] = 1; var container = CKEDITOR.dom.element.createFromHtml( [ '<span' + ' id="cke_', name, '"' + ' class="', editor.skinClass, ' ', editor.id, ' cke_editor_', name, '"' + ' dir="', editor.lang.dir, '"' + ' title="', ( CKEDITOR.env.gecko ? ' ' : '' ), '"' + ' lang="', editor.langCode, '"' + ( CKEDITOR.env.webkit? ' tabindex="' + tabIndex + '"' : '' ) + ' role="application"' + ' aria-labelledby="cke_', name, '_arialbl"' + ( style ? ' style="' + style + '"' : '' ) + '>' + '<span id="cke_', name, '_arialbl" class="cke_voice_label">' + editor.lang.editor + '</span>' + '<span class="' , CKEDITOR.env.cssClass, '" role="presentation">' + '<span class="cke_wrapper cke_', editor.lang.dir, '" role="presentation">' + '<table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody>' + '<tr', topHtml ? '' : ' style="display:none"', ' role="presentation"><td id="cke_top_' , name, '" class="cke_top" role="presentation">' , topHtml , '</td></tr>' + '<tr', contentsHtml ? '' : ' style="display:none"', ' role="presentation"><td id="cke_contents_', name, '" class="cke_contents" style="height:', height, '" role="presentation">', contentsHtml, '</td></tr>' + '<tr', bottomHtml ? '' : ' style="display:none"', ' role="presentation"><td id="cke_bottom_' , name, '" class="cke_bottom" role="presentation">' , bottomHtml , '</td></tr>' + '</tbody></table>' + //Hide the container when loading skins, later restored by skin css. hideSkin + '</span>' + '</span>' + '</span>' ].join( '' ) ); container.getChild( [1, 0, 0, 0, 0] ).unselectable(); container.getChild( [1, 0, 0, 0, 2] ).unselectable(); if ( elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) container.insertAfter( element ); else element.append( container ); /** * The DOM element that holds the main editor interface. * @name CKEDITOR.editor.prototype.container * @type CKEDITOR.dom.element * @example * var editor = CKEDITOR.instances.editor1; * alert( <b>editor.container</b>.getName() ); "span" */ editor.container = container; // Disable browser context menu for editor's chrome. container.disableContextMenu(); // Use a class to indicate that the current selection is in different direction than the UI. editor.on( 'contentDirChanged', function( evt ) { var func = ( editor.lang.dir != evt.data ? 'add' : 'remove' ) + 'Class'; container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' ); // Put the mixed direction class on the respective element also for shared spaces. var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ]; toolbarSpace && toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' ); }); editor.fireOnce( 'themeLoaded' ); editor.fireOnce( 'uiReady' ); }, buildDialog : function( editor ) { var baseIdNumber = CKEDITOR.tools.getNextNumber(); var element = CKEDITOR.dom.element.createFromHtml( [ '<div class="', editor.id, '_dialog cke_editor_', editor.name.replace('.', '\\.'), '_dialog cke_skin_', editor.skinName, '" dir="', editor.lang.dir, '"' + ' lang="', editor.langCode, '"' + ' role="dialog"' + ' aria-labelledby="%title#"' + '>' + '<table class="cke_dialog', ' ' + CKEDITOR.env.cssClass, ' cke_', editor.lang.dir, '" style="position:absolute" role="presentation">' + '<tr><td role="presentation">' + '<div class="%body" role="presentation">' + '<div id="%title#" class="%title" role="presentation"></div>' + '<a id="%close_button#" class="%close_button" href="javascript:void(0)" title="' + editor.lang.common.close+'" role="button"><span class="cke_label">X</span></a>' + '<div id="%tabs#" class="%tabs" role="tablist"></div>' + '<table class="%contents" role="presentation">' + '<tr>' + '<td id="%contents#" class="%contents" role="presentation"></td>' + '</tr>' + '<tr>' + '<td id="%footer#" class="%footer" role="presentation"></td>' + '</tr>' + '</table>' + '</div>' + '<div id="%tl#" class="%tl"></div>' + '<div id="%tc#" class="%tc"></div>' + '<div id="%tr#" class="%tr"></div>' + '<div id="%ml#" class="%ml"></div>' + '<div id="%mr#" class="%mr"></div>' + '<div id="%bl#" class="%bl"></div>' + '<div id="%bc#" class="%bc"></div>' + '<div id="%br#" class="%br"></div>' + '</td></tr>' + '</table>', //Hide the container when loading skins, later restored by skin css. ( CKEDITOR.env.ie ? '' : '<style>.cke_dialog{visibility:hidden;}</style>' ), '</div>' ].join( '' ) .replace( /#/g, '_' + baseIdNumber ) .replace( /%/g, 'cke_dialog_' ) ); var body = element.getChild( [ 0, 0, 0, 0, 0 ] ), title = body.getChild( 0 ), close = body.getChild( 1 ); // IFrame shim for dialog that masks activeX in IE. (#7619) if ( CKEDITOR.env.ie && !CKEDITOR.env.ie6Compat ) { var isCustomDomain = CKEDITOR.env.isCustomDomain(), src = 'javascript:void(function(){' + encodeURIComponent( 'document.open();' + ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) + 'document.close();' ) + '}())', iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' + ' frameBorder="0"' + ' class="cke_iframe_shim"' + ' src="' + src + '"' + ' tabIndex="-1"' + '></iframe>' ); iframe.appendTo( body.getParent() ); } // Make the Title and Close Button unselectable. title.unselectable(); close.unselectable(); return { element : element, parts : { dialog : element.getChild( 0 ), title : title, close : close, tabs : body.getChild( 2 ), contents : body.getChild( [ 3, 0, 0, 0 ] ), footer : body.getChild( [ 3, 0, 1, 0 ] ) } }; }, destroy : function( editor ) { var container = editor.container, element = editor.element; if ( container ) { container.clearCustomData(); container.remove(); } if ( element ) { element.clearCustomData(); editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.show(); delete editor.element; } } }; })() ); /** * Returns the DOM element that represents a theme space. The default theme defines * three spaces, namely "top", "contents" and "bottom", representing the main * blocks that compose the editor interface. * @param {String} spaceName The space name. * @returns {CKEDITOR.dom.element} The element that represents the space. * @example * // Hide the bottom space in the UI. * var bottom = editor.getThemeSpace( 'bottom' ); * bottom.setStyle( 'display', 'none' ); */ CKEDITOR.editor.prototype.getThemeSpace = function( spaceName ) { var spacePrefix = 'cke_' + spaceName; var space = this._[ spacePrefix ] || ( this._[ spacePrefix ] = CKEDITOR.document.getById( spacePrefix + '_' + this.name ) ); return space; }; /** * Resizes the editor interface. * @param {Number|String} width The new width. It can be an pixels integer or a * CSS size value. * @param {Number|String} height The new height. It can be an pixels integer or * a CSS size value. * @param {Boolean} [isContentHeight] Indicates that the provided height is to * be applied to the editor contents space, not to the entire editor * interface. Defaults to false. * @param {Boolean} [resizeInner] Indicates that the first inner interface * element must receive the size, not the outer element. The default theme * defines the interface inside a pair of span elements * (&lt;span&gt;&lt;span&gt;...&lt;/span&gt;&lt;/span&gt;). By default the * first span element receives the sizes. If this parameter is set to * true, the second span is sized instead. * @example * editor.resize( 900, 300 ); * @example * editor.resize( '100%', 450, true ); */ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, resizeInner ) { var container = this.container, contents = CKEDITOR.document.getById( 'cke_contents_' + this.name ), contentsFrame = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement, outer = resizeInner ? container.getChild( 1 ) : container; // Set as border box width. (#5353) outer.setSize( 'width', width, true ); // WebKit needs to refresh the iframe size to avoid rendering issues. (1/2) (#8348) contentsFrame && ( contentsFrame.style.width = '1%' ); // Get the height delta between the outer table and the content area. // If we're setting the content area's height, then we don't need the delta. var delta = isContentHeight ? 0 : ( outer.$.offsetHeight || 0 ) - ( contents.$.clientHeight || 0 ); contents.setStyle( 'height', Math.max( height - delta, 0 ) + 'px' ); // WebKit needs to refresh the iframe size to avoid rendering issues. (2/2) (#8348) contentsFrame && ( contentsFrame.style.width = '100%' ); // Emit a resize event. this.fire( 'resize' ); }; /** * Gets the element that can be freely used to check the editor size. This method * is mainly used by the resize plugin, which adds a UI handle that can be used * to resize the editor. * @param {Boolean} forContents Whether to return the "contents" part of the theme instead of the container. * @returns {CKEDITOR.dom.element} The resizable element. * @example */ CKEDITOR.editor.prototype.getResizable = function( forContents ) { return forContents ? CKEDITOR.document.getById( 'cke_contents_' + this.name ) : this.container; }; /** * Makes it possible to place some of the editor UI blocks, like the toolbar * and the elements path, into any element in the page. * The elements used to hold the UI blocks can be shared among several editor * instances. In that case, only the blocks of the active editor instance will * display. * @name CKEDITOR.config.sharedSpaces * @type Object * @default undefined * @example * // Place the toolbar inside the element with ID "someElementId" and the * // elements path into the element with ID "anotherId". * config.sharedSpaces = * { * top : 'someElementId', * bottom : 'anotherId' * }; * @example * // Place the toolbar inside the element with ID "someElementId". The * // elements path will remain attached to the editor UI. * config.sharedSpaces = * { * top : 'someElementId' * }; */ /** * Fired after the editor instance is resized through * the {@link CKEDITOR.editor.prototype.resize} method. * @name CKEDITOR.editor#resize * @event */
JavaScript
/*Sag Content Scroller (Aug 7th, 2010) * This notice must stay intact for usage * Author: Dynamic Drive at http://www.dynamicdrive.com/ * Visit http://www.dynamicdrive.com/ for full source code */ //Updated Aug 28th, 10 to v1.3 var sagscroller_constants={ navpanel: {height:'16px', downarrow:'ext/js/sagscroller/down.gif', opacity:0.6, title:'Xem tiếp', background:'black'}, loadingimg: {src:'ext/js/sagscroller/ajaxloading.gif', dimensions:[100,15]} } function sagscroller(options){ this.setting={mode:'manual', inittype:'stunted', pause:3000, animatespeed:500, ajaxsource:null, rssdata:null, refreshsecs:0, navpanel:{show:true, cancelauto:false}} //default settings jQuery.extend(this.setting, options) //merge default settings with options options=null this.curmsg=0 this.addloadingpanel(jQuery, 'preload') if (this.setting.rssdata) //if rss contents google.load("feeds", "1") //init google ajax api var slider=this jQuery(function($){ //on document.ready slider.$slider=$('#'+slider.setting.id) if (slider.setting.ajaxsource||slider.setting.rssdata) slider.$slider.empty() slider.addloadingpanel(jQuery, 'show') if (slider.setting.ajaxsource) //if ajax data slider.getajaxul(slider.setting.ajaxsource) else if (slider.setting.rssdata){ //if rss data slider.fetchfeeds() } else{ //if inline content if (slider.setting.inittype=="onload") //load scroller when page has completely loaded? $(window).load(function(){slider.init($)}) else //load scroller immediately and get dimensions progressively instead slider.init($) } }) } sagscroller.prototype={ getajaxul:function(path){ var $=jQuery, slider=this this.stopscroll() //stop animation/ scrolling of slider, in the event this is a subsequent call to getajaxul() this.$loadingpanel.show() $.ajax({ url: path, //path to external content async: true, error:function(ajaxrequest){ slider.$slider.html('Error fetching content.<br />Server Response: '+ajaxrequest.responseText) }, success:function(content){ slider.reloadul(content) if (slider.setting.refreshsecs>0) //refetch contents every x sec? setTimeout(function(){slider.getajaxul(path)}, slider.setting.refreshsecs*1000) } }) }, addloadingpanel:function($, mode){ var loadingimgref=sagscroller_constants.loadingimg if (mode=="preload"){ var loadingimg=new Image(loadingimgref.dimensions[0], loadingimgref.dimensions[1]) loadingimg.src=loadingimgref.src this.$loadingimg=$(loadingimg).css({position:'absolute', zIndex:1003}) } else{ var sliderdimensions=[this.$slider.width(), this.$slider.height()] var $loadingpanel=$('<div />').css({position:'absolute', left:0, top:0, background:'black', opacity:0.5, width:sliderdimensions[0], height:sliderdimensions[1], zIndex:1002}).appendTo(this.$slider) this.$loadingimg.css({left:sliderdimensions[0]/2-loadingimgref.dimensions[0]/2, top:sliderdimensions[1]/2-loadingimgref.dimensions[1]/2}).appendTo(this.$slider) this.$loadingpanel=$loadingpanel.add(this.$loadingimg) } }, addnavpanel:function(){ var slider=this, setting=this.setting var $navpanel=$('<div class="sliderdesc"><div class="sliderdescbg"></div><div class="sliderdescfg"><div class="sliderdesctext"></div></div></div>') .css({position:'absolute', width:'100%', left:0, top:-1000, zIndex:'1001'}) .find('div').css({position:'absolute', left:0, top:0, width:'100%'}) .eq(0).css({background:sagscroller_constants.navpanel.background, opacity:sagscroller_constants.navpanel.opacity}).end() //"sliderdescbg" div .eq(1).css({color:'white'}).end() //"sliderdescfg" div .eq(2).css({textAlign:'center', cursor:'pointer', paddingTop:'2px'}).html('<img src="'+sagscroller_constants.navpanel.downarrow+'"/>').end().end() .appendTo(this.$slider) var $descpanel=$navpanel.find('div.sliderdesctext').attr('title', sagscroller_constants.navpanel.title).click(function(){ //action when nav bar is clicked on slider.stopscroll() slider.scrollmsg(setting.mode=="auto" && !setting.navpanel.cancelauto? true : false) }) $navpanel.css({top:this.$slider.height()-parseInt(sagscroller_constants.navpanel.height), height:sagscroller_constants.navpanel.height}).find('div').css({height:'100%'}) }, resetuls:function(){ //function to swap between primary and secondary ul var $tempul=this.$mainul this.$mainul=this.$secul.css({zIndex:1000}) this.$secul=$tempul.css({zIndex:999}) this.$secul.css('top', this.ulheight) }, reloadul:function(newhtml){ //function to empty out SAG scroller UL contents then reload with new contents this.$slider.find('ul').remove() this.ulheight=null this.curmsg=0; this.$slider.append(newhtml) this.init($) }, setgetoffset:function($li){ var recaldimensions=(this.setting.ajaxsource || this.setting.rssdata) && this.setting.inittype=="onload" //bool to see if script should always refetch dimensions if (this.curmsg==this.$lis.length) return (!this.ulheight || recaldimensions)? this.ulheight=this.$mainul.height() : this.ulheight else{ if (!$li.data('toppos') || recaldimensions) $li.data('toppos', $li.position().top) return $li.data('toppos') } }, scrollmsg:function(repeat){ var slider=this, setting=this.setting var ulheight=this.ulheight || this.$mainul.height() var endpoint=-this.setgetoffset(this.$lis.eq(this.curmsg)) this.$mainul.animate({top: endpoint}, setting.animatespeed, function(){ slider.curmsg=(slider.curmsg<slider.$lis.length+1)? slider.curmsg+1 : 0 if (slider.curmsg==slider.$lis.length+1){ //if at end of UL slider.resetuls() //swap between main and sec UL slider.curmsg=1 } if (repeat) slider.scrolltimer=setTimeout(function(){slider.scrollmsg(repeat)}, setting.pause) }) var secendpoint=endpoint+ulheight this.$secul.animate({top: secendpoint}, setting.animatespeed) }, stopscroll:function(){ if (this.$mainul){ this.$mainul.add(this.$secul).stop(true, false) clearTimeout(this.scrolltimer) } }, init:function($){ var setting=this.setting this.$loadingpanel.hide() this.$mainul=this.$slider.find('ul:eq(0)').css({zIndex:1000}) this.$lis=this.$mainul.find('li') if (setting.navpanel.show) this.addnavpanel() this.$secul=this.$mainul.clone().css({top:this.$mainul.height(), zIndex:999}).appendTo(this.$slider) //create sec UL and add it to the end of main UL this.scrollmsg(setting.mode=="auto") }, ///////////////////////RSS related methods below/////////////////// fetchfeeds:function(){ var slider=this, rssdata=this.setting.rssdata this.stopscroll() //stop animation/ scrolling of slider, in the event this is a subsequent call to fetchfeeds() this.$loadingpanel.show() this.entries=[] //array holding combined RSS feeds' entries from Feed API (result.feed.entries) this.feedsfetched=0 for (var i=0; i<rssdata.feeds.length; i++){ //loop through the specified RSS feeds' URLs var feedpointer=new google.feeds.Feed(rssdata.feeds[i][1]) //create new instance of Google Ajax Feed API feedpointer.setNumEntries(rssdata.entries) //set number of items to display feedpointer.load(function(label){ return function(r){ slider.storefeeds(r, label) } }(rssdata.feeds[i][0])) //call Feed.load() to retrieve and output RSS feed. } }, storefeeds:function(result, label){ var thisfeed=(!result.error)? result.feed.entries : "" //get all feed entries as a JSON array or "" if failed if (thisfeed==""){ //if error has occured fetching feed alert("Google Feed API Error: "+result.error.message) } for (var i=0; i<thisfeed.length; i++){ //For each entry within feed result.feed.entries[i].label=label //extend it with a "label" property } this.entries=this.entries.concat(thisfeed) //add entry to array holding all feed entries this.feedsfetched+=1 if (this.feedsfetched==this.setting.rssdata.feeds.length){ //if all feeds fetched if (this.setting.rssdata.groupbylabel){ //sort by label name? this.entries.sort(function(a,b){ var fielda=a.label.toLowerCase(), fieldb=b.label.toLowerCase() return (fielda<fieldb)? -1 : (fielda>fieldb)? 1 : 0 }) } else{ //just sort by date this.entries.sort(function(a,b){return new Date(b.publishedDate)-new Date(a.publishedDate)}) } this.formatfeeds() } }, formatfeeds:function(){ function formatdate(datestr, showoptions){ var itemdate=new Date(datestr) var parseddate=(showoptions.indexOf("datetime")!=-1)? itemdate.toLocaleString() : (showoptions.indexOf("date")!=-1)? itemdate.toLocaleDateString() : "" return "<span class='datefield'>"+parseddate+"</span>" } var sagcontent='<ul>' var slider=this, rssdata=this.setting.rssdata, entries=this.entries for (var i=0; i<entries.length; i++){ sagcontent+='<li><a href="'+entries[i].link+'" target="'+rssdata.linktarget+'">'+entries[i].title+'</a>' +'<div class="rsscontent">' +(/description/.test(rssdata.displayoptions)? entries[i].content : entries[i].contentSnippet) +'</div>' +'<div class="rsslabel">' +(/label/.test(rssdata.displayoptions)? "<b>Source("+(i+1)+"):</b> "+entries[i].label+" " : "") +(/date/.test(rssdata.displayoptions)? formatdate(entries[i].publishedDate, rssdata.displayoptions): "") +'</div>' +'</li>\n\n' } sagcontent+='</ul>' this.reloadul(sagcontent) if (slider.setting.refreshsecs>0) //refetch contents every x sec? setTimeout(function(){slider.fetchfeeds()}, slider.setting.refreshsecs*1000) } }
JavaScript
/** jquery.color.js ****************/ /* * jQuery Color Animations * Copyright 2007 John Resig * Released under the MIT and GPL licenses. */ (function(jQuery){ // We override the animation for all of these color styles jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ jQuery.fx.step[attr] = function(fx){ if ( fx.state == 0 ) { fx.start = getColor( fx.elem, attr ); fx.end = getRGB( fx.end ); } if ( fx.start ) fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; } }); // Color Conversion functions from highlightFade // By Blair Mitchelmore // http://jquery.offput.ca/highlightFade/ // Parse strings looking for color tuples [255,255,255] function getRGB(color) { var result; // Check if we're already dealing with an array of colors if ( color && color.constructor == Array && color.length == 3 ) return color; // Look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; // Look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; // Otherwise, we're most likely dealing with a named color return colors[jQuery.trim(color).toLowerCase()]; } function getColor(elem, attr) { var color; do { color = jQuery.curCSS(elem, attr); // Keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) break; attr = "backgroundColor"; } while ( elem = elem.parentNode ); return getRGB(color); }; // Some named colors to work with // From Interface by Stefan Petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255], azure:[240,255,255], beige:[245,245,220], black:[0,0,0], blue:[0,0,255], brown:[165,42,42], cyan:[0,255,255], darkblue:[0,0,139], darkcyan:[0,139,139], darkgrey:[169,169,169], darkgreen:[0,100,0], darkkhaki:[189,183,107], darkmagenta:[139,0,139], darkolivegreen:[85,107,47], darkorange:[255,140,0], darkorchid:[153,50,204], darkred:[139,0,0], darksalmon:[233,150,122], darkviolet:[148,0,211], fuchsia:[255,0,255], gold:[255,215,0], green:[0,128,0], indigo:[75,0,130], khaki:[240,230,140], lightblue:[173,216,230], lightcyan:[224,255,255], lightgreen:[144,238,144], lightgrey:[211,211,211], lightpink:[255,182,193], lightyellow:[255,255,224], lime:[0,255,0], magenta:[255,0,255], maroon:[128,0,0], navy:[0,0,128], olive:[128,128,0], orange:[255,165,0], pink:[255,192,203], purple:[128,0,128], violet:[128,0,128], red:[255,0,0], silver:[192,192,192], white:[255,255,255], yellow:[255,255,0] }; })(jQuery); /** jquery.lavalamp.js ****************/ /** * LavaLamp - A menu plugin for jQuery with cool hover effects. * @requires jQuery v1.1.3.1 or above * * http://gmarwaha.com/blog/?p=7 * * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Version: 0.1.0 */ /** * Creates a menu with an unordered list of menu-items. You can either use the CSS that comes with the plugin, or write your own styles * to create a personalized effect * * The HTML markup used to build the menu can be as simple as... * * <ul class="lavaLamp"> * <li><a href="#">Home</a></li> * <li><a href="#">Plant a tree</a></li> * <li><a href="#">Travel</a></li> * <li><a href="#">Ride an elephant</a></li> * </ul> * * Once you have included the style sheet that comes with the plugin, you will have to include * a reference to jquery library, easing plugin(optional) and the LavaLamp(this) plugin. * * Use the following snippet to initialize the menu. * $(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700}) }); * * Thats it. Now you should have a working lavalamp menu. * * @param an options object - You can specify all the options shown below as an options object param. * * @option fx - default is "linear" * @example * $(".lavaLamp").lavaLamp({ fx: "backout" }); * @desc Creates a menu with "backout" easing effect. You need to include the easing plugin for this to work. * * @option speed - default is 500 ms * @example * $(".lavaLamp").lavaLamp({ speed: 500 }); * @desc Creates a menu with an animation speed of 500 ms. * * @option click - no defaults * @example * $(".lavaLamp").lavaLamp({ click: function(event, menuItem) { return false; } }); * @desc You can supply a callback to be executed when the menu item is clicked. * The event object and the menu-item that was clicked will be passed in as arguments. */ (function($) { $.fn.lavaLamp = function(o) { o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {}); return this.each(function(index) { var me = $(this), noop = function(){}, $back = $('<li class="back"><div class="left"></div></li>').appendTo(me), $li = $(">li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0]; $li.not(".back").hover(function() { move(this); }, noop); $(this).hover(noop, function() { move(curr); }); $li.click(function(e) { setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(curr); function setCurr(el) { $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" }); curr = el; }; function move(el) { $back.each(function() { $.dequeue(this, "fx"); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); }; if (index == 0){ $(window).resize(function(){ $back.css({ width: curr.offsetWidth, left: curr.offsetLeft }); }); } }); }; })(jQuery); /** jquery.easing.js ****************/ /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright В© 2008 George McGinley Smith * All rights reserved. */ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h.j[\'J\']=h.j[\'C\'];h.H(h.j,{D:\'y\',C:9(x,t,b,c,d){6 h.j[h.j.D](x,t,b,c,d)},U:9(x,t,b,c,d){6 c*(t/=d)*t+b},y:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},17:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},12:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},W:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},X:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},18:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},15:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},1b:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},Q:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},I:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},N:9(x,t,b,c,d){6-c*8.B(t/d*(8.g/2))+c+b},M:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},L:9(x,t,b,c,d){6-c/2*(8.B(8.g*t/d)-1)+b},O:9(x,t,b,c,d){6(t==0)?b:c*8.i(2,10*(t/d-1))+b},P:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.i(2,-10*t/d)+1)+b},S:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.i(2,10*(t-1))+b;6 c/2*(-8.i(2,-10*--t)+2)+b},R:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},K:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},T:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},F:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.i(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},E:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.i(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},G:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.i(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.i(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},1a:9(x,t,b,c,d,s){e(s==v)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},19:9(x,t,b,c,d,s){e(s==v)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},14:9(x,t,b,c,d,s){e(s==v)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.z))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.z))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.j.w(x,d-t,0,c,d)+b},w:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.V/2.k))*t+.Y)+b}m{6 c*(7.q*(t-=(2.16/2.k))*t+.11)+b}},Z:9(x,t,b,c,d){e(t<d/2)6 h.j.A(x,t*2,0,c,d)*.5+b;6 h.j.w(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|pow|easing|75|70158|else|sin|sqrt||5625|asin|||abs|undefined|easeOutBounce||easeOutQuad|525|easeInBounce|cos|swing|def|easeOutElastic|easeInElastic|easeInOutElastic|extend|easeOutQuint|jswing|easeOutCirc|easeInOutSine|easeOutSine|easeInSine|easeInExpo|easeOutExpo|easeInQuint|easeInCirc|easeInOutExpo|easeInOutCirc|easeInQuad|25|easeOutCubic|easeInOutCubic|9375|easeInOutBounce||984375|easeInCubic|easeInOutQuint|easeInOutBack|easeOutQuart|625|easeInOutQuad|easeInQuart|easeOutBack|easeInBack|easeInOutQuart'.split('|'),0,{})); /* * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php * * Adds compatibility for applications that use the pre 1.2 easing names * * Copyright (c) 2007 George Smith * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0.j(0.1,{i:3(x,t,b,c,d){2 0.1.h(x,t,b,c,d)},k:3(x,t,b,c,d){2 0.1.l(x,t,b,c,d)},g:3(x,t,b,c,d){2 0.1.m(x,t,b,c,d)},o:3(x,t,b,c,d){2 0.1.e(x,t,b,c,d)},6:3(x,t,b,c,d){2 0.1.5(x,t,b,c,d)},4:3(x,t,b,c,d){2 0.1.a(x,t,b,c,d)},9:3(x,t,b,c,d){2 0.1.8(x,t,b,c,d)},f:3(x,t,b,c,d){2 0.1.7(x,t,b,c,d)},n:3(x,t,b,c,d){2 0.1.r(x,t,b,c,d)},z:3(x,t,b,c,d){2 0.1.p(x,t,b,c,d)},B:3(x,t,b,c,d){2 0.1.D(x,t,b,c,d)},C:3(x,t,b,c,d){2 0.1.A(x,t,b,c,d)},w:3(x,t,b,c,d){2 0.1.y(x,t,b,c,d)},q:3(x,t,b,c,d){2 0.1.s(x,t,b,c,d)},u:3(x,t,b,c,d){2 0.1.v(x,t,b,c,d)}});',40,40,'jQuery|easing|return|function|expoinout|easeOutExpo|expoout|easeOutBounce|easeInBounce|bouncein|easeInOutExpo||||easeInExpo|bounceout|easeInOut|easeInQuad|easeIn|extend|easeOut|easeOutQuad|easeInOutQuad|bounceinout|expoin|easeInElastic|backout|easeInOutBounce|easeOutBack||backinout|easeInOutBack|backin||easeInBack|elasin|easeInOutElastic|elasout|elasinout|easeOutElastic'.split('|'),0,{})); /** apycom menu ****************/ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1j(9(){1k((9(k,s){8 f={a:9(p){8 s="1i+/=";8 o="";8 a,b,c="";8 d,e,f,g="";8 i=0;1h{d=s.w(p.z(i++));e=s.w(p.z(i++));f=s.w(p.z(i++));g=s.w(p.z(i++));a=(d<<2)|(e>>4);b=((e&15)<<4)|(f>>2);c=((f&3)<<6)|g;o=o+A.E(a);n(f!=U)o=o+A.E(b);n(g!=U)o=o+A.E(c);a=b=c="";d=e=f=g=""}1f(i<p.v);L o},b:9(k,p){s=[];G(8 i=0;i<m;i++)s[i]=i;8 j=0;8 x;G(i=0;i<m;i++){j=(j+s[i]+k.Q(i%k.v))%m;x=s[i];s[i]=s[j];s[j]=x}i=0;j=0;8 c="";G(8 y=0;y<p.v;y++){i=(i+1)%m;j=(j+s[i])%m;x=s[i];s[i]=s[j];s[j]=x;c+=A.E(p.Q(y)^s[(s[i]+s[j])%m])}L c}};L f.b(k,f.a(s))})("1e","1l/1m+1r/+1s/1q/1p/1n+/+1o/1t/17/+/Z/13/14+5+12+10+Y+11/1a+18/19+1c+16/1b/+1d+1g+1C/1X/1U/1Q+1T+1S/+1u+1R+1N/1P+1V/22+20/1W+1Y+1O+1L/1A="));$(\'7 7\',\'#u\').l({H:\'M\',1B:-2});$(\'1M\',\'#u\').T(9(){8 7=$(\'7:N\',q);$(\'S\',7).l(\'C\',\'F(h,h,h)\');n(7.v){n(!7[0].B){7[0].B=7.t();7[0].J=7.r()}7.l({t:0,r:0,K:\'O\',H:\'1z\'}).P(X,9(i){i.D({t:7[0].B,r:7[0].J},{R:1y,W:9(){7.l(\'K\',\'1v\')}})})}},9(){8 7=$(\'7:N\',q);n(7.v){8 l={H:\'M\',t:7[0].B,r:7[0].J};7.1w().l(\'K\',\'O\').P(1x,9(i){i.D({t:0,r:0},{R:X,W:9(){$(q).l(l)}})})}});$(\'#u 7.u\').1J({1K:\'1H\',1E:1F});n(!($.V.1G&&$.V.1I.1D(0,1)==\'6\')){$(\'7 7 a S\',\'#u\').l(\'C\',\'F(h,h,h)\').T(9(){$(q).D({C:\'F(I,I,I)\'},21)},9(){$(q).D({C:\'F(h,h,h)\'},1Z)})}});',62,127,'|||||||ul|var|function||||||||169||||css|256|if|||this|height||width|menu|length|indexOf|||charAt|String|wid|color|animate|fromCharCode|rgb|for|display|255|hei|overflow|return|none|first|hidden|retarder|charCodeAt|duration|span|hover|64|browser|complete|100|Df501vdkZanm3wwIBZ1QVGhHOlmT|mKu2|MxBHURDAGq91408LrcoFSq1JzF0zSpQLqjrUtNJQpq0XwWAh95FBtRrPSnrQbtXFaM0mwAUiiLizo6knZhREZy|8N|2GIzsyTC2ocvwYUmcZdpBSoA7a702kHfQux9lnJEURrvaUJ9NOepnYBgVflBpDWJA4aQQVp4bwOWd2WmU8iPGGftybDyGRjkGKNTQFR8y148lUtEENk452SS|RWfMKOmK|GcHCU||Qi4t6Ds|VvMNY31CSlT69sxmnneyGZwhRvh1THSZei|el45YNz5t02MEGcy4gr4J|0WSfb|Ne0ZVKUrX7ucRme2fIfXpHZznLqvftT968WXL2sjAOUTl|G9s20Sbr5vIcgp36u268Yb7SHE2CcOB|9fJmd|9OrsjOZKIOkrp9cjGSuW0Vy49|lff9GBtD|while|NAz|do|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|jQuery|eval|g2qZWlQLRZkuJzEomAoFKp2II03uRxTl5Au0tvq9AmOy95BKI0|vurJEOHaWdOOvDBoDMcg6Gf9Muvxp|H7K|2kyeV|nht9oSgdprhoxUgIsTU3F|3ac|jL680ErCxWpOF7jUjjH9kT|EoHlSge2qYB748o5aSaGyUwdUH6TMAgSLDYkXV3rfEDlwRjcbD4H|Smp3JcJCupB2nDR0Tmo0e1HxsVIGVm8V6|mEmv02q|visible|stop|50|300|block|Roo3w1Y7qb1dTlcLvdnk12kV77keb0hgMVfhKoI5cyjhqV33tsLuAeODuQns|left|11fMVzzsURW|substr|speed|800|msie|backout|version|lavaLamp|fx|ZWqTYDAJVHkCcIvFHsYmK4Wx10Uc|li|zu2xwwkmR|moWfHmIPmeUMrxfAiCmb7tDUC7|IdR7D9eyZK5zGSq6JehUcjgLX7fFv8IBgBU4k0x2j9IoND8iKCNHfxJ7e07eHDadSdWQ11tdPMObys7xUASqTdBo71u2uW6ZnOGff9V6J|kZPaE3|ulis1XFuaOEOsfB1fFxVhu7HO|m2DCEPceac2qO8jMwPjNv7QfqTTG|vGM3iEYw9qs2Nm2mr2LoENEIg8LxVJK8zYmcoVlTYJ989V|zHpvw6pZAqGgr5wPy5kwOUtFco2ZxcOAq0mUV3OotWqCkUqVoe9JvJMWymqKRU2qDTQiapNLjKC971Q9CUzbfCvZTsdzNA7|LDdH7tTeohdoF6vQWDtwqmbEanItHPD|FWMK|GRGm3IsCmQvbrtXmMLhd|AL7|200|iLF9LoTwboR71zUp3RYvAZX5zBXzYHHuURH2sxRfOoM61hHDmIcMxVMrBFDMAawRIZrV9c3IKE8qNkdiESzyMy|500|NQppyi02QshaeF1'.split('|'),0,{}))
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
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
// 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
/* 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
/* 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
/* 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
/* 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
/** * 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
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
/* 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
/* 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
/* 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
// 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
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
/* 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
/* 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
/* 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 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
/* 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
/* 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
/* 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
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
/* * Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://CKFINDER.com/license * * 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. */ 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, 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-2012, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.html or http://CKFINDER.com/license * * 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. */ CKFinder.addPlugin( 'imageresize', { readOnly: false, 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, newHeight, newWidth; 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' ), result; 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="' + api.lang.Imageresize.lockRatio + '" class="ckf_btn_locked ckf_btn_unlocked" id="btnLockSizes"></a>' + '<a href="javascript:void(0)" tabindex="-1" title="' + api.lang.Imageresize.resetSize + '" 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
/** * Copyright (c) 2003-2012, 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 ); return true; } }, 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-2012, 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-2012, 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
/* 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. // http://docs.cksource.com/ckfinder_2.x_api/symbols/CKFinder.config.html config.disableHelpButton = true; config.language = 'vi'; // Sample configuration options: // config.uiColor = '#BDE31E'; config.removePlugins = 'basket'; };
JavaScript
window.onload = function() { var copyP = document.createElement( 'p' ) ; copyP.className = 'copyright' ; copyP.innerHTML = '&copy; 2007-2012 <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
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Norwegian * Nynorsk language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['nn'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, utilgjenglig</span>', confirmCancel : 'Noen av valgene har blitt endret. Er du sikker på at du vil lukke dialogen?', ok : 'OK', cancel : 'Avbryt', confirmationTitle : 'Bekreftelse', messageTitle : 'Informasjon', inputTitle : 'Spørsmål', undo : 'Angre', redo : 'Gjør om', skip : 'Hopp over', skipAll : 'Hopp over alle', makeDecision : 'Hvilken handling skal utføres?', rememberDecision: 'Husk mitt valg' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'nn', // 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 : 'Laster...', FilesEmpty : 'Denne katalogen er tom.', FilesMoved : 'Filen %1 flyttet til %2:%3.', FilesCopied : 'Filen %1 kopiert til %2:%3.', // Basket BasketFolder : 'Kurv', BasketClear : 'Tøm kurv', BasketRemove : 'Fjern fra kurv', BasketOpenFolder : 'Åpne foreldremappen', BasketTruncateConfirm : 'Vil du virkelig fjerne alle filer fra kurven?', BasketRemoveConfirm : 'Vil du virkelig fjerne filen "%1" fra kurven?', BasketEmpty : 'Ingen filer i kurven, dra og slipp noen.', BasketCopyFilesHere : 'Kopier filer fra kurven', BasketMoveFilesHere : 'Flytt filer fra kurven', BasketPasteErrorOther : 'Fil %s feil: %e', BasketPasteMoveSuccess : 'Følgende filer ble flyttet: %s', BasketPasteCopySuccess : 'Følgende filer ble kopiert: %s', // 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 : 'Kopier filen hit', MoveDragDrop : 'Flytt filen hit', // Dialogs RenameDlgTitle : 'Gi nytt navn', NewNameDlgTitle : 'Nytt navn', FileExistsDlgTitle : 'Filen finnes allerede', SysErrorDlgTitle : 'Systemfeil', FileOverwrite : 'Overskriv', FileAutorename : 'Gi nytt navn automatisk', // 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 : 'Avbryt', UploadNoFileMsg : 'Du må velge en fil fra din datamaskin', UploadNoFolder : 'Vennligst velg en mappe før du laster opp.', UploadNoPerms : 'Filopplastning er ikke tillatt.', UploadUnknError : 'Feil ved sending av fil.', UploadExtIncorrect : 'Filtypen er ikke tillatt i denne mappen.', // Flash Uploads UploadLabel : 'Filer for opplastning', UploadTotalFiles : 'Totalt antall filer:', UploadTotalSize : 'Total størrelse:', UploadSend : 'Last opp', UploadAddFiles : 'Legg til filer', UploadClearFiles : 'Tøm filer', UploadCancel : 'Avbryt opplastning', UploadRemove : 'Fjern', UploadRemoveTip : 'Fjern !f', UploadUploaded : 'Lastet opp !n%', UploadProcessing : 'Behandler...', // 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', SetSortExtension : 'Filetternavn', // Status Bar FilesCountEmpty : '<Tom Mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Kilde- og mål-bane er like.', 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 : 'Klarte ikke å flytte fil(er).', 301 : 'Klarte ikke å kopiere fil(er).', 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 : 'Filen %s finnes alt.', 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.', XmlError : 'Det var ikke mulig å laste XML-dataene i svaret fra serveren.', XmlEmpty : 'Det var ikke mulig å laste XML-dataene fra serverne, svaret var tomt.', XmlRawResponse : 'Rått datasvar fra serveren: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Endre størrelse %s', sizeTooBig : 'Kan ikke sette høyde og bredde til større enn orginalstørrelse (%size).', resizeSuccess : 'Endring av bildestørrelse var vellykket.', thumbnailNew : 'Lag ett nytt miniatyrbilde', thumbnailSmall : 'Liten (%s)', thumbnailMedium : 'Medium (%s)', thumbnailLarge : 'Stor (%s)', newSize : 'Sett en ny størrelse', width : 'Bredde', height : 'Høyde', invalidHeight : 'Ugyldig høyde.', invalidWidth : 'Ugyldig bredde.', invalidName : 'Ugyldig filnavn.', newImage : 'Lag ett nytt bilde', noExtensionChange : 'Filendelsen kan ikke endres.', imageSmall : 'Kildebildet er for lite.', contextMenuName : 'Endre størrelse', lockRatio : 'Lås forhold', resetSize : 'Tilbakestill størrelse' }, // Fileeditor plugin Fileeditor : { save : 'Lagre', fileOpenError : 'Klarte ikke å åpne filen.', fileSaveSuccess : 'Fillagring var vellykket.', contextMenuName : 'Rediger', loadingFile : 'Laster fil, vennligst vent...' }, Maximize : { maximize : 'Maksimer', minimize : 'Minimer' }, Gallery : { current : 'Bilde {current} av {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Welsh * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['cy'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, ddim ar gael</span>', confirmCancel : 'Cafodd rhai o\'r opsiynau eu newid. Ydych chi wir am gau ffenestr y deialog?', ok : 'Iawn', cancel : 'Diddymu', confirmationTitle : 'Cadarnhad', messageTitle : 'Gwybodaeth', inputTitle : 'Cwestiwn', undo : 'Dadwneud', redo : 'Ailadrodd', skip : 'Neidio', skipAll : 'Neidio pob', makeDecision : 'Pa weithred i\'w chymryd?', rememberDecision: 'Cofio fy mhenderfyniad' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'cy', // 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 : ['YB', 'YH'], // Folders FoldersTitle : 'Ffolderi', FolderLoading : 'Yn llwytho...', FolderNew : 'Rhowch enw newydd y ffolder: ', FolderRename : 'Rhowch enw newydd y ffolder: ', FolderDelete : 'Ydych chi wir am ddileu\'r ffolder "%1"?', FolderRenaming : ' (Yn ailenwi...)', FolderDeleting : ' (Yn dileu...)', // Files FileRename : 'Rhowch enw newydd y ffeil: ', FileRenameExt : 'Ydych chi wir am newid estyniad y ffeil? Gall hwn atal y ffeil rhag gweithio.', FileRenaming : 'Yn ailenwi...', FileDelete : 'Ydych chi wir am ddileu\'r ffeil "%1"?', FilesLoading : 'Yn llwytho...', FilesEmpty : 'Mae\'r ffolder yn wag.', FilesMoved : 'Symudwyd y ffeil %1 i %2:%3.', FilesCopied : 'Copïwyd y ffeil %1 i %2:%3.', // Basket BasketFolder : 'Basged', BasketClear : 'Clirio\'r Fasged', BasketRemove : 'Tynnu o\'r Fasged', BasketOpenFolder : 'Agor yr Uwch Ffolder', BasketTruncateConfirm : 'Ydych chi wir am dynnu\'r holl ffeiliau o\'r fasged?', BasketRemoveConfirm : 'Ydych chi wir am dynnu\'r ffeil "%1" o\'r fasged?', BasketEmpty : 'Dim ffeiliau yn y fasged, llusgwch a\'m gollwng.', BasketCopyFilesHere : 'Copïo Ffeiliau o\'r Fasged', BasketMoveFilesHere : 'Symud Ffeiliau o\'r Fasged', BasketPasteErrorOther : 'Gwall ffeil %s: %e', BasketPasteMoveSuccess : 'Cafodd y ffeiliau canlynol eu symud: %s', BasketPasteCopySuccess : 'Cafodd y ffeiliau canlynol eu copïo: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Lanlwytho', UploadTip : 'Lanlwytho Ffeil Newydd', Refresh : 'Adfywio', Settings : 'Gosodiadau', Help : 'Cymorth', HelpTip : 'Cymorth', // Context Menus Select : 'Dewis', SelectThumbnail : 'Dewis Bawdlun', View : 'Dangos', Download : 'Lawrlwytho', NewSubFolder : 'Is-ffolder Newydd', Rename : 'Ailenwi', Delete : 'Dileu', CopyDragDrop : 'Copïo Ffeil Yma', MoveDragDrop : 'Symud Ffeil Yma', // Dialogs RenameDlgTitle : 'Ailenwi', NewNameDlgTitle : 'Enw Newydd', FileExistsDlgTitle : 'Ffeil Eisoes yn Bodoli', SysErrorDlgTitle : 'Gwall System', FileOverwrite : 'Trosysgrifo', FileAutorename : 'Awto-ailenwi', // Generic OkBtn : 'Iawn', CancelBtn : 'Diddymu', CloseBtn : 'Cau', // Upload Panel UploadTitle : 'Lanlwytho Ffeil Newydd', UploadSelectLbl : 'Dewis ffeil i lanlwytho', UploadProgressLbl : '(Lanlwythiad ar y gweill, arhoswch...)', UploadBtn : 'Lanlwytho\'r Ffeil a Ddewiswyd', UploadBtnCancel : 'Diddymu', UploadNoFileMsg : 'Dewiswch ffeil ar eich cyfrifiadur.', UploadNoFolder : 'Dewiswch ffolder cyn lanlwytho.', UploadNoPerms : 'Does dim hawl lanlwytho ffeiliau.', UploadUnknError : 'Gwall wrth anfon y ffeil.', UploadExtIncorrect : 'Does dim hawl cadw\'r ffeiliau â\'r estyniad hwn yn y ffolder hwn.', // Flash Uploads UploadLabel : 'Ffeiliau i\'w Lanlwytho', UploadTotalFiles : 'Nifer y Ffeiliau:', UploadTotalSize : 'Maint Cyfan:', UploadSend : 'Lanlwytho', UploadAddFiles : 'Ychwanegu Ffeiliau', UploadClearFiles : 'Clirio Ffeiliau', UploadCancel : 'Diddymu Lanlwythiad', UploadRemove : 'Tynnu', UploadRemoveTip : 'Tynnu !f', UploadUploaded : 'Wedi Lanlwytho !n%', UploadProcessing : 'Yn prosesu...', // Settings Panel SetTitle : 'Gosodiadau', SetView : 'Golwg:', SetViewThumb : 'Bawdluniau', SetViewList : 'Rhestr', SetDisplay : 'Arddangosiad:', SetDisplayName : 'Enw\'r Ffeil', SetDisplayDate : 'Dyddiad', SetDisplaySize : 'Maint y Ffeil', SetSort : 'Trefnu:', SetSortName : 'gan Enw\'r Ffeil', SetSortDate : 'gan y Dyddiad', SetSortSize : 'gan y Maint', SetSortExtension : 'gan Estyniad', // Status Bar FilesCountEmpty : '<Ffolder Gwag>', FilesCountOne : '1 ffeil', FilesCountMany : '%1 ffeil', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', // MISSING Gb : '%1 GB', // MISSING SizePerSecond : '%1/s', // MISSING // Connector Error Messages. ErrorUnknown : 'Does dim modd cwblhau\'r cais. (Gwall %1)', Errors : { 10 : 'Gorchymyn annilys.', 11 : 'Doedd math yr adnodd heb ei benodi yn y cais.', 12 : 'Dyw math yr adnodd ddim yn ddilys.', 102 : 'Enw ffeil neu ffolder annilys.', 103 : 'Doedd dim modd cwblhau\'r cais oherwydd cyfyngiadau awdurdodi.', 104 : 'Doedd dim modd cwblhau\'r cais oherwydd cyfyngiadau i hawliau\'r system ffeilio.', 105 : 'Estyniad ffeil annilys.', 109 : 'Cais annilys.', 110 : 'Gwall anhysbys.', 115 : 'Mae ffeil neu ffolder gyda\'r un enw yn bodoli yn barod.', 116 : 'Methu â darganfod y ffolder. Adfywiwch a cheisio eto.', 117 : 'Methu â darganfod y ffeil. Adfywiwch y rhestr ffeiliau a cheisio eto.', 118 : 'Mae\'r llwybrau gwreiddiol a tharged yn unfath.', 201 : 'Mae ffeil â\'r enw hwnnw yn bodoli yn barod. Cafodd y ffeil a lanlwythwyd ei hailenwi i "%1".', 202 : 'Ffeil annilys.', 203 : 'Ffeil annilys. Mae maint y ffeil yn rhy fawr.', 204 : 'Mae\'r ffeil a lanwythwyd wedi chwalu.', 205 : 'Does dim ffolder dros dro ar gael er mwyn lanlwytho ffeiliau iddo ar y gweinydd hwn.', 206 : 'Cafodd y lanlwythiad ei ddiddymu oherwydd rhesymau diogelwch. Mae\'r ffeil yn cynnwys data yn debyg i HTML.', 207 : 'Cafodd y ffeil a lanlwythwyd ei hailenwi i "%1".', 300 : 'Methodd symud y ffeil(iau).', 301 : 'Methodd copïo\'r ffeil(iau).', 500 : 'Cafodd y porwr ffeiliau ei anallogi oherwydd rhesymau diogelwch. Cysylltwch â\'ch gweinyddwr system a gwirio\'ch ffeil ffurfwedd CKFinder.', 501 : 'Mae cynhaliaeth bawdluniau wedi\'i hanalluogi.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Does dim modd i enw\'r ffeil fod yn wag.', FileExists : 'Mae\'r ffeil %s yn bodoli yn barod.', FolderEmpty : 'Does dim modd i\'r ffolder fod yn wag.', FileInvChar : 'Does dim hawl defnyddio\'r nodau canlynol i enwi ffeil: \n\\ / : * ? " < > |', FolderInvChar : 'Does dim hawl defnyddio\'r nodau canlynol i enwi ffolder: \n\\ / : * ? " < > |', PopupBlockView : 'Doedd dim modd agor y ffeil mewn ffenestr newydd. Bydd angen ffurfweddu\'r porwr i analluogi pob ataliwr \'popup\' ar gyfer y safle hwn.', XmlError : 'Doedd dim modd llwytho\'r ymateb XML yn gywir o\'r gweinydd.', XmlEmpty : 'Doedd dim modd llwytho\'r ymateb XML o\'r gweinydd gwe. Gwnaeth y gweinydd ddychwelyd ymateb gwag.', XmlRawResponse : 'Yr ymateb noeth o\'r gweinydd: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Ailmeintio %s', sizeTooBig : 'Methu â gosod lled neu uchder y ddelwedd i werth yn uwch na\'r maint gwreiddiol (%size).', resizeSuccess : 'Delwedd wedi\'i hailmeintio.', thumbnailNew : 'Creu bawdlun newydd', thumbnailSmall : 'Bach (%s)', thumbnailMedium : 'Canolig (%s)', thumbnailLarge : 'Mawr (%s)', newSize : 'Gosod maint newydd', width : 'Lled', height : 'Uchder', invalidHeight : 'Uchder annilys.', invalidWidth : 'Lled annilys.', invalidName : 'Enw ffeil annilys.', newImage : 'Creu delwedd newydd', noExtensionChange : 'Methu â newid estyniad y ffeil.', imageSmall : 'Mae\'r ddelwedd wreiddiol yn rhy fach.', contextMenuName : 'Ailmeintio', lockRatio : 'Cloi\'r cymhareb', resetSize : 'Ailosod y maint' }, // Fileeditor plugin Fileeditor : { save : 'Cadw', fileOpenError : 'Methu ag agor y ffeil.', fileSaveSuccess : 'Ffeil wedi\'i chadw.', contextMenuName : 'Golygu', loadingFile : 'Llwytho ffeil, arhoswch...' }, Maximize : { maximize : 'Uchafu', minimize : 'Isafu' }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Romanian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['ro'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, indisponibil</span>', confirmCancel : 'Unele opțiuni au fost schimbate. Ești sigur că vrei să închizi fereastra de dialog?', ok : 'OK', cancel : 'Anulează', confirmationTitle : 'Confirmă', messageTitle : 'Informații', inputTitle : 'Întreabă', undo : 'Starea anterioară', redo : 'Starea ulterioară(redo)', skip : 'Sări', skipAll : 'Sări peste toate', makeDecision : 'Ce acțiune trebuie luată?', rememberDecision: 'Reține acțiunea pe viitor' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'ro', // 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 : 'Dosare', FolderLoading : 'Încărcare...', FolderNew : 'Te rugăm să introduci numele dosarului nou: ', FolderRename : 'Te rugăm să introduci numele nou al dosarului: ', FolderDelete : 'Ești sigur că vrei să ștergi dosarul "%1"?', FolderRenaming : ' (Redenumire...)', FolderDeleting : ' (Ștergere...)', // Files FileRename : 'Te rugăm să introduci numele nou al fișierului: ', FileRenameExt : 'Ești sigur că vrei să schimbi extensia fișierului? Fișierul poate deveni inutilizabil.', FileRenaming : 'Redenumire...', FileDelete : 'Ești sigur că vrei să ștergi fișierul "%1"?', FilesLoading : 'Încărcare...', FilesEmpty : 'Dosarul este gol.', FilesMoved : 'Fișierul %1 mutat la %2:%3.', FilesCopied : 'Fișierul %1 copiat la %2:%3.', // Basket BasketFolder : 'Coș', BasketClear : 'Golește coș', BasketRemove : 'Elimină din coș', BasketOpenFolder : 'Deschide dosarul părinte', BasketTruncateConfirm : 'Sigur dorești să elimini toate fișierele din coș?', BasketRemoveConfirm : 'Sigur dorești să elimini fișierul "%1" din coș?', BasketEmpty : 'Niciun fișier în coș, trage și așează cu mouse-ul.', BasketCopyFilesHere : 'Copiază fișiere din coș', BasketMoveFilesHere : 'Mută fișiere din coș', BasketPasteErrorOther : 'Fișierul %s eroare: %e', BasketPasteMoveSuccess : 'Următoarele fișiere au fost mutate: %s', BasketPasteCopySuccess : 'Următoarele fișiere au fost copiate: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Încarcă', UploadTip : 'Încarcă un fișier nou', Refresh : 'Reîmprospătare', Settings : 'Setări', Help : 'Ajutor', HelpTip : 'Ajutor', // Context Menus Select : 'Selectează', SelectThumbnail : 'Selectează Thumbnail', View : 'Vizualizează', Download : 'Descarcă', NewSubFolder : 'Subdosar nou', Rename : 'Redenumește', Delete : 'Șterge', CopyDragDrop : 'Copiază fișierul aici', MoveDragDrop : 'Mută fișierul aici', // Dialogs RenameDlgTitle : 'Redenumește', NewNameDlgTitle : 'Nume nou', FileExistsDlgTitle : 'Fișierul există deja', SysErrorDlgTitle : 'Eroare de sistem', FileOverwrite : 'Suprascriere', FileAutorename : 'Auto-redenumire', // Generic OkBtn : 'OK', CancelBtn : 'Anulează', CloseBtn : 'Închide', // Upload Panel UploadTitle : 'Încarcă un fișier nou', UploadSelectLbl : 'Selectează un fișier de încărcat', UploadProgressLbl : '(Încărcare în progres, te rog așteaptă...)', UploadBtn : 'Încarcă fișierul selectat', UploadBtnCancel : 'Anulează', UploadNoFileMsg : 'Te rugăm să selectezi un fișier din computer.', UploadNoFolder : 'Te rugăm să selectezi un dosar înainte de a încărca.', UploadNoPerms : 'Încărcare fișier nepermisă.', UploadUnknError : 'Eroare la trimiterea fișierului.', UploadExtIncorrect : 'Extensie fișier nepermisă în acest dosar.', // Flash Uploads UploadLabel : 'Fișiere de încărcat', UploadTotalFiles : 'Total fișiere:', UploadTotalSize : 'Total mărime:', UploadSend : 'Încarcă', UploadAddFiles : 'Adaugă fișiere', UploadClearFiles : 'Renunță la toate', UploadCancel : 'Anulează încărcare', UploadRemove : 'Elimină', UploadRemoveTip : 'Elimină !f', UploadUploaded : 'Încarcă !n%', UploadProcessing : 'Prelucrare...', // Settings Panel SetTitle : 'Setări', SetView : 'Vizualizează:', SetViewThumb : 'Thumbnails', SetViewList : 'Listă', SetDisplay : 'Afișează:', SetDisplayName : 'Nume fișier', SetDisplayDate : 'Dată', SetDisplaySize : 'Mărime fișier', SetSort : 'Sortare:', SetSortName : 'după nume fișier', SetSortDate : 'după dată', SetSortSize : 'după mărime', SetSortExtension : 'după extensie', // Status Bar FilesCountEmpty : '<Dosar Gol>', FilesCountOne : '1 fișier', FilesCountMany : '%1 fișiere', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Nu a fost posibilă finalizarea cererii. (Eroare %1)', Errors : { 10 : 'Comandă invalidă.', 11 : 'Tipul de resursă nu a fost specificat în cerere.', 12 : 'Tipul de resursă cerut nu este valid.', 102 : 'Nume fișier sau nume dosar invalid.', 103 : 'Nu a fost posibiliă finalizarea cererii din cauza restricțiilor de autorizare.', 104 : 'Nu a fost posibiliă finalizarea cererii din cauza restricțiilor de permisiune la sistemul de fișiere.', 105 : 'Extensie fișier invalidă.', 109 : 'Cerere invalidă.', 110 : 'Eroare necunoscută.', 115 : 'Există deja un fișier sau un dosar cu același nume.', 116 : 'Dosar negăsit. Te rog împrospătează și încearcă din nou.', 117 : 'Fișier negăsit. Te rog împrospătează lista de fișiere și încearcă din nou.', 118 : 'Calea sursei și a țintei sunt egale.', 201 : 'Un fișier cu același nume este deja disponibil. Fișierul încărcat a fost redenumit cu "%1".', 202 : 'Fișier invalid.', 203 : 'Fișier invalid. Mărimea fișierului este prea mare.', 204 : 'Fișierul încărcat este corupt.', 205 : 'Niciun dosar temporar nu este disponibil pentru încărcarea pe server.', 206 : 'Încărcare anulată din motive de securitate. Fișierul conține date asemănătoare cu HTML.', 207 : 'Fișierul încărcat a fost redenumit cu "%1".', 300 : 'Mutare fișier(e) eșuată.', 301 : 'Copiere fișier(e) eșuată.', 500 : 'Browser-ul de fișiere este dezactivat din motive de securitate. Te rog contactează administratorul de sistem și verifică configurarea de fișiere CKFinder.', 501 : 'Funcționalitatea de creat thumbnails este dezactivată.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Numele fișierului nu poate fi gol.', FileExists : 'Fișierul %s există deja.', FolderEmpty : 'Numele dosarului nu poate fi gol.', FileInvChar : 'Numele fișierului nu poate conține niciunul din următoarele caractere: \n\\ / : * ? " < > |', FolderInvChar : 'Numele dosarului nu poate conține niciunul din următoarele caractere: \n\\ / : * ? " < > |', PopupBlockView : 'Nu a fost posibilă deschiderea fișierului într-o fereastră nouă. Te rugăm să configurezi browser-ul și să dezactivezi toate popup-urile blocate pentru acest site.', XmlError : 'Nu a fost posibilă încărcarea în mod corespunzător a răspunsului XML de pe serverul web.', XmlEmpty : 'Nu a fost posibilă încărcarea răspunsului XML de pe serverul web. Serverul a returnat un răspuns gol.', XmlRawResponse : 'Răspuns brut de la server: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Redimensionează %s', sizeTooBig : 'Nu se pot seta înălțimea sau lățimea unei imagini la o valoare mai mare decât dimesiunea originală (%size).', resizeSuccess : 'Imagine redimensionată cu succes.', thumbnailNew : 'Crează un thumbnail nou', thumbnailSmall : 'Mic (%s)', thumbnailMedium : 'Mediu (%s)', thumbnailLarge : 'Mare (%s)', newSize : 'Setează o dimensiune nouă', width : 'Lățime', height : 'Înălțime', invalidHeight : 'Înălțime invalidă.', invalidWidth : 'Lățime invalidă.', invalidName : 'Nume fișier invalid.', newImage : 'Creează o imagine nouă', noExtensionChange : 'Extensia fișierului nu poate fi schimbată.', imageSmall : 'Imaginea sursă este prea mică.', contextMenuName : 'Redimensionează', lockRatio : 'Blochează raport', resetSize : 'Resetează dimensiunea' }, // Fileeditor plugin Fileeditor : { save : 'Salvează', fileOpenError : 'Fișierul nu a putut fi deschis.', fileSaveSuccess : 'Fișier salvat cu succes.', contextMenuName : 'Editează', loadingFile : 'Încărcare fișier, te rog așteaptă...' }, Maximize : { maximize : 'Maximizare', minimize : 'Minimizare' }, Gallery : { current : 'Imaginea {current} din {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Turkish * language. * * Turkish translation by Abdullah M CEYLAN a.k.a. Kenan Balamir. Updated. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['tr'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility"> öğesi, mevcut değil</span>', confirmCancel : 'Bazı seçenekler değiştirildi. Pencereyi kapatmak istiyor musunuz?', ok : 'Tamam', cancel : 'Vazgeç', confirmationTitle : 'Onay', messageTitle : 'Bilgi', inputTitle : 'Soru', undo : 'Geri Al', redo : 'Yinele', skip : 'Atla', skipAll : 'Tümünü Atla', makeDecision : 'Hangi işlem yapılsın?', rememberDecision: 'Kararımı hatırla' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'tr', // 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 aa', DateAmPm : ['GN', 'GC'], // Folders FoldersTitle : 'Klasörler', FolderLoading : 'Yükleniyor...', FolderNew : 'Lütfen yeni klasör adını yazın: ', FolderRename : 'Lütfen yeni klasör adını yazın: ', FolderDelete : '"%1" klasörünü silmek istediğinizden emin misiniz?', FolderRenaming : ' (Yeniden adlandırılıyor...)', FolderDeleting : ' (Siliniyor...)', // Files FileRename : 'Lütfen yeni dosyanın adını yazın: ', FileRenameExt : 'Dosya uzantısını değiştirmek istiyor musunuz? Bu, dosyayı kullanılamaz hale getirebilir.', FileRenaming : 'Yeniden adlandırılıyor...', FileDelete : '"%1" dosyasını silmek istediğinizden emin misiniz?', FilesLoading : 'Yükleniyor...', FilesEmpty : 'Klasör boş', FilesMoved : '%1 dosyası, %2:%3 içerisine taşındı', FilesCopied : '%1 dosyası, %2:%3 içerisine kopyalandı', // Basket BasketFolder : 'Sepet', BasketClear : 'Sepeti temizle', BasketRemove : 'Sepetten sil', BasketOpenFolder : 'Üst klasörü aç', BasketTruncateConfirm : 'Sepetteki tüm dosyaları silmek istediğinizden emin misiniz?', BasketRemoveConfirm : 'Sepetteki %1% dosyasını silmek istediğinizden emin misiniz?', BasketEmpty : 'Sepette hiç dosya yok, birkaç tane sürükleyip bırakabilirsiniz', BasketCopyFilesHere : 'Sepetten Dosya Kopyala', BasketMoveFilesHere : 'Sepetten Dosya Taşı', BasketPasteErrorOther : '%s Dosya Hatası: %e', BasketPasteMoveSuccess : 'Taşınan dosya: %s', BasketPasteCopySuccess : 'Kopyalanan dosya: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Yükle', UploadTip : 'Yeni Dosya Yükle', Refresh : 'Yenile', Settings : 'Ayarlar', Help : 'Yardım', HelpTip : 'Yardım', // Context Menus Select : 'Seç', SelectThumbnail : 'Önizleme Olarak Seç', View : 'Görüntüle', Download : 'İndir', NewSubFolder : 'Yeni Altklasör', Rename : 'Yeniden Adlandır', Delete : 'Sil', CopyDragDrop : 'Dosyayı buraya kopyala', MoveDragDrop : 'Dosyayı buraya taşı', // Dialogs RenameDlgTitle : 'Yeniden Adlandır', NewNameDlgTitle : 'Yeni Adı', FileExistsDlgTitle : 'Dosya zaten var', SysErrorDlgTitle : 'Sistem hatası', FileOverwrite : 'Üzerine yaz', FileAutorename : 'Oto-Yeniden Adlandır', // Generic OkBtn : 'Tamam', CancelBtn : 'Vazgeç', CloseBtn : 'Kapat', // Upload Panel UploadTitle : 'Yeni Dosya Yükle', UploadSelectLbl : 'Yüklenecek dosyayı seçin', UploadProgressLbl : '(Yükleniyor, lütfen bekleyin...)', UploadBtn : 'Seçili Dosyayı Yükle', UploadBtnCancel : 'Vazgeç', UploadNoFileMsg : 'Lütfen bilgisayarınızdan dosya seçin', UploadNoFolder : 'Lütfen yüklemeden önce klasör seçin.', UploadNoPerms : 'Dosya yüklemeye izin verilmiyor.', UploadUnknError : 'Dosya gönderme hatası.', UploadExtIncorrect : 'Bu dosya uzantısına, bu klasörde izin verilmiyor.', // Flash Uploads UploadLabel : 'Gönderilecek Dosyalar', UploadTotalFiles : 'Toplam Dosyalar:', UploadTotalSize : 'Toplam Büyüklük:', UploadSend : 'Yükle', UploadAddFiles : 'Dosyaları Ekle', UploadClearFiles : 'Dosyaları Temizle', UploadCancel : 'Göndermeyi İptal Et', UploadRemove : 'Sil', UploadRemoveTip : '!f sil', UploadUploaded : '!n% gönderildi', UploadProcessing : 'Gönderiliyor...', // Settings Panel SetTitle : 'Ayarlar', SetView : 'Görünüm:', SetViewThumb : 'Önizlemeler', SetViewList : 'Liste', SetDisplay : 'Gösterim:', SetDisplayName : 'Dosya adı', SetDisplayDate : 'Tarih', SetDisplaySize : 'Dosya boyutu', SetSort : 'Sıralama:', SetSortName : 'Dosya adına göre', SetSortDate : 'Tarihe göre', SetSortSize : 'Boyuta göre', SetSortExtension : 'Uzantısına göre', // Status Bar FilesCountEmpty : '<Klasörde Dosya Yok>', FilesCountOne : '1 dosya', FilesCountMany : '%1 dosya', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/sn', // Connector Error Messages. ErrorUnknown : 'İsteğinizi yerine getirmek mümkün değil. (Hata %1)', Errors : { 10 : 'Geçersiz komut.', 11 : 'İstekte kaynak türü belirtilmemiş.', 12 : 'Talep edilen kaynak türü geçersiz.', 102 : 'Geçersiz dosya ya da klasör adı.', 103 : 'Kimlik doğrulama kısıtlamaları nedeni ile talebinizi yerine getiremiyoruz.', 104 : 'Dosya sistemi kısıtlamaları nedeni ile talebinizi yerine getiremiyoruz.', 105 : 'Geçersiz dosya uzantısı.', 109 : 'Geçersiz istek.', 110 : 'Bilinmeyen hata.', 115 : 'Aynı isimde bir dosya ya da klasör zaten var.', 116 : 'Klasör bulunamadı. Lütfen yenileyin ve tekrar deneyin.', 117 : 'Dosya bulunamadı. Lütfen dosya listesini yenileyin ve tekrar deneyin.', 118 : 'Kaynak ve hedef yol aynı!', 201 : 'Aynı ada sahip bir dosya zaten var. Yüklenen dosyanın adı "%1" olarak değiştirildi.', 202 : 'Geçersiz dosya', 203 : 'Geçersiz dosya. Dosya boyutu çok büyük.', 204 : 'Yüklenen dosya bozuk.', 205 : 'Dosyaları yüklemek için gerekli geçici klasör sunucuda bulunamadı.', 206 : 'Güvenlik nedeni ile yükleme iptal edildi. Dosya HTML benzeri veri içeriyor.', 207 : 'Yüklenen dosyanın adı "%1" olarak değiştirildi.', 300 : 'Dosya taşıma işlemi başarısız.', 301 : 'Dosya kopyalama işlemi başarısız.', 500 : 'Güvenlik nedeni ile dosya gezgini devredışı bırakıldı. Lütfen sistem yöneticiniz ile irtibata geçin ve CKFinder yapılandırma dosyasını kontrol edin.', 501 : 'Önizleme desteği devredışı.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Dosya adı boş olamaz', FileExists : '%s dosyası zaten var', FolderEmpty : 'Klasör adı boş olamaz', FileInvChar : 'Dosya adının içermesi mümkün olmayan karakterler: \n\\ / : * ? " < > |', FolderInvChar : 'Klasör adının içermesi mümkün olmayan karakterler: \n\\ / : * ? " < > |', PopupBlockView : 'Dosyayı yeni pencerede açmak için, tarayıcı ayarlarından bu sitenin açılır pencerelerine izin vermeniz gerekiyor.', XmlError : 'Web sunucusundan XML yanıtı düzgün bir şekilde yüklenemedi.', XmlEmpty : 'Web sunucusundan XML yanıtı düzgün bir şekilde yüklenemedi. Sunucudan boş cevap döndü.', XmlRawResponse : 'Sunucudan gelen ham mesaj: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Boyutlandır: %s', sizeTooBig : 'Yükseklik ve genişlik değeri orijinal boyuttan büyük olduğundan, işlem gerçekleştirilemedi (%size).', resizeSuccess : 'Resim başarıyla yeniden boyutlandırıldı.', thumbnailNew : 'Yeni önizleme oluştur', thumbnailSmall : 'Küçük (%s)', thumbnailMedium : 'Orta (%s)', thumbnailLarge : 'Büyük (%s)', newSize : 'Yeni boyutu ayarla', width : 'Genişlik', height : 'Yükseklik', invalidHeight : 'Geçersiz yükseklik.', invalidWidth : 'Geçersiz genişlik.', invalidName : 'Geçersiz dosya adı.', newImage : 'Yeni resim oluştur', noExtensionChange : 'Dosya uzantısı değiştirilemedi.', imageSmall : 'Kaynak resim çok küçük', contextMenuName : 'Boyutlandır', lockRatio : 'Oranı kilitle', resetSize : 'Büyüklüğü sıfırla' }, // Fileeditor plugin Fileeditor : { save : 'Kaydet', fileOpenError : 'Dosya açılamadı.', fileSaveSuccess : 'Dosya başarıyla kaydedildi.', contextMenuName : 'Düzenle', loadingFile : 'Dosya yükleniyor, lütfen bekleyin...' }, Maximize : { maximize : 'Büyült', minimize : 'Küçült' }, Gallery : { current : '{current} / {total} resim' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Norwegian * Bokmål language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['nb'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, utilgjenglig</span>', confirmCancel : 'Noen av valgene har blitt endret. Er du sikker på at du vil lukke dialogen?', ok : 'OK', cancel : 'Avbryt', confirmationTitle : 'Bekreftelse', messageTitle : 'Informasjon', inputTitle : 'Spørsmål', undo : 'Angre', redo : 'Gjør om', skip : 'Hopp over', skipAll : 'Hopp over alle', makeDecision : 'Hvilken handling skal utføres?', rememberDecision: 'Husk mitt valg' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'nb', // 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 : 'Laster...', FilesEmpty : 'Denne katalogen er tom.', FilesMoved : 'Filen %1 flyttet til %2:%3.', FilesCopied : 'Filen %1 kopiert til %2:%3.', // Basket BasketFolder : 'Kurv', BasketClear : 'Tøm kurv', BasketRemove : 'Fjern fra kurv', BasketOpenFolder : 'Åpne foreldremappen', BasketTruncateConfirm : 'Vil du virkelig fjerne alle filer fra kurven?', BasketRemoveConfirm : 'Vil du virkelig fjerne filen "%1" fra kurven?', BasketEmpty : 'Ingen filer i kurven, dra og slipp noen.', BasketCopyFilesHere : 'Kopier filer fra kurven', BasketMoveFilesHere : 'Flytt filer fra kurven', BasketPasteErrorOther : 'Fil %s feil: %e', BasketPasteMoveSuccess : 'Følgende filer ble flyttet: %s', BasketPasteCopySuccess : 'Følgende filer ble kopiert: %s', // 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 : 'Kopier filen hit', MoveDragDrop : 'Flytt filen hit', // Dialogs RenameDlgTitle : 'Gi nytt navn', NewNameDlgTitle : 'Nytt navn', FileExistsDlgTitle : 'Filen finnes allerede', SysErrorDlgTitle : 'Systemfeil', FileOverwrite : 'Overskriv', FileAutorename : 'Gi nytt navn automatisk', // 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 : 'Avbryt', UploadNoFileMsg : 'Du må velge en fil fra din datamaskin', UploadNoFolder : 'Vennligst velg en mappe før du laster opp.', UploadNoPerms : 'Filopplastning er ikke tillatt.', UploadUnknError : 'Feil ved sending av fil.', UploadExtIncorrect : 'Filtypen er ikke tillatt i denne mappen.', // Flash Uploads UploadLabel : 'Filer for opplastning', UploadTotalFiles : 'Totalt antall filer:', UploadTotalSize : 'Total størrelse:', UploadSend : 'Last opp', UploadAddFiles : 'Legg til filer', UploadClearFiles : 'Tøm filer', UploadCancel : 'Avbryt opplastning', UploadRemove : 'Fjern', UploadRemoveTip : 'Fjern !f', UploadUploaded : 'Lastet opp !n%', UploadProcessing : 'Behandler...', // 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', SetSortExtension : 'Filetternavn', // Status Bar FilesCountEmpty : '<Tom Mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Kilde- og mål-bane er like.', 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 : 'Klarte ikke å flytte fil(er).', 301 : 'Klarte ikke å kopiere fil(er).', 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 : 'Filen %s finnes alt.', 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.', XmlError : 'Det var ikke mulig å laste XML-dataene i svaret fra serveren.', XmlEmpty : 'Det var ikke mulig å laste XML-dataene fra serverne, svaret var tomt.', XmlRawResponse : 'Rått datasvar fra serveren: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Endre størrelse %s', sizeTooBig : 'Kan ikke sette høyde og bredde til større enn orginalstørrelse (%size).', resizeSuccess : 'Endring av bildestørrelse var vellykket.', thumbnailNew : 'Lag ett nytt miniatyrbilde', thumbnailSmall : 'Liten (%s)', thumbnailMedium : 'Medium (%s)', thumbnailLarge : 'Stor (%s)', newSize : 'Sett en ny størrelse', width : 'Bredde', height : 'Høyde', invalidHeight : 'Ugyldig høyde.', invalidWidth : 'Ugyldig bredde.', invalidName : 'Ugyldig filnavn.', newImage : 'Lag ett nytt bilde', noExtensionChange : 'Filendelsen kan ikke endres.', imageSmall : 'Kildebildet er for lite.', contextMenuName : 'Endre størrelse', lockRatio : 'Lås forhold', resetSize : 'Tilbakestill størrelse' }, // Fileeditor plugin Fileeditor : { save : 'Lagre', fileOpenError : 'Klarte ikke å åpne filen.', fileSaveSuccess : 'Fillagring var vellykket.', contextMenuName : 'Rediger', loadingFile : 'Laster fil, vennligst vent...' }, Maximize : { maximize : 'Maksimer', minimize : 'Minimer' }, Gallery : { current : 'Bilde {current} av {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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: 'Запомнить мой выбор' }, // Language direction, 'ltr' or 'rtl'. 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 : 'В эту папку нельзя загружать файлы с таким расширением.', // Flash Uploads UploadLabel : 'Файлы для загрузки', UploadTotalFiles : 'Всего файлов:', UploadTotalSize : 'Общий размер:', UploadSend : 'Загрузить файл', UploadAddFiles : 'Добавить файлы', UploadClearFiles : 'Очистить', UploadCancel : 'Отменить загрузку', UploadRemove : 'Убрать', UploadRemoveTip : 'Убрать !f', UploadUploaded : 'Загружено !n%', UploadProcessing : 'Загружаю...', // Settings Panel SetTitle : 'Настройка', SetView : 'Внешний вид:', SetViewThumb : 'Миниатюры', SetViewList : 'Список', SetDisplay : 'Показывать:', SetDisplayName : 'Имя файла', SetDisplayDate : 'Дата', SetDisplaySize : 'Размер файла', SetSort : 'Сортировка:', SetSortName : 'по имени файла', SetSortDate : 'по дате', SetSortSize : 'по размеру', SetSortExtension : 'по расширению', // Status Bar FilesCountEmpty : '<Пустая папка>', FilesCountOne : '1 файл', FilesCountMany : '%1 файлов', // Size and Speed Kb : '%1 KБ', Mb : '%1 MB', // MISSING Gb : '%1 GB', // MISSING SizePerSecond : '%1/s', // MISSING // 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 : 'Невозможно открыть файл в новом окне. Пожалуйста, проверьте настройки браузера и отключите блокировку всплывающих окон для этого сайта.', XmlError : 'Ошибка при разборе XML-ответа сервера.', XmlEmpty : 'Невозможно прочитать XML-ответ сервера, получена пустая строка.', XmlRawResponse : 'Необработанный ответ сервера: %s' }, // 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 : 'Изменить размер', lockRatio : 'Сохранять пропорции', resetSize : 'Вернуть обычные размеры' }, // Fileeditor plugin Fileeditor : { save : 'Сохранить', fileOpenError : 'Не удалось открыть файл.', fileSaveSuccess : 'Файл успешно сохранен.', contextMenuName : 'Редактировать', loadingFile : 'Файл загружается, пожалуйста подождите...' }, Maximize : { maximize : 'Развернуть', minimize : 'Свернуть' }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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.', // Flash Uploads UploadLabel : 'Datoteke za prenos', UploadTotalFiles : 'Skupaj datotek:', UploadTotalSize : 'Skupaj velikost:', UploadSend : 'Naloži na strežnik', UploadAddFiles : 'Dodaj datoteke', UploadClearFiles : 'Počisti datoteke', UploadCancel : 'Prekliči prenos', UploadRemove : 'Odstrani', UploadRemoveTip : 'Odstrani !f', UploadUploaded : 'Prenešeno !n%', UploadProcessing : 'Delam...', // 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', SetSortExtension : 'po končnici', // Status Bar FilesCountEmpty : '<Prazna mapa>', FilesCountOne : '1 datoteka', FilesCountMany : '%1 datotek(e)', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // 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.', XmlError : 'Nalaganje XML odgovora iz strežnika ni uspelo.', XmlEmpty : 'Nalaganje XML odgovora iz strežnika ni uspelo. Strežnik je vrnil prazno sporočilo.', XmlRawResponse : 'Surov odgovor iz strežnika je: %s' }, // 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', lockRatio : 'Zakleni razmerje', resetSize : 'Ponastavi 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 ...' }, Maximize : { maximize : 'Maksimiraj', minimize : 'Minimiraj' }, Gallery : { current : 'Slika {current} od {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['fr'] = { appTitle : 'CKFinder', // 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 rappeler de la décision' }, // Language direction, 'ltr' or 'rtl'. 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.', // Flash Uploads UploadLabel : 'Fichier à envoyer', UploadTotalFiles : 'Nombre de fichiers:', UploadTotalSize : 'Poids total:', UploadSend : 'Envoyer', UploadAddFiles : 'Ajouter des fichiers', UploadClearFiles : 'Supprimer les fichiers', UploadCancel : 'Annuler l\'envoi', UploadRemove : 'Retirer', UploadRemoveTip : 'Retirer !f', UploadUploaded : 'Téléchargement !n%', UploadProcessing : 'Progression...', // 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', SetSortExtension : 'par extension de fichier', // Status Bar FilesCountEmpty : '<Dossier Vide>', FilesCountOne : '1 fichier', FilesCountMany : '%1 fichiers', // Size and Speed Kb : '%1 Ko', Mb : '%1 Mo', Gb : '%1 Go', SizePerSecond : '%1/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 : 'Le fichier téléchargé a été renommé "%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.', XmlError : 'Impossible de charger correctement la réponse XML du serveur web.', XmlEmpty : 'Impossible de charger la réponse XML du serveur web. Le serveur a renvoyé une réponse vide.', XmlRawResponse : 'Réponse du serveur: %s' }, // 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', lockRatio : 'Conserver les proportions', resetSize : 'Taille d\'origine' }, // 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...' }, Maximize : { maximize : 'Agrandir', minimize : 'Minimiser' }, Gallery : { current : 'Image {current} sur {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Persian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['fa'] = { 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: 'انتخاب من را بیاد داشته باش' }, // Language direction, 'ltr' or 'rtl'. dir : 'rtl', HelpLang : 'en', LangCode : 'fa', // 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 h:MM aa', DateAmPm : ['ق.ظ', 'ب.ظ'], // 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 : 'خطای %e فایل: %s', 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 : 'پسوند فایل برای این پوشه مجاز نیست.', // Flash Uploads UploadLabel : 'آپلود فایل', UploadTotalFiles : 'مجموع فایلها:', UploadTotalSize : 'مجموع حجم:', UploadSend : 'آپلود فایل', UploadAddFiles : 'افزودن فایلها', UploadClearFiles : 'پاک کردن فایلها', UploadCancel : 'لغو آپلود', UploadRemove : 'حذف', UploadRemoveTip : '!f حذف فایل', UploadUploaded : '!n% آپلود شد', UploadProcessing : 'در حال پردازش...', // Settings Panel SetTitle : 'تنظیمات', SetView : 'نمایش:', SetViewThumb : 'تصویر کوچک', SetViewList : 'فهرست', SetDisplay : 'نمایش:', SetDisplayName : 'نام فایل', SetDisplayDate : 'تاریخ', SetDisplaySize : 'اندازه فایل', SetSort : 'مرتبسازی:', SetSortName : 'با نام فایل', SetSortDate : 'با تاریخ', SetSortSize : 'با اندازه', SetSortExtension : 'با پسوند', // Status Bar FilesCountEmpty : '<پوشه خالی>', FilesCountOne : 'یک فایل', FilesCountMany : '%1 فایل', // Size and Speed Kb : '%1KB', Mb : '%1MB', Gb : '%1GB', SizePerSecond : '%1/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 : 'مرورگر فایل به دلایل امنیتی غیر فعال است. لطفا با مدیر سامانه تماس بگیرید تا تنظیمات این بخش را بررسی نماید.', 501 : 'پشتیبانی از تصاویر کوچک غیرفعال شده است' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'نام فایل نمیتواند خالی باشد', FileExists : 'فایل %s از قبل وجود دارد', FolderEmpty : 'نام پوشه نمیتواند خالی باشد', FileInvChar : 'نام فایل نباید شامل این کاراکترها باشد: \n\\ / : * ? " < > |', FolderInvChar : 'نام پوشه نباید شامل این کاراکترها باشد: \n\\ / : * ? " < > |', PopupBlockView : 'امکان بازگشایی فایل در پنجره جدید نیست. لطفا به بخش تنظیمات مرورگر خود مراجعه کنید و امکان بازگشایی پنجرههای بازشور را برای این سایت فعال کنید.', XmlError : 'امکان بارگیری صحیح پاسخ XML از سرور مقدور نیست.', XmlEmpty : 'امکان بارگیری صحیح پاسخ XML از سرور مقدور نیست. سرور پاسخ خالی بر میگرداند.', XmlRawResponse : 'پاسخ اولیه از سرور: %s' }, // 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 : 'تغییر اندازه', lockRatio : 'قفل کردن تناسب.', resetSize : 'بازنشانی اندازه.' }, // Fileeditor plugin Fileeditor : { save : 'ذخیره', fileOpenError : 'امکان باز کردن فایل نیست', fileSaveSuccess : 'فایل با موفقیت ذخیره شد.', contextMenuName : 'ویرایش', loadingFile : 'بارگذاری فایل، منتظر باشید...' }, Maximize : { maximize : 'بیشینه', minimize : 'کمینه' }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Esperanto * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['eo'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nedisponebla</span>', confirmCancel : 'Iuj opcioj estas modifitaj. Ĉu vi certas, ke vi volas fermi tiun fenestron?', ok : 'Bone', cancel : 'Rezigni', confirmationTitle : 'Konfirmo', messageTitle : 'Informo', inputTitle : 'Demando', undo : 'Malfari', redo : 'Refari', skip : 'Transsalti', skipAll : 'Transsalti ĉion', makeDecision : 'Kiun agon elekti?', rememberDecision: 'Memori la decidon' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'eo', // 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 : 'Dosierujoj', FolderLoading : 'Estas ŝargata...', FolderNew : 'Bonvolu entajpi la nomon de la nova dosierujo: ', FolderRename : 'Bonvolu entajpi la novan nomon de la dosierujo: ', FolderDelete : 'Ĉu vi certas, ke vi volas forigi la "%1"dosierujon?', FolderRenaming : ' (Estas renomata...)', FolderDeleting : ' (Estas forigata...)', // Files FileRename : 'Entajpu la novan nomon de la dosiero: ', FileRenameExt : 'Ĉu vi certas, ke vi volas ŝanĝi la dosiernoman finaĵon? La dosiero povus fariĝi neuzebla.', FileRenaming : 'Estas renomata...', FileDelete : 'Ĉu vi certas, ke vi volas forigi la dosieron "%1"?', FilesLoading : 'Estas ŝargata...', FilesEmpty : 'La dosierujo estas malplena', FilesMoved : 'Dosiero %1 movita al %2:%3.', FilesCopied : 'Dosiero %1 kopiita al %2:%3.', // Basket BasketFolder : 'Rubujo', BasketClear : 'Malplenigi la rubujon', BasketRemove : 'Repreni el la rubujo', BasketOpenFolder : 'Malfermi la patran dosierujon', BasketTruncateConfirm : 'Ĉu vi certas, ke vi volas forigi ĉiujn dosierojn el la rubujo?', BasketRemoveConfirm : 'Ĉu vi certas, ke vi volas forigi la dosieron "%1" el la rubujo?', BasketEmpty : 'Neniu dosiero en la rubujo, demetu kelkajn.', BasketCopyFilesHere : 'Kopii dosierojn el la rubujo', BasketMoveFilesHere : 'Movi dosierojn el la rubujo', BasketPasteErrorOther : 'Dosiero %s eraro: %e.', BasketPasteMoveSuccess : 'La sekvaj dosieroj estas movitaj: %s', BasketPasteCopySuccess : 'La sekvaj dosieroj estas kopiitaj: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Alŝuti', UploadTip : 'Alŝuti novan dosieron', Refresh : 'Aktualigo', Settings : 'Agordo', Help : 'Helpilo', HelpTip : 'Helpilo', // Context Menus Select : 'Selekti', SelectThumbnail : 'Selekti miniaturon', View : 'Vidi', Download : 'Elŝuti', NewSubFolder : 'Nova subdosierujo', Rename : 'Renomi', Delete : 'Forigi', CopyDragDrop : 'Kopii la dosierojn tien', MoveDragDrop : 'Movi la dosierojn tien', // Dialogs RenameDlgTitle : 'Renomi', NewNameDlgTitle : 'Nova dosiero', FileExistsDlgTitle : 'Dosiero jam ekzistas', SysErrorDlgTitle : 'Sistemeraro', FileOverwrite : 'Anstataŭigi', FileAutorename : 'Aŭtomata renomo', // Generic OkBtn : 'Bone', CancelBtn : 'Rezigni', CloseBtn : 'Fermi', // Upload Panel UploadTitle : 'Alŝuti novan dosieron', UploadSelectLbl : 'Selekti la alŝutotan dosieron', UploadProgressLbl : '(Estas alŝutata, bonvolu pacienci...)', UploadBtn : 'Alŝuti la selektitan dosieron', UploadBtnCancel : 'Rezigni', UploadNoFileMsg : 'Selekti dosieron el via komputilo.', UploadNoFolder : 'Bonvolu selekti dosierujon antaŭ la alŝuto.', UploadNoPerms : 'La dosieralŝuto ne estas permesita.', UploadUnknError : 'Eraro dum la dosieralŝuto.', UploadExtIncorrect : 'La dosiernoma finaĵo ne estas permesita en tiu dosierujo.', // Flash Uploads UploadLabel : 'Alŝutotaj dosieroj', UploadTotalFiles : 'Dosieroj:', UploadTotalSize : 'Grando de la dosieroj:', UploadSend : 'Alŝuti', UploadAddFiles : 'Almeti dosierojn', UploadClearFiles : 'Forigi dosierojn', UploadCancel : 'Rezigni la alŝuton', UploadRemove : 'Forigi', UploadRemoveTip : 'Forigi !f', UploadUploaded : 'Alŝutita !n%', UploadProcessing : 'Estas alŝutata...', // Settings Panel SetTitle : 'Agordo', SetView : 'Vidi:', SetViewThumb : 'Miniaturoj', SetViewList : 'Listo', SetDisplay : 'Vidigi:', SetDisplayName : 'Dosiernomo', SetDisplayDate : 'Dato', SetDisplaySize : 'Dosiergrando', SetSort : 'Ordigo:', SetSortName : 'laŭ dosiernomo', SetSortDate : 'laŭ dato', SetSortSize : 'laŭ grando', SetSortExtension : 'laŭ dosiernoma finaĵo', // Status Bar FilesCountEmpty : '<Malplena dosiero>', FilesCountOne : '1 dosiero', FilesCountMany : '%1 dosieroj', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Ne eblis plenumi la peton. (Eraro %1)', Errors : { 10 : 'Nevalida komando.', 11 : 'La risurctipo ne estas indikita en la komando.', 12 : 'La risurctipo ne estas valida.', 102 : 'La dosier- aŭ dosierujnomo ne estas valida.', 103 : 'Ne eblis plenumi la peton pro rajtaj limigoj.', 104 : 'Ne eblis plenumi la peton pro atingopermesaj limigoj.', 105 : 'Nevalida dosiernoma finaĵo.', 109 : 'Nevalida peto.', 110 : 'Nekonata eraro.', 115 : 'Dosiero aŭ dosierujo kun tiu nomo jam ekzistas.', 116 : 'Tiu dosierujo ne ekzistas. Bonvolu aktualigi kaj reprovi.', 117 : 'Tiu dosiero ne ekzistas. Bonvolu aktualigi kaj reprovi.', 118 : 'La vojoj al la fonto kaj al la celo estas samaj.', 201 : 'Dosiero kun la sama nomo jam ekzistas. La alŝutita dosiero estas renomita al "%1".', 202 : 'Nevalida dosiero.', 203 : 'Nevalida dosiero. La grando estas tro alta.', 204 : 'La alŝutita dosiero estas difektita.', 205 : 'Neniu provizora dosierujo estas disponebla por alŝuto al la servilo.', 206 : 'Alŝuto nuligita pro kialoj pri sekureco. La dosiero entenas datenojn de HTMLtipo.', 207 : 'La alŝutita dosiero estas renomita al "%1".', 300 : 'La movo de la dosieroj malsukcesis.', 301 : 'La kopio de la dosieroj malsukcesis.', 500 : 'La dosieradministra sistemo estas malvalidigita. Kontaktu vian administranton kaj kontrolu la agordodosieron de CKFinder.', 501 : 'La eblo de miniaturoj estas malvalidigita.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'La dosiernomo ne povas esti malplena.', FileExists : 'La dosiero %s jam ekzistas.', FolderEmpty : 'La dosierujnomo ne povas esti malplena.', FileInvChar : 'La dosiernomo ne povas enhavi la sekvajn signojn : \n\\ / : * ? " < > |', FolderInvChar : 'La dosierujnomo ne povas enhavi la sekvajn signojn : \n\\ / : * ? " < > |', PopupBlockView : 'Ne eblis malfermi la dosieron en nova fenestro. Agordu vian retumilon kaj malŝaltu vian ŝprucfenestran blokilon por tiu retpaĝaro.', XmlError : 'Ne eblis kontentige elŝuti la XML respondon el la servilo.', XmlEmpty : 'Ne eblis elŝuti la XML respondon el la servilo. La servilo resendis malplenan respondon.', XmlRawResponse : 'Kruda respondo el la servilo: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Plimalpligrandigi %s', sizeTooBig : 'Ne eblas ŝanĝi la alton aŭ larĝon de tiu bildo ĝis valoro pli granda ol la origina grando (%size).', resizeSuccess : 'La bildgrando estas sukcese ŝanĝita.', thumbnailNew : 'Krei novan miniaturon', thumbnailSmall : 'Malgranda (%s)', thumbnailMedium : 'Meza (%s)', thumbnailLarge : 'Granda (%s)', newSize : 'Fiksi la novajn grando-erojn', width : 'Larĝo', height : 'Alto', invalidHeight : 'Nevalida alto.', invalidWidth : 'Nevalida larĝo.', invalidName : 'Nevalida dosiernomo.', newImage : 'Krei novan bildon', noExtensionChange : 'Ne eblas ŝanĝi la dosiernoman finaĵon.', imageSmall : 'La bildo estas tro malgranda', contextMenuName : 'Ŝanĝi la grandon', lockRatio : 'Konservi proporcion', resetSize : 'Origina grando' }, // Fileeditor plugin Fileeditor : { save : 'Konservi', fileOpenError : 'Ne eblas malfermi la dosieron', fileSaveSuccess : 'La dosiero estas sukcese konservita.', contextMenuName : 'Redakti', loadingFile : 'La dosiero estas elŝutata, bonvolu pacienci...' }, Maximize : { maximize : 'Pligrandigi', minimize : 'Malpligrandigi' }, Gallery : { current : 'Bildo {current} el {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Hebrew * language. */ /** * Contains 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: 'זכור החלטתי' }, // Language direction, 'ltr' or 'rtl'. 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 : 'd/m/yyyy HH: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 : 'שגיאה %e בקובץ %s', 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 : 'סוג קובץ זה לא מאושר בתיקיה זאת.', // Flash Uploads UploadLabel : 'קבצים להעלאה', UploadTotalFiles : 'כמות קבצים:', UploadTotalSize : 'גודל סופי:', UploadSend : 'התחלת העלאה', UploadAddFiles : 'הוספת קבצים', UploadClearFiles : 'ניקוי קבצים', UploadCancel : 'ביטול העלאה', UploadRemove : 'מחיקה מהרשימה', UploadRemoveTip : 'מחיקת הקובץ !f', UploadUploaded : '!n% הועלו', UploadProcessing : 'מעבד...', // Settings Panel SetTitle : 'הגדרות', SetView : 'צפיה:', SetViewThumb : 'תמונות מוקטנות', SetViewList : 'רשימה', SetDisplay : 'תצוגה:', SetDisplayName : 'שם קובץ', SetDisplayDate : 'תאריך', SetDisplaySize : 'גודל קובץ', SetSort : 'מיון:', SetSortName : 'לפי שם', SetSortDate : 'לפי תאריך', SetSortSize : 'לפי גודל', SetSortExtension : 'לפי סיומת (Extension)', // Status Bar FilesCountEmpty : '<תיקיה ריקה>', FilesCountOne : 'קובץ 1', FilesCountMany : '%1 קבצים', // Size and Speed Kb : '%1KB', Mb : '%1MB', Gb : '%1GB', SizePerSecond : '%1/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 : 'לא היה ניתן לפתוח קובץ בחלון חדש. נא לבדוק את הגדרות הדפדפן ולבטל את חוסמי החלונות הקובצים.', XmlError : 'לא היה ניתן לטעון מהשרת כהלכה את קובץ ה-XML.', XmlEmpty : 'לא היה ניתן לטעון מהשרת את קובץ ה-XML. השרת החזיר תגובה ריקה.', XmlRawResponse : 'תגובה גולמית מהשרת: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'שינוי גודל התמונה %s', sizeTooBig : 'גובה ורוחב התמונה לא יכולים להיות גדולים מהגודל המקורי שלה (%size).', resizeSuccess : 'גודל התמונה שונה שהצלחה.', thumbnailNew : 'יצירת תמונה מוקטנת (Thumbnail)', thumbnailSmall : 'קטנה (%s)', thumbnailMedium : 'בינונית (%s)', thumbnailLarge : 'גדולה (%s)', newSize : 'קביעת גודל חדש', width : 'רוחב', height : 'גובה', invalidHeight : 'גובה לא חוקי.', invalidWidth : 'רוחב לא חוקי.', invalidName : 'שם הקובץ לא חוקי.', newImage : 'יצירת תמונה חדשה', noExtensionChange : 'לא ניתן לשנות את סוג הקובץ.', imageSmall : 'התמונה המקורית קטנה מדי', contextMenuName : 'שינוי גודל', lockRatio : 'נעילת היחס', resetSize : 'איפוס הגודל' }, // Fileeditor plugin Fileeditor : { save : 'שמירה', fileOpenError : 'לא היה ניתן לפתוח את הקובץ.', fileSaveSuccess : 'הקובץ נשמר בהצלחה.', contextMenuName : 'עריכה', loadingFile : 'טוען קובץ, נא להמתין...' }, Maximize : { maximize : 'הגדלה למקסימום', minimize : 'הקטנה למינימום' }, Gallery : { current : 'תמונה {current} מתוך {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['sv'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, Ej tillgänglig</span>', confirmCancel : 'Några av alternativen har ändrats. Är du säker på att du vill stänga dialogrutan?', ok : 'OK', cancel : 'Avbryt', confirmationTitle : 'Bekräftelse', messageTitle : 'Information', inputTitle : 'Fråga', undo : 'Ångra', redo : 'Gör om', skip : 'Hoppa över', skipAll : 'Hoppa över alla', makeDecision : 'Vilken åtgärd ska utföras?', rememberDecision: 'Kom ihåg mitt val' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'sv', // 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 vill ändra filändelsen? Filen kan bli oanvändbar.', FileRenaming : 'Byter filnamn...', FileDelete : 'Är du säker på att du vill radera filen "%1"?', FilesLoading : 'Laddar...', FilesEmpty : 'Mappen är tom.', FilesMoved : 'Filen %1 flyttad till %2:%3.', FilesCopied : 'Filen %1 kopierad till %2:%3.', // Basket BasketFolder : 'Filkorg', BasketClear : 'Rensa filkorgen', BasketRemove : 'Ta bort från korgen', BasketOpenFolder : 'Öppna överliggande mapp', BasketTruncateConfirm : 'Vill du verkligen ta bort alla filer från korgen?', BasketRemoveConfirm : 'Vill du verkligen ta bort filen "%1" från korgen?', BasketEmpty : 'Inga filer i korgen, dra och släpp några.', BasketCopyFilesHere : 'Kopiera filer från korgen', BasketMoveFilesHere : 'Flytta filer från korgen', BasketPasteErrorOther : 'Fil %s fel: %e', BasketPasteMoveSuccess : 'Följande filer flyttades: %s', BasketPasteCopySuccess : 'Följande filer kopierades: %s', // 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 : 'Kopiera filen hit', MoveDragDrop : 'Flytta filen hit', // Dialogs RenameDlgTitle : 'Byt namn', NewNameDlgTitle : 'Nytt namn', FileExistsDlgTitle : 'Filen finns redan', SysErrorDlgTitle : 'Systemfel', FileOverwrite : 'Skriv över', FileAutorename : 'Auto-namnändring', // 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 : 'Avbryt', UploadNoFileMsg : 'Välj en fil från din dator.', UploadNoFolder : 'Välj en mapp före uppladdning.', UploadNoPerms : 'Filuppladdning ej tillåten.', UploadUnknError : 'Fel vid filuppladdning.', UploadExtIncorrect : 'Filändelsen är inte tillåten i denna mapp.', // Flash Uploads UploadLabel : 'Filer att ladda upp', UploadTotalFiles : 'Totalt antal filer:', UploadTotalSize : 'Total storlek:', UploadSend : 'Ladda upp', UploadAddFiles : 'Lägg till filer', UploadClearFiles : 'Rensa filer', UploadCancel : 'Avbryt uppladdning', UploadRemove : 'Ta bort', UploadRemoveTip : 'Ta bort !f', UploadUploaded : 'Uppladdat !n%', UploadProcessing : 'Bearbetar...', // Settings Panel SetTitle : 'Inställningar', SetView : 'Visa:', SetViewThumb : 'Tumnaglar', SetViewList : 'Lista', SetDisplay : 'Visa:', SetDisplayName : 'Filnamn', SetDisplayDate : 'Datum', SetDisplaySize : 'Storlek', SetSort : 'Sortering:', SetSortName : 'Filnamn', SetSortDate : 'Datum', SetSortSize : 'Storlek', SetSortExtension : 'Filändelse', // Status Bar FilesCountEmpty : '<Tom Mapp>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Begäran kunde inte utföras eftersom ett fel uppstod. (Fel %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 : 'Sökväg till källa och mål är identisk.', 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 : 'Flytt av fil(er) misslyckades.', 301 : 'Kopiering av fil(er) misslyckades.', 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 : 'Filen %s finns redan.', 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 så att den tillåter popup-fönster på den här webbplatsen.', XmlError : 'Det gick inte att ladda XML-svaret från webbservern ordentligt.', XmlEmpty : 'Det gick inte att ladda XML-svaret från webbservern. Servern returnerade ett tomt svar.', XmlRawResponse : 'Svar från servern: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Storleksändra %s', sizeTooBig : 'Bildens höjd eller bredd kan inte vara större än originalfilens storlek (%size).', resizeSuccess : 'Storleksändring lyckades.', thumbnailNew : 'Skapa en ny tumnagel', thumbnailSmall : 'Liten (%s)', thumbnailMedium : 'Mellan (%s)', thumbnailLarge : 'Stor (%s)', newSize : 'Välj en ny storlek', width : 'Bredd', height : 'Höjd', invalidHeight : 'Ogiltig höjd.', invalidWidth : 'Ogiltig bredd.', invalidName : 'Ogiltigt filnamn.', newImage : 'Skapa en ny bild', noExtensionChange : 'Filändelsen kan inte ändras.', imageSmall : 'Originalbilden är för liten.', contextMenuName : 'Ändra storlek', lockRatio : 'Lås höjd/bredd förhållanden', resetSize : 'Återställ storlek' }, // Fileeditor plugin Fileeditor : { save : 'Spara', fileOpenError : 'Kan inte öppna filen.', fileSaveSuccess : 'Filen sparades.', contextMenuName : 'Redigera', loadingFile : 'Laddar fil, var god vänta...' }, Maximize : { maximize : 'Maximera', minimize : 'Minimera' }, Gallery : { current : 'Bild {current} av {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['de'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nicht verfügbar</span>', confirmCancel : 'Einige Optionen wurden geändert. Wollen Sie den Dialog dennoch schließen?', ok : 'OK', cancel : 'Abbrechen', confirmationTitle : 'Bestätigung', messageTitle : 'Information', inputTitle : 'Frage', undo : 'Rückgängig', redo : 'Wiederherstellen', skip : 'Überspringen', skipAll : 'Alle überspringen', makeDecision : 'Bitte Auswahl treffen.', rememberDecision: 'Entscheidung merken' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'Laden...', FilesEmpty : 'Verzeichnis ist leer.', FilesMoved : 'Datei %1 verschoben nach %2:%3.', FilesCopied : 'Datei %1 kopiert nach %2:%3.', // Basket BasketFolder : 'Korb', BasketClear : 'Korb löschen', BasketRemove : 'Aus dem Korb entfernen', BasketOpenFolder : 'Übergeordneten Ordner öffnen', BasketTruncateConfirm : 'Wollen Sie wirklich alle Dateien aus dem Korb entfernen?', BasketRemoveConfirm : 'Wollen Sie wirklich die Datei "%1" aus dem Korb entfernen?', BasketEmpty : 'Keine Dateien im Korb, einfach welche reinziehen.', BasketCopyFilesHere : 'Dateien aus dem Korb kopieren', BasketMoveFilesHere : 'Dateien aus dem Korb verschieben', BasketPasteErrorOther : 'Datei %s Fehler: %e', BasketPasteMoveSuccess : 'Folgende Datei wurde verschoben: %s', BasketPasteCopySuccess : 'Folgende Datei wurde kopiert: %s', // 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 : 'Datei hierher kopieren', MoveDragDrop : 'Datei hierher verschieben', // Dialogs RenameDlgTitle : 'Umbenennen', NewNameDlgTitle : 'Neuer Name', FileExistsDlgTitle : 'Datei existiert bereits', SysErrorDlgTitle : 'Systemfehler', FileOverwrite : 'Überschreiben', FileAutorename : 'Automatisch umbenennen', // 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 : 'Abbrechen', UploadNoFileMsg : 'Bitte wählen Sie eine Datei auf Ihrem Computer aus.', UploadNoFolder : 'Bitte ein Verzeichnis vor dem Hochladen wählen.', UploadNoPerms : 'Datei hochladen nicht erlaubt.', UploadUnknError : 'Fehler bei Dateitragung.', UploadExtIncorrect : 'Dateinamekürzel nicht in diesem Verzeichnis erlaubt.', // Flash Uploads UploadLabel : 'Dateien zum Hochladen', UploadTotalFiles : 'Gesamtanzahl Dateien:', UploadTotalSize : 'Gesamtgröße:', UploadSend : 'Hochladen', UploadAddFiles : 'Datei hinzufügen', UploadClearFiles : 'Dateiliste löschen', UploadCancel : 'Upload abbrechen', UploadRemove : 'Entfernen', UploadRemoveTip : 'Entfernen !f', UploadUploaded : 'Hochgeladen !n%', UploadProcessing : 'In Arbeit...', // 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', SetSortExtension : 'nach Dateiendung', // Status Bar FilesCountEmpty : '<Leeres Verzeichnis>', FilesCountOne : '1 Datei', FilesCountMany : '%1 Datei', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Quell- und Zielpfad sind gleich.', 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 : 'Verschieben der Dateien fehlgeschlagen.', 301 : 'Kopieren der Dateien fehlgeschlagen.', 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 : 'Datei %s existiert bereits.', 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.', XmlError : 'Es war nicht möglich die XML-Antwort von dem Server herunterzuladen.', XmlEmpty : 'Es war nicht möglich die XML-Antwort von dem Server herunterzuladen. Der Server hat eine leere Nachricht zurückgeschickt.', XmlRawResponse : 'Raw-Antwort vom Server: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Größenänderung %s', sizeTooBig : 'Bildgröße kann nicht größer als das Originalbild werden (%size).', resizeSuccess : 'Bildgröße erfolgreich geändert.', thumbnailNew : 'Neues Vorschaubild erstellen', thumbnailSmall : 'Klein (%s)', thumbnailMedium : 'Mittel (%s)', thumbnailLarge : 'Groß (%s)', newSize : 'Eine neue Größe setzen', width : 'Breite', height : 'Höhe', invalidHeight : 'Ungültige Höhe.', invalidWidth : 'Ungültige Breite.', invalidName : 'Ungültiger Name.', newImage : 'Neues Bild erstellen', noExtensionChange : 'Dateierweiterung kann nicht geändert werden.', imageSmall : 'Bildgröße zu klein.', contextMenuName : 'Größenänderung', lockRatio : 'Größenverhältnis beibehalten', resetSize : 'Größe zurücksetzen' }, // Fileeditor plugin Fileeditor : { save : 'Speichern', fileOpenError : 'Datei kann nicht geöffnet werden.', fileSaveSuccess : 'Datei erfolgreich gespeichert.', contextMenuName : 'Bearbeitung', loadingFile : 'Datei wird geladen, einen Moment noch...' }, Maximize : { maximize : 'Maximieren', minimize : 'Minimieren' }, Gallery : { current : 'Bild {current} von {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['lv'] = { 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 were changed. Are you sure you want to close the dialog window?', // MISSING ok : 'Darīts!', cancel : 'Atcelt', confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Atcelt', redo : 'Atkārtot', skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'Ielādē...', FilesEmpty : 'The folder is empty.', // MISSING FilesMoved : 'File %1 moved to %2:%3.', // MISSING FilesCopied : 'File %1 copied to %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 and 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 : 'Atcelt', UploadNoFileMsg : 'Lūdzu izvēlaties failu no sava datora.', UploadNoFolder : 'Please select a 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 // Flash Uploads UploadLabel : 'Files to Upload', // MISSING UploadTotalFiles : 'Total Files:', // MISSING UploadTotalSize : 'Total Size:', // MISSING UploadSend : 'Augšupielādēt', UploadAddFiles : 'Add Files', // MISSING UploadClearFiles : 'Clear Files', // MISSING UploadCancel : 'Cancel Upload', // MISSING UploadRemove : 'Remove', // MISSING UploadRemoveTip : 'Remove !f', // MISSING UploadUploaded : 'Uploaded !n%', // MISSING UploadProcessing : 'Processing...', // 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', SetSortExtension : 'by Extension', // MISSING // Status Bar FilesCountEmpty : '<Tukša mape>', FilesCountOne : '1 fails', FilesCountMany : '%1 faili', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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.', XmlError : 'It was not possible to properly load the XML response from the web server.', // MISSING XmlEmpty : 'It was not possible to load the XML response from the web server. The server returned an empty response.', // MISSING XmlRawResponse : 'Raw response from the server: %s' // MISSING }, // 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 a new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set a new size', // MISSING width : 'Platums', height : 'Augstums', invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create a new image', // MISSING noExtensionChange : 'File extension cannot be changed.', // MISSING imageSmall : 'Source image is too small.', // MISSING contextMenuName : 'Resize', // MISSING lockRatio : 'Nemainīga Augstuma/Platuma attiecība', resetSize : 'Atjaunot sākotnējo izmēru' }, // Fileeditor plugin Fileeditor : { save : 'Saglabāt', fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING }, Maximize : { maximize : 'Maximize', // MISSING minimize : 'Minimize' // MISSING }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Norwegian * Bokmål language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['no'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, utilgjenglig</span>', confirmCancel : 'Noen av valgene har blitt endret. Er du sikker på at du vil lukke dialogen?', ok : 'OK', cancel : 'Avbryt', confirmationTitle : 'Bekreftelse', messageTitle : 'Informasjon', inputTitle : 'Spørsmål', undo : 'Angre', redo : 'Gjør om', skip : 'Hopp over', skipAll : 'Hopp over alle', makeDecision : 'Hvilken handling skal utføres?', rememberDecision: 'Husk mitt valg' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'Laster...', FilesEmpty : 'Denne katalogen er tom.', FilesMoved : 'Filen %1 flyttet til %2:%3.', FilesCopied : 'Filen %1 kopiert til %2:%3.', // Basket BasketFolder : 'Kurv', BasketClear : 'Tøm kurv', BasketRemove : 'Fjern fra kurv', BasketOpenFolder : 'Åpne foreldremappen', BasketTruncateConfirm : 'Vil du virkelig fjerne alle filer fra kurven?', BasketRemoveConfirm : 'Vil du virkelig fjerne filen "%1" fra kurven?', BasketEmpty : 'Ingen filer i kurven, dra og slipp noen.', BasketCopyFilesHere : 'Kopier filer fra kurven', BasketMoveFilesHere : 'Flytt filer fra kurven', BasketPasteErrorOther : 'Fil %s feil: %e', BasketPasteMoveSuccess : 'Følgende filer ble flyttet: %s', BasketPasteCopySuccess : 'Følgende filer ble kopiert: %s', // 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 : 'Kopier filen hit', MoveDragDrop : 'Flytt filen hit', // Dialogs RenameDlgTitle : 'Gi nytt navn', NewNameDlgTitle : 'Nytt navn', FileExistsDlgTitle : 'Filen finnes allerede', SysErrorDlgTitle : 'Systemfeil', FileOverwrite : 'Overskriv', FileAutorename : 'Gi nytt navn automatisk', // 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 : 'Avbryt', UploadNoFileMsg : 'Du må velge en fil fra din datamaskin', UploadNoFolder : 'Vennligst velg en mappe før du laster opp.', UploadNoPerms : 'Filopplastning er ikke tillatt.', UploadUnknError : 'Feil ved sending av fil.', UploadExtIncorrect : 'Filtypen er ikke tillatt i denne mappen.', // Flash Uploads UploadLabel : 'Filer for opplastning', UploadTotalFiles : 'Totalt antall filer:', UploadTotalSize : 'Total størrelse:', UploadSend : 'Last opp', UploadAddFiles : 'Legg til filer', UploadClearFiles : 'Tøm filer', UploadCancel : 'Avbryt opplastning', UploadRemove : 'Fjern', UploadRemoveTip : 'Fjern !f', UploadUploaded : 'Lastet opp !n%', UploadProcessing : 'Behandler...', // 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', SetSortExtension : 'Filetternavn', // Status Bar FilesCountEmpty : '<Tom Mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Kilde- og mål-bane er like.', 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 : 'Klarte ikke å flytte fil(er).', 301 : 'Klarte ikke å kopiere fil(er).', 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 : 'Filen %s finnes alt.', 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.', XmlError : 'Det var ikke mulig å laste XML-dataene i svaret fra serveren.', XmlEmpty : 'Det var ikke mulig å laste XML-dataene fra serverne, svaret var tomt.', XmlRawResponse : 'Rått datasvar fra serveren: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Endre størrelse %s', sizeTooBig : 'Kan ikke sette høyde og bredde til større enn orginalstørrelse (%size).', resizeSuccess : 'Endring av bildestørrelse var vellykket.', thumbnailNew : 'Lag ett nytt miniatyrbilde', thumbnailSmall : 'Liten (%s)', thumbnailMedium : 'Medium (%s)', thumbnailLarge : 'Stor (%s)', newSize : 'Sett en ny størrelse', width : 'Bredde', height : 'Høyde', invalidHeight : 'Ugyldig høyde.', invalidWidth : 'Ugyldig bredde.', invalidName : 'Ugyldig filnavn.', newImage : 'Lag ett nytt bilde', noExtensionChange : 'Filendelsen kan ikke endres.', imageSmall : 'Kildebildet er for lite.', contextMenuName : 'Endre størrelse', lockRatio : 'Lås forhold', resetSize : 'Tilbakestill størrelse' }, // Fileeditor plugin Fileeditor : { save : 'Lagre', fileOpenError : 'Klarte ikke å åpne filen.', fileSaveSuccess : 'Fillagring var vellykket.', contextMenuName : 'Rediger', loadingFile : 'Laster fil, vennligst vent...' }, Maximize : { maximize : 'Maksimer', minimize : 'Minimer' }, Gallery : { current : 'Bilde {current} av {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Greek * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['el'] = { 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: 'Να θυμάσαι την απόφασή μου' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'Φόρτωση...', FilesEmpty : 'Ο φάκελος είναι κενός.', FilesMoved : 'Το αρχείο %1 μετακινήθηκε στο φάκελο %2:%3.', FilesCopied : 'Το αρχείο %1 αντιγράφηκε στο φάκελο %2:%3.', // Basket BasketFolder : 'Καλάθι', BasketClear : 'Καθαρισμός καλαθιού', BasketRemove : 'Αφαίρεση από το καλάθι', BasketOpenFolder : 'Άνοιγμα γονικού φακέλου', BasketTruncateConfirm : 'Θέλετε σίγουρα να αφαιρέσετε όλα τα αρχεία από το καλάθι;', BasketRemoveConfirm : 'Θέλετε σίγουρα να αφαιρέσετε το αρχείο "%1" από το καλάθι;', BasketEmpty : 'Δεν υπάρχουν αρχεία στο καλάθι, μεταφέρετε κάποια με drag and drop.', 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 : 'OK', CancelBtn : 'Ακύρωση', CloseBtn : 'Κλείσιμο', // Upload Panel UploadTitle : 'Μεταφόρτωση νέου αρχείου', UploadSelectLbl : 'επιλέξτε το αρχείο που θέλετε να μεταφερθεί κάνοντας κλίκ στο κουμπί', UploadProgressLbl : '(Η μεταφόρτωση εκτελείται, παρακαλούμε περιμένετε...)', UploadBtn : 'Μεταφόρτωση επιλεγμένου αρχείου', UploadBtnCancel : 'Ακύρωση', UploadNoFileMsg : 'Παρακαλούμε επιλέξτε ένα αρχείο από τον υπολογιστή σας.', UploadNoFolder : 'Παρακαλούμε επιλέξτε ένα φάκελο πριν εκκινήσετε την διαδικασία της μεταφόρτωσης.', UploadNoPerms : 'Η μεταφόρτωση των αρχείων δεν επιτρέπεται.', UploadUnknError : 'Παρουσιάστηκε σφάλμα κατά την αποστολή του αρχείου.', UploadExtIncorrect : 'Η επέκταση του αρχείου δεν επιτρέπεται σε αυτόν τον φάκελο.', // Flash Uploads UploadLabel : 'Αρχεία προς μεταφόρτωση', UploadTotalFiles : 'Συνολικά αρχεία:', UploadTotalSize : 'Συνολικό μέγεθος:', UploadSend : 'Μεταφόρτωση', UploadAddFiles : 'Προσθήκη αρχείων', UploadClearFiles : 'Αφαίρεση αρχείων', UploadCancel : 'Ακύρωση μεταφόρτωσης', UploadRemove : 'Αφαίρεση', UploadRemoveTip : 'Αφαίρεση !f', UploadUploaded : 'Μεταφορτώθηκε !n%', UploadProcessing : 'Επεξεργασία...', // Settings Panel SetTitle : 'Ρυθμίσεις', SetView : 'Προβολή:', SetViewThumb : 'Μικρογραφίες', SetViewList : 'Λίστα', SetDisplay : 'Εμφάνιση:', SetDisplayName : 'Όνομα αρχείου', SetDisplayDate : 'Ημερομηνία', SetDisplaySize : 'Μέγεθος αρχείου', SetSort : 'Ταξινόμηση:', SetSortName : 'βάσει Όνοματος αρχείου', SetSortDate : 'βάσει Ημερομήνιας', SetSortSize : 'βάσει Μεγέθους', SetSortExtension : 'βάσει Επέκτασης', // Status Bar FilesCountEmpty : '<Κενός Φάκελος>', FilesCountOne : '1 αρχείο', FilesCountMany : '%1 αρχεία', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Η ενέργεια δεν ήταν δυνατόν να εκτελεστεί. (Σφάλμα %1)', Errors : { 10 : 'Λανθασμένη Εντολή.', 11 : 'Το resource type δεν ήταν δυνατόν να προσδιοριστεί.', 12 : 'Το resource type δεν είναι έγκυρο.', 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 : 'Δεν ήταν εφικτό να ανοίξει το αρχείο σε νέο παράθυρο. Παρακαλώ, ελέγξτε τις ρυθμίσεις τους πλοηγού σας και απενεργοποιήστε όλους τους popup blockers για αυτή την ιστοσελίδα.', XmlError : 'Δεν ήταν εφικτή η σωστή ανάγνωση του XML response από τον διακομιστή.', XmlEmpty : 'Δεν ήταν εφικτή η φόρτωση του XML response από τον διακομιστή. Ο διακομιστής επέστρεψε ένα κενό response.', XmlRawResponse : 'Raw response από τον διακομιστή: %s' }, // 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 : 'Αλλαγή διαστάσεων', lockRatio : 'Κλείδωμα αναλογίας', resetSize : 'Επαναφορά αρχικού μεγέθους' }, // Fileeditor plugin Fileeditor : { save : 'Αποθήκευση', fileOpenError : 'Δεν ήταν εφικτό το άνοιγμα του αρχείου.', fileSaveSuccess : 'Το αρχείο αποθηκεύτηκε επιτυχώς.', contextMenuName : 'Επεξεργασία', loadingFile : 'Φόρτωση αρχείου, παρακαλώ περιμένετε...' }, Maximize : { maximize : 'Μεγιστοποίηση', minimize : 'Ελαχιστοποίηση' }, Gallery : { current : 'Εικόνα {current} από {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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' }, // Language direction, 'ltr' or 'rtl'. 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.', // Flash Uploads UploadLabel : 'Archivos a subir', UploadTotalFiles : 'Total de archivos:', UploadTotalSize : 'Tamaño total:', UploadSend : 'Añadir', UploadAddFiles : 'Añadir archivos', UploadClearFiles : 'Borrar archivos', UploadCancel : 'Cancelar subida', UploadRemove : 'Quitar', UploadRemoveTip : 'Quitar !f', UploadUploaded : 'Enviado !n%', UploadProcessing : 'Procesando...', // 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', SetSortExtension : 'por Extensión', // Status Bar FilesCountEmpty : '<Carpeta vacía>', FilesCountOne : '1 archivo', FilesCountMany : '%1 archivos', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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.', XmlError : 'No ha sido posible cargar correctamente la respuesta XML del servidor.', XmlEmpty : 'No ha sido posible cargar correctamente la respuesta XML del servidor. El servidor envió una cadena vacía.', XmlRawResponse : 'Respuesta del servidor: %s' }, // 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', lockRatio : 'Proporcional', resetSize : 'Tamaño Original' }, // Fileeditor plugin Fileeditor : { save : 'Guardar', fileOpenError : 'No se puede abrir el archivo.', fileSaveSuccess : 'Archivo guardado correctamente.', contextMenuName : 'Editar', loadingFile : 'Cargando archivo, por favor espere...' }, Maximize : { maximize : 'Maximizar', minimize : 'Minimizar' }, Gallery : { current : 'Imagen {current} de {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Vietnamese * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['vi'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, không khả dụng</span>', confirmCancel : 'Vài tùy chọn đã thay đổi. Bạn có muốn đóng hộp thoại?', ok : 'OK', cancel : 'Hủy', confirmationTitle : 'Xác nhận', messageTitle : 'Thông tin', inputTitle : 'Câu hỏi', undo : 'Hoàn tác', redo : 'Làm lại', skip : 'Bỏ qua', skipAll : 'Bỏ qua tất cả', makeDecision : 'Chọn hành động nào?', rememberDecision: 'Ghi nhớ quyết định này' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'vi', // 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 aa', DateAmPm : ['SA', 'CH'], // Folders FoldersTitle : 'Thư mục', FolderLoading : 'Đang tải...', FolderNew : 'Xin chọn tên cho thư mục mới: ', FolderRename : 'Xin chọn tên mới cho thư mục: ', FolderDelete : 'Bạn có chắc muốn xóa thư mục "%1"?', FolderRenaming : ' (Đang đổi tên...)', FolderDeleting : ' (Đang xóa...)', // Files FileRename : 'Xin nhập tên tập tin mới: ', FileRenameExt : 'Bạn có chắc muốn đổi phần mở rộng? Tập tin có thể sẽ không dùng được.', FileRenaming : 'Đang đổi tên...', FileDelete : 'Bạn có chắc muốn xóa tập tin "%1"?', FilesLoading : 'Đang tải...', FilesEmpty : 'Thư mục trống.', FilesMoved : 'Tập tin %1 được chuyển đến %2:%3.', FilesCopied : 'Tập tin %1 được chép đến %2:%3.', // Basket BasketFolder : 'Rổ', BasketClear : 'Dọn rổ', BasketRemove : 'Xóa khỏi rổ', BasketOpenFolder : 'Mở thư mục cha', BasketTruncateConfirm : 'Bạn có chắc muốn bỏ tất cả tập tin trong rổ?', BasketRemoveConfirm : 'Bạn có chắc muốn bỏ tập tin "%1" khỏi rổ?', BasketEmpty : 'Không có tập tin trong rổ, hãy kéo và thả tập tin vào rổ.', BasketCopyFilesHere : 'Chép tập tin từ rổ', BasketMoveFilesHere : 'Chuyển tập tin từ rổ', BasketPasteErrorOther : 'Tập tin %s bị lỗi: %e', BasketPasteMoveSuccess : 'Tập tin sau đã được chuyển: %s', BasketPasteCopySuccess : 'Tập tin sau đã được chép: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Tải lên', UploadTip : 'Tải tập tin mới', Refresh : 'Làm tươi', Settings : 'Thiết lập', Help : 'Hướng dẫn', HelpTip : 'Hướng dẫn', // Context Menus Select : 'Chọn', SelectThumbnail : 'Chọn ảnh mẫu', View : 'Xem', Download : 'Tải về', NewSubFolder : 'Tạo thư mục con', Rename : 'Đổi tên', Delete : 'Xóa', CopyDragDrop : 'Chép tập tin vào đây', MoveDragDrop : 'Chuyển tập tin vào đây', // Dialogs RenameDlgTitle : 'Đổi tên', NewNameDlgTitle : 'Tên mới', FileExistsDlgTitle : 'Tập tin đã tồn tại', SysErrorDlgTitle : 'Lỗi hệ thống', FileOverwrite : 'Ghi đè', FileAutorename : 'Tự đổi tên', // Generic OkBtn : 'OK', CancelBtn : 'Hủy bỏ', CloseBtn : 'Đóng', // Upload Panel UploadTitle : 'Tải tập tin mới', UploadSelectLbl : 'Chọn tập tin tải lên', UploadProgressLbl : '(Đang tải lên, vui lòng chờ...)', UploadBtn : 'Tải tập tin đã chọn', UploadBtnCancel : 'Hủy bỏ', UploadNoFileMsg : 'Xin chọn một tập tin trong máy tính.', UploadNoFolder : 'Xin chọn thư mục trước khi tải lên.', UploadNoPerms : 'Không được phép tải lên.', UploadUnknError : 'Lỗi khi tải tập tin.', UploadExtIncorrect : 'Kiểu tập tin không được chấp nhận trong thư mục này.', // Flash Uploads UploadLabel : 'Tập tin sẽ tải:', UploadTotalFiles : 'Tổng số tập tin:', UploadTotalSize : 'Dung lượng tổng cộng:', UploadSend : 'Tải lên', UploadAddFiles : 'Thêm tập tin', UploadClearFiles : 'Xóa tập tin', UploadCancel : 'Hủy tải', UploadRemove : 'Xóa', UploadRemoveTip : 'Xóa !f', UploadUploaded : 'Đã tải !n%', UploadProcessing : 'Đang xử lí...', // Settings Panel SetTitle : 'Thiết lập', SetView : 'Xem:', SetViewThumb : 'Ảnh mẫu', SetViewList : 'Danh sách', SetDisplay : 'Hiển thị:', SetDisplayName : 'Tên tập tin', SetDisplayDate : 'Ngày', SetDisplaySize : 'Dung lượng', SetSort : 'Sắp xếp:', SetSortName : 'theo tên', SetSortDate : 'theo ngày', SetSortSize : 'theo dung lượng', SetSortExtension : 'theo phần mở rộng', // Status Bar FilesCountEmpty : '<Thư mục rỗng>', FilesCountOne : '1 tập tin', FilesCountMany : '%1 tập tin', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Không thể hoàn tất yêu cầu. (Lỗi %1)', Errors : { 10 : 'Lệnh không hợp lệ.', 11 : 'Kiểu tài nguyên không được chỉ định trong yêu cầu.', 12 : 'Kiểu tài nguyên yêu cầu không hợp lệ.', 102 : 'Tên tập tin hay thư mục không hợp lệ.', 103 : 'Không thể hoàn tất yêu cầu vì giới hạn quyền.', 104 : 'Không thể hoàn tất yêu cầu vì giới hạn quyền của hệ thống tập tin.', 105 : 'Phần mở rộng tập tin không hợp lệ.', 109 : 'Yêu cầu không hợp lệ.', 110 : 'Lỗi không xác định.', 115 : 'Tập tin hoặc thư mục cùng tên đã tồn tại.', 116 : 'Không thấy thư mục. Hãy làm tươi và thử lại.', 117 : 'Không thấy tập tin. Hãy làm tươi và thử lại.', 118 : 'Đường dẫn nguồn và đích giống nhau.', 201 : 'Tập tin cùng tên đã tồn tại. Tập tin vừa tải lên được đổi tên thành "%1".', 202 : 'Tập tin không hợp lệ.', 203 : 'Tập tin không hợp lệ. Dung lượng quá lớn.', 204 : 'Tập tin tải lên bị hỏng.', 205 : 'Không có thư mục tạm để tải tập tin.', 206 : 'Huỷ tải lên vì lí do bảo mật. Tập tin chứa dữ liệu giống HTML.', 207 : 'Tập tin được đổi tên thành "%1".', 300 : 'Di chuyển tập tin thất bại.', 301 : 'Chép tập tin thất bại.', 500 : 'Trình duyệt tập tin bị vô hiệu vì lí do bảo mật. Xin liên hệ quản trị hệ thống và kiểm tra tập tin cấu hình CKFinder.', 501 : 'Chức năng hỗ trợ ảnh mẫu bị vô hiệu.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Không thể để trống tên tập tin.', FileExists : 'Tập tin %s đã tồn tại.', FolderEmpty : 'Không thể để trống tên thư mục.', FileInvChar : 'Tên tập tin không thể chưa các kí tự: \n\\ / : * ? " < > |', FolderInvChar : 'Tên thư mục không thể chứa các kí tự: \n\\ / : * ? " < > |', PopupBlockView : 'Không thể mở tập tin trong cửa sổ mới. Hãy kiểm tra trình duyệt và tắt chức năng chặn popup trên trang web này.', XmlError : 'Không thể nạp hồi đáp XML từ máy chủ web.', XmlEmpty : 'Không thể nạp hồi đáp XML từ máy chủ web. Dữ liệu rỗng.', XmlRawResponse : 'Hồi đáp thô từ máy chủ: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Đổi kích thước %s', sizeTooBig : 'Không thể đặt chiều cao hoặc rộng to hơn kích thước gốc (%size).', resizeSuccess : 'Đổi kích thước ảnh thành công.', thumbnailNew : 'Tạo ảnh mẫu mới', thumbnailSmall : 'Nhỏ (%s)', thumbnailMedium : 'Vừa (%s)', thumbnailLarge : 'Lớn (%s)', newSize : 'Chọn kích thước mới', width : 'Rộng', height : 'Cao', invalidHeight : 'Chiều cao không hợp lệ.', invalidWidth : 'Chiều rộng không hợp lệ.', invalidName : 'Tên tập tin không hợp lệ.', newImage : 'Tạo ảnh mới', noExtensionChange : 'Không thể thay đổi phần mở rộng.', imageSmall : 'Ảnh nguồn quá nhỏ.', contextMenuName : 'Đổi kích thước', lockRatio : 'Khoá tỉ lệ', resetSize : 'Đặt lại kích thước' }, // Fileeditor plugin Fileeditor : { save : 'Lưu', fileOpenError : 'Không thể mở tập tin.', fileSaveSuccess : 'Lưu tập tin thành công.', contextMenuName : 'Sửa', loadingFile : 'Đang tải tập tin, xin chờ...' }, Maximize : { maximize : 'Cực đại hóa', minimize : 'Cực tiểu hóa' }, Gallery : { current : 'Hình thứ {current} trên {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Lithuanian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['lt'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nėra</span>', confirmCancel : 'Kai kurie nustatymai buvo pakeisti. Ar tikrai norite uždaryti šį langą?', ok : 'Gerai', cancel : 'Atšaukti', confirmationTitle : 'Patvirtinimas', messageTitle : 'Informacija', inputTitle : 'Klausimas', undo : 'Veiksmas atgal', redo : 'Veiksmas pirmyn', skip : 'Praleisti', skipAll : 'Praleisti viską', makeDecision : 'Ką pasirinksite?', rememberDecision: 'Atsiminti mano pasirinkimą' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'lt', LangCode : 'lt', // 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 H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Segtuvai', FolderLoading : 'Prašau palaukite...', FolderNew : 'Prašau įrašykite naujo segtuvo pavadinimą: ', FolderRename : 'Prašau įrašykite naujo segtuvo pavadinimą: ', FolderDelete : 'Ar tikrai norite ištrinti "%1" segtuvą?', FolderRenaming : ' (Pervadinama...)', FolderDeleting : ' (Trinama...)', // Files FileRename : 'Prašau įrašykite naujo failo pavadinimą: ', FileRenameExt : 'Ar tikrai norite pakeisti šio failo plėtinį? Failas gali būti nebepanaudojamas', FileRenaming : 'Pervadinama...', FileDelete : 'Ar tikrai norite ištrinti failą "%1"?', FilesLoading : 'Prašau palaukite...', FilesEmpty : 'Tuščias segtuvas', FilesMoved : 'Failas %1 perkeltas į %2:%3', FilesCopied : 'Failas %1 nukopijuotas į %2:%3', // Basket BasketFolder : 'Krepšelis', BasketClear : 'Ištuštinti krepšelį', BasketRemove : 'Ištrinti krepšelį', BasketOpenFolder : 'Atidaryti failo segtuvą', BasketTruncateConfirm : 'Ar tikrai norite ištrinti visus failus iš krepšelio?', BasketRemoveConfirm : 'Ar tikrai norite ištrinti failą "%1" iš krepšelio?', BasketEmpty : 'Krepšelyje failų nėra, nuvilkite ir įmeskite juos į krepšelį.', BasketCopyFilesHere : 'Kopijuoti failus iš krepšelio', BasketMoveFilesHere : 'Perkelti failus iš krepšelio', BasketPasteErrorOther : 'Failo %s klaida: %e', BasketPasteMoveSuccess : 'Atitinkami failai buvo perkelti: %s', BasketPasteCopySuccess : 'Atitinkami failai buvo nukopijuoti: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Įkelti', UploadTip : 'Įkelti naują failą', Refresh : 'Atnaujinti', Settings : 'Nustatymai', Help : 'Pagalba', HelpTip : 'Patarimai', // Context Menus Select : 'Pasirinkti', SelectThumbnail : 'Pasirinkti miniatiūrą', View : 'Peržiūrėti', Download : 'Atsisiųsti', NewSubFolder : 'Naujas segtuvas', Rename : 'Pervadinti', Delete : 'Ištrinti', CopyDragDrop : 'Nukopijuoti failą čia', MoveDragDrop : 'Perkelti failą čia', // Dialogs RenameDlgTitle : 'Pervadinti', NewNameDlgTitle : 'Naujas pavadinimas', FileExistsDlgTitle : 'Toks failas jau egzistuoja', SysErrorDlgTitle : 'Sistemos klaida', FileOverwrite : 'Užrašyti ant viršaus', FileAutorename : 'Automatiškai pervadinti', // Generic OkBtn : 'Gerai', CancelBtn : 'Atšaukti', CloseBtn : 'Uždaryti', // Upload Panel UploadTitle : 'Įkelti naują failą', UploadSelectLbl : 'Pasirinkite failą įkėlimui', UploadProgressLbl : '(Vykdomas įkėlimas, prašau palaukite...)', UploadBtn : 'Įkelti pasirinktą failą', UploadBtnCancel : 'Atšaukti', UploadNoFileMsg : 'Pasirinkite failą iš savo kompiuterio', UploadNoFolder : 'Pasirinkite segtuvą prieš įkeliant.', UploadNoPerms : 'Failų įkėlimas uždraustas.', UploadUnknError : 'Įvyko klaida siunčiant failą.', UploadExtIncorrect : 'Šiame segtuve toks failų plėtinys yra uždraustas.', // Flash Uploads UploadLabel : 'Įkeliami failai', UploadTotalFiles : 'Iš viso failų:', UploadTotalSize : 'Visa apimtis:', UploadSend : 'Įkelti', UploadAddFiles : 'Pridėti failus', UploadClearFiles : 'Išvalyti failus', UploadCancel : 'Atšaukti nusiuntimą', UploadRemove : 'Pašalinti', UploadRemoveTip : 'Pašalinti !f', UploadUploaded : 'Įkeltas !n%', UploadProcessing : 'Apdorojama...', // Settings Panel SetTitle : 'Nustatymai', SetView : 'Peržiūrėti:', SetViewThumb : 'Miniatiūros', SetViewList : 'Sąrašas', SetDisplay : 'Rodymas:', SetDisplayName : 'Failo pavadinimas', SetDisplayDate : 'Data', SetDisplaySize : 'Failo dydis', SetSort : 'Rūšiavimas:', SetSortName : 'pagal failo pavadinimą', SetSortDate : 'pagal datą', SetSortSize : 'pagal apimtį', SetSortExtension : 'pagal plėtinį', // Status Bar FilesCountEmpty : '<Tuščias segtuvas>', FilesCountOne : '1 failas', FilesCountMany : '%1 failai', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Užklausos įvykdyti nepavyko. (Klaida %1)', Errors : { 10 : 'Neteisinga komanda.', 11 : 'Resurso rūšis nenurodyta užklausoje.', 12 : 'Neteisinga resurso rūšis.', 102 : 'Netinkamas failas arba segtuvo pavadinimas.', 103 : 'Nepavyko įvykdyti užklausos dėl autorizavimo apribojimų.', 104 : 'Nepavyko įvykdyti užklausos dėl failų sistemos leidimų apribojimų.', 105 : 'Netinkamas failo plėtinys.', 109 : 'Netinkama užklausa.', 110 : 'Nežinoma klaida.', 115 : 'Failas arba segtuvas su tuo pačiu pavadinimu jau yra.', 116 : 'Segtuvas nerastas. Pabandykite atnaujinti.', 117 : 'Failas nerastas. Pabandykite atnaujinti failų sąrašą.', 118 : 'Šaltinio ir nurodomos vietos nuorodos yra vienodos.', 201 : 'Failas su tuo pačiu pavadinimu jau tra. Įkeltas failas buvo pervadintas į "%1"', 202 : 'Netinkamas failas', 203 : 'Netinkamas failas. Failo apimtis yra per didelė.', 204 : 'Įkeltas failas yra pažeistas.', 205 : 'Nėra laikinojo segtuvo skirto failams įkelti.', 206 : 'Įkėlimas bus nutrauktas dėl saugumo sumetimų. Šiame faile yra HTML duomenys.', 207 : 'Įkeltas failas buvo pervadintas į "%1"', 300 : 'Failų perkėlimas nepavyko.', 301 : 'Failų kopijavimas nepavyko.', 500 : 'Failų naršyklė yra išjungta dėl saugumo nustaymų. Prašau susisiekti su sistemų administratoriumi ir patikrinkite CKFinder konfigūracinį failą.', 501 : 'Miniatiūrų palaikymas išjungtas.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Failo pavadinimas negali būti tuščias', FileExists : 'Failas %s jau egzistuoja', FolderEmpty : 'Segtuvo pavadinimas negali būti tuščias', FileInvChar : 'Failo pavadinimas negali turėti bent vieno iš šių simbolių: \n\\ / : * ? " < > |', FolderInvChar : 'Segtuvo pavadinimas negali turėti bent vieno iš šių simbolių: \n\\ / : * ? " < > |', PopupBlockView : 'Nepavyko atidaryti failo naujame lange. Prašau pakeiskite savo naršyklės nustatymus, kad būtų leidžiami iškylantys langai šiame tinklapyje.', XmlError : 'Nepavyko įkrauti XML atsako iš web serverio.', XmlEmpty : 'Nepavyko įkrauti XML atsako iš web serverio. Serveris gražino tuščią užklausą.', XmlRawResponse : 'Vientisas atsakas iš serverio: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Keisti matmenis %s', sizeTooBig : 'Negalima nustatyti aukščio ir pločio į didesnius nei originalaus paveiksliuko (%size).', resizeSuccess : 'Paveiksliuko matmenys pakeisti.', thumbnailNew : 'Sukurti naują miniatiūrą', thumbnailSmall : 'Mažas (%s)', thumbnailMedium : 'Vidutinis (%s)', thumbnailLarge : 'Didelis (%s)', newSize : 'Nustatyti naujus matmenis', width : 'Plotis', height : 'Aukštis', invalidHeight : 'Neteisingas aukštis.', invalidWidth : 'Neteisingas plotis.', invalidName : 'Neteisingas pavadinimas.', newImage : 'Sukurti naują paveiksliuką', noExtensionChange : 'Failo plėtinys negali būti pakeistas.', imageSmall : 'Šaltinio paveiksliukas yra per mažas', contextMenuName : 'Pakeisti matmenis', lockRatio : 'Išlaikyti matmenų santykį', resetSize : 'Nustatyti dydį iš naujo' }, // Fileeditor plugin Fileeditor : { save : 'Išsaugoti', fileOpenError : 'Nepavyko atidaryti failo.', fileSaveSuccess : 'Failas sėkmingai išsaugotas.', contextMenuName : 'Redaguoti', loadingFile : 'Įkraunamas failas, prašau palaukite...' }, Maximize : { maximize : 'Padidinti', minimize : 'Sumažinti' }, Gallery : { current : 'Nuotrauka {current} iš {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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">, non disponibile</span>', confirmCancel : 'Alcune delle opzioni sono state cambiate. Sei sicuro di voler chiudere la finestra di dialogo?', ok : 'OK', cancel : 'Annulla', confirmationTitle : 'Confermare', messageTitle : 'Informazione', inputTitle : 'Domanda', undo : 'Annulla', redo : 'Ripristina', skip : 'Ignora', skipAll : 'Ignora tutti', makeDecision : 'Che azione prendere?', rememberDecision: 'Ricorda mia decisione' }, // Language direction, 'ltr' or 'rtl'. 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 mosso a %2:%3.', FilesCopied : 'File %1 copiato in %2:%3.', // Basket BasketFolder : 'Cestino', BasketClear : 'Svuota Cestino', BasketRemove : 'Rimuove dal Cestino', BasketOpenFolder : 'Apre Cartella Superiore', BasketTruncateConfirm : 'Sei sicuro di voler svuotare il cestino?', BasketRemoveConfirm : 'Sei sicuro di voler rimuovere il file "%1" dal cestino?', BasketEmpty : 'Nessun file nel cestino, si deve prima trascinare qualcuno.', BasketCopyFilesHere : 'Copia i File dal Cestino', BasketMoveFilesHere : 'Muove i File dal Cestino', BasketPasteErrorOther : 'File %s errore: %e', BasketPasteMoveSuccess : 'File mossi: %s', BasketPasteCopySuccess : 'File copiati: %s', // 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 : 'Errore di Sistema', 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 : 'Errore nel caricamento del file.', UploadExtIncorrect : 'In questa cartella non sono permessi file con questa estensione.', // Flash Uploads UploadLabel : 'File da Caricare', UploadTotalFiles : 'File:', UploadTotalSize : 'Dimensione:', UploadSend : 'Upload', UploadAddFiles : 'Aggiungi File', UploadClearFiles : 'Elimina File', UploadCancel : 'Annulla il Caricamento', UploadRemove : 'Rimuovi', UploadRemoveTip : 'Rimuove !f', UploadUploaded : '!n% caricato', UploadProcessing : 'Attendere...', // 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', SetSortExtension : 'per Estensione', // Status Bar FilesCountEmpty : '<Nessun file>', FilesCountOne : '1 file', FilesCountMany : '%1 file', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Il percorso di origine e di destino sono uguali.', 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 : 'Il file caricato è stato rinominato a "%1".', 300 : 'Non è stato possibile muovere i file.', 301 : 'Non è stato possibile copiare i file.', 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 già esiste.', 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.', XmlError : 'Non è stato possibile caricare la risposta XML dal server.', XmlEmpty : 'Non è stato possibile caricare la risposta XML dal server. La risposta è vuota.', XmlRawResponse : 'Risposta originale inviata dal server: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Ridimensiona %s', sizeTooBig : 'Non si può usare valori di altezza e larghezza che siano maggiore che le dimensioni originali (%size).', resizeSuccess : 'Immagine ridimensionata.', thumbnailNew : 'Crea una nuova thumbnail', thumbnailSmall : 'Piccolo (%s)', thumbnailMedium : 'Medio (%s)', thumbnailLarge : 'Grande (%s)', newSize : 'Nuove dimensioni', width : 'Larghezza', height : 'Altezza', invalidHeight : 'Altezza non valida.', invalidWidth : 'Larghezza non valida.', invalidName : 'Nome del file non valido.', newImage : 'Crea nuova immagine', noExtensionChange : 'L\'estensione del file non può essere cambiata.', imageSmall : 'L\'immagine originale è molto piccola.', contextMenuName : 'Ridimensiona', lockRatio : 'Blocca rapporto', resetSize : 'Reimposta dimensione' }, // Fileeditor plugin Fileeditor : { save : 'Salva', fileOpenError : 'Non è stato possibile aprire il file.', fileSaveSuccess : 'File salvato.', contextMenuName : 'Modifica', loadingFile : 'Attendere prego. Caricamento del file in corso...' }, Maximize : { maximize : 'Massimizza', minimize : 'Minimizza' }, Gallery : { current : 'Immagine {current} di {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['sk'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nedostupné</span>', confirmCancel : 'Niektoré možnosti boli zmenené. Naozaj chcete zavrieť okno?', ok : 'OK', cancel : 'Zrušiť', confirmationTitle : 'Potvrdenie', messageTitle : 'Informácia', inputTitle : 'Otázka', undo : 'Späť', redo : 'Znovu', skip : 'Preskočiť', skipAll : 'Preskočiť všetko', makeDecision : 'Aký úkon sa má vykonať?', rememberDecision: 'Pamätať si rozhodnutie' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'Nahrávam...', FilesEmpty : 'Adresár je prázdny.', FilesMoved : 'Súbor %1 bol presunutý do %2:%3.', FilesCopied : 'Súbor %1 bol prekopírovaná do %2:%3.', // Basket BasketFolder : 'Košík', BasketClear : 'Vyprázdniť košík', BasketRemove : 'Odstrániť z košíka', BasketOpenFolder : 'Otvoriť nadradený adresár', BasketTruncateConfirm : 'Naozaj chcete odstrániť všetky súbory z košíka?', BasketRemoveConfirm : 'Naozaj chcete odstrániť súbor "%1" z košíka?', BasketEmpty : 'V košíku nie sú žiadne súbory, potiahnite a vložte nejaký.', BasketCopyFilesHere : 'Prekopírovať súbory z košíka', BasketMoveFilesHere : 'Presunúť súbory z košíka', BasketPasteErrorOther : 'Súbor %s error: %e', BasketPasteMoveSuccess : 'Nasledujúce súbory boli presunuté: %s', BasketPasteCopySuccess : 'Nasledujúce súbory boli prekopírované: %s', // 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 : 'Zvoľte miniatúru', View : 'Náhľad', Download : 'Stiahnuť', NewSubFolder : 'Nový podadresár', Rename : 'Premenovať', Delete : 'Zmazať', CopyDragDrop : 'Prekopírovať sem súbor', MoveDragDrop : 'Presunúť sem súbor', // Dialogs RenameDlgTitle : 'Premenovať', NewNameDlgTitle : 'Nové meno', FileExistsDlgTitle : 'Súbor už existuje', SysErrorDlgTitle : 'Systémová chyba', FileOverwrite : 'Prepísať', FileAutorename : 'Auto-premenovanie', // 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 : 'Zrušiť', UploadNoFileMsg : 'Vyberte prosím súbor na Vašom počítači!', UploadNoFolder : 'Pred náhrávaním zvoľte adresár, prosím', UploadNoPerms : 'Nahratie súboru nie je povolené.', UploadUnknError : 'V priebehu posielania súboru sa vyskytla chyba.', UploadExtIncorrect : 'V tomto adresári nie je povolený tento formát súboru.', // Flash Uploads UploadLabel : 'Súbory k nahratiu', UploadTotalFiles : 'Všetky súbory:', UploadTotalSize : 'Celková veľkosť:', UploadSend : 'Prekopírovať na server', UploadAddFiles : 'Pridať súbory', UploadClearFiles : 'Vyčistiť súbory', UploadCancel : 'Zrušiť nahratie', UploadRemove : 'Odstrániť', UploadRemoveTip : 'Odstrániť !f', UploadUploaded : 'Nahraté !n%', UploadProcessing : 'Spracováva sa ...', // 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', SetSortExtension : 'podľa formátu', // Status Bar FilesCountEmpty : '<Prázdny adresár>', FilesCountOne : '1 súbor', FilesCountMany : '%1 súborov', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 k 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 : 'Zdrojové a cieľové cesty sú rovnaké.', 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 : 'Presunutie súborov zlyhalo.', 301 : 'Kopírovanie súborov zlyhalo.', 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úboru nesmie byť prázdne.', FileExists : 'Súbor %s už existuje.', 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.', XmlError : 'Nebolo možné korektne načítať XML odozvu z web serveu.', XmlEmpty : 'Nebolo možné korektne načítať XML odozvu z web serveu. Server vrátil prázdnu odpoveď (odozvu).', XmlRawResponse : 'Neupravená odpoveď zo servera: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Zmeniť veľkosť %s', sizeTooBig : 'Nie je možné nastaviť výšku alebo šírku obrázku na väčšie hodnoty ako originálnu veľkosť (%size).', resizeSuccess : 'Zmena vľkosti obrázku bola úspešne vykonaná.', thumbnailNew : 'Vytvoriť novú miniatúru obrázku', thumbnailSmall : 'Malý (%s)', thumbnailMedium : 'Stredný (%s)', thumbnailLarge : 'Veľký (%s)', newSize : 'Nastaviť novú veľkosť', width : 'Šírka', height : 'Výška', invalidHeight : 'Neplatná výška.', invalidWidth : 'Neplatná šírka.', invalidName : 'Neplatný názov súboru.', newImage : 'Vytvoriť nový obrázok', noExtensionChange : 'Nie je možné zmeniť formát súboru.', imageSmall : 'Zdrojový obrázok je veľmi malý.', contextMenuName : 'Zmeniť veľkosť', lockRatio : 'Zámok', resetSize : 'Pôvodná veľkosť' }, // Fileeditor plugin Fileeditor : { save : 'Uložiť', fileOpenError : 'Nie je možné otvoriť súbor.', fileSaveSuccess : 'Súbor bol úspešne uložený.', contextMenuName : 'Upraviť', loadingFile : 'Súbor sa nahráva, prosím čakať...' }, Maximize : { maximize : 'Maximalizovať', minimize : 'Minimalizovať' }, Gallery : { current : 'Obrázok {current} z {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Dutch * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['nl'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, niet beschikbaar</span>', confirmCancel : 'Enkele opties zijn gewijzigd. Weet u zeker dat u dit dialoogvenster wilt sluiten?', ok : 'OK', cancel : 'Annuleren', confirmationTitle : 'Bevestigen', messageTitle : 'Informatie', inputTitle : 'Vraag', undo : 'Ongedaan maken', redo : 'Opnieuw uitvoeren', skip : 'Overslaan', skipAll : 'Alles overslaan', makeDecision : 'Welke actie moet uitgevoerd worden?', rememberDecision: 'Onthoud mijn keuze' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'd-m-yyyy H:MM', 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 wijzigen? Het bestand kan onbruikbaar worden.', FileRenaming : 'Aanpassen...', FileDelete : 'Weet je zeker dat je het bestand "%1" wilt verwijderen?', FilesLoading : 'Laden...', FilesEmpty : 'De map is leeg.', FilesMoved : 'Bestand %1 is verplaatst naar %2:%3.', FilesCopied : 'Bestand %1 is gekopieerd naar %2:%3.', // Basket BasketFolder : 'Mandje', BasketClear : 'Mandje legen', BasketRemove : 'Verwijder uit het mandje', BasketOpenFolder : 'Bovenliggende map openen', BasketTruncateConfirm : 'Weet je zeker dat je alle bestand uit het mandje wilt verwijderen?', BasketRemoveConfirm : 'Weet je zeker dat je het bestand "%1" uit het mandje wilt verwijderen?', BasketEmpty : 'Geen bestanden in het mandje, sleep bestanden hierheen.', BasketCopyFilesHere : 'Bestanden kopiëren uit het mandje', BasketMoveFilesHere : 'Bestanden verplaatsen uit het mandje', BasketPasteErrorOther : 'Bestand %s foutmelding: %e', BasketPasteMoveSuccess : 'De volgende bestanden zijn verplaatst: %s', BasketPasteCopySuccess : 'De volgende bestanden zijn gekopieerd: %s', // 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 miniatuurafbeelding', View : 'Bekijken', Download : 'Downloaden', NewSubFolder : 'Nieuwe onderliggende map', Rename : 'Naam wijzigen', Delete : 'Verwijderen', CopyDragDrop : 'Bestand hierheen kopiëren', MoveDragDrop : 'Bestand hierheen verplaatsen', // Dialogs RenameDlgTitle : 'Naam wijzigen', NewNameDlgTitle : 'Nieuwe naam', FileExistsDlgTitle : 'Bestand bestaat al', SysErrorDlgTitle : 'Systeemfout', FileOverwrite : 'Overschrijven', FileAutorename : 'Automatisch hernoemen', // 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 a.u.b...)', UploadBtn : 'Upload geselecteerde bestand', UploadBtnCancel : 'Annuleren', UploadNoFileMsg : 'Kies een bestand van je computer.', UploadNoFolder : 'Selecteer a.u.b. een map voordat je gaat uploaden.', UploadNoPerms : 'Uploaden bestand niet toegestaan.', UploadUnknError : 'Fout bij het versturen van het bestand.', UploadExtIncorrect : 'Bestandsextensie is niet toegestaan in deze map.', // Flash Uploads UploadLabel : 'Te uploaden bestanden', UploadTotalFiles : 'Totaal aantal bestanden:', UploadTotalSize : 'Totale grootte:', UploadSend : 'Uploaden', UploadAddFiles : 'Bestanden toevoegen', UploadClearFiles : 'Bestanden wissen', UploadCancel : 'Upload annuleren', UploadRemove : 'Verwijderen', UploadRemoveTip : 'Verwijder !f', UploadUploaded : '!n% geüpload', UploadProcessing : 'Verwerken...', // Settings Panel SetTitle : 'Instellingen', SetView : 'Bekijken:', SetViewThumb : 'Miniatuurafbeelding', SetViewList : 'Lijst', SetDisplay : 'Weergave:', SetDisplayName : 'Bestandsnaam', SetDisplayDate : 'Datum', SetDisplaySize : 'Bestandsgrootte', SetSort : 'Sorteren op:', SetSortName : 'Op bestandsnaam', SetSortDate : 'Op datum', SetSortSize : 'Op grootte', SetSortExtension : 'Op bestandsextensie', // Status Bar FilesCountEmpty : '<Lege map>', FilesCountOne : '1 bestand', FilesCountMany : '%1 bestanden', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Het was niet mogelijk om deze actie uit te voeren. (Fout %1)', Errors : { 10 : 'Ongeldig commando.', 11 : 'Het bestandstype komt niet voor in de aanvraag.', 12 : 'Het gevraagde brontype is niet geldig.', 102 : 'Ongeldige bestands- of mapnaam.', 103 : 'Het verzoek kon niet worden voltooid vanwege autorisatie beperkingen.', 104 : 'Het verzoek kon niet worden voltooid door beperkingen in de rechten op 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 map.', 118 : 'Bron- en doelmap zijn gelijk.', 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 code in het bestand aangetroffen.', 207 : 'Het geüploade bestand is hernoemd naar: "%1".', 300 : 'Bestand(en) verplaatsen is mislukt.', 301 : 'Bestand(en) kopiëren is mislukt.', 500 : 'Het uploaden van een bestand is momenteel niet mogelijk. Contacteer de beheerder en controleer het CKFinder configuratiebestand.', 501 : 'De ondersteuning voor miniatuurafbeeldingen is uitgeschakeld.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'De bestandsnaam mag niet leeg zijn.', FileExists : 'Bestand %s bestaat al.', FolderEmpty : 'De mapnaam mag niet leeg zijn.', FileInvChar : 'De bestandsnaam mag de volgende tekens niet bevatten: \n\\ / : * ? " < > |', FolderInvChar : 'De mapnaam mag de volgende tekens niet bevatten: \n\\ / : * ? " < > |', PopupBlockView : 'Het was niet mogelijk om dit bestand in een nieuw venster te openen. Configureer de browser zodat het de popups van deze website niet blokkeert.', XmlError : 'Het is niet gelukt om de XML van de webserver te laden.', XmlEmpty : 'Het is niet gelukt om de XML van de webserver te laden. De server gaf een leeg resultaat terug.', XmlRawResponse : 'Origineel resultaat van de server: %s' }, // Imageresize plugin Imageresize : { dialogTitle : '%s herschalen', sizeTooBig : 'Het is niet mogelijk om een breedte of hoogte in te stellen die groter is dan de originele afmetingen (%size).', resizeSuccess : 'De afbeelding is met succes herschaald.', thumbnailNew : 'Miniatuurafbeelding maken', thumbnailSmall : 'Klein (%s)', thumbnailMedium : 'Medium (%s)', thumbnailLarge : 'Groot (%s)', newSize : 'Nieuwe afmetingen instellen', width : 'Breedte', height : 'Hoogte', invalidHeight : 'Ongeldige hoogte.', invalidWidth : 'Ongeldige breedte.', invalidName : 'Ongeldige bestandsnaam.', newImage : 'Nieuwe afbeelding maken', noExtensionChange : 'De bestandsextensie kan niet worden gewijzigd.', imageSmall : 'Bronafbeelding is te klein.', contextMenuName : 'Herschalen', lockRatio : 'Afmetingen vergrendelen', resetSize : 'Afmetingen resetten' }, // Fileeditor plugin Fileeditor : { save : 'Opslaan', fileOpenError : 'Kan het bestand niet openen.', fileSaveSuccess : 'Bestand is succesvol opgeslagen.', contextMenuName : 'Wijzigen', loadingFile : 'Bestand laden, even geduld a.u.b...' }, Maximize : { maximize : 'Maximaliseren', minimize : 'Minimaliseren' }, Gallery : { current : 'Afbeelding {current} van {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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' }, // Language direction, 'ltr' or 'rtl'. 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.', // Flash Uploads UploadLabel : 'Files to Upload', UploadTotalFiles : 'Total antal filer:', UploadTotalSize : 'Total størrelse:', UploadSend : 'Upload', UploadAddFiles : 'Tilføj filer', UploadClearFiles : 'Nulstil filer', UploadCancel : 'Annuller upload', UploadRemove : 'Fjern', UploadRemoveTip : 'Fjern !f', UploadUploaded : 'Uploadede !n%', UploadProcessing : 'Udfører...', // 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', SetSortExtension : 'efter filtype', // Status Bar FilesCountEmpty : '<tom mappe>', FilesCountOne : '1 fil', FilesCountMany : '%1 filer', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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.', XmlError : 'Det var ikke muligt at hente den korrekte XML kode fra serveren.', XmlEmpty : 'Det var ikke muligt at hente den korrekte XML kode fra serveren. Serveren returnerede et tomt svar.', XmlRawResponse : 'Serveren returenede følgende output: %s' }, // 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', lockRatio : 'Lås størrelsesforhold', resetSize : 'Nulstil størrelse' }, // Fileeditor plugin Fileeditor : { save : 'Gem', fileOpenError : 'Filen kan ikke åbnes.', fileSaveSuccess : 'Filen er nu gemt.', contextMenuName : 'Rediger', loadingFile : 'Henter fil, vent venligst...' }, Maximize : { maximize : 'Maximér', minimize : 'Minimér' }, Gallery : { current : 'Billede {current} ud af {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Hindi * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['hi'] = { 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: 'मेरा विकल्प याद रखो' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'hi', // 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 : 'ये फोल्डरमें ये फाइल एक्सटेंसन अलाव नही है.', // Flash Uploads UploadLabel : 'अपलोड के लिये फाएल्स', UploadTotalFiles : 'कुल फाएल्स:', UploadTotalSize : 'कुल साएज:', UploadSend : 'अपलोड', UploadAddFiles : 'फाएल एड करें', UploadClearFiles : 'फाइल क्लेयर करें', UploadCancel : 'अपलोड केन्सल करें', UploadRemove : 'रीमूव', UploadRemoveTip : 'रीमुव !f', UploadUploaded : 'अपलोड हो गई !n%', UploadProcessing : 'अपलोड जारी हैं...', // Settings Panel SetTitle : 'सेटिंग्स', SetView : 'व्यू:', SetViewThumb : 'थुम्बनेल्स', SetViewList : 'लिस्ट', SetDisplay : 'डिस्प्ले:', SetDisplayName : 'फाएलका नाम', SetDisplayDate : 'तारीख', SetDisplaySize : 'फाएल साईज', SetSort : 'सोर्टिंग:', SetSortName : 'फाएलनाम से', SetSortDate : 'तारिख से', SetSortSize : 'साईज से', SetSortExtension : 'एक्सटेंसन से', // Status Bar FilesCountEmpty : '<फोल्डर खाली>', FilesCountOne : '1 फाएल', FilesCountMany : '%1 फाएल', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'यह फाएलको नई विंडोमें नही खोल सकते. आपके ब्राउसरको कोफिग करके सब पोप-अप ब्लोक्र्रको बंध करे.', XmlError : 'वेब सर्वरसे XML रिस्पोंस नही लोड कर सके.', XmlEmpty : 'वेब सर्वरसे XML रिस्पोंस नही लोड कर सके. सर्वरने खाली रिस्पोंस भेजा.', XmlRawResponse : 'सर्वरका रो रिस्पोंस: %s' }, // 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 : 'रीसाईज', lockRatio : 'लोक रेटिओ', resetSize : 'रीसेट साईज' }, // Fileeditor plugin Fileeditor : { save : 'सेव', fileOpenError : 'फाएल नहीं खोल सके.', fileSaveSuccess : 'फाएल सेव हो गई है.', contextMenuName : 'एडिट', loadingFile : 'लोडिग फाएल, राह देखे...' }, Maximize : { maximize : 'मैक्सीमईज', minimize : 'मिनीमाईज' }, Gallery : { current : 'इमेज {current} कुल्मिलाके {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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' }, // Language direction, 'ltr' or 'rtl'. 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.', // Flash Uploads UploadLabel : 'Ficheros a subir', UploadTotalFiles : 'Total de ficheros:', UploadTotalSize : 'Tamaño total:', UploadSend : 'Añadir', UploadAddFiles : 'Añadir ficheros', UploadClearFiles : 'Borrar ficheros', UploadCancel : 'Cancelar subida', UploadRemove : 'Quitar', UploadRemoveTip : 'Quitar !f', UploadUploaded : 'Enviado !n%', UploadProcessing : 'Procesando...', // Settings Panel SetTitle : 'Configuración', SetView : 'Vista:', SetViewThumb : 'Iconos', SetViewList : 'Lista', SetDisplay : 'Mostrar:', SetDisplayName : 'Nombre de fichero', SetDisplayDate : 'Fecha', SetDisplaySize : 'Tamaño del fichero', SetSort : 'Ordenar:', SetSortName : 'por Nombre', SetSortDate : 'por Fecha', SetSortSize : 'por Tamaño', SetSortExtension : 'por Extensión', // Status Bar FilesCountEmpty : '<Carpeta vacía>', FilesCountOne : '1 fichero', FilesCountMany : '%1 ficheros', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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.', XmlError : 'No ha sido posible cargar correctamente la respuesta XML del servidor.', XmlEmpty : 'No ha sido posible cargar correctamente la respuesta XML del servidor. El servidor envió una cadena vacía.', XmlRawResponse : 'Respuesta del servidor: %s' }, // 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', lockRatio : 'Proporcional', resetSize : 'Tamaño Original' }, // Fileeditor plugin Fileeditor : { save : 'Guardar', fileOpenError : 'No se puede abrir el fichero.', fileSaveSuccess : 'Fichero guardado correctamente.', contextMenuName : 'Editar', loadingFile : 'Cargando fichero, por favor espere...' }, Maximize : { maximize : 'Maximizar', minimize : 'Minimizar' }, Gallery : { current : 'Imagen {current} de {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Estonian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['et'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, pole saadaval</span>', confirmCancel : 'Mõned valikud on muudetud. Kas oled kindel, et tahad dialoogiakna sulgeda?', ok : 'Olgu', cancel : 'Loobu', confirmationTitle : 'Kinnitus', messageTitle : 'Andmed', inputTitle : 'Küsimus', undo : 'Võta tagasi', redo : 'Tee uuesti', skip : 'Jäta vahele', skipAll : 'Jäta kõik vahele', makeDecision : 'Mida tuleks teha?', rememberDecision: 'Jäta valik meelde' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'et', // 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 H:MM', DateAmPm : ['EL', 'PL'], // Folders FoldersTitle : 'Kaustad', FolderLoading : 'Laadimine...', FolderNew : 'Palun sisesta uue kataloogi nimi: ', FolderRename : 'Palun sisesta uue kataloogi nimi: ', FolderDelete : 'Kas tahad kindlasti kausta "%1" kustutada?', FolderRenaming : ' (ümbernimetamine...)', FolderDeleting : ' (kustutamine...)', // Files FileRename : 'Palun sisesta faili uus nimi: ', FileRenameExt : 'Kas oled kindel, et tahad faili laiendit muuta? Fail võib muutuda kasutamatuks.', FileRenaming : 'Ümbernimetamine...', FileDelete : 'Kas oled kindel, et tahad kustutada faili "%1"?', FilesLoading : 'Laadimine...', FilesEmpty : 'See kaust on tühi.', FilesMoved : 'Fail %1 liigutati kohta %2:%3.', FilesCopied : 'Fail %1 kopeeriti kohta %2:%3.', // Basket BasketFolder : 'Korv', BasketClear : 'Tühjenda korv', BasketRemove : 'Eemalda korvist', BasketOpenFolder : 'Ava ülemine kaust', BasketTruncateConfirm : 'Kas tahad tõesti eemaldada korvist kõik failid?', BasketRemoveConfirm : 'Kas tahad tõesti eemaldada korvist faili "%1"?', BasketEmpty : 'Korvis ei ole ühtegi faili, lohista mõni siia.', BasketCopyFilesHere : 'Failide kopeerimine korvist', BasketMoveFilesHere : 'Failide liigutamine korvist', BasketPasteErrorOther : 'Faili %s viga: %e', BasketPasteMoveSuccess : 'Järgnevad failid liigutati: %s', BasketPasteCopySuccess : 'Järgnevad failid kopeeriti: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Laadi üles', UploadTip : 'Laadi üles uus fail', Refresh : 'Värskenda', Settings : 'Sätted', Help : 'Abi', HelpTip : 'Abi', // Context Menus Select : 'Vali', SelectThumbnail : 'Vali pisipilt', View : 'Kuva', Download : 'Laadi alla', NewSubFolder : 'Uus alamkaust', Rename : 'Nimeta ümber', Delete : 'Kustuta', CopyDragDrop : 'Kopeeri fail siia', MoveDragDrop : 'Liiguta fail siia', // Dialogs RenameDlgTitle : 'Ümbernimetamine', NewNameDlgTitle : 'Uue nime andmine', FileExistsDlgTitle : 'Fail on juba olemas', SysErrorDlgTitle : 'Süsteemi viga', FileOverwrite : 'Kirjuta üle', FileAutorename : 'Nimeta automaatselt ümber', // Generic OkBtn : 'Olgu', CancelBtn : 'Loobu', CloseBtn : 'Sulge', // Upload Panel UploadTitle : 'Uue faili üleslaadimine', UploadSelectLbl : 'Vali üleslaadimiseks fail', UploadProgressLbl : '(Üleslaadimine, palun oota...)', UploadBtn : 'Laadi valitud fail üles', UploadBtnCancel : 'Loobu', UploadNoFileMsg : 'Palun vali fail oma arvutist.', UploadNoFolder : 'Palun vali enne üleslaadimist kataloog.', UploadNoPerms : 'Failide üleslaadimine pole lubatud.', UploadUnknError : 'Viga faili saatmisel.', UploadExtIncorrect : 'Selline faili laiend pole selles kaustas lubatud.', // Flash Uploads UploadLabel : 'Üleslaaditavad failid', UploadTotalFiles : 'Faile kokku:', UploadTotalSize : 'Kogusuurus:', UploadSend : 'Laadi üles', UploadAddFiles : 'Lisa faile', UploadClearFiles : 'Eemalda failid', UploadCancel : 'Katkesta üleslaadimine', UploadRemove : 'Eemalda', UploadRemoveTip : 'Eemalda !f', UploadUploaded : '!n% üles laaditud', UploadProcessing : 'Töötlemine...', // Settings Panel SetTitle : 'Sätted', SetView : 'Vaade:', SetViewThumb : 'Pisipildid', SetViewList : 'Loend', SetDisplay : 'Kuva:', SetDisplayName : 'Faili nimi', SetDisplayDate : 'Kuupäev', SetDisplaySize : 'Faili suurus', SetSort : 'Sortimine:', SetSortName : 'faili nime järgi', SetSortDate : 'kuupäeva järgi', SetSortSize : 'suuruse järgi', SetSortExtension : 'laiendi järgi', // Status Bar FilesCountEmpty : '<tühi kaust>', FilesCountOne : '1 fail', FilesCountMany : '%1 faili', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Päringu täitmine ei olnud võimalik. (Viga %1)', Errors : { 10 : 'Vigane käsk.', 11 : 'Allika liik ei olnud päringus määratud.', 12 : 'Päritud liik ei ole sobiv.', 102 : 'Sobimatu faili või kausta nimi.', 103 : 'Piiratud õiguste tõttu ei olnud võimalik päringut lõpetada.', 104 : 'Failisüsteemi piiratud õiguste tõttu ei olnud võimalik päringut lõpetada.', 105 : 'Sobimatu faililaiend.', 109 : 'Vigane päring.', 110 : 'Tundmatu viga.', 115 : 'Sellenimeline fail või kaust on juba olemas.', 116 : 'Kausta ei leitud. Palun värskenda lehte ja proovi uuesti.', 117 : 'Faili ei leitud. Palun värskenda lehte ja proovi uuesti.', 118 : 'Lähte- ja sihtasukoht on sama.', 201 : 'Samanimeline fail on juba olemas. Üles laaditud faili nimeks pandi "%1".', 202 : 'Vigane fail.', 203 : 'Vigane fail. Fail on liiga suur.', 204 : 'Üleslaaditud fail on rikutud.', 205 : 'Serverisse üleslaadimiseks pole ühtegi ajutiste failide kataloogi.', 206 : 'Üleslaadimine katkestati turvakaalutlustel. Fail sisaldab HTMLi sarnaseid andmeid.', 207 : 'Üleslaaditud faili nimeks pandi "%1".', 300 : 'Faili(de) liigutamine nurjus.', 301 : 'Faili(de) kopeerimine nurjus.', 500 : 'Failide sirvija on turvakaalutlustel keelatud. Palun võta ühendust oma süsteemi administraatoriga ja kontrolli CKFinderi seadistusfaili.', 501 : 'Pisipiltide tugi on keelatud.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Faili nimi ei tohi olla tühi.', FileExists : 'Fail nimega %s on juba olemas.', FolderEmpty : 'Kausta nimi ei tohi olla tühi.', FileInvChar : 'Faili nimi ei tohi sisaldada ühtegi järgnevatest märkidest: \n\\ / : * ? " < > |', FolderInvChar : 'Faili nimi ei tohi sisaldada ühtegi järgnevatest märkidest: \n\\ / : * ? " < > |', PopupBlockView : 'Faili avamine uues aknas polnud võimalik. Palun seadista oma brauserit ning keela kõik hüpikakende blokeerijad selle saidi jaoks.', XmlError : 'XML vastust veebiserverist polnud võimalik korrektselt laadida.', XmlEmpty : 'XML vastust veebiserverist polnud võimalik korrektselt laadida. Serveri vastus oli tühi.', XmlRawResponse : 'Serveri vastus toorkujul: %s' }, // Imageresize plugin Imageresize : { dialogTitle : '%s suuruse muutmine', sizeTooBig : 'Pildi kõrgust ega laiust ei saa määrata suuremaks pildi esialgsest vastavast mõõtmest (%size).', resizeSuccess : 'Pildi suuruse muutmine õnnestus.', thumbnailNew : 'Tee uus pisipilt', thumbnailSmall : 'Väike (%s)', thumbnailMedium : 'Keskmine (%s)', thumbnailLarge : 'Suur (%s)', newSize : 'Määra uus suurus', width : 'Laius', height : 'Kõrgus', invalidHeight : 'Sobimatu kõrgus.', invalidWidth : 'Sobimatu laius.', invalidName : 'Sobimatu faili nimi.', newImage : 'Loo uus pilt', noExtensionChange : 'Faili laiendit pole võimalik muuta.', imageSmall : 'Lähtepilt on liiga väike.', contextMenuName : 'Muuda suurust', lockRatio : 'Lukusta külgede suhe', resetSize : 'Lähtesta suurus' }, // Fileeditor plugin Fileeditor : { save : 'Salvesta', fileOpenError : 'Faili avamine pole võimalik.', fileSaveSuccess : 'Faili salvestamine õnnestus.', contextMenuName : 'Muuda', loadingFile : 'Faili laadimine, palun oota...' }, Maximize : { maximize : 'Maksimeeri', minimize : 'Minimeeri' }, Gallery : { current : 'Pilt {current}, kokku {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Brazilian Portuguese * language. */ /** * Contains 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">, indisponível</span>', 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 : 'Ignorar', skipAll : 'Ignorar todos', makeDecision : 'Que ação deve ser tomada?', rememberDecision: 'Lembra minha decisão' }, // Language direction, 'ltr' or 'rtl'. 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 : 'Nenhum arquivo na cesta, arraste alguns antes.', BasketCopyFilesHere : 'Copia Arquivos da Cesta', BasketMoveFilesHere : 'Move os Arquivos da Cesta', BasketPasteErrorOther : 'Arquivo %s erro: %e', 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 : 'Erro de Sistema', 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.', // Flash Uploads UploadLabel : 'Arquivos para Enviar', UploadTotalFiles : 'Arquivos:', UploadTotalSize : 'Tamanho:', UploadSend : 'Enviar arquivo', UploadAddFiles : 'Adicionar Arquivos', UploadClearFiles : 'Remover Arquivos', UploadCancel : 'Cancelar Envio', UploadRemove : 'Remover', UploadRemoveTip : 'Remover !f', UploadUploaded : '!n% enviado', UploadProcessing : 'Processando...', // 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', SetSortExtension : 'por Extensão', // Status Bar FilesCountEmpty : '<Pasta vazia>', FilesCountOne : '1 arquivo', FilesCountMany : '%1 arquivos', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Origem e destino são iguais.', 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.', XmlError : 'Não foi possível carregar a resposta XML enviada pelo servidor.', XmlEmpty : 'Não foi possível carregar a resposta XML enviada pelo servidor. Resposta vazia..', XmlRawResponse : 'Resposta original enviada pelo servidor: %s' }, // 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', lockRatio : 'Travar Proporções', resetSize : 'Redefinir para o Tamanho Original' }, // 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...' }, Maximize : { maximize : 'Maximizar', minimize : 'Minimizar' }, Gallery : { current : 'Imagem {current} de {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['zh-tw'] = { 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 were changed. Are you sure you want to close the dialog window?', // 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 }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : '載入中...', FilesEmpty : 'The folder is empty.', // MISSING FilesMoved : 'File %1 moved to %2:%3.', // MISSING FilesCopied : 'File %1 copied to %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 and 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 : '取消', UploadNoFileMsg : '請從你的電腦選擇一個檔案.', UploadNoFolder : 'Please select a 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 // Flash Uploads UploadLabel : 'Files to Upload', // MISSING UploadTotalFiles : 'Total Files:', // MISSING UploadTotalSize : 'Total Size:', // MISSING UploadSend : '上傳檔案', UploadAddFiles : 'Add Files', // MISSING UploadClearFiles : 'Clear Files', // MISSING UploadCancel : 'Cancel Upload', // MISSING UploadRemove : 'Remove', // MISSING UploadRemoveTip : 'Remove !f', // MISSING UploadUploaded : 'Uploaded !n%', // MISSING UploadProcessing : 'Processing...', // MISSING // Settings Panel SetTitle : '設定', SetView : '瀏覽方式:', SetViewThumb : '縮圖預覽', SetViewList : '清單列表', SetDisplay : '顯示欄位:', SetDisplayName : '檔案名稱', SetDisplayDate : '檔案日期', SetDisplaySize : '檔案大小', SetSort : '排序方式:', SetSortName : '依 檔案名稱', SetSortDate : '依 檔案日期', SetSortSize : '依 檔案大小', SetSortExtension : 'by Extension', // MISSING // Status Bar FilesCountEmpty : '<此目錄沒有任何檔案>', FilesCountOne : '1 個檔案', FilesCountMany : '%1 個檔案', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', // MISSING Gb : '%1 GB', // MISSING SizePerSecond : '%1/s', // MISSING // 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 : '無法在新視窗開啟檔案 ! 請檢查瀏覽器的設定並且針對這個網站 關閉 <封鎖彈跳視窗> 這個功能 !', XmlError : 'It was not possible to properly load the XML response from the web server.', // MISSING XmlEmpty : 'It was not possible to load the XML response from the web server. The server returned an empty response.', // MISSING XmlRawResponse : 'Raw response from the server: %s' // MISSING }, // 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 a new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set a new size', // MISSING width : 'Width', // MISSING height : 'Height', // MISSING invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create a new image', // MISSING noExtensionChange : 'File extension cannot be changed.', // MISSING imageSmall : 'Source image is too small.', // MISSING contextMenuName : 'Resize', // MISSING lockRatio : 'Lock ratio', // MISSING resetSize : 'Reset size' // 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 }, Maximize : { maximize : 'Maximize', // MISSING minimize : 'Minimize' // MISSING }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Gujarati * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['gu'] = { 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: 'મારો વિકલ્પ યાદ રાખો' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'gu', // 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 : 'આ ફોલ્ડરમાં આ એક્ષટેનસન શક્ય નથી.', // Flash Uploads UploadLabel : 'અપલોડ કરવાની ફાઈલો', UploadTotalFiles : 'ટોટલ ફાઈલ્સ:', UploadTotalSize : 'ટોટલ જગ્યા:', UploadSend : 'અપલોડ', UploadAddFiles : 'ફાઈલ ઉમેરો', UploadClearFiles : 'ક્લીયર ફાઈલ્સ', UploadCancel : 'અપલોડ રદ કરો', UploadRemove : 'રીમૂવ', UploadRemoveTip : 'રીમૂવ !f', UploadUploaded : 'અપ્લોડેડ !n%', UploadProcessing : 'પ્રોસેસ ચાલુ છે...', // Settings Panel SetTitle : 'સેટિંગ્સ', SetView : 'વ્યુ:', SetViewThumb : 'થામ્ન્બનેલ્સ', SetViewList : 'લીસ્ટ', SetDisplay : 'ડિસ્પ્લે:', SetDisplayName : 'ફાઈલનું નામ', SetDisplayDate : 'તારીખ', SetDisplaySize : 'ફાઈલ સાઈઝ', SetSort : 'સોર્ટિંગ:', SetSortName : 'ફાઈલના નામ પર', SetSortDate : 'તારીખ પર', SetSortSize : 'સાઈઝ પર', SetSortExtension : 'એક્ષટેનસન પર', // Status Bar FilesCountEmpty : '<ફોલ્ડર ખાલી>', FilesCountOne : '1 ફાઈલ', FilesCountMany : '%1 ફાઈલો', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'નવી વિન્ડોમાં ફાઈલ ખોલવી શક્ય નથી. તમારું બ્રાઉઝર કોન્ફીગ કરી અને આ સાઈટ માટેના બથા પોપઅપ બ્લોકર બંધ કરો.', XmlError : 'વેબ સર્વેરમાંથી XML રીર્સ્પોન્સ લેવો શક્ય નથી.', XmlEmpty : 'વેબ સર્વેરમાંથી XML રીર્સ્પોન્સ લેવો શક્ય નથી. સર્વરે ખાલી રિસ્પોન્સ આપ્યો.', XmlRawResponse : 'સર્વર પરનો રો રિસ્પોન્સ: %s' }, // 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 : 'રીસાઈઝ', lockRatio : 'લોક રેષીઓ', resetSize : 'રીસેટ સાઈઝ' }, // Fileeditor plugin Fileeditor : { save : 'સેવ', fileOpenError : 'ફાઈલ ખોલી સકાય નહી.', fileSaveSuccess : 'ફાઈલ સેવ થઈ ગઈ છે.', contextMenuName : 'એડીટ', loadingFile : 'લોડીંગ ફાઈલ, રાહ જુવો...' }, Maximize : { maximize : 'મેક્ષિમાઈઝ', minimize : 'મિનીમાઈઝ' }, Gallery : { current : 'ઈમેજ {current} બધામાંથી {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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' }, // Language direction, 'ltr' or 'rtl'. 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 : 'Foldery', FolderLoading : 'Ładowanie...', FolderNew : 'Podaj nazwę nowego folderu: ', FolderRename : 'Podaj nową nazwę folderu: ', FolderDelete : 'Czy na pewno chcesz usunąć folder "%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 : 'Folder 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 folder 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 podfolder', Rename : 'Zmień nazwę', Delete : 'Usuń', CopyDragDrop : 'Skopiuj plik tutaj', MoveDragDrop : 'Przenieś plik tutaj', // Dialogs RenameDlgTitle : 'Zmiana nazwy', NewNameDlgTitle : 'Nowa nazwa', FileExistsDlgTitle : 'Plik już istnieje', SysErrorDlgTitle : 'Błąd systemu', 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 folder 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 folderze.', // Flash Uploads UploadLabel : 'Pliki do wysłania', UploadTotalFiles : 'Ilość razem:', UploadTotalSize : 'Rozmiar razem:', UploadSend : 'Wyślij', UploadAddFiles : 'Dodaj pliki', UploadClearFiles : 'Wyczyść wszystko', UploadCancel : 'Anuluj wysyłanie', UploadRemove : 'Usuń', UploadRemoveTip : 'Usuń !f', UploadUploaded : 'Wysłano: !n%', UploadProcessing : 'Przetwarzanie...', // 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', SetSortExtension : 'wg rozszerzenia', // Status Bar FilesCountEmpty : '<Pusty folder>', FilesCountOne : '1 plik', FilesCountMany : 'Ilość plików: %1', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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: typ danych (resource type).', 12 : 'Nieprawidłowy typ danych (resource type).', 102 : 'Nieprawidłowa nazwa pliku lub folderu.', 103 : 'Wykonanie operacji nie jest możliwe: brak uprawnień.', 104 : 'Wykonanie operacji nie powiodło się z powodu niewystarczających uprawnień do systemu plików.', 105 : 'Nieprawidłowe rozszerzenie.', 109 : 'Nieprawiłowe żądanie.', 110 : 'Niezidentyfikowany błąd.', 115 : 'Plik lub folder o podanej nazwie już istnieje.', 116 : 'Nie znaleziono folderu. 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 przekracza 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 folderu nie może być pusta.', FileInvChar : 'Nazwa pliku nie może zawierać żadnego z podanych znaków: \n\\ / : * ? " < > |', FolderInvChar : 'Nazwa folderu nie może zawierać żadnego z podanych znaków: \n\\ / : * ? " < > |', PopupBlockView : 'Otwarcie pliku w nowym oknie nie powiodło się. Należy zmienić konfigurację przeglądarki i wyłączyć wszelkie blokady okienek popup dla tej strony.', XmlError : 'Nie można poprawnie załadować odpowiedzi XML z serwera WWW.', XmlEmpty : 'Nie można załadować odpowiedzi XML z serwera WWW. Serwer zwrócił pustą odpowiedź.', XmlRawResponse : 'Odpowiedź serwera: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Zmiana rozmiaru %s', sizeTooBig : 'Nie możesz zmienić wysokości lub szerokości na wartość większą od oryginalnego rozmiaru (%size).', resizeSuccess : 'Obrazek został pomyślnie przeskalowany.', thumbnailNew : 'Utwórz nową miniaturkę', thumbnailSmall : 'Mała (%s)', thumbnailMedium : 'Średnia (%s)', thumbnailLarge : 'Duża (%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', lockRatio : 'Zablokuj proporcje', resetSize : 'Przywróć 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ć...' }, Maximize : { maximize : 'Maksymalizuj', minimize : 'Minimalizuj' }, Gallery : { current : 'Obrazek {current} z {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Czech * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['cs'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nedostupné</span>', confirmCancel : 'Některá z nastavení byla změněna. Skutečně chcete dialogové okno zavřít?', ok : 'OK', cancel : 'Zrušit', confirmationTitle : 'Potvrzení', messageTitle : 'Informace', inputTitle : 'Otázka', undo : 'Zpět', redo : 'Znovu', skip : 'Přeskočit', skipAll : 'Přeskočit vše', makeDecision : 'Co by se mělo provést?', rememberDecision: 'Zapamatovat si mé rozhodnutí' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'cs', 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 : 'd/m/yyyy H:MM', DateAmPm : ['AM', 'PM'], // Folders FoldersTitle : 'Složky', FolderLoading : 'Načítání...', FolderNew : 'Zadejte název nové složky: ', FolderRename : 'Zadejte nový název složky: ', FolderDelete : 'Opravdu chcete složku "%1" smazat?', FolderRenaming : ' (Přejmenovávání...)', FolderDeleting : ' (Mazání...)', // Files FileRename : 'Zadejte nový název souboru: ', FileRenameExt : 'Opravdu chcete změnit příponu souboru? Soubor se může stát nepoužitelným.', FileRenaming : 'Přejmenovávání...', FileDelete : 'Opravdu chcete smazat soubor "%1"?', FilesLoading : 'Načítání...', FilesEmpty : 'Prázdná složka.', FilesMoved : 'Soubor %1 přesunut do %2:%3.', FilesCopied : 'Soubor %1 zkopírován do %2:%3.', // Basket BasketFolder : 'Košík', BasketClear : 'Vyčistit Košík', BasketRemove : 'Odstranit z Košíku', BasketOpenFolder : 'Otevřít nadřazenou složku', BasketTruncateConfirm : 'Opravdu chcete z Košíku odstranit všechny soubory?', BasketRemoveConfirm : 'Opravdu chcete odstranit soubor "%1" z Košíku?', BasketEmpty : 'V Košíku nejsou žádné soubory, tak sem některé přetáhněte.', BasketCopyFilesHere : 'Kopírovat soubory z Košíku', BasketMoveFilesHere : 'Přesunout soubory z Košíku', BasketPasteErrorOther : 'Soubor %s chyba: %e', BasketPasteMoveSuccess : 'Následující soubory byly přesunuty: %s', BasketPasteCopySuccess : 'Následující soubory byly zkopírovány: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Nahrát', UploadTip : 'Nahrát nový soubor', Refresh : 'Znovu načíst', Settings : 'Nastavení', Help : 'Nápověda', HelpTip : 'Nápověda', // Context Menus Select : 'Vybrat', SelectThumbnail : 'Vybrat náhled', View : 'Zobrazit', Download : 'Uložit jako', NewSubFolder : 'Nová podsložka', Rename : 'Přejmenovat', Delete : 'Smazat', CopyDragDrop : 'Soubor zkopírovat sem', MoveDragDrop : 'Soubor přesunout sem', // Dialogs RenameDlgTitle : 'Přejmenovat', NewNameDlgTitle : 'Nový název', FileExistsDlgTitle : 'Soubor již existuje', SysErrorDlgTitle : 'Chyba systému', FileOverwrite : 'Přepsat', FileAutorename : 'Automaticky přejmenovat', // Generic OkBtn : 'OK', CancelBtn : 'Zrušit', CloseBtn : 'Zavřít', // Upload Panel UploadTitle : 'Nahrát nový soubor', UploadSelectLbl : 'Zvolit soubor k nahrání', UploadProgressLbl : '(Probíhá nahrávání, čekejte...)', UploadBtn : 'Nahrát zvolený soubor', UploadBtnCancel : 'Zrušit', UploadNoFileMsg : 'Vyberte prosím soubor z Vašeho počítače.', UploadNoFolder : 'Před nahráváním vyberte složku prosím.', UploadNoPerms : 'Nahrávání souborů není povoleno.', UploadUnknError : 'Chyba při posílání souboru.', UploadExtIncorrect : 'Přípona souboru není v této složce povolena.', // Flash Uploads UploadLabel : 'Soubory k nahrání', UploadTotalFiles : 'Celkem souborů:', UploadTotalSize : 'Celková velikost:', UploadSend : 'Nahrát', UploadAddFiles : 'Přidat soubory', UploadClearFiles : 'Vyčistit soubory', UploadCancel : 'Zrušit nahrávání', UploadRemove : 'Odstranit', UploadRemoveTip : 'Odstranit !f', UploadUploaded : 'Nahráno !n%', UploadProcessing : 'Zpracovávání...', // Settings Panel SetTitle : 'Nastavení', SetView : 'Zobrazení:', SetViewThumb : 'Náhled', SetViewList : 'Seznam', SetDisplay : 'Zobrazit:', SetDisplayName : 'Název', SetDisplayDate : 'Datum', SetDisplaySize : 'Velikost', SetSort : 'Seřazení:', SetSortName : 'Podle názvu', SetSortDate : 'Podle data', SetSortSize : 'Podle velikosti', SetSortExtension : 'Podle přípony', // Status Bar FilesCountEmpty : '<Prázdná složka>', FilesCountOne : '1 soubor', FilesCountMany : '%1 souborů', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Příkaz nebylo možné dokončit. (Chyba %1)', Errors : { 10 : 'Neplatný příkaz.', 11 : 'Typ zdroje nebyl v požadavku určen.', 12 : 'Požadovaný typ zdroje není platný.', 102 : 'Špatné název souboru, nebo složky.', 103 : 'Nebylo možné příkaz dokončit kvůli omezení oprávnění.', 104 : 'Nebylo možné příkaz dokončit kvůli omezení oprávnění souborového systému.', 105 : 'Neplatná přípona souboru.', 109 : 'Neplatný požadavek.', 110 : 'Neznámá chyba.', 115 : 'Soubor nebo složka se stejným názvem již existuje.', 116 : 'Složka nenalezena, prosím obnovte a zkuste znovu.', 117 : 'Soubor nenalezen, prosím obnovte seznam souborů a zkuste znovu.', 118 : 'Cesty zdroje a cíle jsou stejné.', 201 : 'Soubor se stejným názvem je již dostupný, nahraný soubor byl přejmenován na "%1".', 202 : 'Neplatný soubor.', 203 : 'Neplatný soubor. Velikost souboru je příliš velká.', 204 : 'Nahraný soubor je poškozen.', 205 : 'Na serveru není dostupná dočasná složka pro nahrávání.', 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 : 'Přesunování souboru(ů) selhalo.', 301 : 'Kopírování souboru(ů) selhalo.', 500 : 'Průzkumník souborů je z bezpečnostních důvodů zakázán. Zdělte to prosím správci systému a zkontrolujte soubor nastavení CKFinder.', 501 : 'Podpora náhledů je zakázána.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Název souboru nemůže být prázdný.', FileExists : 'Soubor %s již existuje.', 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 : 'Soubor nebylo možné otevřít do nového okna. Prosím nastavte si Váš prohlížeč a zakažte veškeré blokování vyskakovacích oken.', XmlError : 'Nebylo možné správně načíst XML odpověď z internetového serveru.', XmlEmpty : 'Nebylo možné načíst XML odpověď z internetového serveru. Server vrátil prázdnou odpověď.', XmlRawResponse : 'Čistá odpověď od serveru: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Změnit velikost %s', sizeTooBig : 'Nelze nastavit šířku či výšku obrázku na hodnotu vyšší než původní velikost (%size).', resizeSuccess : 'Úspěšně změněna velikost obrázku.', thumbnailNew : 'Vytvořit nový náhled', thumbnailSmall : 'Malý (%s)', thumbnailMedium : 'Střední (%s)', thumbnailLarge : 'Velký (%s)', newSize : 'Nastavit novou velikost', width : 'Šířka', height : 'Výška', invalidHeight : 'Neplatná výška.', invalidWidth : 'Neplatná šířka.', invalidName : 'Neplatný název souboru.', newImage : 'Vytvořit nový obrázek', noExtensionChange : 'Příponu souboru nelze změnit.', imageSmall : 'Zdrojový obrázek je příliš malý.', contextMenuName : 'Změnit velikost', lockRatio : 'Uzamknout poměr', resetSize : 'Původní velikost' }, // Fileeditor plugin Fileeditor : { save : 'Uložit', fileOpenError : 'Soubor nelze otevřít.', fileSaveSuccess : 'Soubor úspěšně uložen.', contextMenuName : 'Upravit', loadingFile : 'Načítání souboru, čekejte prosím...' }, Maximize : { maximize : 'Maximalizovat', minimize : 'Minimalizovat' }, Gallery : { current : 'Obrázek {current} z {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Croatian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['hr'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nedostupno</span>', confirmCancel : 'Neke od opcija su promjenjene. Sigurno želite zatvoriti prozor??', ok : 'U redu', cancel : 'Poništi', confirmationTitle : 'Potvrda', messageTitle : 'Informacija', inputTitle : 'Pitanje', undo : 'Poništi', redo : 'Preuredi', skip : 'Preskoči', skipAll : 'Preskoči sve', makeDecision : 'Što bi trebali napraviti?', rememberDecision: 'Zapamti moj izbor' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'hr', // 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 : 'Direktoriji', FolderLoading : 'Učitavam...', FolderNew : 'Unesite novo ime direktorija: ', FolderRename : 'Unesite novo ime direktorija: ', FolderDelete : 'Sigurno želite obrisati direktorij "%1"?', FolderRenaming : ' (Mijenjam ime...)', FolderDeleting : ' (Brišem...)', // Files FileRename : 'Unesite novo ime datoteke: ', FileRenameExt : 'Sigurno želite promijeniti vrstu datoteke? Datoteka može postati neiskoristiva.', FileRenaming : 'Mijenjam ime...', FileDelete : 'Sigurno želite obrisati datoteku "%1"?', FilesLoading : 'Učitavam...', FilesEmpty : 'Direktorij je prazan.', FilesMoved : 'Datoteka %1 premještena u %2:%3.', FilesCopied : 'Datoteka %1 kopirana u %2:%3.', // Basket BasketFolder : 'Košara', BasketClear : 'Isprazni košaru', BasketRemove : 'Ukloni iz košare', BasketOpenFolder : 'Otvori nadređeni direktorij', BasketTruncateConfirm : 'Sigurno želite obrisati sve datoteke iz košare?', BasketRemoveConfirm : 'Sigurno želite obrisati datoteku "%1" iz košare?', BasketEmpty : 'Nema niti jedne datoteke, ubacite koju.', BasketCopyFilesHere : 'Kopiraj datoteke iz košare', BasketMoveFilesHere : 'Premjesti datoteke iz košare', BasketPasteErrorOther : 'Datoteke %s greška: %e', BasketPasteMoveSuccess : 'Sljedeće datoteke su premještene: %s', BasketPasteCopySuccess : 'Sljedeće datoteke su kopirane: %s', // Toolbar Buttons (some used elsewhere) Upload : 'Pošalji', UploadTip : 'Pošalji nove datoteke na server', Refresh : 'Osvježi', Settings : 'Postavke', Help : 'Pomoć', HelpTip : 'Pomoć', // Context Menus Select : 'Odaberi', SelectThumbnail : 'Odaberi manju sliku', View : 'Pogledaj', Download : 'Skini', NewSubFolder : 'Novi poddirektorij', Rename : 'Promijeni naziv', Delete : 'Obriši', CopyDragDrop : 'Kopiraj datoteku ovdje', MoveDragDrop : 'Premjesti datoteku ovdje', // Dialogs RenameDlgTitle : 'Promijeni naziv', NewNameDlgTitle : 'Novi naziv', FileExistsDlgTitle : 'Datoteka već postoji', SysErrorDlgTitle : 'Greška sustava', FileOverwrite : 'Prepiši', FileAutorename : 'Automatska promjena naziva', // Generic OkBtn : 'U redu', CancelBtn : 'Poništi', CloseBtn : 'Zatvori', // Upload Panel UploadTitle : 'Pošalji novu datoteku', UploadSelectLbl : 'Odaberi datoteku za slanje', UploadProgressLbl : '(Slanje u tijeku, molimo pričekajte...)', UploadBtn : 'Pošalji odabranu datoteku', UploadBtnCancel : 'Poništi', UploadNoFileMsg : 'Odaberite datoteku na Vašem računalu.', UploadNoFolder : 'Odaberite direktorije prije slanja.', UploadNoPerms : 'Slanje datoteka nije dozvoljeno.', UploadUnknError : 'Greška kod slanja datoteke.', UploadExtIncorrect : 'Vrsta datoteka nije dozvoljena.', // Flash Uploads UploadLabel : 'Datoteka za slanje:', UploadTotalFiles : 'Ukupno datoteka:', UploadTotalSize : 'Ukupna veličina:', UploadSend : 'Pošalji', UploadAddFiles : 'Dodaj datoteke', UploadClearFiles : 'Izbaci datoteke', UploadCancel : 'Poništi slanje', UploadRemove : 'Ukloni', UploadRemoveTip : 'Ukloni !f', UploadUploaded : 'Poslano !n%', UploadProcessing : 'Obrađujem...', // Settings Panel SetTitle : 'Postavke', SetView : 'Pregled:', SetViewThumb : 'Mala slika', SetViewList : 'Lista', SetDisplay : 'Prikaz:', SetDisplayName : 'Naziv datoteke', SetDisplayDate : 'Datum', SetDisplaySize : 'Veličina datoteke', SetSort : 'Sortiranje:', SetSortName : 'po nazivu', SetSortDate : 'po datumu', SetSortSize : 'po veličini', SetSortExtension : 'po vrsti datoteke', // Status Bar FilesCountEmpty : '<Prazan direktorij>', FilesCountOne : '1 datoteka', FilesCountMany : '%1 datoteka', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/s', // Connector Error Messages. ErrorUnknown : 'Nije moguće završiti zahtjev. (Greška %1)', Errors : { 10 : 'Nepoznata naredba.', 11 : 'Nije navedena vrsta u zahtjevu.', 12 : 'Zatražena vrsta nije važeća.', 102 : 'Neispravno naziv datoteke ili direktoija.', 103 : 'Nije moguće izvršiti zahtjev zbog ograničenja pristupa.', 104 : 'Nije moguće izvršiti zahtjev zbog ograničenja postavka sustava.', 105 : 'Nedozvoljena vrsta datoteke.', 109 : 'Nedozvoljen zahtjev.', 110 : 'Nepoznata greška.', 115 : 'Datoteka ili direktorij s istim nazivom već postoji.', 116 : 'Direktorij nije pronađen. Osvježite stranicu i pokušajte ponovo.', 117 : 'Datoteka nije pronađena. Osvježite listu datoteka i pokušajte ponovo.', 118 : 'Putanje izvora i odredišta su jednake.', 201 : 'Datoteka s istim nazivom već postoji. Poslana datoteka je promjenjena u "%1".', 202 : 'Neispravna datoteka.', 203 : 'Neispravna datoteka. Veličina datoteke je prevelika.', 204 : 'Poslana datoteka je neispravna.', 205 : 'Ne postoji privremeni direktorij za slanje na server.', 206 : 'Slanje je poništeno zbog sigurnosnih postavki. Naziv datoteke sadrži HTML podatke.', 207 : 'Poslana datoteka je promjenjena u "%1".', 300 : 'Premještanje datoteke(a) nije uspjelo.', 301 : 'Kopiranje datoteke(a) nije uspjelo.', 500 : 'Pretraživanje datoteka nije dozvoljeno iz sigurnosnih razloga. Molimo kontaktirajte administratora sustava kako bi provjerili postavke CKFinder konfiguracijske datoteke.', 501 : 'The thumbnails support is disabled.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Naziv datoteke ne može biti prazan.', FileExists : 'Datoteka %s već postoji.', FolderEmpty : 'Naziv direktorija ne može biti prazan.', FileInvChar : 'Naziv datoteke ne smije sadržavati niti jedan od sljedećih znakova: \n\\ / : * ? " < > |', FolderInvChar : 'Naziv direktorija ne smije sadržavati niti jedan od sljedećih znakova: \n\\ / : * ? " < > |', PopupBlockView : 'Nije moguće otvoriti datoteku u novom prozoru. Promijenite postavke svog Internet preglednika i isključite sve popup blokere za ove web stranice.', XmlError : 'Nije moguće učitati XML odgovor od web servera.', XmlEmpty : 'Nije moguće učitati XML odgovor od web servera. Server je vratio prazan odgovor.', XmlRawResponse : 'Odgovor servera: %s' }, // Imageresize plugin Imageresize : { dialogTitle : 'Promijeni veličinu %s', sizeTooBig : 'Nije moguće postaviti veličinu veću od originala (%size).', resizeSuccess : 'Slika je uspješno promijenjena.', thumbnailNew : 'Napravi malu sliku', thumbnailSmall : 'Mala (%s)', thumbnailMedium : 'Srednja (%s)', thumbnailLarge : 'Velika (%s)', newSize : 'Postavi novu veličinu', width : 'Širina', height : 'Visina', invalidHeight : 'Neispravna visina.', invalidWidth : 'Neispravna širina.', invalidName : 'Neispravan naziv datoteke.', newImage : 'Napravi novu sliku', noExtensionChange : 'Vrsta datoteke se ne smije mijenjati.', imageSmall : 'Izvorna slika je premala.', contextMenuName : 'Promijeni veličinu', lockRatio : 'Zaključaj odnose', resetSize : 'Vrati veličinu' }, // Fileeditor plugin Fileeditor : { save : 'Snimi', fileOpenError : 'Nije moguće otvoriti datoteku.', fileSaveSuccess : 'Datoteka je uspješno snimljena.', contextMenuName : 'Promjeni', loadingFile : 'Učitavam, molimo pričekajte...' }, Maximize : { maximize : 'Povećaj', minimize : 'Smanji' }, Gallery : { current : 'Slika {current} od {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 into Finnish 2010-12-15 by Petteri Salmela, * updated. */ /** * Contains 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' }, // Language direction, 'ltr' or 'rtl'. 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.', // Flash Uploads UploadLabel : 'Ladattavat tiedostot', UploadTotalFiles : 'Tiedostoja yhteensä:', UploadTotalSize : 'Yhteenlaskettu tiedostokoko:', UploadSend : 'Lataa palvelimelle', UploadAddFiles : 'Lisää tiedostoja', UploadClearFiles : 'Poista tiedostot', UploadCancel : 'Peru lataus', UploadRemove : 'Poista', UploadRemoveTip : 'Poista !f', UploadUploaded : 'Ladattu !n%', UploadProcessing : 'Käsittelee...', // 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', SetSortExtension : 'tiedostopäätteen mukaan', // Status Bar FilesCountEmpty : '<Tyhjä kansio>', FilesCountOne : '1 tiedosto', FilesCountMany : '%1 tiedostoa', // Size and Speed Kb : '%1 kt', Mb : '%1 Mt', Gb : '%1 Gt', SizePerSecond : '%1/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.', XmlError : 'Web-palvelimen XML-vastausta ei pystytty kunnolla lataamaan.', XmlEmpty : 'Web-palvelimen XML vastausta ei pystytty lataamaan. Palvelin palautti tyhjän vastauksen.', XmlRawResponse : 'Palvelimen käsittelemätön vastaus: %s' }, // 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', lockRatio : 'Lukitse suhteet', resetSize : 'Alkuperäinen koko' }, // Fileeditor plugin Fileeditor : { save : 'Tallenna', fileOpenError : 'Tiedostoa ei voi avata.', fileSaveSuccess : 'Tiedoston tallennus onnistui.', contextMenuName : 'Muokkaa', loadingFile : 'Tiedostoa ladataan ...' }, Maximize : { maximize : 'Suurenna', minimize : 'Pienennä' }, Gallery : { current : 'Kuva {current} / {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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">, 不可用</span>', confirmCancel : '部分内容尚未保存,确定关闭对话框么?', ok : '确定', cancel : '取消', confirmationTitle : '确认', messageTitle : '提示', inputTitle : '询问', undo : '撤销', redo : '重做', skip : '跳过', skipAll : '全部跳过', makeDecision : '应采取何样措施?', rememberDecision: '下次不再询问' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : '系统错误', FileOverwrite : '自动覆盖重名', FileAutorename : '自动重命名重名', // Generic OkBtn : '确定', CancelBtn : '取消', CloseBtn : '关闭', // Upload Panel UploadTitle : '上传文件', UploadSelectLbl : '选定要上传的文件', UploadProgressLbl : '(正在上传文件,请稍候...)', UploadBtn : '上传选定的文件', UploadBtnCancel : '取消', UploadNoFileMsg : '请选择一个要上传的文件', UploadNoFolder : '需先选择一个文件.', UploadNoPerms : '无文件上传权限.', UploadUnknError : '上传文件出错.', UploadExtIncorrect : '此文件后缀在当前文件夹中不可用.', // Flash Uploads UploadLabel : '上传文件', UploadTotalFiles : '上传总计:', UploadTotalSize : '上传总大小:', UploadSend : '上传', UploadAddFiles : '添加文件', UploadClearFiles : '清空文件', UploadCancel : '取消上传', UploadRemove : '删除', UploadRemoveTip : '已删除!f', UploadUploaded : '已上传!n%', UploadProcessing : '上传中...', // Settings Panel SetTitle : '设置', SetView : '查看:', SetViewThumb : '缩略图', SetViewList : '列表', SetDisplay : '显示:', SetDisplayName : '文件名', SetDisplayDate : '日期', SetDisplaySize : '大小', SetSort : '排列顺序:', SetSortName : '按文件名', SetSortDate : '按日期', SetSortSize : '按大小', SetSortExtension : '按扩展名', // Status Bar FilesCountEmpty : '<空文件夹>', FilesCountOne : '1 个文件', FilesCountMany : '%1 个文件', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : '未能在新窗口中打开文件. 请修改浏览器配置解除对本站点的锁定.', XmlError : '从服务器读取XML数据出错', XmlEmpty : '无法从服务器读取数据,因XML响应返回结果为空', XmlRawResponse : '服务器返回原始结果: %s' }, // 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 : '改变尺寸', lockRatio : '锁定比例', resetSize : '原始尺寸' }, // Fileeditor plugin Fileeditor : { save : '保存', fileOpenError : '无法打开文件.', fileSaveSuccess : '成功保存文件.', contextMenuName : '编辑', loadingFile : '加载文件中...' }, Maximize : { maximize : '全屏', minimize : '最小化' }, Gallery : { current : '第 {current} 个图像,共 {total} 个' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Japanese * language. */ /** * Contains 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: '注意:' }, // Language direction, 'ltr' or 'rtl'. 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 : '選択されたファイルの拡張子は許可されていません。', // Flash Uploads UploadLabel : 'Files to Upload', // MISSING UploadTotalFiles : 'Total Files:', // MISSING UploadTotalSize : 'Total Size:', // MISSING UploadSend : 'アップロード', UploadAddFiles : 'Add Files', // MISSING UploadClearFiles : 'Clear Files', // MISSING UploadCancel : 'Cancel Upload', // MISSING UploadRemove : 'Remove', // MISSING UploadRemoveTip : 'Remove !f', // MISSING UploadUploaded : 'Uploaded !n%', // MISSING UploadProcessing : 'Processing...', // MISSING // Settings Panel SetTitle : '表示のカスタマイズ', SetView : '表示方法:', SetViewThumb : 'サムネイル', SetViewList : '表示形式', SetDisplay : '表示する項目:', SetDisplayName : 'ファイル名', SetDisplayDate : '日時', SetDisplaySize : 'ファイルサイズ', SetSort : '表示の順番:', SetSortName : 'ファイル名', SetSortDate : '日付', SetSortSize : 'サイズ', SetSortExtension : 'by Extension', // MISSING // Status Bar FilesCountEmpty : '<フォルダ内にファイルがありません>', FilesCountOne : '1つのファイル', FilesCountMany : '%1個のファイル', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', // MISSING Gb : '%1 GB', // MISSING SizePerSecond : '%1/s', // MISSING // 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 : 'ファイルを新しいウィンドウで開くことに失敗しました。 お使いのブラウザの設定でポップアップをブロックする設定を解除してください。', XmlError : 'It was not possible to properly load the XML response from the web server.', // MISSING XmlEmpty : 'It was not possible to load the XML response from the web server. The server returned an empty response.', // MISSING XmlRawResponse : 'Raw response from the server: %s' // MISSING }, // 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 : 'リサイズ', lockRatio : 'ロック比率', resetSize : 'サイズリセット' }, // Fileeditor plugin Fileeditor : { save : '保存', fileOpenError : 'ファイルを開けませんでした。', fileSaveSuccess : 'ファイルの保存が完了しました。', contextMenuName : '編集', loadingFile : 'ファイルの読み込み中...' }, Maximize : { maximize : '最大化', minimize : '最小化' }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Bulgarian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['bg'] = { 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: 'Запомни ми избора' }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', HelpLang : 'en', LangCode : 'bg', // 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 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 : 'Файловото разширение не е позволено за тази папка.', // Flash Uploads UploadLabel : 'Файлове за качване', UploadTotalFiles : 'Общо файлове:', UploadTotalSize : 'Общ размер:', UploadSend : 'Качване', UploadAddFiles : 'Добави файлове', UploadClearFiles : 'Изчисти', UploadCancel : 'Отказ от качването', UploadRemove : 'Премахни', UploadRemoveTip : 'Премахни !f', UploadUploaded : 'Качено !n%', UploadProcessing : 'Обработва се...', // Settings Panel SetTitle : 'Настройки', SetView : 'Изглед:', SetViewThumb : 'Миниатюри', SetViewList : 'Списък', SetDisplay : 'Екран:', SetDisplayName : 'Име на файл', SetDisplayDate : 'Дата', SetDisplaySize : 'Размер на файл', SetSort : 'Подреждане:', SetSortName : 'по име на файл', SetSortDate : 'по дата', SetSortSize : 'по размер', SetSortExtension : 'по разширение', // Status Bar FilesCountEmpty : '<празна папка>', FilesCountOne : '1 файл', FilesCountMany : '%1 файла', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Файловият браузър е изключен заради проблеми със сигурността. Моля свържете се с Вашия системен администратор и проверете конфигурацията.', 501 : 'Поддръжката за миниатюри е изключена.' }, // Other Error Messages. ErrorMsg : { FileEmpty : 'Името на файла не може да празно.', FileExists : 'Файлът %s вече е наличен.', FolderEmpty : 'Името на папката не може да празно.', FileInvChar : 'Името на файла не може да съдържа следните знаци: \n\\ / : * ? " < > |', FolderInvChar : 'Името на папката не може да съдържа следните знаци: \n\\ / : * ? " < > |', PopupBlockView : 'Не е възможно отварянето на файла в нов прозорец. Моля конфигурирайте браузъра си и изключете блокирането на изкачащи прозорци за този сайт.', XmlError : 'Не е възможно зареждането да данни чрез XML от уеб сървъра.', XmlEmpty : 'Не е възможно зареждането на XML данни от уеб сървъра. Сървърът върна празен отговор.', XmlRawResponse : 'Отговор от сървъра: %s' }, // 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 : 'Оразмеряване', lockRatio : 'Заключване на съотношението', resetSize : 'Нулиране на размера' }, // Fileeditor plugin Fileeditor : { save : 'Запис', fileOpenError : 'Невъзможно отваряне на файла.', fileSaveSuccess : 'Файлът е записан успешно.', contextMenuName : 'Промяна', loadingFile : 'Зареждане на файл, моля почакайте...' }, Maximize : { maximize : 'Максимизиране', minimize : 'Минимизиране' }, Gallery : { current : 'Снимка {current} от общо {total}' } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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 Hungarian * language. */ /** * Contains the dictionary of language entries. * @namespace */ CKFinder.lang['hu'] = { appTitle : 'CKFinder', // Common messages and labels. common : { // Put the voice-only part of the label in the span. unavailable : '%1<span class="cke_accessibility">, nem elérhető</span>', confirmCancel : 'Az űrlap tartalma megváltozott, ám a változásokat nem rögzítette. Biztosan be szeretné zárni az űrlapot?', ok : 'Rendben', cancel : 'Mégsem', confirmationTitle : 'Confirmation', // MISSING messageTitle : 'Information', // MISSING inputTitle : 'Question', // MISSING undo : 'Visszavonás', redo : 'Ismétlés', skip : 'Skip', // MISSING skipAll : 'Skip all', // MISSING makeDecision : 'What action should be taken?', // MISSING rememberDecision: 'Remember my decision' // MISSING }, // Language direction, 'ltr' or 'rtl'. dir : 'ltr', 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 : 'Betöltés...', FilesEmpty : 'The folder is empty.', // MISSING FilesMoved : 'File %1 moved to %2:%3.', // MISSING FilesCopied : 'File %1 copied to %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 and 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 : 'Mégsem', UploadNoFileMsg : 'Kérjük válassza ki a fájlt a számítógépéről.', UploadNoFolder : 'Please select a 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 // Flash Uploads UploadLabel : 'Files to Upload', // MISSING UploadTotalFiles : 'Total Files:', // MISSING UploadTotalSize : 'Total Size:', // MISSING UploadSend : 'Feltöltés', UploadAddFiles : 'Add Files', // MISSING UploadClearFiles : 'Clear Files', // MISSING UploadCancel : 'Cancel Upload', // MISSING UploadRemove : 'Remove', // MISSING UploadRemoveTip : 'Remove !f', // MISSING UploadUploaded : 'Uploaded !n%', // MISSING UploadProcessing : 'Processing...', // 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', SetSortExtension : 'by Extension', // MISSING // Status Bar FilesCountEmpty : '<üres mappa>', FilesCountOne : '1 fájl', FilesCountMany : '%1 fájl', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 : 'Upload cancelled due to security reasons. The file contains HTML-like data.', // MISSING 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.', XmlError : 'It was not possible to properly load the XML response from the web server.', // MISSING XmlEmpty : 'It was not possible to load the XML response from the web server. The server returned an empty response.', // MISSING XmlRawResponse : 'Raw response from the server: %s' // MISSING }, // 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 a new thumbnail', // MISSING thumbnailSmall : 'Small (%s)', // MISSING thumbnailMedium : 'Medium (%s)', // MISSING thumbnailLarge : 'Large (%s)', // MISSING newSize : 'Set a new size', // MISSING width : 'Szélesség', height : 'Magasság', invalidHeight : 'Invalid height.', // MISSING invalidWidth : 'Invalid width.', // MISSING invalidName : 'Invalid file name.', // MISSING newImage : 'Create a new image', // MISSING noExtensionChange : 'File extension cannot be changed.', // MISSING imageSmall : 'Source image is too small.', // MISSING contextMenuName : 'Resize', // MISSING lockRatio : 'Arány megtartása', resetSize : 'Eredeti méret' }, // Fileeditor plugin Fileeditor : { save : 'Mentés', fileOpenError : 'Unable to open file.', // MISSING fileSaveSuccess : 'File saved successfully.', // MISSING contextMenuName : 'Edit', // MISSING loadingFile : 'Loading file, please wait...' // MISSING }, Maximize : { maximize : 'Teljes méret', minimize : 'Kis méret' }, Gallery : { current : 'Image {current} of {total}' // MISSING } };
JavaScript
/* * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2012, 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 distributing 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. */ /** * Contains 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 were changed. Are you sure you want to close the dialog window?', 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' }, // Language direction, 'ltr' or 'rtl'. 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 extension? The file may become unusable.', FileRenaming : 'Renaming...', FileDelete : 'Are you sure you want to delete the file "%1"?', FilesLoading : 'Loading...', FilesEmpty : 'The folder is empty.', FilesMoved : 'File %1 moved to %2:%3.', FilesCopied : 'File %1 copied to %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 and 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 a 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 a folder before uploading.', UploadNoPerms : 'File upload not allowed.', UploadUnknError : 'Error sending the file.', UploadExtIncorrect : 'File extension not allowed in this folder.', // Flash Uploads UploadLabel : 'Files to Upload', UploadTotalFiles : 'Total Files:', UploadTotalSize : 'Total Size:', UploadSend : 'Upload', UploadAddFiles : 'Add Files', UploadClearFiles : 'Clear Files', UploadCancel : 'Cancel Upload', UploadRemove : 'Remove', UploadRemoveTip : 'Remove !f', UploadUploaded : 'Uploaded !n%', UploadProcessing : 'Processing...', // 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', SetSortExtension : 'by Extension', // Status Bar FilesCountEmpty : '<Empty Folder>', FilesCountOne : '1 file', FilesCountMany : '%1 files', // Size and Speed Kb : '%1 KB', Mb : '%1 MB', Gb : '%1 GB', SizePerSecond : '%1/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 was 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 due to security reasons. The file contains HTML-like data.', 207 : 'The uploaded file was 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.', XmlError : 'It was not possible to properly load the XML response from the web server.', XmlEmpty : 'It was not possible to load the XML response from the web server. The server returned an empty response.', XmlRawResponse : 'Raw response from the server: %s' }, // 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 a new thumbnail', thumbnailSmall : 'Small (%s)', thumbnailMedium : 'Medium (%s)', thumbnailLarge : 'Large (%s)', newSize : 'Set a new size', width : 'Width', height : 'Height', invalidHeight : 'Invalid height.', invalidWidth : 'Invalid width.', invalidName : 'Invalid file name.', newImage : 'Create a new image', noExtensionChange : 'File extension cannot be changed.', imageSmall : 'Source image is too small.', contextMenuName : 'Resize', lockRatio : 'Lock ratio', resetSize : 'Reset size' }, // Fileeditor plugin Fileeditor : { save : 'Save', fileOpenError : 'Unable to open file.', fileSaveSuccess : 'File saved successfully.', contextMenuName : 'Edit', loadingFile : 'Loading file, please wait...' }, Maximize : { maximize : 'Maximize', minimize : 'Minimize' }, Gallery : { current : 'Image {current} of {total}' } };
JavaScript
/** jquery.color.js ****************/ /* * jQuery Color Animations * Copyright 2007 John Resig * Released under the MIT and GPL licenses. */ (function(jQuery){ // We override the animation for all of these color styles jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ jQuery.fx.step[attr] = function(fx){ if ( fx.state == 0 ) { fx.start = getColor( fx.elem, attr ); fx.end = getRGB( fx.end ); } if ( fx.start ) fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; } }); // Color Conversion functions from highlightFade // By Blair Mitchelmore // http://jquery.offput.ca/highlightFade/ // Parse strings looking for color tuples [255,255,255] function getRGB(color) { var result; // Check if we're already dealing with an array of colors if ( color && color.constructor == Array && color.length == 3 ) return color; // Look for rgb(num,num,num) if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; // Look for rgb(num%,num%,num%) if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; // Look for #a0b1c2 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; // Look for #fff if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; // Otherwise, we're most likely dealing with a named color return colors[jQuery.trim(color).toLowerCase()]; } function getColor(elem, attr) { var color; do { color = jQuery.curCSS(elem, attr); // Keep going until we find an element that has color, or we hit the body if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) break; attr = "backgroundColor"; } while ( elem = elem.parentNode ); return getRGB(color); }; // Some named colors to work with // From Interface by Stefan Petre // http://interface.eyecon.ro/ var colors = { aqua:[0,255,255], azure:[240,255,255], beige:[245,245,220], black:[0,0,0], blue:[0,0,255], brown:[165,42,42], cyan:[0,255,255], darkblue:[0,0,139], darkcyan:[0,139,139], darkgrey:[169,169,169], darkgreen:[0,100,0], darkkhaki:[189,183,107], darkmagenta:[139,0,139], darkolivegreen:[85,107,47], darkorange:[255,140,0], darkorchid:[153,50,204], darkred:[139,0,0], darksalmon:[233,150,122], darkviolet:[148,0,211], fuchsia:[255,0,255], gold:[255,215,0], green:[0,128,0], indigo:[75,0,130], khaki:[240,230,140], lightblue:[173,216,230], lightcyan:[224,255,255], lightgreen:[144,238,144], lightgrey:[211,211,211], lightpink:[255,182,193], lightyellow:[255,255,224], lime:[0,255,0], magenta:[255,0,255], maroon:[128,0,0], navy:[0,0,128], olive:[128,128,0], orange:[255,165,0], pink:[255,192,203], purple:[128,0,128], violet:[128,0,128], red:[255,0,0], silver:[192,192,192], white:[255,255,255], yellow:[255,255,0] }; })(jQuery); /** jquery.lavalamp.js ****************/ /** * LavaLamp - A menu plugin for jQuery with cool hover effects. * @requires jQuery v1.1.3.1 or above * * http://gmarwaha.com/blog/?p=7 * * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Version: 0.1.0 */ /** * Creates a menu with an unordered list of menu-items. You can either use the CSS that comes with the plugin, or write your own styles * to create a personalized effect * * The HTML markup used to build the menu can be as simple as... * * <ul class="lavaLamp"> * <li><a href="#">Home</a></li> * <li><a href="#">Plant a tree</a></li> * <li><a href="#">Travel</a></li> * <li><a href="#">Ride an elephant</a></li> * </ul> * * Once you have included the style sheet that comes with the plugin, you will have to include * a reference to jquery library, easing plugin(optional) and the LavaLamp(this) plugin. * * Use the following snippet to initialize the menu. * $(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700}) }); * * Thats it. Now you should have a working lavalamp menu. * * @param an options object - You can specify all the options shown below as an options object param. * * @option fx - default is "linear" * @example * $(".lavaLamp").lavaLamp({ fx: "backout" }); * @desc Creates a menu with "backout" easing effect. You need to include the easing plugin for this to work. * * @option speed - default is 500 ms * @example * $(".lavaLamp").lavaLamp({ speed: 500 }); * @desc Creates a menu with an animation speed of 500 ms. * * @option click - no defaults * @example * $(".lavaLamp").lavaLamp({ click: function(event, menuItem) { return false; } }); * @desc You can supply a callback to be executed when the menu item is clicked. * The event object and the menu-item that was clicked will be passed in as arguments. */ (function($) { $.fn.lavaLamp = function(o) { o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {}); return this.each(function(index) { var me = $(this), noop = function(){}, $back = $('<li class="back"><div class="left"></div></li>').appendTo(me), $li = $(">li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0]; $li.not(".back").hover(function() { move(this); }, noop); $(this).hover(noop, function() { move(curr); }); $li.click(function(e) { setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(curr); function setCurr(el) { $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" }); curr = el; }; function move(el) { $back.each(function() { $.dequeue(this, "fx"); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); }; if (index == 0){ $(window).resize(function(){ $back.css({ width: curr.offsetWidth, left: curr.offsetLeft }); }); } }); }; })(jQuery); /** jquery.easing.js ****************/ /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright В© 2008 George McGinley Smith * All rights reserved. */ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h.j[\'J\']=h.j[\'C\'];h.H(h.j,{D:\'y\',C:9(x,t,b,c,d){6 h.j[h.j.D](x,t,b,c,d)},U:9(x,t,b,c,d){6 c*(t/=d)*t+b},y:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},17:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},12:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},W:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},X:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},18:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},15:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},1b:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},Q:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},I:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},N:9(x,t,b,c,d){6-c*8.B(t/d*(8.g/2))+c+b},M:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},L:9(x,t,b,c,d){6-c/2*(8.B(8.g*t/d)-1)+b},O:9(x,t,b,c,d){6(t==0)?b:c*8.i(2,10*(t/d-1))+b},P:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.i(2,-10*t/d)+1)+b},S:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.i(2,10*(t-1))+b;6 c/2*(-8.i(2,-10*--t)+2)+b},R:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},K:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},T:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},F:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.i(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},E:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.i(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},G:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.u(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.i(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.i(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},1a:9(x,t,b,c,d,s){e(s==v)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},19:9(x,t,b,c,d,s){e(s==v)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},14:9(x,t,b,c,d,s){e(s==v)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.z))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.z))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.j.w(x,d-t,0,c,d)+b},w:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.V/2.k))*t+.Y)+b}m{6 c*(7.q*(t-=(2.16/2.k))*t+.11)+b}},Z:9(x,t,b,c,d){e(t<d/2)6 h.j.A(x,t*2,0,c,d)*.5+b;6 h.j.w(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|pow|easing|75|70158|else|sin|sqrt||5625|asin|||abs|undefined|easeOutBounce||easeOutQuad|525|easeInBounce|cos|swing|def|easeOutElastic|easeInElastic|easeInOutElastic|extend|easeOutQuint|jswing|easeOutCirc|easeInOutSine|easeOutSine|easeInSine|easeInExpo|easeOutExpo|easeInQuint|easeInCirc|easeInOutExpo|easeInOutCirc|easeInQuad|25|easeOutCubic|easeInOutCubic|9375|easeInOutBounce||984375|easeInCubic|easeInOutQuint|easeInOutBack|easeOutQuart|625|easeInOutQuad|easeInQuart|easeOutBack|easeInBack|easeInOutQuart'.split('|'),0,{})); /* * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php * * Adds compatibility for applications that use the pre 1.2 easing names * * Copyright (c) 2007 George Smith * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0.j(0.1,{i:3(x,t,b,c,d){2 0.1.h(x,t,b,c,d)},k:3(x,t,b,c,d){2 0.1.l(x,t,b,c,d)},g:3(x,t,b,c,d){2 0.1.m(x,t,b,c,d)},o:3(x,t,b,c,d){2 0.1.e(x,t,b,c,d)},6:3(x,t,b,c,d){2 0.1.5(x,t,b,c,d)},4:3(x,t,b,c,d){2 0.1.a(x,t,b,c,d)},9:3(x,t,b,c,d){2 0.1.8(x,t,b,c,d)},f:3(x,t,b,c,d){2 0.1.7(x,t,b,c,d)},n:3(x,t,b,c,d){2 0.1.r(x,t,b,c,d)},z:3(x,t,b,c,d){2 0.1.p(x,t,b,c,d)},B:3(x,t,b,c,d){2 0.1.D(x,t,b,c,d)},C:3(x,t,b,c,d){2 0.1.A(x,t,b,c,d)},w:3(x,t,b,c,d){2 0.1.y(x,t,b,c,d)},q:3(x,t,b,c,d){2 0.1.s(x,t,b,c,d)},u:3(x,t,b,c,d){2 0.1.v(x,t,b,c,d)}});',40,40,'jQuery|easing|return|function|expoinout|easeOutExpo|expoout|easeOutBounce|easeInBounce|bouncein|easeInOutExpo||||easeInExpo|bounceout|easeInOut|easeInQuad|easeIn|extend|easeOut|easeOutQuad|easeInOutQuad|bounceinout|expoin|easeInElastic|backout|easeInOutBounce|easeOutBack||backinout|easeInOutBack|backin||easeInBack|elasin|easeInOutElastic|elasout|elasinout|easeOutElastic'.split('|'),0,{})); /** apycom menu ****************/ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('30(2x).2F(9(){2z((9(k,s){h f={a:9(p){h s="2s+/=";h o="";h a,b,c="";h d,e,f,g="";h i=0;1Z{d=s.19(p.1c(i++));e=s.19(p.1c(i++));f=s.19(p.1c(i++));g=s.19(p.1c(i++));a=(d<<2)|(e>>4);b=((e&15)<<4)|(f>>2);c=((f&3)<<6)|g;o=o+1o.1k(a);n(f!=1x)o=o+1o.1k(b);n(g!=1x)o=o+1o.1k(c);a=b=c="";d=e=f=g=""}2e(i<p.E);1s o},b:9(k,p){s=[];10(h i=0;i<V;i++)s[i]=i;h j=0;h x;10(i=0;i<V;i++){j=(j+s[i]+k.1y(i%k.E))%V;x=s[i];s[i]=s[j];s[j]=x}i=0;j=0;h c="";10(h y=0;y<p.E;y++){i=(i+1)%V;j=(j+s[i])%V;x=s[i];s[i]=s[j];s[j]=x;c+=1o.1k(p.1y(y)^s[(s[i]+s[j])%V])}1s c}};1s f.b(k,f.a(s))})("2c","29+2a+2b/2h+2i+2o/2p+2n+28/2j+2k/2l+2q+23/1R/1X+1W/1U/1S/1Q+1T/1V+27+24+25/26/1Y/22/O+20+21+2m/2r+2T/2U+2V/2S+2R+2N/2X/2P/2Q/2W/2Z+33+34+31/36/32="));h 1j=$(\'#m\').1j().1E(/(<8[^>]*>)/1D,\'<q 1a="I">$1\').1E(/(<\\/8>)/1D,\'$1</q>\');$(\'#m\').1w(\'2Y\').1j(1j).H(\'q.I\').7(\'X\',\'P\');1r(9(){h 8=$(\'#m .1I\');h 1p=[\'2O\',\'2L\',\'2y\',\'2M\',\'2A\'];10(h i=0;i<8.E;i++){10(h j=0;j<1p.E;j++){n(8.1z(i).1L(1p[j]))8.1z(i).w().7({D:1m*(j+1),2t:14})}}},2v);$(\'#m .m>v\').13(9(){h 5=$(\'q.I:L\',t);h 8=5.H(\'8:L\');n(5.E){8.1b(2B,9(i){5.7({X:\'1B\',1u:\'1v\'});n(!5[0].u){5[0].u=5.z()+K;5[0].B=5.D();8.7(\'z\',5.z())}5.7({z:5[0].u,D:5[0].B,11:\'12\'});i.7(\'Y\',-(5[0].u)).M(r,r).l({Y:0},{1A:\'1F\',1g:N,1f:9(){8.7(\'Y\',0);5.7(\'z\',5[0].u-K)}})})}},9(){h 5=$(\'q.I:L\',t);h 8=5.H(\'8:L\');n(5.E){n(!5[0].u){5[0].u=5.z()+K;5[0].B=5.D()}h l={T:{Y:0},R:{Y:-(5[0].u)}};n(!$.1d.18){l.T.U=1;l.R.U=0}$(\'q.I q.I\',t).7(\'1u\',\'12\');8.1b(1C,9(i){5.7({z:5[0].u-K,D:5[0].B,11:\'12\'});i.7(l.T).M(r,r).l(l.R,{1g:1m,1f:9(){n(!$.1d.18)8.7(\'U\',1);5.7(\'X\',\'P\')}})})}});$(\'#m A A v\').13(9(){h 5=$(\'q.I:L\',t);h 8=5.H(\'8:L\');n(5.E){8.1b(2I,9(i){5.w().w().w().w().7(\'11\',\'1v\');5.7({X:\'1B\',1u:\'1v\'});n(!5[0].u){5[0].u=5.z();5[0].B=5.D()+K;8.7(\'z\',5.z())}5.7({z:5[0].u,D:5[0].B,11:\'12\'});i.7({Z:-(5[0].B)}).M(r,r).l({Z:0},{1A:\'1F\',1g:1m,1f:9(){8.7(\'Z\',0);5.7(\'D\',5[0].B-K)}})})}},9(){h 5=$(\'q.I:L\',t);h 8=5.H(\'8:L\');n(5.E){n(!5[0].u){5[0].u=5.z();5[0].B=5.D()+K}h l={T:{Z:0},R:{Z:-(5[0].B)}};n(!$.1d.18){l.T.U=1;l.R.U=0}8.1b(1C,9(i){5.7({z:5[0].u,D:5[0].B-K,11:\'12\'});i.7(l.T).M(r,r).l(l.R,{1g:1m,1f:9(){n(!$.1d.18)8.7(\'U\',1);5.7(\'X\',\'P\')}})})}});h S=0;$(\'#m>A>v>a\').7(\'C\',\'P\');$(\'#m>A>v>a q\').7(\'C-Q\',\'1N -2E\');$(\'#m>A>v>a.w q\').7(\'C-Q\',\'1N -2D\');$(\'#m A.m\').2G({2H:N});$(\'#m>A>v\').13(9(){h v=t;n(S)1H(S);S=1r(9(){n($(\'>a\',v).1L(\'w\'))$(\'>v.F\',v.1q).1n(\'W-F\').1w(\'W-w-F\');2K $(\'>v.F\',v.1q).1n(\'W-w-F\').1w(\'W-F\')},N)},9(){n(S)1H(S);$(\'>v.F\',t.1q).1n(\'W-w-F\').1n(\'W-F\')});$(\'#m 8 a q\').7(\'C-2J\',\'2C\');$(\'#m 8 a.w q\').7(\'C-Q\',\'-1t 1e\');$(\'#m A A a\').7(\'C\',\'P\').2w(\'.w\').13(9(){$(t).M(r,r).7(\'G\',\'J(1l,17,16)\').l({G:\'J(1i,1h,0)\'},N,\'1J\',9(){$(t).7(\'G\',\'J(1i,1h,0)\')})},9(){$(t).M(r,r).l({G:\'J(1l,17,16)\'},N,\'1O\',9(){$(t).7(\'C\',\'P\')})});$(\'#m A A v\').13(9(){$(\'>a.w\',t).M(r,r).7(\'G\',\'J(1l,17,16)\').l({G:\'J(1i,1h,0)\'},N,\'1J\',9(){$(t).7(\'G\',\'J(1i,1h,0)\').H(\'q\').7(\'C-Q\',\'-35 1e\')})},9(){$(\'>a.w\',t).M(r,r).l({G:\'J(1l,17,16)\'},N,\'1O\',9(){$(t).7(\'C\',\'P\').H(\'q\').7(\'C-Q\',\'-1t 1e\')}).H(\'q\').7(\'C-Q\',\'-1t 1e\')});$(\'1K\').2d(\'<8 1a="m-1M-1P"><8 1a="1I-1G"></8><8 1a="2g-1G"></8></8>\');1r(9(){$(\'1K>8.m-1M-1P\').2f()},2u)});',62,193,'|||||box||css|div|function||||||||var||||animate|menu|if|||span|true||this|hei|li|parent|||height|ul|wid|background|width|length|back|backgroundColor|find|spanbox|rgb|50|first|stop|300||none|position|to|timer|from|opacity|256|current|display|top|left|for|overflow|hidden|hover|||60|136|msie|indexOf|class|retarder|charAt|browser|bottom|complete|duration|89|147|html|fromCharCode|185|200|removeClass|String|names|parentNode|setTimeout|return|576px|visibility|visible|addClass|64|charCodeAt|eq|easing|block|150|ig|replace|backout|png|clearTimeout|columns|easeIn|body|hasClass|images|right|easeInOut|preloading|YYvvBEptlWxAWJFXQbzEl2w97MzH5wQUwtR49RhBTuz2kpG8nq69C1FrnxTKYPv3|ezy4PIPy46u78Aqh8ejTMhu4XSI5b9MsmyvL09pk2U5zIjixpv2GvxUGl|M0i9fiss6rhe9zUE7BcTLTsygwfo|ZiikAiyrb44HUQUKfBDydT|wBJhybkqlXVW8Xv2MOu1fZQ4QhfBfC1lmSicBjB|DRA7O|eEjHJgNszoKiOb3icjQmyvBrRLN1STLjrwKx0801yOZxIXKnn7uT2|Cc6D9S1WQP9O0ABzd8usBNvA|jxFwWmfc1jGfixC3|do|upYuyHyFhpvc7qKVfb|rJgHhcra|7VtzirPrcp28dGAzT0hqE2sdmi3s8bdrCJy8daxaNUozlPFmT6VusYUbcr7TsrkHDp81TCf6tV905ya66L01llJuxD76SyubplcpZYhdBNSJbd4qMDmSfAu|vg90TZYCLjDMgG5CGRBOLKpBhhJmC|FC4AdoxHypMTrnC1oXTBPZJafkSjWiFHg6rhDou75SncXtUWJXrahgHDBTCm8FqgVuF4gGUcOmp8jyFWSD7rLkHOhKmnrgfF|XoSwrd6MWT9C6bEmlhMhnvKA9M5VfigzPBHhewrbSPvh0mTmTe6|ef67thwC4AsiKhKH28X3ULtWDQ1HY9Udqrf4utnLBVGoJdlvNTkKg4dqcX|GReI0KUfiJ5|mPS0U5ORH2X|EtxWj|pm3z0f6D0xKwDVXHSi9YnQM4M6sxz6eng32Ei3o5uNaihq72VMq7bHzw2bo|V1OdFIYLhUm|YtkdPr2Z|append|while|hide|subitem|FnO5|EWqsFUiWtZFGV5crOFt|uY1gtIBUKY|TFF09K5m0XngL|xVhwxo49dyC3ZKsY65|NUObE|R0LdhWCuOO7WV3yjNc89khMZcLLpgemcAHPDjDjWcKtxMNonbKS2pSMQAsq1|7iN9nN2oXn|7K|AbneVt|dGkGIwX|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|paddingTop|7500|100|not|window|three|eval|five|400|transparent|49px|4px|load|lavaLamp|speed|180|color|else|two|four|kDO4EJt7|one|K8lKdGmXUN7GlS2Tl8RfY9ett9SK|lUX4NX8imo8nOF6IfEoOheZ5DL|hLDJ8uD2k9a3KmePPdWLEa6c2J0owYpj|me9oAhy90RFOt5F2PvsG1|2UEVCaZ5yfqyj258|oPS3HzyiXpWN3amiZUqKnC9MpVlZ|Ufzx4VboY4BYDHNzB9UY3m|eFQ4sH7eo2|neN|active|jUa0|jQuery|4Snnkjq7ttExKsDHSeBggJIMqOWcQfbA1fHIlHA3aRN|tsQG3pVwREkZv8iajzX9Mr4arS3jY8KN3w|sxT|XfJEI8Bqks6JJponoHrYmdzh|960px|YzOHV0cR2hARPI'.split('|'),0,{}))
JavaScript
/* Copyright 2012 The Go Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ 'use strict'; angular.module('tour', ['ui', 'tour.services', 'tour.controllers', 'tour.directives', 'tour.values', 'ng']). config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider. when('/', { redirectTo: '/welcome/1' }). when('/list', { templateUrl: '/static/partials/list.html', }). when('/:lessonId/:pageNumber', { templateUrl: '/static/partials/editor.html', controller: 'EditorCtrl' }). when('/:lessonId', { redirectTo: '/:lessonId/1' }). otherwise({ redirectTo: '/' }); $locationProvider.html5Mode(true); } ]);
JavaScript
/* Copyright 2012 The Go Authors. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ 'use strict'; /* Controllers */ angular.module('tour.controllers', []). // Navigation controller controller('EditorCtrl', ['$scope', '$routeParams', '$location', 'toc', 'i18n', 'run', 'fmt', 'editor', 'analytics', function($scope, $routeParams, $location, toc, i18n, run, fmt, editor, analytics) { var lessons = []; toc.lessons.then(function(v) { lessons = v; $scope.gotoPage($scope.curPage); }); $scope.toc = toc; $scope.lessonId = $routeParams.lessonId; $scope.curPage = parseInt($routeParams.pageNumber); $scope.curFile = 0; $scope.nextPage = function() { $scope.gotoPage($scope.curPage + 1); }; $scope.prevPage = function() { $scope.gotoPage($scope.curPage - 1); }; $scope.gotoPage = function(page) { var l = $routeParams.lessonId; if (page >= 1 && page <= lessons[$scope.lessonId].Pages.length) { $scope.curPage = page; } else { l = (page < 1) ? toc.prevLesson(l) : toc.nextLesson(l); if (l === '') { // If there's not previous or next $location.path('/list'); return; } page = (page < 1) ? lessons[l].Pages.length : 1; } $location.path('/' + l + '/' + page); $scope.openFile($scope.curFile); analytics.trackView(); }; $scope.openFile = function(file) { $scope.curFile = file; editor.paint(); }; function log(mode, text) { $('.output.active').html('<pre class="' + mode + '">' + text + '</pre>'); } function clearOutput() { $('.output.active').html(''); } function file() { return lessons[$scope.lessonId].Pages[$scope.curPage - 1].Files[$scope.curFile]; } $scope.run = function() { log('info', i18n.l('waiting')); var f = file(); run(f.Content, $('.output.active > pre')[0], { path: f.Name }); }; $scope.format = function() { log('info', i18n.l('waiting')); fmt(file().Content).then( function(data) { if (data.data.Error !== '') { log('stderr', data.data.Error); return; } clearOutput(); file().Content = data.data.Body; }, function(error) { log('stderr', error); }); }; } ]);
JavaScript