Get rid of coffeescript.

This commit is contained in:
wvengen 2016-04-25 20:25:49 +02:00
parent 483c2aba29
commit 2e2efec5e7
5 changed files with 6 additions and 75 deletions

View file

@ -5,7 +5,6 @@ gem "rails", '~> 4.2'
gem 'sass-rails' gem 'sass-rails'
gem 'coffee-rails'
gem 'less-rails' gem 'less-rails'
gem 'uglifier', '>= 1.0.3' gem 'uglifier', '>= 1.0.3'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes # See https://github.com/sstephenson/execjs#readme for more supported runtimes

View file

@ -477,7 +477,6 @@ DEPENDENCIES
capistrano-rails capistrano-rails
capistrano-rvm capistrano-rvm
capybara capybara
coffee-rails
connection_pool connection_pool
coveralls coveralls
daemons daemons

View file

@ -1,3 +1,4 @@
jQuery -> $(function() {
$("a[rel~=popover], .has-popover").popover() $("a[rel~=popover], .has-popover").popover()
$("a[rel~=tooltip], .has-tooltip").tooltip() $("a[rel~=tooltip], .has-tooltip").tooltip()
});

View file

@ -0,0 +1,4 @@
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){},{}],2:[function(a,b,c){/*!
Copyright (c) 2013 Derek Petersen https://github.com/tuxracer/touchclick MIT License
*/
var d,e,f,g,h,i,j,k,l,m,n,o,p;d="function"==typeof jQuery?jQuery:a("jquery"),e="touchactive",l=!1,k=10,j=0,m={x:null,y:null},g=function(a){var b,c,d;return b=null!=(c=a.originalEvent)&&null!=(d=c.touches)?d[0]:void 0,b?{x:b.pageX,y:b.pageY}:void 0},i=function(a){var b,c;return b=Math.round((new Date).getTime()/1e3),c=b-j,a.type.match("touchstart|touchmove|touchend")&&(j=b),3>c&&a.type.match("mouse")},h=function(a){var b,c;return b=d(a),c=b.closest('*[data-touchclick="true"]'),c.length?c:b},p=function(a){return m=g(a),i(a)?void 0:h(a.target).addClass(e)},o=function(a){var b;return b=g(a),!b||Math.abs(b.x-m.x)>k||Math.abs(b.y-m.y)>k?h(a.target).removeClass(e):void 0},n=function(a){var b;return b=h(a.target),b.hasClass(e)&&!i(a)?(a.type="touchclick",b.trigger(a).removeClass(e)):void 0},f=function(a){var b;return b=d(this),l&&b[a]("click",function(a){return a.preventDefault()}),window.navigator.pointerEnabled?(b[a]("pointerdown",p),b[a]("pointerup",n)):(b[a]("touchstart mousedown",p),b[a]("touchmove mouseout",o),b[a]("touchend mouseup",n))},d.event.special.touchclick={setup:function(){return f.call(this,"on")},teardown:function(){return f.call(this,"off")}}},{jquery:1}]},{},[2]);

View file

@ -1,72 +0,0 @@
###!
Copyright (c) 2013 Derek Petersen https://github.com/tuxracer/touchclick MIT License
https://github.com/tuxracer/touchclick/raw/3.1.0/src/touchclick.coffee
###
$ = if typeof jQuery is 'function' then jQuery else require 'jquery'
activeClass = 'touchactive'
preventDefaultClick = false
# Store a timestamp of when the last touch event occurred
lastTouched = 0
# Support devices with both touch and mouse (e.g. Windows 8, Chromebook Pixel)
ignoreEvent = (e) ->
currentTimestamp = Math.round (new Date()).getTime() / 1000
secondsSinceTouch = currentTimestamp - lastTouched
if e.type.match 'touchstart|touchmove|touchend'
lastTouched = currentTimestamp
secondsSinceTouch < 3 and e.type.match 'mouse'
getTouchclickEl = (target) ->
$targetEl = $ target
# For delegated events you can optionally provide an element
# that will have the active style added when touch is active
# by adding data-touchclick="true"
$touchclickEl = $targetEl.closest '*[data-touchclick="true"]'
if $touchclickEl.length
$touchclickEl
else
$targetEl
touchstart = (e) ->
getTouchclickEl(e.target).addClass(activeClass) unless ignoreEvent e
touchmove = (e) ->
getTouchclickEl(e.target).removeClass(activeClass)
touchend = (e) ->
$touchclickEl = getTouchclickEl e.target
if $touchclickEl.hasClass(activeClass) and not ignoreEvent e
e.type = 'touchclick'
$touchclickEl
.trigger(e)
.removeClass(activeClass)
events = (type) ->
$el = $ this
if preventDefaultClick
$el[type] 'click', (e) ->
e.preventDefault()
if window.navigator.pointerEnabled
$el[type] 'pointerdown', touchstart
$el[type] 'pointerup', touchend
else
$el[type] 'touchstart mousedown', touchstart
$el[type] 'touchmove mouseout', touchmove
$el[type] 'touchend mouseup', touchend
$.event.special.touchclick =
setup: ->
events.call this, 'on'
teardown: ->
events.call this, 'off'