frontendeditor_ckeditor 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e10951bfd460ff2d9a949227d3505c3fce7d0519
4
+ data.tar.gz: 1fef343f523a243b3c8c173f3114067eaee5239c
5
+ SHA512:
6
+ metadata.gz: 114bc9f1353f53a7f52bf6b469949d621d4f609ed08d37cb1086b331adfaf770ede1673abe34f4a70de09cd08dda198e3644a801778ccbedc0b67ef5d9a48d20
7
+ data.tar.gz: e3e590f3ce95d91faa52aee8f32012f97acb257dd6cd05af6c1714200fb21b758dfb1742e36d995cbdd3ed3b892386f5b6b1031fec6fa6a7e1bbd1e572962e80
@@ -1,3 +1,3 @@
1
1
  module FrontendeditorCkeditor
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -1,14 +1,13 @@
1
1
  window.Editor = CKEDITOR
2
2
 
3
3
  Editor.active = ->
4
- target = $('.editable-long-text')
5
- target.attr('contenteditable',true)
6
- target.effect('highlight', duration: 5000)
7
- for div in target
8
- CKEDITOR.inline(div, extraPlugins: 'sourcedialog')
4
+ @el().attr('contenteditable',true)
5
+ @el().effect('highlight', duration: 5000)
6
+ for div in @el()
7
+ CKEDITOR.inline(div)
9
8
 
10
9
  Editor.deactive = ->
11
- $('.editable-long-text').attr('contenteditable', false)
10
+ @el().attr('contenteditable', false)
12
11
  $.each(CKEDITOR.instances, (key, editor) ->
13
12
  editor.destroy()
14
13
  )
@@ -20,3 +19,21 @@ Editor.commitAll = ->
20
19
  model.id = dataset.id
21
20
  model.set(dataset.attribute, editor.getData())
22
21
  )
22
+
23
+ Editor.el = ->
24
+ $('.editable-long-text')
25
+
26
+ Editor.on('instanceCreated', ( event ) ->
27
+ editor = event.editor
28
+ element = editor.element
29
+ editor.on('configLoaded', () ->
30
+ editor.config.toolbarGroups = [
31
+ { name: 'editing', groups: [ 'basicstyles', 'links' ] }
32
+ { name: 'styles' }
33
+ '/'
34
+ { name: 'undo' }
35
+ { name: 'clipboard', groups: [ 'selection', 'clipboard' ] }
36
+ { name: 'insert' }
37
+ ]
38
+ )
39
+ )
metadata CHANGED
@@ -1,48 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frontendeditor_ckeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - gcorbel
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-14 00:00:00.000000000 Z
11
+ date: 2014-05-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: frontendeditor
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: ckeditor
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
37
- version: 4.0.4
33
+ version: 4.0.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
45
- version: 4.0.4
40
+ version: 4.0.0
46
41
  description: This is an editor for any rails application
47
42
  email:
48
43
  - guirec.corbel@gmail.com
@@ -50,62 +45,54 @@ executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
- - lib/frontendeditor_ckeditor/version.rb
54
- - lib/frontendeditor_ckeditor/engine.rb
48
+ - README.md
49
+ - Rakefile
55
50
  - lib/frontendeditor_ckeditor.rb
56
- - vendor/assets/stylesheets/ckeditor/skins/kama/images/dialog_sides_rtl.png
57
- - vendor/assets/stylesheets/ckeditor/skins/kama/images/toolbar_start.gif
51
+ - lib/frontendeditor_ckeditor/engine.rb
52
+ - lib/frontendeditor_ckeditor/version.rb
53
+ - vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
54
+ - vendor/assets/javascripts/ckeditor/init_ckeditor.coffee
55
+ - vendor/assets/stylesheets/ckeditor/skins/kama/dialog.css
56
+ - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_ie.css
57
+ - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_ie7.css
58
+ - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_ie8.css
59
+ - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_iequirks.css
60
+ - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_opera.css
61
+ - vendor/assets/stylesheets/ckeditor/skins/kama/editor.css
62
+ - vendor/assets/stylesheets/ckeditor/skins/kama/editor_ie.css
63
+ - vendor/assets/stylesheets/ckeditor/skins/kama/editor_ie7.css
64
+ - vendor/assets/stylesheets/ckeditor/skins/kama/editor_ie8.css
65
+ - vendor/assets/stylesheets/ckeditor/skins/kama/editor_iequirks.css
66
+ - vendor/assets/stylesheets/ckeditor/skins/kama/icons.png
67
+ - vendor/assets/stylesheets/ckeditor/skins/kama/images/dialog_sides.gif
58
68
  - vendor/assets/stylesheets/ckeditor/skins/kama/images/dialog_sides.png
