1 var ConfigurationWindowClass = jQuery.klass({
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 document.getElementById(this.window_id).style.display = 'block';
18 $('div[id=' + this.window_id + '] input[type="submit"]').each(function(index, el) {
19 $(el).on('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 document.getElementById(this.window_id).style.display = 'none';
48 $('div.configuration').css({'display' : 'none'});
51 progress: function(show) {
53 document.getElementById(this.progress_id).style.display = 'block';
55 document.getElementById(this.progress_id).style.display = 'none';
59 is_progress: function() {
60 return (document.getElementById(this.progress_id).style.display == 'block');
63 initTabs: function() {
64 var show_elements = [];
66 var tabs = $('div[id=' + this.window_id + '] span.tab');
67 tabs.each(function(index, el) {
68 element = $(el).attr('rel');
69 show_elements.push($('#' + element));
70 $(el).on('click', function() {
71 for (var i = 0; i < show_elements.length; i++) {
72 show_elements[i].hide();
74 tabs.removeClass('tab_active');
75 $(el).addClass('tab_active');
76 var show_el = $('#' + el.getAttribute('rel'));
82 switchTab: function(tab_rel) {
83 var tabs = $('div[id=' + this.window_id + '] span.tab');
84 tabs.each(function(index, el) {
85 element = $(el).attr('rel');
86 if (element == tab_rel) {
87 $(el).addClass('tab_active');
89 $(el).removeClass('tab_active');
91 $('#' + element).hide();
93 $('#' + tab_rel).show();
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].getAttribute('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();
123 function setContentWidth() {
124 var content_width = $('#container').width() - $('#workspace-menu-left').width() - 1;
125 $('#content').css({'width': content_width + 'px'});
128 $(window).resize(function() {