Skip to content
This repository

Moving core.js loading into separate method #981

Closed
wants to merge 4 commits into from

4 participants

danyaPostfactum Rouven Weßling Louis Landry WebMechanic
danyaPostfactum

It is bad idea to merge core.js and motools loading.
I sure it is nesessary to separate this actions into different methods.

Im working at my plugin, wich re-registers such methods as behavior.keepalive, behavior.formvalidation etc,
This plugin allows to avoid mootools requirement, all my scripts uses jQuery.
Its ok, but I can't replace core.js. Moreover, merging mootools requirement with core.js creates big problems for me.

I don't like jQuery, MooTools is more beauty for me, BUT I'm using extensions, wich works on jQuery, and I'm forcet to use this js library and refuse from MooTools die to site weight optimisation.

This plugin works great in joomla 1.7, but in joomla 2.5 I cannot get rid of mootools due to core.js and framework merging.

Please separete this methods, I thing it is a good idea.

Rouven Weßling
Collaborator

Could you explAin your reasoning? We just removed the JHtml::core() method.

Also this is not backwards compatible, there's a ton of code relying on core.js being loaded when MooTools is.

Rouven Weßling
Collaborator

I just saw you send me an earlier, I'll respond in the morning ;)

danyaPostfactum

Ok, so I offer to call JHtml::_('behavior.core') from framework() method.
This way doesnt break the compatibility and allows to override core.js in plugins

But, JHtml::core usage must be replaced with JHtml::('behavior.core'), not with JHtml::('behavior.framework') ( to prevent mootools loading when we only need to core.js.

So, core.js will be loaded in any way, wether we call JHtml::('behavior.core'), JHtml::('behavior.framework') or JHtml::script()

But if extension needs only core.js, it calls JHtml::('behavior.core'), if needs mootools , it calls JHtml::('behavior.framework')

Is it possible to make these changes ?

Rouven Weßling
Collaborator

First of all I'd be very interested in your jQuery plug-in. Do you host it somewhere?

Now back to topic.

The code in core.js has depended on MooTools at least since Joomla 1.6, also at least since 1.6 JHtmlBehavior::framework() has loaded core.js, this used to be done by calling JHtml::core(). I just simplified the code since calling either one used to load both files.

I don't quite get what your concern is? That some extension the uses parts of core.js will call JHtml::_('behavior.framework')? How is it going to help you if we accept this pull request, JHtmlBeavhior::core() would still include MooTools.

I'm not saying I'm opposed to it, I'd just like to understand the problem first.

danyaPostfactum

Ok, I have learned this problem deeper. I think it is possible to change a little bit of code without any combatibiltity problem, and with satisfaction of my interests.

First, what I think about usage of core.js and mootools framework:
If extension needs Joomla js object, it says behavior.core , If extension needs mootools framework (because of it uses $ function or addEvent for example) it says behavior.framework. If extension needs both of these things it calls both of behaviors. Extension shouldnt care how some of behaviors impements - may be it uses dojo or jquery, it doesnt matter.
Extension just calls behavior.core and gets Joomla object.
That is my point of view of how it should be ideally.
Due to backwards compatibility behavior.framework should call core.js anyway.

Second, to avoid recursion in calls of framework and core each other (framework calls core, and core calls framework and so on) we need to break this dependence. Because of we cannot remove the call of core in framework method (due to b.comp.) we need to rewrite core.js in pure js. Its very easy, there are two only methods which uses mootools, and I have rewritten it (with help of js master) already.

In future, when we get rid of the core.js call from behavior.framework, we will be able to use mootools in core.js (because of there will not be double-dependence of methods)

Finally, what we get:
1) Logically correct way to load mootools.js and core.js
2) Possibility of overriding core.js call. So, in most cases, core extensions such as com_content, com_contact, com_users will not call mootools directly, they will only call keepalive, tooltip etc behaviors, and this gives us possibility to implement this behaviors with usage of any js library/framework you wish, just using joomla plugin.

