Skip to content

Instantly share code, notes, and snippets.

Created March 21, 2013 09:50
Show Gist options
  • Select an option

  • Save anonymous/5211883 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/5211883 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Mar 21, 2013.
    37 changes: 37 additions & 0 deletions index.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@

    # Your awesome Koding App Code

    {nickname} = KD.whoami().profile

    class MainView extends JView
    constructor:->
    super
    @header = new KDHeaderView
    type: "big"
    title: "Welcome to Kodepad!"

    @name = new KDInputView
    placeholder: "Your name"

    @button = new KDButtonView
    title: "Say mmmm...hello!"
    callback: =>
    name = @name.getValue() or nickname
    @_notify?.destroy()
    @_notify = new KDNotificationView
    title: "Hello, #{name}!"

    pistachio:->
    """
    {{> @header}}
    Just change something from the left pane.
    <br><br>
    <strong>And try some interactions!:</strong>
    {{> @name}}
    {{> @button}}
    """
    viewAppended: ->
    @setTemplate do @pistachio

    appView.addSubView new MainView
    cssClass: "my-koding-app"
    16 changes: 16 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@

    /* Your awesome Koding App CSS Code */

    .my-koding-app {
    margin: 10px;
    padding: 0 10px 10px;
    width: auto;
    height: auto;
    background-color: rgba(255,255,255,0.9);
    border-radius: 3px;
    }

    .my-koding-app input {
    margin: 20px 0;
    background-color: #ccc !important;
    }