You are here: Foswiki>Tasks Web>Item9571 (18 Jan 2011, ArthurClemens)Edit Attach

Item9571: Unify buttons (make BUTTON buttons more flexible)

pencil
Priority: Normal
Current State: Being Worked On
Released In: n/a
Target Release: major
Applies To: Extension
Component:
Branches:
Reported By: ArthurClemens
Waiting For:
Last Change By: ArthurClemens
I would like to use the same buttons in one skin. Currently we have BUTTON buttons and pattern skin buttons. That doesn't look professional. Ideally the skin uses BUTTON in all instances, skinned for the specific skin.

Before this can happen, a number of features need to be implemented to BUTTON:
  1. possibility to have the button generated as link (no button style and no icon, as in the topic actions at the page bottom)
  2. pass text, title and accesskey so they can be translated as one sentence (otherwise the 'accesskey' string is out of context, lost in the .po file). For example, this would be used in the template: %MAKETEXT{"text='Edit' accesskey='e' title='Edit this topic text'"}%. Alas BUTTON (and other macros?) does not read the single quotes.
  3. disabled state: not clickable, "grayed out" link and button graphic
  4. skinnable graphic and label style, ideally size as well

Additional requirements that MichaelDaum has posed for compatibility with older installations:
  1. CSS classes should not change names
  2. The CSS should be kept with the jquery button plugin

I have created CSS styled buttons and links that can be used as replacement for the current style that BUTTON generates, that:
  1. do not use a background image
  2. have skinnable colors (and gradient)
  3. have rounded borders on modern browsers (mac, ie9)
  4. work across all major browsers (gradients, icons, rounded borders only mac and new win browsers)
  5. can have an optional icon like current BUTTON
  6. do not use float, so no %CLEAR% needed to prevent overlapping page elements

Current BUTTONs

BUTTON macro: %BUTTON{"Create a new topic" icon="add"}%
Renders: Create a new topic
HTML:
<a class="jqButton jqButtonDefault jqInitedButton" href="#"><span><span class="jqButtonIcon" style="background-image:url(%PUBURLPATH%/%SYSTEMWEB%/DocumentGraphics/add.png)">Create a new topic</span></span></a>

Proposed BUTTONs and button styles

Keep using BUTTON macro: %BUTTON{"Create a new topic" icon="add"}%
To render: Create a new topic
HTML: same HTML
And the ability to write:
<button type="submit" class="xjqButton" name="action_button">Create new topic</button>
Or to write:
<a href="#" class="xjqButton">Create new topic</a>
And the ability to have disabled buttons:
<a href="#" class="xjqButton xjqButtonDisabled">Edit</a>

Rendered examples

(view in trunk to see icons)

Button
Link Edit
Button with icon
Button with icon, 150%
Link with icon Edit
Disabled link Edit
Different color links Create a new topicCreate a new topicCreate a new topic
Row of save actions

CSS

See topic source. For each xjqButton, the x will be removed in implementation.

To resolve

  • BUTTON macro:
    • Support for access keys
  • CSS:
    • You cannot use jqButtonDisabled and jqButtonRed at the same time. Perhaps a class jqButtonEnabled is needed.
    • How to add skinning if this jquery button css is loaded after the skin css? Somehow the skin css should be loaded after plugin css.

-- ArthurClemens - 14 Nov 2010

I have attached the css that could be used by jquery button.

jquery.button2.css: Alternative jquery button css

-- ArthurClemens - 18 Jan 2011

 

ItemTemplate edit

Summary Unify buttons (make BUTTON buttons more flexible)
ReportedBy ArthurClemens
Codebase trunk
SVN Range
AppliesTo Extension
Component
Priority Normal
CurrentState Being Worked On
WaitingFor
Checkins
TargetRelease major
ReleasedIn n/a
I Attachment Action Size Date Who Comment
jquery.button2.csscss jquery.button2.css manage 4 K 18 Jan 2011 - 22:56 ArthurClemens Alternative jquery button css
mac_chrome_5.0.375.pngpng mac_chrome_5.0.375.png manage 33 K 30 Aug 2010 - 21:58 ArthurClemens  
mac_firefox_3.6.8.pngpng mac_firefox_3.6.8.png manage 41 K 30 Aug 2010 - 21:58 ArthurClemens  
mac_safari_5.0.1.pngpng mac_safari_5.0.1.png manage 31 K 30 Aug 2010 - 21:59 ArthurClemens  
win_chrome.pngpng win_chrome.png manage 14 K 30 Aug 2010 - 21:59 ArthurClemens  
win_firefox_3.6.3.pngpng win_firefox_3.6.3.png manage 15 K 30 Aug 2010 - 21:59 ArthurClemens  
win_ie_6.pngpng win_ie_6.png manage 15 K 30 Aug 2010 - 22:00 ArthurClemens  
win_ie_7.pngpng win_ie_7.png manage 16 K 30 Aug 2010 - 22:01 ArthurClemens  
win_ie_8.pngpng win_ie_8.png manage 15 K 30 Aug 2010 - 22:00 ArthurClemens  
win_ie_9_preview.pngpng win_ie_9_preview.png manage 18 K 30 Aug 2010 - 22:02 ArthurClemens  
win_opera_10.61.pngpng win_opera_10.61.png manage 13 K 30 Aug 2010 - 22:02 ArthurClemens  
win_safari_5.0.1.pngpng win_safari_5.0.1.png manage 14 K 30 Aug 2010 - 22:02 ArthurClemens  
Topic revision: r9 - 18 Jan 2011, ArthurClemens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy