-
Notifications
You must be signed in to change notification settings - Fork 0
/
mondrian.html
156 lines (149 loc) · 5.96 KB
/
mondrian.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html>
<!-- Copyright 2012 Jim Rootham -->
<!-- Licensed under GPL3. See mondrian.js and COPYING.txt for more details -->
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="lib/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="lib/jscolor/jscolor.js"></script>
<script type="text/javascript" src="lib/mh.js"></script>
<script type="text/javascript" src="src/mondrian.js"></script>
<script type="text/javascript" src="src/mondrianUI.js"></script>
<script type="text/javascript" src="src/undoRedo.js"></script>
<script type="text/javascript" src="src/undoRedoUI.js"></script>
<script type="text/javascript" src="src/scripts.js"></script>
<link type="text/css" href="css/mondrian.css" rel="stylesheet" />
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<style type="text/css">
#myCanvas{border:1px solid red;}
#outer{padding:50px;}
p{margin:10px;}
</style>
<script type="text/javascript">
$(document).ready(function(){
reset();
setup($(window).width(), $(window).height());
setupUI();
setupUndoRedoUI($(window).width(), $(window).height());
redraw();
root.context = $('#myCanvas')[0].toDataURL();
disableActions(true);
if (window.location.search == '?small=1')
{
small();
}
});
</script>
</head>
<body>
<div id="top">
<h1>Mondrian</h1>
</div>
<div id="toolbar">
<button type="button" onClick="doAdd()">Add</button>
<button type="button" onClick="undo();redraw();">Undo</button>
<button type="button" onClick="doRedo();">Redo</button>
<button type="button" onClick="versions()">History window</button>
<button type="button" onClick="newPic()">New</button>
<select id="openList"></select>
<button type="button" onClick="openMondrian()">Open</button>
<input id="editName" type="text"/>
<button id="renameButton" type="button" onClick="renamePicture()">Rename</button>
<button id="deleteButton" type="button" onClick="deletePicture()">Delete</button>
<button id ="exportButton" type="button" onClick="exportPicture()">Export</button>
<button type="button" onClick="$('#help').dialog('open')">Help</button>
<button type="button" onClick="$('#about').dialog('open')">About</button>
<input type="checkbox" id="useClick" /><span class="label">No hover</span>
</div>
<div id="pictureName">
</div>
<div id="colourBox">
<input id="picker" class="color {pickerOnfocus:false}" />
</div>
<div id="help">
<ul>
<li>
Add adds a black square. The first add to a blank picture creates
a named picture and adds it to the picture directory.
</li>
<li>
Delete and Colour actions are done by clicking on a square. Move and
Resize actions are done by dragging a square. Hover over a square to see
a tooltip describing the action.
</li>
<li>Undo undoes an action.</li>
<li>
Redo redoes an undone action. If the history is at a branch point,
it gives you options as to which action to redo.
</li>
<li>History window displays the complete history of the application.</li>
<li>The New button creates a blank picture.</li>
<li>
To open a named picture, select the picture from the names dropdown
and press the open button.
</li>
<li>To rename a picture edit the name textbox and press the Rename button.</li>
<li>To delete the picture you have open press the Delete button.</li>
<li>
To export a picture press the export button. This will open a new
window with a png of the picture in it. To save the picture right
click on that window and save a copy of the picture. The picture can
then be pasted into an image manipulation program. This manual
intervention is required as a security measure.
</li>
<li>
Check the No hover checkbox if you are using a device that does not
implement hover. It makes the context display happen on click in the
history window and adds a button to the context window to revert.
</li>
</ul>
</div>
<div id="outer">
<div>
<div id="redoDialog">
</div>
<div id="versions">
<canvas id="versionCanvas" width="1000" height="500"></canvas>
</div>
<div id="zoom">
<canvas id="zoomCanvas" width="500" height="250"></canvas>
</div>
<div id="select">
<div>Context</div>
<div>
<canvas id="selectCanvas" width="250" height="125"></canvas>
</div>
</div>
<canvas id="myCanvas" width="1000" height="500"></canvas>
</div>
</div>
<div id="about">
<p>
Mondrian is a test bed for branching undo/redo (or zero effort version
contol). It places and colours rectangles on a white background, similar
to the paintings of Piet Mondrian.
</p>
<p>
Copyright 2012 Jim Rootham
</p>
<p>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
</p>
<p>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
</p>
<p>
You should have received a copy of the GNU General Public License
along with this program (see COPYING.txt).
If not, see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a>.
</p>
</div>
</body>
</html>