}
}
- var date = new Date();
- var timestamp = Math.round(date.getTime() / 1000);
- query = query + "&ts=" + timestamp
-
- disableContainerChildren("headlinesToolbar", false);
Form.enable("main_toolbar_form");
// for piggybacked counters
}
}
-/*
-function init_hidden_feedlist(theme) {
- try {
- debug("init_hidden_feedlist");
-
- if (theme != "" && theme != "compact") return;
-
- var fl = $("feeds-holder");
- var fh = $("headlines-frame");
- var fc = $("content-frame");
- var ft = $("toolbar");
- var ff = $("footer");
- var fhdr = $("header");
-
- var fbtn = $("toggle_feeds_btn");
-
- if (fbtn) Element.show(fbtn);
-
- fl.style.top = fh.offsetTop + "px";
- fl.style.backgroundColor = "white"; //FIXME
-
- Element.hide(fl);
-
- fh.style.left = "0px";
- ft.style.left = "0px";
- if (fc) fc.style.left = "0px";
- if (ff) ff.style.left = "0px";
-
- if (theme == "compact") {
- fhdr.style.left = "10px";
- fl.style.top = (fh.offsetTop + 1) + "px";
- }
-
- } catch (e) {
- exception_error("init_hidden_feedlist", e);
- }
-} */
-
function init_collapsable_feedlist() {
try {
debug("init_collapsable_feedlist");
return unescape(dc.substring(begin + prefix.length, end));
}
-function disableContainerChildren(id, disable, doc) {
-
- if (!doc) doc = document;
-
- var container = $(id);
-
- if (!container) {
- //alert("disableContainerChildren: element " + id + " not found");
- return;
- }
-
- for (var i = 0; i < container.childNodes.length; i++) {
- var child = container.childNodes[i];
-
- try {
- child.disabled = disable;
- } catch (E) {
-
- }
-
- if (disable) {
- if (child.className && child.className.match("button")) {
- child.className = "disabledButton";
- }
- } else {
- if (child.className && child.className.match("disabledButton")) {
- child.className = "button";
- }
- }
- }
-
-}
-
function gotoPreferences() {
document.location.href = "prefs.php";
}
}
}
-
function getRelativeFeedId(list, id, direction, unread_only) {
var rows = list.getElementsByTagName("LI");
var feeds = new Array();
}
}
-function addLabelExample() {
- try {
- var form = document.forms["label_edit_form"];
-
- var text = form.sql_exp;
- var op = form.label_fields[form.label_fields.selectedIndex];
- var p = form.label_fields_param;
-
- if (op) {
- op = op.value;
-
- var tmp = "";
-
- if (text.value != "") {
- if (text.value.substring(text.value.length-3, 3).toUpperCase() != "AND") {
- tmp = " AND ";
- } else {
- tmp = " ";
- }
- }
-
- if (op == "unread") {
- tmp = tmp + "unread = true";
- }
-
- if (op == "updated") {
- tmp = tmp + "last_read is null and unread = false";
- }
-
- if (op == "kw_title") {
- if (p.value == "") {
- alert("This action requires a parameter.");
- return false;
- }
- tmp = tmp + "ttrss_entries.title like '%"+p.value+"%'";
- }
-
- if (op == "kw_content") {
- if (p.value == "") {
- alert("This action requires a parameter.");
- return false;
- }
-
- tmp = tmp + "ttrss_entries.content like '%"+p.value+"%'";
- }
-
- if (op == "scoreE") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "score = " + p.value;
- }
-
- if (op == "scoreG") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "score > " + p.value;
- }
-
- if (op == "scoreL") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "score < " + p.value;
- }
-
- if (op == "newerD") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "updated > NOW() - INTERVAL '"+parseInt(p.value)+" days'";
- }
-
- if (op == "newerH") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
-
- tmp = tmp + "updated > NOW() - INTERVAL '"+parseInt(p.value)+" hours'";
- }
-
- text.value = text.value + tmp;
-
- p.value = "";
-
- }
-
- } catch (e) {
- exception_error("addLabelExample", e);
- }
-
- return false;
-}
-
-function labelFieldsCheck(elem) {
- try {
- var op = elem[elem.selectedIndex].value;
-
- var p = document.forms["label_edit_form"].label_fields_param;
-
- if (op == "kw_title" || op == "kw_content" || op == "scoreL" ||
- op == "scoreG" || op == "scoreE" || op == "newerD" ||
- op == "newerH" ) {
- Element.show(p);
- } else {
- Element.hide(p);
- }
-
- } catch (e) {
- exception_error("labelFieldsCheck", e);
-
- }
-}
-
function getSelectedFeedsFromBrowser() {
var list = $("browseFeedList");
- if (!list) list = $("browseBigFeedList");
var selected = new Array();
}
-function browseFeeds(limit) {
-
- try {
-
-/* var query = "?op=ialog&subop=browse";
-
- notify_progress("Loading, please wait...", true);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- infobox_callback2(transport);
- } }); */
-
- displayDlg('feedBrowser');
-
- return false;
- } catch (e) {
- exception_error("browseFeeds", e);
- }
-}
-
function transport_error_check(transport) {
try {
if (transport.responseXML) {
return tmp;
}
-/*
-function switchToFlash(e) {
- try {
- var targ = e;
- if (!e) var e = window.event;
- if (e.target) targ = e.target;
- else if (e.srcElement) targ = e.srcElement;
- if (targ.nodeType == 3) // defeat Safari bug
- targ = targ.parentNode;
-
- //targ is the link that was clicked
- var audioTag=targ;
- do {
- audioTag=audioTag.previousSibling;
- } while(audioTag && audioTag.nodeType != 1)
-
- var flashPlayer = audioTag.getElementsByTagName('span')[0];
- targ.parentNode.insertBefore(flashPlayer,targ);
- targ.parentNode.removeChild(targ);
- audioTag.parentNode.removeChild(audioTag);
-
- return false;
- } catch (e) {
- exception_error("switchToFlash", e);
- }
-}
-
-function html5AudioOrFlash(type) {
- var audioTag = document.createElement('audio');
- if(! audioTag.canPlayType || audioTag.canPlayType(type) == "no" ||
- audioTag.canPlayType(type) == ""){
- if($('switchToFlashLink')){
- switchToFlash($('switchToFlashLink'));
- }
- }
-} */
-
function hotkey_prefix_timeout() {
try {
}
}
+function addLabel() {
+
+ try {
+
+ var caption = prompt(__("Please enter label caption:"), "");
+
+ if (caption != undefined) {
+
+ if (caption == "") {
+ alert(__("Can't create label: missing caption."));
+ return false;
+ }
+
+ var query = "?op=pref-labels&subop=add&caption=" +
+ param_escape(caption);
+
+ notify_progress("Loading, please wait...", true);
+
+ if (inPreferences()) active_tab = "labelConfig";
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ if (inPreferences()) {
+ infobox_submit_callback2(transport);
+ } else {
+ updateFeedList();
+ }
+ } });
+
+ }
+
+ } catch (e) {
+ exception_error("addLabel", e);
+ }
+}
+
print "<div align='center'>";
- print "<input class=\"button\"
- type=\"submit\" onclick=\"return visitOfficialSite()\"
- value=\"".__('Visit official site')."\"> ";
-
print "<input class=\"button\"
type=\"submit\" onclick=\"return closeInfoBox()\"
value=\"".__('Close this window')."\">";
print "<div class=\"dlgButtons\">
<button class=\"button\" id=\"fadd_submit_btn\"
onclick=\"return subscribeToFeed()\">".__('Subscribe')."</button>
- <button onclick=\"return browseFeeds()\">".__('More feeds')."</button>
+ <button onclick=\"return displayDlg('feedBrowser')\">".__('More feeds')."</button>
<button onclick=\"return closeInfoBox()\">".__('Cancel')."</button></div>";
return;
catchup_local_feed(feed_id, is_cat);
}
- disableContainerChildren("headlinesToolbar", false);
Form.enable("main_toolbar_form");
var f = $("headlines-frame");
}
}
-function addLabel() {
-
- try {
-
- var caption = prompt(__("Please enter label caption:"), "");
-
- if (caption == null) {
- return false;
- }
-
- if (caption == "") {
- alert(__("Can't create label: missing caption."));
- return false;
- }
-
- // we can be called from some other tab
- active_tab = "labelConfig";
-
- query = "?op=pref-labels&subop=add&caption=" +
- param_escape(caption);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- infobox_submit_callback2(transport);
- } });
-
- } catch (e) {
- exception_error("addLabel", e);
- }
-}
-
function addFeed() {
try {
selectTableRowsByIdPrefix('prefUserList', 'UMRR-', 'UMCHK-', false);
selectTableRowById('UMRR-'+id, 'UMCHK-'+id, true);
- disableContainerChildren("userOpToolbar", false);
-
var query = "?op=pref-users&subop=edit&id=" +
param_escape(id);
notify_progress("Loading, please wait...");
- disableContainerChildren("filterOpToolbar", false);
-
selectTableRowsByIdPrefix('prefFilterList', 'FILRR-', 'FICHK-', false);
selectTableRowById('FILRR-'+id, 'FICHK-'+id, true);
selectTableRowsByIdPrefix('prefFeedList', 'FEEDR-', 'FRCHK-', false);
selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
- disableContainerChildren("feedOpToolbar", false);
-
var query = "?op=pref-feeds&subop=editfeed&id=" +
param_escape(feed);
}
-/*function feedBrowserSubscribe() {
- try {
-
- var selected = getSelectedFeedsFromBrowser();
-
- var mode = document.forms['feed_browser'].mode;
-
- mode = mode[mode.selectedIndex].value;
-
- if (selected.length > 0) {
- closeInfoBox();
-
- var query = "?op=pref-feeds&subop=massSubscribe&ids="+
- param_escape(selected.toString()) + "&mode=" + param_escape(mode);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- feedlist_callback2(transport);
- } });
-
- } else {
- alert(__("No feeds are selected."));
- }
-
- } catch (e) {
- exception_error("feedBrowserSubscribe", e);
- }
-} */
-
-function updateBigFeedBrowserBtn() {
- notify_progress("Loading, please wait...");
- return updateBigFeedBrowser();
-}
-
function selectPrefRows(kind, select) {
if (kind) {
if (opbarid) {
selectTableRowsByIdPrefix(lname, nrow, nchk, select);
- disableContainerChildren(opbarid, !select);
}
}
nsel = getSelectedUsers();
}
- if (opbarid && nsel != -1) {
- disableContainerChildren(opbarid, nsel == false);
- }
-
}
}
function toggleSelectFBListRow(sender) {
toggleSelectListRow(sender);
- disableContainerChildren("fbrOpToolbar", getSelectedFeedsFromBrowser() == 0);
}
var seq = "";
}
if (keycode == 84 && shift_key) { // T
- browseFeeds();
+ displayDlg('feedBrowser');
return false;
}
query_str = query_str + "&omode=" + omode;
query_str = query_str + "&uctr=" + global_unread;
- var date = new Date();
- var timestamp = Math.round(date.getTime() / 1000);
- query_str = query_str + "&ts=" + timestamp
-
debug("REFETCH query: " + query_str);
new Ajax.Request("backend.php", {
if (getActiveFeedId() && !activeFeedIsCat()) {
query_str = query_str + "&actid=" + getActiveFeedId();
}
-
- var date = new Date();
- var timestamp = Math.round(date.getTime() / 1000);
- query_str = query_str + "&ts=" + timestamp
if (fetch) query_str = query_str + "&fetch=yes";
if (getActiveFeedId() != undefined) {
viewfeed(getActiveFeedId(), subop, activeFeedIsCat());
} else {
- disableContainerChildren("headlinesToolbar", false, document);
// viewfeed(-1, subop); // FIXME
}
return false; // block unneeded form submits
init_gears();
- disableContainerChildren("headlinesToolbar", true);
-
Form.disable("main_toolbar_form");
if (!genericSanityCheck())
return;
}
- if (opid == "qmcClearFeed") {
- var actid = getActiveFeedId();
-
- if (!actid) {
- alert(__("Please select some feed first."));
- return;
- }
-
- if (activeFeedIsCat() || actid < 0) {
- alert(__("You can't clear this type of feed."));
- return;
- }
-
- var fn = getFeedName(actid);
-
- var pr = __("Erase all non-starred articles in %s?").replace("%s", fn);
-
- if (confirm(pr)) {
- clearFeedArticles(actid);
- }
-
- return;
- }
-
-
if (opid == "qmcUpdateFeeds") {
scheduleFeedUpdate(true);
return;
}
}
-function clearFeedArticles(feed_id) {
-
- notify_progress("Clearing feed...");
-
- var query = "?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id;
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- dlg_frefresh_callback(transport, feed_id);
- } });
-
- return false;
-}
-
function collapse_feedlist() {
try {
debug("collapse_feedlist");
return feeds_sort_by_unread;
}
-function addLabel() {
-
- try {
-
- var caption = prompt(__("Please enter label caption:"), "");
-
- if (caption != undefined) {
-
- if (caption == "") {
- alert(__("Can't create label: missing caption."));
- return false;
- }
-
- var query = "?op=pref-labels&subop=add&caption=" +
- param_escape(caption);
-
- notify_progress("Loading, please wait...", true);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- updateFeedList();
- } });
-
- }
-
- } catch (e) {
- exception_error("addLabel", e);
- }
-}
-
-function visitOfficialSite() {
- window.open("http://tt-rss.org/");
-}
-
function inPreferences() {
return false;
}
<optgroup label="<?php echo __('Feed actions:') ?>">
<option value="qmcAddFeed"><?php echo __('Subscribe to feed...') ?></option>
<option value="qmcEditFeed"><?php echo __('Edit this feed...') ?></option>
- <!-- <option value="qmcClearFeed"><?php echo __('Clear articles') ?></option> -->
<option value="qmcRescoreFeed"><?php echo __('Rescore feed') ?></option>
<option value="qmcRemoveFeed"><?php echo __('Unsubscribe') ?></option>
</optgroup>
var query = "?op=view&id=" + param_escape(id);
- var date = new Date();
-
var neighbor_ids = getRelativePostIds(active_post_id);
/* only request uncached articles */
query = query + "&omode=flc";
}
- var date = new Date();
- var timestamp = Math.round(date.getTime() / 1000);
- query = query + "&ts=" + timestamp;
-
query = query + "&cids=" + cids_to_request.toString();
var crow = $("RROW-" + id);