Files
edx-platform/common/static/js/src/ie_shim.js
louyihua 7f1c784629 Add defininition of window.location.origin in both CMS/LMS
The same bug in studio was fixed in #3893, and as TinyMCE is also used in LMS, it should be also fixed in LMS.
Here a common javascript file called 'ie_shim.js' is added, so that in the future it can be used for other IE compatibility purposes too.
2014-07-15 11:34:52 +08:00

17 lines
818 B
JavaScript

/*
* This file is used for keeping compatibility with Internet Explorer.
* As starting with IE10, the conditional comments are not supported, this file
* will always be loaded whether the browser is IE or not. Therefore, the code
* here should not make any assumption and should always detect the execution
* conditions itself.
*/
// Shim name: Create the attribute of 'window.location.origin'
// IE version: 11 or earlier, 12 or later not tested
// Internet Explorer does not have built-in property 'window.location.origin',
// we need to create one here as some vendor code such as TinyMCE uses this.
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname
+ (window.location.port ? ':' + window.location.port : '');
}