/usr/share/ubiquity-slideshow/slides/link-core/base.js is in ubiquity-slideshow-ubuntukylin 113.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | /*
Additional Javascript for ubiquity-slideshow, global to all variations.
*/
/* FIXME: Replace this with a proper querystring deparam function (and update Ubiquity for new format) */
var INSTANCE_OPTIONS = {
'locale' : 'en'
};
(function() {
var hash = window.location.hash.split('#')[1] || '';
var parameters = hash.split(/\?|&/);
$.each(parameters, function(i, parameter) {
var hash = parameter.split('=');
var key = hash[0];
if (hash[1] !== undefined) {
var value = decodeURIComponent(
hash[1].replace(/\+/g, '%20')
);
} else {
var value = undefined;
}
INSTANCE_OPTIONS[key] = value;
});
})();
var Signals = new function() {
var handlers = {};
var register = function(signalName) {
if (! handlers[signalName]) {
handlers[signalName] = [];
}
}
this.fire = function(signalName, data) {
if (! handlers[signalName]) register(signalName);
$.each(handlers[signalName], function(index, callback) {
callback(data);
});
}
this.watch = function(signalName, handler) {
if (! handlers[signalName]) register(signalName);
var signalId = 0;
signalId = handlers[signalName].push(handler);
return signalId;
}
this.unwatch = function(signalName, handlerID) {
if (! handlers[signalName]) register(signalName);
handlers[signalName].splice(handlerID - 1, 1);
}
}
var parse_locale_code = function(locale) {
var data = {};
var modifier = locale.split('@', 1);
data['modifier'] = modifier[1];
var codeset = modifier[0].split('.', 1);
data['codeset'] = codeset[1];
var territory = codeset[0].split('_', 1);
data['territory'] = territory[1];
data['language'] = territory[0];
return data;
}
|