rails_admin_ui_layout_taris 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83fcb39d2de552e7a06cad248c2160159041d4a3655ef987424ec2719692b717
4
- data.tar.gz: e67248ef5340c4d4b6e895b7c8cccbb54909b88d443332167b3c08c7bb8aaab6
3
+ metadata.gz: de2887598d1b5e9dfcdc9d2441f353ab6578fd73ca5cc00c7b524c85e932ff3e
4
+ data.tar.gz: 9b3852ba18107b015d2ff47a660027154c1e27bc73dfcfdaa72d3f3e7d11623d
5
5
  SHA512:
6
- metadata.gz: ad9f2778ef67837836093a2e83961b8dd0992bbb2aeae0cebbc97869c6fb211e4340e7d166d3b266d469267dec0276f68a34ce93379a641b591ff8028c1f3b04
7
- data.tar.gz: 4aefdd870f32924239298d6fe943c6db9fade4e3bdfc402cf3f2272c4d3198ba04a9d418ba619119c4898948708d131af0f8e07d039e86c308ad1103965096ff
6
+ metadata.gz: 8e16aa4a02bde54f9b39e99f6a90a59542bcd500b6be0451ddebdc852fe439ed77862982809ac414d109f72a61861dc3b01a457e4762c6b8a09b32a702202d6e
7
+ data.tar.gz: f754360eb5fe713420d9ab48b441d6dcf8b2a44b626470bd40e2f30e2b3d9418dd7f88569658ad5511b9d6c54761d0a67e8faaefd0b53801712153ee4113b3ca
@@ -33,7 +33,7 @@ CKEDITOR.editorConfig = function( config )
33
33
 
34
34
  config.allowedContent = true;
35
35
 
36
- config.extraPlugins = 'videoembed,';
36
+ config.extraPlugins = 'videodetector';
37
37
  <%# config.youtube_responsive = true; %>
38
38
 
39
39
  // Toolbar groups configuration.
@@ -43,7 +43,7 @@ CKEDITOR.editorConfig = function( config )
43
43
  // { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
44
44
  // { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
