1 /*
  2  * CKEditor - The text editor for Internet - http://ckeditor.com
  3  * Copyright (C) 2003-2008 Frederico Caldeira Knabben
  4  *
  5  * == BEGIN LICENSE ==
  6  *
  7  * Licensed under the terms of any of the following licenses at your
  8  * choice:
  9  *
 10  *  - GNU General Public License Version 2 or later (the "GPL")
 11  *    http://www.gnu.org/licenses/gpl.html
 12  *
 13  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 14  *    http://www.gnu.org/licenses/lgpl.html
 15  *
 16  *  - Mozilla Public License Version 1.1 or later (the "MPL")
 17  *    http://www.mozilla.org/MPL/MPL-1.1.html
 18  *
 19  * == END LICENSE ==
 20  */
 21
 22 /**
 23  * @fileOverview Defines the {@link CKEDITOR.skins} object, which is used to
 24  *		manage skins loading.
 25  */
 26
 27 /**
 28  * Manages skins loading.
 29  * @namespace
 30  * @augments CKEDITOR.resourceManager
 31  * @example
 32  */
 33 CKEDITOR.skins = (function()
 34 {
 35 	// Holds the list of loaded skins.
 36 	var loaded = {};
 37
 38 	var loadCss = function( cssUrl )
 39 	{
 40 		// Ignore it if already loaded.
 41 		if ( loaded[ cssUrl ] )
 42 			return;
 43
 44 		loaded[ cssUrl ] = 1;
 45
 46 		CKEDITOR.document.appendStyleSheet( cssUrl );
 47 	};
 48
 49 	/**
 50 	 * Loads a skin part. Skins are defined in parts, which are basically
 51 	 * separated CSS files. This function is mainly used by the core code and
 52 	 * should not have much use out of it.
 53 	 * @param {String} skinName The name of the skin to be loaded.
 54 	 * @param {String} skinPart The skin part to be loaded. Common skin parts
 55 	 *		are "editor" and "dialog".
 56 	 * @type undefined
 57 	 * @example
 58 	 */
 59 	return /** lends CKEDITOR.skins */ {
 60
 61 		load : function( skinName, skinPart )
 62 		{
 63 			loadCss( CKEDITOR.scriptsPath + 'skins/' + skinName + '/' + skinPart + '.css' );
 64 		}
 65 	 };
 66 })();
 67