This commit is contained in:
2015-01-04 11:10:38 +01:00
parent 514bb748e6
commit 5a69e85908
6 changed files with 1 additions and 74 deletions
-17
View File
@@ -1,17 +0,0 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
// require jquery-ui
//= require_directory .
//= require_self
@@ -1,12 +0,0 @@
jQuery ->
$("a[rel=popover]").popover()
$(".tooltip").tooltip()
$("a[rel=tooltip]").tooltip()
$('input.currency').each(->
obj = $(this)
original_width = obj.width()
obj.wrap("<div class='input-prepend'>")
currency_sign = $("<span class='add-on'>&euro;</span>")
obj.before(currency_sign)
obj.css('width', (original_width - currency_sign.outerWidth())+'px')
)
-44
View File
@@ -1,44 +0,0 @@
window.Qwaiter=
alert: (msg) ->
$('.modal').modal('hide')
template = @mustache('#alert-template', {title: 'Alert', message: msg, close: 'OK'})
$(template).modal()
false
confirm: (options) ->
options ||= {}
content = options.content || 'Are you sure?'
title = options.title || 'Confirm'
wrapper = $('<div class="modal"></div>')
if typeof(options.ok) == 'function'
callback_wrapper = ->
wrapper.modal('hide')
options.ok()
callback_cancel_wrapper = ->
wrapper.modal('hide')
options.cancel() if options.cancel
header = $('<div class="modal-header"></div>')
.append('<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>')
.append('<h3>'+title+'</h3>').appendTo(wrapper)
body = $('<div class="modal-body"></div>').append('<p>'+content+'</p>').appendTo(wrapper)
ok_button = $('<a href="#" class="btn btn-primary confirm-ok">Yes</a>')
if typeof(options.ok) == 'function'
ok_button.click(callback_wrapper)
else
ok_button.click ->
eval(options.ok)
wrapper.modal('hide')
footer = $('<div class="modal-footer"></div>')
.append($('<a href="#" class="btn confirm-cancel">Close</a>').click(callback_cancel_wrapper))
.append(ok_button)
.appendTo(wrapper)
wrapper.modal()
currency: (num) ->
num = 0.0 if isNaN(num) || num == '' || num == null
'&euro;&nbsp;' + parseFloat(num).toFixed(2)
mustache: (selector, locals)->
locs = $.extend(locals,
currency: ->
(val)->
currency(Mustache.render(val, this))
)
Mustache.to_html($(selector).html(), locs)
@@ -1,6 +1,6 @@
#= require jquery #= require jquery
#= require jquery_ujs #= require jquery_ujs
#= require ./app/application #= require ./app/manifest
#= require foundation #= require foundation
#= require moment #= require moment
#= require jquery-ui/datepicker #= require jquery-ui/datepicker