diff --git a/Changelog.md b/Changelog.md index 5ea4158c1..5ae16c5c8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -20,6 +20,7 @@ * Gracefully handle XML parse errors within federation [#5991](https://github.com/diaspora/diaspora/pull/5991) * Remove zip-zip workaround gem [#6001](https://github.com/diaspora/diaspora/pull/6001) * Cleanup and reorganize image assets [#6004](https://github.com/diaspora/diaspora/pull/6004) +* Replace vendored assets for facebox by gem [#6005](https://github.com/diaspora/diaspora/pull/6005) ## Bug fixes * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) diff --git a/Gemfile b/Gemfile index 537928c80..0b7ad9875 100644 --- a/Gemfile +++ b/Gemfile @@ -112,6 +112,8 @@ source "https://rails-assets.org" do gem "rails-assets-jakobmattsson--jquery-elastic", "1.6.11" end +gem "facebox-rails", "0.2.0" + # Localization gem "http_accept_language", "2.0.5" diff --git a/Gemfile.lock b/Gemfile.lock index cfd7d8e8d..363901f12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,6 +182,9 @@ GEM sigar (~> 0.7.2) state_machine thor + facebox-rails (0.2.0) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) factory_girl (4.5.0) activesupport (>= 3.0.0) factory_girl_rails (4.5.0) @@ -746,6 +749,7 @@ DEPENDENCIES diaspora-vines (~> 0.1.27) entypo-rails (= 2.2.3) eye (= 0.7.pre) + facebox-rails (= 0.2.0) factory_girl_rails (= 4.5.0) faraday (= 0.9.1) faraday-cookie_jar (= 0.0.6) diff --git a/app/assets/images/facebox/closelabel.png b/app/assets/images/facebox/closelabel.png deleted file mode 100644 index cd0445580..000000000 Binary files a/app/assets/images/facebox/closelabel.png and /dev/null differ diff --git a/app/assets/images/facebox/loading.gif b/app/assets/images/facebox/loading.gif deleted file mode 100644 index f864d5fd3..000000000 Binary files a/app/assets/images/facebox/loading.gif and /dev/null differ diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 7114600e6..58f9db688 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -12,7 +12,7 @@ //= require jquery.charcount //= require jquery-placeholder //= require rails-timeago -//= require facebox +//= require jquery.facebox //= require browser_detection //= require jquery.events.input //= require jakobmattsson-jquery-elastic diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index a4f8ce423..3638522c2 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -47,7 +47,7 @@ /* conversations */ @import 'conversations'; -@import 'vendor/facebox'; +@import 'jquery.facebox'; @import 'facebox'; /* publisher */ diff --git a/app/assets/stylesheets/vendor/facebox.css b/app/assets/stylesheets/vendor/facebox.css deleted file mode 100644 index 511a9ef36..000000000 --- a/app/assets/stylesheets/vendor/facebox.css +++ /dev/null @@ -1,72 +0,0 @@ -#facebox { - position: absolute; - top: 0; - left: 0; - z-index: 100; - text-align: left; -} - -#facebox .popup{ - position:relative; - border:1px solid #999; - border-radius:2px; - box-shadow:0 0 10px rgba(0,0,0,0.8), 0 2px 200px rgba(255,255,255,0.2);; -} - -#facebox .content { - display:table; - width: 370px; - padding: 20px; - background: #fff; - border-radius:2px; -} - -#facebox .content > p:first-child{ - margin-top:0; -} -#facebox .content > p:last-child{ - margin-bottom:0; -} - -#facebox .close{ - position:absolute; - top:15px; - right:20px; - padding:2px; -} -#facebox .close img{ - opacity:0.3; -} -#facebox .close:hover img{ - opacity:1.0; -} - -#facebox .loading { - text-align: center; -} - -#facebox .image { - text-align: center; -} - -#facebox img { - border: 0; - margin: 0; -} - -#facebox_overlay { - position: fixed; - top: 0px; - left: 0px; - height:100%; - width:100%; -} - -.facebox_hide { - z-index:-100; -} - -.facebox_overlayBG { - background-color: #000; - z-index: 99; -} diff --git a/vendor/assets/javascripts/facebox.js b/vendor/assets/javascripts/facebox.js deleted file mode 100644 index 763aa5a8d..000000000 --- a/vendor/assets/javascripts/facebox.js +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Facebox (for jQuery) - * version: 1.3 - * @requires jQuery v1.2 or later - * @homepage https://github.com/defunkt/facebox - * - * Licensed under the MIT: - * http://www.opensource.org/licenses/mit-license.php - * - * Copyright Forever Chris Wanstrath, Kyle Neath - * - * Usage: - * - * jQuery(document).ready(function() { - * jQuery('a[rel*=facebox]').facebox() - * }) - * - * Terms - * Loads the #terms div in the box - * - * Terms - * Loads the terms.html page in the box - * - * Terms - * Loads the terms.png image in the box - * - * - * You can also use it programmatically: - * - * jQuery.facebox('some html') - * jQuery.facebox('some html', 'my-groovy-style') - * - * The above will open a facebox with "some html" as the content. - * - * jQuery.facebox(function($) { - * $.get('blah.html', function(data) { $.facebox(data) }) - * }) - * - * The above will show a loading screen before the passed function is called, - * allowing for a better ajaxy experience. - * - * The facebox function can also display an ajax page, an image, or the contents of a div: - * - * jQuery.facebox({ ajax: 'remote.html' }) - * jQuery.facebox({ ajax: 'remote.html' }, 'my-groovy-style') - * jQuery.facebox({ image: 'stairs.jpg' }) - * jQuery.facebox({ image: 'stairs.jpg' }, 'my-groovy-style') - * jQuery.facebox({ div: '#box' }) - * jQuery.facebox({ div: '#box' }, 'my-groovy-style') - * - * Want to close the facebox? Trigger the 'close.facebox' document event: - * - * jQuery(document).trigger('close.facebox') - * - * Facebox also has a bunch of other hooks: - * - * loading.facebox - * beforeReveal.facebox - * reveal.facebox (aliased as 'afterReveal.facebox') - * init.facebox - * afterClose.facebox - * - * Simply bind a function to any of these hooks: - * - * $(document).bind('reveal.facebox', function() { ...stuff to do after the facebox and contents are revealed... }) - * - */ -(function($) { - $.facebox = function(data, klass) { - $.facebox.loading() - - if (data.ajax) fillFaceboxFromAjax(data.ajax, klass) - else if (data.image) fillFaceboxFromImage(data.image, klass) - else if (data.div) fillFaceboxFromHref(data.div, klass) - else if ($.isFunction(data)) data.call($) - else $.facebox.reveal(data, klass) - } - - /* - * Public, $.facebox methods - */ - - $.extend($.facebox, { - settings: { - opacity : 0.2, - overlay : true, - loadingImage : '/facebox/loading.gif', - closeImage : '/facebox/closelabel.png', - imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ], - faceboxHtml : '\ -
' - }, - - loading: function() { - init() - if ($('#facebox .loading').length == 1) return true - showOverlay() - - $('#facebox .content').empty(). - append('