yellow-text-rails 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -39,6 +39,7 @@ As long as you retain this notice you can do whatever you want with this stuff.
39
39
  ## Changelog
40
40
  - v0.0.1: Very raw first version of the plugin
41
41
  - v0.0.2: Fixed a typo in the description
42
+ - v0.0.3 t/m v0.0.5: Updates of the jQuery plugin
42
43
 
43
44
  ## Contributing
44
45
 
@@ -2,10 +2,7 @@ require "yellow-text-rails/version"
2
2
 
3
3
  module YellowText
4
4
  module Rails
5
- if defined?(::Rails) and ::Rails.version >= "3.1"
6
- class Rails::Engine < ::Rails::Engine
7
- # this class enables the asset pipeline
8
- end
9
- end
5
+ class Engine < ::Rails::Engine
6
+ end
10
7
  end
11
8
  end
@@ -1,5 +1,5 @@
1
1
  module YellowText
2
2
  module Rails
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@
4
4
  * This plugin is created to make text editing
5
5
  * more fun and to make it easy for the editor.
6
6
  *
7
- * Version: 0.3.1
7
+ * Version: 0.3.2
8
8
  * Author: Stefan Vermaas
9
9
  * URL: www.stefanvermaas.nl
10
10
  *
@@ -409,15 +409,17 @@
409
409
 
410
410
  // Unwrap all br tags and remove the ugly div tags
411
411
  body.find("br").unwrap();
412
-
413
- // Find the first line
414
- var firstLine = body.contents()[0];
412
+
413
+ // Get fancy stuff done with the first line
414
+ var firstLine = "<p>" + $( body.contents()[0] ).html() + "</p>";
415
415
 
416
- // Check or the first line has a p tag surrounding it
417
- if( body.find(firstLine).not("p") ) {
418
- // The first line does not have a p tag
419
- body.find(firstLine).wrap("p");
420
- }
416
+ // Remove the first line
417
+ $( body.contents()[0] ).remove();
418
+
419
+ // Add the line on the first line
420
+ body.prepend( firstLine );
421
+
422
+ console.log( body.contents()[0] );
421
423
  },
422
424
 
423
425
  /**
@@ -433,9 +435,9 @@
433
435
  putContentBack: function() {
434
436
  // Grap the content of the iframe
435
437
  var postData = $(methods.editor).contents().find("body").html();
436
-
437
- // Add the data to the textarea, where this plugin is attached too
438
- $( methods.el ).html(postData);
438
+
439
+ // Make sure the textarea is empty
440
+ $( methods.el ).val( postData );
439
441
  }
440
442
  };
441
443
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yellow-text-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stefan Vermaas
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-02-08 00:00:00 Z
18
+ date: 2013-02-09 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: