coffeescript-ui
Version:
Coffeescript User Interface System
192 lines (150 loc) • 5.97 kB
text/coffeescript
###
* coffeescript-ui - Coffeescript User Interface System (CUI)
* Copyright (c) 2013 - 2016 Programmfabrik GmbH
* MIT Licence
* https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org
###
class Demo.LabelDemo extends Demo
getName: () ->
"Labels"
display: ->
__demo_table: null
__table: null
__buttons: []
__toggle_enabled_state_button: null
__addLabel: (description, label) ->
__addDivider: (text) ->
createButtonTable: ->
# ---------------- Labels --------------------------
label = new CUI.Label
text: "Label Text"
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
label = new CUI.Label
text: "Label Rotated by 90deg"
icon: "rotate_right"
size: "big"
rotate_90: true
label = new CUI.Label
text: "Label Rotated by 90deg"
size: "big"
rotate_90: true
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
size: "mini"
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
size: "normal"
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
size: "big"
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
size: "bigger"
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
appearance: "important"
label = new CUI.Label
text: "Label with Icon"
icon: "rotate_right"
appearance: "title"
size: "bigger"
div = CUI.dom.append(CUI.dom.div("cui-label-demo-centered-label-parent"),
new CUI.Label
centered: true
text: "Centered"
icon: "rotate_right"
.DOM
)
label = new CUI.EmptyLabel
text: "Empty Label with Icon"
icon: "rotate_right"
label = new CUI.Label
multiline: true
text: "First line\nfollowed by a second."
label = new CUI.Label
class: "cui-label-demo-multiline-with-limited-width"
multiline: true
text: "A very long text that includes a veryverysuperlongword to show that it can break into lines."
icon: "rotate_left"
label = new CUI.Label
class: "cui-label-demo-multiline-with-limited-width"
multiline: true
manage_overflow: true
text: """
A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines. A good and long text that includes a veryverysuperlongword to show that it can break into lines.
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
"""
icon: "rotate_left"
label = new CUI.Label
class: "cui-label-demo-multiline-with-limited-width"
multiline: true
manage_overflow:
active_css_class: ""
text_inactive: "More..."
icon_inactive: "down"
text_active: "Less..."
icon_active: "up"
text: """
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
A good and long text that includes a veryverysuperlongword to show that it can break into lines.
"""
label = new CUI.Label
class: "cui-label-demo-multiline-with-limited-width"
multiline: true
manage_overflow: true
text: """Not so long text."""
label = new CUI.Label
multiline: true
text: "First line\nfollowed by a second.\nPlus an Icon"
icon: "rotate_left"
size: "big"
label = new CUI.Label
multiline: true
text: "First line\nfollowed by a second.\nPlus an Icon"
icon: "rotate_left"
appearance: "important"
label = new CUI.Label
multiline: true
markdown: true
text: "# Markdown Test\n**Markdown List:**\n\n* 1\n* 2\* 3"
Demo.register(new Demo.LabelDemo())