From 6e4f4ce14bb2ce14fbc73cb8b0fe82f3aa059f24 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 13:12:02 +0300 Subject: [PATCH] remove modalbox; use dijit.Dialog; further dojo-related updates --- backend.php | 6 +- feedlist.js | 104 +------ functions.js | 63 +++-- functions.php | 22 +- lib/modalbox/license.txt | 1 - lib/modalbox/modalbox.css | 122 -------- lib/modalbox/modalbox.js | 577 -------------------------------------- lib/modalbox/spinner.gif | Bin 7823 -> 0 bytes tt-rss.css | 61 ++-- tt-rss.js | 110 +------- tt-rss.php | 28 +- viewfeed.js | 9 +- 12 files changed, 131 insertions(+), 972 deletions(-) delete mode 100644 lib/modalbox/license.txt delete mode 100644 lib/modalbox/modalbox.css delete mode 100644 lib/modalbox/modalbox.js delete mode 100644 lib/modalbox/spinner.gif diff --git a/backend.php b/backend.php index e03e6a272..ee68d9779 100644 --- a/backend.php +++ b/backend.php @@ -295,9 +295,9 @@ } if (!$next_unread_feed) { - print ""; } else { - print ""; } $override_order = false; @@ -346,7 +346,7 @@ $disable_cache = $ret[3]; $vgroup_last_feed = $ret[4]; - print "]]>"; + print ""; if ($_REQUEST["debug"]) $timing_info = print_checkpoint("05", $timing_info); diff --git a/feedlist.js b/feedlist.js index 5ee103747..47d310404 100644 --- a/feedlist.js +++ b/feedlist.js @@ -3,10 +3,6 @@ var _infscroll_disable = 0; var _infscroll_request_sent = 0; var feed_under_pointer = undefined; -var mouse_is_down = false; -var mouse_y = 0; -var mouse_x = 0; - var counter_timeout_id = false; var resize_enabled = false; @@ -408,10 +404,6 @@ function feedlist_init() { hideOrShowFeeds(getInitParam("hide_read_feeds") == 1); document.onkeydown = hotkey_handler; - document.onmousemove = mouse_move_handler; - document.onmousedown = mouse_down_handler; - document.onmouseup = mouse_up_handler; - setTimeout("hotkey_prefix_timeout()", 5*1000); if (getActiveFeedId()) { @@ -432,7 +424,7 @@ function feedlist_init() { setTimeout("hide_footer()", 5000); } - init_collapsable_feedlist(getInitParam("theme")); + //init_collapsable_feedlist(getInitParam("theme")); toggle_sortable_feedlist(isFeedlistSortable()); @@ -472,6 +464,7 @@ function hide_footer() { if (Element.visible("footer")) { Element.hide("footer"); + dijit.byId("main").resize(); //new Effect.Fade("footer", { afterFinish: hide_footer_af }); } @@ -480,60 +473,6 @@ function hide_footer() { } } -function init_collapsable_feedlist() { - try { - //console.log("init_collapsable_feedlist"); - - var theme = getInitParam("theme"); - var options = getInitParam("theme_options"); - - if (theme != "" && !options.match("collapse_feedlist")) return; - - var fbtn = $("collapse_feeds_btn"); - - if (fbtn) Element.show(fbtn); - - if (getInitParam("collapsed_feedlist") == 1) { - collapse_feedlist(); - } - - } catch (e) { - exception_error("init_hidden_feedlist", e); - } - -} - -function mouse_move_handler(e) { - try { - var client_y; - var client_x; - - if (window.event) { - client_y = window.event.clientY; - client_x = window.event.clientX; - } else if (e) { - client_x = e.screenX; - client_y = e.screenY; - } - - if (mouse_is_down) { - - if (mouse_y == 0) mouse_y = client_y; - if (mouse_x == 0) mouse_x = client_x; - - resize_headlines(mouse_x - client_x, mouse_y - client_y); - - mouse_y = client_y; - mouse_x = client_x; - - return false; - } - - } catch (e) { - exception_error("mouse_move_handler", e); - } -} - function enable_selection(b) { selection_disabled = !b; } @@ -542,45 +481,6 @@ function enable_resize(b) { resize_enabled = b; } -function mouse_down_handler(e) { - try { - - /* do not prevent right click */ - if (e && e.button && e.button == 2) return; - - if (resize_enabled) { - mouse_is_down = true; - mouse_x = 0; - mouse_y = 0; - document.onselectstart = function() { return false; }; - return false; - } - - if (selection_disabled) { - document.onselectstart = function() { return false; }; - return false; - } - - } catch (e) { - exception_error("mouse_down_handler", e); - } -} - -function mouse_up_handler(e) { - try { - mouse_is_down = false; - - if (!selection_disabled) { - document.onselectstart = null; - var e = $("headlineActionsBody"); - if (e) Element.hide(e); - } - - } catch (e) { - exception_error("mouse_up_handler", e); - } -} - function request_counters_real() { try { console.log("requesting counters..."); diff --git a/functions.js b/functions.js index 1c21adf0a..362fc9888 100644 --- a/functions.js +++ b/functions.js @@ -2,6 +2,7 @@ var hotkeys_enabled = true; var notify_silent = false; var last_progress_point = 0; var sanity_check_done = false; +var dialogs = []; /* add method to remove element from array */ @@ -23,8 +24,6 @@ function exception_error(location, e, ext_info) { if (!ext_info) ext_info = false; - disableHotkeys(); - try { if (ext_info) { @@ -44,14 +43,20 @@ function exception_error(location, e, ext_info) { content += "
Stack trace:
" + ""; - content += "
" + - "
"; - +// content += "
" + +// "
"; + + content += ""; + // TODO: add code to automatically report errors to tt-rss.org - Modalbox.show(content, {title: "Unhandled exception", width: 600, - resizeDuration: 0, transitions: false}); + var dialog = new dijit.Dialog({ + title: "Unhandled exception", + style: "width: 600px", + content: content}); + + dialog.show(); } catch (e) { alert(msg); @@ -318,10 +323,7 @@ function toggleSelectRow(sender, row) { function checkboxToggleElement(elem, id) { if (elem.checked) { - Effect.Appear(id, {duration : 0.5, - afterSetup: function() { - Modalbox.resizeToContent(); - }}); + Effect.Appear(id, {duration : 0.5}); } else { Effect.Fade(id, {duration : 0.5}); } @@ -387,10 +389,13 @@ function closeErrorBox() { } function closeInfoBox(cleanup) { - try { enableHotkeys(); - Modalbox.hide(); + + var dialog = dialogs.pop(); + + if (dialog) + dialog.hide(); } catch (e) { //exception_error("closeInfoBox", e); @@ -401,7 +406,6 @@ function closeInfoBox(cleanup) { function displayDlg(id, param, callback) { - disableHotkeys(); notify_progress("Loading, please wait...", true); var query = "?op=dlg&id=" + @@ -446,7 +450,7 @@ function infobox_callback2(transport) { var title = transport.responseXML.getElementsByTagName("title")[0]; if (title) - dtitle = title.firstChild.nodeValue; + title = title.firstChild.nodeValue; var content = transport.responseXML.getElementsByTagName("content")[0]; @@ -456,10 +460,26 @@ function infobox_callback2(transport) { content = transport.responseText; } - Modalbox.show(content, {title: dtitle, width: 600, - transitions: true, resizeDuration: 0 }); + var dialog = new dijit.Dialog({ + title: title, + style: "width: 600px", + onCancel: function() { + dialogs.remove(this); + return true; + }, + onExecute: function() { + dialogs.remove(this); + return true; + }, + onClose: function() { + dialogs.remove(this); + return true; + }, + content: content}); - disableHotkeys(); + dialog.show(); + + dialogs.push(dialog); notify(""); } catch (e) { @@ -603,10 +623,7 @@ function subscribeToFeed() { if (count > 5) count = 5; select.size = count; - Effect.Appear('fadd_feeds_container', {duration : 0.5, - afterSetup: function() { - Modalbox.resizeToContent() - }}); + Effect.Appear('fadd_feeds_container', {duration : 0.5}); } }); break; diff --git a/functions.php b/functions.php index 44f5af4dc..67e3087ec 100644 --- a/functions.php +++ b/functions.php @@ -4115,7 +4115,7 @@ $feed_id, $is_cat, $search, $match_on, $search_mode, $view_mode) { - print "
"; +# print "
"; $page_prev_link = "javascript:viewFeedGoPage(-1)"; $page_next_link = "javascript:viewFeedGoPage(1)"; @@ -4246,7 +4246,7 @@ print ""; - print "
"; +# print "
"; } function printCategoryHeader($link, $cat_id, $hidden = false, $can_browse = true, @@ -5060,8 +5060,10 @@ /// STOP ////////////////////////////////////////////////////////////////////////////////// + print ""; +// print "
"; if (!$result) { print "
".__("Could not display feed (query failed). Please check label match syntax or local configuration.")."
"; @@ -5072,11 +5074,13 @@ print_headline_subtoolbar($link, $feed_site_url, $feed_title, $feed, $cat_view, $search, $match_on, $search_mode, $view_mode); - print "
"; +// print "
"; } } + print "]]> 0) { @@ -5537,10 +5541,12 @@ } } - if (!$offset) { - if ($headlines_count > 0) print "
"; - print "
"; - } +# if (!$offset) { +# if ($headlines_count > 0) print "
"; +# print ""; +# } + + print "]]>"; return array($topmost_article_ids, $headlines_count, $feed, $disable_cache, $vgroup_last_feed); } diff --git a/lib/modalbox/license.txt b/lib/modalbox/license.txt deleted file mode 100644 index 7ae2f8928..000000000 --- a/lib/modalbox/license.txt +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2006-2007 Andrey Okonetchnikov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/modalbox/modalbox.css b/lib/modalbox/modalbox.css deleted file mode 100644 index 60c305087..000000000 --- a/lib/modalbox/modalbox.css +++ /dev/null @@ -1,122 +0,0 @@ -/* - modalbox.css - - Modalbox project - - Created by Andrew Okonetchnikov. - Copyright 2006-2010 okonet.ru. All rights reserved. - - Licensed under MIT license. -*/ - -#MB_overlay { - position: absolute; - margin: auto; - top: 0; left: 0; - width: 100%; height: 100%; - z-index: 9999; - border: 0; - background-color: #000!important; -} -#MB_overlay[id] { position: fixed; } - -#MB_windowwrapper { - position:absolute; - top:0; - width:100%; -} - -#MB_window { - position:relative; - margin-left:auto; - margin-right:auto; - top:0; - left:0; - border: 0 solid; - text-align: left; - z-index: 10000; -} -#MB_window[id] { position: relative; } - -#MB_frame { - position: relative; - background-color: #EFEFEF; - height: 100%; -} - -#MB_header { - margin: 0; - padding: 0; -} - -#MB_content { - position: relative; - padding: 6px .75em; - overflow: auto; -} - -#MB_caption { - font: bold 100% "Lucida Grande", Arial, sans-serif; - text-shadow: #FFF 0 1px 0; - padding: .5em 2em .5em .75em; - margin: 0; - text-align: left; -} - -#MB_close { - display: block; - position: absolute; - right: 5px; top: 4px; - padding: 2px 3px; - font-weight: bold; - text-decoration: none; - font-size: 13px; -} -#MB_close:hover { - background: transparent; -} - -#MB_loading { - padding: 1.5em; - text-indent: -10000px; - background: transparent url(spinner.gif) 50% 0 no-repeat; -} - -/* Color scheme */ -#MB_window { - background-color: #EFEFEF; - color: #000; - - -webkit-box-shadow: 0 0 64px #000; - -moz-box-shadow: #000 0 0 64px; - box-shadow: 0 0 64px #000; -} - #MB_frame { - padding-bottom: 4px; - - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-bottomright: 4px; - - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - } - - #MB_content { border-top: 1px solid #F9F9F9; } - - #MB_header { - background-color: #DDD; - border-bottom: 1px solid #CCC; - } - #MB_caption { color: #000 } - #MB_close { color: #777 } - #MB_close:hover { color: #000 } - - -/* Alert message */ -.MB_alert { - margin: 10px 0; - text-align: center; -} \ No newline at end of file diff --git a/lib/modalbox/modalbox.js b/lib/modalbox/modalbox.js deleted file mode 100644 index f338ec434..000000000 --- a/lib/modalbox/modalbox.js +++ /dev/null @@ -1,577 +0,0 @@ -// -// ModalBox - The pop-up window thingie with AJAX, based on Prototype JS framework. -// -// Created by Andrew Okonetchnikov -// Copyright 2006-2010 okonet.ru. All rights reserved. -// -// Licensed under MIT license. -// - -if (!window.Modalbox) - var Modalbox = new Object(); - -Modalbox.Methods = { - overrideAlert: false, // Override standard browser alert message with ModalBox - focusableElements: new Array, - currFocused: 0, - initialized: false, - active: true, - options: { - title: "ModalBox Window", // Title of the ModalBox window - overlayClose: true, // Close modal box by clicking on overlay - width: 500, // Default width in px - height: 90, // Default height in px - overlayOpacity: .65, // Default overlay opacity - overlayDuration: .25, // Default overlay fade in/out duration in seconds - slideDownDuration: .5, // Default Modalbox appear slide down effect in seconds - slideUpDuration: .5, // Default Modalbox hiding slide up effect in seconds - resizeDuration: .25, // Default resize duration seconds - inactiveFade: true, // Fades MB window on inactive state - transitions: true, // Toggles transition effects. Transitions are enabled by default - loadingString: "Please wait. Loading...", // Default loading string message - closeString: "Close window", // Default title attribute for close window link - closeValue: "×", // Default string for close link in the header - params: {}, - method: 'get', // Default Ajax request method - autoFocusing: true, // Toggles auto-focusing for form elements. Disable for long text pages. - aspnet: false, // Should be use then using with ASP.NET costrols. Then true Modalbox window will be injected into the first form element. - resizeCSSID: '' - }, - _options: new Object, - - setOptions: function(options) { - Object.extend(this.options, options || {}); - }, - - _init: function(options) { - // Setting up original options with default options - Object.extend(this._options, this.options); - this.setOptions(options); - - //Creating the overlay - this.MBoverlay = new Element("div", { id: "MB_overlay", style: "opacity: 0" }); - - //Creating the modal window - this.MBwindowwrapper = new Element("div", {id: "MB_windowwrapper"}).update( - this.MBwindow = new Element("div", {id: "MB_window", style: "display: none"}).update( - this.MBframe = new Element("div", {id: "MB_frame"}).update( - this.MBheader = new Element("div", {id: "MB_header"}).update( - this.MBcaption = new Element("div", {id: "MB_caption"}) - ) - ) - ) - ); - - this.MBclose = new Element("a", {id: "MB_close", title: this.options.closeString, href: "#"}).update("" + this.options.closeValue + ""); - this.MBheader.insert({'bottom':this.MBclose}); - - this.MBcontent = new Element("div", {id: "MB_content"}).update( - this.MBloading = new Element("div", {id: "MB_loading"}).update(this.options.loadingString) - ); - this.MBframe.insert({'bottom':this.MBcontent}); - - // Inserting into DOM. If parameter set and form element have been found will inject into it. Otherwise will inject into body as topmost element. - // Be sure to set padding and marging to null via CSS for both body and (in case of asp.net) form elements. - var injectToEl = this.options.aspnet ? $(document.body).down('form') : $(document.body); - injectToEl.insert({'top':this.MBwindowwrapper}); - injectToEl.insert({'top':this.MBoverlay}); - - var scrollOffsets = document.viewport.getScrollOffsets(); - if (scrollOffsets[1] > 0) { - $('MB_window').setStyle({top:scrollOffsets[1] + 'px'}); - } - - Event.observe(window, 'scroll', function() { - scrollOffsets = document.viewport.getScrollOffsets(); - $('MB_window').setStyle({top:scrollOffsets[1] + 'px'}); - }); - - // Initial scrolling position of the window. To be used for remove scrolling effect during ModalBox appearing - this.initScrollX = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft; - this.initScrollY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; - - //Adding event observers - this.hideObserver = this._hide.bindAsEventListener(this); - this.kbdObserver = this._kbdHandler.bindAsEventListener(this); - this._initObservers(); - - this.initialized = true; // Mark as initialized - }, - - show: function(content, options) { - if(!this.initialized) this._init(options); // Check for is already initialized - - this.content = content; - this.setOptions(options); - - if(this.options.title) // Updating title of the MB - $(this.MBcaption).update(this.options.title); - else { // If title isn't given, the header will not displayed - $(this.MBheader).hide(); - $(this.MBcaption).hide(); - } - - if(this.MBwindow.style.display == "none") { // First modal box appearing - this._appear(); - this.event("onShow"); // Passing onShow callback - } - else { // If MB already on the screen, update it - this._update(); - this.event("onUpdate"); // Passing onUpdate callback - } - }, - - hide: function(options) { // External hide method to use from external HTML and JS - if(this.initialized) { - // Reading for options/callbacks except if event given as a pararmeter - if(options && typeof options.element != 'function') Object.extend(this.options, options); - // Passing beforeHide callback - this.event("beforeHide"); - if(this.options.transitions) - Effect.SlideUp(this.MBwindow, { duration: this.options.slideUpDuration, transition: Effect.Transitions.sinoidal, afterFinish: this._deinit.bind(this) } ); - else { - $(this.MBwindow).hide(); - this._deinit(); - } - Event.stopObserving(window, 'scroll'); - } else throw("Modalbox is not initialized."); - }, - - _hide: function(event) { // Internal hide method to use with overlay and close link - event.stop(); // Stop event propaganation for link elements - /* Then clicked on overlay we'll check the option and in case of overlayClose == false we'll break hiding execution [Fix for #139] */ - if(event.element().id == 'MB_overlay' && !this.options.overlayClose) return false; - this.hide(); - }, - - alert: function(message){ - var html = '