But, I don't how did you replace JHtml::core in CMS. I guess JHtml::('behavior.framework') ? But frontend parts of com_content, com_contact etc havent need to mootools, they dont use $, addEvent etc, only they need is core.js and other behaviors (tooltip, keepalive and so on)
Is it possible to change code in at least frontend part ? For now, in the last release of CMS, there over 10 calls of JHtml::core() - it so easy to change it to JHtml::
('behavior.core').
Without this change, my plugin will not give a full effect - mootools will be loading but will not be in use.
Or where can I try to discuss this problem ?

I will place my plugin here. on github, but i havent yet have deal with it, so it takes a time :)
Уфф...

danyaPostfactum danyaPostfactum commented on the diff March 13, 2012
libraries/joomla/html/html/behavior.php
@@ -58,13 +58,33 @@ public static function framework($extras = false, $debug = null)
58 58
 		}
59 59
 
60 60
 		JHtml::_('script', 'system/mootools-' . $type . '.js', false, true, false, false, $debug);
61  
-		JHtml::_('script', 'system/core.js', false, true);
1

Remove direct loading of core.js, let ::core() method do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
danyaPostfactum danyaPostfactum commented on the diff March 13, 2012
libraries/joomla/html/html/behavior.php
@@ -82,7 +102,7 @@ public static function caption($selector = 'img.caption')
82 102
 		}
83 103
 
84 104
 		// Include MooTools framework
85  
-		self::framework();
1

May be somebody wants to re-register behavior.framework (for loading from CDN for examle) , so, let it use his overriding method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
danyaPostfactum danyaPostfactum commented on the diff March 13, 2012
libraries/joomla/html/html/behavior.php
((7 lines not shown))
62 63
 		self::$loaded[__METHOD__][$type] = true;
63 64
 
64 65
 		return;
65 66
 	}
66 67
 
67 68
 	/**
  69
+	 * Method to load the Joomla core behavior
1

core.js should not use MooTools (at this moment) to prevent recursive calls of framework and core each other. In future, extensions should call directly ::core() method when they needs Joomla object, so we will remove ::core() call from framework method, and we will get possibility to use mootools in core.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
danyaPostfactum danyaPostfactum commented on the diff March 13, 2012
media/system/js/core-uncompressed.js
@@ -124,35 +124,41 @@ Joomla.checkAll = function(checkbox, stub) {
124 124
  * @return	void
125 125
  */
126 126
 Joomla.renderMessages = function(messages) {
1

Just pure javascript, it so easy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
danyaPostfactum

So, what do you think about it?
I want to create fast and lightweight sites, wich dont load tons of javascript. I want to give the availability to web-developers to use jquery correctly without loading mootools if they dont wont to use it.

All changes i offered will not affect outside Htmlbehavior file

Rouven Weßling
Collaborator

I'll respond in a bit, between JSST and our state parliament disbanding itself today I'm kept pretty busy ;)

Rouven Weßling
Collaborator

Haven't completely thought this trough but two three that came to my mind reading trough it:

  1. We'll have to add the JHtmlBeavhior::core() method, no doubt about it. We'll just have to add another file when we start extending MT objects (I have a rough cut of Request.Joomla laying around that was supposed to go into core.js)

  2. Can you really override JHtmlBehavior partly? So far I've alway overridden the complete JHtmlBehavior class - but then I've never tried it differently. I kinda like the self::framework() calls. That whole JHtml::_() method hides valuable information from IDEs so it should be avoided where possible.

  3. I'm very much against removing the MooTools code from core.js. I'd actually prefer if we could move some of the smaller files (e.g. multiselect) into core.js so we don't have to load that many files. But even if we can't do that, we got a framework in the core, why don't use it?

We should probably deprecate that JHtmlBehavior::framework() loads the core.js file. That will mean we'll have to add quite a bit of code but I really don't wanna be stuck in no framework mode in core.js.

danyaPostfactum

I'm glad to see you agree with some of my thoughts :)

You asked: 'Can you really override JHtmlBehavior partly?'
Yes, there is the way: JHtml::register('behavior.jquery', array('myClass', 'jquery')). It works.
And JHtml::register('behavior.framework', array('myClass', 'framework')) - it works too.
For now, if I need to override behavior.framework ( I want to load it from Google CDN, and I want to select wich parts of more.js I want to load, because I dont want to load this monsterous file), I have to override the whole behavior.php, due to self::framework() calls.
But if you don't want to change this, ok, it is not a big problem :)

