├── toolkit ├── .gitignore ├── implements │ ├── README │ ├── warning.js │ ├── globalcursor.js │ ├── anchor.js │ └── ranges.js ├── styles │ ├── 2013 │ │ ├── images │ │ │ ├── background.png │ │ │ ├── state │ │ │ │ ├── over.xcf │ │ │ │ ├── circle.png │ │ │ │ ├── square.png │ │ │ │ ├── vertical.png │ │ │ │ └── horizontal.png │ │ │ ├── window │ │ │ │ ├── resize.png │ │ │ │ └── background.png │ │ │ ├── chart │ │ │ │ ├── background.png │ │ │ │ └── background.xcf │ │ │ ├── gradients │ │ │ │ ├── blue_in.jpg │ │ │ │ ├── blue_in.png │ │ │ │ ├── grey_in.jpg │ │ │ │ ├── grey_in.png │ │ │ │ ├── blue_out.jpg │ │ │ │ ├── blue_out.png │ │ │ │ ├── grey_out.jpg │ │ │ │ └── grey_out.png │ │ │ ├── select │ │ │ │ └── arrow_down.png │ │ │ ├── meterbase │ │ │ │ ├── grid_soft.png │ │ │ │ ├── grid_strong.png │ │ │ │ ├── led_vertical.png │ │ │ │ ├── led_horizontal.png │ │ │ │ ├── bevel_soft_vertical.png │ │ │ │ ├── slim_soft_horizontal.png │ │ │ │ ├── slim_soft_vertical.png │ │ │ │ ├── slim_strong_vertical.png │ │ │ │ ├── bevel_soft_horizontal.png │ │ │ │ ├── bevel_strong_vertical.png │ │ │ │ ├── slim_strong_horizontal.png │ │ │ │ └── bevel_strong_horizontal.png │ │ │ └── fader │ │ │ │ ├── handle_vertical.png │ │ │ │ ├── handle_horizontal.png │ │ │ │ ├── handle_vertical_warn.png │ │ │ │ ├── background_vertical_top.png │ │ │ │ ├── handle_horizontal_warn.png │ │ │ │ ├── background_horizontal_left.png │ │ │ │ ├── background_vertical_bottom.png │ │ │ │ ├── background_vertical_center.png │ │ │ │ ├── background_horizontal_center.png │ │ │ │ └── background_horizontal_right.png │ │ └── css │ │ │ ├── notifications.css │ │ │ ├── dialog.css │ │ │ ├── root.css │ │ │ ├── slider.css │ │ │ ├── container.css │ │ │ ├── crossover.css │ │ │ ├── valueknob.css │ │ │ ├── label.css │ │ │ ├── colorpickerdialog.css │ │ │ ├── icon.css │ │ │ ├── responsehandler.css │ │ │ ├── frame.css │ │ │ ├── pager.css │ │ │ ├── gauge.css │ │ │ ├── frequencyresponse.css │ │ │ ├── graph.css │ │ │ ├── toggle.css │ │ │ ├── grid.css │ │ │ ├── dynamics.css │ │ │ ├── value.css │ │ │ ├── state.css │ │ │ ├── tooltip.css │ │ │ ├── clock.css │ │ │ ├── knob.css │ │ │ ├── colorpicker.css │ │ │ ├── circular.css │ │ │ ├── select.css │ │ │ ├── expander.css │ │ │ ├── chart.css │ │ │ ├── valuebutton.css │ │ │ └── notification.css │ ├── fonts │ │ ├── Toolkit.ttf │ │ ├── Toolkit.css.in │ │ └── Toolkit.html.in │ ├── css │ │ └── toolkit.all.css │ ├── plain │ │ └── css │ │ │ ├── notifications.css │ │ │ ├── root.css │ │ │ ├── slider.css │ │ │ ├── container.css │ │ │ ├── crossover.css │ │ │ ├── valueknob.css │ │ │ ├── colorpickerdialog.css │ │ │ ├── label.css │ │ │ ├── icon.css │ │ │ ├── responsehandler.css │ │ │ ├── frame.css │ │ │ ├── gauge.css │ │ │ ├── graph.css │ │ │ ├── frequencyresponse.css │ │ │ ├── pager.css │ │ │ ├── value.css │ │ │ ├── valuebutton.css │ │ │ ├── grid.css │ │ │ ├── state.css │ │ │ ├── toggle.css │ │ │ ├── clock.css │ │ │ ├── dynamics.css │ │ │ ├── knob.css │ │ │ ├── tooltip.css │ │ │ ├── circular.css │ │ │ ├── colorpicker.css │ │ │ ├── chart.css │ │ │ ├── button.css │ │ │ ├── dialog.css │ │ │ ├── select.css │ │ │ ├── expander.css │ │ │ ├── multimeter.css │ │ │ ├── meterbase.css │ │ │ ├── buttonarray.css │ │ │ ├── window.css │ │ │ └── notification.css │ ├── 2013.css │ ├── plain.css │ ├── plain_lime.css │ └── plain_raspberry.css ├── widgets │ ├── README │ ├── taggablelistitem.js │ ├── taggabletreeitem.js │ ├── listitem.js │ ├── frame.js │ ├── responsehandler.js │ ├── sortablelistitem.js │ ├── notifications.js │ ├── label.js │ ├── colorpickerdialog.js │ ├── sortablelist.js │ ├── list.js │ ├── tagnode.js │ ├── root.js │ ├── tags.js │ └── icon.js ├── modules │ └── README └── polyfill │ └── raf.js ├── logo.png ├── doc ├── tutorials │ ├── Label.md │ ├── Clock.md │ ├── ValueKnob.md │ ├── Value.md │ ├── ConfirmButton.md │ ├── Select.md │ ├── FrequencyResponse.md │ ├── Toggle.md │ ├── Button.md │ ├── Dynamics.md │ ├── Slider.md │ ├── Window.md │ ├── Scale.md │ ├── ValueButton.md │ ├── MeterBase.md │ ├── State.md │ ├── Expander.md │ ├── Knob.md │ ├── Equalizer.md │ ├── Chart.md │ ├── ButtonArray.md │ ├── Pager.md │ └── Fader.md ├── jsdoc │ ├── files.js │ └── conf.json └── docs │ ├── Main.md │ └── Widgets.md ├── .gitignore └── README.md /toolkit/.gitignore: -------------------------------------------------------------------------------- 1 | styles/css/toolkit.min.css 2 | -------------------------------------------------------------------------------- /toolkit/implements/README: -------------------------------------------------------------------------------- 1 | @category: Implements 2 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/logo.png -------------------------------------------------------------------------------- /toolkit/styles/fonts/Toolkit.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/fonts/Toolkit.ttf -------------------------------------------------------------------------------- /toolkit/styles/2013/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/background.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/state/over.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/state/over.xcf -------------------------------------------------------------------------------- /toolkit/styles/2013/images/state/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/state/circle.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/state/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/state/square.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/state/vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/state/vertical.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/window/resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/window/resize.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/chart/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/chart/background.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/chart/background.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/chart/background.xcf -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/blue_in.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/blue_in.jpg -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/blue_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/blue_in.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/grey_in.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/grey_in.jpg -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/grey_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/grey_in.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/select/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/select/arrow_down.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/state/horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/state/horizontal.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/window/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/window/background.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/blue_out.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/blue_out.jpg -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/blue_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/blue_out.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/grey_out.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/grey_out.jpg -------------------------------------------------------------------------------- /toolkit/styles/2013/images/gradients/grey_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/gradients/grey_out.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/grid_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/grid_soft.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/handle_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/handle_vertical.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/grid_strong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/grid_strong.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/led_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/led_vertical.png -------------------------------------------------------------------------------- /toolkit/styles/css/toolkit.all.css: -------------------------------------------------------------------------------- 1 | /* WARNING: This file will be removed in a future version. */ 2 | 3 | @import "../toolkit.css"; 4 | @import "../2013.css"; 5 | -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/handle_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/handle_horizontal.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/led_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/led_horizontal.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/handle_vertical_warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/handle_vertical_warn.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/background_vertical_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/background_vertical_top.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/handle_horizontal_warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/handle_horizontal_warn.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/bevel_soft_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/bevel_soft_vertical.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/slim_soft_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/slim_soft_horizontal.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/slim_soft_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/slim_soft_vertical.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/slim_strong_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/slim_strong_vertical.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/background_horizontal_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/background_horizontal_left.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/background_vertical_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/background_vertical_bottom.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/background_vertical_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/background_vertical_center.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/bevel_soft_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/bevel_soft_horizontal.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/bevel_strong_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/bevel_strong_vertical.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/slim_strong_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/slim_strong_horizontal.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/background_horizontal_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/background_horizontal_center.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/fader/background_horizontal_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/fader/background_horizontal_right.png -------------------------------------------------------------------------------- /toolkit/styles/2013/images/meterbase/bevel_strong_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeutscheSoft/toolkit/HEAD/toolkit/styles/2013/images/meterbase/bevel_strong_horizontal.png -------------------------------------------------------------------------------- /doc/tutorials/Label.md: -------------------------------------------------------------------------------- 1 | function run_label(root) { 2 | label = new TK.Label({ 3 | label: "Lorem ipsum dolor sit amet" 4 | }); 5 | root.append_child(label); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /toolkit/widgets/README: -------------------------------------------------------------------------------- 1 | @category: Widgets 2 | 3 | Widgets are fully functional elements to build user interfaces. 4 | They typically rely on other elements like #Modules and #Implements and 5 | are somehow based on #Widget itself or other widgets. 6 | -------------------------------------------------------------------------------- /toolkit/styles/2013/css/notifications.css: -------------------------------------------------------------------------------- 1 | .toolkit-notifications { 2 | position: fixed; 3 | z-index: 100000000000; 4 | bottom: 0; 5 | right: 0; 6 | width: 100%; 7 | max-width: 400px; 8 | 9 | transform: translate3d(0, 0, 0); 10 | } 11 | -------------------------------------------------------------------------------- /toolkit/styles/plain/css/notifications.css: -------------------------------------------------------------------------------- 1 | .toolkit-notifications { 2 | position: fixed; 3 | z-index: 100000000000; 4 | bottom: 0; 5 | right: 0; 6 | width: 100%; 7 | max-width: 400px; 8 | 9 | transform: translate3d(0, 0, 0); 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *toolkit.all.js 2 | *toolkit.min.js 3 | *toolkit.max.js 4 | *toolkit.min.map 5 | backup.html 6 | javascript/items.js 7 | *.swp 8 | doc/documentation 9 | doc/toolkit 10 | *toolkit.min.css 11 | *toolkit.all.css 12 | export/ 13 | node_modules/ 14 | -------------------------------------------------------------------------------- /toolkit/modules/README: -------------------------------------------------------------------------------- 1 | @category: Modules 2 | 3 | Modules are Classes to build other widgets from. They normally can't 4 | exist on their own and require a parent item which makes use of them. 5 | For example: Graph is mainly a SVG path which needs a parent item containing 6 | a SVG image. 7 | -------------------------------------------------------------------------------- /doc/tutorials/Clock.md: -------------------------------------------------------------------------------- 1 | function run_clock (root) { 2 | clock = new TK.Clock(); 3 | root.append_child(clock); 4 | TK.seat_all_svg() 5 | } 6 |
7 | .toolkit-clock {
8 | width: 40%;
9 | height: 40%;
10 | }
11 |
12 |
13 |
--------------------------------------------------------------------------------
/doc/tutorials/ValueKnob.md:
--------------------------------------------------------------------------------
1 | function run_valueknob(root) {
2 | valueknob = new TK.ValueKnob({
3 | min: -100,
4 | max: 100,
5 | value: -20,
6 | base: 0,
7 | snap: 0.01,
8 | title: "Value",
9 | });
10 | root.append_child(valueknob);
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/doc/tutorials/Value.md:
--------------------------------------------------------------------------------
1 | function run_value(root) {
2 | value = new TK.Value({
3 | size: 10,
4 | value: 123.97,
5 | format: TK.FORMAT("%.3f Hz"),
6 | set: function (val) { val = parseFloat(val); console.log("the value was set to " + val); return val; }
7 | });
8 | root.append_child(value);
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/dialog.css:
--------------------------------------------------------------------------------
1 | .toolkit-dialog {
2 | border: 1px solid #fff;
3 | background: #eee;
4 | -webkit-border-radius: 6px;
5 | -moz-border-radius: 6px;
6 | border-radius: 6px;
7 | -webkit-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.75);
8 | -moz-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.75);
9 | box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.75);
10 | }
11 |
--------------------------------------------------------------------------------
/doc/tutorials/ConfirmButton.md:
--------------------------------------------------------------------------------
1 | function run_confirmbutton (root) {
2 | confirm = new TK.ConfirmButton({
3 | label: "Do something unsafe",
4 | icon: "gear",
5 | label_confirm: "Are you sure?",
6 | icon_confirm: "questionmark",
7 | onconfirmed: function () { alert("Something unsafe was done!") }
8 | });
9 | root.append_child(confirm);
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/doc/tutorials/Select.md:
--------------------------------------------------------------------------------
1 | function run_select(root) {
2 | select = new TK.Select({
3 | entries: [
4 | {title:"haha", value:11},
5 | {title:"huu", value:12},
6 | {title:"höhö", value:13},
7 | {title:"foo", value:14},
8 | {title:"bar", value:15},
9 | {title:"foobar",value:16},
10 | {title:"wtf",value:17}
11 | ],
12 | selected: 4
13 | });
14 | root.append_child(select);
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/doc/tutorials/FrequencyResponse.md:
--------------------------------------------------------------------------------
1 | function run_frequencyresponse(root) {
2 | fr = new TK.FrequencyResponse({
3 | db_grid: 12
4 | });
5 | frgraph = fr.add_graph({
6 | dots: [{x:20, y:0.0},
7 | {x:100, y:24},
8 | {x:200, y:-12},
9 | {x:500, y:0},
10 | {x:1000, y:0},
11 | {x:4000, y:30},
12 | {x:20000, y:-36}
13 | ],
14 | type: "H4",
15 | mode: "line"
16 | });
17 | root.append_child(fr);
18 | TK.seat_all_svg()
19 | }
20 |
21 | .toolkit-frequency-response {
22 | margin: 10px;
23 | width: calc(100% - 20px);
24 | height: calc(100% - 20px);
25 | }
26 |
27 |
28 |
--------------------------------------------------------------------------------
/doc/tutorials/Toggle.md:
--------------------------------------------------------------------------------
1 | function run_toggle(root) {
2 | toggle = new TK.Toggle({
3 | label: "Mic Active",
4 | label_active: "Mic Muted",
5 | icon: "images/icons_big/microphone.png",
6 | icon_active: "images/icons_big/microphone_muted.png"
7 | });
8 | press = new TK.Toggle({
9 | label: "Mic Active",
10 | label_active: "Mic Muted",
11 | icon: "images/icons_big/microphone.png",
12 | icon_active: "images/icons_big/microphone_muted.png",
13 | press: 200,
14 | toggle: true
15 | });
16 | root.append_child(toggle);
17 | root.append_child(press);
18 | }
19 |
20 | .toolkit-toggle {
21 | margin-right: 10px;
22 | }
23 |
24 |
25 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/root.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-root {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/root.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-root {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/slider.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-slider {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/slider.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-slider {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/doc/tutorials/Button.md:
--------------------------------------------------------------------------------
1 | function run_button (root) {
2 | button = new TK.Button({
3 | label: "Demo Button",
4 | icon: "images/icons_big/showcase.png",
5 | onclick: function () { alert("clicked") }
6 | });
7 | button2 = new TK.Button({
8 | label: "Demo Button",
9 | icon: "warning",
10 | layout: "horizontal",
11 | onclick: function () { alert("clicked") }
12 | });
13 | button3 = new TK.Button({
14 | icon: "message",
15 | onclick: function () { alert("clicked") }
16 | });
17 | button4 = new TK.Button({
18 | label: "Demo Button",
19 | onclick: function () { alert("clicked") }
20 | });
21 | root.append_children([ button, button2, button3, button4 ]);
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/container.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-container {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/crossover.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-crossover {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/container.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-container {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/crossover.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-crossover {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/valueknob.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-valueknob {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/valueknob.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-valueknob {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/label.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-label {
20 | overflow: hidden;
21 | }
22 |
--------------------------------------------------------------------------------
/doc/jsdoc/files.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var env = require('jsdoc/env');
4 | var fs = require('jsdoc/fs');
5 | var markdown = require('jsdoc/util/markdown');
6 | var path = require('path');
7 |
8 | exports.handlers = {
9 | parseComplete: function(e) {
10 | var extra_files = env.conf.extra_mainpages;
11 | extra_files.forEach(function (f) {
12 | var location = typeof f === "object" ? f.path : f;
13 | var name = typeof f === "object" ? f.name : path.basename(f, ".md");
14 | var content = fs.readFileSync(location, env.opts.encoding);
15 | var parse = markdown.getParser();
16 | name = name.substr(0, 1).toUpperCase() + name.substr(1);
17 | e.doclets.push({
18 | kind : "mainpage",
19 | readme : parse(content),
20 | longname : name,
21 | });
22 | });
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/colorpickerdialog.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-color-picker-dialog {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/colorpickerdialog.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-color-picker-dialog {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/doc/jsdoc/conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "tags": {
3 | "allowUnknownTags": true
4 | },
5 | "source": {
6 | "includePattern": ".+\\.js(doc|x)?$",
7 | "excludePattern": "(^|\\/|\\\\)_"
8 | },
9 | "plugins": [
10 | "plugins/markdown",
11 | "./doc/jsdoc/files"
12 | ],
13 | "extra_mainpages" : [
14 | { "path" : "./doc/docs/Widgets.md", "name" : "Layout" },
15 | "./doc/docs/Rendering.md"
16 | ],
17 | "templates": {
18 | "cleverLinks": false,
19 | "monospaceLinks": false,
20 | "default": {
21 | "staticFiles": {
22 | "include" : [
23 | "./doc/jsdoc/screen.css",
24 | "./doc/jsdoc/script.js"
25 | ]
26 | },
27 | "outputSourceFiles": true,
28 | "layoutFile" : "doc/jsdoc/layout.tmpl",
29 | "useLongnameInNav" : true
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/label.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-label {
20 | overflow: hidden;
21 | transition: color 0.25s, background-color 0.25s;
22 | }
23 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/icon.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-icon {
21 | margin: auto;
22 | width: 32px;
23 | height: 32px;
24 | font-size: 32px;
25 | line-height: 32px;
26 | }
27 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/icon.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-icon {
21 | margin: auto;
22 | width: 32px;
23 | height: 32px;
24 | font-size: 32px;
25 | line-height: 32px;
26 | }
27 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/responsehandler.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-response-handler {
20 |
21 | }
22 | .toolkit-response-handler.toolkit-dragging {
23 | cursor: move;
24 | }
25 | .toolkit-response-handler > .toolkit-response-handles {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/toolkit/styles/fonts/Toolkit.css.in:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "[name]";
3 | font-style: normal;
4 | font-weight: normal;
5 | src: url("[name].ttf") format("truetype");
6 | }
7 |
8 | .[prefix]icon {
9 | font-family: "[name]", sans-serif;
10 | font-size: 24px;
11 | text-align: center;
12 | display: inline-block;
13 | vertical-align: middle;
14 | }
15 |
16 | .[prefix]button.[prefix]icon::before{
17 | display: table-cell;
18 | vertical-align: middle;
19 | text-align: center;
20 | }
21 |
22 | .[prefix]icon.[prefix]12 { font-size: 12px; }
23 | .[prefix]icon.[prefix]16 { font-size: 16px; }
24 | .[prefix]icon.[prefix]20 { font-size: 20px; }
25 | .[prefix]icon.[prefix]24 { font-size: 24px; }
26 | .[prefix]icon.[prefix]32 { font-size: 32px; }
27 | .[prefix]icon.[prefix]40 { font-size: 40px; }
28 | .[prefix]icon.[prefix]48 { font-size: 48px; }
29 | .[prefix]icon.[prefix]56 { font-size: 56px; }
30 | .[prefix]icon.[prefix]64 { font-size: 64px; }
31 | .[prefix]icon.[prefix]128 { font-size: 128px; }
32 | .[prefix]icon.[prefix]256 { font-size: 256px; }
33 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/responsehandler.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-response-handler {
20 |
21 | }
22 | .toolkit-response-handler.toolkit-dragging {
23 | cursor: move;
24 | }
25 | .toolkit-response-handler > .toolkit-response-handles {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/frame.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-frame {
20 | padding: 8px;
21 | margin-top: 8px;
22 | }
23 | .toolkit-frame > .toolkit-frame-label {
24 | font-weight: bold;
25 | position: absolute;
26 | top: -8px;
27 | left: 8px;
28 | }
29 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/frame.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-frame {
20 | padding: 8px;
21 | margin-top: 8px;
22 | }
23 | .toolkit-frame > .toolkit-frame-label {
24 | font-weight: bold;
25 | position: absolute;
26 | top: -8px;
27 | left: 8px;
28 | }
29 |
--------------------------------------------------------------------------------
/doc/tutorials/Dynamics.md:
--------------------------------------------------------------------------------
1 | function run_dynamics (root) {
2 | comp = new TK.Dynamics({});
3 | gcomp = comp.add_graph({
4 | dots: [{x:-96, y:-72},
5 | {x:-24, y:0},
6 | {x:24, y: 12},
7 | ],
8 | mode: "line"
9 | });
10 | expand = new TK.Dynamics({
11 | type: "expander",
12 | threshold: -12,
13 | ratio: 4,
14 | range: -36
15 | });
16 | dyna = new TK.Dynamics({});
17 | gdyna = dyna.add_graph({
18 | dots: [{x:-60, y:-96},
19 | {x:-48, y:-48},
20 | {x:-36, y:-24},
21 | {x:-12, y:-12},
22 | {x:24, y:-8}
23 | ],
24 | mode: "line"
25 | });
26 | root.append_children([ comp, expand, dyna ]);
27 | TK.seat_all_svg()
28 | }
29 |
30 | .toolkit-dynamics {
31 | width: 250px;
32 | height: 250px;
33 | }
34 |
35 |
36 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/gauge.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-gauge {
20 | margin: 4px;
21 | }
22 |
23 | .toolkit-gauge > svg > .toolkit-circular {
24 |
25 | }
26 |
27 | .toolkit-gauge > svg > .toolkit-circular > .toolkit-base {
28 | opacity: 0.5;
29 | }
30 |
31 | .toolkit-gauge > svg > .toolkit-title {
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/graph.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-graph {
20 | fill: none;
21 | stroke-width: 1.2px;
22 | stroke-linecap: round;
23 | stroke-linejoin: round;
24 | }
25 |
26 | .toolkit-graph.toolkit-filled {
27 | stroke-width: 1.2px;
28 | }
29 |
30 | .toolkit-graph.toolkit-outline {
31 | stroke-width: 2px;
32 | }
33 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/frequencyresponse.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-frequency-response {
20 |
21 | }
22 |
23 | .toolkit-frequency-response > svg > .toolkit-grid > .toolkit-grid-line.toolkit-highlight {
24 |
25 | }
26 | .toolkit-frequency-response > svg > .toolkit-grid > .toolkit-grid-label.toolkit-highlight {
27 | font-weight: bold;
28 | }
29 |
--------------------------------------------------------------------------------
/toolkit/styles/fonts/Toolkit.html.in:
--------------------------------------------------------------------------------
1 |
2 |
3 | | Title | [title] |
| Name | [name] |
| Family | [family] |
| CSS-File | [name].css |
| TTF-File | [name].ttf |
| HTML | <link href="[name].css" rel="stylesheet" type="text/css"> |
36 | .toolkit-slider {
37 | width: 64px;
38 | height: 64px;
39 | margin: 8px;
40 | }
41 | .toolkit-root {
42 | background: url(images/background_plugin.png);
43 | }
44 |
45 |
46 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/toggle.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-toggle {
20 |
21 | }
22 | .toolkit-toggle:hover {
23 |
24 | }
25 | .toolkit-toggle:active {
26 |
27 | }
28 | .toolkit-toggle > .toolkit-cell > .toolkit-label {
29 |
30 | }
31 | .toolkit-toggle > .toolkit-cell > .toolkit-icon {
32 |
33 | }
34 | .toolkit-toggle.active {
35 |
36 | }
37 | .toolkit-toggle.active > .toolkit-cell > .toolkit-label {
38 |
39 | }
40 | .toolkit-toggle.active > .toolkit-cell > .toolkit-icon {
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/state.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | /*
20 | available overlays:
21 | circle.png
22 | square.png
23 | vertical.png
24 | horizontal.png
25 | */
26 |
27 | .toolkit-state {
28 | width: 32px;
29 | height: 10px;
30 | margin: 10px;
31 | background-position: 0 0;
32 | background-size: 100% 100%;
33 | background-clip: padding-box !important;
34 | }
35 |
36 | .toolkit-state > .toolkit-mask {
37 |
38 | }
39 |
40 | .toolkit-state.toolkit-state-on > .toolkit-mask {
41 | opacity: 0;
42 | }
43 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/toggle.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-toggle {
20 |
21 | }
22 | .toolkit-toggle:hover {
23 |
24 | }
25 | .toolkit-toggle:active {
26 |
27 | }
28 | .toolkit-toggle > .toolkit-cell > .toolkit-label {
29 |
30 | }
31 | .toolkit-toggle > .toolkit-cell > .toolkit-icon {
32 |
33 | }
34 | .toolkit-toggle.active {
35 |
36 | }
37 | .toolkit-toggle.active > .toolkit-cell > .toolkit-label {
38 |
39 | }
40 | .toolkit-toggle.active > .toolkit-cell > .toolkit-icon {
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/toolkit/widgets/taggablelistitem.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | TK.TaggableListItem = TK.class({
23 |
24 | _class: "TaggableListItem",
25 | Extends: TK.ListItem,
26 | Implements: TK.Taggable,
27 |
28 | initialize: function (options) {
29 | TK.ListItem.prototype.initialize.call(this, options);
30 | TK.Taggable.prototype.initialize.call(this);
31 | TK.add_class(this.element, "toolkit-taggable-list-item");
32 | }
33 | });
34 |
35 | })(this, this.TK);
36 |
--------------------------------------------------------------------------------
/toolkit/widgets/taggabletreeitem.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | TK.TaggableTreeItem = TK.class({
23 |
24 | _class: "TaggableTreeItem",
25 | Extends: TK.TreeItem,
26 | Implements: TK.Taggable,
27 |
28 | initialize: function (options) {
29 | TK.TreeItem.prototype.initialize.call(this, options);
30 | TK.Taggable.prototype.initialize.call(this);
31 | TK.add_class(this.element, "toolkit-taggable-tree-item");
32 | },
33 | });
34 |
35 | })(this, this.TK);
36 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/grid.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-grid-line {
20 | stroke: rgba(255,255,255,0.25);
21 | stroke-dasharray: 1,1;
22 | }
23 | .toolkit-grid-line.toolkit-vertical {
24 |
25 | }
26 | .toolkit-grid-line.toolkit-horizontal {
27 |
28 | }
29 |
30 | .toolkit-grid-label {
31 | fill: rgba(255,255,255,0.99);
32 | /* ONLY USE PADDING FOR POSITIONING! */
33 | padding: 1px 2px;
34 | font-size: 0.7em;
35 | }
36 | .toolkit-grid-label.toolkit-vertical {
37 |
38 | }
39 | .toolkit-grid-label.toolkit-horizontal {
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/clock.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-widget.toolkit-clock > svg {
20 | -webkit-border-radius: 100%;
21 | -moz-border-radius: 100%;
22 | border-radius: 100%;
23 | }
24 |
25 | .toolkit-widget.toolkit-clock > svg > .toolkit-circular {
26 |
27 | }
28 |
29 | .toolkit-widget.toolkit-clock > svg > .toolkit-circular > .toolkit-value {
30 |
31 | }
32 |
33 | .toolkit-widget.toolkit-clock > svg > .toolkit-circular > .toolkit-base {
34 |
35 | }
36 |
37 | .toolkit-widget.toolkit-clock > svg > .toolkit-label {
38 | margin: 5px;
39 | }
40 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/dynamics.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-dynamics {
20 | }
21 |
22 | .toolkit-dynamics > svg {
23 | position:absolute;
24 | top: 50%;
25 | left: 50%;
26 | transform: translate(-50%, -50%);
27 | }
28 |
29 | .toolkit-dynamics > svg > .toolkit-grid > .toolkit-grid-line.toolkit-highlight {
30 |
31 | }
32 | .toolkit-dynamics > svg > .toolkit-grid > .toolkit-grid-label.toolkit-highlight {
33 | font-weight: bold;
34 | }
35 |
36 | .toolkit-dynamics > svg > .toolkit-graphs > .toolkit-steady {
37 | stroke-dasharray: 1.41421,1.41421;
38 | stroke-width: 1px;
39 | }
40 |
--------------------------------------------------------------------------------
/toolkit/widgets/listitem.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | TK.ListItem = TK.class({
23 | /**
24 | * TK.ListItem is a member {@link TK.Container} of {@link TK.List}s. The
25 | * element is a `LI` instead of a `DIV`.
26 | *
27 | * @class TK.ListItem
28 | *
29 | * @extends TK.Container
30 | */
31 | _class: "ListItem",
32 | Extends: TK.Container,
33 |
34 | initialize: function (options) {
35 | this.element = TK.element("li", "toolkit-list-item");
36 | TK.Container.prototype.initialize.call(this, options);
37 | },
38 | });
39 |
40 | })(this, this.TK);
41 |
--------------------------------------------------------------------------------
/toolkit/styles/2013.css:
--------------------------------------------------------------------------------
1 | @import "toolkit.css";
2 |
3 | @import "2013/css/root.css";
4 | @import "2013/css/globalcursor.css";
5 | @import "2013/css/tooltip.css";
6 | @import "2013/css/scale.css";
7 | @import "2013/css/graph.css";
8 | @import "2013/css/grid.css";
9 | @import "2013/css/responsehandle.css";
10 | @import "2013/css/circular.css";
11 | @import "2013/css/buttonarray.css";
12 | @import "2013/css/meterbase.css";
13 | @import "2013/css/chart.css";
14 | @import "2013/css/gauge.css";
15 | @import "2013/css/button.css";
16 | @import "2013/css/valuebutton.css";
17 | @import "2013/css/toggle.css";
18 | @import "2013/css/state.css";
19 | @import "2013/css/levelmeter.css";
20 | @import "2013/css/frequencyresponse.css";
21 | @import "2013/css/dynamics.css";
22 | @import "2013/css/responsehandler.css";
23 | @import "2013/css/clock.css";
24 | @import "2013/css/window.css";
25 | @import "2013/css/knob.css";
26 | @import "2013/css/value.css";
27 | @import "2013/css/fader.css";
28 | @import "2013/css/select.css";
29 | @import "2013/css/label.css";
30 | @import "2013/css/container.css";
31 | @import "2013/css/pager.css";
32 | @import "2013/css/expander.css";
33 | @import "2013/css/valueknob.css";
34 | @import "2013/css/multimeter.css";
35 | @import "2013/css/notification.css";
36 | @import "2013/css/notifications.css";
37 | @import "2013/css/crossover.css";
38 | @import "2013/css/frame.css";
39 | @import "2013/css/dialog.css";
40 | @import "2013/css/colorpicker.css";
41 | @import "2013/css/colorpickerdialog.css";
42 |
--------------------------------------------------------------------------------
/doc/tutorials/Window.md:
--------------------------------------------------------------------------------
1 | function run_window(root) {
2 | winbutton = new TK.Button({
3 | label: "Demo Window",
4 | icon: "images/icons_big/window.png"
5 | });
6 | root.append_child(winbutton);
7 |
8 | winbutton.add_event("click", function () {
9 | win = new TK.Window({
10 | container: document.body,
11 | height: 233,
12 | width: 640,
13 | open: "center",
14 | title: "Example Window",
15 | status: "Integrity of the Cloud at 112%! Hull breach impending!",
16 | icon: "images/toolkit_win_icon.png",
17 | header: ["icon", "title", "maximizehorizontal", "maximizevertical", "maximize",
18 | "minimize", "shrink", "close"],
19 | footer: ["status", "size"],
20 | fixed: true,
21 | content: TK.html("
"
23 | + "Thanks for testing TK. We hope you like "
24 | + "the functionality, complexity and style. If you have any "
25 | + "sugestions or bug reports, please let us know.
46 | .toolkit-scale {
47 | display: block;
48 | position: absolute;
49 | }
50 | #sc_scale_v_l {
51 | height: calc(100% - 60px);
52 | top: 30px;
53 | left: 10px;
54 | }
55 | #sc_scale_v_r {
56 | height: calc(100% - 60px);
57 | top: 30px;
58 | right: 10px;
59 |
60 | }
61 | #sc_scale_h_t {
62 | width: calc(100% - 94px);
63 | left: 47px;
64 | top: 10px;
65 | }
66 | #sc_scale_h_b {
67 | width: calc(100% - 94px);
68 | left: 47px;
69 | bottom: 10px;
70 | }
71 |
72 |
73 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/button.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-button {
20 | padding: 6px;
21 | margin: 2px;
22 | cursor: pointer;
23 | border: 2px solid white;
24 | transition: background-color 0.25s,
25 | border-color 0.25s,
26 | color 0.25s;
27 | background-clip: padding-box;
28 | }
29 | .toolkit-button > .toolkit-label {
30 | line-height: 1.1em;
31 | text-align: center;
32 | margin: auto;
33 | padding: 0 3px;
34 | transition: none;
35 | }
36 | .toolkit-button.toolkit-horizontal > .toolkit-label {
37 | padding: 2px 4px;
38 | }
39 | .toolkit-button > .toolkit-icon {
40 | width: 32px;
41 | height: 32px;
42 | font-size: 32px;
43 | line-height: 32px;
44 | }
45 | .toolkit-button.toolkit-has-label.toolkit-vertical > .toolkit-icon {
46 | margin-bottom: 5px;
47 | }
48 | .toolkit-button.toolkit-has-label.toolkit-horizontal > .toolkit-icon {
49 | margin-right: 5px;
50 | }
51 |
52 | .toolkit-button.toolkit-active {
53 |
54 | }
55 | .toolkit-button.toolkit-active > .toolkit-cell > .toolkit-label {
56 |
57 | }
58 | .toolkit-button.toolkit-active > .toolkit-cell > .toolkit-icon {
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/dialog.css:
--------------------------------------------------------------------------------
1 | .toolkit-dialog {
2 | background: #111111;
3 |
4 | -webkit-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.75);
5 | -moz-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.75);
6 | box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.75);
7 |
8 | position: absolute;
9 | z-index: 100000000000;
10 |
11 | -webkit-animation: -webkit-dialog-fade-in 0.5s;
12 | -moz-animation: -moz-dialog-fade-in 0.5s;
13 | -ms-animation: -ms-dialog-fade-in 0.5s;
14 | -o-animation: -o-dialog-fade-in 0.5s;
15 | animation: dialog-fade-in 0.5s;
16 |
17 | -webkit-transform: scale(1);
18 | -moz-transform: scale(1);
19 | -ms-transform: scale(1);
20 | -o-transform: scale(1);
21 | transform: scale(1);
22 | }
23 |
24 | .toolkit-dialog.toolkit-show {
25 | opacity: 1;
26 | }
27 | .toolkit-dialog.toolkit-hiding {
28 | opacity: 0;
29 |
30 | -webkit-transition: opacity 0.5s, transform 0.5s;
31 | -moz-transition: opacity 0.5s, transform 0.5s;
32 | -ms-transition: opacity 0.5s, transform 0.5s;
33 | -o-transition: opacity 0.5s, transform 0.5s;
34 | transition: opacity 0.5s, transform 0.5s;
35 |
36 | -webkit-transform: scale(0);
37 | -moz-transform: scale(0);
38 | -ms-transform: scale(0);
39 | -o-transform: scale(0);
40 | transform: scale(0);
41 | }
42 |
43 | @-webkit-keyframes -webit-dialog-fade-in {
44 | 0% { opacity: 0; -webit-transform: scale(1); }
45 | 100% { opacity: 1; -webit-transform: scale(1);}
46 | }
47 | @-moz-keyframes -moz-dialog-fade-in {
48 | 0% { opacity: 0; -moz-transform: scale(1); }
49 | 100% { opacity: 1; -moz-transform: scale(1);}
50 | }
51 | @-ms-keyframes -ms-dialog-fade-in {
52 | 0% { opacity: 0; -ms-transform: scale(1); }
53 | 100% { opacity: 1; -ms-transform: scale(1);}
54 | }
55 | @-o-keyframes -o-dialog-fade-in {
56 | 0% { opacity: 0; -o-transform: scale(1); }
57 | 100% { opacity: 1; -o-transform: scale(1);}
58 | }
59 | @keyframes dialog-fade-in {
60 | 0% { opacity: 0; transform: scale(1); }
61 | 100% { opacity: 1; transform: scale(1);}
62 | }
63 |
--------------------------------------------------------------------------------
/toolkit/widgets/frame.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | /**
22 | * Frame is a {@link TK.Container} with a {@link TK.Label} on top.
23 | *
24 | * @extends TK.Container
25 | *
26 | * @param {Object} [options={ }] - An object containing initial options.
27 | *
28 | * @property {String|Boolean} [options.label=false] - The label of the frame. Set to `false` to remove it from the DOM.
29 | *
30 | * @class TK.Frame
31 | */
32 | TK.Frame = TK.class({
33 | Extends: TK.Container,
34 | _class: "Frame",
35 | _options: Object.create(TK.Container.prototype._options),
36 | options: {
37 | label: false,
38 | },
39 | initialize: function (options) {
40 | TK.Container.prototype.initialize.call(this, options);
41 | /**
42 | * @member {HTMLDivElement} TK.Frame#element - The main DIV container.
43 | * Has class toolkit-frame.
44 | */
45 | TK.add_class(this.element, "toolkit-frame");
46 | },
47 | });
48 | /**
49 | * @member {TK.Label} TK.Frame#label - The {@link TK.Label} of the frame.
50 | */
51 | TK.ChildWidget(TK.Frame, "label", {
52 | create: TK.Label,
53 | option: "label",
54 | inherit_options: true,
55 | default_options: {
56 | class: "toolkit-frame-label"
57 | },
58 | });
59 | })(this, this.TK);
60 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/select.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-button.toolkit-select {
20 | padding-left: 8px;
21 | padding-right: 8px;
22 | }
23 |
24 | .toolkit-button.toolkit-select > .toolkit-cell > .toolkit-label {
25 | margin-right: 20px;
26 | }
27 | .toolkit-button.toolkit-select > .toolkit-cell > .toolkit-arrow {
28 | background: url(../images/select/arrow_down.png) 50% 50% no-repeat;
29 | width: 16px;
30 | position: absolute;
31 | top: 0;
32 | right: 0;
33 | bottom: 0;
34 | }
35 |
36 | .toolkit-select-list {
37 | background: #efefef;
38 | border: 1px solid white;
39 | margin: 0;
40 | padding: 0;
41 | -webkit-box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
42 | -moz-box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
43 | box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
44 | transition: opacity 200ms;
45 | text-align: left;
46 | }
47 |
48 | .toolkit-select-list > .toolkit-option {
49 | list-style: none;
50 | margin: 0;
51 | padding: 0 5px;
52 | line-height: 2em;
53 | cursor: pointer;
54 | transition: background 0.25s ease-in-out, color 0.25s ease-in-out;
55 | }
56 |
57 | .toolkit-select-list > .toolkit-option:hover {
58 | background: #002f42;
59 | color: white;
60 | }
61 | .toolkit-select-list > .toolkit-option.toolkit-active {
62 | background: #dfdfdf;
63 | }
64 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/select.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-button.toolkit-select {
20 | padding-left: 8px;
21 | padding-right: 8px;
22 | }
23 |
24 | .toolkit-button.toolkit-select > .toolkit-cell > .toolkit-label {
25 | margin-right: 20px;
26 | }
27 | .toolkit-button.toolkit-select > .toolkit-cell > .toolkit-arrow {
28 | width: 12px;
29 | height: 6px;
30 | position: absolute;
31 | top: 50%;
32 | right: 0;
33 | bottom: 0;
34 | border-width: 8px 6px 0 6px;
35 | border-style: solid;
36 | border-color: white transparent transparent transparent;
37 |
38 | -webkit-transform: translateY(-50%);
39 | -moz-transform: translateY(-50%);
40 | -ms-transform: translateY(-50%);
41 | -o-transform: translateY(-50%);
42 | transform: translateY(-50%);
43 | }
44 |
45 | .toolkit-select-list {
46 | margin: 0;
47 | padding: 0;
48 | transition: opacity 0.25s;
49 | text-align: left;
50 | }
51 |
52 | .toolkit-select-list > .toolkit-option {
53 | list-style: none;
54 | margin: 0;
55 | padding: 0 5px;
56 | line-height: 2em;
57 | cursor: pointer;
58 | transition: background 0.25s ease-in-out, color 0.25s ease-in-out;
59 | display: block;
60 | }
61 |
62 | .toolkit-select-list > .toolkit-option:hover {
63 |
64 | }
65 | .toolkit-select-list > .toolkit-option.toolkit-active {
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/doc/tutorials/ValueButton.md:
--------------------------------------------------------------------------------
1 | function run_valuebutton(root) {
2 | thres = new TK.ValueButton({
3 | label: "Threshold",
4 | icon: "images/icons_small/threshold.png",
5 | value_position: "bottom",
6 | value_format: TK.FORMAT("%.1f dB"),
7 | min: -96,
8 | max: 24,
9 | step: 1,
10 | basis: 300,
11 | shift_up: 4,
12 | shift_down: 0.25,
13 | value: 0,
14 | });
15 |
16 | attack = new TK.ValueButton({
17 | "class": "attack",
18 | label: "Attack",
19 | icon: "images/icons_small/attack.png",
20 | value_position: "bottom",
21 | value_format: TK.FORMAT("%.1f ms"),
22 | min: 1,
23 | max: 1000,
24 | step: 1,
25 | basis: 300,
26 | shift_up: 4,
27 | shift_down: 0.25,
28 | value: 100,
29 | scale: "frequency"
30 | });
31 |
32 | ratio = new TK.ValueButton({
33 | label: "Ratio",
34 | icon: "images/icons_small/ratio.png",
35 | value_position: "bottom",
36 | value_format: TK.FORMAT("%.1f : 1"),
37 | min: 1,
38 | max: 10,
39 | step: 1,
40 | basis: 300,
41 | shift_up: 4,
42 | shift_down: 0.25,
43 | value: 2
44 | });
45 |
46 | release = new TK.ValueButton({
47 | label: "Release",
48 | icon: "images/icons_small/release.png",
49 | value_position: "bottom",
50 | value_format: TK.FORMAT("%.1f ms"),
51 | min: 1,
52 | max: 1000,
53 | step: 1,
54 | basis: 300,
55 | shift_up: 4,
56 | shift_down: 0.25,
57 | value: 100,
58 | scale: "frequency"
59 | });
60 |
61 | root.append_children([ thres, attack, ratio, release ]);
62 | }
63 |
64 | .toolkit-valuebutton {
65 | width: 240px;
66 | }
67 |
68 |
69 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 
2 |
3 | toolkit is a JavaScript widget library with special focus on building
4 | low latency user interfaces for audio applications. It contains a wide range
5 | of widgets such as faders, knobs, levelmeters and equalizers.
6 |
7 | ## Design Goals
8 |
9 | toolkit is written in pure JavaScript and has no external dependencies.
10 | It is supposed to run in browsers which support ECMAScript 5 including
11 | IE9. toolkit was designed to be lightweight and fast while keeping the
12 | full flexibility which comes with CSS. toolkit widgets offer consistent
13 | and intuitive APIs.
14 |
15 | ## Documentation
16 |
17 | The complete API documentation can be found at [http://docs.deuso.de/].
18 | The documentation contains interactive examples for many Widgets.
19 |
20 | Alternatively, the documentation can be directly built from the source code.
21 | The documentation in the source files uses the common jsdoc syntax and [JSDoc 3](https://usejsdoc.org).
22 | can be used to generate the documentation. If you have jsdoc installed, simply run
23 |
24 | make jsdoc
25 |
26 | Apart from the documentation inside the source tree, there are several longer
27 | introductory articles and usage examples in the directories `doc/docs/` and `doc/tutorials/`.
28 | These articles automatically get added to the generated documentation by our jsdoc configuration.
29 |
30 | ## Demos
31 |
32 | Several online demos of interfaces using toolkit can be found at [http://demo.deuso.de].
33 | All of those demos are written in [AWML](https://github.com/DeutscheSoft/AWML), which is
34 | a HTML5 based markup language, which can be used to create toolkit-based interfaces.
35 |
36 | For most use-cases using AWML is much more convenient than building an interface in
37 | JavaScript using toolkit directly.
38 |
39 | ## Reporting Bugs
40 |
41 | When you find a bug in this software, please report it to our issue tracker at [https://github.com/DeutscheSoft/toolkit].
42 |
43 | ## License
44 |
45 | toolkit is released unter the the terms of the GPLv3. See the file `COPYING`
46 | file for details.
47 |
48 | Copyright (c) 2013-2019 Markus Schmidt toolkit-response-handler.
42 | */
43 | TK.add_class(this.element, "toolkit-response-handler");
44 | /**
45 | * @member {SVGImage} TK.ResponseHandler#_handles - An SVG group element containing all {@link TK.ResponseHandle} graphics.
46 | * Has class toolkit-response-handles.
47 | */
48 | TK.add_class(this._handles, "toolkit-response-handles");
49 | },
50 | });
51 | })(this, this.TK);
52 |
--------------------------------------------------------------------------------
/doc/tutorials/MeterBase.md:
--------------------------------------------------------------------------------
1 | function run_meterbase(root) {
2 | mbvl = new TK.MeterBase({
3 | layout: "right",
4 | scale: "decibel",
5 | segment: 2,
6 | min: -60,
7 | max: 3,
8 | value: 18,
9 | scale_base: 0,
10 | title: "left",
11 | show_title: true,
12 | show_label: true,
13 | gradient: {"-96": "#001f83", "-0.1": "#008bea", "0": "#ff6000", "24": "#ffa000"},
14 | levels: [1, 3, 6, 12],
15 | gap_labels: 20
16 | });
17 | mbvr = new TK.MeterBase({
18 | layout: "left",
19 | segment: 2,
20 | min: -96,
21 | max: 24,
22 | value: 6,
23 | scale_base: 0,
24 | title: "right",
25 | show_title: true,
26 | show_label: true,
27 | gradient: {"-96": "#001f83", "-0.1": "#008bea", "0": "#ff6000", "24": "#ffa000"},
28 | levels: [1, 6, 12],
29 | gap_labels: 30
30 | });
31 | mbhb = new TK.MeterBase({
32 | layout: "bottom",
33 | segment: 2,
34 | min: -15,
35 | max: 15,
36 | value: -6.25,
37 | base: 0,
38 | scale_base: 0,
39 | title: "left",
40 | show_title: true,
41 | show_label: true,
42 | gradient: {"-15": "#001f83", "0": "#008bea", "15": "#001f83"},
43 | levels: [1, 5]
44 | });
45 | mbht = new TK.MeterBase({
46 | layout: "top",
47 | segment: 2,
48 | min: -15,
49 | max: 15,
50 | value: 12.5,
51 | base: 0,
52 | scale_base: 0,
53 | title: "right",
54 | show_title: true,
55 | show_label: true,
56 | gradient: {"-15": "#001f83", "0": "#008bea", "15": "#001f83"},
57 | levels: [1, 5]
58 | });
59 | root.append_children([ mbvl, mbvr, mbhb, mbht ]);
60 | }
61 |
62 | .toolkit-meter-base {
63 | float: left;
64 | }
65 |
66 |
67 |
--------------------------------------------------------------------------------
/doc/tutorials/State.md:
--------------------------------------------------------------------------------
1 | function run_state(root) {
2 | s1 = new TK.State({ });
3 | s2 = new TK.State({ color: "#00ff00"
4 | });
5 | s3 = new TK.State({
6 | color: "blue",
7 | state: 1
8 | });
9 | s4 = new TK.State({
10 | color: "blue",
11 | state: 1,
12 | });
13 | s5 = new TK.State({
14 | color: "#cc0000",
15 | state: 1,
16 | });
17 | s6 = new TK.State({
18 | color: "#ff8800",
19 | state: 1,
20 | });
21 | s7 = new TK.State({
22 | color: "grey",
23 | state: 1,
24 | });
25 | s8 = new TK.State({
26 | color: "#d00",
27 | state: 0,
28 | "class": "on_air",
29 | onClick: function () { this.set("state", !this.get("state")) }
30 | });
31 |
32 | root.append_children([ s1, s2, s3, s4, s5, s6, s7, s8 ]);
33 |
34 | var _s1 = 0;
35 | var _s2 = 0;
36 | var _s3 = 0;
37 |
38 | function __s1 () {
39 | if (!s1) return;
40 | _s1 = !_s1;
41 | s1.set("state", _s1);
42 | if(s1)
43 | window.setTimeout(__s1, 1000);
44 | }
45 |
46 | function __s2 () {
47 | if (!s2) return;
48 | if (s2.get("state") >= 1)
49 | _s2 = -0.02;
50 | else if (s2.get("state") <= 0)
51 | _s2 = 0.02;
52 | s2.set("state", s2.get("state") + _s2);
53 | if(s2)
54 | window.setTimeout(__s2, 20);
55 | }
56 |
57 | function __s3 () {
58 | if (!s3) return;
59 | _s3 = !_s3;
60 | s3.set("color", _s3 ? "#def" : "#0af");
61 | if(s3)
62 | window.setTimeout(__s3, 500);
63 | }
64 |
65 | __s1();
66 | __s2();
67 | __s3();
68 | }
69 |
70 | .toolkit-state {
71 | float: left;
72 | }
73 | .toolkit-state.on_air {
74 | width: 250px;
75 | height: 70px;
76 | }
77 | .toolkit-state.on_air {
78 | background: url(images/on_air.png) no-repeat 50% 51%;
79 | cursor: pointer;
80 | }
81 |
82 |
83 |
--------------------------------------------------------------------------------
/toolkit/widgets/sortablelistitem.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | var build_sorter = function () {
23 | this.sorter = new TK.Button({"class":"toolkit-sorter",container:this.element});
24 | this.add_child(this.sorter);
25 | }
26 |
27 | TK.SortableListItem = TK.class({
28 |
29 | _class: "SortableListItem",
30 | Extends: TK.ListItem,
31 |
32 | _options: Object.assign(Object.create(TK.ListItem.prototype._options), {
33 | sortable: "boolean",
34 | }),
35 | options: {
36 | sortable: false,
37 | },
38 | initialize: function (options) {
39 | TK.ListItem.prototype.initialize.call(this, options);
40 | this.element.add_class("toolkit-sortable-list-item");
41 | },
42 | redraw: function () {
43 | TK.ListItem.prototype.redraw.call(this);
44 | var I = this.invalid;
45 | var O = this.options;
46 | if (I.sortable) {
47 | if (O.sortable) {
48 | if (!this.sorter) {
49 | build_sorter.call(this);
50 | } else {
51 | this.element.appendChild(this.sorter.element);
52 | }
53 | } else {
54 | if (this.sorter)
55 | this.element.removeChild(this.sorter.element);
56 | }
57 | }
58 | },
59 | set: function (key, value) {
60 | return TK.ListItem.prototype.set.call(this, key, value);
61 | }
62 | });
63 |
64 |
65 | })(this, this.TK);
66 |
--------------------------------------------------------------------------------
/doc/tutorials/Expander.md:
--------------------------------------------------------------------------------
1 | function run_chart (root) {
2 | chart = new TK.Chart({
3 | _collapsed: true,
4 | range_x: {scale: "linear", min:0, max:1},
5 | range_y: {scale: "linear", min:0, max:1},
6 | grid_x: [{pos:0.0, label:"0"},
7 | {pos:0.1},
8 | {pos:0.2, label:"20"},
9 | {pos:0.3},
10 | {pos:0.4, label:"40"},
11 | {pos:0.5, label: "50", color: "rgba(255,255,255,0.66)"},
12 | {pos:0.6, label:"60"},
13 | {pos:0.7},
14 | {pos:0.8, label:"80"},
15 | {pos:0.9},
16 | {pos:1.0, label:"100"}],
17 | grid_y: [{pos:0.0, label:"0"},
18 | {pos:0.2, label:"20"},
19 | {pos:0.4, label:"40"},
20 | {pos:0.5, label: "50", color: "rgba(255,255,255,0.66)"},
21 | {pos:0.6, label:"60"},
22 | {pos:0.8, label:"80"},
23 | {pos:1.0, label:"100"}],
24 | key: "top-left",
25 | title: "Click Chart for Fullscreen",
26 | title_position: "top-right",
27 | });
28 | cgraph1 = chart.add_graph({
29 | dots: [{x:0.0, y:0.0},
30 | {x:0.1, y:1.0},
31 | {x:0.2, y:0.5},
32 | {x:0.3, y:0.7},
33 | {x:0.4, y:0.2},
34 | {x:0.5, y:0.8},
35 | {x:0.6, y:0.9},
36 | {x:0.7, y:0.5},
37 | {x:0.8, y:0.6},
38 | {x:0.9, y:0.2},
39 | {x:1.0, y:0.0}
40 | ],
41 | type: "H3",
42 | mode: "bottom",
43 | key: "foobar"
44 | });
45 | expander = new TK.Expander({"class":"toolkit-popup"});
46 | root.append_child(expander);
47 | expander.append_child(chart);
48 | TK.seat_all_svg();
49 | }
50 |
51 | .toolkit-expander {
52 | margin: 10px;
53 | width: calc(100% - 20px);
54 | height: calc(100% - 20px);
55 | }
56 | .toolkit-chart {
57 | width: 100%;
58 | height: 100%;
59 | }
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/toolkit/implements/warning.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | /**
22 | * Adds the class "toolkit-warn" on this.element for a certain
23 | * period of time. It is used e.g. in {@link TK.ResponseHandle} or {@link TK.Knob} when the value
24 | * exceeds the range.
25 | *
26 | * @mixin TK.Warning
27 | */
28 | TK.Warning = TK.class({
29 | _class: "Warning",
30 | /**
31 | * Adds the class toolkit-warn to the given element and
32 | * sets a timeout after which the class is removed again. If there
33 | * already is a timeout waiting it gets updated.
34 | *
35 | * @method TK.Warning#warning
36 | *
37 | * @emits TK.Warning#warning
38 | *
39 | * @param {HTMLElement|SVGElement} element - The DOM node the class should be added to.
40 | * @param {Number} [timeout=250] - The timeout in ms until the class should be removed again.
41 | */
42 | warning: function (element, timeout) {
43 | if (!timeout) timeout = 250;
44 | if (this.__wto) window.clearTimeout(this.__wto);
45 | this.__wto = null;
46 | TK.add_class(element, "toolkit-warn");
47 | this.__wto = window.setTimeout(function () {
48 | TK.remove_class(element, "toolkit-warn");
49 | }.bind(this), timeout);
50 | /**
51 | * Gets fired when {@link TK.Warning#warning} was called.
52 | *
53 | * @event TK.Warning#warning
54 | */
55 | this.fire_event("warning");
56 | }
57 | });
58 | })(this, this.TK);
59 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/expander.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | /* POPUP */
21 | .toolkit-expander.toolkit-popup {
22 | background: rgba(216, 216, 216, 0.9);
23 | }
24 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand {
25 | width: 42px;
26 | height: 42px;
27 | }
28 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::after,
29 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::before {
30 | content: "";
31 | display: block;
32 | position: absolute;
33 | height: 4px;
34 | width: 32px;
35 | top: 19px;
36 | left: 5px;
37 | transform: rotate(45deg);
38 | background: #003050;
39 | }
40 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::before {
41 | transform: rotate(135deg);
42 | }
43 |
44 | /* POPUP INPLACE */
45 |
46 | .toolkit-expander.toolkit-popup-inplace {
47 | background: rgba(216, 216, 216, 0.9);
48 | }
49 |
50 | .toolkit-expander.toolkit-popup-inplace.toolkit-expanded > .toolkit-toggle-expand {
51 | width: 42px;
52 | height: 42px;
53 | }
54 | .toolkit-expander.toolkit-popup-inplace.toolkit-expanded > .toolkit-toggle-expand::after,
55 | .toolkit-expander.toolkit-popup-inplace.toolkit-expanded > .toolkit-toggle-expand::before {
56 | content: "";
57 | display: block;
58 | position: absolute;
59 | height: 4px;
60 | width: 32px;
61 | top: 19px;
62 | left: 5px;
63 | transform: rotate(45deg);
64 | background: #003050;
65 | }
66 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::before {
67 | transform: rotate(135deg);
68 | }
69 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/expander.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | /* POPUP */
21 | .toolkit-expander.toolkit-popup {
22 | background: rgba(216, 216, 216, 0.9);
23 | }
24 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand {
25 | width: 42px;
26 | height: 42px;
27 | }
28 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::after,
29 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::before {
30 | content: "";
31 | display: block;
32 | position: absolute;
33 | height: 4px;
34 | width: 32px;
35 | top: 19px;
36 | left: 5px;
37 | transform: rotate(45deg);
38 | background: #003050;
39 | }
40 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::before {
41 | transform: rotate(135deg);
42 | }
43 |
44 | /* POPUP INPLACE */
45 |
46 | .toolkit-expander.toolkit-popup-inplace {
47 | background: rgba(216, 216, 216, 0.9);
48 | }
49 |
50 | .toolkit-expander.toolkit-popup-inplace.toolkit-expanded > .toolkit-toggle-expand {
51 | width: 42px;
52 | height: 42px;
53 | }
54 | .toolkit-expander.toolkit-popup-inplace.toolkit-expanded > .toolkit-toggle-expand::after,
55 | .toolkit-expander.toolkit-popup-inplace.toolkit-expanded > .toolkit-toggle-expand::before {
56 | content: "";
57 | display: block;
58 | position: absolute;
59 | height: 4px;
60 | width: 32px;
61 | top: 19px;
62 | left: 5px;
63 | transform: rotate(45deg);
64 | background: #003050;
65 | }
66 | .toolkit-expander.toolkit-popup.toolkit-expanded > .toolkit-toggle-expand::before {
67 | transform: rotate(135deg);
68 | }
69 |
--------------------------------------------------------------------------------
/toolkit/widgets/notifications.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | /**
23 | * TK.Notifications is a {@link TK.Container} displaying {@link TK.Notification}
24 | * popups.
25 | *
26 | * @class TK.Notifications
27 | *
28 | * @extends TK.Container
29 | *
30 | * @param {Object} [options={ }] - An object containing initial options.
31 | *
32 | * @property {String} [options.stack="end"] - Define the position a new {@link TK.Notification}
33 | * is appended to the container, either `end` or `start`.
34 | */
35 |
36 | TK.Notifications = TK.class({
37 |
38 | _class: "Notifications",
39 | Extends: TK.Container,
40 |
41 | _options: Object.assign(TK.Container.prototype._options, {
42 | stack: "string",
43 | }),
44 | options: {
45 | stack: "start",
46 | },
47 |
48 | initialize: function (options) {
49 | TK.Container.prototype.initialize.call(this, options);
50 | TK.add_class(this.element, "toolkit-notifications");
51 | },
52 |
53 | notify: function (options) {
54 | /**
55 | * Create and show a new notification.
56 | *
57 | * @method TK.Notifications#notify
58 | *
59 | * @param {Object} [options={ }] - An object containing initial options. - Options for the {@link TK.Notification} to add
60 | *
61 | */
62 | var n = new TK.Notification(options);
63 | this.add_child(n);
64 | if (this.options.stack == "start")
65 | this.element.insertBefore(n.element, this.element.firstChild);
66 | else
67 | this.element.appendChild(n.element);
68 | return n;
69 | }
70 | });
71 |
72 | })(this, this.TK);
73 |
--------------------------------------------------------------------------------
/doc/tutorials/Knob.md:
--------------------------------------------------------------------------------
1 | function run_knob(root) {
2 | knob1 = new TK.Knob({
3 | id: "knob1",
4 | min: -96,
5 | max: 24,
6 | value: -20,
7 | markers: [
8 | {from: 0, to: 24}
9 | ],
10 | dots: [
11 | {pos: -96}, {pos: -84}, {pos: -72}, {pos: -60}, {pos: -48}, {pos: -36}, {pos: -24},
12 | {pos: -12}, {pos: 0}, {pos: 12}, {pos: 24}
13 | ],
14 | labels: [
15 | {pos: -96}, {pos: -72}, {pos: -48}, {pos: -24}, {pos: -12}, {pos: 0, label: "\u00B10"}, {pos: 12}, {pos: 24}
16 | ]
17 | });
18 | knob2 = new TK.Knob({
19 | id: "knob2",
20 | margin: 0,
21 | thickness: 4,
22 | min: 20,
23 | max: 20000,
24 | value: 1000,
25 | scale: "frequency",
26 | dot: {length: 4, margin: 0, width: 1},
27 | label: {align: "inner", margin: 3},
28 | dots: [
29 | {pos: 20}, {pos: 30}, {pos: 40}, {pos: 50}, {pos: 60}, {pos: 70}, {pos: 80}, {pos: 90},
30 | {pos: 100}, {pos: 200}, {pos: 300}, {pos: 400}, {pos: 500}, {pos: 600}, {pos: 700}, {pos: 800}, {pos: 900},
31 | {pos: 1000}, {pos: 2000}, {pos: 3000}, {pos: 4000}, {pos: 5000}, {pos: 6000}, {pos: 7000}, {pos: 8000}, {pos: 9000},
32 | {pos: 10000}, {pos: 20000}
33 | ],
34 | labels: [
35 | {pos: 20}, {pos: 100}, {pos: 1000, label: "1k"}, {pos: 2000, label: "2k"}, {pos: 3000, label: "3k"}, {pos: 4000, label: "4k"},
36 | {pos: 10000, label: "10k"}, {pos: 20000, label:"20k"}
37 | ],
38 | hand: {width: 3, length: 3, margin: 24},
39 | styles: {backgroundImage: "url(images/knob2.png)"}
40 | });
41 | root.append_children([ knob1, knob2 ]);
42 | }
43 |
44 | .toolkit-knob {
45 | margin: 10px;
46 | }
47 |
48 | #knob1 {
49 | width: 80px;
50 | height: 80px;
51 | }
52 |
53 | #knob2 {
54 | width: 120px;
55 | heigh: 120px;
56 | background-size: 75%;
57 | }
58 | #knob2 .toolkit-value {
59 | fill: rgba(0, 47, 66, 1);
60 | }
61 | #knob2 .toolkit-warn .toolkit-value {
62 | fill: #c00;
63 | }
64 | #knob2 .toolkit-dot {
65 | fill: white;
66 | }
67 | #knob2 .toolkit-base {
68 | fill: rgba(0, 47, 66, 0.5);
69 | }
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/chart.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-chart > svg {
20 | background-color: rgb(0, 56, 103);
21 | background-image: url(../images/chart/background.png);
22 | background-repeat: repeat-x;
23 | background-size: 100% 100%;
24 | background-position: 50% 50%;
25 | background-clip: padding-box;
26 | filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/chart/background.png',sizingMethod='scale');
27 | -webkit-box-shadow: inset 0px 4px 12px 0px rgba(0, 0, 0, 0.9);
28 | -moz-box-shadow: inset 0px 4px 12px 0px rgba(0, 0, 0, 0.9);
29 | box-shadow: inset 0px 4px 12px 0px rgba(0, 0, 0, 0.9);
30 | border-top: 3px solid #ddd;
31 | border-bottom: 3px solid #fff;
32 | border-left: 2px solid #e8e8e8;
33 | border-right: 2px solid #f3f3f3;
34 | }
35 |
36 | .toolkit-chart {
37 | }
38 |
39 | .toolkit-chart > svg > .toolkit-background {
40 | fill: rgba(0, 0, 0, 0.2);
41 | }
42 | .toolkit-chart > svg > .toolkit-background.toolkit-hover {
43 | fill: rgba(0, 0, 0, 0.5);
44 | }
45 | .toolkit-chart > svg > .toolkit-key {
46 | margin: 8px;
47 | padding: 8px;
48 | fill: white;
49 | opacity: 0.8;
50 | }
51 | .toolkit-chart > svg > .toolkit-key.toolkit-hover {
52 | opacity: 1;
53 | }
54 | .toolkit-chart > svg > .toolkit-key > text > .toolkit-label {
55 | line-height: 1.2em; /* sets the distance between key entries */
56 | margin: 5px; /* sets the distance between labels and example rects */
57 | }
58 | .toolkit-chart > svg > .toolkit-key > .toolkit-rect {
59 |
60 | }
61 |
62 | .toolkit-chart > svg > .toolkit-title {
63 | fill: rgba(255,255,255,0.2);
64 | margin: 8px 26px;
65 | font-weight: bold;
66 | font-size: 2em;
67 | }
68 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/multimeter.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | .toolkit-multi-meter {
21 | margin: 3px;
22 | padding: 0;
23 | }
24 |
25 | .toolkit-multi-meter > .toolkit-title {
26 | height: 1.2em;
27 | line-height: 1.2em;
28 | position: absolute;
29 | top: 3px;
30 | left: 3px;
31 | }
32 |
33 | .toolkit-multi-meter > .toolkit-level-meter {
34 | border: none;
35 | background: transparent;
36 | -webkit-box-shadow: none;
37 | -moz-box-shadow: none;
38 | box-shadow: none;
39 | margin: 0;
40 | -webkit-border-radius: 0px;
41 | -moz-border-radius: 0px;
42 | border-radius: 0px;
43 | padding-top: calc(1.2em + 8px);
44 | }
45 |
46 | .toolkit-multi-meter.toolkit-vertical > .toolkit-level-meter > .toolkit-bar,
47 | .toolkit-multi-meter.toolkit-vertical > .toolkit-level-meter > .toolkit-state {
48 | border-right: 1px solid transparent;
49 | }
50 | .toolkit-multi-meter.toolkit-horizontal > .toolkit-level-meter > .toolkit-bar,
51 | .toolkit-multi-meter.toolkit-horizontal > .toolkit-level-meter > .toolkit-state {
52 | border-bottom: 1px solid transparent;
53 | }
54 | .toolkit-multi-meter.toolkit-vertical > .toolkit-level-meter:nth-last-of-type(1) > .toolkit-bar,
55 | .toolkit-multi-meter.toolkit-vertical > .toolkit-level-meter:nth-last-of-type(1) > .toolkit-state {
56 | border-right: 0px solid transparent;
57 | }
58 | .toolkit-multi-meter.toolkit-horizontal > .toolkit-level-meter:nth-last-of-type(1) > .toolkit-bar,
59 | .toolkit-multi-meter.toolkit-horizontal > .toolkit-level-meter:nth-last-of-type(1) > .toolkit-state {
60 | border-bottom: 0px solid transparent;
61 | }
62 |
63 | .toolkit-multi-meter.toolkit-horizontal .toolkit-level-meter > .toolkit-title {
64 | margin-right: 4px;
65 | }
66 |
--------------------------------------------------------------------------------
/toolkit/widgets/label.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | TK.Label = TK.class({
22 | /**
23 | * TK.Label is a simple text field displaying strings.
24 | *
25 | * @class TK.Label
26 | *
27 | * @extends TK.Widget
28 | *
29 | * @property {Object} options
30 | *
31 | * @param {Mixed} [options.label=""] - The content of the label. Can be formatted via `options.format`.
32 | * @param {Function|Boolean} [options.format=false] - Optional format function.
33 | */
34 | _class: "Label",
35 | Extends: TK.Widget,
36 | _options: Object.assign(Object.create(TK.Widget.prototype._options), {
37 | label: "string",
38 | format: "function|boolean"
39 | }),
40 | options: {
41 | label: "",
42 | format: false,
43 | },
44 | initialize: function (options) {
45 | var E;
46 | TK.Widget.prototype.initialize.call(this, options);
47 | /** @member {HTMLDivElement} TK.Label#element - The main DIV container.
48 | * Has class toolkit-label.
49 | */
50 | if (!(E = this.element)) this.element = E = TK.element("div");
51 | TK.add_class(E, "toolkit-label");
52 | this._text = document.createTextNode("");
53 | E.appendChild(this._text);
54 | this.widgetize(E, true, true, true);
55 | },
56 |
57 | redraw: function () {
58 | var I = this.invalid;
59 | var O = this.options;
60 |
61 | TK.Widget.prototype.redraw.call(this);
62 |
63 | if (I.label || I.format) {
64 | I.label = I.format = false;
65 | this._text.data = O.format ? O.format.call(this, O.label) : O.label;
66 | }
67 | },
68 | });
69 | })(this, this.TK);
70 |
--------------------------------------------------------------------------------
/toolkit/widgets/colorpickerdialog.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | function cancel () {
23 | var self = this.parent;
24 | self.fire_event.call(self, "cancel");
25 | self.close();
26 | }
27 |
28 | function apply (color) {
29 | var self = this.parent;
30 | self.fire_event.call(self, "apply", color);
31 | self.close();
32 | }
33 |
34 | /**
35 | * A {@link TK.Dialog} window containing a {@link TK.ColorPicker}. It can be opened
36 | * programatically and closes automatically on the appropriate user
37 | * interactions like hitting ESC or clicking `apply`. TK.ColorPickerDialog
38 | * inherits all options of TK.ColorPicker.
39 | *
40 | * @class TK.ColorPickerDialog
41 | *
42 | * @extends TK.Dialog
43 | *
44 | * @param {Object} [options={ }] options - An object containing initial options.
45 | *
46 | */
47 | TK.ColorPickerDialog = TK.class({
48 |
49 | _class: "ColorPickerDialog",
50 | Extends: TK.Dialog,
51 |
52 | initialize: function (options) {
53 | TK.Dialog.prototype.initialize.call(this, options);
54 | /** @member {HTMLDivElement} TK.ColorPickerDialog#element - The main DIV container.
55 | * Has class toolkit-color-picker-dialog.
56 | */
57 | TK.add_class(this.element, "toolkit-color-picker-dialog");
58 | },
59 | });
60 |
61 | /**
62 | * @member {TK.ColorPicker} TK.ColorPickerDialog#colorpicker - The {@ink TK.ColorPicker} widget.
63 | */
64 | TK.ChildWidget(TK.ColorPickerDialog, "colorpicker", {
65 | create: TK.ColorPicker,
66 | show: true,
67 | inherit_options: true,
68 | userset_delegate: true,
69 | static_events: {
70 | cancel: cancel,
71 | apply: apply,
72 | },
73 | });
74 |
75 | })(this, this.TK);
76 |
--------------------------------------------------------------------------------
/toolkit/widgets/sortablelist.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | /* TODO */
23 |
24 | var build_dragcapture = function () {
25 | this.dragcapture = new TK.DragCapture(this, {
26 | state: true,
27 | onstartcapture: function (state) {
28 | console.log(state, "start");
29 | return true;
30 | },
31 | onmovecapture: function (state) {
32 | console.log(state, "move");
33 | },
34 | onstopcapture: function () {
35 | console.log("stop");
36 | }
37 | });
38 | }
39 |
40 | TK.SortableList = TK.class({
41 |
42 | _class: "SortableList",
43 | Extends: TK.List,
44 |
45 | _options: Object.assign(Object.create(TK.Container.prototype._options), {
46 | sortable: "boolean",
47 | }),
48 | options: {
49 | sortable: false,
50 | item_class: TK.SortableListItem,
51 | },
52 | initialize: function (options) {
53 | TK.List.prototype.initialize.call(this, options);
54 | this.element.add_class("toolkit-sortable-list");
55 | },
56 | add_item: function (item, pos) {
57 | var O = this.options;
58 | var item = TK.List.prototype.add_item.call(this, item, pos);
59 | item.set("sortable", O.sortable);
60 | },
61 | set: function (key, value) {
62 | switch (key) {
63 | case "sortable":
64 | var I = this.options.items;
65 | for (var i = 0; i < I.length; i++)
66 | I[i].set("sortable", value);
67 | if (value && !this.dragcapture)
68 | build_dragcapture.call(this);
69 | break;
70 | }
71 | return TK.List.prototype.set.call(this, key, value);
72 | }
73 | });
74 |
75 |
76 | })(this, this.TK);
77 |
--------------------------------------------------------------------------------
/doc/tutorials/Equalizer.md:
--------------------------------------------------------------------------------
1 | function run_equalizer (root) {
2 | eq = new TK.Equalizer({
3 | styles: {
4 | "margin": "10px",
5 | },
6 | width: "calc(100% - 20px)",
7 | height: "calc(100% - 20px)",
8 | depth: 120,
9 | db_grid: 12,
10 | range_z: {min: 0.4, max: 4, step: 0.1, shift_up: 10, shift_down: 0.2, reverse: true},
11 | bands: [
12 | {freq:600, gain:-12, q:3, type:"parametric",
13 | z_handle: "right", title:"Band 1", z_min: 0.4, z_max: 4},
14 | {freq:2000, gain:12, q:1, type:"parametric",
15 | z_handle: "right", title:"Band 1", z_min: 0.4, z_max: 4},
16 | {freq:200, gain:-12, q:1, type:"low-shelf",
17 | z_handle: "right", title:"Low Shelf",
18 | preferences: ["top-right", "top", "top-left",
19 | "right", "center", "left",
20 | "bottom-right", "bottom", "bottom-left"],
21 | z_min: 0.4, z_max: 4},
22 | {freq:7000, gain: 12, q:1, type:"high-shelf",
23 | z_handle: "left", title:"High Shelf",
24 | preferences: ["top-left", "top", "top-right",
25 | "left", "center", "right",
26 | "bottom-left", "bottom", "bottom-right"],
27 | z_min: 0.4, z_max: 4},
28 | {freq:40, q: 1, type:"highpass2", title:"High Pass",
29 | preferences: ["top-right", "top", "top-left",
30 | "right", "center", "left",
31 | "bottom-right", "bottom", "bottom-left"],
32 | label: function (title, x, y, z) { return title + "\n" + TK.sprintf("%.2f", x) + " Hz"; } },
33 | {freq:15000, q: 1, type:"lowpass2", title:"Low Pass",
34 | preferences: ["top-left", "top", "top-right",
35 | "left", "center", "right",
36 | "bottom-left", "bottom", "bottom-right"],
37 | label: function (title, x, y, z) { return title + "\n" + TK.sprintf("%.2f", x) + " Hz"; } }]
38 | });
39 | root.append_child(eq);
40 | TK.seat_all_svg()
41 | }
42 |
43 | .toolkit-equalizer {
44 | margin: 10px;
45 | width: calc(100% - 20px);
46 | height: calc(100% - 20px);
47 | }
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/toolkit/widgets/list.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | TK.List = TK.class({
23 | /**
24 | * TK.List is a sortable {@link TK.Container} for {@TK.ListItems}s.
25 | * the element is a UL instead of a DIV.
26 | *
27 | * @param {Object} [options={ }] - An object containing initial options.
28 | *
29 | * @property {Function|Boolean} [options.sort=false] - A function
30 | * expecting arguments A and B, returning a number <0, if A comes first and >0,
31 | * if B comes first. 0 keeps both elements in place. Please refer to the
32 | * compareFunction at W3Schools
33 | * for any further information.
34 | *
35 | * @class TK.List
36 | *
37 | * @extends TK.Container
38 | */
39 | _options: Object.assign(Object.create(TK.Container.prototype._options), {
40 | sort: "function",
41 | }),
42 | _class: "List",
43 | Extends: TK.Container,
44 |
45 | initialize: function (options) {
46 | this.element = TK.element("ul", "toolkit-list");
47 | TK.Container.prototype.initialize.call(this, options);
48 | },
49 | static_events: {
50 | set_sort: function(f) {
51 | if (typeof(f) === "function") {
52 | var C = this.children.slice(0);
53 | C.sort(f);
54 | for (var i = 0; i < C.length; i++) {
55 | this.element.appendChild(C[i].element);
56 | }
57 | }
58 | },
59 | },
60 | append_child: function(w) {
61 | TK.Container.prototype.append_child.call(this, w);
62 | var O = this.options;
63 | var C = this.children;
64 | if (O.sort) {
65 | C.sort(O.sort);
66 | var pos = C.indexOf(w);
67 | if (pos !== C.length - 1)
68 | this.element.insertBefore(w.element, C[pos+1].element);
69 | }
70 | },
71 | });
72 |
73 | })(this, this.TK);
74 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/valuebutton.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-valuebutton {
20 | padding: 0;
21 |
22 | grid-column-gap: 8px;
23 | grid-row-gap: 0px;
24 | }
25 |
26 | .toolkit-valuebutton.toolkit-dragging,
27 | .toolkit-valuebutton.toolkit-scrolling {
28 | border: 1px solid #002f42;
29 | }
30 | .toolkit-valuebutton.toolkit-warn {
31 | border: 1px solid #c00;
32 | }
33 |
34 | .toolkit-valuebutton > .toolkit-icon {
35 | margin-left: 8px;
36 | margin-top: 4px;
37 | margin-bottom: 4px;
38 | }
39 | .toolkit-valuebutton > .toolkit-label {
40 | margin-top: 4px;
41 | margin-bottom: 4px;
42 | }
43 | .toolkit-valuebutton > .toolkit-scale {
44 | margin-left: 8px;
45 | margin-bottom: 4px;
46 | height: 16px;
47 | }
48 | .toolkit-valuebutton > .toolkit-scale::before {
49 | content: "";
50 | display: block;
51 | position: absolute;
52 | bottom: 0;
53 | left: 0;
54 | right: 0;
55 | height: 4px;
56 | background: white;
57 | }
58 |
59 | .toolkit-valuebutton > .toolkit-scale > .toolkit-dot {
60 | height: 4px;
61 | }
62 |
63 | .toolkit-valuebutton > .toolkit-value {
64 | background: rgba(0,0,0,0.033);
65 | border: none;
66 | -webkit-border-top-right-radius: 5px;
67 | -webkit-border-bottom-right-radius: 5px;
68 | -moz-border-radius-topright: 5px;
69 | -moz-border-radius-bottomright: 5px;
70 | border-top-right-radius: 5px;
71 | border-bottom-right-radius: 5px;
72 |
73 | justify-self: stretch;
74 | align-self: stretch;
75 | }
76 | .toolkit-valuebutton > .toolkit-value > .toolkit-input {
77 | width: 100%;
78 | height: 100%;
79 | }
80 | .toolkit-valuebutton.toolkit-dragging > .toolkit-label,
81 | .toolkit-valuebutton.toolkit-scrolling > .toolkit-label {
82 | background-color: #002f42;
83 | color: white;
84 | text-shadow: 0px -1px 0px black;
85 | -webkit-border-radius: 4px;
86 | -moz-border-radius: 4px;
87 | border-radius: 4px;
88 | }
89 |
--------------------------------------------------------------------------------
/toolkit/widgets/tagnode.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | TK.TagNode = TK.class({
23 |
24 | Extends: TK.Container,
25 | Implements: TK.Colors,
26 |
27 | _options: Object.assign(Object.create(TK.Container.prototype._options), {
28 | label: "string",
29 | color: "string|null",
30 | confirm: "boolean",
31 | }),
32 | options: {
33 | label: "",
34 | color: null,
35 | confirm: false,
36 | },
37 |
38 | initialize: function (options, tag) {
39 | TK.Container.prototype.initialize.call(this, options);
40 | this.tag = tag;
41 | this.add_class("toolkit-tag");
42 |
43 | },
44 |
45 | redraw: function () {
46 | TK.Container.prototype.redraw.call(this);
47 | var I = this.invalid;
48 | var O = this.options;
49 | if (I.color) {
50 | I.color = false;
51 | this.element.style.backgroundColor = O.color;
52 | if (O.color)
53 | this.element.style.color = this.rgb2bw(this.hex2rgb(O.color));
54 | else
55 | this.element.style.color = null;
56 | }
57 | }
58 | });
59 |
60 | TK.ChildWidget(TK.TagNode, "label", {
61 | create: TK.Label,
62 | show: true,
63 | map_options: {
64 | tag: "label",
65 | },
66 | toggle_class: true,
67 | });
68 | TK.ChildWidget(TK.TagNode, "colorize", {
69 | create: TK.Button,
70 | show: false,
71 | toggle_class: true,
72 | static_events: {
73 | click: function (e) { this.parent.fire_event("colorize", e); }
74 | },
75 | default_options: {
76 | class: "toolkit-colorize"
77 | },
78 | });
79 | TK.ChildWidget(TK.TagNode, "remove", {
80 | create: TK.ConfirmButton,
81 | show: true,
82 | toggle_class: true,
83 | static_events: {
84 | confirmed: function (e) { this.parent.fire_event("remove", e, this.parent); }
85 | },
86 | default_options: {
87 | class: "toolkit-remove",
88 | label : "",
89 | confirm: false,
90 | },
91 | });
92 |
93 | })(this, this.TK);
94 |
--------------------------------------------------------------------------------
/doc/docs/Widgets.md:
--------------------------------------------------------------------------------
1 | # Widgets inside the DOM
2 |
3 | This document describes briefly how toolkit widgets can be used inside of a HTML layout.
4 |
5 | Widgets are organized in a tree. This tree will usually be similar to the DOM
6 | tree, where each widget consists of at least one DOM element. There may be
7 | several disconnected widget trees at the same time. The root of a widget tree
8 | should always be a widget which is a subclass of Root. The Root widget takes
9 | care of tracking resize events and (possibly) document visibility changes.
10 |
11 | By default all Widgets are represented by DOM Elements with `display: inline-block`.
12 | When layouting an interface they can therefore be absolutely positioned inside
13 | a container.
14 | Alternatively, they can also simply be floating, which makes it easier to build grid-like layouts
15 | which reorganize themselves depending on window size.
16 |
17 | However, utilizing CSS features like grid and flexbox is recommended.
18 |
19 | All widgets can be given a size using CSS alone.
20 | This makes it possible to build fully responsive layouts by using CSS only.
21 | Some widgets need to redraw parts of themselves when they are resized.
22 | The Root widgets therefore fires a `resize` event on the full widget tree.
23 | In cases where the size of widgets is purely determined by CSS, this is sufficient.
24 | If however, parts of the layout require dynamic resizing using Javascript, there are simple
25 | techniques that need to be used.
26 |
27 | The simplest case is when a widget should be resized using javascript whenever the window size changes.
28 | There are certain situations in which purely relying on CSS is not enough.
29 | In that case, the way to do that is to register for the `resize` even on the widget to be resized
30 | and set the appropriate style attributes when the resize event occurs.
31 |
32 | For example:
33 |
34 | chart.add_event('resize', function() {
35 | var width, height;
36 | /* calculate new size */
37 |
38 | this.set_style('width', width);
39 | this.set_style('height', height);
40 | });
41 |
42 | This way the widget itself (and all its children) will be able to correctly determine their new size
43 | and redraw themselves if necessary.
44 |
45 | In the more general case when widgets are resized dynamically in the absense of window resize events,
46 | it is necessary to call the `resize()` method on that part of the widget tree, which is affected by
47 | the size change.
48 |
49 | For example:
50 |
51 | function shrink_chart() {
52 | chart.set_style('width', 400);
53 | chart.set_style('height', 200);
54 |
55 | chart.resize();
56 | }
57 |
58 | function grow_chart() {
59 | chart.set_style('width', 400);
60 | chart.set_style('height', 400);
61 |
62 | chart.resize();
63 | }
64 |
--------------------------------------------------------------------------------
/doc/tutorials/Chart.md:
--------------------------------------------------------------------------------
1 | function run_chart (root) {
2 | chart = new TK.Chart({
3 | range_x: {scale: "linear", min:0, max:1},
4 | range_y: {scale: "linear", min:0, max:1},
5 | grid_x: [{pos:0.0, label:"0"},
6 | {pos:0.1},
7 | {pos:0.2, label:"20"},
8 | {pos:0.3},
9 | {pos:0.4, label:"40"},
10 | {pos:0.5, label: "50", color: "rgba(255,255,255,0.66)"},
11 | {pos:0.6, label:"60"},
12 | {pos:0.7},
13 | {pos:0.8, label:"80"},
14 | {pos:0.9},
15 | {pos:1.0, label:"100"}],
16 | grid_y: [{pos:0.0, label:"0"},
17 | {pos:0.2, label:"20"},
18 | {pos:0.4, label:"40"},
19 | {pos:0.5, label: "50", color: "rgba(255,255,255,0.66)"},
20 | {pos:0.6, label:"60"},
21 | {pos:0.8, label:"80"},
22 | {pos:1.0, label:"100"}],
23 | key: "top-left",
24 | title: "Chart Example",
25 | title_position: "top-right",
26 | });
27 | cgraph1 = chart.add_graph({
28 | dots: [{x:0.0, y:0.0},
29 | {x:0.1, y:1.0},
30 | {x:0.2, y:0.5},
31 | {x:0.3, y:0.7},
32 | {x:0.4, y:0.2},
33 | {x:0.5, y:0.8},
34 | {x:0.6, y:0.9},
35 | {x:0.7, y:0.5},
36 | {x:0.8, y:0.6},
37 | {x:0.9, y:0.2},
38 | {x:1.0, y:0.0}
39 | ],
40 | type: "H3",
41 | mode: "bottom",
42 | key: "foo"
43 | });
44 | cgraph2 = chart.add_graph({
45 | dots: [{x:0.0, y:0.5},
46 | {x:0.2, y:0.1},
47 | {x:0.4, y:0.5},
48 | {x:0.6, y:0.4},
49 | {x:0.8, y:0.3},
50 | {x:1.0, y:0.9}
51 | ],
52 | color: "#dd0000",
53 | key: "bar"
54 | });
55 | cgraph3 = chart.add_graph({
56 | dots: [{x:0.0, y:0.1},
57 | {x:0.2, y:0.5},
58 | {x:0.4, y:0.7},
59 | {x:0.6, y:0.3},
60 | {x:0.8, y:0.5},
61 | {x:1.0, y:0.1}
62 | ],
63 | color: "#ffffff",
64 | key: "baz"
65 | });
66 | TK.seat_all_svg()
67 | root.append_child(chart);
68 | }
69 |
70 | .toolkit-chart {
71 | margin: 10px;
72 | width: calc(100% - 20px);
73 | height: calc(100% - 20px);
74 | }
75 |
76 |
77 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/meterbase.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | /*
20 | AVAILABLE DEFAULT BACKGROUNDS
21 | background-image: url(../images/meterbase/grid_soft.png);
22 | background-image: url(../images/meterbase/grid_strong.png);
23 | background-image: url(../images/meterbase/slim_soft_vertical.png);
24 | background-image: url(../images/meterbase/slim_strong_vertical.png);
25 | background-image: url(../images/meterbase/slim_soft_horizontal.png);
26 | background-image: url(../images/meterbase/slim_strong_horizontal.png);
27 | background-image: url(../images/meterbase/led_vertical.png);
28 | background-image: url(../images/meterbase/led_horizontal.png);
29 | background-image: url(../images/meterbase/bevel_soft_vertical.png);
30 | background-image: url(../images/meterbase/bevel_strong_vertical.png);
31 | background-image: url(../images/meterbase/bevel_soft_horizontal.png);
32 | background-image: url(../images/meterbase/bevel_strong_horizontal.png);
33 | */
34 |
35 | /* BASE */
36 |
37 | .toolkit-meter-base {
38 | padding: 4px;
39 | margin: 4px;
40 | }
41 |
42 | /* LABEL */
43 |
44 | .toolkit-meter-base > .toolkit-label {
45 | line-height: 1.2em;
46 | height: 1.2em;
47 | overflow: visible;
48 | font-size: 0.8em;
49 | }
50 |
51 | /* TITLE */
52 |
53 | .toolkit-meter-base > .toolkit-title {
54 | line-height: 1.2em;
55 | height: 1.2em;
56 | overflow: visible;
57 | font-size: 0.8em;
58 | }
59 |
60 | /* SCALE */
61 |
62 | .toolkit-meter-base > .toolkit-scale {
63 |
64 | }
65 |
66 | /* BAR */
67 |
68 | .toolkit-meter-base > .toolkit-bar {
69 |
70 | }
71 | .toolkit-meter-base.toolkit-horizontal > .toolkit-bar {
72 | height: 16px;
73 | }
74 | .toolkit-meter-base.toolkit-vertical > .toolkit-bar {
75 | width: 16px;
76 | }
77 | .toolkit-meter-base.toolkit-horizontal > .toolkit-bar {
78 | height: 16px;
79 | }
80 | .toolkit-meter-base.toolkit-vertical > .toolkit-bar {
81 | width: 16px;
82 | }
83 |
84 | /* MASK */
85 |
86 | .toolkit-meter-base > .toolkit-bar > .toolkit-mask {
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/toolkit/widgets/root.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | function visibility_change() {
22 | if (document.hidden) {
23 | this.disable_draw();
24 | } else {
25 | this.enable_draw();
26 | }
27 | }
28 | function resized() {
29 | if (!this.resize_event) {
30 | this.resize_event = true;
31 | this.trigger_resize();
32 | }
33 | }
34 | /**
35 | * TK.Root is used to force a resize on all its child widgets
36 | * as soon as the browser window is resized. It also toggles drawing
37 | * of its children depending on the state of visibility of the
38 | * browser tab or browser window.
39 | *
40 | * @extends TK.Container
41 | *
42 | * @class TK.Root
43 | */
44 | TK.Root = TK.class({
45 | Extends: TK.Container,
46 | _class: "Root",
47 | _options: Object.create(TK.Container.prototype._options),
48 | static_events: {
49 | initialized: function () {
50 | window.addEventListener("resize", this._resize_cb);
51 | document.addEventListener("visibilitychange", this._visibility_cb, false);
52 | this.enable_draw();
53 | },
54 | destroy: function() {
55 | window.removeEventListener("resize", this._resize_cb);
56 | document.removeEventListener("visibilitychange", this._visibility_cb)
57 | this._resize_cb = this._visibility_cb = null;
58 | },
59 | redraw: function() {
60 | if (this.resize_event)
61 | this.resize_event = false;
62 | },
63 | },
64 | initialize: function (options) {
65 | TK.Container.prototype.initialize.call(this, options);
66 | /**
67 | * @member {HTMLDivElement} TK.Root#element - The main DIV container.
68 | * Has class toolkit-root.
69 | */
70 | TK.add_class(this.element, "toolkit-root");
71 | this._resize_cb = resized.bind(this);
72 | this._visibility_cb = visibility_change.bind(this);
73 | this.resize_event = false;
74 | },
75 | });
76 | })(this, this.TK);
77 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/buttonarray.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-buttonarray {
20 | height: 36px;
21 | }
22 |
23 | .toolkit-buttonarray.toolkit-vertical {
24 | text-align: left;
25 | }
26 | .toolkit-buttonarray.toolkit-horizontal > .toolkit-previous {
27 | width: 40px;
28 | padding-left: 4px;
29 | padding-right: 4px;
30 | }
31 | .toolkit-buttonarray.toolkit-horizontal > .toolkit-next {
32 | width: 40px;
33 | padding-left: 4px;
34 | padding-right: 4px;
35 | }
36 |
37 | .toolkit-buttonarray > .toolkit-clip {
38 | transition: left 0.5s ease-in-out, top 0.5s ease-in-out, right 0.5s ease-in-out, bottom 0.5s ease-in-out;
39 | }
40 | .toolkit-buttonarray.toolkit-over.toolkit-horizontal > .toolkit-clip {
41 |
42 | }
43 | .toolkit-buttonarray.toolkit-over.toolkit-vertical > .toolkit-clip {
44 |
45 | }
46 |
47 | .toolkit-buttonarray > .toolkit-clip > .toolkit-container {
48 | transition: left 0.5s ease-in-out, top 0.5s ease-in-out;
49 | }
50 |
51 | .toolkit-buttonarray.toolkit-horizontal > .toolkit-clip > .toolkit-container {
52 |
53 | }
54 | .toolkit-buttonarray.toolkit-vertical > .toolkit-clip > .toolkit-container {
55 |
56 | }
57 |
58 | .toolkit-buttonarray > .toolkit-clip > .toolkit-container > .toolkit-button {
59 | margin: 0;
60 | }
61 | .toolkit-buttonarray > .toolkit-clip > .toolkit-container > .toolkit-button.toolkit-active {
62 |
63 | }
64 | .toolkit-buttonarray > .toolkit-clip > .toolkit-container > .toolkit-button > .toolkit-label {
65 | white-space: nowrap;
66 | width: 100%;
67 | box-sizing: border-box;
68 | }
69 | .toolkit-buttonarray.toolkit-horizontal > .toolkit-clip > .toolkit-container > .toolkit-button {
70 | height: 100%;
71 | }
72 | .toolkit-buttonarray.toolkit-vertical > .toolkit-clip > .toolkit-container > .toolkit-button {
73 | display: flex;
74 | width: 100%;
75 | }
76 | .toolkit-buttonarray.toolkit-vertical > .toolkit-clip > .toolkit-container > .toolkit-button:hover,
77 | .toolkit-buttonarray.toolkit-vertical > .toolkit-clip > .toolkit-container > .toolkit-button:active
78 | {
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/toolkit/widgets/tags.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function (w, TK) {
21 |
22 | TK.Tags = TK.class({
23 |
24 | Extends: TK.Widget,
25 |
26 | _options: Object.assign(Object.create(TK.Widget.prototype._options), {
27 | tag_class: "object",
28 | }),
29 | options: {
30 | tag_class: TK.Tag,
31 | },
32 |
33 | initialize: function (options) {
34 | this.tags = new Map();
35 | this.tag_to_name = new Map();
36 | TK.Widget.prototype.initialize.call(this, options);
37 | },
38 | tag_to_string: function (tag) {
39 | if (typeof tag == "string") {
40 | return tag
41 | } else if (TK.Tag.prototype.isPrototypeOf(tag)) {
42 | if (!tag.is_destructed()) {
43 | return tag.options.tag;
44 | } else {
45 | return this.tag_to_name.get(tag);
46 | }
47 | } else {
48 | return tag.tag;
49 | }
50 | },
51 | find_tag: function (tag) {
52 | return this.tags.get(this.tag_to_string(tag));
53 | },
54 | request_tag: function (tag, options) {
55 | var C = this.options.tag_class;
56 | var t = this.tag_to_string(tag);
57 |
58 | if (this.tags.has(t)) {
59 | tag = this.tags.get(t);
60 | if (!tag.is_destructed()) return tag;
61 | }
62 |
63 | if (typeof tag == "string") {
64 | var o = Object.assign(options || {}, {tag:tag});
65 | tag = new C(o);
66 | } else if (C.prototype.isPrototypeOf(tag)) {
67 | tag = tag;
68 | } else {
69 | tag = new C(tag);
70 | }
71 | tag.show();
72 | this.tags.set(t, tag);
73 | this.tag_to_name.set(tag, t);
74 | return tag;
75 | },
76 | remove_tag: function (tag) {
77 | tag = this.find_tag(tag);
78 | this.tags.delete(this.tag_to_string(tag));
79 | this.tag_to_name.delete(tag);
80 | },
81 | empty: function() {
82 | this.tags = new Map();
83 | this.tag_to_name = new Map();
84 | },
85 | });
86 |
87 | })(this, this.TK);
88 |
--------------------------------------------------------------------------------
/toolkit/implements/globalcursor.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | /**
22 | * TK.GlobalCursor adds global cursor classes to ensure
23 | * one of the standard cursors
24 | * is shown in the overall application.
25 | *
26 | * @mixin TK.GlobalCursor
27 | */
28 | TK.GlobalCursor = TK.class({
29 | _class: "GlobalCursor",
30 | /**
31 | * Adds a class "toolkit-cursor-" + cursor to the document.body to show a specific cursor.
32 | *
33 | * @method TK.GlobalCursor#global_cursor
34 | *
35 | * @param {string} cursor - The name of the cursor to show.
36 | *
37 | * @emits TK.GlobalCursor#globalcursor
38 | */
39 | global_cursor: function (cursor) {
40 | TK.add_class(document.body, "toolkit-cursor-" + cursor);
41 | /**
42 | * Is fired when a cursor gets set.
43 | *
44 | * @event TK.GlobalCursor#globalcursor
45 | *
46 | * @param {string} cursor - The name of the cursor to show.
47 | */
48 | this.fire_event("globalcursor", cursor);
49 | },
50 | /**
51 | * Removes the class from document.body node.
52 | *
53 | * @method TK.GlobalCursor#remove_cursor
54 | *
55 | * @param {string} cursor - The name of the cursor to remome.
56 | *
57 | * @emits TK.GlobalCursor#cursorremoved
58 | */
59 | remove_cursor: function (cursor) {
60 | TK.remove_class(document.body, "toolkit-cursor-" + cursor);
61 | /**
62 | * Is fired when a cursor is removed.
63 | *
64 | * @event TK.GlobalCursor#cursorremoved
65 | *
66 | * @param {string} cursor - The name of the cursor to remove.
67 | */
68 | this.fire_event("cursorremoved", cursor);
69 | }
70 | });
71 | })(this, this.TK);
72 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/window.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | .toolkit-window {
20 | -webkit-box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.33);
21 | -moz-box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.33);
22 | box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.33);
23 | opacity: 1;
24 | }
25 | .toolkit-window.toolkit-inactive {
26 | opacity: 0.5;
27 | -webkit-box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.2);
28 | -moz-box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.2);
29 | box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.2);
30 | }
31 |
32 | .toolkit-window.toolkit-resizing,
33 | .toolkit-window.toolkit-dragging {
34 | opacity: 0.7;
35 | }
36 |
37 | .toolkit-window > .toolkit-content {
38 | margin: 4px;
39 | }
40 |
41 | .toolkit-window > .toolkit-header {
42 | line-height: 30px;
43 | background: #00ccff;
44 | color: white;
45 | }
46 | .toolkit-window > .toolkit-footer {
47 | line-height: 30px;
48 | border-top: 1px solid white;
49 | }
50 |
51 | .toolkit-window > .toolkit-header > .toolkit-title,
52 | .toolkit-window > .toolkit-footer > .toolkit-title {
53 | text-align: left;
54 | font-size: bold;
55 | }
56 | .toolkit-window > .toolkit-header > .toolkit-status,
57 | .toolkit-window > .toolkit-footer > .toolkit-status {
58 | text-align: left;
59 | margin: 0 5px;
60 | }
61 | .toolkit-window > .toolkit-header > .toolkit-icon,
62 | .toolkit-window > .toolkit-footer > .toolkit-icon {
63 | width: 24px;
64 | height: 24px;
65 | margin: 3px;
66 | }
67 | .toolkit-window > .toolkit-header > .toolkit-button,
68 | .toolkit-window > .toolkit-footer > .toolkit-button {
69 | background: transparent;
70 | border-color: transparent;
71 | position: relative;
72 | padding: 0;
73 | width: 24px;
74 | height: 24px;
75 | margin: 0 2px;
76 | }
77 |
78 | .toolkit-window > .toolkit-header > .toolkit-button .toolkit-icon,
79 | .toolkit-window > .toolkit-footer > .toolkit-button .toolkit-icon {
80 | height: 16px;
81 | margin: 0;
82 | font-size: 16px;
83 | line-height: 16px;
84 | text-shadow: none !important;
85 | }
86 |
87 |
88 | .toolkit-window.toolkit-shrinked {
89 | height: 32px !important;
90 | }
91 |
--------------------------------------------------------------------------------
/doc/tutorials/ButtonArray.md:
--------------------------------------------------------------------------------
1 | function run_buttonarray(root) {
2 | ba_horiz1 = new TK.ButtonArray({
3 | buttons: [
4 | {label: "Button 1"},
5 | {label: "Button 2"},
6 | {label: "Button 3"},
7 | {label: "Button 4"},
8 | ],
9 | show: 3
10 | });
11 | ba_horiz2 = new TK.ButtonArray({
12 | buttons: [
13 | {label: "Button 1"},
14 | {label: "Button 2"},
15 | {label: "Button 3"},
16 | {label: "Button 4"},
17 | {label: "Button 5"},
18 | {label: "Button 6"},
19 | {label: "Button 7"},
20 | {label: "Button 8"},
21 | {label: "Button 9"},
22 | {label: "Button 10"},
23 | {label: "Button 11"},
24 | {label: "Button 12"},
25 | {label: "Button 13"},
26 | {label: "Button 14"},
27 | {label: "Button 15"},
28 | {label: "Button 16"}
29 | ],
30 | show: 1
31 | });
32 | ba_vert1 = new TK.ButtonArray({
33 | direction: "vertical",
34 | buttons: [
35 | {label: "Button 1"},
36 | {label: "Button 2"},
37 | {label: "Button 3"},
38 | {label: "Button 4"},
39 | {label: "Button 5"},
40 | {label: "Button 6"},
41 | {label: "Button 7"},
42 | {label: "Button 8"},
43 | ],
44 | show: 8
45 | });
46 | ba_vert2 = new TK.ButtonArray({
47 | direction: "vertical",
48 | buttons: [
49 | {label: "Button 1"},
50 | {label: "Button 2"},
51 | {label: "Button 3"},
52 | {label: "Button 4"},
53 | {label: "Button 5"},
54 | {label: "Button 6"},
55 | {label: "Button 7"},
56 | {label: "Button 8"},
57 | {label: "Button 9"},
58 | {label: "Button 10"},
59 | {label: "Button 11"},
60 | {label: "Button 12"},
61 | {label: "Button 13"},
62 | {label: "Button 14"},
63 | {label: "Button 15"},
64 | {label: "Button 16"}
65 | ],
66 | show: 15
67 | });
68 | root.append_child(ba_vert1);
69 | root.append_child(ba_horiz1);
70 | root.append_child(ba_vert2);
71 | root.append_child(ba_horiz2);
72 | }
73 |
74 | .toolkit-buttonarray.toolkit-vertical {
75 | height: 400px;
76 | margin-right: 20px;
77 | float: left;
78 | }
79 | .toolkit-buttonarray.toolkit-horizontal {
80 | width: calc(100% - 250px);
81 | float: right;
82 | margin-bottom: 20px;
83 | }
84 |
85 |
86 |
--------------------------------------------------------------------------------
/doc/tutorials/Pager.md:
--------------------------------------------------------------------------------
1 | function run_pager(root) {
2 | pager1 = new TK.Pager({
3 | pages: [
4 | {label: "Page #1", content: TK.html("This is Page #1.
") }, 5 | {label: "Page #2", content: TK.html("This is Page #2.
") }, 6 | {label: "Page #3", content: TK.html("This is Page #3.
") }, 7 | {label: "Page #4", content: TK.html("This is Page #4.
") }, 8 | {label: "Page #5", content: TK.html("This is Page #5.
") }, 9 | {label: "Page #6", content: TK.html("This is Page #6.
") }, 10 | {label: "Page #7", content: TK.html("This is Page #7.
") }, 11 | {label: "Page #8", content: TK.html("This is Page #8.
") }, 12 | {label: "Page #9", content: TK.html("This is Page #9.
") }, 13 | {label: "Page #10", content: TK.html("This is Page #10.
") }, 14 | {label: "Page #11", content: TK.html("This is Page #11.
") }, 15 | {label: "Page #12", content: TK.html("This is Page #12.
") } 16 | ], 17 | show: 4, 18 | position: "right", 19 | "class": "pager-newspaper", 20 | }); 21 | pager2 = new TK.Pager({ 22 | pages: [ 23 | {label: "Page #1", content: TK.html("This is Page #1.
") }, 24 | {label: "Page #2", content: TK.html("This is Page #2.
") }, 25 | {label: "Page #3", content: TK.html("This is Page #3.
") }, 26 | {label: "Page #4", content: TK.html("This is Page #4.
") }, 27 | {label: "Page #5", content: TK.html("This is Page #5.
") }, 28 | {label: "Page #6", content: TK.html("This is Page #6.
") }, 29 | {label: "Page #7", content: TK.html("This is Page #7.
") }, 30 | {label: "Page #8", content: TK.html("This is Page #8.
") }, 31 | {label: "Page #9", content: TK.html("This is Page #9.
") }, 32 | {label: "Page #10", content: TK.html("This is Page #10.
") }, 33 | {label: "Page #11", content: TK.html("This is Page #11.
") }, 34 | {label: "Page #12", content: TK.html("This is Page #12.
") } 35 | ], 36 | show: 4, 37 | }); 38 | root.append_child(pager1); 39 | root.append_child(pager2); 40 | } 41 |
42 | .toolkit-pager {
43 | width: 100%;
44 | height: 200px;
45 | margin-bottom: 30px;
46 | }
47 |
48 |
49 |
--------------------------------------------------------------------------------
/toolkit/implements/anchor.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | /**
22 | * TK.Anchor provides a single function translate_anchor
23 | * which returns real x and y values from a relative positioning.
24 | * For example positioning a {@link TK.Window} with anchor center
25 | * needs to subtract half of its width from y and half of its height
26 | * from x to appear at the correct position.
27 | *
28 | * @mixin TK.Anchor
29 | */
30 | TK.Anchor = TK.class({
31 | /**
32 | * Returns real x and y values from a relative positioning.
33 | *
34 | * @method TK.Anchor#translate_anchor
35 | *
36 | * @param {string} [anchor="top-left"] - Position of the anchor.
37 | * @param {number} x - X position to translate.
38 | * @param {number} y - Y position to translate.
39 | * @param {number} width - Width of the element.
40 | * @param {number} height - Height of the element.
41 | *
42 | * @returns {object} Object with members x and y as numbers
43 | */
44 | translate_anchor: function (anchor, x, y, width, height) {
45 | switch (anchor) {
46 | case "top-left":
47 | break;
48 | case "top":
49 | x += width / 2;
50 | break;
51 | case "top-right":
52 | x += width;
53 | break;
54 | case "left":
55 | y += height / 2;
56 | break;
57 | case "center":
58 | x += width / 2;
59 | y += height / 2;
60 | break;
61 | case "right":
62 | x += width;
63 | y += height / 2;
64 | break;
65 | case "bottom-left":
66 | y += height;
67 | break;
68 | case "bottom":
69 | x += width / 2;
70 | y += height;
71 | break;
72 | case "bottom-right":
73 | x += width;
74 | y += height;
75 | break;
76 | default:
77 | throw new Error("Unsupported anchor position");
78 | }
79 | return {x: Math.round(x), y: Math.round(y)};
80 | }
81 | });
82 | })(this, this.TK);
83 |
--------------------------------------------------------------------------------
/doc/tutorials/Fader.md:
--------------------------------------------------------------------------------
1 | function run_fader(root) {
2 | function delay (v) {
3 | var t = this;
4 | setTimeout( function () {
5 | if (parseInt(t.options.id) > 1)
6 | t.set("pointer", v);
7 | else
8 | t.set("bar", v);
9 | }, 200);
10 | }
11 | faders = [];
12 | var options = {
13 | id: "0",
14 | min: -580,
15 | max: 60,
16 | value: 0,
17 | labels: TK.FORMAT("%d", "%/4"),
18 | format: TK.FORMAT("%.2fdB", "%/4"),
19 | "value.set": function (v) { return parseFloat(v)*4; },
20 | tooltip: false,
21 | step: 1,
22 | base: 0,
23 | gap_dots: 5,
24 | gap_labels: 20,
25 | log_factor: 2,
26 | division: 1,
27 | snap: 1,
28 | scale:"decibel",
29 | show_label: true,
30 | show_value: true,
31 | bar: 0,
32 | onset_value: function (v) { delay.call(this, v); },
33 | bind_click: true,
34 | }
35 | options.layout = "right";
36 | options.label = "Left";
37 | options.id = "0";
38 | options.fixed_dots = [60, 40, 20, 0, -20, -40, -60, -80, -120, -160, -200, -280, -580];
39 | options.fixed_labels = [60, 40, 20, 0, -20, -40, -60, -80, -120, -160, -200, -280, -580];
40 | faders.push(new TK.Fader(options));
41 |
42 | options.layout = "left";
43 | options.label = "Right";
44 | options.id = "1";
45 | faders.push(new TK.Fader(options));
46 |
47 | options.layout = "bottom";
48 | options.label = "Left";
49 | options.id = "2";
50 | options.fixed_dots = false;
51 | options.fixed_labels = false;
52 | options.gap_labels = 20;
53 | options.levels = [4, 20];
54 | options.bar = false;
55 | options.pointer = 0;
56 | faders.push(new TK.Fader(options));
57 |
58 | options.layout = "top";
59 | options.label = "Right";
60 | options.id = "3";
61 | faders.push(new TK.Fader(options));
62 |
63 | root.append_children(faders);
64 |
65 | fadertt = new TK.Toggle({
66 | label: "Tooltips",
67 | onToggled: function (state) {
68 | var t = state ? TK.FORMAT("%.2f dB", "%/4") : false;
69 | for (var i = 0; i < faders.length; i++) {
70 | faders[i].set("tooltip", t);
71 | }
72 | }
73 | });
74 | root.append_child(fadertt);
75 | }
76 |
77 | .toolkit-fader {
78 | vertical-align: top;
79 | float: left;
80 | margin: 8px;
81 | }
82 | .toolkit-fader:nth-child(2),
83 | .toolkit-fader:nth-child(3) {
84 | height: 400px;
85 | }
86 | .toolkit-fader:nth-child(4),
87 | .toolkit-fader:nth-child(5) {
88 | width: 400px;
89 | }
90 | .toolkit-fader .toolkit-input {
91 | font-size: 12px !important;
92 | }
93 |
94 |
95 |
--------------------------------------------------------------------------------
/toolkit/styles/plain/css/notification.css:
--------------------------------------------------------------------------------
1 | .toolkit-notification {
2 | margin: 4px;
3 | padding: 4px 8px;
4 | min-height: 32px;
5 |
6 | font-size: 1rem;
7 | text-align: left;
8 |
9 | -webkit-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.25);
10 | -moz-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.25);
11 | box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.25);
12 |
13 | -webkit-border-radius: 6px;
14 | -moz-border-radius: 6px;
15 | border-radius: 6px;
16 |
17 | display: block;
18 | }
19 |
20 | .toolkit-notification > .toolkit-button {
21 | background: transparent !important;
22 | border: none !important;
23 | position: absolute;
24 | top: 4px;
25 | right: 4px;
26 | width: 20px !important;
27 | height: 20px !important;
28 | margin: 0;
29 | padding: 0;
30 | box-shadow: none !important;
31 | }
32 | .toolkit-notification > .toolkit-button.toolkit-close .toolkit-icon {
33 | font-size: 20px !important;
34 | line-height: 20px !important;
35 | width: 20px !important;
36 | height: 20px !important;
37 | }
38 |
39 | .toolkit-notification > .toolkit-icon {
40 | position: absolute;
41 | font-size: 32px;
42 | line-height: 32px;
43 | top: 8px;
44 | left: 8px;
45 | }
46 |
47 | .toolkit-notification.toolkit-has-icon {
48 | padding-left: 56px;
49 | }
50 |
51 | .toolkit-notification.toolkit-has-close {
52 | padding-right: 48px;
53 | }
54 |
55 |
56 | .toolkit-notification {
57 | opacity: 0;
58 |
59 | -webkit-animation: -webkit-fade-in 0.5s;
60 | -moz-animation: -moz-fade-in 0.5s;
61 | -ms-animation: -ms-fade-in 0.5s;
62 | -o-animation: -o-fade-in 0.5s;
63 | animation: fade-in 0.5s;
64 |
65 | -webkit-transform: scale(1);
66 | -moz-transform: scale(1);
67 | -ms-transform: scale(1);
68 | -o-transform: scale(1);
69 | transform: scale(1);
70 | }
71 |
72 | .toolkit-notification.toolkit-show {
73 | opacity: 1;
74 | }
75 | .toolkit-notification.toolkit-hiding {
76 | opacity: 0;
77 |
78 | -webkit-transition: opacity 0.5s, transform 0.5s;
79 | -moz-transition: opacity 0.5s, transform 0.5s;
80 | -ms-transition: opacity 0.5s, transform 0.5s;
81 | -o-transition: opacity 0.5s, transform 0.5s;
82 | transition: opacity 0.5s, transform 0.5s;
83 |
84 | -webkit-transform: scale(0);
85 | -moz-transform: scale(0);
86 | -ms-transform: scale(0);
87 | -o-transform: scale(0);
88 | transform: scale(0);
89 | }
90 |
91 | @-webkit-keyframes -webit-fade-in {
92 | 0% { opacity: 0; -webit-transform: scale(1); }
93 | 100% { opacity: 1; -webit-transform: scale(1);}
94 | }
95 | @-moz-keyframes -moz-fade-in {
96 | 0% { opacity: 0; -moz-transform: scale(1); }
97 | 100% { opacity: 1; -moz-transform: scale(1);}
98 | }
99 | @-ms-keyframes -ms-fade-in {
100 | 0% { opacity: 0; -ms-transform: scale(1); }
101 | 100% { opacity: 1; -ms-transform: scale(1);}
102 | }
103 | @-o-keyframes -o-fade-in {
104 | 0% { opacity: 0; -o-transform: scale(1); }
105 | 100% { opacity: 1; -o-transform: scale(1);}
106 | }
107 | @keyframes fade-in {
108 | 0% { opacity: 0; transform: scale(1); }
109 | 100% { opacity: 1; transform: scale(1);}
110 | }
111 |
--------------------------------------------------------------------------------
/toolkit/implements/ranges.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 | "use strict";
20 | (function(w, TK){
21 | /**
22 | * Ranges provides multiple {@link TK.Range}s for a widget. They
23 | * can be used for building coordinate systems.
24 | *
25 | * @mixin TK.Ranges
26 | */
27 | function range_changed(value, name) {
28 | var range = this[name];
29 | for (var i in value) {
30 | range.set(i, value[i]);
31 | }
32 | }
33 | TK.Ranges = TK.class({
34 | _class: "Ranges",
35 | /**
36 | * Add a new {@link TK.Range}. If name is set and this.options[name]
37 | * exists, is an object and from is an object, too, both are merged
38 | * before a range is created.
39 | *
40 | * @method TK.Ranges#add_range
41 | *
42 | * @param {Function|Object} from - A function returning a {@link TK.Range}
43 | * instance or an object containing options for a new {@link TK.Range}.
44 | * @param {string} name - Designator of the {@link TK.Range}.
45 | * If a name is set a new set function is added to the item to
46 | * set the options of the {@link TK.Range}. Use the set function like this:
47 | * this.set("name", {key: value});
48 | *
49 | * @emits TK.Ranges#rangeadded
50 | *
51 | * @returns {TK.Range} The new {@link TK.Range}.
52 | */
53 | add_range: function (from, name) {
54 | var r;
55 | if (typeof from === "function") {
56 | r = from();
57 | } else if (TK.Ranged.prototype.isPrototypeOf(from)) {
58 | r = TK.Range(from.options);
59 | } else if (TK.Range.prototype.isPrototypeOf(from)) {
60 | r = from;
61 | } else {
62 | if (name
63 | && this.options[name]
64 | && typeof this.options[name] === "object")
65 | from = Object.assign({}, this.options[name], from)
66 | r = new TK.Range(from);
67 | }
68 | if (name) {
69 | this[name] = r;
70 | this.add_event("set_"+name, range_changed);
71 | }
72 | /**
73 | * Gets fired when a new range is added
74 | *
75 | * @event TK.Ranges#rangeadded
76 | *
77 | * @param {TK.Range} range - The {@link TK.Range} that was added.
78 | */
79 | this.fire_event("rangeadded", r);
80 | return r;
81 | }
82 | })
83 | })(this, this.TK);
84 |
--------------------------------------------------------------------------------
/toolkit/widgets/icon.js:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Toolkit.
3 | *
4 | * Toolkit is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or (at your option) any later version.
8 | *
9 | * Toolkit is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General
15 | * Public License along with this program; if not, write to the
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 | * Boston, MA 02110-1301 USA
18 | */
19 |
20 | "use strict";
21 | (function(w, TK){
22 |
23 | TK.Icon = TK.class({
24 | /**
25 | * TK.Icon represents a <DIV> element showing either
26 | * icons from the toolkit font or dedicated image files as CSS background.
27 | *
28 | * @class TK.Icon
29 | *
30 | * @extends TK.Widget
31 | *
32 | * @param {Object} [options={ }] - An object containing initial options.
33 | *
34 | * @property {String} [options.icon] - The icon to show. It can either be
35 | * a string which is interpreted as class name (if [A-Za-z0-9_\-]) or as URI.
36 | */
37 | _class: "Icon",
38 | Extends: TK.Widget,
39 | _options: Object.assign(Object.create(TK.Widget.prototype._options), {
40 | icon: "string",
41 | }),
42 | options: {
43 | icon: false,
44 | },
45 | initialize: function (options) {
46 | var E;
47 | TK.Widget.prototype.initialize.call(this, options);
48 | /**
49 | * @member {HTMLDivElement} TK.Icon#element - The main DIV element. Has class toolkit-icon
50 | */
51 | if (!(E = this.element)) this.element = E = TK.element("div");
52 | TK.add_class(E, "toolkit-icon");
53 | this.widgetize(E, true, true, true);
54 | this._icon_old = [];
55 | },
56 | redraw: function() {
57 | var O = this.options;
58 | var I = this.invalid;
59 | var E = this.element;
60 |
61 | TK.Widget.prototype.redraw.call(this);
62 |
63 | if (I.icon) {
64 | I.icon = false;
65 | var old = this._icon_old;
66 | for (var i = 0; i < old.length; i++) {
67 | if (old[i] && TK.is_class_name(old[i])) {
68 | TK.remove_class(E, old[i]);
69 | }
70 | }
71 | this._icon_old = [];
72 | if (TK.is_class_name(O.icon)) {
73 | E.style["background-image"] = null;
74 | if (O.icon)
75 | TK.add_class(E, O.icon);
76 | } else if (O.icon) {
77 | E.style["background-image"] = "url(\"" + O.icon + "\")";
78 | }
79 | }
80 | },
81 | set: function (key, val) {
82 | if (key == "icon") {
83 | this._icon_old.push(this.options.icon);
84 | }
85 | return TK.Widget.prototype.set.call(this, key, val);
86 | },
87 | });
88 | })(this, this.TK);
89 |
--------------------------------------------------------------------------------
/toolkit/styles/2013/css/notification.css:
--------------------------------------------------------------------------------
1 | .toolkit-notification {
2 | background: rgba(238, 238, 238, 0.9);
3 | border: 1px solid rgba(255, 255, 255, 0.9);
4 | margin: 4px;
5 | padding: 4px 8px;
6 | min-height: 32px;
7 |
8 | font-size: 1rem;
9 | text-align: left;
10 |
11 | -webkit-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.25);
12 | -moz-box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.25);
13 | box-shadow: 0px 2px 9px 0px rgba(0, 0, 0, 0.25);
14 |
15 | -webkit-border-radius: 6px;
16 | -moz-border-radius: 6px;
17 | border-radius: 6px;
18 |
19 | display: block;
20 | }
21 |
22 | .toolkit-notification > .toolkit-button {
23 | background: transparent !important;
24 | border: none !important;
25 | position: absolute;
26 | top: 4px;
27 | right: 4px;
28 | width: 20px !important;
29 | height: 20px !important;
30 | margin: 0;
31 | padding: 0;
32 | box-shadow: none !important;
33 | }
34 | .toolkit-notification > .toolkit-button.toolkit-close .toolkit-icon {
35 | font-size: 20px !important;
36 | line-height: 20px !important;
37 | width: 20px !important;
38 | height: 20px !important;
39 | }
40 |
41 | .toolkit-notification > .toolkit-icon {
42 | position: absolute;
43 | font-size: 32px;
44 | line-height: 32px;
45 | color: #002A42;
46 | top: 8px;
47 | left: 8px;
48 | }
49 |
50 | .toolkit-notification.toolkit-has-icon {
51 | padding-left: 56px;
52 | }
53 |
54 | .toolkit-notification.toolkit-has-close {
55 | padding-right: 48px;
56 | }
57 |
58 |
59 | .toolkit-notification {
60 | opacity: 0;
61 |
62 | -webkit-animation: -webkit-fade-in 0.5s;
63 | -moz-animation: -moz-fade-in 0.5s;
64 | -ms-animation: -ms-fade-in 0.5s;
65 | -o-animation: -o-fade-in 0.5s;
66 | animation: fade-in 0.5s;
67 |
68 | -webkit-transform: scale(1);
69 | -moz-transform: scale(1);
70 | -ms-transform: scale(1);
71 | -o-transform: scale(1);
72 | transform: scale(1);
73 | }
74 |
75 | .toolkit-notification.toolkit-show {
76 | opacity: 1;
77 | }
78 | .toolkit-notification.toolkit-hiding {
79 | opacity: 0;
80 |
81 | -webkit-transition: opacity 0.5s, transform 0.5s;
82 | -moz-transition: opacity 0.5s, transform 0.5s;
83 | -ms-transition: opacity 0.5s, transform 0.5s;
84 | -o-transition: opacity 0.5s, transform 0.5s;
85 | transition: opacity 0.5s, transform 0.5s;
86 |
87 | -webkit-transform: scale(0);
88 | -moz-transform: scale(0);
89 | -ms-transform: scale(0);
90 | -o-transform: scale(0);
91 | transform: scale(0);
92 | }
93 |
94 | @-webkit-keyframes -webit-fade-in {
95 | 0% { opacity: 0; -webit-transform: scale(1); }
96 | 100% { opacity: 1; -webit-transform: scale(1);}
97 | }
98 | @-moz-keyframes -moz-fade-in {
99 | 0% { opacity: 0; -moz-transform: scale(1); }
100 | 100% { opacity: 1; -moz-transform: scale(1);}
101 | }
102 | @-ms-keyframes -ms-fade-in {
103 | 0% { opacity: 0; -ms-transform: scale(1); }
104 | 100% { opacity: 1; -ms-transform: scale(1);}
105 | }
106 | @-o-keyframes -o-fade-in {
107 | 0% { opacity: 0; -o-transform: scale(1); }
108 | 100% { opacity: 1; -o-transform: scale(1);}
109 | }
110 | @keyframes fade-in {
111 | 0% { opacity: 0; transform: scale(1); }
112 | 100% { opacity: 1; transform: scale(1);}
113 | }
114 |
--------------------------------------------------------------------------------