contributions/javascript.jquery/start.inc.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * @defgroup JQuery 00004 * @ingroup JavaScript 00005 * 00006 * Include JQuery (http://jquery.com/) on all pages 00007 * 00008 * @section Usage 00009 * 00010 * On install, the module copies jquery.js to the a folder named "js" below web root. This file will 00011 * get included on all pages, if JCSSManager WidgetJCSS is used. It also will be compressed by JCSSManager, 00012 * if compression is enabled. 00013 * 00014 * To dissable automatic inclusion of jquery.js set constant APP-JQUERY_ON_EVERY_PAGE to false, and include 00015 * 'js/jquery.js' manually where approbiate. 00016 * 00017 * To define the version of JQuery to use, you must specify a version to use by defining 00018 * the constant APP_JQUERY_VERSION. Available values are "1.3" for JQuery 1.3.2, "1.4" for JQuery 1.4.4, 00019 * "1.5" for JQuery 1.5.2., "1.6" for 1.6.4 and "1.7" for 1.7.1 The default is "1.7". 00020 * 00021 * @attention The default version policy changed to "newest", so if you do not define a jquery version, 00022 * you will automaticalyy get the latest release 00023 * 00024 * @code 00025 * define('APP_JQUERY_VERSION', '1.4'); 00026 * @endcode 00027 * 00028 * @section Notes Additional notes 00029 * 00030 * JQuery is released under MIT license. 00031 */ 00032 00033 EventSource::Instance()->register(new JavascriptJQueryEventSink()); 00034 00035 /** 00036 * JQuery Config options 00037 * 00038 * @author Gerd Riesselmann 00039 * @ingroup JQuery 00040 */ 00041 class ConfigJQuery { 00042 /** @deprecated Use VERSION instead */ 00043 const JQUERY_VERSION = 'JQUERY_VERSION'; 00044 const VERSION = 'JQUERY_VERSION'; 00045 00046 /** @deprecated Use ON_EVERY_PAGE instead */ 00047 const JQUERY_ON_EVERY_PAGE = 'JQUERY_ON_EVERY_PAGE'; 00048 const ON_EVERY_PAGE = 'JQUERY_ON_EVERY_PAGE'; 00049 00050 /** 00051 * JQuery CDN URL. Either an URL with %version% as placeholder for version OR 00052 * 00053 * - "google" for the Google CDN 00054 * - "ms" for the Microsoft CDN 00055 * 00056 * @attention %version% will be allways 3 digits (e.g. 1.6.0). Use %version_min% to force this to 1.6 00057 * 00058 * Files will be loaded using https with both Google and Microsoft CDN 00059 */ 00060 const CDN = 'JQUERY_CDN'; 00061 } 00062 00063 Config::set_feature_from_constant(ConfigJQuery::ON_EVERY_PAGE, 'APP_JQUERY_ON_EVERY_PAGE', true); 00064 Config::set_value_from_constant(ConfigJQuery::CDN, 'APP_JQUERY_CDN', ''); 00065 00066 // To be changed on new releases 00067 Config::set_value_from_constant(ConfigJQuery::VERSION, 'APP_JQUERY_VERSION', '1.7'); 00068 define('JQUERY_VERSION_1_7', '1.7.1'); 00069 define('JQUERY_VERSION_1_6', '1.6.4'); 00070 define('JQUERY_VERSION_1_5', '1.5.2'); 00071 00072 define('JQUERY_VERSION_1_4', '1.4.4'); 00073 define('JQUERY_VERSION_1_3', '1.3.2'); 00074