]> git.mxchange.org Git - friendica.git/blobdiff - js/main.js
Merge pull request #1460 from FlxAlbroscheit/develop
[friendica.git] / js / main.js
index c336939c73904c11de59d8fd0df37ada9f0ec89f..53608024c966ce2e3df5dfc6b6168326b8b7f716 100644 (file)
                }
                }
                $('a[rel^=#]').click(function(e){
+                       e.preventDefault();
+                       var parent = $(this).parent();
+                       var isSelected = (last_popup_button && parent.attr('id') == last_popup_button.attr('id'));
                        close_last_popup_menu();
+                       if(isSelected) return false;
                        menu = $( $(this).attr('rel') );
                        e.preventDefault();
                        e.stopPropagation();
                        if (menu.attr('popup')=="false") return false;
-                       $(this).parent().toggleClass("selected");
+                       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();
+                               last_popup_button = parent;
                        }
                        return false;
                });
                });
                
                // fancyboxes
-               /*$("a.popupbox").fancybox({
-                       'transitionIn' : 'elastic',
-                       'transitionOut' : 'elastic'
-               });*/
                $("a.popupbox").colorbox({
                        'inline' : true,
                        'transition' : 'elastic'
                                        text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
                                        html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
                                        nnm.append(html);
+                                       
+                                       if(e.text().search('&rarr;') == 0) {
+                                         var notification = new Notification(document.title, {
+                                          body: e.text().replace('&rarr; ',''),
+                                          icon: e.attr('photo')
+                                         });
+   
+                                         // TODO (yet unsupported by most browsers): 
+                                         // Implement notification.onclick()
+                                         
+                                        notifyMarkAll();
+                                       }
                                });
 
                                $("img[data-src]", nnm).each(function(i, el){
                        });
                        eSysmsg.children("info").each(function(){
                                text = $(this).text();
-                               $.jGrowl(text, { sticky: false, theme: 'info', life: 10000 });
+                               $.jGrowl(text, { sticky: false, theme: 'info', life: 5000 });
                        });
                        
                });
                        if(livetime) {
                                clearTimeout(livetime);
                        }
-                       livetime = setTimeout(liveUpdate, 10000);
+                       livetime = setTimeout(liveUpdate, 5000);
                        return;
                }
                if(livetime != null)
@@ -703,6 +715,7 @@ function setupFieldRichtext(){
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "center",
                theme_advanced_blockformats : "blockquote,code",
+               theme_advanced_resizing : true,
                paste_text_sticky : true,
                entity_encoding : "raw",
                add_unload_trigger : false,