Skip to content

Commit

Permalink
stripped trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
collin committed Apr 25, 2012
1 parent 064fe79 commit 8015775
Show file tree
Hide file tree
Showing 41 changed files with 299 additions and 252 deletions.
2 changes: 1 addition & 1 deletion lib/alpha_simprini.coffee
Expand Up @@ -10,7 +10,7 @@ AS.unimplemented = (method) ->
return ->
throw new Error ["you MUST implement the method '#{method}' on: #{@toString()}"]

AS.part = (name) ->
AS.part = (name) ->
exports[name] = require: (libraries) -> AS.require name.toLowerCase(), libraries

# Namespaces
Expand Down
2 changes: 1 addition & 1 deletion lib/alpha_simprini/client.coffee
Expand Up @@ -7,7 +7,7 @@ Client.require """
binding
binding/container
binding/model binding/field binding/input binding/select binding/file
binding/check_box binding/edit_line binding/one binding/many
Expand Down
2 changes: 1 addition & 1 deletion lib/alpha_simprini/client/application.coffee
Expand Up @@ -41,7 +41,7 @@ AS.Application = AS.Object.extend ({def, include}) ->
each handlers, (trigger, key) =>
jwerty.key key, ( (event) => @trigger(trigger, event) ), @el

jwerty.key "backspace", (event) =>
jwerty.key "backspace", (event) =>
event.preventDefault()
@trigger("delete", event)

Expand Down
6 changes: 3 additions & 3 deletions lib/alpha_simprini/client/binding.coffee
Expand Up @@ -4,8 +4,8 @@ _ = require "underscore"
AS.Binding = AS.Object.extend ({def}) ->
def initialize: (@context, @model, @field, @options={}, @fn=undefined) ->
if _.isString(@field)
@field = @model[@field]
@field = @model[@field]

if _.isFunction(@options)
[@fn, @options] = [@options, {}]

Expand All @@ -26,7 +26,7 @@ AS.Binding = AS.Object.extend ({def}) ->
def willGroupBindings: ->
@constructor.willGroupBindings or _.isFunction(@fn)

def fieldValue: ->
def fieldValue: ->
if _.isArray(@field)
@model.readPath(@field)
else
Expand Down
4 changes: 2 additions & 2 deletions lib/alpha_simprini/client/binding/file.coffee
Expand Up @@ -8,7 +8,7 @@ AS.Binding.File = AS.Binding.Input.extend ({delegate, include, def, defs}) ->

def fieldValue: -> # FALSE. Cannot set value of a file input.
def setContent: -> # FALSE. Cannot set value of a file input.
def readField: ->
def readField: ->
AS.Models.File.new file: @content[0].files[0]


2 changes: 1 addition & 1 deletion lib/alpha_simprini/client/binding/one.coffee
Expand Up @@ -5,7 +5,7 @@ jQuery = require "jquery"
AS.Binding.One = AS.Binding.Field.extend ({delegate, include, def, defs}) ->
def makeContent: ->
AS.Binding.Container.new(@container[0])

def setContent: ->
@content.empty()
@bindingGroup.unbind()
Expand Down
2 changes: 1 addition & 1 deletion lib/alpha_simprini/client/binding_group.coffee
Expand Up @@ -25,7 +25,7 @@ AS.BindingGroup = AS.Object.extend ({def}) ->
else if _.isArray(event)
object.bindPath(event, _.bind(handler, context))
else
object.bind
object.bind
event: event
namespace: @namespace
handler: handler
Expand Down
6 changes: 3 additions & 3 deletions lib/alpha_simprini/client/view.coffee
Expand Up @@ -15,7 +15,7 @@ AS.View = AS.DOM.extend ({delegate, include, def, defs}) ->

def attrBindings: null

def _ensureElement: ->
def _ensureElement: ->
@el ?= @$(@buildElement())
baseAttributes = @baseAttributes()
baseAttributes["class"] = undefined if @el.attr("class")
Expand Down Expand Up @@ -73,7 +73,7 @@ AS.View = AS.DOM.extend ({delegate, include, def, defs}) ->

def binds: -> @bindingGroup.binds.apply(@bindingGroup, arguments)

def klassString: ->
def klassString: ->
classes = []
for ancestor in @constructor.ancestors
continue unless ancestor.path().match(/Views?/)
Expand Down Expand Up @@ -129,7 +129,7 @@ AS.View = AS.DOM.extend ({delegate, include, def, defs}) ->

def bindAttrs: ->
return unless @attrBindings
@modelBinding().attr @attrBindings
@modelBinding().attr @attrBindings

def delegateEvents: () ->
if @events
Expand Down
22 changes: 11 additions & 11 deletions lib/alpha_simprini/client/views/dialog.coffee
Expand Up @@ -5,51 +5,51 @@ knead = require "knead"
AS.Views.Dialog = AS.Views.Panel.extend ({delegate, include, def, defs}) ->
def initialize: ->
@constructor::events ?= {}
_.extend @constructor::events,
_.extend @constructor::events,
"click .accept": "trigger_commit"
"click .cancel": "trigger_cancel"
"esc @application": "trigger_cancel"
"accept @application": "trigger_commit"

"knead:dragstart header": "dragstart"
"knead:drag header": "drag"
"knead:dragend header": "dragend"

@_super.apply(this, arguments)

def content: ->
@head = @$ @header @header_content
@content = @$ @section @main_content
@foot = @$ @footer @footer_content
knead.monitor @head

def header_content: ->
def main_content: ->
def footer_content: ->
def footer_content: ->
@accept = @$ @button class:"accept", -> "Accept"
@cancel = @$ @a href:"#", class:"cancel", -> "cancel"

def open: ->
@el.css width: "", height: ""
@trigger "open"

def close: ->
@el.css width: 0, height: 0, overflow: "hidden"
@trigger "close"

def trigger_commit: ->
@trigger "commit"
@close()

def trigger_cancel: ->
@trigger "cancel"
@close()
def dragstart: (event) ->

def dragstart: (event) ->
@start = @el.position()
def drag: (event) ->
@el.css
top: event.deltaY + @start.top
left: event.deltaX + @start.left
def dragend: (event) ->
def dragend: (event) ->
delete @start
4 changes: 2 additions & 2 deletions lib/alpha_simprini/core.coffee
Expand Up @@ -4,12 +4,12 @@ _ = require "underscore"

Core.require """
logging
callbacks state_machine
instance_methods
model model/dendrite model/synapse model/store
properties/field properties/has_many properties/has_one
properties/field properties/has_many properties/has_one
properties/belongs_to properties/virtual_property
collection filtered_collection
Expand Down
6 changes: 3 additions & 3 deletions lib/alpha_simprini/core/callbacks.coffee
Expand Up @@ -9,13 +9,13 @@ AS.Callbacks = AS.Module.extend ({def, defs}) ->
do (callback) =>
@["#{key}#{upperCamelize callback}"] = (fn) ->
@pushInheritableItem("#{key}#{upperCamelize callback}_callbacks", fn)
# @::runCallbacks.doc =

# @::runCallbacks.doc =
# params: [
# ["name", String, true]
# ]
# desc: """
#
#
# """
def runCallbacks: (name) ->
for callback in @constructor["#{name}_callbacks"] || []
Expand Down
48 changes: 24 additions & 24 deletions lib/alpha_simprini/core/collection.coffee
Expand Up @@ -7,13 +7,13 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->
include Taxi.Mixin
delegate AS.COLLECTION_DELEGATES, to: "models"

# @::initialize.doc =
# @::initialize.doc =
# params: [
# ["@models", [AS.Model], false, default: []]
# ["options", Object, false, default: {}]
# ]
# desc: """
#
#
# """
def initialize: (@models=[], options = {}) ->
extend this, options
Expand All @@ -23,19 +23,19 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->
@models = _([]).chain()
@add(model) for model in @models

# @::model.doc =
# @::model.doc =
# desc: """
#
#
# """
def model: -> AS.Model

# @::add.doc =
# @::add.doc =
# params: [
# ["model", [AS.Model, String, Object], false, default: {}]
# ["options", Object, false, default: {}]
# ]
# desc: """
#
#
# """
def add: (model={}, options={}) ->
# Allow for passing both Model and ViewModels in
Expand All @@ -51,13 +51,13 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->

model

# @::build.doc =
# @::build.doc =
# private: true
# params: [
# ["model", [AS.Model, String, Object], true]
# ]
# desc: """
#
#
# """
def build: (model) ->
if isString(model) and constructor = @model?()
Expand All @@ -69,18 +69,18 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->
return AS.All.byId[model.id]
else
ctor = @model()

data = _.clone(model)
ctor.new(data)

# @::_add.doc =
# @::_add.doc =
# private: true
# params: [
# ["model", AS.Model, true]
# ["options", Object, false, default: {}]
# ]
# desc: """
#
#
# """
def _add: (model, options={}) ->
options.at ?= this.length
Expand All @@ -96,23 +96,23 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->

model.trigger "add", this, options

# @::at.doc =
# @::at.doc =
# params: [
# ["index", Number, true]
# ]
# desc: """
#
#
# """
def at: (index) ->
@models.value()[index]

# @::remove.doc =
# @::remove.doc =
# params: [
# ["model", AS.Model, true]
# ["options", Object, false, default: {}]
# ]
# desc: """
#
#
# """
def remove: (model, options={}) ->
# Allow for passing both Model and ViewModels in
Expand All @@ -123,14 +123,14 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->

result

# @::_remove.doc =
# @::_remove.doc =
# private: true
# params: [
# ["model", AS.Model, true]
# ["options", {}, false, default: {}]
# ]
# desc: """
#
#
# """
def _remove: (model, options={}) ->
options.at = @models.indexOf(model).value()
Expand All @@ -143,29 +143,29 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->
event: "all"
namespace: @objectId()

# @::filter.doc =
# @::filter.doc =
# params: [
# ["filterBy", {}, true]
# ]
# return: AS.FilteredCollection
# desc: """
#
#
# """
def filter: (filterBy) ->
AS.FilteredCollection.new(this, filterBy)

# @::groupBy.doc =
# @::groupBy.doc =
# params: [
# ["key", String, true]
# ["metaData", Object, false]
# ]
# desc: """
#
#
# """
def groupBy: (key, metaData) ->
AS.Models.Grouping.new(this, key, metaData)
# @::_onModelEvent.doc =

# @::_onModelEvent.doc =
# private: true
# params: [
# ["event", String, true]
Expand All @@ -174,7 +174,7 @@ AS.Collection = AS.Object.extend ({def, include, delegate}) ->
# ["options", Object, false]
# ]
# desc: """
#
#
# """
# # When an event is triggered from a model, it is bubbled up through the collection.
def _onModelEvent: (event, model, collection, options) ->
Expand Down

0 comments on commit 8015775

Please sign in to comment.