mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Rollback of initialization sequence
This commit is contained in:
15
index.html
15
index.html
@ -16,15 +16,16 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="css/preview-film-section.css">
|
<link rel="stylesheet" type="text/css" href="css/preview-film-section.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<script type="text/javascript" src="js/lib/iframeLoader.js"></script>
|
||||||
<div class="piskel-name-container">
|
<div class="piskel-name-container">
|
||||||
<input readonly id="piskel-name" type="text" value=""/>
|
<input readonly id="piskel-name" type="text" value=""/>
|
||||||
</div>
|
</div>
|
||||||
<div id="main-wrapper" class="main-wrapper">
|
<div id="main-wrapper" class="main-wrapper">
|
||||||
<iframe src="templates/drawing-tools.html" data-iframe-loader="display"></iframe>
|
<iframe src="templates/drawing-tools.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||||
|
|
||||||
<div id="column-wrapper" class="column-wrapper">
|
<div id="column-wrapper" class="column-wrapper">
|
||||||
<div class='column left-column'>
|
<div class='column left-column'>
|
||||||
<iframe src="templates/frames-list.html" data-iframe-loader="display"></iframe>
|
<iframe src="templates/frames-list.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='column main-column'>
|
<div class='column main-column'>
|
||||||
@ -34,18 +35,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column right-column">
|
<div class="column right-column">
|
||||||
<iframe src="templates/preview.html" data-iframe-loader="display"></iframe>
|
<iframe src="templates/preview.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||||
<iframe src="templates/layers-list.html" data-iframe-loader="display"></iframe>
|
<iframe src="templates/layers-list.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="application-action-section" data-pskl-controller="settings" class="sticky-section right-sticky-section">
|
<div id="application-action-section" data-pskl-controller="settings" class="sticky-section right-sticky-section">
|
||||||
<div class="sticky-section-wrap">
|
<div class="sticky-section-wrap">
|
||||||
<iframe src="templates/settings.html" data-iframe-loader="display"></iframe>
|
<iframe src="templates/settings.html" onload="iframeloader.onLoad(event)" data-iframe-loader="display"></iframe>
|
||||||
<div class="drawer vertical-centerer">
|
<div class="drawer vertical-centerer">
|
||||||
<div class="drawer-content" id="drawer-container">
|
<div class="drawer-content" id="drawer-container">
|
||||||
<iframe src="templates/settings-application.html" data-iframe-loader="store"></iframe>
|
<iframe src="templates/settings-application.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||||
<iframe src="templates/settings-export-gif.html" data-iframe-loader="store"></iframe>
|
<iframe src="templates/settings-export-gif.html" onload="iframeloader.onLoad(event)" data-iframe-loader="store"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @param {HTMLElement} iframe
|
* @param {HTMLElement} iframe
|
||||||
*/
|
*/
|
||||||
var processFrame = function (iframe) {
|
var processFrame = function (iframe) {
|
||||||
var type = iframe.dataset.iframeLoader;
|
var type = iframe.getAttribute('data-iframe-loader');
|
||||||
if (type === "display") {
|
if (type === "display") {
|
||||||
displayFrame(iframe);
|
displayFrame(iframe);
|
||||||
} else if (type === "store") {
|
} else if (type === "store") {
|
||||||
@ -43,19 +43,10 @@
|
|||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
window.iframeloader = {
|
||||||
* Retrieve iFrames with a data-attribute data-iframe-loader
|
onLoad : function (event) {
|
||||||
* Converts the nodeList to an array for easier manipulation
|
var iframe = event.target || event.srcElement;
|
||||||
* @return {Array} array of iframe elements
|
processFrame(iframe);
|
||||||
*/
|
}
|
||||||
var getLoaderFrames = function () {
|
}
|
||||||
var iframes = document.querySelectorAll("[data-iframe-loader]");
|
|
||||||
return Array.prototype.slice.call(iframes, 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
var init = function () {
|
|
||||||
getLoaderFrames().forEach(processFrame);
|
|
||||||
};
|
|
||||||
|
|
||||||
init();
|
|
||||||
})();
|
})();
|
@ -30,6 +30,13 @@
|
|||||||
} else {
|
} else {
|
||||||
script = "build/piskel-packaged-min.js";
|
script = "build/piskel-packaged-min.js";
|
||||||
}
|
}
|
||||||
loadScript(script, "pskl.app.init()");
|
var loaderInterval = window.setInterval(function () {
|
||||||
|
if (document.querySelectorAll("._ctl").length === 0) {
|
||||||
|
window.clearInterval(loaderInterval);
|
||||||
|
loadScript(script, "pskl.app.init()");
|
||||||
|
} else {
|
||||||
|
console.log("waiting for templates to load ....");
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
@ -1,8 +1,6 @@
|
|||||||
// This list is used both by the grunt build and index.html (in debug mode)
|
// This list is used both by the grunt build and index.html (in debug mode)
|
||||||
|
|
||||||
exports.scripts = [
|
exports.scripts = [
|
||||||
// iframe loader
|
|
||||||
"js/lib/iframeLoader.js",
|
|
||||||
// Core libraries
|
// Core libraries
|
||||||
"js/lib/jquery-1.8.0.js","js/lib/jquery-ui-1.10.3.custom.js","js/lib/pubsub.js","js/lib/bootstrap/bootstrap.js",
|
"js/lib/jquery-1.8.0.js","js/lib/jquery-ui-1.10.3.custom.js","js/lib/pubsub.js","js/lib/bootstrap/bootstrap.js",
|
||||||
// GIF Encoding libraries
|
// GIF Encoding libraries
|
||||||
|
Reference in New Issue
Block a user