Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 7 files changed
  • 0 comments
  • 2 contributors
8  Gemfile
@@ -17,16 +17,16 @@ gem 'sqlite3-ruby', :require => 'sqlite3' #db_adapter=sqlite3
17 17
 # gem 'aws-s3'
18 18
 
19 19
 #===REFINERY REQUIRED GEMS===
20  
-gem 'acts_as_indexed',  '= 0.6.4', :require => 'acts_as_indexed'
  20
+gem 'acts_as_indexed',  '= 0.6.6', :require => 'acts_as_indexed'
21 21
 gem 'authlogic',        '= 2.1.6', :require => 'authlogic'
22 22
 gem 'friendly_id',      '= 3.1.3', :require => 'friendly_id'
23  
-gem 'rails',            '= 2.3.8'
  23
+gem 'rails',            '= 2.3.9'
24 24
 gem 'rmagick',          '~> 2.12.0'
25 25
 gem 'truncate_html',    '= 0.3.2', :require => 'truncate_html'
26 26
 gem 'will_paginate',    '= 2.3.14', :require => 'will_paginate'
27 27
 
28 28
 group :test do
29  
-  gem 'json_pure',      '=1.4.6', :require => 'json/pure'
  29
+  gem 'json_pure',      '= 1.4.6', :require => 'json/pure'
30 30
   gem 'factory_girl'
31 31
   gem 'test-unit',      '= 1.2.3'
32 32
   gem 'capybara'
@@ -45,7 +45,7 @@ end
45 45
 
46 46
 #===REQUIRED FOR REFINERY GEM INSTALL===
47 47
 # Leave the gem below disabled (commented out) if you're not using the gem install method.
48  
-# gem 'refinerycms',    '= 0.9.7.12'
  48
+# gem 'refinerycms',    '= 0.9.7.14'
49 49
 #===END OF REFINERY GEM INSTALL REQUIREMENTS===
50 50
 
51 51
 # Bundle gems for certain environments:
63  Gemfile.lock
... ...
@@ -1,20 +1,20 @@
1 1
 GEM
2 2
   remote: http://rubygems.org/
3 3
   specs:
4  
-    actionmailer (2.3.8)
5  
-      actionpack (= 2.3.8)
6  
-    actionpack (2.3.8)
7  
-      activesupport (= 2.3.8)
  4
+    actionmailer (2.3.9)
  5
+      actionpack (= 2.3.9)
  6
+    actionpack (2.3.9)
  7
+      activesupport (= 2.3.9)
8 8
       rack (~> 1.1.0)
9  
-    activerecord (2.3.8)
10  
-      activesupport (= 2.3.8)
11  
-    activeresource (2.3.8)
12  
-      activesupport (= 2.3.8)
13  
-    activesupport (2.3.8)
14  
-    acts_as_indexed (0.6.4)
  9
+    activerecord (2.3.9)
  10
+      activesupport (= 2.3.9)
  11
+    activeresource (2.3.9)
  12
+      activesupport (= 2.3.9)
  13
+    activesupport (2.3.9)
  14
+    acts_as_indexed (0.6.6)
15 15
     authlogic (2.1.6)
16 16
       activesupport
17  
-    babosa (0.1.1)
  17
+    babosa (0.2.0)
18 18
     builder (2.1.2)
19 19
     capybara (0.3.9)
20 20
       culerity (>= 0.2.4)
@@ -24,15 +24,15 @@ GEM
24 24
       rack-test (>= 0.5.4)
25 25
       selenium-webdriver (>= 0.0.3)
26 26
     configuration (1.1.0)
27  
-    cucumber (0.8.5)
  27
+    cucumber (0.9.2)
28 28
       builder (~> 2.1.2)
29 29
       diff-lcs (~> 1.1.2)
30  
-      gherkin (~> 2.1.4)
31  
-      json_pure (~> 1.4.3)
32  
-      term-ansicolor (~> 1.0.4)
  30
+      gherkin (~> 2.2.5)
  31
+      json (~> 1.4.6)
  32
+      term-ansicolor (~> 1.0.5)
33 33
     cucumber-rails (0.3.2)
34 34
       cucumber (>= 0.8.0)
35  
-    culerity (0.2.10)
  35
+    culerity (0.2.12)
36 36
     database_cleaner (0.5.2)
37 37
     diff-lcs (1.1.2)
38 38
     factory_girl (1.3.2)
@@ -40,11 +40,13 @@ GEM
40 40
       rake (>= 0.8.7)
41 41
     friendly_id (3.1.3)
42 42
       babosa (>= 0.1.0)
43  
-    gherkin (2.1.5)
44  
-      trollop (~> 1.16.2)
45  
-    hoe (2.6.1)
  43
