diff --git a/public/javascripts/widgets/alert.js b/public/javascripts/widgets/alert.js index 30a7e1715..f05f5e9a1 100644 --- a/public/javascripts/widgets/alert.js +++ b/public/javascripts/widgets/alert.js @@ -4,27 +4,27 @@ this.faceboxTemplate = '
' + '
' + - '
' + - '

' + - '{{title}}' + - '

' + - '
' + - '{{content}}' + + '
' + + '

' + + '{{title}}' + + '

' + + '
' + + '{{content}}' + '
' + '
'; this.subscribe("widget/ready", function() { $(document).bind("close.facebox", function() { - $("#facebox, #diaspora_alert").remove(); + $("#facebox, #diaspora_alert").remove(); }); }); this.alert = function(title, content) { $($.mustache(self.faceboxTemplate, { - title: title, - content: content + title: title, + content: content })).appendTo(document.body); $.facebox({ diff --git a/public/javascripts/widgets/directionDetector.js b/public/javascripts/widgets/directionDetector.js index d5e5b9610..9af9cca3b 100644 --- a/public/javascripts/widgets/directionDetector.js +++ b/public/javascripts/widgets/directionDetector.js @@ -13,49 +13,49 @@ self.updateBinds(); Diaspora.widgets.subscribe("stream/scrolled", function() { - self.updateBinds(); + self.updateBinds(); }); }); this.isRTL = function(str) { if(typeof str !== "string" || str.length < 1) { - return false; + return false; } var charCode = str.charCodeAt(0); if(charCode >= 1536 && charCode <= 1791) // Sarabic, Persian, ... - return true; + return true; else if(charCode >= 65136 && charCode <= 65279) // Arabic present 1 - return true; + return true; else if(charCode >= 64336 && charCode <= 65023) // Arabic present 2 - return true; + return true; else if(charCode>=1424 && charCode<=1535) // Hebrew - return true; + return true; else if(charCode>=64256 && charCode<=64335) // Hebrew present - return true; + return true; else if(charCode>=1792 && charCode<=1871) // Syriac - return true; + return true; else if(charCode>=1920 && charCode<=1983) // Thaana - return true; + return true; else if(charCode>=1984 && charCode<=2047) // NKo - return true; + return true; else if(charCode>=11568 && charCode<=11647) // Tifinagh - return true; + return true; return false; }; this.updateBinds = function() { $.each(self.binds, function(index, bind) { - bind.unbind("keyup", self.updateDirection); + bind.unbind("keyup", self.updateDirection); }); self.binds = []; @@ -65,19 +65,19 @@ this.bind = function() { self.binds.push( - $(this).bind("keyup", self.updateDirection) + $(this).bind("keyup", self.updateDirection) ); }; this.updateDirection = function() { var textArea = $(this), - cleaned = textArea.val().replace(self.cleaner, "").replace(/^[ ]+/, ""); + cleaned = textArea.val().replace(self.cleaner, "").replace(/^[ ]+/, ""); if(self.isRTL(cleaned)) { - textArea.css("direction", "rtl"); + textArea.css("direction", "rtl"); } else { - textArea.css("direction", "ltr"); + textArea.css("direction", "ltr"); } }; }; diff --git a/public/javascripts/widgets/embedder.js b/public/javascripts/widgets/embedder.js index 97eebb9a4..c136ef360 100644 --- a/public/javascripts/widgets/embedder.js +++ b/public/javascripts/widgets/embedder.js @@ -12,7 +12,7 @@ self.subscribe("widget/ready", function() { $.extend(self, { - stream: $("#main_stream") + stream: $("#main_stream") }); self.ensureDOMStructure(); @@ -23,7 +23,7 @@ this.ensureDOMStructure = function() { var post = self.stream.children(".stream_element:first"), - content = post.children(".sm_body").children(".content").children("p"); + content = post.children(".sm_body").children(".content").children("p"); self.canEmbed = !!content.length; }; @@ -43,14 +43,15 @@ this.embed = function(videoLink) { var host = videoLink.data("host"), - container = $("
", { "class": "video-container" }), - videoContainer = videoLink.closest(".content").children(".video-container"); + container = $("
", { "class": "video-container" }), + videoContainer = videoLink.closest(".content").children(".video-container"); if (videoContainer.length) { - videoContainer.slideUp("fast", function() { - $(this).detach(); - }); - return; + videoContainer.slideUp("fast", function() { + $(this).detach(); + }); + + return; } if ($("div.video-container").length) { @@ -62,20 +63,20 @@ ); container.hide() - .insertAfter(videoLink.parent()) - .slideDown("fast"); + .insertAfter(videoLink.parent()) + .slideDown("fast"); videoLink.click(function() { - videoContainer.slideUp("fast", function() { - $(this).detach(); - }); + videoContainer.slideUp("fast", function() { + $(this).detach(); + }); }); }; this.onVideoLinkClicked = function(evt) { if(self.canEmbed) { - evt.preventDefault(); - self.embed($(this)); + evt.preventDefault(); + self.embed($(this)); } }; @@ -87,8 +88,8 @@ ''); self.register("vimeo.com", - '' + $.mustache(watchVideoOn, { provider: "Vimeo" }) + '
' + - ''); + '' + $.mustache(watchVideoOn, { provider: "Vimeo" }) + '
' + + ''); self.register("undefined", '

