/** * eGroupWare - API * http://www.egroupware.org * * This file was originally created Tyamad, but their content is now completly removed! * It still contains some commonly used javascript functions, always included by EGroupware. * * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package api * @subpackage jsapi * @version $Id$ */ 'use strict'; import '../../../vendor/bower-asset/jquery/dist/jquery.js'; /** * Check whether the console object is defined - if not, define one */ if (typeof window.console == 'undefined') { window.console = { 'log': function() { }, 'warn': function() { }, 'error': function() { }, 'info': function() { } } } /** * Seperates all script tags from the given html code and returns the seperately * * @param object _html object that the html code * from which the script should be seperated * The html code has to be stored in _html.html, * the result js will be written to _html.js. */ window.egw_seperateJavaScript = function(_html) { var html = typeof _html.html == 'string'?_html.html:''; var in_pos = html.search(/ tag */ var js_str = html.substring(in_pos, out_pos+9); /*Remove the initial tag */ /*js_str = js_str.substring(js_str.search(/>/) + 1);*/ _html.js += js_str; html = html.substring(0, in_pos) + html.substring(out_pos + 9); var in_pos = html.search(/