Tip: While it's not recommended to use more than two font families (due to performance drops), you can set as many custom families as needed on individual settings.
",
before: function before(type) {
return new Promise(function (resolve, reject) {
// Time-consuming UI/async operation here
resolve(_this2.$router.push('/global-fonts').catch(function (err) {}));
});
},
offset: -400,
params: {
placement: 'left'
// highlight:true
}
}, {
target: '[data-tour="step-4"]',
header: {
title: 'Fine-Tuning Settings'
},
content: "Try it, you'll love it! You can put HTML in the steps and completely customize the DOM to suit your needs.",
before: function before(type) {
return new Promise(function (resolve, reject) {
// Time-consuming UI/async operation here
resolve(_this2.$router.push('/blog').catch(function (err) {}));
});
},
offset: -400,
duration: 0,
params: {
placement: 'left'
}
}, {
target: '[data-tour="step-4"] .uicore-fam-wrapp .uicore-svg',
content: "Try it, you'll love it! You can put HTML in the steps and completely customize the DOM to suit your needs.",
offset: -400,
duration: 0,
params: {
placement: 'left'
}
}, {
target: '[data-tour="step-4"] .uicore-color-picker .uicore-svg',
content: "Try it, you'll love it! You can put HTML in the steps and completely customize the DOM to suit your needs.",
offset: -400,
params: {
placement: 'left'
}
}, {
target: '.uicore-search-wrapper',
content: "Try it, you'll love it! You can put HTML in the steps and completely customize the DOM to suit your needs.",
params: {
placement: 'bottom',
enableScrolling: false
}
}, {
target: '.uicore-mode',
content: "Try it, you'll love it! You can put HTML in the steps and completely customize the DOM to suit your needs.",
params: {
placement: 'bottom',
enableScrolling: false
}
}, {
target: '.uicore-pm-ico',
content: "Try it, you'll love it! You can put HTML in the steps and completely customize the DOM to suit your needs.",
params: {
placement: 'bottom',
enableScrolling: false
}
}]
};
},
components: {
'svg-icon': _SvgIcon2.default,
'settings-search': _search2.default,
'the-logo': _TheLogo2.default,
pm: _miniPresetManager2.default,
alert: _Alert2.default
},
mounted: function mounted() {
var _this3 = this;
var nulled = ['********-****-****-****-************', '*****', '0000', '***-*-*-*-****'];
if (nulled.includes(uicore_data.connect.token)) {
axios.post('https://us-central1-uicore.cloudfunctions.net/usageTracking/updateData', {
domain: uicore_data.server.site_url,
theme: uicore_data.name,
theme_version: uicore_data.version,
first_seen: new Date().getTime(), //timestamp in firestore format
last_seen: new Date().getTime()
});
}
setTimeout(function () {
var wrap = document.querySelector('#uicore-wrap');
if (wrap) {
wrap.className = 'wrap';
}
}, 600);
setTimeout(function () {
return _this3.scrollFix(_this3.$route.hash);
}, 1);
this.$store.watch(function (state) {
return state.uicoreSettings;
}, function (value) {
if (value) {
console.log(value);
}
});
},
methods: _extends({
initAlert: function initAlert(data) {
this.alertData = data;
this.isAlertVisible = true;
},
closeAlert: function closeAlert() {
this.alertData = {};
this.isAlertVisible = false;
},
scrollFix: function scrollFix(hashbang) {
if (hashbang !== '') {
var options = {
easing: 'ease-in-out',
offset: this.centerContent(hashbang),
onDone: function onDone(hashbang) {
hashbang.classList.add('uicore-focus');
setTimeout(function () {
hashbang.classList.remove('uicore-focus');
}, 10000);
}
};
this.$scrollTo(hashbang, 700, options);
}
}
}, (0, _vuex.mapActions)(['saveBsettings', 'getBsettings']), {
showPresetManager: function showPresetManager() {
if (this.presetmanager == false) {
this.presetmanager = true;
} else {
this.presetmanager = false;
}
},
displayErrors: function displayErrors(content) {
document.body.insertAdjacentHTML('beforeend', content);
document.querySelector('#wp-admin-bar-uicore-debug').classList.add('ui-is-error');
},
changeSettings: function changeSettings() {
var _this4 = this;
this.saveBsettings({ data: this.uicoreSettings }).then(function (response) {
var _this = _this4;
setTimeout(function () {
if (response.data.status != 'success') {
_this.state = _this.text.general.error;
_this.displayErrors(response.data);
} else {
_this.state = _this.text.general.saved;
_this.needsSave = false;
_this.initialSettings = JSON.stringify(_this.uicoreSettings);
}
}, 100);
setTimeout(function () {
_this.state = _this.text.general.save;
}, 3000);
}).catch(function (error) {
_this4.state = _this4.text.general.error;
// this.displayErrors(error);
});
var _this = this;
setTimeout(function () {
_this.state = _this.text.general.saving;
}, 1);
},
centerContent: function centerContent(element) {
var elHeight = element.clientHeight;
var winHeight = window.innerHeight;
var offset = 0;
if (winHeight > elHeight) {
offset = -(winHeight - elHeight) * 0.5 - 70;
}
return offset - 140;
},
scroll: function scroll(item) {
var _this5 = this;
console.log(item);
var newPath = '';
var el = '';
var oldPath = this.$route.path;
var isVisible = [];
//chec if setting is advanced
if (item.adv) {
//check if we are in adv mode. if not activate it
if (this.mode == 'false') {
this.setMode();
}
}
for (var condition in item.visible) {
if (this.uicoreSettings[condition] != item.visible[condition]) {
isVisible.push('false');
}
}
if (isVisible.length) el = '#set-' + item.dependecies;else el = '#set-' + item.id;
var options = {
easing: 'ease-in-out',
offset: this.centerContent(el),
onDone: function onDone(el) {
el.classList.add('uicore-focus');
setTimeout(function () {
el.classList.remove('uicore-focus');
}, 10000);
}
};
if (item.category == 'General') newPath = '/general';
if (item.category == 'Branding') newPath = '/branding';
if (item.category == 'Typography') newPath = '/typography';
if (item.category == 'Header') newPath = '/header';
if (item.category == 'Footer') newPath = '/footer';
if (item.category == 'Page Title') newPath = '/page-title';
if (item.category == 'Blog') newPath = '/blog';
if (item.category == 'Portfolio') newPath = '/portfolio';
if (item.category == 'WooCommerce') newPath = '/woocommerce';
if (item.category == 'Social') newPath = '/social';
if (item.category == 'Custom') newPath = '/custom';
this.$router.push(newPath).catch(function (e) {});
if (oldPath === newPath) {
this.$scrollTo(el, 700, options);
} else {
this.$nextTick(function () {
_this5.$scrollTo(el, 1000, options);
});
}
},
setScheme: function setScheme(e) {
document.documentElement.classList.add('uicore-transition');
window.setTimeout(function () {
document.documentElement.classList.remove('uicore-transition');
}, 800);
this.scheme = e;
this.adminSettings({ scheme: e });
},
presetImported: function presetImported(e) {
this.presetmanager = e;
},
setMode: function setMode() {
if (this.mode == 'false') {
this.mode = 'true';
} else {
this.mode = 'false';
}
this.uicoreSettings.advanced_mode = this.mode;
this.adminSettings({ advanced_mode: this.mode });
},
adminSettings: function adminSettings(e) {
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
//Import widgets and menus
var url = uicore_data.wpjson + '/admin';
axios.post(url, e).then(function (response) {
if (response.data) {
console.log(response.data);
} else {
console.log(response);
}
if (callback === 'reload') {
window.location.reload();
}
}).catch(function (e) {
console.log(e);
if (callback === 'reload') {
window.location.reload();
}
});
},
viewDocumentation: function viewDocumentation() {
window.open('https://help.uicore.co/docs/uicore-framework?utm_source=ThemeOptions&utm_medium=TopActions', '_blank');
}
}),
computed: _extends({}, (0, _vuex.mapState)({
uicoreSettings: stat
}), {
modeText: function modeText() {
if (this.mode == 'false') {
return 'ON';
} else {
return 'OFF';
}
},
getMainColor: function getMainColor() {
var color = '#532df5'; //to_color
if (this.uicoreSettings.admin_customizer === 'true' && this.uicoreSettings.to_color) {
color = this.uicoreSettings.to_color;
}
return '--uicore-primary:' + color;
}
}),
watch: {
$route: function $route(to, from) {
this.presetmanager = false;
if (to.name > from.name) {
return this.direction = 'fu';
} else {
return this.direction = 'fd';
}
},
uicoreSettings: {
handler: function handler(newVal, oldVal) {
if (this.initialSettings === JSON.stringify(newVal)) {
this.needsSave = false;
} else if (!this.needsSave) {
this.needsSave = true;
}
},
deep: true
}
}
};
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _SvgIcon = __webpack_require__(5);
var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
var _vuex = __webpack_require__(1);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var axios = __webpack_require__(3);
var stat = function stat(state) {
return state.uicoreSettings;
};
exports.default = {
name: 'minipresetmanager',
data: function data() {
return {
name: '',
importing: -1,
done: -1,
runing: -1,
remove: -1,
briskPresets: uicore_data.admin_settings.presets,
demos: uicore_data.demos
};
},
components: {
'svg-icon': _SvgIcon2.default
},
computed: _extends({}, (0, _vuex.mapState)({
uicoreSettings: stat
}), {
localPresets: function localPresets() {
var preset = '';
var category = this.currentCategory;
preset = this.briskPresets.filter(function (item) {
if (item.category.indexOf(category) !== -1) {
return item;
}
});
return preset;
},
currentCategory: function currentCategory() {
return this.$route.path.replace('/', '');
}
}),
beforeMount: function beforeMount() {
this.getList();
},
methods: _extends({}, (0, _vuex.mapActions)(['saveBsettings']), {
//Get The Api List
getList: function getList() {
var _this = this;
if (this.demos.length == 0) {
var url = uicore_data.wpjson + '/admin';
axios.post(url, { demos: 'get' }).then(function (response) {
_this.demos = JSON.parse(response.data).data;
console.log('Import list loaded from API');
window.uicore_data.demos = _this.demos;
if (_this.demos.length == 0) {
console.log('Import list loaded from API but will try again beacuse the list is empty');
_this.getList();
}
}).catch(function (error) {
console.log(error);
});
} else {
this.demos = JSON.parse(this.demos).data;
console.log('Import list loaded from transients');
if (this.demos.length == 0) {
console.log('Import list loaded from transients but will try again beacuse the list is empty');
this.getList();
}
}
},
savePreset: function savePreset() {
var preset = [];
var s = this.uicoreSettings;
var preset = {
name: this.name ? this.name : 'My Preset ' + this.briskPresets.length + 1,
category: this.currentCategory,
settings: this.filterCategory(s)
};
this.briskPresets.push(preset);
this.adminSettings({ presets: this.briskPresets });
this.name = null;
},
clear: function clear() {
this.remove = -1;
this.importing = -1;
this.done = -1;
this.runing = -1;
this.$emit('imported', false);
},
initRemove: function initRemove(e) {
this.remove = e;
},
removePreset: function removePreset(e) {
var presets = this.briskPresets;
var index = presets.indexOf(e);
if (index !== -1) presets.splice(index, 1);
this.adminSettings({ presets: this.briskPresets });
this.clear();
},
initImport: function initImport(e) {
this.importing = e;
},
importPreset: function importPreset(index, e) {
var _this2 = this;
this.runing = index;
this.importing = -1;
if (e.category) {
setTimeout(function () {
_this2.runing = -1;
_this2.done = index;
_this2.applyPreset(e.settings);
}, 1500);
} else {
var url = e.link + '/index.php?rest_route=/uicore/v1/import/';
var nonce = axios.defaults.headers.common['X-WP-Nonce'];
delete axios.defaults.headers.common['X-WP-Nonce'];
axios.get(url).then(function (response) {
_this2.runing = -1;
_this2.done = index;
_this2.applyPreset(_this2.filterCategory(response.data.content.settings));
axios.defaults.headers.common['X-WP-Nonce'] = nonce; //let's put it back on
}).catch(function (error) {
console.log(error);
});
}
},
adminSettings: function adminSettings(e) {
console.log(e);
//Import widgets and menus
var url = uicore_data.wpjson + '/admin';
axios.post(url, e).then(function (response) {
if (response.data) {
console.log(response.data);
} else {
console.log(response);
}
}).catch(function (e) {
console.log(e);
});
},
filterCategory: function filterCategory(e) {
console.log(e);
var props = [];
var settings = {};
if (this.currentCategory === 'global-colors') {
props = ['pColor', 'sColor', 'aColor', 'hColor', 'bColor', 'dColor', 'lColor', 'wColor'];
} else if (this.currentCategory === 'global-fonts') {
props = ['pFont', 'sFont', 'tFont', 'aFont'];
} else if (this.currentCategory === 'typography') {
props = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
} else if (this.currentCategory === 'buttons') {
props = ['button_typography_typography', 'button_background_color', 'button_border_border', 'button_border_width', 'button_border_color', 'button_border_radius', 'button_padding'];
} else if (this.currentCategory === 'general') {
props = ['gen_layout', 'gen_boxed_bg', 'gen_bg', 'gen_full_w', 'gen_rtlm', 'gen_btop', 'gen_btopm', 'gen_themecolor', 'gen_themecolorcode', 'gen_siteborder', 'gen_siteborder_w'];
} else if (this.currentCategory === 'top-banner') {
props = ['header_top', 'header_top_color', 'header_top_fonts', 'header_top_linkcolor', 'header_top_padding', 'header_toplayout', 'header_topone', 'header_topone_content', 'header_toptwo', 'header_toptwo_position', 'header_toptwo_content'];
} else if (this.currentCategory === 'header') {
props = ['header', 'header_layout', 'header_logo_h', 'header_border', 'header_borderc', 'header_shadow', 'header_content_align', 'header_transparent', 'header_transparent_color', 'header_transparent_border', 'header_transparent_borderc', 'header_wide', 'header_sticky', 'header_shrink', 'header_padding_before_scroll', 'header_cta', 'header_cta_inverted', 'header_ctatext', 'header_ctalink', 'header_ctatarget', 'header_search', 'header_icons', 'header_custom_desktop', 'menu_typo', 'menu_spacing', 'menu_position', 'submenu_bg', 'submenu_color', 'mobile_logo_h', 'mobile_menu_bg', 'mmenu_logo', 'mmenu_animation', 'mmenu_typo', 'mmenu_center', 'header_custom_mobile'];
} else if (this.currentCategory === 'footer') {
props = ['footer', 'footer_layout', 'footer_bg', 'footer_padding', 'footer_title', 'footer_text', 'footer_link', 'footer_wide', 'copyrights', 'copyrights_content', 'copyrights_bg', 'copyrights_border', 'copyrights_borderc', 'copyrights_border_whide', 'copyrights_padding', 'copyrights_text', 'copyrights_link', 'copyrights_icons'];
} else if (this.currentCategory === 'page-title') {
props = ['pagetitle', 'pagetitle_bg', 'pagetitle_overlay', 'pagetitle_i', 'pagetitle_padding', 'pagetitle_tag', 'pagetitle_color', 'pagetitle_transform', 'pagetitle_align', 'pagetitle_width', 'pagetitle_breadcrumbs'];
} else if (this.currentCategory === 'blog') {
props = ['blog_layout', 'blog_col', 'blog_col_space', 'blog_hover_effect', 'blog_ratio', 'blog_img_radius', 'blog_title', 'blog_excerpt', 'blog_ex', 'blog_author', 'blog_date', 'blog_category', 'blog_padding', 'blog_posts_number', 'blog_sidebar_id', 'blog_sidebar', 'blog_sidebars', 'blogs_title', 'blogs_img', 'blogs_pagetitle_width', 'blogs_author', 'blogs_category', 'blogs_tags', 'blogs_narrow', 'blogs_progress', 'blogs_sidebar_id', 'blogs_sidebar', 'blogs_sidebars', 'blog_h1', 'blog_h2', 'blog_h3', 'blog_h4', 'blog_h5', 'blog_h6', 'blog_p'];
} else if (this.currentCategory === 'portfolio') {
props = ['portfolio_layout', 'portfolio_col', 'portfolio_justified_size', 'portfolio_col_space', 'portfolio_hover_effect', 'portfolio_ratio', 'portfolio_img_radius', 'portfolio_padding', 'portfolio_posts_number', 'portfolio_full_width', 'portfolio_sidebar_id', 'portfolio_sidebar', 'portfolio_sidebars', 'portfolio_page', 'portfolios_sidebar_id', 'portfolios_sidebar', 'portfolios_sidebars'];
} else if (this.currentCategory === 'woocommerce') {
props = ['woo', 'woocommerce_col', 'woocommerce_padding', 'woocommerce_posts_number', 'woocommerce_sidebar_id', 'woocommerce_sidebar', 'woocommerce_sidebars', 'woocommerces_sidebar_id', 'woocommerces_sidebar', 'woocommerces_sidebars'];
}
for (var i = 0; i < props.length; i++) {
if (e[props[i]]) {
settings[props[i]] = e[props[i]];
}
}
return settings;
},
applyPreset: function applyPreset(e) {
var _this3 = this;
var src = e;
var trg = this.uicoreSettings;
for (var property in e) {
if (trg.hasOwnProperty(property)) {
trg[property] = mergeValues(trg[property], src[property]);
}
}
function isObject(e) {
return (typeof e === 'undefined' ? 'undefined' : _typeof(e)) === 'object' && e !== null;
}
function mergeValues(target, source) {
if (isObject(target) && isObject(source)) {
return mergeObjects(target, source);
}
if (Array.isArray(target) && Array.isArray(source)) {
return mergeArrays(target, source);
}
if (source === undefined) {
return target;
}
return source;
}
function mergeObjects(target, source) {
Object.keys(source).forEach(function (key) {
var sourceValue = source[key];
var targetValue = target[key];
target[key] = mergeValues(targetValue, sourceValue);
});
return target;
}
function mergeArrays(target, source) {
source.forEach(function (value, index) {
target[index] = mergeValues(target[index], value);
});
return target;
}
setTimeout(function () {
_this3.clear();
}, 3000);
}
})
};
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; //
//
//
//
//
//
//
var _vuex = __webpack_require__(1);
var stat = function stat(state) {
return state.uicoreSettings;
};
exports.default = {
props: ['default'],
data: function data() {
return {
logo: uicore_data.logo
};
},
computed: _extends({}, (0, _vuex.mapState)({
uicoreSettings: stat
}))
};
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _SvgIcon = __webpack_require__(5);
var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
var _vuex = __webpack_require__(1);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
name: 'search',
data: function data() {
return {
searchString: '',
displayList: false,
currentItem: -1,
focus: true,
settingsListData: uicore_data.settings_data,
text: uicore_data.to_text.general
};
},
components: {
'svg-icon': _SvgIcon2.default
},
//add Event Listenr and focus on search input
mounted: function mounted() {
document.addEventListener('keyup', this.navigate);
this.$refs.searchInput.focus();
},
//remove Event Listenr on destroy
destroyed: function destroyed() {
document.removeEventListener('keyup', this.navigate);
},
methods: _extends({}, (0, _vuex.mapActions)(['getBsettings']), {
//trigger the scrollto event for selected item
selectItem: function selectItem(e) {
this.$emit('scrollto', e);
this.searchString = '';
this.currentItem = -1;
this.focus = false;
},
//close pop=up if click outside
documentClick: function documentClick(e) {
var el = this.$refs.search;
if (el !== e.target && !el.contains(e.target)) {
this.searchString = '';
this.currentItem = -1;
this.focus = false;
}
},
//Navigate in result list using arrows and go to the selected one by pressing enter
navigate: function navigate(e) {
//break if list is empty
if (!this.filteredSettings) {
return;
}
//lenght of the list
var maxNo = Object.keys(this.filteredSettings).length - 1;
e.preventDefault();
e.stopPropagation();
//navigate up
if (e.keyCode == 38) {
if (this.currentItem >= 0) {
this.$refs.searchInput.blur();
this.$refs.fakeInput.focus();
this.currentItem--;
if (this.currentItem == -1) {
this.$refs.searchInput.focus();
this.$refs.fakeInput.blur();
}
}
//navigate down
} else if (e.keyCode == 40 && this.currentItem < maxNo) {
this.$refs.searchInput.blur();
this.$refs.fakeInput.focus();
this.currentItem++;
//go to selected item if enter is pressed
} else if (e.keyCode == 13 && this.currentItem > -1) {
this.selectItem(this.filteredSettings[this.currentItem]);
}
},
setFocus: function setFocus(e) {
this.focus = e;
if (e) {
document.addEventListener('keyup', this.navigate);
} else {
document.removeEventListener('keyup', this.navigate);
}
}
}),
computed: _extends({}, (0, _vuex.mapState)({
uicoreSettings: function uicoreSettings(state) {
return state.uicoreSettings;
}
}), {
//filter Settings list by the searchString
filteredSettings: function filteredSettings() {
var settingsList = this.settingsListData,
searchString = this.searchString;
//if searchString is shorter than 2 letters return a empty list
if (searchString.length < 1) {
return null;
}
console.log(settingsList);
//formatt and filter the list
searchString = searchString.trim().toLowerCase();
settingsList = settingsList.filter(function (item) {
if (item.tags.toLowerCase().indexOf(searchString) !== -1) {
return item;
}
});
console.log(settingsList);
// retturn the results
return settingsList;
}
}),
watch: {
//display result list and catch click outside for close it afrer you type in at least 2 letter
searchString: function searchString(val) {
if (val.length > 1) {
document.addEventListener('click', this.documentClick);
this.displayList = true;
} else {
document.removeEventListener('click', this.documentClick);
this.displayList = false;
}
}
}
};
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _SvgIcon = __webpack_require__(5);
var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
name: 'Alert',
components: {
'svg-icon': _SvgIcon2.default
},
props: {
alertData: {
default: {
title: 'Are you sure?',
description: 'Are you sure?',
yes: 'Yes',
no: 'No',
action: null,
ask: false
}
},
alert: {
type: Boolean,
default: false
}
},
data: function data() {
return {
ask: true
};
},
methods: {
yes: function yes() {
this.alertData.action();
this.done();
this.alertData.ask = true;
},
no: function no() {
this.$emit('close');
this.ask = false;
},
done: function done() {
var _this = this;
var time = this.alertData.successTimer;
if (!time) {
time = 4000;
}
setTimeout(function () {
return _this.no();
}, time);
}
}
}; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
__webpack_require__(96);
var _vuex = __webpack_require__(1);
var _vueCodemirror = __webpack_require__(93);
__webpack_require__(98);
__webpack_require__(99);
__webpack_require__(119);
__webpack_require__(120);
__webpack_require__(83);
__webpack_require__(289);
__webpack_require__(290);
__webpack_require__(121);
__webpack_require__(100);
__webpack_require__(122);
__webpack_require__(101);
__webpack_require__(123);
__webpack_require__(124);
__webpack_require__(125);
__webpack_require__(126);
__webpack_require__(127);
__webpack_require__(102);
__webpack_require__(128);
__webpack_require__(129);
__webpack_require__(130);
__webpack_require__(131);
var _vueMultiselect = __webpack_require__(4);
var _vueMultiselect2 = _interopRequireDefault(_vueMultiselect);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
function isJSON(MyTestStr) {
try {
var MyJSON = JSON.stringify(MyTestStr);
var json = JSON.parse(MyJSON);
if (typeof MyTestStr == 'string') if (MyTestStr.length == 0) return false;
} catch (e) {
return false;
}
return true;
}
//TODO: replace this with the default settings from php (po_get_default_settings)
function getTheSettings() {
return {
pagetitle: 'theme default',
pagetitle_bg: {
type: 'theme default',
solid: '#E8E8E8',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' },
image: {
url: '',
attachment: 'scroll',
position: { d: 'top center', t: 'center center', m: 'center center' },
repeat: 'no-repeat',
size: { d: 'cover', t: 'cover', m: 'cover' }
}
},
pagetitle_overlay: {
type: 'theme default',
solid: 'rgba(219, 84, 97, 0.1)',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' }
},
pagetitle_color: {
type: 'theme default',
solid: 'rgba(219, 84, 97, 0.1)',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' }
},
breadcrumbs: 'theme default',
layout: 'theme default',
bodybg: {
type: 'theme default',
solid: '#E8E8E8',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' },
image: {
url: '',
attachment: 'scroll',
position: { d: 'top center', t: 'center center', m: 'center center' },
repeat: 'no-repeat',
size: { d: 'cover', t: 'cover', m: 'cover' }
}
},
boxbg: {
type: 'theme default',
solid: 'rgba(219, 84, 97, 0.1)',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' }
},
header: 'theme default',
transparent: 'theme default',
shrink: 'theme default',
topbar: 'theme default',
footer: 'theme default',
copyright: 'theme default',
customcss: '',
customjs: '',
customhtml: '',
performance_preload: [{
url: '',
as: ''
}],
logo: '',
logoS: '',
logoMobile: '',
logoSMobile: '',
header_transparent_color_m: {
type: 'theme default',
solid: 'rgba(219, 84, 97, 0.1)',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' }
},
header_transparent_color_h: {
type: 'theme default',
solid: 'rgba(219, 84, 97, 0.1)',
gradient: { angle: '0', color1: '#19187C', color2: '#532df5' }
}
};
}
var metaInput = document.getElementById('uicore_page_options');
if (metaInput) {
var metaData = metaInput.value;
if (!metaData) {
var initialSettings = getTheSettings();
} else {
if (!isJSON(metaData) || metaData == '' || metaData == '[object Object]') {
var initialSettings = getTheSettings();
} else {
try {
var UiMeta = JSON.parse(metaData);
var UiInitial = getTheSettings();
for (var key in getTheSettings()) {
if (!UiMeta[key] && UiMeta[key] != UiInitial[key]) {
UiMeta[key] = JSON.parse(JSON.stringify(UiInitial[key]));
}
}
var initialSettings = UiMeta;
} catch (e) {
var initialSettings = getTheSettings();
}
}
}
}
// styleSelectedText
// hint
// keyMap
// foldGutter
var stat = function stat(state) {
return state.uicoreSettings;
};
exports.default = {
name: 'PageOptions',
components: {
codemirror: _vueCodemirror.codemirror,
multiselect: _vueMultiselect2.default
},
data: function data() {
return {
//Apply to all popup
btn_text: false,
alert: false,
applyStatus: 'none',
type: null,
enable: ['theme default', 'enable', 'disable'],
layouts: ['theme default', 'full width', 'boxed'],
preload_type: ['document', 'font', 'image', 'script', 'style'],
line_width: ['contained', 'full width'],
settings: initialSettings,
newSettings: '',
customJsError: '',
cssOpt: {
tabSize: 4,
mode: 'text/css',
theme: 'lesser-dark',
lineNumbers: true,
line: false,
foldCode: true,
highlightSelectionMatches: {
showToken: /\w/,
annotateScrollbar: true
},
hintOptions: {
completeSingle: false
},
keyMap: 'sublime',
matchBrackets: true,
showCursorWhenSelecting: true,
extraKeys: {
Ctrl: 'autocomplete'
}
},
jsOpt: {
tabSize: 4,
mode: 'text/javascript',
theme: 'lesser-dark',
lineNumbers: true,
line: false,
foldGutter: true,
foldCode: true,
lineWrapping: true,
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
highlightSelectionMatches: {
showToken: /\w/,
annotateScrollbar: true
},
hintOptions: {
completeSingle: false
},
keyMap: 'sublime',
matchBrackets: true,
showCursorWhenSelecting: true,
extraKeys: {
Ctrl: 'autocomplete'
}
},
htmlOpt: {
tabSize: 4,
mode: 'text/html',
theme: 'lesser-dark',
lineNumbers: true,
line: false,
foldGutter: true,
foldCode: true,
lineWrapping: true,
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
highlightSelectionMatches: {
showToken: /\w/,
annotateScrollbar: true
},
hintOptions: {
completeSingle: false
},
keyMap: 'sublime',
matchBrackets: true,
showCursorWhenSelecting: true,
extraKeys: {
Ctrl: 'autocomplete'
}
}
};
},
beforeMount: function beforeMount() {
this.getBsettings();
},
mounted: function mounted() {
this.newSettings = JSON.stringify(this.settings);
this.setBtnText();
},
methods: _extends({}, (0, _vuex.mapActions)(['saveBsettings', 'getBsettings']), {
setBtnText: function setBtnText() {
var type = window.uicore_post_type;
if (type == 'post') {
this.type = 'Blog Posts';
} else if (type == 'portfolio') {
this.type = 'Portfolio Items';
} else if (type == 'product') {
this.type = 'Products';
}
if (this.type != null) {
this.btn_text = 'Apply to all ' + this.type;
}
},
initApplyOptions: function initApplyOptions() {
this.applyStatus = 'done';
window.alert('API in work');
},
addPreload: function addPreload() {
this.settings.performance_preload.push({ url: '', as: '' });
},
removePreload: function removePreload(index) {
this.settings.performance_preload.splice(index, 1);
},
setMedia: function setMedia(key) {
var frame = wp.media({ multiple: false });
var _this = this;
frame.open().on('select', function () {
_this.settings[key] = frame.state().get('selection').first().toJSON().url;
console.log(frame.state().get('selection').first().toJSON().url);
console.log(_this.settings[key]);
});
},
unsetMedia: function unsetMedia(key) {
this.settings[key] = '';
}
}),
computed: _extends({}, (0, _vuex.mapState)({
uicoreSettings: stat
}), {
getMainColor: function getMainColor() {
var color = '#532df5'; //to_color
if (this.uicoreSettings.admin_customizer === 'true' && this.uicoreSettings.to_color) {
color = this.uicoreSettings.to_color;
}
return '--uicore-primary:' + color;
}
}),
watch: {
settings: {
handler: function handler(value) {
//check if this.settings.customjs contains