1 var ConfigurationWindowClass = new Class.create({
4 initialize: function(id) {
5 if(typeof(id) == "undefined") {
8 var prefix = id.replace('Window', 'Configuration');
9 this.window_id = prefix + 'configuration';
10 this.progress_id = 'configuration-progress';
17 $(this.window_id).setStyle({'display' : 'block'});
18 $$('div[id=' + this.window_id + '] input[type="submit"]').each(function(el) {
19 el.observe('click', function() {
25 objectExists: function(key) {
26 return this.objects.hasOwnProperty(key);
29 registerObj: function(key, obj) {
30 if(this.objectExists(key) === false) {
31 this.objects[key] = obj;
35 getObj: function(key) {
37 if(this.objectExists(key) === true) {
38 obj = this.objects[key];
44 $(this.window_id).setStyle({'display' : 'none'});
48 $$('div.configuration').each(function(el){
49 el.setStyle({'display' : 'none'});
53 progress: function(show) {
55 $(this.progress_id).setStyle({'display' : 'block'});
57 $(this.progress_id).setStyle({'display' : 'none'});
61 is_progress: function() {
62 return $(this.progress_id).getStyle('display') == 'block';
65 initTabs: function() {
66 var show_elements = [];
68 var tabs = $$('div[id=' + this.window_id + '] span.tab');
69 tabs.each(function(el) {
70 element = el.readAttribute('rel');
71 show_elements.push($(element));
72 el.observe('click', function() {
73 show_elements.invoke('hide');
74 tabs.invoke('removeClassName', 'tab_active');
75 el.addClassName('tab_active');
76 var show_el = $(el.readAttribute('rel'));
82 switchTab: function(tab_rel) {
83 var tabs = $$('div[id=' + this.window_id + '] span.tab');
84 tabs.each(function(el) {
85 element = el.readAttribute('rel');
86 if (element == tab_rel) {
87 el.addClassName('tab_active');
89 el.removeClassName('tab_active');
96 switchTabByNo: function(tab_no) {
98 var tabs = $$('div[id=' + this.window_id + '] span.tab');
99 for (var i = 0, j = 1; i < tabs.length; i++, j++) {
101 tab_rel = tabs[i].readAttribute('rel');
107 this.switchTab(tab_rel);
111 openConfigurationWindow: function(slideWindowObj) {
112 if(this.is_progress() === false) {
114 if(slideWindowObj.isFullSize() === true) {
115 slideWindowObj.resetSize();
121 var ConfigurationWindow = new ConfigurationWindowClass();