Browse Source

update jQuery to 3.3.1 (and 1.12.4 for tmobile)

readme-update
Simon Grim 6 years ago
parent
commit
4c4666f221
  1. 3
      abort.html
  2. 3
      home.html
  3. 2
      index.html
  4. 6
      js/calm.js
  5. 53
      js/interface_common.js
  6. 26
      js/interface_home.js
  7. 4
      js/interface_localization.js
  8. 4
      js/interface_profile-edit.js
  9. 4
      js/jQueryPlugins.js
  10. 5
      js/jquery-1.12.4.min.js
  11. 5
      js/jquery-1.9.1.min.js
  12. 2
      js/jquery-3.3.1.min.js
  13. 200
      js/jquery.json-2.4.js
  14. 30
      js/jquery.jsonrpcclient.js
  15. 5
      js/jquery.min.js
  16. 4
      js/jquery.textcomplete.min.js
  17. 24
      js/mobile_abstract.js
  18. 2
      js/options.js
  19. 82
      js/tmobile.js
  20. 12
      js/twister_actions.js
  21. 8
      js/twister_directmsg.js
  22. 12
      js/twister_formatpost.js
  23. 2
      js/twister_io.js
  24. 13
      js/twister_network.js
  25. 3
      network.html
  26. 3
      options.html
  27. 3
      profile-edit.html
  28. 12
      theme_nin/js/theme_option.js
  29. 3
      tmobile.html

3
abort.html

@ -4,9 +4,8 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>Aborting...</title> <title>Aborting...</title>
<link id="stylecss" rel="stylesheet" href="css/style.css"/> <link id="stylecss" rel="stylesheet" href="css/style.css"/>
<script src="js/jquery.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jQueryPlugins.js"></script> <script src="js/jQueryPlugins.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js"></script> <script src="js/options.js"></script>

3
home.html

@ -5,9 +5,8 @@
<title>twister</title> <title>twister</title>
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/> <link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
<link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css"/> <link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css"/>
<script src="js/jquery.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jQueryPlugins.js"></script> <script src="js/jQueryPlugins.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js"></script> <script src="js/options.js"></script>

2
index.html

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no"/> <meta name="viewport" content="width=device-width, user-scalable=no"/>
<link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" /> <link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" />
<script src="js/jquery-1.9.1.min.js"></script> <script src="js/jquery-1.12.4.min.js"></script>
<script src="js/jquery.mobile.router.min.js"></script> <script src="js/jquery.mobile.router.min.js"></script>
<script src="js/jquery.mobile-1.3.2.min.js"></script> <script src="js/jquery.mobile-1.3.2.min.js"></script>

6
js/calm.js

@ -1,13 +1,13 @@
$(function(){ $(function(){
$('#showqr').on('click', function(){ $('#showqr').on('click', function () {
if($('#qrcode img')[0]) return; if($('#qrcode img')[0]) return;
var skey = document.getElementById('skey').innerText; var skey = document.getElementById('skey').innerText;
new QRCode(document.getElementById("qrcode"), skey); new QRCode(document.getElementById("qrcode"), skey);
}); });
$('.tox-ctc').on('click', function(){ $('.tox-ctc').on('click', function () {
window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data')) window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data'))
}) })
$('.bitmessage-ctc').on('click', function(){ $('.bitmessage-ctc').on('click', function () {
window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data')) window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data'))
}) })
}) })

53
js/interface_common.js

