1 From 3fea934afc1252e6476750d86e450a61e6d8b816 Mon Sep 17 00:00:00 2001
2 From: wongi11.lee <wongi11.lee@samsung.com>
3 Date: Fri, 8 Jun 2012 19:58:19 +0900
4 Subject: [PATCH] JQM:Apply Tizen button style.
6 Signed-off-by: Wongi Lee <wongi11.lee@samsung.com>
7 Signed-off-by: Hyunjung Kim <hjnim.kim@samsung.com>
9 .../js/jquery.mobile.buttonMarkup.js | 59 ++++++++++++++++++++
10 1 files changed, 59 insertions(+), 0 deletions(-)
12 diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js
13 index c5f32b4..d1b992b 100644
14 --- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js
15 +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.buttonMarkup.js
18 +* "buttons" plugin - for making button-like links
22 + * Button Markup modified for TIZEN style.
27 + * data-style: circle, nobg, edit
31 + * <div data-role="button" data-inline="true" data-icon="send" data-style="circle"></div>
32 + * <div data-role="button" data-inline="true" data-icon="favorite" data-style="nobg">
33 + * <div data-role="button" data-inline="true" data-icon="editminus" data-style="edit"></div>
36 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
37 //>>description: Applies button styling to links
38 //>>label: Buttons: Link-based
39 @@ -74,6 +93,63 @@ $.fn.buttonMarkup = function( options ) {
40 buttonClass += o.shadow ? " ui-shadow" : "";
41 buttonClass += o.corners ? " ui-btn-corner-all" : "";
43 + // To distinguish real buttons
44 + if( el.jqmData("role") == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
45 + buttonClass += " ui-btn-box-" + o.theme;
48 + /* TIZEN style markup */
49 + buttonStyle = el.jqmData("style");
51 + if ( buttonStyle == "circle" ) {
52 + /* style : no text, Icon only */
53 + buttonClass += " ui-btn-corner-circle";
54 + buttonClass += " ui-btn-icon_only";
55 + } else if ( buttonStyle == "nobg" ) {
56 + /* style : no text, Icon only, no bg */
57 + buttonClass += " ui-btn-icon-nobg";
58 + buttonClass += " ui-btn-icon_only";
59 + } else if ( buttonStyle == "edit" ) {
60 + buttonClass += " ui-btn-edit";
64 + if ( $(el).text().length > 0 ) {
65 + /* o.iconpos == "right" ?
66 + textClass += " ui-btn-text-padding-right" :
67 + textClass += " ui-btn-text-padding-left"; */
69 + switch ( o.iconpos ) {
74 + textClass += " ui-btn-text-padding-" + o.iconpos;
77 + textClass += " ui-btn-text-padding-left";
81 + innerClass += " ui-btn-hastxt";
83 + if ( buttonStyle == "circle" ) {
84 + /* style : no text, Icon only */
85 + innerClass += " ui-btn-corner-circle";
86 + } else if ( buttonStyle == "nobg" ) {
87 + /* style : no text, Icon only, no bg */
88 + innerClass += " ui-btn-icon-nobg";
91 + buttonClass += " ui-btn-icon_only";
92 + innerClass += " ui-btn-icon-only";
95 + if ( $(el).text().length > 0 ) {
96 + innerClass += " ui-btn-hastxt";
100 if ( o.mini !== undefined ) {
101 // Used to control styling in headers/footers, where buttons default to `mini` style.
102 buttonClass += o.mini ? " ui-mini" : " ui-fullsize";