I'm not against using MooTools code in core.js, but we cant use it, until we remove core.js loading in framework method.

If we will call core.js in framework method, and will call framework in core method, we will get recursion.

So we have to remove core.js loading in framework method, or we have to remove framework call in core method.

Due to backward compatibilty we are not allowed to do first thing, so lets do second one.
As you see, using pure js is not more complex then using MooTools in our case. Function renderMessages is still clear and simple.

After removing core.js loading in framework method, we will get availability to use MT in core.js again.

So, I must get back self:framework() lines in my patch, do I ?

WebMechanic WebMechanic commented on the diff March 25, 2012
media/system/js/core-uncompressed.js
@@ -162,8 +168,8 @@ Joomla.renderMessages = function(messages) {
162 168
  * @return	void
163 169
  */
164 170
 Joomla.removeMessages = function() {
165  
-	var children = $$('#system-message-container > *');
166  
-	children.destroy();
  171
+    var container = document.getElementById('system-message-container'), child;
3

why travel the DOM?
document.getElementById('system-message-container').innerHTML='';

I don't know. I asked on javascript.ru to help me to "decode" mootools code into pure js , and professional js-coder helped me.
I also offered innerHTML = '', but he sayd "removeChild() would be better" ....

and did that professional js-coder also explain to you why it is suposed to be "better"?
It's DOM Level1, granted, but that's about it :)
Not only will this save a variable, a loop, and memory, innerHTML is also much faster which is why virtually any JS lib is using it internally to speed up these kind of "mass" DOM manipulation.
+1 that you ripped off the dependency on MooTools from renderMessage!

edit: this was my personal take on ripping it off: https://gist.github.com/2199473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
danyaPostfactum

So, what about merging my patches?

Louis Landry

@danyaPostfactum This is no longer mergeable. Can you rebase this so we can take another look? @realityking would you have another look at this and talk it through with the CMS folks as well so we can make a call?

I'm going to close this for now. @danyaPostfactum once you have rebased this so that it will cleanly merge again please re-open it so we can finish the discussion. My apologies for the delay in getting a decision made on it.

Louis Landry LouisLandry closed this October 08, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
49  libraries/joomla/html/html/behavior.php
@@ -58,13 +58,33 @@ public static function framework($extras = false, $debug = null)
58 58
 		}
59 59
 
60 60
 		JHtml::_('script', 'system/mootools-' . $type . '.js', false, true, false, false, $debug);
61  
-		JHtml::_('script', 'system/core.js', false, true);
  61
+		// Backward compatibility: please call JHtml::_('behavior.core') directly when you need Joomla object
  62
+		JHtml::_('behavior.core');
62 63
 		self::$loaded[__METHOD__][$type] = true;
63 64
 
64 65
 		return;
65 66
 	}
66 67
 
67 68
 	/**
  69
+	 * Method to load the Joomla core behavior
  70
+	 *
  71
+	 * @return  void
  72
+	 *
  73
+	 * @since   11.4
  74
+	 */
  75
+	public static function core()
  76
+	{
  77
+		// Only load once
  78
+		if (isset(self::$loaded[__METHOD__]))
  79
+		{
  80
+			return;
  81
+		}
  82
+
  83
+		JHtml::_('script', 'system/core.js', false, true);
  84
+		self::$loaded[__METHOD__] = true;
  85
+	}
  86
+
  87
