tramway 0.1.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +12 -893
  4. data/Rakefile +8 -8
  5. data/app/components/tailwind_component.html.haml +0 -0
  6. data/app/components/tailwind_component.rb +6 -0
  7. data/app/components/tailwinds/navbar/button_component.html.haml +1 -0
  8. data/app/components/tailwinds/navbar/button_component.rb +14 -0
  9. data/config/routes.rb +0 -9
  10. data/lib/tasks/tramway_tasks.rake +5 -0
  11. data/lib/tramway/engine.rb +5 -10
  12. data/lib/tramway/version.rb +1 -1
  13. data/lib/tramway.rb +5 -140
  14. metadata +17 -554
  15. data/app/assets/config/tramway_core_manifest.js +0 -2
  16. data/app/assets/images/tramway/mona_lisa_from_prado.jpg +0 -0
  17. data/app/assets/images/tramway/mona_lisa_from_prado_square.jpg +0 -0
  18. data/app/assets/javascripts/bootstrap-datepicker-1.8.0.js +0 -2035
  19. data/app/assets/javascripts/bootstrap-datepicker-1.8.0.ru.min.js +0 -64
  20. data/app/assets/javascripts/ckeditor/config.js +0 -30
  21. data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -1259
  22. data/app/assets/javascripts/ckeditor/plugins/image/icons/hidpi/image.png +0 -0
  23. data/app/assets/javascripts/ckeditor/plugins/image/icons/image.png +0 -0
  24. data/app/assets/javascripts/ckeditor/plugins/image/images/noimage.png +0 -0
  25. data/app/assets/javascripts/ckeditor/plugins/image/lang/en.js +0 -25
  26. data/app/assets/javascripts/ckeditor/plugins/image/lang/ru.js +0 -25
  27. data/app/assets/javascripts/ckeditor/plugins/image/plugin.js +0 -184
  28. data/app/assets/javascripts/ckeditor/plugins/youtube/images/icon-hdpi.png +0 -0
  29. data/app/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
  30. data/app/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +0 -25
  31. data/app/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +0 -25
  32. data/app/assets/javascripts/ckeditor/plugins/youtube/plugin.js +0 -449
  33. data/app/assets/javascripts/tramway/application.js +0 -60
  34. data/app/assets/stylesheets/tramway/application.sass +0 -60
  35. data/app/assets/stylesheets/tramway/bootstrap-datepicker-1.8.0.css +0 -477
  36. data/app/controllers/concerns/auth_management.rb +0 -26
  37. data/app/controllers/concerns/filtering.rb +0 -43
  38. data/app/controllers/tramway/application_controller.rb +0 -142
  39. data/app/controllers/tramway/export/application_controller.rb +0 -5
  40. data/app/controllers/tramway/has_and_belongs_to_many_records_controller.rb +0 -26
  41. data/app/controllers/tramway/records_controller.rb +0 -86
  42. data/app/controllers/tramway/sessions_controller.rb +0 -49
  43. data/app/controllers/tramway/singletons_controller.rb +0 -48
  44. data/app/controllers/tramway/welcome_controller.rb +0 -17
  45. data/app/decorators/tramway/application_decorated_collection.rb +0 -15
  46. data/app/decorators/tramway/application_decorator.rb +0 -124
  47. data/app/decorators/tramway/associations/class_helper.rb +0 -45
  48. data/app/decorators/tramway/associations/object_helper.rb +0 -58
  49. data/app/decorators/tramway/attributes/view_helper.rb +0 -30
  50. data/app/decorators/tramway/concerns/attributes_decorator_helper.rb +0 -97
  51. data/app/decorators/tramway/concerns/table_builder.rb +0 -33
  52. data/app/decorators/tramway/default/values_helper.rb +0 -23
  53. data/app/decorators/tramway/delegating/class_helper.rb +0 -9
  54. data/app/decorators/tramway/user_decorator.rb +0 -49
  55. data/app/forms/admin/tramway/user_form.rb +0 -24
  56. data/app/forms/tramway/application_form.rb +0 -124
  57. data/app/forms/tramway/application_forms/association_class_helpers.rb +0 -7
  58. data/app/forms/tramway/application_forms/association_object_helpers.rb +0 -36
  59. data/app/forms/tramway/application_forms/constant_class_actions.rb +0 -7
  60. data/app/forms/tramway/application_forms/constant_object_actions.rb +0 -20
  61. data/app/forms/tramway/application_forms/frontend.rb +0 -12
  62. data/app/forms/tramway/application_forms/object_helpers.rb +0 -15
  63. data/app/forms/tramway/application_forms/properties_object_helper.rb +0 -16
  64. data/app/forms/tramway/application_forms/submit_helper.rb +0 -26
  65. data/app/forms/tramway/extendable_form.rb +0 -15
  66. data/app/forms/tramway/extendable_forms_helpers/class_builder.rb +0 -34
  67. data/app/forms/tramway/extendable_forms_helpers/ignored_properties_helper.rb +0 -11
  68. data/app/forms/tramway/extendable_forms_helpers/more_properties_helper.rb +0 -31
  69. data/app/forms/tramway/extendable_forms_helpers/properties_helper.rb +0 -16
  70. data/app/forms/tramway/extendable_forms_helpers/submit/class_helpers.rb +0 -18
  71. data/app/forms/tramway/extendable_forms_helpers/submit/object_helpers.rb +0 -21
  72. data/app/forms/tramway/extendable_forms_helpers/validators.rb +0 -40
  73. data/app/forms/tramway/extended_application_form.rb +0 -23
  74. data/app/forms/tramway/form_creator.rb +0 -7
  75. data/app/forms/tramway/session_form.rb +0 -26
  76. data/app/helpers/tramway/actions_helper.rb +0 -45
  77. data/app/helpers/tramway/additional_buttons_builder.rb +0 -12
  78. data/app/helpers/tramway/application_helper.rb +0 -27
  79. data/app/helpers/tramway/cases_helper.rb +0 -13
  80. data/app/helpers/tramway/copy_to_clipboard_helper.rb +0 -11
  81. data/app/helpers/tramway/focus_generator_helper.rb +0 -10
  82. data/app/helpers/tramway/frontend_helper.rb +0 -26
  83. data/app/helpers/tramway/inputs/associations_helper.rb +0 -30
  84. data/app/helpers/tramway/inputs/polymorphic_associations_helper.rb +0 -24
  85. data/app/helpers/tramway/inputs_helper.rb +0 -96
  86. data/app/helpers/tramway/model_helper.rb +0 -7
  87. data/app/helpers/tramway/navbar_helper.rb +0 -11
  88. data/app/helpers/tramway/records_helper.rb +0 -120
  89. data/app/helpers/tramway/russian_cases_helper.rb +0 -26
  90. data/app/helpers/tramway/singleton_helper.rb +0 -12
  91. data/app/helpers/tramway/state_machine_buttons_helper.rb +0 -61
  92. data/app/helpers/tramway/title_helper.rb +0 -25
  93. data/app/inputs/date_picker_input.rb +0 -4
  94. data/app/inputs/multiple_file_input.rb +0 -7
  95. data/app/models/tramway/application_record.rb +0 -60
  96. data/app/models/tramway/user.rb +0 -23
  97. data/app/uploaders/application_uploader.rb +0 -22
  98. data/app/uploaders/file_uploader.rb +0 -4
  99. data/app/uploaders/ico_uploader.rb +0 -7
  100. data/app/uploaders/image_defaults.rb +0 -14
  101. data/app/uploaders/photo_uploader.rb +0 -54
  102. data/app/views/layouts/tramway/application.html.haml +0 -32
  103. data/app/views/layouts/tramway/shared/_navbar.html.haml +0 -46
  104. data/app/views/tramway/404.haml +0 -1
  105. data/app/views/tramway/records/_form.html.haml +0 -22
  106. data/app/views/tramway/records/_list.html.haml +0 -38
  107. data/app/views/tramway/records/_search.html.haml +0 -34
  108. data/app/views/tramway/records/edit.html.haml +0 -1
  109. data/app/views/tramway/records/index.html.haml +0 -31
  110. data/app/views/tramway/records/new.html.haml +0 -1
  111. data/app/views/tramway/records/show.html.haml +0 -1
  112. data/app/views/tramway/sessions/new.html.haml +0 -9
  113. data/app/views/tramway/shared/_input.html.haml +0 -34
  114. data/app/views/tramway/shared/_input_extended.html.haml +0 -14
  115. data/app/views/tramway/shared/_messages.html.haml +0 -10
  116. data/app/views/tramway/shared/_show.html.haml +0 -35
  117. data/app/views/tramway/shared/errors/server_error.html.haml +0 -12
  118. data/app/views/tramway/shared/input_extended_types/_checkbox.html.haml +0 -1
  119. data/app/views/tramway/shared/input_extended_types/_select.html.haml +0 -16
  120. data/app/views/tramway/shared/input_extended_types/_simple.html.haml +0 -4
  121. data/app/views/tramway/shared/input_extended_types/_yes_no.html.haml +0 -4
  122. data/app/views/tramway/shared/show/_attribute_tr.html.haml +0 -9
  123. data/app/views/tramway/shared/show/associations/_habtm_row.html.haml +0 -14
  124. data/app/views/tramway/shared/show/associations/_list.html.haml +0 -21
  125. data/app/views/tramway/shared/show/associations/_row.html.haml +0 -19
  126. data/app/views/tramway/shared/show/associations/_table_row.html.haml +0 -21
  127. data/app/views/tramway/singletons/_form.html.haml +0 -15
  128. data/app/views/tramway/singletons/edit.html.haml +0 -1
  129. data/app/views/tramway/singletons/new.html.haml +0 -1
  130. data/app/views/tramway/singletons/show.html.haml +0 -1
  131. data/app/views/tramway/welcome/index.html.haml +0 -4
  132. data/config/initializers/assets.rb +0 -7
  133. data/config/initializers/carrierwave.rb +0 -5
  134. data/config/initializers/ckeditor.rb +0 -9
  135. data/config/initializers/plurals.rb +0 -25
  136. data/config/locales/en/collections.yml +0 -4
  137. data/config/locales/en/date.yml +0 -16
  138. data/config/locales/en/dates.yml +0 -10
  139. data/config/locales/en/helpers.yml +0 -26
  140. data/config/locales/en/locale.yml +0 -11
  141. data/config/locales/en/messages.yml +0 -7
  142. data/config/locales/en/models.yml +0 -9
  143. data/config/locales/en/simple_form_extension.yml +0 -8
  144. data/config/locales/en/state_machines.yml +0 -8
  145. data/config/locales/ru/collections.yml +0 -4
  146. data/config/locales/ru/date.yml +0 -16
  147. data/config/locales/ru/dates.yml +0 -10
  148. data/config/locales/ru/helpers.yml +0 -30
  149. data/config/locales/ru/locale.yml +0 -6
  150. data/config/locales/ru/messages.yml +0 -7
  151. data/config/locales/ru/models.yml +0 -21
  152. data/config/locales/ru/simple_form_extension.yml +0 -8
  153. data/config/locales/ru/state_machines.yml +0 -8
  154. data/lib/string.rb +0 -18
  155. data/lib/tramway/application.rb +0 -10
  156. data/lib/tramway/class_name_helpers.rb +0 -15
  157. data/lib/tramway/collection.rb +0 -9
  158. data/lib/tramway/collections/helper.rb +0 -21
  159. data/lib/tramway/collections.rb +0 -4
  160. data/lib/tramway/error.rb +0 -32
  161. data/lib/tramway/forms.rb +0 -5
  162. data/lib/tramway/generators/install_generator.rb +0 -49
  163. data/lib/tramway/generators/model_generator.rb +0 -105
  164. data/lib/tramway/generators/templates/create_tramway_users.rb +0 -18
  165. data/lib/tramway/generators/templates/decorator.rb.erb +0 -56
  166. data/lib/tramway/generators/templates/form.rb.erb +0 -22
  167. data/lib/tramway/generators/templates/initializers/simple_form.rb +0 -23
  168. data/lib/tramway/generators/templates/initializers/simple_form_bootstrap.rb +0 -133
  169. data/lib/tramway/generators.rb +0 -6
  170. data/lib/tramway/navbar.rb +0 -44
  171. data/lib/tramway/notifications.rb +0 -12
  172. data/lib/tramway/record_routes_helper.rb +0 -23
  173. data/lib/tramway/records_models.rb +0 -52
  174. data/lib/tramway/singleton_models.rb +0 -32
  175. data/lib/tramway/spec/helpers/navbar_helper.rb +0 -7
  176. data/lib/tramway/spec/helpers/tramway_helpers.rb +0 -47
  177. data/lib/tramway/welcome_page_actions.rb +0 -5
  178. data/lib/tramway/yaml/errors.yml +0 -49
  179. data/lib/validators/presence_validator.rb +0 -9
