replace unicode characters that librejs messes up

Esse commit está contido em:
Hannes Mannerheim
2016-03-12 15:08:22 +01:00
commit 0273158e47
4 arquivos alterados com 24 adições e 24 exclusões
+7 -7
Ver Arquivo
@@ -808,7 +808,7 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess
// discard and remove any cached data that is not in this (new) format
if(typeof haveOldStreamState.card == 'undefined'
|| typeof haveOldStreamState.feed == 'undefined') {
|| typeof haveOldStreamState.feed == 'undefined') {
localStorageObjectCache_STORE('streamState',window.currentStreamObject.path, false);
haveOldStreamState = false;
}
@@ -958,7 +958,7 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess
}
else if(error.status == 404) {
if(streamObject.name == 'profile'
|| streamObject.name == 'friends timeline'
|| streamObject.name == 'friends timeline'
|| streamObject.name == 'mentions'
|| streamObject.name == 'favorites'
|| streamObject.name == 'subscribers'
@@ -967,13 +967,13 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess
showErrorMessage(window.sL.ERRORcouldNotFindUserWithNickname.replace('{nickname}',replaceHtmlSpecialChars(streamObject.nickname)));
}
else if(streamObject.name == 'group notice stream'
|| streamObject.name == 'group member list'
|| streamObject.name == 'group admin list') {
|| streamObject.name == 'group member list'
|| streamObject.name == 'group admin list') {
showErrorMessage(window.sL.ERRORcouldNotFindGroupWithNickname.replace('{nickname}',replaceHtmlSpecialChars(streamObject.nickname)));
}
else if(streamObject.name == 'list notice stream'
|| streamObject.name == 'list members'
|| streamObject.name == 'list subscribers') {
|| streamObject.name == 'list members'
|| streamObject.name == 'list subscribers') {
showErrorMessage(window.sL.ERRORcouldNotFindList);
}
else {
@@ -1485,7 +1485,7 @@ function replyFormHtml(streamItem,qid) {
var repliesText = '';
if(Object.keys(screenNamesToAdd).length < 1
&& q.find('strong.name').attr('data-user-id') == window.loggedIn.id) {
if(streamItem.attr('data-in-reply-to-status-id') == 'null' || streamItem.attr('data-in-reply-to-status-id') == 'false' || streamItem.attr('data-in-reply-to-status-id') == 'undefined' || streamItem.attr('data-in-reply-to-status-id') == '') {
if(streamItem.attr('data-in-reply-to-status-id') == 'null' || streamItem.attr('data-in-reply-to-status-id') == 'false' || streamItem.attr('data-in-reply-to-status-id') == 'undefined' || streamItem.attr('data-in-reply-to-status-id') == '') {
var startText = window.sL.startRant + ' ';
}
else {
+5 -5
Ver Arquivo
@@ -461,7 +461,7 @@ function userIsBlocked(userId) {
· · · · · · · · · */
function markAllNoticesFromBlockedUsersAsBlockedInJQueryObject(obj) {
function markAllNoticesFromBlockedUsersAsBlockedInJQueryObject(obj) {
$.each(window.allBlocking,function(){
obj.find('.stream-item[data-user-id="' + this + '"]').addClass('profile-blocked-by-me');
obj.find('.stream-item[data-user-id="' + this + '"]').children('.queet').attr('data-tooltip',window.sL.thisIsANoticeFromABlockedUser);
@@ -475,7 +475,7 @@ function markAllNoticesFromBlockedUsersAsBlockedInJQueryObject(obj) {
·
· · · · · · · · · */
function markAllNoticesFromMutedUsersAsMutedInJQueryObject(obj) {
function markAllNoticesFromMutedUsersAsMutedInJQueryObject(obj) {
$.each(obj.find('.stream-item'),function(){
if(isUserMuted($(this).attr('data-user-id'))) {
@@ -496,7 +496,7 @@ function markAllNoticesFromMutedUsersAsMutedInJQueryObject(obj) {
·
· · · · · · · · · */
function markAllProfileCardsFromMutedUsersAsMutedInDOM() {
function markAllProfileCardsFromMutedUsersAsMutedInDOM() {
$.each($('body').find('.profile-header-inner'),function(){
if(isUserMuted($(this).attr('data-user-id'))) {
@@ -938,7 +938,7 @@ function userArrayCacheStore(data) {
window.convertStatusnetProfileUrlToUserArrayCacheKey[dataToStore.external.statusnet_profile_url] = key;
}
// store the time when this record was modified
if(dataToStore.local || dataToStore.external) {
if(dataToStore.local || dataToStore.external) {
window.userArrayCache[key].modified = Date.now();
}
}
@@ -1733,7 +1733,7 @@ function validateRegisterForm(o) {
return allFieldsValid;
}
function validEmail(email) {
function validEmail(email) {
if(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email)) {
return true;
}
+11 -11
Ver Arquivo
@@ -222,8 +222,8 @@ window.userArrayLastRetrieved = new Object();
$('body').on('mouseover',function (e) {
// no hovercards on these elements
if($(e.target).is('#user-queets') || $(e.target).closest('a').is('#user-queets')
|| $(e.target).is('.tweet-stats') || $(e.target).closest('a').is('.tweet-stats')) {
if($(e.target).is('#user-queets') || $(e.target).closest('a').is('#user-queets')
|| $(e.target).is('.tweet-stats') || $(e.target).closest('a').is('.tweet-stats')) {
return true;
}
@@ -321,7 +321,7 @@ $('body').on('mouseover',function (e) {
// if the user array has not been retrieved from the server for the last 60 seconds,
// we query it for the lastest data
if((typeof window.userArrayLastRetrieved[hrefAttr] == 'undefined') || (timeNow - window.userArrayLastRetrieved[hrefAttr]) > 60000) {
if((typeof window.userArrayLastRetrieved[hrefAttr] == 'undefined') || (timeNow - window.userArrayLastRetrieved[hrefAttr]) > 60000) {
window.userArrayLastRetrieved[hrefAttr] = timeNow;
// local users
@@ -380,7 +380,7 @@ function getUserArrayData(maybeProfileUrl,maybeNickname,timeNow,targetElement,ca
setTimeout(function(){
if(targetElement.is(":hover")) {
// don't try this if we already tried it less than a minute ago
if((typeof window.userArrayLastRetrieved[maybeProfileUrl] == 'undefined') || (timeNow - window.userArrayLastRetrieved[maybeProfileUrl]) > 60000) {
if((typeof window.userArrayLastRetrieved[maybeProfileUrl] == 'undefined') || (timeNow - window.userArrayLastRetrieved[maybeProfileUrl]) > 60000) {
window.userArrayLastRetrieved[maybeProfileUrl] = timeNow;
getFromAPI('qvitter/external_user_show.json?profileurl=' + encodeURIComponent(maybeProfileUrl),function(data){
if(data && data.external !== null) {
@@ -406,11 +406,11 @@ function getUserArrayData(maybeProfileUrl,maybeNickname,timeNow,targetElement,ca
else if(streamObject && (streamObject.name == 'profile' || streamObject.name == 'profile by id')) {
var nicknameOrId = streamObject.nickname;
if(!nicknameOrId) {
if(!nicknameOrId) {
nicknameOrId = streamObject.id;
}
// don't query too often for the same user
if(typeof window.userArrayLastRetrieved[maybeProfileUrl] == 'undefined' || (timeNow - window.userArrayLastRetrieved[maybeProfileUrl]) > 60000) {
if(typeof window.userArrayLastRetrieved[maybeProfileUrl] == 'undefined' || (timeNow - window.userArrayLastRetrieved[maybeProfileUrl]) > 60000) {
window.userArrayLastRetrieved[maybeProfileUrl] = timeNow;
// query server and cache user data (done automatically in getFromAPI)
getFromAPI('users/show.json?id=' + nicknameOrId, function(data){
@@ -1400,7 +1400,7 @@ $('body').on('click',function(e){
/* ·
·
· When clicking a function row in a stream menu – invoke the function
· When clicking a function row in a stream menuinvoke the function
·
· · · · · · · · · · · · · */
@@ -1847,7 +1847,7 @@ $('body').on('click','a', function(e) {
setNewCurrentStream(pathToStreamRouter(window.following[streamObject.id].username),true,streamObject.id);
}
// if the text() of the clicked element looks like a user nickname, use that (but send id to setNewCurrentStream() in case this is bad data)
else if(/^@[a-zA-Z0-9]+$/.test($(e.target).text()) || /^[a-zA-Z0-9]+$/.test($(e.target).text())) {
else if(/^@[a-zA-Z0-9]+$/.test($(e.target).text()) || /^[a-zA-Z0-9]+$/.test($(e.target).text())) {
var nickname = $(e.target).text();
if(nickname.indexOf('@') == 0) {
nickname = nickname.substring(1); // remove any starting @
@@ -1873,7 +1873,7 @@ $('body').on('click','a', function(e) {
setNewCurrentStream(pathToStreamRouter('group/' + window.groupMemberships[streamObject.id].username),true,streamObject.id);
}
// if the text() of the clicked element looks like a group nickname, use that (but send id to setNewCurrentStream() in case this is bad data)
else if(/^![a-zA-Z0-9]+$/.test($(e.target).text()) || /^[a-zA-Z0-9]+$/.test($(e.target).text())) {
else if(/^![a-zA-Z0-9]+$/.test($(e.target).text()) || /^[a-zA-Z0-9]+$/.test($(e.target).text())) {
var nickname = $(e.target).text();
if(nickname.indexOf('!') == 0) {
nickname = nickname.substring(1); // remove any starting !
@@ -2049,7 +2049,7 @@ function checkForNewQueets() {
$('body').addClass('loading-newer');
// only if logged in and only for notice or notification streams
if(window.loggedIn && (window.currentStreamObject.type == 'notices' || window.currentStreamObject.type == 'notifications')) {
if(window.loggedIn && (window.currentStreamObject.type == 'notices' || window.currentStreamObject.type == 'notifications')) {
var lastId = $('#feed-body').children('.stream-item').not('.temp-post').not('.posted-from-form').attr('data-quitter-id-in-stream');
var addThisStream = window.currentStreamObject.stream;
var timeNow = new Date().getTime();
@@ -3471,7 +3471,7 @@ $('body').keyup(function (e) {
&& window.loggedIn !== false) {
// shortcuts documentation on '?'
if(e.shiftKey && (e.which == 171 || e.which == 191)) {
if(e.shiftKey && (e.which == 171 || e.which == 191)) {
$('#shortcuts-link').click();
}
+1 -1
Ver Arquivo
@@ -182,7 +182,7 @@ function pathToStreamRouter(path) {
}
// the whole known network
if(path.length == 0 || path == 'main/all') {
if(path.length == 0 || path == 'main/all') {
streamObject.path = 'main/all';
streamObject.name = 'public and external timeline';
streamObject.streamHeader = window.sL.publicAndExtTimeline;