r2665 - spinner: added stepUp, stepDown, pageUp and pageDown methods.

r2665 - spinner: added stepUp, stepDown, pageUp and pageDown methods.


Author: pazu2k@gmail.com
Date: Sat Jun 6 13:00:53 2009
New Revision: 2665
Added:
branches/dev/spinner/tests/visual/spinner/spinner_method_pageDown.html
branches/dev/spinner/tests/visual/spinner/spinner_method_pageUp.html
branches/dev/spinner/tests/visual/spinner/spinner_method_stepDown.html
branches/dev/spinner/tests/visual/spinner/spinner_method_stepUp.html
(contents, props changed)
Modified:

branches/dev/spinner/tests/visual/spinner/spinner_option_spinnerClass.html
branches/dev/spinner/ui/ui.spinner.js
Log:
spinner: added stepUp, stepDown, pageUp and pageDown methods.
Added:
branches/dev/spinner/tests/visual/spinner/spinner_method_pageDown.html
==============================================================================
--- (empty file)
+++ branches/dev/spinner/tests/visual/spinner/spinner_method_pageDown.html    
Sat Jun 6 13:00:53 2009
@@ -0,0 +1,27 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>Spinner Visual Test : Spinner method pageDown</title>
+    <link rel="stylesheet" href="../visual.css" type="text/css">
+    <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
+    <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.spinner.js"></script>
+    <script type="text/javascript">
+    $(function() {
+        $('#spinner').spinner();
+        $('#button').click(function() {
+            $('#spinner').spinner('pageDown', $('#pageSize').val());
+        })
+    });
+    </script>
+</head>
+<body>
+<div class="ui-widget">
+    
+

<input id="spinner" type="text">


+

page jump: <input id="pageSize" type="text" value="1" size="5">


+<button id="button" class="ui-state-default ui-corner-all">Page
Down</button>
+</div>
+</body>
+</html>
\ No newline at end of file
Added: branches/dev/spinner/tests/visual/spinner/spinner_method_pageUp.html
==============================================================================
--- (empty file)
+++ branches/dev/spinner/tests/visual/spinner/spinner_method_pageUp.html    
Sat Jun 6 13:00:53 2009
@@ -0,0 +1,27 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>Spinner Visual Test : Spinner method pageUp</title>
+    <link rel="stylesheet" href="../visual.css" type="text/css">
+    <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
+    <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.spinner.js"></script>
+    <script type="text/javascript">
+    $(function() {
+        $('#spinner').spinner();
+        $('#button').click(function() {
+            $('#spinner').spinner('pageUp', $('#pageSize').val());
+        })
+    });
+    </script>
+</head>
+<body>
+<div class="ui-widget">
+    
+

<input id="spinner" type="text">


+

page jump: <input id="pageSize" type="text" value="1" size="5">


+<button id="button" class="ui-state-default ui-corner-all">Page Up</button>
+</div>
+</body>
+</html>
\ No newline at end of file
Added:
branches/dev/spinner/tests/visual/spinner/spinner_method_stepDown.html
==============================================================================
--- (empty file)
+++ branches/dev/spinner/tests/visual/spinner/spinner_method_stepDown.html    
Sat Jun 6 13:00:53 2009
@@ -0,0 +1,27 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>Spinner Visual Test : Spinner method stepDown</title>
+    <link rel="stylesheet" href="../visual.css" type="text/css">
+    <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
+    <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.spinner.js"></script>
+    <script type="text/javascript">
+    $(function() {
+        $('#spinner').spinner();
+        $('#button').click(function() {
+            $('#spinner').spinner('stepDown', $('#stepSize').val());
+        })
+    });
+    </script>
+</head>
+<body>
+<div class="ui-widget">
+    
+

<input id="spinner" type="text">


+

step size: <input id="stepSize" type="text" value="1" size="5">


+<button id="button" class="ui-state-default
ui-corner-all">stepDown</button>
+</div>
+</body>
+</html>
\ No newline at end of file
Added: branches/dev/spinner/tests/visual/spinner/spinner_method_stepUp.html
==============================================================================
--- (empty file)
+++ branches/dev/spinner/tests/visual/spinner/spinner_method_stepUp.html    
Sat Jun 6 13:00:53 2009
@@ -0,0 +1,27 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>Spinner Visual Test : Spinner method stepUp</title>
+    <link rel="stylesheet" href="../visual.css" type="text/css">
+    <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
+    <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.spinner.js"></script>
+    <script type="text/javascript">
+    $(function() {
+        $('#spinner').spinner();
+        $('#button').click(function() {
+            $('#spinner').spinner('stepUp', $('#stepSize').val());
+        })
+    });
+    </script>
+</head>
+<body>
+<div class="ui-widget">
+    
+

<input id="spinner" type="text">


+

step size: <input id="stepSize" type="text" value="1" size="5">


+<button id="button" class="ui-state-default ui-corner-all">stepUp</button>
+</div>
+</body>
+</html>
\ No newline at end of file
Modified:
branches/dev/spinner/tests/visual/spinner/spinner_option_spinnerClass.html
==============================================================================
---
branches/dev/spinner/tests/visual/spinner/spinner_option_spinnerClass.html    
(original)
+++
branches/dev/spinner/tests/visual/spinner/spinner_option_spinnerClass.html    
Sat Jun 6 13:00:53 2009
@@ -5,7 +5,7 @@
    <link rel="stylesheet" href="../visual.css" type="text/css">
    <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
    <style type="text/css">
-        .look-ma-my-this-is-MY-spinner-class {
+        .look-ma-this-is-MY-spinner-class {
            border: 1px solid red;
            color: blue;
            background: none;
@@ -17,7 +17,7 @@
    <script type="text/javascript" src="../../../ui/ui.spinner.js"></script>
    <script type="text/javascript">
    $(function() {
-        $('#spinner').spinner({
spinnerClass: 'look-ma-my-this-is-MY-spinner-class' });
+        $('#spinner').spinner({ spinnerClass: 'look-ma-this-is-MY-spinner-class'
});
    });
    </script>
</head>
Modified: branches/dev/spinner/ui/ui.spinner.js
==============================================================================
--- branches/dev/spinner/ui/ui.spinner.js    (original)
+++ branches/dev/spinner/ui/ui.spinner.js    Sat Jun 6 13:00:53 2009
@@ -524,6 +524,18 @@
            
        this._setValue(newVal);
        return this;
+    },
+    stepUp: function(newVal) {
+        this._up(newVal || this.options.step, null);
+    },
+    stepDown: function(newVal) {
+        this._down(newVal || this.options.step, null);    
+    },
+    pageUp: function(newVal) {
+        this.stepUp((newVal || 1) * this.options.page);        
+    },
+    pageDown: function(newVal) {
+        this.stepDown((newVal || 1) * this.options.page);        
    }
});