Fix the non-AMD case.
This commit is contained in:
parent
0a1a98d278
commit
31cb3d4b6e
16
Gruntfile.js
16
Gruntfile.js
|
@ -4,6 +4,7 @@ module.exports = function(grunt) {
|
|||
jst: {
|
||||
compile: {
|
||||
options: {
|
||||
namespace: 'templates',
|
||||
templateSettings: {
|
||||
evaluate : /\{\[([\s\S]+?)\]\}/g,
|
||||
interpolate : /\{\{([\s\S]+?)\}\}/g
|
||||
|
@ -20,6 +21,20 @@ module.exports = function(grunt) {
|
|||
}
|
||||
},
|
||||
|
||||
json: {
|
||||
main: {
|
||||
options: {
|
||||
namespace: 'locales',
|
||||
includePath: true,
|
||||
processName: function(filename) {
|
||||
return filename.toLowerCase().match(/^locale\/(.*)\/lc_messages/)[1];
|
||||
}
|
||||
},
|
||||
src: ['locale/**/LC_MESSAGES/*.json'],
|
||||
dest: 'builds/locales.js'
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {
|
||||
trailing: true
|
||||
|
@ -52,6 +67,7 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-jst');
|
||||
grunt.loadNpmTasks('grunt-json');
|
||||
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
||||
|
||||
grunt.registerTask('test', 'Run Tests', function () {
|
||||
|
|
11108
builds/locales.js
Normal file
11108
builds/locales.js
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
this["JST"] = this["JST"] || {};
|
||||
this["templates"] = this["templates"] || {};
|
||||
|
||||
this["JST"]["action"] = function(obj) {
|
||||
this["templates"]["action"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -20,7 +20,7 @@ __p += '<div class="chat-message ' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["add_contact_dropdown"] = function(obj) {
|
||||
this["templates"]["add_contact_dropdown"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -34,7 +34,7 @@ __p += '<dl class="add-converse-contact dropdown">\n <dt id="xmpp-contact-sea
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["add_contact_form"] = function(obj) {
|
||||
this["templates"]["add_contact_form"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -48,7 +48,7 @@ __p += '<li>\n <form class="add-xmpp-contact">\n <input type="text"\n
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["change_status_message"] = function(obj) {
|
||||
this["templates"]["change_status_message"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -64,7 +64,7 @@ __p += '<form id="set-custom-xmpp-status">\n <input type="text" class="custom
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chat_status"] = function(obj) {
|
||||
this["templates"]["chat_status"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -86,7 +86,7 @@ __p += '<div class="xmpp-status">\n <a class="choose-xmpp-status ' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chatarea"] = function(obj) {
|
||||
this["templates"]["chatarea"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -103,7 +103,7 @@ __p += '\n <textarea type="text" class="chat-textarea" \n plac
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chatbox"] = function(obj) {
|
||||
this["templates"]["chatbox"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -134,7 +134,7 @@ __p += '\n <textarea\n type="text"\n class="chat-te
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chatroom"] = function(obj) {
|
||||
this["templates"]["chatroom"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -153,7 +153,7 @@ __p += '>\n <div class="dragresize dragresize-tm"></div>\n <div class="cha
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chatroom_password_form"] = function(obj) {
|
||||
this["templates"]["chatroom_password_form"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -161,7 +161,7 @@ __p += '<div class="chatroom-form-container">\n <form class="chatroom-form">\
|
|||
((__t = (heading)) == null ? '' : __t) +
|
||||
'</legend>\n <label>' +
|
||||
((__t = (label_password)) == null ? '' : __t) +
|
||||
'<input type="password" name="password"/></label>\n <input type="submit" value="' +
|
||||
'</label>\n <input type="password" name="password"/>\n <input type="submit" value="' +
|
||||
((__t = (label_submit)) == null ? '' : __t) +
|
||||
'"/>\n </form>\n</div>\n';
|
||||
|
||||
|
@ -169,7 +169,7 @@ __p += '<div class="chatroom-form-container">\n <form class="chatroom-form">\
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chatroom_sidebar"] = function(obj) {
|
||||
this["templates"]["chatroom_sidebar"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -183,7 +183,7 @@ __p += '<!-- <div class="participants"> -->\n<form class="room-invite">\n <in
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chatrooms_tab"] = function(obj) {
|
||||
this["templates"]["chatrooms_tab"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -195,7 +195,7 @@ __p += '<li><a class="s" href="#chatrooms">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["chats_panel"] = function(obj) {
|
||||
this["templates"]["chats_panel"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -205,7 +205,7 @@ __p += '<div id="minimized-chats">\n <a id="toggle-minimized-chats" href="#">
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["choose_status"] = function(obj) {
|
||||
this["templates"]["choose_status"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -215,7 +215,7 @@ __p += '<dl id="target" class="dropdown">\n <dt id="fancy-xmpp-status-select"
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["contacts_panel"] = function(obj) {
|
||||
this["templates"]["contacts_panel"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -240,7 +240,7 @@ __p += '\n </select>\n </span>\n</form>\n';
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["contacts_tab"] = function(obj) {
|
||||
this["templates"]["contacts_tab"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -252,7 +252,7 @@ __p += '<li><a class="s current" href="#users">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["controlbox"] = function(obj) {
|
||||
this["templates"]["controlbox"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -264,7 +264,7 @@ __p += '<div class="box-flyout" style="height: ' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["controlbox_toggle"] = function(obj) {
|
||||
this["templates"]["controlbox_toggle"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -276,7 +276,7 @@ __p += '<span class="conn-feedback">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["field"] = function(obj) {
|
||||
this["templates"]["field"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -303,7 +303,7 @@ __p += '</field>\n';
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["form_captcha"] = function(obj) {
|
||||
this["templates"]["form_captcha"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -330,7 +330,7 @@ __p += ' >\n\n\n';
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["form_checkbox"] = function(obj) {
|
||||
this["templates"]["form_checkbox"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -348,7 +348,7 @@ __p += '<label>' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["form_input"] = function(obj) {
|
||||
this["templates"]["form_input"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -379,7 +379,7 @@ __p += ' >\n';
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["form_select"] = function(obj) {
|
||||
this["templates"]["form_select"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -400,7 +400,7 @@ __p += '>' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["form_textarea"] = function(obj) {
|
||||
this["templates"]["form_textarea"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -416,7 +416,7 @@ __p += '<label class="label-ta">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["form_username"] = function(obj) {
|
||||
this["templates"]["form_username"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -449,7 +449,7 @@ __p += ' />\n <span>' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["group_header"] = function(obj) {
|
||||
this["templates"]["group_header"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -465,7 +465,7 @@ __p += '<a href="#" class="group-toggle icon-' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["info"] = function(obj) {
|
||||
this["templates"]["info"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -477,7 +477,7 @@ __p += '<div class="chat-info">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["login_panel"] = function(obj) {
|
||||
this["templates"]["login_panel"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -493,7 +493,7 @@ __p += '<form id="converse-login" method="post">\n <label>' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["login_tab"] = function(obj) {
|
||||
this["templates"]["login_tab"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -505,7 +505,7 @@ __p += '<li><a class="current" href="#login-dialog">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["message"] = function(obj) {
|
||||
this["templates"]["message"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -525,7 +525,7 @@ __p += '<div class="chat-message ' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["new_day"] = function(obj) {
|
||||
this["templates"]["new_day"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -539,7 +539,7 @@ __p += '<time class="chat-date" datetime="' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["occupant"] = function(obj) {
|
||||
this["templates"]["occupant"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -572,11 +572,15 @@ __p += '\n>' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["pending_contact"] = function(obj) {
|
||||
this["templates"]["pending_contact"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
__p += '<span class="pending-contact-name">' +
|
||||
__p += '<span class="pending-contact-name" title="Name: ' +
|
||||
((__t = (fullname)) == null ? '' : __t) +
|
||||
'\nJID: ' +
|
||||
((__t = (jid)) == null ? '' : __t) +
|
||||
'">' +
|
||||
((__t = (fullname)) == null ? '' : __t) +
|
||||
'</span> <a class="remove-xmpp-contact icon-remove" title="' +
|
||||
((__t = (desc_remove)) == null ? '' : __t) +
|
||||
|
@ -586,7 +590,7 @@ __p += '<span class="pending-contact-name">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["pending_contacts"] = function(obj) {
|
||||
this["templates"]["pending_contacts"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -602,7 +606,7 @@ __p += '<dt id="pending-xmpp-contacts"><a href="#" class="group-toggle icon-' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["register_panel"] = function(obj) {
|
||||
this["templates"]["register_panel"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -624,7 +628,7 @@ __p += '<form id="converse-register">\n <span class="reg-feedback"></span>\n
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["register_tab"] = function(obj) {
|
||||
this["templates"]["register_tab"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -636,7 +640,7 @@ __p += '<li><a class="s" href="#register">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["registration_form"] = function(obj) {
|
||||
this["templates"]["registration_form"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -656,7 +660,7 @@ __p += '<p class="provider-title">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["registration_request"] = function(obj) {
|
||||
this["templates"]["registration_request"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -670,11 +674,15 @@ __p += '<span class="spinner login-submit"/>\n<p class="info">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["requesting_contact"] = function(obj) {
|
||||
this["templates"]["requesting_contact"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
__p += '<span class="req-contact-name">' +
|
||||
__p += '<span class="req-contact-name" title="Name: ' +
|
||||
((__t = (fullname)) == null ? '' : __t) +
|
||||
'\nJID: ' +
|
||||
((__t = (jid)) == null ? '' : __t) +
|
||||
'">' +
|
||||
((__t = (fullname)) == null ? '' : __t) +
|
||||
'</span>\n<span class="request-actions">\n <a class="accept-xmpp-request icon-checkmark" title="' +
|
||||
((__t = (desc_accept)) == null ? '' : __t) +
|
||||
|
@ -686,7 +694,7 @@ __p += '<span class="req-contact-name">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["requesting_contacts"] = function(obj) {
|
||||
this["templates"]["requesting_contacts"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -702,7 +710,7 @@ __p += '<dt id="xmpp-contact-requests"><a href="#" class="group-toggle icon-' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["room_description"] = function(obj) {
|
||||
this["templates"]["room_description"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -789,7 +797,7 @@ __p += '\n </ul>\n</p>\n</div>\n';
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["room_item"] = function(obj) {
|
||||
this["templates"]["room_item"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -809,15 +817,21 @@ __p += '<dd class="available-chatroom">\n<a class="open-room" data-room-jid="' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["room_panel"] = function(obj) {
|
||||
this["templates"]["room_panel"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
__p += '<form class="add-chatroom" action="" method="post">\n <input type="text" name="chatroom" class="new-chatroom-name"\n placeholder="' +
|
||||
__p += '<form class="add-chatroom" action="" method="post">\n <label>' +
|
||||
((__t = (label_room_name)) == null ? '' : __t) +
|
||||
'"/>\n <input type="text" name="nick" class="new-chatroom-nick"\n placeholder="' +
|
||||
'</label>\n <input type="text" name="chatroom" class="new-chatroom-name"\n placeholder="' +
|
||||
((__t = (label_room_name)) == null ? '' : __t) +
|
||||
'"/>\n <label>' +
|
||||
((__t = (label_nickname)) == null ? '' : __t) +
|
||||
'"/>\n <input type="' +
|
||||
'</label>\n <input type="text" name="nick" class="new-chatroom-nick"\n placeholder="' +
|
||||
((__t = (label_nickname)) == null ? '' : __t) +
|
||||
'"/>\n <label>' +
|
||||
((__t = (label_server)) == null ? '' : __t) +
|
||||
'</label>\n <input type="' +
|
||||
((__t = (server_input_type)) == null ? '' : __t) +
|
||||
'" name="server" class="new-chatroom-server"\n placeholder="' +
|
||||
((__t = (label_server)) == null ? '' : __t) +
|
||||
|
@ -831,27 +845,31 @@ __p += '<form class="add-chatroom" action="" method="post">\n <input type="te
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["roster"] = function(obj) {
|
||||
this["templates"]["roster"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
__p += '<input style="display: none;" class="roster-filter" placeholder="' +
|
||||
__p += '<span class="roster-filter-group">\n <input style="display: none;" class="roster-filter" placeholder="' +
|
||||
((__t = (placeholder)) == null ? '' : __t) +
|
||||
'">\n<select style="display: none;" class="filter-type">\n <option value="contacts">' +
|
||||
'">\n <select style="display: none;" class="filter-type">\n <option value="contacts">' +
|
||||
((__t = (label_contacts)) == null ? '' : __t) +
|
||||
'</option>\n <option value="groups">' +
|
||||
'</option>\n <option value="groups">' +
|
||||
((__t = (label_groups)) == null ? '' : __t) +
|
||||
'</option>\n</select>\n';
|
||||
'</option>\n </select>\n</span>\n';
|
||||
|
||||
}
|
||||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["roster_item"] = function(obj) {
|
||||
this["templates"]["roster_item"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
__p += '<a class="open-chat" title="' +
|
||||
__p += '<a class="open-chat" title="Name: ' +
|
||||
((__t = (fullname)) == null ? '' : __t) +
|
||||
'\nJID: ' +
|
||||
((__t = (jid)) == null ? '' : __t) +
|
||||
'\n' +
|
||||
((__t = (desc_chat)) == null ? '' : __t) +
|
||||
'" href="#"><span class="icon-' +
|
||||
((__t = (chat_status)) == null ? '' : __t) +
|
||||
|
@ -867,7 +885,7 @@ __p += '<a class="open-chat" title="' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["search_contact"] = function(obj) {
|
||||
this["templates"]["search_contact"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -881,7 +899,7 @@ __p += '<li>\n <form class="search-xmpp-contact">\n <input type="text"
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["select_option"] = function(obj) {
|
||||
this["templates"]["select_option"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -900,7 +918,7 @@ __p += ' >' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["status_option"] = function(obj) {
|
||||
this["templates"]["status_option"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape;
|
||||
with (obj) {
|
||||
|
@ -918,7 +936,7 @@ __p += '<li>\n <a href="#" class="' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["toggle_chats"] = function(obj) {
|
||||
this["templates"]["toggle_chats"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -939,7 +957,7 @@ __p += '\n href="#">' +
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["toolbar"] = function(obj) {
|
||||
this["templates"]["toolbar"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
@ -1022,7 +1040,7 @@ __p += '\n';
|
|||
return __p
|
||||
};
|
||||
|
||||
this["JST"]["trimmed_chat"] = function(obj) {
|
||||
this["templates"]["trimmed_chat"] = function(obj) {
|
||||
obj || (obj = {});
|
||||
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
}
|
||||
);
|
||||
} else {
|
||||
root.converse = factory(jQuery, _, OTR, DSA, JST, moment, utils);
|
||||
root.converse = factory(jQuery, _, OTR, DSA, templates, moment, utils);
|
||||
}
|
||||
}(this, function ($, _, OTR, DSA, templates, moment, utils) {
|
||||
// "use strict";
|
||||
|
@ -282,6 +282,8 @@
|
|||
// Allow only whitelisted configuration attributes to be overwritten
|
||||
_.extend(this, _.pick(settings, Object.keys(default_settings)));
|
||||
|
||||
this.jed = new Jed(this.i18n);
|
||||
|
||||
if (settings.visible_toolbar_buttons) {
|
||||
_.extend(
|
||||
this.visible_toolbar_buttons,
|
||||
|
|
1
dev.html
1
dev.html
|
@ -13,7 +13,6 @@
|
|||
<link type="text/css" rel="stylesheet" media="screen" href="components/fontawesome/css/font-awesome.min.css" />
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" />
|
||||
<script type="text/javascript" src="analytics.js"></script>
|
||||
<script data-main="main" src="components/requirejs/require.js"></script>
|
||||
</head>
|
||||
|
||||
|
|
|
@ -7,40 +7,6 @@
|
|||
|
||||
(function (root, factory) {
|
||||
define("locales", ['jquery', 'jed',
|
||||
'text!af',
|
||||
'text!de',
|
||||
'text!en',
|
||||
'text!es',
|
||||
'text!fr',
|
||||
'text!he',
|
||||
'text!hu',
|
||||
'text!id',
|
||||
'text!it',
|
||||
'text!ja',
|
||||
'text!nb',
|
||||
'text!nl',
|
||||
'text!pl',
|
||||
'text!pt_BR',
|
||||
'text!ru',
|
||||
'text!zh'
|
||||
], function ($, Jed, af, de, en, es, fr, he, hu, id, it, ja, nb, nl, pl, pt_BR, ru, zh) {
|
||||
root.locales = {
|
||||
'af': new Jed($.parseJSON(af)),
|
||||
'de': new Jed($.parseJSON(de)),
|
||||
'en': new Jed($.parseJSON(en)),
|
||||
'es': new Jed($.parseJSON(es)),
|
||||
'fr': new Jed($.parseJSON(fr)),
|
||||
'he': new Jed($.parseJSON(he)),
|
||||
'hu': new Jed($.parseJSON(hu)),
|
||||
'id': new Jed($.parseJSON(id)),
|
||||
'it': new Jed($.parseJSON(it)),
|
||||
'ja': new Jed($.parseJSON(ja)),
|
||||
'nb': new Jed($.parseJSON(nb)),
|
||||
'nl': new Jed($.parseJSON(nl)),
|
||||
'pl': new Jed($.parseJSON(pl)),
|
||||
'pt-br': new Jed($.parseJSON(pt_BR)),
|
||||
'ru': new Jed($.parseJSON(ru)),
|
||||
'zh': new Jed($.parseJSON(zh))
|
||||
};
|
||||
});
|
||||
})(this);
|
||||
|
|
186
non_amd.html
186
non_amd.html
|
@ -1,9 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Converse.js (Non-AMD Example)</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
|
||||
<meta name="description" content="Converse.js: Open Source Browser-Based Instant Messaging" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Converse.js: A free chat client for your website" />
|
||||
<meta name="author" content="JC Brand" />
|
||||
<link rel="shortcut icon" type="image/ico" href="css/images/favicon.ico"/>
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="components/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="components/fontawesome/css/font-awesome.min.css" />
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
|
||||
<link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" />
|
||||
|
||||
|
@ -26,175 +32,43 @@
|
|||
<script type="text/javascript" src="components/otr/build/dep/eventemitter.js"></script>
|
||||
<script type="text/javascript" src="src/otr.js"></script>
|
||||
<script type="text/javascript" src="components/strophe/strophe.js"></script>
|
||||
<script type="text/javascript" src="components/strophe.roster/index.js"></script>
|
||||
<script type="text/javascript" src="src/strophe.roster.js"></script>
|
||||
<script type="text/javascript" src="components/strophe.muc/index.js"></script>
|
||||
<script type="text/javascript" src="components/strophe.vcard/index.js"></script>
|
||||
<script type="text/javascript" src="components/strophe.disco/index.js"></script>
|
||||
<script type="text/javascript" src="components/strophejs-plugins/vcard/strophe.vcard.js"></script>
|
||||
<script type="text/javascript" src="components/strophejs-plugins/disco/strophe.disco.js"></script>
|
||||
<script type="text/javascript" src="components/underscore/underscore.js"></script>
|
||||
<script type="text/javascript" src="components/backbone//backbone.js"></script>
|
||||
<script type="text/javascript" src="components/backbone.browserStorage/backbone.browserStorage.js"></script>
|
||||
<script type="text/javascript" src="components/backbone.overview/backbone.overview.js"></script>
|
||||
<script type="text/javascript" src="components/momentjs/moment.js"></script>
|
||||
<script type="text/javascript" src="components/jquery.browser/dist/jquery.browser.js"></script>
|
||||
<script type="text/javascript" src="components/typeahead.js/dist/typeahead.jquery.js"></script>
|
||||
<script type="text/javascript" src="components/jquery.browser/index.js"></script>
|
||||
<script type="text/javascript" src="components/typeahead.js/index.js"></script>
|
||||
<script type="text/javascript" src="components/jed/jed.js"></script>
|
||||
<script type="text/javascript" src="locale/en/LC_MESSAGES/en.js"></script>
|
||||
<script type="text/javascript" src="builds/locales.js"></script>
|
||||
<script type="text/javascript" src="builds/templates.js"></script>
|
||||
<script type="text/javascript" src="src/utils.js"></script>
|
||||
<script type="text/javascript" src="converse.js"></script>
|
||||
<title>Converse.js</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- HEADER -->
|
||||
<div id="header_wrap" class="outer">
|
||||
<header class="inner">
|
||||
<a id="forkme_banner" href="https://github.com/jcbrand/converse.js">View on GitHub</a>
|
||||
<h1 id="project_title"><a href="http://conversejs.org">Converse.js</a></h1>
|
||||
<h2 id="project_tagline">Non-AMD Test Page</h2>
|
||||
<section id="downloads">
|
||||
<a class="zip_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.4.zip">Download the latest release as a .zip file</a>
|
||||
<a class="tar_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.4.tar.gz">Download the latest release as a tar.gz file</a>
|
||||
</section>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<!-- MAIN CONTENT -->
|
||||
<div id="main_content_wrap" class="outer">
|
||||
<section id="main_content" class="inner">
|
||||
|
||||
<p><strong>Converse.js</strong> is an open source, webchat client, that
|
||||
runs in the browser and can be integrated into any website.</p>
|
||||
|
||||
<p>It's similar to <a href="https://www.facebook.com/sitetour/chat.php" target="_blank">Facebook chat</a>, but also supports multi-user chatrooms.</p>
|
||||
|
||||
<p><em>Converse.js</em> can connect to any accessible <a href="http://xmpp.org" target="_blank">XMPP/Jabber</a> server, either from a public provider such as
|
||||
<a href="http://jabber.org">jabber.org</a>, or to one you have set up
|
||||
yourself.</a>
|
||||
|
||||
<p>It's possible to enable single-site login, whereby users already authenticated in your website will also automatically be logged in on the chat server,
|
||||
but you will have to pre-authenticate them on your server. You can refer to the <a href="/docs/html/index.html">documentation</a> for more
|
||||
info.</p>
|
||||
|
||||
<p>An <a href="http://github.com/collective/collective.xmpp.chat" target="_blank">add-on product</a> that does exactly this,
|
||||
already exists for the <a href="http://plone.org" target="_blank">Plone</a> CMS. Hopefully in the future more such add-ons will
|
||||
be created for other platforms.
|
||||
</p>
|
||||
|
||||
<p>If you have integrated <em>Converse.js</em> into any other CMS or framework,
|
||||
<a href="http://opkode.com/contact.html" target="_blank">please let me know</a> and I'll mention it on this page.</p>
|
||||
|
||||
<h2>Features</h2>
|
||||
<ul>
|
||||
<li>Single-user chat</li>
|
||||
<li>Multi-user chat in chatrooms (<a href="http://xmpp.org/extensions/xep-0045.html">XEP 45</a>)</li>
|
||||
<li>vCard support (<a href="http://xmpp.org/extensions/xep-0054.html">XEP 54</a>)</li>
|
||||
<li>Service discovery (<a href="http://xmpp.org/extensions/xep-0030.html">XEP 30</a>)</li>
|
||||
<li>Contact rosters</li>
|
||||
<li>Manually or automically subscribe to other contacts</li>
|
||||
<li>Accept or decline contact requests</li>
|
||||
<li>Roster item exchange (<a href="http://xmpp.org/extensions/tmp/xep-0144-1.1.html">XEP 144</a>)</li>
|
||||
<li>Chat statuses (online, busy, away, offline)</li>
|
||||
<li>Custom status messages</li>
|
||||
<li>Typing notifications</li>
|
||||
<li>Third person messages (/me )</li>
|
||||
<li>i18n aware</li>
|
||||
</ul>
|
||||
|
||||
<h2>Screencasts</h2>
|
||||
<ul>
|
||||
<li><a href="http://opkode.com/media/blog/instant-messaging-for-plone-with-javascript-and-xmpp" target="_blank">Screencast 1</a>:
|
||||
Integrated into a Plone site via <strong>collective.xmpp.chat</strong>.
|
||||
</li>
|
||||
<li><a href="http://opkode.com/media/blog/2013/04/02/converse.js-xmpp-instant-messaging-with-javascript" target="_blank">Screencast 2</a>:
|
||||
A static HTML page with <em>Converse.js</em>. Here we chat to external XMPP accounts on Jabber.org and Gmail.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Demo</h2>
|
||||
<p>You can log in with any existing XMPP account. There is also a list of public XMPP providers on <a href="http://xmpp.net" target="_blank">xmpp.net</a>.</p>
|
||||
<p><em><strong>Note:</strong> currently the demo doesn't work in Internet Explorer older
|
||||
than 10. This is due to lacking support for <a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a>,
|
||||
a standard which enables cross-domain XmlHttpRequests. There are ways
|
||||
around this, but it hasn't been a priority for me to implement them for
|
||||
this demo.
|
||||
</p>
|
||||
<p>
|
||||
See <a href="/docs/html/index.html#overcoming-cross-domain-request-restrictions" target="_blank">here</a> for more information.
|
||||
</p>
|
||||
</em>
|
||||
|
||||
<h3>Is it secure?</h3>
|
||||
<p>Yes. In this demo <em>Converse.js</em> makes an
|
||||
<a href="https://en.wikipedia.org/wiki/Secure_Sockets_Layer" target="_blank">SSL</a> encrypted connection to a secure connection manager.
|
||||
The connection manager then uses SSL and <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a> to connect to an XMPP server.</p>
|
||||
That said, the developers don't assume any liability for any loss or damages as a result of using this software or demo. Use this demo at your own risk.
|
||||
|
||||
<h3>Session support</h3>
|
||||
<p>
|
||||
The chat client will disconnect whenever you reload the page. If you
|
||||
want the user's session to persist across page reloads, you can
|
||||
establish an authenticated connection on the server side and then attach to
|
||||
this connection in your browser.
|
||||
</p>
|
||||
<p><em>Converse.js</em> already supports this usecase, but you'll have to do some integration work yourself.</p>
|
||||
|
||||
|
||||
<h2>Documentation</h2>
|
||||
<p>
|
||||
The documentation is still a bit sparse and a work in progress.
|
||||
Nevertheless, you can read what's already written <a href="/docs/html/index.html" target="_blank">here</a>.
|
||||
</p>
|
||||
|
||||
<h2>Tests</h2>
|
||||
<p>
|
||||
We use the <a href="http://pivotal.github.io/jasmine"
|
||||
target="_blank">Jasmine</a> testing framework to write tests.
|
||||
The tests can be run in the browser and can be viewed <a href="http://conversejs.org/tests.html" target="_blank">here</a>.
|
||||
</p>
|
||||
|
||||
<h2>Credits and Dependencies</h2>
|
||||
<p><strong>Converse.js</strong> depends on a few third party libraries, including:
|
||||
<ul>
|
||||
<li><a href="http://jquery.com" target="_blank">JQuery</a></li>
|
||||
<li><a href="http://strophe.im/strophejs" target="_blank">strophe.js</a></li>
|
||||
<li><a href="http://backbonejs.org" target="_blank">backbone.js</a></li>
|
||||
<li><a href="http://requirejs.org" target="_blank">require.js</a> (optional dependency)</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>Some images were taken from <a href="http://plone.org" target="_blank">Plone</a> and the
|
||||
<a href="http://openiconlibrary.sourceforge.net" target="_blank">Open Icon Library</a>.
|
||||
|
||||
<h2>Licence</h2>
|
||||
<p><strong>Converse.js</strong> is released under both the <a href="http://opensource.org/licenses/mit-license.php" target="_blank">MIT</a>
|
||||
and <a href="http://opensource.org/licenses/GPL-2.0" target="_blank">GPL</a> licenses.</p>
|
||||
|
||||
<h2>Contact</h2>
|
||||
<p>You can follow me on <strong><a href="http://twitter.com/jcopkode" target="_blank">Twitter</a></strong> and <strong><a href="http://identi.ca/opkode" target="_blank">Identica</a></strong></p>
|
||||
<p>My XMPP username is <strong>jc@opkode.im</strong>.</p>
|
||||
<p>Send me an email via this <a href="http://opkode.com/contact" target="_blank">contact form</a>.</p>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div id="footer_wrap" class="outer">
|
||||
<footer class="inner">
|
||||
<p class="copyright">Converse.js created by <a href="http://opkode.com" target="_blank">jcbrand</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<div id="conversejs"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-2128260-8"); pageTracker._trackPageview(); } catch(err) {}</script>
|
||||
<body id="page-top" data-spy="scroll" data-target=".navbar-custom">
|
||||
<section class="intro">
|
||||
<div class="intro-body">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<h1 class="brand-heading"><i class="icon-conversejs"></i>Converse.js</h1>
|
||||
<p class="intro-text">Example page without require.js and AMD module loading.</p>
|
||||
<div class="page-scroll">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
converse.initialize({
|
||||
bosh_service_url: 'https://bind.conversejs.org', // Please use this connection manager only for testing purposes
|
||||
bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
|
||||
i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
|
||||
prebind: false,
|
||||
show_controlbox_by_default: true,
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"po2json": "^0.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"grunt-json": "^0.1.3",
|
||||
"requirejs": "~2.1.11"
|
||||
}
|
||||
}
|
||||
|
|
35
src/utils.js
35
src/utils.js
|
@ -1,4 +1,10 @@
|
|||
define(["jquery", "converse-templates"], function ($, templates) {
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(["jquery", "converse-templates", "locales"], factory);
|
||||
} else {
|
||||
root.utils = factory(jQuery, templates);
|
||||
}
|
||||
}(this, function ($, templates) {
|
||||
"use strict";
|
||||
|
||||
var XFORM_TYPE_MAP = {
|
||||
|
@ -49,10 +55,13 @@ define(["jquery", "converse-templates"], function ($, templates) {
|
|||
// ---------------------
|
||||
__: function (str) {
|
||||
// Translation factory
|
||||
if (this.i18n === undefined) {
|
||||
if (typeof this.i18n === "undefined") {
|
||||
this.i18n = locales.en;
|
||||
}
|
||||
var t = this.i18n.translate(str);
|
||||
if (typeof this.jed === "undefined") {
|
||||
this.jed = new Jed(this.i18n);
|
||||
}
|
||||
var t = this.jed.translate(str);
|
||||
if (arguments.length>1) {
|
||||
return t.fetch.apply(t, [].slice.call(arguments,1));
|
||||
} else {
|
||||
|
@ -73,10 +82,10 @@ define(["jquery", "converse-templates"], function ($, templates) {
|
|||
|
||||
webForm2xForm: function (field) {
|
||||
/* Takes an HTML DOM and turns it into an XForm field.
|
||||
*
|
||||
* Parameters:
|
||||
* (DOMElement) field - the field to convert
|
||||
*/
|
||||
*
|
||||
* Parameters:
|
||||
* (DOMElement) field - the field to convert
|
||||
*/
|
||||
var $input = $(field), value;
|
||||
if ($input.is('[type=checkbox]')) {
|
||||
value = $input.is(':checked') && 1 || 0;
|
||||
|
@ -100,11 +109,11 @@ define(["jquery", "converse-templates"], function ($, templates) {
|
|||
|
||||
xForm2webForm: function ($field, $stanza) {
|
||||
/* Takes a field in XMPP XForm (XEP-004: Data Forms) format
|
||||
* and turns it into a HTML DOM field.
|
||||
*
|
||||
* Parameters:
|
||||
* (XMLElement) field - the field to convert
|
||||
*/
|
||||
* and turns it into a HTML DOM field.
|
||||
*
|
||||
* Parameters:
|
||||
* (XMLElement) field - the field to convert
|
||||
*/
|
||||
|
||||
// FIXME: take <required> into consideration
|
||||
var options = [], j, $options, $values, value, values;
|
||||
|
@ -186,4 +195,4 @@ define(["jquery", "converse-templates"], function ($, templates) {
|
|||
}
|
||||
};
|
||||
return utils;
|
||||
});
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue
Block a user