r3335 committed - Dialog (dev): Use button plugin.

r3335 committed - Dialog (dev): Use button plugin.


Revision: 3335
Author: scott.gonzalez
Date: Tue Sep 29 16:52:01 2009
Log: Dialog (dev): Use button plugin.
http://code.google.com/p/jquery-ui/source/detail?r=3335
Modified:
/branches/dev/demos/dialog/modal-confirmation.html
/branches/dev/demos/dialog/modal-form.html
/branches/dev/demos/dialog/modal-message.html
/branches/dev/ui/jquery.ui.dialog.js
=======================================
--- /branches/dev/demos/dialog/modal-confirmation.html    Thu Sep 17 03:39:12
2009
+++ /branches/dev/demos/dialog/modal-confirmation.html    Tue Sep 29 16:52:01
2009
@@ -5,6 +5,7 @@
    <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
    <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
    <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
+    <script type="text/javascript"
src="../../ui/jquery.ui.button.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.draggable.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.position.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.resizable.js"></script>
=======================================
--- /branches/dev/demos/dialog/modal-form.html    Thu Sep 17 03:39:12 2009
+++ /branches/dev/demos/dialog/modal-form.html    Tue Sep 29 16:52:01 2009
@@ -5,6 +5,7 @@
    <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
    <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
    <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
+    <script type="text/javascript"
src="../../ui/jquery.ui.button.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.draggable.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.position.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.resizable.js"></script>
@@ -21,7 +22,6 @@
        div#users-contain { width: 350px; margin: 20px 0; }
        div#users-contain table { margin: 1em 0; border-collapse: collapse;
width: 100%; }
        div#users-contain table td, div#users-contain table th { border: 1px
solid #eee; padding: .6em 10px; text-align: left; }
-        .ui-button { outline: 0; margin: 0; padding: .4em 1em .5em;
text-decoration: none; cursor: pointer; position: relative; text-align:
center; }
        .ui-dialog .ui-state-error { padding: .3em; }
        .validateTips { border: 1px solid transparent; padding: 0.3em; }
@@ -110,29 +110,11 @@
-        $('#create-user').click(function() {
-            $('#dialog-form').dialog('open');
-        })
-        .hover(
-            function() {
-                $(this).addClass("ui-state-hover");
-            },
-            function() {
-                $(this).removeClass("ui-state-hover");
-            }
-        )
-        .focus(function() {
-            $(this).addClass('ui-state-focus');
-        })
-        .blur(function() {
-            $(this).removeClass('ui-state-focus');
-        })
-        .mousedown(function() {
-            $(this).addClass("ui-state-active");
-        })
-        .mouseup(function() {
-                $(this).removeClass("ui-state-active");
-        });
+        $('#create-user')
+            .button()
+            .click(function() {
+                $('#dialog-form').dialog('open');
+            });
    });
    </script>
@@ -179,7 +161,7 @@
        </tbody>
    </table>
</div>
-<button id="create-user" class="ui-button ui-state-default
ui-corner-all">Create new user</button>
+<button id="create-user">Create new user</button>
</div><!-- End demo -->
=======================================
--- /branches/dev/demos/dialog/modal-message.html    Thu Sep 17 03:39:12 2009
+++ /branches/dev/demos/dialog/modal-message.html    Tue Sep 29 16:52:01 2009
@@ -5,6 +5,7 @@
    <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
    <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
    <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
+    <script type="text/javascript"
src="../../ui/jquery.ui.button.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.draggable.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.position.js"></script>
    <script type="text/javascript"
src="../../ui/jquery.ui.resizable.js"></script>
=======================================
--- /branches/dev/ui/jquery.ui.dialog.js    Tue Sep 22 00:54:11 2009
+++ /branches/dev/ui/jquery.ui.dialog.js    Tue Sep 29 16:52:01 2009
@@ -278,26 +278,9 @@
        if (hasButtons) {
            $.each(buttons, function(name, fn) {
                $('<button type="button"></button>')
-                    .addClass(
-                        'ui-state-default ' +
-                        'ui-corner-all'
-                    )
                    .text(name)
                    .click(function() { fn.apply(self.element[0], arguments); })
-                    .hover(
-                        function() {
-                            $(this).addClass('ui-state-hover');
-                        },
-                        function() {
-                            $(this).removeClass('ui-state-hover');
-                        }
-                    )
-                    .focus(function() {
-                        $(this).addClass('ui-state-focus');
-                    })
-                    .blur(function() {
-                        $(this).removeClass('ui-state-focus');
-                    })
+                    .button()
                    .appendTo(uiDialogButtonPane);
            });
            uiDialogButtonPane.appendTo(self.uiDialog);