Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
task "full", ->
exec "coffee -cb lib/icui.coffee", (e) ->
console.log e if e
exec "uglifyjs lib/strftime.js lib/icui.js -o js/jquery.icui.min.js -c -m", (e) ->
exec "uglifyjs lib/icui.js -o js/jquery.icui.min.js -c -m", (e) ->
console.log e if e
exec "rm lib/icui.js"
exec "git checkout gh-pages", (e) ->
Expand All @@ -21,15 +21,15 @@ task "full", ->
build = (cb) ->
exec "coffee -cb lib/icui.coffee", (e) ->
console.log e if e
exec "uglifyjs2 lib/strftime.js lib/icui.js -o js/jquery.icui.min.js -c -m", (e) ->
exec "uglifyjs2 lib/icui.js -o js/jquery.icui.min.js -c -m", (e) ->
console.log e if e
exec "rm lib/icui.js", (e) ->
cb() if cb

task 'build', ->
exec "coffee -cb lib/icui.coffee", (e) ->
console.log e if e
exec "uglifyjs2 lib/strftime.js lib/icui.js -o js/jquery.icui.min.js -c -m", (e) ->
exec "uglifyjs2 lib/icui.js -o js/jquery.icui.min.js -c -m", (e) ->
console.log e if e
exec "rm lib/icui.js"

Expand All @@ -48,6 +48,7 @@ task 'develop', ->
<head>
<title>ICUI Test</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://momentjs.com/downloads/moment.min.js"></script>
<script src="icui.js?nocache=#{Math.random()}"></script>
<link rel="stylesheet" href="app.css" />
</head>
Expand All @@ -60,7 +61,7 @@ task 'develop', ->

<h1>Editing</h1>
<form>
<input type="hidden" class="icuiinp" value='{"start_date":"2013-06-23T17:30:00.000Z","rrules":[{"rule_type":"IceCube::WeeklyRule", "count": 3, "interval":1,"validations":{"offset_from_pascha": [-3]}}]}' />
<input type="hidden" class="icuiinp" value='{"start_time":"2013-06-23T17:30:00.000Z","rrules":[{"rule_type":"IceCube::WeeklyRule", "count": 3, "interval":1,"validations":{"offset_from_pascha": [-3]}}]}' />
<input type="submit"/>
</form>
<h1>Make new</h1>
Expand All @@ -86,14 +87,9 @@ task 'develop', ->
response.write("""$(function() {document.write("<h1>Compile Error</h1><pre>#{("" + e).replace(/\n/g, "\\n")}</pre>");});""", 'UTF-8')
response.end()
else
exec "cat lib/icui.js > js/icui.js && cat lib/strftime.js >> js/icui.js", (e) ->
if e
response.write("""document.body.write('<h1>Compile Error</h1><pre>#{e}</pre>)""", 'UTF-8')
response.end()
else
fs.readFile 'js/icui.js', "binary", (err, file) ->
response.write(file, "binary")
response.end()
fs.readFile 'lib/icui.js', "binary", (err, file) ->
response.write(file, "binary")
response.end()
else if extension == 'js' && !uri.match(/jasmine/)
comps = uri.split('.')
comps.pop()
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def json2yaml(str)
end
~~~

ICUI is dependent on jQuery and expects it to be already present. Typically ICUI will be used with a hidden form field which contains as it's value the JSON representation of the IceCube schedule. Then the jQuery method `icui` should be called to instantiate ICUI. The form field will be updated automatically with a new JSON representation on form submission.
ICUI is dependent on jQuery and Moment.JS and expects them to be already present.

Typically ICUI will be used with a hidden form field which contains as it's value the JSON representation of the IceCube schedule. Then the jQuery method `icui` should be called to instantiate ICUI. The form field will be updated automatically with a new JSON representation on form submission.

For usage with AJAX the `icui.getData()` method must be called to get a native representation of the data.

Expand All @@ -51,12 +53,8 @@ Gotcha's

ICUI isn't tested on any IE, but should work, but might require a JSON shim.

ICUI currently extends the `Date` prototype with a `strftime` (written by Gianni Chiappetta) method, the plan is to drop this in the future.

Currently ICUI doesn't support the rules and validations that have higher resolution than 1 day, however it should be fairly trivial to add these and in fact this is on the development roadmap.

ICUI currently deals with all times as if they are UTC times.

Development and Extension
-------------------------

Expand Down
Loading