Commit aa772bba authored by Jonathon Duerig's avatar Jonathon Duerig

Load jquery before require for Jacks compatibility. Fix build issues.

parent 5fa0f84d
......@@ -32,6 +32,8 @@ RequiredPageArguments();
SPITHEADER();
echo "The URL you gave: <b>" . htmlentities( $_SERVER["REQUEST_URI"] ) . "</b>
is not available or is broken.";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/main'></script>";
SPITFOOTER();
......@@ -5,10 +5,8 @@ window.APT_OPTIONS.config = function ()
require.config({
baseUrl: '.',
paths: {
'jquery': 'js/lib/jquery-2.0.3.min',
'jquery-ui': 'jquery-ui/js/jquery-ui-1.10.4.custom',
'jquery-grid':'jquery.appendGrid/js/jquery.appendGrid-1.3.1.min',
'bootstrap': 'bootstrap/js/bootstrap',
'jquery-ui': 'js/lib/jquery-ui-1.10.4.custom',
'jquery-grid':'js/lib/jquery.appendGrid-1.3.1.min',
'formhelpers': 'formhelpers/js/bootstrap-formhelpers',
'dateformat': 'js/lib/date.format',
'd3': 'js/lib/d3.v3',
......@@ -21,49 +19,12 @@ window.APT_OPTIONS.config = function ()
'jacks': 'https://www.emulab.net/protogeni/jacks-stable/js/jacks'
},
shim: {
'bootstrap': { deps: ['jquery'] },
'jquery-ui': { deps: ['jquery'] },
'jquery-grid': { deps: ['jquery-ui'] },
'formhelpers': { deps: ['bootstrap']},
'dateformat': { exports: 'dateFormat' },
'd3': { exports: 'd3' },
'filestyle': { deps: ['bootstrap']},
'tablesorter': { deps: ['jquery'] },
'tablesorterwidgets': { deps: ['tablesorter'] },
'marked' : { exports: 'marked' },
'underscore': { exports: '_' }
},
});
};
window.APT_OPTIONS.configNoQuery = function ()
{
require.config({
baseUrl: '.',
paths: {
'jquery': 'js/lib/jquery-2.0.3.min',
'jquery-ui': 'jquery-ui/js/jquery-ui-1.10.4.custom',
'jquery-grid':'jquery.appendGrid/js/jquery.appendGrid-1.3.1.min',
'bootstrap': 'bootstrap/js/bootstrap',
'formhelpers': 'formhelpers/js/bootstrap-formhelpers',
'dateformat': 'js/lib/date.format',
'd3': 'js/lib/d3.v3',
'filestyle': 'js/lib/filestyle',
'tablesorter': 'js/lib/jquery.tablesorter.min',
'tablesorterwidgets': 'js/lib/jquery.tablesorter.widgets.min',
'marked': 'js/lib/marked',
'moment': 'js/lib/moment',
'underscore': 'js/lib/underscore-min',
'jacks': 'https://www.emulab.net/protogeni/jacks-stable/js/jacks'
},
shim: {
'bootstrap': { },
'jquery-ui': { },
'jquery-grid': { deps: ['jquery-ui'] },
'formhelpers': { /*deps: ['bootstrap']*/},
'formhelpers': { },
'dateformat': { exports: 'dateFormat' },
'd3': { exports: 'd3' },
'filestyle': { deps: ['bootstrap']},
'filestyle': { },
'tablesorter': { },
'tablesorterwidgets': { deps: ['tablesorter'] },
'marked' : { exports: 'marked' },
......
window.APT_OPTIONS.configNoQuery();
window.APT_OPTIONS.config();
require([// jQuery modules
require(['js/quickvm_sup', // jQuery modules
'formhelpers', 'filestyle', 'marked', 'jacks'],
function ()
function (sup)
{
'use strict';
......@@ -48,6 +48,7 @@ function ()
});
UpdateProfileSelection($('#profile_name li[value = ' +
window.PROFILE + ']'));
_.delay(function () {$('.dropdown-toggle').dropdown();}, 500);
}
function resetForm($form) {
......@@ -139,31 +140,9 @@ function ()
[{ rspec: json.value.rspec }]);
}
}
var $xmlthing = CallMethod("getprofile", null, 0, profile);
var $xmlthing = sup.CallMethod("getprofile", null, 0, profile);
$xmlthing.done(callback);
}
function CallMethod(method, callback, uuid, arg)
{
return $.ajax({
// the URL for the request
url: window.location.href,
// the data to send (will be converted to a query string)
data: {
uuid: uuid,
ajax_request: 1,
ajax_method: method,
ajax_argument: arg,
},
// whether this is a POST or GET request
type: (arg ? "GET" : "GET"),
// the type of data we expect back
dataType : "json",
});
}
$(document).ready(initialize);
});
window.APT_OPTIONS.config();
require(['jquery', 'js/quickvm_sup',
require(['js/quickvm_sup'
// jQuery modules
'bootstrap'],
function ($, sup)
],
function (sup)
{
'use strict';
......
window.APT_OPTIONS.config();
require(['jquery', 'underscore', 'js/quickvm_sup',
require(['underscore', 'js/quickvm_sup',
'js/lib/text!template/manage-profile.html',
'js/lib/text!template/waitwait-modal.html',
'js/lib/text!template/imaging-modal.html',
......@@ -8,8 +8,8 @@ require(['jquery', 'underscore', 'js/quickvm_sup',
'js/lib/text!template/showtopo-modal.html',
'js/lib/text!template/rspectextview-modal.html',
// jQuery modules
'bootstrap','filestyle','marked','jquery-ui','jquery-grid'],
function ($, _, sup,
'filestyle','marked','jquery-ui','jquery-grid'],
function (_, sup,
manageString, waitwaitString, imagingString,
rendererString, showtopoString, rspectextviewString)
{
......
window.APT_OPTIONS.config();
require(['jquery', 'js/quickvm_sup',
'tablesorter', 'tablesorterwidgets', 'bootstrap'],
function ($, sup)
require(['js/quickvm_sup',
'tablesorter', 'tablesorterwidgets'],
function (sup)
{
'use strict';
......
window.APT_OPTIONS.config();
require(['jquery', 'js/quickvm_sup',
'tablesorter', 'tablesorterwidgets', 'bootstrap'],
function ($, sup)
require(['js/quickvm_sup',
'tablesorter', 'tablesorterwidgets'],
function (sup)
{
'use strict';
var ajaxurl = null;
......
window.APT_OPTIONS.config();
require(['jquery', 'js/quickvm_sup',
// jQuery modules
'bootstrap'],
function ($, sup)
require(['js/quickvm_sup'],
function (sup)
{
'use strict';
......
define(['jquery', 'd3', 'dateformat', 'marked'],
function ($, d3) {
define(['d3', 'dateformat', 'marked'],
function (d3) {
function ShowModal(which)
{
......
window.APT_OPTIONS.config();
require(['jquery', 'underscore', 'js/quickvm_sup',
require(['underscore', 'js/quickvm_sup',
'js/lib/text!template/about-account.html',
'js/lib/text!template/verify-modal.html',
'js/lib/text!template/signup-personal.html',
'js/lib/text!template/signup-project.html',
'js/lib/text!template/signup.html',
// jQuery modules
'bootstrap', 'formhelpers'],
function ($, _, sup,
'formhelpers'],
function (_, sup,
aboutString, verifyString, personalString,
projectString, signupString)
{
......
window.APT_OPTIONS.config();
require(['jquery', 'js/quickvm_sup', 'moment',
'tablesorter', 'tablesorterwidgets', 'bootstrap' ],
function ($, sup, moment)
require(['js/quickvm_sup', 'moment',
'tablesorter', 'tablesorterwidgets'],
function (sup, moment)
{
'use strict';
var CurrentTopo = null;
......
......@@ -64,6 +64,8 @@ if (NOLOGINS()) {
SPITHEADER();
SPITUSERERROR("Sorry, logins are temporarily disabled, ".
"please try again later.");
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/main'></script>";
SPITFOOTER();
return;
......@@ -145,6 +147,8 @@ function SPITFORM($uid, $referrer, $error)
</div>
</div>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/main'></script>";
SPITFOOTER();
return;
......@@ -182,6 +186,8 @@ else {
restored. <br> <br>
Please do not attempt to login again; it will not work!
</h3>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/main'></script>";
SPITFOOTER();
return;
......
......@@ -44,6 +44,8 @@ if ($this_user) {
else {
SPITHEADER();
echo "<center><font color=red>Logout failed!</font></failed>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/main'></script>";
SPITFOOTER();
}
......
......@@ -110,9 +110,9 @@ function SPITFORM($formfields, $errors)
echo "</script>\n";
echo "<link rel='stylesheet'
href='jquery-ui/css/smoothness/jquery-ui-1.10.4.custom.min.css'>\n";
href='jquery-ui-1.10.4.custom.min.css'>\n";
echo "<link rel='stylesheet'
href='jquery.appendGrid/css/jquery.appendGrid-1.3.1.min.css'>\n";
href='jquery.appendGrid-1.3.1.min.css'>\n";
# For progress bubbles in the imaging modal.
echo "<link rel='stylesheet' href='progress.css'>\n";
......@@ -129,6 +129,8 @@ function SPITFORM($formfields, $errors)
echo " window.SNAPUUID = '$snapuuid';\n";
}
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/manage_profile'>
</script>";
......
......@@ -137,6 +137,8 @@ if (ISADMIN() && !isset($all)) {
echo " </div>
</div>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/myexperiments'></script>\n";
SPITFOOTER();
......
......@@ -183,6 +183,8 @@ echo "<!-- This is the topology view modal -->
echo "<script type='text/javascript'>\n";
echo " window.AJAXURL = 'server-ajax.php';\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/myprofiles'></script>\n";
SPITFOOTER();
......
......@@ -56,6 +56,8 @@ $PAGEERROR_HANDLER = function($msg, $status_code = 0) {
SPITHEADER();
}
echo $msg;
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/null.js'></script>\n";
SPITFOOTER();
die("");
......@@ -237,6 +239,8 @@ function SPITAJAX_ERROR($code, $msg)
function SPITNULLREQUIRE()
{
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/null'></script>\n";
}
......
......@@ -94,6 +94,8 @@ function SPITFORM($formfields, $showverify, $errors)
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/signup'></script>";
SPITFOOTER();
}
......
......@@ -306,6 +306,8 @@ echo " window.APT_OPTIONS.creatorUid = '" . $creator_uid . "';\n";
echo " window.APT_OPTIONS.creatorEmail = '" . $creator_email . "';\n";
echo " window.APT_OPTIONS.AJAXURL = 'server-ajax.php';\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='bootstrap/js/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/status'></script>";
#
......
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