Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (label === 'Content') {
w.elements.popup.message({
content: elm.Button({
label: 'This text will be changed as soon as this button is realized',
icon: elm.Icon({ image: 'starred' })
})
});
} else if (label === 'Items') {
w.elements.popup.message({
items: [
{ text: 'Available', icon: elm.Icon({ image: 'user-available'}) },
{ text: 'Away', icon: elm.Icon({ image: 'user-away'}) },
{ text: 'Busy', icon: elm.Icon({ image: 'user-busy'}) },
{ text: 'Idle', icon: elm.Icon({ image: 'user-idle'}) },
{ text: 'Invisible', icon: elm.Icon({ image: 'user-invisible'}) },
{ text: 'Offline', icon: elm.Icon({ image: 'user-offline'}) },
'Only text',
{ text: 'Only text in an object' }
],
orientation: 'left'
});
}
},
on_dismiss: function() {
align: FILL_BOTH,
on_click: function() {
win.elements.box.elements['logo_' + count++] = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
})
}
}),
logo_top: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.0, y: 0.0 }
}),
logo_middle: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.0, y: 0.5 }
}),
logo_bottom: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.0, y: 1.0 }
})
}
})
}
}));
#!/usr/local/bin/elev8
elm = require('elm');
var EXPAND_BOTH = { x: 1.0, y: 1.0 };
var FILL_BOTH = { x: -1.0, y: -1.0 };
var logo_icon = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
});
var logo_icon_unscaled = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
});
var window = elm.Window({
label: "Segment Control demo",
elements: {
background: elm.Background({
weight: EXPAND_BOTH,
resize: true,
}),
align: FILL_BOTH,
on_click: function() {
win.elements.box.elements['logo_' + count++] = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
})
}
}),
logo_top: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.5, y: 0.5 }
}),
logo_middle: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.5, y: 0.0 }
}),
logo_bottom: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.0, y: 1.0 }
})
}
})
}
}));
var elm = require('elm');
var EXPAND_BOTH = { x: 1.0, y: 1.0 };
var FILL_BOTH = { x: -1.0, y: -1.0 };
var logo_icon = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
});
var logo_icon_unscaled = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
});
var w = elm.Window({
label: "Button demo",
width: 320,
height: 480,
elements: {
the_background: elm.Background({
weight: EXPAND_BOTH,
/*
* This is a reproduction of the elementary_test Slider example
*/
var elm = require('elm');
var EXPAND_BOTH = { x: 1.0, y: 1.0 };
var logo_icon = elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
});
var w = elm.Window({
title: "Slider",
width: 320,
height: 480,
elements: {
the_background: elm.Background({
resize: true,
weight: EXPAND_BOTH
}),
the_box: elm.Box({
weight: EXPAND_BOTH,
resize: true,
elements: {
*/
var EXPAND_BOTH = { x: 1.0, y: 1.0 };
var FILL_BOTH = { x: -1.0, y: -1.0 };
elm.datadir += "/data/images/";
var item_selected = null;
var bulk_size = 10000;
var item_count = 0;
var bubble = elm.Icon({
image: elm.datadir + "bubble.png",
size_hint_aspect: { a: 3, w: 1, h: 1 }
});
var logo = elm.Icon({
image: elm.datadir + "logo_small.png",
size_hint_aspect: { a: 3, w: 1, h : 1 }
});
var violet = elm.Icon({
prescale: 1,
image: elm.datadir + "violet.png"
});
function createItem(key, before) {
var list = win.elements.box.elements.list;
item_count++;
key = key || item_count;
list.elements[key] = {
key: key,
data: item_count,
elm = require('elm');
/*
* This is a reproduction of the elementary_test Genlist example
*/
var EXPAND_BOTH = { x: 1.0, y: 1.0 };
var FILL_BOTH = { x: -1.0, y: -1.0 };
elm.datadir += "/data/images/";
var item_selected = null;
var bulk_size = 10000;
var item_count = 0;
var bubble = elm.Icon({
image: elm.datadir + "bubble.png",
size_hint_aspect: { a: 3, w: 1, h: 1 }
});
var logo = elm.Icon({
image: elm.datadir + "logo_small.png",
size_hint_aspect: { a: 3, w: 1, h : 1 }
});
var violet = elm.Icon({
prescale: 1,
image: elm.datadir + "violet.png"
});
function createItem(key, before) {
var list = win.elements.box.elements.list;
})
}
}),
logo_top: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.5, y: 0.5 }
}),
logo_middle: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.5, y: 0.0 }
}),
logo_bottom: elm.Icon({
image: elm.datadir + "data/images/logo_small.png",
resizable_up: false,
resizable_down: false,
align: { x: 0.0, y: 1.0 }
})
}
})
}
}));
elm.datadir += "/data/images/";
var item_selected = null;
var bulk_size = 10000;
var item_count = 0;
var bubble = elm.Icon({
image: elm.datadir + "bubble.png",
size_hint_aspect: { a: 3, w: 1, h: 1 }
});
var logo = elm.Icon({
image: elm.datadir + "logo_small.png",
size_hint_aspect: { a: 3, w: 1, h : 1 }
});
var violet = elm.Icon({
prescale: 1,
image: elm.datadir + "violet.png"
});
function createItem(key, before) {
var list = win.elements.box.elements.list;
item_count++;
key = key || item_count;
list.elements[key] = {
key: key,
data: item_count,
before: before,
class: default_class,
on_select: function(item) {
print('Selected item with data: ' + item.data);
item_selected = item;