Commit b2e0fb50 authored by Jonathon Duerig's avatar Jonathon Duerig

Tweaked new html import system. Usage is less verbose and imports are inserted just before </body>

parent 79671ab8
......@@ -123,7 +123,7 @@ echo "<script src='https://cdn.jsdelivr.net/ace/1.2.3/noconflict/keybinding-vim.
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>";
EchoTemplateList(array("genilib-editor", "oops-modal", "waitwait-modal", "manage-profile"));
$PORTAL_TEMPLATES = array("genilib-editor", "oops-modal", "waitwait-modal", "manage-profile");
SPITFOOTER();
?>
......@@ -171,3 +171,12 @@ window.APT_OPTIONS.fetchTemplate = function (name) {
}
return result;
};
window.APT_OPTIONS.fetchTemplateList = function (nameList) {
var result = {};
for (var name in nameList)
{
result[name] = window.APT_OPTIONS.fetchTemplate(name);
}
return result;
};
......@@ -10,10 +10,11 @@ function (_, sup, aptforms)//,
{
'use strict';
var pageString = APT_OPTIONS.fetchTemplate('genilib-editor');
var oopsString = APT_OPTIONS.fetchTemplate('oops-modal');
var waitwaitString = APT_OPTIONS.fetchTemplate('waitwait-modal');
var manageString = APT_OPTIONS.fetchTemplate('manage-profile');
var templates = APT_OPTIONS.fetchTemplateList('genilib-editor', 'oops-modal', 'waitwait-modal', 'manage-profile');
var pageString = templates['genilib-editor'];
var oopsString = templates['oops-modal'];
var waitwaitString = templates['waitwait-modal'];
var manageString = templates['manage-profile'];
var editor;
var isWaiting = false;
......
......@@ -40,6 +40,8 @@ if (isset($_REQUEST["embedded"]) && $_REQUEST["embedded"]) {
$embedded = 1;
}
$PORTAL_TEMPLATES = array();
# Flag to signal that a requires was spit. For errors.
$spatrequired = 0;
......@@ -475,7 +477,7 @@ function GET_ANNOUNCEMENTS($user)
}
$PAGEFOOTER_FUNCTION = function($ignored = NULL) {
global $PORTAL_HELPFORUM, $PORTAL_NSFNUMBER, $embedded;
global $PORTAL_HELPFORUM, $PORTAL_NSFNUMBER, $embedded, $PORTAL_TEMPLATES;
echo "</div>
</div>\n";
......@@ -509,8 +511,9 @@ $PAGEFOOTER_FUNCTION = function($ignored = NULL) {
</div>
</div>
</div>
<!-- Placed at the end of the document so the pages load faster -->
</body></html>\n";
<!-- Placed at the end of the document so the pages load faster -->\n";
EchoTemplateList($PORTAL_TEMPLATES);
echo "</body></html>\n";
};
function SPITFOOTER($ignored = null)
......
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