33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-01 03:02:34 +00:00
jedchecker/source/media/com_jedchecker/js/police.js
Daniel Dimitrov 7dc7fd3ab0 the check is now an ajax request. (one need just to add rules in the libraries/rules and they
will be automatically called by the component - no further actions necessary)
layout improvements
2012-06-09 15:34:32 +02:00

34 lines
948 B
JavaScript

/**
* @author Daniel Dimitrov - compojoom.com
* @date: 09.06.12
*
* @copyright Copyright (C) 2008 - 2012 compojoom.com . All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
var police = new Class({
Implements:[Options],
options:{},
initialize:function (options) {
var self = this;
this.setOptions(options);
this.options.rules.each(function(rule){
self.check(rule);
});
},
check: function(rule) {
var self = this;
new Request({
url: self.options.url + '/index.php?option=com_jedchecker&task=police.check&format=raw&rule='+rule,
async: false,
onComplete: function(result) {
var div = new Element('div', {
html: result
});
div.inject(document.id('police-check-result'));
}
}).send();
}
});