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  * @example
 31  */
 32 CKEDITOR.skins = (function()
 33 {
 34 	// Holds the list of loaded skins.
 35 	var loaded = {};
 36
 37 	var loadCss = function( cssUrl )
 38 	{
 39 		// Ignore it if already loaded.
 40 		if ( loaded[ cssUrl ] )
 41 			return;
 42
 43 		loaded[ cssUrl ] = 1;
 44
 45 		CKEDITOR.document.appendStyleSheet( cssUrl );
 46 	};
 47
 48 	return /** @lends CKEDITOR.skins */ {
 49
 50 		/**
 51 		 * Loads a skin part. Skins are defined in parts, which are basically
 52 		 * separated CSS files. This function is mainly used by the core code and
 53 		 * should not have much use out of it.
 54 		 * @param {String} skinName The name of the skin to be loaded.
 55 		 * @param {String} skinPart The skin part to be loaded. Common skin parts
 56 		 *		are "editor" and "dialog".
 57 		 * @example
 58 		 */
 59 		load : function( skinName, skinPart )
 60 		{
 61 			loadCss( CKEDITOR.getUrl(
 62 				'_source/' +	// @Packager.RemoveLine
 63 				'skins/' + skinName + '/' + skinPart + '.css' ) );
 64 		}
 65 	 };
 66 })();
 67