@ -95,8 +95,9 @@ function openModal(modal) {
modal.drapper = $('<div>').appendTo(twister.html.detached); // here modal goes instead detaching modal.drapper = $('<div>').appendTo(twister.html.detached); // here modal goes instead detaching
modal.content.outerHeight(modal.self.height() - modal.self.find('.modal-header').outerHeight() modal.content.outerHeight(modal.self.height() - modal.self.find('.modal-header').outerHeight()
- modal.self.find('.inline-warn').outerHeight() - (modal.warn && !$.Options.get('skipWarn' + modal.warn.name) ?
* (modal.warn && !$.Options.get('skipWarn' + modal.warn.name) ? 1 : 0)); modal.self.find('.inline-warn').outerHeight() : 0)
);
var windowHeight = $(window).height(); var windowHeight = $(window).height();
if (modal.self.outerHeight() > windowHeight) { if (modal.self.outerHeight() > windowHeight) {
@ -191,7 +192,7 @@ function minimizeModal(modal, switchMode) {
twister.modal[i].scroll = scroll; twister.modal[i].scroll = scroll;
twister.modal[i].btnResume = $('<li>' + modal.find('.modal-header h3').text() + '</li>') twister.modal[i].btnResume = $('<li>' + modal.find('.modal-header h3').text() + '</li>')
.on('click', {hashString: window.location.hash}, function (event) { .on('click', {hashString: window.location.hash}, function (event) {
if (!event.button) // only if left mouse (button is 0) or elem.click() (button is undefined) if (!event.button) // only if left mouse (button is 0) or elem.trigger('click') (button is undefined)
resumeModal(event); resumeModal(event);
}) })
.on('mouseup', {route: window.location.hash, blankOnly: true}, routeOnClick) .on('mouseup', {route: window.location.hash, blankOnly: true}, routeOnClick)
@ -277,7 +278,7 @@ function focusModalWithElement(elem, cbFunc, cbReq) {
if (typeof i === 'object') i = i[0]; // several modals, but only one may be active currently if (typeof i === 'object') i = i[0]; // several modals, but only one may be active currently
twister.modal[i].onResume = cbFunc; twister.modal[i].onResume = cbFunc;
twister.modal[i].onResumeReq = cbReq; twister.modal[i].onResumeReq = cbReq;
twister.modal[i].btnResume.click(); twister.modal[i].btnResume.trigger('click');
return true; return true;
} }
@ -557,7 +558,7 @@ function openGroupProfileModalWithNameHandler(groupAlias) {
; ;
if (ret.members.indexOf(defaultScreenName) !== -1) if (ret.members.indexOf(defaultScreenName) !== -1)
req.modal.content.find('.group-messages-control').children('button').attr('disabled', false); req.modal.content.find('.group-messages-control').children('button').prop('disabled', false);
var membersList = req.modal.content.find('.members'); var membersList = req.modal.content.find('.members');
var memberTemplate = $('#group-profile-member-template').children(); var memberTemplate = $('#group-profile-member-template').children();
@ -1246,7 +1247,7 @@ function routeOnClick(event) {
.bind({elem: event.target, href: event.target.getAttribute('href')}), 200); .bind({elem: event.target, href: event.target.getAttribute('href')}), 200);
event.target.removeAttribute('href'); event.target.removeAttribute('href');
} }
twister.html.blanka.attr('href', event.data.route)[0].click(); // opens .route in new tab twister.html.blanka.attr('href', event.data.route)[0].trigger('click'); // opens .route in new tab
} }
if (!event || !event.data || !event.data.route) if (!event || !event.data || !event.data.route)
@ -1300,10 +1301,10 @@ function watchHashChange(event) {
function loadModalFromHash() { function loadModalFromHash() {
var i = window.location.hash; var i = window.location.hash;
if (twister.modal[i] && twister.modal[i].minimized) { if (twister.modal[i] && twister.modal[i].minimized) {
// need to close active modal(s) before btnResume.click() or it will be minimized in resumeModal() // need to close active modal(s) before btnResume.trigger('click') or it will be minimized in resumeModal()
// e.g. for case when you click on profile link in some modal having this profile's modal minimized already // e.g. for case when you click on profile link in some modal having this profile's modal minimized already
closeModal(undefined, true); closeModal(undefined, true);
twister.modal[i].btnResume.click(); twister.modal[i].btnResume.trigger('click');
return; return;
} }
@ -1396,7 +1397,7 @@ function reTwistPopup(event, post, textArea) {
} }
if (typeof post === 'undefined') if (typeof post === 'undefined')
post = $.evalJSON($(event.target).closest('.post-data').attr('data-userpost')); post = JSON.parse($(event.target).closest('.post-data').attr('data-userpost'));
var modal = openModal({ var modal = openModal({
classBase: '.prompt-wrapper', classBase: '.prompt-wrapper',
@ -1430,7 +1431,7 @@ function reTwistPopup(event, post, textArea) {
} else { } else {
replyArea.find('textarea').replaceWith(textArea); replyArea.find('textarea').replaceWith(textArea);
if (textArea.val()) { if (textArea.val()) {
textArea.focus(); textArea.trigger('focus');
replyArea.addClass('open'); replyArea.addClass('open');
} }
} }
@ -1448,7 +1449,7 @@ function favPopup(event, post, textArea) {
} }
if (typeof post === 'undefined') if (typeof post === 'undefined')
post = $.evalJSON($(event.target).closest('.post-data').attr('data-userpost')); post = JSON.parse($(event.target).closest('.post-data').attr('data-userpost'));
var modal = openModal({ var modal = openModal({
classBase: '.prompt-wrapper', classBase: '.prompt-wrapper',
@ -1472,7 +1473,7 @@ function favPopup(event, post, textArea) {
} else { } else {
replyArea.find('textarea').replaceWith(textArea); replyArea.find('textarea').replaceWith(textArea);
if (textArea.val()) { if (textArea.val()) {
textArea.focus(); textArea.trigger('focus');
replyArea.addClass('open'); replyArea.addClass('open');
} }
} }
@ -1734,7 +1735,7 @@ function postReplyClick(event) {
var post = $(this).closest('.post'); var post = $(this).closest('.post');
if (!post.hasClass('original')) if (!post.hasClass('original'))
replyInitPopup(event, $.evalJSON(post.find('.post-data').attr('data-userpost'))); replyInitPopup(event, JSON.parse(post.find('.post-data').attr('data-userpost')));
else { else {
if (!post.closest('.post.open').length) if (!post.closest('.post.open').length)
postExpandFunction(event, post); postExpandFunction(event, post);
@ -1774,7 +1775,7 @@ function composeNewPost(e, postAreaNew) {
poseTextareaPostTools(textArea); poseTextareaPostTools(textArea);
} }
if (!postAreaNew.find('textarea:focus').length) if (!postAreaNew.find('textarea:focus').length)
postAreaNew.find('textarea:last').focus(); postAreaNew.find('textarea:last').trigger('focus');
} }
function poseTextareaPostTools(event) { function poseTextareaPostTools(event) {
@ -1920,7 +1921,7 @@ function replyTextInput(event) {
if (typeof targetta !== 'undefined' && targetta[0] !== document.activeElement) { if (typeof targetta !== 'undefined' && targetta[0] !== document.activeElement) {
textArea = targetta; textArea = targetta;
textArea.focus(); textArea.trigger('focus');
textArea.caret(caretPos); textArea.caret(caretPos);
} }
} }
@ -2036,7 +2037,7 @@ function replyTextKeySend(event) {
textArea.val(textArea.val().trim()); textArea.val(textArea.val().trim());
if (!buttonSend.hasClass('disabled')) if (!buttonSend.hasClass('disabled'))
buttonSend.click(); buttonSend.trigger('click');
} }
} }
} }
@ -2461,7 +2462,7 @@ function postSubmit(e, oldLastPostId) {
if (btnPostSubmit.hasClass('with-reference')) { if (btnPostSubmit.hasClass('with-reference')) {
var doSubmitPost = function (postText, postDataElem) { var doSubmitPost = function (postText, postDataElem) {
newRtMsg($.evalJSON(postDataElem.attr('data-content_to_rt')), newRtMsg(JSON.parse(postDataElem.attr('data-content_to_rt')),
postDataElem.attr('data-content_to_sigrt'), postText, updateRTsWithOwnOne postDataElem.attr('data-content_to_sigrt'), postText, updateRTsWithOwnOne
); );
}; };
@ -2573,7 +2574,7 @@ function postSubmit(e, oldLastPostId) {
if (btnPostSubmit.closest('.post-area,.post-reply-content').length) { if (btnPostSubmit.closest('.post-area,.post-reply-content').length) {
btnPostSubmit.closest('.post-area-new').removeClass('open') btnPostSubmit.closest('.post-area-new').removeClass('open')
.find('textarea').blur(); .find('textarea').trigger('blur');
} }
textArea.data('unicodeConversionStack', []); textArea.data('unicodeConversionStack', []);
textArea.data('disabledUnicodeRules', []); textArea.data('disabledUnicodeRules', []);
@ -2587,7 +2588,7 @@ function retweetSubmit(event) {
var prompt = $(event.target).closest('.prompt-wrapper'); var prompt = $(event.target).closest('.prompt-wrapper');
var postDataElem = prompt.find('.post-data'); var postDataElem = prompt.find('.post-data');
newRtMsg($.evalJSON(postDataElem.attr('data-content_to_rt')), newRtMsg(JSON.parse(postDataElem.attr('data-content_to_rt')),
postDataElem.attr('data-content_to_sigrt'), '', updateRTsWithOwnOne postDataElem.attr('data-content_to_sigrt'), '', updateRTsWithOwnOne
); );
@ -2626,7 +2627,7 @@ function changeStyle() {
$('#profilecss').attr('href', profile); $('#profilecss').attr('href', profile);
$('<style type="text/css"> .selectable_theme:not(.theme_' + theme + ')' + $('<style type="text/css"> .selectable_theme:not(.theme_' + theme + ')' +
'{display:none!important;}\n</style>').appendTo('head'); '{display:none!important;}\n</style>').appendTo('head');
setTimeout(function() {$(menu).removeAttr('style');}, 0); setTimeout(function() {console.log($(menu)); $(menu).removeAttr('style');}, 0);
} }
function getMentionsForAutoComplete() { function getMentionsForAutoComplete() {
@ -2779,7 +2780,7 @@ function initInterfaceCommon() {
$('.post-favorite').on('click', favPopup); $('.post-favorite').on('click', favPopup);
$('.userMenu-config').clickoutside(closeThis.bind($('.config-menu'))); $('.userMenu-config').clickoutside(closeThis.bind($('.config-menu')));
$('.userMenu-config-dropdown').on('click', dropDownMenu); $('.userMenu-config-dropdown').on('click', dropDownMenu);
$('#post-template.module.post').on('click', function(event) { $('#post-template.module.post').on('click', function (event) {
if (event.button === 0 && window.getSelection() == 0) if (event.button === 0 && window.getSelection() == 0)
postExpandFunction(event, $(this)); postExpandFunction(event, $(this));
}) })
@ -2794,7 +2795,7 @@ function initInterfaceCommon() {
.closest('.post-data').find('.post-stats').hide() .closest('.post-data').find('.post-stats').hide()
; ;
$('.post-area-new') $('.post-area-new')
.on('click', function(e) {composeNewPost(e, $(this));}) .on('click', function (e) {composeNewPost(e, $(this));})
.clickoutside(unfocusPostAreaNew) .clickoutside(unfocusPostAreaNew)
.children('textarea') .children('textarea')
.on({ .on({
@ -2830,7 +2831,7 @@ function initInterfaceCommon() {
{feeder: '.latest-activity'}, handleClickOpenConversation); {feeder: '.latest-activity'}, handleClickOpenConversation);
replaceDashboards(); replaceDashboards();
$(window).resize(replaceDashboards); $(window).on('resize', replaceDashboards);
$('.profile-card .profile-bio .group-description') $('.profile-card .profile-bio .group-description')
.on('focus', function (event) { .on('focus', function (event) {
@ -2928,7 +2929,7 @@ function elemFitNextIntoParentHeight(elem) {
function inputEnterActivator(event) { function inputEnterActivator(event) {
var elemEvent = $(event.target); var elemEvent = $(event.target);
elemEvent.closest(event.data.parentSelector).find(event.data.enterSelector) elemEvent.closest(event.data.parentSelector).find(event.data.enterSelector)
.attr('disabled', elemEvent.val().trim() === ''); .prop('disabled', elemEvent.val().trim() === '');
} }
function pasteToTextarea(ta, p) { function pasteToTextarea(ta, p) {
@ -2947,7 +2948,7 @@ function pasteToTextarea(ta, p) {
} else } else
ta.val(p + ' '); ta.val(p + ' ');
ta.focus().caret(c + p.length + ((ta.val().length - s.length - p.length) > 1 ? 2 : 1)); ta.trigger('focus').caret(c + p.length + ((ta.val().length - s.length - p.length) > 1 ? 2 : 1));
} }
function setTextcompleteOnEventTarget(event) { function setTextcompleteOnEventTarget(event) {
@ -2984,7 +2985,7 @@ function setTextcompleteDropdownListPos(position) {
return this; return this;
} }
$(document).ready(function () { $(function () {
setupTimeGmtToText($.Options.locLang.val); setupTimeGmtToText($.Options.locLang.val);
if ($.localStorage.isSet('twistaURIs')) if ($.localStorage.isSet('twistaURIs'))
twister.URIs = $.localStorage.get('twistaURIs'); twister.URIs = $.localStorage.get('twistaURIs');

26
js/interface_home.js

@ -10,7 +10,7 @@ var InterfaceFunctions = function() {
//faço os binds no init //faço os binds no init
this.init = function() this.init = function()
{ {
$( ".wrapper .postboard-news").click(function() { $('.wrapper .postboard-news').on('click', function () {
var newPosts = parseInt($(".userMenu .menu-news").text()); var newPosts = parseInt($(".userMenu .menu-news").text());
if (!newPosts) if (!newPosts)
newPosts = postsPerRefresh; newPosts = postsPerRefresh;
@ -18,14 +18,14 @@ var InterfaceFunctions = function() {
}); });
// Add refresh posts for home link in menu // Add refresh posts for home link in menu
$( ".userMenu-home.current a").click(function() { $('.userMenu-home.current a').on('click', function () {
var newPosts = parseInt($(".userMenu .menu-news").text()); var newPosts = parseInt($(".userMenu .menu-news").text());
if (!newPosts) if (!newPosts)
newPosts = postsPerRefresh; newPosts = postsPerRefresh;
requestTimelineUpdate('pending',newPosts,followingUsers,promotedPostsOnly); requestTimelineUpdate('pending',newPosts,followingUsers,promotedPostsOnly);
}); });
$( ".promoted-posts-only").click(function() { $('.promoted-posts-only').on('click', function () {
promotedPostsOnly = !promotedPostsOnly; promotedPostsOnly = !promotedPostsOnly;
timelineChangedUser(); timelineChangedUser();
@ -51,13 +51,13 @@ var InterfaceFunctions = function() {
if (!defaultScreenName) { if (!defaultScreenName) {
$('.userMenu-profile > a').attr('href', '#/login').text(polyglot.t('Login')); $('.userMenu-profile > a').attr('href', '#/login').text(polyglot.t('Login'));
$(".post-area-new > textarea").attr("placeholder",polyglot.t("You have to log in to post messages.")); $(".post-area-new > textarea").attr("placeholder",polyglot.t("You have to log in to post messages."));
$(".post-area-new > textarea").attr("disabled","true"); $('.post-area-new > textarea').prop('disabled', true);
$miniProfile.find(".mini-profile-name").text("guest"); $miniProfile.find(".mini-profile-name").text("guest");
$miniProfile.find(".posts-count").text("0"); $miniProfile.find(".posts-count").text("0");
$miniProfile.find(".following-count").text("0"); $miniProfile.find(".following-count").text("0");
$miniProfile.find(".followers-count").text("0"); $miniProfile.find(".followers-count").text("0");
$(".dropdown-menu-following").attr("href","#"); $(".dropdown-menu-following").attr("href","#");
$(".dropdown-menu-following").bind("click", function() $('.dropdown-menu-following').on('click', function ()
{ alert(polyglot.t("You are not following anyone because you are not logged in."))} ); { alert(polyglot.t("You are not following anyone because you are not logged in."))} );
} else { } else {
$miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName)); $miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName));
@ -80,7 +80,7 @@ var InterfaceFunctions = function() {
requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly); requestTimelineUpdate("latestFirstTime",postsPerRefresh,followingUsers,promotedPostsOnly);
// install scrollbottom handler to load more posts as needed // install scrollbottom handler to load more posts as needed
$(window).scroll(function(){ $(window).on('scroll', function () {
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){ if ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){
if( timelineLoaded ) { if( timelineLoaded ) {
requestTimelineUpdate("older", postsPerRefresh, followingUsers, promotedPostsOnly); requestTimelineUpdate("older", postsPerRefresh, followingUsers, promotedPostsOnly);
@ -125,7 +125,7 @@ function initTopTrends() {
if ($tt.length) { if ($tt.length) {
var $ttRefresh = $tt.find('.refresh-toptrends'); var $ttRefresh = $tt.find('.refresh-toptrends');
$ttRefresh.on('click', updateTrendingHashtags); $ttRefresh.on('click', updateTrendingHashtags);
setTimeout(function() { $ttRefresh.click() }, 100); setTimeout(function (req) {req.trigger('click');}, 100, $ttRefresh);
} }
} }
@ -184,8 +184,8 @@ function initWhoToFollow() {
if (wtf.length) { if (wtf.length) {
var wtfRefresh = wtf.find('.refresh-users'); var wtfRefresh = wtf.find('.refresh-users');
wtfRefresh.on('click', refreshWhoToFollow); wtfRefresh.on('click', refreshWhoToFollow);
setTimeout(function() {wtfRefresh.click();}, 100); setTimeout(function (req) {req.trigger('click');}, 100, wtfRefresh);
//wtf.find('.view-all-users').on('click', function() {window.location.hash = '#whotofollow';}); //wtf.find('.view-all-users').on('click', function () {window.location.hash = '#whotofollow';});
} }
} }
@ -211,7 +211,7 @@ function initNewUsers() {
if (nus.length) { if (nus.length) {
var nusRefresh = nus.find('.refresh-users'); var nusRefresh = nus.find('.refresh-users');
nusRefresh.on('click', refreshNewUsers); nusRefresh.on('click', refreshNewUsers);
setTimeout(function() {nusRefresh.click();}, 100); setTimeout(function (req) {req.trigger('click');}, 100, nusRefresh);
} }
} }
@ -234,7 +234,7 @@ function initTwistdayReminder() {
if ($module.length) { if ($module.length) {
var $moduleRefresh = $module.find('.refresh'); var $moduleRefresh = $module.find('.refresh');
$moduleRefresh.on('click', refreshTwistdayReminder); $moduleRefresh.on('click', refreshTwistdayReminder);
setTimeout(function() { $moduleRefresh.click() }, 100); setTimeout(function (req) {req.trigger('click');}, 100, $moduleRefresh);
$module.find('.current').hide(); $module.find('.current').hide();
$module.find('.upcoming').hide(); $module.find('.upcoming').hide();
} }
@ -263,7 +263,7 @@ function refreshTwistdayReminder() {
item.find('.twister-user-name').attr('href', $.MAL.userUrl(lucky)); item.find('.twister-user-name').attr('href', $.MAL.userUrl(lucky));
item.find('.twister-user-tag').text('@' + lucky); item.find('.twister-user-tag').text('@' + lucky);
itemTwisterday = item.find('.twisterday'); itemTwisterday = item.find('.twisterday');
itemTwisterday.on('click', (function(e) {replyInitPopup(e, post);}).bind(post)); itemTwisterday.on('click', (function (e) {replyInitPopup(e, post);}).bind(post));
if (typeof time !== 'undefined') if (typeof time !== 'undefined')
itemTwisterday.text(timeGmtToText(time)); itemTwisterday.text(timeGmtToText(time));
else else
@ -431,4 +431,4 @@ function shortenMagnetLink(event,magnetLink) {
//******************* INIT ************** //******************* INIT **************
//*********************************************** //***********************************************
var interfaceFunctions = new InterfaceFunctions; var interfaceFunctions = new InterfaceFunctions;
$( document ).ready( interfaceFunctions.init ); $(interfaceFunctions.init);

4
js/interface_localization.js

@ -5628,8 +5628,8 @@ var fixedLabels = [
".ui-input-text" ".ui-input-text"
]; ];
$(document).ready(function(){ $(function () {
$(document).bind('pagecreate', function (){ $(document).on('pagecreate', function () {
var elems,content,i,e,LenElem,elem; var elems,content,i,e,LenElem,elem;
var LenLabels = fixedLabels.length; var LenLabels = fixedLabels.length;

4
js/interface_profile-edit.js

@ -15,7 +15,7 @@ function initProfileEdit() {
initInterfaceCommon(); initInterfaceCommon();
$('.profile-card-photo.forEdition').on('click', function() { $('#avatar-file').click(); }); $('.profile-card-photo.forEdition').on('click', function () {$('#avatar-file').trigger('click');});
$('#avatar-file').on('change', handleAvatarFileSelect); $('#avatar-file').on('change', handleAvatarFileSelect);
$('.submit-changes').on('click', saveProfile); $('.submit-changes').on('click', saveProfile);
$('.cancel-changes').on('click', $.MAL.goHome); $('.cancel-changes').on('click', $.MAL.goHome);
@ -116,4 +116,4 @@ function localizePlaceholders() {
$('.input-bitmessage').attr('placeholder', polyglot.t('Bitmessage address')); $('.input-bitmessage').attr('placeholder', polyglot.t('Bitmessage address'));
} }
$(document).ready(localizePlaceholders); $(localizePlaceholders);

4
js/jQueryPlugins.js

@ -32,10 +32,10 @@ var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d);});};j=function(){c.
jQuery.fn.clickoutside = function(callback) { jQuery.fn.clickoutside = function(callback) {
var outside = 1, self = $(this); var outside = 1, self = $(this);
self.cb = callback; self.cb = callback;
this.click(function() { this.on('click', function () {
outside = 0; outside = 0;
}); });
$(document).click(function() { $(document).on('click', function () {
outside && self.cb(); outside && self.cb();
outside = 1; outside = 1;
}); });

5
js/jquery-1.12.4.min.js vendored

File diff suppressed because one or more lines are too long

5
js/jquery-1.9.1.min.js vendored

File diff suppressed because one or more lines are too long

2
js/jquery-3.3.1.min.js vendored

File diff suppressed because one or more lines are too long

200
js/jquery.json-2.4.js

@ -1,200 +0,0 @@
/**
* jQuery JSON plugin 2.4.0
*
* @author Brantley Harris, 2009-2011
* @author Timo Tijhof, 2011-2012
* @source This plugin is heavily influenced by MochiKit's serializeJSON, which is
* copyrighted 2005 by Bob Ippolito.
* @source Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
* website's http://www.json.org/json2.js, which proclaims:
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
* I uphold.
* @license MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
(function ($) {
'use strict';
var escape = /["\\\x00-\x1f]/g,
meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
hasOwn = Object.prototype.hasOwnProperty;
/**
* jQuery.toJSON
* Converts the given argument into a JSON representation.
*
* @param o {Mixed} The json-serializable *thing* to be converted
*
* If an object has a toJSON prototype, that will be used to get the representation.
* Non-integer/string keys are skipped in the object, as are keys that point to a
* function.
*
*/
$.toJSON = typeof JSON === 'object' && JSON.stringify ? JSON.stringify : function (o) {
//$.toJSON = function (o) {
if (o === null) {
return 'null';
}
var pairs, k, name, val,
type = $.type(o);
if (type === 'undefined') {
return undefined;
}
// Also covers instantiated Number and Boolean objects,
// which are typeof 'object' but thanks to $.type, we
// catch them here. I don't know whether it is right
// or wrong that instantiated primitives are not
// exported to JSON as an {"object":..}.
// We choose this path because that's what the browsers did.
if (type === 'number' || type === 'boolean') {
return String(o);
}
if (type === 'string') {
return $.quoteString(o);
}
if (typeof o.toJSON === 'function') {
return $.toJSON(o.toJSON());
}
if (type === 'date') {
var month = o.getUTCMonth() + 1,
day = o.getUTCDate(),
year = o.getUTCFullYear(),
hours = o.getUTCHours(),
minutes = o.getUTCMinutes(),
seconds = o.getUTCSeconds(),
milli = o.getUTCMilliseconds();
if (month < 10) {
month = '0' + month;
}
if (day < 10) {
day = '0' + day;
}
if (hours < 10) {
hours = '0' + hours;
}
if (minutes < 10) {
minutes = '0' + minutes;
}
if (seconds < 10) {
seconds = '0' + seconds;
}
if (milli < 100) {
milli = '0' + milli;
}
if (milli < 10) {
milli = '0' + milli;
}
return '"' + year + '-' + month + '-' + day + 'T' +
hours + ':' + minutes + ':' + seconds +
'.' + milli + 'Z"';
}
pairs = [];
if ($.isArray(o)) {
for (k = 0; k < o.length; k++) {
pairs.push($.toJSON(o[k]) || 'null');
}
return '[' + pairs.join(',') + ']';
}
// Any other object (plain object, RegExp, ..)
// Need to do typeof instead of $.type, because we also
// want to catch non-plain objects.
if (typeof o === 'object') {
for (k in o) {
// Only include own properties,
// Filter out inherited prototypes
if (hasOwn.call(o, k)) {
// Keys must be numerical or string. Skip others
type = typeof k;
if (type === 'number') {
name = '"' + k + '"';
} else if (type === 'string') {
name = $.quoteString(k);
} else {
continue;
}
type = typeof o[k];
// Invalid values like these return undefined
// from toJSON, however those object members
// shouldn't be included in the JSON string at all.
if (type !== 'function' && type !== 'undefined') {
val = $.toJSON(o[k]);
pairs.push(name + ':' + val);
}
}
}
return '{' + pairs.join(',') + '}';
}
};
/**
* jQuery.evalJSON
* Evaluates a given json string.
*
* @param str {String}
*/
$.evalJSON = typeof JSON === 'object' && JSON.parse ? JSON.parse : function (str) {
/*jshint evil: true */
return eval('(' + str + ')');
};
/**
* jQuery.secureEvalJSON
* Evals JSON in a way that is *more* secure.
*
* @param str {String}
*/
$.secureEvalJSON = typeof JSON === 'object' && JSON.parse ? JSON.parse : function (str) {
var filtered =
str
.replace(/\\["\\\/bfnrtu]/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
if (/^[\],:{}\s]*$/.test(filtered)) {
/*jshint evil: true */
return eval('(' + str + ')');
}
throw new SyntaxError('Error parsing JSON, source is not valid.');
};
/**
* jQuery.quoteString
* Returns a string-repr of a string, escaping quotes intelligently.
* Mostly a support function for toJSON.
* Examples:
* >>> jQuery.quoteString('apple')
* "apple"
*
* >>> jQuery.quoteString('"Where are we going?", she asked.')
* "\"Where are we going?\", she asked."
*/
$.quoteString = function (str) {
if (str.match(escape)) {
return '"' + str.replace(escape, function (a) {
var c = meta[a];
if (typeof c === 'string') {
return c;
}
c = a.charCodeAt();
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
}) + '"';
}
return '"' + str + '"';
};
}(jQuery));

30
js/jquery.jsonrpcclient.js

@ -1,6 +1,5 @@
/** /**
* This plugin requires jquery.json.js to be available, or at least the methods $.toJSON and * This plugin requires JSON to be available
* $.parseJSON.
* *
* The plan is to make use of websockets if they are available, but work just as well with only * The plan is to make use of websockets if they are available, but work just as well with only
* http if not. * http if not.
@ -84,29 +83,32 @@
throw "$.JsonRpcClient.call used with no websocket and no http endpoint."; throw "$.JsonRpcClient.call used with no websocket and no http endpoint.";
} }
var options = this.options; var options = this.options;
$.ajax({ $.ajax({
type : 'POST', type : 'POST',
url : this.options.ajaxUrl, url : this.options.ajaxUrl,
data : $.toJSON(request), data : JSON.stringify(request),
dataType : 'json', dataType : 'json',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
cache : false, cache : false,
beforeSend: function (xhr) { beforeSend: function (xhr) {
if( options.username != null && options.username != undefined ) { if( options.username != null && options.username != undefined ) {
xhr.setRequestHeader('Authorization', "Basic " + btoa(options.username + ":" + options.password)); xhr.setRequestHeader('Authorization', "Basic " + btoa(options.username + ":" + options.password));
} }
}, },
success : function(data) { success : function(data) {
if ('error' in data) error_cb(data.error); if ('error' in data && data.error !== null) {
success_cb(data.result); errorCb(data.error);
} else {
success_cb(data.result);
}
}, },
// JSON-RPC Server could return non-200 on error // JSON-RPC Server could return non-200 on error
error : function(jqXHR, textStatus, errorThrown) { error : function(jqXHR, textStatus, errorThrown) {
try { try {
var response = $.parseJSON(jqXHR.responseText); var response = JSON.parse(jqXHR.responseText);
if ('console' in window) console.log(response); if ('console' in window) console.log(response);
error_cb(response.error); error_cb(response.error);
} }
@ -153,11 +155,11 @@
$.ajax({ $.ajax({
type : 'POST', type : 'POST',
url : this.options.ajaxUrl, url : this.options.ajaxUrl,
data : $.toJSON(request), data : JSON.stringify(request),
dataType : 'json', dataType : 'json',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
cache : false, cache : false,
beforeSend: function (xhr){ beforeSend: function (xhr){
if( options.username != null && options.username != undefined ) { if( options.username != null && options.username != undefined ) {
xhr.setRequestHeader('Authorization', "Basic " + btoa(options.username + ":" + options.password)); xhr.setRequestHeader('Authorization', "Basic " + btoa(options.username + ":" + options.password));
} }
@ -174,7 +176,7 @@
* *
* @fn batch * @fn batch
* @memberof $.JsonRpcClient * @memberof $.JsonRpcClient
* *
* @param callback The main function which will get a batch handler to run call and notify on. * @param callback The main function which will get a batch handler to run call and notify on.
* @param all_done_cb A callback function to call after all results have been handled. * @param all_done_cb A callback function to call after all results have been handled.
* @param error_cb A callback function to call if there is an error from the server. * @param error_cb A callback function to call if there is an error from the server.
@ -218,7 +220,7 @@
* @memberof $.JsonRpcClient * @memberof $.JsonRpcClient
*/ */
$.JsonRpcClient.prototype._wsCall = function(socket, request, success_cb, error_cb) { $.JsonRpcClient.prototype._wsCall = function(socket, request, success_cb, error_cb) {
var request_json = $.toJSON(request); var request_json = JSON.stringify(request);
if (socket.readyState < 1) { if (socket.readyState < 1) {
// The websocket is not open yet; we have to set sending of the message in onopen. // The websocket is not open yet; we have to set sending of the message in onopen.
@ -251,7 +253,7 @@
$.JsonRpcClient.prototype._wsOnMessage = function(event) { $.JsonRpcClient.prototype._wsOnMessage = function(event) {
// Check if this could be a JSON RPC message. // Check if this could be a JSON RPC message.
try { try {
var response = $.parseJSON(event.data); var response = JSON.parse(event.data);
/// @todo Make using the jsonrcp 2.0 check optional, to use this on JSON-RPC 1 backends. /// @todo Make using the jsonrcp 2.0 check optional, to use this on JSON-RPC 1 backends.
@ -395,7 +397,7 @@
// Send request // Send request
$.ajax({ $.ajax({
url : self.jsonrpcclient.options.ajaxUrl, url : self.jsonrpcclient.options.ajaxUrl,
data : $.toJSON(batch_request), data : JSON.stringify(batch_request),
dataType : 'json', dataType : 'json',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
cache : false, cache : false,

5
js/jquery.min.js vendored

File diff suppressed because one or more lines are too long

4
js/jquery.textcomplete.min.js vendored

File diff suppressed because one or more lines are too long

24
js/mobile_abstract.js

@ -8,10 +8,10 @@ var MAL = function()
{ {
this.postboardLoading = function() { this.postboardLoading = function() {
if( $.hasOwnProperty("mobile") ) { if( $.hasOwnProperty("mobile") ) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
/* /*
setTimeout(function(){ setTimeout(function(){
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
}, 10 * 1000); }, 10 * 1000);
*/ */
} else { } else {
@ -21,7 +21,7 @@ var MAL = function()
this.postboardLoaded = function() { this.postboardLoaded = function() {
if( $.hasOwnProperty("mobile") ) { if( $.hasOwnProperty("mobile") ) {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
var curPage = $.mobile.activePage.attr("id"); var curPage = $.mobile.activePage.attr("id");
$( '#'+curPage+' .content ul.posts').listview('refresh'); $( '#'+curPage+' .content ul.posts').listview('refresh');
@ -33,7 +33,7 @@ var MAL = function()
this.commonDMsListLoaded = function () { this.commonDMsListLoaded = function () {
if ($.hasOwnProperty('mobile')) { if ($.hasOwnProperty('mobile')) {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
$('#directmsg .direct-messages-list').listview('refresh'); $('#directmsg .direct-messages-list').listview('refresh');
} else { } else {
} }
@ -41,7 +41,7 @@ var MAL = function()
this.dmConversationLoaded = function (dmConvo) { this.dmConversationLoaded = function (dmConvo) {
if ($.hasOwnProperty('mobile')) { if ($.hasOwnProperty('mobile')) {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
$('#dmchat .direct-messages-thread').listview('refresh'); $('#dmchat .direct-messages-thread').listview('refresh');
$.mobile.silentScroll($('.dm-form').offset().top); $.mobile.silentScroll($('.dm-form').offset().top);
} else { } else {
@ -52,7 +52,7 @@ var MAL = function()
this.relatedPostLoaded = function() { this.relatedPostLoaded = function() {
if( $.hasOwnProperty("mobile") ) { if( $.hasOwnProperty("mobile") ) {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
var curPage = $.mobile.activePage.attr("id"); var curPage = $.mobile.activePage.attr("id");
$( '#'+curPage+' .content ul.posts').listview('refresh'); $( '#'+curPage+' .content ul.posts').listview('refresh');
} else { } else {
@ -75,7 +75,7 @@ var MAL = function()
this.listLoaded = function (list) { this.listLoaded = function (list) {
if ($.hasOwnProperty('mobile')) { if ($.hasOwnProperty('mobile')) {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
list.listview('refresh'); list.listview('refresh');
} else } else
list.find('.loading-roller').hide(); list.find('.loading-roller').hide();
@ -83,7 +83,7 @@ var MAL = function()
this.searchUserListLoaded = function() { this.searchUserListLoaded = function() {
if( $.hasOwnProperty("mobile") ) { if( $.hasOwnProperty("mobile") ) {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
$(".userMenu-search-profiles").listview('refresh'); $(".userMenu-search-profiles").listview('refresh');
} else { } else {
var $searchResultsModal = $( ".search-results" ); var $searchResultsModal = $( ".search-results" );
@ -405,7 +405,7 @@ var MAL = function()
$button.button("enable"); $button.button("enable");
} else { } else {
$button.removeClass("disabled"); $button.removeClass("disabled");
$button.removeAttr("disabled"); $button.prop('disabled', false);
} }
} }
@ -414,7 +414,7 @@ var MAL = function()
$button.button("disable"); $button.button("disable");
} else { } else {
$button.addClass("disabled"); $button.addClass("disabled");
$button.attr("disabled","true"); $button.prop('disabled', true);
} }
} }
@ -440,11 +440,11 @@ var MAL = function()
removeClose: true removeClose: true
}); });
modal.content.find('.confirm').attr('disabled', true); modal.content.find('.confirm').prop('disabled', true);
sendNewUserTransaction(peerAlias, sendNewUserTransaction(peerAlias,
function (accountCreatedModal) { function (accountCreatedModal) {
accountCreatedModal.content.find('.confirm').attr('disabled', false); accountCreatedModal.content.find('.confirm').prop('disabled', false);
}, modal }, modal
); );
} }

2
js/options.js

@ -199,7 +199,7 @@ function twisterOptions() {
name: 'useProxy', name: 'useProxy',
valDefault: 'disable', valDefault: 'disable',
tickMethod: function (elem) { tickMethod: function (elem) {
$('#useProxyForImgOnly').attr('disabled', (elem.value === 'disable') ? true : false); $('#useProxyForImgOnly').prop('disabled', elem.value === 'disable');
} }
}); });
this.add({ this.add({

82
js/tmobile.js

@ -11,13 +11,13 @@ function initializeTwister( redirectNetwork, redirectLogin, cbFunc, cbArg ) {
installUserSearchHandler(); installUserSearchHandler();
installProfileEditHandlers(); installProfileEditHandlers();
// install scrollbottom handler to load more posts as needed // install scrollbottom handler to load more posts as needed
$(window).scroll(function(){ $(window).on('scroll', function () {
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){ if ($(window).scrollTop() >= $(document).height() - $(window).height() - 20){
reachedScrollBottom(); reachedScrollBottom();
} }
}); });
// home screen timeline refresh button // home screen timeline refresh button
$( ".timeline-refresh").click(function(e) { $('.timeline-refresh').on('click', function (e) {
$.MAL.setPostTemplate( $("#post-template-home") ); $.MAL.setPostTemplate( $("#post-template-home") );
requestTimelineUpdate("latest",postsPerRefresh,followingUsers); requestTimelineUpdate("latest",postsPerRefresh,followingUsers);
$.mobile.silentScroll(0); $.mobile.silentScroll(0);
@ -90,16 +90,16 @@ var router=new $.mobile.Router(
{ "#new-user-modal": {handler: "newusermodal", events: "bs" } }, { "#new-user-modal": {handler: "newusermodal", events: "bs" } },
],{ ],{
index: function(type,match,ui) { index: function(type,match,ui) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
//$.MAL.goHome(); //$.MAL.goHome();
}); });
}, },
home: function(type,match,ui) { home: function(type,match,ui) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
if( !$("#home .posts").children().length ) { if( !$("#home .posts").children().length ) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
cleanupStorage(); cleanupStorage();
getFullname( defaultScreenName, $("#home .rtitle")); getFullname( defaultScreenName, $("#home .rtitle"));
$(".mentions-count").attr("href","#mentions?user="+defaultScreenName ); $(".mentions-count").attr("href","#mentions?user="+defaultScreenName );
@ -111,7 +111,7 @@ var router=new $.mobile.Router(
profile: function(type,match,ui) { profile: function(type,match,ui) {
var params=router.getParams(match[1]); var params=router.getParams(match[1]);
clearProfilePage(); clearProfilePage();
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
var user; var user;
if( params && params.hasOwnProperty("user") ) { if( params && params.hasOwnProperty("user") ) {
@ -126,13 +126,13 @@ var router=new $.mobile.Router(
$newmsgLink.hide(); $newmsgLink.hide();
} }
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$.MAL.setPostTemplate( $("#post-template-home") ); $.MAL.setPostTemplate( $("#post-template-home") );
updateProfileData( $("#profile"), user); updateProfileData( $("#profile"), user);
}); });
}, },
profileedit: function(type,match,ui) { profileedit: function(type,match,ui) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
loadAvatarForEdit(); loadAvatarForEdit();
loadProfileForEdit(); loadProfileForEdit();
@ -144,7 +144,7 @@ var router=new $.mobile.Router(
following: function(type,match,ui) { following: function(type,match,ui) {
var params=router.getParams(match[1]); var params=router.getParams(match[1]);
clearProfilePage(); clearProfilePage();
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
var user; var user;
if( params && params.hasOwnProperty("user") ) { if( params && params.hasOwnProperty("user") ) {
@ -158,7 +158,7 @@ var router=new $.mobile.Router(
if( params && params.hasOwnProperty("unfollow") ) { if( params && params.hasOwnProperty("unfollow") ) {
unfollow(params.unfollow); unfollow(params.unfollow);
} }
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$("#following a.ui-btn").removeClass("ui-btn-active"); $("#following a.ui-btn").removeClass("ui-btn-active");
var followingList = twister.tmpl.followingList.clone(true).appendTo($("#following .content")) var followingList = twister.tmpl.followingList.clone(true).appendTo($("#following .content"))
.closest('.following-list').listview(); .closest('.following-list').listview();
@ -172,7 +172,7 @@ var router=new $.mobile.Router(
var $ulPost = $("#post ul.posts"); var $ulPost = $("#post ul.posts");
$ulPost.text(""); $ulPost.text("");
$.MAL.setPostTemplate( $("#post-template-post") ); $.MAL.setPostTemplate( $("#post-template-post") );
var originalLi = postToElem($.evalJSON(params.userpost), "original"); var originalLi = postToElem(JSON.parse(params.userpost), 'original');
$ulPost.append(originalLi); $ulPost.append(originalLi);
$ulPost.find(".post-interactions").trigger('create'); $ulPost.find(".post-interactions").trigger('create');
$ulPost.listview('refresh'); $ulPost.listview('refresh');
@ -202,7 +202,7 @@ var router=new $.mobile.Router(
$replyOriginal.html(""); $replyOriginal.html("");
if( params && params.hasOwnProperty("userpost") ) { if( params && params.hasOwnProperty("userpost") ) {
$.MAL.setPostTemplate( $("#post-template-home") ); $.MAL.setPostTemplate( $("#post-template-home") );
var originalLi = postToElem($.evalJSON(params.userpost), "original"); var originalLi = postToElem(JSON.parse(params.userpost), 'original');
$replyOriginal.append(originalLi); $replyOriginal.append(originalLi);
$replyOriginal.listview('refresh'); $replyOriginal.listview('refresh');
} }
@ -216,7 +216,7 @@ var router=new $.mobile.Router(
var $rtOriginal = $(".rt-original-post") var $rtOriginal = $(".rt-original-post")
$rtOriginal.html(""); $rtOriginal.html("");
$.MAL.setPostTemplate( $("#post-template-home") ); $.MAL.setPostTemplate( $("#post-template-home") );
var originalLi = postToElem($.evalJSON(params.userpost), "original"); var originalLi = postToElem(JSON.parse(params.userpost), 'original');
$rtOriginal.append(originalLi); $rtOriginal.append(originalLi);
$rtOriginal.listview('refresh'); $rtOriginal.listview('refresh');
@ -225,7 +225,7 @@ var router=new $.mobile.Router(
}, },
mentions: function(type,match,ui) { mentions: function(type,match,ui) {
var params=router.getParams(match[1]); var params=router.getParams(match[1]);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
var user; var user;
var $newmsgLink = $("a.mention-newmsg"); var $newmsgLink = $("a.mention-newmsg");
@ -244,7 +244,7 @@ var router=new $.mobile.Router(
}, },
hashtag: function(type,match,ui) { hashtag: function(type,match,ui) {
var params=router.getParams(match[1]); var params=router.getParams(match[1]);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
$("#hashtag .rtitle").text("#" + params.hashtag); $("#hashtag .rtitle").text("#" + params.hashtag);
$("a.hashtag-newmsg").attr("href",$.MAL.newPostHashtagToUrl(params.hashtag)); $("a.hashtag-newmsg").attr("href",$.MAL.newPostHashtagToUrl(params.hashtag));
@ -255,31 +255,31 @@ var router=new $.mobile.Router(
login: function(type,match,ui) { login: function(type,match,ui) {
if (!$('#login .content').children().length) if (!$('#login .content').children().length)
$('#login .content').append(twister.tmpl.loginMC.clone(true)).trigger('create'); $('#login .content').append(twister.tmpl.loginMC.clone(true)).trigger('create');
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, false, function() { initializeTwister( true, false, function() {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
$("select.local-usernames").selectmenu("refresh", true); $("select.local-usernames").selectmenu("refresh", true);
}); });
}, },
network: function(type,match,ui) { network: function(type,match,ui) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( false, false, function() { initializeTwister( false, false, function() {
$.mobile.hidePageLoadingMsg(); $.mobile.loading('hide');
$("select.local-usernames.spam-user").selectmenu("refresh", true); $("select.local-usernames.spam-user").selectmenu("refresh", true);
getSpamMsg(); getSpamMsg();
getGenerate(); getGenerate();
}); });
}, },
directmsg: function(type,match,ui) { directmsg: function(type,match,ui) {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
modalDMsSummaryDraw($('#directmsg .direct-messages-list')); modalDMsSummaryDraw($('#directmsg .direct-messages-list'));
}); });
}, },
dmchat: function(type,match,ui) { dmchat: function(type,match,ui) {
var params=router.getParams(match[1]); var params=router.getParams(match[1]);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
initializeTwister( true, true, function() { initializeTwister( true, true, function() {
var peerAlias = params.user; var peerAlias = params.user;
var board = $('#dmchat .direct-messages-thread').empty(); var board = $('#dmchat .direct-messages-thread').empty();
@ -288,7 +288,7 @@ var router=new $.mobile.Router(
$("#dmchat textarea").val(""); $("#dmchat textarea").val("");
installDMSendClick(peerAlias); installDMSendClick(peerAlias);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
tmobileQueryReq = queryStart(board, peerAlias, 'direct', undefined, 2000, { tmobileQueryReq = queryStart(board, peerAlias, 'direct', undefined, 2000, {
boardAutoAppend: true, boardAutoAppend: true,
@ -333,29 +333,29 @@ var router=new $.mobile.Router(
function installPostboardClick() { function installPostboardClick() {
var $postDatas = $(".post-data"); var $postDatas = $(".post-data");
$postDatas.unbind('click').click(function(e){ $postDatas.off('click').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
var userpost = $(this).attr("data-userpost"); var userpost = $(this).attr("data-userpost");
var url = "#post?userpost=" + encodeURIComponent(userpost); var url = "#post?userpost=" + encodeURIComponent(userpost);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$.mobile.navigate( url ); $.mobile.navigate( url );
}); });
$(".post a").unbind('click').click(function(e) { $(".post a").off('click').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
// stopPropagation is supposed to be enough, but in Android the // stopPropagation is supposed to be enough, but in Android the
// default action is not called so we reimplement it here as a hack. // default action is not called so we reimplement it here as a hack.
e.preventDefault(); e.preventDefault();
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$.mobile.navigate( $(this).attr("href") ); $.mobile.navigate( $(this).attr("href") );
}); });
} }
function installReplyClick() { function installReplyClick() {
var $postReply = $("#post .post-reply"); var $postReply = $("#post .post-reply");
$postReply.unbind('click').click(function(e){ $postReply.off('click').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@ -364,21 +364,21 @@ function installReplyClick() {
var replyTo = $postData.attr("data-reply-to"); var replyTo = $postData.attr("data-reply-to");
var url = "#newmsg?replyto=" + encodeURIComponent(replyTo) + var url = "#newmsg?replyto=" + encodeURIComponent(replyTo) +
"&userpost=" + encodeURIComponent(userpost); "&userpost=" + encodeURIComponent(userpost);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$.mobile.navigate( url ); $.mobile.navigate( url );
}); });
} }
function installRetransmitClick() { function installRetransmitClick() {
var $postRt = $("#post .post-propagate"); var $postRt = $("#post .post-propagate");
$postRt.unbind('click').click(function(e){ $postRt.off('click').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
var $postData = $(this).closest(".post-data"); var $postData = $(this).closest(".post-data");
var userpost = $postData.attr("data-userpost"); var userpost = $postData.attr("data-userpost");
var url = "#rt?userpost=" + encodeURIComponent(userpost); var url = "#rt?userpost=" + encodeURIComponent(userpost);
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$.mobile.navigate( url ); $.mobile.navigate( url );
}); });
} }
@ -386,7 +386,7 @@ function installRetransmitClick() {
function installSubmitClick() { function installSubmitClick() {
var $postSubmit = $(".post-submit"); var $postSubmit = $(".post-submit");
$postSubmit.unbind('click').click(function(e){ $postSubmit.off('click').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@ -422,13 +422,13 @@ function installDMSendClick(peerAlias) {
function installRetransmitConfirmClick() { function installRetransmitConfirmClick() {
var $postConfirmRt = $(".retransmit-confirm"); var $postConfirmRt = $(".retransmit-confirm");
$postConfirmRt.unbind('click').click(function(e){ $postConfirmRt.off('click').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
var $postOrig = $("#rt .rt-original-post .post-data"); var $postOrig = $("#rt .rt-original-post .post-data");
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
newRtMsg($postOrig); newRtMsg($postOrig);
$.MAL.goHome(); $.MAL.goHome();
}); });
@ -445,13 +445,13 @@ function installUserSearchHandler() {
} }
function installProfileEditHandlers() { function installProfileEditHandlers() {
$(".profile-card-photo.forEdition").click( function() { $('#avatar-file').click(); } ); $('.profile-card-photo.forEdition').on('click', function () {$('#avatar-file').trigger('click');});
$("#avatar-file").bind( "change", handleAvatarFileSelectMobile); $('#avatar-file').on('change', handleAvatarFileSelectMobile);
$(".submit-changes").click( function() { $('.submit-changes').on('click', function () {
saveProfile(); saveProfile();
setTimeout( function() {$.MAL.goHome();}, 1000); setTimeout( function() {$.MAL.goHome();}, 1000);
} ); } );
$(".cancel-changes").click( $.mobile.back ); $('.cancel-changes').on('click', $.mobile.back);
} }
function handleAvatarFileSelectMobile(evt) { function handleAvatarFileSelectMobile(evt) {
@ -501,7 +501,7 @@ function handleClickOpenConversation(event) {
var userpost = $(event.target).closest(event.data.feeder).attr('data-userpost'); var userpost = $(event.target).closest(event.data.feeder).attr('data-userpost');
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
$.mobile.navigate('#post?userpost=' + encodeURIComponent(userpost)); $.mobile.navigate('#post?userpost=' + encodeURIComponent(userpost));
} }
@ -545,7 +545,7 @@ var tmobileQueryReq;
function setupHashtagOrMention(board, query, resource) { function setupHashtagOrMention(board, query, resource) {
$.MAL.setPostTemplate( $("#post-template-home") ); $.MAL.setPostTemplate( $("#post-template-home") );
$.mobile.showPageLoadingMsg(); $.mobile.loading('show');
board.empty(); board.empty();
tmobileQueryReq = queryStart(board, query, resource, undefined, undefined, { tmobileQueryReq = queryStart(board, query, resource, undefined, undefined, {
@ -578,7 +578,7 @@ function tmobileTick() {
} }
} }
$(document).bind('mobileinit', function () { $(document).on('mobileinit', function () {
$.mobile.allowCrossDomainPages = true; $.mobile.allowCrossDomainPages = true;
$.mobile.zoom.enabled = false; $.mobile.zoom.enabled = false;
$.mobile.buttonMarkup.hoverDelay = 0; //defaults 200 $.mobile.buttonMarkup.hoverDelay = 0; //defaults 200

12
js/twister_actions.js

@ -102,7 +102,7 @@ function getTopPostOfConversation(postLi, post, postboard) {
} }
requestRepliesAfterAll(newStreamPost); requestRepliesAfterAll(newStreamPost);
newStreamPost.find('.post-expand').remove(); newStreamPost.find('.post-expand').remove();
newStreamPost.unbind('click'); newStreamPost.off('click');
newStreamPost.hide(); newStreamPost.hide();
postboard.append(newStreamPost); postboard.append(newStreamPost);
newStreamPost.slideDown("fast"); newStreamPost.slideDown("fast");
@ -287,7 +287,7 @@ function requestPostRecursively(containerToAppend,username,resource,count,useGet
requestPostRecursively(args.containerToAppend, n, "post"+lastk, count-1); requestPostRecursively(args.containerToAppend, n, "post"+lastk, count-1);
} else { } else {
profilePostsLoading = false; profilePostsLoading = false;
args.containerToAppend.scroll(); args.containerToAppend.trigger('scroll');
} }
} else { } else {
profilePostsLoading = false; profilePostsLoading = false;
@ -413,7 +413,7 @@ function newRtMsg(userpost, sig_userpost, comment, cbFunc, cbReq) {
} }
function newFavMsg(postData, priv, msg) { function newFavMsg(postData, priv, msg) {
var userpost = $.evalJSON(postData.attr('data-content_to_rt')); var userpost = JSON.parse(postData.attr('data-content_to_rt'));
var sig_userpost = postData.attr('data-content_to_sigrt'); var sig_userpost = postData.attr('data-content_to_sigrt');
if (!sig_userpost) { if (!sig_userpost) {
@ -523,7 +523,7 @@ function updateProfileData(profileModalContent, username) {
function updateProfilePosts(postsView, username, useGetposts) { function updateProfilePosts(postsView, username, useGetposts) {
requestPostRecursively(postsView,username,"status",postsPerRefresh, useGetposts); requestPostRecursively(postsView,username,"status",postsPerRefresh, useGetposts);
postsView.scroll(function(){ postsView.on('scroll', function () {
if (!profilePostsLoading) { if (!profilePostsLoading) {
var $this = $(this); var $this = $(this);
if ($this.scrollTop() >= this.scrollHeight - $this.height() - 20) { if ($this.scrollTop() >= this.scrollHeight - $this.height() - 20) {
@ -686,7 +686,7 @@ function queryProcess(req, res) {
if (!twister.res[this.req].board || !focusModalWithElement(twister.res[this.req].board, if (!twister.res[this.req].board || !focusModalWithElement(twister.res[this.req].board,
function (req) { function (req) {
twister.res[req].board.closest('.postboard') twister.res[req].board.closest('.postboard')
.find('.postboard-news').click(); .find('.postboard-news').trigger('click');
}, },
this.req this.req
)) ))
@ -770,7 +770,7 @@ function queryProcess(req, res) {
focusModalWithElement(twister.res[this.req].board, focusModalWithElement(twister.res[this.req].board,
function (req) { function (req) {
twister.res[req].board.closest('.postboard') twister.res[req].board.closest('.postboard')
.find('.postboard-news').click(); .find('.postboard-news').trigger('click');
}, },
this.req this.req
); );

8
js/twister_directmsg.js

@ -125,7 +125,7 @@ function openDmWithUserModal(peerAlias) {
$('.dm-form-template').children().clone(true) $('.dm-form-template').children().clone(true)
.addClass('open').appendTo(modal.content).fadeIn('fast') .addClass('open').appendTo(modal.content).fadeIn('fast')
.find('textarea').focus(); .find('textarea').trigger('focus');
} }
function openGroupMessagesModal(groupAlias) { function openGroupMessagesModal(groupAlias) {
@ -193,7 +193,7 @@ function openGroupMessagesModal(groupAlias) {
$('.dm-form-template').children().clone(true) $('.dm-form-template').children().clone(true)
.addClass('open').appendTo(req.modal.content).fadeIn('fast') .addClass('open').appendTo(req.modal.content).fadeIn('fast')
.find('textarea').focus(); .find('textarea').trigger('focus');
} }
}, {groupAlias: groupAlias, modal: modal} }, {groupAlias: groupAlias, modal: modal}
); );
@ -259,7 +259,7 @@ function openGroupMessagesJoinGroupModal() {
.on('click', function (event) { .on('click', function (event) {
var elemEvent = $(event.target); var elemEvent = $(event.target);
elemEvent.closest('.module').find('.join') elemEvent.closest('.module').find('.join')
.attr('disabled', .prop('disabled',
!elemEvent.closest('.groups-list').find('input:checked').length); !elemEvent.closest('.groups-list').find('input:checked').length);
}) })
; ;
@ -442,7 +442,7 @@ function initInterfaceDirectMsg() {
$('.userMenu-groupmessages a').attr('href', '#groupmessages'); $('.userMenu-groupmessages a').attr('href', '#groupmessages');
$('.dm-submit').on('click', directMsgSubmit); $('.dm-submit').on('click', directMsgSubmit);
$('.direct-messages-with-user').on('click', function() { $('.direct-messages-with-user').on('click', function () {
window.location.hash = '#directmessages?user=' + window.location.hash = '#directmessages?user=' +
$(this).closest('[data-screen-name]').attr('data-screen-name'); $(this).closest('[data-screen-name]').attr('data-screen-name');
}); });

12
js/twister_formatpost.js

@ -7,7 +7,7 @@ var _htmlFormatMsgLinkTemplateExternal;
var _htmlFormatMsgLinkTemplateUser; var _htmlFormatMsgLinkTemplateUser;
var _htmlFormatMsgLinkTemplateHashtag; var _htmlFormatMsgLinkTemplateHashtag;
$(document).ready(function() { $(function () {
// we're setting it here for perfomance improvement purpose // we're setting it here for perfomance improvement purpose
// to not search and prepare it for for every post every time // to not search and prepare it for for every post every time
_htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template') _htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template')
@ -73,14 +73,14 @@ function postToElem(post, kind, promoted) {
k = userpost.k; k = userpost.k;
time = userpost.time; time = userpost.time;
msg = userpost.msg + (userpost.msg2 || ''); msg = userpost.msg + (userpost.msg2 || '');
content_to_rt = $.toJSON(userpost); content_to_rt = JSON.stringify(userpost);
content_to_sigrt = post.sig_userpost; content_to_sigrt = post.sig_userpost;
} else { } else {
username = rt.n; username = rt.n;
k = rt.k; k = rt.k;
time = rt.time; time = rt.time;
msg = rt.msg + (rt.msg2 || ''); msg = rt.msg + (rt.msg2 || '');
content_to_rt = $.toJSON(rt); content_to_rt = JSON.stringify(rt);
content_to_sigrt = userpost.sig_rt; content_to_sigrt = userpost.sig_rt;
} }
retweeted_by = userpost.n; retweeted_by = userpost.n;
@ -89,7 +89,7 @@ function postToElem(post, kind, promoted) {
k = userpost.k; k = userpost.k;
time = userpost.time; time = userpost.time;
msg = userpost.msg + (userpost.msg2 || ''); msg = userpost.msg + (userpost.msg2 || '');
content_to_rt = $.toJSON(userpost); content_to_rt = JSON.stringify(userpost);
content_to_sigrt = post.sig_userpost; content_to_sigrt = post.sig_userpost;
} }
if (typeof msg !== 'string') if (typeof msg !== 'string')
@ -111,7 +111,7 @@ function postToElem(post, kind, promoted) {
var postData = elem.find('.post-data'); var postData = elem.find('.post-data');
postData.addClass(kind) postData.addClass(kind)
.attr('data-userpost', $.toJSON(post)) .attr('data-userpost', JSON.stringify(post))
.attr('data-content_to_rt', content_to_rt) .attr('data-content_to_rt', content_to_rt)
.attr('data-content_to_sigrt', content_to_sigrt) .attr('data-content_to_sigrt', content_to_sigrt)
.attr('data-screen-name', username) .attr('data-screen-name', username)
@ -246,7 +246,7 @@ function setPostReference(elem, rt, sig_rt) {
.find('.post-rt-reference') .find('.post-rt-reference')
.attr('data-screen-name', rt.n) .attr('data-screen-name', rt.n)
.attr('data-id', rt.k) .attr('data-id', rt.k)
.attr('data-userpost', $.toJSON({userpost: rt, sig_userpost: sig_rt})) .attr('data-userpost', JSON.stringify({userpost: rt, sig_userpost: sig_rt}))
.find('.post-text').each(function (i, elem) {fillElemWithTxt($(elem), rt.msg + (rt.msg2 || ''));}) .find('.post-text').each(function (i, elem) {fillElemWithTxt($(elem), rt.msg + (rt.msg2 || ''));})
; ;
setPostCommon(elem, rt.n, rt.time); setPostCommon(elem, rt.n, rt.time);

2
js/twister_io.js

@ -13,7 +13,7 @@ function twisterRpc(method, params, resultFunc, resultArg, errorFunc, errorArg)
var foo = new $.JsonRpcClient({ajaxUrl: window.location.pathname.replace(/[^\/]*$/, '')}); var foo = new $.JsonRpcClient({ajaxUrl: window.location.pathname.replace(/[^\/]*$/, '')});
foo.call(method, params, foo.call(method, params,
function(ret) {resultFunc(resultArg, ret);}, function(ret) {resultFunc(resultArg, ret);},
function(ret) {if (ret != null) errorFunc(errorArg, ret);} // FIXME why only if "(ret != null)"? function(ret) {errorFunc(errorArg, ret);} // FIXME why only if "(ret != null)"?
); );
} }

13
js/twister_network.js

@ -286,7 +286,6 @@ function setSpamMsg(event) {
function exitDaemon() { function exitDaemon() {
$( ".terminate-daemon").text("Exiting..."); $( ".terminate-daemon").text("Exiting...");
$( ".terminate-daemon").addClass("disabled");
$.MAL.disableButton( $( ".terminate-daemon") ); $.MAL.disableButton( $( ".terminate-daemon") );
twisterRpc("stop", undefined, twisterRpc("stop", undefined,
@ -304,12 +303,12 @@ function exitDaemon() {
// handlers common to both desktop and mobile // handlers common to both desktop and mobile
function interfaceNetworkHandlers() { function interfaceNetworkHandlers() {
$( ".new-peer-addr" ).keyup( peerKeypress ); $('.new-peer-addr').on('keyup', peerKeypress);
$( ".new-dns-addr" ).keyup( dnsKeypress ); $('.new-dns-addr').on('keyup', dnsKeypress);
$( ".add-peer").bind( "click", addPeerClick ); $('.add-peer').on('click', addPeerClick);
$( ".add-dns").bind( "click", addDNSClick ); $('.add-dns').on('click', addDNSClick);
$( "select.genblock").change( setGenerate ); $('select.genblock').on('change', setGenerate);
$( ".genproclimit").change( setGenerate ); $('.genproclimit').on('change', setGenerate);
$('.network .post-area-new').off('click').on('click', $('.network .post-area-new').off('click').on('click',
function (e) {e.stopPropagation(); $(this).addClass('open'); usePostSpliting = false;}); function (e) {e.stopPropagation(); $(this).addClass('open'); usePostSpliting = false;});
$('.post-submit.update-spam-msg').off('click').on('click', setSpamMsg); $('.post-submit.update-spam-msg').off('click').on('click', setSpamMsg);

3
network.html

@ -4,9 +4,8 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>Network status</title> <title>Network status</title>
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/> <link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
<script src="js/jquery.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jQueryPlugins.js"></script> <script src="js/jQueryPlugins.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js"></script> <script src="js/options.js"></script>

3
options.html

@ -4,9 +4,8 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>Options</title> <title>Options</title>
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/> <link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"/>
<script src="js/jquery.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jQueryPlugins.js"></script> <script src="js/jQueryPlugins.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js"></script> <script src="js/options.js"></script>

3
profile-edit.html

@ -4,9 +4,8 @@
<title>Edit profile</title> <title>Edit profile</title>
<link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css"> <link id="stylecss" rel="stylesheet" href="css/style.css" type="text/css">
<link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css"> <link id="profilecss" rel="stylesheet" href="css/profile.css" type="text/css">
<script src="js/jquery.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jQueryPlugins.js"></script> <script src="js/jQueryPlugins.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js"></script> <script src="js/options.js"></script>

12
theme_nin/js/theme_option.js

@ -1,5 +1,4 @@
$(function(){ $(function () {
$('.modal-close').html(''); $('.modal-close').html('');
$('.modal-back').html(''); $('.modal-back').html('');
$('.twister-user-remove').html(''); $('.twister-user-remove').html('');
@ -10,13 +9,12 @@ $(function(){
$.globalEval(postToElem.toString().replace(/postContext.append\(twister\.tmpl\.postRtBy/, $.globalEval(postToElem.toString().replace(/postContext.append\(twister\.tmpl\.postRtBy/,
'postContext.prependTo(postContext.parent()).append(twister.tmpl.postRtBy')); 'postContext.prependTo(postContext.parent()).append(twister.tmpl.postRtBy'));
$('.userMenu-home.current a').on('click', function () {
$( '.userMenu-home.current a' ).on( 'click', function() {
$('html, body').animate({scrollTop:0},300); $('html, body').animate({scrollTop:0},300);
return false return false
}); });
$( ".promoted-posts-only").click(function() { $('.promoted-posts-only').on('click', function () {
// modify the way promoted posts are shown // modify the way promoted posts are shown
//active promoted posts tab //active promoted posts tab
$(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled"); $(this).children('.promoted-posts').addClass(promotedPostsOnly ? "active" : "disabled");
@ -28,7 +26,7 @@ $(function(){
$('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show"); $('#postboard-top').addClass(promotedPostsOnly ? "hide" : "show");
}); });
$(window).scroll((function(){ $(window).on('scroll', (function () {
if ($(document).scrollTop() >= 250) { if ($(document).scrollTop() >= 250) {
if (this.css('display') === 'none') if (this.css('display') === 'none')
this.slideDown(300); this.slideDown(300);
@ -49,7 +47,7 @@ $(function(){
; ;
if (/\/options.html$/i.test(document.location)) if (/\/options.html$/i.test(document.location))
$(document).ready(localizeLabels); localizeLabels();
}); });
function localizeLabels() { function localizeLabels() {

3
tmobile.html

@ -10,12 +10,11 @@
<meta name="viewport" content="width=device-width, user-scalable=no"/> <meta name="viewport" content="width=device-width, user-scalable=no"/>
<link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" /> <link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" />
<script src="js/jquery-1.9.1.min.js"></script> <script src="js/jquery-1.12.4.min.js"></script>
<script src="js/jquery.mobile.router.min.js"></script> <script src="js/jquery.mobile.router.min.js"></script>
<script src="js/jquery.mobile-1.3.2.min.js"></script> <script src="js/jquery.mobile-1.3.2.min.js"></script>
<script src="js/jQueryPlugins.js"></script> <script src="js/jQueryPlugins.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script src="js/jquery.jsonrpcclient.js"></script> <script src="js/jquery.jsonrpcclient.js"></script>
<script src="js/jquery.storageapi.js"></script> <script src="js/jquery.storageapi.js"></script>
<script src="js/options.js?vr=10"></script> <script src="js/options.js?vr=10"></script>

Loading…
Cancel
Save