Commit c0511bd1 by louyihua

Build 'window.location.origin' for Internet Explorer

As TinyMCE's CodeMirror plug-in uses 'window.location.origin' which is not supported by Internet Explorer, the HTML or raw code editor does not work under Internet Explorer.
We need to create one in order to make these vendor codes work under Internet Explorer.
parent b2656bb2
## -*- coding: utf-8 -*- ## -*- coding: utf-8 -*-
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='static_content.html'/>
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
<script type="text/javascript"> <script type="text/javascript">
window.baseUrl = "${settings.STATIC_URL}"; window.baseUrl = "${settings.STATIC_URL}";
// 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 : '');
}
var require = { var require = {
baseUrl: baseUrl, baseUrl: baseUrl,
waitSeconds: 60, waitSeconds: 60,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment