enju_leaf 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/app/models/profile.rb +2 -2
- data/app/models/role.rb +1 -1
- data/app/views/my_accounts/_edit_credential.html.erb +23 -14
- data/app/views/profiles/show.html.erb +1 -1
- data/lib/enju_leaf/export_file.rb +2 -1
- data/lib/enju_leaf/import_file.rb +2 -1
- data/lib/enju_leaf/master_model.rb +1 -1
- data/lib/enju_leaf/user.rb +1 -1
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/enju_leaf.rb +1 -1
- data/lib/generators/enju_leaf/setup/setup_generator.rb +1 -1
- data/vendor/assets/javascripts/jquery.colorbox.js +116 -101
- data/vendor/assets/stylesheets/colorbox.css +1 -1
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 495a9c35f27e957fc76075bb6c9a65f2fe2ea27a
|
4
|
+
data.tar.gz: 2b7085c28d123459a30bad1ae16a3bfaf5de4084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92fc6f5a49e12b4117a55eb8ed87ec89e8007cdc940db4f9d37b776fc19c724a87b580007d371e19028247b44095fb0630c5b86f409fcb42c8a123e2e9dab02f
|
7
|
+
data.tar.gz: 81a037660b09b63f2e7a65a3199958e14625fbdcd7d53950d29bd4c0e2fc8c5b9c5817406399a2ef4776302bf481854b4a791d20c57f332edc12132ca569c6f3
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Next-L Enju Leaf
|
2
2
|
{<img src="https://travis-ci.org/next-l/enju_leaf.svg?branch=1.1" alt="Build Status" />}[https://travis-ci.org/next-l/enju_leaf]
|
3
|
-
{<img src="https://coveralls.io/repos/next-l/
|
3
|
+
{<img src="https://coveralls.io/repos/next-l/enju_nii/badge.svg?branch=1.1&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_nii?branch=1.1]
|
4
4
|
{<img src="https://hakiri.io/github/next-l/enju_leaf/1.1.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_leaf/1.1]
|
5
5
|
|
6
6
|
Next-L Enju Leaf は、{Project Next-L}[http://www.next-l.jp] で開発している図書館管理システムです。
|
data/app/models/profile.rb
CHANGED
@@ -14,9 +14,9 @@ class Profile < ActiveRecord::Base
|
|
14
14
|
validates_associated :user_group, :library
|
15
15
|
validates_associated :user
|
16
16
|
validates_presence_of :user_group, :library, :locale #, :user_number
|
17
|
-
validates :user_number, uniqueness: true, format: { with: /\A[0-9A-Za-z_]+\
|
17
|
+
validates :user_number, uniqueness: true, format: { with: /\A[0-9A-Za-z_]+\z/ }, allow_blank: true
|
18
18
|
validates :user_id, uniqueness: true, allow_blank: true
|
19
|
-
validates :birth_date, format: { with: /\A\d{4}-\d{1,2}-\d{1,2}\
|
19
|
+
validates :birth_date, format: { with: /\A\d{4}-\d{1,2}-\d{1,2}\z/ }, allow_blank: true
|
20
20
|
|
21
21
|
normalize_attribute :user_number
|
22
22
|
|
data/app/models/role.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Role < ActiveRecord::Base
|
2
2
|
include MasterModel
|
3
|
-
validates :name, presence: true, format: { with: /\A[A-Za-z][a-z_,]*[a-z]\
|
3
|
+
validates :name, presence: true, format: { with: /\A[A-Za-z][a-z_,]*[a-z]\z/ }
|
4
4
|
has_many :user_has_roles
|
5
5
|
has_many :users, through: :user_has_roles
|
6
6
|
after_save :clear_all_cache
|
@@ -38,7 +38,7 @@
|
|
38
38
|
<%- if current_user.has_role?('Administrator') and current_user != profile.user -%>
|
39
39
|
<%= u.select :role_id, @roles.collect{|r| [r.display_name.localize, r.id]} %>
|
40
40
|
<% else %>
|
41
|
-
<%=
|
41
|
+
<%= current_user.role.display_name.localize -%>
|
42
42
|
<% end %>
|
43
43
|
<% end %>
|
44
44
|
</div>
|
@@ -55,12 +55,14 @@
|
|
55
55
|
<%= f.text_field :full_name_transcription -%>
|
56
56
|
</div>
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
<div class="field">
|
59
|
+
<%= f.label t('activerecord.models.user_group') -%><br />
|
60
|
+
<%- if current_user.has_role?('Librarian') -%>
|
61
61
|
<%= f.select(:user_group_id, @user_groups.collect{|u| [u.display_name.localize, u.id]}) -%>
|
62
|
-
|
63
|
-
|
62
|
+
<%- else -%>
|
63
|
+
<%= current_user.profile.user_group.display_name.localize if current_user.profile.user_group -%>
|
64
|
+
<%- end -%>
|
65
|
+
</div>
|
64
66
|
|
65
67
|
<div class="field">
|
66
68
|
<%= f.label :user_number -%><br />
|
@@ -71,17 +73,24 @@
|
|
71
73
|
<%- end -%>
|
72
74
|
</div>
|
73
75
|
|
74
|
-
|
75
|
-
|
76
|
-
|
76
|
+
<div class="field">
|
77
|
+
<%= f.label t('activerecord.models.library') -%><br />
|
78
|
+
<%- if current_user.has_role?('Librarian') -%>
|
77
79
|
<%= f.select(:library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}) -%>
|
78
|
-
|
80
|
+
<% else %>
|
81
|
+
<%= current_user.profile.library.display_name.localize if current_user.profile.library %>
|
82
|
+
<% end %>
|
83
|
+
</div>
|
79
84
|
|
80
|
-
|
81
|
-
|
85
|
+
<div class="field">
|
86
|
+
<%= f.label t('role.required_role') -%><br />
|
87
|
+
<%- if current_user.has_role?('Librarian') -%>
|
82
88
|
<%= f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]}) -%>
|
83
|
-
|
84
|
-
|
89
|
+
<%- else -%>
|
90
|
+
<%= current_user.role.display_name.localize -%>
|
91
|
+
<%- end -%>
|
92
|
+
</div>
|
93
|
+
|
85
94
|
<div class="field">
|
86
95
|
<%= f.label :locale -%><br />
|
87
96
|
<%= f.select(:locale, @available_languages.collect{|language| [language.display_name.localize, language.iso_639_1]}) -%>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<% if defined?(EnjuMessage) %>
|
41
41
|
<li><%= link_to t('message.send'), new_message_path(recipient: @profile.user.username) -%></li>
|
42
42
|
<% end %>
|
43
|
-
<%- if can? :create,
|
43
|
+
<%- if can? :create, Profile -%>
|
44
44
|
<li><%= link_to t('page.new', model: t('activerecord.models.profile')), new_profile_path -%></li>
|
45
45
|
<% end %>
|
46
46
|
<%- if can? :destroy, @profile -%>
|
@@ -15,7 +15,8 @@ module ExportFile
|
|
15
15
|
module InstanceMethods
|
16
16
|
def send_message
|
17
17
|
sender = User.find(1) #system
|
18
|
-
|
18
|
+
locale = user.profile.try(:locale) || I18n.default_locale.to_s
|
19
|
+
message_template = MessageTemplate.localized_template('export_completed', locale)
|
19
20
|
request = MessageRequest.new
|
20
21
|
request.assign_attributes({sender: sender, receiver: user, message_template: message_template})
|
21
22
|
request.save_message_body
|
@@ -55,7 +55,8 @@ module ImportFile
|
|
55
55
|
# インポート完了時のメッセージを送信します。
|
56
56
|
def send_message
|
57
57
|
sender = User.find(1)
|
58
|
-
|
58
|
+
locale = user.profile.try(:locale) || I18n.default_locale.to_s
|
59
|
+
message_template = MessageTemplate.localized_template('import_completed', locale)
|
59
60
|
request = MessageRequest.new
|
60
61
|
request.assign_attributes({sender: sender, receiver: user, message_template: message_template})
|
61
62
|
request.save_message_body
|
data/lib/enju_leaf/user.rb
CHANGED
@@ -37,7 +37,7 @@ module EnjuLeaf
|
|
37
37
|
accepts_nested_attributes_for :user_has_role
|
38
38
|
|
39
39
|
validates :username, presence: true, uniqueness: true, format: {
|
40
|
-
with: /\A[0-9A-Za-z][0-9A-Za-z_\-]*[0-9A-Za-z]\
|
40
|
+
with: /\A[0-9A-Za-z][0-9A-Za-z_\-]*[0-9A-Za-z]\z/
|
41
41
|
}
|
42
42
|
validates :email, format: Devise::email_regexp, allow_blank: true, uniqueness: true
|
43
43
|
validates_date :expired_at, allow_blank: true
|
data/lib/enju_leaf/version.rb
CHANGED
data/lib/enju_leaf.rb
CHANGED
@@ -57,7 +57,7 @@ module EnjuLeaf
|
|
57
57
|
format.mobile { render template: 'page/404', status: 404 }
|
58
58
|
format.xml { render template: 'page/404', status: 404 }
|
59
59
|
format.json { render text: '{"error": "not_found"}' }
|
60
|
-
format.
|
60
|
+
format.rss { render template: 'page/404.xml', status: 404 }
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -56,7 +56,7 @@ EOS
|
|
56
56
|
""
|
57
57
|
end
|
58
58
|
gsub_file 'config/routes.rb', /devise_for :users$/, "devise_for :users, skip: [:registration]"
|
59
|
-
gsub_file 'config/initializers/devise.rb', '# config.email_regexp = /\A[^@]+@[^@]+\z/', 'config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\
|
59
|
+
gsub_file 'config/initializers/devise.rb', '# config.email_regexp = /\A[^@]+@[^@]+\z/', 'config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i'
|
60
60
|
gsub_file 'config/initializers/devise.rb', '# config.authentication_keys = [:email]', 'config.authentication_keys = [:username]'
|
61
61
|
gsub_file 'config/initializers/devise.rb', '# config.secret_key', 'config.secret_key'
|
62
62
|
gsub_file 'config/initializers/devise.rb',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
Colorbox 1.
|
2
|
+
Colorbox 1.6.3
|
3
3
|
license: MIT
|
4
4
|
http://www.jacklmoore.com/colorbox
|
5
5
|
*/
|
@@ -85,6 +85,39 @@
|
|
85
85
|
},
|
86
86
|
title: function() {
|
87
87
|
return this.title;
|
88
|
+
},
|
89
|
+
createImg: function() {
|
90
|
+
var img = new Image();
|
91
|
+
var attrs = $(this).data('cbox-img-attrs');
|
92
|
+
|
93
|
+
if (typeof attrs === 'object') {
|
94
|
+
$.each(attrs, function(key, val){
|
95
|
+
img[key] = val;
|
96
|
+
});
|
97
|
+
}
|
98
|
+
|
99
|
+
return img;
|
100
|
+
},
|
101
|
+
createIframe: function() {
|
102
|
+
var iframe = document.createElement('iframe');
|
103
|
+
var attrs = $(this).data('cbox-iframe-attrs');
|
104
|
+
|
105
|
+
if (typeof attrs === 'object') {
|
106
|
+
$.each(attrs, function(key, val){
|
107
|
+
iframe[key] = val;
|
108
|
+
});
|
109
|
+
}
|
110
|
+
|
111
|
+
if ('frameBorder' in iframe) {
|
112
|
+
iframe.frameBorder = 0;
|
113
|
+
}
|
114
|
+
if ('allowTransparency' in iframe) {
|
115
|
+
iframe.allowTransparency = "true";
|
116
|
+
}
|
117
|
+
iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching
|
118
|
+
iframe.allowFullscreen = true;
|
119
|
+
|
120
|
+
return iframe;
|
88
121
|
}
|
89
122
|
},
|
90
123
|
|
@@ -92,7 +125,7 @@
|
|
92
125
|
colorbox = 'colorbox',
|
93
126
|
prefix = 'cbox',
|
94
127
|
boxElement = prefix + 'Element',
|
95
|
-
|
128
|
+
|
96
129
|
// Events
|
97
130
|
event_open = prefix + '_open',
|
98
131
|
event_load = prefix + '_load',
|
@@ -123,7 +156,7 @@
|
|
123
156
|
$close,
|
124
157
|
$groupControls,
|
125
158
|
$events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2
|
126
|
-
|
159
|
+
|
127
160
|
// Variables for cached values or use across multiple functions
|
128
161
|
settings,
|
129
162
|
interfaceHeight,
|
@@ -145,7 +178,7 @@
|
|
145
178
|
// ****************
|
146
179
|
// HELPER FUNCTIONS
|
147
180
|
// ****************
|
148
|
-
|
181
|
+
|
149
182
|
// Convenience function for creating new jQuery objects
|
150
183
|
function $tag(tag, id, css) {
|
151
184
|
var element = document.createElement(tag);
|
@@ -160,7 +193,7 @@
|
|
160
193
|
|
161
194
|
return $(element);
|
162
195
|
}
|
163
|
-
|
196
|
+
|
164
197
|
// Get the window height using innerHeight when available to avoid an issue with iOS
|
165
198
|
// http://bugs.jquery.com/ticket/6724
|
166
199
|
function winheight() {
|
@@ -204,7 +237,7 @@
|
|
204
237
|
var
|
205
238
|
max = $related.length,
|
206
239
|
newIndex = (index + increment) % max;
|
207
|
-
|
240
|
+
|
208
241
|
return (newIndex < 0) ? max + newIndex : newIndex;
|
209
242
|
}
|
210
243
|
|
@@ -212,7 +245,7 @@
|
|
212
245
|
function setSize(size, dimension) {
|
213
246
|
return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
|
214
247
|
}
|
215
|
-
|
248
|
+
|
216
249
|
// Checks an href to see if it is a photo.
|
217
250
|
// There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
|
218
251
|
function isImage(settings, url) {
|
@@ -239,7 +272,7 @@
|
|
239
272
|
|
240
273
|
function getRelated(rel) {
|
241
274
|
index = 0;
|
242
|
-
|
275
|
+
|
243
276
|
if (rel && rel !== false && rel !== 'nofollow') {
|
244
277
|
$related = $('.' + boxElement).filter(function () {
|
245
278
|
var options = $.data(this, colorbox);
|
@@ -247,7 +280,7 @@
|
|
247
280
|
return (settings.get('rel') === rel);
|
248
281
|
});
|
249
282
|
index = $related.index(settings.el);
|
250
|
-
|
283
|
+
|
251
284
|
// Check direct calls to Colorbox.
|
252
285
|
if (index === -1) {
|
253
286
|
$related = $related.add(settings.el);
|
@@ -297,7 +330,7 @@
|
|
297
330
|
|
298
331
|
function stop() {
|
299
332
|
clear();
|
300
|
-
|
333
|
+
|
301
334
|
$events
|
302
335
|
.unbind(event_complete, set)
|
303
336
|
.unbind(event_load, clear);
|
@@ -354,17 +387,17 @@
|
|
354
387
|
options = $(element).data(colorbox);
|
355
388
|
|
356
389
|
settings = new Settings(element, options);
|
357
|
-
|
390
|
+
|
358
391
|
getRelated(settings.get('rel'));
|
359
392
|
|
360
393
|
if (!open) {
|
361
394
|
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
|
362
395
|
|
363
396
|
setClass(settings.get('className'));
|
364
|
-
|
397
|
+
|
365
398
|
// Show colorbox so the sizes can be calculated in older versions of jQuery
|
366
399
|
$box.css({visibility:'hidden', display:'block', opacity:''});
|
367
|
-
|
400
|
+
|
368
401
|
$loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
|
369
402
|
$content.css({width:'', height:''}).append($loaded);
|
370
403
|
|
@@ -380,8 +413,8 @@
|
|
380
413
|
var maxWidth = settings.get('maxWidth');
|
381
414
|
var maxHeight = settings.get('maxHeight');
|
382
415
|
|
383
|
-
settings.w = (maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth;
|
384
|
-
settings.h = (maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight;
|
416
|
+
settings.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth, 0);
|
417
|
+
settings.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight, 0);
|
385
418
|
|
386
419
|
$loaded.css({width:'', height:settings.h});
|
387
420
|
publicMethod.position();
|
@@ -392,14 +425,14 @@
|
|
392
425
|
$groupControls.add($title).hide();
|
393
426
|
|
394
427
|
$box.focus();
|
395
|
-
|
428
|
+
|
396
429
|
if (settings.get('trapFocus')) {
|
397
430
|
// Confine focus to the modal
|
398
431
|
// Uses event capturing that is not supported in IE8-
|
399
432
|
if (document.addEventListener) {
|
400
433
|
|
401
434
|
document.addEventListener('focus', trapFocus, true);
|
402
|
-
|
435
|
+
|
403
436
|
$events.one(event_closed, function () {
|
404
437
|
document.removeEventListener('focus', trapFocus, true);
|
405
438
|
});
|
@@ -420,7 +453,7 @@
|
|
420
453
|
cursor: settings.get('overlayClose') ? 'pointer' : '',
|
421
454
|
visibility: 'visible'
|
422
455
|
}).show();
|
423
|
-
|
456
|
+
|
424
457
|
if (settings.get('closeButton')) {
|
425
458
|
$close.html(settings.get('close')).appendTo($content);
|
426
459
|
} else {
|
@@ -456,7 +489,7 @@
|
|
456
489
|
);
|
457
490
|
|
458
491
|
$close = $('<button type="button"/>').attr({id:prefix+'Close'});
|
459
|
-
|
492
|
+
|
460
493
|
$wrap.append( // The 3x3 Grid that makes up Colorbox
|
461
494
|
$tag(div).append(
|
462
495
|
$tag(div, "TopLeft"),
|
@@ -474,9 +507,9 @@
|
|
474
507
|
$tag(div, "BottomRight")
|
475
508
|
)
|
476
509
|
).find('div div').css({'float': 'left'});
|
477
|
-
|
510
|
+
|
478
511
|
$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
|
479
|
-
|
512
|
+
|
480
513
|
$groupControls = $next.add($prev).add($current).add($slideshow);
|
481
514
|
}
|
482
515
|
if (document.body && !$box.parent().length) {
|
@@ -514,7 +547,7 @@
|
|
514
547
|
publicMethod.close();
|
515
548
|
}
|
516
549
|
});
|
517
|
-
|
550
|
+
|
518
551
|
// Key Bindings
|
519
552
|
$(document).bind('keydown.' + prefix, function (e) {
|
520
553
|
var key = e.keyCode;
|
@@ -562,7 +595,7 @@
|
|
562
595
|
// Usage format: $.colorbox.close();
|
563
596
|
// Usage from within an iframe: parent.jQuery.colorbox.close();
|
564
597
|
// ****************
|
565
|
-
|
598
|
+
|
566
599
|
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
|
567
600
|
var settings;
|
568
601
|
var $obj = this;
|
@@ -572,15 +605,12 @@
|
|
572
605
|
if ($.isFunction($obj)) { // assume a call to $.colorbox
|
573
606
|
$obj = $('<a/>');
|
574
607
|
options.open = true;
|
575
|
-
} else if (!$obj[0]) { // colorbox being applied to empty collection
|
576
|
-
return $obj;
|
577
608
|
}
|
578
609
|
|
579
|
-
|
580
610
|
if (!$obj[0]) { // colorbox being applied to empty collection
|
581
611
|
return $obj;
|
582
612
|
}
|
583
|
-
|
613
|
+
|
584
614
|
appendHTML();
|
585
615
|
|
586
616
|
if (addBindings()) {
|
@@ -595,12 +625,12 @@
|
|
595
625
|
}).addClass(boxElement);
|
596
626
|
|
597
627
|
settings = new Settings($obj[0], options);
|
598
|
-
|
628
|
+
|
599
629
|
if (settings.get('open')) {
|
600
630
|
launch($obj[0]);
|
601
631
|
}
|
602
632
|
}
|
603
|
-
|
633
|
+
|
604
634
|
return $obj;
|
605
635
|
};
|
606
636
|
|
@@ -612,7 +642,7 @@
|
|
612
642
|
offset = $box.offset(),
|
613
643
|
scrollTop,
|
614
644
|
scrollLeft;
|
615
|
-
|
645
|
+
|
616
646
|
$window.unbind('resize.' + prefix);
|
617
647
|
|
618
648
|
// remove the modal so that it doesn't influence the document width/height
|
@@ -639,7 +669,7 @@
|
|
639
669
|
} else {
|
640
670
|
left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
|
641
671
|
}
|
642
|
-
|
672
|
+
|
643
673
|
if (settings.get('bottom') !== false) {
|
644
674
|
top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
|
645
675
|
} else if (settings.get('top') !== false) {
|
@@ -649,12 +679,12 @@
|
|
649
679
|
}
|
650
680
|
|
651
681
|
$box.css({top: offset.top, left: offset.left, visibility:'visible'});
|
652
|
-
|
682
|
+
|
653
683
|
// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
|
654
684
|
// but it has to be shrank down around the size of div#colorbox when it's done. If not,
|
655
685
|
// it can invoke an obscure IE bug when using iframes.
|
656
686
|
$wrap[0].style.width = $wrap[0].style.height = "9999px";
|
657
|
-
|
687
|
+
|
658
688
|
function modalDimensions() {
|
659
689
|
$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
|
660
690
|
$content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
|
@@ -684,13 +714,13 @@
|
|
684
714
|
duration: speed || 0,
|
685
715
|
complete: function () {
|
686
716
|
modalDimensions();
|
687
|
-
|
717
|
+
|
688
718
|
active = false;
|
689
|
-
|
719
|
+
|
690
720
|
// shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
|
691
721
|
$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
|
692
722
|
$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
|
693
|
-
|
723
|
+
|
694
724
|
if (settings.get('reposition')) {
|
695
725
|
setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
|
696
726
|
$window.bind('resize.' + prefix, publicMethod.position);
|
@@ -707,10 +737,10 @@
|
|
707
737
|
|
708
738
|
publicMethod.resize = function (options) {
|
709
739
|
var scrolltop;
|
710
|
-
|
740
|
+
|
711
741
|
if (open) {
|
712
742
|
options = options || {};
|
713
|
-
|
743
|
+
|
714
744
|
if (options.width) {
|
715
745
|
settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
|
716
746
|
}
|
@@ -720,7 +750,7 @@
|
|
720
750
|
}
|
721
751
|
|
722
752
|
$loaded.css({width: settings.w});
|
723
|
-
|
753
|
+
|
724
754
|
if (options.height) {
|
725
755
|
settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
|
726
756
|
}
|
@@ -740,7 +770,7 @@
|
|
740
770
|
if(scrolltop) {
|
741
771
|
$loaded.scrollTop(scrolltop);
|
742
772
|
}
|
743
|
-
|
773
|
+
|
744
774
|
publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
|
745
775
|
}
|
746
776
|
};
|
@@ -749,13 +779,13 @@
|
|
749
779
|
if (!open) {
|
750
780
|
return;
|
751
781
|
}
|
752
|
-
|
782
|
+
|
753
783
|
var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
|
754
784
|
|
755
785
|
$loaded.remove();
|
756
786
|
|
757
787
|
$loaded = $tag(div, 'LoadedContent').append(object);
|
758
|
-
|
788
|
+
|
759
789
|
function getWidth() {
|
760
790
|
settings.w = settings.w || $loaded.width();
|
761
791
|
settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
|
@@ -766,17 +796,17 @@
|
|
766
796
|
settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
|
767
797
|
return settings.h;
|
768
798
|
}
|
769
|
-
|
799
|
+
|
770
800
|
$loaded.hide()
|
771
801
|
.appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
|
772
802
|
.css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
|
773
803
|
.css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
|
774
804
|
.prependTo($content);
|
775
|
-
|
805
|
+
|
776
806
|
$loadingBay.hide();
|
777
|
-
|
807
|
+
|
778
808
|
// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
|
779
|
-
|
809
|
+
|
780
810
|
$(photo).css({'float': 'none'});
|
781
811
|
|
782
812
|
setClass(settings.get('className'));
|
@@ -785,17 +815,17 @@
|
|
785
815
|
var total = $related.length,
|
786
816
|
iframe,
|
787
817
|
complete;
|
788
|
-
|
818
|
+
|
789
819
|
if (!open) {
|
790
820
|
return;
|
791
821
|
}
|
792
|
-
|
822
|
+
|
793
823
|
function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
|
794
824
|
if ($.support.opacity === false) {
|
795
825
|
$box[0].style.removeAttribute('filter');
|
796
826
|
}
|
797
827
|
}
|
798
|
-
|
828
|
+
|
799
829
|
complete = function () {
|
800
830
|
clearTimeout(loadingTimer);
|
801
831
|
$loadingOverlay.hide();
|
@@ -803,20 +833,20 @@
|
|
803
833
|
settings.get('onComplete');
|
804
834
|
};
|
805
835
|
|
806
|
-
|
836
|
+
|
807
837
|
$title.html(settings.get('title')).show();
|
808
838
|
$loaded.show();
|
809
|
-
|
839
|
+
|
810
840
|
if (total > 1) { // handle grouping
|
811
841
|
if (typeof settings.get('current') === "string") {
|
812
842
|
$current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
|
813
843
|
}
|
814
|
-
|
844
|
+
|
815
845
|
$next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
|
816
846
|
$prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
|
817
|
-
|
847
|
+
|
818
848
|
slideshow();
|
819
|
-
|
849
|
+
|
820
850
|
// Preloads images within a rel group
|
821
851
|
if (settings.get('preloading')) {
|
822
852
|
$.each([getIndex(-1), getIndex(1)], function(){
|
@@ -835,32 +865,23 @@
|
|
835
865
|
} else {
|
836
866
|
$groupControls.hide();
|
837
867
|
}
|
838
|
-
|
868
|
+
|
839
869
|
if (settings.get('iframe')) {
|
840
|
-
|
841
|
-
|
842
|
-
if ('frameBorder' in iframe) {
|
843
|
-
iframe.frameBorder = 0;
|
844
|
-
}
|
845
|
-
|
846
|
-
if ('allowTransparency' in iframe) {
|
847
|
-
iframe.allowTransparency = "true";
|
848
|
-
}
|
870
|
+
|
871
|
+
iframe = settings.get('createIframe');
|
849
872
|
|
850
873
|
if (!settings.get('scrolling')) {
|
851
874
|
iframe.scrolling = "no";
|
852
875
|
}
|
853
|
-
|
876
|
+
|
854
877
|
$(iframe)
|
855
878
|
.attr({
|
856
879
|
src: settings.get('href'),
|
857
|
-
|
858
|
-
'class': prefix + 'Iframe',
|
859
|
-
allowFullScreen : true // allow HTML5 video to go fullscreen
|
880
|
+
'class': prefix + 'Iframe'
|
860
881
|
})
|
861
882
|
.one('load', complete)
|
862
883
|
.appendTo($loaded);
|
863
|
-
|
884
|
+
|
864
885
|
$events.one(event_purge, function () {
|
865
886
|
iframe.src = "//about:blank";
|
866
887
|
});
|
@@ -871,14 +892,14 @@
|
|
871
892
|
} else {
|
872
893
|
complete();
|
873
894
|
}
|
874
|
-
|
895
|
+
|
875
896
|
if (settings.get('transition') === 'fade') {
|
876
897
|
$box.fadeTo(speed, 1, removeFilter);
|
877
898
|
} else {
|
878
899
|
removeFilter();
|
879
900
|
}
|
880
901
|
};
|
881
|
-
|
902
|
+
|
882
903
|
if (settings.get('transition') === 'fade') {
|
883
904
|
$box.fadeTo(speed, 0, function () {
|
884
905
|
publicMethod.position(0, callback);
|
@@ -890,27 +911,27 @@
|
|
890
911
|
|
891
912
|
function load () {
|
892
913
|
var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
|
893
|
-
|
914
|
+
|
894
915
|
active = true;
|
895
|
-
|
916
|
+
|
896
917
|
photo = false;
|
897
|
-
|
918
|
+
|
898
919
|
trigger(event_purge);
|
899
920
|
trigger(event_load);
|
900
921
|
settings.get('onLoad');
|
901
|
-
|
922
|
+
|
902
923
|
settings.h = settings.get('height') ?
|
903
924
|
setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
|
904
925
|
settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
|
905
|
-
|
926
|
+
|
906
927
|
settings.w = settings.get('width') ?
|
907
928
|
setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
|
908
929
|
settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
|
909
|
-
|
930
|
+
|
910
931
|
// Sets the minimum dimensions for use in image scaling
|
911
932
|
settings.mw = settings.w;
|
912
933
|
settings.mh = settings.h;
|
913
|
-
|
934
|
+
|
914
935
|
// Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
|
915
936
|
// If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
|
916
937
|
if (settings.get('maxWidth')) {
|
@@ -921,13 +942,13 @@
|
|
921
942
|
settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
|
922
943
|
settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
|
923
944
|
}
|
924
|
-
|
945
|
+
|
925
946
|
href = settings.get('href');
|
926
|
-
|
947
|
+
|
927
948
|
loadingTimer = setTimeout(function () {
|
928
949
|
$loadingOverlay.show();
|
929
950
|
}, 100);
|
930
|
-
|
951
|
+
|
931
952
|
if (settings.get('inline')) {
|
932
953
|
var $target = $(href);
|
933
954
|
// Inserts an empty placeholder where inline content is being pulled from.
|
@@ -949,11 +970,11 @@
|
|
949
970
|
|
950
971
|
href = retinaUrl(settings, href);
|
951
972
|
|
952
|
-
photo =
|
973
|
+
photo = settings.get('createImg');
|
953
974
|
|
954
975
|
$(photo)
|
955
976
|
.addClass(prefix + 'Photo')
|
956
|
-
.bind('error',function () {
|
977
|
+
.bind('error.'+prefix,function () {
|
957
978
|
prep($tag(div, 'Error').html(settings.get('imgError')));
|
958
979
|
})
|
959
980
|
.one('load', function () {
|
@@ -961,18 +982,11 @@
|
|
961
982
|
return;
|
962
983
|
}
|
963
984
|
|
964
|
-
// A small pause because some browsers will occassionaly report a
|
985
|
+
// A small pause because some browsers will occassionaly report a
|
965
986
|
// img.width and img.height of zero immediately after the img.onload fires
|
966
987
|
setTimeout(function(){
|
967
988
|
var percent;
|
968
989
|
|
969
|
-
$.each(['alt', 'longdesc', 'aria-describedby'], function(i,val){
|
970
|
-
var attr = $(settings.el).attr(val) || $(settings.el).attr('data-'+val);
|
971
|
-
if (attr) {
|
972
|
-
photo.setAttribute(val, attr);
|
973
|
-
}
|
974
|
-
});
|
975
|
-
|
976
990
|
if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
|
977
991
|
photo.height = photo.height / window.devicePixelRatio;
|
978
992
|
photo.width = photo.width / window.devicePixelRatio;
|
@@ -992,16 +1006,17 @@
|
|
992
1006
|
setResize();
|
993
1007
|
}
|
994
1008
|
}
|
995
|
-
|
1009
|
+
|
996
1010
|
if (settings.h) {
|
997
1011
|
photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
|
998
1012
|
}
|
999
|
-
|
1013
|
+
|
1000
1014
|
if ($related[1] && (settings.get('loop') || $related[index + 1])) {
|
1001
1015
|
photo.style.cursor = 'pointer';
|
1002
|
-
|
1016
|
+
|
1017
|
+
$(photo).bind('click.'+prefix, function () {
|
1003
1018
|
publicMethod.next();
|
1004
|
-
};
|
1019
|
+
});
|
1005
1020
|
}
|
1006
1021
|
|
1007
1022
|
photo.style.width = photo.width + 'px';
|
@@ -1009,7 +1024,7 @@
|
|
1009
1024
|
prep(photo);
|
1010
1025
|
}, 1);
|
1011
1026
|
});
|
1012
|
-
|
1027
|
+
|
1013
1028
|
photo.src = href;
|
1014
1029
|
|
1015
1030
|
} else if (href) {
|
@@ -1020,7 +1035,7 @@
|
|
1020
1035
|
});
|
1021
1036
|
}
|
1022
1037
|
}
|
1023
|
-
|
1038
|
+
|
1024
1039
|
// Navigates to the next page/image in a set.
|
1025
1040
|
publicMethod.next = function () {
|
1026
1041
|
if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
|
@@ -1028,7 +1043,7 @@
|
|
1028
1043
|
launch($related[index]);
|
1029
1044
|
}
|
1030
1045
|
};
|
1031
|
-
|
1046
|
+
|
1032
1047
|
publicMethod.prev = function () {
|
1033
1048
|
if (!active && $related[1] && (settings.get('loop') || index)) {
|
1034
1049
|
index = getIndex(-1);
|
@@ -1039,20 +1054,20 @@
|
|
1039
1054
|
// Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
|
1040
1055
|
publicMethod.close = function () {
|
1041
1056
|
if (open && !closing) {
|
1042
|
-
|
1057
|
+
|
1043
1058
|
closing = true;
|
1044
1059
|
open = false;
|
1045
1060
|
trigger(event_cleanup);
|
1046
1061
|
settings.get('onCleanup');
|
1047
1062
|
$window.unbind('.' + prefix);
|
1048
1063
|
$overlay.fadeTo(settings.get('fadeOut') || 0, 0);
|
1049
|
-
|
1064
|
+
|
1050
1065
|
$box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
|
1051
1066
|
$box.hide();
|
1052
1067
|
$overlay.hide();
|
1053
1068
|
trigger(event_purge);
|
1054
1069
|
$loaded.remove();
|
1055
|
-
|
1070
|
+
|
1056
1071
|
setTimeout(function () {
|
1057
1072
|
closing = false;
|
1058
1073
|
trigger(event_closed);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Colorbox Core Style:
|
3
3
|
The following CSS is consistent between example themes and should not be altered.
|
4
4
|
*/
|
5
|
-
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
|
5
|
+
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
|
6
6
|
#cboxWrapper {max-width:none;}
|
7
7
|
#cboxOverlay{position:fixed; width:100%; height:100%;}
|
8
8
|
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_leaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,42 +36,42 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.1.
|
39
|
+
version: 0.1.1
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.1.
|
46
|
+
version: 0.1.1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: enju_library
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.1.0
|
53
|
+
version: 0.1.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.1.0
|
60
|
+
version: 0.1.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: enju_manifestation_viewer
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.1.0
|
67
|
+
version: 0.1.0
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.1.0
|
74
|
+
version: 0.1.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: friendly_id
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,16 +174,16 @@ dependencies:
|
|
174
174
|
name: sunspot_rails
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
|
-
- -
|
177
|
+
- - '='
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
179
|
+
version: 2.2.0
|
180
180
|
type: :runtime
|
181
181
|
prerelease: false
|
182
182
|
version_requirements: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
|
-
- -
|
184
|
+
- - '='
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
186
|
+
version: 2.2.0
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
188
|
name: resque
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -342,16 +342,16 @@ dependencies:
|
|
342
342
|
name: statesman
|
343
343
|
requirement: !ruby/object:Gem::Requirement
|
344
344
|
requirements:
|
345
|
-
- - "
|
345
|
+
- - "~>"
|
346
346
|
- !ruby/object:Gem::Version
|
347
|
-
version: '
|
347
|
+
version: '1.3'
|
348
348
|
type: :runtime
|
349
349
|
prerelease: false
|
350
350
|
version_requirements: !ruby/object:Gem::Requirement
|
351
351
|
requirements:
|
352
|
-
- - "
|
352
|
+
- - "~>"
|
353
353
|
- !ruby/object:Gem::Version
|
354
|
-
version: '
|
354
|
+
version: '1.3'
|
355
355
|
- !ruby/object:Gem::Dependency
|
356
356
|
name: kramdown
|
357
357
|
requirement: !ruby/object:Gem::Requirement
|
@@ -414,56 +414,56 @@ dependencies:
|
|
414
414
|
requirements:
|
415
415
|
- - "~>"
|
416
416
|
- !ruby/object:Gem::Version
|
417
|
-
version: '3.
|
417
|
+
version: '3.4'
|
418
418
|
type: :development
|
419
419
|
prerelease: false
|
420
420
|
version_requirements: !ruby/object:Gem::Requirement
|
421
421
|
requirements:
|
422
422
|
- - "~>"
|
423
423
|
- !ruby/object:Gem::Version
|
424
|
-
version: '3.
|
424
|
+
version: '3.4'
|
425
425
|
- !ruby/object:Gem::Dependency
|
426
426
|
name: enju_circulation
|
427
427
|
requirement: !ruby/object:Gem::Requirement
|
428
428
|
requirements:
|
429
429
|
- - "~>"
|
430
430
|
- !ruby/object:Gem::Version
|
431
|
-
version: 0.1.0
|
431
|
+
version: 0.1.0
|
432
432
|
type: :development
|
433
433
|
prerelease: false
|
434
434
|
version_requirements: !ruby/object:Gem::Requirement
|
435
435
|
requirements:
|
436
436
|
- - "~>"
|
437
437
|
- !ruby/object:Gem::Version
|
438
|
-
version: 0.1.0
|
438
|
+
version: 0.1.0
|
439
439
|
- !ruby/object:Gem::Dependency
|
440
440
|
name: enju_bookmark
|
441
441
|
requirement: !ruby/object:Gem::Requirement
|
442
442
|
requirements:
|
443
443
|
- - "~>"
|
444
444
|
- !ruby/object:Gem::Version
|
445
|
-
version: 0.1.2
|
445
|
+
version: 0.1.2
|
446
446
|
type: :development
|
447
447
|
prerelease: false
|
448
448
|
version_requirements: !ruby/object:Gem::Requirement
|
449
449
|
requirements:
|
450
450
|
- - "~>"
|
451
451
|
- !ruby/object:Gem::Version
|
452
|
-
version: 0.1.2
|
452
|
+
version: 0.1.2
|
453
453
|
- !ruby/object:Gem::Dependency
|
454
454
|
name: enju_search_log
|
455
455
|
requirement: !ruby/object:Gem::Requirement
|
456
456
|
requirements:
|
457
457
|
- - "~>"
|
458
458
|
- !ruby/object:Gem::Version
|
459
|
-
version: 0.1.0
|
459
|
+
version: 0.1.0
|
460
460
|
type: :development
|
461
461
|
prerelease: false
|
462
462
|
version_requirements: !ruby/object:Gem::Requirement
|
463
463
|
requirements:
|
464
464
|
- - "~>"
|
465
465
|
- !ruby/object:Gem::Version
|
466
|
-
version: 0.1.0
|
466
|
+
version: 0.1.0
|
467
467
|
- !ruby/object:Gem::Dependency
|
468
468
|
name: vcr
|
469
469
|
requirement: !ruby/object:Gem::Requirement
|
@@ -510,16 +510,16 @@ dependencies:
|
|
510
510
|
name: sunspot_solr
|
511
511
|
requirement: !ruby/object:Gem::Requirement
|
512
512
|
requirements:
|
513
|
-
- -
|
513
|
+
- - '='
|
514
514
|
- !ruby/object:Gem::Version
|
515
|
-
version:
|
515
|
+
version: 2.2.0
|
516
516
|
type: :development
|
517
517
|
prerelease: false
|
518
518
|
version_requirements: !ruby/object:Gem::Requirement
|
519
519
|
requirements:
|
520
|
-
- -
|
520
|
+
- - '='
|
521
521
|
- !ruby/object:Gem::Version
|
522
|
-
version:
|
522
|
+
version: 2.2.0
|
523
523
|
- !ruby/object:Gem::Dependency
|
524
524
|
name: sunspot-rails-tester
|
525
525
|
requirement: !ruby/object:Gem::Requirement
|