1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-05 04:47:32 +02:00

Merge branch 'master' into func

# Conflicts:
#	src/script.js
This commit is contained in:
MKFMIKU
2016-06-11 13:31:27 +08:00
5 changed files with 279 additions and 13 deletions

View File

@@ -1,3 +1,6 @@
chrome.browserAction.onClicked.addListener(function(activeTab) {
chrome.tabs.create({ url: chrome.extension.getURL('index.html'), selected: true });
chrome.browserAction.onClicked.addListener(function(){
chrome.tabs.create({
url: chrome.extension.getURL('index.html'),
selected: true
});
});

View File

@@ -302,7 +302,8 @@
<div>
<p>Made by <a href="https://twitter.com/chinchang457" target="_blank">Kushagra Gour</a></p>
<p>Tweet out your feature requests, comments & suggestions to <a href="https://twitter.com/chinchang457">@chinchang457</a>.</p>
<p>If you like this extension, support it by <a href="https://chrome.google.com/webstore/detail/lkfkkhfhhdkiemehlpkgjeojomhpccnh/" target="_blank">writing a review here</a>.</p>
<p>Like this extension? Please <a href="https://chrome.google.com/webstore/detail/web-maker/lkfkkhfhhdkiemehlpkgjeojomhpccnh/reviews" target="_blank">rate it here</a>.</p>
<p>Contribute on <a href="https://github.com/chinchang/web-maker">Github</a>.</p>
<p>
<h3>Awesome libraries used</h3>
@@ -316,7 +317,7 @@
<p>
<h3>License</h3>
"Web Maker" is licensed under <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/" target="_blank">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>
"Web Maker" is open-source under the <a href="https://opensource.org/licenses/MIT" target="_blank">MIT License</a>.
</p>
</div>
</div>

View File

@@ -1,6 +1,8 @@
/* eslint-disable no-extra-semi */
;(function () {
editur = window.editur || {};
/* eslint-enable no-extra-semi */
var editur = window.editur || {};
var $ = document.querySelector.bind(document);
var $all = document.querySelectorAll.bind(document);
@@ -10,7 +12,7 @@
, currentLayoutMode
, frame = $('#demo-frame')
, htmlCode = $('#js-html-code')
,cssCode = $('#js-css-code')
, cssCode = $('#js-css-code')
, jsCode = $('#js-js-code')
, layoutBtn1 = $('#js-layout-btn-1')
, layoutBtn2 = $('#js-layout-btn-2')
@@ -44,7 +46,7 @@
direction: (currentLayoutMode === 2 ? 'vertical' : 'horizontal')
});
}
window.toggleLayout = function (mode) {
function toggleLayout(mode) {
currentLayoutMode = mode;
$('#js-layout-btn-1').classList.remove('selected');
$('#js-layout-btn-2').classList.remove('selected');
@@ -58,12 +60,12 @@
resetSplitting();
}
window.saveSetting = function saveSetting(setting, value) {
function saveSetting(setting, value) {
var obj = {};
obj[setting] = value;
chrome.storage.local.set(obj, function() {
});
};
}
function saveCode() {
var code = {
@@ -79,7 +81,6 @@
};
editur.setPreviewContent = function () {
var self = this;
var html = editur.cm.html.getValue();
var css = editur.cm.css.getValue();
var js = editur.cm.js.getValue();
@@ -89,7 +90,7 @@
var fileWritten = false;
var blob = new Blob([ html ], {type : "text/plain;charset=UTF-8"});
var blob = new Blob([ html ], {type: "text/plain;charset=UTF-8"});
function errorHandler() { console.log(arguments); }
@@ -120,7 +121,7 @@
lineWrapping: true,
autofocus: options.autofocus || false,
autoCloseBrackets: true,
matchBrackets: true,
matchBrackets: true,
tabMode: 'indent',
keyMap: 'sublime',
theme: 'monokai',
@@ -185,6 +186,7 @@
event.preventDefault();
saveFile();
}
});
window.addEventListener('click', function(e) {
@@ -193,7 +195,7 @@
}
});
settingsBtn.addEventListener('click', function(e) {
settingsBtn.addEventListener('click', function() {
if (!chrome.runtime.openOptionsPage) {
// New way to open options pages, if supported (Chrome 42+).
// Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=601997