topical media & game development

talk show tell print

professional-web-01-v4-config.js / js



  
  function initConfig() {
  
     YAHOO.buzzWatch.config = new ConfigPanel();
            
  }
  
  function ConfigPanel () {
          this.symbol = document.getElementById('symbol').value;
          this.tag = document.getElementById('tag').value;
          this.panel = new YAHOO.widget.Panel(
              "config", 
              {  
                          width: "180px",
                       fixedcenter: true, 
                      constraintoviewport: false, 
                      underlay:"shadow", 
                      close:true, 
                      visible:false, 
                      draggable:true, 
                      modal:true
              } 
      );
          
             this.panel.beforeHideEvent.subscribe(this.beforeHide, this);
      this.panel.render();
      YAHOO.util.Event.addListener("menubar.config", "click", this.displayConfig, this, true);
      YAHOO.util.Event.addListener("configForm", "submit", this.saveConfig, this, true);
  }
  ConfigPanel.prototype.isEmpty = function() {
    return this.symbol=="" && this.tag=="";
  }
  
  ConfigPanel.prototype.set = function(symbol, tag) {
          this.symbol = symbol;
          this.tag = tag;
          document.getElementById('symbol').value = symbol;
          document.getElementById('tag').value = tag;
  }
  ConfigPanel.prototype.displayConfig = function() {
          this.panel.show();        
  }
  ConfigPanel.prototype.saveConfig = function(){
          this.symbol = document.getElementById('symbol').value;
          this.tag = document.getElementById('tag').value;
          this.panel.hide();
          refreshPanels();
          return false;
  }
  ConfigPanel.prototype.beforeHide = function(type, args, me){
          document.getElementById('symbol').value = me.symbol;
          document.getElementById('tag').value = me.tag;
  }


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.