+	/**
68 88
 	 * Add unobtrusive javascript support for image captions.
69 89
 	 *
70 90
 	 * @param   string  $selector  The selector for which a caption behaviour is to be applied.
@@ -82,7 +102,7 @@ public static function caption($selector = 'img.caption')
82 102
 		}
83 103
 
84 104
 		// Include MooTools framework
85  
-		self::framework();
  105
+		JHtml::_('behavior.framework');
86 106
 
87 107
 		JHtml::_('script', 'system/caption.js', true, true);
88 108
 
@@ -118,7 +138,7 @@ public static function formvalidation()
118 138
 		}
119 139
 
120 140
 		// Include MooTools framework
121  
-		self::framework();
  141
+		JHtml::_('behavior.framework');
122 142
 
123 143
 		JHtml::_('script', 'system/validate.js', true, true);
124 144
 		self::$loaded[__METHOD__] = true;
@@ -141,7 +161,7 @@ public static function switcher()
141 161
 		}
142 162
 
143 163
 		// Include MooTools framework
144  
-		self::framework();
  164
+		JHtml::_('behavior.framework');
145 165
 
146 166
 		JHtml::_('script', 'system/switcher.js', true, true);
147 167
 
@@ -176,7 +196,7 @@ public static function combobox()
176 196
 			return;
177 197
 		}
178 198
 		// Include MooTools framework
179  
-		self::framework();
  199
+		JHtml::_('behavior.framework');
180 200
 
181 201
 		JHtml::_('script', 'system/combobox.js', true, true);
182 202
 		self::$loaded[__METHOD__] = true;
@@ -218,7 +238,7 @@ public static function tooltip($selector = '.hasTip', $params = array())
218 238
 		}
219 239
 
220 240
 		// Include MooTools framework
221  
-		self::framework(true);
  241
+		JHtml::_('behavior.framework', true);
222 242
 
223 243
 		// Setup options object
224 244
 		$opt['maxTitleChars']	= (isset($params['maxTitleChars']) && ($params['maxTitleChars'])) ? (int) $params['maxTitleChars'] : 50;
@@ -284,7 +304,7 @@ public static function modal($selector = 'a.modal', $params = array())
284 304
 		if (!isset(self::$loaded[__METHOD__]))
285 305
 		{
286 306
 			// Include MooTools framework
287  
-			self::framework(true);
  307
+			JHtml::_('behavior.framework', true);
288 308
 
289 309
 			// Load the javascript and css
290 310
 			JHtml::_('script', 'system/modal.js', true, true);
@@ -356,7 +376,7 @@ public static function multiselect($id = 'adminForm')
356 376
 		}
357 377
 
358 378
 		// Include MooTools framework
359  
-		self::framework();
  379
+		JHtml::_('behavior.framework');
360 380
 
361 381
 		JHtml::_('script', 'system/multiselect.js', true, true);
362 382
 
@@ -386,7 +406,7 @@ public static function multiselect($id = 'adminForm')
386 406
 	public static function uploader($id = 'file-upload', $params = array(), $upload_queue = 'upload-queue')
387 407
 	{
388 408
 		// Include MooTools framework
389  
-		self::framework();
  409
+		JHtml::_('behavior.framework');
390 410
 
391 411
 		JHtml::_('script', 'system/swf.js', true, true);
392 412
 		JHtml::_('script', 'system/progressbar.js', true, true);
@@ -552,7 +572,7 @@ public static function uploader($id = 'file-upload', $params = array(), $upload_
552 572
 	public static function tree($id, $params = array(), $root = array())
553 573
 	{
554 574
 		// Include MooTools framework
555  
-		self::framework();
  575
+		JHtml::_('behavior.framework');
556 576
 
557 577
 		JHtml::_('script', 'system/mootree.js', true, true, false, false);
558 578
 		JHtml::_('stylesheet', 'system/mootree.css', array(), true);
@@ -648,7 +668,7 @@ public static function colorpicker()
648 668
 		}
649 669
 
650 670
 		// Include MooTools framework
651  
-		self::framework(true);
  671
+		JHtml::_('behavior.framework', true);
652 672
 
653 673
 		JHtml::_('stylesheet', 'system/mooRainbow.css', array('media' => 'all'), true);
654 674
 		JHtml::_('script', 'system/mooRainbow.js', false, true);
@@ -699,7 +719,7 @@ public static function keepalive()
699 719
 		}
700 720
 
701 721
 		// Include MooTools framework
702  
-		self::framework();
  722
+		JHtml::_('behavior.framework');
703 723
 
704 724
 		$config = JFactory::getConfig();
705 725
 		$lifetime = ($config->get('lifetime') * 60000);
@@ -751,6 +771,9 @@ public static function highlighter(array $terms, $start = 'highlighter-start', $
751 771
 			return;
752 772
 		}
753 773
 
  774
+		// Include MooTools framework
  775
+		JHtml::_('behavior.framework');
  776
+
754 777
 		JHtml::_('script', 'system/highlighter.js', true, true);
755 778
 
756 779
 		$terms = str_replace('"', '\"', $terms);
@@ -796,7 +819,7 @@ public static function noframes()
796 819
 		}
797 820
 
798 821
 		// Include MooTools framework
799  
-		self::framework();
  822
+		JHtml::_('behavior.framework');
800 823
 
801 824
 		$js = "window.addEvent('domready', function () {if (top == self) {document.documentElement.style.display = 'block'; }" .
802 825
 			" else {top.location = self.location; }});";
68  media/system/js/core-uncompressed.js
@@ -124,35 +124,41 @@ Joomla.checkAll = function(checkbox, stub) {
124 124
  * @return	void
125 125
  */
