+function strip_tags(s) {
+ return s.replace(/<\/?[^>]+(>|$)/g, "");
+}
+
+function truncate_string(s, length) {
+ if (!length) length = 30;
+ var tmp = s.substring(0, length);
+ if (s.length > length) tmp += "…";
+ return tmp;
+}
+
+function hotkey_prefix_timeout() {
+ try {
+
+ var date = new Date();
+ var ts = Math.round(date.getTime() / 1000);
+
+ if (hotkey_prefix_pressed && ts - hotkey_prefix_pressed >= 5) {
+ console.log("hotkey_prefix seems to be stuck, aborting");
+ hotkey_prefix_pressed = false;
+ hotkey_prefix = false;
+ Element.hide('cmdline');
+ }
+
+ setTimeout("hotkey_prefix_timeout()", 1000);
+
+ } catch (e) {
+ exception_error("hotkey_prefix_timeout", e);
+ }
+}
+
+function hideAuxDlg() {
+ try {
+ Element.hide('auxDlg');
+ } catch (e) {
+ exception_error("hideAuxDlg", e);
+ }
+}
+
+function displayNewContentPrompt(id) {
+ try {
+
+ var msg = "<a href='#' onclick='viewfeed("+id+")'>" +
+ __("New articles available in this feed (click to show)") + "</a>";
+
+ msg = msg.replace("%s", getFeedName(id));
+
+ $('auxDlg').innerHTML = msg;
+
+ new Effect.Appear('auxDlg', {duration : 0.5});
+
+ } catch (e) {
+ exception_error("displayNewContentPrompt", e);
+ }
+}
+
+function feedBrowserSubscribe() {
+ try {
+
+ var selected = getSelectedFeedsFromBrowser();
+
+ var mode = document.forms['feed_browser'].mode;
+
+ mode = mode[mode.selectedIndex].value;
+
+ if (selected.length > 0) {
+ closeInfoBox();
+
+ notify_progress("Loading, please wait...", true);
+
+ var query = "?op=rpc&subop=massSubscribe&ids="+
+ param_escape(selected.toString()) + "&mode=" + param_escape(mode);
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {