{"id":350,"date":"2008-11-01T14:59:31","date_gmt":"2008-11-01T22:59:31","guid":{"rendered":"http:\/\/www.codebelay.com\/blog\/?p=350"},"modified":"2008-11-01T15:01:10","modified_gmt":"2008-11-01T23:01:10","slug":"redboxing-with-rails-modal-windows-ftw","status":"publish","type":"post","link":"https:\/\/www.codebelay.com\/blog\/2008\/11\/01\/redboxing-with-rails-modal-windows-ftw\/","title":{"rendered":"Redboxing with Rails: Modal Windows FTW"},"content":{"rendered":"<p>There&#8217;s a great lightbox plugin for Ruby on Rails called <a href=\"http:\/\/blog.craigambrose.com\/past\/2006\/8\/16\/redbox-a-rails-compatible-lightbox\/\">Redbox<\/a>. Unfortunately, it doesn&#8217;t work out of the box, but here&#8217;s the <a href=\"redbox_patch.dif\">patch<\/a> for redbox.js:<\/p>\n<p>Replace:<\/p>\n<div style=\"background: #000; color: #fff; padding: 10px;\">\n                Element.setTop(window_id, boxTop);<br \/>\n                Element.setLeft(window_id, boxLeft);\n<\/div>\n<p>With:<\/p>\n<div style=\"background: #000; color: #fff; padding: 10px;\">\n    $(window_id).style.top = boxTop + &#8220;px&#8221;;<br \/>\n    $(window_id).style.left = boxLeft + &#8220;px&#8221;;\n<\/div>\n<p>Remove or comment out:<\/p>\n<div style=\"background: #000; color: #fff; padding: 10px;\">\nElement.hide(&#8216;RB_loading&#8217;);\n<\/div>\n<p>Remove:<\/p>\n<div style=\"background: #000; color: #fff; padding: 10px;\">\n&lt;div id=&#8221;RB_loading&#8221;&gt;&lt;\/div&gt;\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a great lightbox plugin for Ruby on Rails called Redbox. Unfortunately, it doesn&#8217;t work out of the box, but here&#8217;s the patch for redbox.js: Replace: Element.setTop(window_id, boxTop); Element.setLeft(window_id, boxLeft); With: $(window_id).style.top = boxTop + &#8220;px&#8221;; $(window_id).style.left = boxLeft + &#8220;px&#8221;; Remove or comment out: Element.hide(&#8216;RB_loading&#8217;); Remove: &lt;div id=&#8221;RB_loading&#8221;&gt;&lt;\/div&gt;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,107],"tags":[136,224,223,393,392],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-how-to","category-ruby-on-rails","tag-ajax","tag-modal-windows","tag-redbox-plugin","tag-ruby","tag-ruby-on-rails"],"_links":{"self":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":0,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebelay.com\/blog\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}