126 126
 Joomla.renderMessages = function(messages) {
127  
-	Joomla.removeMessages();
128  
-	var container = document.id('system-message-container');
129  
-
130  
-	var dl = new Element('dl', {
131  
-		id: 'system-message',
132  
-		role: 'alert'
133  
-	});
134  
-	Object.each(messages, function (item, type) {
135  
-		var dt = new Element('dt', {
136  
-			'class': type,
137  
-			html: type
138  
-		});
139  
-		dt.inject(dl);
140  
-		var dd = new Element('dd', {
141  
-			'class': type
142  
-		});
143  
-		dd.addClass('message');
144  
-		var list = new Element('ul');
145  
-
146  
-		Array.each(item, function (item, index, object) {
147  
-			var li = new Element('li', {
148  
-				html: item
149  
-			});
150  
-			li.inject(list);
151  
-		}, this);
152  
-		list.inject(dd);
153  
-		dd.inject(dl);
154  
-	}, this);
155  
-	dl.inject(container);
  127
+    Joomla.removeMessages();
  128
+    var container = document.getElementById('system-message-container');
  129
+
  130
+    var dl = document.createElement('dl');
  131
+    dl.id = 'system-message';
  132
+    dl.role = 'alert';
  133
+
  134
+    var type, item, dt, dd, list, li;
  135
+    for ( type in messages ) {
  136
+        if ( Object.prototype.hasOwnProperty.call ( messages, type ) ) {
  137
+            item = messages[ type ];
  138
+            dt = document.createElement('dt');
  139
+            dt.className = type;
  140
+            dt.innerHTML = type;
  141
+            dl.appendChild( dt );
  142
+
  143
+            dd = document.createElement('dd');
  144
+            dd.className = type + ' message';
  145
+            
  146
+            list = document.createElement('ul');
  147
+            
  148
+            for ( var i = 0, len = item.length; i < len; i++ ) {
  149
+                li = document.createElement('li');
  150
+                li.innerHTML = item[ i ];
  151
+                list.appendChild( li );
  152
+            }
  153
+            
  154
+            dd.appendChild( list );
  155
+            dl.appendChild( dd );
  156
+            
  157
+        }
  158
+    }
  159
+    dt = dd = list = li = null;
  160
+    
  161
+    container.appendChild(dl);
156 162
 };
157 163
 
158 164
 
