From f0c7e1e194f6973f1f7d3bb60cec0653966f3f25 Mon Sep 17 00:00:00 2001 From: vickzkater Date: Tue, 29 Dec 2020 16:08:06 +0700 Subject: [PATCH] Add vendor autosize & update kiniditech-pagebuilder --- app/Libraries/CustomFunction.php | 34 +- public/admin/vendors/autosize/.bower.json | 39 + public/admin/vendors/autosize/.gitignore | 2 + public/admin/vendors/autosize/LICENSE.md | 21 + public/admin/vendors/autosize/bower.json | 29 + public/admin/vendors/autosize/build.js | 87 + public/admin/vendors/autosize/changelog.md | 72 + .../admin/vendors/autosize/dist/autosize.js | 254 ++ .../vendors/autosize/dist/autosize.min.js | 6 + .../admin/vendors/autosize/example/index.html | 29 + public/admin/vendors/autosize/package.json | 49 + public/admin/vendors/autosize/readme.md | 35 + public/admin/vendors/autosize/src/autosize.js | 218 ++ .../vendors/kiniditech-pagebuilder/README.md | 19 +- .../pagebuilder-form.js | 2150 ++++++++++------- .../pagebuilder-page.js | 92 +- .../_form_element/autosize/script.blade.php | 9 + .../_form_element/pagebuilder/css.blade.php | 4 +- .../_form_element/pagebuilder/form.blade.php | 1 + .../_form_element/pagebuilder/page.blade.php | 1 + .../views/_template_adm/master.blade.php | 7 + .../views/admin/system/config/form.blade.php | 9 +- 22 files changed, 2254 insertions(+), 913 deletions(-) create mode 100644 public/admin/vendors/autosize/.bower.json create mode 100644 public/admin/vendors/autosize/.gitignore create mode 100644 public/admin/vendors/autosize/LICENSE.md create mode 100644 public/admin/vendors/autosize/bower.json create mode 100644 public/admin/vendors/autosize/build.js create mode 100644 public/admin/vendors/autosize/changelog.md create mode 100644 public/admin/vendors/autosize/dist/autosize.js create mode 100644 public/admin/vendors/autosize/dist/autosize.min.js create mode 100644 public/admin/vendors/autosize/example/index.html create mode 100644 public/admin/vendors/autosize/package.json create mode 100644 public/admin/vendors/autosize/readme.md create mode 100644 public/admin/vendors/autosize/src/autosize.js create mode 100644 resources/views/_form_element/autosize/script.blade.php create mode 100644 resources/views/_form_element/pagebuilder/form.blade.php create mode 100644 resources/views/_form_element/pagebuilder/page.blade.php diff --git a/app/Libraries/CustomFunction.php b/app/Libraries/CustomFunction.php index 04e3483..ffa4b66 100644 --- a/app/Libraries/CustomFunction.php +++ b/app/Libraries/CustomFunction.php @@ -325,6 +325,10 @@ function set_input_form2($type, $input_name, $label_name, $data, $errors, $requi if (isset($config->rows)) { $textarea_rows = $config->rows; } + // config for textarea + if (isset($config->autosize)) { + $textarea_autosize = true; + } // config for switch if (isset($config->default)) { $default = $config->default; @@ -421,12 +425,17 @@ function set_input_form2($type, $input_name, $label_name, $data, $errors, $requi break; case 'textarea': - $attr = ''; // set rows attribute + $attr = ''; if (isset($textarea_rows)) { $attr = 'rows="' . (int) $textarea_rows . '"'; } - $input_element = ''; + // set autosize + $autosize = ''; + if (isset($textarea_autosize) && $textarea_autosize == true) { + $autosize = 'resizable_textarea'; + } + $input_element = ''; break; case 'switch': @@ -601,7 +610,26 @@ function set_input_form2($type, $input_name, $label_name, $data, $errors, $requi case 'file': $input_element = ''; if (!empty($value)) { - $input_element .= '' . asset($value) . ' '; + // validate $value is local path or link + $string = filter_var($value, FILTER_VALIDATE_URL); + // for sanitize (">) ('>) + if ($string == 34 || $string == 39 || $string == false) { + // local path + $url_value = asset($value); + } else { + $headers = get_headers($value); + $value_is_url = stripos($headers[0], "200 OK") ? true : false; + + if ($value_is_url) { + // link + $url_value = $value; + } else { + // local path + $url_value = asset($value); + } + } + + $input_element .= '' . $url_value . ' '; if ($delete) { $input_element .= ' 
'; $input_element .= ' '; diff --git a/public/admin/vendors/autosize/.bower.json b/public/admin/vendors/autosize/.bower.json new file mode 100644 index 0000000..dbe849c --- /dev/null +++ b/public/admin/vendors/autosize/.bower.json @@ -0,0 +1,39 @@ +{ + "name": "autosize", + "description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.", + "dependencies": {}, + "keywords": [ + "textarea", + "form", + "ui" + ], + "authors": [ + { + "name": "Jack Moore", + "url": "http://www.jacklmoore.com", + "email": "hello@jacklmoore.com" + } + ], + "license": "MIT", + "homepage": "http://www.jacklmoore.com/autosize", + "ignore": [], + "repository": { + "type": "git", + "url": "http://github.com/jackmoore/autosize.git" + }, + "main": "dist/autosize.js", + "moduleType": [ + "amd", + "node" + ], + "version": "3.0.15", + "_release": "3.0.15", + "_resolution": { + "type": "version", + "tag": "3.0.15", + "commit": "82ba655a20a5939e93d967c883a3c413973bc480" + }, + "_source": "https://github.com/jackmoore/autosize.git", + "_target": "^3.0.15", + "_originalSource": "autosize" +} \ No newline at end of file diff --git a/public/admin/vendors/autosize/.gitignore b/public/admin/vendors/autosize/.gitignore new file mode 100644 index 0000000..c383b36 --- /dev/null +++ b/public/admin/vendors/autosize/.gitignore @@ -0,0 +1,2 @@ +node_modules/* +test/* \ No newline at end of file diff --git a/public/admin/vendors/autosize/LICENSE.md b/public/admin/vendors/autosize/LICENSE.md new file mode 100644 index 0000000..2de673b --- /dev/null +++ b/public/admin/vendors/autosize/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jack Moore + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/public/admin/vendors/autosize/bower.json b/public/admin/vendors/autosize/bower.json new file mode 100644 index 0000000..f6aa4bc --- /dev/null +++ b/public/admin/vendors/autosize/bower.json @@ -0,0 +1,29 @@ +{ + "name": "autosize", + "description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.", + "dependencies": {}, + "keywords": [ + "textarea", + "form", + "ui" + ], + "authors": [ + { + "name": "Jack Moore", + "url": "http://www.jacklmoore.com", + "email": "hello@jacklmoore.com" + } + ], + "license": "MIT", + "homepage": "http://www.jacklmoore.com/autosize", + "ignore": [], + "repository": { + "type": "git", + "url": "http://github.com/jackmoore/autosize.git" + }, + "main": "dist/autosize.js", + "moduleType": [ + "amd", + "node" + ] +} \ No newline at end of file diff --git a/public/admin/vendors/autosize/build.js b/public/admin/vendors/autosize/build.js new file mode 100644 index 0000000..bab0cd6 --- /dev/null +++ b/public/admin/vendors/autosize/build.js @@ -0,0 +1,87 @@ +var pkg = require('./package.json'); +var fs = require('fs'); +var ugly = require('uglify-js'); +var jshint = require('jshint').JSHINT; +var babel = require('babel'); +var gaze = require('gaze'); + +function writeBower() { + var bower = { + name: pkg.config.bower.name, + description: pkg.description, + dependencies: pkg.dependencies, + keywords: pkg.keywords, + authors: [pkg.author], + license: pkg.license, + homepage: pkg.homepage, + ignore: pkg.config.bower.ignore, + repository: pkg.repository, + main: pkg.main, + moduleType: pkg.config.bower.moduleType, + }; + fs.writeFile('bower.json', JSON.stringify(bower, null, '\t')); + return true; +} + +function lint(full) { + jshint(full.toString(), { + browser: true, + undef: true, + unused: true, + immed: true, + eqeqeq: true, + eqnull: true, + noarg: true, + predef: ['define', 'module', 'exports', 'Set'] + }); + + if (jshint.errors.length) { + jshint.errors.forEach(function (err) { + console.log(err.line+':'+err.character+' '+err.reason); + }); + } else { + console.log('linted') + } + + return true; +} + +function build(code) { + var minified = ugly.minify(code, {fromString: true}).code; + var header = [ + '/*!', + ' '+pkg.config.title+' '+pkg.version, + ' license: MIT', + ' '+pkg.homepage, + '*/', + '' + ].join('\n'); + + fs.writeFile('dist/'+pkg.config.filename+'.js', header+code); + fs.writeFile('dist/'+pkg.config.filename+'.min.js', header+minified); + writeBower(); + + console.log('dist built'); +} + +function transform(filepath) { + babel.transformFile(filepath, {modules: 'umd'}, function (err,res) { + if (err) { + return console.log(err); + } else { + lint(res.code); + build(res.code); + } + }); +} + +gaze('src/'+pkg.config.filename+'.js', function(err, watcher){ + // On file changed + this.on('changed', function(filepath) { + transform(filepath); + }); + + console.log('watching'); +}); + +transform('src/'+pkg.config.filename+'.js'); \ No newline at end of file diff --git a/public/admin/vendors/autosize/changelog.md b/public/admin/vendors/autosize/changelog.md new file mode 100644 index 0000000..30df43b --- /dev/null +++ b/public/admin/vendors/autosize/changelog.md @@ -0,0 +1,72 @@ +## Changelog + +##### v.3.0.15 - 2016-1-26 +* Used newer Event constructor, when available. Fixes #280. + +##### v.3.0.14 - 2015-11-11 +* Fixed memory leak on destroy. Merged #271, fixes #270. +* Fixed bug in old versions of Firefox (1-5), fixes #246. + +##### v.3.0.13 - 2015-09-26 +* Fixed scroll-bar jumpiness in iOS. Merged #261, fixes #207. +* Fixed reflowing of initial text in Chrome and Safari. + +##### v.3.0.12 - 2015-09-14 +* Merged changes were discarded when building new dist files. Merged #255, Fixes #257 for real this time. + +##### v.3.0.11 - 2015-09-14 +* Fixed regression from 3.0.10 that caused an error with ES5 browsers. Merged #255, Fixes #257. + +##### v.3.0.10 - 2015-09-10 +* Removed data attribute as a way of tracking which elements autosize has been assigned to. fixes #254, fixes #200. + +##### v.3.0.9 - 2015-09-02 +* Fixed issue with assigning autosize to detached nodes. Merged #253, Fixes #234. + +##### v.3.0.8 - 2015-06-29 +* Fixed the `autosize:resized` event not being triggered when the overflow changes. Fixes #244. + +##### v.3.0.7 - 2015-06-29 +* Fixed jumpy behavior in Windows 8.1 mobile. Fixes #239. + +##### v.3.0.6 - 2015-05-19 +* Renamed 'dest' folder to 'dist' to follow common conventions. + +##### v.3.0.5 - 2015-05-18 +* Do nothing in Node.js environment. + +##### v.3.0.4 - 2015-05-05 +* Added options object for indicating if the script should set the overflowX and overflowY. The default behavior lets the script control the overflows, which will normalize the appearance between browsers. Fixes #220. + +##### v.3.0.3 - 2015-04-23 +* Avoided adjusting the height for hidden textarea elements. Fixes #155. + +##### v.3.0.2 - 2015-04-23 +* Reworked to respect max-height of any unit-type. Fixes #191. + +##### v.3.0.1 - 2015-04-23 +* Fixed the destroy event so that it removes its own event handler. Fixes #218. + +##### v.3.0.0 - 2015-04-15 +* Added new methods for updating and destroying: + + * autosize.update(elements) + * autosize.destroy(elements) + +* Renamed custom events as to not use jQuery's custom events namespace: + + * autosize.resized renamed to autosize:resized + * autosize.update renamed to autosize:update + * autosize.destroy renamed to autosize:destroy + +##### v.2.0.1 - 2015-04-15 +* Version bump for NPM publishing purposes + +##### v.2.0.0 - 2015-02-25 + +* Smaller, simplier code-base +* New API. Example usage: `autosize(document.querySelectorAll(textarea));` +* Dropped jQuery dependency +* Dropped IE7-IE8 support +* Dropped optional parameters +* Closes #98, closes #106, closes #123, fixes #129, fixes #132, fixes #139, closes #140, closes #166, closes #168, closes #192, closes #193, closes #197 \ No newline at end of file diff --git a/public/admin/vendors/autosize/dist/autosize.js b/public/admin/vendors/autosize/dist/autosize.js new file mode 100644 index 0000000..c807509 --- /dev/null +++ b/public/admin/vendors/autosize/dist/autosize.js @@ -0,0 +1,254 @@ +/*! + Autosize 3.0.15 + license: MIT + http://www.jacklmoore.com/autosize +*/ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + define(['exports', 'module'], factory); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod); + global.autosize = mod.exports; + } +})(this, function (exports, module) { + 'use strict'; + + var set = typeof Set === 'function' ? new Set() : (function () { + var list = []; + + return { + has: function has(key) { + return Boolean(list.indexOf(key) > -1); + }, + add: function add(key) { + list.push(key); + }, + 'delete': function _delete(key) { + list.splice(list.indexOf(key), 1); + } }; + })(); + + var createEvent = function createEvent(name) { + return new Event(name); + }; + try { + new Event('test'); + } catch (e) { + // IE does not support `new Event()` + createEvent = function (name) { + var evt = document.createEvent('Event'); + evt.initEvent(name, true, false); + return evt; + }; + } + + function assign(ta) { + var _ref = arguments[1] === undefined ? {} : arguments[1]; + + var _ref$setOverflowX = _ref.setOverflowX; + var setOverflowX = _ref$setOverflowX === undefined ? true : _ref$setOverflowX; + var _ref$setOverflowY = _ref.setOverflowY; + var setOverflowY = _ref$setOverflowY === undefined ? true : _ref$setOverflowY; + + if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return; + + var heightOffset = null; + var overflowY = null; + var clientWidth = ta.clientWidth; + + function init() { + var style = window.getComputedStyle(ta, null); + + overflowY = style.overflowY; + + if (style.resize === 'vertical') { + ta.style.resize = 'none'; + } else if (style.resize === 'both') { + ta.style.resize = 'horizontal'; + } + + if (style.boxSizing === 'content-box') { + heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); + } else { + heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); + } + // Fix when a textarea is not on document body and heightOffset is Not a Number + if (isNaN(heightOffset)) { + heightOffset = 0; + } + + update(); + } + + function changeOverflow(value) { + { + // Chrome/Safari-specific fix: + // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space + // made available by removing the scrollbar. The following forces the necessary text reflow. + var width = ta.style.width; + ta.style.width = '0px'; + // Force reflow: + /* jshint ignore:start */ + ta.offsetWidth; + /* jshint ignore:end */ + ta.style.width = width; + } + + overflowY = value; + + if (setOverflowY) { + ta.style.overflowY = value; + } + + resize(); + } + + function resize() { + var htmlTop = window.pageYOffset; + var bodyTop = document.body.scrollTop; + var originalHeight = ta.style.height; + + ta.style.height = 'auto'; + + var endHeight = ta.scrollHeight + heightOffset; + + if (ta.scrollHeight === 0) { + // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. + ta.style.height = originalHeight; + return; + } + + ta.style.height = endHeight + 'px'; + + // used to check if an update is actually necessary on window.resize + clientWidth = ta.clientWidth; + + // prevents scroll-position jumping + document.documentElement.scrollTop = htmlTop; + document.body.scrollTop = bodyTop; + } + + function update() { + var startHeight = ta.style.height; + + resize(); + + var style = window.getComputedStyle(ta, null); + + if (style.height !== ta.style.height) { + if (overflowY !== 'visible') { + changeOverflow('visible'); + } + } else { + if (overflowY !== 'hidden') { + changeOverflow('hidden'); + } + } + + if (startHeight !== ta.style.height) { + var evt = createEvent('autosize:resized'); + ta.dispatchEvent(evt); + } + } + + var pageResize = function pageResize() { + if (ta.clientWidth !== clientWidth) { + update(); + } + }; + + var destroy = (function (style) { + window.removeEventListener('resize', pageResize, false); + ta.removeEventListener('input', update, false); + ta.removeEventListener('keyup', update, false); + ta.removeEventListener('autosize:destroy', destroy, false); + ta.removeEventListener('autosize:update', update, false); + set['delete'](ta); + + Object.keys(style).forEach(function (key) { + ta.style[key] = style[key]; + }); + }).bind(ta, { + height: ta.style.height, + resize: ta.style.resize, + overflowY: ta.style.overflowY, + overflowX: ta.style.overflowX, + wordWrap: ta.style.wordWrap }); + + ta.addEventListener('autosize:destroy', destroy, false); + + // IE9 does not fire onpropertychange or oninput for deletions, + // so binding to onkeyup to catch most of those events. + // There is no way that I know of to detect something like 'cut' in IE9. + if ('onpropertychange' in ta && 'oninput' in ta) { + ta.addEventListener('keyup', update, false); + } + + window.addEventListener('resize', pageResize, false); + ta.addEventListener('input', update, false); + ta.addEventListener('autosize:update', update, false); + set.add(ta); + + if (setOverflowX) { + ta.style.overflowX = 'hidden'; + ta.style.wordWrap = 'break-word'; + } + + init(); + } + + function destroy(ta) { + if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; + var evt = createEvent('autosize:destroy'); + ta.dispatchEvent(evt); + } + + function update(ta) { + if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; + var evt = createEvent('autosize:update'); + ta.dispatchEvent(evt); + } + + var autosize = null; + + // Do nothing in Node.js environment and IE8 (or lower) + if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') { + autosize = function (el) { + return el; + }; + autosize.destroy = function (el) { + return el; + }; + autosize.update = function (el) { + return el; + }; + } else { + autosize = function (el, options) { + if (el) { + Array.prototype.forEach.call(el.length ? el : [el], function (x) { + return assign(x, options); + }); + } + return el; + }; + autosize.destroy = function (el) { + if (el) { + Array.prototype.forEach.call(el.length ? el : [el], destroy); + } + return el; + }; + autosize.update = function (el) { + if (el) { + Array.prototype.forEach.call(el.length ? el : [el], update); + } + return el; + }; + } + + module.exports = autosize; +}); \ No newline at end of file diff --git a/public/admin/vendors/autosize/dist/autosize.min.js b/public/admin/vendors/autosize/dist/autosize.min.js new file mode 100644 index 0000000..4cd8eed --- /dev/null +++ b/public/admin/vendors/autosize/dist/autosize.min.js @@ -0,0 +1,6 @@ +/*! + Autosize 3.0.15 + license: MIT + http://www.jacklmoore.com/autosize +*/ +!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);p=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),c="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(c)&&(c=0),i()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,p=t,f&&(e.style.overflowY=t),o()}function o(){var t=window.pageYOffset,n=document.body.scrollTop,o=e.style.height;e.style.height="auto";var i=e.scrollHeight+c;return 0===e.scrollHeight?void(e.style.height=o):(e.style.height=i+"px",v=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=n))}function i(){var t=e.style.height;o();var i=window.getComputedStyle(e,null);if(i.height!==e.style.height?"visible"!==p&&n("visible"):"hidden"!==p&&n("hidden"),t!==e.style.height){var r=d("autosize:resized");e.dispatchEvent(r)}}var s=void 0===arguments[1]?{}:arguments[1],a=s.setOverflowX,l=void 0===a?!0:a,u=s.setOverflowY,f=void 0===u?!0:u;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var c=null,p=null,v=e.clientWidth,h=function(){e.clientWidth!==v&&i()},y=function(t){window.removeEventListener("resize",h,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",y,!1),e.removeEventListener("autosize:update",i,!1),r["delete"](e),Object.keys(t).forEach(function(n){e.style[n]=t[n]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",y,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",h,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),r.add(e),l&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function o(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:destroy");e.dispatchEvent(t)}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=d("autosize:update");e.dispatchEvent(t)}}var r="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),d=function(e){return new Event(e)};try{new Event("test")}catch(s){d=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e}),t.exports=a}); \ No newline at end of file diff --git a/public/admin/vendors/autosize/example/index.html b/public/admin/vendors/autosize/example/index.html new file mode 100644 index 0000000..fdcdba1 --- /dev/null +++ b/public/admin/vendors/autosize/example/index.html @@ -0,0 +1,29 @@ + + + + + Simple Autosize for textareas + + + +

max-height 300px

+ + +

no max-height

+ + + + + diff --git a/public/admin/vendors/autosize/package.json b/public/admin/vendors/autosize/package.json new file mode 100644 index 0000000..18ef012 --- /dev/null +++ b/public/admin/vendors/autosize/package.json @@ -0,0 +1,49 @@ +{ + "name": "autosize", + "description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.", + "version": "3.0.15", + "keywords": [ + "textarea", + "form", + "ui" + ], + "files": [ + "dist", + "src" + ], + "author": { + "name": "Jack Moore", + "url": "http://www.jacklmoore.com", + "email": "hello@jacklmoore.com" + }, + "main": "dist/autosize.js", + "license": "MIT", + "homepage": "http://www.jacklmoore.com/autosize", + "demo": "http://www.jacklmoore.com/autosize", + "repository": { + "type": "git", + "url": "http://github.com/jackmoore/autosize.git" + }, + "dependencies": {}, + "devDependencies": { + "babel": "^5.4.3", + "gaze": "^0.5.1", + "jshint": "^2.5.6", + "uglify-js": "^2.4.22" + }, + "config": { + "bower": { + "name": "autosize", + "ignore": [], + "moduleType": [ + "amd", + "node" + ] + }, + "title": "Autosize", + "filename": "autosize" + }, + "scripts": { + "build": "node build" + } +} diff --git a/public/admin/vendors/autosize/readme.md b/public/admin/vendors/autosize/readme.md new file mode 100644 index 0000000..3857829 --- /dev/null +++ b/public/admin/vendors/autosize/readme.md @@ -0,0 +1,35 @@ +## Summary + +Autosize is a small, stand-alone script to automatically adjust textarea height to fit text. + +#### Demo + +Full documentation and a demo can be found at [jacklmoore.com/autosize](http://jacklmoore.com/autosize) + +#### Install via NPM +```bash +npm install autosize +``` + +#### Browser compatibility + +Chrome | Firefox | IE | Safari | iOS Safari | Android | Opera Mini | Windows Phone IE +------ | --------|----|--------|------------|---------|------------|------------------ +yes | yes | 9 | yes | yes | 4 | ? | 8.1 + +#### Usage + +The autosize function accepts a single textarea element, or an array or array-like object (such as a NodeList or jQuery collection) of textarea elements. + +```javascript +// from a NodeList +autosize(document.querySelectorAll('textarea')); + +// from a single Node +autosize(document.querySelector('textarea')); + +// from a jQuery collection +autosize($('textarea')); +``` + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php) diff --git a/public/admin/vendors/autosize/src/autosize.js b/public/admin/vendors/autosize/src/autosize.js new file mode 100644 index 0000000..d0e47ce --- /dev/null +++ b/public/admin/vendors/autosize/src/autosize.js @@ -0,0 +1,218 @@ +const set = (typeof Set === "function") ? new Set() : (function () { + const list = []; + + return { + has(key) { + return Boolean(list.indexOf(key) > -1); + }, + add(key) { + list.push(key); + }, + delete(key) { + list.splice(list.indexOf(key), 1); + }, + } +})(); + +let createEvent = (name)=> new Event(name); +try { + new Event('test'); +} catch(e) { + // IE does not support `new Event()` + createEvent = (name)=> { + const evt = document.createEvent('Event'); + evt.initEvent(name, true, false); + return evt; + }; +} + +function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) { + if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return; + + let heightOffset = null; + let overflowY = null; + let clientWidth = ta.clientWidth; + + function init() { + const style = window.getComputedStyle(ta, null); + + overflowY = style.overflowY; + + if (style.resize === 'vertical') { + ta.style.resize = 'none'; + } else if (style.resize === 'both') { + ta.style.resize = 'horizontal'; + } + + if (style.boxSizing === 'content-box') { + heightOffset = -(parseFloat(style.paddingTop)+parseFloat(style.paddingBottom)); + } else { + heightOffset = parseFloat(style.borderTopWidth)+parseFloat(style.borderBottomWidth); + } + // Fix when a textarea is not on document body and heightOffset is Not a Number + if (isNaN(heightOffset)) { + heightOffset = 0; + } + + update(); + } + + function changeOverflow(value) { + { + // Chrome/Safari-specific fix: + // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space + // made available by removing the scrollbar. The following forces the necessary text reflow. + const width = ta.style.width; + ta.style.width = '0px'; + // Force reflow: + /* jshint ignore:start */ + ta.offsetWidth; + /* jshint ignore:end */ + ta.style.width = width; + } + + overflowY = value; + + if (setOverflowY) { + ta.style.overflowY = value; + } + + resize(); + } + + function resize() { + const htmlTop = window.pageYOffset; + const bodyTop = document.body.scrollTop; + const originalHeight = ta.style.height; + + ta.style.height = 'auto'; + + let endHeight = ta.scrollHeight+heightOffset; + + if (ta.scrollHeight === 0) { + // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. + ta.style.height = originalHeight; + return; + } + + ta.style.height = endHeight+'px'; + + // used to check if an update is actually necessary on window.resize + clientWidth = ta.clientWidth; + + // prevents scroll-position jumping + document.documentElement.scrollTop = htmlTop; + document.body.scrollTop = bodyTop; + } + + function update() { + const startHeight = ta.style.height; + + resize(); + + const style = window.getComputedStyle(ta, null); + + if (style.height !== ta.style.height) { + if (overflowY !== 'visible') { + changeOverflow('visible'); + } + } else { + if (overflowY !== 'hidden') { + changeOverflow('hidden'); + } + } + + if (startHeight !== ta.style.height) { + const evt = createEvent('autosize:resized'); + ta.dispatchEvent(evt); + } + } + + const pageResize = () => { + if (ta.clientWidth !== clientWidth) { + update(); + } + }; + + const destroy = style => { + window.removeEventListener('resize', pageResize, false); + ta.removeEventListener('input', update, false); + ta.removeEventListener('keyup', update, false); + ta.removeEventListener('autosize:destroy', destroy, false); + ta.removeEventListener('autosize:update', update, false); + set.delete(ta); + + Object.keys(style).forEach(key => { + ta.style[key] = style[key]; + }); + }.bind(ta, { + height: ta.style.height, + resize: ta.style.resize, + overflowY: ta.style.overflowY, + overflowX: ta.style.overflowX, + wordWrap: ta.style.wordWrap, + }); + + ta.addEventListener('autosize:destroy', destroy, false); + + // IE9 does not fire onpropertychange or oninput for deletions, + // so binding to onkeyup to catch most of those events. + // There is no way that I know of to detect something like 'cut' in IE9. + if ('onpropertychange' in ta && 'oninput' in ta) { + ta.addEventListener('keyup', update, false); + } + + window.addEventListener('resize', pageResize, false); + ta.addEventListener('input', update, false); + ta.addEventListener('autosize:update', update, false); + set.add(ta); + + if (setOverflowX) { + ta.style.overflowX = 'hidden'; + ta.style.wordWrap = 'break-word'; + } + + init(); +} + +function destroy(ta) { + if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; + const evt = createEvent('autosize:destroy'); + ta.dispatchEvent(evt); +} + +function update(ta) { + if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; + const evt = createEvent('autosize:update'); + ta.dispatchEvent(evt); +} + +let autosize = null; + +// Do nothing in Node.js environment and IE8 (or lower) +if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') { + autosize = el => el; + autosize.destroy = el => el; + autosize.update = el => el; +} else { + autosize = (el, options) => { + if (el) { + Array.prototype.forEach.call(el.length ? el : [el], x => assign(x, options)); + } + return el; + }; + autosize.destroy = el => { + if (el) { + Array.prototype.forEach.call(el.length ? el : [el], destroy); + } + return el; + }; + autosize.update = el => { + if (el) { + Array.prototype.forEach.call(el.length ? el : [el], update); + } + return el; + }; +} + +export default autosize; diff --git a/public/admin/vendors/kiniditech-pagebuilder/README.md b/public/admin/vendors/kiniditech-pagebuilder/README.md index 1ab9088..74ce05e 100644 --- a/public/admin/vendors/kiniditech-pagebuilder/README.md +++ b/public/admin/vendors/kiniditech-pagebuilder/README.md @@ -11,8 +11,7 @@ Developed by [KINIDI Tech](https://kiniditech.com/) ([@vickzkater](https://github.com/vickzkater/)) on June 2020 -## Support Content Elements: - +## PageBuilder (Build pages using content elements) - Text (Rich Text Editor / WYSIWYG HTML Editor) - Image - Image & Text (Rich Text Editor / WYSIWYG HTML Editor) @@ -20,6 +19,22 @@ Developed by [KINIDI Tech](https://kiniditech.com/) ([@vickzkater](https://githu - Video & Text (Rich Text Editor / WYSIWYG HTML Editor) - Plain Text +## PageBuilder - Form (Build form pages using content elements) + - Multiple Choice (Text) + - Multiple Choice (Image) + - Checkboxes (Text) + - Dropdown + - Linear Scale + +## PageBuilder - Landing Page (Build landing pages using content elements) + - Masthead (Support Multiple Item) + - Text (Support 3 Items) + - Image (Support Multiple Item) + - Image + Text + Button (Support 3 Items) + - Video (Video Only or Video + Text + Button) + - Button (Support Multiple Item) + - Plain Text + ## Documentation Coming soon diff --git a/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-form.js b/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-form.js index 5634dc8..8c32daf 100644 --- a/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-form.js +++ b/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-form.js @@ -20,933 +20,1279 @@ * - Linear Scale */ -function add_question(type, collapsed = false, identifier = 0, data = '', config = '', options = '', required = false) { - var html_content_element = ''; - - switch (type) { - case 'multiple_choice_text': - html_content_element = set_html_multiple_choice_text(collapsed, identifier, data, config, options, required); - break; - case 'multiple_choice_image': - html_content_element = set_html_multiple_choice_image(collapsed, identifier, data, config, options, required); - break; - case 'checkboxes_text': - html_content_element = set_html_checkboxes_text(collapsed, identifier, data, config, options, required); - break; - case 'drop-down': - html_content_element = set_html_dropdown(collapsed, identifier, data, config, options, required); - break; - case 'linear_scale': - html_content_element = set_html_linear_scale(collapsed, identifier, data, config, options, required); - break; - } - - $(content_container).append(html_content_element); - - // initialize sortable - $(".sortable-option").sortable(); +function add_question(type, collapsed = false, identifier = 0, data = '', config = '', options = '', required = false, mission_type = 'questionnaire') { + var html_content_element = ''; + + switch (type) { + case 'multiple_choice_text': + html_content_element = set_html_multiple_choice_text(collapsed, identifier, data, config, options, required, mission_type); + break; + case 'multiple_choice_image': + html_content_element = set_html_multiple_choice_image(collapsed, identifier, data, config, options, required, mission_type); + break; + case 'checkboxes_text': + html_content_element = set_html_checkboxes_text(collapsed, identifier, data, config, options, required); + break; + case 'drop-down': + html_content_element = set_html_dropdown(collapsed, identifier, data, config, options, required, mission_type); + break; + case 'linear_scale': + html_content_element = set_html_linear_scale(collapsed, identifier, data, config, options, required); + break; + } + + $("#content-pagebuilder").append(html_content_element); + + // initialize sortable + $(".sortable-option").sortable(); } function show_question_element_media(id) { - var media_elm = $('#question_media_' + id).val(); + var media_elm = $('#question_media_' + id).val(); - $('.media-question-' + id).hide(); + $('.media-question-' + id).hide(); - if (media_elm == 'youtube') { - $('#media-question-youtube-' + id).show(); - } else if (media_elm == 'image') { - $('#media-question-image-' + id).show(); - } + if (media_elm == 'youtube') { + $('#media-question-youtube-' + id).show(); + } else if (media_elm == 'image') { + $('#media-question-image-' + id).show(); + } } function delete_option(id) { - if (confirm("Are you sure to delete this option (this action can't be undone) ?")) { - $('#v_option_' + id).remove(); - return true; - } - return false; + if (confirm("Are you sure to delete this option (this action can't be undone) ?")) { + $('#v_option_' + id).remove(); + return true; + } + return false; } -function add_multiple_option_text(id) { - var uniqid = Date.now(); - // GET TOTAL OPTIONS - var total_opt = document.getElementsByClassName('option-' + id).length; - var next_opt = parseInt(total_opt) + 1; - - var html = ''; - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - - $("#list-option-" + id).append(html); +function add_multiple_option_text(id, mission_type = '') { + var uniqid = Date.now(); + // GET TOTAL OPTIONS + var total_opt = document.getElementsByClassName('option-' + id).length; + var next_opt = parseInt(total_opt) + 1; + + var html = ''; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + + $("#list-option-" + id).append(html); } -function add_multiple_option_image(id) { - var uniqid = Date.now(); - var default_value = '{{ asset("/images/no-image.png") }}'; - var html = ''; - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += ''; - html += '
'; - html += '
'; - - $("#list-option-" + id).append(html); +function add_multiple_option_image(id, mission_type = '') { + var uniqid = Date.now(); + var default_value = '{{ asset("/images/no-image.png") }}'; + var html = ''; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + + $("#list-option-" + id).append(html); } // SET CONTENT ELEMENT BELOW ********* -function set_html_multiple_choice_text(collapsed, identifier, data, config, options, required) { - if (identifier == 0) { - var uniqid = Date.now(); - } else { - var uniqid = identifier; - } - var default_value = '{{ asset("/images/no-image.png") }}'; - - var question_text = ''; - var question_media = ''; - var select_image = ''; - var select_youtube = ''; - var question_src = ''; - var question_src_image = default_value; - var question_src_youtube = ''; - var points_per_item = ''; - var is_required_yes = ''; - var is_required_no = 'selected'; - if (data != '') { - data = JSON.parse(data); - question_text = data.question_text; - question_media = data.question_media; - question_src = data.question_src; - if (question_media == 'image') { - select_image = 'selected'; - question_src_image = '{{ asset("uploads/mission") }}/' + question_src; - } else if (question_media == 'youtube') { - select_youtube = 'selected'; - question_src_youtube = question_src; - } - points_per_item = data.points_per_item; - is_required = data.is_required; - if (is_required == 1) { - is_required_yes = 'selected'; - is_required_no = ''; - } - } - - var opt_other_yes = ''; - var opt_other_no = 'selected'; - if (config != '') { - config = JSON.parse(config); - opt_other = config.opt_other; - if (opt_other == 1) { - opt_other_yes = 'selected'; - opt_other_no = ''; - } - } - - var html = '
'; - html += ''; - html += ''; - - if (collapsed) { - html += ''; - } - - html += '

Multiple Choice (Text) - ' + question_text + '

'; - html += '
'; - - if (collapsed) { - html += '
'; - } else { - html += '
'; - } - - html += '
'; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += ''; - - html += ''; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ' Add Option'; - html += '
'; - html += '
'; - - html += '
'; - if (options != '') { - options = JSON.parse(options); - $.each(options, function(key, value) { - var i = key + 1; - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - }); - } else { - for (i = 1; i <= 4; i++) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - } - } - html += '
'; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - if (required) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - } - - html += '
'; - html += '
'; - html += '
'; - - return html; +function set_html_text(collapsed) { + var uniqid = Date.now(); + + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Text - Section

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + return html; } -function set_html_multiple_choice_image(collapsed, identifier, data, config, options, required) { - if (identifier == 0) { - var uniqid = Date.now(); - } else { - var uniqid = identifier; - } - var default_value = '{{ asset("/images/no-image.png") }}'; - - var question_text = ''; - var question_media = ''; - var select_image = ''; - var select_youtube = ''; - var question_src = ''; - var question_src_image = default_value; - var question_src_youtube = ''; - var points_per_item = ''; - var is_required_yes = ''; - var is_required_no = 'selected'; - if (data != '') { - data = JSON.parse(data); - question_text = data.question_text; - question_media = data.question_media; - question_src = data.question_src; - if (question_media == 'image') { - select_image = 'selected'; - question_src_image = '{{ asset("uploads/mission") }}/' + question_src; - } else if (question_media == 'youtube') { - select_youtube = 'selected'; - question_src_youtube = question_src; - } - points_per_item = data.points_per_item; - is_required = data.is_required; - if (is_required == 1) { - is_required_yes = 'selected'; - is_required_no = ''; - } - } - - var opt_other_yes = ''; - var opt_other_no = 'selected'; - if (config != '') { - config = JSON.parse(config); - opt_other = config.opt_other; - if (opt_other == 1) { - opt_other_yes = 'selected'; - opt_other_no = ''; - } - } - - var html = '
'; - html += ''; - html += ''; - - if (collapsed) { - html += ''; - } - - html += '

Multiple Choice (Image) - ' + question_text + '

'; - html += '
'; - - if (collapsed) { - html += '
'; - } else { - html += '
'; - } - - html += '
'; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += ''; - - html += ''; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ' Add Option'; - html += '
'; - html += '
'; - - html += '
'; - if (options != '') { - options = JSON.parse(options); - $.each(options, function(key, value) { - var i = key + 1; - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += ''; - html += '
'; - html += '
'; - html += ''; - }); - } else { - for (i = 1; i <= 4; i++) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += ''; - html += '
'; - html += '
'; - } - } - html += '
'; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - if (required) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - } - - html += '
'; - html += '
'; - html += '
'; - - return html; +function set_html_image(collapsed) { + var uniqid = Date.now(); + var default_value = '{{ asset("/images/no-image.png") }}'; + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Image - Section

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + return html; +} + +function set_html_image_text(collapsed) { + var uniqid = Date.now(); + var default_value = '{{ asset("/images/no-image.png") }}'; + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Image & Text - Section

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + return html; +} + +function set_html_video(collapsed) { + var uniqid = Date.now(); + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Video - Section

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + return html; +} + +function set_html_video_text(collapsed) { + var uniqid = Date.now(); + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Video & Text - Section

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + return html; +} + +function set_html_plaintext(collapsed) { + var uniqid = Date.now(); + + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Plain Text - Section

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + return html; +} + +// SET CONTENT ELEMENT QUESTION BELOW ********* + +function set_html_multiple_choice_text(collapsed, identifier, data, config, options, required, mission_type) { + if (identifier == 0) { + var uniqid = Date.now(); + } else { + var uniqid = identifier; + } + var default_value = '{{ asset("/images/no-image.png") }}'; + + var question_text = ''; + var question_media = ''; + var select_image = ''; + var select_youtube = ''; + var question_src = ''; + var question_src_image = default_value; + var question_src_youtube = ''; + var points_per_item = ''; + var is_required_yes = ''; + var is_required_no = 'selected'; + var answer = ''; + if (data != '') { + data = JSON.parse(data); + question_text = data.question_text; + question_media = data.question_media; + question_src = data.question_src; + if (question_media == 'image') { + select_image = 'selected'; + question_src_image = '{{ asset("uploads/mission") }}/' + question_src; + } else if (question_media == 'youtube') { + select_youtube = 'selected'; + question_src_youtube = question_src; + } + points_per_item = data.points_per_item; + is_required = data.is_required; + if (is_required == 1) { + is_required_yes = 'selected'; + is_required_no = ''; + } + answer = data.answer; + } + + var opt_other_yes = ''; + var opt_other_no = 'selected'; + if (config != '') { + config = JSON.parse(config); + opt_other = config.opt_other; + if (opt_other == 1) { + opt_other_yes = 'selected'; + opt_other_no = ''; + } + } + + var html = '
'; + html += ''; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Multiple Choice (Text) - ' + question_text + '

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += ''; + + html += ''; + + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ' Add Option'; + html += '
'; + html += '
'; + + html += '
'; + if (options != '') { + options = JSON.parse(options); + $.each(options, function(key, value) { + var i = key + 1; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + if(i == answer) { + checked = 'checked'; + } + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + }); + } else { + for (i = 1; i <= 4; i++) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + if(i == 1) { + checked = 'checked'; + } + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + } + } + html += '
'; + + html += '
'; + + if (mission_type == 'quiz') { + + html += '
'; + html += ''; + html += '
'; + html += '
'; + } else { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + if (required) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + html += '
'; + html += '
'; + html += '
'; + + return html; +} + +function set_html_multiple_choice_image(collapsed, identifier, data, config, options, required, mission_type) { + if (identifier == 0) { + var uniqid = Date.now(); + } else { + var uniqid = identifier; + } + var default_value = '{{ asset("/images/no-image.png") }}'; + + var question_text = ''; + var question_media = ''; + var select_image = ''; + var select_youtube = ''; + var question_src = ''; + var question_src_image = default_value; + var question_src_youtube = ''; + var points_per_item = ''; + var is_required_yes = ''; + var is_required_no = 'selected'; + var answer = ''; + if (data != '') { + data = JSON.parse(data); + question_text = data.question_text; + question_media = data.question_media; + question_src = data.question_src; + if (question_media == 'image') { + select_image = 'selected'; + question_src_image = '{{ asset("uploads/mission") }}/' + question_src; + } else if (question_media == 'youtube') { + select_youtube = 'selected'; + question_src_youtube = question_src; + } + points_per_item = data.points_per_item; + is_required = data.is_required; + if (is_required == 1) { + is_required_yes = 'selected'; + is_required_no = ''; + } + answer = data.answer; + } + + var opt_other_yes = ''; + var opt_other_no = 'selected'; + if (config != '') { + config = JSON.parse(config); + opt_other = config.opt_other; + if (opt_other == 1) { + opt_other_yes = 'selected'; + opt_other_no = ''; + } + } + + var html = '
'; + html += ''; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Multiple Choice (Image) - ' + question_text + '

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += ''; + + html += ''; + + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ' Add Option'; + html += '
'; + html += '
'; + + html += '
'; + if (options != '') { + options = JSON.parse(options); + $.each(options, function(key, value) { + var i = key + 1; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + if(i == answer) { + checked = 'checked'; + } + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + html += ''; + }); + } else { + for (i = 1; i <= 4; i++) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + if(i == 1) { + checked = 'checked'; + } + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + } + } + html += '
'; + + html += '
'; + + if (mission_type == 'quiz') { + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + if (required) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + html += '
'; + html += '
'; + html += '
'; + + return html; } function set_html_checkboxes_text(collapsed, identifier, data, config, options, required) { - if (identifier == 0) { - var uniqid = Date.now(); - } else { - var uniqid = identifier; - } - var default_value = '{{ asset("/images/no-image.png") }}'; - - var question_text = ''; - var question_media = ''; - var select_image = ''; - var select_youtube = ''; - var question_src = ''; - var question_src_image = default_value; - var question_src_youtube = ''; - var points_per_item = ''; - var is_required_yes = ''; - var is_required_no = 'selected'; - if (data != '') { - data = JSON.parse(data); - question_text = data.question_text; - question_media = data.question_media; - question_src = data.question_src; - if (question_media == 'image') { - select_image = 'selected'; - question_src_image = '{{ asset("uploads/mission") }}/' + question_src; - } else if (question_media == 'youtube') { - select_youtube = 'selected'; - question_src_youtube = question_src; - } - points_per_item = data.points_per_item; - is_required = data.is_required; - if (is_required == 1) { - is_required_yes = 'selected'; - is_required_no = ''; - } - } - - var opt_other_yes = ''; - var opt_other_no = 'selected'; - if (config != '') { - config = JSON.parse(config); - opt_other = config.opt_other; - if (opt_other == 1) { - opt_other_yes = 'selected'; - opt_other_no = ''; - } - } - - var html = '
'; - html += ''; - html += ''; - - if (collapsed) { - html += ''; - } - - html += '

