CLICK HERE TO BUY IT TODAY! OR GET IT FREE VIA TRIALPAY  

PHP Demo Application - Source Code

/Framework/Model/Vendor/CkEditor/_source/core/dom/document.js



/*
Copyright (c) 2003-2010, 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.callthisdomDocument );
	};
// PACKAGER_RENAME( CKEDITOR.dom.document )
CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject();
CKEDITOR.tools.extendCKEDITOR.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.$.createStyleSheetcssFileUrl );
		            else
		            {
			                var link = new CKEDITOR.dom.element'link' );
			                link.setAttributes(
			                    {
				                        rel        :'stylesheet',
				                        type    'text/css',
				                        href    cssFileUrl
				                    });
			                this.getHead().appendlink );
			            }
		        },
	        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.textcssStyleTextthis ) );
			                this.getHead().appendstyle );
			            }
		        },
	        createElement : function( nameattribsAndStyles )
	        {
		            var element = new CKEDITOR.dom.elementnamethis );
		            if ( attribsAndStyles )
		            {
			                if ( attribsAndStyles.attributes )
			                    element.setAttributesattribsAndStyles.attributes );
			                if ( attribsAndStyles.styles )
			                    element.setStylesattribsAndStyles.styles );
			            }
		            return element;
		        },
	        createText : function( text )
	        {
		            return new CKEDITOR.dom.texttextthis );
		        },
	        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.$.getElementByIdelementId );
		            return $ ? new CKEDITOR.dom.element( $ ) : null;
		        },
	        getByAddress : function( addressnormalized )
	        {
		            var $ = this.$.documentElement;
		            for ( var ;
		 $ && address.length ;
		 i++ )
		            {
			                var target address];
			                if ( !normalized )
			                {
				                    $ = $.childNodestarget ];
				                    continue;
				                }
			                var currentIndex = -1;
			                for (var ;
			 < $.childNodes.length ;
			 j++ )
			                {
				                    var candidate = $.childNodes];
				                    if ( normalized === true &&
				                            candidate.nodeType == &&
				                            candidate.previousSibling &&
				                            candidate.previousSibling.nodeType == )
				                    {
					                        continue;
					                    }
				                    currentIndex++;
				                    if ( currentIndex == target )
				                    {
					                        $ = candidate;
					                        break;
					                    }
				                }
			            }
		            return $ ? new CKEDITOR.dom.node( $ ) : null;
		        },
	        getElementsByTag : function( tagName, namespace )
	        {
		            if ( !CKEDITOR.env.ie && namespace )
		                tagName = namespace + ':' tagName;
		            return new CKEDITOR.dom.nodeListthis.$.getElementsByTagNametagName ) );
		        },
	        /**
	         * 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];
		            head = new CKEDITOR.dom.elementhead );
		            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.elementthis.$.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.elementthis.$.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.windowthis.$.parentWindow || this.$.defaultView );
		            return (
		            this.getWindow = function()
		                {
			                    return win;
			                })();
		        }
	    });





PHP Demo Source Code Index