This file contains hidden or 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
#!/usr/bin/env ruby | |
require "chunky_png" | |
#require "oily_png" | |
def screenshot(display = ":0") | |
mine_pipe, xwd_pipe = IO.pipe | |
png = nil | |
begin |
This file contains hidden or 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
# pages/application.js.coffee | |
class @ApplicationPage extends Joosy.Page | |
@beforePaint (container, complete) -> | |
#@layout.showSystemPreloader() if !@dataFetched | |
complete() | |
@paint (container, complete) -> | |
#@layout.hideSystemPreloader() | |
container.fadeTo 80, 0, => |
This file contains hidden or 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
bootstrap = -> | |
$('#preloader').remove() | |
Joosy.Application.initialize 'blog','#application', | |
environment: window.joosy.environment | |
debug: false |
This file contains hidden or 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
!= @formFor resource, {class: 'foo'}, (f) -> | |
!= f.label 'field', {class: 'foo'}, 'inner text' | |
!= f.radioButton 'field', 'value', {class: 'foo'} | |
!= f.textArea 'field', {class: 'foo'} | |
!= f.checkBox 'field', {class: 'foo'} | |
!= f.textField 'field', {class: 'foo'} | |
!= f.fileField 'field', {class: 'foo'} | |
!= f.hiddenField 'field', {class: 'foo'} | |
!= f.passwordField 'field', {class: 'foo'} |
This file contains hidden or 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
elements: | |
'titlePane': 'h1' | |
'titleForm': 'form' | |
events: | |
'click $titlePane': (element) -> | |
@titlePane.hide() | |
@titleForm.show() | |
@afterLoad -> |
This file contains hidden or 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
Joosy.Form.attach $('element'), | |
success: (data) -> | |
error: (data) -> | |
progress: (data) -> | |
action: 'URL' |
This file contains hidden or 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
# layouts/application.js.coffee | |
class @ApplicationLayout extends Joosy.Layout | |
@view 'application' | |
elements: | |
'navigationBar': '.navbar' | |
'clocks': '.navbar .pull-right a' | |
events: | |
'mouseenter $navigationBar': 'showClocks' |
This file contains hidden or 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
# pages/posts/index.js.coffee | |
Joosy.namespace 'Posts', -> | |
class @IndexPage extends ApplicationPage | |
@layout ApplicationLayout | |
@view 'index' | |
@fetch (complete) -> | |
Post.find 'all', (posts) => | |
@data.posts = posts |
This file contains hidden or 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
Post.find 2, (post) -> # Loads entity from /posts/2 | |
post('title') # Returns 'Test post' | |
post('title', 'New and better title!') # Sets new title value | |
post('title') # Returns 'New and better title!' | |
post.reload -> # Reloads fields from server | |
post('title') # Returns 'Test post' | |
post.delete -> console.log 'Deleted!' # Deletes fetched entity (DELETE /posts/2) |
This file contains hidden or 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
bundle install |
NewerOlder