Changeset 645 for lang/ruby/Chemr/AppController.rb
- Timestamp:
- 10/24/07 01:01:40 (6 years ago)
- Location:
- lang/ruby/Chemr
- Files:
-
- 2 modified
-
. (modified) (1 prop)
-
AppController.rb (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/Chemr
-
Property
svn:ignore set
to
build
-
Property
svn:ignore set
to
-
lang/ruby/Chemr/AppController.rb
r643 r645 11 11 12 12 def self.url_for(doc, path) 13 # TODO: weak ref14 13 url = "#{SCHEME}://#{doc.object_id}#{path}" 15 14 NSURL.URLWithString_relativeToURL(url, "#{SCHEME}://#{doc.object_id}/") … … 20 19 #+ (BOOL)canHandleURL:(NSURL *)anURL; 21 20 def self.canHandleURL(url) 22 log url23 21 url.scheme == SCHEME 24 22 end … … 26 24 #+ (BOOL)canInitWithRequest:(NSURLRequest *)request 27 25 def self.canInitWithRequest(req) 28 log req29 26 canHandleURL(req.URL) 30 27 end … … 32 29 #+ (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request 33 30 def self.canonicalRequestForRequest(req) 34 log req35 31 req 36 32 end … … 45 41 log "startLoading" 46 42 url = request.URL 47 log url.host48 log url.path49 43 chm = ObjectSpace._id2ref(url.host.to_s.to_i) 50 log chm51 44 52 45 text = chm.retrieve_object(url.path.to_s) … … 56 49 response = NSURLResponse.alloc.objc_send( 57 50 :initWithURL, url, 58 :MIMEType, "application/octet-stream", 51 #:MIMEType, "application/octet-stream", 52 :MIMEType, "text/html", 59 53 :expectedContentLength, data.length, 60 54 :textEncodingName, nil … … 80 74 require "chm" 81 75 class AppController < NSObject 82 ib_outlets :webview83 84 85 ib_action :open do |sender|86 end87 88 ib_action :close do |sender|89 end90 76 91 77 def awakeFromNib … … 96 82 log "Register: #{r}" 97 83 98 chm = Chmlib::Chm.new("/Users/cho45/tmp/ruby-refm-rdp-1.9.0-ja-htmlhelp_css/rubymanjp.chm") 99 log chm 100 r = NSURLRequest.requestWithURL CHMInternalURLProtocol.url_for(chm, chm.home) 101 @webview.mainFrame.loadRequest r 84 # "/Users/cho45/tmp/ruby-refm-rdp-1.9.0-ja-htmlhelp_css/rubymanjp.chm" 102 85 end 103 86 … … 106 89 log "Unregister" 107 90 end 91 108 92 end 109 93
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)