2014-05-04 13:32:02 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Paint</title>
|
2017-05-30 03:05:05 +00:00
|
|
|
<link href="styles/normalize.css" rel="stylesheet" type="text/css">
|
2017-01-28 21:31:05 +00:00
|
|
|
<link href="styles/layout.css" rel="stylesheet" type="text/css">
|
|
|
|
<link href="styles/print.css" rel="stylesheet" type="text/css" media="print">
|
2017-01-29 18:54:53 +00:00
|
|
|
<script>
|
|
|
|
(function(){
|
|
|
|
var default_theme = "classic.css";
|
|
|
|
var theme_storage_key = "jspaint theme";
|
|
|
|
|
|
|
|
var href_for = function(theme){
|
|
|
|
return "styles/themes/" + theme;
|
|
|
|
};
|
|
|
|
try{
|
2017-01-29 20:19:43 +00:00
|
|
|
var current_theme = localStorage[theme_storage_key];
|
2017-01-29 18:54:53 +00:00
|
|
|
}catch(e){}
|
|
|
|
|
2017-01-29 20:19:43 +00:00
|
|
|
current_theme = current_theme || default_theme;
|
|
|
|
document.write('<link rel="stylesheet" type="text/css" href="' + href_for(current_theme) + '" id="theme-link" />');
|
2017-01-29 18:54:53 +00:00
|
|
|
|
|
|
|
var theme_link = document.getElementById("theme-link");
|
2017-06-29 04:35:46 +00:00
|
|
|
var theme_style = document.createElement("style");
|
|
|
|
|
2017-01-29 18:54:53 +00:00
|
|
|
self.set_theme = function(theme){
|
2017-01-29 20:19:43 +00:00
|
|
|
current_theme = theme;
|
2018-01-13 04:39:37 +00:00
|
|
|
var can_probably_refresh_to_switch = true;
|
2017-01-29 20:19:43 +00:00
|
|
|
try{
|
2017-06-29 04:35:46 +00:00
|
|
|
localStorage[theme_storage_key] = theme;
|
2018-01-13 04:39:37 +00:00
|
|
|
}catch(e){
|
|
|
|
can_probably_refresh_to_switch = false;
|
|
|
|
}
|
2018-01-11 18:14:49 +00:00
|
|
|
fetch(href_for(theme))
|
|
|
|
.catch(function(err){
|
2018-01-13 04:39:37 +00:00
|
|
|
show_error_message(
|
|
|
|
"Failed to load theme." +
|
|
|
|
(can_probably_refresh_to_switch ? " You can probably reload the app to finish switching themes." : ""),
|
|
|
|
err
|
|
|
|
);
|
2018-01-11 18:14:49 +00:00
|
|
|
})
|
2018-01-13 04:39:37 +00:00
|
|
|
// I'm gonna tell a funny joke, just wait..
|
2018-01-11 18:14:49 +00:00
|
|
|
.then(function(response) {
|
2018-01-13 04:39:37 +00:00
|
|
|
// Q: Why is this a separate step?
|
|
|
|
// A: Because response.text() returns a Promise!
|
|
|
|
// XD: 😂😂😂 WHO DID THIS 😂😂😂😂 XD
|
2018-01-12 23:24:24 +00:00
|
|
|
return response.text();
|
|
|
|
})
|
|
|
|
.then(function(css) {
|
2017-06-29 04:35:46 +00:00
|
|
|
if(theme_link){
|
|
|
|
theme_link.parentElement.removeChild(theme_link);
|
|
|
|
theme_link = null;
|
|
|
|
}
|
|
|
|
theme_style.textContent = css;
|
|
|
|
document.head.appendChild(theme_style);
|
|
|
|
$(window).triggerHandler("theme-load");
|
|
|
|
});
|
2017-01-29 20:19:43 +00:00
|
|
|
};
|
|
|
|
self.get_theme = function(){
|
|
|
|
return current_theme;
|
|
|
|
};
|
2017-01-29 18:54:53 +00:00
|
|
|
})();
|
|
|
|
</script>
|
2014-05-04 13:32:02 +00:00
|
|
|
<link rel="icon" href="images/icons/16.png" sizes="16x16" type="image/png">
|
|
|
|
<link rel="icon" href="images/icons/32.png" sizes="32x32" type="image/png">
|
|
|
|
<link rel="icon" href="images/icons/48.png" sizes="48x48" type="image/png">
|
|
|
|
<link rel="icon" href="images/icons/128.png" sizes="128x128" type="image/png">
|
|
|
|
<link rel="icon" href="images/icons/windows.ico" sizes="16x16,32x32,48x48" type="image/icon">
|
2014-05-17 07:37:10 +00:00
|
|
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
2014-08-19 20:53:19 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-05-04 13:32:02 +00:00
|
|
|
<script src="lib/jquery.min.js"></script>
|
2015-06-21 01:02:47 +00:00
|
|
|
<script src="lib/pep.js"></script>
|
2014-05-04 13:32:02 +00:00
|
|
|
<script src="lib/canvas.toBlob.js"></script>
|
|
|
|
<script src="lib/gif.js/gif.js"></script>
|
2015-06-16 01:29:30 +00:00
|
|
|
<script src="lib/palette.js"></script>
|
2015-06-17 00:07:11 +00:00
|
|
|
<script src="lib/FileSaver.js"></script>
|
2015-06-28 18:16:55 +00:00
|
|
|
<script src="lib/font-detective.js"></script>
|
2014-08-19 20:15:09 +00:00
|
|
|
<script src="src/helpers.js"></script>
|
2015-10-14 23:30:46 +00:00
|
|
|
<script src="src/storage.js"></script>
|
2014-08-19 20:15:09 +00:00
|
|
|
<script src="src/$Component.js"></script>
|
|
|
|
<script src="src/$Window.js"></script>
|
2017-05-26 20:31:26 +00:00
|
|
|
<script src="src/$MenuBar.js"></script>
|
2014-08-19 20:15:09 +00:00
|
|
|
<script src="src/$ToolBox.js"></script>
|
|
|
|
<script src="src/$ColorBox.js"></script>
|
|
|
|
<script src="src/$FontBox.js"></script>
|
|
|
|
<script src="src/$Handles.js"></script>
|
2016-03-25 14:55:53 +00:00
|
|
|
<script src="src/OnCanvasObject.js"></script>
|
2014-08-19 20:15:09 +00:00
|
|
|
<script src="src/Selection.js"></script>
|
|
|
|
<script src="src/TextBox.js"></script>
|
|
|
|
<script src="src/image-manipulation.js"></script>
|
|
|
|
<script src="src/tool-options.js"></script>
|
|
|
|
<script src="src/tools.js"></script>
|
|
|
|
<script src="src/functions.js"></script>
|
2016-09-29 03:12:21 +00:00
|
|
|
<script src="src/manage-storage.js"></script>
|
2015-10-13 18:56:42 +00:00
|
|
|
<script src="src/help.js"></script>
|
2014-10-02 21:17:43 +00:00
|
|
|
<script src="src/app.js"></script>
|
2017-05-26 20:31:26 +00:00
|
|
|
<script src="src/menus.js"></script>
|
2015-02-23 17:46:57 +00:00
|
|
|
<script src="src/canvas-change.js"></script>
|
2016-03-24 16:38:37 +00:00
|
|
|
<script src="src/sessions.js"></script>
|
2014-05-04 13:32:02 +00:00
|
|
|
</body>
|
|
|
|
</html>
|