Changeset 87

Show
Ignore:
Timestamp:
08/17/08 13:43:08 (3 months ago)
Author:
bi..@lilyapp.org
Message:

code reorg phase 1: break up utils.js into meaningful chunks. create a new class LilyComponents?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/bootstrap.js

    r39 r87  
    66                "chrome://global/content/nsTransferable.js", 
    77                "chrome://lily/content/lib.js", 
    8                 "chrome://lily/content/utils.js", 
     8                "chrome://lily/content/utils/core.js", 
     9                "chrome://lily/content/utils/file.js", 
     10                "chrome://lily/content/utils/font.js", 
     11                "chrome://lily/content/utils/patch.js", 
     12                "chrome://lily/content/utils/prefs.js", 
     13                "chrome://lily/content/utils/string.js", 
     14                "chrome://lily/content/utils/window.js", 
     15                "chrome://lily/content/apiKeyManager.js",                
     16                "chrome://lily/content/components/dialog.js", 
     17                "chrome://lily/content/components/editor.js", 
     18                "chrome://lily/content/components/iframe.js", 
     19                "chrome://lily/content/components/xhr.js",                                                               
    920                "chrome://lily/content/externals.js", 
    1021                "chrome://lily/content/debug.js", 
  • trunk/lily/lily/chrome/content/externals/amazondotitemlookup.js

    r1 r87  
    4242        this.outlet1=new this.outletClass("outlet1",this,"each item as hash with keys {asin, group, title, url, img, author}"); 
    4343        this.outlet2=new this.outletClass("outlet2",this,"bang on complete");    
    44         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     44        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4545         
    4646        this.inlet1["anything"]=function(str){ 
  • trunk/lily/lily/chrome/content/externals/amazondotitemsearch.js

    r1 r87  
    4242        this.outlet1=new this.outletClass("outlet1",this,"each result as hash with keys {asin, group, title, url, img, author}"); 
    4343        this.outlet2=new this.outletClass("outlet2",this,"bang on complete");    
    44         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     44        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4545         
    4646        this.inlet1["anything"]=function(str){ 
  • trunk/lily/lily/chrome/content/externals/amazondotsimilaritylookup.js

    r1 r87  
    4242        this.outlet1=new this.outletClass("outlet1",this,"each item as hash with keys {asin, group, title, url, img, author}"); 
    4343        this.outlet2=new this.outletClass("outlet2",this,"bang on complete");    
    44         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     44        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4545         
    4646        //bang method 
  • trunk/lily/lily/chrome/content/externals/babelfish.js

    r1 r87  
    7979        this.outlet2 = new this.outletClass("outlet2",this,"bang on complete");  
    8080                 
    81         this.xhr=new LilyUtils._xhr(outputResponse,"text",this);       
     81        this.xhr=new LilyComponents._xhr(outputResponse,"text",this);  
    8282         
    8383        this.inlet1["anything"]=function(str) { 
  • trunk/lily/lily/chrome/content/externals/comment.js

    r1 r87  
    7676        this.displayElement=thisPtr.ui.contentWrapper 
    7777 
    78         var editor=new LilyUtils._editor(this,this.ui.getElByID(thisPtr.createElID("comment")),spacer(),setArgs,getArgs,true); //widget that will handle editing... 
     78        var editor=new LilyComponents._editor(this,this.ui.getElByID(thisPtr.createElID("comment")),spacer(),setArgs,getArgs,true); //widget that will handle editing... 
    7979 
    8080        this.controller.attachObserver(this.createElID("comment"),"dblclick",editor.startEdit,"edit");   
  • trunk/lily/lily/chrome/content/externals/get.js

    r1 r87  
    3939        this.inlet1=new this.inletClass("inlet1",this,"url to get, \"bang\" uses url supplied in object argument");      
    4040         
    41         this.xhr=new LilyUtils._xhr(outputResponse,type,this); 
     41        this.xhr=new LilyComponents._xhr(outputResponse,type,this); 
    4242         
    4343        this.inlet1["anything"]=function(loc){  
  • trunk/lily/lily/chrome/content/externals/googledotmap.js

    r1 r87  
    152152        } 
    153153         
    154         var iframe=new LilyUtils._iframe(this,"file://"+Lily.libPath+"/googlemaps.html",300,500,"no",frameInit); 
     154        var iframe=new LilyComponents._iframe(this,"file://"+Lily.libPath+"/googlemaps.html",300,500,"no",frameInit); 
    155155         
    156156        this.controller.attachObserver(this.objID,"deselect",function(){deselectFunc();},"edit"); 
  • trunk/lily/lily/chrome/content/externals/id.js

    r1 r87  
    1313        this.outlet1 = new this.outletClass("outlet1",this,"most recent queries"); 
    1414        this.outlet2 = new this.outletClass("outlet2",this,"bang on complete or error");                 
    15         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     15        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    1616         
    1717        this.inlet1["bang"]=function(){ thisPtr.xhr.loadXMLDoc(url+ "&timestamp=" +new Date().getTime()); } 
  • trunk/lily/lily/chrome/content/externals/iframe.js

    r1 r87  
    6565        //_iframe contains the iframe html, ui property is a necessary placeholder, must'nt be null. 
    6666        this.ui={};      
    67         var iframe=new LilyUtils._iframe(this,this.src,null,null,null,frameInit); 
     67        var iframe=new LilyComponents._iframe(this,this.src,null,null,null,frameInit); 
    6868 
    6969         
  • trunk/lily/lily/chrome/content/externals/jquerydotcolorpicker.js

    r1 r87  
    5050        } 
    5151 
    52         var iframe=new LilyUtils._iframe(this,"chrome://lily/content/lib/jquery.html?farbtastic",200,200,"no",frameInit); 
     52        var iframe=new LilyComponents._iframe(this,"chrome://lily/content/lib/jquery.html?farbtastic",200,200,"no",frameInit); 
    5353        //iframe.objFrame.addEventListener("load",frameInit,false);              
    5454         
  • trunk/lily/lily/chrome/content/externals/message.js

    r1 r87  
    211211        // 
    212212        this.displayElement=this.ui.getElByID(thisPtr.createElID("message")); 
    213         var editor=new LilyUtils._editor(this,this.displayElement,spacer(),setArgs,getArgs,false); //widget that will handle editing...                        
     213        var editor=new LilyComponents._editor(this,this.displayElement,spacer(),setArgs,getArgs,false); //widget that will handle editing...                   
    214214         
    215215        function setStyles() { 
  • trunk/lily/lily/chrome/content/externals/oracle.js

    r1 r87  
    1616        this.outlet2 = new this.outletClass("outlet2",this,"bang on complete or error");                 
    1717         
    18         var xhr=new LilyUtils._xhr(outputResponse,"text",this); 
     18        var xhr=new LilyComponents._xhr(outputResponse,"text",this); 
    1919         
    2020        this.inlet1["bang"]=function(){ xhr.loadXMLDoc(url); } 
  • trunk/lily/lily/chrome/content/externals/post.js

    r1 r87  
    4646        this.outlet2 = new this.outletClass("outlet2",this,"bang on complete");          
    4747        this.inlet1=new this.inletClass("inlet1",this,"data to post");   
    48         this.xhr=new LilyUtils._xhr(outputResponse,type,this,"POST",null,[{name:"Content-Type",value:"application/x-www-form-urlencoded"}]); 
     48        this.xhr=new LilyComponents._xhr(outputResponse,type,this,"POST",null,[{name:"Content-Type",value:"application/x-www-form-urlencoded"}]); 
    4949         
    5050        this.inlet1["anything"]=function(msg){ thisPtr.xhr.loadXMLDoc(url,msg); } 
  • trunk/lily/lily/chrome/content/externals/rss.js

    r1 r87  
    4040        this.inlet1=new this.inletClass("inlet1",this,"feed url, \"bang\" uses url supplied in object argument");        
    4141         
    42         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); //gets xml 
     42        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); //gets xml 
    4343        this.rssparser=new LilyServices._rssService(); //converts to js object 
    4444         
  • trunk/lily/lily/chrome/content/externals/subpatch.js

    r60 r87  
    274274        //_iframe contains the iframe html, ui property is a necessary placeholder, must'nt be null. 
    275275        this.ui={};      
    276         var iframe=new LilyUtils._iframe(this,null,200,200,"no",frameLoad);   //no scrolling 
     276        var iframe=new LilyComponents._iframe(this,null,200,200,"no",frameLoad);      //no scrolling 
    277277         
    278278        this.displayElement=this.resizeElement=iframe.objFrame; // 
  • trunk/lily/lily/chrome/content/externals/twitter.js

    r1 r87  
    5858                 
    5959        //get 
    60         this.xhr1=new LilyUtils._xhr(outputResponse1,"text",this,"GET",true,[{name:"Authorization",value:"Basic "+ window.btoa(credentials)}]); 
     60        this.xhr1=new LilyComponents._xhr(outputResponse1,"text",this,"GET",true,[{name:"Authorization",value:"Basic "+ window.btoa(credentials)}]); 
    6161        //post 
    62         this.xhr2=new LilyUtils._xhr(outputResponse2,"text",this,"POST",true,[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Authorization",value:"Basic "+ window.btoa(credentials)}]); 
     62        this.xhr2=new LilyComponents._xhr(outputResponse2,"text",this,"POST",true,[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Authorization",value:"Basic "+ window.btoa(credentials)}]); 
    6363                 
    6464        //public timeline        
  • trunk/lily/lily/chrome/content/externals/wikipedia.js

    r1 r87  
    4040        this.outlet2 = new this.outletClass("outlet2",this,"bang on complete or error");         
    4141         
    42         this.xhr=new LilyUtils._xhr(outputResponse,"text",this); 
     42        this.xhr=new LilyComponents._xhr(outputResponse,"text",this); 
    4343                 
    4444        this.inlet1["anything"]=function(str){ 
  • trunk/lily/lily/chrome/content/externals/xuldottree.js

    r1 r87  
    317317        } 
    318318         
    319         var iframe=new LilyUtils._iframe(this,"chrome://lily/content/lib/base.xul",200,200,"no",frameInit); 
     319        var iframe=new LilyComponents._iframe(this,"chrome://lily/content/lib/base.xul",200,200,"no",frameInit); 
    320320         
    321321        function frameInit() { 
  • trunk/lily/lily/chrome/content/externals/yahoodotgeocoding.js

    r1 r87  
    4343        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error"); 
    4444                 
    45         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     45        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4646         
    4747        //bang method 
  • trunk/lily/lily/chrome/content/externals/yahoodotgettime.js

    r1 r87  
    4242        this.outlet2=new this.outletClass("outlet2",this,"time as a string"); 
    4343        this.outlet3=new this.outletClass("outlet3",this,"bang on complete or error");   
    44         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     44        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4545         
    4646        //bang method 
  • trunk/lily/lily/chrome/content/externals/yahoodotimagesearch.js

    r1 r87  
    4343        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error"); 
    4444         
    45         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     45        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4646 
    4747        this.inlet1["anything"]=function(str){ 
  • trunk/lily/lily/chrome/content/externals/yahoodotitemextraction.js

    r1 r87  
    4646        this.outlet2 = new this.outletClass("outlet2",this,"bang on complete or error");         
    4747                 
    48         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this,"POST",null,[{name:"Content-Type",value:"application/x-www-form-urlencoded"}]); 
     48        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this,"POST",null,[{name:"Content-Type",value:"application/x-www-form-urlencoded"}]); 
    4949         
    5050        this.inlet1["anything"]=function(msg)   { 
  • trunk/lily/lily/chrome/content/externals/yahoodotlocalsearch.js

    r1 r87  
    4747        this.outlet1=new this.outletClass("outlet1",this,"each result as hash {title, url, latitude, longitude, address, city, state, phone}"); 
    4848        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");   
    49         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     49        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    5050         
    5151        this.inlet2["anything"]=function(str) { 
  • trunk/lily/lily/chrome/content/externals/yahoodotnewssearch.js

    r1 r87  
    4141        this.outlet1=new this.outletClass("outlet1",this,"each result as hash with keys {title, summary, url}"); 
    4242        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");   
    43         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     43        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4444         
    4545        //&street=701+First+Street&city=Sunnyvale&state=CA 
  • trunk/lily/lily/chrome/content/externals/yahoodotspellingsuggestion.js

    r1 r87  
    4141        this.outlet1=new this.outletClass("outlet1",this,"suggested spelling"); 
    4242        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");   
    43         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     43        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4444         
    4545        //&street=701+First+Street&city=Sunnyvale&state=CA 
  • trunk/lily/lily/chrome/content/externals/yahoodottrafficdata.js

    r1 r87  
    4141        this.outlet1=new this.outletClass("outlet1",this,"each result as hash {title, description, latitude, longitude, direction, severity}"); 
    4242        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");   
    43         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     43        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4444         
    4545         
  • trunk/lily/lily/chrome/content/externals/yahoodotvideosearch.js

    r1 r87  
    4141        this.outlet1=new this.outletClass("outlet1",this,"each result as hash with keys {\"title\",\"summary\",\"url\",\"height\",\"width\"}"); 
    4242        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");   
    43         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     43        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4444         
    4545        //&street=701+First+Street&city=Sunnyvale&state=CA 
  • trunk/lily/lily/chrome/content/externals/yahoodotwebsearch.js

    r1 r87  
    4141        this.outlet1=new this.outletClass("outlet1",this,"each result as hash with keys {title, summary, url}"); 
    4242        this.outlet2=new this.outletClass("outlet2",this,"bang on complete or error");   
    43         this.xhr=new LilyUtils._xhr(outputResponse,"xml",this); 
     43        this.xhr=new LilyComponents._xhr(outputResponse,"xml",this); 
    4444         
    4545        //&street=701+First+Street&city=Sunnyvale&state=CA 
  • trunk/lily/lily/chrome/content/externals/yuidotcalendar.js

    r1 r87  
    9292        }                
    9393         
    94         var iframe=new LilyUtils._iframe(this,"chrome://lily/content/lib/yui.html",185,202,"no",frameInit); 
     94        var iframe=new LilyComponents._iframe(this,"chrome://lily/content/lib/yui.html",185,202,"no",frameInit); 
    9595         
    9696        function frameInit() { 
  • trunk/lily/lily/chrome/content/lib/processing.js

    r51 r87  
    664664                 
    665665        //synchronous 
    666         var xhr = new LilyUtils._xhr(processData,"bin",this,"GET",false); 
     666        var xhr = new LilyComponents._xhr(processData,"bin",this,"GET",false); 
    667667        xhr.loadXMLDoc(file); 
    668668        xhr.loadXMLDoc(file); //2nd verse, same as the first...  
  • trunk/lily/lily/chrome/content/lily.js

    r86 r87  
    289289                //win,str,width,color 
    290290                if(!this.initialized) 
    291                         LilyUtils.displayMessageDialog(content,"<img src='chrome://lily/content/images/activity-medium.png'/>",200);   
     291                        LilyComponents._dialog.toggleMessageDialog(content,"<img src='chrome://lily/content/images/activity-medium.png'/>",200);       
    292292        }, 
    293293                                 
     
    684684                //only open if the user confirms 
    685685                if(hideWarning||prompts.confirmCheck(null, "", "It appears that you're opening a Lily program located at "+url+". Malicious Lily programs can damage your privacy and data. You should only open Lily programs from sources you trust.", "Don't warn again", check)) { 
    686                         var xhr=new LilyUtils._xhr(outputResponse,"text",this); 
     686                        var xhr=new LilyComponents._xhr(outputResponse,"text",this); 
    687687                        xhr.loadXMLDoc(url);                     
    688688                } 
  • trunk/lily/lily/chrome/content/patch.js

    r86 r87  
    22052205        this.displayPatchDialog=function(str,color) { 
    22062206                var width=Math.floor(this.patch.width/1.33);     
    2207                 return LilyUtils.toggleMessageDialog(thisPtr.oWin,str,width,color); 
     2207                return LilyComponents._dialog.toggleMessageDialog(thisPtr.oWin,str,width,color); 
    22082208        } 
    22092209                 
  • trunk/lily/lily/chrome/content/services.js

    r14 r87  
    5353        this.outputError=null; //error/complete cb attaches here 
    5454         
    55         this.xhr=new LilyUtils._xhr(handleResponse,'xml',this); 
     55        this.xhr=new LilyComponents._xhr(handleResponse,'xml',this); 
    5656         
    5757        //loads the default url 
     
    232232        this.outputError=null; //error/complete cb attaches here 
    233233         
    234         this.xhr=new LilyUtils._xhr(handleResponse,'text',this); 
     234        this.xhr=new LilyComponents._xhr(handleResponse,'text',this); 
    235235         
    236236        function formatDate(unixTime) {