move some more shared stuff to CommonDialogs, Filters, and Utils
This commit is contained in:
parent
4b492cc93e
commit
1e2d4410d3
|
@ -174,7 +174,7 @@ class Dlg extends Handler_Protected {
|
||||||
|
|
||||||
print "<div align='center'>";
|
print "<div align='center'>";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return genUrlChangeKey('$feed_id', '$is_cat')\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return CommonDialogs.genUrlChangeKey('$feed_id', '$is_cat')\">".
|
||||||
__('Generate new URL')."</button> ";
|
__('Generate new URL')."</button> ";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">".
|
||||||
|
|
|
@ -765,7 +765,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
|
|
||||||
print "<div class='dlgButtons'>
|
print "<div class='dlgButtons'>
|
||||||
<div style=\"float : left\">
|
<div style=\"float : left\">
|
||||||
<button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick='return unsubscribeFeed($feed_id, \"$title\")'>".
|
<button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick='return CommonDialogs.unsubscribeFeed($feed_id, \"$title\")'>".
|
||||||
__('Unsubscribe')."</button>";
|
__('Unsubscribe')."</button>";
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
@ -1247,7 +1247,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
var bare_id = id.substr(id.indexOf(':')+1);
|
var bare_id = id.substr(id.indexOf(':')+1);
|
||||||
|
|
||||||
if (id.match('FEED:')) {
|
if (id.match('FEED:')) {
|
||||||
editFeed(bare_id);
|
CommonDialogs.editFeed(bare_id);
|
||||||
} else if (id.match('CAT:')) {
|
} else if (id.match('CAT:')) {
|
||||||
editCat(bare_id, item);
|
editCat(bare_id, item);
|
||||||
}
|
}
|
||||||
|
@ -1441,7 +1441,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
|
|
||||||
print "<a class=\"visibleLink\" href=\"#\" ".
|
print "<a class=\"visibleLink\" href=\"#\" ".
|
||||||
"title=\"".__("Click to edit feed")."\" ".
|
"title=\"".__("Click to edit feed")."\" ".
|
||||||
"onclick=\"editFeed(".$line["id"].")\">".
|
"onclick=\"CommonDialogs.editFeed(".$line["id"].")\">".
|
||||||
htmlspecialchars($line["title"])."</a>";
|
htmlspecialchars($line["title"])."</a>";
|
||||||
|
|
||||||
print "</td><td class=\"insensitive\" align='right'>";
|
print "</td><td class=\"insensitive\" align='right'>";
|
||||||
|
@ -1506,7 +1506,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
|
|
||||||
print "<a class=\"visibleLink\" href=\"#\" ".
|
print "<a class=\"visibleLink\" href=\"#\" ".
|
||||||
"title=\"".__("Click to edit feed")."\" ".
|
"title=\"".__("Click to edit feed")."\" ".
|
||||||
"onclick=\"editFeed(".$line["id"].")\">".
|
"onclick=\"CommonDialogs.editFeed(".$line["id"].")\">".
|
||||||
htmlspecialchars($line["title"])."</a>: ";
|
htmlspecialchars($line["title"])."</a>: ";
|
||||||
|
|
||||||
print "<span class=\"insensitive\">";
|
print "<span class=\"insensitive\">";
|
||||||
|
|
|
@ -797,7 +797,7 @@ class Pref_Filters extends Handler_Protected {
|
||||||
dojoType=\"dijit.MenuItem\">".__('None')."</div>";
|
dojoType=\"dijit.MenuItem\">".__('None')."</div>";
|
||||||
print "</div></div>";
|
print "</div></div>";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return quickAddFilter()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Filters.quickAddFilter()\">".
|
||||||
__('Create filter')."</button> ";
|
__('Create filter')."</button> ";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return joinSelectedFilters()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return joinSelectedFilters()\">".
|
||||||
|
@ -1044,7 +1044,7 @@ class Pref_Filters extends Handler_Protected {
|
||||||
print "<div class=\"dlgSecCont\">";
|
print "<div class=\"dlgSecCont\">";
|
||||||
|
|
||||||
print "<select name=\"action_id\" dojoType=\"dijit.form.Select\"
|
print "<select name=\"action_id\" dojoType=\"dijit.form.Select\"
|
||||||
onchange=\"filterDlgCheckAction(this)\">";
|
onchange=\"Filters.filterDlgCheckAction(this)\">";
|
||||||
|
|
||||||
$res = $this->pdo->query("SELECT id,description FROM ttrss_filter_actions
|
$res = $this->pdo->query("SELECT id,description FROM ttrss_filter_actions
|
||||||
ORDER BY name");
|
ORDER BY name");
|
||||||
|
|
|
@ -48,7 +48,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Edit feed"),
|
label: __("Edit feed"),
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
editFeed(this.getParent().row_id, false);
|
CommonDialogs.editFeed(this.getParent().row_id, false);
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
/* menu.addChild(new dijit.MenuItem({
|
/* menu.addChild(new dijit.MenuItem({
|
||||||
|
|
|
@ -55,13 +55,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Edit feed"),
|
label: __("Edit feed"),
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
editFeed(this.getParent().row_id);
|
CommonDialogs.editFeed(this.getParent().row_id);
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Unsubscribe"),
|
label: __("Unsubscribe"),
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
unsubscribeFeed(this.getParent().row_id, this.getParent().item.name);
|
CommonDialogs.unsubscribeFeed(this.getParent().row_id, this.getParent().item.name);
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
menu.bindDomNode(tnode.domNode);
|
menu.bindDomNode(tnode.domNode);
|
||||||
|
|
955
js/functions.js
955
js/functions.js
File diff suppressed because it is too large
Load Diff
|
@ -82,7 +82,7 @@ const App = {
|
||||||
const param = getURLParam('methodparam');
|
const param = getURLParam('methodparam');
|
||||||
|
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
editFeed(param)
|
CommonDialogs.editFeed(param)
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -100,7 +100,7 @@ const App = {
|
||||||
CommonDialogs.addLabel();
|
CommonDialogs.addLabel();
|
||||||
return false;
|
return false;
|
||||||
case "create_filter":
|
case "create_filter":
|
||||||
quickAddFilter();
|
Filters.quickAddFilter();
|
||||||
return false;
|
return false;
|
||||||
case "help_dialog":
|
case "help_dialog":
|
||||||
Utils.helpDialog("main");
|
Utils.helpDialog("main");
|
||||||
|
@ -575,7 +575,7 @@ function editSelectedFeed() {
|
||||||
|
|
||||||
notify("");
|
notify("");
|
||||||
|
|
||||||
editFeed(rows[0], {});
|
CommonDialogs.editFeed(rows[0], {});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,7 @@ const App = {
|
||||||
if (Feeds.activeFeedIsCat())
|
if (Feeds.activeFeedIsCat())
|
||||||
alert(__("You can't edit this kind of feed."));
|
alert(__("You can't edit this kind of feed."));
|
||||||
else
|
else
|
||||||
editFeed(Feeds.getActiveFeedId());
|
CommonDialogs.editFeed(Feeds.getActiveFeedId());
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_catchup"] = function () {
|
this.hotkey_actions["feed_catchup"] = function () {
|
||||||
if (Feeds.getActiveFeedId() != undefined) {
|
if (Feeds.getActiveFeedId() != undefined) {
|
||||||
|
@ -424,7 +424,7 @@ const App = {
|
||||||
CommonDialogs.addLabel();
|
CommonDialogs.addLabel();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["create_filter"] = function () {
|
this.hotkey_actions["create_filter"] = function () {
|
||||||
quickAddFilter();
|
Filters.quickAddFilter();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["collapse_sidebar"] = function () {
|
this.hotkey_actions["collapse_sidebar"] = function () {
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.viewCurrentFeed();
|
||||||
|
@ -501,7 +501,7 @@ const App = {
|
||||||
if (Feeds.activeFeedIsCat())
|
if (Feeds.activeFeedIsCat())
|
||||||
alert(__("You can't edit this kind of feed."));
|
alert(__("You can't edit this kind of feed."));
|
||||||
else
|
else
|
||||||
editFeed(Feeds.getActiveFeedId());
|
CommonDialogs.editFeed(Feeds.getActiveFeedId());
|
||||||
break;
|
break;
|
||||||
case "qmcRemoveFeed":
|
case "qmcRemoveFeed":
|
||||||
var actid = Feeds.getActiveFeedId();
|
var actid = Feeds.getActiveFeedId();
|
||||||
|
@ -521,7 +521,7 @@ const App = {
|
||||||
var pr = __("Unsubscribe from %s?").replace("%s", fn);
|
var pr = __("Unsubscribe from %s?").replace("%s", fn);
|
||||||
|
|
||||||
if (confirm(pr)) {
|
if (confirm(pr)) {
|
||||||
unsubscribeFeed(actid);
|
CommonDialogs.unsubscribeFeed(actid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "qmcCatchupAll":
|
case "qmcCatchupAll":
|
||||||
|
|
|
@ -1560,7 +1560,7 @@ const Headlines = {
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Edit feed"),
|
label: __("Edit feed"),
|
||||||
onClick: function () {
|
onClick: function () {
|
||||||
editFeed(this.getParent().currentTarget.getAttribute("data-feed-id"));
|
CommonDialogs.editFeed(this.getParent().currentTarget.getAttribute("data-feed-id"));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ class Af_Psql_Trgm extends Plugin {
|
||||||
print "<li>" .
|
print "<li>" .
|
||||||
"<img src='images/pub_set.png'
|
"<img src='images/pub_set.png'
|
||||||
style='vertical-align : middle'> <a href='#'
|
style='vertical-align : middle'> <a href='#'
|
||||||
onclick='editFeed($f)'>" .
|
onclick='CommonDialogs.editFeed($f)'>" .
|
||||||
Feeds::getFeedTitle($f) . "</a></li>";
|
Feeds::getFeedTitle($f) . "</a></li>";
|
||||||
}
|
}
|
||||||
print "</ul>";
|
print "</ul>";
|
||||||
|
|
|
@ -94,7 +94,7 @@ class Af_Readability extends Plugin {
|
||||||
print "<li>" .
|
print "<li>" .
|
||||||
"<img src='images/pub_set.png'
|
"<img src='images/pub_set.png'
|
||||||
style='vertical-align : middle'> <a href='#'
|
style='vertical-align : middle'> <a href='#'
|
||||||
onclick='editFeed($f)'>".
|
onclick='CommonDialogs.editFeed($f)'>".
|
||||||
Feeds::getFeedTitle($f) . "</a></li>";
|
Feeds::getFeedTitle($f) . "</a></li>";
|
||||||
}
|
}
|
||||||
print "</ul>";
|
print "</ul>";
|
||||||
|
|
|
@ -25,7 +25,7 @@ class BasicTest extends PHPUnit_Extensions_Selenium2TestCase {
|
||||||
public function testBasicDialogs() {
|
public function testBasicDialogs() {
|
||||||
$this->testLogin();
|
$this->testLogin();
|
||||||
|
|
||||||
$this->execute(["script" => "quickAddFilter()", "args" => []]);
|
$this->execute(["script" => "Filters.quickAddFilter()", "args" => []]);
|
||||||
$this->byCssSelector("#filterEditDlg")->displayed();
|
$this->byCssSelector("#filterEditDlg")->displayed();
|
||||||
|
|
||||||
$this->execute(["script" => "dijit.byId('filterEditDlg').hide();", "args" => []]);
|
$this->execute(["script" => "dijit.byId('filterEditDlg').hide();", "args" => []]);
|
||||||
|
|
Loading…
Reference in New Issue