pluotsorbet/config/urlparams.js

49 строки
1.0 KiB
JavaScript
Исходник Обычный вид История

2014-09-05 22:34:30 +04:00
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
/**
* The URL query parameters. One or more of the following:
*
* args (gets split from comma-separated list to Array)
2014-10-28 00:23:23 +03:00
* gamepad
* icc_mcc
* icc_mnc
* icc_msisdn
2014-09-05 22:34:30 +04:00
* jad
* jars
2014-09-09 06:17:08 +04:00
* logConsole
2014-09-08 19:10:25 +04:00
* logLevel
2014-09-05 22:34:30 +04:00
* main
* midletClassName
* network_mcc
* network_mnc
* platform
* autosize
* fontSize
2014-09-05 22:34:30 +04:00
*
* Keep this list up-to-date!
*/
(function() {
2014-09-05 22:34:30 +04:00
var params = {};
location.search.substring(1).split("&").forEach(function (param) {
param = param.split("=").map(function(v) {
return v.replace(/\+/g, " ");
}).map(decodeURIComponent);
params[param[0]] = param[1];
});
params.args = (params.args || "").split(",");
2014-09-05 22:34:30 +04:00
2015-01-22 02:19:35 +03:00
if ("midletClassName" in params) {
params.midletClassName = params.midletClassName.replace(/\//g, '.');
}
for (var name in params) {
config[name] = params[name];
}
2014-09-05 22:34:30 +04:00
})();