' + Diaspora.widgets.i18n.t("videos.unknown") + ' - {{host}}

'); }; diff --git a/public/javascripts/widgets/flashes.js b/public/javascripts/widgets/flashes.js index ad052f6b8..30b2cce78 100644 --- a/public/javascripts/widgets/flashes.js +++ b/public/javascripts/widgets/flashes.js @@ -17,10 +17,10 @@ this.render = function(result) { $("
", { - id: (result.success) ? "flash_notice" : "flash_error" + id: (result.success) ? "flash_notice" : "flash_error" }) - .prependTo(document.body) - .html(result.notice); + .prependTo(document.body) + .html(result.notice); self.animateMessages(); }; diff --git a/public/javascripts/widgets/i18n.js b/public/javascripts/widgets/i18n.js index 6335d0007..a01ea2fcf 100644 --- a/public/javascripts/widgets/i18n.js +++ b/public/javascripts/widgets/i18n.js @@ -15,16 +15,16 @@ this.t = function(item, views) { var translatedMessage, - items = item.split("."); + items = item.split("."); while(nextNamespace = items.shift()) { - translatedMessage = (translatedMessage) - ? translatedMessage[nextNamespace] - : self.locale[nextNamespace]; + translatedMessage = (translatedMessage) + ? translatedMessage[nextNamespace] + : self.locale[nextNamespace]; - if(typeof translatedMessage === "undefined") { - return ""; - } + if(typeof translatedMessage === "undefined") { + return ""; + } } return $.mustache(translatedMessage, views || { }); diff --git a/public/javascripts/widgets/infinite-scroll.js b/public/javascripts/widgets/infinite-scroll.js index 82bedbfff..86e0548c7 100644 --- a/public/javascripts/widgets/infinite-scroll.js +++ b/public/javascripts/widgets/infinite-scroll.js @@ -11,9 +11,9 @@ nextSelector : ".paginate", itemSelector : ".stream_element", pathParse : function( pathStr, nextPage ){ - var newPath = pathStr.replace("?", "?only_posts=true&"); - var last_time = $('#main_stream .stream_element').last().find('.time').attr('integer'); - return newPath.replace( /max_time=\d+/, 'max_time=' + last_time); + var newPath = pathStr.replace("?", "?only_posts=true&"), + lastTime = $('#main_stream .stream_element').last().find('.time').attr('integer'); + return newPath.replace( /max_time=\d+/, 'max_time=' + lastTime); }, bufferPx: 500, debug: false, @@ -34,16 +34,16 @@ this.initialize = function() { if($('#main_stream').length !== 0){ - $('#main_stream').infinitescroll(this.options, function() { - Diaspora.widgets.publish("stream/scrolled"); - }); + $('#main_stream').infinitescroll(this.options, function() { + Diaspora.widgets.publish("stream/scrolled"); + }); } else if($('#people_stream.contacts').length !== 0){ - $("#people_stream.contacts").infinitescroll($.extend(self.options, { - navSelector : ".pagination", - nextSelector : ".next_page", - }), function() { - Diaspora.widgets.publish("stream/scrolled"); - }); + $("#people_stream.contacts").infinitescroll($.extend(self.options, { + navSelector : ".pagination", + nextSelector : ".next_page", + }), function() { + Diaspora.widgets.publish("stream/scrolled"); + }); } }; diff --git a/public/javascripts/widgets/notifications-badge.js b/public/javascripts/widgets/notifications-badge.js index 54a69a31a..b614dd24f 100644 --- a/public/javascripts/widgets/notifications-badge.js +++ b/public/javascripts/widgets/notifications-badge.js @@ -11,7 +11,7 @@ self.ajaxLoader = self.dropdown.find(".ajax_loader"); self.badgeLink.toggle(function(evt) { - evt.preventDefault(); + evt.preventDefault(); evt.stopPropagation(); self.ajaxLoader.show(); diff --git a/public/javascripts/widgets/notifications.js b/public/javascripts/widgets/notifications.js index 3b63dde72..48c224bbc 100644 --- a/public/javascripts/widgets/notifications.js +++ b/public/javascripts/widgets/notifications.js @@ -36,14 +36,14 @@ this.showNotification = function(notification) { $(notification.html).prependTo(this.notificationArea) - .fadeIn(200) - .delay(8000) - .fadeOut(200, function() { - $(this).detach(); - }); + .fadeIn(200) + .delay(8000) + .fadeOut(200, function() { + $(this).detach(); + }); if(typeof notification.incrementCount === "undefined" || notification.incrementCount) { - this.incrementCount(); + this.incrementCount(); } }; @@ -51,18 +51,18 @@ this.count += change; if(this.badge.text() !== "") { - this.badge.text(this.count); - if(this.on_index_page) - this.index_badge.text(this.count + " "); + this.badge.text(this.count); + if(this.onIndexPage) + this.indexBadge.text(this.count + " "); - if(this.count === 0) { - this.badge.addClass("hidden"); - if(this.on_index_page) - this.index_badge.removeClass('unread'); - } - else if(this.count === 1) { - this.badge.removeClass("hidden"); - } + if(this.count === 0) { + this.badge.addClass("hidden"); + if(this.onIndexPage) + this.indexBadge.removeClass('unread'); + } + else if(this.count === 1) { + this.badge.removeClass("hidden"); + } } }; diff --git a/public/javascripts/widgets/post.js b/public/javascripts/widgets/post.js index d8ca300b8..b5dbd8463 100644 --- a/public/javascripts/widgets/post.js +++ b/public/javascripts/widgets/post.js @@ -33,13 +33,13 @@ this.expandLikes = function(evt){ evt.preventDefault(); var likesList = $(this).siblings(".likes_list"); - if(likesList.children().length == 0){ + if(likesList.children().length == 0) { likesList.append("loading"); $.ajax({ url: this.href, success: function(data){ likesList.html(data) - .fadeToggle(100); + .fadeToggle(100); } }); } diff --git a/public/javascripts/widgets/timeago.js b/public/javascripts/widgets/timeago.js index b16079b0d..cbd7ed2f4 100644 --- a/public/javascripts/widgets/timeago.js +++ b/public/javascripts/widgets/timeago.js @@ -12,9 +12,9 @@ self.updateTimeAgo(); if(Diaspora.widgets.i18n.language !== "en") { - $.each($.timeago.settings.strings, function(index) { - $.timeago.settings.strings[index] = Diaspora.widgets.i18n.t("timeago." + index); - }); + $.each($.timeago.settings.strings, function(index) { + $.timeago.settings.strings[index] = Diaspora.widgets.i18n.t("timeago." + index); + }); } });