diff --git a/config/environment.rb b/config/environment.rb index f6f4659..7443476 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -66,8 +66,11 @@ Rails::Initializer.run do |config| } # Adds custom attributes to the Set of allowed html attributes for the #sanitize helper - config.action_view.sanitized_allowed_attributes = 'align', 'border', 'alt', 'vspace', 'hspace', 'width', 'heigth', 'align' + config.action_view.sanitized_allowed_attributes = 'align', 'border', 'alt', 'vspace', 'hspace', 'width', 'heigth', 'value', 'type', 'data', 'style' + # Adds custom tags to the Set of allowed html tags for the #sanitize helper + config.action_view.sanitized_allowed_tags = 'object', 'embed', 'param' + # See Rails::Configuration for more options extra_controller_dirs.each do |item| diff --git a/public/javascripts/lightbox.js b/public/javascripts/lightbox.js index 3e8cd4d..79247b4 100644 --- a/public/javascripts/lightbox.js +++ b/public/javascripts/lightbox.js @@ -76,6 +76,7 @@ lightbox.prototype = { this.setScroll(0,0); this.hideSelects('hidden'); } + this.hideObjectsAndEmbeds('hidden'); this.displayLightbox("block"); }, @@ -84,7 +85,7 @@ lightbox.prototype = { bod = document.getElementsByTagName('body')[0]; bod.style.height = height; bod.style.overflow = overflow; - + htm = document.getElementsByTagName('html')[0]; htm.style.height = height; htm.style.overflow = overflow; @@ -97,7 +98,20 @@ lightbox.prototype = { selects[i].style.visibility = visibility; } }, - + + // In FF, objects and embeds elements hover on top of the lightbox + hideObjectsAndEmbeds: function(visibility){ + var f = function(collection) { + for(i = 0; i < collection.length; i++) { + if (collection[i].style) { + collection[i].style.visibility = visibility; + } + } + }; + f(document.getElementsByTagName('object')); + f(document.getElementsByTagName('embed')); + }, + // Taken from lightbox implementation found at http://www.huddletogether.com/projects/lightbox/ getScroll: function(){ if (self.pageYOffset) { @@ -122,8 +136,8 @@ lightbox.prototype = { // Begin Ajax request based off of the href of the clicked linked loadInfo: function() { var myAjax = new Ajax.Request( - this.content, - {method: 'post', parameters: "", onComplete: this.processInfo.bindAsEventListener(this)} + this.content, + {method: 'post', parameters: "", onComplete: this.processInfo.bindAsEventListener(this)} ); }, @@ -168,7 +182,7 @@ lightbox.prototype = { this.prepareIE("auto", "auto"); this.hideSelects("visible"); } - + this.hideObjectsAndEmbeds("visible"); this.displayLightbox("none"); } } -- libgit2 0.21.2