This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)">×</a></div>'); | |
// Use the pickAndStore api from FilePicker with a callback to uploaded_media | |
$('.upload-media').click(function() { | |
filepicker.pickAndStore({ | |
multiple: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
express.application.test = 123; | |
console.log(app.test); | |
// undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meh = {} | |
meh.key func1 func2 x, -> | |
p 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JS: | |
{ key: func1(func2(x, function() {...})) } | |
CS: | |
key: func1 func2 x, -> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete: | |
withUser | |
withModel Project, -> | |
p 'yo' |