mirador_rails 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/app/controllers/mirador_rails/locales_controller.rb +10 -0
  4. data/config/routes.rb +7 -0
  5. data/lib/mirador_rails/exceptions.rb +6 -0
  6. data/lib/mirador_rails/locale.rb +24 -0
  7. data/lib/mirador_rails/version.rb +1 -1
  8. data/lib/mirador_rails.rb +9 -2
  9. data/mirador_rails.gemspec +3 -0
  10. data/tasks/mirador_rails.rake +44 -10
  11. data/vendor/assets/images/border_type_4.png +0 -0
  12. data/vendor/assets/images/border_type_5.png +0 -0
  13. data/vendor/assets/javascripts/mirador/mirador.js.erb +20105 -0
  14. data/vendor/assets/javascripts/mirador.js +4 -1
  15. data/vendor/assets/locales/de/translation.json +3 -0
  16. data/vendor/assets/locales/en/translation.json +11 -7
  17. data/vendor/assets/locales/ko/translation.json +18 -9
  18. data/vendor/assets/stylesheets/enhancements.scss +36 -0
  19. data/vendor/assets/stylesheets/mirador-combined.css +1488 -1642
  20. data/vendor/assets/stylesheets/mirador.css +1 -0
  21. metadata +52 -174
  22. data/vendor/assets/javascripts/mirador.min.js +0 -89
  23. data/vendor/assets/javascripts/mirador.min.js.map +0 -1
  24. data/vendor/assets/plugins/plugins/advlist/plugin.js +0 -97
  25. data/vendor/assets/plugins/plugins/advlist/plugin.min.js +0 -1
  26. data/vendor/assets/plugins/plugins/anchor/plugin.js +0 -45
  27. data/vendor/assets/plugins/plugins/anchor/plugin.min.js +0 -1
  28. data/vendor/assets/plugins/plugins/autolink/plugin.js +0 -194
  29. data/vendor/assets/plugins/plugins/autolink/plugin.min.js +0 -1
  30. data/vendor/assets/plugins/plugins/autoresize/plugin.js +0 -152
  31. data/vendor/assets/plugins/plugins/autoresize/plugin.min.js +0 -1
  32. data/vendor/assets/plugins/plugins/autosave/plugin.js +0 -165
  33. data/vendor/assets/plugins/plugins/autosave/plugin.min.js +0 -1
  34. data/vendor/assets/plugins/plugins/bbcode/plugin.js +0 -123
  35. data/vendor/assets/plugins/plugins/bbcode/plugin.min.js +0 -1
  36. data/vendor/assets/plugins/plugins/charmap/plugin.js +0 -370
  37. data/vendor/assets/plugins/plugins/charmap/plugin.min.js +0 -1
  38. data/vendor/assets/plugins/plugins/code/plugin.js +0 -60
  39. data/vendor/assets/plugins/plugins/code/plugin.min.js +0 -1
  40. data/vendor/assets/plugins/plugins/colorpicker/plugin.js +0 -112
  41. data/vendor/assets/plugins/plugins/colorpicker/plugin.min.js +0 -1
  42. data/vendor/assets/plugins/plugins/compat3x/css/dialog.css +0 -118
  43. data/vendor/assets/plugins/plugins/compat3x/img/buttons.png +0 -0
  44. data/vendor/assets/plugins/plugins/compat3x/img/icons.gif +0 -0
  45. data/vendor/assets/plugins/plugins/compat3x/img/items.gif +0 -0
  46. data/vendor/assets/plugins/plugins/compat3x/img/menu_arrow.gif +0 -0
  47. data/vendor/assets/plugins/plugins/compat3x/img/menu_check.gif +0 -0
  48. data/vendor/assets/plugins/plugins/compat3x/img/progress.gif +0 -0
  49. data/vendor/assets/plugins/plugins/compat3x/img/tabs.gif +0 -0
  50. data/vendor/assets/plugins/plugins/compat3x/plugin.js +0 -297
  51. data/vendor/assets/plugins/plugins/compat3x/plugin.min.js +0 -1
  52. data/vendor/assets/plugins/plugins/compat3x/tiny_mce_popup.js +0 -542
  53. data/vendor/assets/plugins/plugins/compat3x/utils/editable_selects.js +0 -70
  54. data/vendor/assets/plugins/plugins/compat3x/utils/form_utils.js +0 -210
  55. data/vendor/assets/plugins/plugins/compat3x/utils/mctabs.js +0 -164
  56. data/vendor/assets/plugins/plugins/compat3x/utils/validate.js +0 -252
  57. data/vendor/assets/plugins/plugins/contextmenu/plugin.js +0 -87
  58. data/vendor/assets/plugins/plugins/contextmenu/plugin.min.js +0 -1
  59. data/vendor/assets/plugins/plugins/directionality/plugin.js +0 -64
  60. data/vendor/assets/plugins/plugins/directionality/plugin.min.js +0 -1
  61. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cool.gif +0 -0
  62. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cry.gif +0 -0
  63. data/vendor/assets/plugins/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  64. data/vendor/assets/plugins/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  65. data/vendor/assets/plugins/plugins/emoticons/img/smiley-frown.gif +0 -0
  66. data/vendor/assets/plugins/plugins/emoticons/img/smiley-innocent.gif +0 -0
  67. data/vendor/assets/plugins/plugins/emoticons/img/smiley-kiss.gif +0 -0
  68. data/vendor/assets/plugins/plugins/emoticons/img/smiley-laughing.gif +0 -0
  69. data/vendor/assets/plugins/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  70. data/vendor/assets/plugins/plugins/emoticons/img/smiley-sealed.gif +0 -0
  71. data/vendor/assets/plugins/plugins/emoticons/img/smiley-smile.gif +0 -0
  72. data/vendor/assets/plugins/plugins/emoticons/img/smiley-surprised.gif +0 -0
  73. data/vendor/assets/plugins/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  74. data/vendor/assets/plugins/plugins/emoticons/img/smiley-undecided.gif +0 -0
  75. data/vendor/assets/plugins/plugins/emoticons/img/smiley-wink.gif +0 -0
  76. data/vendor/assets/plugins/plugins/emoticons/img/smiley-yell.gif +0 -0
  77. data/vendor/assets/plugins/plugins/emoticons/plugin.js +0 -65
  78. data/vendor/assets/plugins/plugins/emoticons/plugin.min.js +0 -1
  79. data/vendor/assets/plugins/plugins/example/dialog.html +0 -8
  80. data/vendor/assets/plugins/plugins/example/plugin.js +0 -68
  81. data/vendor/assets/plugins/plugins/example/plugin.min.js +0 -1
  82. data/vendor/assets/plugins/plugins/example_dependency/plugin.js +0 -22
  83. data/vendor/assets/plugins/plugins/example_dependency/plugin.min.js +0 -1
  84. data/vendor/assets/plugins/plugins/fullpage/plugin.js +0 -490
  85. data/vendor/assets/plugins/plugins/fullpage/plugin.min.js +0 -1
  86. data/vendor/assets/plugins/plugins/fullscreen/plugin.js +0 -136
  87. data/vendor/assets/plugins/plugins/fullscreen/plugin.min.js +0 -1
  88. data/vendor/assets/plugins/plugins/hr/plugin.js +0 -30
  89. data/vendor/assets/plugins/plugins/hr/plugin.min.js +0 -1
  90. data/vendor/assets/plugins/plugins/image/plugin.js +0 -439
  91. data/vendor/assets/plugins/plugins/image/plugin.min.js +0 -1
  92. data/vendor/assets/plugins/plugins/importcss/plugin.js +0 -195
  93. data/vendor/assets/plugins/plugins/importcss/plugin.min.js +0 -1
  94. data/vendor/assets/plugins/plugins/insertdatetime/plugin.js +0 -121
  95. data/vendor/assets/plugins/plugins/insertdatetime/plugin.min.js +0 -1
  96. data/vendor/assets/plugins/plugins/layer/plugin.js +0 -225
  97. data/vendor/assets/plugins/plugins/layer/plugin.min.js +0 -1
  98. data/vendor/assets/plugins/plugins/legacyoutput/plugin.js +0 -211
  99. data/vendor/assets/plugins/plugins/legacyoutput/plugin.min.js +0 -1
  100. data/vendor/assets/plugins/plugins/link/plugin.js +0 -400
  101. data/vendor/assets/plugins/plugins/link/plugin.min.js +0 -1
  102. data/vendor/assets/plugins/plugins/lists/plugin.js +0 -791
  103. data/vendor/assets/plugins/plugins/lists/plugin.min.js +0 -1
  104. data/vendor/assets/plugins/plugins/media/moxieplayer.swf +0 -0
  105. data/vendor/assets/plugins/plugins/media/plugin.js +0 -774
  106. data/vendor/assets/plugins/plugins/media/plugin.min.js +0 -1
  107. data/vendor/assets/plugins/plugins/nonbreaking/plugin.js +0 -53
  108. data/vendor/assets/plugins/plugins/nonbreaking/plugin.min.js +0 -1
  109. data/vendor/assets/plugins/plugins/noneditable/plugin.js +0 -540
  110. data/vendor/assets/plugins/plugins/noneditable/plugin.min.js +0 -1
  111. data/vendor/assets/plugins/plugins/pagebreak/plugin.js +0 -88
  112. data/vendor/assets/plugins/plugins/pagebreak/plugin.min.js +0 -1
  113. data/vendor/assets/plugins/plugins/paste/classes/Clipboard.js +0 -634
  114. data/vendor/assets/plugins/plugins/paste/classes/Plugin.js +0 -110
  115. data/vendor/assets/plugins/plugins/paste/classes/Quirks.js +0 -159
  116. data/vendor/assets/plugins/plugins/paste/classes/Utils.js +0 -130
  117. data/vendor/assets/plugins/plugins/paste/classes/WordFilter.js +0 -493
  118. data/vendor/assets/plugins/plugins/paste/plugin.dev.js +0 -120
  119. data/vendor/assets/plugins/plugins/paste/plugin.js +0 -1625
  120. data/vendor/assets/plugins/plugins/paste/plugin.min.js +0 -1
  121. data/vendor/assets/plugins/plugins/preview/plugin.js +0 -88
  122. data/vendor/assets/plugins/plugins/preview/plugin.min.js +0 -1
  123. data/vendor/assets/plugins/plugins/print/plugin.js +0 -32
  124. data/vendor/assets/plugins/plugins/print/plugin.min.js +0 -1
  125. data/vendor/assets/plugins/plugins/save/plugin.js +0 -94
  126. data/vendor/assets/plugins/plugins/save/plugin.min.js +0 -1
  127. data/vendor/assets/plugins/plugins/searchreplace/plugin.js +0 -594
  128. data/vendor/assets/plugins/plugins/searchreplace/plugin.min.js +0 -1
  129. data/vendor/assets/plugins/plugins/spellchecker/classes/DomTextMatcher.js +0 -470
  130. data/vendor/assets/plugins/plugins/spellchecker/classes/Plugin.js +0 -436
  131. data/vendor/assets/plugins/plugins/spellchecker/plugin.dev.js +0 -117
  132. data/vendor/assets/plugins/plugins/spellchecker/plugin.js +0 -996
  133. data/vendor/assets/plugins/plugins/spellchecker/plugin.min.js +0 -1
  134. data/vendor/assets/plugins/plugins/tabfocus/plugin.js +0 -120
  135. data/vendor/assets/plugins/plugins/tabfocus/plugin.min.js +0 -1
  136. data/vendor/assets/plugins/plugins/table/classes/CellSelection.js +0 -176
  137. data/vendor/assets/plugins/plugins/table/classes/Dialogs.js +0 -749
  138. data/vendor/assets/plugins/plugins/table/classes/Plugin.js +0 -422
  139. data/vendor/assets/plugins/plugins/table/classes/Quirks.js +0 -372
  140. data/vendor/assets/plugins/plugins/table/classes/TableGrid.js +0 -864
  141. data/vendor/assets/plugins/plugins/table/plugin.dev.js +0 -118
  142. data/vendor/assets/plugins/plugins/table/plugin.js +0 -2680
  143. data/vendor/assets/plugins/plugins/table/plugin.min.js +0 -1
  144. data/vendor/assets/plugins/plugins/template/plugin.js +0 -262
  145. data/vendor/assets/plugins/plugins/template/plugin.min.js +0 -1
  146. data/vendor/assets/plugins/plugins/textcolor/plugin.js +0 -272
  147. data/vendor/assets/plugins/plugins/textcolor/plugin.min.js +0 -1
  148. data/vendor/assets/plugins/plugins/textpattern/plugin.js +0 -268
  149. data/vendor/assets/plugins/plugins/textpattern/plugin.min.js +0 -1
  150. data/vendor/assets/plugins/plugins/visualblocks/css/visualblocks.css +0 -135
  151. data/vendor/assets/plugins/plugins/visualblocks/img/address.gif +0 -0
  152. data/vendor/assets/plugins/plugins/visualblocks/img/article.gif +0 -0
  153. data/vendor/assets/plugins/plugins/visualblocks/img/aside.gif +0 -0
  154. data/vendor/assets/plugins/plugins/visualblocks/img/blockquote.gif +0 -0
  155. data/vendor/assets/plugins/plugins/visualblocks/img/div.gif +0 -0
  156. data/vendor/assets/plugins/plugins/visualblocks/img/dl.gif +0 -0
  157. data/vendor/assets/plugins/plugins/visualblocks/img/figure.gif +0 -0
  158. data/vendor/assets/plugins/plugins/visualblocks/img/h1.gif +0 -0
  159. data/vendor/assets/plugins/plugins/visualblocks/img/h2.gif +0 -0
  160. data/vendor/assets/plugins/plugins/visualblocks/img/h3.gif +0 -0
  161. data/vendor/assets/plugins/plugins/visualblocks/img/h4.gif +0 -0
  162. data/vendor/assets/plugins/plugins/visualblocks/img/h5.gif +0 -0
  163. data/vendor/assets/plugins/plugins/visualblocks/img/h6.gif +0 -0
  164. data/vendor/assets/plugins/plugins/visualblocks/img/hgroup.gif +0 -0
  165. data/vendor/assets/plugins/plugins/visualblocks/img/ol.gif +0 -0
  166. data/vendor/assets/plugins/plugins/visualblocks/img/p.gif +0 -0
  167. data/vendor/assets/plugins/plugins/visualblocks/img/pre.gif +0 -0
  168. data/vendor/assets/plugins/plugins/visualblocks/img/section.gif +0 -0
  169. data/vendor/assets/plugins/plugins/visualblocks/img/ul.gif +0 -0
  170. data/vendor/assets/plugins/plugins/visualblocks/plugin.js +0 -86
  171. data/vendor/assets/plugins/plugins/visualblocks/plugin.min.js +0 -1
  172. data/vendor/assets/plugins/plugins/visualchars/plugin.js +0 -88
  173. data/vendor/assets/plugins/plugins/visualchars/plugin.min.js +0 -1
  174. data/vendor/assets/plugins/plugins/wordcount/plugin.js +0 -69
  175. data/vendor/assets/plugins/plugins/wordcount/plugin.min.js +0 -1
  176. data/vendor/assets/skins/skins/lightgray/content.inline.min.css +0 -1
  177. data/vendor/assets/skins/skins/lightgray/content.min.css +0 -1
  178. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.eot +0 -0
  179. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.svg +0 -62
  180. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  181. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.woff +0 -0
  182. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.eot +0 -0
  183. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.svg +0 -63
  184. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.ttf +0 -0
  185. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.woff +0 -0
  186. data/vendor/assets/skins/skins/lightgray/img/anchor.gif +0 -0
  187. data/vendor/assets/skins/skins/lightgray/img/loader.gif +0 -0
  188. data/vendor/assets/skins/skins/lightgray/img/object.gif +0 -0
  189. data/vendor/assets/skins/skins/lightgray/img/trans.gif +0 -0
  190. data/vendor/assets/skins/skins/lightgray/skin.ie7.min.css +0 -1
  191. data/vendor/assets/skins/skins/lightgray/skin.min.css +0 -1
  192. data/vendor/assets/themes/themes/modern/theme.js +0 -617
  193. data/vendor/assets/themes/themes/modern/theme.min.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06b7705ed53e7c5585e14c85b3bbd91968a5e8a1
4
- data.tar.gz: 16bdbe4f3722f5fe4f0730fa1d887142982fd11a
3
+ metadata.gz: 679bf3fdaa9d65a617d66b8200f1c7171524c44e
4
+ data.tar.gz: f0e4ab8e8614570b837de736a0dad548ba4a4e18
5
5
  SHA512:
6
- metadata.gz: 4dea2e72dacae6b4f8f92387f5d9f0cf21c86113c936d4aba76bef603b6ec7751bd982f4e7425211b38ab36967259d023b2e2edb5afc7baccc54cc0896775f02
7
- data.tar.gz: dc0e6dd3b7b98e3ffec5df99010bb237534bc0ddb52b9ac3f838f3434516bf45026e596e8f7910b3157be8df2523c99bea9f7648e456929b58897cdae4cf124b
6
+ metadata.gz: d73aab219e38369f8c9a7b0c7fce392a8cbf3812e51dd170c9471b47ecc4896f3210f626a3645cb03c98e6278af60f8618756a08d0dcd4025e369c99992ac6f4
7
+ data.tar.gz: 59fbe2b01f083c7283eff5187ef0de444ff16e5ff6f3292181dd204e0c37e9bfd1bfec9f86fb423a095a4f6b72e6bb96834217fdf1f59c30158c3f76ca264769
data/README.md CHANGED
@@ -20,6 +20,12 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install mirador_rails
22
22
 
23
+ ### Mount the Engine
24
+ In your `routes.rb` file mount the MiradorRails::Engine
25
+ ```ruby
26
+ mount MiradorRails::Engine, at: MiradorRails::Engine.locales_mount_path
27
+ ```
28
+
23
29
  ## Usage
24
30
 
25
31
  You can require the mirador js by requiring the following:
@@ -0,0 +1,10 @@
1
+ module MiradorRails
2
+ class LocalesController < ::ApplicationController
3
+
4
+ def locale
5
+ language = params.fetch(:locale) { I18n.default_locale.to_s }
6
+ locale = MiradorRails::Locale.new(language)
7
+ render json: locale.file_source
8
+ end
9
+ end
10
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ MiradorRails::Engine.routes.draw do
2
+ match '/:locale/translation',
3
+ to: 'mirador_rails/locales#locale',
4
+ via: :get,
5
+ as: :locales,
6
+ defaults: { format: :json }
7
+ end
@@ -0,0 +1,6 @@
1
+ module MiradorRails
2
+ module Exceptions
3
+ class LocaleNotFound < StandardError
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,24 @@
1
+ module MiradorRails
2
+ class Locale
3
+ attr_reader :language
4
+
5
+ def initialize(language)
6
+ @language = language
7
+ end
8
+
9
+ def path
10
+ "#{language}/translation.json"
11
+ end
12
+
13
+ def file_source
14
+ raise MiradorRails::Exceptions::LocaleNotFound, "Could not find #{path}" if file.blank?
15
+ file.source.force_encoding('UTF-8')
16
+ end
17
+
18
+ def file
19
+ # Rails.application.assets is `nil` in production mode (where compile assets is enabled).
20
+ # This workaround is based off of this comment: https://github.com/fphilipe/premailer-rails/issues/145#issuecomment-225992564
21
+ (Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)).find_asset(path)
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module MiradorRails
2
- VERSION = '0.3.3'
2
+ VERSION = '0.4.0'
3
3
  end