Checkboxes - ' + question_text + '

'; - html += '
'; - - if (collapsed) { - html += '
'; - } else { - html += '
'; - } - - html += '
'; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += ''; - - html += ''; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ' Add Option'; - html += '
'; - html += '
'; - - html += '
'; - if (options != '') { - options = JSON.parse(options); - $.each(options, function(key, value) { - var i = key + 1; - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - }); - } else { - for (i = 1; i <= 4; i++) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - } - } - html += '
'; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - if (required) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - } - - html += '
'; - html += '
'; - html += '
'; - - return html; + if (identifier == 0) { + var uniqid = Date.now(); + } else { + var uniqid = identifier; + } + var default_value = '{{ asset("/images/no-image.png") }}'; + + var question_text = ''; + var question_media = ''; + var select_image = ''; + var select_youtube = ''; + var question_src = ''; + var question_src_image = default_value; + var question_src_youtube = ''; + var points_per_item = ''; + var is_required_yes = ''; + var is_required_no = 'selected'; + if (data != '') { + data = JSON.parse(data); + question_text = data.question_text; + question_media = data.question_media; + question_src = data.question_src; + if (question_media == 'image') { + select_image = 'selected'; + question_src_image = '{{ asset("uploads/mission") }}/' + question_src; + } else if (question_media == 'youtube') { + select_youtube = 'selected'; + question_src_youtube = question_src; + } + points_per_item = data.points_per_item; + is_required = data.is_required; + if (is_required == 1) { + is_required_yes = 'selected'; + is_required_no = ''; + } + } + + var opt_other_yes = ''; + var opt_other_no = 'selected'; + if (config != '') { + config = JSON.parse(config); + opt_other = config.opt_other; + if (opt_other == 1) { + opt_other_yes = 'selected'; + opt_other_no = ''; + } + } + + var html = '
'; + html += ''; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Checkboxes - ' + question_text + '

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += ''; + + html += ''; + + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ' Add Option'; + html += '
'; + html += '
'; + + html += '
'; + if (options != '') { + options = JSON.parse(options); + $.each(options, function(key, value) { + var i = key + 1; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + html += '
'; + }); + } else { + for (i = 1; i <= 4; i++) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + html += '
'; + } + } + html += '
'; + + html += '
'; + + // html += '
'; + // html += ''; + // html += '
'; + // html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + if (required) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + html += '
'; + html += '
'; + html += '
'; + + return html; } -function set_html_dropdown(collapsed, identifier, data, config, options, required) { - if (identifier == 0) { - var uniqid = Date.now(); - } else { - var uniqid = identifier; - } - var default_value = '{{ asset("/images/no-image.png") }}'; - - var question_text = ''; - var question_media = ''; - var select_image = ''; - var select_youtube = ''; - var question_src = ''; - var question_src_image = default_value; - var question_src_youtube = ''; - var points_per_item = ''; - var is_required_yes = ''; - var is_required_no = 'selected'; - if (data != '') { - data = JSON.parse(data); - question_text = data.question_text; - question_media = data.question_media; - question_src = data.question_src; - if (question_media == 'image') { - select_image = 'selected'; - question_src_image = '{{ asset("uploads/mission") }}/' + question_src; - } else if (question_media == 'youtube') { - select_youtube = 'selected'; - question_src_youtube = question_src; - } - points_per_item = data.points_per_item; - is_required = data.is_required; - if (is_required == 1) { - is_required_yes = 'selected'; - is_required_no = ''; - } - } - - var opt_other_yes = ''; - var opt_other_no = 'selected'; - if (config != '') { - config = JSON.parse(config); - opt_other = config.opt_other; - if (opt_other == 1) { - opt_other_yes = 'selected'; - opt_other_no = ''; - } - } - - var html = '
'; - html += ''; - html += ''; - - if (collapsed) { - html += ''; - } - - html += '

