refinerycms-core 0.9.9.21 → 0.9.9.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,9 +6,9 @@ module Admin
6
6
  url_params = params.reject {|key, value| key =~ /(action)|(controller)/}
7
7
 
8
8
  @iframe_src = if @dialog_type == 'image'
9
- insert_admin_images_url(url_params.merge(:id => nil, :modal => true))
9
+ insert_admin_images_path(url_params.merge(:id => nil, :modal => true))
10
10
  elsif @dialog_type == 'link'
11
- link_to_admin_pages_dialogs_url(url_params.merge(:id => nil))
11
+ link_to_admin_pages_dialogs_path(url_params.merge(:id => nil))
12
12
  end
13
13
 
14
14
  render :layout => false
@@ -1,7 +1,7 @@
1
1
  <% unless refinery_user? or
2
2
  (page_code = RefinerySetting.find_or_set(:analytics_page_code, 'UA-xxxxxx-x').to_s.strip) =~ /^(UA-xxxxxx-x)?$/ -%>
3
3
  <!-- asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet -->
4
- <script>var _gaq=[['_setAccount','<%= page_code %>'],['_trackPageview']];(function(d,t){
4
+ <script>var _gaq=[['_setAccount','<%= page_code %>'],['_trackPageview'],['_trackPageLoadTime']];(function(d,t){
5
5
  var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
6
6
  g.async=1;g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)
7
7
  }(document,'script'))</script>
@@ -3,5 +3,6 @@
3
3
  </h1>
4
4
  <%= render(:partial => "/shared/menu", :locals => {
5
5
  :dom_id => 'menu',
6
- :css => 'menu'
6
+ :css => 'menu',
7
+ :roots => @menu_pages
7
8
  }) %>
@@ -2,17 +2,20 @@
2
2
  dom_id ||= 'menu'
3
3
  caching = (cache_menu ||= RefinerySetting.find_or_set(:cache_menu, false))
4
4
  cache_key = [Refinery.base_cache_key, 'pages_menus', dom_id, Globalize.locale].join('_')
5
- # cache the pages first
6
- collection = if caching
7
- Rails.cache.fetch(cache_key) { (collection ||= @menu_pages).to_a }
8
- else
9
- (collection ||= @menu_pages).to_a
10
- end
11
5
 
12
6
  # cache the generation of the menu based on the pages.
13
7
  cache_if(caching, ([cache_key, cache_path ||= request.path].join('_'))) do
8
+ # cache the pages first
9
+ if caching
10
+ collection = Rails.cache.fetch(cache_key) { (collection ||= @menu_pages).to_a }
11
+ roots = local_assigns[:roots] || Rails.cache.fetch([cache_key, "roots"].join("_")) { roots = collection.select{|c| c.parent_id.nil?} } unless roots
12
+ else
13
+ collection ||= @menu_pages
14
+ roots = local_assigns[:roots] || collection.select{|c| c.parent_id.nil?}
15
+ end
16
+
14
17
  # Select top menu items unless 'roots' is supplied.
15
- if (roots ||= collection.select{|c| c.parent_id.nil?}).present?
18
+ if roots.present?
16
19
  css = [(css || 'menu'), 'clearfix'].flatten.join(' ')
17
20
  hide_children = RefinerySetting.find_or_set(:menu_hide_children, false) if hide_children.nil?
18
21
  -%>
@@ -23,10 +26,8 @@
23
26
  :locals => {
24
27
  :hide_children => hide_children,
25
28
  :sibling_count => (roots.length - 1),
26
- :collection => collection,
27
29
  :apply_css => true #if you don't care about class='first' class='last' or class='selected' set apply_css to false for speed.
28
- }
29
- -%>
30
+ } -%>
30
31
  </ul>
31
32
  </nav>
32
33
  <% end -%>
@@ -2,9 +2,9 @@
2
2
  if !!local_assigns[:apply_css] and (classes = menu_branch_css(local_assigns)).any?
3
3
  css = "class='#{classes.join(' ')}'".html_safe
4
4
  end
5
- dom_id = "id='item_#{menu_branch_counter}'".html_safe
5
+ dom_id = "id='item_#{menu_branch_counter}'".html_safe if menu_branch.parent_id.nil?
6
6
 
7
- children = menu_branch.children.live.in_menu unless hide_children
7
+ children = menu_branch.children.live.in_menu unless hide_children or menu_branch.rgt == menu_branch.lft + 1
8
8
  -%>
9
9
  <li<%= ['', css, dom_id].compact.join(' ').gsub(/\ *$/, '').html_safe %>>
10
10
  <%= link_to menu_branch.title, menu_branch.url -%>
@@ -14,9 +14,7 @@
14
14
  :collection => children,
15
15
  :locals => {
16
16
  :apply_css => local_assigns[:apply_css],
17
- :hide_children => !!hide_children,
18
- :collection => collection,
19
- :sibling_count => children.length - 1
17
+ :hide_children => !!hide_children
20
18
  } -%>
21
19
  </ul>
22
20
  <% end -%>
@@ -32,7 +32,7 @@
32
32
  delete_title ||= nil
33
33
  delete_confirmation ||= nil
34
34
  delete_button_id ||= "delete_button"
35
- delete_url ||= eval("admin_#{f.object_name}_url(#{f.object.id})")
35
+ delete_url ||= eval("admin_#{f.object_name}_path(#{f.object.id})")
36
36
  end
37
37
 
38
38
  paginate_collection = nil
@@ -2,16 +2,17 @@
2
2
  description ||= 'image'
3
3
  thumbnail ||= 'medium'
4
4
  toggle_image_display ||= false
5
+ conditions ||= nil
5
6
  randomiser = rand(Time.now.yesterday.to_i * Time.now.to_i)
6
- current_image_link_href = insert_admin_images_url(:dialog => true, :callback => "image_picker_#{randomiser}_changed",
7
- :width => 866, :height => 510)
7
+ current_image_link_href = insert_admin_images_path(:dialog => true, :callback => "image_picker_#{randomiser}_changed",
8
+ :width => 866, :height => 510, :conditions => conditions)
8
9
  current_image_title = t('.change', :what => description.titleize)
9
10
  -%>
10
11
  <div id='image_picker_container_<%= randomiser %>'>
11
12
  <%= link_to t('.show'), '', :class => "current_image_toggler" if toggle_image_display %>
12
13
  <%= f.hidden_field field, :class => "current_image_id" -%>
13
14
 
14
- <div class='current_image_container'<%= " style='display: none'" if toggle_image_display %> style="margin-top: 10px;">
15
+ <div class='current_image_container' style="margin-top: 10px<%= ";display: none" if toggle_image_display %>">
15
16
  <a class='current_image_link dialog' href="<%= current_image_link_href %>" style='border: 0px' title='<%= current_image_title %>' name='<%= current_image_title %>'>
16
17
  <% unless image.nil? -%>
17
18
  <%= image_fu image, ::Image.user_image_sizes[thumbnail.to_sym],
@@ -1,15 +1,17 @@
1
1
  <%
2
+ conditions ||= nil
2
3
  insert_text = "<span id='no_resource_selected_#{field}' class='nothing_selected' #{"style='display: none;'" if resource.present?}>
3
4
  #{t('.no_resource_selected')}
4
5
  </span>".html_safe
