Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update webView, scroll = false
- webView.windowScriptObject.evaluateWebScript "Twittia.checkAtBottom()"
- res = ""
- template = IO.read OSX::NSBundle.mainBundle.resourcePath + "/Themes/Default/template.rhtml"
- tmp = MessagesContainer.new @type, @messages, @myusername
- ERB.new(template, nil, nil, 'res').result(tmp.get_binding)
- body = webView.mainFrame.DOMDocument.getElementsByTagName("body").item(0)
- body.setInnerHTML(res)
- end
- # ---------------------
- class MessagesContainer
- attr_reader :type, :messages, :myusername
- def initialize type, messages, myusername
- @type = type
- @messages = messages
- @myusername = myusername
- end
- def get_binding
- binding
- end
- end
Add Comment
Please, Sign In to add comment