X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2FCommon.js;h=43cc526b7213c192b4d2e000f7634bbe9720f7b6;hb=2644aface7e336051f6808a0a24c8559a496be83;hp=fae46f6495fcaadedc1c642f459c49aeac8b8f7c;hpb=c0b7357c175880a35b5237a92119c3a368be1ac6;p=civicrm-core.git diff --git a/js/Common.js b/js/Common.js index fae46f6495..43cc526b72 100644 --- a/js/Common.js +++ b/js/Common.js @@ -243,10 +243,13 @@ if (!CRM.vars) CRM.vars = {}; var script = document.createElement('script'); scriptsLoaded[url] = $.Deferred(); script.onload = function () { - if (window.jQuery === CRM.$ && CRM.CMSjQuery) { - window.jQuery = CRM.CMSjQuery; - } - scriptsLoaded[url].resolve(); + // Give the script time to execute + window.setTimeout(function () { + if (window.jQuery === CRM.$ && CRM.CMSjQuery) { + window.jQuery = CRM.CMSjQuery; + } + scriptsLoaded[url].resolve(); + }, 100); }; // Make jQuery global available while script is loading if (window.jQuery !== CRM.$) { @@ -1257,7 +1260,8 @@ if (!CRM.vars) CRM.vars = {}; if (title.length) { text = title + "\n" + text; } - alert(text); + // strip html tags as they are not parsed in standard alerts + alert($("
").html(text).text()); return null; } }; @@ -1589,6 +1593,10 @@ if (!CRM.vars) CRM.vars = {}; return format.replace(/1.*234.*56/, result); }; + CRM.angRequires = function(name) { + return CRM.angular.requires[name] || []; + }; + CRM.console = function(method, title, msg) { if (window.console) { method = $.isFunction(console[method]) ? method : 'log';