classiccms 0.6.3 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ $ ->
6
6
 
7
7
  class Browser
8
8
  constructor: ->
9
+ @input = $('#input').first().val()
9
10
  @p =
10
11
  images: '.images'
11
12
  image: 'img'
@@ -34,13 +35,14 @@ class Browser
34
35
  $('.'+id).show()
35
36
 
36
37
  select: () ->
37
- $('.item').click ->
38
- input = $('input').first().val()
39
- url = $(this).attr('url')
38
+ $('.item').click (event)=>
39
+ url = $(event.currentTarget).attr('url')
40
+ input = $('input[name=return]').first().val()
40
41
  if input.length > 0
41
42
  window.opener.CKEDITOR.tools.callFunction(input, url)
42
43
  else
43
- window.opener.$('#file_select').val($(this).attr('id'))
44
+ window.opener.$('#' + @input).first().val($(event.currentTarget).attr('id'))
45
+ window.opener.$("##{@input}_preview img").attr('src', $(event.currentTarget).attr('src'))
44
46
  self.close()
45
47
 
46
48
  destroy: () ->
@@ -36,6 +36,7 @@ class Sort
36
36
  }
37
37
 
38
38
  class Image
39
+ #needs a rewrite
39
40
  constructor: (input) ->
40
41
  @input = input
41
42
  @p =
@@ -48,14 +49,14 @@ class Image
48
49
  @listen()
49
50
 
50
51
  listen: ->
51
- $j('#edit_bg').slideUp()
52
- $j.get '/cms/images', (data) =>
53
- @form = $j('#edit_bg')
54
- $j('#edit_bg').after(data)
55
- @set_upload_button()
56
- $j('#' + @input.val()).addClass('selected')
57
- @select()
58
- @destroy()
52
+ #$j('#edit_bg').slideUp()
53
+ #$j.get '/cms/images', (data) =>
54
+ # @form = $j('#edit_bg')
55
+ # $j('#edit_bg').after(data)
56
+ # @set_upload_button()
57
+ # $j('#' + @input.val()).addClass('selected')
58
+ # @select()
59
+ # @destroy()
59
60
 
60
61
  destroy: () ->
61
62
  $j(@p.images + ' .image').live 'mouseover mouseout', (event) =>
@@ -3,4 +3,7 @@ module Classiccms
3
3
  $app = Dragonfly[:file].configure_with(:imagemagick)
4
4
  $app.define_macro_on_include(Mongoid::Document, :file_accessor)
5
5
  $app.server.url_format = '/files/:job/:basename.:format'
6
- end
6
+ $app.configure do |c|
7
+ c.allow_fetch_file = true
8
+ end
9
+ end
@@ -4,7 +4,7 @@ require 'bundler'
4
4
  Bundler.require
5
5
  Classiccms.boot
6
6
 
7
-
7
+ use Dragonfly::Middleware, :file
8
8
  run Rack::URLMap.new({
9
9
  '/' => Classiccms::WebsiteController,
10
10
  '/cms' => Classiccms::CMSController,
@@ -1,3 +1,3 @@
1
1
  module Classiccms #:nodoc
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
@@ -13,6 +13,7 @@
13
13
  /%link{:rel=>'stylesheet', :href=>'/cms/css/style.css', :type=> 'text/css'}
14
14
  /%link{:rel=>'stylesheet', :href=>'/cms/css/images.css', :type=> 'text/css'}
15
15
  %body#iki
16
+ %input{:type => 'hidden', :id => 'input', :value => params[:input]}
16
17
  .container{:style => 'margin-top: 20px'}
17
18
  .row
18
19
  .span4
@@ -29,7 +29,10 @@
29
29
  = select_options info.options[:options], record[key]
30
30
  - when 'image'
31
31
  %p.image_select Selecteer image
32
- %input{:type => 'hidden', :id => 'file_select', :name=> name, :value => record[key]}
32
+ %input{:type => 'hidden', :id => "file_#{key}", :name=> name, :value => record[key]}
33
+
34
+ %p{:id => "file_#{key}_preview", :style => 'float:left; clear:left;'}
35
+ %img{:src => record.send(key).thumb('50x50').url}
33
36
 
34
37
  - when 'images'
35
38
  - if record.new_record?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classiccms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-10 00:00:00.000000000 Z
12
+ date: 2012-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec