rails_admin_ui_layout_taris 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d20fce3c845b88d15a5793917f1fa127c2596687
4
- data.tar.gz: 1cb7a6638af8709fb786de9eb19eefd685a77baa
2
+ SHA256:
3
+ metadata.gz: 8908fe31e8c3db61a38e1721dfe59115a22c1cddbb1669024f8c5da48961477c
4
+ data.tar.gz: 0b9223da504221f8007383b284b123fc65fa119192e7daa9fa6f449f3df2e2c0
5
5
  SHA512:
6
- metadata.gz: df637622e8fa0f11a474a4d317392571f82394a661a6bcb3c5f0ea27e25ac67ee04f6fe085b28e456ae3df9ffab1941e79381a383ffecb937ca0c725bcada468
7
- data.tar.gz: '08620e2451ec516e1a2521ed3b534ce1885becfc4dc8a4dec6188fffdf7c1db4a810d3ed22ebaec77f30c7263e004b72d64ce11cde7adff9cf3f64c1f06a3c40'
6
+ metadata.gz: a711a59e122cf0aaa19d57d0e65c94dc7a46f1fb858e5d2b13445cd383e49cbdf9b15aba967b176b9147ae88de616846bcd7d74188883e7113384be39eda9003
7
+ data.tar.gz: 528f4819d286c5338203e716c8f94d3d20dfc85bd459a054067d2edc4c4b64061e0636c94282d6fe3769ba618b9f12ab327e3a619edae1a4e3173389750d8d04
@@ -33,6 +33,9 @@ CKEDITOR.editorConfig = function( config )
33
33
 
34
34
  config.allowedContent = true;
35
35
 
36
+ config.extraPlugins = 'videoembed';
37
+ <%# config.youtube_responsive = true; %>
38
+
36
39
  // Toolbar groups configuration.
