mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
feature(config) add online
This commit is contained in:
parent
75c7b2849b
commit
9412071926
3 changed files with 30 additions and 19 deletions
|
|
@ -155,6 +155,7 @@ All main configuration could be done via [config.json](json/config.json "Config"
|
|||
"html" : true,
|
||||
"img" : false
|
||||
},
|
||||
"online" : true, /* load js files from cdn or local path */
|
||||
"cache" : true,
|
||||
"logs" : false, /* logs or console ouput */
|
||||
"show_keys_panel" : true, /* show classic panel with buttons of keys */
|
||||
|
|
|
|||
|
|
@ -1053,26 +1053,33 @@ var CloudCmd, Util, DOM, CloudFunc;
|
|||
* @param pCallBack
|
||||
*/
|
||||
this.jqueryLoad = function(pCallBack) {
|
||||
Loader.jquery({
|
||||
onload: pCallBack,
|
||||
CloudCmd.getConfig(function(config) {
|
||||
var online = config.online;
|
||||
|
||||
onerror: function() {
|
||||
Loader.jsload('/lib/client/jquery.js', {
|
||||
onload: pCallBack
|
||||
Util.ifExec(!online,
|
||||
function() {
|
||||
Loader.jsload('/lib/client/jquery.js', {
|
||||
onload: pCallBack
|
||||
});
|
||||
|
||||
/* if could not load jquery from google server
|
||||
* maybe we offline, load font from local
|
||||
* directory */
|
||||
Loader.cssSet({
|
||||
id :'local-droids-font',
|
||||
element : document.head,
|
||||
inner : '@font-face {font-family: "Droid Sans Mono";' +
|
||||
'font-style: normal;font-weight: normal;' +
|
||||
'src: local("Droid Sans Mono"), local("DroidSansMono"),'+
|
||||
' url("/font/DroidSansMono.woff") format("woff");}'
|
||||
});
|
||||
},
|
||||
function(callback) {
|
||||
Loader.jquery({
|
||||
onload: pCallBack,
|
||||
onerror: callback
|
||||
});
|
||||
});
|
||||
|
||||
/* if could not load jquery from google server
|
||||
* maybe we offline, load font from local
|
||||
* directory */
|
||||
Loader.cssSet({
|
||||
id :'local-droids-font',
|
||||
element : document.head,
|
||||
inner : '@font-face {font-family: "Droid Sans Mono";' +
|
||||
'font-style: normal;font-weight: normal;' +
|
||||
'src: local("Droid Sans Mono"), local("DroidSansMono"),'+
|
||||
' url("/font/DroidSansMono.woff") format("woff");}'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ var Util, DOM, CloudCmd;
|
|||
|
||||
this.analytics = function() {
|
||||
getConfig(function(config) {
|
||||
if (config.analytics) {
|
||||
var analytics = config.analytics,
|
||||
online = config.online;
|
||||
|
||||
if (analytics && online) {
|
||||
Events.addOneTime('mousemove', function(){
|
||||
var FIVE_SECONDS = 5000,
|
||||
lUrl = CloudCmd.LIBDIRCLIENT + 'analytics.js';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue