camaleon_cms 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4b0b30448fb0ace3c0211759a1cfa907b13e1be
|
4
|
+
data.tar.gz: 3405faac8eb44d08804b38be753f3f171906c707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19575dfc1efe6398d203e9d69fe65b93bd5a189497396664e78d7f775ae1160651ba9c4de4a7a4d5d3b7b6ae4935c8654c9626656bd9457dd06bc45371e0ea8d
|
7
|
+
data.tar.gz: b58471054de0c1357569b8797279ec499cd873af0fd421d13b0e940f92f26ac6110285dcd3b497da2bc37d7e1d06298d57b1a4a50fd54e3d50d987b780b9e2d0
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
* Add the gem in your Gemfile
|
29
29
|
|
30
30
|
```
|
31
|
-
gem "camaleon_cms", '>=2.3.
|
31
|
+
gem "camaleon_cms", '>=2.3.3' # Stable versions 2.2.1, 2.1.1, 2.1.0
|
32
32
|
# gem "camaleon_cms", github: 'owen2345/camaleon-cms' # current development version
|
33
33
|
```
|
34
34
|
* Only Rails 5 support
|
@@ -6,7 +6,8 @@ window["cama_init_media"] = (media_panel) ->
|
|
6
6
|
################ visualize item
|
7
7
|
show_file = (item) ->
|
8
8
|
item.addClass('selected').siblings().removeClass('selected')
|
9
|
-
data = eval("("+item.find(".data_value").val()+")")
|
9
|
+
data = item.data('eval-data') || eval("("+item.find(".data_value").val()+")")
|
10
|
+
item.data('eval-data', data)
|
10
11
|
media_info_tab_info.click()
|
11
12
|
tpl =
|
12
13
|
"<div class='p_thumb'></div>" +
|
@@ -25,22 +26,33 @@ window["cama_init_media"] = (media_panel) ->
|
|
25
26
|
media_info.html(tpl)
|
26
27
|
media_info.find(".p_thumb").html(item.find(".thumb").html())
|
27
28
|
if data["format"] == "image"
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
draw_image = ->
|
30
|
+
ww = parseInt(data['dimension'].split("x")[0])
|
31
|
+
hh = parseInt(data['dimension'].split("x")[1])
|
32
|
+
media_info.find(".p_body").append("<div class='cdimension'><b>"+I18n("button.dimension")+": </b><span>"+ww+"x"+hh+"</span></div>")
|
33
|
+
if media_panel.attr("data-dimension") # verify dimensions
|
34
|
+
btn = media_info.find(".p_footer .insert_btn")
|
35
|
+
btn.prop('disabled', true)
|
36
|
+
_ww = parseInt(media_panel.attr("data-dimension").split("x")[0])
|
37
|
+
_hh = parseInt(media_panel.attr("data-dimension").split("x")[1])
|
38
|
+
if _ww == ww && _hh == hh
|
39
|
+
btn.prop('disabled', false)
|
40
|
+
else
|
41
|
+
media_info.find(".cdimension").css("color", 'red')
|
42
|
+
cut = $("<button class='btn btn-info pull-right'><i class='fa fa-crop'></i> "+I18n("button.crop_image")+"</button>").click(->
|
43
|
+
$.fn.upload_url({url: data["url"]})
|
44
|
+
)
|
45
|
+
btn.after(cut)
|
46
|
+
|
47
|
+
if !data['dimension'] && media_panel.attr("data-dimension") # if not dimension in the image and required dimension
|
48
|
+
img = new Image()
|
49
|
+
img.onload = ->
|
50
|
+
data['dimension'] = this.width+'x'+this.height
|
51
|
+
item.data('eval-data', data)
|
52
|
+
draw_image()
|
53
|
+
img.src = data["url"]
|
54
|
+
else
|
55
|
+
draw_image()
|
44
56
|
|
45
57
|
if window["callback_media_uploader"] # trigger callback
|
46
58
|
media_info.find(".insert_btn").click ->
|
@@ -154,12 +154,15 @@ class CamaleonCms::SiteDecorator < CamaleonCms::TermTaxonomyDecorator
|
|
154
154
|
args[:locale] = @_deco_locale unless args.include?(:locale)
|
155
155
|
postfix = 'url'
|
156
156
|
postfix = 'path' if args.delete(:as_path)
|
157
|
-
|
157
|
+
skip_relative_url_root = args.delete(:skip_relative_url_root)
|
158
|
+
res = begin
|
158
159
|
h.cama_url_to_fixed("cama_root_#{postfix}", args)
|
159
160
|
rescue # undefined method `host' for nil:NilClass (called from rake:tasks)
|
160
161
|
parms = args.except(:host, :port, :locale, :as_path)
|
161
|
-
"http://#{args[:host]}#{":#{args[:port]}" if args[:port].present?}#{"/#{args[:locale]}" if args[:locale].present?}/#{"?#{parms.to_param}" if parms.present?}"
|
162
|
+
"http://#{args[:host]}#{":#{args[:port]}" if args[:port].present?}#{"/#{PluginRoutes.static_system_info['relative_url_root']}" if PluginRoutes.static_system_info['relative_url_root'].present?}#{"/#{args[:locale]}" if args[:locale].present?}/#{"?#{parms.to_param}" if parms.present?}"
|
162
163
|
end
|
164
|
+
res = res.sub("/#{PluginRoutes.static_system_info['relative_url_root']}", '') if skip_relative_url_root && PluginRoutes.static_system_info['relative_url_root'].present?
|
165
|
+
res
|
163
166
|
end
|
164
167
|
|
165
168
|
# return the path for this site
|
@@ -41,7 +41,7 @@ class CamaleonCmsLocalUploader < CamaleonCmsUploader
|
|
41
41
|
res = {
|
42
42
|
"name" => File.basename(file_path),
|
43
43
|
"key" => parse_key(file_path),
|
44
|
-
"url" => is_dir ? '' : (is_private_uploader? ? url_path.sub("#{@root_folder}/", '') : File.join(@current_site.decorate.the_url(locale: false), url_path)),
|
44
|
+
"url" => is_dir ? '' : (is_private_uploader? ? url_path.sub("#{@root_folder}/", '') : File.join(@current_site.decorate.the_url(locale: false, skip_relative_url_root: true), url_path)),
|
45
45
|
"is_folder" => is_dir,
|
46
46
|
"size" => is_dir ? 0 : File.size(file_path).round(2),
|
47
47
|
"format" => is_dir ? 'folder' : self.class.get_file_format(file_path),
|
data/lib/camaleon_cms/version.rb
CHANGED