Changeset 3466

Show
Ignore:
Timestamp:
12/17/06 02:00:08 (2 years ago)
Author:
timothy
Message:

Changed the NSImage constructor function to take a NSURL. Added a NSURL constructor.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plug-Ins/JavaScript Support/plugin.html

    r3464 r3466  
    148148} 
    149149 
    150 function NSImage(filePath) { 
     150function NSImage(url) { 
    151151        var obj = Plugin.allocInstance('NSImage'); 
    152         if( filePath !== undefined ) 
    153                 return obj.initByReferencingFile(filePath.toString()); 
    154         throw "Can't create a NSImage without a file path."; 
     152        if( url !== undefined ) 
     153                return obj.initByReferencingURL(url); 
     154        throw "Can't create a NSImage without a NSURL."; 
     155
     156 
     157function NSURL(url) { 
     158        var obj = Plugin.allocInstance('NSURL'); 
     159        if( url !== undefined ) 
     160                return obj.initWithString(url.toString()); 
     161        throw "Can't create a NSURL without a URL string."; 
    155162} 
    156163