You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source from https://github.com/jelastic/jelastic-widget/blob/master/assets/js/jlcwidget.js// main functionfunctionCreateElement(tagName,attrs,text){constelement=document.createElement(tagName);if(attrs){for(letattributeinattrs){letvalue=attrs[attribute];if(attribute==='className'){attribute='class';}letelement_attribute=document.createAttribute(attribute);element_attribute.value=value;element.setAttributeNode(element_attribute);}}if(text){letelement_content=document.createTextNode(text);element.appendChild(element_content);}returnelement;}// create simple element with class constelNew=CreateElement('div',{className: 'element-class'});// appent element inside another constwrapper=document.querySelector('.wrapper');wrapper.appendChild(elNew);// create element with content, button for example constelButton=CreateElement('button',{className: 'button-class'},'Button Text');wrapper.appendChild(elButton);// create element with attributesconstelInput=CreateElement('input',{className: 'input-class',placeholder: '[email protected]',type: 'email',required: 'true'});wrapper.appendChild(elInput);
constmix=require('laravel-mix');/* |-------------------------------------------------------------------------- | Mix Asset Management |-------------------------------------------------------------------------- | | Mix provides a clean, fluent API for defining some Webpack build steps | for your Laravel application. By default, we are compiling the Sass | file for the application as well as bundling up all the JS files. | */mix.autoload({jquery: ['window.$','window.jQuery'],'popper.js/dist/umd/popper.js': ['Popper']}).js('resources/js/app.js','public/js').js('resources/js/vendor.js','public/js').sass('resources/sass/app.scss','public/css').options({processCssUrls: false}).version();if(process.env.MIX_BROWSER_SYNC_DOMAIN){mix.browserSync('traffic-school.local');}if(!mix.inProduction()){mix.sourceMaps().webpackConfig({devtool: 'source-map'});}```
/** * Define the chunk method in the prototype of an array * that returns an array with arrays of the given size. * * @param chunkSize {Integer} Size of every group */Object.defineProperty(Array.prototype,'chunk',{value: functionvalue(chunkSize){constthat=this;returnArray(Math.ceil(that.length/chunkSize)).fill().map((_,i)=>that.slice(i*chunkSize,i*chunkSize+chunkSize));},});