diff --git a/libraries/cms/html/behavior.php b/libraries/cms/html/behavior.php
index f8453e03fdf0c..cabe16a7f61e1 100644
--- a/libraries/cms/html/behavior.php
+++ b/libraries/cms/html/behavior.php
@@ -61,6 +61,8 @@ public static function framework($extras = false, $debug = null)
}
JHtml::_('script', 'system/mootools-' . $type . '.js', false, true, false, false, $debug);
+ // Include jQuery
+ JHtml::_('jquery.framework');
JHtml::_('script', 'system/core.js', false, true);
static::$loaded[__METHOD__][$type] = true;
diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js
index f7840d3affbc5..5db2334a285b2 100644
--- a/media/system/js/core-uncompressed.js
+++ b/media/system/js/core-uncompressed.js
@@ -1,12 +1,10 @@
/**
- * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
+ * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Only define the Joomla namespace if not defined.
-if (typeof(Joomla) === 'undefined') {
- var Joomla = {};
-}
+Joomla = window.Joomla || {};
Joomla.editors = {};
// An object to hold each editor instance on page
@@ -16,29 +14,29 @@ Joomla.editors.instances = {};
* Generic submit form
*/
Joomla.submitform = function(task, form) {
- if (typeof(form) === 'undefined') {
- form = document.getElementById('adminForm');
- }
-
- if (typeof(task) !== 'undefined') {
- form.task.value = task;
- }
-
- // Submit the form.
- if (typeof form.onsubmit == 'function') {
- form.onsubmit();
- }
- if (typeof form.fireEvent == "function") {
- form.fireEvent('submit');
- }
- form.submit();
+ if (typeof(form) === 'undefined') {
+ form = document.getElementById('adminForm');
+ }
+
+ if (typeof(task) !== 'undefined') {
+ form.task.value = task;
+ }
+
+ // Submit the form.
+ if (typeof form.onsubmit == 'function') {
+ form.onsubmit();
+ }
+ if (typeof form.fireEvent == "function") {
+ form.fireEvent('submit');
+ }
+ form.submit();
};
/**
* Default function. Usually would be overriden by the component
*/
Joomla.submitbutton = function(pressbutton) {
- Joomla.submitform(pressbutton);
+ Joomla.submitform(pressbutton);
}
/**
@@ -47,28 +45,28 @@ Joomla.submitbutton = function(pressbutton) {
* Allows you to call Joomla.JText._() to get a translated JavaScript string pushed in with JText::script() in Joomla.
*/
Joomla.JText = {
- strings: {},
- '_': function(key, def) {
- return typeof this.strings[key.toUpperCase()] !== 'undefined' ? this.strings[key.toUpperCase()] : def;
- },
- load: function(object) {
- for (var key in object) {
- this.strings[key.toUpperCase()] = object[key];
- }
- return this;
- }
+ strings: {},
+ '_': function(key, def) {
+ return typeof this.strings[key.toUpperCase()] !== 'undefined' ? this.strings[key.toUpperCase()] : def;
+ },
+ load: function(object) {
+ for (var key in object) {
+ this.strings[key.toUpperCase()] = object[key];
+ }
+ return this;
+ }
};
/**
* Method to replace all request tokens on the page with a new one.
*/
Joomla.replaceTokens = function(n) {
- var els = document.getElementsByTagName('input');
- for (var i = 0; i < els.length; i++) {
- if ((els[i].type == 'hidden') && (els[i].name.length == 32) && els[i].value == '1') {
- els[i].name = n;
- }
- }
+ var els = document.getElementsByTagName('input'), i;
+ for (i = 0; i < els.length; i++) {
+ if ((els[i].type == 'hidden') && (els[i].name.length == 32) && els[i].value == '1') {
+ els[i].name = n;
+ }
+ }
};
/**
@@ -80,8 +78,8 @@ Joomla.replaceTokens = function(n) {
* @return boolean
*/
Joomla.isEmail = function(text) {
- var regex = new RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$");
- return regex.test(text);
+ var regex = new RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$");
+ return regex.test(text);
};
/**
@@ -91,73 +89,75 @@ Joomla.isEmail = function(text) {
*
* Checkboxes must have an id attribute in the form cb0, cb1...
*
- * @param mixed The number of box to 'check', for a checkbox element
- * @param string An alternative field name
+ * @param mixed The number of box to 'check', for a checkbox element
+ * @param string An alternative field name
*/
Joomla.checkAll = function(checkbox, stub) {
- if (!stub) {
- stub = 'cb';
- }
- if (checkbox.form) {
- var c = 0;
- for (var i = 0, n = checkbox.form.elements.length; i < n; i++) {
- var e = checkbox.form.elements[i];
- if (e.type == checkbox.type) {
- if ((stub && e.id.indexOf(stub) == 0) || !stub) {
- e.checked = checkbox.checked;
- c += (e.checked == true ? 1 : 0);
- }
- }
- }
- if (checkbox.form.boxchecked) {
- checkbox.form.boxchecked.value = c;
- }
- return true;
- }
- return false;
+ if (!stub) {
+ stub = 'cb';
+ }
+ if (checkbox.form) {
+ var c = 0, i, e;
+ for (i = 0, n = checkbox.form.elements.length; i < n; i++) {
+ e = checkbox.form.elements[i];
+ if (e.type == checkbox.type) {
+ if ((stub && e.id.indexOf(stub) == 0) || !stub) {
+ e.checked = checkbox.checked;
+ c += (e.checked == true ? 1 : 0);
+ }
+ }
+ }
+ if (checkbox.form.boxchecked) {
+ checkbox.form.boxchecked.value = c;
+ }
+ return true;
+ }
+ return false;
}
/**
* Render messages send via JSON
*
- * @param object messages JavaScript object containing the messages to render
- * @return void
+ * @param object messages JavaScript object containing the messages to render
+ * @return void
*/
Joomla.renderMessages = function(messages) {
- Joomla.removeMessages();
- var container = document.id('system-message-container');
-
- Object.each(messages, function (item, type) {
- var div = new Element('div', {
- id: 'system-message',
- 'class': 'alert alert-' + type
- });
- div.inject(container);
- var h4 = new Element('h4', {
- 'class' : 'alert-heading',
- html: Joomla.JText._(type)
- });
- h4.inject(div);
- var divList = new Element('div');
- Array.each(item, function (item, index, object) {
- var p = new Element('p', {
- html: item
- });
- p.inject(divList);
- }, this);
- divList.inject(div);
- }, this);
+ var $ = jQuery.noConflict(), $container, $div, $h4, $divList, $p;
+ Joomla.removeMessages();
+ $container = $('#system-message-container');
+
+ $.each(messages, function(type, item) {
+ $div = $('
', {
+ 'id' : 'system-message',
+ 'class' : 'alert alert-' + type
+ });
+ $container.append($div)
+
+ $h4 = $('', {
+ 'class' : 'alert-heading',
+ 'text' : Joomla.JText._(type)
+ });
+ $div.append($h4);
+
+ $divList = $('');
+ $.each(item, function(index, item) {
+ $p = $('', {
+ html : item
+ });
+ $divList.append($p);
+ });
+ $div.append($divList);
+ });
};
/**
* Remove messages
*
- * @return void
+ * @return void
*/
Joomla.removeMessages = function() {
- var children = $$('#system-message-container > *');
- children.destroy();
+ jQuery('#system-message-container').empty();
}
/**
@@ -172,15 +172,15 @@ Joomla.removeMessages = function() {
* @return
*/
Joomla.isChecked = function(isitchecked, form) {
- if (typeof(form) === 'undefined') {
- form = document.getElementById('adminForm');
- }
-
- if (isitchecked == true) {
- form.boxchecked.value++;
- } else {
- form.boxchecked.value--;
- }
+ if (typeof(form) === 'undefined') {
+ form = document.getElementById('adminForm');
+ }
+
+ if (isitchecked == true) {
+ form.boxchecked.value++;
+ } else {
+ form.boxchecked.value--;
+ }
}
/**
@@ -189,25 +189,25 @@ Joomla.isChecked = function(isitchecked, form) {
* Pops up a new window in the middle of the screen
*/
Joomla.popupWindow = function(mypage, myname, w, h, scroll) {
- var winl = (screen.width - w) / 2;
- var wint = (screen.height - h) / 2;
- var winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl
- + ',scrollbars=' + scroll + ',resizable'
- var win = window.open(mypage, myname, winprops)
- win.window.focus();
+ var winl = (screen.width - w) / 2, wint, winprops, win;
+ wint = (screen.height - h) / 2;
+ winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl
+ + ',scrollbars=' + scroll + ',resizable'
+ win = window.open(mypage, myname, winprops)
+ win.window.focus();
}
/**
* USED IN: libraries/joomla/html/html/grid.php
*/
Joomla.tableOrdering = function(order, dir, task, form) {
- if (typeof(form) === 'undefined') {
- form = document.getElementById('adminForm');
- }
+ if (typeof(form) === 'undefined') {
+ form = document.getElementById('adminForm');
+ }
- form.filter_order.value = order;
- form.filter_order_Dir.value = dir;
- Joomla.submitform(task, form);
+ form.filter_order.value = order;
+ form.filter_order_Dir.value = dir;
+ Joomla.submitform(task, form);
}
/**
@@ -216,34 +216,34 @@ Joomla.tableOrdering = function(order, dir, task, form) {
* Writes a dynamically generated list
*
* @param string
- * The parameters to insert into the