fae-rails 1.7.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/Rakefile +0 -3
- data/app/assets/images/fae/tutorial_model_location.png +0 -0
- data/app/assets/javascripts/fae/_deploy.js +198 -0
- data/app/assets/javascripts/fae/_modals.js +94 -0
- data/app/assets/javascripts/fae/_tables.js +11 -25
- data/app/assets/javascripts/fae/application.js +4 -2
- data/app/assets/javascripts/fae/fae_init.js +0 -4
- data/app/assets/javascripts/fae/form/_ajax.js +26 -7
- data/app/assets/javascripts/fae/form/_cancel.js +1 -0
- data/app/assets/javascripts/fae/form/_filtering.js +34 -0
- data/app/assets/javascripts/fae/form/_form.js +1 -0
- data/app/assets/javascripts/fae/form/_form_manager.js +295 -0
- data/app/assets/javascripts/fae/form/_slugger.js.erb +2 -2
- data/app/assets/javascripts/fae/form/_validator.js +24 -14
- data/app/assets/javascripts/fae/form/inputs/_color.js +2 -1
- data/app/assets/javascripts/fae/form/inputs/_select.js +5 -2
- data/app/assets/javascripts/fae/navigation/_language.js +1 -1
- data/app/assets/javascripts/fae/navigation/_navigation.js +9 -21
- data/app/assets/javascripts/fae/navigation/_subnav_highlighter.js +7 -41
- data/app/assets/javascripts/fae/vendor/jqColorPicker.min.js +0 -1
- data/app/assets/stylesheets/fae/base.scss +7 -8
- data/app/assets/stylesheets/fae/globals/imports/_variables.scss +1 -2
- data/app/assets/stylesheets/fae/globals/layout/_base.scss +7 -2
- data/app/assets/stylesheets/fae/globals/layout/_content-header.scss +17 -31
- data/app/assets/stylesheets/fae/globals/navigation/_header.scss +2 -2
- data/app/assets/stylesheets/fae/globals/navigation/_multi-col-subnav.scss +50 -0
- data/app/assets/stylesheets/fae/modules/_buttons.scss +11 -0
- data/app/assets/stylesheets/fae/modules/_deploy.scss +25 -0
- data/app/assets/stylesheets/fae/modules/_modal.scss +25 -0
- data/app/assets/stylesheets/fae/modules/_toggles.scss +39 -23
- data/app/assets/stylesheets/fae/modules/forms/_asset-actions.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_base.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_checkbox.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_date.scss +16 -0
- data/app/assets/stylesheets/fae/modules/forms/_form-manager.scss +82 -0
- data/app/assets/stylesheets/fae/modules/forms/_radio.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_select.scss +7 -6
- data/app/assets/stylesheets/fae/modules/forms/_simple-mde.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_textarea.scss +1 -1
- data/app/assets/stylesheets/fae/modules/tables/_filters.scss +4 -0
- data/app/assets/stylesheets/fae/pages/_home.scss +18 -0
- data/app/assets/stylesheets/fae/pages/_login.scss +4 -0
- data/app/controllers/fae/application_controller.rb +22 -1
- data/app/controllers/fae/base_controller.rb +6 -2
- data/app/controllers/fae/deploy_controller.rb +24 -0
- data/app/controllers/fae/deploy_hooks_controller.rb +71 -0
- data/app/controllers/fae/form_managers_controller.rb +19 -0
- data/app/controllers/fae/options_controller.rb +1 -0
- data/app/controllers/fae/pages_controller.rb +3 -2
- data/app/controllers/fae/static_pages_controller.rb +6 -1
- data/app/controllers/fae/users_controller.rb +19 -1
- data/app/controllers/fae/utilities_controller.rb +18 -6
- data/app/helpers/fae/application_helper.rb +27 -2
- data/app/helpers/fae/form_helper.rb +40 -8
- data/app/helpers/fae/nested_form_helper.rb +2 -2
- data/app/helpers/fae/view_helper.rb +99 -43
- data/app/models/concerns/fae/base_model_concern.rb +10 -7
- data/app/models/concerns/fae/user_concern.rb +10 -1
- data/app/models/fae/change.rb +18 -5
- data/app/models/fae/deploy_hook.rb +12 -0
- data/app/models/fae/file.rb +1 -1
- data/app/models/fae/form_manager.rb +24 -0
- data/app/models/fae/image.rb +1 -1
- data/app/models/fae/option.rb +1 -1
- data/app/models/fae/role.rb +1 -1
- data/app/models/fae/static_page.rb +11 -2
- data/app/models/fae/user.rb +4 -5
- data/app/services/fae/netlify_api.rb +197 -0
- data/app/uploaders/fae/file_uploader.rb +2 -5
- data/app/uploaders/fae/image_uploader.rb +3 -3
- data/app/views/devise/unlocks/new.html.slim +5 -9
- data/app/views/fae/application/_content_form.html.slim +16 -11
- data/app/views/fae/application/_file_uploader.html.slim +11 -3
- data/app/views/fae/application/_global_search_results.html.slim +2 -2
- data/app/views/fae/application/_header.slim +12 -9
- data/app/views/fae/application/_markdown_helper.slim +17 -17
- data/app/views/fae/application/_mobilenav.slim +9 -6
- data/app/views/fae/application/_user_log.html.slim +2 -2
- data/app/views/fae/deploy/index.html.slim +40 -0
- data/app/views/fae/deploy_hooks/_form.html.slim +18 -0
- data/app/views/fae/deploy_hooks/_table.html.slim +28 -0
- data/app/views/fae/deploy_hooks/edit.html.slim +3 -0
- data/app/views/fae/deploy_hooks/new.html.slim +3 -0
- data/app/views/fae/images/_image_uploader.html.slim +15 -6
- data/app/views/fae/options/_form.html.slim +11 -8
- data/app/views/fae/pages/activity_log.html.slim +16 -12
- data/app/views/fae/pages/disabled_environment.html.slim +2 -2
- data/app/views/fae/pages/error404.html.slim +5 -3
- data/app/views/fae/pages/home.html.slim +32 -21
- data/app/views/fae/setup/first_user.html.slim +3 -3
- data/app/views/fae/shared/_form_header.html.slim +37 -33
- data/app/views/fae/shared/_index_header.html.slim +3 -2
- data/app/views/fae/shared/_nested_table.html.slim +6 -6
- data/app/views/fae/shared/_recent_changes.html.slim +6 -6
- data/app/views/fae/shared/_shared_nested_table.html.slim +5 -2
- data/app/views/fae/static_pages/index.html.slim +2 -2
- data/app/views/fae/users/_form.html.slim +8 -12
- data/app/views/fae/users/index.html.slim +7 -7
- data/app/views/layouts/fae/application.html.slim +1 -0
- data/config/deploy.rb +3 -1
- data/config/initializers/devise.rb +6 -6
- data/config/locales/devise.cs.yml +59 -0
- data/config/locales/fae.cs.yml +125 -0
- data/config/locales/fae.en.yml +145 -0
- data/config/locales/fae.zh-CN.yml +109 -0
- data/config/routes.rb +9 -1
- data/db/migrate/20140809222030_add_user_table.rb +2 -2
- data/db/migrate/20140822224029_create_fae_roles.rb +1 -1
- data/db/migrate/20141008180718_create_fae_images_table.rb +1 -1
- data/db/migrate/20141017194616_create_fae_options.rb +1 -1
- data/db/migrate/20141021181327_create_fae_files.rb +1 -1
- data/db/migrate/20141021183047_create_fae_text_areas.rb +1 -1
- data/db/migrate/20141021184311_create_fae_pages.rb +1 -1
- data/db/migrate/20141105214814_create_fae_text_fields.rb +1 -1
- data/db/migrate/20150930224821_create_fae_changes.rb +1 -1
- data/db/migrate/20190925153222_create_fae_form_managers.rb +11 -0
- data/db/migrate/20220118192729_create_fae_publish_hooks.rb +10 -0
- data/db/migrate/20220128133730_rename_publish_hooks.rb +5 -0
- data/db/migrate/20220202153607_add_position_to_deploy_hooks.rb +6 -0
- data/lib/fae/options.rb +4 -2
- data/lib/fae/version.rb +1 -1
- data/lib/generators/fae/base_generator.rb +62 -8
- data/lib/generators/fae/nested_index_scaffold_generator.rb +1 -1
- data/lib/generators/fae/nested_scaffold_generator.rb +16 -2
- data/lib/generators/fae/page_generator.rb +8 -0
- data/lib/generators/fae/scaffold_generator.rb +1 -1
- data/lib/generators/fae/templates/assets/fae.js +1 -1
- data/lib/generators/fae/templates/controllers/nested_scaffold_controller.rb +14 -0
- data/lib/generators/fae/templates/graphql/graphql_page_type.rb +17 -0
- data/lib/generators/fae/templates/graphql/graphql_type.rb +13 -0
- data/lib/generators/fae/templates/initializers/fae.rb +16 -1
- data/lib/generators/fae/templates/views/_form.html.slim +11 -4
- data/lib/generators/fae/templates/views/_form_index_nested.html.slim +15 -1
- data/lib/generators/fae/templates/views/_form_nested.html.slim +19 -2
- data/lib/generators/fae/templates/views/index_nested.html.slim +1 -0
- data/lib/generators/fae/templates/views/static_page_form.html.slim +14 -3
- metadata +70 -47
- data/app/views/fae/shared/_form_buttons.html.slim +0 -11
- data/app/views/fae/shared/_nested_table_advanced.html.slim +0 -18
- data/lib/sub_test_task_patch.rb +0 -129
@@ -0,0 +1,295 @@
|
|
1
|
+
/* global Fae */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Fae form manager
|
5
|
+
* @namespace form
|
6
|
+
* @memberof Fae
|
7
|
+
*/
|
8
|
+
Fae.form.formManager = {
|
9
|
+
|
10
|
+
$theForm: null,
|
11
|
+
$managerForm: null,
|
12
|
+
savedFieldSettings: null,
|
13
|
+
mainContentClass: 'main-content',
|
14
|
+
fmContainerClass: 'js-form-manager-container',
|
15
|
+
formManagerFormClass: 'form-manager-form',
|
16
|
+
launchManagerClass: 'js-launch-form-manager',
|
17
|
+
cancelManagerClass: 'js-form-manager-cancel',
|
18
|
+
saveAndCloseManagerClass: 'js-form-manager-submit',
|
19
|
+
helperTextTextElClass: 'helper_text_text',
|
20
|
+
infoAttr: 'data-form-manager-info',
|
21
|
+
languageAttr: 'data-language',
|
22
|
+
requiredEl: '<abbr title="required">*</abbr> ',
|
23
|
+
containerManagerDataId: 'data-form-manager-id',
|
24
|
+
ignoredFields: [
|
25
|
+
'seo_title',
|
26
|
+
'seo_description',
|
27
|
+
'social_media_title',
|
28
|
+
'social_media_description',
|
29
|
+
'social_media_image'
|
30
|
+
],
|
31
|
+
|
32
|
+
init: function(formSelector) {
|
33
|
+
var _this = this;
|
34
|
+
formSelector = formSelector || 'form:first';
|
35
|
+
_this.$theForm = $(formSelector);
|
36
|
+
|
37
|
+
// Draw initial label/helper overrides
|
38
|
+
_this.setupAllFields(_this.$theForm);
|
39
|
+
|
40
|
+
$('body').on('click', '.'+_this.launchManagerClass, function(e) {
|
41
|
+
e.preventDefault();
|
42
|
+
_this.$theForm = $(this).parents('form');
|
43
|
+
_this._launchManager($(this));
|
44
|
+
});
|
45
|
+
|
46
|
+
$('body').on('click', '.'+_this.saveAndCloseManagerClass, function(e) {
|
47
|
+
e.preventDefault();
|
48
|
+
_this._saveAndCloseManager($(this));
|
49
|
+
});
|
50
|
+
|
51
|
+
$('body').on('click', '.'+_this.cancelManagerClass, function(e) {
|
52
|
+
e.preventDefault();
|
53
|
+
_this._closeManager($(this));
|
54
|
+
});
|
55
|
+
|
56
|
+
},
|
57
|
+
|
58
|
+
setupAllFields: function($theForm) {
|
59
|
+
_this = this;
|
60
|
+
if ($theForm.length && $theForm.attr(_this.infoAttr)) {
|
61
|
+
this.savedFieldSettings = JSON.parse($theForm.attr(_this.infoAttr));
|
62
|
+
|
63
|
+
$.each(JSON.parse(this.savedFieldSettings.fields), function(i, fieldSettings) {
|
64
|
+
_this._determineFieldSetup(fieldSettings);
|
65
|
+
});
|
66
|
+
}
|
67
|
+
},
|
68
|
+
|
69
|
+
_determineFieldSetup: function(fieldSettings) {
|
70
|
+
var $container = $('[data-form-manager-id="'+fieldSettings.formManagerId+'"]');
|
71
|
+
_this._setupField($container, fieldSettings.label, fieldSettings.helper);
|
72
|
+
|
73
|
+
if ($container.hasClass('image')) {
|
74
|
+
var $captionContainer = $('.' + fieldSettings.formManagerId + '_caption_container');
|
75
|
+
var $altContainer = $('.' + fieldSettings.formManagerId + '_alt_container');
|
76
|
+
|
77
|
+
if ($captionContainer) {
|
78
|
+
var captionLabel = fieldSettings.label + ' Caption';
|
79
|
+
_this._setupField($captionContainer, captionLabel, '');
|
80
|
+
}
|
81
|
+
if ($altContainer) {
|
82
|
+
var altLabel = fieldSettings.label + ' Alt Text';
|
83
|
+
_this._setupField($altContainer, altLabel, '');
|
84
|
+
}
|
85
|
+
}
|
86
|
+
},
|
87
|
+
|
88
|
+
_setupField: function($container, overriddenLabel, overriddenHelper) {
|
89
|
+
var _this = this;
|
90
|
+
if ($container.length) {
|
91
|
+
var $label = $container.find('label:first');
|
92
|
+
var $helperTextContainerEl = $container.find('h6');
|
93
|
+
var $labelInner = $label.find('.label_inner');
|
94
|
+
var $labelTextEl = $label;
|
95
|
+
if ($labelInner.length) {
|
96
|
+
$labelTextEl = $labelInner;
|
97
|
+
}
|
98
|
+
var $labelsCheckbox = $labelTextEl.find('input');
|
99
|
+
|
100
|
+
var newLabelText = '';
|
101
|
+
if ($container.hasClass('required') || $label.hasClass('required') || $labelInner.text().indexOf('*') !== -1) {
|
102
|
+
newLabelText = _this.requiredEl;
|
103
|
+
}
|
104
|
+
|
105
|
+
newLabelText += overriddenLabel;
|
106
|
+
$labelTextEl.html(newLabelText);
|
107
|
+
|
108
|
+
if($labelsCheckbox.length) {
|
109
|
+
$labelTextEl.append($labelsCheckbox);
|
110
|
+
}
|
111
|
+
|
112
|
+
// Don't mess with image alt text or caption helpers
|
113
|
+
if ($container.attr('class').indexOf('alt_container') !== -1
|
114
|
+
|| $container.attr('class').indexOf('caption_container') !== -1
|
115
|
+
) {
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
|
119
|
+
// Just do the helper thing no matter what, aka allow empty
|
120
|
+
$label.removeClass('has_no_helper_text');
|
121
|
+
|
122
|
+
// Main form and nested form markup differs, deal with it
|
123
|
+
if ($container.find('h6').length) {
|
124
|
+
$label.find('.'+_this.helperTextTextElClass).text(overriddenHelper);
|
125
|
+
} else {
|
126
|
+
if ($helperTextContainerEl.length) {
|
127
|
+
$helperTextContainerEl.find('.'+_this.helperTextTextElClass).text(overriddenHelper);
|
128
|
+
} else {
|
129
|
+
$helperTextContainerEl = $('<h6 />', {class: 'helper_text'}).append($('<span />', {class: 'helper_text_text', text: overriddenHelper}));
|
130
|
+
}
|
131
|
+
$label.append($helperTextContainerEl);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
},
|
135
|
+
|
136
|
+
_launchManager: function() {
|
137
|
+
var _this = this;
|
138
|
+
|
139
|
+
// Show all language inputs so we can manage them
|
140
|
+
_this.$theForm.find('['+_this.languageAttr+']').show();
|
141
|
+
|
142
|
+
_this.$managerForm =
|
143
|
+
$('<form />', {action: '#', class: _this.formManagerFormClass})
|
144
|
+
.append($('<header />', {class: 'content-header js-content-header js-will-be-sticky'})
|
145
|
+
.append($('<a />', {href: '#', text: 'Cancel', class: 'button '+_this.cancelManagerClass}))
|
146
|
+
.append($('<a />', {href: '#', text: 'Submit', class: 'button js-form-manager-submit'}))
|
147
|
+
);
|
148
|
+
|
149
|
+
// Insert a bunch of inputs for label/helper text
|
150
|
+
_this._gatherAndInjectManagerEls();
|
151
|
+
|
152
|
+
$('.'+_this.fmContainerClass).append(_this.$managerForm);
|
153
|
+
_this._revealManagerForm();
|
154
|
+
|
155
|
+
},
|
156
|
+
|
157
|
+
_gatherAndInjectManagerEls: function() {
|
158
|
+
$(_this.$theForm.find('['+_this.containerManagerDataId+']')).each(function(i) {
|
159
|
+
var $container = $(this);
|
160
|
+
|
161
|
+
if ($container.hasClass('hidden') || !_this._shouldDisplayInManager($container)) { return; }
|
162
|
+
|
163
|
+
var $label = $container.find('label:first');
|
164
|
+
var $labelTextEl = $label;
|
165
|
+
var $labelInner = $label.find('.label_inner');
|
166
|
+
if ($labelInner.length) {
|
167
|
+
$labelTextEl = $labelInner;
|
168
|
+
}
|
169
|
+
var $helperTextTextEl = $label.find('.'+_this.helperTextTextElClass);
|
170
|
+
var containerManagerId = $container.attr(_this.containerManagerDataId);
|
171
|
+
var iDParts = containerManagerId.split('_');
|
172
|
+
iDParts.shift();
|
173
|
+
var fMLabelText = _this._titleize(iDParts.join(' '));
|
174
|
+
var labelInputValue = $labelTextEl.clone().children().remove().end().text().replace('*','').trim();
|
175
|
+
var helperInputValue = $helperTextTextEl.text();
|
176
|
+
|
177
|
+
var $fmFieldContainer = $('<div />', {class: "form-section", 'data-form-manager-id': $container.attr('data-form-manager-id')});
|
178
|
+
var $fmSingleFieldContainer = $('<div />', {class: "single-field"});
|
179
|
+
var $fmSingleHelperFieldContainer = $('<div />', {class: "single-field"});
|
180
|
+
var $fmFieldTitle = $('<div />', {class: "field_title"});
|
181
|
+
var $fmHelperFieldTitle = $('<div />', {class: "field_title"});
|
182
|
+
var $fMLabel = $('<label />', {text: fMLabelText, class: 'fm_label'});
|
183
|
+
var $fMHelper = $('<label />', {text: 'Helper', class: 'fm_label'});
|
184
|
+
var $labelInput = $('<input />', {type: 'text', id: $container.attr('data-form-manager-id')+'_label_input', class: 'label_input', value: labelInputValue});
|
185
|
+
var $helperInput = $('<input />', {type: 'text', id: $container.attr('data-form-manager-id')+'_helper_input', class: 'helper_input', value: helperInputValue});
|
186
|
+
|
187
|
+
_this.$managerForm.append(
|
188
|
+
$fmFieldContainer.append(
|
189
|
+
$fmSingleFieldContainer.append(
|
190
|
+
$fmFieldTitle.append(
|
191
|
+
$fMLabel
|
192
|
+
),
|
193
|
+
$labelInput
|
194
|
+
),
|
195
|
+
$fmSingleHelperFieldContainer.append(
|
196
|
+
$fmHelperFieldTitle.append(
|
197
|
+
$fMHelper
|
198
|
+
),
|
199
|
+
$helperInput
|
200
|
+
)
|
201
|
+
)
|
202
|
+
);
|
203
|
+
|
204
|
+
});
|
205
|
+
},
|
206
|
+
|
207
|
+
_revealManagerForm: function() {
|
208
|
+
var _this = this;
|
209
|
+
$('.'+_this.mainContentClass).hide();
|
210
|
+
$('.'+_this.fmContainerClass).show();
|
211
|
+
$('.'+_this.formManagerFormClass).fadeIn('fast');
|
212
|
+
},
|
213
|
+
|
214
|
+
_saveAndCloseManager: function() {
|
215
|
+
_this = this;
|
216
|
+
_this._submitManager();
|
217
|
+
_this._closeManager();
|
218
|
+
},
|
219
|
+
|
220
|
+
_closeManager: function() {
|
221
|
+
var _this = this;
|
222
|
+
$('.'+_this.fmContainerClass).children().remove();
|
223
|
+
$('.'+_this.mainContentClass).show();
|
224
|
+
},
|
225
|
+
|
226
|
+
_submitManager: function() {
|
227
|
+
var _this = this;
|
228
|
+
var payload = {
|
229
|
+
form_manager: {
|
230
|
+
form_manager_model_name: _this.$theForm.data('form-manager-model'),
|
231
|
+
form_manager_model_id: _this.$theForm.data('form-manager-model-id'),
|
232
|
+
fields: {}
|
233
|
+
}
|
234
|
+
};
|
235
|
+
|
236
|
+
// Gather everything in the inputs for a POST
|
237
|
+
$.each(_this.$managerForm.find('['+_this.containerManagerDataId+']'), function(i) {
|
238
|
+
var $container = $(this);
|
239
|
+
var formManagerId = $container.attr(_this.containerManagerDataId);
|
240
|
+
var requiredValue = $container.hasClass('required') ? 1 : 0;
|
241
|
+
|
242
|
+
payload.form_manager.fields[formManagerId] = {
|
243
|
+
formManagerId: formManagerId,
|
244
|
+
label: $container.find('.label_input').val(),
|
245
|
+
helper: $container.find('.helper_input').val(),
|
246
|
+
required: requiredValue
|
247
|
+
};
|
248
|
+
});
|
249
|
+
|
250
|
+
// Reset the labels/helpers to the custom ones just made
|
251
|
+
$.each(payload.form_manager.fields, function(i, fieldSettings) {
|
252
|
+
_this._determineFieldSetup(fieldSettings);
|
253
|
+
});
|
254
|
+
|
255
|
+
$.ajax({
|
256
|
+
url: Fae.path+'/form_managers/update',
|
257
|
+
type: 'post',
|
258
|
+
data: payload,
|
259
|
+
headers: {
|
260
|
+
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
|
261
|
+
},
|
262
|
+
dataType: 'json',
|
263
|
+
success: function (data) {
|
264
|
+
// do something?
|
265
|
+
}
|
266
|
+
});
|
267
|
+
|
268
|
+
},
|
269
|
+
|
270
|
+
_shouldDisplayInManager: function($container) {
|
271
|
+
var _this = this;
|
272
|
+
var should = true;
|
273
|
+
$(_this.ignoredFields).each(function(i, fuzzyClass) {
|
274
|
+
if ($container.attr('class').indexOf(fuzzyClass) > -1) {
|
275
|
+
should = false;
|
276
|
+
return false;
|
277
|
+
}
|
278
|
+
});
|
279
|
+
return should;
|
280
|
+
},
|
281
|
+
|
282
|
+
_capitalize: function(str) {
|
283
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
284
|
+
},
|
285
|
+
|
286
|
+
_titleize: function(str) {
|
287
|
+
var _this = this;
|
288
|
+
var string_array = str.split(' ');
|
289
|
+
string_array = string_array.map(function(str) {
|
290
|
+
return _this._capitalize(str);
|
291
|
+
});
|
292
|
+
return string_array.join(' ');
|
293
|
+
}
|
294
|
+
|
295
|
+
};
|
@@ -74,8 +74,8 @@ Fae.form.slugger = {
|
|
74
74
|
slug_text = slug_text.join(' ');
|
75
75
|
|
76
76
|
// Strip accented characters
|
77
|
-
var from = '
|
78
|
-
var to = '
|
77
|
+
var from = 'âàáâãäæåçèéêëęēėìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ';
|
78
|
+
var to = 'aaaaaaaaceeeeeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY';
|
79
79
|
|
80
80
|
// Loop through all accented characters and replace with non-accents
|
81
81
|
for (var i = 0; i < from.length; i++) {
|
@@ -26,10 +26,13 @@ Fae.form.validator = {
|
|
26
26
|
/**
|
27
27
|
* Validate the entire form on submit and stop it if the form is invalid
|
28
28
|
*/
|
29
|
-
formValidate: function () {
|
29
|
+
formValidate: function ($scope) {
|
30
30
|
var _this = this;
|
31
31
|
|
32
|
-
|
32
|
+
if (typeof($scope) === 'undefined'){
|
33
|
+
$scope = FCH.$document;
|
34
|
+
}
|
35
|
+
$scope.on('submit', 'form:not([data-remote=true])', function (e) {
|
33
36
|
var $this = $(this);
|
34
37
|
|
35
38
|
if ($this.data('passed_validation') !== 'true') {
|
@@ -58,7 +61,7 @@ Fae.form.validator = {
|
|
58
61
|
}
|
59
62
|
});
|
60
63
|
|
61
|
-
_this.testValidation($this);
|
64
|
+
_this.testValidation($this, $scope);
|
62
65
|
|
63
66
|
}
|
64
67
|
|
@@ -69,7 +72,7 @@ Fae.form.validator = {
|
|
69
72
|
* Tests a forms validation after all validation checks have responded
|
70
73
|
* Polls validations responses every 50ms to allow uniqueness AJAX calls to complete
|
71
74
|
*/
|
72
|
-
testValidation: function($this) {
|
75
|
+
testValidation: function($this, $scope) {
|
73
76
|
var _this = this;
|
74
77
|
_this.validation_test_count++;
|
75
78
|
|
@@ -84,9 +87,11 @@ Fae.form.validator = {
|
|
84
87
|
|
85
88
|
$this.submit();
|
86
89
|
} else {
|
87
|
-
// otherwise scroll to the top to display alerts
|
90
|
+
// otherwise scroll to the top to display alerts (unless in a nested form scope)
|
88
91
|
Fae.navigation.language.checkForHiddenErrors();
|
89
|
-
|
92
|
+
if (typeof($scope) === 'undefined') {
|
93
|
+
FCH.smoothScroll($('#js-main-header'), 500, 100, 0);
|
94
|
+
}
|
90
95
|
|
91
96
|
if ($(".field_with_errors").length) {
|
92
97
|
$('.alert').slideDown('fast').delay(3000).slideUp('fast');
|
@@ -108,10 +113,14 @@ Fae.form.validator = {
|
|
108
113
|
/**
|
109
114
|
* Bind validation events based on input type
|
110
115
|
*/
|
111
|
-
bindValidationEvents: function () {
|
116
|
+
bindValidationEvents: function ($scope) {
|
112
117
|
var _this = this;
|
113
118
|
|
114
|
-
$
|
119
|
+
if (typeof($scope) === 'undefined'){
|
120
|
+
$scope = $('body');
|
121
|
+
}
|
122
|
+
|
123
|
+
$scope.find('[data-validate]').each(function () {
|
115
124
|
var $this = $(this);
|
116
125
|
|
117
126
|
if ($this.data('validate').length) {
|
@@ -214,9 +223,9 @@ Fae.form.validator = {
|
|
214
223
|
|
215
224
|
var $wrapper = $input.closest('.input');
|
216
225
|
if ($wrapper.children('.error').length) {
|
217
|
-
$wrapper.children('.error').text(messages.join(','));
|
226
|
+
$wrapper.children('.error').text(messages.join(', '));
|
218
227
|
} else {
|
219
|
-
$wrapper.addClass('field_with_errors').append("<span class='error'>" + messages.join(',') + "</span>");
|
228
|
+
$wrapper.addClass('field_with_errors').append("<span class='error'>" + messages.join(', ') + "</span>");
|
220
229
|
}
|
221
230
|
},
|
222
231
|
|
@@ -264,12 +273,13 @@ Fae.form.validator = {
|
|
264
273
|
// if the kind matches, remove it from the array
|
265
274
|
if (validations[i]['kind'] === kind) {
|
266
275
|
validations.splice(i, 1);
|
276
|
+
i--;
|
277
|
+
} else {
|
278
|
+
// otherwise convert JSON back to a string
|
279
|
+
validations[i] = JSON.stringify(validations[i]);
|
267
280
|
}
|
268
|
-
|
269
|
-
// convert JSON back to a string
|
270
|
-
validations[i] = JSON.stringify(validations[i]);
|
271
281
|
}
|
272
|
-
$field.
|
282
|
+
$field.data('validate', '[' + validations + ']');
|
273
283
|
},
|
274
284
|
|
275
285
|
/**
|
@@ -23,8 +23,9 @@ Fae.form.color = {
|
|
23
23
|
var inputOffset = $elm.offset().top;
|
24
24
|
var distanceToBottom = $(document).height() - inputOffset;
|
25
25
|
var top = distanceToBottom <= this.$UI._height ? 414 : inputOffset + $elm.innerHeight();
|
26
|
+
var left = $elm.offset().left;
|
26
27
|
|
27
|
-
return { left:
|
28
|
+
return { left: left, top: top }
|
28
29
|
},
|
29
30
|
renderCallback: function($elm, toggled) {
|
30
31
|
var colors = this.color.colors;
|
@@ -92,8 +92,11 @@ Fae.form.select = {
|
|
92
92
|
})
|
93
93
|
});
|
94
94
|
|
95
|
-
//
|
96
|
-
|
95
|
+
// prevent duplicate link from being added when nested form re-renders on the page after saving
|
96
|
+
if (!$('.js-multiselect-action-deselect_all').length > 0) {
|
97
|
+
// Add actions to wraper
|
98
|
+
$deselect_all_action.insertAfter($chosen);
|
99
|
+
}
|
97
100
|
|
98
101
|
// Add special "Select All" option and notify Chosen of new option
|
99
102
|
addSelectAllOption($element)
|
@@ -83,7 +83,7 @@ Fae.navigation.language = {
|
|
83
83
|
*/
|
84
84
|
checkForHiddenErrors: function() {
|
85
85
|
if (this.el.$select.length && $('div.field_with_errors:hidden').length && !FCH.exists('.hidden_errors')) {
|
86
|
-
$(
|
86
|
+
$('.content').prepend('<div class="hidden_errors field_with_errors"><span class="error">There are hidden errors. Click "All Languages" in the language nav to view all errors.</span></div>');
|
87
87
|
}
|
88
88
|
}
|
89
89
|
};
|
@@ -167,27 +167,15 @@ Fae.navigation = {
|
|
167
167
|
stickyHeaders: function(just_headers) {
|
168
168
|
just_headers = FCH.setDefault(just_headers, false);
|
169
169
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
});
|
180
|
-
|
181
|
-
// @depreciation - remove else block in 2.0
|
182
|
-
} else {
|
183
|
-
var $header = $('.main_content-header');
|
184
|
-
var sidebar_top_offset = (parseInt( $header.outerHeight(), 10) + 30) + 'px';
|
185
|
-
$('#js-sidenav').css('padding-top', sidebar_top_offset );
|
186
|
-
|
187
|
-
$('.main_content-header').sticky({
|
188
|
-
placeholder: true
|
189
|
-
});
|
190
|
-
}
|
170
|
+
var $header = $('.js-content-header');
|
171
|
+
var sidebar_top_offset = (parseInt( $header.outerHeight(), 10) + 30) + 'px';
|
172
|
+
$('#js-sidenav').css('padding-top', sidebar_top_offset );
|
173
|
+
|
174
|
+
$header.sticky({
|
175
|
+
placeholder: true,
|
176
|
+
perpetual_placeholder: true,
|
177
|
+
ignore_placeholder_offsets: true
|
178
|
+
});
|
191
179
|
|
192
180
|
if (!just_headers) {
|
193
181
|
$('#js-sidenav').sticky();
|
@@ -8,18 +8,7 @@
|
|
8
8
|
Fae.navigation.subnav_highlighter = {
|
9
9
|
init: function() {
|
10
10
|
//only run everything if there is a subnav area
|
11
|
-
|
12
|
-
if (FCH.exists('.main_content-header-section-links') || FCH.exists('.content-header-subnav')) {
|
13
|
-
// @depreciation - remove entire conditional block (following 7 lines) in v2.0
|
14
|
-
if(Fae.content_selector === '.content') {
|
15
|
-
this.section_class = Fae.content_selector;
|
16
|
-
this.subnav_class = '#js-content-header-subnav';
|
17
|
-
this.addBuffer();
|
18
|
-
} else {
|
19
|
-
this.section_class = '.main_content-section';
|
20
|
-
this.subnav_class = '.main_content-header-section-links';
|
21
|
-
}
|
22
|
-
|
11
|
+
if (FCH.exists('.content-header-subnav')) {
|
23
12
|
this.FCHListeners();
|
24
13
|
|
25
14
|
//makes the subnav clicks
|
@@ -27,28 +16,10 @@ Fae.navigation.subnav_highlighter = {
|
|
27
16
|
}
|
28
17
|
},
|
29
18
|
|
30
|
-
/**
|
31
|
-
* Add space above subnav links if they're present
|
32
|
-
* @depreciation - Remove this function in favor of a better HTML solution in form_header in a v2.0 refactor.
|
33
|
-
*/
|
34
|
-
addBuffer: function() {
|
35
|
-
var $subnav = $( this.subnav_class );
|
36
|
-
var height = $subnav.css('height');
|
37
|
-
$subnav.parent().css('padding-bottom', height);
|
38
|
-
},
|
39
|
-
|
40
19
|
/**
|
41
20
|
* Since subnavHighlighter is not a direct child of Fae and therefore unknown to FCH, these listeners are saved in private functions in this method
|
42
21
|
*/
|
43
22
|
FCHListeners: function() {
|
44
|
-
// @depreciation - change value of section_class to '.content' in v2.0
|
45
|
-
var section_class = this.section_class;
|
46
|
-
// @depreciation - change value of subnav_class to '#js-content-header-subnav' in v2.0
|
47
|
-
// Ideally, form_header will include header.content-header.js-content-header
|
48
|
-
var subnav_class = this.subnav_class;
|
49
|
-
// @depreciation - remove legacy_buffer expression in v2.0 (the value should be 0, so it will be unnecessary)
|
50
|
-
var legacy_buffer = section_class === Fae.content_selector ? 0 : 32;
|
51
|
-
|
52
23
|
/**
|
53
24
|
* On scroll, change highlight of nav item. Bread and butter of this subclass.
|
54
25
|
* @private
|
@@ -56,11 +27,11 @@ Fae.navigation.subnav_highlighter = {
|
|
56
27
|
function scrollCallback() {
|
57
28
|
var scroll_top = FCH.$window.scrollTop();
|
58
29
|
|
59
|
-
$(
|
30
|
+
$('.content').each(function(index) {
|
60
31
|
var $this = $(this);
|
61
|
-
var position = $this.position().top - scroll_top
|
32
|
+
var position = $this.position().top - scroll_top;
|
62
33
|
var $link = $('a[href="#' + $this.attr('id') + '"]').parent();
|
63
|
-
var is_scrolled_to_bottom = scroll_top
|
34
|
+
var is_scrolled_to_bottom = scroll_top >= (FCH.$document.outerHeight() - FCH.dimensions.wh);
|
64
35
|
|
65
36
|
$link.removeClass('-active');
|
66
37
|
if (position <= 0 || index === 0 || is_scrolled_to_bottom) {
|
@@ -80,11 +51,7 @@ Fae.navigation.subnav_highlighter = {
|
|
80
51
|
* Smooth scrolling on anchor links in the tab area.
|
81
52
|
*/
|
82
53
|
anchorClickListener: function() {
|
83
|
-
|
84
|
-
var scroll_offset_selector = FCH.exists('.main_content-header') ? '.main_content-header' : '.content-header';
|
85
|
-
var scroll_offset = parseInt( $(scroll_offset_selector).css('height'), 10 );
|
86
|
-
// @depreciation - remove should_find_h2 in v2.0
|
87
|
-
var should_find_h2 = this.section_class === Fae.content_selector;
|
54
|
+
var scroll_offset = parseInt( $('.content-header').css('height'), 10 );
|
88
55
|
|
89
56
|
/**
|
90
57
|
* Smoothly scroll to destination if it's a link to the current page
|
@@ -98,8 +65,7 @@ Fae.navigation.subnav_highlighter = {
|
|
98
65
|
var $target = $(this.hash);
|
99
66
|
$target = $target.length ? $target : $('[name=' + this.hash.slice(1) + ']');
|
100
67
|
|
101
|
-
|
102
|
-
if(should_find_h2 && $target.find('h2').length) {
|
68
|
+
if($target.find('h2').length) {
|
103
69
|
$target = $target.find('h2');
|
104
70
|
scroll_offset -= 2;
|
105
71
|
}
|
@@ -110,6 +76,6 @@ Fae.navigation.subnav_highlighter = {
|
|
110
76
|
}
|
111
77
|
}
|
112
78
|
|
113
|
-
$(
|
79
|
+
$('#js-content-header-subnav a').on('click', scroller);
|
114
80
|
},
|
115
81
|
};
|
@@ -1,4 +1,3 @@
|
|
1
1
|
/*! tinyColorPicker - v1.1.1 2016-07-15 */
|
2
2
|
|
3
3
|
!function(a,b){"object"==typeof exports?module.exports=b(a):"function"==typeof define&&define.amd?define("colors",[],function(){return b(a)}):a.Colors=b(a)}(this,function(a,b){"use strict";function c(a,c,d,f,g){if("string"==typeof c){var c=v.txt2color(c);d=c.type,p[d]=c[d],g=g!==b?g:c.alpha}else if(c)for(var h in c)a[d][h]=k(c[h]/l[d][h][1],0,1);return g!==b&&(a.alpha=k(+g,0,1)),e(d,f?a:b)}function d(a,b,c){var d=o.options.grey,e={};return e.RGB={r:a.r,g:a.g,b:a.b},e.rgb={r:b.r,g:b.g,b:b.b},e.alpha=c,e.equivalentGrey=n(d.r*a.r+d.g*a.g+d.b*a.b),e.rgbaMixBlack=i(b,{r:0,g:0,b:0},c,1),e.rgbaMixWhite=i(b,{r:1,g:1,b:1},c,1),e.rgbaMixBlack.luminance=h(e.rgbaMixBlack,!0),e.rgbaMixWhite.luminance=h(e.rgbaMixWhite,!0),o.options.customBG&&(e.rgbaMixCustom=i(b,o.options.customBG,c,1),e.rgbaMixCustom.luminance=h(e.rgbaMixCustom,!0),o.options.customBG.luminance=h(o.options.customBG,!0)),e}function e(a,b){var c,e,k,q=b||p,r=v,s=o.options,t=l,u=q.RND,w="",x="",y={hsl:"hsv",rgb:a},z=u.rgb;if("alpha"!==a){for(var A in t)if(!t[A][A]){a!==A&&(x=y[A]||"rgb",q[A]=r[x+"2"+A](q[x])),u[A]||(u[A]={}),c=q[A];for(w in c)u[A][w]=n(c[w]*t[A][w][1])}z=u.rgb,q.HEX=r.RGB2HEX(z),q.equivalentGrey=s.grey.r*q.rgb.r+s.grey.g*q.rgb.g+s.grey.b*q.rgb.b,q.webSave=e=f(z,51),q.webSmart=k=f(z,17),q.saveColor=z.r===e.r&&z.g===e.g&&z.b===e.b?"web save":z.r===k.r&&z.g===k.g&&z.b===k.b?"web smart":"",q.hueRGB=v.hue2RGB(q.hsv.h),b&&(q.background=d(z,q.rgb,q.alpha))}var B,C,D,E=q.rgb,F=q.alpha,G="luminance",H=q.background;return B=i(E,{r:0,g:0,b:0},F,1),B[G]=h(B,!0),q.rgbaMixBlack=B,C=i(E,{r:1,g:1,b:1},F,1),C[G]=h(C,!0),q.rgbaMixWhite=C,s.customBG&&(D=i(E,H.rgbaMixCustom,F,1),D[G]=h(D,!0),D.WCAG2Ratio=j(D[G],H.rgbaMixCustom[G]),q.rgbaMixBGMixCustom=D,D.luminanceDelta=m.abs(D[G]-H.rgbaMixCustom[G]),D.hueDelta=g(H.rgbaMixCustom,D,!0)),q.RGBLuminance=h(z),q.HUELuminance=h(q.hueRGB),s.convertCallback&&s.convertCallback(q,a),q}function f(a,b){var c={},d=0,e=b/2;for(var f in a)d=a[f]%b,c[f]=a[f]+(d>e?b-d:-d);return c}function g(a,b,c){return(m.max(a.r-b.r,b.r-a.r)+m.max(a.g-b.g,b.g-a.g)+m.max(a.b-b.b,b.b-a.b))*(c?255:1)/765}function h(a,b){for(var c=b?1:255,d=[a.r/c,a.g/c,a.b/c],e=o.options.luminance,f=d.length;f--;)d[f]=d[f]<=.03928?d[f]/12.92:m.pow((d[f]+.055)/1.055,2.4);return e.r*d[0]+e.g*d[1]+e.b*d[2]}function i(a,c,d,e){var f={},g=d!==b?d:1,h=e!==b?e:1,i=g+h*(1-g);for(var j in a)f[j]=(a[j]*g+c[j]*h*(1-g))/i;return f.a=i,f}function j(a,b){var c=1;return c=a>=b?(a+.05)/(b+.05):(b+.05)/(a+.05),n(100*c)/100}function k(a,b,c){return a>c?c:b>a?b:a}var l={rgb:{r:[0,255],g:[0,255],b:[0,255]},hsv:{h:[0,360],s:[0,100],v:[0,100]},hsl:{h:[0,360],s:[0,100],l:[0,100]},alpha:{alpha:[0,1]},HEX:{HEX:[0,16777215]}},m=a.Math,n=m.round,o={},p={},q={r:.298954,g:.586434,b:.114612},r={r:.2126,g:.7152,b:.0722},s=function(a){this.colors={RND:{}},this.options={color:"rgba(0,0,0,0)",grey:q,luminance:r,valueRanges:l},t(this,a||{})},t=function(a,d){var e,f=a.options;u(a);for(var g in d)d[g]!==b&&(f[g]=d[g]);e=f.customBG,f.customBG="string"==typeof e?v.txt2color(e).rgb:e,p=c(a.colors,f.color,b,!0)},u=function(a){o!==a&&(o=a,p=a.colors)};s.prototype.setColor=function(a,d,f){return u(this),a?c(this.colors,a,d,b,f):(f!==b&&(this.colors.alpha=k(f,0,1)),e(d))},s.prototype.setCustomBackground=function(a){return u(this),this.options.customBG="string"==typeof a?v.txt2color(a).rgb:a,c(this.colors,b,"rgb")},s.prototype.saveAsBackground=function(){return u(this),c(this.colors,b,"rgb",!0)},s.prototype.toString=function(a,b){return v.color2text((a||"rgb").toLowerCase(),this.colors,b)};var v={txt2color:function(a){var b={},c=a.replace(/(?:#|\)|%)/g,"").split("("),d=(c[1]||"").split(/,\s*/),e=c[1]?c[0].substr(0,3):"rgb",f="";if(b.type=e,b[e]={},c[1])for(var g=3;g--;)f=e[g]||e.charAt(g),b[e][f]=+d[g]/l[e][f][1];else b.rgb=v.HEX2rgb(c[0]);return b.alpha=d[3]?+d[3]:1,b},color2text:function(a,b,c){var d=c!==!1&&n(100*b.alpha)/100,e="number"==typeof d&&c!==!1&&(c||1!==d),f=b.RND.rgb,g=b.RND.hsl,h="hex"===a&&e,i="hex"===a&&!h,j="rgb"===a||h,k=j?f.r+", "+f.g+", "+f.b:i?"#"+b.HEX:g.h+", "+g.s+"%, "+g.l+"%";return i?k:(h?"rgb":a)+(e?"a":"")+"("+k+(e?", "+d:"")+")"},RGB2HEX:function(a){return((a.r<16?"0":"")+a.r.toString(16)+(a.g<16?"0":"")+a.g.toString(16)+(a.b<16?"0":"")+a.b.toString(16)).toUpperCase()},HEX2rgb:function(a){return a=a.split(""),{r:+("0x"+a[0]+a[a[3]?1:0])/255,g:+("0x"+a[a[3]?2:1]+(a[3]||a[1]))/255,b:+("0x"+(a[4]||a[2])+(a[5]||a[2]))/255}},hue2RGB:function(a){var b=6*a,c=~~b%6,d=6===b?0:b-c;return{r:n(255*[1,1-d,0,0,d,1][c]),g:n(255*[d,1,1,1-d,0,0][c]),b:n(255*[0,0,d,1,1,1-d][c])}},rgb2hsv:function(a){var b,c,d,e=a.r,f=a.g,g=a.b,h=0;return g>f&&(f=g+(g=f,0),h=-1),c=g,f>e&&(e=f+(f=e,0),h=-2/6-h,c=m.min(f,g)),b=e-c,d=e?b/e:0,{h:1e-15>d?p&&p.hsl&&p.hsl.h||0:b?m.abs(h+(f-g)/(6*b)):0,s:e?b/e:p&&p.hsv&&p.hsv.s||0,v:e}},hsv2rgb:function(a){var b=6*a.h,c=a.s,d=a.v,e=~~b,f=b-e,g=d*(1-c),h=d*(1-f*c),i=d*(1-(1-f)*c),j=e%6;return{r:[d,h,g,g,i,d][j],g:[i,d,d,h,g,g][j],b:[g,g,i,d,d,h][j]}},hsv2hsl:function(a){var b=(2-a.s)*a.v,c=a.s*a.v;return c=a.s?1>b?b?c/b:0:c/(2-b):0,{h:a.h,s:a.v||c?c:p&&p.hsl&&p.hsl.s||0,l:b/2}},rgb2hsl:function(a,b){var c=v.rgb2hsv(a);return v.hsv2hsl(b?c:p.hsv=c)},hsl2rgb:function(a){var b=6*a.h,c=a.s,d=a.l,e=.5>d?d*(1+c):d+c-c*d,f=d+d-e,g=e?(e-f)/e:0,h=~~b,i=b-h,j=e*g*i,k=f+j,l=e-j,m=h%6;return{r:[e,l,f,f,k,e][m],g:[k,e,e,l,f,f][m],b:[f,f,k,e,e,l][m]}}};return s}),function(a,b){"object"==typeof exports?module.exports=b(a,require("jquery"),require("colors")):"function"==typeof define&&define.amd?define(["jquery","colors"],function(c,d){return b(a,c,d)}):b(a,a.jQuery,a.Colors)}(this,function(a,b,c,d){"use strict";function e(a){return a.value||a.getAttribute("value")||b(a).css("background-color")||"#FFF"}function f(a){return a=a.originalEvent&&a.originalEvent.touches?a.originalEvent.touches[0]:a,a.originalEvent?a.originalEvent:a}function g(a){return b(a.find(r.doRender)[0]||a[0])}function h(c){var d=b(this),f=d.offset(),h=b(a),k=r.gap;c?(s=g(d),s._colorMode=s.data("colorMode"),p.$trigger=d,(t||i()).css(r.positionCallback.call(p,d)||{left:(t._left=f.left)-((t._left+=t._width-(h.scrollLeft()+h.width()))+k>0?t._left+k:0),top:(t._top=f.top+d.outerHeight())-((t._top+=t._height-(h.scrollTop()+h.height()))+k>0?t._top+k:0)}).show(r.animationSpeed,function(){c!==!0&&(y.toggle(!!r.opacity)._width=y.width(),v._width=v.width(),v._height=v.height(),u._height=u.height(),q.setColor(e(s[0])),n(!0))}).off(".tcp").on(D,".cp-xy-slider,.cp-z-slider,.cp-alpha",j)):p.$trigger&&b(t).hide(r.animationSpeed,function(){n(!1),p.$trigger=null}).off(".tcp")}function i(){return b("head").append('<style type="text/css" id="tinyColorPickerStyles">'+(r.css||I)+(r.cssAddon||"")+"</style>"),b(H).css({margin:r.margin}).appendTo("body").show(0,function(){p.$UI=t=b(this),F=r.GPU&&t.css("perspective")!==d,u=b(".cp-z-slider",this),v=b(".cp-xy-slider",this),w=b(".cp-xy-cursor",this),x=b(".cp-z-cursor",this),y=b(".cp-alpha",this),z=b(".cp-alpha-cursor",this),r.buildCallback.call(p,t),t.prepend("<div>").children().eq(0).css("width",t.children().eq(0).width()),t._width=this.offsetWidth,t._height=this.offsetHeight}).hide()}function j(a){var c=this.className.replace(/cp-(.*?)(?:\s*|$)/,"$1").replace("-","_");(a.button||a.which)>1||(a.preventDefault&&a.preventDefault(),a.returnValue=!1,s._offset=b(this).offset(),(c="xy_slider"===c?k:"z_slider"===c?l:m)(a),n(),A.on(E,function(){A.off(".tcp")}).on(C,function(a){c(a),n()}))}function k(a){var b=f(a),c=b.pageX-s._offset.left,d=b.pageY-s._offset.top;q.setColor({s:c/v._width*100,v:100-d/v._height*100},"hsv")}function l(a){var b=f(a).pageY-s._offset.top;q.setColor({h:360-b/u._height*360},"hsv")}function m(a){var b=f(a).pageX-s._offset.left,c=b/y._width;q.setColor({},"rgb",c)}function n(a){var b=q.colors,c=b.hueRGB,e=(b.RND.rgb,b.RND.hsl,r.dark),f=r.light,g=q.toString(s._colorMode,r.forceAlpha),h=b.HUELuminance>.22?e:f,i=b.rgbaMixBlack.luminance>.22?e:f,j=(1-b.hsv.h)*u._height,k=b.hsv.s*v._width,l=(1-b.hsv.v)*v._height,m=b.alpha*y._width,n=F?"translate3d":"",p=s[0].value,t=s[0].hasAttribute("value")&&""===p&&a!==d;v._css={backgroundColor:"rgb("+c.r+","+c.g+","+c.b+")"},w._css={transform:n+"("+k+"px, "+l+"px, 0)",left:F?"":k,top:F?"":l,borderColor:b.RGBLuminance>.22?e:f},x._css={transform:n+"(0, "+j+"px, 0)",top:F?"":j,borderColor:"transparent "+h},y._css={backgroundColor:"#"+b.HEX},z._css={transform:n+"("+m+"px, 0, 0)",left:F?"":m,borderColor:i+" transparent"},s._css={backgroundColor:t?"":g,color:t?"":b.rgbaMixBGMixCustom.luminance>.22?e:f},s.text=t?"":p!==g?g:"",a!==d?o(a):G(o)}function o(a){v.css(v._css),w.css(w._css),x.css(x._css),y.css(y._css),z.css(z._css),r.doRender&&s.css(s._css),s.text&&s.val(s.text),r.renderCallback.call(p,s,"boolean"==typeof a?a:d)}var p,q,r,s,t,u,v,w,x,y,z,A=b(document),B=b(),C="touchmove.tcp mousemove.tcp pointermove.tcp",D="touchstart.tcp mousedown.tcp pointerdown.tcp",E="touchend.tcp mouseup.tcp pointerup.tcp",F=!1,G=a.requestAnimationFrame||a.webkitRequestAnimationFrame||function(a){a()},H='<div class="cp-color-picker"><div class="cp-z-slider"><div class="cp-z-cursor"></div></div><div class="cp-xy-slider"><div class="cp-white"></div><div class="cp-xy-cursor"></div></div><div class="cp-alpha"><div class="cp-alpha-cursor"></div></div></div>',I=".cp-color-picker{position:absolute;overflow:hidden;padding:6px 6px 0;background-color:#444;color:#bbb;font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:400;cursor:default;border-radius:5px}.cp-color-picker>div{position:relative;overflow:hidden}.cp-xy-slider{float:left;height:128px;width:128px;margin-bottom:6px;background:linear-gradient(to right,#FFF,rgba(255,255,255,0))}.cp-white{height:100%;width:100%;background:linear-gradient(rgba(0,0,0,0),#000)}.cp-xy-cursor{position:absolute;top:0;width:10px;height:10px;margin:-5px;border:1px solid #fff;border-radius:100%;box-sizing:border-box}.cp-z-slider{float:right;margin-left:6px;height:128px;width:20px;background:linear-gradient(red 0,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red 100%)}.cp-z-cursor{position:absolute;margin-top:-4px;width:100%;border:4px solid #fff;border-color:transparent #fff;box-sizing:border-box}.cp-alpha{clear:both;width:100%;height:16px;margin:6px 0;background:linear-gradient(to right,#444,rgba(0,0,0,0))}.cp-alpha-cursor{position:absolute;margin-left:-4px;height:100%;border:4px solid #fff;border-color:#fff transparent;box-sizing:border-box}",J=function(a){q=this.color=new c(a),r=q.options,p=this};J.prototype={render:n,toggle:h},b.fn.colorPicker=function(c){var d=this,f=function(){};return c=b.extend({animationSpeed:150,GPU:!0,doRender:!0,customBG:"#FFF",opacity:!0,renderCallback:f,buildCallback:f,positionCallback:f,body:document.body,scrollResize:!0,gap:4,dark:"#222",light:"#DDD"},c),!p&&c.scrollResize&&b(a).on("resize.tcp scroll.tcp",function(){p.$trigger&&p.toggle.call(p.$trigger[0],!0)}),B=B.add(this),this.colorPicker=p||new J(c),this.options=c,b(c.body).off(".tcp").on(D,function(a){-1===B.add(t).add(b(t).find(a.target)).index(a.target)&&h()}),this.on("focusin.tcp click.tcp",function(a){p.color.options=b.extend(p.color.options,r=d.options),h.call(this,a)}).on("change.tcp",function(){q.setColor(this.value||"#FFF"),d.colorPicker.render(!0)}).each(function(){var a=e(this),d=a.split("("),f=g(b(this));f.data("colorMode",d[1]?d[0].substr(0,3):"HEX").attr("readonly",r.preventFocus),c.doRender&&f.css({"background-color":a,color:function(){return q.setColor(a).rgbaMixBGMixCustom.luminance>.22?c.dark:c.light}})})},b.fn.colorPicker.destroy=function(){b("*").off(".tcp"),p.toggle(!1),B=b()}});
|
4
|
-
//# sourceMappingURL=jqColorPicker.js.map
|
@@ -32,7 +32,8 @@
|
|
32
32
|
'globals/navigation/sidenav',
|
33
33
|
'globals/navigation/mobilenav',
|
34
34
|
'globals/navigation/utility',
|
35
|
-
'globals/navigation/search'
|
35
|
+
'globals/navigation/search',
|
36
|
+
'globals/navigation/multi-col-subnav'
|
36
37
|
;
|
37
38
|
|
38
39
|
// Tables
|
@@ -52,6 +53,7 @@
|
|
52
53
|
@import
|
53
54
|
'modules/buttons',
|
54
55
|
'modules/modal',
|
56
|
+
'modules/deploy',
|
55
57
|
'modules/toggles',
|
56
58
|
'modules/alerts'
|
57
59
|
;
|
@@ -70,17 +72,14 @@
|
|
70
72
|
'modules/forms/colorpicker',
|
71
73
|
'modules/forms/hints',
|
72
74
|
'modules/forms/validation',
|
73
|
-
'modules/forms/simple-mde'
|
75
|
+
'modules/forms/simple-mde',
|
76
|
+
'modules/forms/form-manager'
|
74
77
|
;
|
75
78
|
|
76
79
|
// Pages
|
77
80
|
@import
|
78
81
|
'pages/error',
|
79
82
|
'pages/login',
|
80
|
-
'pages/help'
|
81
|
-
|
82
|
-
|
83
|
-
// Legacy styles
|
84
|
-
@import
|
85
|
-
'globals/legacy/pre-1.3'
|
83
|
+
'pages/help',
|
84
|
+
'pages/home'
|
86
85
|
;
|
@@ -7,8 +7,6 @@ $custom-breakpoints: () !default;
|
|
7
7
|
|
8
8
|
// Fae-specific breakpoints
|
9
9
|
$fae-breakpoints: (
|
10
|
-
// @depreciation - remove page_header_save_block in v2.0
|
11
|
-
'page_header_save_block': ( max-width: 615px ),
|
12
10
|
'login_container': ( min-width: 700px ),
|
13
11
|
'login_submit': ( min-width: 500px ),
|
14
12
|
);
|
@@ -91,6 +89,7 @@ $c-chosen-gradient-end: $c-light-grey !default;
|
|
91
89
|
$c-chosen-multi-bg: $c-lightest-grey !default;
|
92
90
|
$c-chosen-multi-text: $c-dark-grey !default;
|
93
91
|
$c-chosen-multi-delete: $c-darker-grey !default;
|
92
|
+
$c-focus-border: $c-mid-dark-grey !default;
|
94
93
|
|
95
94
|
// Yes / No Sliders
|
96
95
|
$c-slider-no-color: $c-light-grey !default;
|