+    gherkin (2.2.8)
  44
+      json (~> 1.4.6)
  45
+      term-ansicolor (~> 1.0.5)
  46
+    hoe (2.6.2)
46 47
       rake (>= 0.8.7)
47 48
       rubyforge (>= 2.0.4)
  49
+    json (1.4.6)
48 50
     json_pure (1.4.6)
49 51
     launchy (0.3.7)
50 52
       configuration (>= 0.0.5)
@@ -52,14 +54,14 @@ GEM
52 54
     mime-types (1.16)
53 55
     nokogiri (1.4.3.1)
54 56
     rack (1.1.0)
55  
-    rack-test (0.5.4)
  57
+    rack-test (0.5.6)
56 58
       rack (>= 1.0)
57  
-    rails (2.3.8)
58  
-      actionmailer (= 2.3.8)
59  
-      actionpack (= 2.3.8)
60  
-      activerecord (= 2.3.8)
61  
-      activeresource (= 2.3.8)
62  
-      activesupport (= 2.3.8)
  59
+    rails (2.3.9)
  60
+      actionmailer (= 2.3.9)
  61
+      actionpack (= 2.3.9)
  62
+      activerecord (= 2.3.9)
  63
+      activeresource (= 2.3.9)
  64
+      activesupport (= 2.3.9)
63 65
       rake (>= 0.8.3)
64 66
     rake (0.8.7)
65 67
     rmagick (2.12.2)
@@ -67,11 +69,11 @@ GEM
67 69
     rspec-rails (1.3.2)
68 70
       rack (>= 1.0.0)
69 71
       rspec (>= 1.3.0)
70  
-    ruby-prof (0.9.1)
  72
+    ruby-prof (0.9.2)
71 73
     rubyforge (2.0.4)
72 74
       json_pure (>= 1.1.7)
73 75
     rubyzip (0.9.4)
74  
-    selenium-webdriver (0.0.27)
  76
+    selenium-webdriver (0.0.28)
75 77
       ffi (>= 0.6.1)
76 78
       json_pure
77 79
       rubyzip
@@ -80,7 +82,6 @@ GEM
80 82
     term-ansicolor (1.0.5)
81 83
     test-unit (1.2.3)
82 84
       hoe (>= 1.5.1)
83  
-    trollop (1.16.2)
84 85
     truncate_html (0.3.2)
85 86
     will_paginate (2.3.14)
86 87
 
@@ -88,7 +89,7 @@ PLATFORMS
88 89
   ruby
89 90
 
90 91
 DEPENDENCIES
91  
-  acts_as_indexed (= 0.6.4)
  92
+  acts_as_indexed (= 0.6.6)
92 93
   authlogic (= 2.1.6)
93 94
   capybara
94 95
   cucumber
@@ -99,7 +100,7 @@ DEPENDENCIES
99 100
   gherkin
100 101
   json_pure (= 1.4.6)
101 102
   launchy
102  
-  rails (= 2.3.8)
  103
+  rails (= 2.3.9)
103 104
   rmagick (~> 2.12.0)
104 105
   rspec
105 106
   rspec-rails
19  public/javascripts/refinery/admin.js
@@ -950,18 +950,21 @@ var resource_picker = {
950 950
 }
951 951
 
952 952
 close_dialog = function(e) {
953  
-  if (parent
954  
-      && parent.document.location.href != document.location.href
955  
-      && $.isFunction(parent.$))
  953
+  if (parent && parent.document.location.href != document.location.href && $.isFunction(parent.$))
956 954
   {
957  
-    $(parent.document.body).removeClass('hide-overflow');
958  
-    parent.$('.ui-dialog').dialog('close').remove();
  955
+    the_body = $(parent.document.body)
  956
+    the_dialog = parent.$('.ui-dialog');
959 957
   } else {
960  
-    $(document.body).removeClass('hide-overflow');
961  
-    $('.ui-dialog').dialog('close').remove();
  958
+    the_body = $(document.body).removeClass('hide-overflow');
  959
+    the_dialog = $('.ui-dialog').dialog('close').remove();
962 960
   }
  961
+  // if there's a wymeditor involved then let it do its thing without blocking first.
  962
+  if (!($(document.body).hasClass('wym_iframe_body'))) {
  963
+    the_body.removeClass('hide-overflow');
  964
+    the_dialog.dialog('close').remove();
963 965
 
964  
-  e.preventDefault();
  966
+    e.preventDefault();
  967
+  }
965 968
 }
966 969
 
967 970
 //parse a URL to form an object of properties
