refinerycms 0.9.6.30 → 0.9.6.31

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.6.30
1
+ 0.9.6.31
@@ -2,7 +2,7 @@
2
2
  RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
3
3
 
4
4
  # Specified gem version of Refinery to use when vendor/plugins/refinery/lib/refinery.rb is not present.
5
- REFINERY_GEM_VERSION = '0.9.6.30' unless defined? REFINERY_GEM_VERSION
5
+ REFINERY_GEM_VERSION = '0.9.6.31' unless defined? REFINERY_GEM_VERSION
6
6
 
7
7
  # Boot Rails
8
8
  require File.join(File.dirname(__FILE__), 'boot')
@@ -104,7 +104,6 @@ var wymeditor_boot_options = $.extend({
104
104
  + "<form>"
105
105
  + "<input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='" + WYMeditor.DIALOG_PASTE + "' />"
106
106
  + "<div class='field'>"
107
- + "<label for='wym_text'>{Text_From_Word}</label"
108
107
  + "<textarea class='wym_text' rows='10' cols='50'></textarea>"
109
108
  + "</div>"
110
109
  + "<div id='dialog-form-actions' class='form-actions'>"
@@ -95,7 +95,7 @@ $.extend(WYMeditor, {
95
95
  DIALOG_LINK - A link dialog type.
96
96
  DIALOG_IMAGE - An image dialog type.
97
97
  DIALOG_TABLE - A table dialog type.
98
- DIALOG_PASTE - A 'Paste from Word' dialog type.
98
+ DIALOG_PASTE - A 'Paste' dialog type.
99
99
  BOLD - Command: (un)set selection to <strong>.
100
100
  ITALIC - Command: (un)set selection to <em>.
101
101
  CREATE_LINK - Command: open the link dialog or (un)set link.
@@ -1277,8 +1277,8 @@ WYMeditor.editor.prototype.dialog = function( dialogType ) {
1277
1277
  else {
1278
1278
  parent_node = selected;
1279
1279
  }
1280
-
1281
- if ((parent_node != null) && (dialogType != WYMeditor.DIALOG_PASTE) && (parent_node.tagName.toLowerCase() != WYMeditor.A))
1280
+
1281
+ if ((parent_node != null) && (parent_node.tagName.toLowerCase() != WYMeditor.A))
1282
1282
  {
1283
1283
  // wrap the current selection with a funky span (not required for safari)
1284
1284
  if (!this._selected_image && !$.browser.safari)
@@ -1381,14 +1381,51 @@ WYMeditor.editor.prototype.paste = function(sData) {
1381
1381
 
1382
1382
  //add a P for each item
1383
1383
  if(container && container.tagName.toLowerCase() != WYMeditor.BODY) {
1384
+ contentAfterBreak = "";
1385
+ insertedContentAfterBreak = "";
1384
1386
  for(x = aP.length - 1; x >= 0; x--) {
1385
- sTmp = aP[x];
1386
1387
  //simple newlines are replaced by a break
1387
- sTmp = sTmp.replace(rExp, "<br />");
1388
- if (x == 0 && $(container).html().replace(/<br\ ?\/?>/, "").length == 0) {
1389
- $(container).html(sTmp);
1388
+ sTmp = aP[x].replace(rExp, "<br />");
1389
+ if (x == 0) {
1390
+ // if we're inside a p tag but the container is not a p tag
1391
+ // then we need to close the p tag first before starting a new one.
1392
+ // Only if we placed more items after it (aP.length)
1393
+ if (aP.length > 1
1394
+ && $(container).get(0).tagName.toLowerCase() == "span"
1395
+ && $(container).attr('id') == ('replace_me_with_' + wym._current_unique_stamp)
1396
+ && $(container).parent().get(0).tagName.toLowerCase() == "p")
1397
+ {
1398
+ p = $(container).parent();
1399
+ matches = p.html().match(new RegExp("([\\s\\S]*)\<span id=[\'|\"]replace_me_with_" + wym._current_unique_stamp + "[\'|\"]\>.*\<\/span\>"));
1400
+ sTmp = matches[1] + sTmp + $(container).html();
1401
+ p.html(sTmp);
1402
+ if (insertedContentAfterBreak != null && insertedContentAfterBreak.length > 0) {
1403
+ p.after(insertedContentAfterBreak);
1404
+ }
1405
+ if (contentAfterBreak != null && contentAfterBreak.length > 0) {
1406
+ if ((last_paste = p.parent().find('p#last_paste')).length == 1) {
1407
+ last_paste.attr('id', null).html(last_paste.html() + contentAfterBreak);
1408
+ } else {
1409
+ p.next().after("<p>" + contentAfterBreak + "</p>");
1410
+ }
1411
+ }
1412
+
1413
+ } else {
1414
+ $(container).html($(container).html() + sTmp);
1415
+ }
1390
1416
  } else {
1391
- $(container).after("<p>" + sTmp + "</p>");
1417
+ if ((aP.length -1) == x) {
1418
+ contentAfterBreak = $(container).parent().html().match(new RegExp("\<span id=[\'|\"]replace_me_with_" + wym._current_unique_stamp + "[\'|\"]\>.*\<\/span\>([\\s\\S]*)"))[1].split('</p>')[0];
1419
+ sTmp = "<p id='last_paste'>" + sTmp + "</p>";
1420
+ } else {
1421
+ sTmp = "<p>" + sTmp + "</p>";
1422
+ }
1423
+
1424
+ if (insertedContentAfterBreak == "") {
1425
+ insertedContentAfterBreak = insertedContentAfterBreak + sTmp;
1426
+ } else {
1427
+ insertedContentAfterBreak = sTmp + insertedContentAfterBreak;
1428
+ }
1392
1429
  }
1393
1430
  }
1394
1431
  } else {
@@ -1406,37 +1443,40 @@ WYMeditor.editor.prototype.paste = function(sData) {
1406
1443
 
1407
1444
  if (replaceable.get(0) != null) {
1408
1445
  // set the id of the container back.
1409
- replaceable.get(0).id = replaceable.get(0)._id_before_replaceable;
1446
+ if (replaceable.get(0).tagName.toLowerCase() == 'span') {
1447
+ replaceable.replaceWith(replaceable.html());
1448
+ }
1449
+ replaceable.attr('id', replaceable.get(0)._id_before_replaceable || null);
1410
1450
  }
1411
1451
  };
1412
1452
 
1413
1453
  WYMeditor.editor.prototype.insert = function(html) {
1414
- // Do we have a selection?
1415
- if (this._iframe.contentWindow.getSelection().focusNode != null) {
1416
- // Overwrite selection with provided html
1417
- this._exec(WYMeditor.INSERT_HTML, html);
1418
- } else {
1419
- // Fall back to the internal paste function if there's no selection
1420
- this.paste(html);
1421
- }
1454
+ // Do we have a selection?
1455
+ if (this._iframe.contentWindow.getSelection().focusNode != null) {
1456
+ // Overwrite selection with provided html
1457
+ this._exec(WYMeditor.INSERT_HTML, html);
1458
+ } else {
1459
+ // Fall back to the internal paste function if there's no selection
1460
+ this.paste(html);
1461
+ }
1422
1462
  };
1423
1463
 
1424
1464
  WYMeditor.editor.prototype.wrap = function(left, right, selection) {
1425
- // Do we have a selection?
1426
- if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
1427
- if (selection.focusNode != null) {
1428
- // Wrap selection with provided html
1429
- this._exec( WYMeditor.INSERT_HTML, left + selection.toString() + right);
1430
- }
1465
+ // Do we have a selection?
1466
+ if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
1467
+ if (selection.focusNode != null) {
1468
+ // Wrap selection with provided html
1469
+ this._exec( WYMeditor.INSERT_HTML, left + selection.toString() + right);
1470
+ }
1431
1471
  };
1432
1472
 
1433
1473
  WYMeditor.editor.prototype.unwrap = function(selection) {
1434
- // Do we have a selection?
1435
- if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
1436
- if (selection.focusNode != null) {
1437
- // Unwrap selection
1438
- this._exec( WYMeditor.INSERT_HTML, selection.toString() );
1439
- }
1474
+ // Do we have a selection?
1475
+ if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
1476
+ if (selection.focusNode != null) {
1477
+ // Unwrap selection
1478
+ this._exec( WYMeditor.INSERT_HTML, selection.toString() );
1479
+ }
1440
1480
  };
1441
1481
 
1442
1482
  WYMeditor.editor.prototype.addCssRules = function(doc, aCss) {
@@ -4741,6 +4781,53 @@ WYMeditor.WymClassSafari.prototype.initIframe = function(iframe) {
4741
4781
  this.listen();
4742
4782
  };
4743
4783
 
4784
+ WYMeditor.WymClassSafari.prototype.paste = function(sData) {
4785
+
4786
+ wym = this;
4787
+
4788
+ wym.format_block();
4789
+
4790
+ var sTmp;
4791
+ replaceable = $(wym._doc.body).find('#replace_me_with_' + wym._current_unique_stamp);
4792
+
4793
+ // replaceable doesn't actually get replaced here, it's just used as a marker for where the cursor was.
4794
+ var container = replaceable.get(0) || this.selected();
4795
+
4796
+ //split the data, using double newlines as the separator
4797
+ var aP = sData.split(wym._newLine + wym._newLine);
4798
+ var rExp = new RegExp(wym._newLine, "g");
4799
+
4800
+ //add a P for each item
4801
+ if(container && container.tagName.toLowerCase() != WYMeditor.BODY) {
4802
+ for(x = aP.length - 1; x >= 0; x--) {
4803
+ sTmp = aP[x];
4804
+ //simple newlines are replaced by a break
4805
+ sTmp = sTmp.replace(rExp, "<br />");
4806
+ if (x == 0 && $(container).html().replace(/<br\ ?\/?>/, "").length == 0) {
4807
+ $(container).html(sTmp);
4808
+ } else {
4809
+ $(container).after("<p>" + sTmp + "</p>");
4810
+ }
4811
+ }
4812
+ } else {
4813
+ for(x = 0; x < aP.length; x++) {
4814
+ sTmp = aP[x];
4815
+ //simple newlines are replaced by a break
4816
+ sTmp = sTmp.replace(rExp, "<br />");
4817
+ if (x == 0 && $(container).html().replace(/<br\ ?\/?>/, "").length == 0) {
4818
+ $(container).html(sTmp);
4819
+ } else {
4820
+ $(wym._doc.body).append("<p>" + sTmp + "</p>");
4821
+ }
4822
+ }
4823
+ }
4824
+
4825
+ if (replaceable.get(0) != null) {
4826
+ // set the id of the container back.
4827
+ replaceable.get(0).id = replaceable.get(0)._id_before_replaceable;
4828
+ }
4829
+ };
4830
+
4744
4831
  WYMeditor.WymClassSafari.prototype._exec = function(cmd,param) {
4745
4832
 
4746
4833
  if(!this.selected()) return(false);
@@ -37,12 +37,11 @@ WYMeditor.STRINGS['en'] = {
37
37
  Cancel: 'Cancel',
38
38
  Choose: 'Choose',
39
39
  Preview: 'Preview',
40
- Paste_From_Word: 'Paste from Word',
40
+ Paste_From_Word: 'Paste',
41
41
  Tools: 'Tools',
42
42
  Containers: 'Containers',
43
43
  Classes: 'Classes',
44
44
  Status: 'Status',
45
45
  Source_Code: 'Source code',
46
- Text_From_Word: 'Text From Word',
47
46
  Css_Class: 'Apply CSS Class'
48
47
  };
@@ -36,7 +36,7 @@ WYMeditor.STRINGS['fa'] = {
36
36
  Cancel: 'لغو',//Cancel
37
37
  Choose: 'انتخاب',//Choose
38
38
  Preview: 'پیش‌نمایش',//Preview
39
- Paste_From_Word: 'انتقال از ورد',//Paste from Word
39
+ Paste_From_Word: 'انتقال از ورد',//Paste
40
40
  Tools: 'ابزار',//Tools
41
41
  Containers: '‌قالب‌ها',//Containers
42
42
  Classes: 'کلاس‌ها',//Classes
@@ -1258,4 +1258,8 @@ ul#plugins li {
1258
1258
  }
1259
1259
  .tooltip * {
1260
1260
  color: black;
1261
+ }
1262
+
1263
+ .wym_dialog_paste .field textarea {
1264
+ width: 98%;
1261
1265
  }
data/readme.md CHANGED
@@ -148,7 +148,7 @@ This will pull in all of the updated files in the project and may result in some
148
148
 
149
149
  * Manage who can access Refinery
150
150
  * Control which plugins each user has access to
151
- * Uses the popular [RESTful authentication](http://github.com/technoweenie/restful-authentication) Rails plugin
151
+ * Uses the popular [authlogic](http://github.com/binarylogic/authlogic) authentication Rails plugin
152
152
 
153
153
  ### [Themes](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/themes/themes.md)
154
154
 
@@ -4,7 +4,9 @@
4
4
 
5
5
  At the heart of Refinery's user management is the authentication plugin located in ``vendor/plugins/authentication``
6
6
 
7
- What this really is is just a standard [RESTFul authentication](http://github.com/technoweenie/restful-authentication) install extended with a few extra features like "I forgot my password" and hooked directly into the heart of Refinery's plugin system.
7
+ What this really is is just a standard [authlogic](http://github.com/binarylogic/authlogic) install extended with a few extra features like "I forgot my password" and hooked directly into the heart of Refinery's plugin system.
8
+
9
+ Authlogic allows you to easily integrate with other systems too. So you could be logged in into another system using authlogic and easily stay logged in between the two systems without having to login twice.
8
10
 
9
11
  ## Adding New Users
10
12
 
@@ -1,13 +1,11 @@
1
1
  <%
2
2
  # web address link
3
3
  web_address_text = "http://"
4
- unless params[:current_link].blank?
5
- web_address_text = params[:current_link] if params[:current_link] =~ /^http:\/\//
6
- end
7
- web_address_target_blank = params[:target_blank] == "true"
4
+ web_address_text = params[:current_link] if params[:current_link].present? and params[:current_link] =~ /^http:\/\//
5
+ web_address_target_blank = (params[:target_blank] == "true")
8
6
 
9
7
  # mailto link
10
- unless params[:current_link].blank?
8
+ if params[:current_link].present?
11
9
  if params[:current_link] =~ /^mailto:/
12
10
  email_address_text = params[:current_link].split("mailto:")[1].split('?')[0]
13
11
  end
@@ -16,18 +14,18 @@
16
14
  end
17
15
 
18
16
  # resource link
19
- unless params[:current_link].blank?
17
+ if params[:current_link].present?
20
18
  is_resource_link = params[:current_link].include?("/system/resources")
21
19
  end
22
20
 
23
- if params[:paginating].blank?
21
+ if params[:paginating].present?
22
+ page_area_selected = (params[:paginating] == "your_page")
23
+ resource_area_selected = (params[:paginating] == "resource_file")
24
+ else
24
25
  page_area_selected = (!is_resource_link and web_address_text == "http://" and email_address_text.blank?)
25
26
  web_address_area_selected = (web_address_text != "http://")
26
27
  email_address_area_selected = !email_address_text.blank?
27
28
  resource_area_selected = is_resource_link
28
- else
29
- page_area_selected = (params[:paginating] == "your_page")
30
- resource_area_selected = (params[:paginating] == "resource_file")
31
29
  end
32
30
  %>
33
31
  <div class='clearfix dialog_link_to'>
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 6
9
- - 30
10
- version: 0.9.6.30
9
+ - 31
10
+ version: 0.9.6.31
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-04-16 00:00:00 +12:00
20
+ date: 2010-04-20 00:00:00 +12:00
21
21
  default_executable:
22
22
  dependencies: []
23
23