|
|
@ -1,9 +1,9 @@
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable new-cap */
|
|
|
|
/* eslint-disable new-cap */
|
|
|
|
/* global __, Article, Ajax, Headlines, Filters, fox */
|
|
|
|
/* global __, Article, Headlines, Filters, fox */
|
|
|
|
/* global xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, $$, Feeds, Cookie */
|
|
|
|
/* global xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, Feeds, Cookie */
|
|
|
|
/* global CommonDialogs, Plugins, Effect */
|
|
|
|
/* global CommonDialogs, Plugins */
|
|
|
|
|
|
|
|
|
|
|
|
const App = {
|
|
|
|
const App = {
|
|
|
|
_initParams: [],
|
|
|
|
_initParams: [],
|
|
|
@ -234,7 +234,7 @@ const App = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
urlParam: function(name) {
|
|
|
|
urlParam: function(name) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
|
|
|
|
const results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.href);
|
|
|
|
return decodeURIComponent(results[1].replace(/\+/g, " ")) || 0;
|
|
|
|
return decodeURIComponent(results[1].replace(/\+/g, " ")) || 0;
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -439,8 +439,7 @@ const App = {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
parseRuntimeInfo: function(data) {
|
|
|
|
parseRuntimeInfo: function(data) {
|
|
|
|
for (const k in data) {
|
|
|
|
Object.keys(data).forEach((k) => {
|
|
|
|
if (data.hasOwnProperty(k)) {
|
|
|
|
|
|
|
|
const v = data[k];
|
|
|
|
const v = data[k];
|
|
|
|
|
|
|
|
|
|
|
|
console.log("RI:", k, "=>", v);
|
|
|
|
console.log("RI:", k, "=>", v);
|
|
|
@ -471,8 +470,7 @@ const App = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.setInitParam(k, v);
|
|
|
|
this.setInitParam(k, v);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
|
|
|
|
PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -500,8 +498,7 @@ const App = {
|
|
|
|
if (params) {
|
|
|
|
if (params) {
|
|
|
|
console.log('reading init-params...');
|
|
|
|
console.log('reading init-params...');
|
|
|
|
|
|
|
|
|
|
|
|
for (const k in params) {
|
|
|
|
Object.keys(params).forEach((k) => {
|
|
|
|
if (params.hasOwnProperty(k)) {
|
|
|
|
|
|
|
|
switch (k) {
|
|
|
|
switch (k) {
|
|
|
|
case "label_base_index":
|
|
|
|
case "label_base_index":
|
|
|
|
this.LABEL_BASE_INDEX = parseInt(params[k]);
|
|
|
|
this.LABEL_BASE_INDEX = parseInt(params[k]);
|
|
|
@ -517,12 +514,11 @@ const App = {
|
|
|
|
// i.e. *(191)|Ctrl-/ -> *(191)
|
|
|
|
// i.e. *(191)|Ctrl-/ -> *(191)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const tmp = [];
|
|
|
|
const tmp = [];
|
|
|
|
for (const sequence in params[k][1]) {
|
|
|
|
|
|
|
|
if (params[k][1].hasOwnProperty(sequence)) {
|
|
|
|
Object.keys(params[k][1]).forEach((sequence) => {
|
|
|
|
const filtered = sequence.replace(/\|.*$/, "");
|
|
|
|
const filtered = sequence.replace(/\|.*$/, "");
|
|
|
|
tmp[filtered] = params[k][1][sequence];
|
|
|
|
tmp[filtered] = params[k][1][sequence];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
params[k][1] = tmp;
|
|
|
|
params[k][1] = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -531,8 +527,7 @@ const App = {
|
|
|
|
|
|
|
|
|
|
|
|
console.log("IP:", k, "=>", params[k]);
|
|
|
|
console.log("IP:", k, "=>", params[k]);
|
|
|
|
this.setInitParam(k, params[k]);
|
|
|
|
this.setInitParam(k, params[k]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PluginHost might not be available on non-index pages
|
|
|
|
// PluginHost might not be available on non-index pages
|
|
|
|
if (typeof PluginHost !== 'undefined')
|
|
|
|
if (typeof PluginHost !== 'undefined')
|
|
|
|