forked from jquery/themeroller.jquerymobile.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
427 lines (389 loc) · 20.1 KB
/
index.php
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<?php
require_once( 'version.php' );
if ( isset($_GET['style_id']) ) {
$style_id = $_GET['style_id'];
}
if ( isset($_GET['ver']) ) {
$JQM_VERSION = $_GET['ver'];
}
if ( isset($_POST['style']) ) {
$style = urldecode($_POST['style']);
}
$JQUERY_VERSION = $ALL_JQUERY_VERSIONS[ $JQM_VERSION ] ? $ALL_JQUERY_VERSIONS[ $JQM_VERSION ] : "1.6.4";
$kuler_markup = rtrim( preg_replace( "/\n/", "\n\t\t\t\t\t", file_get_contents( "kuler/kuler.html" ) ) ) . "\n";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>ThemeRoller | jQuery Mobile</title>
<link rel="canonical" href="index.php" />
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/tr.layout.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/jquery.ui.css" />
<link rel="stylesheet" type="text/css" href="css/farbtastic.css" />
<link rel="stylesheet" type="text/css" href="css/tr.panel.css" />
<link rel="stylesheet" type="text/css" href="kuler/kuler.css" />
<script type="text/javascript" src="js/lib/jquery.js"></script>
<script type="text/javascript" src="js/lib/jquery.ui.js"></script>
<script type="text/javascript" src="js/lib/jquery.ui.tabs.paging.js"></script>
<script type="text/javascript" src="js/lib/jquery.color.js"></script>
<script type="text/javascript" src="js/lib/json2.js"></script>
<script type="text/javascript" src="js/lib/farbtastic.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/panel.js"></script>
<script type="text/javascript" src="js/ui.js"></script>
<script type="text/javascript" src="js/version.js"></script>
<script type="text/javascript" src="kuler/kuler.js"></script>
<?php
if( file_exists( "jqm/" . $JQM_VERSION . "/panel.js" ) ) {
echo '<script type="text/javascript" src="jqm/' . $JQM_VERSION . '/panel.js"></script>';
}
?>
</head>
<body>
<div id="load-mask">
<div id="load-screen">
<div id="load-spinner"></div>
</div>
</div>
<div id="interface">
<div id="welcome" class="dialog" title=" ">
<h1><strong>Welcome</strong> to ThemeRoller for jQuery Mobile</h1>
<p>
Create up to 26 theme "swatches" lettered from A-Z,
each with a unique color scheme, then mix and
match for unlimited possibilities.
</p>
<p>
<strong>To upgrade a theme to <?php echo $JQM_VERSION; ?>:</strong> Click the Import button, paste in your uncompressed theme, then tweak and download the upgraded version.
</p>
<div class="buttonpane">
<div class="separator"></div>
<img src="images/target_big.png" alt=" "/>
<div id="colors">
<div class="color-drag disabled" style="background-color: #C1272D"></div>
<div class="color-drag disabled" style="background-color: #ED1C24"></div>
<div class="color-drag disabled" style="background-color: #F7931E"></div>
<div class="color-drag disabled" style="background-color: #FFCC33"></div>
<div class="color-drag disabled" style="background-color: #FCEE21"></div>
<div class="color-drag disabled" style="background-color: #D9E021"></div>
<div class="color-drag disabled" style="background-color: #8CC63F"></div>
<div class="color-drag disabled" style="background-color: #009245"></div>
<div class="color-drag disabled" style="background-color: #006837"></div>
<div class="color-drag disabled" style="background-color: #00A99D"></div>
<div class="color-drag disabled" style="background-color: #33CCCC"></div>
<div class="color-drag disabled" style="background-color: #33CCFF"></div>
</div>
</div>
</div>
<div id="upload" class="dialog" title=" ">
<h1><strong>Import</strong> Theme<span href="#" id="import-default">Import Default Theme</span></h1>
<?php
if ( isset($VERSION_LIST) ) {
echo '<label>Upgrade to version:</label><select id="upgrade-to-version">';
foreach($VERSION_LIST as $l) {
echo '<option value="' . $l . '">' . $l . '</option>';
}
echo '</select>';
}
?>
<textarea id="load-css"></textarea>
<div class="buttonpane">
<img src="images/target_big.png" alt=" "/>
<p>
Copy and paste the contents of any uncompressed
jQuery Mobile theme file to load it in for editing.
</p>
</div>
</div>
<div id="download" class="dialog" title=" ">
<h1><strong>Download</strong> Theme<input value="" /><label for="theme-name">Theme Name</label></h1>
<p>
This will generate a Zip file that contains both a compressed (for production) and uncompressed (for editing)
version of the theme.
</p>
<p><strong>To use your theme</strong>, add it<?php if(isset($JQM_VERSION) && preg_match("/1.4/", $JQM_VERSION)) echo " together with the icon CSS file";?> to the head of your page before the jquery.mobile.structure file, like this:</p>
<pre>
<code>
<!DOCTYPE html>
<html>
<head>
<title>jQuery Mobile page</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<b class="highlight"><link rel="stylesheet" href="css/themes/my-custom-theme.css" /></b>
<?php if(isset($JQM_VERSION) && preg_match("/1.4/", $JQM_VERSION)) echo '<b class="highlight"><link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" /></b><br>';?>
<link rel="stylesheet" href="http://code.jquery.com/mobile/<span class="version-num"><?php echo $JQM_VERSION; ?></span>/jquery.mobile.structure-<span class="version-num"><?php echo $JQM_VERSION; ?></span>.min.css" />
<script src="http://code.jquery.com/jquery-<?php echo $JQUERY_VERSION; ?>.min.js"></script>
<script src="http://code.jquery.com/mobile/<span class="version-num"><?php echo $JQM_VERSION; ?></span>/jquery.mobile-<span class="version-num"><?php echo $JQM_VERSION; ?></span>.min.js"></script>
</head>
</code>
</pre>
<div class="buttonpane">
<div class="separator"></div>
<img src="images/target_big.png" alt=" "/>
<p>
Tip: To edit your theme later, use the import feature to paste in the uncompressed theme file
</p>
</div>
</div>
<div id="share" class="dialog" title=" ">
<h1><strong>Share</strong> Theme</h1>
<p>
Use this link to share a copy of your theme. People can download
or edit a copy of the theme, but your version won’t be changed.
</p>
<div class="input-wrapper">
<input type="text" value="" />
<span class="loading-text">
<img src="images/ajax-load-black.gif" />
Loading...
</span>
</div>
<div class="buttonpane">
<div class="separator"></div>
<img src="images/target_big.png" alt=" "/>
<p>
Important note: We can only store this theme URL on the server for 30 days, then it will be deleted.
Download a theme to keep a copy safe that you can import later.
</p>
</div>
</div>
<div id="help" class="dialog" title=" ">
<h1 id="help-top"><strong>ThemeRoller Mobile Help</strong></h1>
<p>The ThemeRoller Mobile tool makes it easy to create custom-designed themes for your mobile site or app. Just pick colors, then share your theme URL, or download the theme and drop it into your site.</p>
<ul>
<li><a href="#theme-intro">Theme basics</a></li>
<li><a href="#getting-started">Getting started</a></li>
<li><a href="#downloading">Downloading themes</a></li>
<li><a href="#importing">Importing themes</a></li>
<li><a href="#sharing">Sharing themes</a></li>
<li><a href="#supported">Supported browsers</a></li>
</ul>
<h3 id="theme-intro">Theme basics <a href="#help-top" class="help-top">^ Top</a></h3>
<p>A jQuery Mobile theme contains a both global settings for things like rounded corner radius and active (on) state, and up to to 26 "swatches" lettered from A-Z, each with a unique color scheme that can be mixed and matched for unlimited possibilities. Each swatch sets the colors, textures and font settings for the primary elements: toolbar, content block and button. Buttons have 3 interaction states: normal, hover, pressed.</p>
<h3 id="getting-started">Getting Started <a href="#help-top" class="help-top">^ Top</a></h3>
<p>The ThemeRoller interface has 3 major zones: the left column contains the inspector panel, along the top is the QuickSwatch/Kuler bar, and below this is the preview window. </p>
<p>Use the <strong>inspector pane</strong> to set global theme settings on the first tab and tweak the individual style options for each swatch. Above the tabs, there are links to download, share, or import a theme.</p>
<p>In the <strong>QuickSwatch bar</strong>, you can turn the inspector feature on to automatically expand the relevant inspector section when you click on an element in the preview pane. Drag and drop a color from the QuickSwatch panel onto an element in the preview pane and the tool with automatically calculate text color and shadow, borders, gradients and even button states. The sliders make it easy to adjust the lightness and saturation of the colors. Click the Adobe Kuler Swatches to load pre-made color palettes from Adobe's popular color palette sharing site.</p>
<p>The <strong>preview pane</strong> shows a sample of common jQuery Mobile widgets that live update each time you make a change to the theme so you can quickly test and tweak the theme.</p>
<h3 id="downloading">Downloading themes <a href="#help-top" class="help-top">^ Top</a></h3>
<p>Once you have created your final theme, click the <strong>Download Theme</strong> link at the top of the inspector panel. In the download dialog, give your theme a name and press the <strong>Download Zip</strong> button. This will generate a zip file that contains both the compressed (production-ready) and uncompressed (editable) theme files and a simple test page (index.html) to show that everything worked (whew) and instructions on how to add the theme to your site. It's pretty simple: link your custom theme in the head of the page followed by the jQuery Mobile structure theme and you're ready to go. </p>
<h3 id="importing">Importing themes <a href="#help-top" class="help-top">^ Top</a></h3>
<p>The import feature is primarily designed to make it easy to either edit a theme you've downloaded or to generate an updated version of a theme for a new release of the library. When you download a theme, be sure keep the uncompressed version of the theme CSS file because this is used in the import process. To import a theme, click the <strong>Import</strong> link and paste the entire contents of the uncompressed theme file (select all > copy > paste) into the text input in the dialog, and the system will parse the theme into an editable format for sharing and downloading.</p>
<h3 id="sharing">Sharing themes <a href="#help-top" class="help-top">^ Top</a></h3>
<p>To generate a theme URL that can be shared with others, click the <strong>Share</strong> link and copy the URL. Post it on Twitter and become a famous theme artist. Anyone that opens the shared URL can edit or download the theme, but this activity won't affect your original theme. Note that due to the high volume of traffic, we can only store your theme on the server for 30 days so shared links have an expiration date. Be sure to download a copy of your theme for safekeeping.</p>
<h3 id="supported">Supported browsers <a href="#help-top" class="help-top">^ Top</a></h3>
<p>This is a beta version of a developer tool so we're committing to supporting the <strong>latest</strong> versions of popular desktop browsers: Chrome, Firefox, Safari. Even though the tool works in IE9, it doesn't support CSS gradients so we don't recommend recommend using this browser to create themes. If you're running into issues, maybe try a different browser or <a href="https://github.com/jquery/web-jquery-mobile-theme-roller/issues" target="new"><strong>log an issue</strong></a> in the tracker.</p>
<div class="buttonpane">
<div class="separator"></div>
<img src="images/target_big.png" alt=" "/>
<p>
</p>
</div>
</div>
<div id="toolbar">
<div id="tr-logo"></div>
<div id="button-block-1">
<div class="tb-button" id="version-select">
<img src="images/jqm_logo_small.png" alt="jQuery Mobile"/>
<img id="version-select-arrow" src="images/version_select_arrow.png" alt=" " />
<div id="current-version">Version <?php echo $JQM_VERSION ?></div>
<?php
if (isset($VERSION_LIST)) {
echo '<ul><b>Switch to version:</b>';
foreach($VERSION_LIST as $l) {
if( $l != $JQM_VERSION ) {
echo '<li data-version="' . $l . '">' . $l . '</li>';
}
}
echo '</ul>';
}
?>
</div>
<div id="fix-buttons">
<div id="undo">
<img src="images/undo.png" alt="Undo" />
<span>undo</span>
</div>
<div id="redo">
<img src="images/redo.png" alt="Redo" />
<span>redo</span>
</div>
</div>
<div class="tb-button" id="inspector-button">
<img src="images/inspector.png" alt=" "/>
<span>Inspector <strong>off</strong></span>
</div>
</div>
<div id="button-block-2">
<div class="tb-button" id="download-button">
<div class="tb-button-inner">
<img src="images/download.png" alt="Download" />
<div class="text">
<span class="big">Download</span>
<span>theme zip file</span>
</div>
</div>
</div>
<div class="tb-button" id="import-button">
<div class="tb-button-inner">
<img src="images/import.png" alt="Import" />
<div class="text">
<span class="big">Import</span>
<span>or upgrade</span>
</div>
</div>
</div>
<div class="tb-button" id="share-button">
<div class="tb-button-inner">
<img src="images/share.png" alt="Share" />
<div class="text">
<span class="big">Share</span>
<span>theme link</span>
</div>
</div>
</div>
<div class="tb-button" id="help-button">
<div class="tb-button-inner">
<img src="images/help.png" alt="Help" />
<div class="text">
<span class="big">Help</span>
<span>center</span>
</div>
</div>
</div>
</div>
</div>
<div id="colorpicker"></div>
<div id="tr_panel">
<div id="tabs">
<ul>
<!--Tabs and tab panels go here-->
</ul>
</div>
</div>
<div id="wrapper">
<div id="header-wrapper">
<div id="header">
<div id="quickswatch">
<h2>Drag a color onto an element below</h2>
<div class="colors">
<div class="color-drag" style="background-color: #FFFFFF"></div>
<div class="color-drag" style="background-color: #F2F2F2"></div>
<div class="color-drag" style="background-color: #E6E6E6"></div>
<div class="color-drag" style="background-color: #CCCCCC"></div>
<div class="color-drag" style="background-color: #808080"></div>
<div class="color-drag" style="background-color: #4D4D4D"></div>
<div class="color-drag" style="background-color: #000000"></div>
<div class="color-drag" style="background-color: #C1272D"></div>
<div class="color-drag" style="background-color: #ED1C24"></div>
<div class="color-drag" style="background-color: #F7931E"></div>
<div class="color-drag" style="background-color: #FFCC33"></div>
<div class="color-drag" style="background-color: #FCEE21"></div>
<div class="color-drag" style="background-color: #D9E021"></div>
<div class="color-drag" style="background-color: #8CC63F"></div>
<div class="color-drag" style="background-color: #009245"></div>
<div class="color-drag" style="background-color: #006837"></div>
<div class="color-drag" style="background-color: #00A99D"></div>
<div class="color-drag" style="background-color: #33CCCC"></div>
<div class="color-drag" style="background-color: #33CCFF"></div>
<div class="color-drag" style="background-color: #29ABE2"></div>
<div class="color-drag" style="background-color: #0071BC"></div>
<div class="color-drag" style="background-color: #2E3192"></div>
<div class="color-drag" style="background-color: #662D91"></div>
<div class="color-drag" style="background-color: #93278F"></div>
<div class="color-drag" style="background-color: #D4145A"></div>
<div class="color-drag" style="background-color: #ED1E79"></div>
<div class="color-drag" style="background-color: #C7B299"></div>
<div class="color-drag" style="background-color: #736357"></div>
<div class="color-drag" style="background-color: #C69C6D"></div>
<div class="color-drag" style="background-color: #8C6239"></div>
<div class="color-drag" style="background-color: #603813"></div>
</div>
<div id="sliders">
<img src="images/target.png" alt=" "/>
<span>LIGHTNESS</span><div id="lightness_slider"></div>
<span>SATURATION</span><div id="saturation_slider"></div>
</div>
</div>
<?php
if( isset($kuler_markup) ) {
echo $kuler_markup;
}
?>
<div id="most-recent-colors">
<div class="picker">
<h2>Recent Colors</h2>
<div class="compact">
<a id="recent-color-picker" href="#">colors...</a>
<input type="text" class="colorwell-toggle" value="#FFFFFF" data-name="recent" style="display: none" />
</div>
</div>
<div class="clear"></div>
<div class="colors">
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
<div class="color-drag disabled" style="background-color: #ddd"></div>
</div>
</div>
<div id="back-to-jquery">
<a href="http://jquerymobile.com/">
<img src="images/jquery-mobile-logo.png" alt="jQuery Mobile" />
<img id="right-arrow" src="images/right_arrow.png" alt=" "/>
</a>
</div>
</div>
</div>
<div id="content">
<iframe id="frame" src="jqm/<?php echo $JQM_VERSION ;?>/preview.html" onload="TR.iframeLoadCallback();">
</iframe>
</div>
<?php
if( isset($JQM_VERSION) ) {
echo '<div id="version">' . $JQM_VERSION . '</div>';
}
?>
<?php
if( isset($style) || isset($style_id) ) {
echo '<div style="display: none" id="imported-style">true</div>';
}
?>
<div id="style"><?php
if( isset($style) ) {
echo $style;
} else {
//If the file exists we add the CSS here, if not, we leave it blank for the JS to find on load
$file_path = "jqm/" . $JQM_VERSION . "/jqm.starter.theme.css";
if( isset($style_id) ) {
$file_path = "jqm/" . $JQM_VERSION . "/user_themes/" . $style_id . ".css";
}
if( is_file($file_path) ) {
echo file_get_contents( $file_path );
}
}
?>
</div>
</div>
</div>
</body>
</html>