mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added what's new window
This commit is contained in:
@@ -40,11 +40,14 @@ function closeDialogue () {
|
||||
popups[i].style.display = 'none';
|
||||
}
|
||||
|
||||
dialogueOpen = false;
|
||||
|
||||
if (currentOpenDialogue == "palette-block") {
|
||||
pbAddToSimplePalette();
|
||||
}
|
||||
|
||||
dialogueOpen = false;
|
||||
else if (currentOpenDialogue == "features-log") {
|
||||
showDialogue("new-pixel");
|
||||
}
|
||||
}
|
||||
|
||||
/** Closes a dialogue window if the user clicks everywhere but in the current window
|
||||
|
||||
4
js/_featuresLog.js
Normal file
4
js/_featuresLog.js
Normal file
@@ -0,0 +1,4 @@
|
||||
if (settings.showLog || settings.showLog == undefined) {
|
||||
console.log("Ok");
|
||||
showDialogue("features-log", false);
|
||||
}
|
||||
@@ -8,5 +8,6 @@ window.onload = function(){
|
||||
newPixel(getValue('size-width'),getValue('size-height'), getValue('editor-mode'));
|
||||
else
|
||||
//otherwise show the new pixel dialog
|
||||
showDialogue('new-pixel', false);
|
||||
};
|
||||
if (settings.showLog != undefined && !settings.showLog)
|
||||
showDialogue('new-pixel', false);
|
||||
};
|
||||
@@ -9,6 +9,7 @@ var settingsFromCookie = Cookies.get('pixelEditorSettings');
|
||||
if(!settingsFromCookie) {
|
||||
console.log('settings cookie not found');
|
||||
settings = {
|
||||
showLog: true,
|
||||
switchToChangedColor: true,
|
||||
enableDynamicCursorOutline: true, //unused - performance
|
||||
enableBrushPreview: true, //unused - performance
|
||||
@@ -26,8 +27,9 @@ else{
|
||||
console.log(settings);
|
||||
|
||||
//on clicking the save button in the settings dialog
|
||||
on('click', 'save-settings', function (){
|
||||
on('click', 'save-settings', saveSettings);
|
||||
|
||||
function saveSettings() {
|
||||
//check if values are valid
|
||||
if (isNaN(getValue('setting-numberOfHistoryStates'))) {
|
||||
alert('Invalid value for numberOfHistoryStates');
|
||||
@@ -37,6 +39,7 @@ on('click', 'save-settings', function (){
|
||||
//save new settings to settings object
|
||||
settings.numberOfHistoryStates = getValue('setting-numberOfHistoryStates');
|
||||
settings.pixelGridColour = getValue('setting-pixelGridColour');
|
||||
settings.showLog = false;
|
||||
// Filling pixel grid again if colour changed
|
||||
fillPixelGrid();
|
||||
|
||||
@@ -46,4 +49,4 @@ on('click', 'save-settings', function (){
|
||||
|
||||
//close window
|
||||
closeDialogue();
|
||||
});
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
//=include _colorChanged.js
|
||||
//=include _initColor.js
|
||||
//=include _dialogue.js
|
||||
//=include _featuresLog.js
|
||||
//=include _updateCursor.js
|
||||
//=include _drawLine.js
|
||||
//=include _getCursorPosition.js
|
||||
|
||||
Reference in New Issue
Block a user