~ps-jenkins/unity-webapps-amazon/latestsnapshot-2.4.16daily13.05.16-0ubuntu1

« back to all changes in this revision

Viewing changes to Amazon.user.js

  • Committer: Robert Bruce Park
  • Date: 2013-05-01 21:01:19 UTC
  • Revision ID: robert.park@canonical.com-20130501210119-lbai6hqsamj3ir1v
Insert a gettext placeholder.

This placeholder is a valid url-escaped JSON blob which can be
harmlessly parsed as-is, allowing the -common branch's test-runner.py
to download and test this file as-is, but during building of the
debian package this gets replaced with a translation table that allows
the script to display localized strings to the user.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
// @require        utils.js
4
4
// ==/UserScript==
5
5
 
 
6
// This placeholder gets munged with real data at build time.
 
7
const WebappsGettextDict = JSON.parse(unescape(
 
8
    "%7B%22GETTEXT%22%3A%22PLACEHOLDER%22%7D"
 
9
))
 
10
 
6
11
window.Unity = external.getUnityObject(1);
7
12
 
8
13
function unityLoaded() {
33
38
}
34
39
 
35
40
Unity.init({ name: "Amazon",
36
 
             domains: [ ['amazon.com', 'http://www.amazon.com/'],
37
 
                        ['amazon.co.uk', 'http://www.amazon.co.uk/'],
38
 
                        ['amazon.co.jp', 'http://www.amazon.co.jp/'],
39
 
                        ['amazon.ca', 'http://www.amazon.ca/'],
40
 
                        ['amazon.cn', 'http://www.amazon.cn/'],
41
 
                        ['amazon.fr', 'http://www.amazon.fr/'],
42
 
                        ['amazon.es', 'http://www.amazon.es/'],
43
 
                        ['amazon.it', 'http://www.amazon.it/'],
44
 
                        ['amazon.de', 'http://www.amazon.de/'] ],
 
41
             domains: [ ['amazon.com', 'http://www.amazon.com/'],
 
42
                        ['amazon.co.uk', 'http://www.amazon.co.uk/'],
 
43
                        ['amazon.co.jp', 'http://www.amazon.co.jp/'],
 
44
                        ['amazon.ca', 'http://www.amazon.ca/'],
 
45
                        ['amazon.cn', 'http://www.amazon.cn/'],
 
46
                        ['amazon.fr', 'http://www.amazon.fr/'],
 
47
                        ['amazon.es', 'http://www.amazon.es/'],
 
48
                        ['amazon.it', 'http://www.amazon.it/'],
 
49
                        ['amazon.de', 'http://www.amazon.de/'] ],
45
50
             iconUrl: "icon://amazon-store",
46
51
             onInit: wrapCallback(unityLoaded) });
47