Drop-down - ' + question_text + '

'; - html += '
'; - - if (collapsed) { - html += '
'; - } else { - html += '
'; - } - - html += '
'; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += ''; - - html += ''; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ' Add Option'; - html += '
'; - html += '
'; - - html += '
'; - if (options != '') { - options = JSON.parse(options); - $.each(options, function(key, value) { - var i = key + 1; - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - }); - } else { - for (i = 1; i <= 4; i++) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += ''; - html += '
'; - html += '
'; - } - } - html += '
'; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - if (required) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - } - - html += '
'; - html += '
'; - html += '
'; - - return html; +function set_html_dropdown(collapsed, identifier, data, config, options, required, mission_type) { + if (identifier == 0) { + var uniqid = Date.now(); + } else { + var uniqid = identifier; + } + var default_value = '{{ asset("/images/no-image.png") }}'; + + var question_text = ''; + var question_media = ''; + var select_image = ''; + var select_youtube = ''; + var question_src = ''; + var question_src_image = default_value; + var question_src_youtube = ''; + var points_per_item = ''; + var is_required_yes = ''; + var is_required_no = 'selected'; + var answer = ''; + if (data != '') { + data = JSON.parse(data); + question_text = data.question_text; + question_media = data.question_media; + question_src = data.question_src; + if (question_media == 'image') { + select_image = 'selected'; + question_src_image = '{{ asset("uploads/mission") }}/' + question_src; + } else if (question_media == 'youtube') { + select_youtube = 'selected'; + question_src_youtube = question_src; + } + points_per_item = data.points_per_item; + is_required = data.is_required; + if (is_required == 1) { + is_required_yes = 'selected'; + is_required_no = ''; + } + answer = data.answer + } + + var opt_other_yes = ''; + var opt_other_no = 'selected'; + if (config != '') { + config = JSON.parse(config); + opt_other = config.opt_other; + if (opt_other == 1) { + opt_other_yes = 'selected'; + opt_other_no = ''; + } + } + + var html = '
'; + html += ''; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Drop-down - ' + question_text + '

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += ''; + + html += ''; + + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ' Add Option'; + html += '
'; + html += '
'; + + html += '
'; + if (options != '') { + options = JSON.parse(options); + $.each(options, function(key, value) { + var i = key + 1; + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + if(i == answer) { + checked = 'checked'; + } + html += '
'; + html += ''; + html += '
'; + } + + html += '
'; + }); + } else { + for (i = 1; i <= 4; i++) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += ''; + html += '
'; + + if (mission_type == 'quiz') { + checked = ''; + if(i == 1) { + checked = 'checked'; + } + html += '
'; + html += ''; + html += '
'; + } + html += '
'; + } + } + html += '
'; + + html += '
'; + + if (mission_type == 'quiz') { + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + if (required) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + html += '
'; + html += '
'; + html += '
'; + + return html; } function set_html_linear_scale(collapsed, identifier, data, config, options, required) { - if (identifier == 0) { - var uniqid = Date.now(); - } else { - var uniqid = identifier; - } - var default_value = '{{ asset("/images/no-image.png") }}'; - - var question_text = ''; - var question_media = ''; - var select_image = ''; - var select_youtube = ''; - var question_src = ''; - var question_src_image = default_value; - var question_src_youtube = ''; - var points_per_item = ''; - var is_required_yes = ''; - var is_required_no = 'selected'; - if (data != '') { - data = JSON.parse(data); - question_text = data.question_text; - question_media = data.question_media; - question_src = data.question_src; - if (question_media == 'image') { - select_image = 'selected'; - question_src_image = '{{ asset("uploads/mission") }}/' + question_src; - } else if (question_media == 'youtube') { - select_youtube = 'selected'; - question_src_youtube = question_src; - } - points_per_item = data.points_per_item; - is_required = data.is_required; - if (is_required == 1) { - is_required_yes = 'selected'; - is_required_no = ''; - } - } - - var opt_other_yes = ''; - var opt_other_no = 'selected'; - var start_from_0 = ''; - var start_from_1 = 'selected'; - var total_opt = 0; - if (config != '') { - config = JSON.parse(config); - opt_other = config.opt_other; - if (opt_other == 1) { - opt_other_yes = 'selected'; - opt_other_no = ''; - } - start_from = config.start_from; - if (start_from != 1) { - start_from_0 = 'selected'; - start_from_1 = ''; - } - total_opt = config.total_opt; - } - - var html = '
'; - html += ''; - html += ''; - - if (collapsed) { - html += ''; - } - - html += '

