Permalink
Browse files

added documentation stubs

  • Loading branch information...
collin committed May 8, 2012
1 parent f7ce1ec commit 271d37adf1cd655e48b8eb0e9619a4711e282a73
Showing with 1,134 additions and 117 deletions.
  1. +1 −14 Assetfile
  2. +3 −3 Rakefile
  3. +1 −1 src/alpha_simprini.coffee
  4. +37 −3 src/alpha_simprini/client/application.coffee
  5. +42 −0 src/alpha_simprini/client/binding.coffee
  6. +28 −0 src/alpha_simprini/client/binding/check_box.coffee
  7. +21 −0 src/alpha_simprini/client/binding/container.coffee
  8. +74 −4 src/alpha_simprini/client/binding/edit_line.coffee
  9. +29 −1 src/alpha_simprini/client/binding/field.coffee
  10. +28 −0 src/alpha_simprini/client/binding/file.coffee
  11. +42 −0 src/alpha_simprini/client/binding/input.coffee
  12. +70 −1 src/alpha_simprini/client/binding/many.coffee
  13. +28 −2 src/alpha_simprini/client/binding/model.coffee
  14. +14 −0 src/alpha_simprini/client/binding/one.coffee
  15. +21 −9 src/alpha_simprini/client/binding/select.coffee
  16. +48 −1 src/alpha_simprini/client/binding_group.coffee
  17. +49 −0 src/alpha_simprini/client/dom.coffee
  18. +145 −23 src/alpha_simprini/client/models/targets.coffee
  19. +166 −21 src/alpha_simprini/client/view.coffee
  20. +56 −0 src/alpha_simprini/client/view_events.coffee
  21. +49 −0 src/alpha_simprini/client/view_model.coffee
  22. +0 −1 src/alpha_simprini/client/views/canvas.coffee
  23. +99 −12 src/alpha_simprini/client/views/dialog.coffee
  24. +36 −0 src/alpha_simprini/client/views/region.coffee
  25. +8 −1 src/alpha_simprini/client/views/stage.coffee
  26. +7 −0 src/alpha_simprini/core/callbacks.coffee
  27. +5 −2 src/alpha_simprini/core/model.coffee
  28. +2 −1 src/alpha_simprini/core/model/rest.coffee
  29. +1 −1 src/alpha_simprini/core/models/file.coffee
  30. +9 −1 test/client/binding/check_box.coffee
  31. +15 −15 test/client/models/targets.coffee
