mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
jshint cleanup, move HTML to a template, add css classes
This commit is contained in:
parent
98527c6ded
commit
c0f7e7be52
@ -24,3 +24,13 @@
|
||||
color: white;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.save-status-warning-icon {
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.save-status-warning-icon {
|
||||
overflow: hidden;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
@ -54,9 +54,8 @@
|
||||
|
||||
ns.SaveController.prototype.updateSaveToGalleryMessage_ = function (spritesheetSize) {
|
||||
if (pskl.app.performanceReportService.hasProblem()) {
|
||||
document.querySelector('.save-online-status').innerHTML =
|
||||
'<div class="icon-common-warning-red" style="float:left; margin-top: 5px"> </div>' +
|
||||
'<div style="overflow: hidden; padding-left: 10px">Saving to the gallery might fail due to the sprite size.</div>';
|
||||
var warningPartial = pskl.utils.Template.get('save-gallery-warning-partial');
|
||||
document.querySelector('.save-online-status').innerHTML = warningPartial;
|
||||
}
|
||||
};
|
||||
|
||||
@ -76,7 +75,6 @@
|
||||
}
|
||||
|
||||
// Uncomment this line to test the online save section locally.
|
||||
return [PARTIALS.FILEDOWNLOAD, PARTIALS.LOCALSTORAGE, PARTIALS.GALLERY];
|
||||
return [PARTIALS.FILEDOWNLOAD, PARTIALS.LOCALSTORAGE, PARTIALS.GALLERY_UNAVAILABLE];
|
||||
};
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
var areChunksValid = function (chunks) {
|
||||
return chunks.length && chunks.every(function (chunk) {
|
||||
return chunk.base64PNG && chunk.base64PNG !== "data:,";
|
||||
return chunk.base64PNG && chunk.base64PNG !== 'data:,';
|
||||
});
|
||||
};
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
var renderer = new pskl.rendering.FramesheetRenderer(frames);
|
||||
return renderer.renderAsCanvas().toDataURL();
|
||||
} catch (e) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -26,12 +26,15 @@
|
||||
<div class="settings-title">Save online</div>
|
||||
<div class="settings-item">
|
||||
<input type="button" class="button button-primary" id="save-gallery-button" value="Save to your gallery" />
|
||||
<div class="save-status save-online-status">
|
||||
<div>Your piskel will be stored online in your gallery.</div>
|
||||
</div>
|
||||
<div class="save-status save-online-status">Your piskel will be stored online in your gallery.</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="save-gallery-warning-partial">
|
||||
<div class="save-status-warning-icon icon-common-warning-red"> </div>
|
||||
<div class="save-status-warning-text">Saving to the gallery might fail due to the sprite size.</div>
|
||||
</script>
|
||||
|
||||
<!-- save-gallery-unavailable-partial -->
|
||||
<script type="text/template" id="save-gallery-unavailable-partial">
|
||||
<div class="settings-title">Save online</div>
|
||||
|
Loading…
Reference in New Issue
Block a user