update i18next (fix #385)

Esse commit está contido em:
sualko
2016-11-03 17:19:58 +01:00
commit 16a0d0237f
11 arquivos alterados com 54 adições e 44 exclusões
+2
Ver Arquivo
@@ -20,3 +20,5 @@ dev/
/lib/strophe.js/
/lib/strophe.vcard/
/lib/emojione/
lib/i18next/
lib/jquery-i18next/
-3
Ver Arquivo
@@ -1,9 +1,6 @@
[submodule "lib/otr"]
path = lib/otr
url = https://github.com/sualko/otr.git
[submodule "lib/i18next"]
path = lib/i18next
url = https://github.com/i18next/i18next.git
[submodule "lib/bootstrap"]
path = lib/bootstrap
url = https://github.com/twbs/bootstrap-sass/
+1
Ver Arquivo
@@ -17,6 +17,7 @@
"t":true,
"i18n":true,
"I18next":true,
"i18next":true,
"OTR":true,
"DSA":true,
"Worker":true,
+1 -1
Ver Arquivo
@@ -26,7 +26,7 @@ module.exports = function(grunt) {
main: {
files: [{
expand: true,
src: ['lib/i18next/release/i18next-latest.min.js', 'lib/magnific-popup/dist/*.js', 'lib/favico.js/favico.js', 'lib/emojione/lib/js/*.js', 'lib/emojione/assets/svg/*.svg', 'lib/strophe.js/strophe.js', 'lib/strophe.x/*.js', 'lib/strophe.bookmarks/*.js', 'lib/strophe.vcard/*.js', 'lib/strophe.jinglejs/*-bundle.js', 'lib/otr/build/**', 'lib/otr/lib/dsa-webworker.js', 'lib/otr/lib/sm-webworker.js', 'lib/otr/lib/const.js', 'lib/otr/lib/helpers.js', 'lib/otr/lib/dsa.js', 'lib/otr/vendor/*.js', 'lib/*.js', 'LICENSE', 'img/**', 'sound/**'],
src: ['lib/i18next/i18next.min.js', 'lib/jquery-i18next/jquery-i18next.min.js', 'lib/magnific-popup/dist/*.js', 'lib/favico.js/favico.js', 'lib/emojione/lib/js/*.js', 'lib/emojione/assets/svg/*.svg', 'lib/strophe.js/strophe.js', 'lib/strophe.x/*.js', 'lib/strophe.bookmarks/*.js', 'lib/strophe.vcard/*.js', 'lib/strophe.jinglejs/*-bundle.js', 'lib/otr/build/**', 'lib/otr/lib/dsa-webworker.js', 'lib/otr/lib/sm-webworker.js', 'lib/otr/lib/const.js', 'lib/otr/lib/helpers.js', 'lib/otr/lib/dsa.js', 'lib/otr/vendor/*.js', 'lib/*.js', 'LICENSE', 'img/**', 'sound/**'],
dest: '<%= target %>/'
}, {
expand: true,
+3 -1
Ver Arquivo
@@ -30,6 +30,8 @@
"strophe.bookmarks": "https://raw.githubusercontent.com/sualko/strophejs-plugins/bookmarks/bookmarks/strophe.bookmarks.js",
"strophe.js": "strophejs#a11ebefa3db1b6712d51d0d309b9f68f8e391d1b",
"strophe.vcard": "https://raw.githubusercontent.com/strophe/strophejs-plugins/2f07137ad2cbeaed41650ee46373c2f44e0f263a/vcard/strophe.vcard.js",
"strophe.x": "https://raw.githubusercontent.com/strophe/strophejs-plugins/master/dataforms/src/strophe.x.js"
"strophe.x": "https://raw.githubusercontent.com/strophe/strophejs-plugins/master/dataforms/src/strophe.x.js",
"jquery-i18next": "^1.1.0",
"i18next": "^3.4.4"
}
}
+7 -1
Ver Arquivo
@@ -79,7 +79,13 @@
},
{
"name": "i18next",
"file": "lib/i18next/release/i18next-latest.min.js",
"file": "lib/i18next/i18next.min.js",
"license": "MIT",
"url": "http://i18next.com/"
},
{
"name": "jquery-i18next",
"file": "lib/jquery-i18next/jquery-i18next.min.js",
"license": "MIT",
"url": "http://i18next.com/"
},
Submodule lib/i18next deleted from e51cad3c82
+1 -1
Ver Arquivo
@@ -3092,7 +3092,7 @@ jsxc.gui.template.get = function(name, bid, msg) {
}
});
ret.i18n();
ret.localize();
return ret;
}
+9 -6
Ver Arquivo
@@ -250,15 +250,18 @@ jsxc = {
lang = jsxc.options.defaultLang;
}
// initialize i18n translator
$.i18n.init({
// initialize i18next translator
window.i18next.init({
lng: lang,
fallbackLng: 'en',
resStore: I18next,
// use localStorage and set expiration to a day
useLocalStorage: true,
localStorageExpirationTime: 60 * 60 * 24 * 1000,
resources: I18next,
debug: jsxc.storage.getItem('debug') === true
}, function() {
window.jqueryI18next.init(window.i18next, $, {
tName: 't',
i18nName: 'i18next',
handleName: 'localize',
});
});
if (jsxc.storage.getItem('debug') === true) {
+1 -1
Ver Arquivo
@@ -301,7 +301,7 @@ jsxc.muc = {
$(stanza).find('feature').each(function() {
var feature = $(this).attr('var');
if (feature !== '' && i18n.exists(feature)) {
if (feature !== '' && i18next.exists(feature)) {
var tr = $('<tr>');
$('<td>').text($.t(feature + '.keyword')).appendTo(tr);
$('<td>').text($.t(feature + '.description')).appendTo(tr);
+29 -29
Ver Arquivo
@@ -1,6 +1,6 @@
/**
* Handle XMPP stuff.
*
*
* @namespace jsxc.xmpp
*/
jsxc.xmpp = {
@@ -8,14 +8,14 @@ jsxc.xmpp = {
/**
* Create new connection or attach to old
*
*
* @name login
* @memberOf jsxc.xmpp
* @private
*/
/**
* Create new connection with given parameters.
*
*
* @name login^2
* @param {string} jid
* @param {string} password
@@ -24,7 +24,7 @@ jsxc.xmpp = {
*/
/**
* Attach connection with given parameters.
*
*
* @name login^3
* @param {string} jid
* @param {string} sid
@@ -176,7 +176,7 @@ jsxc.xmpp = {
/**
* Logs user out of his xmpp session and does some clean up.
*
*
* @param {boolean} complete If set to false, roster will not be removed
* @returns {Boolean}
*/
@@ -243,7 +243,7 @@ jsxc.xmpp = {
/**
* Triggered if connection is established
*
*
* @private
*/
connected: function() {
@@ -276,7 +276,7 @@ jsxc.xmpp = {
/**
* Triggered if connection is attached
*
*
* @private
*/
attached: function() {
@@ -417,7 +417,7 @@ jsxc.xmpp = {
/**
* Triggered if lost connection
*
*
* @private
*/
disconnected: function() {
@@ -460,7 +460,7 @@ jsxc.xmpp = {
/**
* Triggered on connection fault
*
*
* @param {String} condition information why we lost the connection
* @private
*/
@@ -474,7 +474,7 @@ jsxc.xmpp = {
/**
* Triggered on auth fail.
*
*
* @private
*/
onAuthFail: function() {
@@ -496,7 +496,7 @@ jsxc.xmpp = {
/**
* Triggered on initial roster load
*
*
* @param {dom} iq
* @private
*/
@@ -548,7 +548,7 @@ jsxc.xmpp = {
/**
* Triggerd on roster changes
*
*
* @param {dom} iq
* @returns {Boolean} True to preserve handler
* @private
@@ -623,19 +623,19 @@ jsxc.xmpp = {
/**
* Triggered on incoming presence stanzas
*
*
* @param {dom} presence
* @private
*/
onPresence: function(presence) {
/*
* <presence xmlns='jabber:client' type='unavailable' from='' to=''/>
*
*
* <presence xmlns='jabber:client' from='' to=''> <priority>5</priority>
* <c xmlns='http://jabber.org/protocol/caps'
* node='http://psi-im.org/caps' ver='caps-b75d8d2b25' ext='ca cs
* ep-notify-2 html'/> </presence>
*
*
* <presence xmlns='jabber:client' from='' to=''> <show>chat</show>
* <status></status> <priority>5</priority> <c
* xmlns='http://jabber.org/protocol/caps' node='http://psi-im.org/caps'
@@ -770,7 +770,7 @@ jsxc.xmpp = {
/**
* Triggered on incoming message stanzas
*
*
* @param {dom} presence
* @returns {Boolean}
* @private
@@ -908,7 +908,7 @@ jsxc.xmpp = {
/**
* Triggerd if the rid changed
*
*
* @param {integer} rid next valid request id
* @private
*/
@@ -918,7 +918,7 @@ jsxc.xmpp = {
/**
* response to friendship request
*
*
* @param {string} from jid from original friendship req
* @param {boolean} approve
*/
@@ -939,7 +939,7 @@ jsxc.xmpp = {
/**
* Add buddy to my friends
*
*
* @param {string} username jid
* @param {string} alias
*/
@@ -975,7 +975,7 @@ jsxc.xmpp = {
/**
* Remove buddy from my friends
*
*
* @param {type} jid
*/
removeBuddy: function(jid) {
@@ -1010,7 +1010,7 @@ jsxc.xmpp = {
/**
* Public function to send message.
*
*
* @memberOf jsxc.xmpp
* @param bid css jid of user
* @param msg message
@@ -1026,7 +1026,7 @@ jsxc.xmpp = {
/**
* Create message stanza and send it.
*
*
* @memberOf jsxc.xmpp
* @param jid Jabber id
* @param msg Message
@@ -1062,7 +1062,7 @@ jsxc.xmpp = {
/**
* This function loads a vcard.
*
*
* @memberOf jsxc.xmpp
* @param bid
* @param cb
@@ -1086,7 +1086,7 @@ jsxc.xmpp = {
/**
* Retrieves capabilities.
*
*
* @memberOf jsxc.xmpp
* @param jid
* @returns List of known capabilities
@@ -1108,7 +1108,7 @@ jsxc.xmpp = {
/**
* Test if jid has given features
*
*
* @param {string} jid Jabber id
* @param {string[]} feature Single feature or list of features
* @param {Function} cb Called with the result as first param.
@@ -1160,7 +1160,7 @@ jsxc.xmpp = {
/**
* Handle carbons (XEP-0280);
*
*
* @namespace jsxc.xmpp.carbons
*/
jsxc.xmpp.carbons = {
@@ -1168,7 +1168,7 @@ jsxc.xmpp.carbons = {
/**
* Enable carbons.
*
*
* @memberOf jsxc.xmpp.carbons
* @param cb callback
*/
@@ -1194,7 +1194,7 @@ jsxc.xmpp.carbons = {
/**
* Disable carbons.
*
*
* @memberOf jsxc.xmpp.carbons
* @param cb callback
*/
@@ -1220,7 +1220,7 @@ jsxc.xmpp.carbons = {
/**
* Enable/Disable carbons depending on options key.
*
*
* @memberOf jsxc.xmpp.carbons
* @param err error message
*/