View
@@ -4,7 +4,7 @@ require "json"
output "dist"
input "lib" do
- match "/**/*.js" do
+ match "**/*.js" do
minispade rewrite_requires: true, string: true, module_id_generator: proc { |input|
id = input.path.dup
id.sub!('/lib/', '/')
@@ -17,22 +17,9 @@ input "lib" do
end
end
-# TODO: include a raw distribution
-# input "lib", "**/*.js" do
-# neuter { "alpha_simprini.js" }
-# end
-
input "./", "alpha_simprini.erb" do
require "./version"
filter(Rake::Pipeline::Web::Filters::TiltFilter, {}, Object) do |input|
"alpha_simprini.html"
end
end
-
-
-# output "dist/test"
-# input "tmp/test" do
-# match "**/*.js" do
-# neuter
-# end
-# end
View
@@ -55,11 +55,11 @@ task :upload => :test do
uploader = GithubUploader.setup_uploader
# TODO: release a raw distribution
# GithubUploader.upload_file uploader, "Alpha Simprini-#{AS_VERSION}.js", "Alpha Simprini #{AS_VERSION}", "dist/alpha_simprini.js"
- GithubUploader.upload_file uploader, "Alpha Simprini-#{AS_VERSION}-spade.js", "Alpha Simprini #{AS_VERSION} (minispade)", "dist/alpha_simprini-spade.js"
- GithubUploader.upload_file uploader, "Alpha Simprini-#{AS_VERSION}.html", "Alpha Simprini #{AS_VERSION} (html_package)", "dist/alpha_simprini.html"
+ GithubUploader.upload_file uploader, "alpha_simprini-#{AS_VERSION}-spade.js", "Alpha Simprini #{AS_VERSION} (minispade)", "dist/alpha_simprini-spade.js"
+ GithubUploader.upload_file uploader, "alpha_simprini-#{AS_VERSION}.html", "Alpha Simprini #{AS_VERSION} (html_package)", "dist/alpha_simprini.html"
# GithubUploader.upload_file uploader, 'Alpha Simprini-latest.js', "Current Alpha Simprini", "dist/alpha_simprini.js"
- GithubUploader.upload_file uploader, 'Alpha Simprini-latest-spade.js', "Current Alpha Simprini (minispade)", "dist/alpha_simprini-spade.js"
+ GithubUploader.upload_file uploader, 'alpha_simprini-latest-spade.js', "Current Alpha Simprini (minispade)", "dist/alpha_simprini-spade.js"
end
desc "Create json document object"
@@ -28,7 +28,7 @@ AS.Property = Taxi.Property
AS.COLLECTION_DELEGATES = ["first", "rest", "last", "compact", "flatten", "without", "union", "filter", "reverse",
"intersection", "difference", "uniq", "zip", "indexOf", "find", "detect", "sortBy",
- "lastIndexOf", "range", "include", "each", "map", "reject","all", "toArray", "pluck"]
+ "lastIndexOf", "range", "include", "each", "map", "reject","all", "toArray", "pluck", "invoke"]
AS.require = (framework="alpha_simprini", libraries) ->
if libraries is undefined
@@ -9,14 +9,28 @@ AS.Application = AS.Object.extend ({def, include}) ->
_.extend(this, config)
@params = AS.params
@el ?= $("body")
- @god_given_key_handlers()
+ @godGivenKeyHandlers()
domready =>
@boot()
+ # @::initialize.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def boot: ->
+ # @::boot.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
- def god_given_key_handlers: ->
+ def godGivenKeyHandlers: ->
handlers =
'': 'escape'
'⌘+↩': 'accept'
@@ -39,13 +53,33 @@ AS.Application = AS.Object.extend ({def, include}) ->
jwerty.key key, ( (event) => @trigger(trigger, event) ), @el
jwerty.key "backspace", (event) =>
- event.preventDefault()
@trigger("delete", event)
+ # @::godGivenKeyHandlers.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def view: (constructor, options={}) ->
options.application = this
constructor.new options
+ # @::view.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def append: (view) ->
@el.append view.el
+ # @::append.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
@@ -16,23 +16,65 @@ AS.Binding = AS.Object.extend ({def}) ->
@bindingGroup = bindingGroup
@setup()
+ # @::initialize.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def makeContent: ->
@context.$ []
+ # @::makeContent.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def willGroupBindings: ->
@constructor.willGroupBindings or _.isFunction(@fn)
+ # @::willGroupBindings.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def fieldValue: ->
if _.isArray(@field)
@model.readPath(@field)
else
@field.get()
+ # @::fieldValue.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def require_option: (name) ->
return unless @options[name] is undefined
throw new AS.Binding.MissingOption("You must specify the #{name} option for #{@constructor.name} bindings.")
+ # @::requireOption.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def setup: ->
+ # @::setup.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
class AS.Binding.MissingOption extends Error
@@ -2,15 +2,43 @@ AS.Binding.CheckBox = AS.Binding.Input.extend ({def}) ->
def initialize: (context, model, field, options={}, fn=undefined) ->
options.type = "checkbox"
@_super.apply(this, arguments)
+ # @::initialize.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def setContent: ->
@content.attr "checked", @fieldValue()
+ # @::setContent.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def bindContent: ->
@context.binds @content, "change", _.bind(@setField, this)
+ # @::bindContext.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def setField: ->
if @content.is ":checked"
@field.set true
else
@field.set false
+ # @::setField.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
@@ -4,6 +4,13 @@ AS.Binding.Container = AS.Object.extend ({delegate, include, def, defs}) ->
def initialize: (@domElement) ->
@el = jQuery(@domElement)
@containerChildren = []
+ # @::initialize.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def appendChild: (child) ->
if child instanceof jQuery
@@ -12,7 +19,21 @@ AS.Binding.Container = AS.Object.extend ({delegate, include, def, defs}) ->
else
@containerChildren.push child
@domElement.appendChild(child)
+ # @::appendChild.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
def empty: ->
jQuery(@containerChildren).remove()
@containerChildren = []
+ # @::empty.doc =
+ # params: [
+ # []
+ # ]
+ # desc: """
+ #
+ # """
Oops, something went wrong.

0 comments on commit 271d37a

Please sign in to comment.