Linear Scale - ' + question_text + '

'; - html += '
'; - - if (collapsed) { - html += '
'; - } else { - html += '
'; - } - - html += '
'; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += ''; - - html += ''; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - - var start_from_label = ''; - var until_to_label = ''; - if (options != '') { - options = JSON.parse(options); - if (typeof options[0] !== 'undefined') { - start_from_label = options[0]; - } - if (typeof options[1] !== 'undefined') { - until_to_label = options[1]; - } - } - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - html += '
'; - - html += '
'; - html += ''; - html += '
'; - html += '
'; - - if (required) { - html += '
'; - html += ''; - html += '
'; - html += ''; - html += '
'; - html += '
'; - } - - html += '
'; - html += '
'; - html += '
'; - - return html; + if (identifier == 0) { + var uniqid = Date.now(); + } else { + var uniqid = identifier; + } + var default_value = '{{ asset("/images/no-image.png") }}'; + + var question_text = ''; + var question_media = ''; + var select_image = ''; + var select_youtube = ''; + var question_src = ''; + var question_src_image = default_value; + var question_src_youtube = ''; + var points_per_item = ''; + var is_required_yes = ''; + var is_required_no = 'selected'; + if (data != '') { + data = JSON.parse(data); + question_text = data.question_text; + question_media = data.question_media; + question_src = data.question_src; + if (question_media == 'image') { + select_image = 'selected'; + question_src_image = '{{ asset("uploads/mission") }}/' + question_src; + } else if (question_media == 'youtube') { + select_youtube = 'selected'; + question_src_youtube = question_src; + } + points_per_item = data.points_per_item; + is_required = data.is_required; + if (is_required == 1) { + is_required_yes = 'selected'; + is_required_no = ''; + } + } + + var opt_other_yes = ''; + var opt_other_no = 'selected'; + var start_from_0 = ''; + var start_from_1 = 'selected'; + var total_opt = 0; + if (config != '') { + config = JSON.parse(config); + opt_other = config.opt_other; + if (opt_other == 1) { + opt_other_yes = 'selected'; + opt_other_no = ''; + } + start_from = config.start_from; + if (start_from != 1) { + start_from_0 = 'selected'; + start_from_1 = ''; + } + total_opt = config.total_opt; + } + + var html = '
'; + html += ''; + html += ''; + + if (collapsed) { + html += ''; + } + + html += '

