app/assets/javascripts/joosy/preloaders/inline.js.coffee in joosy-0.1.0.RC2 vs app/assets/javascripts/joosy/preloaders/inline.js.coffee in joosy-0.1.0.RC3
- old
+ new
@@ -1,20 +1,20 @@
#
-# Preloader for libraries using <script src> without any caching magic
+# Preloader for libraries using `script src` without any caching magic
#
-# Example:
+# @example Basic usage
# libraries = [['/test1.js'], ['/test2.js']]
+#
# InlinePreloader.load libraries,
# start: -> console.log 'preloading started'
# complete: -> console.log 'preloading finished'
#
-# @class InlinePreloader
+# @module
#
-@Preloader = @InlinePreloader =
-
+@InlinePreloader =
#
- # Loads set of libraries by adding <script src> to DOM head
+ # Loads set of libraries by adding `script src` to DOM head
# See class description for example of usage
#
# @param [Array] 2-levels array of libraries URLs i.e. [['/test1.js'],['/test2.js']]
# @param [Hash] Available options:
# * start: `() -> null` to call before load starts:
@@ -28,11 +28,11 @@
@receive libraries.shift()[0], => @load(libraries)
else
@complete?()
#
- # Loads one script by adding <script src> to DOM head
+ # Loads one script by adding `script src` to DOM head
#
# @param [String] url to load script from
# @param [Function] `() -> null` to call after script was loaded and executed
#
receive: (url, callback) ->
@@ -50,5 +50,7 @@
script.onload = script.onreadystatechange = proceed
head.appendChild script
return undefined
+
+@Preloader = @InlinePreloader
\ No newline at end of file