1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-04-08 12:52:34 +02:00

remove ported code from old files

This commit is contained in:
Kushagra Gour 2018-06-15 12:01:15 +05:30
parent c2e1d25d47
commit cbb33b12f4

View File

@ -1,75 +1,3 @@
const BASE_PATH = chrome.extension || window.DEBUG ? '/' : '/app';
const DEFAULT_PROFILE_IMG =
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='#ccc' d='M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z' /%3E%3C/svg%3E";
// Calculates the sizes of html, css & js code panes.
function getCodePaneSizes() {
var sizes;
var dimensionProperty =
currentLayoutMode === 2 || currentLayoutMode === 5 ? 'width' : 'height';
try {
sizes = [
htmlCode.style[dimensionProperty],
cssCode.style[dimensionProperty],
jsCode.style[dimensionProperty]
];
} catch (e) {
sizes = [33.33, 33.33, 33.33];
} finally {
/* eslint-disable no-unsafe-finally */
return sizes;
/* eslint-enable no-unsafe-finally */
}
}
// Calculates the current sizes of code & preview panes.
function getMainPaneSizes() {
var sizes;
var dimensionProperty = currentLayoutMode === 2 ? 'height' : 'width';
try {
sizes = [+$('#js-code-side').style[dimensionProperty].match(/([\d.]+)%/)[1], +$('#js-demo-side').style[dimensionProperty].match(/([\d.]+)%/)[1]];
} catch (e) {
sizes = [50, 50];
} finally {
/* eslint-disable no-unsafe-finally */
return sizes;
/* eslint-enable no-unsafe-finally */
}
}
/**
* Toggles a modal and logs an event.
* @param {Node} modal modal to be toggled
*/
scope.toggleModal = function (modal) {
if (hasOpened) {
/* eslint-disable no-inner-declarations */
function onTransitionEnd() {
modal.querySelector('.js-modal__close-btn').focus();
modal
.querySelector('.modal__content')
.removeEventListener('transitionend', onTransitionEnd);
}
/* eslint-enable no-inner-declarations */
modal
.querySelector('.modal__content')
.addEventListener('transitionend', onTransitionEnd);
}
};
/**
* Compiles directives on the given node
* @param {Node} root The element on which compilation is required
@ -84,7 +12,6 @@ function compileNodes(root) {
const query = selector => [...root.querySelectorAll(selector)];
// Compile d-open-modal directive
const modalTriggers = query(`[d-open-modal]`);
modalTriggers.forEach(function (el) {
@ -99,16 +26,6 @@ function compileNodes(root) {
}
function init() {
var lastCode;
document.body.style.height = `${window.innerHeight}px`;
new TextareaAutoComplete(externalJsTextarea, {
filter: obj => obj.latest.match(/\.js$/)
});
@ -144,8 +61,6 @@ function init() {
$('#demo-frame').classList.remove('pointer-none');
});
window.addEventListener('focusin', e => {
if (document.body.classList.contains('overlay-visible')) {
const modal = $('.is-modal-visible');