@@ -162,8 +168,8 @@ Joomla.renderMessages = function(messages) {
162 168
  * @return	void
163 169
  */
164 170
 Joomla.removeMessages = function() {
165  
-	var children = $$('#system-message-container > *');
166  
-	children.destroy();
  171
+    var container = document.getElementById('system-message-container'), child;
  172
+    while ( (child = container.firstChild)  ) container.removeChild( child );
167 173
 }
168 174
 
169 175
 /**
14  media/system/js/core.js
... ...
@@ -1,13 +1,13 @@
1 1
 /*
2 2
 		GNU General Public License version 2 or later; see LICENSE.txt
3 3
 */
4  
-if("undefined"===typeof Joomla)var Joomla={};Joomla.editors={};Joomla.editors.instances={};Joomla.submitform=function(a,b){"undefined"===typeof b&&(b=document.getElementById("adminForm"));"undefined"!==typeof a&&(b.task.value=a);if("function"==typeof b.onsubmit)b.onsubmit();"function"==typeof b.fireEvent&&b.fireEvent("submit");b.submit()};Joomla.submitbutton=function(a){Joomla.submitform(a)};
5  
-Joomla.JText={strings:{},_:function(a,b){return"undefined"!==typeof this.strings[a.toUpperCase()]?this.strings[a.toUpperCase()]:b},load:function(a){for(var b in a)this.strings[b.toUpperCase()]=a[b];return this}};Joomla.replaceTokens=function(a){for(var b=document.getElementsByTagName("input"),c=0;c<b.length;c++)"hidden"==b[c].type&&32==b[c].name.length&&"1"==b[c].value&&(b[c].name=a)};Joomla.isEmail=function(a){return/^[\w-_.]*[\w-_.]@[\w].+[\w]+[\w]$/.test(a)};
6  
-Joomla.checkAll=function(a,b){b||(b="cb");if(a.form){for(var c=0,d=0,f=a.form.elements.length;d<f;d++){var e=a.form.elements[d];if(e.type==a.type&&(b&&0==e.id.indexOf(b)||!b))e.checked=a.checked,c+=!0==e.checked?1:0}a.form.boxchecked&&(a.form.boxchecked.value=c);return!0}return!1};
7  
-Joomla.renderMessages=function(a){Joomla.removeMessages();var b=document.id("system-message-container"),c=new Element("dl",{id:"system-message",role:"alert"});Object.each(a,function(a,b){(new Element("dt",{"class":b,html:b})).inject(c);var e=new Element("dd",{"class":b});e.addClass("message");var g=new Element("ul");Array.each(a,function(a){(new Element("li",{html:a})).inject(g)},this);g.inject(e);e.inject(c)},this);c.inject(b)};Joomla.removeMessages=function(){$$("#system-message-container > *").destroy()};
8  
-Joomla.isChecked=function(a,b){"undefined"===typeof b&&(b=document.getElementById("adminForm"));!0==a?b.boxchecked.value++:b.boxchecked.value--};Joomla.popupWindow=function(a,b,c,d,f){window.open(a,b,"height="+d+",width="+c+",top="+(screen.height-d)/2+",left="+(screen.width-c)/2+",scrollbars="+f+",resizable").window.focus()};
  4
+if("undefined"===typeof Joomla)var Joomla={};Joomla.editors={};Joomla.editors.instances={};Joomla.submitform=function(a,b){"undefined"===typeof b&&(b=document.getElementById("adminForm"));if("undefined"!==typeof a)b.task.value=a;if("function"==typeof b.onsubmit)b.onsubmit();"function"==typeof b.fireEvent&&b.fireEvent("submit");b.submit()};Joomla.submitbutton=function(a){Joomla.submitform(a)};
  5
+Joomla.JText={strings:{},_:function(a,b){return"undefined"!==typeof this.strings[a.toUpperCase()]?this.strings[a.toUpperCase()]:b},load:function(a){for(var b in a)this.strings[b.toUpperCase()]=a[b];return this}};Joomla.replaceTokens=function(a){for(var b=document.getElementsByTagName("input"),c=0;c<b.length;c++)if("hidden"==b[c].type&&32==b[c].name.length&&"1"==b[c].value)b[c].name=a};Joomla.isEmail=function(a){return/^[\w-_.]*[\w-_.]@[\w].+[\w]+[\w]$/.test(a)};
  6
+Joomla.checkAll=function(a,b){b||(b="cb");if(a.form){for(var c=0,d=0,f=a.form.elements.length;d<f;d++){var e=a.form.elements[d];if(e.type==a.type&&(b&&0==e.id.indexOf(b)||!b))e.checked=a.checked,c+=!0==e.checked?1:0}if(a.form.boxchecked)a.form.boxchecked.value=c;return!0}return!1};
  7
+Joomla.renderMessages=function(a){Joomla.removeMessages();var b=document.getElementById("system-message-container"),c=document.createElement("dl");c.id="system-message";c.role="alert";var d,f,e,g,h;for(d in a)if(Object.prototype.hasOwnProperty.call(a,d)){f=a[d];e=document.createElement("dt");e.className=d;e.innerHTML=d;c.appendChild(e);e=document.createElement("dd");e.className=d+" message";g=document.createElement("ul");for(var j=0,k=f.length;j<k;j++)h=document.createElement("li"),h.innerHTML=f[j],
  8
+g.appendChild(h);e.appendChild(g);c.appendChild(e)}b.appendChild(c)};Joomla.removeMessages=function(){for(var a=document.getElementById("system-message-container"),b;b=a.firstChild;)a.removeChild(b)};Joomla.isChecked=function(a,b){"undefined"===typeof b&&(b=document.getElementById("adminForm"));!0==a?b.boxchecked.value++:b.boxchecked.value--};Joomla.popupWindow=function(a,b,c,d,f){window.open(a,b,"height="+d+",width="+c+",top="+(screen.height-d)/2+",left="+(screen.width-c)/2+",scrollbars="+f+",resizable").window.focus()};
9 9
 Joomla.tableOrdering=function(a,b,c,d){"undefined"===typeof d&&(d=document.getElementById("adminForm"));d.filter_order.value=a;d.filter_order_Dir.value=b;Joomla.submitform(c,d)};function writeDynaList(a,b,c,d,f){var a="\n\t<select "+a+">",e=0;for(x in b){if(b[x][0]==c){var g="";if(d==c&&f==b[x][1]||0==e&&d!=c)g='selected="selected"';a+='\n\t\t<option value="'+b[x][1]+'" '+g+">"+b[x][2]+"</option>"}e++}document.writeln(a+"\n\t</select>")}
10 10
 function changeDynaList(a,b,c,d,f){a=document.adminForm[a];for(i in a.options.length)a.options[i]=null;i=0;for(x in b)if(b[x][0]==c){opt=new Option;opt.value=b[x][1];opt.text=b[x][2];if(d==c&&f==opt.value||0==i)opt.selected=!0;a.options[i++]=opt}a.length=i}function radioGetCheckedValue(a){if(!a)return"";var b=a.length;if(void 0==b)return a.checked?a.value:"";for(var c=0;c<b;c++)if(a[c].checked)return a[c].value;return""}
11 11
 function getSelectedValue(a,b){var c=document[a][b];i=c.selectedIndex;return null!=i&&-1<i?c.options[i].value:null}function listItemTask(a,b){var c=document.adminForm,d=c[a];if(d){for(var f=0;;f++){var e=c["cb"+f];if(!e)break;e.checked=!1}d.checked=!0;c.boxchecked.value=1;submitbutton(b)}return!1}function submitbutton(a){submitform(a)}
12  
-function submitform(a){a&&(document.adminForm.task.value=a);if("function"==typeof document.adminForm.onsubmit)document.adminForm.onsubmit();"function"==typeof document.adminForm.fireEvent&&document.adminForm.fireEvent("submit");document.adminForm.submit()}function saveorder(a,b){checkAll_button(a,b)}
13  
-function checkAll_button(a,b){b||(b="saveorder");for(var c=0;c<=a;c++){var d=document.adminForm["cb"+c];if(d)!1==d.checked&&(d.checked=!0);else{alert("You cannot change the order of items, as an item in the list is `Checked Out`");return}}submitform(b)};
  12
+function submitform(a){if(a)document.adminForm.task.value=a;if("function"==typeof document.adminForm.onsubmit)document.adminForm.onsubmit();"function"==typeof document.adminForm.fireEvent&&document.adminForm.fireEvent("submit");document.adminForm.submit()}function saveorder(a,b){checkAll_button(a,b)}
  13
+function checkAll_button(a,b){b||(b="saveorder");for(var c=0;c<=a;c++){var d=document.adminForm["cb"+c];if(d){if(!1==d.checked)d.checked=!0}else{alert("You cannot change the order of items, as an item in the list is `Checked Out`");return}}submitform(b)};
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.