Make page specific loaders depend on common
Make page specific loaders depend on common

file:a/js/blob.js -> file:b/js/blob.js
--- a/js/blob.js
+++ b/js/blob.js
@@ -9,7 +9,7 @@
  * @subpackage Javascript
  */
 
-define(["jquery", "modules/blameasync"], function($, blameAsync) {
+define(["jquery", "modules/blameasync", "common"], function($, blameAsync) {
 	$(function() {
 		var url = window.location.href.match(/^([^\?]+\/)/);
 		if (!url) {

--- a/js/commitdiff.js
+++ b/js/commitdiff.js
@@ -9,7 +9,7 @@
  * @subpackage Javascript
  */
 
-define(["jquery"], function($) {
+define(["jquery", "common"], function($) {
 	$(function(){
 		var toc = $('div.commitDiffSBS div.SBSTOC');
 		var content = $('div.SBSContent');

--- a/js/projectlist.js
+++ b/js/projectlist.js
@@ -9,7 +9,7 @@
  * @subpackage Javascript
  */
 
-define(["jquery", "modules/projectsearch"], function($, projectSearch) {
+define(["jquery", "modules/projectsearch", "common"], function($, projectSearch) {
 	$(function() {
 		projectSearch.init($('table.projectList'), $('div.projectSearch'));
 	});

--- a/templates/header.tpl
+++ b/templates/header.tpl
@@ -56,7 +56,13 @@
 	{/if}
 	{rdelim},
 	priority: ['jquery']
-    {rdelim}, ['common'{if $extrascripts},'{$extrascripts}'{/if}]);
+    {rdelim}, [
+    	{if $extrascripts}
+	  '{$extrascripts}'
+	{else}
+	  'common'
+	{/if}
+      ]);
     </script>
     {/if}
     {$smarty.capture.header}

comments