From 3ad02a749b1ae7db2a92a552a3ed1ffe545ed46f Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 21 Mar 2012 05:27:08 -0700 Subject: make autocomplete work with updated tinymce --- js/fk.autocomplete.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'js') diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js index 69fe77e8c..b1db92c41 100755 --- a/js/fk.autocomplete.js +++ b/js/fk.autocomplete.js @@ -14,22 +14,22 @@ function ACPopup(elm,backend_url){ this.kp_timer = false; this.url = backend_url; + var w = 530; + var h = 130; + + if(typeof elm.editorId == "undefined") { style = $(elm).offset(); w = $(elm).width(); h = $(elm).height(); } else { - style = $(elm.container).offset(); - w = elm.container.offsetWidth; - h = elm.container.offsetHeight; - // Quick fix for chrome until I get a tool to inspect the dom - // Chrome returns 0x0 - if(! w) - w = 530; - if(! h) - h = 130; - + var container = elm.getContainer(); + if(typeof container != "undefined") { + style = $(container).offset(); + w = $(container).width(); + h = $(container).height(); + } } style.top=style.top+h; -- cgit v1.2.3 From 1780fff1611809a6069603eceb643e210b4b3f36 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 23 Mar 2012 14:09:06 +0100 Subject: diabook: theme.php remove code duplication last photos check for user "hidewall" remove unneeded regex move js code to close popup in main.js (missing stop event propagation in popup links) --- js/main.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/main.js b/js/main.js index babd2a1c3..2b4b13791 100755 --- a/js/main.js +++ b/js/main.js @@ -28,13 +28,15 @@ var in_progress = false; var langSelect = false; var commentBusy = false; + var last_popup_menu = null; + var last_popup_button = null; $(function() { $.ajaxSetup({cache: false}); msie = $.browser.msie ; - /* setup tooltips */ + /* setup tooltips *//* $("a,.tt").each(function(){ var e = $(this); var pos="bottom"; @@ -43,7 +45,7 @@ if (e.hasClass("ttleft")) pos="left"; if (e.hasClass("ttright")) pos="right"; e.tipTip({defaultPosition: pos, edgeOffset: 8}); - }); + });*/ @@ -76,8 +78,21 @@ if (menu.attr('popup')=="false") return false; $(this).parent().toggleClass("selected"); menu.toggle(); + if (menu.css("display") == "none") { + last_popup_menu = null; + last_popup_button = null; + } else { + last_popup_menu = menu; + last_popup_button = $(this).parent(); + } return false; }); + $('html').click(function() { + last_popup_menu.hide(); + last_popup_button.removeClass("selected"); + last_popup_menu = null; + last_popup_button = null; + }); // fancyboxes $("a.popupbox").fancybox({ -- cgit v1.2.3 From c88674aaf23ede573f19a2b363dfccf9627a5dcb Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 Mar 2012 19:05:14 -0700 Subject: theme preview for end users --- js/main.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'js') diff --git a/js/main.js b/js/main.js index 2b4b13791..0b5fb5cdc 100755 --- a/js/main.js +++ b/js/main.js @@ -588,3 +588,10 @@ Array.prototype.remove = function(item) { return this.push.apply(this, rest); }; +function previewTheme(elm) { + theme = $(elm).val(); + $.getJSON('pretheme?f=&theme=' + theme,function(data) { + $('#theme-preview').html('' + theme + ''); + }); + +} \ No newline at end of file -- cgit v1.2.3