mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-11 19:11:04 +02:00
pref feeds: index cleanup, split into several methods, use tabs to maximize space for feed tree, persist feed tree state
This commit is contained in:
parent
9684ce5c4b
commit
17413078a7
@ -1197,12 +1197,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
$opml->opml_import($_SESSION["uid"]);
|
$opml->opml_import($_SESSION["uid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function index() {
|
private function index_feeds() {
|
||||||
|
|
||||||
print "<div dojoType='dijit.layout.AccordionContainer' region='center'>";
|
|
||||||
print "<div style='padding : 0px' dojoType='dijit.layout.AccordionPane'
|
|
||||||
title=\"<i class='material-icons'>rss_feed</i> ".__('Feeds')."\">";
|
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("SELECT COUNT(id) AS num_errors
|
$sth = $this->pdo->prepare("SELECT COUNT(id) AS num_errors
|
||||||
FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?");
|
FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?");
|
||||||
$sth->execute([$_SESSION['uid']]);
|
$sth->execute([$_SESSION['uid']]);
|
||||||
@ -1214,16 +1209,15 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($num_errors > 0) {
|
if ($num_errors > 0) {
|
||||||
$error_button = "<button dojoType=\"dijit.form.Button\"
|
$error_button = "<button dojoType='dijit.form.Button' onclick='CommonDialogs.showFeedsWithErrors()' id='errorButton'>".
|
||||||
onclick=\"CommonDialogs.showFeedsWithErrors()\" id=\"errorButton\">" .
|
__("Feeds with errors")."</button>";
|
||||||
__("Feeds with errors") . "</button>";
|
|
||||||
} else {
|
} else {
|
||||||
$error_button = "";
|
$error_button = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$inactive_button = "<button dojoType=\"dijit.form.Button\"
|
$inactive_button = "<button dojoType='dijit.form.Button'
|
||||||
id=\"pref_feeds_inactive_btn\"
|
id='pref_feeds_inactive_btn'
|
||||||
style=\"display : none\"
|
style='display : none'
|
||||||
onclick=\"dijit.byId('feedTree').showInactiveFeeds()\">" .
|
onclick=\"dijit.byId('feedTree').showInactiveFeeds()\">" .
|
||||||
__("Inactive feeds") . "</button>";
|
__("Inactive feeds") . "</button>";
|
||||||
|
|
||||||
@ -1235,82 +1229,77 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
$feed_search = $_SESSION["prefs_feed_search"] ?? "";
|
$feed_search = $_SESSION["prefs_feed_search"] ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div dojoType="dijit.layout.BorderContainer" gutters="false">';
|
?>
|
||||||
|
|
||||||
print "<div region='top' dojoType=\"fox.Toolbar\">"; #toolbar
|
<div dojoType="dijit.layout.BorderContainer" gutters="false">
|
||||||
|
<div region='top' dojoType="fox.Toolbar">
|
||||||
print "<div style='float : right; padding-right : 4px;'>
|
<div style='float : right'>
|
||||||
<input dojoType=\"dijit.form.TextBox\" id=\"feed_search\" size=\"20\" type=\"search\"
|
<input dojoType="dijit.form.TextBox" id="feed_search" size="20" type="search"
|
||||||
value=\"$feed_search\">
|
value="<?php echo htmlspecialchars($feed_search) ?>">
|
||||||
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedTree').reload()\">".
|
<button dojoType="dijit.form.Button" onclick="dijit.byId('feedTree').reload()">
|
||||||
__('Search')."</button>
|
<?php echo __('Search') ?></button>
|
||||||
</div>";
|
|
||||||
|
|
||||||
print "<div dojoType=\"fox.form.DropDownButton\">".
|
|
||||||
"<span>" . __('Select')."</span>";
|
|
||||||
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').model.setAllChecked(true)\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('All')."</div>";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').model.setAllChecked(false)\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('None')."</div>";
|
|
||||||
print "</div></div>";
|
|
||||||
|
|
||||||
print "<div dojoType=\"fox.form.DropDownButton\">".
|
|
||||||
"<span>" . __('Feeds')."</span>";
|
|
||||||
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
|
|
||||||
print "<div onclick=\"CommonDialogs.quickAddFeed()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Subscribe to feed')."</div>";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').editSelectedFeed()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Edit selected feeds')."</div>";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').resetFeedOrder()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').batchSubscribe()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Batch subscribe')."</div>";
|
|
||||||
print "<div dojoType=\"dijit.MenuItem\" onclick=\"dijit.byId('feedTree').removeSelectedFeeds()\">"
|
|
||||||
.__('Unsubscribe')."</div> ";
|
|
||||||
print "</div></div>";
|
|
||||||
|
|
||||||
if (get_pref('ENABLE_FEED_CATS')) {
|
|
||||||
print "<div dojoType=\"fox.form.DropDownButton\">".
|
|
||||||
"<span>" . __('Categories')."</span>";
|
|
||||||
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').createCategory()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Add category')."</div>";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').resetCatOrder()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Reset sort order')."</div>";
|
|
||||||
print "<div onclick=\"dijit.byId('feedTree').removeSelectedCategories()\"
|
|
||||||
dojoType=\"dijit.MenuItem\">".__('Remove selected')."</div>";
|
|
||||||
print "</div></div>";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
print $error_button;
|
|
||||||
print $inactive_button;
|
|
||||||
|
|
||||||
print "</div>"; # toolbar
|
|
||||||
|
|
||||||
//print '</div>';
|
|
||||||
print '<div style="padding : 0px" dojoType="dijit.layout.ContentPane" region="center">';
|
|
||||||
|
|
||||||
print "<div id=\"feedlistLoading\">
|
|
||||||
<img src='images/indicator_tiny.gif'>".
|
|
||||||
__("Loading, please wait...")."</div>";
|
|
||||||
|
|
||||||
$auto_expand = $feed_search != "" ? "true" : "false";
|
|
||||||
|
|
||||||
print "<div dojoType=\"fox.PrefFeedStore\" jsId=\"feedStore\"
|
|
||||||
url=\"backend.php?op=pref-feeds&method=getfeedtree\">
|
|
||||||
</div>
|
</div>
|
||||||
<div dojoType=\"lib.CheckBoxStoreModel\" jsId=\"feedModel\" store=\"feedStore\"
|
|
||||||
query=\"{id:'root'}\" rootId=\"root\" rootLabel=\"Feeds\"
|
<div dojoType="fox.form.DropDownButton">
|
||||||
childrenAttrs=\"items\" checkboxStrict=\"false\" checkboxAll=\"false\">
|
<span><?php echo __('Select') ?></span>
|
||||||
|
<div dojoType="dijit.Menu" style="display: none;">
|
||||||
|
<div onclick="dijit.byId('feedTree').model.setAllChecked(true)"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('All') ?></div>
|
||||||
|
<div onclick="dijit.byId('feedTree').model.setAllChecked(false)"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('None') ?></div>
|
||||||
</div>
|
</div>
|
||||||
<div dojoType=\"fox.PrefFeedTree\" id=\"feedTree\"
|
</div>
|
||||||
dndController=\"dijit.tree.dndSource\"
|
|
||||||
betweenThreshold=\"5\"
|
<div dojoType="fox.form.DropDownButton">
|
||||||
autoExpand='$auto_expand'
|
<span><?php echo __('Feeds') ?></span>
|
||||||
model=\"feedModel\" openOnClick=\"false\">
|
<div dojoType="dijit.Menu" style="display: none">
|
||||||
<script type=\"dojo/method\" event=\"onClick\" args=\"item\">
|
<div onclick="CommonDialogs.quickAddFeed()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Subscribe to feed') ?></div>
|
||||||
|
<div onclick="dijit.byId('feedTree').editSelectedFeed()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Edit selected feeds') ?></div>
|
||||||
|
<div onclick="dijit.byId('feedTree').resetFeedOrder()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Reset sort order') ?></div>
|
||||||
|
<div onclick="dijit.byId('feedTree').batchSubscribe()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Batch subscribe') ?></div>
|
||||||
|
<div dojoType="dijit.MenuItem" onclick="dijit.byId('feedTree').removeSelectedFeeds()">
|
||||||
|
<?php echo __('Unsubscribe') ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if (get_pref('ENABLE_FEED_CATS')) { ?>
|
||||||
|
<div dojoType="fox.form.DropDownButton">
|
||||||
|
<span><?php echo __('Categories') ?></span>
|
||||||
|
<div dojoType="dijit.Menu" style="display: none">
|
||||||
|
<div onclick="dijit.byId('feedTree').createCategory()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Add category') ?></div>
|
||||||
|
<div onclick="dijit.byId('feedTree').resetCatOrder()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Reset sort order') ?></div>
|
||||||
|
<div onclick="dijit.byId('feedTree').removeSelectedCategories()"
|
||||||
|
dojoType="dijit.MenuItem"><?php echo __('Remove selected') ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php echo $error_button ?>
|
||||||
|
<?php echo $inactive_button ?>
|
||||||
|
</div>
|
||||||
|
<div style="padding : 0px" dojoType="dijit.layout.ContentPane" region="center">
|
||||||
|
<div dojoType="fox.PrefFeedStore" jsId="feedStore"
|
||||||
|
url="backend.php?op=pref-feeds&method=getfeedtree">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div dojoType="lib.CheckBoxStoreModel" jsId="feedModel" store="feedStore"
|
||||||
|
query="{id:'root'}" rootId="root" rootLabel="Feeds" childrenAttrs="items"
|
||||||
|
checkboxStrict="false" checkboxAll="false">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div dojoType="fox.PrefFeedTree" id="feedTree"
|
||||||
|
dndController="dijit.tree.dndSource"
|
||||||
|
betweenThreshold="5"
|
||||||
|
autoExpand="<?php echo (!empty($feed_search) ? "true" : "false") ?>"
|
||||||
|
persist="true"
|
||||||
|
model="feedModel"
|
||||||
|
openOnClick="false">
|
||||||
|
<script type="dojo/method" event="onClick" args="item">
|
||||||
var id = String(item.id);
|
var id = String(item.id);
|
||||||
var bare_id = id.substr(id.indexOf(':')+1);
|
var bare_id = id.substr(id.indexOf(':')+1);
|
||||||
|
|
||||||
@ -1320,90 +1309,122 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
dijit.byId('feedTree').editCategory(bare_id, item);
|
dijit.byId('feedTree').editCategory(bare_id, item);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type=\"dojo/method\" event=\"onLoad\" args=\"item\">
|
<script type="dojo/method" event="onLoad" args="item">
|
||||||
Element.hide(\"feedlistLoading\");
|
|
||||||
|
|
||||||
dijit.byId('feedTree').checkInactiveFeeds();
|
dijit.byId('feedTree').checkInactiveFeeds();
|
||||||
</script>
|
</script>
|
||||||
</div>";
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
|
||||||
# print "<div dojoType=\"dijit.Tooltip\" connectId=\"feedTree\" position=\"below\">
|
}
|
||||||
# ".__('<b>Hint:</b> you can drag feeds and categories around.')."
|
|
||||||
# </div>";
|
|
||||||
|
|
||||||
print '</div>';
|
private function index_opml() {
|
||||||
print '</div>';
|
?>
|
||||||
|
|
||||||
print "</div>"; # feeds pane
|
<h3><?php echo __("Using OPML you can export and import your feeds, filters, labels and Tiny Tiny RSS settings.") ?></h3>
|
||||||
|
|
||||||
print "<div dojoType='dijit.layout.AccordionPane'
|
<?php print_notice("Only main settings profile can be migrated using OPML.") ?>
|
||||||
title='<i class=\"material-icons\">import_export</i> ".__('OPML')."'>";
|
|
||||||
|
|
||||||
print "<h3>" . __("Using OPML you can export and import your feeds, filters, labels and Tiny Tiny RSS settings.") . "</h3>";
|
<form id='opml_import_form' method='post' enctype='multipart/form-data'>
|
||||||
|
<label class='dijitButton'><?php echo __("Choose file...") ?>
|
||||||
print_notice("Only main settings profile can be migrated using OPML.");
|
<input style='display : none' id='opml_file' name='opml_file' type='file'>
|
||||||
|
|
||||||
print "<form id='opml_import_form' method='post' enctype='multipart/form-data' >
|
|
||||||
<label class='dijitButton'>".__("Choose file...")."
|
|
||||||
<input style='display : none' id='opml_file' name='opml_file' type='file'>
|
|
||||||
</label>
|
</label>
|
||||||
<input type='hidden' name='op' value='pref-feeds'>
|
<input type='hidden' name='op' value='pref-feeds'>
|
||||||
<input type='hidden' name='csrf_token' value='".$_SESSION['csrf_token']."'>
|
<input type='hidden' name='csrf_token' value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
<input type='hidden' name='method' value='importOpml'>
|
<input type='hidden' name='method' value='importOpml'>
|
||||||
<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return Helpers.OPML.import();\" type=\"submit\">" .
|
<button dojoType='dijit.form.Button' class='alt-primary' onclick="return Helpers.OPML.import()" type="submit">
|
||||||
__('Import OPML') . "</button>";
|
<?php echo __('Import OPML') ?>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
print "</form>";
|
<hr/>
|
||||||
|
|
||||||
print "<form dojoType='dijit.form.Form' id='opmlExportForm' style='display : inline-block'>";
|
<form dojoType='dijit.form.Form' id='opmlExportForm' style='display : inline-block'>
|
||||||
|
<button dojoType='dijit.form.Button' onclick='Helpers.OPML.export()'>
|
||||||
|
<?php echo __('Export OPML') ?>
|
||||||
|
</button>
|
||||||
|
|
||||||
print "<button dojoType='dijit.form.Button'
|
<label class='checkbox'>
|
||||||
onclick='Helpers.OPML.export()' >" .
|
<?php print_checkbox("include_settings", true, "1", "") ?>
|
||||||
__('Export OPML') . "</button>";
|
<?php echo __("Include settings") ?>
|
||||||
|
</label>
|
||||||
|
</form>
|
||||||
|
|
||||||
print " <label class='checkbox'>";
|
<hr/>
|
||||||
print_checkbox("include_settings", true, "1", "");
|
|
||||||
print " " . __("Include settings");
|
|
||||||
print "</label>";
|
|
||||||
|
|
||||||
print "</form>";
|
<h2><?php echo __("Published OPML") ?></h2>
|
||||||
|
|
||||||
print "<p/>";
|
<p>
|
||||||
|
<?php echo __('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.') ?>
|
||||||
|
<?php echo __("Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") ?>
|
||||||
|
</p>
|
||||||
|
|
||||||
print "<h2>" . __("Published OPML") . "</h2>";
|
<button dojoType='dijit.form.Button' class='alt-primary' onclick="return CommonDialogs.publishedOPML()">
|
||||||
|
<?php echo __('Display published OPML URL') ?>
|
||||||
print "<p>" . __('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.') .
|
</button>
|
||||||
" " .
|
|
||||||
__("Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") . "</p>";
|
|
||||||
|
|
||||||
print "<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return CommonDialogs.publishedOPML()\">".
|
|
||||||
__('Display published OPML URL')."</button> ";
|
|
||||||
|
|
||||||
|
<?php
|
||||||
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsOPML");
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsOPML");
|
||||||
|
}
|
||||||
|
|
||||||
print "</div>"; # pane
|
private function index_shared() {
|
||||||
|
|
||||||
print "<div dojoType=\"dijit.layout.AccordionPane\"
|
|
||||||
title=\"<i class='material-icons'>share</i> ".__('Published & shared articles / Generated feeds')."\">";
|
|
||||||
|
|
||||||
print "<h3>" . __('Published articles can be subscribed by anyone who knows the following URL:') . "</h3>";
|
|
||||||
|
|
||||||
$rss_url = htmlspecialchars(get_self_url_prefix() .
|
$rss_url = htmlspecialchars(get_self_url_prefix() .
|
||||||
"/public.php?op=rss&id=-2&view-mode=all_articles");;
|
"/public.php?op=rss&id=-2&view-mode=all_articles");
|
||||||
|
?>
|
||||||
|
|
||||||
print "<button dojoType='dijit.form.Button' class='alt-primary'
|
<h3><?php echo __('Published articles can be subscribed by anyone who knows the following URL:') ?></h3>
|
||||||
onclick='CommonDialogs.generatedFeed(-2, false, \"$rss_url\", \"".__("Published articles")."\")'>".
|
|
||||||
__('Display URL')."</button>
|
|
||||||
<button class='alt-danger' dojoType='dijit.form.Button' onclick='return Helpers.Feeds.clearFeedAccessKeys()'>".
|
|
||||||
__('Clear all generated URLs')."</button> ";
|
|
||||||
|
|
||||||
|
<button dojoType='dijit.form.Button' class='alt-primary'
|
||||||
|
onclick='CommonDialogs.generatedFeed(-2, false, "<?php echo $rss_url ?>", "<?php echo __("Published articles") ?>")'>
|
||||||
|
<?php echo __('Display URL') ?>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button class='alt-danger' dojoType='dijit.form.Button' onclick='return Helpers.Feeds.clearFeedAccessKeys()'>
|
||||||
|
<?php echo __('Clear all generated URLs') ?>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<?php
|
||||||
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsPublishedGenerated");
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsPublishedGenerated");
|
||||||
|
}
|
||||||
|
|
||||||
print "</div>"; #pane
|
function index() {
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div dojoType='dijit.layout.TabContainer' tabPosition='left-h'>
|
||||||
|
<div style='padding : 0px' dojoType='dijit.layout.ContentPane'
|
||||||
|
title="<i class='material-icons'>rss_feed</i> <?php echo __('My feeds') ?>">
|
||||||
|
<?php $this->index_feeds() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div dojoType='dijit.layout.ContentPane'
|
||||||
|
title="<i class='material-icons'>import_export</i> <?php echo __('OPML') ?>">
|
||||||
|
<?php $this->index_opml() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div dojoType="dijit.layout.ContentPane"
|
||||||
|
title="<i class='material-icons'>share</i> <?php echo __('Sharing') ?>">
|
||||||
|
<?php $this->index_shared() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
ob_start();
|
||||||
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefFeeds");
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefFeeds");
|
||||||
|
$plugin_data = trim((string)ob_get_contents());
|
||||||
|
ob_end_clean();
|
||||||
|
?>
|
||||||
|
|
||||||
print "</div>"; #container
|
<?php if ($plugin_data) { ?>
|
||||||
|
<div dojoType='dijit.layout.ContentPane'
|
||||||
|
title="<i class='material-icons'>extension</i> <?php echo __('Plugins') ?>">
|
||||||
|
|
||||||
|
<div dojoType='dijit.layout.AccordionContainer' region='center'>
|
||||||
|
<?php echo $plugin_data ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
private function feedlist_init_cat($cat_id) {
|
private function feedlist_init_cat($cat_id) {
|
||||||
|
@ -746,9 +746,6 @@ class Pref_Filters extends Handler_Protected {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='center'>
|
<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='center'>
|
||||||
<div id='filterlistLoading'>
|
|
||||||
<img src='images/indicator_tiny.gif'> <?php echo __("Loading, please wait...") ?>
|
|
||||||
</div>
|
|
||||||
<div dojoType="fox.PrefFilterStore" jsId="filterStore"
|
<div dojoType="fox.PrefFilterStore" jsId="filterStore"
|
||||||
url="backend.php?op=pref-filters&method=getfiltertree">
|
url="backend.php?op=pref-filters&method=getfiltertree">
|
||||||
</div>
|
</div>
|
||||||
@ -758,9 +755,6 @@ class Pref_Filters extends Handler_Protected {
|
|||||||
</div>
|
</div>
|
||||||
<div dojoType="fox.PrefFilterTree" id="filterTree" dndController="dijit.tree.dndSource"
|
<div dojoType="fox.PrefFilterTree" id="filterTree" dndController="dijit.tree.dndSource"
|
||||||
betweenThreshold="5" model="filterModel" openOnClick="true">
|
betweenThreshold="5" model="filterModel" openOnClick="true">
|
||||||
<script type="dojo/method" event="onLoad" args="item">
|
|
||||||
Element.hide("filterlistLoading");
|
|
||||||
</script>
|
|
||||||
<script type="dojo/method" event="onClick" args="item">
|
<script type="dojo/method" event="onClick" args="item">
|
||||||
var id = String(item.id);
|
var id = String(item.id);
|
||||||
var bare_id = id.substr(id.indexOf(':')+1);
|
var bare_id = id.substr(id.indexOf(':')+1);
|
||||||
|
@ -217,10 +217,6 @@ class Pref_Labels extends Handler_Protected {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='center'>
|
<div style='padding : 0px' dojoType='dijit.layout.ContentPane' region='center'>
|
||||||
<div id='labellistLoading'>
|
|
||||||
<img src='images/indicator_tiny.gif'><?php echo("Loading, please wait...") ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div dojoType='dojo.data.ItemFileWriteStore' jsId='labelStore'
|
<div dojoType='dojo.data.ItemFileWriteStore' jsId='labelStore'
|
||||||
url='backend.php?op=pref-labels&method=getlabeltree'>
|
url='backend.php?op=pref-labels&method=getlabeltree'>
|
||||||
</div>
|
</div>
|
||||||
@ -231,9 +227,6 @@ class Pref_Labels extends Handler_Protected {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div dojoType='fox.PrefLabelTree' id='labelTree' model='labelModel' openOnClick='true'>
|
<div dojoType='fox.PrefLabelTree' id='labelTree' model='labelModel' openOnClick='true'>
|
||||||
<script type='dojo/method' event='onLoad' args='item'>
|
|
||||||
Element.hide('labellistLoading');
|
|
||||||
</script>
|
|
||||||
<script type='dojo/method' event='onClick' args='item'>
|
<script type='dojo/method' event='onClick' args='item'>
|
||||||
var id = String(item.id);
|
var id = String(item.id);
|
||||||
var bare_id = id.substr(id.indexOf(':')+1);
|
var bare_id = id.substr(id.indexOf(':')+1);
|
||||||
|
@ -1,9 +1,44 @@
|
|||||||
/* eslint-disable prefer-rest-params */
|
/* eslint-disable prefer-rest-params */
|
||||||
/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhrPost, fox, App */
|
/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhrPost, fox, App */
|
||||||
|
|
||||||
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
|
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_base/array", "dojo/cookie"],
|
||||||
|
function (declare, domConstruct, checkBoxTree, array, cookie) {
|
||||||
|
|
||||||
return declare("fox.PrefFeedTree", lib.CheckBoxTree, {
|
return declare("fox.PrefFeedTree", lib.CheckBoxTree, {
|
||||||
|
// save state in localStorage instead of cookies
|
||||||
|
// reference: https://stackoverflow.com/a/27968996
|
||||||
|
_saveExpandedNodes: function(){
|
||||||
|
if (this.persist && this.cookieName){
|
||||||
|
const ary = [];
|
||||||
|
for (const id in this._openedNodes){
|
||||||
|
ary.push(id);
|
||||||
|
}
|
||||||
|
// Was:
|
||||||
|
// cookie(this.cookieName, ary.join(","), {expires: 365});
|
||||||
|
localStorage.setItem(this.cookieName, ary.join(","));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_initState: function(){
|
||||||
|
this.cookieName = 'prefs:' + this.cookieName;
|
||||||
|
// summary:
|
||||||
|
// Load in which nodes should be opened automatically
|
||||||
|
this._openedNodes = {};
|
||||||
|
if (this.persist && this.cookieName){
|
||||||
|
// Was:
|
||||||
|
// var oreo = cookie(this.cookieName);
|
||||||
|
let oreo = localStorage.getItem(this.cookieName);
|
||||||
|
// migrate old data if nothing in localStorage
|
||||||
|
if (oreo == null || oreo === '') {
|
||||||
|
oreo = cookie(this.cookieName);
|
||||||
|
cookie(this.cookieName, null, { expires: -1 });
|
||||||
|
}
|
||||||
|
if (oreo){
|
||||||
|
array.forEach(oreo.split(','), function(item){
|
||||||
|
this._openedNodes[item] = true;
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
_createTreeNode: function(args) {
|
_createTreeNode: function(args) {
|
||||||
const tnode = this.inherited(arguments);
|
const tnode = this.inherited(arguments);
|
||||||
|
|
||||||
|
@ -42,13 +42,13 @@ class Share extends Plugin {
|
|||||||
function hook_prefs_tab_section($id) {
|
function hook_prefs_tab_section($id) {
|
||||||
if ($id == "prefFeedsPublishedGenerated") {
|
if ($id == "prefFeedsPublishedGenerated") {
|
||||||
|
|
||||||
print "<h3>" . __("You can disable all articles shared by unique URLs here.") . "</h3>";
|
print "<hr/>";
|
||||||
|
|
||||||
|
print "<h2>" . __("You can disable all articles shared by unique URLs here.") . "</h2>";
|
||||||
|
|
||||||
print "<button class='alt-danger' dojoType='dijit.form.Button' onclick=\"return Plugins.Share.clearKeys()\">".
|
print "<button class='alt-danger' dojoType='dijit.form.Button' onclick=\"return Plugins.Share.clearKeys()\">".
|
||||||
__('Unshare all articles')."</button> ";
|
__('Unshare all articles')."</button> ";
|
||||||
|
|
||||||
print "</p>";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1450,21 +1450,12 @@ body.ttrss_prefs .dijitAccordionTitle i.material-icons {
|
|||||||
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
body.ttrss_prefs #feedsTab {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
body.ttrss_prefs div#feedlistLoading,
|
|
||||||
body.ttrss_prefs div#filterlistLoading,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs div#feedlistLoading img,
|
|
||||||
body.ttrss_prefs div#filterlistLoading img,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs #errorButton {
|
body.ttrss_prefs #errorButton {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
@ -1450,21 +1450,12 @@ body.ttrss_prefs .dijitAccordionTitle i.material-icons {
|
|||||||
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
body.ttrss_prefs #feedsTab {
|
||||||
|
background: #222;
|
||||||
|
}
|
||||||
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
body.ttrss_prefs div#feedlistLoading,
|
|
||||||
body.ttrss_prefs div#filterlistLoading,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs div#feedlistLoading img,
|
|
||||||
body.ttrss_prefs div#filterlistLoading img,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs #errorButton {
|
body.ttrss_prefs #errorButton {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
@ -1450,21 +1450,12 @@ body.ttrss_prefs .dijitAccordionTitle i.material-icons {
|
|||||||
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
body.ttrss_prefs #feedsTab {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
body.ttrss_prefs div#feedlistLoading,
|
|
||||||
body.ttrss_prefs div#filterlistLoading,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs div#feedlistLoading img,
|
|
||||||
body.ttrss_prefs div#filterlistLoading img,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs #errorButton {
|
body.ttrss_prefs #errorButton {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
@ -57,20 +57,14 @@ body.ttrss_prefs {
|
|||||||
color : white;
|
color : white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#feedsTab {
|
||||||
|
background : @color-panel-bg;
|
||||||
|
}
|
||||||
|
|
||||||
.dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
.dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
||||||
padding : 0px;
|
padding : 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#feedlistLoading, div#filterlistLoading, div#labellistLoading {
|
|
||||||
text-align : center;
|
|
||||||
padding : 5px;
|
|
||||||
color : @default-text;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#feedlistLoading img, div#filterlistLoading img, div#labellistLoading {
|
|
||||||
margin-right : 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#errorButton {
|
#errorButton {
|
||||||
color : red;
|
color : red;
|
||||||
}
|
}
|
||||||
|
@ -1451,21 +1451,12 @@ body.ttrss_prefs .dijitAccordionTitle i.material-icons {
|
|||||||
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
body.ttrss_prefs #feedsTab {
|
||||||
|
background: #222;
|
||||||
|
}
|
||||||
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
body.ttrss_prefs div#feedlistLoading,
|
|
||||||
body.ttrss_prefs div#filterlistLoading,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs div#feedlistLoading img,
|
|
||||||
body.ttrss_prefs div#filterlistLoading img,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs #errorButton {
|
body.ttrss_prefs #errorButton {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
@ -1451,21 +1451,12 @@ body.ttrss_prefs .dijitAccordionTitle i.material-icons {
|
|||||||
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
body.ttrss_prefs .dijitAccordionTitleSelected i.material-icons {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
body.ttrss_prefs #feedsTab {
|
||||||
|
background: #222;
|
||||||
|
}
|
||||||
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
body.ttrss_prefs .dijitDialog #pref-profiles-list .dijitInlineEditBoxDisplayMode {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
body.ttrss_prefs div#feedlistLoading,
|
|
||||||
body.ttrss_prefs div#filterlistLoading,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
text-align: center;
|
|
||||||
padding: 5px;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs div#feedlistLoading img,
|
|
||||||
body.ttrss_prefs div#filterlistLoading img,
|
|
||||||
body.ttrss_prefs div#labellistLoading {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
body.ttrss_prefs #errorButton {
|
body.ttrss_prefs #errorButton {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user