Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"
});
elm.realise(elm.Window({
title: "Panes Demo",
width: 320,
height: 480,
align: FILL_BOTH,
elements: {
background: elm.Background({
weight: EXPAND_BOTH,
align: FILL_BOTH,
resize: true,
}),
pane_1: elm.Pane({
weight: EXPAND_BOTH,
resize: true,
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 }
})
}
})
}
}));
function sprite(n, type) {
return elm.Image({
width: 64,
height: 64,
file: elm.datadir + 'data/images/bubble_' + type + '.png',
on_animate: function(arg) {
animator(arg, n, type == 'sh');
}
});
}
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({
title: "Check box demo",
elements: {
the_background: elm.Background({
weight: EXPAND_BOTH,
resize: true
}),
the_box: elm.Box({
elm = require('elm');
elm.datadir += "/data/images/";
var count = 0;
var green = elm.Photo({
size: 80,
weight: EXPAND_BOTH,
align: FILL_BOTH,
image: elm.datadir + "green.png",
fill: true
});
var yellow = elm.Photo({
size: 80,
weight: EXPAND_BOTH,
align: FILL_BOTH,
image: elm.datadir + "yellow.png",
fill: true
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;
}
};
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,
#!/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,
}),
segment: elm.Segment({
align: FILL_BOTH,
elements: {
background: elm.Background({
weight: EXPAND_BOTH,
align: FILL_BOTH,
resize: true,
}),
box: elm.Box({
weight: EXPAND_BOTH,
align: FILL_BOTH,
resize: true,
elements: {
photocam: elm.Photocam({
weight: EXPAND_BOTH,
align: FILL_BOTH,
file: elm.datadir + "data/images/sky_01.jpg",
zoom_mode: "auto-fill",
zoom: 5.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,
resize: true