45
45
  { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
46
- { name: 'insert', items: [ 'Image', 'videoembed', 'Table', 'HorizontalRule', 'SpecialChar' ] },
46
+ { name: 'insert', items: [ 'Image', 'VideoDetector', 'Table', 'HorizontalRule', 'SpecialChar' ] },
47
47
  { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
48
48
  '/',
49
49
  { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 dimitriconejo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ # Videodetector for CK Editor
2
+ This plugin allows you to insert videos from Youtube, Vimeo or Dailymotion only pasting an URL or embed code. The inserted videos will catch the full CKEditor width and will be fully responsive.
3
+
4
+ Developed by [Dimitri Conejo](https://www.dimitriconejo.com).
5
+
6
+ ### MIT Licence
@@ -0,0 +1,137 @@
1
+ /*
2
+ *
3
+ * Plugin developed by Dimitri Conejo
4
+ * www.dimitriconejo.com
5
+ *
6
+ */
7
+
8
+ CKEDITOR.dialog.add( 'videoDialog', function( editor ) {
9
+ return {
10
+ title: 'Insert a Youtube, Vimeo, Dailymotion URL or embed code',
11
+ minWidth: 400,
12
+ minHeight: 100,
13
+ contents: [
14
+ {
15
+ id: 'tab-basic',
16
+ label: 'Basic Settings',
17
+ elements: [
18
+ {
19
+ type: 'text',
20
+ id: 'url_video',
21
+ label: 'Youtube, Vimeo, Dailymotion URL or embed code',
22
+ validate: CKEDITOR.dialog.validate.notEmpty( "Empty!" )
23
+ }
24
+ ]
25
+ }
26
+ ],
27
+
28
+ onOk: function(){
29
+ var dialog = this;
30
+
31
+
32
+ //detectamos el video
33
+ var respuesta = detectar(dialog);
34
+ var url = "";
35
+
36
+ if(respuesta.reproductor == "youtube"){
37
+ var url = "https://www.youtube.com/embed/"+respuesta.id_video+"?autohide=1&controls=1&showinfo=0";
38
+ }
39
+ else if(respuesta.reproductor == "vimeo"){
40
+ var url = "https://player.vimeo.com/video/"+respuesta.id_video+"?portrait=0";
41
+ }
42
+ else if(respuesta.reproductor == "dailymotion"){
43
+ var url = "https://www.dailymotion.com/embed/video/"+respuesta.id_video;
44
+ }
45
+
46
+ var p = new CKEDITOR.dom.element('div');
47
+ p.setAttribute('class', 'videodetector');
48
+
49
+ var iframe = new CKEDITOR.dom.element('iframe');
50
+ iframe.setAttribute('src', url);
51
+ iframe.setAttribute('frameborder', '0');
52
+ p.append(iframe);
53
+
54
+ // var edit_btn = new CKEDITOR.dom.element('input');
55
+ // edit_btn.setAttribute('type', 'button');
56
+ // edit_btn.setAttribute('value', 'Edit video');
57
+ // edit_btn.setAttribute('class', 'edit-videodetector');
58
+ // p.append(edit_btn);
59
+
60
+ var remove_btn = new CKEDITOR.dom.element('input');
61
+ remove_btn.setAttribute('type', 'button');
62
+ remove_btn.setAttribute('value', 'Remove video');
63
+ remove_btn.setAttribute('class', 'remove-videodetector');
64
+ p.append(remove_btn);
65
+
66
+ editor.insertElement(p);
67
+
68
+ // edit_btn.on('click', function(){
69
+ // new CKEDITOR.dialog(editor, 'videoDialog');
70
+ // });
71
+
72
+ remove_btn.on('click', function(){
73
+ var to_remove = remove_btn.getParent();
74
+ to_remove.remove();
75
+ });
76
+ }
77
+ };
78
+ });
79
+
80
+
81
+ //funcion para detectar el id y la plataforma (youtube, vimeo o dailymotion) de los videos
82
+ function detectar(dialog){
83
+ var getDialog = dialog.parts.dialog;
84
+ var url = getDialog.find('input').getItem(0).getValue();
85
+ var id = '';
86
+ var reproductor = '';
87
+ var url_comprobar = '';
88
+
89
+ if(url.indexOf('youtu.be') >= 0){
90
+ reproductor = 'youtube';
91
+ id = url.substring(url.lastIndexOf("/")+1, url.length);
92
+ }
93
+ if(url.indexOf("youtube") >= 0){
94
+ reproductor = 'youtube'
95
+ if(url.indexOf("</iframe>") >= 0){
96
+ var fin = url.substring(url.indexOf("embed/")+6, url.length)
97
+ id = fin.substring(fin.indexOf('"'), 0);
98
+ }else{
99
+ if(url.indexOf("&") >= 0)
100
+ id = url.substring(url.indexOf("?v=")+3, url.indexOf("&"));
101
+ else
102
+ id = url.substring(url.indexOf("?v=")+3, url.length);
103
+ }
104
+ url_comprobar = "https://gdata.youtube.com/feeds/api/videos/" + id + "?v=2&alt=json";
105
+ //"https://gdata.youtube.com/feeds/api/videos/" + id + "?v=2&alt=json"
106
+ }
107
+ if(url.indexOf("vimeo") >= 0){
108
+ reproductor = 'vimeo'
109
+ if(url.indexOf("</iframe>") >= 0){
110
+ var fin = url.substring(url.lastIndexOf('vimeo.com/"')+6, url.indexOf('>'))
111
+ id = fin.substring(fin.lastIndexOf('/')+1, fin.indexOf('"',fin.lastIndexOf('/')+1))
112
+ }else{
113
+ id = url.substring(url.lastIndexOf("/")+1, url.length)
114
+ }
115
+ url_comprobar = 'http://vimeo.com/api/v2/video/' + id + '.json';
116
+ //'http://vimeo.com/api/v2/video/' + video_id + '.json';
117
+ }
118
+ if(url.indexOf('dai.ly') >= 0){
119
+ reproductor = 'dailymotion';
120
+ id = url.substring(url.lastIndexOf("/")+1, url.length);
121
+ }
122
+ if(url.indexOf("dailymotion") >= 0){
123
+ reproductor = 'dailymotion';
124
+ if(url.indexOf("</iframe>") >= 0){
125
+ var fin = url.substring(url.indexOf('dailymotion.com/')+16, url.indexOf('></iframe>'))
126
+ id = fin.substring(fin.lastIndexOf('/')+1, fin.lastIndexOf('"'))
127
+ }else{
128
+ if(url.indexOf('_') >= 0)
129
+ id = url.substring(url.lastIndexOf('/')+1, url.indexOf('_'))
130
+ else
131
+ id = url.substring(url.lastIndexOf('/')+1, url.length);
132
+ }
133
+ url_comprobar = 'https://api.dailymotion.com/video/' + id;
134
+ // https://api.dailymotion.com/video/x26ezrb
135
+ }
136
+ return {'reproductor':reproductor,'id_video':id};
137
+ }
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
5
+ <g>
6
+ <g id="_x33_56._Play">
7
+ <g>
8
+ <path fill="#FFFFFF" d="M15,4C12.8,0.2,7.9-1.1,4,1.1C0.2,3.3-1.1,8.2,1.1,12C3.3,15.9,8.2,17.2,12,15C15.9,12.8,17.2,7.9,15,4z
9
+ M11.2,13.6c-3.1,1.8-7,0.7-8.7-2.3c-1.8-3.1-0.7-7,2.3-8.7c3.1-1.8,7-0.7,8.7,2.3C15.3,7.9,14.3,11.8,11.2,13.6z M10.9,7.7
10
+ L6.7,5.3C6.3,5,6,5.2,6,5.7l0,4.8c0,0.4,0.3,0.6,0.7,0.4l4.2-2.4C11.3,8.3,11.3,7.9,10.9,7.7z"/>
11
+ </g>
12
+ </g>
13
+ </g>
14
+ </svg>
@@ -0,0 +1,25 @@
1
+ /*
2
+ *
3
+ * Plugin developed by Dimitri Conejo
4
+ * www.dimitriconejo.com
5
+ *
6
+ */
7
+
8
+ CKEDITOR.plugins.add( 'videodetector', {
9
+ icons: 'videodetector',
10
+ init: function( editor ) {
11
+
12
+ var pluginDirectory = this.path;
13
+ editor.addContentsCss(pluginDirectory + 'videodetector.css');
14
+
15
+ editor.addCommand('videodetector', new CKEDITOR.dialogCommand('videoDialog'));
16
+ editor.ui.addButton( 'VideoDetector', {
17
+ label: 'Insert a Youtube, Vimeo or Dailymotion video',
18
+ command: 'videodetector',
19
+ icon: CKEDITOR.plugins.getPath('videodetector') + 'icons/icon_black.png'
20
+ });
21
+
22
+ CKEDITOR.dialog.add('videoDialog', this.path + 'dialogs/videoDialog.js');
23
+
24
+ }
25
+ });
@@ -0,0 +1,48 @@
1
+ .videodetector {
2
+ position : relative;
3
+ width : 100%;
4
+ height : 0;
5
+ padding-bottom: 60%;
6
+ }
7
+
8
+ .videodetector iframe {
9
+ position: absolute;
10
+ top : 0;
11
+ left : 0;
12
+ width : 100%;
13
+ height : 100%;
14
+ }
15
+
16
+ .remove-videodetector{
17
+ position: absolute;
18
+ top: 15px;
19
+ left: 15px;
20
+ z-index: 999;
21
+ cursor: pointer!important;
22
+ display: none;
23
+ outline: none;
24
+ padding: 10px 20px;
25
+ appearance: none;
26
+ -webkit-appearance: none;
27
+ box-shadow: 0px 2px 6px rgba(0,0,0,0.2);
28
+ border-radius: 3px;
29
+ border: none;
30
+ background-color: #e74c3c;
31
+ color: #fff;
32
+ font-weight: bold;
33
+ font-size: 12px;
34
+ text-transform: uppercase;
35
+ -webkit-transition: 0.2s;
36
+ -moz-transition: 0.2s;
37
+ -ms-transition: 0.2s;
38
+ -o-transition: 0.2s;
39
+ transition: 0.2s;
40
+ }
41
+
42
+ .remove-videodetector:hover{
43
+ background-color: #c0392b;
44
+ }
45
+
46
+ .videodetector:hover .remove-videodetector{
47
+ display: block;
48
+ }
@@ -1,3 +1,3 @@
1
1
  module RailsAdminUiLayoutTaris
2
- VERSION = '1.3.7'.freeze
2
+ VERSION = '1.3.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_ui_layout_taris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
@@ -77,6 +77,14 @@ files:
77
77
  - README.md
78
78
  - Rakefile
79
79
  - app/assets/javascripts/ckeditor/config.js.erb
80
+ - app/assets/javascripts/ckeditor/plugins/videodetector/LICENSE
81
+ - app/assets/javascripts/ckeditor/plugins/videodetector/README.md
82
+ - app/assets/javascripts/ckeditor/plugins/videodetector/dialogs/videoDialog.js
83
+ - app/assets/javascripts/ckeditor/plugins/videodetector/icons/icon_black.png
84
+ - app/assets/javascripts/ckeditor/plugins/videodetector/icons/icon_white.png
85
+ - app/assets/javascripts/ckeditor/plugins/videodetector/icons/videodetector.svg
86
+ - app/assets/javascripts/ckeditor/plugins/videodetector/plugin.js
87
+ - app/assets/javascripts/ckeditor/plugins/videodetector/videodetector.css
80
88
  - app/assets/javascripts/ckeditor/plugins/videoembed/dialogs/videoembedDialog.js
81
89
  - app/assets/javascripts/ckeditor/plugins/videoembed/icons/videoembed.png
82
90
  - app/assets/javascripts/ckeditor/plugins/videoembed/lang/en.js