summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2014-05-11 17:56:08 (GMT)
committer Jaromil <jaromil@dyne.org>2014-05-11 18:15:23 (GMT)
commitb7af2b38f79dba094b3234b96663a7521d651db3 (patch)
tree3228f55909b84c7d95e37526bc53b939f98d687f
parent464510efcde443b63e54ff4e4a5d54bc5cc065e4 (diff)
dropdown select for design test
-rw-r--r--js/jquery.fontswitch.js32
-rwxr-xr-xtest24
2 files changed, 15 insertions, 41 deletions
diff --git a/js/jquery.fontswitch.js b/js/jquery.fontswitch.js
deleted file mode 100644
index 9ce45b6..0000000
--- a/js/jquery.fontswitch.js
+++ /dev/null
@@ -1,32 +0,0 @@
-$(document).ready(function() {
-
-function change_size(element, size) {
-
- var current = parseInt(element.css('font-size'));
-
- if (size == 'smaller') {
- var new_size = current - 1;
- } else if (size == 'bigger') {
- var new_size = current + 1;
- }
-
- element.css('font-size', new_size + 'px');
-}
-
-
-
-$('#smaller').click(function() {
- change_size($('p'), 'smaller');
-});
-
-$('#bigger').click(function() {
- change_size($('p'), 'bigger');
-});
-
-});
-
-function change_family(element, family) {
- console.log('change font family');
- element.css('font-family', family);
-
-}
diff --git a/test b/test
index fc3f2b7..f0354c3 100755
--- a/test
+++ b/test
@@ -53,6 +53,8 @@ EOF
# start the body of article
cat <<EOF >> $dst
<p>&nbsp;</p>
+<a id="menu" href="#sidr">Design test</a>
+
<article>
EOF
@@ -66,20 +68,25 @@ cat <<EOF >> $dst
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.sidr.js"></script>
-<script type="text/javascript" src="js/jquery.fontswitch.js"></script>
-<a id="menu" href="#sidr">Design test</a>
<div id="sidr">
<h2>Design test</h2>
<h3>Font size</h3>
<ul>
- <li><a href="#" id="smaller">smaller</a><li><a href="#" id="bigger">bigger</a></li>
+ <li><select id="h1size" name="size">
+<option value="2">2</option>
+<option value="4">4</option>
+<option value="6">6</option>
+</select></li>
</ul>
+
<h3>Font family</h3>
- <ul>
- <li><a href="#" id="h1courier">Courier</a></li>
- </ul>
+<select id="headerfamily" name="header font family">
+<option value="Arial">Arial</option>
+<option value="Courier">Courier</option>
+</select>
+
</div>
<script>
@@ -90,8 +97,8 @@ cat <<EOF >> $dst
displace: false
});
});
-
-\$('#h1courier').click(function(){ change_family(\$('h1'), 'Courier'); })
+\$('#h1size').change(function() { \$('h1').css('font-size', \$('#h1size').val() + "em" ); })
+\$('#headerfamily').change(function(){ \$('h1').css('font-family', \$('#headerfamily').val() ); })
</script>
EOF
@@ -113,4 +120,3 @@ done
mkdir -p test/js
cp $DIR/js/jquery.min.js test/js
cp $DIR/js/jquery.sidr.js test/js
-cp $DIR/js/jquery.fontswitch.js test/js