daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def update webView, scroll = false
  2.    
  3.         webView.windowScriptObject.evaluateWebScript "Twittia.checkAtBottom()"
  4.         res = ""
  5.         template = IO.read OSX::NSBundle.mainBundle.resourcePath + "/Themes/Default/template.rhtml"
  6.        
  7.         tmp = MessagesContainer.new @type, @messages, @myusername
  8.        
  9.         ERB.new(template, nil, nil, 'res').result(tmp.get_binding)
  10.         body = webView.mainFrame.DOMDocument.getElementsByTagName("body").item(0)
  11.         body.setInnerHTML(res)
  12.     end
  13.  
  14.  
  15. #  ---------------------
  16. class MessagesContainer
  17.    
  18.     attr_reader :type, :messages, :myusername
  19.    
  20.     def initialize type, messages, myusername
  21.         @type = type
  22.         @messages = messages
  23.         @myusername = myusername   
  24.     end
  25.    
  26.     def get_binding
  27.         binding
  28.     end
  29. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top