37
40
  config.toolbar = [
38
41
  { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source'] },
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Plugin developed by CTRL+N.
3
+ *
4
+ * LICENCE: GPL, LGPL, MPL
5
+ * NON-COMMERCIAL PLUGIN.
6
+ *
7
+ * Website: https://www.ctrplusn.net/
8
+ * Facebook: https://www.facebook.com/ctrlplusn.net/
9
+ *
10
+ */
11
+ CKEDITOR.dialog.add('videoembedDialog', function (editor) {
12
+ return {
13
+ title: editor.lang.videoembed.title,
14
+ minWidth: 400,
15
+ minHeight: 80,
16
+ contents: [
17
+ {
18
+ id: 'tab-basic',
19
+ label: 'Basic Settings',
20
+ elements: [
21
+ {
22
+ type: 'html',
23
+ html: '<p>' + editor.lang.videoembed.onlytxt + '</p>'
24
+ },
25
+ {
26
+ type: 'text',
27
+ id: 'url_video',
28
+ label: 'URL (ex: https://www.youtube.com/watch?v=EOIvnRUa3ik)',
29
+ validate: CKEDITOR.dialog.validate.notEmpty(editor.lang.videoembed.validatetxt)
30
+ },
31
+ {
32
+ type: 'text',
33
+ id: 'css_class',
34
+ label: editor.lang.videoembed.input_css
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ onOk: function () {
40
+ var
41
+ dialog = this,
42
+ div_container = new CKEDITOR.dom.element('div'),
43
+ css = 'videoEmbed';
44
+ // Set custom css class name
45
+ if (dialog.getValueOf('tab-basic', 'css_class').length > 0) {
46
+ css = dialog.getValueOf('tab-basic', 'css_class');
47
+ }
48
+ div_container.setAttribute('class', css);
49
+
50
+ // Auto-detect if youtube, vimeo or dailymotion url
51
+ var url = detect(dialog.getValueOf('tab-basic', 'url_video'));
52
+ // Create iframe with specific url
53
+ if (url.length > 1) {
54
+ var iframe = new CKEDITOR.dom.element.createFromHtml('<iframe frameborder="0" width="560" height="349" src="' + url + '" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>');
55
+ div_container.append(iframe);
56
+ editor.insertElement(div_container);
57
+ }
58
+ }
59
+ };
60
+ });
61
+
62
+ // Detect platform and return video ID
63
+ function detect(url) {
64
+ var embed_url = '';
65
+ // full youtube url
66
+ if (url.indexOf('youtube') > 0) {
67
+ id = getId(url, "?v=", 3);
68
+ if (id.indexOf('&list=') > 0) {
69
+ lastId = getId(id, "&list=", 6);
70
+ return embed_url = 'https://www.youtube.com/embed/' + id + '?list=' + lastId;
71
+ }
72
+ return embed_url = 'https://www.youtube.com/embed/' + id;
73
+ }
74
+ // tiny youtube url
75
+ if (url.indexOf('youtu.be') > 0) {
76
+ id = getId(url);
77
+ // if this is a playlist
78
+ if (id.indexOf('&list=') > 0) {
79
+ lastId = getId(id, "&list=", 6);
80
+ return embed_url = 'https://www.youtube.com/embed/' + id + '?list=' + lastId;
81
+ }
82
+ return embed_url = 'https://www.youtube.com/embed/' + id;
83
+ }
84
+ // full vimeo url
85
+ if (url.indexOf('vimeo') > 0) {
86
+ id = getId(url);
87
+ return embed_url = 'https://player.vimeo.com/video/' + id + '?badge=0';
88
+ }
89
+ // full dailymotion url
90
+ if (url.indexOf('dailymotion') > 0) {
91
+ // if this is a playlist (jukebox)
92
+ if (url.indexOf('/playlist/') > 0) {
93
+ id = url.substring(url.lastIndexOf('/playlist/') + 10, url.indexOf("/1#video="));
94
+ console.log(id);
95
+ return embed_url = 'https://www.dailymotion.com/widget/jukebox?list[]=%2Fplaylist%2F' + id + '%2F1&&autoplay=0&mute=0';
96
+ } else {
97
+ id = getId(url);
98
+ }
99
+ return embed_url = 'https://www.dailymotion.com/embed/video/' + id;
100
+ }
101
+ // tiny dailymotion url
102
+ if (url.indexOf('dai.ly') > 0) {
103
+ id = getId(url);
104
+ return embed_url = 'https://www.dailymotion.com/embed/video/' + id;
105
+ }
106
+ return embed_url;
107
+ }
108
+
109
+ // Return video ID from URL
110
+ function getId(url, string = "/", index = 1) {
111
+ return url.substring(url.lastIndexOf(string) + index, url.length);
112
+ }
@@ -0,0 +1,8 @@
1
+ CKEDITOR.plugins.setLang('videoembed', 'en', {
2
+ title: 'Insert video',
3
+ button: 'Video Embedded',
4
+ onlytxt: 'Youtube, Vimeo & Dailymotion URLs only',
5
+ validatetxt: 'URL field should not be empty!',
6
+ input_css: 'Custom CSS class name :'
7
+ });
8
+
@@ -0,0 +1,8 @@
1
+ CKEDITOR.plugins.setLang('videoembed', 'fr', {
2
+ title: 'Insérer une vidéo',
3
+ button: 'Vidéo intégrée',
4
+ onlytxt: 'Uniquement les URLs de Youtube, Vimeo & Dailymotion',
5
+ validatetxt: 'Le champ URL ne doit pas être vide!',
6
+ input_css: 'Classe CSS personnalisée :'
7
+ });
8
+
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Plugin developed by CTRL+N.
3
+ *
4
+ * LICENCE: GPL, LGPL, MPL
5
+ * NON-COMMERCIAL PLUGIN.
6
+ *
7
+ * Website: https://www.ctrplusn.net/
8
+ * Facebook: https://www.facebook.com/ctrlplusn.net/
9
+ *
10
+ */
11
+ CKEDITOR.plugins.add('videoembed', {
12
+ icons: 'videoembed',
13
+ lang: 'fr,en',
14
+ version: 1.1,
15
+ init: function (editor) {
16
+ // Command
17
+ editor.addCommand('videoembed', new CKEDITOR.dialogCommand('videoembedDialog'));
18
+ // Toolbar button
19
+ editor.ui.addButton('VideoEmbed', {
20
+ label: editor.lang.videoembed.button,
21
+ command: 'videoembed',
22
+ toolbar: 'insert'
23
+ });
24
+ // Dialog window
25
+ CKEDITOR.dialog.add('videoembedDialog', this.path + 'dialogs/videoembedDialog.js');
26
+ }
27
+ });
@@ -1,3 +1,3 @@
1
1
  module RailsAdminUiLayoutTaris
2
- VERSION = '1.3.3'.freeze
2
+ VERSION = '1.3.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-16 00:00:00.000000000 Z
11
+ date: 2019-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore
@@ -77,6 +77,11 @@ files:
77
77
  - README.md
78
78
  - Rakefile
79
79
  - app/assets/javascripts/ckeditor/config.js.erb
80
+ - app/assets/javascripts/ckeditor/plugins/videoembed/dialogs/videoembedDialog.js
81
+ - app/assets/javascripts/ckeditor/plugins/videoembed/icons/videoembed.png
82
+ - app/assets/javascripts/ckeditor/plugins/videoembed/lang/en.js
83
+ - app/assets/javascripts/ckeditor/plugins/videoembed/lang/fr.js
84
+ - app/assets/javascripts/ckeditor/plugins/videoembed/plugin.js
80
85
  - app/assets/javascripts/rails_admin/custom/ckeditor_ajax.js.coffee
81
86
  - app/assets/javascripts/rails_admin/custom/timer.js
82
87
  - app/assets/javascripts/rails_admin/custom/ui.js
@@ -117,8 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
122
  - !ruby/object:Gem::Version
118
123
  version: '0'
119
124
  requirements: []
120
- rubyforge_project:
121
- rubygems_version: 2.6.14
125
+ rubygems_version: 3.0.1
122
126
  signing_key:
123
127
  specification_version: 4
124
128
  summary: Layout for Rails Admin customized by Taris.