iShafayet / legacy-copolymer

A declarative language that transpiles to HTML5 and CoffeeScript. Purpose made to work with Google's Polymer 0.x.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copolymer

A declarative language that transpiles to HTML5 and CoffeeScript. Purpose made to work with Google's Polymer 0.x. However, the Polymer project has shifted direction a lot from the original and so, this project is no longer active.

Quick example

import "../polymer/polymer.html"
import "../polymer/paper-checkbox"
import "../polymer/paper-button"
import "../polymer/paper-input"

define todo-app todoList="[]"

  h1 | Todo App
  
  div$todoList vertical layout
    for todo, index in todoList
      div.todoEntry horizontal layout
        paper-checkbox checked="{{todo.isDone}}"
        div | {{todo.text}}
        paper-button %index="{{index}}" *click="deleteClicked" label="Delete"
        
  div horizontal layout
    paper-input label="Type new entry here" value="{{newEntryText}}"
    paper-button *click="addClicked" label="Add"
    
script type="text/coffeescript" `
  Copolymer todo-app, {
    deleteClicked: (e)->
      @todoList.splice (parseInt (e.target.getAttribute 'data-index'), 10), 1
      
    addClicked: (e)->
      @todoList.push {isDone: false, text: @newEntryText}
  }
`

Notes

It was written on the now almost-retired language CoffeeScript. You will need the CoffeeScript compiler to run the code.

About

A declarative language that transpiles to HTML5 and CoffeeScript. Purpose made to work with Google's Polymer 0.x.

License:MIT License


Languages

Language:CoffeeScript 100.0%