5
- insert_link = insert_admin_resources_url({
6
+ insert_link = insert_admin_resources_path({
6
7
  :dialog => true,
7
8
  :update_resource => "current_resource_#{field}",
8
9
  :update_text => "current_resource_text_#{field}",
9
10
  :callback => "resource_changed_#{field}",
10
11
  :field => [f.object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, ""), field].join('_'),
11
12
  :current_link => "#{resource.url if resource.present?}",
12
- :height => 480
13
+ :height => 480,
14
+ :conditions => conditions
13
15
  })
14
16
  %>
15
17
  <%= f.hidden_field field %>
@@ -18,18 +20,16 @@
18
20
  :name => t('.name'),
19
21
  :id => "current_resource_link_#{field}"
20
22
  %>
21
- <div id='current_resource_container_<%= field %>' <%= "style='display:none'" unless resource.present? %>>
22
- <span id='current_resource_tag'><%= t('.current') %>:</span>
23
- <span id='current_resource_text_<%= field %>'>
24
- <%= "#{resource.title} (#{resource.file_name})" if resource.present? %>
25
- </span>
26
- <br/>
27
- <%= link_to "#{refinery_icon_tag("page_white_put.png")}
28
- #{t('.download_current')}
29
- (<em>#{t('.opens_in_new_window')}</em>)".html_safe,
30
- "#{resource.url if resource.present?}",
31
- :id => "current_resource_#{field}",
32
- :target => "_blank" %>
23
+ <div id='current_resource_container_<%= field %>' style='margin-top: 10px<%= ";display: none" unless resource.present? %>'>
24
+ <%= link_to "#{refinery_icon_tag('page_white_put.png')} ".html_safe +
25
+ content_tag(
26
+ :span,
27
+ "#{resource.title} (#{resource.file_name})",
28
+ :id => "current_resource_text_#{field}"
29
+ ),
30
+ resource.url,
31
+ :id => "current_resource_#{field}",
32
+ :target => "_blank" if resource.present? %>
33
33
  </div>
34
34
  <br/>
35
35
  <%= link_to t('.remove_current'), "",
@@ -44,9 +44,9 @@ de:
44
44
  change: Klicken Sie hier, um ein Bild auszuwählen
45
45
  show: anzeigen
46
46
  resource_picker:
47
- download_current: Aktuelles %{what} herunterladen
47
+ download_current: Datei herunterladen
48
48
  opens_in_new_window: Öffnet in einem neuen Fenster
49
- remove_current: "Entferne aktuelles %{what}"
49
+ remove_current: "Entferne Datei"
50
50
  no_resource_selected: Es ist momentan keine Datei ausgewählt, klicken Sie hier, um eine hinzuzufügen.
51
51
  name: Datei hinzufügen
52
52
  current: Aktuelle Datei
@@ -16,8 +16,8 @@ fi:
16
16
  continue: Jatka...
17
17
  admin:
18
18
  menu:
19
- reorder_menu: Uudelleenjärjestä valikko
20
- reorder_menu_done: Olen valmis
19
+ reorder_menu: Muuta valikon järjestystä
20
+ reorder_menu_done: Tallenna
21
21
  dialogs:
22
22
  show:
23
23
  save: Tallenna
@@ -58,7 +58,7 @@ fi:
58
58
  results_for: "Hakutulokset haulle '%{query}'"
59
59
  no_results: 'Valitettavasti mitään ei löytynyt'
60
60
  delete:
61
- message: "Oletko varma, että haluat poistaa sivun '%{title}'?"
61
+ message: "Oletko varma, että haluat poistaa sisältöesineen '%{title}'?"
62
62
  error_messages:
63
63
  problems_in_following_fields: Seuraavissa kentissä oli virheitä
64
64
  help: apua
data/lib/gemspec.rb CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'refinerycms-generators', '~> 1.0'
25
25
  s.add_dependency 'acts_as_indexed', '~> 0.7'
26
26
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
27
- s.add_dependency 'globalize3', '>= 0.1.0.beta'
28
- s.add_dependency 'moretea-awesome_nested_set', '~> 1.4'
27
+ s.add_dependency 'globalize3', '>= 0.1.0.beta2'
28
+ s.add_dependency 'awesome_nested_set', '~> 2.0'
29
29
  s.add_dependency 'rails', '~> 3.0.7'
30
30
  s.add_dependency 'truncate_html', '~> 0.5'
31
31
  s.add_dependency 'will_paginate', '~> 3.0.pre'
@@ -78,7 +78,6 @@ capybara-*html
78
78
  # Always keep this section at the bottom.
79
79
 
80
80
  config/database.yml
81
- config/amazon_s3.yml
82
81
  config/rackspace_cloudfiles.yml
83
82
  your_*.*
84
83
  db/schema.rb
@@ -30,7 +30,7 @@ module Refinery
30
30
  end
31
31
 
32
32
  def url
33
- "#{self.url_prefix}#{@url ||= "admin_#{self.class.name.underscore.downcase}_url"}"
33
+ "#{self.url_prefix}#{@url ||= "admin_#{self.class.name.underscore.downcase}_path"}"
34
34
  end
35
35
 
36
36
  def class
data/lib/refinery/crud.rb CHANGED
@@ -253,11 +253,11 @@ module Refinery
253
253
  0.upto((newlist ||= params[:ul]).length - 1) do |index|
254
254
  hash = newlist[index.to_s]
255
255
  moved_item_id = hash['id'].split(/#{singular_name}\\_?/)
256
- @current_#{singular_name} = #{class_name}.find_by_id(moved_item_id)
256
+ @current_#{singular_name} = #{class_name}.where(:id => moved_item_id).first
257
257
 
258
258
  if @current_#{singular_name}.respond_to?(:move_to_root)
259
259
  if previous.present?
260
- @current_#{singular_name}.move_to_right_of(#{class_name}.find_by_id(previous))
260
+ @current_#{singular_name}.move_to_right_of(#{class_name}.where(:id => previous).first)
261
261
  else
262
262
  @current_#{singular_name}.move_to_root
263
263
  end
@@ -280,7 +280,7 @@ module Refinery
280
280
  0.upto(node['children'].length - 1) do |child_index|
281
281
  child = node['children'][child_index.to_s]
282
282
  child_id = child['id'].split(/#{singular_name}\_?/)
283
- child_#{singular_name} = #{class_name}.find_by_id(child_id)
283
+ child_#{singular_name} = #{class_name}.where(:id => child_id).first
284
284
  child_#{singular_name}.move_to_child_of(#{singular_name})
285
285
 
286
286
  if child['children'].present?
@@ -32,7 +32,7 @@ module Refinery
32
32
  unless geometry.nil? or !(split_geometry = geometry.to_s.split('#')).many? or !(split_geometry = split_geometry.first.split('x')).many?
33
33
  image_width, image_height = split_geometry
34
34
  else
35
- image_with = nil
35
+ image_width = nil
36
36
  image_height = nil
37
37
  end
38
38
 
@@ -16,7 +16,7 @@ module Refinery
16
16
 
17
17
  # This was extracted from app/views/shared/_menu_branch.html.erb
18
18
  # to remove the complexity of that template by reducing logic in the view.
19
- def css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count = nil, collection = [], selected_item = nil, warning = true)
19
+ def css_for_menu_branch(menu_branch, menu_branch_counter, sibling_count = nil, collection = nil, selected_item = nil, warning = true)
20
20
  # DEPRECATION. Remove at version 1.1
21
21
  if warning
22
22
  warn "\n-- DEPRECATION WARNING --"
@@ -25,17 +25,29 @@ module Refinery
25
25
  warn "Called from: #{caller.detect{|c| c =~ %r{#{Rails.root.to_s}}}.inspect.to_s.split(':in').first}\n\n"
26
26
  end
27
27
 
28
+ if collection
29
+ warn "\n-- DEPRECATION WARNING --"
30
+ warn "The use of 'collection' is deprecated and will be removed at version 1.1."
31
+ warn "Called from: #{caller.detect{|c| c =~ %r{#{Rails.root.to_s}}}.inspect.to_s.split(':in').first}\n\n"
32
+ end
33
+
34
+ if selected_item
35
+ warn "\n-- DEPRECATION WARNING --"
36
+ warn "The use of 'selected_item' is deprecated and will be removed at version 1.1."
37
+ warn "Called from: #{caller.detect{|c| c =~ %r{#{Rails.root.to_s}}}.inspect.to_s.split(':in').first}\n\n"
38
+ end
39
+
28
40
  css = []
29
41
  css << "selected" if selected_page_or_descendant_page_selected?(menu_branch, collection, selected_item)
30
42
  css << "first" if menu_branch_counter == 0
31
- css << "last" if menu_branch_counter == sibling_count
43
+ css << "last" if (sibling_count ? (menu_branch_counter == sibling_count - 1) : (menu_branch.rgt == menu_branch.parent.rgt - 1))
32
44
  css
33
45
  end
34
46
 
35
47
  # New method which accepts the local_assigns hash.
36
48
  # This maps to the older css_for_menu_branch method.
37
49
  def menu_branch_css(local_assigns)
38
- options = {:collection => []}.merge(local_assigns)
50
+ options = local_assigns.dup
39
51
  options.update(:sibling_count => options[:menu_branch].shown_siblings.size) unless options[:sibling_count]
40
52
 
41
53
  css_for_menu_branch(options[:menu_branch],
@@ -49,14 +61,8 @@ module Refinery
49
61
  # Determines whether any page underneath the supplied page is the current page according to rails.
50
62
  # Just calls selected_page? for each descendant of the supplied page.
51
63
  # if you pass a collection it won't check its own descendants but use the collection supplied.
52
- def descendant_page_selected?(page, collection = [], selected_item = nil)
53
- if selected_item
54
- warn "\n-- DEPRECATION WARNING --"
55
- warn "The use of 'selected_item' is deprecated and will be removed at version 1.1."
56
- warn "Called from: #{caller.detect{|c| c =~ %r{#{Rails.root.to_s}}}.inspect.to_s.split(':in').first}\n\n"
57
- end
58
-
59
- return false unless page.has_descendants?
64
+ def descendant_page_selected?(page, collection = nil, selected_item = nil)
65
+ return false if page.rgt == page.lft + 1
60
66
  return false unless selected_item.nil? or !selected_item.in_menu?
61
67
 
62
68
  page.descendants.any? { |descendant|
@@ -64,7 +70,7 @@ module Refinery
64
70
  }
65
71
  end
66
72
 
67
- def selected_page_or_descendant_page_selected?(page, collection = [], selected_item = nil)
73
+ def selected_page_or_descendant_page_selected?(page, collection = nil, selected_item = nil)
68
74
  return true if selected_page?(page) || selected_item === page
69
75
  return true if descendant_page_selected?(page, collection, selected_item)
70
76
  false
@@ -87,6 +93,7 @@ module Refinery
87
93
  path == page.link_url or
88
94
  path == page.nested_path or
89
95
  URI.decode(path) == page.nested_path or
96
+ path == "/#{page.id}" or
90
97
  current_page?(page)
91
98
  end
92
99
 
@@ -47,7 +47,13 @@ module Refinery
47
47
  else
48
48
  obj.title
49
49
  end
50
- title << link_to_if(options[:link] && obj.respond_to?(:url), obj_title, obj.url)
50
+
51
+ # Only link when the object responds to a url method.
52
+ if options[:link] && obj.respond_to?(:url)
53
+ title << link_to(obj_title, obj.url)
54
+ else
55
+ title << obj_title
56
+ end
51
57
  end
52
58
 
53
59
  final_title = title.pop
@@ -34,6 +34,10 @@ module Refinery
34
34
  def attach_to_application!
35
35
  ::Rails::Application.subclasses.each do |subclass|
36
36
  begin
37
+ # Fix Rake 0.9.0 issue
38
+ subclass.send :include, ::Rake::DSL if defined?(::Rake::DSL)
39
+
40
+ # Include our logic inside your logic
37
41
  subclass.send :include, ::Refinery::Application
38
42
  rescue
39
43
  $stdout.puts "Refinery CMS couldn't attach to #{subclass.name}."
@@ -1,88 +1,95 @@
1
1
  (function($) {
2
- $.extend($,{ placeholder: {
3
- browser_supported: function() {
4
- return this._supported !== undefined ?
5
- this._supported :
6
- ( this._supported = !!('placeholder' in $('<input type="text">')[0]) );
7
- },
8
- shim: function(opts) {
9
- var config = {
10
- color: '#888',
11
- cls: '',
12
- lr_padding:4,
13
- selector: 'input[placeholder], textarea[placeholder]'
14
- };
15
- $.extend(config,opts);
16
- !this.browser_supported() && $(config.selector)._placeholder_shim(config);
17
- }
18
- }});
2
+ // @todo Document this.
3
+ $.extend($,{ placeholder: {
4
+ browser_supported: function() {
5
+ return this._supported !== undefined ?
6
+ this._supported :
7
+ ( this._supported = !!('placeholder' in $('<input type="text">')[0]) );
8
+ },
9
+ shim: function(opts) {
10
+ var config = {
11
+ color: '#888',
12
+ cls: 'placeholder',
13
+ lr_padding:4,
14
+ selector: 'input[placeholder], textarea[placeholder]'
15
+ };
16
+ $.extend(config,opts);
17
+ !this.browser_supported() && $(config.selector)._placeholder_shim(config);
18
+ }
19
+ }});
19
20
 
20
- $.extend($.fn,{
21
- _placeholder_shim: function(config) {
22
- function calcPositionCss(target)
23
- {
24
- var op = $(target).offsetParent().offset();
25
- var ot = $(target).offset();
21
+ $.extend($.fn,{
22
+ _placeholder_shim: function(config) {
23
+ function calcPositionCss(target)
24
+ {
25
+ var op = $(target).offsetParent().offset();
26
+ var ot = $(target).offset();
26
27
 
27
- return {
28
- top: ot.top - op.top + ($(target).outerHeight() - $(target).height()) /2,
29
- left: ot.left - op.left + config.lr_padding,
30
- width: $(target).width() - config.lr_padding
31
- };
32
- }
33
- return this.each(function() {
34
- if( $(this).data('placeholder') ) {
35
- var $ol = $(this).data('placeholder');
36
- $ol.css(calcPositionCss($(this)));
37
- return true;
38
- }
39
-
40
- var possible_line_height = {};
41
- if( $(this).css('height') != 'auto') {
42
- possible_line_height = { lineHeight: $(this).css('height') };
43
- }
28
+ return {
29
+ top: ot.top - op.top + ($(target).outerHeight() - $(target).height()) /2,
30
+ left: ot.left - op.left + config.lr_padding,
31
+ width: $(target).width() - config.lr_padding
32
+ };
33
+ }
34
+ return this.each(function() {
35
+ if( $(this).data('placeholder') ) {
36
+ var $ol = $(this).data('placeholder');
37
+ $ol.css(calcPositionCss($(this)));
38
+ return true;
39
+ }
44
40
 
45
- var ol = $('<label />')
46
- .text($(this).attr('placeholder'))
47
- .addClass(config.cls)
48
- .css($.extend({
49
- position:'absolute',
50
- display: 'inline',
51
- float:'none',
52
- overflow:'hidden',
53
- whiteSpace:'nowrap',
54
- textAlign: 'left',
55
- color: config.color,
56
- cursor: 'text',
57
- fontSize: $(this).css('font-size')
58
- }, possible_line_height))
59
- .css(calcPositionCss(this))
60
- .attr('for', this.id)
61
- .data('target',$(this))
62
- .click(function(){
63
- $(this).data('target').focus()
64
- })
65
- .insertBefore(this);
66
- $(this)
67
- .data('placeholder',ol)
68
- .focus(function(){
69
- ol.hide();
70
- }).blur(function() {
71
- ol[$(this).val().length ? 'hide' : 'show']();
72
- }).triggerHandler('blur');
73
- $(window)
74
- .resize(function() {
75
- var $target = ol.data('target')
76
- ol.css(calcPositionCss($target))
77
- });
78
- });
79
- }
80
- });
41
+ var possible_line_height = {};
42
+ if( $(this).css('height') != 'auto') {
43
+ possible_line_height = { lineHeight: $(this).css('height') };
44
+ }
81
45
 
46
+ var ol = $('<label />')
47
+ .text($(this).attr('placeholder'))
48
+ .addClass(config.cls)
49
+ .css($.extend({
50
+ position:'absolute',
51
+ display: 'inline',
52
+ float:'none',
53
+ overflow:'hidden',
54
+ whiteSpace:'nowrap',
55
+ textAlign: 'left',
56
+ color: config.color,
57
+ cursor: 'text',
58
+ paddingTop: $(this).css('padding-top'),
59
+ paddingLeft: $(this).css('padding-left'),
60
+ fontSize: $(this).css('font-size'),
61
+ fontFamily: $(this).css('font-family'),
62
+ fontStyle: $(this).css('font-style'),
63
+ fontWeight: $(this).css('font-weight'),
64
+ textTransform: $(this).css('text-transform'),
65
+ zIndex: 99
66
+ }, possible_line_height))
67
+ .css(calcPositionCss(this))
68
+ .attr('for', this.id)
69
+ .data('target',$(this))
70
+ .click(function(){
71
+ $(this).data('target').focus()
72
+ })
73
+ .insertBefore(this);
74
+ $(this)
75
+ .data('placeholder',ol)
76
+ .focus(function(){
77
+ ol.hide();
78
+ }).blur(function() {
79
+ ol[$(this).val().length ? 'hide' : 'show']();
80
+ }).triggerHandler('blur');
81
+ $(window)
82
+ .resize(function() {
83
+ var $target = ol.data('target')
84
+ ol.css(calcPositionCss($target))
85
+ });
86
+ });
87
+ }
88
+ });
82
89
  })(jQuery);
83
90
 
84
- $(document).ready(function() {
85
- if ($.placeholder) {
86
- $.placeholder.shim();
91
+ jQuery(document).add(window).bind('ready load', function() {
92
+ if (jQuery.placeholder) {
93
+ jQuery.placeholder.shim();
87
94
  }
88
95
  });
@@ -412,9 +412,12 @@ init_tooltips = function(args){
412
412
  var link_tester = {
413
413
  initialised: false
414
414
  , init: function(test_url, test_email) {
415
- this.test_url = test_url;
416
- this.test_email = test_email;
417
- this.initialised = true;
415
+
416
+ if (!this.initialised) {
417
+ this.test_url = test_url;
418
+ this.test_email = test_email;
419
+ this.initialised = true;
420
+ }
418
421
  },
419
422
 
420
423
  email: function(value, callback) {
@@ -479,13 +482,16 @@ var link_tester = {
479
482
  var link_dialog = {
480
483
  initialised: false
481
484
  , init: function(){
482
- this.init_tabs();
483
- this.init_resources_submit();
484
- this.init_close();
485
- this.page_tab();
486
- this.web_tab();
487
- this.email_tab();
488
- this.initialised = true;
485
+
486
+ if (!this.initialised) {
487
+ this.init_tabs();
488
+ this.init_resources_submit();
489
+ this.init_close();
490
+ this.page_tab();
491
+ this.web_tab();
492
+ this.email_tab();
493
+ this.initialised = true;
494
+ }
489
495
  },
490
496
 
491
497
  init_tabs: function(){
@@ -630,30 +636,33 @@ var link_dialog = {
630
636
  var page_options = {
631
637
  initialised: false
632
638
  , init: function(enable_parts, new_part_url, del_part_url){
633
- // set the page tabs up, but ensure that all tabs are shown so that when wymeditor loads it has a proper height.
634
- page_options.tabs = $('#page-tabs');
635
- page_options.tabs.tabs({tabTemplate: '<li><a href="#{href}">#{label}</a></li>'});
636
- page_options.tabs.find(' > ul li a').corner('top 5px');
637
-
638
- part_shown = $('#page-tabs .page_part.field').not('.ui-tabs-hide');
639
- $('#page-tabs .page_part.field').removeClass('ui-tabs-hide');
640
-
641
- this.enable_parts = enable_parts;
642
- this.new_part_url = new_part_url;
643
- this.del_part_url = del_part_url;
644
- this.show_options();
645
- this.title_type();
646
-
647
- $(document).ready($.proxy(function(){
648
- // hide the tabs that are supposed to be hidden.
649
- $('#page-tabs .page_part.field').not(this).addClass('ui-tabs-hide');
650
- $('#page-tabs > ul li a').corner('top 5px');
651
- }, part_shown));
652
-
653
- if(this.enable_parts){
654
- this.page_part_dialog();
639
+
640
+ if (!this.initialised) {
641
+ // set the page tabs up, but ensure that all tabs are shown so that when wymeditor loads it has a proper height.
642
+ page_options.tabs = $('#page-tabs');
643
+ page_options.tabs.tabs({tabTemplate: '<li><a href="#{href}">#{label}</a></li>'});
644
+ page_options.tabs.find(' > ul li a').corner('top 5px');
645
+
646
+ part_shown = $('#page-tabs .page_part.field').not('.ui-tabs-hide');
647
+ $('#page-tabs .page_part.field').removeClass('ui-tabs-hide');
648
+
649
+ this.enable_parts = enable_parts;
650
+ this.new_part_url = new_part_url;
651
+ this.del_part_url = del_part_url;
652
+ this.show_options();
653
+ this.title_type();
654
+
655
+ $(document).ready($.proxy(function(){
656
+ // hide the tabs that are supposed to be hidden.
657
+ $('#page-tabs .page_part.field').not(this).addClass('ui-tabs-hide');
658
+ $('#page-tabs > ul li a').corner('top 5px');
659
+ }, part_shown));
660
+
661
+ if(this.enable_parts){
662
+ this.page_part_dialog();
663
+ }
664
+ this.initialised = true;
655
665
  }
656
- this.initialised = true;
657
666
  },
658
667
 
659
668
  show_options: function(){
@@ -766,11 +775,14 @@ var image_dialog = {
766
775
  , callback: null
767
776
 
768
777
  , init: function(callback){
769
- this.callback = callback;
770
- this.init_tabs();
771
- this.init_select();
772
- this.init_actions();
773
- this.initialised = true;
778
+
779
+ if (!this.initialised) {
780
+ this.callback = callback;
781
+ this.init_tabs();
782
+ this.init_select();
783
+ this.init_actions();
784
+ this.initialised = true;
785
+ }
774
786
  return this;
775
787
  }
776
788
 
@@ -884,43 +896,46 @@ var image_dialog = {
884
896
  var list_reorder = {
885
897
  initialised: false
886
898
  , init: function() {
887
- $('#reorder_action').click(list_reorder.enable_reordering);
888
- $('#reorder_action_done').click(list_reorder.disable_reordering);
889
- if(list_reorder.tree === false) {
890
- list_reorder.sortable_list.find('li').addClass('no-nest');
891
- }
892
- list_reorder.sortable_list.nestedSortable({
893
- disableNesting: 'no-nest',
894
- forcePlaceholderSize: true,
895
- handle: list_reorder.tree ? 'div' : null,
896
- items: 'li',
897
- opacity: .6,
898
- placeholder: 'placeholder',
899
- tabSize: 25,
900
- tolerance: 'pointer',
901
- toleranceElement: list_reorder.tree ? '> div' : null,
902
- disabled: true,
903
- start: function () {
904
- },
905
- change: function () {
906
- if (list_reorder.tree) {
907
- list_reorder.reset_branch_classes(this);
908
- }
909
- },
910
- stop: function () {
911
- if (list_reorder.tree) {
912
- list_reorder.reset_branch_classes(this);
913
- } else {
914
- list_reorder.reset_on_off_classes(this);
899
+
900
+ if (!this.initialised) {
901
+ $('#reorder_action').click(list_reorder.enable_reordering);
902
+ $('#reorder_action_done').click(list_reorder.disable_reordering);
903
+ if(list_reorder.tree === false) {
904
+ list_reorder.sortable_list.find('li').addClass('no-nest');
905
+ }
906
+ list_reorder.sortable_list.nestedSortable({
907
+ disableNesting: 'no-nest',
908
+ forcePlaceholderSize: true,
909
+ handle: list_reorder.tree ? 'div' : null,
910
+ items: 'li',
911
+ opacity: .6,
912
+ placeholder: 'placeholder',
913
+ tabSize: 25,
914
+ tolerance: 'pointer',
915
+ toleranceElement: list_reorder.tree ? '> div' : null,
916
+ disabled: true,
917
+ start: function () {
918
+ },
919
+ change: function () {
920
+ if (list_reorder.tree) {
921
+ list_reorder.reset_branch_classes(this);
922
+ }
923
+ },
924
+ stop: function () {
925
+ if (list_reorder.tree) {
926
+ list_reorder.reset_branch_classes(this);
927
+ } else {
928
+ list_reorder.reset_on_off_classes(this);
929
+ }
915
930
  }
931
+ });
932
+ if (list_reorder.tree) {
933
+ list_reorder.reset_branch_classes(list_reorder.sortable_list);
934
+ } else {
935
+ list_reorder.reset_on_off_classes(list_reorder.sortable_list);
916
936
  }
917
- });
918
- if (list_reorder.tree) {
919
- list_reorder.reset_branch_classes(list_reorder.sortable_list);
920
- } else {
921
- list_reorder.reset_on_off_classes(list_reorder.sortable_list);
937
+ this.initialised = true;
922
938
  }
923
- this.initialised = true;
924
939
  }
925
940
  , reset_on_off_classes: function(ul) {
926
941
  $("> li", ul).each(function(i, li) {
@@ -1005,13 +1020,16 @@ var image_picker = {
1005
1020
  }
1006
1021
 
1007
1022
  , init: function(new_options){
1008
- this.options = $.extend(this.options, new_options);
1009
- $(this.options.picker_container).find(this.options.remove_image_button)
1010
- .click($.proxy(this.remove_image, {container: this.options.picker_container, picker: this}));
1011
- $(this.options.picker_container).find(this.options.image_toggler)
1012
- .click($.proxy(this.toggle_image, {container: this.options.picker_container, picker: this}));
1013
-
1014
- this.initialised = true;
1023
+
1024
+ if (!this.initialised) {
1025
+ this.options = $.extend(this.options, new_options);
1026
+ $(this.options.picker_container).find(this.options.remove_image_button)
1027
+ .click($.proxy(this.remove_image, {container: this.options.picker_container, picker: this}));
1028
+ $(this.options.picker_container).find(this.options.image_toggler)
1029
+ .click($.proxy(this.toggle_image, {container: this.options.picker_container, picker: this}));
1030
+
1031
+ this.initialised = true;
1032
+ }
1015
1033
 
1016
1034
  return this;
1017
1035
  }
@@ -1060,8 +1078,11 @@ var resource_picker = {
1060
1078
  , callback: null
1061
1079
 
1062
1080
  , init: function(callback) {
1063
- this.callback = callback;
1064
- this.initialised = true;
1081
+
1082
+ if (!this.initialised) {
1083
+ this.callback = callback;
1084
+ this.initialised = true;
1085
+ }
1065
1086
  }
1066
1087
  };
1067
1088
 
@@ -3,7 +3,7 @@ if (typeof($) == 'function') {
3
3
  $logo = $('#site_bar_content #site_bar_refinery_cms_logo');
4
4
  $logo.css('left', ($('#site_bar_content').width() / 2) - ($logo.width() / 2));
5
5
 
6
- $switch_anchor = $('#editor_switch a').not('.ie7 #editor_switch a, .ie6 #editor_swtich a');
6
+ $switch_anchor = $('#editor_switch a').not('.ie7 #editor_switch a, .ie6 #editor_switch a');
7
7
  if ($.isFunction($switch_anchor.corner)) {
8
8
  $switch_anchor.corner('6px');
9
9
  }
@@ -3759,7 +3759,8 @@ WYMeditor.XhtmlSaxListener = function()
3759
3759
  this._open_tags = {};
3760
3760
  this.validator = WYMeditor.XhtmlValidator;
3761
3761
  this._tag_stack = [];
3762
- this.avoided_tags = [];
3762
+
3763
+ this.avoided_tags = ['area'];
3763
3764
 
3764
3765
  this.entities = {
3765
3766
  '&nbsp;':'&#160;','&iexcl;':'&#161;','&cent;':'&#162;',
@@ -3977,7 +3978,9 @@ WYMeditor.XhtmlSaxListener.prototype.inlineTag = function(tag, attributes)
3977
3978
 
3978
3979
  WYMeditor.XhtmlSaxListener.prototype.openUnknownTag = function(tag, attributes)
3979
3980
  {
3980
- //this.output += this.helper.tag(tag, attributes, true);
3981
+ if(tag === 'area') {
3982
+ this.output += this.helper.tag(tag, attributes, true);
3983
+ }
3981
3984
  };
3982
3985
 
3983
3986
  WYMeditor.XhtmlSaxListener.prototype.closeBlockTag = function(tag)
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-core}
5
- s.version = %q{0.9.9.21}
5
+ s.version = %q{0.9.9.22}
6
6
  s.summary = %q{Core engine for Refinery CMS}
7
7
  s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
8
- s.date = %q{2011-05-03}
8
+ s.date = %q{2011-05-22}
9
9
  s.email = %q{info@refinerycms.com}
10
10
  s.homepage = %q{http://refinerycms.com}
11
11
  s.rubyforge_project = %q{refinerycms}
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
14
14
  s.require_paths = %w(lib)
15
15
  s.executables = %w()
16
16
 
17
- s.add_dependency 'refinerycms-base', '= 0.9.9.21'
18
- s.add_dependency 'refinerycms-settings', '= 0.9.9.21'
17
+ s.add_dependency 'refinerycms-base', '= 0.9.9.22'
18
+ s.add_dependency 'refinerycms-settings', '= 0.9.9.22'
19
19
  s.add_dependency 'refinerycms-generators', '~> 1.0'
20
20
  s.add_dependency 'acts_as_indexed', '~> 0.7'
21
21
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
22
- s.add_dependency 'globalize3', '>= 0.1.0.beta'
23
- s.add_dependency 'moretea-awesome_nested_set', '~> 1.4'
22
+ s.add_dependency 'globalize3', '>= 0.1.0.beta2'
23
+ s.add_dependency 'awesome_nested_set', '~> 2.0'
24
24
  s.add_dependency 'rails', '~> 3.0.7'
25
25
  s.add_dependency 'truncate_html', '~> 0.5'
26
26
  s.add_dependency 'will_paginate', '~> 3.0.pre'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-core
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.9.21
5
+ version: 0.9.9.22
6
6
  platform: ruby
7
7
  authors:
8
8
  - Resolve Digital
@@ -13,7 +13,8 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2011-05-03 00:00:00 Z
16
+ date: 2011-05-22 00:00:00 +12:00
17
+ default_executable:
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
20
  name: refinerycms-base
@@ -23,7 +24,7 @@ dependencies:
23
24
  requirements:
24
25
  - - "="
25
26
  - !ruby/object:Gem::Version
26
- version: 0.9.9.21
27
+ version: 0.9.9.22
27
28
  type: :runtime
28
29
  version_requirements: *id001
29
30
  - !ruby/object:Gem::Dependency
@@ -34,7 +35,7 @@ dependencies:
34
35
  requirements:
35
36
  - - "="
36
37
  - !ruby/object:Gem::Version
37
- version: 0.9.9.21
38
+ version: 0.9.9.22
38
39
  type: :runtime
39
40
  version_requirements: *id002
40
41
  - !ruby/object:Gem::Dependency
@@ -78,18 +79,18 @@ dependencies:
78
79
  requirements:
79
80
  - - ">="
80
81
  - !ruby/object:Gem::Version
81
- version: 0.1.0.beta
82
+ version: 0.1.0.beta2
82
83
  type: :runtime
83
84
  version_requirements: *id006
84
85
  - !ruby/object:Gem::Dependency
85
- name: moretea-awesome_nested_set
86
+ name: awesome_nested_set
86
87
  prerelease: false
87
88
  requirement: &id007 !ruby/object:Gem::Requirement
88
89
  none: false
89
90
  requirements:
90
91
  - - ~>
91
92
  - !ruby/object:Gem::Version
92
- version: "1.4"
93
+ version: "2.0"
93
94
  type: :runtime
94
95
  version_requirements: *id007
95
96
  - !ruby/object:Gem::Dependency
@@ -472,6 +473,7 @@ files:
472
473
  - refinerycms-core.gemspec
473
474
  - spec/lib/refinery/plugin_spec.rb
474
475
  - spec/lib/refinery/plugins_spec.rb
476
+ has_rdoc: true
475
477
  homepage: http://refinerycms.com
476
478
  licenses:
477
479
  - MIT
@@ -495,10 +497,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
495
497
  requirements: []
496
498
 
497
499
  rubyforge_project: refinerycms
498
- rubygems_version: 1.7.2
500
+ rubygems_version: 1.6.2
499
501
  signing_key:
500
502
  specification_version: 3
501
503
  summary: Core engine for Refinery CMS
502
504
  test_files: []
503
505
 
504
- has_rdoc: