Commit 59529594 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Load jquery on every page (bug #1006213)



Change-Id: I942c1fbeaab3178ea040196ecafafa22bb2c73c2
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 31966be5
......@@ -269,7 +269,7 @@ $js = <<<EOF
EOF;
$smarty = smarty(
array('jquery'),
array(),
array(),
array(),
array('sidebars' => false)
......
......@@ -914,7 +914,7 @@ $j(function() {
});
';
$smarty = smarty(array('jquery'));
$smarty = smarty();
$smarty->assign('INLINEJAVASCRIPT', $customthemejs);
$smarty->assign('institution_form', $institutionform);
$smarty->assign('instancestring', $instancestring);
......
......@@ -130,7 +130,7 @@ function edit_comment_submit(Pieform $form, $values) {
}
$stylesheets = array('style/jquery.rating.css');
$smarty = smarty(array('jquery','jquery.rating'), array(), array(), array('stylesheets' => $stylesheets));
$smarty = smarty(array('jquery.rating'), array(), array(), array('stylesheets' => $stylesheets));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('strdescription', get_string('editcommentdescription', 'artefact.comment', $maxage));
$smarty->assign('form', $form);
......
......@@ -175,7 +175,7 @@ $j(function() {
});
});';
$smarty = smarty(array('jquery'));
$smarty = smarty();
$smarty->assign('PAGEHEADING', $pageheading);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign_by_ref('data', $data);
......
......@@ -40,7 +40,7 @@ $compositetypes = array('employmenthistory', 'educationhistory');
$inlinejs = ArtefactTypeResumeComposite::get_js($compositetypes);
$compositeforms = ArtefactTypeResumeComposite::get_forms($compositetypes);
$smarty = smarty(array('tablerenderer','jquery'));
$smarty = smarty(array('tablerenderer'));
$smarty->assign('compositeforms', $compositeforms);
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('PAGEHEADING', TITLE);
......
......@@ -50,7 +50,7 @@ $defaults = array(
);
$form = pieform(simple_resumefield_form($defaults, 'artefact/resume/goals.php'));
$smarty = smarty(array('jquery', 'artefact/resume/js/simpleresumefield.js'));
$smarty = smarty(array('artefact/resume/js/simpleresumefield.js'));
$smarty->assign('goalform', $form);
$smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);');
$smarty->assign('PAGEHEADING', TITLE);
......
......@@ -122,7 +122,7 @@ $personalinformationform = pieform(array(
),
));
$smarty = smarty(array('jquery', 'artefact/resume/js/simpleresumefield.js'));
$smarty = smarty(array('artefact/resume/js/simpleresumefield.js'));
$smarty->assign('coverletterform', $coverletterform);
$smarty->assign('personalinformationform',$personalinformationform);
$smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);');
......
......@@ -45,7 +45,7 @@ $defaults = array(
);
$form = pieform(simple_resumefield_form($defaults, 'artefact/resume/skills.php'));
$smarty = smarty(array('jquery', 'artefact/resume/js/simpleresumefield.js'));
$smarty = smarty(array('artefact/resume/js/simpleresumefield.js'));
$smarty->assign('interestsform', $form);
$smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);');
$smarty->assign('PAGEHEADING', TITLE);
......
......@@ -50,7 +50,7 @@ $defaults = array(
);
$form = pieform(simple_resumefield_form($defaults, 'artefact/resume/skills.php'));
$smarty = smarty(array('jquery', 'artefact/resume/js/simpleresumefield.js'));
$smarty = smarty(array('artefact/resume/js/simpleresumefield.js'));
$smarty->assign('skillform', $form);
$smarty->assign('INLINEJAVASCRIPT', '$j(simple_resumefield_init);');
$smarty->assign('PAGEHEADING', TITLE);
......
......@@ -364,7 +364,7 @@ class BrowserIDUser extends LiveUser {
}
$registerdescription .= ' ' . get_string('registerprivacy');
$smarty = smarty(array('jquery'));
$smarty = smarty();
$smarty->assign('register_form', $formhtml);
$smarty->assign('registerdescription', $registerdescription);
if ($registerterms) {
......
......@@ -475,7 +475,7 @@ $j(function() {
});
';
$smarty = smarty(array('jquery'));
$smarty = smarty();
$smarty->assign('form', $editgroup);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('INLINEJAVASCRIPT', $js);
......
......@@ -80,7 +80,7 @@ if ($group->public) {
$headers[] = '<link rel="alternate" type="application/atom+xml" href="' . $feedlink . '" />';
}
$javascript = array('paginator', 'jquery');
$javascript = array('paginator');
$javascript = array_merge($javascript, $view->get_blocktype_javascript());
$smarty = smarty(
......
......@@ -47,7 +47,7 @@ if ($USER->is_logged_in()) {
require_once(get_config('libroot') . 'view.php');
$view = $USER->get_view_by_type('dashboard');
$javascript = array('paginator', 'jquery');
$javascript = array('paginator');
$javascript = array_merge($javascript, $view->get_blocktype_javascript());
$stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
$smarty = smarty(
......
......@@ -214,15 +214,17 @@ EOF;
unset($check[$key]);
}
}
// Load jquery first, so that it doesn't break Mochikit
// If any page adds jquery explicitly, remove it from the list
if (($key = array_search('jquery', $check)) !== false) {
array_unshift($javascript_array, $jsroot . 'jquery/jquery.js');
// Make jQuery accessible with $j (Mochikit has $)
$headers[] = '<script type="text/javascript">$j=jQuery;</script>';
unset($check[$key]);
}
}
// Make jQuery accessible with $j (Mochikit has $)
$javascript_array[] = $jsroot . 'jquery/jquery.js';
$headers[] = '<script type="text/javascript">$j=jQuery;</script>';
if (get_config('developermode') & DEVMODE_UNPACKEDJS) {
$javascript_array[] = $jsroot . 'MochiKit/MochiKit.js';
$javascript_array[] = $jsroot . 'MochiKit/Position.js';
......
......@@ -210,7 +210,7 @@ if ($registerterms = get_config('registerterms')) {
}
$registerdescription .= ' ' . get_string('registerprivacy');
$smarty = smarty(array('jquery'));
$smarty = smarty();
$smarty->assign('register_form', $formhtml);
$smarty->assign('registerdescription', $registerdescription);
if ($registerterms) {
......
......@@ -83,7 +83,7 @@ if (!$restrictedview) {
$viewcontent = $view->build_columns();
}
$javascript = array('paginator', 'jquery', 'lib/pieforms/static/core/pieforms.js', 'artefact/resume/resumeshowhide.js');
$javascript = array('paginator', 'lib/pieforms/static/core/pieforms.js', 'artefact/resume/resumeshowhide.js');
$javascript = array_merge($javascript, $view->get_blocktype_javascript());
// Set up theme
......
......@@ -596,7 +596,7 @@ function editaccess_submit(Pieform $form, $values) {
$form = pieform($form);
$smarty = smarty(
array('tablerenderer', 'jquery'),
array('tablerenderer'),
array(),
array(
'mahara' => array('From', 'To', 'datetimeformatguide'),
......
......@@ -125,7 +125,6 @@ if ($artefact->get('allowcomments')) {
$anonfeedback = !$USER->is_logged_in() && view_has_token($viewid, get_cookie('viewaccess:'.$viewid));
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form(false, $artefact->get('approvecomments')));
$extrastylesheets[] = 'style/jquery.rating.css';
$javascript[] = 'jquery';
$javascript[] = 'jquery.rating';
}
$objectionform = pieform(objection_form());
......
......@@ -146,7 +146,7 @@ if ($viewtheme && !isset($allowedthemes[$viewtheme])) {
exit;
}
$javascript = array('views', 'tinymce', 'paginator', 'jquery', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js');
$javascript = array('views', 'tinymce', 'paginator', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js');
$javascript = array_merge($javascript, $view->get_blocktype_javascript());
$smarty = smarty($javascript, $stylesheets, false, $extraconfig);
......
......@@ -261,7 +261,7 @@ $js = <<<EOF
EOF;
$smarty = smarty(
array('jquery'),
array(),
array(),
array(),
array('sidebars' => false)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment