load dijit properly, duh

This commit is contained in:
Andrew Dolgov 2016-08-10 11:48:09 +03:00
parent ee5170424e
commit 0dbc20a8d4

View file

@ -216,39 +216,43 @@ function genericSanityCheck() {
function init() { function init() {
try { try {
require(['dojo/_base/kernel', 'dojo/ready', 'dojo/parser', 'dojo/_base/loader'], function(dojo, ready, parser) {
//dojo.registerModulePath("fox", "../../js/"); //dojo.registerModulePath("fox", "../../js/");
dojo.require("fox.FeedTree"); require(['dojo/_base/kernel',
'dojo/ready',
'dojo/parser',
'dojo/_base/loader',
"dijit/ProgressBar",
"dijit/ColorPalette",
"dijit/Dialog",
"dijit/form/Button",
"dijit/form/ComboButton",
"dijit/form/CheckBox",
"dijit/form/DropDownButton",
"dijit/form/FilteringSelect",
"dijit/form/Form",
"dijit/form/RadioButton",
"dijit/form/Select",
"dijit/form/SimpleTextarea",
"dijit/form/TextBox",
"dijit/form/ComboBox",
"dijit/form/ValidationTextBox",
"dijit/InlineEditBox",
"dijit/layout/AccordionContainer",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dijit/PopupMenuItem",
"dijit/Menu",
"dijit/Toolbar",
"dijit/Tree",
"dijit/tree/dndSource",
"dijit/tree/ForestStoreModel",
"dojo/data/ItemFileWriteStore" ], function (dojo, ready, parser) {
dojo.require("dijit.ColorPalette"); ready(function() {
dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button"); dojo.require("fox.FeedTree");
dojo.require("dijit.form.ComboButton");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.DropDownButton");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.RadioButton");
dojo.require("dijit.form.Select");
dojo.require("dijit.form.SimpleTextarea");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.InlineEditBox");
dojo.require("dijit.layout.AccordionContainer");
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");
dojo.require("dijit.Toolbar");
dojo.require("dijit.Tree");
dojo.require("dijit.tree.dndSource");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.parser.parse(); dojo.parser.parse();
@ -264,6 +268,8 @@ function init() {
var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, '')); var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
var clientTzOffset = new Date().getTimezoneOffset() * 60; var clientTzOffset = new Date().getTimezoneOffset() * 60;
init_hotkey_actions();
new Ajax.Request("backend.php", { new Ajax.Request("backend.php", {
parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio, parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
hasMp3: hasMp3, hasMp3: hasMp3,
@ -273,6 +279,18 @@ function init() {
backend_sanity_check_callback(transport); backend_sanity_check_callback(transport);
} }); } });
});
});
} catch (e) {
exception_error("init", e);
}
}
function init_hotkey_actions() {
hotkey_actions["next_feed"] = function() { hotkey_actions["next_feed"] = function() {
var rv = dijit.byId("feedTree").getNextFeed( var rv = dijit.byId("feedTree").getNextFeed(
getActiveFeedId(), activeFeedIsCat()); getActiveFeedId(), activeFeedIsCat());
@ -562,22 +580,11 @@ function init() {
viewCurrentFeed(); viewCurrentFeed();
} }); } });
}; };
});
} catch (e) {
exception_error("init", e);
}
} }
function init_second_stage() { function init_second_stage() {
try { try {
Event.observe(window, 'resize', function() {
dijit.byId("main").resize();
});
//dojo.addOnLoad(function() {
updateFeedList(); updateFeedList();
closeArticlePanel(); closeArticlePanel();
@ -603,8 +610,6 @@ function init_second_stage() {
} }
}); });
//});
delCookie("ttrss_test"); delCookie("ttrss_test");
var toolbar = document.forms["main_toolbar_form"]; var toolbar = document.forms["main_toolbar_form"];