Replace inline js in the default page style with files

This commit is contained in:
Dmitriy Simushev 2014-10-10 09:15:50 +00:00
parent a671caeb79
commit 922edc96d7
6 changed files with 93 additions and 36 deletions

View File

@ -0,0 +1,30 @@
/*!
* 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(Mibew, $) {
$(document).ready(function() {
$('a.removelink').click(function() {
var address = $.trim($("#t" + this.id).text());
return confirm(Mibew.Localization.trans(
'Are you sure that you want to delete address {0} from the blocked list?',
address
));
});
});
})(Mibew, jQuery);

View File

@ -0,0 +1,30 @@
/*!
* 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(Mibew, $) {
$(document).ready(function(){
$('a.removelink').click(function(){
var groupName = $.trim($("#t" + this.id).text());
return confirm(Mibew.Localization.trans(
'Are you sure that you want to delete the group "{0}"?',
groupName
));
});
});
})(Mibew, jQuery);

View File

@ -0,0 +1,30 @@
/*!
* 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(Mibew, $) {
$(document).ready(function(){
$('a.removelink').click(function(){
var login = $.trim($("#t" + this.id).text());
return confirm(Mibew.Localization.trans(
'Are you sure that you want to delete operator "{0}"?',
login
));
});
});
})(Mibew, jQuery);

View File

@ -2,18 +2,7 @@
{{#override "menu"}}{{> _menu}}{{/override}}
{{#override "head"}}
<script type="text/javascript" language="javascript"><!--
(function($) {
$(document).ready(function(){
var confirmMessage = "{{#jsString}}{{l10n 'Are you sure that you want to delete address {0} from the blocked list?' '{addr}'}}{{/jsString}}";
$('a.removelink').click(function(){
var addr = $.trim($("#t" + this.id).text());
return confirm(confirmMessage.replace("{addr}", addr));
});
});
})(jQuery);
//--></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/js/bans.js"}}"></script>
{{/override}}
{{#override "content"}}

View File

@ -2,18 +2,7 @@
{{#override "menu"}}{{> _menu}}{{/override}}
{{#override "head"}}
<script type="text/javascript" language="javascript"><!--
(function($) {
$(document).ready(function(){
var confirmMessage = "{{#jsString}}{{l10n 'Are you sure that you want to delete the group "{0}"?' '{groupName}'}}{{/jsString}}";
$('a.removelink').click(function(){
var groupName = $.trim($("#t" + this.id).text());
return confirm(confirmMessage.replace("{groupName}", groupName));
});
});
})(jQuery);
//--></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/js/groups.js"}}"></script>
{{/override}}
{{#override "content"}}

View File

@ -2,18 +2,7 @@
{{#override "menu"}}{{> _menu}}{{/override}}
{{#override "head"}}
<script type="text/javascript" language="javascript"><!--
(function($) {
$(document).ready(function(){
var confirmMessage = "{{#jsString}}{{l10n 'Are you sure that you want to delete operator "{0}"?' '{login}'}}{{/jsString}}";
$('a.removelink').click(function(){
var login = $.trim($("#t" + this.id).text());
return confirm(confirmMessage.replace("{login}", login));
});
});
})(jQuery);
//--></script>
<script type="text/javascript" src="{{asset "@CurrentStyle/js/operators.js"}}"></script>
{{/override}}
{{#override "content"}}