dojo: main UI: load stuff asynchronously

This commit is contained in:
Andrew Dolgov 2016-08-10 10:01:05 +03:00
parent 25a533c432
commit ee5170424e
4 changed files with 239 additions and 214 deletions

View File

@ -88,6 +88,15 @@
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
<link rel="icon" type="image/png" sizes="72x72" href="images/favicon-72px.png" />
<script>
dojoConfig = {
async: true,
packages: [
{ name: "fox", location: "../../js" },
]
};
</script>
<?php
foreach (array("lib/prototype.js",
"lib/scriptaculous/scriptaculous.js?load=effects,controls",
@ -105,7 +114,7 @@
require_once 'lib/jshrink/Minifier.php';
print get_minified_js(array("tt-rss",
"functions", "feedlist", "viewfeed", "FeedTree", "PluginHost"));
"functions", "feedlist", "viewfeed", "PluginHost"));
foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
if (method_exists($p, "get_js")) {

View File

@ -216,6 +216,8 @@ function genericSanityCheck() {
function init() {
try {
require(['dojo/_base/kernel', 'dojo/ready', 'dojo/parser', 'dojo/_base/loader'], function(dojo, ready, parser) {
//dojo.registerModulePath("fox", "../../js/");
dojo.require("fox.FeedTree");
@ -223,6 +225,7 @@ function init() {
dojo.require("dijit.ColorPalette");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.ComboButton");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.DropDownButton");
dojo.require("dijit.form.FilteringSelect");
@ -238,6 +241,7 @@ function init() {
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dijit.PopupMenuItem");
dojo.require("dijit.Menu");
dojo.require("dijit.ProgressBar");
dojo.require("dijit.ProgressBar");
@ -559,6 +563,7 @@ function init() {
} });
};
});
} catch (e) {
exception_error("init", e);
@ -568,7 +573,11 @@ function init() {
function init_second_stage() {
try {
dojo.addOnLoad(function() {
Event.observe(window, 'resize', function() {
dijit.byId("main").resize();
});
//dojo.addOnLoad(function() {
updateFeedList();
closeArticlePanel();
@ -594,7 +603,7 @@ function init_second_stage() {
}
});
});
//});
delCookie("ttrss_test");

View File

@ -1,3 +1,4 @@
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
dojo.addOnLoad(function () {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) {
if (row) {
@ -38,3 +39,5 @@ dojo.addOnLoad(function() {
});
});
});

View File

@ -22,6 +22,8 @@ function expandSizeWrapper(id) {
}
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
dojo.addOnLoad(function() {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) {
if (getInitParam('cdm_expanded')) {
@ -45,3 +47,5 @@ dojo.addOnLoad(function() {
return true;
});
});
});