Skip to content

Node.js based forum software built for the modern web

updating all templates.get to ajaxify.variables.get

psychobunny7217954078e5
diff --git a/public/src/forum/account.js b/public/src/forum/account.js
index 6738f1838a..9fbccf2bf7 100644
--- a/public/src/forum/account.js
+++ b/public/src/forum/account.js
@@ -4,9 +4,9 @@ define(['forum/accountheader'], function(header) {
Account.init = function() {
header.init();
- var yourid = templates.get('yourid'),
- theirid = templates.get('theirid'),
- isFollowing = templates.get('isFollowing');
+ var yourid = ajaxify.variables.get('yourid'),
+ theirid = ajaxify.variables.get('theirid'),
+ isFollowing = ajaxify.variables.get('isFollowing');
$(document).ready(function() {
var username = $('.account-username').html();
@@ -79,7 +79,7 @@ define(['forum/accountheader'], function(header) {
Account.handleUserOnline = function(err, data) {
var onlineStatus = $('.account-online-status');
- if(parseInt(templates.get('theirid'), 10) !== parseInt(data.uid, 10)) {
+ if(parseInt(ajaxify.variables.get('theirid'), 10) !== parseInt(data.uid, 10)) {
return;
}
diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js
index 2f14d37dc2..515e1d4047 100644
--- a/public/src/forum/accountedit.js
+++ b/public/src/forum/accountedit.js
@@ -6,8 +6,8 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
AccountEdit.init = function() {
header.init();
- gravatarPicture = templates.get('gravatarpicture');
- uploadedPicture = templates.get('uploadedpicture');
+ gravatarPicture = ajaxify.variables.get('gravatarpicture');
+ uploadedPicture = ajaxify.variables.get('uploadedpicture');
var selectedImageType = '';
@@ -117,7 +117,7 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
$('#uploadPictureBtn').on('click', function() {
$('#change-picture-modal').modal('hide');
- uploader.open(RELATIVE_PATH + '/user/uploadpicture', {uid: templates.get('theirid')}, config.maximumProfileImageSize, function(imageUrlOnServer) {
+ uploader.open(RELATIVE_PATH + '/user/uploadpicture', {uid: ajaxify.variables.get('theirid')}, config.maximumProfileImageSize, function(imageUrlOnServer) {
imageUrlOnServer = imageUrlOnServer + '?' + new Date().getTime();
$('#user-current-picture').attr('src', imageUrlOnServer);
@@ -193,7 +193,7 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
socket.emit('user.changePassword', {
'currentPassword': currentPassword.val(),
'newPassword': password.val(),
- 'uid': templates.get('theirid')
+ 'uid': ajaxify.variables.get('theirid')
}, function(err) {
currentPassword.val('');
@@ -219,7 +219,7 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
AccountEdit.changeUserPicture = function(type) {
var userData = {
type: type,
- uid: templates.get('theirid')
+ uid: ajaxify.variables.get('theirid')
};
socket.emit('user.changePicture', userData, function(err) {
diff --git a/public/src/forum/accountheader.js b/public/src/forum/accountheader.js
index e49c1eddac..96f73c9fe0 100644
--- a/public/src/forum/accountheader.js
+++ b/public/src/forum/accountheader.js
@@ -33,8 +33,8 @@ define(function() {
};
function hideLinks() {
- var yourid = templates.get('yourid'),
- theirid = templates.get('theirid');
+ var yourid = ajaxify.variables.get('yourid'),
+ theirid = ajaxify.variables.get('theirid');
var editLink = $('#editLink');
var settingsLink = $('#settingsLink');
diff --git a/public/src/forum/admin/groups.js b/public/src/forum/admin/groups.js
index 231c8628d8..31d52f7f2a 100644
--- a/public/src/forum/admin/groups.js
+++ b/public/src/forum/admin/groups.js
@@ -5,7 +5,7 @@ define(function() {
var Groups = {};
Groups.init = function() {
- var yourid = templates.get('yourid'),
+ var yourid = ajaxify.variables.get('yourid'),
createEl = $('#create'),
createModal = $('#create-modal'),
createSubmitBtn = $('#create-modal-go'),
diff --git a/public/src/forum/admin/users.js b/public/src/forum/admin/users.js
index 9c2af40ce5..3a9ff65e94 100644
--- a/public/src/forum/admin/users.js
+++ b/public/src/forum/admin/users.js
@@ -4,7 +4,7 @@ define(function() {
var Users = {};
Users.init = function() {
- var yourid = templates.get('yourid');
+ var yourid = ajaxify.variables.get('yourid');
function isUserAdmin(element) {
var parent = $(element).parents('.users-box');
diff --git a/public/src/forum/category.js b/public/src/forum/category.js
index d9035594b8..7ddb84fc1f 100644
--- a/public/src/forum/category.js
+++ b/public/src/forum/category.js
@@ -6,12 +6,12 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
loadingMoreTopics = false;
Category.init = function() {
- var cid = templates.get('category_id');
+ var cid = ajaxify.variables.get('category_id');
app.enterRoom('category_' + cid);
$('#twitter-share').on('click', function () {
- window.open('https://twitter.com/intent/tweet?url=' + encodeURIComponent(window.location.href) + '&text=' + encodeURIComponent(templates.get('category_name')), '_blank', 'width=550,height=420,scrollbars=no,status=no');
+ window.open('https://twitter.com/intent/tweet?url=' + encodeURIComponent(window.location.href) + '&text=' + encodeURIComponent(ajaxify.variables.get('category_name')), '_blank', 'width=550,height=420,scrollbars=no,status=no');
return false;
});
@@ -86,7 +86,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
$('#topics-container').empty();
loadingMoreTopics = false;
- Category.loadMoreTopics(templates.get('category_id'), index, function() {
+ Category.loadMoreTopics(ajaxify.variables.get('category_id'), index, function() {
Category.scrollToTopic(bookmark, clicked, 0);
});
});
@@ -115,7 +115,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}
if($('#topics-container li.category-item[data-tid="' + tid + '"]').length) {
- var cid = templates.get('category_id');
+ var cid = ajaxify.variables.get('category_id');
var scrollTo = $('#topics-container li.category-item[data-tid="' + tid + '"]');
if (cid && scrollTo.length) {
@@ -151,7 +151,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
offset = el.offset().top - $('#header-menu').offset().top + $('#header-menu').height();
}
- Category.loadMoreTopics(templates.get('category_id'), after, function() {
+ Category.loadMoreTopics(ajaxify.variables.get('category_id'), after, function() {
if(direction < 0 && el) {
Category.scrollToTopic(el.attr('data-tid'), null, 0, offset);
}
@@ -159,7 +159,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}
});
} else {
- pagination.init(templates.get('currentPage'), templates.get('pageCount'));
+ pagination.init(ajaxify.variables.get('currentPage'), ajaxify.variables.get('pageCount'));
}
}
@@ -202,7 +202,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
topic.hide().fadeIn('slow');
- socket.emit('categories.getPageCount', templates.get('category_id'), function(err, newPageCount) {
+ socket.emit('categories.getPageCount', ajaxify.variables.get('category_id'), function(err, newPageCount) {
pagination.recreatePaginationLinks(newPageCount);
});
diff --git a/public/src/forum/followers.js b/public/src/forum/followers.js
index ee955ff615..7916a67214 100644
--- a/public/src/forum/followers.js
+++ b/public/src/forum/followers.js
@@ -4,9 +4,9 @@ define(['forum/accountheader'], function(header) {
Followers.init = function() {
header.init();
- var yourid = templates.get('yourid'),
- theirid = templates.get('theirid'),
- followersCount = templates.get('followersCount');
+ var yourid = ajaxify.variables.get('yourid'),
+ theirid = ajaxify.variables.get('theirid'),
+ followersCount = ajaxify.variables.get('followersCount');
if (parseInt(followersCount, 10) === 0) {
diff --git a/public/src/forum/following.js b/public/src/forum/following.js
index f9f0e8eeb6..4bc23d1a5a 100644
--- a/public/src/forum/following.js
+++ b/public/src/forum/following.js
@@ -4,7 +4,7 @@ define(['forum/accountheader'], function(header) {
Following.init = function() {
header.init();
- var followingCount = templates.get('followingCount');
+ var followingCount = ajaxify.variables.get('followingCount');
if (parseInt(followingCount, 10) === 0) {
$('#no-following-notice').removeClass('hide');
diff --git a/public/src/forum/reset_code.js b/public/src/forum/reset_code.js
index 36af29de16..fc4c2ff704 100644
--- a/public/src/forum/reset_code.js
+++ b/public/src/forum/reset_code.js
@@ -2,7 +2,7 @@ define(function() {
var ResetCode = {};
ResetCode.init = function() {
- var reset_code = templates.get('reset_code');
+ var reset_code = ajaxify.variables.get('reset_code');
var resetEl = $('#reset'),
password = $('#password'),
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 473b874241..028e353ae6 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -24,16 +24,16 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
});
Topic.init = function() {
- var tid = templates.get('topic_id'),
+ var tid = ajaxify.variables.get('topic_id'),
thread_state = {
- locked: templates.get('locked'),
- deleted: templates.get('deleted'),
- pinned: templates.get('pinned')
+ locked: ajaxify.variables.get('locked'),
+ deleted: ajaxify.variables.get('deleted'),
+ pinned: ajaxify.variables.get('pinned')
},
- currentPage = parseInt(templates.get('currentPage'), 10),
- pageCount = parseInt(templates.get('pageCount'), 10);
+ currentPage = parseInt(ajaxify.variables.get('currentPage'), 10),
+ pageCount = parseInt(ajaxify.variables.get('pageCount'), 10);
- Topic.postCount = templates.get('postcount');
+ Topic.postCount = ajaxify.variables.get('postcount');
$(window).trigger('action:topic.loading');
@@ -228,7 +228,7 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
}
// Get users who are currently replying to the topic entered
- socket.emit('modules.composer.getUsersByTid', templates.get('topic_id'), function(err, uids) {
+ socket.emit('modules.composer.getUsersByTid', ajaxify.variables.get('topic_id'), function(err, uids) {
if (uids && uids.length) {
for(var x=0;x<uids.length;x++) {
activeEl.find('[data-uid="' + uids[x] + '"]').addClass('replying');
@@ -261,7 +261,7 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
});
socket.on('event:new_post', function(data) {
- if(data && data.posts && data.posts.length && data.posts[0].tid !== templates.get('topic_id')) {
+ if(data && data.posts && data.posts.length && data.posts[0].tid !== ajaxify.variables.get('topic_id')) {
return;
}
@@ -528,7 +528,7 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
});
if($(window).scrollTop() > 50) {
- $('.header-topic-title').find('span').text(templates.get('topic_name')).show();
+ $('.header-topic-title').find('span').text(ajaxify.variables.get('topic_name')).show();
} else {
$('.header-topic-title').find('span').text('').hide();
}
@@ -544,9 +544,9 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
updatePaginationTextAndProgressBar(index);
- var currentBookmark = localStorage.getItem('topic:' + templates.get('topic_id') + ':bookmark');
+ var currentBookmark = localStorage.getItem('topic:' + ajaxify.variables.get('topic_id') + ':bookmark');
if (!currentBookmark || parseInt(el.attr('data-pid'), 10) >= parseInt(currentBookmark, 10)) {
- localStorage.setItem('topic:' + templates.get('topic_id') + ':bookmark', el.attr('data-pid'));
+ localStorage.setItem('topic:' + ajaxify.variables.get('topic_id') + ':bookmark', el.attr('data-pid'));
app.removeAlert('bookmark');
}
@@ -666,7 +666,7 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
function onNewPostPagination(data) {
var posts = data.posts;
- socket.emit('topics.getPageCount', templates.get('topic_id'), function(err, newPageCount) {
+ socket.emit('topics.getPageCount', ajaxify.variables.get('topic_id'), function(err, newPageCount) {
pagination.recreatePaginationLinks(newPageCount);
@@ -721,8 +721,8 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
findInsertionPoint();
- data.title = templates.get('topic_name');
- data.viewcount = templates.get('viewcount');
+ data.title = ajaxify.variables.get('topic_name');
+ data.viewcount = ajaxify.variables.get('viewcount');
parseAndTranslatePosts(data, function(translatedHTML) {
var translated = $(translatedHTML);
@@ -777,7 +777,7 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
}
function updatePostCount() {
- socket.emit('topics.postcount', templates.get('topic_id'), function(err, postcount) {
+ socket.emit('topics.postcount', ajaxify.variables.get('topic_id'), function(err, postcount) {
if(!err) {
Topic.postCount = postcount;
$('#topic-post-count').html(Topic.postCount);
diff --git a/public/src/forum/topic/postTools.js b/public/src/forum/topic/postTools.js
index 66823ea656..4b355b2dbc 100644
--- a/public/src/forum/topic/postTools.js
+++ b/public/src/forum/topic/postTools.js
@@ -1,6 +1,6 @@
'use strict';
-/* globals define, app, translator, templates, socket, bootbox */
+/* globals define, app, translator, ajaxify, socket, bootbox */
define(['composer'], function(composer) {
@@ -8,7 +8,7 @@ define(['composer'], function(composer) {
topicName;
PostTools.init = function(tid, threadState) {
- topicName = templates.get('topic_name');
+ topicName = ajaxify.variables.get('topic_name');
addPostHandlers(tid, threadState);
diff --git a/public/src/forum/topic/threadTools.js b/public/src/forum/topic/threadTools.js
index 9dffc5bdde..46ca06e45d 100644
--- a/public/src/forum/topic/threadTools.js
+++ b/public/src/forum/topic/threadTools.js
@@ -1,6 +1,6 @@
'use strict';
-/* globals define, app, translator, templates, socket, bootbox */
+/* globals define, app, translator, ajaxify, socket, bootbox */
define(['forum/topic/fork', 'forum/topic/move'], function(fork, move) {
@@ -8,7 +8,7 @@ define(['forum/topic/fork', 'forum/topic/move'], function(fork, move) {
ThreadTools.init = function(tid, threadState) {
- if (templates.get('expose_tools') === '1') {
+ if (ajaxify.variables.get('expose_tools') === '1') {
$('.thread-tools').removeClass('hide');