Commit 7d6cdea1 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Remove dependency on require.js from CL/Apt frontend. Checkpoint.

parent 84eff3a8
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include("profile_defs.php");
$page_title = "My Profiles";
......@@ -197,8 +198,13 @@ echo "<script src='js/lib/jQRangeSlider/jQRuler.js'></script>\n";
echo "<script src='js/lib/jquery.tablesorter.min.js'></script>\n";
echo "<script src='js/lib/jquery.tablesorter.widgets.min.js'></script>\n";
echo "<script src='js/lib/jquery.tablesorter.widget-math.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/activity'></script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
SPITREQUIRE("js/activity.js");
AddTemplate("activity");
SPITFOOTER();
?>
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
# Must be after quickvm_sup.php since it changes the auth domain.
$page_title = "Extend";
......@@ -112,7 +113,12 @@ echo "<link rel='stylesheet'
# Place to hang the toplevel template.
echo "<div id='main-body'></div>\n";
SPITREQUIRE("adminextend",
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
REQUIRE_IDLE_GRAPHS();
SPITREQUIRE("js/adminextend.js",
"<script src='js/lib/d3.v3.js'></script>".
"<script src='js/lib/nv.d3.js'></script>".
"<script src='js/lib/jquery.tablesorter.min.js'></script>".
......@@ -136,5 +142,7 @@ if (count($extensions)) {
echo json_encode($foo, JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_TAG|JSON_HEX_TAG);
echo "</script>\n";
}
AddTemplateList(array("adminextend", "oops-modal", "waitwait-modal", "admin-history", "admin-firstrow", "admin-secondrow", "admin-utilization", "admin-summary"));
SPITFOOTER();
?>
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
$page_title = "Approve User";
#
......@@ -95,6 +96,7 @@ echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/approveuser'></script>\n";
REQUIRE_SUP();
SPITREQUIRE("js/approveuser.js");
SPITFOOTER();
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
$page_title = "Change Password";
RedirectSecure();
......@@ -136,6 +137,7 @@ function SPITFORM($password1, $password2, $errors)
};
SPITHEADER(1);
REQUIRE_SUP();
SPITNULLREQUIRE();
echo "<div class='row'>
......@@ -231,6 +233,7 @@ if (isset($key)) {
# Header after cookie.
SPITHEADER(1);
SpitWaitModal("waitwait");
REQUIRE_SUP();
SPITREQUIRE("async");
echo "<script>ShowWaitModal('waitwait');</script>\n";
flush();
......
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
$page_title = "Cluster Graphs";
SPITHEADER(1);
......@@ -38,5 +39,12 @@ echo "</script>\n";
# Place to hang the toplevel template.
echo "<div id='cluster-graphs'></div>\n";
SPITREQUIRE("cluster-graphs");
REQUIRE_SUP();
REQUIRE_UNDERSCORE();
REQUIRE_BILEVEL();
REQUIRE_LIQUIDFILLGAUGE();
SPITREQUIRE("js/cluster-graphs.js");
AddTemplate("cluster-graphs");
SPITFOOTER();
?>
......@@ -26,6 +26,7 @@ include("defs.php3");
include_once("geni_defs.php");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include_once("instance_defs.php");
include_once("aggregate_defs.php");
$page_title = "Cluster Status";
......@@ -73,10 +74,15 @@ echo "<script type='text/plain' id='agglist-json'>\n";
echo htmlentities(json_encode($aggregates)) . "\n";
echo "</script>\n";
SPITREQUIRE("cluster-status",
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
SPITREQUIRE("js/cluster-status.js",
"<script src='js/lib/jquery.tablesorter.min.js'></script>".
"<script src='js/lib/jquery.tablesorter.widgets.min.js'></script>".
"<script src='js/lib/sugar.min.js'></script>".
"<script src='js/lib/jquery.tablesorter.parser-date.js'></script>");
AddTemplateList(array("cluster-status", "cluster-status-templates"));
SPITFOOTER();
?>
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include_once("profile_defs.php");
include_once("instance_defs.php");
# Must be after quickvm_sup.php since it changes the auth domain.
......@@ -48,7 +49,7 @@ $optargs = OptionalPageArguments("create", PAGEARG_STRING,
#
function SPITFORM($formfields, $errors)
{
global $this_user, $projlist, $embedded, $this_idx;
global $this_user, $projlist, $embedded, $this_idx, $PORTAL_TEMPLATES;
$button_label = "Create";
$title = "Create Dataset";
......@@ -130,8 +131,8 @@ function SPITFORM($formfields, $errors)
echo " window.BUTTONLABEL = '$button_label';\n";
echo "</script>\n";
SPITREQUIRE("create-dataset",
"<script src='js/lib/jquery-ui.js'></script>");
SPITREQUIRE_DATASET();
AddTemplateList(array("create-dataset", "dataset-help", "oops-modal", "waitwait-modal"));
SPITFOOTER();
}
......
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
# Must be after quickvm_sup.php since it changes the auth domain.
$page_title = "Create Group";
......@@ -74,8 +75,14 @@ echo "</script>\n";
echo "<script type='text/javascript'>\n";
echo " window.ISADMIN = $isadmin;\n";
echo "</script>\n";
SPITREQUIRE("create-group");
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
REQUIRE_APTFORMS();
SPITREQUIRE("js/create-group.js");
AddTemplateList(array("create-group", "oops-modal", "waitwait-modal"));
SPITFOOTER();
?>
......@@ -26,6 +26,7 @@ include("defs.php3");
include_once("geni_defs.php");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
$dblink = GetDBLink("sa");
#
......
......@@ -26,6 +26,7 @@ include("defs.php3");
include_once("geni_defs.php");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include_once("instance_defs.php");
$page_title = "Dash Board";
......@@ -53,5 +54,11 @@ echo "</script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/dashboard'></script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
SPITREQUIRE("js/dashboard.js");
AddTemplate("dashboard");
SPITFOOTER();
?>
......@@ -27,6 +27,7 @@ include("lease_defs.php");
include("imageid_defs.php");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include_once("dataset_defs.php");
include_once("instance_defs.php");
include_once("profile_defs.php");
......@@ -77,7 +78,7 @@ if (!$dataset->AccessCheck($this_user, $LEASE_ACCESS_MODIFY)) {
#
function SPITFORM($formfields, $errors)
{
global $this_user, $projlist, $embedded, $this_idx;
global $this_user, $projlist, $embedded, $this_idx, $PORTAL_TEMPLATES;
$button_label = "Save";
$title = "Modify Dataset";
$isadmin = (ISADMIN() ? "true" : "false");
......@@ -125,7 +126,8 @@ function SPITFORM($formfields, $errors)
echo " window.BUTTONLABEL = '$button_label';\n";
echo "</script>\n";
SPITREQUIRE("create-dataset");
SPITREQUIRE_DATASET();
AddTemplateList(array("create-dataset", "dataset-help", "oops-modal", "waitwait-modal"));
SPITFOOTER();
}
......
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
# No page arguments, but make sure that the environment is clean
RequiredPageArguments();
......@@ -34,6 +35,6 @@ 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='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/main'></script>";
SPITNULLREQUIRE();
SPITFOOTER();
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
jinclude("require.php");
$page_title = "Forgot Your Password";
RedirectSecure();
......
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
# Must be after quickvm_sup.php since it changes the auth domain.
include_once("../session.php");
$page_title = "Login";
......@@ -48,7 +49,11 @@ echo "<script src='https://www.emulab.net/protogeni/speaks-for/geni-auth.js'>
</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/geni-login'></script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
SPITREQUIRE("js/geni-login.js");
AddTemplateList(array("geni-login", "waitwait-modal"));
SPITFOOTER();
?>
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include_once("profile_defs.php");
$page_title = "Genilib Editor";
......@@ -121,9 +122,14 @@ echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='https://cdn.jsdelivr.net/ace/1.2.3/noconflict/ace.js'></script>\n";
echo "<script src='https://cdn.jsdelivr.net/ace/1.2.3/noconflict/keybinding-vim.js'></script>\n";
echo "<script src='https://cdn.jsdelivr.net/ace/1.2.3/noconflict/keybinding-emacs.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/genilib-editor'></script>";
$PORTAL_TEMPLATES = array("genilib-editor", "oops-modal", "waitwait-modal", "manage-profile");
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_APTFORMS();
REQUIRE_JACKS();
SPITREQUIRE("js/genilib-editor.js");
AddTemplateList(array("genilib-editor", "oops-modal", "waitwait-modal", "manage-profile"));
SPITFOOTER();
?>
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
$page_title = "Image List";
#
......@@ -172,7 +173,12 @@ echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/jquery.tablesorter.min.js'></script>\n";
echo "<script src='js/lib/jquery.tablesorter.widgets.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/images'></script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
SPITREQUIRE("js/images.js");
AddTemplate("images");
SPITFOOTER();
?>
......@@ -28,6 +28,7 @@ include_once("geni_defs.php");
include_once("webtask.php");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
include_once("instance_defs.php");
include_once("profile_defs.php");
# Must be after quickvm_sup.php since it changes the auth domain.
......@@ -437,11 +438,21 @@ function SPITFORM($formfields, $newuser, $errors)
echo " window.PORTAL_NAME = '$PORTAL_NAME';\n";
echo " window.CLASSIC = " . ($classic ? "true" : "false") . ";\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js?nocache=asdfasdf'></script>\n";
echo "<script src='js/lib/bootstrap.js?nocache=asdfasdf'></script>\n";
echo "<script src='js/lib/require.js?nocache=asdfasdf' ".
"data-main='js/instantiate" . ($classic ? "" : "-new") .
".js?nocache=asdfasdf'></script>";
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_CONSTRAINTS();
REQUIRE_SUP();
REQUIRE_PPWIZARDSTART();
REQUIRE_JACKS_EDITOR();
REQUIRE_WIZARD_TEMPLATE();
REQUIRE_FORMHELPERS();
REQUIRE_FILESTYLE();
REQUIRE_MARKED();
REQUIRE_JACKS();
REQUIRE_JQUERY_STEPS();
SPITREQUIRE("js/instantiate" . ($classic ? "" : "-new") . ".js");
}
if (!isset($create)) {
......@@ -517,6 +528,8 @@ if (!isset($create)) {
SPITFORM($defaults, false, array());
echo "<div style='display: none'><div id='jacks-dummy'></div></div>\n";
AddTemplateList(array("instantiate", "instantiate-new", "aboutapt", "aboutcloudlab", "aboutpnet", "waitwait-modal", "rspectextview-modal"));
SPITFOOTER();
return;
}
......
......@@ -25,6 +25,7 @@ chdir("..");
include("defs.php3");
chdir("apt");
include("quickvm_sup.php");
include("require.php");
$page_title = "Invite a User";
#
......@@ -45,7 +46,7 @@ $optargs = OptionalPageArguments("invite", PAGEARG_STRING,
#
function SPITFORM($formfields, $errors)
{
global $projlist;
global $projlist, $PORTAL_TEMPLATES;
SPITHEADER(1);
......@@ -69,7 +70,13 @@ function SPITFORM($formfields, $errors)
echo "<script src='js/lib/jquery-2.0.3.min.js'></script>\n";
echo "<script src='js/lib/bootstrap.js'></script>\n";
echo "<script src='js/lib/require.js' data-main='js/invite'></script>";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_APTFORMS();
SPITREQUIRE("js/invite.js");
AddTemplate("invite");
SPITFOOTER();
}
......
define(['underscore', 'js/lib/text!template/edit-modal.html', 'js/lib/text!template/edit-inline.html'],
function (_, editModalString, editInlineString)
//define(['underscore', 'js/lib/text!template/edit-modal.html', 'js/lib/text!template/edit-inline.html'],
window.JacksEditor = function ()
{
'use strict';
var templates = APT_OPTIONS.fetchTemplateList(['edit-modal', 'edit-inline']);
var editModalString = templates['edit-modal'];
var editInlineString = templates['edit-inline'];
var context = {
canvasOptions: {
"defaults": [
......@@ -272,4 +275,4 @@ function (_, editModalString, editInlineString)
}
return JacksEditor;
});
})();
require(window.APT_OPTIONS.configObject,
['underscore', 'js/quickvm_sup', 'moment',
'js/lib/text!template/activity.html'],
function (_, sup, moment, profileString)
{
//require(window.APT_OPTIONS.configObject,
// ['underscore', 'js/quickvm_sup', 'moment'],
//function (_, sup, moment)
$(function () {
'use strict';
var ajaxurl = null;
var profileTemplate = _.template(profileString);
var templates = APT_OPTIONS.fetchTemplateList(['activity']);
var profileTemplate = _.template(templates['activity']);
function initialize()
{
......
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