Linear Scale - ' + question_text + '

'; + html += '
'; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += ''; + + html += ''; + + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + var start_from_label = ''; + var until_to_label = ''; + if (options != '') { + options = JSON.parse(options); + if (typeof options[0] !== 'undefined') { + start_from_label = options[0]; + } + if (typeof options[1] !== 'undefined') { + until_to_label = options[1]; + } + } + + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + + + // html += '
'; + // html += ''; + // html += '
'; + // html += '
'; + + if (required) { + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + } + + html += '
'; + html += '
'; + html += '
'; + + return html; } diff --git a/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-page.js b/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-page.js index 338cc87..2b9f1a6 100644 --- a/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-page.js +++ b/public/admin/vendors/kiniditech-pagebuilder/pagebuilder-page.js @@ -1,6 +1,6 @@ /** * PageBuilder - Landing Page (Build landing pages using content elements) - * Version: 1.0.0 (2020-06-10) + * Version: 1.0.1 (2020-12-22) * * Copyright (c) KINIDI Tech and other contributors * Released under the MIT license. @@ -19,6 +19,7 @@ * - Image + Text + Button (Support 3 Items) * - Video (Video Only or Video + Text + Button) * - Button (Support Multiple Item) + * - Plain Text */ // SET OPTIONS FOR SECTION STYLE IN PAGEBUILDER @@ -191,6 +192,10 @@ function add_content_element_page(type, collapsed = false, identifier = 0, data html_content_element = set_element_page_button(collapsed, uniqid, data); break; + case "plain": + html_content_element = set_element_page_plain(collapsed, uniqid, data); + break; + default: alert("NO CONTENT ELEMENT TYPE SELECTED"); return false; @@ -226,6 +231,10 @@ function add_content_element_page(type, collapsed = false, identifier = 0, data case "video": initialize_tinymce('.page-element-text-editor'); break; + + case "button": + $('#list-button-'+uniqid).sortable(); + break; } } @@ -376,6 +385,7 @@ function add_masthead_item(section_page_id, uniqid, identifier = 0, data = "", d html += ''; html += ''; html += ''; + html += '
Recommended image size is 1920 x 720 px. Use images with same height if you have multiple images.'; html += '
'; html += '
'; @@ -386,6 +396,7 @@ function add_masthead_item(section_page_id, uniqid, identifier = 0, data = "", d html += ''; html += ''; html += ''; + html += '
Recommended image size is 800 x 800 px. Use images with same height if you have multiple images.'; html += '
'; html += '
'; @@ -573,7 +584,7 @@ function set_element_page_text(collapsed, uniqid, data) { v_page_element_status_inactive = "selected"; } v_page_element_width = data.v_page_element_width; - if (data.v_page_element_alignment == 'left') { + if (data.v_page_element_alignment == 'center') { v_page_element_alignment_center = 'selected'; } v_page_element_total_item = data.v_page_element_total_item; @@ -643,7 +654,7 @@ function set_element_page_text(collapsed, uniqid, data) { var max_items_text = 3; } html += '
'; - html += ''; + html += ''; html += '
'; html += ''; html += ''; + html += '
Recommended image size is 960 x 365 px for Slideshow and 960 x 640 px for Carousel. Use images with same dimensions if you have multiple images.'; html += '
'; html += '
'; @@ -1067,6 +1079,7 @@ function set_element_page_imagetextbutton(collapsed, uniqid, data) { html += ''; html += ''; html += ''; + html += '
It is recommended to resize your image to 800 px width to ensure best quality with minimum loading time.'; html += '
'; html += '
'; @@ -1201,6 +1214,7 @@ function set_element_page_imagetextbutton(collapsed, uniqid, data) { html += ''; html += ''; html += ''; + html += '
It is recommended to resize your image to 800 px width to ensure best quality with minimum loading time.'; html += '
'; html += '
'; @@ -1434,6 +1448,7 @@ function set_element_page_video(collapsed, uniqid, data) { html += ''; html += '
'; html += ''; + html += '
Embed a video from YouTube by copying and pasting the link here.'; html += '
'; html += '
'; @@ -1805,4 +1820,73 @@ function delete_button_item(id) { } return false; } -// BUTTON - END \ No newline at end of file +// BUTTON - END + +// PLAIN - BEGIN +function set_element_page_plain(collapsed, uniqid, data) { + var element_type = "plain"; + var element_type_title = "Script"; + var v_page_element_section = ""; + var v_page_element_status_inactive = ""; + var v_page_element_text = ""; + if (data != "") { + v_page_element_section = decodeURI(data.v_page_element_section); + if (data.v_page_element_status == 0) { + v_page_element_status_inactive = "selected"; + } + v_page_element_text = decodeURI(data.v_page_element_text); + } + + var html = '
'; + html += ''; + + if (collapsed) { + html += ''; + } + html += '

