mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
adding ES6 Promise shim for IE 10/11 and other old browsers
This commit is contained in:
parent
0781de61dc
commit
ed4a20634f
9
phpgwapi/js/es6-promise.min.js
vendored
Normal file
9
phpgwapi/js/es6-promise.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -12,7 +12,8 @@
|
||||
"use strict";
|
||||
|
||||
/*egw:uses
|
||||
egw_inheritance;
|
||||
egw_inheritance;
|
||||
/phpgwapi/js/es6-promise.min.js;
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -145,7 +146,7 @@ var AppJS = Class.extend(
|
||||
|
||||
// Highlights the favorite based on initial list state
|
||||
this.highlight_favorite();
|
||||
|
||||
|
||||
// Initialize egw tutorial sidebox
|
||||
this.egwTutorial_init();
|
||||
},
|
||||
@ -912,7 +913,7 @@ var AppJS = Class.extend(
|
||||
|
||||
/**
|
||||
* Get json data for videos from the given url
|
||||
*
|
||||
*
|
||||
* @return {Promise, object} return Promise, json object as resolved result and error message in case of failure
|
||||
*/
|
||||
egwTutorialGetData: function(){
|
||||
@ -926,23 +927,23 @@ var AppJS = Class.extend(
|
||||
}).sendRequest();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Create and Render etemplate2 for egroupware tutorial
|
||||
* sidebox option. The .xet file is stored in etemplate/templates/default/egw_tutorials
|
||||
*
|
||||
*
|
||||
* @description tutorials json object should have the following structure:
|
||||
* object:
|
||||
* {
|
||||
* [app name]:{
|
||||
* [language tag]:[
|
||||
* {src:"",thumbnail:"",title:"",desc:""}
|
||||
* {src:"",thumbnail:"",title:"",desc:""}
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
*
|
||||
*
|
||||
* *Note: "desc" and "title" are optional attributes, which "desc" would appears as tooltip for the video.
|
||||
*
|
||||
*
|
||||
* example:
|
||||
* {
|
||||
* "mail":{
|
||||
@ -962,18 +963,18 @@ var AppJS = Class.extend(
|
||||
//DOM container
|
||||
var div = document.getElementById('egw_tutorial_'+egw.app_name()+'_sidebox');
|
||||
if (!div) return;
|
||||
|
||||
|
||||
// et2 object
|
||||
var etemplate = new etemplate2 (div, false);
|
||||
var template = egw.webserverUrl+'/etemplate/templates/default/egw_tutorial.xet';
|
||||
|
||||
|
||||
this.egwTutorialGetData().then(function(_data){
|
||||
var lang = egw.preference('lang');
|
||||
var content = {content:{list:[]}};
|
||||
if (_data && _data[egw.app_name()])
|
||||
{
|
||||
if (!_data[egw.app_name()][lang]) lang = 'en';
|
||||
if (typeof _data[egw.app_name()][lang] !='undefined'
|
||||
if (typeof _data[egw.app_name()][lang] !='undefined'
|
||||
&& _data[egw.app_name()][lang].length > 0)
|
||||
{
|
||||
for (var i=0;i < _data[egw.app_name()][lang].length;i++)
|
||||
@ -982,7 +983,7 @@ var AppJS = Class.extend(
|
||||
_data[egw.app_name()][lang][i]['onclick'] = 'app.'+egw.app_name()+'.egwTutorialPopup("'+tuid+'")';
|
||||
}
|
||||
content.content.list = _data[egw.app_name()][lang];
|
||||
|
||||
|
||||
if (template.indexOf('.xet') >0)
|
||||
{
|
||||
etemplate.load ('',template , content, function(){});
|
||||
@ -992,13 +993,13 @@ var AppJS = Class.extend(
|
||||
etemplate.load (template, '', content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
function(_err){
|
||||
console.log(_err);
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Open popup to show given tutorial id
|
||||
* @param {string} _tuid tutorial object id
|
||||
|
Loading…
Reference in New Issue
Block a user