refinerycms-core 1.0.3 → 1.0.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.
@@ -3,4 +3,4 @@
3
3
  <!--[if IE 7 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie7"> <![endif]-->
4
4
  <!--[if IE 8 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie8"> <![endif]-->
5
5
  <!--[if IE 9 ]> <html lang="<%= ::I18n.locale %>" class="no-js ie9"> <![endif]-->
6
- <!--[if (gt IE 9)|!(IE)]><!--> <html lang="<%= ::I18n.locale %>" class="no-js"> <!--<![endif]-->
6
+ <!--[if (gt IE 9)|!(IE)]> <html lang="<%= ::I18n.locale %>" class="no-js"> <![endif]-->
@@ -2,5 +2,6 @@
2
2
  <input id='search' name='search' size='22' type='search' value='<%= params[:search] %>' />
3
3
  <% if params[:wymeditor].presence %><input name='wymeditor' value='true' type='hidden'><% end %>
4
4
  <% if from_dialog? %><input id='dialog' name='dialog' type='hidden' value='true' /><% end %>
5
+ <% if @callback.presence %><input name='callback' value='<%= @callback %>' type='hidden'><% end %>
5
6
  <%= submit_tag t('button_text', :scope => 'shared.admin.search'), :name => nil %>
6
7
  </form>
data/lib/gemspec.rb CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
30
30
  s.add_dependency 'awesome_nested_set', '~> 2.0'
31
31
  s.add_dependency 'rails', '~> 3.0.9'
32
32
  s.add_dependency 'truncate_html', '~> 0.5'
33
- s.add_dependency 'will_paginate', '~> 3.0.pre'
33
+ s.add_dependency 'will_paginate', '= 3.0.pre2'
34
34
 
35
35
  s.files = [
36
36
  '#{%w( **/{*,.rspec,.gitignore,.yardopts} ).map { |file| Pathname.glob(gempath.join(file)) }.flatten.reject{|f|
@@ -6,17 +6,18 @@ ActionView::Helpers::FormHelper.module_eval do
6
6
  def required_label(object_name, method, text = nil, options = {})
7
7
  options = {:class => "required"}.merge!(options)
8
8
 
9
- label(object_name, method, "#{label_humanize_text(object_name, method, text, options)} *", options)
9
+ label(object_name, method, "#{label_humanize_text(object_name, method, text)} *", options)
10
10
  end
11
11
 
12
12
 
13
- def label_humanize_text object_name, method, text = nil, options = {}
14
- if text.blank?
15
- text = object_name.classify.constantize.respond_to?(:human_attribute_name) ? object_name.classify.constantize.human_attribute_name(method) : method.to_s
13
+ def label_humanize_text object_name, method, text = nil
14
+ content = text unless text.is_a?(Hash)
15
+ if content.blank?
16
+ content = object_name.classify.constantize.respond_to?(:human_attribute_name) ? object_name.classify.constantize.human_attribute_name(method) : method.to_s
16
17
  else
17
- text = text.to_s
18
+ content = content.to_s
18
19
  end
19
- text.humanize
20
+ content.humanize
20
21
  end
21
22
 
22
23
  end
@@ -40,7 +41,6 @@ ActionView::Helpers::FormTagHelper.module_eval do
40
41
 
41
42
  end
42
43
 
43
-
44
44
  # I18n labels automatically
45
45
  module ActionView
46
46
  module Helpers
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  module Refinery
2
4
  module Helpers
3
5
  module ImageHelper
@@ -25,25 +27,16 @@ module Refinery
25
27
  # <%= image_fu @model.image, '200x200' %> or with no thumbnail: <%= image_fu @model.image %>
26
28
  def image_fu(image, geometry = nil, options={})
27
29
  if image.present?
28
- # call rails' image tag function with default alt tag.
29
- # if any other options were supplied these are merged in and can replace the defaults.
30
- # if the geomtry is nil, then we know the image height and width already.
31
- # detect nil geometry or cropping presence which is where we can guess the dimensions
32
- unless geometry.nil? or !(split_geometry = geometry.to_s.split('#')).many? or !(split_geometry = split_geometry.first.split('x')).many?
33
- image_width, image_height = split_geometry
34
- else
35
- image_width = nil
36
- image_height = nil
37
- end
30
+ original_width = image.image_width
31
+ original_height = image.image_height
32
+
33
+ dimensions = (image.thumbnail_dimensions(geometry) rescue {})
38
34
 
39
35
  image_tag(image.thumbnail(geometry).url, {
40
36
  :alt => image.respond_to?(:title) ? image.title : image.image_name,
41
- :width => image_width,
42
- :height => image_height
43
- }.merge(options))
37
+ }.merge(dimensions).merge(options))
44
38
  end
45
39
  end
46
-
47
40
  end
48
41
  end
49
42
  end
@@ -27,11 +27,6 @@ module Refinery
27
27
  def self.called_from; "#{new_called_from}"; end
28
28
  RUBY
29
29
  Object.const_set(plugin.class_name.to_sym, klass)
30
-
31
- # provide a default pathname to where this plugin is using its lib directory.
32
- depth = RUBY_VERSION >= "1.9.2" ? 4 : 3
33
- plugin.pathname ||= Pathname.new(caller(depth).first.match("(.*)#{File::SEPARATOR}lib")[1])
34
- Refinery::Plugins.registered << plugin # add me to the collection of registered plugins
35
30
  end
36
31
 
37
32
  # Returns the class name of the plugin
@@ -101,5 +96,12 @@ module Refinery
101
96
  def add_activity(options)
102
97
  (self.plugin_activity ||= []) << Activity::new(options)
103
98
  end
99
+
100
+ def initialize
101
+ # provide a default pathname to where this plugin is using its lib directory.
102
+ depth = RUBY_VERSION >= "1.9.2" ? 4 : 3
103
+ self.pathname ||= Pathname.new(caller(depth).first.match("(.*)#{File::SEPARATOR}lib")[1])
104
+ ::Refinery::Plugins.registered << self # add me to the collection of registered plugins
105
+ end
104
106
  end
105
107
  end
@@ -186,3 +186,15 @@ task :whitespace do
186
186
  puts "This doesn't work on systems other than OSX or Linux. Please use a custom whitespace tool for your platform '#{Config::CONFIG["host_os"]}'."
187
187
  end
188
188
  end
189
+
190
+ desc "Recalculate $LOAD_PATH frequencies."
191
+ task :recalculate_loaded_features_frequency => :environment do
192
+ require 'load_path_analyzer'
193
+
194
+ frequencies = LoadPathAnalyzer.new($LOAD_PATH, $LOADED_FEATURES).frequencies
195
+ ideal_load_path = frequencies.to_a.sort_by(&:last).map(&:first)
196
+
197
+ Rails.root.join('config', 'ideal_load_path').open("w") do |f|
198
+ f.puts ideal_load_path
199
+ end
200
+ end
@@ -412,7 +412,7 @@ init_tooltips = function(args){
412
412
  var link_tester = {
413
413
  initialised: false
414
414
  , init: function(test_url, test_email) {
415
-
415
+
416
416
  if (!this.initialised) {
417
417
  this.test_url = test_url;
418
418
  this.test_email = test_email;
@@ -482,7 +482,7 @@ var link_tester = {
482
482
  var link_dialog = {
483
483
  initialised: false
484
484
  , init: function(){
485
-
485
+
486
486
  if (!this.initialised) {
487
487
  this.init_tabs();
488
488
  this.init_resources_submit();
@@ -636,7 +636,7 @@ var link_dialog = {
636
636
  var page_options = {
637
637
  initialised: false
638
638
  , init: function(enable_parts, new_part_url, del_part_url){
639
-
639
+
640
640
  if (!this.initialised) {
641
641
  // set the page tabs up, but ensure that all tabs are shown so that when wymeditor loads it has a proper height.
642
642
  page_options.tabs = $('#page-tabs');
@@ -714,17 +714,17 @@ var page_options = {
714
714
  }, function(data, status){
715
715
  $('#submit_continue_button').remove();
716
716
  // Add a new tab for the new content section.
717
- $(data).appendTo('#page_part_editors');
717
+ $('#page_part_editors').append(data);
718
718
  page_options.tabs.tabs('add', '#page_part_new_' + $('#new_page_part_index').val(), part_title);
719
719
  page_options.tabs.tabs('select', $('#new_page_part_index').val());
720
720
 
721
- // hook into wymedtior to instruct it to select this new tab again once it has loaded.
721
+ // hook into wymeditor to instruct it to select this new tab again once it has loaded.
722
722
  WYMeditor.onload_functions.push(function() {
723
- $('#page_part_new_' + $('#new_page_part_index').val()).appendTo('#page_part_editors');
724
723
  page_options.tabs.tabs('select', $('#new_page_part_index').val());
725
724
  });
726
725
 
727
726
  // turn the new textarea into a wymeditor.
727
+ $('#page_part_new_' + $('#new_page_part_index').val()).appendTo('#page_part_editors')
728
728
  WYMeditor.init();
729
729
 
730
730
  // Wipe the title and increment the index counter by one.
@@ -775,7 +775,7 @@ var image_dialog = {
775
775
  , callback: null
776
776
 
777
777
  , init: function(callback){
778
-
778
+
779
779
  if (!this.initialised) {
780
780
  this.callback = callback;
781
781
  this.init_tabs();
@@ -896,7 +896,7 @@ var image_dialog = {
896
896
  var list_reorder = {
897
897
  initialised: false
898
898
  , init: function() {
899
-
899
+
900
900
  if (!this.initialised) {
901
901
  $('#reorder_action').click(list_reorder.enable_reordering);
902
902
  $('#reorder_action_done').click(list_reorder.disable_reordering);
@@ -989,12 +989,7 @@ var list_reorder = {
989
989
  }
990
990
 
991
991
  , restore_controls: function(e) {
992
- if (list_reorder.tree && !$.browser.msie) {
993
- list_reorder.sortable_list.add(list_reorder.sortable_list.find('ul, li, div')).draggable({ disabled: true });
994
- } else {
995
- $(list_reorder.sortable_list).sortable('destroy');
996
- }
997
- $(list_reorder.sortable_list).removeClass('reordering, ui-sortable');
992
+ $(list_reorder.sortable_list).removeClass('reordering');
998
993
 
999
994
  $('#sortable_list .actions, #site_bar, header > *:not(script)').fadeTo(250, 1);
1000
995
  $('#actions *:not("#reorder_action_done, #reorder_action")').not($('#reorder_action_done').parents('li, ul, div')).fadeTo(250, 1, function() {
@@ -1020,7 +1015,7 @@ var image_picker = {
1020
1015
  }
1021
1016
 
1022
1017
  , init: function(new_options){
1023
-
1018
+
1024
1019
  if (!this.initialised) {
1025
1020
  this.options = $.extend(this.options, new_options);
1026
1021
  $(this.options.picker_container).find(this.options.remove_image_button)
@@ -1078,7 +1073,7 @@ var resource_picker = {
1078
1073
  , callback: null
1079
1074
 
1080
1075
  , init: function(callback) {
1081
-
1076
+
1082
1077
  if (!this.initialised) {
1083
1078
  this.callback = callback;
1084
1079
  this.initialised = true;
@@ -263,8 +263,7 @@ WYMeditor.editor.prototype.loadIframe = function(iframe) {
263
263
  };
264
264
 
265
265
  WYMeditor.init = function() {
266
- wymeditor_inputs = $('.wymeditor');
267
- wymeditor_inputs = wymeditor_inputs.filter(function(index) {
266
+ wymeditor_inputs = $('.wymeditor').filter(function(index) {
268
267
  for (i=0; i < WYMeditor.INSTANCES.length; i++) {
269
268
  if (WYMeditor.INSTANCES[i]._element.attr('id') == $(this).attr('id')) {
270
269
  return false;
@@ -275,7 +274,7 @@ WYMeditor.init = function() {
275
274
  });
276
275
 
277
276
  wymeditor_inputs.each(function(input) {
278
- if ((containing_field = $(this).parents('.field')).length > 0 && containing_field.get(0).style.height === '') {
277
+ if ((containing_field = $(this).parents('.field')).length > 0 && containing_field.get(0).style.height.replace('auto', '') === '') {
279
278
  containing_field.addClass('hide-overflow')
280
279
  .css('height', $(this).outerHeight() - containing_field.offset().top + $(this).offset().top + 45);
281
280
  }
@@ -4,7 +4,7 @@ $(document).ready(function(){
4
4
  $('nav#actions.multilist > ul:not(.search_list) li a:nth(1)').parent().addClass('selected');
5
5
  }
6
6
 
7
- $('nav#actions.multilist > ul:not(.search_list) li > a').not('.not_a_link a').each(function(i,a){
7
+ $('nav#actions.multilist > ul:not(.search_list) li > a').not('.not_a_link a').not('a.reorder_icon').each(function(i,a){
8
8
  if ($(this).data('dialog-title') == null) {
9
9
  $(this).bind('click', function(){
10
10
  $(this).css('background-image', "url('/images/refinery/ajax-loader.gif') !important");
data/public/robots.txt CHANGED
@@ -1,3 +1,2 @@
1
- User-Agent: *
2
- Disallow: /admin/
3
- Disallow: /refinery/
1
+ User-agent: *
2
+ Disallow: /refinery/
@@ -3,10 +3,10 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{refinerycms-core}
6
- s.version = %q{1.0.3}
6
+ s.version = %q{1.0.4}
7
7
  s.summary = %q{Core engine for Refinery CMS}
8
8
  s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most engines}
9
- s.date = %q{2011-06-23}
9
+ s.date = %q{2011-08-11}
10
10
  s.email = %q{info@refinerycms.com}
11
11
  s.homepage = %q{http://refinerycms.com}
12
12
  s.rubyforge_project = %q{refinerycms}
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
15
15
  s.require_paths = %w(lib)
16
16
  s.executables = %w()
17
17
 
18
- s.add_dependency 'refinerycms-base', '= 1.0.3'
19
- s.add_dependency 'refinerycms-settings', '= 1.0.3'
18
+ s.add_dependency 'refinerycms-base', '= 1.0.4'
19
+ s.add_dependency 'refinerycms-settings', '= 1.0.4'
20
20
  s.add_dependency 'refinerycms-generators', '~> 1.0'
21
21
  s.add_dependency 'acts_as_indexed', '~> 0.7'
22
22
  s.add_dependency 'friendly_id_globalize3', '~> 3.2.1'
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'awesome_nested_set', '~> 2.0'
25
25
  s.add_dependency 'rails', '~> 3.0.9'
26
26
  s.add_dependency 'truncate_html', '~> 0.5'
27
- s.add_dependency 'will_paginate', '~> 3.0.pre'
27
+ s.add_dependency 'will_paginate', '= 3.0.pre2'
28
28
 
29
29
  s.files = [
30
30
  'app',
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2011-06-23 00:00:00 Z
22
+ date: 2011-08-11 00:00:00 Z
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: refinerycms-base
@@ -29,12 +29,12 @@ dependencies:
29
29
  requirements:
30
30
  - - "="
31
31
  - !ruby/object:Gem::Version
32
- hash: 17
32
+ hash: 31
33
33
  segments:
34
34
  - 1
35
35
  - 0
36
- - 3
37
- version: 1.0.3
36
+ - 4
37
+ version: 1.0.4
38
38
  type: :runtime
39
39
  version_requirements: *id001
40
40
  - !ruby/object:Gem::Dependency
@@ -45,12 +45,12 @@ dependencies:
45
45
  requirements:
46
46
  - - "="
47
47
  - !ruby/object:Gem::Version
48
- hash: 17
48
+ hash: 31
49
49
  segments:
50
50
  - 1
51
51
  - 0
52
- - 3
53
- version: 1.0.3
52
+ - 4
53
+ version: 1.0.4
54
54
  type: :runtime
55
55
  version_requirements: *id002
56
56
  - !ruby/object:Gem::Dependency
@@ -166,14 +166,15 @@ dependencies:
166
166
  requirement: &id010 !ruby/object:Gem::Requirement
167
167
  none: false
168
168
  requirements:
169
- - - ~>
169
+ - - "="
170
170
  - !ruby/object:Gem::Version
171
- hash: 961915916
171
+ hash: 1923831917
172
172
  segments:
173
173
  - 3
174
174
  - 0
175
175
  - pre
176
- version: 3.0.pre
176
+ - 2
177
+ version: 3.0.pre2
177
178
  type: :runtime
178
179
  version_requirements: *id010
179
180
  description: The core of Refinery CMS. This handles the common functionality and is required by most engines
@@ -558,7 +559,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
558
559
  requirements: []
559
560
 
560
561
  rubyforge_project: refinerycms
561
- rubygems_version: 1.8.5
562
+ rubygems_version: 1.8.6
562
563
  signing_key:
563
564
  specification_version: 3
564
565
  summary: Core engine for Refinery CMS