Skip to content

Commit

Permalink
Don't merge params for pagination button
Browse files Browse the repository at this point in the history
  • Loading branch information
galetahub committed May 18, 2017
1 parent 9e30da0 commit 604608b
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 67 deletions.
110 changes: 51 additions & 59 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
arel (6.0.3)
bson (4.1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
arel (6.0.4)
bson (4.2.1)
bson_ext (1.5.1)
builder (3.2.2)
capybara (2.7.1)
builder (3.2.3)
capybara (2.14.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -61,78 +62,70 @@ GEM
json (>= 1.7)
mime-types (>= 1.16)
mimemagic (>= 0.3.0)
carrierwave-mongoid (0.9.0)
carrierwave-mongoid (0.10.0)
carrierwave (>= 0.8.0, < 0.12.0)
mongoid (>= 3.0, < 6.0)
mongoid (>= 3.0, < 7.0)
mongoid-grid_fs (>= 1.3, < 3.0)
climate_control (0.0.3)
activesupport (>= 3.0)
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coderay (1.1.1)
concurrent-ruby (1.0.2)
domain_name (0.5.20160615)
concurrent-ruby (1.0.5)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
dragonfly (1.0.12)
dragonfly (1.1.2)
addressable (~> 2.3)
multi_json (~> 1.0)
rack (>= 1.3.0)
rack (>= 1.3)
erubis (2.7.0)
globalid (0.3.6)
activesupport (>= 4.1.0)
http-cookie (1.0.2)
globalid (0.4.0)
activesupport (>= 4.2.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (0.7.0)
i18n (0.8.1)
jquery-rails (4.0.5)
rails-dom-testing (~> 1.0)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
kgio (2.10.0)
json (1.8.6)
kgio (2.11.0)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mail (2.6.5)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (2.99.2)
mimemagic (0.3.1)
mini_magick (4.5.1)
mime-types (2.99.3)
mimemagic (0.3.2)
mini_magick (4.7.0)
mini_portile2 (2.1.0)
minitest (5.9.0)
mongo (2.2.6)
bson (~> 4.0)
pry
minitest (5.10.2)
mongo (2.4.1)
bson (>= 4.2.1, < 5.0.0)
mongoid (5.0.2)
activemodel (~> 4.0)
mongo (~> 2.1)
origin (~> 2.1)
tzinfo (>= 0.3.37)
mongoid-grid_fs (2.2.2)
mongoid-grid_fs (2.3.0)
mime-types (>= 1.0, < 4.0)
mongoid (>= 3.0, < 6.0)
mongoid-paperclip (0.0.10)
mongoid (>= 3.0, < 7.0)
mongoid-paperclip (0.0.11)
mongoid
paperclip (>= 2.3.6, != 4.3.0)
multi_json (1.12.1)
mynyml-redgreen (0.7.1)
term-ansicolor (>= 1.0.4)
netrc (0.11.0)
nokogiri (1.6.8)
nokogiri (1.7.2)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
origin (2.2.0)
origin (2.3.0)
orm_adapter (0.5.0)
paperclip (5.0.0)
paperclip (5.1.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (~> 0.3.0)
pkg-config (1.1.7)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4)
public_suffix (2.0.5)
rack (1.6.8)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
Expand All @@ -150,9 +143,9 @@ GEM
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
rails-dom-testing (1.0.8)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
Expand All @@ -161,8 +154,8 @@ GEM
activesupport (= 4.2.7)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.16.0)
rake (11.2.2)
raindrops (0.18.0)
rake (12.0.0)
refile (0.6.2)
mime-types
rest-client (~> 1.8)
Expand All @@ -174,31 +167,30 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
sass (3.4.22)
sinatra (1.4.7)
sass (3.4.23)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
sprockets (3.6.3)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
term-ansicolor (1.3.2)
sqlite3 (1.3.13)
term-ansicolor (1.6.0)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
tins (1.11.0)
tzinfo (1.2.2)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.7)
tins (1.14.0)
tzinfo (1.2.3)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unf_ext (0.0.7.4)
unicorn (4.0.1)
kgio (~> 2.4)
rack
Expand Down
44 changes: 42 additions & 2 deletions app/assets/stylesheets/ckeditor/filebrowser/uploader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,46 @@ img {
text-decoration: underline;
}

.pagination, .pagination a {
text-decoration: none;
.pagination {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
height: 40px;
text-align: center;
vertical-align: middle;
}

.pagination a {
height: 40px;
width: 50%;
padding-right: 5px;
padding-left: 5px;
text-decoration: none;

background: #f8f8f8;
border-color: #f5c002;
color: #000;

position: relative;
display: inline-block;
vertical-align: middle;
line-height: 40px;
font-weight: 400;
font-size: 13px;

padding: 0 20px;

box-sizing: border-box;
border: 1px solid #bcbcbc;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-ms-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
}

.pagination a:hover {
background: #fff;
}
2 changes: 1 addition & 1 deletion app/views/ckeditor/attachment_files/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<% unless @attachments.last_page? %>
<div class="pagination">
<%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.attachment_files_path(params.merge(page: @attachments.next_page)), class: "next", rel: "next" %>
<%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.attachment_files_path(page: @attachments.next_page), class: "next", rel: "next" %>
</div>
<% end -%>

Expand Down
2 changes: 1 addition & 1 deletion app/views/ckeditor/pictures/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<% unless @pictures.last_page? %>
<div class="pagination">
<%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.pictures_path(params.merge(page: @pictures.next_page)), class: "next", rel: "next" %>
<%= link_to I18n.t("ckeditor.buttons.next"), ckeditor.pictures_path(page: @pictures.next_page), class: "next", rel: "next" %>
</div>
<% end -%>

Expand Down
3 changes: 2 additions & 1 deletion lib/ckeditor/asset_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class AssetResponse
include ActionView::Helpers::JavaScriptHelper

FUNCTION = 'window.parent.CKEDITOR.tools.callFunction'.freeze
JSON_TYPE = 'json'.freeze

attr_reader :asset, :params

Expand All @@ -19,7 +20,7 @@ def initialize(asset, request)
end

def json?
params[:responseType] == 'json'
params[:responseType] == JSON_TYPE
end

def ckeditor?
Expand Down
2 changes: 1 addition & 1 deletion lib/ckeditor/helpers/controllers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def ckeditor_attachment_files_scope(options = {})
end

def ckeditor_filebrowser_scope(options = {})
{ order: [:id, :desc] }.merge(options)
{ order: [:id, :desc] }.merge!(options)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ckeditor/orm/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def as_json(options = nil)
options = {
methods: as_json_methods,
root: 'asset'
}.merge(options || {})
}.merge!(options || {})

super(options)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ckeditor/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def js_init_ckeditor(dom_id, replace)
end

def js_fileuploader(uploader_type, options = {})
options = { multiple: true, element: 'fileupload' }.merge(options)
options = { multiple: true, element: 'fileupload' }.merge!(options)

case uploader_type.to_s.downcase
when 'image' then
Expand Down

0 comments on commit 604608b

Please sign in to comment.