Move js code which auto close a window in a sepate file

This commit is contained in:
Dmitriy Simushev 2014-10-10 09:01:15 +00:00
parent 3088481d6d
commit a671caeb79
4 changed files with 30 additions and 18 deletions

View File

@ -0,0 +1,27 @@
/*!
* This file is a part of Mibew Messenger.
*
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function (window) {
if (window.opener && window.opener.location) {
window.opener.location.reload();
}
setTimeout(function() {
window.close();
}, 1500);
})(window);

View File

@ -3,12 +3,7 @@
{{#if saved}} {{#if saved}}
{{l10n "Address {0} is blocked for a specified number of days." address}} {{l10n "Address {0} is blocked for a specified number of days." address}}
<script type="text/javascript"><!-- <script type="text/javascript" src="{{asset "@CurrentStyle/js/autoclose.js"}}"></script>
if(window.opener && window.opener.location) {
window.opener.location.reload();
}
setTimeout( (function() { window.close(); }), 1500 );
//--></script>
{{else}} {{else}}
{{l10n "Here you can block malicious visitors that affect your work with spam messages."}} {{l10n "Here you can block malicious visitors that affect your work with spam messages."}}

View File

@ -2,12 +2,7 @@
{{#override "content"}} {{#override "content"}}
{{#if saved}} {{#if saved}}
{{l10n "Saved"}} {{l10n "Saved"}}
<script type="text/javascript"><!-- <script type="text/javascript" src="{{asset "@CurrentStyle/js/autoclose.js"}}"></script>
if(window.opener && window.opener.location) {
window.opener.location.reload();
}
setTimeout( (function() { window.close(); }), 1500 );
//--></script>
{{else}} {{else}}
{{#if key}} {{#if key}}
{{l10n "Edit an existing message."}} {{l10n "Edit an existing message."}}

View File

@ -3,12 +3,7 @@
{{#if saved}} {{#if saved}}
{{l10n "Your translation is saved."}} {{l10n "Your translation is saved."}}
<script type="text/javascript"><!-- <script type="text/javascript" src="{{asset "@CurrentStyle/js/autoclose.js"}}"></script>
if(window.opener && window.opener.location) {
window.opener.location.reload();
}
setTimeout( (function() { window.close(); }), 1500 );
//--></script>
{{else}} {{else}}
{{l10n "Enter your translation."}} {{l10n "Enter your translation."}}