yellow-text-rails 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module YellowText
2
2
  module Rails
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -4,8 +4,8 @@
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.4.1
7
+ * Version: 0.4.2
8
8
  * Author: Stefan Vermaas
9
9
  * URL: www.stefanvermaas.nl
10
10
  *
11
- */(function(e){var t={init:function(n,r){t.el=n;t.settings=e.extend({width:"100%",height:"300px",containerClass:"js-editor-container",buttonsClass:"js-editor-buttons",iFrameClass:"js-editor-iframe",cleanOnSubmit:!0,defaultFont:"Helvetica Neue, Helvetica, arial, sans-serief",defaultFontSize:"1em",defaultFontColor:"#000000",defaultActions:"bold, underline, italic, strikethrough, align-left, align-center, align-right, unordered-list, ordered-list, link, image",isContentChanged:function(){},setImage:function(){}},r);t.render();t.setContent();t.events()},render:function(){t.createTextEditor();t.createButtons()},createTextEditor:function(){e(t.el).hide();t.container=e("<div />").addClass(t.settings.containerClass).css({"float":"left",width:t.settings.width,border:"1px solid #ccc"});e(t.el).after(t.container);t.editor=e("<iframe />").addClass(t.settings.iFrameClass).css({"float":"left",width:t.settings.width,height:t.settings.height,border:"0",overflow:"hidden"}).appendTo(t.container).get(0);t.editor.contentWindow.document.open();t.editor.contentWindow.document.close();t.editor.contentWindow.document.designMode="on";e(t.editor).contents().find("body").css({"word-wrap":"break-word","font-family":t.settings.defaultFont,"font-size":t.settings.defaultFontSize,color:t.settings.defaultFontColor});var n='<style type="text/css">body{padding: 2%;} p { margin: 0; }</style>';e(t.editor).contents().find("head").append(n);t.buttons=e("<div />").addClass(t.settings.buttonsClass).css({"float":"left",width:t.settings.width}).prependTo(t.container)},setContent:function(){var n=e(t.el).text();e(t.editor).contents().find("body").append(n)},createButtons:function(){var n=t.settings.defaultActions.split(/, ?/);for(i=0;i<n.length;i++){var r;switch(n[i]){case"bold":r={content:"b",command:"bold"};break;case"underline":r={content:"u",command:"underline"};break;case"italic":r={content:"i",command:"italic"};break;case"strikethrough":r={content:"s",command:"strikethrough"};break;case"align-left":r={content:"left",command:"JustifyLeft"};break;case"align-center":r={content:"center",command:"JustifyCenter"};break;case"align-right":r={content:"right",command:"JustifyRight"};break;case"unordered-list":r={content:"ul",command:"InsertUnorderedList"};break;case"ordered-list":r={content:"ol",command:"InsertOrderedList"};break;case"image":r={content:"img",command:"image"};break;case"link":r={content:"link",command:"link"};break;default:r={content:"",command:""}}e("<a />").addClass(r.command).text(r.content).attr("data-command",r.command).appendTo(t.buttons)}},events:function(){e("."+t.settings.buttonsClass+" a").on("click",function(e){t.buttonClicked(e,this)});e(t.editor).contents().find("body").on("keydown",function(e){(e.ctrlKey||e.metaKey)&&t.shortkey(e,this)});e(t.editor).contents().find("body").on("keyup",function(n){var r=e(t.editor).contents().find("body").html()!==e(t.el).text()?!0:!1;t.settings.isContentChanged(r)});e(t.el).parents("form").on("submit",function(e){t.cleanTheCode();t.putContentBack()})},buttonClicked:function(n,r){var i=e(r).attr("data-command");t.editor.contentWindow.focus();t.runCMD(i);t.editor.contentWindow.focus()},shortkey:function(e){var n;t.editor.contentWindow.focus();e.which===66?n="bold":e.which===73?n="italic":e.which===85?n="underline":n="";t.runCMD(n);t.editor.contentWindow.focus()},runCMD:function(e){if(e==="image"){if(typeof t.settings.setImage=="function")var n=t.settings.setImage.call();var r=typeof n!="undefined"&&n.length>0?n:prompt("URL (example: http://www.google.com): ");return t.editor.contentWindow.document.execCommand("InsertImage",!1,r)}if(e==="link"){var i=prompt("URL (example: http://www.google.com): ");return t.editor.contentWindow.document.execCommand("CreateLink",!1,i)}return t.editor.contentWindow.document.execCommand(e)},cleanTheCode:function(){var n=e(t.editor).contents().find("body");n.find("div").each(function(){var t=e(this).attr("style")?!0:!1;e(this).parent("p").not("p")&&(t?e(this).wrap('<p style="'+e(this).attr("style")+'"></p>'):e(this).wrap("<p></p>"));e(this).contents().unwrap()});n.find("br").removeAttr("class").unwrap();var r="<p>"+e(n.contents()[0]).html()+"</p>";e(n.contents()[0]).remove();n.prepend(r)},putContentBack:function(){var n=e(t.editor).contents().find("body").html();e(t.el).val(n)}};e.fn.texteditor=function(n){return this.each(function(){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return t.init(this,n);e.error("Method "+n+" does not exist on jQuery.texteditor")})}})(jQuery);
11
+ */(function(e){var t={init:function(n,r){t.el=n;t.settings=e.extend({width:"100%",height:"300px",containerClass:"js-editor-container",buttonsClass:"js-editor-buttons",iFrameClass:"js-editor-iframe",cleanOnSubmit:!0,defaultFont:"Helvetica Neue, Helvetica, arial, sans-serief",defaultFontSize:"1em",defaultFontColor:"#000000",defaultActions:"bold, underline, italic, strikethrough, align-left, align-center, align-right, unordered-list, ordered-list, link, image",isContentChanged:function(){},setImage:function(){}},r);t.render();t.setContent();t.events()},render:function(){t.createTextEditor();t.createButtons()},createTextEditor:function(){e(t.el).hide();t.container=e("<div />").addClass(t.settings.containerClass).css({"float":"left",width:t.settings.width,border:"1px solid #ccc"});e(t.el).after(t.container);t.editor=e("<iframe />").addClass(t.settings.iFrameClass).css({"float":"left",width:t.settings.width,height:t.settings.height,border:"0",overflow:"hidden"}).appendTo(t.container).get(0);t.editor.contentWindow.document.open();t.editor.contentWindow.document.close();t.editor.contentWindow.document.designMode="on";e(t.editor).contents().find("body").css({"word-wrap":"break-word","font-family":t.settings.defaultFont,"font-size":t.settings.defaultFontSize,color:t.settings.defaultFontColor});e(t.editor).contents().find("body").append("<p><br /></p>");var n='<style type="text/css">body{padding:2%;}p{margin:0;}</style>';e(t.editor).contents().find("head").append(n);t.buttons=e("<div />").addClass(t.settings.buttonsClass).css({"float":"left",width:t.settings.width}).prependTo(t.container)},setContent:function(){var n=e(t.el).text();e(t.editor).contents().find("body").append(n)},createButtons:function(){var n=t.settings.defaultActions.split(/, ?/);for(i=0;i<n.length;i++){var r;switch(n[i]){case"bold":r={content:"b",command:"bold"};break;case"underline":r={content:"u",command:"underline"};break;case"italic":r={content:"i",command:"italic"};break;case"strikethrough":r={content:"s",command:"strikethrough"};break;case"align-left":r={content:"left",command:"JustifyLeft"};break;case"align-center":r={content:"center",command:"JustifyCenter"};break;case"align-right":r={content:"right",command:"JustifyRight"};break;case"unordered-list":r={content:"ul",command:"InsertUnorderedList"};break;case"ordered-list":r={content:"ol",command:"InsertOrderedList"};break;case"image":r={content:"img",command:"image"};break;case"link":r={content:"link",command:"link"};break;default:r={content:"",command:""}}e("<a />").addClass(r.command).text(r.content).data("command",r.command).appendTo(t.buttons)}},events:function(){e("."+t.settings.buttonsClass+" a").on("click",function(n){var r=e(this).data("command");t.buttonClicked(n,r);(r==="InsertUnorderedList"||r==="InsertOrderedList")&&t.cleanLists(r)});e(t.editor).contents().find("body").on("keydown",function(e){(e.ctrlKey||e.metaKey)&&t.shortkey(e,this)});e(t.editor).contents().find("body").on("keyup",function(n){var r=e(t.editor).contents().find("body").html()!==e(t.el).text()?!0:!1;t.settings.isContentChanged(r)});e(t.el).parents("form").on("submit",function(e){t.cleanTheCode();t.putContentBack()})},buttonClicked:function(e,n){t.editor.contentWindow.focus();t.runCMD(n);t.editor.contentWindow.focus()},shortkey:function(e){var n=e.which;if(n===66||n===73||n===85){t.editor.contentWindow.focus();switch(n){case 66:t.runCMD("bold");break;case 73:t.runCMD("italic");break;case 85:t.runCMD("underline")}t.editor.contentWindow.focus()}},runCMD:function(e){if(e==="image"){if(typeof t.settings.setImage=="function")var n=t.settings.setImage.call();var r=typeof n!="undefined"&&n.length>0?n:prompt("URL (example: http://www.google.com): ");return t.editor.contentWindow.document.execCommand("InsertImage",!1,r)}if(e==="link"){var i=prompt("URL (example: http://www.google.com): ");return t.editor.contentWindow.document.execCommand("CreateLink",!1,i)}return t.editor.contentWindow.document.execCommand(e)},cleanTheCode:function(){e(t.editor).contents().find("body").find("br").removeAttr("class").unwrap()},cleanLists:function(n){var r=n==="InsertUnorderedList"?"ul":"ol";e(t.editor).contents().find("body").find(r).removeAttr("class").unwrap()},putContentBack:function(){var n=e(t.editor).contents().find("body").html();e(t.el).val(n)}};e.fn.texteditor=function(n){return this.each(function(){if(t[n])return t[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return t.init(this,n);e.error("Method "+n+" does not exist on jQuery.texteditor")})}})(jQuery);
metadata CHANGED
@@ -1,47 +1,39 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yellow-text-rails
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Stefan Vermaas
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-02-22 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: railties
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 3
31
- - 1
32
- version: "3.1"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
33
22
  type: :runtime
34
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
35
30
  description:
36
- email:
31
+ email:
37
32
  - stefan@yellowduckwebdesign.nl
38
33
  executables: []
39
-
40
34
  extensions: []
41
-
42
35
  extra_rdoc_files: []
43
-
44
- files:
36
+ files:
45
37
  - lib/yellow-text-rails/version.rb
46
38
  - lib/yellow-text-rails.rb
47
39
  - vendor/assets/images/icon-s634930a1a1.png
@@ -49,36 +41,27 @@ files:
49
41
  - vendor/assets/stylesheets/yellow-text.css.scss
50
42
  homepage: http://www.stefanvermaas.nl/yellow-text/
51
43
  licenses: []
52
-
53
44
  post_install_message:
54
45
  rdoc_options: []
55
-
56
- require_paths:
46
+ require_paths:
57
47
  - lib
58
- required_ruby_version: !ruby/object:Gem::Requirement
48
+ required_ruby_version: !ruby/object:Gem::Requirement
59
49
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- hash: 3
64
- segments:
65
- - 0
66
- version: "0"
67
- required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
55
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
76
60
  requirements: []
77
-
78
61
  rubyforge_project: yellow-text-rails
79
- rubygems_version: 1.8.24
62
+ rubygems_version: 1.8.25
80
63
  signing_key:
81
64
  specification_version: 3
82
- summary: Yellow Text makes text editing fun again with a beautiful interface and a few very clean options
65
+ summary: Yellow Text makes text editing fun again with a beautiful interface and a
66
+ few very clean options
83
67
  test_files: []
84
-