mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-06 02:48:24 +02:00
Switch module t.js usage to Benchpress
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('alerts', ['translator', 'components'], function (translator, components) {
|
||||
define('alerts', ['translator', 'components', 'benchpress'], function (translator, components, Benchpress) {
|
||||
var module = {};
|
||||
|
||||
module.alert = function (params) {
|
||||
@@ -19,7 +19,7 @@ define('alerts', ['translator', 'components'], function (translator, components)
|
||||
};
|
||||
|
||||
function createNew(params) {
|
||||
templates.parse('alert', params, function (alertTpl) {
|
||||
Benchpress.parse('alert', params, function (alertTpl) {
|
||||
translator.translate(alertTpl, function (translatedHTML) {
|
||||
var alert = $('#' + params.alert_id);
|
||||
if (alert.length) {
|
||||
|
||||
@@ -10,7 +10,8 @@ define('chat', [
|
||||
'forum/chats/messages',
|
||||
'translator',
|
||||
'scrollStop',
|
||||
], function (components, taskbar, S, sounds, Chats, ChatsMessages, translator, scrollStop) {
|
||||
'benchpress',
|
||||
], function (components, taskbar, S, sounds, Chats, ChatsMessages, translator, scrollStop, Benchpress) {
|
||||
var module = {};
|
||||
var newMessage = false;
|
||||
|
||||
@@ -125,7 +126,7 @@ define('chat', [
|
||||
return room.teaser;
|
||||
});
|
||||
|
||||
templates.parse('partials/chats/dropdown', {
|
||||
Benchpress.parse('partials/chats/dropdown', {
|
||||
rooms: rooms,
|
||||
}, function (html) {
|
||||
translator.translate(html, function (translated) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('flags', [], function () {
|
||||
define('flags', ['benchpress'], function (Benchpress) {
|
||||
var Flag = {};
|
||||
var flagModal;
|
||||
var flagCommit;
|
||||
@@ -31,7 +31,7 @@ define('flags', [], function () {
|
||||
};
|
||||
|
||||
function parseModal(tplData, callback) {
|
||||
templates.parse('partials/modals/flag_modal', tplData, function (html) {
|
||||
Benchpress.parse('partials/modals/flag_modal', tplData, function (html) {
|
||||
require(['translator'], function (translator) {
|
||||
translator.translate(html, callback);
|
||||
});
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
define('helpers', ['benchpress', 'string'], function (Benchpress, string) {
|
||||
return factory(utils, Benchpress, string, config.relative_path);
|
||||
});
|
||||
} else {
|
||||
window.helpers = factory(utils, templates, window.String, config.relative_path);
|
||||
}
|
||||
}(function (utils, Benchpress, S, relative_path) {
|
||||
var helpers = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('iconSelect', function () {
|
||||
define('iconSelect', ['benchpress'], function (Benchpress) {
|
||||
var iconSelect = {};
|
||||
|
||||
iconSelect.init = function (el, onModified) {
|
||||
@@ -19,7 +19,7 @@ define('iconSelect', function () {
|
||||
}
|
||||
}
|
||||
|
||||
templates.parse('partials/fontawesome', {}, function (html) {
|
||||
Benchpress.parse('partials/fontawesome', {}, function (html) {
|
||||
html = $(html);
|
||||
html.find('.fa-icons').prepend($('<i class="fa fa-nbb-none"></i>'));
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('notifications', ['sounds', 'translator', 'components', 'navigator'], function (sounds, translator, components, navigator) {
|
||||
define('notifications', ['sounds', 'translator', 'components', 'navigator', 'benchpress'], function (sounds, translator, components, navigator, Benchpress) {
|
||||
var Notifications = {};
|
||||
|
||||
var unreadNotifs = {};
|
||||
@@ -143,7 +143,7 @@ define('notifications', ['sounds', 'translator', 'components', 'navigator'], fun
|
||||
}
|
||||
translator.toggleTimeagoShorthand();
|
||||
|
||||
templates.parse('partials/notifications_list', { notifications: notifs }, function (html) {
|
||||
Benchpress.parse('partials/notifications_list', { notifications: notifs }, function (html) {
|
||||
notifList.translateHtml(html);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('pictureCropper', ['translator', 'cropper'], function (translator, cropper) {
|
||||
define('pictureCropper', ['translator', 'cropper', 'benchpress'], function (translator, cropper, Benchpress) {
|
||||
var module = {};
|
||||
|
||||
module.show = function (data, callback) {
|
||||
@@ -32,7 +32,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
|
||||
module.handleImageCrop = function (data, callback) {
|
||||
$('#crop-picture-modal').remove();
|
||||
templates.parse('modals/crop_picture', {
|
||||
Benchpress.parse('modals/crop_picture', {
|
||||
url: data.url,
|
||||
}, function (cropperHtml) {
|
||||
translator.translate(cropperHtml, function (translated) {
|
||||
@@ -179,7 +179,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
}
|
||||
|
||||
function parseModal(tplVals, callback) {
|
||||
templates.parse('partials/modals/upload_file_modal', tplVals, function (html) {
|
||||
Benchpress.parse('partials/modals/upload_file_modal', tplVals, function (html) {
|
||||
translator.translate(html, callback);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('taskbar', function () {
|
||||
define('taskbar', ['benchpress'], function (Benchpress) {
|
||||
var taskbar = {};
|
||||
|
||||
taskbar.init = function () {
|
||||
var self = this;
|
||||
|
||||
templates.parse('modules/taskbar', {}, function (html) {
|
||||
Benchpress.parse('modules/taskbar', {}, function (html) {
|
||||
self.taskbar = $(html);
|
||||
self.tasklist = self.taskbar.find('ul');
|
||||
$(document.body).append(self.taskbar);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
define('uploader', ['translator'], function (translator) {
|
||||
define('uploader', ['translator', 'benchpress'], function (translator, Benchpress) {
|
||||
var module = {};
|
||||
|
||||
module.open = function (route, params, fileSize, callback) {
|
||||
@@ -102,7 +102,7 @@ define('uploader', ['translator'], function (translator) {
|
||||
}
|
||||
|
||||
function parseModal(tplVals, callback) {
|
||||
templates.parse('partials/modals/upload_file_modal', tplVals, function (html) {
|
||||
Benchpress.parse('partials/modals/upload_file_modal', tplVals, function (html) {
|
||||
translator.translate(html, callback);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user