From 0fe484d7dbbfdfaa017ddb4d0ad7c9d80af9e19b Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Fri, 22 Jan 2016 21:19:08 +0100 Subject: [PATCH] hide embedded content and quotes from timelines --- QvitterPlugin.php | 5 + css/qvitter.css | 13 +++ js/dom-functions.js | 74 +++++++++--- js/misc-functions.js | 29 +---- js/qvitter.js | 81 +++++++++++++- js/stream-router.js | 247 +++++++++++++++++++++++++++++++++++++++-- locale/ar.json | 4 +- locale/ast.json | 4 +- locale/ca.json | 4 +- locale/de.json | 4 +- locale/en.json | 4 +- locale/eo.json | 4 +- locale/es.json | 4 +- locale/es_ahorita.json | 4 +- locale/eu.json | 4 +- locale/fa.json | 4 +- locale/fi.json | 4 +- locale/fr.json | 4 +- locale/gl.json | 4 +- locale/he.json | 4 +- locale/io.json | 4 +- locale/it.json | 4 +- locale/no.json | 4 +- locale/pt_br.json | 4 +- locale/sv.json | 4 +- locale/zh_cn.json | 4 +- locale/zh_tw.json | 4 +- 27 files changed, 453 insertions(+), 80 deletions(-) diff --git a/QvitterPlugin.php b/QvitterPlugin.php index 920be26..96a6102 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -547,6 +547,10 @@ class QvitterPlugin extends Plugin { // add id to all attachments $attachment_url_to_id[$enclosure_o->url]['id'] = $attachment->id; + // add an attachment version to all attachments + // this means we can force all cached attachments to update, if we change this + $attachment_url_to_id[$enclosure_o->url]['version'] = '1.2'; + // add data about thumbnails $thumb = $attachment->getThumbnail(); $large_thumb = $attachment->getThumbnail(1000,3000,false); @@ -654,6 +658,7 @@ class QvitterPlugin extends Plugin { $attachment['quoted_notice']['content'] = $quoted_notice->content; $attachment['quoted_notice']['nickname'] = $quoted_notice_author->nickname; $attachment['quoted_notice']['fullname'] = $quoted_notice_author->fullname; + $attachment['quoted_notice']['is_local'] = $quoted_notice_author->isLocal(); $quoted_notice_attachments = $quoted_notice->attachments(); foreach($quoted_notice_attachments as $q_attach) { if(is_object($q_attach)) { diff --git a/css/qvitter.css b/css/qvitter.css index ee0d292..843e337 100644 --- a/css/qvitter.css +++ b/css/qvitter.css @@ -2451,6 +2451,19 @@ body.rtl .queet.rtl .expanded-content { } +#feed-body.embedded-content-hidden-by-user .queet-content > .oembed-data, +#feed-body.embedded-content-hidden-by-user .queet-content > .queet-thumbs, +#feed-body.quotes-hidden-by-user .queet-text .quote-link-container, +.queet-text a.hidden-embedded-link-in-queet-text, +.queet-text a.hidden-quote-link-in-queet-text { + display:none; + } +#feed-body.embedded-content-hidden-by-user .queet-text a.hidden-embedded-link-in-queet-text, +#feed-body.quotes-hidden-by-user .queet-text a.hidden-quote-link-in-queet-text { + display:inline; + } + + .stream-item.activity .created-at a { display:none; } diff --git a/js/dom-functions.js b/js/dom-functions.js index 66e08e3..95076e5 100644 --- a/js/dom-functions.js +++ b/js/dom-functions.js @@ -97,7 +97,8 @@ function getMenu(menuArray) { 'data-menu-row-type': this.type, 'data-profile-prefs-topic': this.topic, 'data-profile-prefs-namespace': this.namespace, - 'data-profile-pref-state': prefEnabledOrDisabled + 'data-profile-pref-state': prefEnabledOrDisabled, + 'data-profile-pref-callback': this.callback }); } } @@ -743,15 +744,24 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess // also mark this stream as the current stream immediately, if a saved copy exists addStreamToHistoryMenuAndMarkAsCurrent(streamObject); + // make sure page-container and feed is visible + $('#page-container').css('opacity','1'); + $('#feed').css('opacity','1'); + + // run callbacks for this stream + if(streamObject.callbacks !== false) { + $.each(streamObject.callbacks, function(){ + if(typeof window[this] == 'function') { + window[this](); + } + }); + } + // maybe do something if(typeof actionOnSuccess == 'function') { actionOnSuccess(); - // make sure page-container and feed is visible - $('#page-container').css('opacity','1'); - $('#feed').css('opacity','1'); - // don't invoke actionOnSuccess later if we already invoked it here actionOnSuccess = false; } @@ -941,6 +951,15 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess $('#page-container').css('opacity','1'); $('#feed').css('opacity','1'); + // run callbacks for this stream + if(streamObject.callbacks !== false) { + $.each(streamObject.callbacks, function(){ + if(typeof window[this] == 'function') { + window[this](); + } + }); + } + $('.reload-stream').show(); $('body').removeClass('loading-older');$('body').removeClass('loading-newer'); @@ -2024,7 +2043,7 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat var urlToHideWithoutProtocol = removeProtocolFromUrl(urlToHide); if(urlToHideWithoutProtocol == removeProtocolFromUrl($(aElement).attr('href')) || urlToHideWithoutProtocol == removeProtocolFromUrl($(aElement).text())) { - $(aElement).css('display','none'); + $(aElement).addClass('hidden-embedded-link-in-queet-text') } }); }); @@ -2094,7 +2113,7 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat /* · · - · Place quoted notices in the queet text + · Place or update quoted notices in the queet text · · @param quotedNotices: object returned by buildAttachmentHTML() · @param queetText: jQuery object for queet text @@ -2104,23 +2123,42 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat function placeQuotedNoticesInQueetText(quotedNotices,queetText) { $.each(quotedNotices,function(k,qoutedNotice){ if(typeof qoutedNotice.url != 'undefined') { - var quoteLinkFound = queetText.find('a[href*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]'); + var quoteLinkFound = queetText.find('a[href*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]:not(.quote-link-container)'); // if we can't found it in a href, we might find it in data-quote-url attribute! if(quoteLinkFound.length==0) { - quoteLinkFound = queetText.find('a[data-quote-url*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]'); + quoteLinkFound = queetText.find('a[data-quote-url*="' + removeProtocolFromUrl(qoutedNotice.url) + '"]:not(.quote-link-container)'); } if(quoteLinkFound.length>0) { $.each(quoteLinkFound,function(){ - $(this).addClass(qoutedNotice.class); - $(this).attr('href',qoutedNotice.href); - $(this).attr('data-quote-url',qoutedNotice.url); - $(this).html(qoutedNotice.html); - // remove unnecessary line breaks, i.e. remove br between two quoted notices - if($(this).prev().is('br')) { - $(this).prev().remove(); + + // restore old style links (this can be removed later) + if($(this).children('.quoted-notice-header, .oembed-item-header').length>0) { + $(this).html($(this).attr('href')); + $(this).removeAttr('style'); + $(this).removeClass('quoted-notice'); + $(this).removeClass('oembed-item'); } - if(!$(this).next().is('br')) { - $(this).after('
'); + + // place a container if we don't have it + if(!$(this).next().is('.quote-link-container')) { + $(this).after(''); + } + + // update the link and the (maybe newly added) quote container after the link + if($(this).next().is('.quote-link-container')) { + $(this).addClass('hidden-quote-link-in-queet-text'); + $(this).attr('data-quote-url',qoutedNotice.url); + $(this).next().addClass(qoutedNotice.class); + $(this).next().attr('href',qoutedNotice.href); + $(this).next().html(qoutedNotice.html); + + // remove unnecessary line breaks, i.e. remove br between two quoted notices + if($(this).prev().is('br')) { + $(this).prev().remove(); + } + if(!$(this).next().next().is('br')) { + $(this).next().after('
'); + } } }); } diff --git a/js/misc-functions.js b/js/misc-functions.js index 0e7575d..bc60b06 100644 --- a/js/misc-functions.js +++ b/js/misc-functions.js @@ -894,7 +894,8 @@ function searchForUpdatedNoticeData(obj) { // we might want to hide urls (rendered as attachments) in the queet text $.each(queetFoundInFeed.find('.queet-text').find('a'),function(){ if(attachmentsHTMLBuild.urlsToHide.indexOf($(this).text()) > -1) { - $(this).css('display','none'); + $(this).removeAttr('style'); // temporary fix + $(this).addClass('hidden-embedded-link-in-queet-text'); } }); queetFoundInFeed.find('.queet-text').after(attachmentsHTMLBuild.html); @@ -1135,32 +1136,6 @@ function displayOrHideUnreadNotifications(notifications) { } -/* · - · - · Mark all notifications as seen - · - · · · · · · · · · · · · · */ - -function markAllNotificationsAsSeen(arg,callback) { - display_spinner(); - getFromAPI('qvitter/mark_all_notifications_as_seen.json',function(data){ - if(data === false) { - showErrorMessage(window.sL.ERRORfailedMarkingAllNotificationsAsRead); - callback(true); - } - else { - helloAPI(function(){ - $('.stream-item').removeClass('not-seen'); - $('#new-queets-bar').trigger('click'); // show any hidden notifications (this will also remove the dropdown menu) - remove_spinner(); - callback(true); - }); - } - }); - - } - - /* · · diff --git a/js/qvitter.js b/js/qvitter.js index 9395bf8..fc96e16 100644 --- a/js/qvitter.js +++ b/js/qvitter.js @@ -1296,12 +1296,86 @@ $('body').on('click','.row-type-profile-prefs-toggle',function(e){ window.qvitterProfilePrefs[prefTopic] = '0'; } + // run callback + if(typeof thisToggle.attr('data-profile-pref-callback') != 'undefined' + && thisToggle.attr('data-profile-pref-state') != 'undefined' + && typeof window[thisToggle.attr('data-profile-pref-callback')] == 'function') { + window[thisToggle.attr('data-profile-pref-callback')](); + } } }); }); +/* · + · + · Mark all notifications as seen + · + · · · · · · · · · · · · · */ + +function markAllNotificationsAsSeen(arg,callback) { + display_spinner(); + getFromAPI('qvitter/mark_all_notifications_as_seen.json',function(data){ + if(data === false) { + showErrorMessage(window.sL.ERRORfailedMarkingAllNotificationsAsRead); + callback(true); + } + else { + helloAPI(function(){ + $('.stream-item').removeClass('not-seen'); + $('#new-queets-bar').trigger('click'); // show any hidden notifications (this will also remove the dropdown menu) + remove_spinner(); + callback(true); + }); + } + }); + + } + +/* · + · + · Show or hide embedded content in timeline? + · + · · · · · · · · · · · · · */ + +function showOrHideEmbeddedContentInTimelineFromProfilePref() { + if(typeof window.qvitterProfilePrefs['hide_embedded_in_timeline:' + window.currentStreamObject.path] != 'undefined') { + var showHide = window.qvitterProfilePrefs['hide_embedded_in_timeline:' + window.currentStreamObject.path]; + if(parseInt(showHide,10) == 1) { + $('#feed-body').addClass('embedded-content-hidden-by-user'); + } + else { + $('#feed-body').removeClass('embedded-content-hidden-by-user'); + } + } + else { + $('#feed-body').removeClass('embedded-content-hidden-by-user'); + } + } + +/* · + · + · Show or hide quotes in timeline? + · + · · · · · · · · · · · · · */ + +function showOrHideQuotesInTimelineFromProfilePref() { + if(typeof window.qvitterProfilePrefs['hide_quotes_in_timeline:' + window.currentStreamObject.path] != 'undefined') { + var showHide = window.qvitterProfilePrefs['hide_quotes_in_timeline:' + window.currentStreamObject.path]; + if(parseInt(showHide,10) == 1) { + $('#feed-body').addClass('quotes-hidden-by-user'); + } + else { + $('#feed-body').removeClass('quotes-hidden-by-user'); + } + } + else { + $('#feed-body').removeClass('quotes-hidden-by-user'); + } + } + + /* · · @@ -2631,9 +2705,12 @@ $('body').on('click','button.shorten',function () { · · · · · · · · · · · · · · */ $('body').on('click','.reload-stream',function () { - setNewCurrentStream(URLtoStreamRouter(window.location.href),false,false,false); + reloadCurrentStream(); }); - +// can be used a callback too, e.g. from profile pref toggles +function reloadCurrentStream() { + setNewCurrentStream(URLtoStreamRouter(window.location.href),false,false,false); + } /* · · diff --git a/js/stream-router.js b/js/stream-router.js index da647ea..73b1ef8 100644 --- a/js/stream-router.js +++ b/js/stream-router.js @@ -132,6 +132,7 @@ function pathToStreamRouter(path) { id: false, // if we can read a id number string from the path, add it to this property maxIdOrPage: 'maxId', // whether this stream uses 'maxId' or 'page' for paging (maxId is default) menu: false, // optional menu in the header + callbacks: false, // functions to run after this timeline is loaded to feed-body type: 'notices' // notices, notifications, users, groups, lists etc. notices is default }; @@ -141,6 +142,28 @@ function pathToStreamRouter(path) { streamObject.name = 'public timeline'; streamObject.streamHeader = window.sL.publicTimeline; streamObject.stream = 'statuses/public_timeline.json'; + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } @@ -150,6 +173,28 @@ function pathToStreamRouter(path) { streamObject.name = 'public and external timeline'; streamObject.streamHeader = window.sL.publicAndExtTimeline; streamObject.stream = 'statuses/public_and_external_timeline.json'; + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } @@ -168,6 +213,28 @@ function pathToStreamRouter(path) { streamObject.stream = 'search.json?q=' + searchQuery; streamObject.id = searchQuery; streamObject.maxIdOrPage = 'page'; + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } } @@ -193,6 +260,28 @@ function pathToStreamRouter(path) { streamObject.streamHeader = '#' + replaceHtmlSpecialChars(pathSplit[1]); streamObject.id = pathSplit[1]; streamObject.stream = 'statusnet/tags/timeline/' + streamObject.id + '.json'; + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } @@ -243,6 +332,28 @@ function pathToStreamRouter(path) { streamObject.nickname = pathSplit[1]; streamObject.streamHeader = '!' + replaceHtmlSpecialChars(pathSplit[1]); streamObject.stream = 'statusnet/groups/timeline/' + streamObject.nickname + '.json'; + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } @@ -289,19 +400,40 @@ function pathToStreamRouter(path) { if(window.loggedIn.screen_name == streamObject.nickname) { streamObject.stream = 'statuses/friends_timeline.json'; streamObject.streamSubHeader = window.sL.timeline; + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_replies', + label: window.sL.hideRepliesToPeopleIDoNotFollow + }, + { + type: 'divider' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; } else { streamObject.stream = 'statuses/friends_timeline.json?screen_name=' + streamObject.nickname + '&withuserarray=1'; streamObject.parentPath = streamObject.nickname; } - streamObject.menu = [ - { - type: 'profile-prefs-toggle', - namespace: 'qvitter', - topic: 'hide_replies', - label: window.sL.hideRepliesToPeopleIDoNotFollow - } - ]; return streamObject; } @@ -319,6 +451,28 @@ function pathToStreamRouter(path) { streamObject.stream = 'statuses/mentions.json?screen_name=' + streamObject.nickname + '&withuserarray=1'; streamObject.streamSubHeader = '
' + window.sL.notices + ' /
' + window.sL.mentions + '
/ ' + window.sL.favoritesNoun + '
'; } + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } @@ -341,31 +495,56 @@ function pathToStreamRouter(path) { { type: 'divider' }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + }, + { + type: 'divider' + }, { type: 'profile-prefs-toggle', namespace: 'qvitter', topic: 'disable_notify_replies_and_mentions', - label: window.sL.notifyRepliesAndMentions + label: window.sL.notifyRepliesAndMentions, + callback: 'reloadCurrentStream' }, { type: 'profile-prefs-toggle', namespace: 'qvitter', topic: 'disable_notify_favs', - label: window.sL.notifyFavs + label: window.sL.notifyFavs, + callback: 'reloadCurrentStream' }, { type: 'profile-prefs-toggle', namespace: 'qvitter', topic: 'disable_notify_repeats', - label: window.sL.notifyRepeats + label: window.sL.notifyRepeats, + callback: 'reloadCurrentStream' }, { type: 'profile-prefs-toggle', namespace: 'qvitter', topic: 'disable_notify_follows', - label: window.sL.notifyFollows + label: window.sL.notifyFollows, + callback: 'reloadCurrentStream' } ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; } return streamObject; } @@ -384,6 +563,28 @@ function pathToStreamRouter(path) { streamObject.streamHeader = '@' + replaceHtmlSpecialChars(streamObject.nickname); streamObject.streamSubHeader = '
' + window.sL.notices + ' / ' + window.sL.mentions + ' /
' + window.sL.favoritesNoun; } + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } @@ -440,6 +641,28 @@ function pathToStreamRouter(path) { streamObject.streamHeader = window.sL.nicknamesListWithListName.replace('{list-name}',streamObject.nickname).replace('{nickname}',pathSplit[0]); streamObject.streamSubHeader = window.sL.nicknamesListWithListName.replace('{list-name}',streamObject.nickname).replace('{nickname}',pathSplit[0]) + '
/ ' + window.sL.listMembers + ' / ' + window.sL.listSubscribers + '
'; } + if(window.loggedIn !== false) { + streamObject.menu = [ + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_embedded_in_timeline:' + streamObject.path, + label: window.sL.hideEmbeddedInTimeline, + callback: 'showOrHideEmbeddedContentInTimelineFromProfilePref' + }, + { + type: 'profile-prefs-toggle', + namespace: 'qvitter', + topic: 'hide_quotes_in_timeline:' + streamObject.path, + label: window.sL.hideQuotesInTimeline, + callback: 'showOrHideQuotesInTimelineFromProfilePref' + } + ]; + streamObject.callbacks = [ + 'showOrHideEmbeddedContentInTimelineFromProfilePref', + 'showOrHideQuotesInTimelineFromProfilePref' + ]; + } return streamObject; } diff --git a/locale/ar.json b/locale/ar.json index 3cfcecc..68a34ef 100644 --- a/locale/ar.json +++ b/locale/ar.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/ast.json b/locale/ast.json index acc0325..90c11cb 100644 --- a/locale/ast.json +++ b/locale/ast.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/ca.json b/locale/ca.json index 297c4bd..958cf36 100644 --- a/locale/ca.json +++ b/locale/ca.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/de.json b/locale/de.json index 01f12dd..19a97a3 100644 --- a/locale/de.json +++ b/locale/de.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Eingebettete Inhaltsvorschau nicht anzeigen in dieser Timeline", + "hideQuotesInTimeline":"Verberge Zitate in dieser Timeline" } diff --git a/locale/en.json b/locale/en.json index 23777b9..d5153d1 100644 --- a/locale/en.json +++ b/locale/en.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/eo.json b/locale/eo.json index 2c46a10..7be1137 100644 --- a/locale/eo.json +++ b/locale/eo.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/es.json b/locale/es.json index 68b1931..259ac6e 100644 --- a/locale/es.json +++ b/locale/es.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Ocultar contenido incrustado en esta línea temporal", + "hideQuotesInTimeline":"Ocultar citas en esta línea temporal" } diff --git a/locale/es_ahorita.json b/locale/es_ahorita.json index e7ed92d..91b721d 100644 --- a/locale/es_ahorita.json +++ b/locale/es_ahorita.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/eu.json b/locale/eu.json index 79cba87..dc71e3a 100644 --- a/locale/eu.json +++ b/locale/eu.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/fa.json b/locale/fa.json index ea62048..5c0578c 100644 --- a/locale/fa.json +++ b/locale/fa.json @@ -162,5 +162,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/fi.json b/locale/fi.json index 48d8129..794abe8 100644 --- a/locale/fi.json +++ b/locale/fi.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/fr.json b/locale/fr.json index f843039..9264b37 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Cacher le contenu intégré dans ces avis", + "hideQuotesInTimeline":"Cacher les citations dans ces avis" } diff --git a/locale/gl.json b/locale/gl.json index 52d3c80..bcb2247 100644 --- a/locale/gl.json +++ b/locale/gl.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/he.json b/locale/he.json index 6068ee9..9d0dd66 100644 --- a/locale/he.json +++ b/locale/he.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/io.json b/locale/io.json index 44bbd45..d6cd2f9 100644 --- a/locale/io.json +++ b/locale/io.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/it.json b/locale/it.json index e54c60d..e4985b3 100644 --- a/locale/it.json +++ b/locale/it.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/no.json b/locale/no.json index ce3d992..e00fa34 100644 --- a/locale/no.json +++ b/locale/no.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/pt_br.json b/locale/pt_br.json index c7de381..45580e9 100644 --- a/locale/pt_br.json +++ b/locale/pt_br.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/sv.json b/locale/sv.json index 019a782..e7291bd 100644 --- a/locale/sv.json +++ b/locale/sv.json @@ -161,5 +161,7 @@ "addEditLanguageLink":"Hjälp till att översätta {site-title} till ett annat språk", "onlyPartlyTranslated":"Bara {percent}% av gränssnittet är översatt till svenska. Du kan hjälpa till med översättningen på Qvitters hemsida", "startRant":"Påbörja en harang", - "continueRant":"Fortsätt harangen" + "continueRant":"Fortsätt harangen", + "hideEmbeddedInTimeline":"Dölj inbäddat innehåll i detta flöde", + "hideQuotesInTimeline":"Dölj citat i detta flöde" } diff --git a/locale/zh_cn.json b/locale/zh_cn.json index 98cad55..c7fa0b2 100644 --- a/locale/zh_cn.json +++ b/locale/zh_cn.json @@ -160,5 +160,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" } diff --git a/locale/zh_tw.json b/locale/zh_tw.json index fdc4e85..54da409 100644 --- a/locale/zh_tw.json +++ b/locale/zh_tw.json @@ -160,5 +160,7 @@ "addEditLanguageLink":"Help translate {site-title} to another language", "onlyPartlyTranslated":"{site-title} is only partly translated to {language-name} ({percent}%). You can help complete the translation at Qvitter's repository homepage", "startRant":"Start a rant", - "continueRant":"Continue the rant" + "continueRant":"Continue the rant", + "hideEmbeddedInTimeline":"Hide embedded content in this timeline", + "hideQuotesInTimeline":"Hide quotes in this timeline" }