Show More
Commit Description:
submission report
Commit Description:
submission report
File last commit:
Show/Diff file:
Action:
app/assets/javascripts/custom.js.coffee | 53 lines | 1.3 KiB | text/coffeescript | CoffeeScriptLexer |
## Bootstrapify...
r555 $(document).on 'change', '.btn-file :file', ->
input = $(this)
numFiles = if input.get(0).files then input.get(0).files.length else 1
label = input.val().replace(/\\/g, '/').replace(/.*\//, '')
input.trigger 'fileselect', [
numFiles
label
]
return
# document ready
use jquery by default
r554 $ ->
submission report
r790 $(".select2").select2({
})
wip: bootstrap toggle switch...
r556 #$(".bootstrap-switch").bootstrapSwitch()
- countdown timer
r572 #$(".bootstrap-toggle").bootstrapToggle()
## Bootstrapify...
r555 $('.btn-file :file').on 'fileselect', (event, numFiles, label) ->
input = $(this).parents('.input-group').find(':text')
log = if numFiles > 1 then numFiles + ' files selected' else label
if input.length
input.val log
else
if log
alert log
return
hall of fame bootrapized
r560 $(".go-button").on 'click', (event) ->
link = $(this).attr("data-source")
url = $(link).val()
if url
window.location.href = url
return
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
r562 $('.ajax-toggle').on 'click', (event) ->
target = $(event.target)
target.removeClass 'btn-default'
target.removeClass 'btn-success'
target.addClass 'btn-warning'
target.text '...'
return
- add problem toggle test js reponse (it was forgotten)...
r570
- countdown timer
r572
use ace editor for submission viewing
r566 #ace editor
- countdown timer
r572 if $("#editor").length > 0
e = ace.edit("editor")
e.setTheme('ace/theme/merbivore')
e.getSession().setTabSize(2)
e.getSession().setUseSoftTabs(true)
#best in place
jQuery(".best_in_place").best_in_place()
live editor using cloud9 ace for problem
r564
* DRY the toggle button via application_helper.rb#toggle_button and _toggle_button.js.haml...
r562 return