Skip to content

Commit d69dbf4

Browse files
committed
update demo page
1 parent 69c69aa commit d69dbf4

3 files changed

Lines changed: 102 additions & 102 deletions

File tree

README

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Free Admin Template with Twitter Bootstrap
2-
3-
**Demo**
4-
http://demo.onokumus.com/metis/index.html
1+
Free Admin Template with Twitter Bootstrap
2+
3+
**Demo**
4+
http://onokumus.github.io/Bootstrap-Admin-Template/

assets/img/pattern/demo.html

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<title>Subtle Pattern Demo</title>
6-
<style>
7-
body , html { padding:0;margin:0;height:100%; }
8-
body { background:#ccc none repeat 0 0; }
9-
form { padding:10px;text-align:center;background:#FFF;border-bottom:1px solid #000; }
10-
</style>
11-
</head>
12-
<body>
13-
<form>
14-
<select id="image">
15-
<option selected>Downloading Pattern Names...</option>
16-
</select>
17-
</form>
18-
19-
<script src="http://code.jquery.com/jquery.min.js"></script>
20-
<script>
21-
$(document).ready(function(){
22-
23-
var pattern_selector = $('#image')
24-
body_tag = $('body');
25-
26-
// make an ajax request to find all the file names
27-
$.getJSON('https://api.github.com/repos/subtlepatterns/SubtlePatterns/contents?callback=?', function(files) {
28-
// http://baylorrae.com/prevent-dom-reflow/
29-
var items = document.createDocumentFragment(),
30-
item, file;
31-
32-
// loop through all files in the repo
33-
for( var i = 0, len = files.data.length; i < len; i++ ) {
34-
file = files.data[i];
35-
36-
// skip over non image files
37-
if( /\.(png|jpg|jpeg)$/.test(file["path"]) == false ) {
38-
continue;
39-
}
40-
41-
// create the option tag and use the raw image url
42-
item = $('<option />', {
43-
value: file["_links"]["html"].replace('blob', 'raw'),
44-
text: file["path"]
45-
})[0];
46-
47-
items.appendChild(item);
48-
}
49-
50-
// update the dropdown menu
51-
pattern_selector.find('option').remove();
52-
pattern_selector.append(items);
53-
pattern_selector.change();
54-
});
55-
56-
// bind an event to change the body background image
57-
pattern_selector.change(function() {
58-
body_tag.css('background-image', 'url(' + this.value + ')');
59-
});
60-
61-
});
62-
</script>
63-
</body>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Subtle Pattern Demo</title>
6+
<style>
7+
body , html { padding:0;margin:0;height:100%; }
8+
body { background:#ccc none repeat 0 0; }
9+
form { padding:10px;text-align:center;background:#FFF;border-bottom:1px solid #000; }
10+
</style>
11+
</head>
12+
<body>
13+
<form>
14+
<select id="image">
15+
<option selected>Downloading Pattern Names...</option>
16+
</select>
17+
</form>
18+
19+
<script src="http://code.jquery.com/jquery.min.js"></script>
20+
<script>
21+
$(document).ready(function(){
22+
23+
var pattern_selector = $('#image')
24+
body_tag = $('body');
25+
26+
// make an ajax request to find all the file names
27+
$.getJSON('https://api.github.com/repos/subtlepatterns/SubtlePatterns/contents?callback=?', function(files) {
28+
// http://baylorrae.com/prevent-dom-reflow/
29+
var items = document.createDocumentFragment(),
30+
item, file;
31+
32+
// loop through all files in the repo
33+
for( var i = 0, len = files.data.length; i < len; i++ ) {
34+
file = files.data[i];
35+
36+
// skip over non image files
37+
if( /\.(png|jpg|jpeg)$/.test(file["path"]) == false ) {
38+
continue;
39+
}
40+
41+
// create the option tag and use the raw image url
42+
item = $('<option />', {
43+
value: file["_links"]["html"].replace('blob', 'raw'),
44+
text: file["path"]
45+
})[0];
46+
47+
items.appendChild(item);
48+
}
49+
50+
// update the dropdown menu
51+
pattern_selector.find('option').remove();
52+
pattern_selector.append(items);
53+
pattern_selector.change();
54+
});
55+
56+
// bind an event to change the body background image
57+
pattern_selector.change(function() {
58+
body_tag.css('background-image', 'url(' + this.value + ')');
59+
});
60+
61+
});
62+
</script>
63+
</body>
6464
</html>

assets/img/pattern/demo.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
<?php
2-
3-
$files = glob('*.{png,jpg,jpeg}', GLOB_BRACE);
4-
5-
?><!DOCTYPE html>
6-
<html lang="en">
7-
<head>
8-
<meta charset="utf-8">
9-
<title>Subtle Pattern Demo</title>
10-
<style>
11-
body , html { padding:0;margin:0;height:100%; }
12-
body { background:#ccc none repeat 0 0; }
13-
form { padding:10px;text-align:center;background:#FFF;border-bottom:1px solid #000; }
14-
</style>
15-
</head>
16-
<body>
17-
<form>
18-
<select id="image">
19-
<option><?php echo implode( "</option>\n <option>" , $files ); ?></option>
20-
</select>
21-
</form>
22-
23-
<script src="http://code.jquery.com/jquery.min.js"></script>
24-
<script>
25-
$(document).ready(function(){
26-
27-
$('#image')
28-
.bind('keyup change unfocus blur',function(){
29-
$('body').css( 'background-image' , 'url('+$(this).val()+')' );
30-
})
31-
.blur();
32-
33-
});
34-
</script>
35-
</body>
1+
<?php
2+
3+
$files = glob('*.{png,jpg,jpeg}', GLOB_BRACE);
4+
5+
?><!DOCTYPE html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8">
9+
<title>Subtle Pattern Demo</title>
10+
<style>
11+
body , html { padding:0;margin:0;height:100%; }
12+
body { background:#ccc none repeat 0 0; }
13+
form { padding:10px;text-align:center;background:#FFF;border-bottom:1px solid #000; }
14+
</style>
15+
</head>
16+
<body>
17+
<form>
18+
<select id="image">
19+
<option><?php echo implode( "</option>\n <option>" , $files ); ?></option>
20+
</select>
21+
</form>
22+
23+
<script src="http://code.jquery.com/jquery.min.js"></script>
24+
<script>
25+
$(document).ready(function(){
26+
27+
$('#image')
28+
.bind('keyup change unfocus blur',function(){
29+
$('body').css( 'background-image' , 'url('+$(this).val()+')' );
30+
})
31+
.blur();
32+
33+
});
34+
</script>
35+
</body>
3636
</html>

0 commit comments

Comments
 (0)