'+element_type_title+' - Section " + v_page_element_section + '

'; + html += "
"; + + if (collapsed) { + html += '
'; + } else { + html += '
'; + } + + html += '
'; + + // SECTION + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + // TEXT + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + // STATUS + html += '
'; + html += ''; + html += '
'; + html += ''; + html += '
'; + html += '
'; + + html += '
'; + html += '
'; + html += '
'; + + return html; +} +// PLAIN - END \ No newline at end of file diff --git a/resources/views/_form_element/autosize/script.blade.php b/resources/views/_form_element/autosize/script.blade.php new file mode 100644 index 0000000..329033d --- /dev/null +++ b/resources/views/_form_element/autosize/script.blade.php @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/resources/views/_form_element/pagebuilder/css.blade.php b/resources/views/_form_element/pagebuilder/css.blade.php index 03291b5..0f2107e 100644 --- a/resources/views/_form_element/pagebuilder/css.blade.php +++ b/resources/views/_form_element/pagebuilder/css.blade.php @@ -1,2 +1,4 @@ {{-- --}} - \ No newline at end of file + + + \ No newline at end of file diff --git a/resources/views/_form_element/pagebuilder/form.blade.php b/resources/views/_form_element/pagebuilder/form.blade.php new file mode 100644 index 0000000..d21bb90 --- /dev/null +++ b/resources/views/_form_element/pagebuilder/form.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/views/_form_element/pagebuilder/page.blade.php b/resources/views/_form_element/pagebuilder/page.blade.php new file mode 100644 index 0000000..384dbc3 --- /dev/null +++ b/resources/views/_form_element/pagebuilder/page.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/views/_template_adm/master.blade.php b/resources/views/_template_adm/master.blade.php index 3647742..34c0572 100644 --- a/resources/views/_template_adm/master.blade.php +++ b/resources/views/_template_adm/master.blade.php @@ -103,6 +103,13 @@ .nav.navbar-nav>li>a{ color :#143c6d !important; } + .top_nav .nav .open>a,.top_nav .nav .open>a:focus,.top_nav .nav .open>a:hover,.top_nav .nav>li>a:focus,.top_nav .nav>li>a:hover{ + background:#46a2db !important; + color: white !important; + } + #menu_toggle { + color: #143c6d !important; + } @yield('css') diff --git a/resources/views/admin/system/config/form.blade.php b/resources/views/admin/system/config/form.blade.php index 0ec47a7..0edb369 100644 --- a/resources/views/admin/system/config/form.blade.php +++ b/resources/views/admin/system/config/form.blade.php @@ -72,6 +72,7 @@ $config = new \stdClass(); $config->info_text = '  Enter a short description as Help popup content.'; + $config->autosize = true; echo set_input_form2('textarea', 'help', ucwords(lang('help', $translation)), $data, $errors, true, $config); echo set_input_form2('text', 'powered', ucwords(lang('powered by', $translation)), $data, $errors, false); @@ -82,7 +83,10 @@ @php echo set_input_form2('text', 'meta_title', ucwords(lang('meta title', $translation)), $data, $errors, true); - echo set_input_form2('textarea', 'meta_description', ucwords(lang('meta description', $translation)), $data, $errors, true); + + $config = new \stdClass(); + $config->autosize = true; + echo set_input_form2('textarea', 'meta_description', ucwords(lang('meta description', $translation)), $data, $errors, true, $config); echo set_input_form2('text', 'meta_author', ucwords(lang('meta author', $translation)), $data, $errors, true); echo set_input_form2('tags', 'meta_keywords', ucwords(lang('meta keywords', $translation)), $data, $errors, true); @endphp @@ -112,6 +116,7 @@ $config = new \stdClass(); $config->info_text = '  A one to two sentence description of your object.'; + $config->autosize = true; echo set_input_form2('textarea', 'og_description', ucwords(lang('open graph description', $translation)), $data, $errors, true, $config); @endphp @@ -179,6 +184,8 @@ @section('script') @include('_form_element.switchery.script') + + @include('_form_element.autosize.script') @include('_form_element.tagsinput.script') @endsection \ No newline at end of file