' + message + '

'; - Modalbox.show(html, {title: 'Alert: ' + document.title, width: 300}); - }, - - _appear: function() { // First appearing of MB - if(Prototype.Browser.IE && !navigator.appVersion.match(/\b7.0\b/)) { // Preparing IE 6 for showing modalbox - window.scrollTo(0,0); - this._prepareIE("100%", "hidden"); - } - this._setWidth(); - if(this.options.transitions) { - $(this.MBoverlay).setStyle({opacity: 0}); - new Effect.Fade(this.MBoverlay, { - from: 0, - to: this.options.overlayOpacity, - duration: this.options.overlayDuration, - afterFinish: function() { - new Effect.SlideDown(this.MBwindow, { - duration: this.options.slideDownDuration, - transition: Effect.Transitions.sinoidal, - afterFinish: function(){ - this.loadContent(); - }.bind(this) - }); - }.bind(this) - }); - } else { - $(this.MBoverlay).setStyle({opacity: this.options.overlayOpacity}); - $(this.MBwindow).show(); - this.loadContent(); - } - this._setWidthAndPosition = this._setWidthAndPosition.bindAsEventListener(this); - Event.observe(window, "resize", this._setWidthAndPosition); - }, - - resize: function(byWidth, byHeight, options) { // Change size of MB without loading content - var oWidth = $(this.MBoverlay).getWidth(); - var wHeight = $(this.MBwindow).getHeight(); - var wWidth = $(this.MBwindow).getWidth(); - var hHeight = $(this.MBheader).getHeight(); - var cHeight = $(this.MBcontent).getHeight(); - var newHeight = ((wHeight - hHeight + byHeight) < cHeight) ? (cHeight + hHeight) : (wHeight + byHeight); - - var el = $(this.MBwindow); - var contentEl = $(this.MBcontent); - var windowBottomMargin = 10; - var windowOffset = (parseInt(el.getStyle('margin-top'), 0) + parseInt(el.getStyle('margin-bottom'), 0) + parseInt(el.getStyle('border-top-width'), 0) + parseInt(el.getStyle('border-bottom-width'), 0)) + windowBottomMargin; - var contentPadding = (parseInt(contentEl.getStyle('padding-top')) + parseInt(contentEl.getStyle('padding-bottom'))); - - if ((newHeight + windowOffset + contentPadding) > document.viewport.getHeight()) { - // adjust window height to account for margins and border widths - newHeight = document.viewport.getHeight() - windowOffset - windowBottomMargin; - // calculate content height including header height and padding values - newcHeight = newHeight - hHeight - parseInt($(this.MBframe).getStyle('padding-bottom'), 0) - parseInt($(this.MBcontent).getStyle('padding-bottom'), 0); - $(this.MBcontent).setStyle({height:newcHeight + 'px'}); - } - else if ($(this.MBcontent).getStyle('height')) { - // release any MB_content height set prior to establish scrollbars in content area - $(this.MBcontent).setStyle({height:''}); - } - - var newWidth = wWidth + byWidth; - this.options.width = newWidth; - if(options) this.setOptions(options); // Passing callbacks - if(this.options.transitions && !Modalbox.animating) { - Modalbox.animating = true; - new Effect.Morph(this.MBwindow, { - style: "width:" + newWidth + "px; height:" + newHeight + "px;", - duration: this.options.resizeDuration, - beforeStart: function(fx){ - fx.element.setStyle({overflow:"hidden"}); // Fix for MSIE 6 to resize correctly - }, - afterFinish: function(fx) { - fx.element.setStyle({overflow:"visible"}); - this.event("_afterResize"); // Passing internal callback - this.event("afterResize"); // Passing callback - Modalbox.animating = false; - }.bind(this) - }); - } else { - this.MBwindow.setStyle({width: newWidth + "px", height: newHeight + "px"}); - setTimeout(function() { - this.event("_afterResize"); // Passing internal callback - this.event("afterResize"); // Passing callback - }.bind(this), 1); - } - - }, - - resizeToContent: function(options){ - // Resizes the modalbox window to the actual content height. - // This might be useful to resize modalbox after some content modifications which were changed ccontent height. - - if (typeof options == "undefined") { - options = new Object(); - } - - // check to see if MB_content includes any images - var mbimages = $('MB_content').select('img'); - var totalimages = mbimages.length; - if (mbimages[0]) { - if (typeof options.imagesloaded == "undefined") { - - var loadedImages = $A(); - var loadedImageTotal = 0; - mbimages.each(function(o,idx) { - loadedImages[idx] = new Image(); - loadedImages[idx].src = o.src; - loadedImages[idx].onload = function() { - loadedImageTotal++; - if (loadedImageTotal == totalimages) { - // make sure all images have been rendered by checking their height - var imageincomplete = false; - mbimages.each(function(i) { - if (i.height == 0) { - imageincomplete = true; - } - }); - if (imageincomplete || Modalbox.animating) { - // some image hasn't been rendered yet, trigger resize loop until it is - Modalbox.resizeToContent(); - } - else { - // trigger one final resize, but set imagesloaded option to skip inspection of images - options.imagesloaded = true; - Modalbox.resizeToContent(options); - } - } - } - }) - } - } - - var byHeight = this.options.height - $(this.MBwindow).getHeight(); - if (options.resizeCSSID && $(options.resizeCSSID)) { - // byWidth is the amount of pixels needed to increase/decrease window to meet width of options.resizeCSSID - // plus a 10 pixel margin to accommodate scrollbars - var byWidth = $(options.resizeCSSID).getWidth() - $(this.MBwindow).getWidth() + (parseInt($(this.MBcontent).getStyle('padding-left'), 0) + parseInt($(this.MBcontent).getStyle('padding-right'), 0)) + 15; - } - else { - // don't change width - var byWidth = 0; - } - if(byHeight != 0) { - if(options) this.setOptions(options); // Passing callbacks - Modalbox.resize(byWidth, byHeight); - } - }, - - resizeToInclude: function(element, options){ - - // Resizes the modalbox window to the camulative height of element. Calculations are using CSS properties for margins and border. - // This method might be useful to resize modalbox before including or updating content. - - var el = $(element); - var elHeight = el.getHeight() + parseInt(el.getStyle('margin-top'), 0) + parseInt(el.getStyle('margin-bottom'), 0) + parseInt(el.getStyle('border-top-width'), 0) + parseInt(el.getStyle('border-bottom-width'), 0); - if(elHeight > 0) { - if(options) this.setOptions(options); // Passing callbacks - Modalbox.resize(0, elHeight); - } - }, - - _update: function() { // Updating MB in case of wizards - $(this.MBcontent).update($(this.MBloading).update(this.options.loadingString)); - this.loadContent(); - }, - - loadContent: function () { - if(this.event("beforeLoad") != false) { // If callback passed false, skip loading of the content - if(typeof this.content == 'string') { - var htmlRegExp = new RegExp(/<\/?[^>]+>/gi); - if(htmlRegExp.test(this.content)) { // Plain HTML given as a parameter - this._insertContent(this.content.stripScripts(), function(){ - this.content.extractScripts().map(function(script) { - return eval(script.replace("", "")); - }.bind(window)); - }.bind(this)); - } else // URL given as a parameter. We'll request it via Ajax - new Ajax.Request( this.content, { method: this.options.method.toLowerCase(), parameters: this.options.params, - onComplete: function(transport) { - var response = new String(transport.responseText); - this._insertContent(transport.responseText.stripScripts(), function(){ - response.extractScripts().map(function(script) { - return eval(script.replace("", "")); - }.bind(window)); - }); - }.bind(this), - onException: function(instance, exception){ - Modalbox.hide(); - throw('Modalbox Loading Error: ' + exception); - } - }); - - } else if (typeof this.content == 'object') {// HTML Object is given - this._insertContent(this.content); - } else { - Modalbox.hide(); - throw('Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)'); - } - } - }, - - _insertContent: function(content, callback){ - $(this.MBcontent).hide().update(""); - if(typeof content == 'string') { // Plain HTML is given - this.MBcontent.update(new Element("div", { style: "display: none" }).update(content)).down().show(); - } else if (typeof content == 'object') { // HTML Object is given - var _htmlObj = content.cloneNode(true); // If node already a part of DOM we'll clone it - // If clonable element has ID attribute defined, modifying it to prevent duplicates - if(content.id) content.id = "MB_" + content.id; - /* Add prefix for IDs on all elements inside the DOM node */ - $(content).select('*[id]').each(function(el){ el.id = "MB_" + el.id; }); - this.MBcontent.update(_htmlObj).down('div').show(); - if(Prototype.Browser.IE) // Toggling back visibility for hidden selects in IE - $$("#MB_content select").invoke('setStyle', {'visibility': ''}); - } - - // Prepare and resize modal box for content - if(this.options.height == this._options.height) { - Modalbox.resize((this.options.width - $(this.MBwindow).getWidth()), $(this.MBcontent).getHeight() - $(this.MBwindow).getHeight() + $(this.MBheader).getHeight(), { - afterResize: function(){ - setTimeout(function(){ // MSIE fix - this._putContent(callback); - }.bind(this),1); - }.bind(this) - }); - } else { // Height is defined. Creating a scrollable window - this._setWidth(); - this.MBcontent.setStyle({overflow: 'auto', height: $(this.MBwindow).getHeight() - $(this.MBheader).getHeight() - 13 + 'px'}); - setTimeout(function(){ // MSIE fix - this._putContent(callback); - }.bind(this),1); - } - }, - - _putContent: function(callback){ - this.MBcontent.show(); - this.focusableElements = this._findFocusableElements(); - this._setFocus(); // Setting focus on first 'focusable' element in content (input, select, textarea, link or button) - if(callback != undefined) - callback(); // Executing internal JS from loaded content - this.event("afterLoad"); // Passing callback - }, - - activate: function(options){ - this.setOptions(options); - this.active = true; - $(this.MBclose).observe("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).observe("click", this.hideObserver); - $(this.MBclose).show(); - if(this.options.transitions && this.options.inactiveFade) - new Effect.Appear(this.MBwindow, {duration: this.options.slideUpDuration}); - }, - - deactivate: function(options) { - this.setOptions(options); - this.active = false; - $(this.MBclose).stopObserving("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).stopObserving("click", this.hideObserver); - $(this.MBclose).hide(); - if(this.options.transitions && this.options.inactiveFade) - new Effect.Fade(this.MBwindow, {duration: this.options.slideUpDuration, to: .75}); - }, - - _initObservers: function(){ - $(this.MBclose).observe("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).observe("click", this.hideObserver); - if(Prototype.Browser.Gecko) - Event.observe(document, "keypress", this.kbdObserver); // Gecko is moving focus a way too fast - else - Event.observe(document, "keydown", this.kbdObserver); // All other browsers are okay with keydown - }, - - _removeObservers: function(){ - $(this.MBclose).stopObserving("click", this.hideObserver); - if(this.options.overlayClose) - $(this.MBoverlay).stopObserving("click", this.hideObserver); - if(Prototype.Browser.Gecko) - Event.stopObserving(document, "keypress", this.kbdObserver); - else - Event.stopObserving(document, "keydown", this.kbdObserver); - }, - - _setFocus: function() { - /* Setting focus to the first 'focusable' element which is one with tabindex = 1 or the first in the form loaded. */ - if(this.focusableElements.length > 0 && this.options.autoFocusing == true) { - var firstEl = this.focusableElements.find(function (el){ - return el.tabIndex == 1; - }) || this.focusableElements.first(); - this.currFocused = this.focusableElements.toArray().indexOf(firstEl); - firstEl.focus(); // Focus on first focusable element except close button - } else if($(this.MBclose).visible()) - $(this.MBclose).focus(); // If no focusable elements exist focus on close button - }, - - _findFocusableElements: function(){ // Collect form elements or links from MB content - this.MBcontent.select('input:not([type~=hidden]), select, textarea, button, a[href]').invoke('addClassName', 'MB_focusable'); - return this.MBcontent.select('.MB_focusable'); - }, - - _kbdHandler: function(event) { - var node = event.element(); - switch(event.keyCode) { - case Event.KEY_TAB: - event.stop(); - - /* Switching currFocused to the element which was focused by mouse instead of TAB-key. Fix for #134 */ - if(node != this.focusableElements[this.currFocused]) - this.currFocused = this.focusableElements.toArray().indexOf(node); - - if(!event.shiftKey) { //Focusing in direct order - if(this.currFocused == this.focusableElements.length - 1) { - this.focusableElements.first().focus(); - this.currFocused = 0; - } else { - this.currFocused++; - this.focusableElements[this.currFocused].focus(); - } - } else { // Shift key is pressed. Focusing in reverse order - if(this.currFocused == 0) { - this.focusableElements.last().focus(); - this.currFocused = this.focusableElements.length - 1; - } else { - this.currFocused--; - this.focusableElements[this.currFocused].focus(); - } - } - break; - case Event.KEY_ESC: - if(this.active) this._hide(event); - break; - case 32: - this._preventScroll(event); - break; - case 0: // For Gecko browsers compatibility - if(event.which == 32) this._preventScroll(event); - break; - case Event.KEY_UP: - case Event.KEY_DOWN: - case Event.KEY_PAGEDOWN: - case Event.KEY_PAGEUP: - case Event.KEY_HOME: - case Event.KEY_END: - // Safari operates in slightly different way. This realization is still buggy in Safari. - if(Prototype.Browser.WebKit && !["textarea", "select"].include(node.tagName.toLowerCase())) - event.stop(); - else if( (node.tagName.toLowerCase() == "input" && ["submit", "button"].include(node.type)) || (node.tagName.toLowerCase() == "a") ) - event.stop(); - break; - } - }, - - _preventScroll: function(event) { // Disabling scrolling by "space" key - if(!["input", "textarea", "select", "button"].include(event.element().tagName.toLowerCase())) - event.stop(); - }, - - _deinit: function() - { - this._removeObservers(); - Event.stopObserving(window, "resize", this._setWidthAndPosition ); - if(this.options.transitions) { - Effect.toggle(this.MBoverlay, 'appear', {duration: this.options.overlayDuration, afterFinish: this._removeElements.bind(this) }); - } else { - this.MBoverlay.hide(); - this._removeElements(); - } - $(this.MBcontent).setStyle({overflow: '', height: ''}); - }, - - _removeElements: function () { - $(this.MBoverlay).remove(); - $(this.MBwindow).remove(); - if(Prototype.Browser.IE && !navigator.appVersion.match(/\b7.0\b/)) { - this._prepareIE("", ""); // If set to auto MSIE will show horizontal scrolling - window.scrollTo(this.initScrollX, this.initScrollY); - } - - /* Replacing prefixes 'MB_' in IDs for the original content */ - if(typeof this.content == 'object') { - if(this.content.id && this.content.id.match(/MB_/)) { - this.content.id = this.content.id.replace(/MB_/, ""); - } - this.content.select('*[id]').each(function(el){ el.id = el.id.replace(/MB_/, ""); }); - } - /* Initialized will be set to false */ - this.initialized = false; - this.event("afterHide"); // Passing afterHide callback - this.setOptions(this._options); //Settings options object into intial state - }, - - _setWidth: function () { //Set size - $(this.MBwindow).setStyle({width: this.options.width + "px", height: this.options.height + "px"}); - }, - - _setWidthAndPosition: function () { - $(this.MBwindow).setStyle({width: this.options.width + "px"}); - }, - - _getScrollTop: function () { //From: http://www.quirksmode.org/js/doctypes.html - var theTop; - if (document.documentElement && document.documentElement.scrollTop) - theTop = document.documentElement.scrollTop; - else if (document.body) - theTop = document.body.scrollTop; - return theTop; - }, - _prepareIE: function(height, overflow){ - $$('html, body').invoke('setStyle', {width: height, height: height, overflow: overflow}); // IE requires width and height set to 100% and overflow hidden - $$("select").invoke('setStyle', {'visibility': overflow}); // Toggle visibility for all selects in the common document - }, - event: function(eventName) { - if(this.options[eventName]) { - var returnValue = this.options[eventName](); // Executing callback - this.options[eventName] = null; // Removing callback after execution - if(returnValue != undefined) - return returnValue; - else - return true; - } - return true; - } -}; - -Object.extend(Modalbox, Modalbox.Methods); - -if(Modalbox.overrideAlert) window.alert = Modalbox.alert; \ No newline at end of file diff --git a/lib/modalbox/spinner.gif b/lib/modalbox/spinner.gif deleted file mode 100644 index 39615c89252d05f980b2cda99be6b153b26b20c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7823 zcmbVRX;hQvy8SW_1V};x0Ydl!0V1GHLQp`I1Of?2B_JvetqGu_wKga!T8B(P!~lV! zqD2i;wTd>*h*JntP}Cr()S?DN1+|(0ZLwvz^qhO{J@@B5>;3cndDr^Z+WXmiKl>HN z$AyJUIRFRvV;cDL&p!hK0)GGf_tw_djT<+1+__U#RXsH|HGh8O*x1;QKb}5z?AYMo zphBS>7#Ofvx}HCOF*G#%`t|F}m#>VBjJ$vU{_Wehot^idK7CqOS9kvW`IMBDzP`Sg zn3((bA6TvZd3kwf&z}9_i!Y>7>7G4%4<0(y)AQ)@<0t#~?|=BPJ3Bj@N~IPR6(=Sp z_V)gK^vKc9&dwV*Zo=X4(z3E!w{DqCrky)?Ha1@0wtc(NXl!U`ShsH7iWMs#+_!MK z+#5GsR>z47x^&8F2&5s^Ee);mHUSIXY4<}EY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rtneM(A(vZr_H@dQx(v zf3GNrD>m}VqVvEv1X|)IxtxfF47396+ge(~-)TmWXe^u8;=GuoLjmseQjC8!$kHy%bv_M z&~l^a*G!v+ce#OWawF@(4sefNDn}Mfz0^d^qa?@B$yL>+kQI|P#hyNyP_%0%S9b>z z5eex)z#zo{pRAsUFV)VpPDLIKL$(r1D%aK;MdV85P*;5Ii#YlzdbCFYG^oQcook1O zh9~xxhE>YXt5DEA4|%X#Q{5fJZr%l9JiS5M#(^zhZN4^LVN*kX-kU1NS|Wct!*J9S z&p18SEiZ!=;|KYtt@tq!{K`3!i$}=Jg4#-1U;nTDT=nm(IR^MY_A*|AS1c+*&%DHl zrL)~RouQSYWIo!YxAQk7* zmTgZjcf7N#V&nYM;)82MLs)gwkf`W3Y_}?Gx~VZCbVygUQ?Sov zLiRg^o}m)Ew7}5GWhhggV{kP+bRAWNE@<62ohx->5OIU3$gj%vC{&VoNo$lF z{(PPv>>dGv++z)}d=2w6;4q-R0OEqwqRq~6R0WE^RV;vE94S^1nJ~!26X*2~6f7bd zcyS&Iv_Jz%m>Nat3?CdV~fQl?NYad_)(($4>^`~Uy| diff --git a/tt-rss.css b/tt-rss.css index 1afda26ee..5200301e4 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1,4 +1,4 @@ -body { +body#ttrssMain { background : white; color : black; margin : 0px; @@ -678,35 +678,24 @@ td.selectPrompt { color : gray; } -div.headlinesSubToolbar { - border-width : 0px 0px 1px 0px; - border-style : solid; - border-color : #f0f0f0; - height : 20px; - line-height : 20px; - -/* position : absolute; - left : 0px; - top : 0px; - height : 25px; - line-height : 25px; - padding-left : 5px; - padding-right : 5px; - right : 0px; */ +div#headlines-toolbar { + border-width : 0px; background-color : white; font-size : 11px; font-family : "Lucida Grande", "Segoe UI", Tahoma, Arial, sans-serif; color : gray; + padding : 0px 5px 0px 0px; + margin : 0px; + overflow : hidden; } -div.headlinesSubToolbar * { +/* div.headlines-toolbar * { line-height : normal; -} +} */ -div.headlinesSubToolbar div#subtoolbar_ftitle { +div#headlines-toolbar div#subtoolbar_ftitle { float : right; - line-height : 20px; - + /* line-height : 20px; */ } span.contentPreview { @@ -1047,7 +1036,7 @@ html, body, #main { } #toolbar div.actionChooser { - margin-right : 5px; + /* margin-right : 5px; */ float : right; } @@ -1558,6 +1547,7 @@ ul#headlineActionsBody { margin-left : -1px; max-height : 250px; overflow : auto; + } ul#headlineActionsBody li { @@ -1762,19 +1752,40 @@ div.fatalError textarea { #main { border-width : 0px; + margin : 0px; + padding : 0px; +} + +#content-wrap { + padding : 0px; + border-width : 0px; + margin : 0px; } #feeds-holder { padding : 0px; } +#headlines-wrap-inner { + padding : 0px; + margin : 0px; + border-width : 0px; +} + #headlines-frame { padding : 0px; } +#headlinesInnerContainer { + font-size : 12px; +} + #toolbar { - padding : 4px; + padding : 0px; + margin : 0px; border-width : 0px; + white-space: nowrap; + font-size : 12px; } #header { @@ -1788,3 +1799,7 @@ div.fatalError textarea { padding : 4px; border-width : 0px; } + +#content-insert { + padding : 0px; +} diff --git a/tt-rss.js b/tt-rss.js index a497de53c..b0e747a0c 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -8,8 +8,6 @@ var number_of_feeds = 0; var hotkey_prefix = false; var hotkey_prefix_pressed = false; var init_params = {}; -var ver_offset = 0; -var hor_offset = 0; var _force_scheduled_update = false; var last_scheduled_update = false; @@ -244,6 +242,8 @@ function init() { dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); + dojo.require("dijit.Dialog"); + dojo.require("dijit.form.Button"); //return remove_splash(); @@ -265,91 +265,12 @@ function init() { } } -function resize_headlines(delta_x, delta_y) { - -/* try { - - console.log("resize_headlines: " + delta_x + ":" + delta_y); - - var h_frame = $("headlines-frame"); - var c_frame = $("content-frame"); - var f_frame = $("footer"); - var feeds_frame = $("feeds-holder"); - var resize_grab = $("resize-grabber"); - var resize_handle = $("resize-handle"); - - if (!c_frame || !h_frame) return; - - if (feeds_frame && getInitParam("theme") == "old-skool") { - feeds_frame.style.bottom = f_frame.offsetHeight + "px"; - } - - if (getInitParam("theme_options").match("horiz_resize")) { - - if (delta_x != undefined) { - if (c_frame.offsetLeft - delta_x > feeds_frame.offsetWidth + feeds_frame.offsetLeft + 100 && c_frame.offsetWidth + delta_x > 100) { - hor_offset = hor_offset + delta_x; - } - } - - console.log("resize_headlines: HOR-mode: " + hor_offset); - - c_frame.style.width = (400 + hor_offset) + "px"; - h_frame.style.right = c_frame.offsetWidth - 1 + "px"; - - resize_grab.style.top = (h_frame.offsetTop + h_frame.offsetHeight - 60) + "px"; - resize_grab.style.left = (h_frame.offsetLeft + h_frame.offsetWidth - - 4) + "px"; - resize_grab.style.display = "block"; - - //resize_handle.src = "themes/"+getInitParam('theme')+"/images/resize_handle_vert.png"; - resize_handle.style.paddingTop = (resize_grab.offsetHeight / 2 - 7) + "px"; - - } else { - - if (delta_y != undefined) { - if (c_frame.offsetHeight + delta_y > 100 && h_frame.offsetHeight - delta_y > 100) { - ver_offset = ver_offset + delta_y; - } - } - - console.log("resize_headlines: VER-mode: " + ver_offset); - - h_frame.style.height = (300 - ver_offset) + "px"; - - c_frame.style.top = (h_frame.offsetTop + h_frame.offsetHeight + 0) + "px"; - h_frame.style.height = h_frame.offsetHeight + "px"; - - // Workaround for Opera: force the content page to be re-rendered, - // so it is not truncated: - var content_pane = $("content-insert"); - content_pane.innerHTML = content_pane.innerHTML; - } - - if (getInitParam("cookie_lifetime") != 0) { - setCookie("ttrss_offset_ver", ver_offset, - getInitParam("cookie_lifetime")); - setCookie("ttrss_offset_hor", hor_offset, - getInitParam("cookie_lifetime")); - } else { - setCookie("ttrss_offset_ver", ver_offset); - setCookie("ttrss_offset_hor", hor_offset); - } - - } catch (e) { - exception_error("resize_headlines", e); - } */ - -} - function init_second_stage() { try { delCookie("ttrss_test"); - window.onresize=resize_headlines; - var toolbar = document.forms["main_toolbar_form"]; dropboxSelect(toolbar.view_mode, getInitParam("default_view_mode")); @@ -363,20 +284,6 @@ function init_second_stage() { loading_set_progress(60); - ver_offset = parseInt(getCookie("ttrss_offset_ver")); - hor_offset = parseInt(getCookie("ttrss_offset_hor")); - - console.log("got offsets from cookies: ver " + ver_offset + " hor " + hor_offset); - - /* fuck IE */ - - if (isNaN(hor_offset)) hor_offset = 0; - if (isNaN(ver_offset)) ver_offset = 0; - - console.log("offsets from cookies [x:y]: " + hor_offset + ":" + ver_offset); - - resize_headlines(); - if (has_local_storage()) localStorage.clear(); @@ -470,9 +377,7 @@ function quickMenuGo(opid) { } if (opid == "qmcResetUI") { - hor_offset = 0; - ver_offset = 0; - resize_headlines(); + alert("Function not implemented"); } if (opid == "qmcToggleReorder") { @@ -677,7 +582,7 @@ function collapse_feedlist() { try { //console.log("collapse_feedlist"); - var theme = getInitParam("theme"); +/* var theme = getInitParam("theme"); if (theme != "" && !getInitParam("theme_options").match("collapse_feedlist")) return; @@ -735,7 +640,10 @@ function collapse_feedlist() { new Ajax.Request("backend.php", { parameters: query }); - } + } */ + + query = "?op=rpc&subop=setpref&key=_COLLAPSED_FEEDLIST&value=true"; + } catch (e) { exception_error("collapse_feedlist", e); } @@ -832,7 +740,7 @@ function hotkey_handler(e) { closeInfoBox(); } - if (!hotkeys_enabled) { + if (dialogs.length > 0 || !hotkeys_enabled) { console.log("hotkeys disabled"); return; } diff --git a/tt-rss.php b/tt-rss.php index 80419a0c6..1abda3b53 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -28,7 +28,6 @@ - - @@ -129,7 +127,7 @@
 
-
+
@@ -199,15 +197,23 @@
- -
-
-
- -
-
- +
+
+
+ +
+
+
+
+
+ + +
+ + +