Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 106 additions & 22 deletions src/js/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ var BCommonProperties = {
defaultValue: "left",
htmlAttribute: "data-iconpos"
},
inline: {
type: "boolean",
defaultValue: false,
htmlAttribute: "data-inline",
},
mini: {
type: "boolean",
defaultValue: false,
Expand All @@ -51,6 +56,18 @@ var BCommonProperties = {
}
}
},
nativecontrol: {
displayName: "native control",
type: "boolean",
defaultValue: false,
htmlAttribute: {
name: "data-role",
value: {
true: "none",
false: ""
}
}
},
position: {
type: "string",
options: [ "default", "fixed" ],
Expand All @@ -62,7 +79,14 @@ var BCommonProperties = {
options: [ "default", "a", "b", "c", "d", "e" ],
defaultValue: "default",
htmlAttribute: "data-theme"
}
},
track_theme: {
displayName: "track theme",
type: "string",
options: [ "default", "a", "b", "c", "d", "e" ],
defaultValue: "default",
htmlAttribute: "data-track-theme",
},
};

/**
Expand Down Expand Up @@ -304,7 +328,12 @@ var BWidgetRegistry = {
autoGenerate: "page",
htmlAttribute: "id"
},
theme: BCommonProperties.theme
theme: BCommonProperties.theme,
title: {
type: "string",
defaultValue: "",
htmlAttribute: "data-title",
}
},
redirect: {
zone: "content",
Expand Down Expand Up @@ -611,6 +640,12 @@ var BWidgetRegistry = {
iconpos: $.extend({}, BCommonProperties.iconpos, {
invalidIn: "Navbar"
}),
iconshadow: {
displayName: "icon shadow",
type: "boolean",
defaultValue: true,
htmlAttribute: "data-iconshadow",
},
mini: BCommonProperties.mini,
active: {
type: "boolean",
Expand All @@ -624,12 +659,9 @@ var BWidgetRegistry = {
}
},
theme: BCommonProperties.theme,
inline: {
type: "boolean",
defaultValue: false,
htmlAttribute: "data-inline",
inline: $.extend({}, BCommonProperties.inline, {
invalidIn: "Navbar"
},
}),
transition: {
type: "string",
options: [ "slide", "slideup", "slidedown", "pop", "fade",
Expand All @@ -647,7 +679,17 @@ var BWidgetRegistry = {
"false": ""
}
}
}
},
corners: {
type: "boolean",
defaultValue: true,
htmlAttribute: "data-corners"
},
shadow: {
type: "boolean",
defaultValue: true,
htmlAttribute: "data-shadow",
},
},
template: '<a data-role="button">%TEXT%</a>'
},
Expand Down Expand Up @@ -787,14 +829,18 @@ var BWidgetRegistry = {
theme: $.extend({}, BCommonProperties.theme, {
htmlSelector: "input"
}),
track_theme: $.extend({}, BCommonProperties.theme, {
displayName: "track theme",
htmlAttribute: "data-track-theme",
track_theme: $.extend({}, BCommonProperties.track_theme, {
htmlSelector: "input"
}),
disabled: $.extend({}, BCommonProperties.disabled, {
htmlSelector: "input"
})
}),
highlight: {
type: "boolean",
defaultValue: false,
htmlAttribute: "data-highlight",
htmlSelector: "input",
},
},
editable: {
selector: "label",
Expand Down Expand Up @@ -871,7 +917,10 @@ var BWidgetRegistry = {
},
disabled: $.extend({}, BCommonProperties.disabled, {
htmlSelector: "input"
})
}),
nativecontrol: $.extend({}, BCommonProperties.nativecontrol, {
htmlSelector: "input"
}),
},
template: '<div data-role="fieldcontain"><label for="%ID%">%LABEL%</label><input type="text"/></div>'
},
Expand Down Expand Up @@ -903,7 +952,8 @@ var BWidgetRegistry = {
type: "string",
defaultValue: ""
},
disabled: BCommonProperties.disabled
disabled: BCommonProperties.disabled,
nativecontrol: BCommonProperties.nativecontrol,
},
template: '<textarea>%VALUE%</textarea>'
},
Expand Down Expand Up @@ -934,12 +984,17 @@ var BWidgetRegistry = {
},
mini: BCommonProperties.mini,
theme: BCommonProperties.theme,
disabled: BCommonProperties.disabled
track_theme: BCommonProperties.track_theme,
disabled: BCommonProperties.disabled,
nativecontrol: BCommonProperties.nativecontrol,
},
template: '<select data-role="slider"><option value="%VALUE1%">%LABEL1%</option><option value="%VALUE2%">%LABEL2%</option></select>',
// jQM generates a div next to the slider, which is the element actually
// clicked when users try to click the flip toggle switch.
delegate: "next"
delegate: function (domNode, admNode) {
if(admNode.getProperty("nativecontrol") === true)
return $(domNode);
else
return $(domNode).next();
},
},

/**
Expand Down Expand Up @@ -1013,7 +1068,12 @@ var BWidgetRegistry = {
htmlAttribute: "multiple"
},
mini: BCommonProperties.mini,
disabled: BCommonProperties.disabled
disabled: BCommonProperties.disabled,
inline: BCommonProperties.inline,
icon: BCommonProperties.icon,
iconpos: $.extend({}, BCommonProperties.iconpos, {
defaultValue: "right"
}),
},
zones: [
{
Expand Down Expand Up @@ -1139,7 +1199,8 @@ var BWidgetRegistry = {
},
checked: BCommonProperties.checked,
theme: BCommonProperties.theme,
disabled: BCommonProperties.disabled
disabled: BCommonProperties.disabled,
nativecontrol: BCommonProperties.nativecontrol,
},
delegate: 'parent',
template: function (node) {
Expand Down Expand Up @@ -1271,6 +1332,16 @@ var BWidgetRegistry = {
htmlAttribute: "data-filter"
},
theme: BCommonProperties.theme,
filter_theme: $.extend({}, BCommonProperties.theme, {
displayName: "filter theme",
htmlAttribute: "data-filter-theme"
}),
filter_placeholder: {
displayName: "filter placeholder",
type: "string",
defaultValue: "Filter items...",
htmlAttribute: "data-filter-placeholder"
},
divider: {
displayName: "divider theme",
type: "string",
Expand Down Expand Up @@ -1314,6 +1385,12 @@ var BWidgetRegistry = {
type: "string",
defaultValue: "List Item"
},
filtertext: {
displayName: "filter text",
type: "string",
defaultValue: "List Item",
htmlAttribute: "data-filtertext",
},
theme: BCommonProperties.theme
},
template: '<li>%TEXT%</li>'
Expand Down Expand Up @@ -1641,7 +1718,13 @@ var BWidgetRegistry = {
content_theme: $.extend({}, BCommonProperties.theme, {
displayName: "content theme",
htmlAttribute: "data-content-theme"
})
}),
collapsed: {
type: "boolean",
defaultValue: true,
htmlAttribute: "data-collapsed",
},
iconpos: BCommonProperties.iconpos,
},
zones: [
{
Expand Down Expand Up @@ -1677,7 +1760,8 @@ var BWidgetRegistry = {
content_theme: $.extend({}, BCommonProperties.theme, {
displayName: "content theme",
htmlAttribute: "data-content-theme"
})
}),
iconpos: BCommonProperties.iconpos,
},
zones: [
{
Expand Down