keppler 2.1.11 → 2.1.12
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 +4 -4
- data/Gemfile.lock +1 -1
- data/LICENSE +674 -0
- data/installer/core/Gemfile.lock +0 -0
- data/installer/core/LICENSE +674 -0
- data/installer/core/app/assets/javascripts/admin/main.coffee +1 -1
- data/installer/core/app/controllers/admin/settings_controller.rb +4 -0
- data/installer/core/app/controllers/application_controller.rb +1 -0
- data/installer/core/app/views/admin/layouts/_navigation.html.haml +1 -1
- data/installer/core/app/views/admin/layouts/_sidebar.html.haml +1 -1
- data/installer/core/app/views/admin/scripts/index.html.haml +1 -1
- data/installer/core/app/views/app/layouts/_google_analytics.html.haml +5 -6
- data/installer/core/config/circleci/db_config.yml +2 -2
- data/installer/core/config/locales/en.yml +3 -0
- data/installer/core/config/routes.rb +0 -8
- data/installer/core/config/settings.yml +2 -2
- data/installer/core/db/seeds.rb +6 -9
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/conf +0 -0
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/conf +0 -0
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/conf +0 -0
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/slick/conf +0 -0
- data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes-editor.js +1174 -0
- data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/app/app_controller.rb +1 -1
- data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/concerns/services.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/helpers/keppler_frontend/app/frontend_helper.rb +1 -1
- data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/concerns/partials/helper_file.rb +4 -4
- data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/concerns/partials/html_file.rb +14 -20
- data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/concerns/partials/scss_file.rb +1 -1
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/file_format.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/resources.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/resources_format.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/assets.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/config.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/front.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/urls/roots.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/code_search.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/file_format.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/yml_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/actions_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/css_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/html_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/install.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/js_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/remote_js_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/routes_handler.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/views/uninstall.rb +0 -0
- data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/_editor_assets.html.haml +25 -23
- data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/_editor_themes.html.haml +25 -23
- data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/_editor_views.html.haml +23 -21
- data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/views/index.html.haml +11 -10
- data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/app/partials/_devise_login.html.erb +34 -34
- data/installer/core/rockets/keppler_frontend/app/views/layouts/keppler_frontend/app/layouts/application.html.erb +0 -1
- data/installer/core/rockets/keppler_frontend/app/views/layouts/themes/keppler_default/application.html.erb +0 -1
- data/installer/core/rockets/keppler_ga_dashboard/app/controllers/keppler_ga_dashboard/admin/dashboard_controller.rb +64 -0
- data/installer/core/rockets/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/admin/dashboard_helper.rb +16 -0
- data/installer/core/rockets/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/application_helper.rb +4 -1
- data/installer/core/rockets/keppler_ga_dashboard/app/views/keppler_ga_dashboard/{dashboard → admin/dashboard}/analytics.html.haml +0 -0
- data/installer/core/rockets/keppler_ga_dashboard/config/routes.rb +1 -1
- data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/create_view_spec.rb +0 -0
- data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/editor_spec.rb +0 -0
- data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/live_editor_save_spec.rb +0 -0
- data/installer/core/spec/fixtures/keppler_frontend/editor/test.html +0 -0
- data/installer/core/spec/fixtures/keppler_frontend/editor/test.png +0 -0
- data/installer/core/spec/fixtures/keppler_frontend/live_editor/test_index_1.html +0 -0
- data/installer/core/spec/fixtures/keppler_frontend/live_editor/test_index_2.html +0 -0
- data/installer/core/spec/models/keppler_frontend/view/live_editor_spec.rb +1 -0
- data/installer/core/spec/models/keppler_frontend/view/model_spec.rb +0 -0
- data/installer/core/spec/models/keppler_frontend/view/view_files_handler_spec.rb +0 -0
- data/installer/core/spec/models/user_spec.rb +0 -2
- data/installer/core/spec/routing/keppler_frontend/views_spec.rb +1 -0
- data/installer/core/spec/services/keppler_frontend/editor/file_format_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/editor/resources_format_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/editor/resources_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/urls/assets_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/urls/config_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/urls/front_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/urls/roots_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/utils/code_search_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/utils/file_format_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/utils/yml_handle_spec.rb +2 -0
- data/installer/core/spec/services/keppler_frontend/views/actions_handler_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/css_handler_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/format_html_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/format_remote_js_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/fromat_only_action_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/html_handler_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/js_handler_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/remote_js_handler_spec.rb +0 -0
- data/installer/core/spec/services/keppler_frontend/views/routes_handler_spec.rb +0 -0
- data/installer/core/vendor/cache/autoprefixer-rails-9.3.1.gem +0 -0
- data/installer/core/vendor/cache/bootsnap-1.3.2.gem +0 -0
- data/installer/core/vendor/cache/factory_bot-4.11.1.gem +0 -0
- data/installer/core/vendor/cache/factory_bot_rails-4.11.1.gem +0 -0
- data/installer/core/vendor/cache/faraday-0.15.3.gem +0 -0
- data/installer/core/vendor/cache/ffi-1.9.25.gem +0 -0
- data/installer/core/vendor/cache/i18n-1.1.1.gem +0 -0
- data/installer/core/vendor/cache/image_optimizer-1.8.0.gem +0 -0
- data/installer/core/vendor/cache/loofah-2.2.3.gem +0 -0
- data/installer/core/vendor/cache/mail-2.7.1.gem +0 -0
- data/installer/core/vendor/cache/marcel-0.3.3.gem +0 -0
- data/installer/core/vendor/cache/mime-types-3.2.2.gem +0 -0
- data/installer/core/vendor/cache/mime-types-data-3.2018.0812.gem +0 -0
- data/installer/core/vendor/cache/mini_mime-1.0.1.gem +0 -0
- data/installer/core/vendor/cache/money-6.13.1.gem +0 -0
- data/installer/core/vendor/cache/nokogiri-1.8.5.gem +0 -0
- data/installer/core/vendor/cache/parser-2.5.3.0.gem +0 -0
- data/installer/core/vendor/cache/powerpack-0.1.2.gem +0 -0
- data/installer/core/vendor/cache/public_suffix-3.0.3.gem +0 -0
- data/installer/core/vendor/cache/puma-3.12.0.gem +0 -0
- data/installer/core/vendor/cache/rack-test-1.1.0.gem +0 -0
- data/installer/core/vendor/cache/rails-assets-animate-css-3.7.0.gem +0 -0
- data/installer/core/vendor/cache/retriable-3.1.2.gem +0 -0
- data/installer/core/vendor/cache/rspec-expectations-3.8.2.gem +0 -0
- data/installer/core/vendor/cache/rspec-rails-3.8.1.gem +0 -0
- data/installer/core/vendor/cache/ruby-progressbar-1.10.0.gem +0 -0
- data/installer/core/vendor/cache/sass-3.6.0.gem +0 -0
- data/installer/core/vendor/cache/scss_lint-0.57.1.gem +0 -0
- data/installer/core/vendor/cache/signet-0.11.0.gem +0 -0
- data/installer/core/vendor/cache/spreadsheet-1.1.8.gem +0 -0
- data/installer/core/vendor/cache/sprockets-3.7.2.gem +0 -0
- data/installer/core/vendor/cache/turbolinks-source-5.2.0.gem +0 -0
- data/installer/core/vendor/cache/unicode-display_width-1.4.0.gem +0 -0
- data/installer/core/vendor/cache/web-console-3.7.0.gem +0 -0
- data/lib/keppler/cli.rb +1 -1
- data/lib/keppler/version.rb +1 -1
- metadata +11 -2993
- data/LICENSE.txt +0 -21
- data/installer/core/app/controllers/admin/customizes_controller.rb +0 -110
- data/installer/core/app/helpers/customizes_helper.rb +0 -5
- data/installer/core/app/models/customize.rb +0 -30
- data/installer/core/app/policies/customize_policy.rb +0 -11
- data/installer/core/app/services/admin/template_service.rb +0 -129
- data/installer/core/app/views/admin/customizes/_description.html.haml +0 -13
- data/installer/core/app/views/admin/customizes/_form.html.haml +0 -33
- data/installer/core/app/views/admin/customizes/_listing.html.haml +0 -15
- data/installer/core/app/views/admin/customizes/_switch_default_template.html.haml +0 -11
- data/installer/core/app/views/admin/customizes/_switch_template.html.haml +0 -19
- data/installer/core/app/views/admin/customizes/index.html.haml +0 -38
- data/installer/core/app/views/admin/customizes/new.html.haml +0 -4
- data/installer/core/db/migrate/20170603145521_create_customizes.rb +0 -10
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-accordion.html +0 -56
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-alert.html +0 -18
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-button-group.html +0 -15
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-button.html +0 -15
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-checks.html +0 -23
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-collapse.html +0 -23
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-12.html +0 -59
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-2.html +0 -29
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-3.html +0 -32
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-4.html +0 -35
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-6.html +0 -41
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-container.html +0 -15
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-dropdown-btn.html +0 -22
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-form.html +0 -33
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-jumbotron.html +0 -25
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-label.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-list-group.html +0 -22
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-modal.html +0 -32
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-navbar.html +0 -71
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-pagination.html +0 -31
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-panel-table.html +0 -48
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-panel.html +0 -19
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-progress-bar.html +0 -17
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-radio.html +0 -23
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-table.html +0 -42
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-tabs.html +0 -34
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-textarea.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-thumbnail.html +0 -23
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-well.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/btsp-input.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-blur-parallax.html +0 -59
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-blur.html +0 -58
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-parallax.html +0 -49
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-static.html +0 -48
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-video.html +0 -54
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-block.html +0 -15
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h1.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h2.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h3.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h4.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-small.html +0 -13
- data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/slick/slick-basic.html +0 -43
- data/installer/core/rockets/keppler_ga_dashboard/app/controllers/keppler_ga_dashboard/dashboard_controller.rb +0 -64
- data/installer/core/rockets/keppler_ga_dashboard/app/helpers/keppler_ga_dashboard/dashboard_helper.rb +0 -14
- data/installer/core/spec/factories/customize.rb +0 -6
- data/installer/core/spec/models/customize_spec.rb +0 -23
@@ -46,7 +46,7 @@ $(document).on 'turbolinks:load', ->
|
|
46
46
|
$('.index-show').css 'right', -$('.index-show').outerWidth()
|
47
47
|
|
48
48
|
$('#open-historial').click ->
|
49
|
-
$('.
|
49
|
+
$('.control-sidebar').toggleClass 'control-sidebar-open'
|
50
50
|
|
51
51
|
searchButton()
|
52
52
|
return
|
@@ -10,6 +10,7 @@ module Admin
|
|
10
10
|
after_action :update_settings_yml, only: %i[create update destroy clone]
|
11
11
|
|
12
12
|
def edit
|
13
|
+
only_development if params[:config].eql?('appearance')
|
13
14
|
@social_medias = social_account_permit_attributes
|
14
15
|
@colors = social_account_colors
|
15
16
|
@languages = %w[en es]
|
@@ -38,6 +39,7 @@ module Admin
|
|
38
39
|
|
39
40
|
def change_locale
|
40
41
|
Appearance.first.update(language: params[:locale])
|
42
|
+
I18n.locale = Appearance.first.language
|
41
43
|
redirect_back fallback_location: admin_root_path
|
42
44
|
end
|
43
45
|
|
@@ -64,6 +66,8 @@ module Admin
|
|
64
66
|
end
|
65
67
|
|
66
68
|
def parsed_color
|
69
|
+
return if params[:color].nil?
|
70
|
+
|
67
71
|
if params[:color].include?('#') || params[:color].include?('rgb')
|
68
72
|
params[:color]
|
69
73
|
else
|
@@ -17,6 +17,7 @@ class ApplicationController < ActionController::Base
|
|
17
17
|
include PublicActivity::StoreController
|
18
18
|
helper KepplerLanguages::LanguagesHelper
|
19
19
|
helper KepplerCapsules::CapsulesHelper
|
20
|
+
helper KepplerGaDashboard::Admin::DashboardHelper
|
20
21
|
|
21
22
|
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
|
22
23
|
# rescue_from Faraday::ConnectionFailed do |error|
|
@@ -22,7 +22,7 @@
|
|
22
22
|
%ul.nav.navbar-nav.language-select
|
23
23
|
%li.dropdown.messages-menu
|
24
24
|
%a.dropdown-toggle.language-option{ 'aria-expanded' => 'false', 'data-toggle' => 'dropdown', :href => '#' }
|
25
|
-
= image_tag
|
25
|
+
= image_tag "admin/#{Appearance.first.language.eql?('es') ? 'es' : 'en'}.png", class: 'small-profile-img keppler-background'
|
26
26
|
%ul.dropdown-menu
|
27
27
|
%li.header= t('keppler.language.select_lang')
|
28
28
|
%li
|
@@ -66,7 +66,7 @@
|
|
66
66
|
ev.preventDefault();
|
67
67
|
swal({
|
68
68
|
html: '<h1 class="modal-h1">Keppler <span>Admin</span></h1><div class="modal-info">' +
|
69
|
-
'<span> v 2.1.
|
69
|
+
'<span> v 2.1.12 </span>' +
|
70
70
|
"<span>#{t('keppler.release_date')}: 25/10/2018</span>" +
|
71
71
|
'<span>Ruby on Rails v 5.2.1</span>' +
|
72
72
|
'<ul class= "modal-social">' +
|
@@ -9,7 +9,7 @@
|
|
9
9
|
%section.content-actions
|
10
10
|
.toolbar
|
11
11
|
.toolbar-item
|
12
|
-
= link_to reload_admin_scripts_path, class: 'tool-btn', remote: true, title: '
|
12
|
+
= link_to reload_admin_scripts_path, class: 'tool-btn', remote: true, title: t('keppler.actions.reload_page') do
|
13
13
|
%i.icon-reload
|
14
14
|
- if can?(Script).download?
|
15
15
|
%li.toolbar-item.dropdown
|
@@ -1,3 +1,4 @@
|
|
1
|
+
%script{:async => "", :src => "https://www.googletagmanager.com/gtag/js?id=UA-121648466-1"}
|
1
2
|
- if Rails.env.production? && @setting.google_analytics_setting.ga_status
|
2
3
|
- if Script.get_script(request)
|
3
4
|
- tracking = Script.get_script(request).script
|
@@ -5,10 +6,8 @@
|
|
5
6
|
- tracking = @setting.google_analytics_setting.ga_tracking_id
|
6
7
|
|
7
8
|
:javascript
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
9
|
+
window.dataLayer = window.dataLayer || [];
|
10
|
+
function gtag(){dataLayer.push(arguments);}
|
11
|
+
gtag('js', new Date());
|
12
12
|
|
13
|
-
|
14
|
-
ga('send', 'pageview');
|
13
|
+
gtag('config', "#{tracking}");
|
@@ -23,7 +23,7 @@ development:
|
|
23
23
|
ga_auth:
|
24
24
|
:service_account_email_address: 911375046727-9n50de61u7flmue7s76qelsthlhqhnnl@developer.gserviceaccount.com
|
25
25
|
:file_key_name: gauth_key.p12
|
26
|
-
:account_id:
|
26
|
+
:account_id: 121648466
|
27
27
|
|
28
28
|
test:
|
29
29
|
domain_name: example.com
|
@@ -48,4 +48,4 @@ production:
|
|
48
48
|
ga_auth:
|
49
49
|
:service_account_email_address: 911375046727-9n50de61u7flmue7s76qelsthlhqhnnl@developer.gserviceaccount.com
|
50
50
|
:file_key_name: gauth_key.p12
|
51
|
-
:account_id:
|
51
|
+
:account_id: 121648466
|
@@ -195,7 +195,10 @@ en:
|
|
195
195
|
appearance_defaut: Set default
|
196
196
|
apply: Apply
|
197
197
|
drop_file: Drop a file or press here
|
198
|
+
drop_files: Drop some files or press here
|
198
199
|
reload_page: Reload page
|
200
|
+
download_records: Download records
|
201
|
+
upload_records: Upload records
|
199
202
|
download:
|
200
203
|
csv: Download CSV
|
201
204
|
xls: Download XLS
|
@@ -98,14 +98,6 @@ Rails.application.routes.draw do
|
|
98
98
|
)
|
99
99
|
end
|
100
100
|
|
101
|
-
# resources :customizes do
|
102
|
-
# get '(page/:page)', action: :index, on: :collection, as: ''
|
103
|
-
# get '/clone', action: 'clone'
|
104
|
-
# post '/upload', action: 'upload', as: :upload
|
105
|
-
# post '/install_default', action: 'install_default'
|
106
|
-
# end
|
107
|
-
|
108
|
-
|
109
101
|
resources :users do
|
110
102
|
get '(page/:page)', action: :index, on: :collection, as: ''
|
111
103
|
get '/delete_avatar', action: :delete_avatar
|
data/installer/core/db/seeds.rb
CHANGED
@@ -10,10 +10,9 @@
|
|
10
10
|
# user = CreateAdminService.new.call
|
11
11
|
# puts 'CREATED ADMIN USER: ' << user.email
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
13
|
+
Role.create name: 'keppler_admin'
|
14
|
+
puts 'Role Keppler Admin has been created'
|
15
|
+
|
17
16
|
|
18
17
|
User.create(
|
19
18
|
name: 'Keppler Admin', email: 'admin@keppleradmin.com', password: '+12345678+',
|
@@ -22,8 +21,6 @@ User.create(
|
|
22
21
|
|
23
22
|
puts 'admin@keppler.io has been created'
|
24
23
|
|
25
|
-
Customize.create(file: '', installed: true)
|
26
|
-
puts 'Keppler Template has been created'
|
27
24
|
|
28
25
|
# Create setting deafult
|
29
26
|
if yml = YAML.load_file("#{Rails.root}/config/settings.yml")
|
@@ -75,8 +72,8 @@ else
|
|
75
72
|
email: 'info@keppler.com', password: '12345678'
|
76
73
|
},
|
77
74
|
google_analytics_setting_attributes: {
|
78
|
-
ga_account_id: '
|
79
|
-
ga_tracking_id: 'UA-
|
75
|
+
ga_account_id: '121648466',
|
76
|
+
ga_tracking_id: 'UA-121648466-1',
|
80
77
|
ga_status: true
|
81
78
|
}
|
82
79
|
)
|
@@ -153,5 +150,5 @@ if defined?(KepplerFrontend) && KepplerFrontend.is_a?(Module)
|
|
153
150
|
function_id: param['function_id']
|
154
151
|
)
|
155
152
|
end
|
156
|
-
puts '
|
153
|
+
puts 'Frontend functions has been created'
|
157
154
|
end
|
data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/conf
ADDED
File without changes
|
File without changes
|
data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/conf
ADDED
File without changes
|
File without changes
|
@@ -0,0 +1,1174 @@
|
|
1
|
+
var extrasEditor = {
|
2
|
+
buildHtml: function(html) {
|
3
|
+
var sections = ""
|
4
|
+
var sectionsPermit = ['keppler-header', 'keppler-view', 'keppler-footer']
|
5
|
+
for(var i=0; i < html.length; i++) {
|
6
|
+
if(sectionsPermit.includes(html[i].localName)) {
|
7
|
+
var noEditIds = this.getNoEditIdsEditor(html[i]);
|
8
|
+
for(var j=0; j < noEditIds.length; j++) {
|
9
|
+
$(html[i]).find('#'+noEditIds[j]).replaceWith(function () {
|
10
|
+
return $('<keppler-no-edit/>', {
|
11
|
+
id: noEditIds[j],
|
12
|
+
html: this.innerHTML
|
13
|
+
});
|
14
|
+
});
|
15
|
+
}
|
16
|
+
sections = sections+processHtml(html[i].outerHTML)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
return sections
|
20
|
+
},
|
21
|
+
|
22
|
+
getNoEditIdsEditor : function(section) {
|
23
|
+
var nodes = section.querySelectorAll(".no-edit-area");
|
24
|
+
var noEditIds = [];
|
25
|
+
for(var i=0; i < nodes.length; i++) {
|
26
|
+
noEditIds.push(nodes[i].id)
|
27
|
+
}
|
28
|
+
return noEditIds
|
29
|
+
},
|
30
|
+
|
31
|
+
getNoEditIds: function(){
|
32
|
+
var nodes = document.querySelectorAll(".no-edit-area");
|
33
|
+
var noEditIds = [];
|
34
|
+
for(var i=0; i < nodes.length; i++) {
|
35
|
+
noEditIds.push(nodes[i].id)
|
36
|
+
}
|
37
|
+
return noEditIds
|
38
|
+
},
|
39
|
+
|
40
|
+
createNoEditAreaEditor: function(){
|
41
|
+
$('keppler-no-edit').addClass('no-edit-area');
|
42
|
+
noEditIds = this.getNoEditIds();
|
43
|
+
var $kepplerNoEdit = $("keppler-no-edit");
|
44
|
+
$kepplerNoEdit.replaceWith(function () {
|
45
|
+
return $('<div/>', {
|
46
|
+
class: 'no-edit-area',
|
47
|
+
html: this.innerHTML
|
48
|
+
});
|
49
|
+
});
|
50
|
+
var nodes = document.querySelectorAll(".no-edit-area");
|
51
|
+
for(var i=0; i < nodes.length; i++) {
|
52
|
+
nodes[i].id = noEditIds[i];
|
53
|
+
}
|
54
|
+
},
|
55
|
+
|
56
|
+
getIfNotArea: function(some) {
|
57
|
+
var sections = ["keppler-header", "keppler-view", "keppler-footer"]
|
58
|
+
var includeKepplerLabel = false;
|
59
|
+
for(var i=0; i < some.path.length; i++) {
|
60
|
+
var label = $(some.path[i])[0].id;
|
61
|
+
if(sections.includes(label)) {
|
62
|
+
includeKepplerLabel = true
|
63
|
+
}
|
64
|
+
}
|
65
|
+
return includeKepplerLabel;
|
66
|
+
},
|
67
|
+
|
68
|
+
createAreas: function() {
|
69
|
+
var sections = ['keppler-header', 'keppler-view', 'keppler-footer']
|
70
|
+
|
71
|
+
for(var i=0; i < sections.length; i++) {
|
72
|
+
$(sections[i]).replaceWith(function () {
|
73
|
+
return $('<div/>', {
|
74
|
+
id: sections[i],
|
75
|
+
html: this.innerHTML
|
76
|
+
});
|
77
|
+
});
|
78
|
+
}
|
79
|
+
},
|
80
|
+
|
81
|
+
deleteAreas: function(html, view_name) {
|
82
|
+
var html = $(html);
|
83
|
+
var sections = ['keppler-header', 'keppler-view', 'keppler-footer']
|
84
|
+
var result = [];
|
85
|
+
for(var i=0; i < html.length; i++) {
|
86
|
+
if(sections.includes(html[i].id)) {
|
87
|
+
var el = document.createElement(html[i].id)
|
88
|
+
el.innerHTML = html[i].innerHTML
|
89
|
+
if (html[i].id==="keppler-view") {
|
90
|
+
el.id = view_name;
|
91
|
+
}
|
92
|
+
result.push(el)
|
93
|
+
}
|
94
|
+
}
|
95
|
+
return result;
|
96
|
+
},
|
97
|
+
|
98
|
+
}
|
99
|
+
|
100
|
+
|
101
|
+
$(document).ready(function(){
|
102
|
+
//grapesjs.plugins.add('testplug', (editor, config) => {});
|
103
|
+
var blkStyle = '.blk-row::after{ content: ""; clear: both; display: block;} .blk-row{padding: 10px;}';
|
104
|
+
var sectors = [{
|
105
|
+
name: 'General',
|
106
|
+
open: false,
|
107
|
+
buildProps: ['float', 'display', 'z-index', 'position', 'top', 'right', 'left', 'bottom'],
|
108
|
+
properties: [{
|
109
|
+
id: 'z-index',
|
110
|
+
type: 'integer',
|
111
|
+
name: 'Position index',
|
112
|
+
property: 'z-index',
|
113
|
+
defaults: 0
|
114
|
+
},{
|
115
|
+
type: 'select',
|
116
|
+
property: 'list-style-type',
|
117
|
+
default: 'none',
|
118
|
+
list : [
|
119
|
+
{value: 'none', name: 'None'},
|
120
|
+
{value: 'circle', name: 'Circle'},
|
121
|
+
{value: 'disc', name: 'Disc'},
|
122
|
+
{value: 'square', name: 'Square'},
|
123
|
+
{value: 'decimal', name: 'Decimal'},
|
124
|
+
{value: 'decimal-leading-zero ', name: 'Decimal leading zero '},
|
125
|
+
{value: 'lower-alpha', name: 'Lower alpha'},
|
126
|
+
{value: 'upper-alpha', name: 'Upper alpha'},
|
127
|
+
{value: 'lower-greek', name: 'Lower greek'},
|
128
|
+
{value: 'lower-latin', name: 'Lower latin'},
|
129
|
+
{value: 'upper-latin', name: 'Upper latin'},
|
130
|
+
{value: 'lower-roman', name: 'Lower roman'},
|
131
|
+
{value: 'upper-roman', name: 'Upper roman'},
|
132
|
+
{value: 'armenian', name: 'Armenian'},
|
133
|
+
{value: 'georgian', name: 'Georgian'},
|
134
|
+
{value: 'cjk-ideographic', name: 'Cjk ideographic'},
|
135
|
+
{value: 'hiragana', name: 'Hiragana'},
|
136
|
+
{value: 'katakana', name: 'Katakana'},
|
137
|
+
{value: 'hiragana-iroha', name: 'Hiragana iroha'},
|
138
|
+
{value: 'katakana-iroha', name: 'Katakana iroha'},
|
139
|
+
],
|
140
|
+
}, {
|
141
|
+
property: 'list-style-position',
|
142
|
+
type: 'radio',
|
143
|
+
list : [
|
144
|
+
{value: 'inside', name: 'Inside'},
|
145
|
+
{value: 'outside', name: 'Outside'}
|
146
|
+
],
|
147
|
+
}, {
|
148
|
+
property: 'cursor',
|
149
|
+
type: 'select',
|
150
|
+
defaults: 'auto',
|
151
|
+
list : [
|
152
|
+
{value: 'auto', name: 'Auto'},
|
153
|
+
{value: 'crosshair', name: 'Crosshair'},
|
154
|
+
{value: 'default', name: 'Default'},
|
155
|
+
{value: 'help', name: 'Help'},
|
156
|
+
{value: 'move', name: 'Move'},
|
157
|
+
{value: 'progress', name: 'Progress'},
|
158
|
+
{value: 'pointer', name: 'Pointer'},
|
159
|
+
{value: 'n-resize', name: 'N-resize'},
|
160
|
+
{value: 'ne-resize ', name: 'Ne-resize '},
|
161
|
+
{value: 'e-resize', name: 'E-resize'},
|
162
|
+
{value: 'se-resize', name: 'Se-resize'},
|
163
|
+
{value: 's-resize', name: 'S-resize'},
|
164
|
+
{value: 'sw-resize', name: 'Sw-resize'},
|
165
|
+
{value: 'w-resize', name: 'W-resize'},
|
166
|
+
{value: 'nw-resize', name: 'Nw-resize'},
|
167
|
+
{value: 'text', name: 'Text'},
|
168
|
+
{value: 'wait', name: 'Wait'},
|
169
|
+
],
|
170
|
+
}, {
|
171
|
+
property: 'overflow',
|
172
|
+
type: 'select',
|
173
|
+
defaults: 'auto',
|
174
|
+
list : [
|
175
|
+
{value: 'auto', name: 'Auto'},
|
176
|
+
{value: 'hidden', name: 'Hidden'},
|
177
|
+
{value: 'visible', name: 'Visible'},
|
178
|
+
{value: 'scroll', name: 'Scroll'},
|
179
|
+
{value: 'initial', name: 'Initial'},
|
180
|
+
{value: 'inherit', name: 'Inherit'},
|
181
|
+
|
182
|
+
],
|
183
|
+
}, {
|
184
|
+
property: 'overflow-x',
|
185
|
+
type: 'select',
|
186
|
+
defaults: 'auto',
|
187
|
+
list : [
|
188
|
+
{value: 'auto', name: 'Auto'},
|
189
|
+
{value: 'hidden', name: 'Hidden'},
|
190
|
+
{value: 'visible', name: 'Visible'},
|
191
|
+
{value: 'scroll', name: 'Scroll'},
|
192
|
+
{value: 'initial', name: 'Initial'},
|
193
|
+
{value: 'inherit', name: 'Inherit'},
|
194
|
+
|
195
|
+
],
|
196
|
+
}, {
|
197
|
+
property: 'overflow-y',
|
198
|
+
type: 'select',
|
199
|
+
defaults: 'auto',
|
200
|
+
list : [
|
201
|
+
{value: 'auto', name: 'Auto'},
|
202
|
+
{value: 'hidden', name: 'Hidden'},
|
203
|
+
{value: 'visible', name: 'Visible'},
|
204
|
+
{value: 'scroll', name: 'Scroll'},
|
205
|
+
{value: 'initial', name: 'Initial'},
|
206
|
+
{value: 'inherit', name: 'Inherit'},
|
207
|
+
|
208
|
+
],
|
209
|
+
}]
|
210
|
+
},{
|
211
|
+
name: 'Dimension',
|
212
|
+
open: false,
|
213
|
+
buildProps: [ 'width', 'flex-width', 'height', 'min-width', 'max-width', 'min-height', 'max-height',
|
214
|
+
'padding','margin'],
|
215
|
+
properties: [{
|
216
|
+
id: 'flex-width',
|
217
|
+
type: 'integer',
|
218
|
+
name: 'Width',
|
219
|
+
units: ['px', '%', 'rem', 'em'],
|
220
|
+
property: 'flex-basis',
|
221
|
+
toRequire: 1,
|
222
|
+
},
|
223
|
+
{
|
224
|
+
id: 'width',
|
225
|
+
type: 'integer',
|
226
|
+
name: 'Width',
|
227
|
+
units: ['px', '%', 'rem', 'em'],
|
228
|
+
property: 'width'
|
229
|
+
},
|
230
|
+
{
|
231
|
+
id: 'height',
|
232
|
+
type: 'integer',
|
233
|
+
name: 'Height',
|
234
|
+
units: ['px', '%', 'rem', 'em'],
|
235
|
+
property: 'height'
|
236
|
+
},
|
237
|
+
{
|
238
|
+
id: 'min-width',
|
239
|
+
type: 'integer',
|
240
|
+
name: 'Min width',
|
241
|
+
units: ['px', '%', 'rem', 'em'],
|
242
|
+
property: 'min-width'
|
243
|
+
},
|
244
|
+
{
|
245
|
+
id: 'max-width',
|
246
|
+
type: 'integer',
|
247
|
+
name: 'Max width',
|
248
|
+
units: ['px', '%', 'rem', 'em'],
|
249
|
+
property: 'max-width'
|
250
|
+
},
|
251
|
+
{
|
252
|
+
id: 'min-height',
|
253
|
+
type: 'integer',
|
254
|
+
name: 'Min height',
|
255
|
+
units: ['px', '%', 'rem', 'em'],
|
256
|
+
property: 'min-height'
|
257
|
+
},
|
258
|
+
{
|
259
|
+
id: 'max-height',
|
260
|
+
type: 'integer',
|
261
|
+
name: 'Max height',
|
262
|
+
units: ['px', '%', 'rem', 'em'],
|
263
|
+
property: 'max-height'
|
264
|
+
},
|
265
|
+
{
|
266
|
+
name : 'Padding',
|
267
|
+
property : 'padding',
|
268
|
+
type : 'composite',
|
269
|
+
properties : [
|
270
|
+
{
|
271
|
+
id: 'padding-top',
|
272
|
+
type: 'integer',
|
273
|
+
name: 'Top',
|
274
|
+
units: ['px', '%', 'rem', 'em'],
|
275
|
+
property: 'padding-top',
|
276
|
+
defaults: 0
|
277
|
+
},
|
278
|
+
{
|
279
|
+
id: 'padding-right',
|
280
|
+
type: 'integer',
|
281
|
+
name: 'Right',
|
282
|
+
units: ['px', '%', 'rem', 'em'],
|
283
|
+
property: 'padding-right',
|
284
|
+
defaults: 0
|
285
|
+
},
|
286
|
+
{
|
287
|
+
id: 'padding-left',
|
288
|
+
type: 'integer',
|
289
|
+
name: 'Left',
|
290
|
+
units: ['px', '%', 'rem', 'em'],
|
291
|
+
property: 'padding-left',
|
292
|
+
defaults: 0
|
293
|
+
},
|
294
|
+
{
|
295
|
+
id: 'padding-bottom',
|
296
|
+
type: 'integer',
|
297
|
+
name: 'Bottom',
|
298
|
+
units: ['px', '%', 'rem', 'em'],
|
299
|
+
property: 'padding-bottom',
|
300
|
+
defaults: 0
|
301
|
+
}
|
302
|
+
]
|
303
|
+
},
|
304
|
+
{
|
305
|
+
name : 'Margin',
|
306
|
+
property : 'margin',
|
307
|
+
type : 'composite',
|
308
|
+
properties : [
|
309
|
+
{
|
310
|
+
id: 'margin-top',
|
311
|
+
type: 'integer',
|
312
|
+
name: 'Top',
|
313
|
+
units: ['px', '%', 'rem', 'em'],
|
314
|
+
property: 'margin-top',
|
315
|
+
defaults: 0
|
316
|
+
},
|
317
|
+
{
|
318
|
+
id: 'margin-right',
|
319
|
+
type: 'integer',
|
320
|
+
name: 'Right',
|
321
|
+
units: ['px', '%', 'rem', 'em'],
|
322
|
+
property: 'margin-right',
|
323
|
+
defaults: 0
|
324
|
+
},
|
325
|
+
{
|
326
|
+
id: 'margin-left',
|
327
|
+
type: 'integer',
|
328
|
+
name: 'Left',
|
329
|
+
units: ['px', '%', 'rem', 'em'],
|
330
|
+
property: 'margin-left',
|
331
|
+
defaults: 0
|
332
|
+
},
|
333
|
+
{
|
334
|
+
id: 'margin-bottom',
|
335
|
+
type: 'integer',
|
336
|
+
name: 'Bottom',
|
337
|
+
units: ['px', '%', 'rem', 'em'],
|
338
|
+
property: 'margin-bottom',
|
339
|
+
defaults: 0
|
340
|
+
}
|
341
|
+
]
|
342
|
+
},
|
343
|
+
|
344
|
+
]
|
345
|
+
},{
|
346
|
+
name: 'Typography',
|
347
|
+
open: false,
|
348
|
+
buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height',
|
349
|
+
'text-indent', 'font-style', 'text-align', 'text-transform', 'text-decoration', 'text-shadow'],
|
350
|
+
properties: [{
|
351
|
+
property: 'text-align',
|
352
|
+
list : [
|
353
|
+
{value: 'left', className: 'fa fa-align-left'},
|
354
|
+
{value: 'center', className: 'fa fa-align-center' },
|
355
|
+
{value: 'right', className: 'fa fa-align-right'},
|
356
|
+
{value: 'justify', className: 'fa fa-align-justify'}
|
357
|
+
],
|
358
|
+
},
|
359
|
+
{
|
360
|
+
id: 'text-indent',
|
361
|
+
type: 'integer',
|
362
|
+
name: 'Text indent',
|
363
|
+
units: ['px', '%', 'rem', 'em'],
|
364
|
+
property: 'text-indent',
|
365
|
+
defaults: 0
|
366
|
+
},
|
367
|
+
{
|
368
|
+
property: 'font-style',
|
369
|
+
type: 'radio',
|
370
|
+
list : [
|
371
|
+
{value: 'normal', name: 'Normal'},
|
372
|
+
{value: 'italic', name: 'Italic'},
|
373
|
+
{value: 'oblique', name: 'Oblique'},
|
374
|
+
],
|
375
|
+
},
|
376
|
+
{
|
377
|
+
property: 'text-transform',
|
378
|
+
type: 'radio',
|
379
|
+
list : [
|
380
|
+
{value: 'lowercase', name: 'a'},
|
381
|
+
{value: 'uppercase', name: 'A'},
|
382
|
+
{value: 'capitalize', name: 'Aa'}
|
383
|
+
],
|
384
|
+
},
|
385
|
+
{
|
386
|
+
property: 'text-decoration',
|
387
|
+
type: 'radio',
|
388
|
+
list : [
|
389
|
+
{value: 'underline', className: 'fa fa-underline'},
|
390
|
+
{value: 'line-through', className: 'fa fa-strikethrough'}
|
391
|
+
],
|
392
|
+
},
|
393
|
+
{
|
394
|
+
property: 'font-family',
|
395
|
+
type: 'text',
|
396
|
+
// list : [
|
397
|
+
// { name: 'Arial', value: 'Arial, Helvetica, sans-serif' },
|
398
|
+
|
399
|
+
// ],
|
400
|
+
}
|
401
|
+
]
|
402
|
+
},
|
403
|
+
{
|
404
|
+
name: 'Background',
|
405
|
+
open: false,
|
406
|
+
buildProps: ['background-color', 'box-shadow', 'background'],
|
407
|
+
},{
|
408
|
+
name: 'Border',
|
409
|
+
open: false,
|
410
|
+
buildProps: ['border-radius-c', 'border-radius', 'border'],
|
411
|
+
properties: [
|
412
|
+
{
|
413
|
+
name : 'Border width',
|
414
|
+
property : 'border-width',
|
415
|
+
type : 'composite',
|
416
|
+
properties : [
|
417
|
+
{
|
418
|
+
id: 'border-top-width',
|
419
|
+
type: 'integer',
|
420
|
+
name: 'Border top',
|
421
|
+
units: ['px', '%', 'rem', 'em'],
|
422
|
+
property: 'border-top-width',
|
423
|
+
defaults: 0
|
424
|
+
},
|
425
|
+
{
|
426
|
+
id: 'border-right-width',
|
427
|
+
type: 'integer',
|
428
|
+
name: 'Border right',
|
429
|
+
units: ['px', '%', 'rem', 'em'],
|
430
|
+
property: 'border-right-width',
|
431
|
+
defaults: 0
|
432
|
+
},
|
433
|
+
{
|
434
|
+
id: 'border-bottom-width',
|
435
|
+
type: 'integer',
|
436
|
+
name: 'Border bottom',
|
437
|
+
units: ['px', '%', 'rem', 'em'],
|
438
|
+
property: 'border-bottom-width',
|
439
|
+
defaults: 0
|
440
|
+
},
|
441
|
+
{
|
442
|
+
id: 'border-left-width',
|
443
|
+
type: 'integer',
|
444
|
+
name: 'Border left',
|
445
|
+
units: ['px', '%', 'rem', 'em'],
|
446
|
+
property: 'border-left-width',
|
447
|
+
defaults: 0
|
448
|
+
}
|
449
|
+
]
|
450
|
+
},
|
451
|
+
]
|
452
|
+
},{
|
453
|
+
name: 'Extra',
|
454
|
+
open: false,
|
455
|
+
buildProps: ['opacity', 'filter', 'transition', 'perspective', 'transform'],
|
456
|
+
properties: [{
|
457
|
+
type: 'slider',
|
458
|
+
property: 'opacity',
|
459
|
+
defaults: 1,
|
460
|
+
step: 0.01,
|
461
|
+
max: 1,
|
462
|
+
min:0,
|
463
|
+
}]
|
464
|
+
},{
|
465
|
+
name: 'Flex',
|
466
|
+
open: false,
|
467
|
+
properties: [{
|
468
|
+
name : 'Flex Container',
|
469
|
+
property : 'display',
|
470
|
+
type : 'select',
|
471
|
+
defaults : 'block',
|
472
|
+
list : [{
|
473
|
+
value : 'block',
|
474
|
+
name : 'Disable',
|
475
|
+
},{
|
476
|
+
value : 'flex',
|
477
|
+
name : 'Enable',
|
478
|
+
}],
|
479
|
+
},{
|
480
|
+
name: 'Flex Parent',
|
481
|
+
property: 'label-parent-flex',
|
482
|
+
},{
|
483
|
+
name : 'Direction',
|
484
|
+
property : 'flex-direction',
|
485
|
+
type : 'radio',
|
486
|
+
defaults : 'row',
|
487
|
+
list : [{
|
488
|
+
value : 'row',
|
489
|
+
name : 'Row',
|
490
|
+
className : 'icons-flex icon-dir-row',
|
491
|
+
title : 'Row',
|
492
|
+
},{
|
493
|
+
value : 'row-reverse',
|
494
|
+
name : 'Row reverse',
|
495
|
+
className : 'icons-flex icon-dir-row-rev',
|
496
|
+
title : 'Row reverse',
|
497
|
+
},{
|
498
|
+
value : 'column',
|
499
|
+
name : 'Column',
|
500
|
+
title : 'Column',
|
501
|
+
className : 'icons-flex icon-dir-col',
|
502
|
+
},{
|
503
|
+
value : 'column-reverse',
|
504
|
+
name : 'Column reverse',
|
505
|
+
title : 'Column reverse',
|
506
|
+
className : 'icons-flex icon-dir-col-rev',
|
507
|
+
}],
|
508
|
+
},{
|
509
|
+
name : 'Wrap',
|
510
|
+
property : 'flex-wrap',
|
511
|
+
type : 'radio',
|
512
|
+
defaults : 'nowrap',
|
513
|
+
list : [{
|
514
|
+
value : 'nowrap',
|
515
|
+
title : 'Single line',
|
516
|
+
},{
|
517
|
+
value : 'wrap',
|
518
|
+
title : 'Multiple lines',
|
519
|
+
},{
|
520
|
+
value : 'wrap-reverse',
|
521
|
+
title : 'Multiple lines reverse',
|
522
|
+
}],
|
523
|
+
},{
|
524
|
+
name : 'Justify',
|
525
|
+
property : 'justify-content',
|
526
|
+
type : 'radio',
|
527
|
+
defaults : 'flex-start',
|
528
|
+
list : [{
|
529
|
+
value : 'flex-start',
|
530
|
+
className : 'icons-flex icon-just-start',
|
531
|
+
title : 'Start',
|
532
|
+
},{
|
533
|
+
value : 'flex-end',
|
534
|
+
title : 'End',
|
535
|
+
className : 'icons-flex icon-just-end',
|
536
|
+
},{
|
537
|
+
value : 'space-between',
|
538
|
+
title : 'Space between',
|
539
|
+
className : 'icons-flex icon-just-sp-bet',
|
540
|
+
},{
|
541
|
+
value : 'space-around',
|
542
|
+
title : 'Space around',
|
543
|
+
className : 'icons-flex icon-just-sp-ar',
|
544
|
+
},{
|
545
|
+
value : 'center',
|
546
|
+
title : 'Center',
|
547
|
+
className : 'icons-flex icon-just-sp-cent',
|
548
|
+
}],
|
549
|
+
},{
|
550
|
+
name : 'Align',
|
551
|
+
property : 'align-items',
|
552
|
+
type : 'radio',
|
553
|
+
defaults : 'center',
|
554
|
+
list : [{
|
555
|
+
value : 'flex-start',
|
556
|
+
title : 'Start',
|
557
|
+
className : 'icons-flex icon-al-start',
|
558
|
+
},{
|
559
|
+
value : 'flex-end',
|
560
|
+
title : 'End',
|
561
|
+
className : 'icons-flex icon-al-end',
|
562
|
+
},{
|
563
|
+
value : 'stretch',
|
564
|
+
title : 'Stretch',
|
565
|
+
className : 'icons-flex icon-al-str',
|
566
|
+
},{
|
567
|
+
value : 'center',
|
568
|
+
title : 'Center',
|
569
|
+
className : 'icons-flex icon-al-center',
|
570
|
+
}],
|
571
|
+
},{
|
572
|
+
name: 'Flex Children',
|
573
|
+
property: 'label-parent-flex',
|
574
|
+
},{
|
575
|
+
name: 'Order',
|
576
|
+
property: 'order',
|
577
|
+
type: 'integer',
|
578
|
+
defaults : 0,
|
579
|
+
min: 0
|
580
|
+
},{
|
581
|
+
name : 'Flex',
|
582
|
+
property : 'flex',
|
583
|
+
type : 'composite',
|
584
|
+
properties : [{
|
585
|
+
name: 'Grow',
|
586
|
+
property: 'flex-grow',
|
587
|
+
type: 'integer',
|
588
|
+
defaults : 0,
|
589
|
+
min: 0
|
590
|
+
},{
|
591
|
+
name: 'Shrink',
|
592
|
+
property: 'flex-shrink',
|
593
|
+
type: 'integer',
|
594
|
+
defaults : 0,
|
595
|
+
min: 0
|
596
|
+
},{
|
597
|
+
name: 'Basis',
|
598
|
+
property: 'flex-basis',
|
599
|
+
type: 'integer',
|
600
|
+
units: ['px','%',''],
|
601
|
+
unit: '',
|
602
|
+
defaults : 'auto',
|
603
|
+
}],
|
604
|
+
},{
|
605
|
+
name : 'Align',
|
606
|
+
property : 'align-self',
|
607
|
+
type : 'radio',
|
608
|
+
defaults : 'auto',
|
609
|
+
list : [{
|
610
|
+
value : 'auto',
|
611
|
+
name : 'Auto',
|
612
|
+
},{
|
613
|
+
value : 'flex-start',
|
614
|
+
title : 'Start',
|
615
|
+
label: 'Start',
|
616
|
+
className : 'icons-flex icon-al-start',
|
617
|
+
},{
|
618
|
+
value : 'flex-end',
|
619
|
+
title : 'End',
|
620
|
+
className : 'icons-flex icon-al-end',
|
621
|
+
},{
|
622
|
+
value : 'stretch',
|
623
|
+
title : 'Stretch',
|
624
|
+
className : 'icons-flex icon-al-str',
|
625
|
+
},{
|
626
|
+
value : 'center',
|
627
|
+
title : 'Center',
|
628
|
+
className : 'icons-flex icon-al-center',
|
629
|
+
}],
|
630
|
+
}]
|
631
|
+
}
|
632
|
+
|
633
|
+
];
|
634
|
+
|
635
|
+
|
636
|
+
var links = document.getElementsByTagName('link')
|
637
|
+
var styles = [];
|
638
|
+
for(var i=1; i < links.length; i++) {
|
639
|
+
styles.push(links[i].href)
|
640
|
+
}
|
641
|
+
|
642
|
+
var links = document.getElementsByTagName('script')
|
643
|
+
var scripts = [];
|
644
|
+
for(var i=0; i < links.length; i++) {
|
645
|
+
scripts.push(links[i].src)
|
646
|
+
}
|
647
|
+
|
648
|
+
try {
|
649
|
+
var css_style = gon.editor.css_style;
|
650
|
+
var images_assets = gon.editor.images_assets;
|
651
|
+
var view_id = gon.editor.view_id;
|
652
|
+
var view_name = gon.editor.view_name;
|
653
|
+
} catch (e) {
|
654
|
+
if (e instanceof SyntaxError) {
|
655
|
+
console.log(e.message);
|
656
|
+
}
|
657
|
+
}
|
658
|
+
|
659
|
+
var editor = grapesjs.init(
|
660
|
+
{
|
661
|
+
container: document.getElementById("keppler-editor"),
|
662
|
+
protectedCss: '',
|
663
|
+
style: css_style,
|
664
|
+
scripts: "function abr(){}",
|
665
|
+
canvas: {
|
666
|
+
styles: styles,
|
667
|
+
scripts: scripts
|
668
|
+
},
|
669
|
+
width: 'auto',
|
670
|
+
fromElement: true,
|
671
|
+
//
|
672
|
+
plugins: ['testplug', 'gjs-blocks-basic', 'grapesjs-custom-code', 'gjs-plugin-forms', 'grapesjs-lory-slider', 'gjs-component-countdown', 'gjs-style-gradient'],
|
673
|
+
pluginsOpts: {
|
674
|
+
'gjs-style-gradient': {
|
675
|
+
colorPicker: 'default',
|
676
|
+
grapickOpts: {
|
677
|
+
min: 1,
|
678
|
+
max: 99,
|
679
|
+
}
|
680
|
+
}
|
681
|
+
},
|
682
|
+
autorender: 0,
|
683
|
+
allowScripts: 1,
|
684
|
+
showOffsets: 1,
|
685
|
+
noticeOnUnload: 0,
|
686
|
+
avoidInlineStyle: 1,
|
687
|
+
avoidDefaults: 1,
|
688
|
+
// forceClass: 0,
|
689
|
+
storageManager: { autoload: 0 },
|
690
|
+
// storageManager: { type: 'firebase-firestore' },
|
691
|
+
layerManager: {
|
692
|
+
showWrapper: 0,
|
693
|
+
},
|
694
|
+
assetManager: {
|
695
|
+
upload: '/admin/frontend/assets/upload',
|
696
|
+
autoAdd: true,
|
697
|
+
assets: images_assets
|
698
|
+
},
|
699
|
+
|
700
|
+
styleManager : {
|
701
|
+
clearProperties: 1,
|
702
|
+
sectors: sectors,
|
703
|
+
},
|
704
|
+
|
705
|
+
});
|
706
|
+
|
707
|
+
|
708
|
+
window.editor = editor;
|
709
|
+
|
710
|
+
function saveCode() {
|
711
|
+
try {
|
712
|
+
var html = extrasEditor.deleteAreas(editor.getHtml(), view_name);
|
713
|
+
var html = extrasEditor.buildHtml(html);
|
714
|
+
var css = editor.getCss();
|
715
|
+
var css = cssbeautify(css, {
|
716
|
+
indent: ' ',
|
717
|
+
openbrace: 'separate-line',
|
718
|
+
autosemicolon: true
|
719
|
+
});
|
720
|
+
|
721
|
+
$.post("/admin/frontend/views/"+view_id+"/live_editor/save", {html: html, css: css}, function(data){
|
722
|
+
if(data.result) {
|
723
|
+
alert('Your code has been saved')
|
724
|
+
} else {
|
725
|
+
alert('Error when saving: Check that all is well')
|
726
|
+
}
|
727
|
+
})
|
728
|
+
} catch (e) {
|
729
|
+
alert('Error when saving: Check that all is well')
|
730
|
+
}
|
731
|
+
}
|
732
|
+
|
733
|
+
|
734
|
+
var toogleTools = false;
|
735
|
+
var pnm = editor.Panels;
|
736
|
+
|
737
|
+
pnm.addButton('commands', [
|
738
|
+
{
|
739
|
+
id: 'keppler-logo',
|
740
|
+
className: 'gjs-keppler-logo',
|
741
|
+
command: function(e) {},
|
742
|
+
}
|
743
|
+
]);
|
744
|
+
|
745
|
+
pnm.addButton('options', [{
|
746
|
+
id: 'undo',
|
747
|
+
className: 'fa fa-undo icon-undo',
|
748
|
+
title: 'Undo',
|
749
|
+
command: function(e) { return e.runCommand('core:undo') },
|
750
|
+
},{
|
751
|
+
id: 'redo',
|
752
|
+
title: 'Redo',
|
753
|
+
className: 'fa fa-repeat icon-redo',
|
754
|
+
command: function(e) { return e.runCommand('core:redo') },
|
755
|
+
},
|
756
|
+
{
|
757
|
+
id: 'refresh',
|
758
|
+
title: 'Refresh',
|
759
|
+
className: 'fa fa-refresh',
|
760
|
+
command(editor, sender) {
|
761
|
+
window.location.reload();
|
762
|
+
},
|
763
|
+
},
|
764
|
+
// {
|
765
|
+
// id: 'clear-all',
|
766
|
+
// className: 'fa fa-trash icon-blank',
|
767
|
+
// command: function(e) { return e.runCommand('core:canvas-clear') },
|
768
|
+
// },
|
769
|
+
{
|
770
|
+
id: 'save-code',
|
771
|
+
title: 'Save',
|
772
|
+
className: 'fa fa-save',
|
773
|
+
command(editor, sender) {
|
774
|
+
saveCode(editor, view_id);
|
775
|
+
},
|
776
|
+
}, {
|
777
|
+
id: 'exit',
|
778
|
+
title: 'Exit',
|
779
|
+
className: 'fa fa-sign-out',
|
780
|
+
command(editor, sender) {
|
781
|
+
var confirmation = confirm("Are you sure?");
|
782
|
+
if (confirmation===true) {
|
783
|
+
window.location.href = window.location.pathname
|
784
|
+
}
|
785
|
+
},
|
786
|
+
},
|
787
|
+
{
|
788
|
+
id: 'show-tools',
|
789
|
+
title: 'Open tools',
|
790
|
+
className: 'fa fa-bars',
|
791
|
+
command(editor, sender) {
|
792
|
+
if(toogleTools===false) {
|
793
|
+
$(".gjs-pn-views").removeClass('gsj-hide-tools').addClass('gsj-show-tools')
|
794
|
+
$(".gjs-pn-views-container").removeClass('gsj-hide-tools').addClass('gsj-show-tools')
|
795
|
+
$(".gjs-pn-options > .gjs-pn-buttons > .gjs-pn-btn.fa-bars ").removeClass('fa-bars').addClass('fa-times')
|
796
|
+
$('.gjs-cv-canvas').addClass('gjs-cv-canvas-width')
|
797
|
+
toogleTools=true
|
798
|
+
} else {
|
799
|
+
$(".gjs-pn-views").removeClass('gsj-show-tools').addClass('gsj-hide-tools')
|
800
|
+
$(".gjs-pn-views-container").removeClass('gsj-show-tools').addClass('gsj-hide-tools')
|
801
|
+
$(".gjs-pn-options > .gjs-pn-buttons > .gjs-pn-btn.fa-times ").removeClass('fa-times').addClass('fa-bars')
|
802
|
+
$('.gjs-cv-canvas').removeClass('gjs-cv-canvas-width')
|
803
|
+
toogleTools=false
|
804
|
+
}
|
805
|
+
},
|
806
|
+
}]);
|
807
|
+
|
808
|
+
|
809
|
+
editor.StyleManager.addProperty('Background', {
|
810
|
+
id: 'gradient',
|
811
|
+
name: 'Gradient',
|
812
|
+
property: 'background-image',
|
813
|
+
type: 'gradient',
|
814
|
+
defaults: 'none'
|
815
|
+
});
|
816
|
+
|
817
|
+
var codeButton = pnm.getButton("options", "fullscreen");
|
818
|
+
codeButton.collection.remove(codeButton);
|
819
|
+
// var codeButton = editor.Panels.getButton("options", "export-template");
|
820
|
+
// codeButton.collection.remove(codeButton);
|
821
|
+
|
822
|
+
var bm = editor.BlockManager;
|
823
|
+
var noArea = false;
|
824
|
+
|
825
|
+
|
826
|
+
|
827
|
+
editor.on('canvas:dragenter', (some, argument) => {
|
828
|
+
// do something
|
829
|
+
$(".gjs-pn-views").removeClass('gsj-show-tools').addClass('gsj-hide-tools')
|
830
|
+
$('.gjs-cv-canvas').removeClass('gjs-cv-canvas-width')
|
831
|
+
$(".gjs-pn-views-container").removeClass('gsj-show-tools').addClass('gsj-hide-tools')
|
832
|
+
$(".gjs-pn-options > .gjs-pn-buttons > .gjs-pn-btn.fa-bars ").removeClass('fa-times').addClass('fa-bars')
|
833
|
+
})
|
834
|
+
|
835
|
+
editor.on('canvas:dragend', (some, argument) => {
|
836
|
+
// do something
|
837
|
+
noArea = extrasEditor.getIfNotArea(some);
|
838
|
+
$('.gjs-cv-canvas').addClass('gjs-cv-canvas-width')
|
839
|
+
$(".gjs-pn-views").removeClass('gsj-hide-tools').addClass('gsj-show-tools')
|
840
|
+
$(".gjs-pn-views-container").removeClass('gsj-hide-tools').addClass('gsj-show-tools')
|
841
|
+
$(".gjs-pn-options > .gjs-pn-buttons > .gjs-pn-btn.fa-times ").removeClass('fa-bars').addClass('fa-times')
|
842
|
+
})
|
843
|
+
|
844
|
+
editor.on("block:drag:start", (some, argument) => {
|
845
|
+
var section = ['header', 'view', 'footer']
|
846
|
+
|
847
|
+
for(var i=0; i < section.length; i++) {
|
848
|
+
var el = $(".gjs-frame").contents().find("#keppler-"+section[i]);
|
849
|
+
$(el).addClass("keppler-"+section[i]+"-area")
|
850
|
+
}
|
851
|
+
})
|
852
|
+
|
853
|
+
|
854
|
+
editor.on("block:drag:stop", (some, argument) => {
|
855
|
+
var section = ['header', 'view', 'footer']
|
856
|
+
|
857
|
+
for(var i=0; i < section.length; i++) {
|
858
|
+
var el = $(".gjs-frame").contents().find("#keppler-"+section[i]);
|
859
|
+
$(el).removeClass("keppler-"+section[i]+"-area")
|
860
|
+
}
|
861
|
+
var el = $(some.view.$el[0]);
|
862
|
+
if (!noArea) {
|
863
|
+
el.remove();
|
864
|
+
}
|
865
|
+
})
|
866
|
+
|
867
|
+
|
868
|
+
bm.add('link', {
|
869
|
+
label: 'Link',
|
870
|
+
category: 'Basic',
|
871
|
+
attributes: {class:'fa fa-link'},
|
872
|
+
content: {
|
873
|
+
type:'link',
|
874
|
+
content:'Link',
|
875
|
+
style:{color: '#d983a6'}
|
876
|
+
}
|
877
|
+
});
|
878
|
+
|
879
|
+
bm.add('link-block', {
|
880
|
+
label: 'Link Block',
|
881
|
+
attributes: {class:'fa fa-link'},
|
882
|
+
category: 'Basic',
|
883
|
+
content: {
|
884
|
+
type:'link',
|
885
|
+
editable: false,
|
886
|
+
draggable: '#wrapper',
|
887
|
+
style:{
|
888
|
+
display: 'inline-block',
|
889
|
+
padding: '5px',
|
890
|
+
'min-height': '50px',
|
891
|
+
'min-width': '50px'
|
892
|
+
}
|
893
|
+
},
|
894
|
+
});
|
895
|
+
|
896
|
+
bm.add('image', {
|
897
|
+
label: 'Image',
|
898
|
+
category: 'Basic',
|
899
|
+
attributes: {class:'gjs-fonts gjs-f-image'},
|
900
|
+
content: {
|
901
|
+
style: {color: 'black'},
|
902
|
+
type:'image',
|
903
|
+
activeOnRender: 1
|
904
|
+
}
|
905
|
+
});
|
906
|
+
|
907
|
+
bm.add('video', {
|
908
|
+
label: 'Video',
|
909
|
+
category: 'Basic',
|
910
|
+
attributes: {class:'fa fa-youtube-play'},
|
911
|
+
content: {
|
912
|
+
type: 'video',
|
913
|
+
src: 'img/video2.webm',
|
914
|
+
style: {
|
915
|
+
height: '350px',
|
916
|
+
width: '615px',
|
917
|
+
}
|
918
|
+
}
|
919
|
+
});
|
920
|
+
|
921
|
+
bm.add('b1-2', {
|
922
|
+
label: 'Flex Columns',
|
923
|
+
category: 'Layouts',
|
924
|
+
attributes: { class:'gjs-fonts gjs-f-b1' },
|
925
|
+
content: `
|
926
|
+
<div class="row-flex" data-columns="1" style="text-align: center" data-gjs-droppable="[data-column]" data-gjs-highlightable="false" data-gjs-resizable='{"tl":0,"tc":0,"tr":0,"cl":0,"cr":0,"bl":0,"br":0}' data-gjs-custom-name="Row">
|
927
|
+
<div class="cell-flex" data-column="1" style="letter-spacing: normal; flex-basis: 100%" data-gjs-draggable="[data-columns]" data-gjs-resizable='{"tl":0,"tc":0,"tr":0,"cl":0,"bl":0,"br":0,"bc": 0, "keyWidth": "flex-basis", "currentUnit": 1, "minDim": 1, "maxDim": 100, "step": 0.2}' data-gjs-unstylable='["width"]' data-gjs-stylable-require='["flex-basis"]'></div>
|
928
|
+
<div class="cell-flex" data-column="1" style="letter-spacing: normal; flex-basis: 100%" data-gjs-draggable="[data-columns]" data-gjs-resizable='{"tl":0,"tc":0,"tr":0,"cl":0,"bl":0,"br":0,"bc": 0, "keyWidth": "flex-basis", "currentUnit": 1, "minDim": 1, "maxDim": 100, "step": 0.2}' data-gjs-unstylable='["width"]' data-gjs-stylable-require='["flex-basis"]'></div>
|
929
|
+
</div>
|
930
|
+
<style>
|
931
|
+
.row-flex {
|
932
|
+
display: flex;
|
933
|
+
justify-content: flex-start;
|
934
|
+
align-items: stretch;
|
935
|
+
flex-wrap: nowrap;
|
936
|
+
padding: 10px;
|
937
|
+
}
|
938
|
+
|
939
|
+
.cell-flex {
|
940
|
+
min-height: 75px;
|
941
|
+
flex-grow: 1;
|
942
|
+
flex-basis: 100%;
|
943
|
+
}
|
944
|
+
</style>
|
945
|
+
`
|
946
|
+
});
|
947
|
+
|
948
|
+
try {
|
949
|
+
for(var i=0; i < gon.editor.components.length; i++) {
|
950
|
+
var component = eval(gon.editor.components[i][0]);
|
951
|
+
if (component.length === 2) {
|
952
|
+
component[1].content.components = gon.editor.components[i][1]
|
953
|
+
bm.add(component[0], component[1]);
|
954
|
+
}
|
955
|
+
}
|
956
|
+
} catch (e) {
|
957
|
+
if (e instanceof SyntaxError) {
|
958
|
+
console.log(e.message);
|
959
|
+
}
|
960
|
+
}
|
961
|
+
|
962
|
+
bm.add('section', {
|
963
|
+
id: 'section',
|
964
|
+
label: 'Section',
|
965
|
+
attributes: {class:'fa fa-code'},
|
966
|
+
category: 'Layouts',
|
967
|
+
content: {
|
968
|
+
content:'<section>Section content</section>',
|
969
|
+
style: {padding: '10px' },
|
970
|
+
activeOnRender: 1
|
971
|
+
}
|
972
|
+
});
|
973
|
+
|
974
|
+
bm.add('text', {
|
975
|
+
id: 'text',
|
976
|
+
label: 'Text',
|
977
|
+
attributes: {class:'gjs-fonts gjs-f-text'},
|
978
|
+
category: 'Typography',
|
979
|
+
content: {
|
980
|
+
type:'text',
|
981
|
+
content:'Insert your text here',
|
982
|
+
style: {padding: '10px' },
|
983
|
+
activeOnRender: 1
|
984
|
+
},
|
985
|
+
});
|
986
|
+
|
987
|
+
bm.add('h1p', {
|
988
|
+
label: 'Text section',
|
989
|
+
category: 'Typography',
|
990
|
+
content: `<div>
|
991
|
+
<h1 class="heading">Insert title here</h1>
|
992
|
+
<p class="paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
|
993
|
+
</div>`,
|
994
|
+
attributes: {class:'gjs-fonts gjs-f-h1p'}
|
995
|
+
});
|
996
|
+
|
997
|
+
bm.add('quo', {
|
998
|
+
label: 'Quote',
|
999
|
+
category: 'Typography',
|
1000
|
+
content: '<blockquote class="quote">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit</blockquote>',
|
1001
|
+
attributes: {class:'fa fa-quote-right'}
|
1002
|
+
});
|
1003
|
+
|
1004
|
+
bm.add('map', {
|
1005
|
+
label: 'Map',
|
1006
|
+
category: 'Extra',
|
1007
|
+
attributes: {class:'fa fa-map-o'},
|
1008
|
+
content: {
|
1009
|
+
type: 'map',
|
1010
|
+
style: {height: '350px'}
|
1011
|
+
},
|
1012
|
+
});
|
1013
|
+
|
1014
|
+
// Store and load events
|
1015
|
+
editor.on('storage:load', function(e) {
|
1016
|
+
// console.log('LOAD ', e);
|
1017
|
+
});
|
1018
|
+
editor.on('storage:store', function(e) {
|
1019
|
+
// console.log('STORE ', e);
|
1020
|
+
});
|
1021
|
+
|
1022
|
+
var domComps = editor.DomComponents;
|
1023
|
+
var dType = domComps.getType('default');
|
1024
|
+
var dModel = dType.model;
|
1025
|
+
var dView = dType.view;
|
1026
|
+
|
1027
|
+
domComps.addType('input', {
|
1028
|
+
model: dModel.extend({
|
1029
|
+
defaults: Object.assign({}, dModel.prototype.defaults, {
|
1030
|
+
traits: [
|
1031
|
+
// strings are automatically converted to text types
|
1032
|
+
'name',
|
1033
|
+
'placeholder',
|
1034
|
+
{
|
1035
|
+
type: 'select',
|
1036
|
+
label: 'Type',
|
1037
|
+
name: 'type',
|
1038
|
+
options: [
|
1039
|
+
{value: 'text', name: 'Text'},
|
1040
|
+
{value: 'email', name: 'Email'},
|
1041
|
+
{value: 'password', name: 'Password'},
|
1042
|
+
{value: 'number', name: 'Number'},
|
1043
|
+
]
|
1044
|
+
}, {
|
1045
|
+
type: 'checkbox',
|
1046
|
+
label: 'Required',
|
1047
|
+
name: 'required',
|
1048
|
+
}],
|
1049
|
+
}),
|
1050
|
+
}, {
|
1051
|
+
isComponent: function(el) {
|
1052
|
+
if(el.tagName == 'INPUT'){
|
1053
|
+
return {type: 'input'};
|
1054
|
+
}
|
1055
|
+
},
|
1056
|
+
}),
|
1057
|
+
|
1058
|
+
view: dView,
|
1059
|
+
});
|
1060
|
+
|
1061
|
+
|
1062
|
+
editor.on('traverse:html', function (node, resultNode) {
|
1063
|
+
|
1064
|
+
});
|
1065
|
+
editor.on('load', () => {
|
1066
|
+
});
|
1067
|
+
editor.render();
|
1068
|
+
|
1069
|
+
editor.on('styleable:change', (model, property) => {
|
1070
|
+
const value = model.getStyle()[property];
|
1071
|
+
if (value!=undefined && value.indexOf('!important') === -1) {
|
1072
|
+
// if (property.includes("background")) {
|
1073
|
+
model.addStyle({ [property]: value + ' !important' });
|
1074
|
+
// }
|
1075
|
+
}
|
1076
|
+
});
|
1077
|
+
|
1078
|
+
// Commands
|
1079
|
+
editor.Commands.add('set-device-desktop', {
|
1080
|
+
run: editor => editor.setDevice('Desktop')
|
1081
|
+
});
|
1082
|
+
editor.Commands.add('set-device-mobile', {
|
1083
|
+
run: editor => editor.setDevice('Mobile')
|
1084
|
+
});
|
1085
|
+
|
1086
|
+
var devices = editor.DeviceManager;
|
1087
|
+
|
1088
|
+
devices.add('Desktop Extra Large (1900px)', '1900px');
|
1089
|
+
|
1090
|
+
devices.add('Desktop Large (1600px)', '1600px');
|
1091
|
+
|
1092
|
+
devices.add('Desktop Medium (1440px)', '1440px');
|
1093
|
+
|
1094
|
+
devices.add('iPad Portrait (768px)', '768px');
|
1095
|
+
|
1096
|
+
devices.add('iPad Landscape (1024px x 768px)', '1024px', {
|
1097
|
+
height: '768px'
|
1098
|
+
});
|
1099
|
+
|
1100
|
+
devices.add('Galaxy S5 Portrait (360px x 640px)', '360px', {
|
1101
|
+
height: '640px'
|
1102
|
+
});
|
1103
|
+
|
1104
|
+
devices.add('Galaxy S5 Landscape (640px x 360px)', '640px', {
|
1105
|
+
height: '360px'
|
1106
|
+
});
|
1107
|
+
|
1108
|
+
devices.add('Pixel 2 Portrait (411px x 731px)', '411px', {
|
1109
|
+
height: '731px'
|
1110
|
+
});
|
1111
|
+
|
1112
|
+
devices.add('Pixel 2 Landscape (731px x 411px)', '731px', {
|
1113
|
+
height: '411px'
|
1114
|
+
});
|
1115
|
+
|
1116
|
+
devices.add('Pixel 2 XL Portrait (411px x 823px)', '411px', {
|
1117
|
+
height: '823px'
|
1118
|
+
});
|
1119
|
+
|
1120
|
+
devices.add('Pixel 2 XL Landscape (823px x 411px)', '823px', {
|
1121
|
+
height: '411px'
|
1122
|
+
});
|
1123
|
+
|
1124
|
+
devices.add('iPhone 5/SE Portrait (320px x 568px)', '320px', {
|
1125
|
+
height: '568px'
|
1126
|
+
});
|
1127
|
+
|
1128
|
+
devices.add('iPhone 5/SE Landscape (568px x 320px)', '568px', {
|
1129
|
+
height: '320px'
|
1130
|
+
});
|
1131
|
+
|
1132
|
+
devices.add('iPhone 6/7/8 Portrait (375px x 667px)', '375px', {
|
1133
|
+
height: '667px'
|
1134
|
+
});
|
1135
|
+
|
1136
|
+
devices.add('iPhone 6/7/8 Landscape (667px x 375px)', '667px', {
|
1137
|
+
height: '375px'
|
1138
|
+
});
|
1139
|
+
|
1140
|
+
devices.add('iPhone 6/7/8 Plus Portrait (414px x 736px)', '414px', {
|
1141
|
+
height: '736px'
|
1142
|
+
});
|
1143
|
+
|
1144
|
+
devices.add('iPhone 6/7/8 Plus Landscape (736px x 414px)', '736px', {
|
1145
|
+
height: '414px'
|
1146
|
+
});
|
1147
|
+
|
1148
|
+
devices.add('iPhone X Portrait (375px x 812px)', '375px');
|
1149
|
+
|
1150
|
+
devices.add('iPhone X Landscape (812px x 375px)', '812px', {
|
1151
|
+
height: '375px'
|
1152
|
+
});
|
1153
|
+
|
1154
|
+
})
|
1155
|
+
|
1156
|
+
|
1157
|
+
|
1158
|
+
extrasEditor.createNoEditAreaEditor();
|
1159
|
+
extrasEditor.createAreas();
|
1160
|
+
|
1161
|
+
// Quitar el keppler-style link de layers
|
1162
|
+
$(document).ready(function(){
|
1163
|
+
$('.gjs-pn-buttons > .gjs-pn-btn').click(function() {
|
1164
|
+
var layers = $('.gjs-layer');
|
1165
|
+
if(layers.length > 0) {
|
1166
|
+
for(var i=0; i < layers.length; i++) {
|
1167
|
+
// console.log(layers[i])
|
1168
|
+
if(layers[i].outerText==="Keppler-style\n1") {
|
1169
|
+
$(layers[i]).remove();
|
1170
|
+
}
|
1171
|
+
}
|
1172
|
+
}
|
1173
|
+
});
|
1174
|
+
})
|