69
+ - vendor/assets/stylesheets/ckeditor/skins/kama/images/dialog_sides_rtl.png
59
70
  - vendor/assets/stylesheets/ckeditor/skins/kama/images/mini.gif
60
71
  - vendor/assets/stylesheets/ckeditor/skins/kama/images/sprites.png
61
72
  - vendor/assets/stylesheets/ckeditor/skins/kama/images/sprites_ie6.png
62
- - vendor/assets/stylesheets/ckeditor/skins/kama/images/dialog_sides.gif
63
- - vendor/assets/stylesheets/ckeditor/skins/kama/dialog.css
64
- - vendor/assets/stylesheets/ckeditor/skins/kama/editor.css
65
- - vendor/assets/stylesheets/ckeditor/skins/kama/editor_iequirks.css
66
- - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_iequirks.css
73
+ - vendor/assets/stylesheets/ckeditor/skins/kama/images/toolbar_start.gif
67
74
  - vendor/assets/stylesheets/ckeditor/skins/kama/readme.md
68
- - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_ie.css
69
- - vendor/assets/stylesheets/ckeditor/skins/kama/editor_ie8.css
70
- - vendor/assets/stylesheets/ckeditor/skins/kama/icons.png
71
- - vendor/assets/stylesheets/ckeditor/skins/kama/editor_ie.css
72
- - vendor/assets/stylesheets/ckeditor/skins/kama/editor_ie7.css
73
- - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_ie8.css
74
- - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_opera.css
75
- - vendor/assets/stylesheets/ckeditor/skins/kama/dialog_ie7.css
76
- - vendor/assets/javascripts/ckeditor/ckeditor_actions.coffee
77
- - vendor/assets/javascripts/ckeditor/plugins/sourcedialog/samples/sourcedialog.html
78
- - vendor/assets/javascripts/ckeditor/plugins/sourcedialog/icons/sourcedialog.png
79
- - vendor/assets/javascripts/ckeditor/plugins/sourcedialog/icons/sourcedialog-rtl.png
80
- - vendor/assets/javascripts/ckeditor/plugins/sourcedialog/lang/en.js
81
- - vendor/assets/javascripts/ckeditor/plugins/sourcedialog/plugin.js
82
- - vendor/assets/javascripts/ckeditor/plugins/sourcedialog/dialogs/sourcedialog.js
83
- - vendor/assets/javascripts/ckeditor/init_ckeditor.coffee
84
- - Rakefile
85
- - README.md
86
75
  homepage: https://github.com/GCorbel/frontendeditor_ckeditor
87
76
  licenses: []
77
+ metadata: {}
88
78
  post_install_message:
89
79
  rdoc_options: []
90
80
  require_paths:
91
81
  - lib
92
82
  required_ruby_version: !ruby/object:Gem::Requirement
93
- none: false
94
83
  requirements:
95
- - - ! '>='
84
+ - - ">="
96
85
  - !ruby/object:Gem::Version
97
86
  version: '0'
98
87
  required_rubygems_version: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
- - - ! '>='
89
+ - - ">="
102
90
  - !ruby/object:Gem::Version
103
91
  version: '0'
104
92
  requirements: []
105
93
  rubyforge_project:
106
- rubygems_version: 1.8.23
94
+ rubygems_version: 2.2.2
107
95
  signing_key:
108
- specification_version: 3
96
+ specification_version: 4
109
97
  summary: This editor is integrable to any rails application