@@ -1,449 +0,0 @@
1
- /*
2
- * Youtube Embed Plugin
3
- *
4
- * @author Jonnas Fonini <jonnasfonini@gmail.com>
5
- * @version 2.1.14
6
- */
7
- (function () {
8
- CKEDITOR.plugins.add('youtube', {
9
- lang: [ 'en', 'bg', 'pt', 'pt-br', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi', 'zh', 'el', 'he', 'es', 'nb', 'nn', 'fi', 'et', 'sk', 'cs', 'ko', 'eu', 'uk'],
10
- init: function (editor) {
11
- editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube', {
12
- allowedContent: 'div{*}(*); iframe{*}[!width,!height,!src,!frameborder,!allowfullscreen,!allow]; object param[*]; a[*]; img[*]'
13
- }));
14
-
15
- editor.ui.addButton('Youtube', {
16
- label : editor.lang.youtube.button,
17
- toolbar : 'insert',
18
- command : 'youtube',
19
- icon : this.path + 'images/icon.png'
20
- });
21
-
22
- CKEDITOR.dialog.add('youtube', function (instance) {
23
- var video,
24
- disabled = editor.config.youtube_disabled_fields || [];
25
-
26
- return {
27
- title : editor.lang.youtube.title,
28
- minWidth : 510,
29
- minHeight : 200,
30
- onShow: function () {
31
- for (var i = 0; i < disabled.length; i++) {
32
- this.getContentElement('youtubePlugin', disabled[i]).disable();
33
- }
34
- },
35
- contents :
36
- [{
37
- id : 'youtubePlugin',
38
- expand : true,
39
- elements :
40
- [{
41
- id : 'txtEmbed',
42
- type : 'textarea',
43
- label : editor.lang.youtube.txtEmbed,
44
- onChange : function (api) {
45
- handleEmbedChange(this, api);
46
- },
47
- onKeyUp : function (api) {
48
- handleEmbedChange(this, api);
49
- },
50
- validate : function () {
51
- if (this.isEnabled()) {
52
- if (!this.getValue()) {
53
- alert(editor.lang.youtube.noCode);
54
- return false;
55
- }
56
- else
57
- if (this.getValue().length === 0 || this.getValue().indexOf('//') === -1) {
58
- alert(editor.lang.youtube.invalidEmbed);
59
- return false;
60
- }
61
- }
62
- }
63
- },
64
- {
65
- type : 'html',
66
- html : editor.lang.youtube.or + '<hr>'
67
- },
68
- {
69
- type : 'hbox',
70
- widths : [ '70%', '15%', '15%' ],
71
- children :
72
- [
73
- {
74
- id : 'txtUrl',
75
- type : 'text',
76
- label : editor.lang.youtube.txtUrl,
77
- onChange : function (api) {
78
- handleLinkChange(this, api);
79
- },
80
- onKeyUp : function (api) {
81
- handleLinkChange(this, api);
82
- },
83
- validate : function () {
84
- if (this.isEnabled()) {
85
- if (!this.getValue()) {
86
- alert(editor.lang.youtube.noCode);
87
- return false;
88
- }
89
- else{
90
- video = ytVidId(this.getValue());
91
-
92
- if (this.getValue().length === 0 || video === false)
93
- {
94
- alert(editor.lang.youtube.invalidUrl);
95
- return false;
96
- }
97
- }
98
- }
99
- }
100
- },
101
- {
102
- type : 'text',
103
- id : 'txtWidth',
104
- width : '60px',
105
- label : editor.lang.youtube.txtWidth,
106
- 'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
107
- validate : function () {
108
- if (this.getValue()) {
109
- var width = parseInt (this.getValue()) || 0;
110
-
111
- if (width === 0) {
112
- alert(editor.lang.youtube.invalidWidth);
113
- return false;
114
- }
115
- }
116
- else {
117
- alert(editor.lang.youtube.noWidth);
118
- return false;
119
- }
120
- }
121
- },
122
- {
123
- type : 'text',
124
- id : 'txtHeight',
125
- width : '60px',
126
- label : editor.lang.youtube.txtHeight,
127
- 'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
128
- validate : function () {
129
- if (this.getValue()) {
130
- var height = parseInt(this.getValue()) || 0;
131
-
132
- if (height === 0) {
133
- alert(editor.lang.youtube.invalidHeight);
134
- return false;
135
- }
136
- }
137
- else {
138
- alert(editor.lang.youtube.noHeight);
139
- return false;
140
- }
141
- }
142
- }
143
- ]
144
- },
145
- {
146
- type : 'hbox',
147
- widths : [ '55%', '45%' ],
148
- children :
149
- [
150
- {
151
- id : 'chkResponsive',
152
- type : 'checkbox',
153
- label : editor.lang.youtube.txtResponsive,
154
- 'default' : editor.config.youtube_responsive != null ? editor.config.youtube_responsive : false
155
- },
156
- {
157
- id : 'chkNoEmbed',
158
- type : 'checkbox',
159
- label : editor.lang.youtube.txtNoEmbed,
160
- 'default' : editor.config.youtube_noembed != null ? editor.config.youtube_noembed : false
161
- }
162
- ]
163
- },
164
- {
165
- type : 'hbox',
166
- widths : [ '55%', '45%' ],
167
- children :
168
- [
169
- {
170
- id : 'chkRelated',
171
- type : 'checkbox',
172
- 'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
173
- label : editor.lang.youtube.chkRelated
174
- },
175
- {
176
- id : 'chkOlderCode',
177
- type : 'checkbox',
178
- 'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
179
- label : editor.lang.youtube.chkOlderCode
180
- }
181
- ]
182
- },
183
- {
184
- type : 'hbox',
185
- widths : [ '55%', '45%' ],
186
- children :
187
- [
188
- {
189
- id : 'chkPrivacy',
190
- type : 'checkbox',
191
- label : editor.lang.youtube.chkPrivacy,
192
- 'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
193
- },
194
- {
195
- id : 'chkAutoplay',
196
- type : 'checkbox',
197
- 'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
198
- label : editor.lang.youtube.chkAutoplay
199
- }
200
- ]
201
- },
202
- {
203
- type : 'hbox',
204
- widths : [ '55%', '45%'],
205
- children :
206
- [
207
- {
208
- id : 'txtStartAt',
209
- type : 'text',
210
- label : editor.lang.youtube.txtStartAt,
211
- validate : function () {
212
- if (this.getValue()) {
213
- var str = this.getValue();
214
-
215
- if (!/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test(str)) {
216
- alert(editor.lang.youtube.invalidTime);
217
- return false;
218
- }
219
- }
220
- }
221
- },
222
- {
223
- id : 'chkControls',
224
- type : 'checkbox',
225
- 'default' : editor.config.youtube_controls != null ? editor.config.youtube_controls : true,
226
- label : editor.lang.youtube.chkControls
227
- }
228
- ]
229
- }
230
- ]
231
- }
232
- ],
233
- onOk: function()
234
- {
235
- var content = '';
236
- var responsiveStyle = '';
237
-
238
- if (this.getContentElement('youtubePlugin', 'txtEmbed').isEnabled()) {
239
- content = this.getValueOf('youtubePlugin', 'txtEmbed');
240
- }
241
- else {
242
- var url = 'https://', params = [], startSecs, paramAutoplay='';
243
- var width = this.getValueOf('youtubePlugin', 'txtWidth');
244
- var height = this.getValueOf('youtubePlugin', 'txtHeight');
245
-
246
- if (this.getContentElement('youtubePlugin', 'chkPrivacy').getValue() === true) {
247
- url += 'www.youtube-nocookie.com/';
248
- }
249
- else {
250
- url += 'www.youtube.com/';
251
- }
252
-
253
- url += 'embed/' + video;
254
-
255
- if (this.getContentElement('youtubePlugin', 'chkRelated').getValue() === false) {
256
- params.push('rel=0');
257
- }
258
-
259
- if (this.getContentElement('youtubePlugin', 'chkAutoplay').getValue() === true) {
260
- params.push('autoplay=1');
261
- paramAutoplay='autoplay';
262
- }
263
-
264
- if (this.getContentElement('youtubePlugin', 'chkControls').getValue() === false) {
265
- params.push('controls=0');
266
- }
267
-
268
- startSecs = this.getValueOf('youtubePlugin', 'txtStartAt');
269
-
270
- if (startSecs) {
271
- var seconds = hmsToSeconds(startSecs);
272
-
273
- params.push('start=' + seconds);
274
- }
275
-
276
- if (params.length > 0) {
277
- url = url + '?' + params.join('&');
278
- }
279
-
280
- if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
281
- content += '<div class="youtube-embed-wrapper" style="position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden">';
282
- responsiveStyle = 'style="position:absolute;top:0;left:0;width:100%;height:100%"';
283
- }
284
-
285
- if (this.getContentElement('youtubePlugin', 'chkOlderCode').getValue() === true) {
286
- url = url.replace('embed/', 'v/');
287
- url = url.replace(/&/g, '&amp;');
288
-
289
- if (url.indexOf('?') === -1) {
290
- url += '?';
291
- }
292
- else {
293
- url += '&amp;';
294
- }
295
- url += 'hl=' + (this.getParentEditor().config.language ? this.getParentEditor().config.language : 'en') + '&amp;version=3';
296
-
297
- content += '<object width="' + width + '" height="' + height + '" ' + responsiveStyle + '>';
298
- content += '<param name="movie" value="' + url + '"></param>';
299
- content += '<param name="allowFullScreen" value="true"></param>';
300
- content += '<param name="allowscriptaccess" value="always"></param>';
301
- content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
302
- content += 'width="' + width + '" height="' + height + '" '+ responsiveStyle + ' allowscriptaccess="always" ';
303
- content += 'allowfullscreen="true"></embed>';
304
- content += '</object>';
305
- }
306
- else
307
- if (this.getContentElement('youtubePlugin', 'chkNoEmbed').getValue() === true) {
308
- var imgSrc = 'https://img.youtube.com/vi/' + video + '/sddefault.jpg';
309
- content += '<a href="' + url + '" ><img width="' + width + '" height="' + height + '" src="' + imgSrc + '" ' + responsiveStyle + '/></a>';
310
- }
311
- else {
312
- content += '<iframe ' + (paramAutoplay ? 'allow="' + paramAutoplay + ';" ' : '') + 'width="' + width + '" height="' + height + '" src="' + url + '" ' + responsiveStyle;
313
- content += 'frameborder="0" allowfullscreen></iframe>';
314
- }
315
-
316
- if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
317
- content += '</div>';
318
- }
319
- }
320
-
321
- var element = CKEDITOR.dom.element.createFromHtml(content);
322
- var instance = this.getParentEditor();
323
- instance.insertElement(element);
324
- }
325
- };
326
- });
327
- }
328
- });
329
- })();
330
-
331
- function handleLinkChange(el, api) {
332
- var video = ytVidId(el.getValue());
333
- var time = ytVidTime(el.getValue());
334
-
335
- if (el.getValue().length > 0) {
336
- el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').disable();
337
- }
338
- else if (!disabled.length || !disabled.includes('txtEmbed')) {
339
- el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').enable();
340
- }
341
-
342
- if (video && time) {
343
- var seconds = timeParamToSeconds(time);
344
- var hms = secondsToHms(seconds);
345
- el.getDialog().getContentElement('youtubePlugin', 'txtStartAt').setValue(hms);
346
- }
347
- }
348
-
349
- function handleEmbedChange(el, api) {
350
- if (el.getValue().length > 0) {
351
- el.getDialog().getContentElement('youtubePlugin', 'txtUrl').disable();
352
- }
353
- else {
354
- el.getDialog().getContentElement('youtubePlugin', 'txtUrl').enable();
355
- }
356
- }
357
-
358
-
359
- /**
360
- * JavaScript function to match (and return) the video Id
361
- * of any valid Youtube Url, given as input string.
362
- * @author: Stephan Schmitz <eyecatchup@gmail.com>
363
- * @url: http://stackoverflow.com/a/10315969/624466
364
- */
365
- function ytVidId(url) {
366
- var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
367
- return (url.match(p)) ? RegExp.$1 : false;
368
- }
369
-
370
- /**
371
- * Matches and returns time param in YouTube Urls.
372
- */
373
- function ytVidTime(url) {
374
- var p = /t=([0-9hms]+)/;
375
- return (url.match(p)) ? RegExp.$1 : false;
376
- }
377
-
378
- /**
379
- * Converts time in hms format to seconds only
380
- */
381
- function hmsToSeconds(time) {
382
- var arr = time.split(':'), s = 0, m = 1;
383
-
384
- while (arr.length > 0) {
385
- s += m * parseInt(arr.pop(), 10);
386
- m *= 60;
387
- }
388
-
389
- return s;
390
- }
391
-
392
- /**
393
- * Converts seconds to hms format
394
- */
395
- function secondsToHms(seconds) {
396
- var h = Math.floor(seconds / 3600);
397
- var m = Math.floor((seconds / 60) % 60);
398
- var s = seconds % 60;
399
-
400
- var pad = function (n) {
401
- n = String(n);
402
- return n.length >= 2 ? n : "0" + n;
403
- };
404
-
405
- if (h > 0) {
406
- return pad(h) + ':' + pad(m) + ':' + pad(s);
407
- }
408
- else {
409
- return pad(m) + ':' + pad(s);
410
- }
411
- }
412
-
413
- /**
414
- * Converts time in youtube t-param format to seconds
415
- */
416
- function timeParamToSeconds(param) {
417
- var componentValue = function (si) {
418
- var regex = new RegExp('(\\d+)' + si);
419
- return param.match(regex) ? parseInt(RegExp.$1, 10) : 0;
420
- };
421
-
422
- return componentValue('h') * 3600
423
- + componentValue('m') * 60
424
- + componentValue('s');
425
- }
426
-
427
- /**
428
- * Converts seconds into youtube t-param value, e.g. 1h4m30s
429
- */
430
- function secondsToTimeParam(seconds) {
431
- var h = Math.floor(seconds / 3600);
432
- var m = Math.floor((seconds / 60) % 60);
433
- var s = seconds % 60;
434
- var param = '';
435
-
436
- if (h > 0) {
437
- param += h + 'h';
438
- }
439
-
440
- if (m > 0) {
441
- param += m + 'm';
442
- }
443
-
444
- if (s > 0) {
445
- param += s + 's';
446
- }
447
-
448
- return param;
449
- }
@@ -1,60 +0,0 @@
1
- //= require jquery
2
- //= require jquery_ujs
3
- //= require jquery3
4
- //= require bootstrap-datepicker-1.8.0
5
- //= require bootstrap-datepicker-1.8.0.ru.min
6
- //= require bootstrap-sprockets
7
- //= require font_awesome5
8
- //= require ckeditor/init
9
- //= require clipboard
10
- //= require_tree .
11
-
12
- window.i18n_locale = function(locale) {
13
- switch (locale) {
14
- case 'en':
15
- return({ date_format: 'yyyy-mm-dd', locale: locale });
16
- break;
17
- case 'ru':
18
- return({ date_format: 'dd.mm.yyyy', locale: locale });
19
- break;
20
- default:
21
- return({ date_format: 'yyyy-mm-dd', locale: locale });
22
- break;
23
- }
24
- }
25
-
26
- $(document).ready(function() {
27
- if (!(window.current_locale)) {
28
- console.log('You should set `window.current_locale` before all Javascript code');
29
- }
30
-
31
- if ($('.date_picker').length != 0) {
32
- $('.date_picker').datepicker({
33
- format: window.current_locale.date_format,
34
- language: window.current_locale.locale
35
- });
36
- }
37
-
38
- $('.link').click(function() {
39
- const href = $(this).data('href');
40
- if (href) {
41
- location.href = href;
42
- } else {
43
- const anchor = $(this).data('anchor');
44
- if (!$(anchor).offset() == undefined) {
45
- $(window).scrollTop($(anchor).offset().top);
46
- }
47
- };
48
- });
49
-
50
- let clipboard = new Clipboard('.clipboard-btn');
51
- $(function () {
52
- $('[data-toggle="popover"]').popover()
53
- })
54
-
55
- const url = new URL(window.location.href);
56
- const focusElementSelector = url.searchParams.get('focus');
57
- if (!$(focusElementSelector).offset() == undefined) {
58
- $(window).scrollTop($(focusElementSelector).offset().top);
59
- }
60
- });
@@ -1,60 +0,0 @@
1
- /*
2
- *= require_tree .
3
- *= require_self
4
- */
5
-
6
- @import 'font_awesome5_webfont'
7
- @import 'font_awesome5'
8
- @import 'bootstrap-datepicker-1.8.0.css'
9
- @import 'bootstrap'
10
-
11
- .datepicker-inline
12
- display: none !important
13
-
14
- .link
15
- cursor: pointer
16
- &:hover
17
- opacity: 0.8
18
-
19
- .circle
20
- border-radius: 50%
21
-
22
- .container
23
- padding-top: 2rem
24
-
25
- td
26
- &.actions
27
- width: 8rem
28
-
29
- .icon-in-navbar
30
- font-size: 15pt
31
-
32
- .notifications
33
- a
34
- margin-right: 25px
35
- span.badge:hover
36
- filter: brightness(90%)
37
-
38
- .smart_button
39
- float: right
40
- margin-bottom: 0
41
-
42
- .scrollable
43
- height: auto
44
- max-height: 30em
45
- overflow-x: hidden
46
-
47
- .row-fluid.filters
48
- width: 100%
49
- display: flex
50
-
51
- select
52
- width: 100%
53
-
54
- .submit
55
- display: flex
56
- flex-direction: row-reverse
57
-
58
- .dates_filter
59
- display: flex
60
- flex-direction: row