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 // #### Compressed Code 23 // Must be updated on changes in the script, as well as updated in the 24 // ckeditor.js and ckeditor_basic.js files. 25 26 // if (!window.CKEDITOR){window.CKEDITOR=(function(){return {status:'unloaded',basePath:(function(){var A='';var B=document.getElementsByTagName('script');for (var i=0;i<B.length;i++){var C=B[i].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?.js(?:\?.*)?$/i);if (C){A=C[1];break;}};if (A.indexOf('://')==-1){if (A.indexOf('/')==0) A=location.href.match(/^.*?:\/\/[^\/]*/)[0]+A;else A=location.href.match(/^[^\?]*\//)[0]+A;};return A;})()};})();}; 27 28 // #### Raw code 29 // ATTENTION: read the above "Compressed Code" notes when changing this code. 30 31 if ( !window.CKEDITOR ) 32 { 33 /** 34 * This is the API entry point. The entire CKEditor code runs under this object. 35 * @name CKEDITOR 36 * @namespace 37 * @example 38 */ 39 window.CKEDITOR = (function() 40 { 41 /** @lends CKEDITOR */ 42 return { 43 /** 44 * Indicates the API loading status: 45 * <ul> 46 * <li><b>unloaded</b>: the API is not yet loaded.</li> 47 * <li><b>basic_loaded</b>: the basic API features are available.</li> 48 * <li><b>loading</b>: the full API is being loaded.</li> 49 * <li><b>ready</b>: the API can be fully used.</li> 50 * </ul> 51 * @type string 52 * @example 53 * if ( <b>CKEDITOR.status</b> == 'ready' ) 54 * { 55 * // The API can now be fully used. 56 * } 57 */ 58 status : 'unloaded', 59 60 /** 61 * Contains the full URL for the CKEditor installation directory. 62 * @type string 63 * @example 64 * // Alerts "http://www.example.com/ckeditor/" (e.g.) 65 * alert( <b>CKEDITOR.basePath</b> ); 66 */ 67 basePath : (function() 68 { 69 // ATTENTION: fixes on this code must be ported to 70 // loader.basePath (core/loader.js). 71 72 // Find out the editor directory path, based on its <script> tag. 73 var path = ''; 74 var scripts = document.getElementsByTagName( 'script' ); 75 76 for ( var i = 0 ; i < scripts.length ; i++ ) 77 { 78 var match = scripts[i].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?.js(?:\?.*)?$/i ); 79 80 if ( match ) 81 { 82 path = match[1]; 83 break; 84 } 85 } 86 87 // In IE (only) the script.src string is the raw valued entered in the 88 // HTML. Other browsers return the full resolved URL instead. 89 if ( path.indexOf('://') == -1 ) 90 { 91 // Absolute path. 92 if ( path.indexOf( '/' ) == 0 ) 93 path = location.href.match( /^.*?:\/\/[^\/]*/ )[0] + path; 94 // Relative path. 95 else 96 path = location.href.match( /^[^\?]*\// )[0] + path; 97 } 98 99 return path; 100 })() 101 }; 102 })(); 103 } 104