82  public/javascripts/wymeditor/jquery.refinery.wymeditor.js
@@ -1212,6 +1212,7 @@ WYMeditor.editor.prototype.update = function() {
1212 1212
  * @description Opens a dialog box
1213 1213
  */
1214 1214
 WYMeditor.editor.prototype.dialog = function( dialogType ) {
  1215
+  this.update();
1215 1216
   var path = this._wym._options.dialogPath + dialogType;
1216 1217
 
1217 1218
   this._current_unique_stamp = this.uniqueStamp();
@@ -1258,10 +1259,50 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
1258 1259
 
1259 1260
   if ((parent_node != null) && (parent_node.tagName.toLowerCase() != WYMeditor.A))
1260 1261
   {
1261  
-    // wrap the current selection with a funky span (not required for webkit)
1262  
-    if (this._selected_image == null && !$.browser.webkit)
  1262
+    // wrap the current selection with a funky span.
  1263
+    if (this._selected_image == null)
1263 1264
     {
1264  
-      this.wrap("<span id='replace_me_with_" + this._current_unique_stamp + "'>", "</span>");
  1265
+      if (selected != null && selected.tagName.toLowerCase() != WYMeditor.A && wym._iframe.contentWindow.getSelection) {
  1266
+        // Fixes webkit issue where it would not paste at cursor.
  1267
+        selection = wym._iframe.contentWindow.getSelection();
  1268
+        selected_html = $(selected).html().replace('&nbsp;', ' ');
  1269
+
  1270
+        if ((offset = selected_html.indexOf(selection.focusNode.textContent)) == -1) {
  1271
+          offset = 0;
  1272
+        }
  1273
+        focus = offset + selection.focusOffset;
  1274
+        anchor = offset + selection.anchorOffset;
  1275
+        start = (focus < anchor) ? focus : anchor;
  1276
+        end = (focus < anchor) ? anchor : focus;
  1277
+        length = (end - start);
  1278
+
  1279
+        focusNode = selection.focusNode.tagName === undefined ? selection.focusNode.parentNode : selection.focusNode;
  1280
+        if (!($.browser.mozilla && $(focusNode).attr('_moz_dirty') !== undefined)) {
  1281
+          if (length > 0) {
  1282
+            new_html = selected_html.substring(0, start)
  1283
+                       + "<span id='replace_me_with_" + this._current_unique_stamp + "'>"
  1284
+                       + selected_html.substring(start, end)
  1285
+                       + "</span>"
  1286
+                       + selected_html.substring(end);
  1287
+          } else {
  1288
+            new_html = selected_html.substring(0, start)
  1289
+                     + "<span id='replace_me_with_" + this._current_unique_stamp + "'></span>"
  1290
+                     + selected_html.substring(end);
  1291
+          }
  1292
+        } else {
  1293
+          // Mozilla Firefox seems to throw its toys out of the cot if the paragraph is _moz_dirty
  1294
+          // and we try to get a selection of the entire text contents of the paragraph.
  1295
+          // Firefox has to use this.wrap() for this specific condition.
  1296
+          this.wrap("<span id='replace_me_with_" + this._current_unique_stamp + "'>", "</span>");
  1297
+        }
  1298
+
  1299
+        if (typeof(new_html) != 'undefined' && new_html != null) {
  1300
+          new_html = new_html.replace('  ', '&nbsp;');
  1301
+          $(selected).html(new_html);
  1302
+        }
  1303
+      } else {
  1304
+        this.wrap("<span id='replace_me_with_" + this._current_unique_stamp + "'>", "</span>");
  1305
+      }
1265 1306
     }
1266 1307
   }
1267 1308
   else {
@@ -1443,6 +1484,9 @@ WYMeditor.editor.prototype.insert = function(html) {
1443 1484
 };
1444 1485
 
1445 1486
 WYMeditor.editor.prototype.wrap = function(left, right, selection) {
  1487
+  left = (typeof(left) != 'undefined' ? left : '');
  1488
+  right = (typeof(right) != 'undefined' ? right : '');
  1489
+
1446 1490
   // Do we have a selection?
1447 1491
   if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
1448 1492
   if (selection.focusNode != null) {
@@ -1650,7 +1694,7 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
1650 1694
   // focus first textarea or input type text element
1651 1695
   dialog.find('input[type=text], textarea').first().focus();
1652 1696
 
1653  
-  dialog.find(".close_dialog").click(function(e){
  1697
+  doc.find('body').addClass('wym_iframe_body').find('#cancel_button').add(dialog.find('.close_dialog')).click(function(e){
1654 1698
     wym.close_dialog(e, true);
1655 1699
   });
1656 1700
 
@@ -1728,19 +1772,15 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
1728 1772
   $(wym._options.dialogImageSelector).find(wym._options.submitSelector).click(function(e) {
1729 1773
     form = $(this.form);
1730 1774
     if ((url = form.find(wym._options.srcSelector).val()) != null && url.length > 0) {
1731  
-      wym._exec(WYMeditor.INSERT_IMAGE, wym._current_unique_stamp, selected);
1732  
-
1733  
-      if((image = $(wym._doc.body).find("img[src*=" + wym._current_unique_stamp + "]")).length > 0) {
1734  
-        image.attr(WYMeditor.SRC, url)
1735  
-              .attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
1736  
-              .attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
1737  
-              .attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());
  1775
+      (image = $('<img />'))
  1776
+        .attr(WYMeditor.SRC, url)
  1777
+        .attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
  1778
+        .attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
  1779
+        .attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());
1738 1780
 
1739  
-        if (!$.browser.webkit && replaceable != null && (this._selected_image == null || (this._selected_image != null && replaceable.parentNode != null)))
1740  
-        {
1741  
-          replaceable.after(image).remove();
1742  
-        }
1743  
-      }
  1781
+       if (replaceable != null) {
  1782
+         replaceable.after(image).remove();
  1783
+       }
1744 1784
 
1745 1785
       // fire a click event on the dialogs close button
1746 1786
       wym.close_dialog(e);
@@ -1791,8 +1831,9 @@ WYMeditor.editor.prototype.close_dialog = function(e, cancelled) {
1791 1831
     if ((span = $(this._doc.body).find('span#replace_me_with_' + this._current_unique_stamp)).length > 0) {
1792 1832
       span.parent().html(span.parent().html().replace(new RegExp(["<span(.+?)", span.attr('id'), "(.+?)<\/span>"].join("")), span.html()));
1793 1833
     }
1794  
-    (remove_id = $(this._doc.body).find('#replace_me_with_' + this._current_unique_stamp)).attr('id', (remove_id.attr('_id_before_replaceable') || ""));
1795  
-
  1834
+    (remove_id = $(this._doc.body).find('#replace_me_with_' + this._current_unique_stamp))
  1835
+      .attr('id', (remove_id.attr('_id_before_replaceable') || ""))
  1836
+      .replaceWith(remove_id.html());
1796 1837
     if (this._undo_on_cancel == true) {
1797 1838
       this._exec("undo");
1798 1839
     }
@@ -4826,7 +4867,8 @@ WYMeditor.WymClassSafari.prototype.paste = function(sData) {
4826 4867
       sTmp = sTmp.replace(rExp, "<br />");
4827 4868
       if (x == 0 && $(container).html().replace(/<br\ ?\/?>/, "").length == 0) {
4828 4869
         $(container).html(sTmp);
4829  
-      } else {
  4870
+      }
  4871
+      else {
4830 4872
         $(container).after("<p>" + sTmp + "</p>");
4831 4873
       }
4832 4874
     }
@@ -5062,4 +5104,4 @@ WYMeditor.WymClassSafari.prototype.getTagForStyle = function(style) {
5062 5104
   if(/sub/.test(style)) return 'sub';
5063 5105
   if(/super/.test(style)) return 'sup';
5064 5106
   return false;
5065  
-};
  5107
+};
4  refinerycms.gemspec
... ...
@@ -1,8 +1,8 @@
1 1
 Gem::Specification.new do |s|
2 2
   s.name              = %q{refinerycms}
3  
-  s.version           = %q{0.9.7.13}
  3
+  s.version           = %q{0.9.7.14}
4 4
   s.description       = %q{A beautiful open source Ruby on Rails content manager for small business. Easy to extend, easy to use, lightweight and all wrapped up in a super slick UI.}
5  
-  s.date              = %q{2010-08-24}
  5
+  s.date              = %q{2010-10-12}
6 6
   s.summary           = %q{A beautiful open source Ruby on Rails content manager for small business.}
7 7
   s.email             = %q{info@refinerycms.com}
8 8
   s.homepage          = %q{http://refinerycms.com}
2  vendor/plugins/refinery/lib/refinery.rb
@@ -31,7 +31,7 @@ class << self
31 31
     @major = 0
32 32
     @minor = 9
33 33
     @tiny  = 7
34  
-    @build = 13
  34
+    @build = 14
35 35
 
36 36
     def self.to_s
37 37
       [@major, @minor, @tiny, @build].compact.join('.')
2  vendor/plugins/refinery/rails/init.rb
@@ -18,6 +18,6 @@
18 18
 ].uniq.each do |path|
19 19
   Dir[path].each do |presenters_path|
20 20
     $LOAD_PATH << presenters_path
21  
-    ::ActiveSupport::Dependencies.load_paths << presenters_path
  21
+    ::ActiveSupport::Dependencies.autoload_paths << presenters_path
22 22
   end
23 23
 end

No commit comments for this range

Something went wrong with that request. Please try again.