glib-web 3.24.0 → 3.24.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/glib/json/libs.rb +20 -12
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/helpers/glib/app_feature_support_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/enum_helper.rb +11 -3
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +7 -0
- data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
- data/app/helpers/glib/json_ui/default.rb +24 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/page_helper.rb +5 -3
- data/app/helpers/glib/json_ui/view_builder/fields.rb +9 -1
- data/app/helpers/glib/urls_helper.rb +2 -2
- data/app/models/concerns/glib/enum_humanization.rb +15 -8
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/dynamic_text_record.rb +0 -0
- data/app/models/glib/text.rb +0 -0
- data/app/validators/email_typo_validator.rb +0 -0
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +4 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +1 -1
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dialogs_update3.json.jbuilder +28 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/paste_file.jbuilder +15 -2
- data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/treeView.json.jbuilder +1 -0
- data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
- data/lib/generators/glib/install_generator.rb +0 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
- data/lib/generators/templates/database.yml +0 -0
- data/lib/generators/templates/dynamic_text.rb +0 -0
- data/lib/glib/crypt/utils.rb +0 -1
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/json_crawler/action_crawler.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- metadata +5 -3
- data/lib/glib/crypt.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b476d1e7ef1dc93819822ba3e2091c534d99fc7395246309f2224e522ca45b
|
4
|
+
data.tar.gz: fbd474cc63d4e30796ae43b2754bfdb0bf07416f923f90a7ec74d75f4924209a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11e24fdad3d1538bda9d6c386053d54c6808e2ee1b1a239ea5839186faf5f097b56b04a5212572da8b11592bb07fa71200dc7f503b9e89ee59c3c9e6c9001d77
|
7
|
+
data.tar.gz: 3b7f3f4b4d4205d463410a87814018e1fcd482a69c8768609d9a87117ffb4d50ffaff22bf2b9f2cff5771b98bf6189cc598b48a200f3cb4692e16a50a05f088f
|
@@ -6,7 +6,8 @@ module Glib::Json::Libs
|
|
6
6
|
|
7
7
|
helper_method :json_ui_app_bundle_id, :json_ui_app_build_version, :json_ui_app_device_os
|
8
8
|
helper_method :json_ui_app_is_android?, :json_ui_app_is_ios?, :json_ui_app_is_web?
|
9
|
-
helper_method :json_ui_redirect_back_or_to
|
9
|
+
# helper_method :json_ui_redirect_back_or_to
|
10
|
+
helper_method :delete_redirect_back_url
|
10
11
|
|
11
12
|
include Glib::Auth::Response
|
12
13
|
helper_method :glib_json_dialog_mode?
|
@@ -115,7 +116,7 @@ module Glib::Json::Libs
|
|
115
116
|
|
116
117
|
def glib_handle_401(sign_in_url)
|
117
118
|
if !glib_json_dialog_mode? && request.get?
|
118
|
-
|
119
|
+
json_ui_save_return_url
|
119
120
|
end
|
120
121
|
|
121
122
|
respond_to do |format|
|
@@ -160,17 +161,22 @@ module Glib::Json::Libs
|
|
160
161
|
session.delete(REDIRECT_BACK_KEY) || url
|
161
162
|
end
|
162
163
|
|
164
|
+
def delete_redirect_back_url(url)
|
165
|
+
__delete_redirect_back_url(url)
|
166
|
+
end
|
167
|
+
|
163
168
|
# def html_ui_redirect_back_or_to(default_url)
|
164
169
|
# redirect_url = __delete_redirect_back_url(default_url)
|
165
170
|
# redirect_to redirect_url
|
166
171
|
# end
|
167
172
|
|
168
|
-
def json_ui_redirect_back_or_to(default_url, json_action)
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
end
|
173
|
+
# def json_ui_redirect_back_or_to(default_url, json_action)
|
174
|
+
# redirect_url = __delete_redirect_back_url(default_url)
|
175
|
+
# json_action.windows_closeAll onClose: ->(subaction) do
|
176
|
+
# puts "***** R2: #{redirect_url}"
|
177
|
+
# subaction.windows_open url: redirect_url
|
178
|
+
# end
|
179
|
+
# end
|
174
180
|
|
175
181
|
def __glib_error_dialog(title, message)
|
176
182
|
{
|
@@ -223,15 +229,17 @@ module Glib::Json::Libs
|
|
223
229
|
end
|
224
230
|
|
225
231
|
def json_ui_redirect_to(url)
|
226
|
-
|
227
|
-
on_load = { action: 'windows/open', url: url }
|
232
|
+
on_response = { action: 'windows/open', url: url }
|
228
233
|
|
229
234
|
if glib_json_dialog_mode?
|
230
235
|
# Only do this in dialog mode because this seems to add to the rendering time
|
231
236
|
# (i.e. longer flicker time), presumably due to the use of things like `nextTick()`.
|
232
|
-
|
237
|
+
on_response = { action: 'dialogs/close', onClose: on_load }
|
233
238
|
end
|
234
|
-
|
239
|
+
|
240
|
+
# Use onResponse because it is harder to guarantee that `onLoad` executes in Vuejs because it relies
|
241
|
+
# on app.vue's reactivity.
|
242
|
+
render json: { onResponse: on_response }
|
235
243
|
end
|
236
244
|
|
237
245
|
module ClassMethods
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,16 +1,24 @@
|
|
1
1
|
module Glib
|
2
2
|
module EnumHelper
|
3
|
-
def glib_enum_options(clazz, enum_field, keys: nil,
|
3
|
+
def glib_enum_options(clazz, enum_field, keys: nil, hint_suffix: false, hint_subtitle: false)
|
4
4
|
enum_name = enum_field.to_s
|
5
5
|
keys ||= clazz.defined_enums[enum_name].keys
|
6
6
|
keys.map do |i|
|
7
|
-
text = clazz.glib_enum_humanize(enum_field, i,
|
8
|
-
{ text: text, value: i }
|
7
|
+
text = clazz.glib_enum_humanize(enum_field, i, hint_suffix: hint_suffix)
|
8
|
+
option = { text: text, value: i }
|
9
|
+
if hint_subtitle && (hint = clazz.glib_enum_hint(enum_field, i))
|
10
|
+
option[:subtitle] = hint
|
11
|
+
end
|
12
|
+
option
|
9
13
|
end
|
10
14
|
end
|
11
15
|
|
12
16
|
# See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones and description
|
13
17
|
def glib_time_zone_options
|
18
|
+
# For some reason, some offsets differ on some machines causing test failures.
|
19
|
+
# TZInfo::Timezone.default_dst = true
|
20
|
+
return [] if Rails.env.test?
|
21
|
+
|
14
22
|
ActiveSupport::TimeZone.all.sort { |a, b|
|
15
23
|
a.utc_offset <=> b.utc_offset
|
16
24
|
}.collect { |tz|
|
File without changes
|
@@ -30,6 +30,13 @@ class Glib::JsonUi::ActionBuilder
|
|
30
30
|
required :fallbackUrl
|
31
31
|
end
|
32
32
|
|
33
|
+
class CloseWithOpen < Action
|
34
|
+
string :url
|
35
|
+
action :onOpen
|
36
|
+
|
37
|
+
required :url
|
38
|
+
end
|
39
|
+
|
33
40
|
# Any component can listen to the refresh_state event and react appropriately.
|
34
41
|
# E.g. Stripe credit card component can refresh its token to make sure it is not stale.
|
35
42
|
class RefreshState < Action
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Glib
|
2
|
+
module JsonUi
|
3
|
+
module Default
|
4
|
+
def default_accepts(value)
|
5
|
+
default_max_size_error = {
|
6
|
+
body: I18n.t('common.accepts.max_file_size_error.body', default: '') || 'Files exceed the maximum size',
|
7
|
+
button: I18n.t('common.accepts.max_file_size_error.button', default: '') || 'Dismiss'
|
8
|
+
}
|
9
|
+
default_max_length_error = {
|
10
|
+
body: I18n.t('common.accepts.max_file_length_error.body', default: '') || 'Files exceed the maximum limit per upload',
|
11
|
+
button: I18n.t('common.accepts.max_file_length_error.button', default: '') || 'Dismiss'
|
12
|
+
}
|
13
|
+
|
14
|
+
{
|
15
|
+
fileType: value[:fileType],
|
16
|
+
maxFileSize: value[:maxFileSize] || 10000,
|
17
|
+
maxFileLength: value[:maxFileLength] || 10,
|
18
|
+
maxFileSizeErrorText: value[:maxFileSizeErrorText] || default_max_size_error,
|
19
|
+
maxFileLengthErrorText: value[:maxFileLengthErrorText] || default_max_length_error
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
@@ -73,6 +73,8 @@ module Glib
|
|
73
73
|
end
|
74
74
|
|
75
75
|
class Page
|
76
|
+
include Glib::JsonUi::Default
|
77
|
+
|
76
78
|
attr_reader :json, :context, :view_builder, :sview_builder, :action_builder, :menu_builder
|
77
79
|
attr_reader :list_section_builder, :table_section_builder, :drawer_content_builder
|
78
80
|
|
@@ -98,9 +100,9 @@ module Glib
|
|
98
100
|
# @generic_content_builder = GenericBuilders::Content.new(json, self, @view_builder)
|
99
101
|
end
|
100
102
|
|
101
|
-
def
|
102
|
-
json.
|
103
|
-
json.accepts options[:accepts]
|
103
|
+
def filePaster(options = {})
|
104
|
+
json.filePaster do
|
105
|
+
json.accepts default_accepts(options[:accepts])
|
104
106
|
json.directUploadUrl options[:directUploadUrl]
|
105
107
|
json.url options[:url]
|
106
108
|
json.inputName options[:inputName]
|
@@ -317,7 +317,9 @@ class Glib::JsonUi::ViewBuilder
|
|
317
317
|
end
|
318
318
|
|
319
319
|
class MultiUpload < AbstractField
|
320
|
-
|
320
|
+
include Glib::JsonUi::Default
|
321
|
+
|
322
|
+
# hash :accepts
|
321
323
|
array :files
|
322
324
|
string :directUploadUrl
|
323
325
|
string :uploadTitle
|
@@ -336,6 +338,10 @@ class Glib::JsonUi::ViewBuilder
|
|
336
338
|
@hint = value
|
337
339
|
end
|
338
340
|
|
341
|
+
def accepts(value)
|
342
|
+
@accepts = value
|
343
|
+
end
|
344
|
+
|
339
345
|
def files(values)
|
340
346
|
@files = values
|
341
347
|
end
|
@@ -364,6 +370,8 @@ class Glib::JsonUi::ViewBuilder
|
|
364
370
|
json.placeholder @placeholder if @placeholder
|
365
371
|
json.hint @hint if @hint
|
366
372
|
|
373
|
+
json.accepts default_accepts(@accepts)
|
374
|
+
|
367
375
|
if @prop && context
|
368
376
|
# association = form.nested_associations.last
|
369
377
|
# context = association || form
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Glib
|
2
2
|
module UrlsHelper
|
3
|
-
def glib_url_current(
|
4
|
-
url_for(
|
3
|
+
def glib_url_current(replacement_params: params.to_unsafe_h, extra_params: {})
|
4
|
+
url_for(replacement_params.merge(extra_params.merge(only_path: false)))
|
5
5
|
end
|
6
6
|
|
7
7
|
def glib_url_equals_current?(url)
|
@@ -11,13 +11,13 @@ module Glib
|
|
11
11
|
extend ClassMethods
|
12
12
|
end
|
13
13
|
|
14
|
-
def glib_enum_humanize(enum_name, default_enum_value = nil,
|
15
|
-
self.class.glib_enum_humanize(enum_name, send(enum_name) || default_enum_value,
|
14
|
+
def glib_enum_humanize(enum_name, default_enum_value = nil, hint_suffix: false)
|
15
|
+
self.class.glib_enum_humanize(enum_name, send(enum_name) || default_enum_value, hint_suffix: hint_suffix)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
module ClassMethods
|
20
|
-
def glib_enum_humanize(enum_name, enum_value, default_translation = nil,
|
20
|
+
def glib_enum_humanize(enum_name, enum_value, default_translation = nil, hint_suffix: false)
|
21
21
|
if enum_value
|
22
22
|
translation_key = "activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}"
|
23
23
|
|
@@ -27,15 +27,22 @@ module Glib
|
|
27
27
|
text = I18n.t(translation_key, default: default_translation)
|
28
28
|
end
|
29
29
|
|
30
|
-
if
|
31
|
-
|
32
|
-
if (hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}.hint")).present?
|
33
|
-
text += " #{hint}"
|
34
|
-
end
|
30
|
+
if hint_suffix && (hint = glib_enum_hint(enum_name, enum_value))
|
31
|
+
text += " #{hint}"
|
35
32
|
end
|
36
33
|
|
37
34
|
text
|
38
35
|
end
|
39
36
|
end
|
37
|
+
|
38
|
+
def glib_enum_hint(enum_name, enum_value)
|
39
|
+
i18n_key = self.model_name.i18n_key
|
40
|
+
if (hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}.hint")).present?
|
41
|
+
# text += " #{hint}"
|
42
|
+
return hint
|
43
|
+
end
|
44
|
+
|
45
|
+
nil
|
46
|
+
end
|
40
47
|
end
|
41
48
|
end
|
File without changes
|
File without changes
|
File without changes
|
data/app/models/glib/text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -84,6 +84,10 @@ section.rows builder: ->(template) do
|
|
84
84
|
action.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_update2')
|
85
85
|
end
|
86
86
|
|
87
|
+
template.thumbnail title: 'dialogs/open (with filePaster)', onClick: ->(action) do
|
88
|
+
action.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_update3')
|
89
|
+
end
|
90
|
+
|
87
91
|
template.thumbnail title: 'dialogs/oauth', onClick: ->(action) do
|
88
92
|
if respond_to?(:user_facebook_omniauth_authorize_url)
|
89
93
|
provider = {
|
@@ -5,7 +5,7 @@ end
|
|
5
5
|
|
6
6
|
section.rows builder: ->(template) do
|
7
7
|
template.thumbnail title: 'sheets/select', onClick: ->(action) do
|
8
|
-
action.sheets_select message: '
|
8
|
+
action.sheets_select message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rutrum vel nisi in pharetra. Aenean mollis feugiat elementum. Donec tempor arcu fringilla risus finibus cursus. Donec eleifend ex sit amet odio rutrum, vitae ornare nunc congue. In hac habitasse platea dictumst. Curabitur at velit et odio ornare vestibulum sit amet vitae ex. Proin tincidunt rutrum libero vitae tempus.', buttons: ->(menu) do
|
9
9
|
menu.button text: 'Option1', onClick: ->(subaction) do
|
10
10
|
subaction.dialogs_alert message: 'Option 1'
|
11
11
|
end
|
File without changes
|
@@ -0,0 +1,28 @@
|
|
1
|
+
json.title 'Forms'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
page.filePaster \
|
7
|
+
directUploadUrl: rails_direct_uploads_url,
|
8
|
+
accepts: {
|
9
|
+
fileType: 'image',
|
10
|
+
maxFileSize: 100,
|
11
|
+
maxFileLength: 1,
|
12
|
+
maxFileSizeErrorText: {
|
13
|
+
body: 'File too big. Max: 100KB',
|
14
|
+
button: 'Try again'
|
15
|
+
},
|
16
|
+
maxFileLengthErrorText: {
|
17
|
+
body: 'File count exceeded! Max: 1 file per paste',
|
18
|
+
button: 'Try again'
|
19
|
+
}
|
20
|
+
},
|
21
|
+
inputName: 'user',
|
22
|
+
url: json_ui_garage_url(path: 'forms/generic_post')
|
23
|
+
|
24
|
+
page.body childViews: ->(body) do
|
25
|
+
body.panels_responsive padding: glib_json_padding_body, childViews: ->(res) do
|
26
|
+
res.h1 text: 'Paste file to this dialog'
|
27
|
+
end
|
28
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,12 +4,25 @@ page = json_ui_page json
|
|
4
4
|
|
5
5
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
6
6
|
|
7
|
-
page.
|
7
|
+
page.filePaster \
|
8
8
|
directUploadUrl: rails_direct_uploads_url,
|
9
|
-
accepts: {
|
9
|
+
accepts: {
|
10
|
+
fileType: 'image',
|
11
|
+
maxFileSize: 100,
|
12
|
+
maxFileLength: 1,
|
13
|
+
maxFileSizeErrorText: {
|
14
|
+
body: 'File too big. Max: 100KB',
|
15
|
+
button: 'Try again'
|
16
|
+
},
|
17
|
+
maxFileLengthErrorText: {
|
18
|
+
body: 'File count exceeded! Max: 1 file per paste',
|
19
|
+
button: 'Try again'
|
20
|
+
}
|
21
|
+
},
|
10
22
|
inputName: 'user',
|
11
23
|
url: json_ui_garage_url(path: 'forms/generic_post')
|
12
24
|
|
25
|
+
|
13
26
|
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
14
27
|
scroll.label text: 'Paste image to this page'
|
15
28
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -29,6 +29,7 @@ json_ui_page json do |page|
|
|
29
29
|
id: 'parent-2',
|
30
30
|
icon: 'folder',
|
31
31
|
label: 'Custom drop',
|
32
|
+
dropData: {},
|
32
33
|
children: [
|
33
34
|
{ label: 'Child 1', id: 'parent-2-child-1', dropData: { to: 'child1' } },
|
34
35
|
{ label: 'Child 2', id: 'parent-2-child-2', dropData: { to: 'child2' } },
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/crypt/utils.rb
CHANGED
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/value.rb
CHANGED
File without changes
|
data/lib/glib/version.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.24.
|
4
|
+
version: 3.24.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- app/helpers/glib/json_ui/action_builder/windows.rb
|
110
110
|
- app/helpers/glib/json_ui/analytics_helper.rb
|
111
111
|
- app/helpers/glib/json_ui/builder/mouse_events.rb
|
112
|
+
- app/helpers/glib/json_ui/default.rb
|
112
113
|
- app/helpers/glib/json_ui/dynamic_field_builders.rb
|
113
114
|
- app/helpers/glib/json_ui/generic_builders.rb
|
114
115
|
- app/helpers/glib/json_ui/list_builders.rb
|
@@ -165,6 +166,7 @@ files:
|
|
165
166
|
- app/views/json_ui/garage/forms/dialogs_close.json.jbuilder
|
166
167
|
- app/views/json_ui/garage/forms/dialogs_update.json.jbuilder
|
167
168
|
- app/views/json_ui/garage/forms/dialogs_update2.json.jbuilder
|
169
|
+
- app/views/json_ui/garage/forms/dialogs_update3.json.jbuilder
|
168
170
|
- app/views/json_ui/garage/forms/dirty_prompt.json.jbuilder
|
169
171
|
- app/views/json_ui/garage/forms/dynamic_group.json.jbuilder
|
170
172
|
- app/views/json_ui/garage/forms/dynamic_select.json.jbuilder
|
@@ -292,7 +294,6 @@ files:
|
|
292
294
|
- lib/generators/templates/database.yml
|
293
295
|
- lib/generators/templates/dynamic_text.rb
|
294
296
|
- lib/glib-web.rb
|
295
|
-
- lib/glib/crypt.rb
|
296
297
|
- lib/glib/crypt/utils.rb
|
297
298
|
- lib/glib/direct_uploads_controller.rb
|
298
299
|
- lib/glib/dynamic_text.rb
|
@@ -336,7 +337,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
337
|
- !ruby/object:Gem::Version
|
337
338
|
version: '0'
|
338
339
|
requirements: []
|
339
|
-
|
340
|
+
rubyforge_project:
|
341
|
+
rubygems_version: 2.7.6
|
340
342
|
signing_key:
|
341
343
|
specification_version: 4
|
342
344
|
summary: ''
|
data/lib/glib/crypt.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require_relative './crypt/utils'
|
2
|
-
|
3
|
-
# A replacement of Glib::Crypt::Utils
|
4
|
-
module Glib
|
5
|
-
class Crypt
|
6
|
-
# Recommended digest: 'SHA256'
|
7
|
-
def self.encrypt(original_message, encryption_secret, encryption_salt, digest)
|
8
|
-
encryptor = message_encryptor(encryption_secret, encryption_salt, digest)
|
9
|
-
CGI.escape(encryptor.encrypt_and_sign(original_message))
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.decrypt(encrypted_message, encryption_secret, encryption_salt, digest)
|
13
|
-
encryptor = message_encryptor(encryption_secret, encryption_salt, digest)
|
14
|
-
begin
|
15
|
-
encryptor.decrypt_and_verify(CGI.unescape(encrypted_message))
|
16
|
-
rescue ActiveSupport::MessageEncryptor::InvalidMessage
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
def self.message_encryptor(encryption_secret, encryption_salt, digest)
|
23
|
-
key_generator = ActiveSupport::KeyGenerator.new(encryption_secret, iterations: 1000)
|
24
|
-
key_secret = key_generator.generate_key(encryption_salt, 32)
|
25
|
-
ActiveSupport::MessageEncryptor.new(key_secret, digest: digest, serializer: JSON)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|