Skip to content

Commit

Permalink
Added a very primitive icon to the desktop for launching Sisyphus
Browse files Browse the repository at this point in the history
  • Loading branch information
pippinbarr committed Jan 28, 2019
1 parent 47a13ab commit 51476d1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
Binary file added assets/images/sisyphus-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<!-- Comment about the body of the HTML -->

<body>
<div id="sisyphus-icon" class="icon">
<img src="assets/images/sisyphus-icon.png">
<div class="icon-label">Sisyphus</div>
</div>

<div id="sisyphus-dialog" title="Sisyphus">
<div class="instruction">Set the slider to 10.</div>
<div id="sisyphus-slider-wrapper">
Expand Down
19 changes: 16 additions & 3 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ https://github.com/simeydotme/jQuery-ui-Slider-Pips
******************************************************/


let $sisyphusDialog;
let $sisyphusSlider;
let $sisyphusIcon;

$(document).ready(function () {

Expand All @@ -30,8 +32,18 @@ $(document).ready(function () {

// Set up Sisyphus dialog with instruction and slider
function setupSisyphus() {

// Set up the icon
$sisyphusIcon = $('#sisyphus-icon');
$sisyphusIcon.draggable();
$sisyphusIcon.on('dblclick',function() {
$sisyphusDialog.dialog('open');
});

$sisyphusDialog = $('#sisyphus-dialog');

// Create the dialog to house the "app"
$('#sisyphus-dialog').dialog({
$sisyphusDialog.dialog({
// You can specify buttons as an array of objects to get finer-grained control
// In this instance I want to assign an id for later reference
buttons: [
Expand All @@ -44,10 +56,11 @@ function setupSisyphus() {
}
}
],
closeOnEscape: false
closeOnEscape: false,
autoOpen: false
});
// Get rid of the 'x' button on the menu bar
$('#sisyphus-dialog').parent().find(".ui-dialog-titlebar-close").hide();
$sisyphusDialog.parent().find(".ui-dialog-titlebar-close").hide();

// We disable the button at the start (the slider will start at 0)
$('#sisyphus-submit').button('disable');
Expand Down
3 changes: 1 addition & 2 deletions process/to-do.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
- ~~Make sure the instruction is clear~~
- ~~__DID IT IN CSS__ Look into the issue of clicking on a slider pip - basically just want to disable them~~
- ~~No closing the dialog ever~~

- Have an icon on the desktop to launch the app
- ~~Have an icon on the desktop to launch the app~~

# Danaids

Expand Down

0 comments on commit 51476d1

Please sign in to comment.