110
98
  test_files: []
111
- has_rdoc:
@@ -1,78 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.html or http://ckeditor.com/license
4
- */
5
-
6
- CKEDITOR.dialog.add( 'sourcedialog', function( editor ) {
7
- var size = CKEDITOR.document.getWindow().getViewPaneSize();
8
-
9
- // Make it maximum 800px wide, but still fully visible in the viewport.
10
- var width = Math.min( size.width - 70, 800);
11
-
12
- // Make it use 2/3 of the viewport height.
13
- var height = size.height / 1.5;
14
-
15
- // Store old editor data to avoid unnecessary setData.
16
- var oldData;
17
-
18
- return {
19
- title: editor.lang.sourcedialog.title,
20
- minWidth: 100,
21
- minHeight: 100,
22
-
23
- onShow: function() {
24
- this.setValueOf( 'main', 'data', oldData = editor.getData() );
25
- },
26
-
27
- onOk: (function() {
28
- function setData( newData ) {
29
- var that = this;
30
-
31
- editor.setData( newData, function() {
32
- that.hide();
33
-
34
- // Ensure correct selection.
35
- var range = editor.createRange();
36
- range.moveToElementEditStart( editor.editable() );
37
- range.select();
38
- } );
39
- }
40
-
41
- return function( event ) {
42
- // Remove CR from input data for reliable comparison with editor data.
43
- var newData = this.getValueOf( 'main', 'data' ).replace( /\r/g, '' );
44
-
45
- // Avoid unnecessary setData. Also preserve selection
46
- // when user changed his mind and goes back to wysiwyg editing.
47
- if ( newData === oldData )
48
- return true;
49
-
50
- // Set data asynchronously to avoid errors in IE.
51
- CKEDITOR.env.ie ?
52
- CKEDITOR.tools.setTimeout( setData, 0, this, newData )
53
- :
54
- setData.call( this, newData );
55
-
56
- // Don't let the dialog close before setData is over.
57
- return false;
58
- };
59
- })(),
60
-
61
- contents: [{
62
- id: 'main',
63
- label: editor.lang.sourcedialog.title,
64
- elements: [{
65
- type: 'textarea',
66
- type: 'textarea',
67
- id: 'data',
68
- dir: 'ltr',
69
- inputStyle: 'cursor:auto;' +
70
- 'width:' + width + 'px;' +
71
- 'height:' + height + 'px;' +
72
- 'tab-size:4;' +
73
- 'text-align:left;',
74
- 'class': 'cke_source'
75
- }]
76
- }]
77
- };
78
- });
@@ -1,9 +0,0 @@
1
- /*
2
- Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
- For licensing, see LICENSE.html or http://ckeditor.com/license
4
- */
5
-
6
- CKEDITOR.plugins.setLang( 'sourcedialog', 'en', {
7
- toolbar: 'Source',
8
- title: 'Source'
9
- });
@@ -1,26 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.html or http://ckeditor.com/license
4
- */
5
-
6
- CKEDITOR.plugins.add( 'sourcedialog', {
7
- lang: 'en', // %REMOVE_LINE_CORE%
8
- icons: 'sourcedialog,sourcedialog-rtl', // %REMOVE_LINE_CORE%
9
-
10
- init: function( editor ) {
11
- // Register the "source" command, which simply opens the "source" dialog.
12
- editor.addCommand( 'sourcedialog', new CKEDITOR.dialogCommand( 'sourcedialog' ) );
13
-
14
- // Register the "source" dialog.
15
- CKEDITOR.dialog.add( 'sourcedialog', this.path + 'dialogs/sourcedialog.js' );
16
-
17
- // If the toolbar is available, create the "Source" button.
18
- if ( editor.ui.addButton ) {
19
- editor.ui.addButton( 'Sourcedialog', {
20
- label: editor.lang.sourcedialog.toolbar,
21
- command: 'sourcedialog',
22
- toolbar: 'mode,10'
23
- });
24
- }
25
- }
26
- });
@@ -1,118 +0,0 @@
1
- <!DOCTYPE html>
2
- <!--
3
- Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
4
- For licensing, see LICENSE.html or http://ckeditor.com/license
5
- -->
6
- <html>
7
- <head>
8
- <title>Raw HTML editing with dialog-based source editor &mdash; CKEditor Sample</title>
9
- <meta charset="utf-8">
10
- <script src="../../../ckeditor.js"></script>
11
- <link rel="stylesheet" href="../../../samples/sample.css">
12
- <meta name="ckeditor-sample-name" content="Raw HTML editing with dialog-based source editor">
13
- <meta name="ckeditor-sample-group" content="Plugins">
14
- <meta name="ckeditor-sample-description" content="Editing HTML content of both inline and framed editor instances.">
15
- <meta name="ckeditor-sample-isnew" content="1">
16
- <style>
17
-
18
- #editable
19
- {
20
- padding: 10px;
21
- float: left;
22
- }
23
-
24
- </style>
25
- </head>
26
- <body>
27
- <h1 class="samples">
28
- <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Raw HTML editing with dialog-based source editor
29
- </h1>
30
- <div class="description">
31
- <p>
32
- <strong>Sourcedialog</strong> plugin provides an easy way to edit raw HTML content
33
- of an editor, similarly to what is possible with <strong>Sourcearea</strong>
34
- plugin for framed instances but using dialogs. Thanks to that, it's also possible
35
- to manipulate raw content of inline editor instances.
36
- </p>
37
- <p>
38
- This plugin extends the toolbar with a button,
39
- which opens a dialog window with a source code editor. It works with both framed
40
- and inline instances. To enable this
41
- plugin, basically add <code>extraPlugins: 'sourcedialog'</code> to editor's
42
- config:
43
- </p>
44
- <pre class="samples">
45
- // Inline editor.
46
- CKEDITOR.inline( 'editable', {
47
- <strong>extraPlugins: 'sourcedialog'</strong>
48
- });
49
-
50
- // Framed editor.
51
- CKEDITOR.replace( 'textarea_id', {
52
- <strong>extraPlugins: 'sourcedialog'</strong>,
53
- removePlugins: 'sourcearea'
54
- });
55
- </pre>
56
- <p>
57
- Note that you may want to include <code>removePlugins: 'sourcearea'</code>
58
- in your config when using <strong>Sourcedialog</strong> in framed instances.
59
- This prevents feature redundancy.
60
- </p>
61
- <p>
62
- Note that <code>editable</code> in the code above is the <code>id</code>
63
- attribute of the <code>&lt;div&gt;</code> element to be converted into an inline instance.
64
- </p>
65
- <p>
66
- Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
67
- the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor.
68
- </p>
69
- </div>
70
- <div>
71
- <label for="editor1">
72
- Inline editor:
73
- </label>
74
- <div id="editor1" contenteditable="true" style="padding: 5px 20px;">
75
- <p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
76
- </div>
77
- </div>
78
- <br>
79
- <div>
80
- <label for="editor2">
81
- Framed editor:
82
- </label>
83
- <textarea cols="80" id="editor2" name="editor2" rows="10">
84
- This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.
85
- </textarea>
86
- </div>
87
- <script>
88
-
89
- // We need to turn off the automatic editor creation first.
90
- CKEDITOR.disableAutoInline = true;
91
-
92
- var config = {
93
- toolbarGroups: [
94
- { name: 'mode' },
95
- { name: 'basicstyles' },
96
- { name: 'links' }
97
- ],
98
- extraPlugins: 'sourcedialog',
99
- removePlugins: 'sourcearea'
100
- }
101
-
102
- CKEDITOR.inline( 'editor1', config );
103
- CKEDITOR.replace( 'editor2', config );
104
-
105
- </script>
106
- <div id="footer">
107
- <hr>
108
- <p>
109
- CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
110
- http://ckeditor.com</a>
111
- </p>
112
- <p id="copy">
113
- Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a>
114
- - Frederico Knabben. All rights reserved.
115
- </p>
116
- </div>
117
- </body>
118
- </html>