Providers, wizard base, core notifier base

This commit is contained in:
Ruud
2011-04-15 12:21:13 +02:00
parent 16f2d5e5f5
commit 49bf6caa52
25 changed files with 1149 additions and 181 deletions
@@ -1,6 +1,6 @@
// MooTools: the javascript framework.
// Load this file's selection again by visiting: http://mootools.net/more/2b832e45b9bf2f9e5fdbdafc9b16febf
// Or build this file again with packager using: packager build More/Element.Forms More/Element.Delegation More/Element.Shortcuts More/Fx.Slide More/Sortables More/Request.JSONP More/Spinner
// Load this file's selection again by visiting: http://mootools.net/more/1e3edb90c5e02d9b9013b54e6ab001ea
// Or build this file again with packager using: packager build More/Element.Forms More/Element.Delegation More/Element.Shortcuts More/Fx.Slide More/Sortables More/Request.JSONP More/Request.Periodical More/Spinner
/*
---
@@ -1754,6 +1754,59 @@ Request.JSONP.counter = 0;
Request.JSONP.request_map = {};
/*
---
script: Request.Periodical.js
name: Request.Periodical
description: Requests the same URL to pull data from a server but increases the intervals if no data is returned to reduce the load
license: MIT-style license
authors:
- Christoph Pojer
requires:
- Core/Request
- /MooTools.More
provides: [Request.Periodical]
...
*/
Request.implement({
options: {
initialDelay: 5000,
delay: 5000,
limit: 60000
},
startTimer: function(data){
var fn = function(){
if (!this.running) this.send({data: data});
};
this.lastDelay = this.options.initialDelay;
this.timer = fn.delay(this.lastDelay, this);
this.completeCheck = function(response){
clearTimeout(this.timer);
this.lastDelay = (response) ? this.options.delay : (this.lastDelay + this.options.delay).min(this.options.limit);
this.timer = fn.delay(this.lastDelay, this);
};
return this.addEvent('complete', this.completeCheck);
},
stopTimer: function(){
clearTimeout(this.timer);
return this.removeEvent('complete', this.completeCheck);
}
});
/*
---
+8 -6
View File
@@ -9,7 +9,8 @@ Page.Settings = new Class({
'general': {},
'providers': {},
'downloaders': {},
'notifications': {}
'notifications': {},
'renamer': {}
},
open: function(action, params){
@@ -114,15 +115,16 @@ Page.Settings = new Class({
section.groups.sortBy('order').each(function(group){
// Create the group
var group_el = self.createGroup(group).inject(self.tabs[group.tab].content);
self.tabs[group.tab].groups[group.name] = group_el
if(!self.tabs[group.tab].groups[group.name]){
var group_el = self.createGroup(group).inject(self.tabs[group.tab].content);
self.tabs[group.tab].groups[group.name] = group_el
}
// Add options to group
group.options.sortBy('order').each(function(option){
var class_name = (option.type || 'string').capitalize();
var input = new Option[class_name](self, section_name, option.name, option);
input.inject(group_el);
input.inject(self.tabs[group.tab].groups[group.name]);
input.fireEvent('injected')
});
@@ -142,7 +144,7 @@ Page.Settings = new Class({
if(self.tabs[tab_name] && self.tabs[tab_name].tab)
return self.tabs[tab_name].tab
var label = (tab.label || tab.name).capitalize()
var label = (tab.label || tab.name || tab_name).capitalize()
var tab_el = new Element('li').adopt(
new Element('a', {
'href': '/'+self.name+'/'+tab_name+'/',