Skip to content

Instantly share code, notes, and snippets.

View phzbox's full-sized avatar

Dominic Savoie phzbox

View GitHub Profile
@phzbox
phzbox / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
// The JSON is provided by the server-side. It's a json string stored in the db.
var init_slides = JSON.parse('[{"url":"..."}]');
// When the form is submited, we're serializing the files and storing them in a hidden input field.
$('.submit-form').submit(function() {
$("#slides").val(JSON.stringify(uploaded_media_fpfiles));
});
// When the page is loaded for the first time, we're faking a file update using the fpfiles already saved.
uploaded_media(init_slides);
// List of fp-files
var uploaded_media_fpfiles = [];
// Template to show the file (<Filename> [x]).
var media_file_html = _.template('<div>File: <a class="file" href="<%= url %>" target="_blank"><%= filename %>!</a> <a class="remove" href="javascript:void(0)">&times;</a></div>');
// Use the pickAndStore api from FilePicker with a callback to uploaded_media
$('.upload-media').click(function() {
filepicker.pickAndStore({
multiple: true
var express = require('express');
var app = express();
express.application.test = 123;
console.log(app.test);
// undefined
meh = {}
meh.key func1 func2 x, ->
p 'test'
JS:
{ key: func1(func2(x, function() {...})) }
CS:
key: func1 func2 x, ->
delete:
withUser
withModel Project, ->
p 'yo'