Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: resolve/refinerycms
...
head fork: resolve/refinerycms
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 7 files changed
  • 0 commit comments
  • 2 contributors
View
8 Gemfile
@@ -17,16 +17,16 @@ gem 'sqlite3-ruby', :require => 'sqlite3' #db_adapter=sqlite3
# gem 'aws-s3'
#===REFINERY REQUIRED GEMS===
-gem 'acts_as_indexed', '= 0.6.4', :require => 'acts_as_indexed'
+gem 'acts_as_indexed', '= 0.6.6', :require => 'acts_as_indexed'
gem 'authlogic', '= 2.1.6', :require => 'authlogic'
gem 'friendly_id', '= 3.1.3', :require => 'friendly_id'
-gem 'rails', '= 2.3.8'
+gem 'rails', '= 2.3.9'
gem 'rmagick', '~> 2.12.0'
gem 'truncate_html', '= 0.3.2', :require => 'truncate_html'
gem 'will_paginate', '= 2.3.14', :require => 'will_paginate'
group :test do
- gem 'json_pure', '=1.4.6', :require => 'json/pure'
+ gem 'json_pure', '= 1.4.6', :require => 'json/pure'
gem 'factory_girl'
gem 'test-unit', '= 1.2.3'
gem 'capybara'
@@ -45,7 +45,7 @@ end
#===REQUIRED FOR REFINERY GEM INSTALL===
# Leave the gem below disabled (commented out) if you're not using the gem install method.
-# gem 'refinerycms', '= 0.9.7.12'
+# gem 'refinerycms', '= 0.9.7.14'
#===END OF REFINERY GEM INSTALL REQUIREMENTS===
# Bundle gems for certain environments:
View
63 Gemfile.lock
@@ -1,20 +1,20 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (2.3.8)
- actionpack (= 2.3.8)
- actionpack (2.3.8)
- activesupport (= 2.3.8)
+ actionmailer (2.3.9)
+ actionpack (= 2.3.9)
+ actionpack (2.3.9)
+ activesupport (= 2.3.9)
rack (~> 1.1.0)
- activerecord (2.3.8)
- activesupport (= 2.3.8)
- activeresource (2.3.8)
- activesupport (= 2.3.8)
- activesupport (2.3.8)
- acts_as_indexed (0.6.4)
+ activerecord (2.3.9)
+ activesupport (= 2.3.9)
+ activeresource (2.3.9)
+ activesupport (= 2.3.9)
+ activesupport (2.3.9)
+ acts_as_indexed (0.6.6)
authlogic (2.1.6)
activesupport
- babosa (0.1.1)
+ babosa (0.2.0)
builder (2.1.2)
capybara (0.3.9)
culerity (>= 0.2.4)
@@ -24,15 +24,15 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3)
configuration (1.1.0)
- cucumber (0.8.5)
+ cucumber (0.9.2)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
- gherkin (~> 2.1.4)
- json_pure (~> 1.4.3)
- term-ansicolor (~> 1.0.4)
+ gherkin (~> 2.2.5)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
cucumber-rails (0.3.2)
cucumber (>= 0.8.0)
- culerity (0.2.10)
+ culerity (0.2.12)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
factory_girl (1.3.2)
@@ -40,11 +40,13 @@ GEM
rake (>= 0.8.7)
friendly_id (3.1.3)
babosa (>= 0.1.0)
- gherkin (2.1.5)
- trollop (~> 1.16.2)
- hoe (2.6.1)
+ gherkin (2.2.8)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ hoe (2.6.2)
rake (>= 0.8.7)
rubyforge (>= 2.0.4)
+ json (1.4.6)
json_pure (1.4.6)
launchy (0.3.7)
configuration (>= 0.0.5)
@@ -52,14 +54,14 @@ GEM
mime-types (1.16)
nokogiri (1.4.3.1)
rack (1.1.0)
- rack-test (0.5.4)
+ rack-test (0.5.6)
rack (>= 1.0)
- rails (2.3.8)
- actionmailer (= 2.3.8)
- actionpack (= 2.3.8)
- activerecord (= 2.3.8)
- activeresource (= 2.3.8)
- activesupport (= 2.3.8)
+ rails (2.3.9)
+ actionmailer (= 2.3.9)
+ actionpack (= 2.3.9)
+ activerecord (= 2.3.9)
+ activeresource (= 2.3.9)
+ activesupport (= 2.3.9)
rake (>= 0.8.3)
rake (0.8.7)
rmagick (2.12.2)
@@ -67,11 +69,11 @@ GEM
rspec-rails (1.3.2)
rack (>= 1.0.0)
rspec (>= 1.3.0)
- ruby-prof (0.9.1)
+ ruby-prof (0.9.2)
rubyforge (2.0.4)
json_pure (>= 1.1.7)
rubyzip (0.9.4)
- selenium-webdriver (0.0.27)
+ selenium-webdriver (0.0.28)
ffi (>= 0.6.1)
json_pure
rubyzip
@@ -80,7 +82,6 @@ GEM
term-ansicolor (1.0.5)
test-unit (1.2.3)
hoe (>= 1.5.1)
- trollop (1.16.2)
truncate_html (0.3.2)
will_paginate (2.3.14)
@@ -88,7 +89,7 @@ PLATFORMS
ruby
DEPENDENCIES
- acts_as_indexed (= 0.6.4)
+ acts_as_indexed (= 0.6.6)
authlogic (= 2.1.6)
capybara
cucumber
@@ -99,7 +100,7 @@ DEPENDENCIES
gherkin
json_pure (= 1.4.6)
launchy
- rails (= 2.3.8)
+ rails (= 2.3.9)
rmagick (~> 2.12.0)
rspec
rspec-rails
View
19 public/javascripts/refinery/admin.js
@@ -950,18 +950,21 @@ var resource_picker = {
}
close_dialog = function(e) {
- if (parent
- && parent.document.location.href != document.location.href
- && $.isFunction(parent.$))
+ if (parent && parent.document.location.href != document.location.href && $.isFunction(parent.$))
{
- $(parent.document.body).removeClass('hide-overflow');
- parent.$('.ui-dialog').dialog('close').remove();
+ the_body = $(parent.document.body)
+ the_dialog = parent.$('.ui-dialog');
} else {
- $(document.body).removeClass('hide-overflow');
- $('.ui-dialog').dialog('close').remove();
+ the_body = $(document.body).removeClass('hide-overflow');
+ the_dialog = $('.ui-dialog').dialog('close').remove();
}
+ // if there's a wymeditor involved then let it do its thing without blocking first.
+ if (!($(document.body).hasClass('wym_iframe_body'))) {
+ the_body.removeClass('hide-overflow');
+ the_dialog.dialog('close').remove();
- e.preventDefault();
+ e.preventDefault();
+ }
}
//parse a URL to form an object of properties
View
82 public/javascripts/wymeditor/jquery.refinery.wymeditor.js
@@ -1212,6 +1212,7 @@ WYMeditor.editor.prototype.update = function() {
* @description Opens a dialog box
*/
WYMeditor.editor.prototype.dialog = function( dialogType ) {
+ this.update();
var path = this._wym._options.dialogPath + dialogType;
this._current_unique_stamp = this.uniqueStamp();
@@ -1258,10 +1259,50 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
if ((parent_node != null) && (parent_node.tagName.toLowerCase() != WYMeditor.A))
{
- // wrap the current selection with a funky span (not required for webkit)
- if (this._selected_image == null && !$.browser.webkit)
+ // wrap the current selection with a funky span.
+ if (this._selected_image == null)
{
- this.wrap("<span id='replace_me_with_" + this._current_unique_stamp + "'>", "</span>");
+ if (selected != null && selected.tagName.toLowerCase() != WYMeditor.A && wym._iframe.contentWindow.getSelection) {
+ // Fixes webkit issue where it would not paste at cursor.
+ selection = wym._iframe.contentWindow.getSelection();
+ selected_html = $(selected).html().replace('&nbsp;', ' ');
+
+ if ((offset = selected_html.indexOf(selection.focusNode.textContent)) == -1) {
+ offset = 0;
+ }
+ focus = offset + selection.focusOffset;
+ anchor = offset + selection.anchorOffset;
+ start = (focus < anchor) ? focus : anchor;
+ end = (focus < anchor) ? anchor : focus;
+ length = (end - start);
+
+ focusNode = selection.focusNode.tagName === undefined ? selection.focusNode.parentNode : selection.focusNode;
+ if (!($.browser.mozilla && $(focusNode).attr('_moz_dirty') !== undefined)) {
+ if (length > 0) {
+ new_html = selected_html.substring(0, start)
+ + "<span id='replace_me_with_" + this._current_unique_stamp + "'>"
+ + selected_html.substring(start, end)
+ + "</span>"
+ + selected_html.substring(end);
+ } else {
+ new_html = selected_html.substring(0, start)
+ + "<span id='replace_me_with_" + this._current_unique_stamp + "'></span>"
+ + selected_html.substring(end);
+ }
+ } else {
+ // Mozilla Firefox seems to throw its toys out of the cot if the paragraph is _moz_dirty
+ // and we try to get a selection of the entire text contents of the paragraph.
+ // Firefox has to use this.wrap() for this specific condition.
+ this.wrap("<span id='replace_me_with_" + this._current_unique_stamp + "'>", "</span>");
+ }
+
+ if (typeof(new_html) != 'undefined' && new_html != null) {
+ new_html = new_html.replace(' ', '&nbsp;');
+ $(selected).html(new_html);
+ }
+ } else {
+ this.wrap("<span id='replace_me_with_" + this._current_unique_stamp + "'>", "</span>");
+ }
}
}
else {
@@ -1443,6 +1484,9 @@ WYMeditor.editor.prototype.insert = function(html) {
};
WYMeditor.editor.prototype.wrap = function(left, right, selection) {
+ left = (typeof(left) != 'undefined' ? left : '');
+ right = (typeof(right) != 'undefined' ? right : '');
+
// Do we have a selection?
if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
if (selection.focusNode != null) {
@@ -1650,7 +1694,7 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
// focus first textarea or input type text element
dialog.find('input[type=text], textarea').first().focus();
- dialog.find(".close_dialog").click(function(e){
+ doc.find('body').addClass('wym_iframe_body').find('#cancel_button').add(dialog.find('.close_dialog')).click(function(e){
wym.close_dialog(e, true);
});
@@ -1728,19 +1772,15 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
$(wym._options.dialogImageSelector).find(wym._options.submitSelector).click(function(e) {
form = $(this.form);
if ((url = form.find(wym._options.srcSelector).val()) != null && url.length > 0) {
- wym._exec(WYMeditor.INSERT_IMAGE, wym._current_unique_stamp, selected);
-
- if((image = $(wym._doc.body).find("img[src*=" + wym._current_unique_stamp + "]")).length > 0) {
- image.attr(WYMeditor.SRC, url)
- .attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
- .attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
- .attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());
+ (image = $('<img />'))
+ .attr(WYMeditor.SRC, url)
+ .attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
+ .attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
+ .attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());
- if (!$.browser.webkit && replaceable != null && (this._selected_image == null || (this._selected_image != null && replaceable.parentNode != null)))
- {
- replaceable.after(image).remove();
- }
- }
+ if (replaceable != null) {
+ replaceable.after(image).remove();
+ }
// fire a click event on the dialogs close button
wym.close_dialog(e);
@@ -1791,8 +1831,9 @@ WYMeditor.editor.prototype.close_dialog = function(e, cancelled) {
if ((span = $(this._doc.body).find('span#replace_me_with_' + this._current_unique_stamp)).length > 0) {
span.parent().html(span.parent().html().replace(new RegExp(["<span(.+?)", span.attr('id'), "(.+?)<\/span>"].join("")), span.html()));
}
- (remove_id = $(this._doc.body).find('#replace_me_with_' + this._current_unique_stamp)).attr('id', (remove_id.attr('_id_before_replaceable') || ""));
-
+ (remove_id = $(this._doc.body).find('#replace_me_with_' + this._current_unique_stamp))
+ .attr('id', (remove_id.attr('_id_before_replaceable') || ""))
+ .replaceWith(remove_id.html());
if (this._undo_on_cancel == true) {
this._exec("undo");
}
@@ -4826,7 +4867,8 @@ WYMeditor.WymClassSafari.prototype.paste = function(sData) {
sTmp = sTmp.replace(rExp, "<br />");
if (x == 0 && $(container).html().replace(/<br\ ?\/?>/, "").length == 0) {
$(container).html(sTmp);
- } else {
+ }
+ else {
$(container).after("<p>" + sTmp + "</p>");
}
}
@@ -5062,4 +5104,4 @@ WYMeditor.WymClassSafari.prototype.getTagForStyle = function(style) {
if(/sub/.test(style)) return 'sub';
if(/super/.test(style)) return 'sup';
return false;
-};
+};
View
4 refinerycms.gemspec
@@ -1,8 +1,8 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms}
- s.version = %q{0.9.7.13}
+ s.version = %q{0.9.7.14}
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.}
- s.date = %q{2010-08-24}
+ s.date = %q{2010-10-12}
s.summary = %q{A beautiful open source Ruby on Rails content manager for small business.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
View
2  vendor/plugins/refinery/lib/refinery.rb
@@ -31,7 +31,7 @@ class << self
@major = 0
@minor = 9
@tiny = 7
- @build = 13
+ @build = 14
def self.to_s
[@major, @minor, @tiny, @build].compact.join('.')
View
2  vendor/plugins/refinery/rails/init.rb
@@ -18,6 +18,6 @@
].uniq.each do |path|
Dir[path].each do |presenters_path|
$LOAD_PATH << presenters_path
- ::ActiveSupport::Dependencies.load_paths << presenters_path
+ ::ActiveSupport::Dependencies.autoload_paths << presenters_path
end
end

No commit comments for this range

Something went wrong with that request. Please try again.