1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-27 00:30:09 +02:00
This commit is contained in:
Kushagra Gour
2017-11-19 18:22:08 +05:30
parent 6fac25c1e5
commit dbcb9ce3ff
3 changed files with 209 additions and 463 deletions

23
dist/index.html vendored
View File

@@ -4,8 +4,9 @@
<title>Web Maker</title> <title>Web Maker</title>
<link rel="stylesheet" href="vendor.css"> <link rel="stylesheet" href="vendor.css">
<link rel="stylesheet" id="editorThemeLinkTag" href="/lib/codemirror/theme/monokai.css"></link> <link rel="stylesheet" id="editorThemeLinkTag" href="lib/codemirror/theme/monokai.css"></link>
<!-- <link rel="stylesheet" id="editorThemeLinkTag" href="/dist/lib/codemirror/theme/monokai.css"></link> -->
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
@@ -14,7 +15,7 @@
font-family: 'fontname'; font-family: 'fontname';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: url(../fontname.ttf) format('truetype'); src: url(fontname.ttf) format('truetype');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }
.Codemirror pre { .Codemirror pre {
@@ -26,7 +27,7 @@
font-family: 'FiraCode'; font-family: 'FiraCode';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: url(../FiraCode.ttf) format('truetype'); src: url(FiraCode.ttf) format('truetype');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
} }
.Codemirror pre { .Codemirror pre {
@@ -203,7 +204,7 @@
<path d="M22,17V7H6V17H22M22,5A2,2 0 0,1 24,7V17C24,18.11 23.1,19 22,19H16V21H18V23H10V21H12V19H6C4.89,19 4,18.11 4,17V7A2,2 0 0,1 6,5H22M2,3V15H0V3A2,2 0 0,1 2,1H20V3H2Z" /> <path d="M22,17V7H6V17H22M22,5A2,2 0 0,1 24,7V17C24,18.11 23.1,19 22,19H16V21H18V23H10V21H12V19H6C4.89,19 4,18.11 4,17V7A2,2 0 0,1 6,5H22M2,3V15H0V3A2,2 0 0,1 2,1H20V3H2Z" />
</svg> </svg>
</a> </a>
<div class="footer__separator"></div> <div class="footer__separator"></div>
@@ -231,7 +232,7 @@
<!-- #00ACED --> <!-- #00ACED -->
<a class="footer__link hint--rounded hint--top-right" data-hint="Tweet about 'Web Maker'" href="http://twitter.com/share?url=https://webmakerapp.com/&text=Web Maker - A blazing fast %26 offline web playground! via @webmakerApp&related=webmakerApp&hashtags=web,playground,chrome,extension" target="_blank"> <a class="footer__link hint--rounded hint--top-right" data-hint="Tweet about 'Web Maker'" href="http://twitter.com/share?url=https://webmakerapp.com/&text=Web Maker - A blazing fast %26 offline web playground! via @webmakerApp&related=webmakerApp&hashtags=web,playground,chrome,extension" target="_blank">
<svg style="width:20px; height:20px; vertical-align:text-bottom"> <svg style="width:20px; height:20px; vertical-align:text-bottom">
<use xlink:href="#twitter-icon"></use> <use xlink:href="#twitter-icon"></use>
</svg> </svg>
</a> </a>
@@ -242,7 +243,7 @@
<div class="modal__content"> <div class="modal__content">
<a d-click="onModalCloseBtnClick" href="" aria-label="Close add library modal" title="Close" class="js-modal__close-btn modal__close-btn"> <a d-click="onModalCloseBtnClick" href="" aria-label="Close add library modal" title="Close" class="js-modal__close-btn modal__close-btn">
<svg> <svg>
<use xlink:href="#cross-icon"></use> <use xlink:href="#cross-icon"></use>
</svg> </svg>
</a> </a>
<h1>Add Library</h1> <h1>Add Library</h1>
@@ -272,7 +273,7 @@
<div class="modal__content"> <div class="modal__content">
<a d-click="onModalCloseBtnClick" href="" aria-label="Close CSS settings modal" title="Close" class="js-modal__close-btn modal__close-btn"> <a d-click="onModalCloseBtnClick" href="" aria-label="Close CSS settings modal" title="Close" class="js-modal__close-btn modal__close-btn">
<svg> <svg>
<use xlink:href="#cross-icon"></use> <use xlink:href="#cross-icon"></use>
</svg> </svg>
</a> </a>
<h1>Atomic CSS Settings</h1> <h1>Atomic CSS Settings</h1>
@@ -374,7 +375,7 @@
</div> </div>
</div> </div>
<p class="tac"> <p class="tac">
<button class="btn" d-click="closeAllOverlays">Lets start!</button> <button class="btn" d-click="closeAllOverlays">Lets start!</button>
</p> </p>
@@ -385,7 +386,7 @@
<div class="modal__content"> <div class="modal__content">
<a d-click="onModalCloseBtnClick" href="" aria-label="Close Settings" title="Close" class="js-modal__close-btn modal__close-btn"> <a d-click="onModalCloseBtnClick" href="" aria-label="Close Settings" title="Close" class="js-modal__close-btn modal__close-btn">
<svg> <svg>
<use xlink:href="#cross-icon"></use> <use xlink:href="#cross-icon"></use>
</svg> </svg>
</a> </a>
<h1>Settings</h1> <h1>Settings</h1>
@@ -502,7 +503,7 @@
</label> </label>
</div> </div>
</div> </div>
<hr> <hr>
<h3>Fun</h3> <h3>Fun</h3>

75
dist/script.js vendored
View File

@@ -1,71 +1,3 @@
/**
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-env browser */
'use strict';
if ('serviceWorker' in navigator) {
// Delay registration until after the page has loaded, to ensure that our
// precaching requests don't degrade the first visit experience.
// See https://developers.google.com/web/fundamentals/instant-and-offline/service-worker/registration
window.addEventListener('load', function() {
// Your service-worker.js *must* be located at the top-level directory relative to your site.
// It won't be able to control pages unless it's located at the same level or higher than them.
// *Don't* register service worker file in, e.g., a scripts/ sub-directory!
// See https://github.com/slightlyoff/ServiceWorker/issues/468
navigator.serviceWorker
.register('service-worker.js')
.then(function(reg) {
// updatefound is fired if service-worker.js changes.
reg.onupdatefound = function() {
// The updatefound event implies that reg.installing is set; see
// https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event
var installingWorker = reg.installing;
installingWorker.onstatechange = function() {
switch (installingWorker.state) {
case 'installed':
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and the fresh content will
// have been added to the cache.
// It's the perfect time to display a "New content is available; please refresh."
// message in the page's interface.
console.log('New or updated content is available.');
} else {
// At this point, everything has been precached.
// It's the perfect time to display a "Content is cached for offline use." message.
console.log('Content is now available offline!');
}
break;
case 'redundant':
console.error(
'The installing service worker became redundant.'
);
break;
}
};
};
})
.catch(function(e) {
console.error('Error during service worker registration:', e);
});
});
}
(function() { (function() {
window.DEBUG = document.cookie.indexOf('wmdebug') > -1; window.DEBUG = document.cookie.indexOf('wmdebug') > -1;
@@ -763,6 +695,7 @@ globalConsoleContainerEl
}; };
const AUTO_SAVE_INTERVAL = 15000; // 15 seconds const AUTO_SAVE_INTERVAL = 15000; // 15 seconds
const BASE_PATH = chrome.extension ? '/' : '/dist/';
var updateTimer, var updateTimer,
updateDelay = 500, updateDelay = 500,
@@ -1635,7 +1568,7 @@ globalConsoleContainerEl
'<script src="' + '<script src="' +
(chrome.extension (chrome.extension
? chrome.extension.getURL('lib/screenlog.js') ? chrome.extension.getURL('lib/screenlog.js')
: `${location.origin}/lib/screenlog.js`) + : `${location.origin}/${BASE_PATH}/lib/screenlog.js`) +
'"></script>'; '"></script>';
if (jsMode === JsModes.ES6) { if (jsMode === JsModes.ES6) {
@@ -2360,7 +2293,7 @@ globalConsoleContainerEl
// Replace correct css file in LINK tags's href // Replace correct css file in LINK tags's href
editorThemeLinkTag.href = editorThemeLinkTag.href =
'/lib/codemirror/theme/' + prefs.editorTheme + '.css'; `lib/codemirror/theme/${prefs.editorTheme}.css`;
fontStyleTag.textContent = fontStyleTemplate.textContent.replace( fontStyleTag.textContent = fontStyleTemplate.textContent.replace(
/fontname/g, /fontname/g,
(prefs.editorFont === 'other' (prefs.editorFont === 'other'
@@ -2619,7 +2552,7 @@ globalConsoleContainerEl
function init() { function init() {
var lastCode; var lastCode;
CodeMirror.modeURL = 'lib/codemirror/mode/%N/%N.js'; CodeMirror.modeURL = `${BASE_PATH}/lib/codemirror/mode/%N/%N.js`;
function getToggleLayoutButtonListener(mode) { function getToggleLayoutButtonListener(mode) {
return function() { return function() {

574
dist/service-worker.js vendored

File diff suppressed because one or more lines are too long