plugins: update markup

This commit is contained in:
Andrew Dolgov 2019-02-22 12:48:02 +03:00
parent dab81ff7d0
commit abfd552962
2 changed files with 59 additions and 46 deletions

View File

@ -163,31 +163,38 @@ class Af_Psql_Trgm extends Plugin {
print_hidden("method", "save"); print_hidden("method", "save");
print_hidden("plugin", "af_psql_trgm"); print_hidden("plugin", "af_psql_trgm");
print "<p>" . __("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.") . "</p>"; print "<h2>" . __("Global settings") . "</h2>";
print_notice("Enable the plugin for specific feeds in the feed editor.");
print "<h3>" . __("Global settings") . "</h3>"; print_notice("Enable for specific feeds in the feed editor.");
print "<table>"; print "<fieldset>";
print "<tr><td width=\"40%\">" . __("Minimum similarity:") . "</td>"; print "<label>" . __("Minimum similarity:") . "</label> ";
print "<td> print "<input dojoType=\"dijit.form.NumberSpinner\"
<input dojoType=\"dijit.form.ValidationTextBox\" placeholder=\"0.75\" id='psql_trgm_similarity'
placeholder=\"0.75\" required=\"1\" name=\"similarity\" value=\"$similarity\">";
required=\"1\" name=\"similarity\" value=\"$similarity\"></td></tr>";
print "<tr><td width=\"40%\">" . __("Minimum title length:") . "</td>"; print "<div dojoType='dijit.Tooltip' connectId='psql_trgm_similarity' position='below'>" .
print "<td> __("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.") .
<input dojoType=\"dijit.form.ValidationTextBox\" "</div>";
print "</fieldset><fieldset>";
print "<label>" . __("Minimum title length:") . "</label> ";
print "<input dojoType=\"dijit.form.NumberSpinner\"
placeholder=\"32\" placeholder=\"32\"
required=\"1\" name=\"min_title_length\" value=\"$min_title_length\"></td></tr>"; required=\"1\" name=\"min_title_length\" value=\"$min_title_length\">";
print "<tr><td width=\"40%\">" . __("Enable for all feeds:") . "</td>";
print "<td>"; print "</fieldset><fieldset>";
print "<label class='checkbox'>";
print_checkbox("enable_globally", $enable_globally); print_checkbox("enable_globally", $enable_globally);
print "</td></tr>"; print " " . __("Enable for all feeds:");
print "</label>";
print "</table>"; print "</fieldset>";
print "<p>"; print_button("submit", __("Save")); print_button("submit", __("Save"), "class='alt-primary'");
print "</form>"; print "</form>";
$enabled_feeds = $this->host->get($this, "enabled_feeds"); $enabled_feeds = $this->host->get($this, "enabled_feeds");

View File

@ -44,18 +44,20 @@ class Af_Readability extends Plugin {
function hook_prefs_tab($args) { function hook_prefs_tab($args) {
if ($args != "prefFeeds") return; if ($args != "prefFeeds") return;
print "<div dojoType=\"dijit.layout.AccordionPane\" print "<div dojoType='dijit.layout.AccordionPane'
title=\"<i class='material-icons'>extension</i> ".__('Readability settings (af_readability)')."\">"; title=\"<i class='material-icons'>extension</i> ".__('Readability settings (af_readability)')."\">";
if (version_compare(PHP_VERSION, '5.6.0', '<')) { if (version_compare(PHP_VERSION, '5.6.0', '<')) {
print_error("This plugin requires PHP version 5.6."); print_error("This plugin requires PHP version 5.6.");
} } else {
print_notice("Enable the plugin for specific feeds in the feed editor."); print "<h2>" . __("Global settings") . "</h2>";
print "<form dojoType=\"dijit.form.Form\">"; print_notice("Enable for specific feeds in the feed editor.");
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\"> print "<form dojoType='dijit.form.Form'>";
print "<script type='dojo/method' event='onSubmit' args='evt'>
evt.preventDefault(); evt.preventDefault();
if (this.validate()) { if (this.validate()) {
console.log(dojo.objectToQuery(this.getValues())); console.log(dojo.objectToQuery(this.getValues()));
@ -69,35 +71,40 @@ class Af_Readability extends Plugin {
} }
</script>"; </script>";
print_hidden("op", "pluginhandler"); print_hidden("op", "pluginhandler");
print_hidden("method", "save"); print_hidden("method", "save");
print_hidden("plugin", "af_readability"); print_hidden("plugin", "af_readability");
$enable_share_anything = $this->host->get($this, "enable_share_anything"); $enable_share_anything = $this->host->get($this, "enable_share_anything");
print_checkbox("enable_share_anything", $enable_share_anything); print "<fieldset>";
print "&nbsp;<label for=\"enable_share_anything\">" . __("Use Readability for pages shared via bookmarklet.") . "</label>"; print "<label class='checkbox'> ";
print_checkbox("enable_share_anything", $enable_share_anything);
print " " . __("Use Readability for pages shared via bookmarklet.");
print "</label>";
print "</fieldset>";
print "<p>"; print_button("submit", __("Save")); print print_button("submit", __("Save"), "class='alt-primary'");
print "</form>"; print "</form>";
$enabled_feeds = $this->host->get($this, "enabled_feeds"); $enabled_feeds = $this->host->get($this, "enabled_feeds");
if (!is_array($enabled_feeds)) $enabled_feeds = array(); if (!is_array($enabled_feeds)) $enabled_feeds = array();
$enabled_feeds = $this->filter_unknown_feeds($enabled_feeds); $enabled_feeds = $this->filter_unknown_feeds($enabled_feeds);
$this->host->set($this, "enabled_feeds", $enabled_feeds); $this->host->set($this, "enabled_feeds", $enabled_feeds);
if (count($enabled_feeds) > 0) { if (count($enabled_feeds) > 0) {
print "<h3>" . __("Currently enabled for (click to edit):") . "</h3>"; print "<h3>" . __("Currently enabled for (click to edit):") . "</h3>";
print "<ul class='panel panel-scrollable list list-unstyled'>"; print "<ul class='panel panel-scrollable list list-unstyled'>";
foreach ($enabled_feeds as $f) { foreach ($enabled_feeds as $f) {
print "<li>" . print "<li><i class='material-icons'>rss_feed</i> <a href='#'
"<i class='material-icons'>rss_feed</i> <a href='#'
onclick='CommonDialogs.editFeed($f)'>". onclick='CommonDialogs.editFeed($f)'>".
Feeds::getFeedTitle($f) . "</a></li>"; Feeds::getFeedTitle($f) . "</a></li>";
}
print "</ul>";
} }
print "</ul>";
} }
print "</div>"; print "</div>";
@ -115,9 +122,8 @@ class Af_Readability extends Plugin {
print "<fieldset>"; print "<fieldset>";
print "<label class='checkbox'><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"af_readability_enabled\" print "<label class='checkbox'><input dojoType='dijit.form.CheckBox' type='checkbox' id='af_readability_enabled'
name=\"af_readability_enabled\" name='af_readability_enabled' $checked>&nbsp;".__('Inline article content')."</label>";
$checked>&nbsp;".__('Inline article content')."</label>";
print "</fieldset>"; print "</fieldset>";