data/lib/mirador_rails.rb CHANGED
@@ -1,12 +1,19 @@
1
+ require 'mirador_rails/exceptions'
2
+ require 'mirador_rails/locale'
1
3
  require 'mirador_rails/version'
2
4
  require 'mirador_rails/view_helpers'
3
5
  require 'font-awesome-rails'
4
6
  require 'material_icons'
7
+ require 'openseadragon'
8
+ require 'jquery-rails'
9
+ require 'tinymce-rails'
5
10
 
6
11
  module MiradorRails
12
+ ##
13
+ # MiradorRails Engine
7
14
  class Engine < ::Rails::Engine
8
- initializer 'mirador_rails.precompile' do |app|
9
- app.config.assets.precompile += %w(locales/* plugins/* themes/* skins/*)
15
+ cattr_accessor :locales_mount_path do
16
+ '/locales'
10
17
  end
11
18
 
12
19
  initializer 'mirador_rails.helpers' do
@@ -23,6 +23,9 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency 'font-awesome-rails'
25
25
  spec.add_dependency 'material_icons'
26
+ spec.add_dependency 'openseadragon'
27
+ spec.add_dependency 'jquery-rails'
28
+ spec.add_dependency 'tinymce-rails'
26
29
 
27
30
  spec.add_development_dependency "bundler", "~> 1.14"
28
31
  spec.add_development_dependency "rake", "~> 10.0"
@@ -25,25 +25,59 @@ task :update, [:version] do |_t, args|
25
25
  end
26
26
  mirador_dir = File.join(tmp_dir, 'build', 'mirador')
27
27
  vendor_dir = File.join(File.expand_path('..', File.dirname(__FILE__)), 'vendor', 'assets')
28
- dirs_to_modify = %w(images locales plugins skins themes)
29
- dirs_to_remap = %w(plugins skins themes)
28
+ dirs_to_modify = %w(images locales)
30
29
 
31
30
  puts "Removing and copying #{dirs_to_modify}"
32
31
  dirs_to_modify.map { |d| FileUtils.rm_rf(File.join(vendor_dir, d)) }
33
32
  dirs_to_modify.map do |d|
34
- if dirs_to_remap.include?(d)
35
- FileUtils.mkdir_p(File.join(vendor_dir, d))
36
- FileUtils.cp_r(File.join(mirador_dir, d), File.join(vendor_dir, d, d))
37
- else
38
- FileUtils.cp_r(File.join(mirador_dir, d), File.join(vendor_dir, d))
39
- end
33
+ FileUtils.cp_r(File.join(mirador_dir, d), File.join(vendor_dir, d))
40
34
  end
41
35
 
42
36
  puts 'Copying stylesheets'
43
37
  FileUtils.cp(File.join(mirador_dir, 'css', 'mirador-combined.css') , File.join(vendor_dir, 'stylesheets'))
44
38
 
45
39
  puts 'Copying javascripts'
46
- FileUtils.cp(Dir.glob(File.join(mirador_dir, 'mirador.min.js*')), File.join(vendor_dir, 'javascripts'))
40
+ FileUtils.cp(Dir.glob(File.join(mirador_dir, 'mirador.js')), File.join(vendor_dir, 'javascripts', 'mirador'))
41
+
42
+ puts 'Updating js to use erb'
43
+ mirador_erb = File.join(vendor_dir, 'javascripts', 'mirador', 'mirador.js.erb')
44
+ mirador_js = File.join(vendor_dir, 'javascripts', 'mirador', 'mirador.js')
45
+
46
+ text = File.read(mirador_js)
47
+ puts 'Replacing images with erb tags'
48
+ content = text.gsub("var backgroundImage = _this.state.getStateProperty('buildPath') + _this.state.getStateProperty('imagesPath') + 'debut_dark.png';", "var backgroundImage = \"<%= asset_path('debut_dark.png') %>\"")
49
+
50
+ puts 'Comment out border image replacement, using SCSS instead'
51
+ content = content.gsub("el.css('background-image','url('+this.getImagePath(imageName)+')');", 'el // Comment out, using SCSS instead \1')
52
+
53
+ puts 'Replacing i18next template, with MiradorRails controller route (default)'
54
+ content = content.gsub("loadPath: _this.state.getStateProperty('buildPath') + _this.state.getStateProperty('i18nPath')+'{{lng}}/{{ns}}.json'", "loadPath: '<%= MiradorRails::Engine.locales_mount_path %>' + '/{{lng}}/{{ns}}.json'")
55
+
56
+ puts 'Removes tinymce library'
57
+ content = content.gsub(/^!function\(e,t\).*(tinymce\S*){10,}.*\/\*!\n\n handlebars/m, "/*!\n\n handlebars")
58
+
59
+ puts 'Removing OpenSeaDragon'
60
+ content = content.gsub(/\/\/! openseadragon .*\/\/# sourceMappingURL=openseadragon.js.map/m, '')
61
+
62
+ puts 'Removing jQuery'
63
+ content = content.gsub(/\/\*! jQuery v.*\/*! jQuery Migrate/m, '/*! jQuery Migrate')
64
+
65
+ puts 'Remove qtip map'
66
+ content = content.gsub("//# sourceMappingURL=jquery.qtip.min.js.map", "\n")
67
+
68
+ File.open(mirador_erb, 'w') { |f| f << content }
69
+ FileUtils.rm(mirador_js)
70
+
71
+ puts 'Removing FontAwesome from css'
72
+ css_file = File.join(vendor_dir, 'stylesheets', 'mirador-combined.css')
73
+ text = File.read(css_file)
74
+ content = text.gsub(/\/\*!\n\s\*\s\sFont Awesome.*\/*! jQuery UI/m, '/*! jQuery UI')
75
+ File.open(css_file, 'w') { |f| f << content }
47
76
 
48
- puts 'Update successful, make sure to remove the FontAwesome and MaterialIcon blocks from mirador-combined.css'
77
+ puts 'Removing MaterialIcons from css'
78
+ css_file = File.join(vendor_dir, 'stylesheets', 'mirador-combined.css')
79
+ text = File.read(css_file)
80
+ content = text.gsub(/@font-face {\s*font-family: 'Material Icons';.*}/m, '')
81
+ content = content.gsub(/\.material-icons {\s*font-family: 'Material Icons';.*}/m, '')
82
+ File.open(css_file, 'w') { |f| f << content }
49
83
  end