mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Various changes
- added `/:paletteSlug/:resolution` functionality for localhost testing - created `currFile.sublayers` for *things that should zoom with the canvas layers* - `currFile.layers` now solely contains the canvas layers - added `getProjectData` to `FileManager`'s exported methods --- - added `FileManager.localStorageSave` (it's basically just: localStorage.setItem("lpe-cache",FileManager.getProjectData())) - added `FileManager.localStorageCheck` (it's basically just: `!!localStorage.getItem("lpe-cache")`) - added `FileManager.localStorageLoad` (it's basically just: `return localStorage.getItem("lpe-cache")`) - added `FileManager.localStorageReset` (for debugging purity) --- - calling `FileManager.localStorageSave()` on mouse up (we should stress test this) --- - changed lpe file format to `{canvasWidth:number,canvasHeight:number,selectedLayer:number,colors:[],layers:[]}` - added backward compatibility for the old lpe file format --- - added some canvas utility functions in `canvas_util` - added Unsettled's color similarity utility functions in `color_util2` --- - html boilerplate - wang tiles - - POC - tiny text boilerplate - POC - tiny text font scraper --- - WIP - added two optional url route parameters `/:paletteSlug/:resolution/:prefillWidth/:prefillBinaryStr` - WIP POC - hbs_parser.js (outputs tree data about hbs file relationships)
This commit is contained in:
@ -127,7 +127,7 @@
|
||||
decodedKey = decodeURIComponent(key);
|
||||
} catch (e) {
|
||||
if (console && typeof console.error === 'function') {
|
||||
console.error('Could not decode cookie with key "' + key + '"', e);
|
||||
//console.error('Could not decode cookie with key "' + key + '"', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ if (!window.jscolor) { window.jscolor = (function () {
|
||||
|
||||
|
||||
init : function () {
|
||||
//console.log('init()')
|
||||
//////console.log('init()')
|
||||
if (jsc.jscolor.lookupClass) {
|
||||
jsc.jscolor.installByClassName(jsc.jscolor.lookupClass);
|
||||
}
|
||||
@ -533,7 +533,7 @@ if (!window.jscolor) { window.jscolor = (function () {
|
||||
|
||||
|
||||
onDocumentMouseDown : function (e) {
|
||||
//console.log(e)
|
||||
//////console.log(e)
|
||||
|
||||
if (!e) { e = window.event; }
|
||||
var target = e.target || e.srcElement;
|
||||
@ -547,7 +547,7 @@ if (!window.jscolor) { window.jscolor = (function () {
|
||||
} else {
|
||||
// Mouse is outside the picker controls -> hide the color picker!
|
||||
if (jsc.picker && jsc.picker.owner) {
|
||||
//console.log(e.target,'=====================================')
|
||||
//////console.log(e.target,'=====================================')
|
||||
//if they clicked on the delete button [lospec]
|
||||
if (e.target.className == 'delete-color-button') {
|
||||
new HistoryState().DeleteColor(jsc.picker.owner.toString());
|
||||
@ -555,13 +555,13 @@ if (!window.jscolor) { window.jscolor = (function () {
|
||||
ColorModule.deleteColor(jsc.picker.owner.styleElement);
|
||||
}
|
||||
else if (e.target.className == 'jscolor-picker-bottom') {
|
||||
//console.log('clicked color picker bottom')
|
||||
//////console.log('clicked color picker bottom')
|
||||
}
|
||||
else if (e.target.parentElement.classList.contains('jscolor-picker-bottom')) {
|
||||
//console.log('clicked element in color picker bottom')
|
||||
//////console.log('clicked element in color picker bottom')
|
||||
}
|
||||
else {
|
||||
//console.log('clicked outside of color picker')
|
||||
//////console.log('clicked outside of color picker')
|
||||
//unhide hidden edit button [lospec]
|
||||
var hiddenButton = document.querySelector('.color-edit-button.hidden');
|
||||
if (hiddenButton) hiddenButton.classList.remove('hidden');
|
||||
@ -1068,7 +1068,7 @@ if (!window.jscolor) { window.jscolor = (function () {
|
||||
|
||||
|
||||
this.hide = function () {
|
||||
///console.log(this.styleElement)
|
||||
///////console.log(this.styleElement)
|
||||
if (isPickerOwner()) {
|
||||
//set the color to old color, in case the color is a duplicate that hasn't been resolved yet [lospec]
|
||||
var hexInput = document.getElementById('jscolor-hex-input');
|
||||
@ -1164,7 +1164,7 @@ if (!window.jscolor) { window.jscolor = (function () {
|
||||
if (this.hash) { value = '#' + value; }
|
||||
|
||||
if (jsc.isElementType(this.valueElement, 'input')) {
|
||||
//console.log('SETTING VALUE')
|
||||
//////console.log('SETTING VALUE')
|
||||
//this sets the value element's value
|
||||
this.valueElement.value = value;
|
||||
} else {
|
||||
@ -1439,7 +1439,7 @@ function detachPicker () {
|
||||
|
||||
function drawPicker () {
|
||||
|
||||
//console.log('drawPicker ()')
|
||||
//////console.log('drawPicker ()')
|
||||
// At this point, when drawing the picker, we know what the parent elements are
|
||||
// and we can do all related DOM operations, such as registering events on them
|
||||
// or checking their positioning
|
||||
@ -1811,7 +1811,7 @@ function isPickerOwner () {
|
||||
|
||||
|
||||
function blurValue () {
|
||||
//console.log('blurValue()')
|
||||
//////console.log('blurValue()')
|
||||
THIS.importColor();
|
||||
}
|
||||
|
||||
@ -1842,7 +1842,7 @@ this.valueElement = jsc.fetchElement(this.valueElement);
|
||||
// Find the style element
|
||||
this.styleElement = jsc.fetchElement(this.styleElement);
|
||||
|
||||
//console.log('VALUE ELEMENT: ', this.valueElement)
|
||||
//////console.log('VALUE ELEMENT: ', this.valueElement)
|
||||
|
||||
var THIS = this;
|
||||
var container =
|
||||
@ -1894,7 +1894,7 @@ do {
|
||||
|
||||
if (jsc.isElementType(this.valueElement, 'input')) {
|
||||
var updateField = function () {
|
||||
//console.log('updateField()')
|
||||
//////console.log('updateField()')
|
||||
THIS.fromString(THIS.valueElement.value, jsc.leaveValue);
|
||||
jsc.dispatchFineChange(THIS);
|
||||
};
|
||||
|
Reference in New Issue
Block a user