tml-js-browser
Advanced tools
Comparing version 0.4.15 to 0.4.17
@@ -94,3 +94,10 @@ /** | ||
includeAgent: function(app, options, callback) { | ||
var agent_host = options.host || "https://cdn.translationexchange.com/tools/agent/" + options.version + "/agent.min.js"; | ||
var agent_host = options.host || "https://cdn.translationexchange.com/tools/agent/stable/agent.min.js"; | ||
if (options.cache) { | ||
var t = new Date().getTime(); | ||
t = t - (t % options.cache); | ||
agent_host += "?ts=" + t; | ||
} | ||
utils.addJS(window.document, 'tml-agent', agent_host, function() { | ||
@@ -97,0 +104,0 @@ Trex.init(app.key, options); |
@@ -143,26 +143,21 @@ /** | ||
options.agent = { | ||
enabled: true, | ||
version: "latest", | ||
type: "tools" | ||
type: 'agent', | ||
cache: 864000000 | ||
}; | ||
} | ||
if (options.agent.enabled) { | ||
if (options.agent.type == "agent") { | ||
helpers.includeAgent(tml.app, { | ||
host: options.agent.host, | ||
version: options.agent.version || "stable", | ||
domains: options.agent.domains || {}, | ||
locale: options.current_locale, | ||
source: options.current_source | ||
}, function () { | ||
if (callback) callback(); | ||
}); | ||
} else { | ||
helpers.includeTools(tml.app, options.current_locale, function () { | ||
if (callback) callback(); | ||
}); | ||
} | ||
if (options.agent.type == "agent") { | ||
helpers.includeAgent(tml.app, { | ||
host: options.agent.host, | ||
cache: options.agent.cache, | ||
domains: options.agent.domains || {}, | ||
locale: options.current_locale, | ||
source: options.current_source | ||
}, function () { | ||
if (callback) callback(); | ||
}); | ||
} else { | ||
if (callback) callback(); | ||
helpers.includeTools(tml.app, options.current_locale, function () { | ||
if (callback) callback(); | ||
}); | ||
} | ||
@@ -169,0 +164,0 @@ |
{ | ||
"name": "tml-js-browser", | ||
"description": "Translation plugin for browsers.", | ||
"version": "0.4.15", | ||
"version": "0.4.17", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Michael Berkovich", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
496065