MINOR Adjusted CMS JavaScript to new jquery-concrete API: Getters have 'get' prefix, namespaces are defined in blocks, event handlers work consistently. Mostly indentation and structure changes, no logic changes.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92830 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:20:14 +00:00
parent c467c926fd
commit 622d2d46f6

View File

@ -5,21 +5,19 @@
var ss_MainLayout; var ss_MainLayout;
(function($) { (function($) {
$(function() {
// global ajax error handlers
$('.LeftAndMain').bind('ajaxComplete', function(e, xmlhttp, settings) {
var status = (xmlhttp.status >= 400) ? 'bad' : 'good';
var msg = (xmlhttp.getResponseHeader('X-Status')) ? xmlhttp.getResponseHeader('X-Status') : xmlhttp.statusText;
// Don't display standard '200 OK' messages
if(msg && msg != 'OK') statusMessage(msg, status);
});
});
$.concrete('ss', function($){ $.concrete('ss', function($){
// setup jquery.concrete // setup jquery.concrete
$.concrete.warningLevel = $.concrete.WARN_LEVEL_BESTPRACTISE; $.concrete.warningLevel = $.concrete.WARN_LEVEL_BESTPRACTISE;
// global ajax error handlers
$.ajaxSetup({
error: function(xmlhttp, status, error) {
var msg = (xmlhttp.getResponseHeader('X-Status')) ? xmlhttp.getResponseHeader('X-Status') : xmlhttp.statusText;
statusMessage(msg, 'bad');
}
});
/** /**
* Available Custom Events: * Available Custom Events:
* <ul> * <ul>
@ -362,6 +360,7 @@ var ss_MainLayout;
onmatch: function() { onmatch: function() {
var self = this; var self = this;
this.setForm($('#Form_EditForm')); this.setForm($('#Form_EditForm'));
jQuery('#Form_EditForm').bind('loadnewpage delete', function(e) {self.refresh();}); jQuery('#Form_EditForm').bind('loadnewpage delete', function(e) {self.refresh();});
self.refresh(); self.refresh();