How to use the elm.datadir function in elm

To help you get started, we’ve selected a few elm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kakaroto / e17 / PROTO / elev8 / data / javascript / panes.js View on Github external
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,
github kakaroto / e17 / PROTO / elev8 / data / javascript / box_vert.js View on Github external
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 }
                })
            }
        })
    }
}));
github kakaroto / e17 / PROTO / elev8 / data / javascript / anim.js View on Github external
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');
        }
    });
}
github kakaroto / e17 / PROTO / elev8 / data / javascript / check.js View on Github external
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({
github kakaroto / e17 / PROTO / elev8 / data / javascript / naviframe.js View on Github external
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
github kakaroto / e17 / PROTO / elev8 / data / javascript / genlist.js View on Github external
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;
    }
  };
github kakaroto / e17 / PROTO / elev8 / data / javascript / genlist.js View on Github external
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,
github kakaroto / e17 / PROTO / elev8 / data / javascript / segment.js View on Github external
#!/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({
github kakaroto / e17 / PROTO / elev8 / data / javascript / photocam.js View on Github external
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
                    })
                }
            })
        }
}));
github kakaroto / e17 / PROTO / elev8 / data / javascript / button.js View on Github external
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