Skip to content

Commit

Permalink
Pay insane amount of tech-debt on the asset pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
abesto committed Dec 25, 2015
1 parent bda824b commit 1909092
Show file tree
Hide file tree
Showing 46 changed files with 10,731 additions and 1,558 deletions.
2 changes: 1 addition & 1 deletion assets/js/app/common/StateMachine.coffee
Expand Up @@ -35,7 +35,7 @@
# for states that are not interesting for the user, but needed for clarity of the implementation.
# * Methods with the name of a state will be run on the StateMachine when it transitions
# into the state with the same name (before the event is fired).
define ['vendor/jquery', 'vendor/underscore'], ($, _) ->
define ['jquery', 'underscore'], ($, _) ->
class StateMachine
constructor: ->
@_state = 'ready'
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/common/UIDMap.coffee
@@ -1,4 +1,4 @@
define ['app/common/UID', 'vendor/underscore'], (UID, _) ->
define ['app/common/UID', 'underscore'], (UID, _) ->
class UIDMap
constructor: ->
@_map = {}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/common/i18n.coffee
@@ -1,4 +1,4 @@
define ['vendor/underscore', 'app/common/UID'],
define ['underscore', 'app/common/UID'],
(_, Registry, UID) ->
# Initialization
language = 'en'
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/underscore', 'vendor/jquery', 'vendor/jquery/json'], (_, $) ->
define ['underscore', 'jquery', 'jquery/json'], (_, $) ->
class AsyncJsonI18nDataProvider
constructor: (@path='/locales') ->

Expand Down
@@ -1,4 +1,4 @@
define ['vendor/jquery', './SimpleUpdater'], ($, SU) ->
define ['jquery', './SimpleUpdater'], ($, SU) ->
class JqueryEventI18nUpdater extends SU
constructor: (@el, @module, @eventProvider, type) ->
super @el, @module
Expand Down
4 changes: 2 additions & 2 deletions assets/js/app/common/i18n/Updaters/SimpleUpdater.coffee
@@ -1,4 +1,4 @@
define ['vendor/underscore', 'vendor/jquery', 'app/common/UID', 'app/common/i18n'],
define ['underscore', 'jquery', 'app/common/UID', 'app/common/i18n'],
(_, $, UID, i18n) ->
class SimpleI18nUpdater
constructor: (@el, @module, @key) ->
Expand All @@ -15,4 +15,4 @@ define ['vendor/underscore', 'vendor/jquery', 'app/common/UID', 'app/common/i18n

update: (@key=@key, @data=@data) ->
if not _(@key).isUndefined()
@updateCallback(@el, @module, @key, @data)
@updateCallback(@el, @module, @key, @data)
2 changes: 1 addition & 1 deletion assets/js/app/common/loadcss.coffee
@@ -1,6 +1,6 @@
# Load CSS files asynchronously

define ['vendor/jquery'], ($) ->
define ['jquery'], ($) ->
(urls...) ->
$ ->
for url in urls then do (url) ->
Expand Down
4 changes: 2 additions & 2 deletions assets/js/app/common/raphael/RecText.coffee
@@ -1,4 +1,4 @@
define ['vendor/underscore', './raphael.class', 'vendor/jquery', './raphael.setfixes'], (_, RC, $) ->
define ['underscore', './raphael.class', 'jquery', './raphael.setfixes'], (_, RC, $) ->
defaults =
x: 0
y: 0
Expand All @@ -9,7 +9,7 @@ define ['vendor/underscore', './raphael.class', 'vendor/jquery', './raphael.setf
fill_color: '#efefef'
opacity: 1

RC class RecText
RC 'RecText', class RecText
constructor: (@_paper, opts) ->
opts = $.extend {}, defaults, opts

Expand Down
6 changes: 3 additions & 3 deletions assets/js/app/common/raphael/raphael.class.coffee
@@ -1,4 +1,4 @@
define ['vendor/raphael'], (R) ->
(clazz) ->
R.fn[clazz.name] = (args...) ->
define ['raphael'], (R) ->
(name, clazz) ->
R.fn[name] = (args...) ->
new clazz(@, args...)
2 changes: 1 addition & 1 deletion assets/js/app/common/raphael/raphael.line.coffee
@@ -1,5 +1,5 @@
# Basic idea from http://taitems.tumblr.com/post/549973287/drawing-arrows-in-raphaeljs
define ['vendor/jquery', 'vendor/raphael'], ($, R) ->
define ['jquery', 'raphael'], ($, R) ->
R.fn.line = (x1, y1, x2, y2, _arrowProps={}, line=null) ->
arrowProps = $.extend(
{size:0;filled:true;foot:true;angle:45},
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/common/raphael/raphael.setfixes.coffee
Expand Up @@ -7,7 +7,7 @@
# Subsets can be accessed as setObject.key
# Subsets are sets too.
##
define ['vendor/raphael', 'vendor/underscore'], (R, _) ->
define ['raphael', 'underscore'], (R, _) ->
f = R::set
R::set = (args...) ->
s = f(args...)
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/common/widgets/CodeListing.coffee
@@ -1,4 +1,4 @@
define ['vendor/jquery'], ($) ->
define ['jquery'], ($) ->
class CodeListing
constructor: (@$container) ->
@$content = $('<pre>').addClass('code-listing')
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/modules/ChainedHashTable.coffee
@@ -1,4 +1,4 @@
define ['vendor/jquery', 'app/common/EventLogger',
define ['jquery', 'app/common/EventLogger',
'./ChainedHashTable/model/ChainedHashTable', './ChainedHashTable/model/OrderedList',
'./ChainedHashTable/model/OrderedUniqueList', './ChainedHashTable/model/UnorderedList',
'app/common/i18n'
Expand Down
Expand Up @@ -39,7 +39,7 @@
#

#
define ['vendor/jquery', 'vendor/underscore'
define ['jquery', 'underscore'
'app/common/StateMachine'
'./Element', './UnorderedList'],
($, _, StateMachine, Element, UnorderedList) ->
Expand Down
Expand Up @@ -9,7 +9,7 @@
# * f(a,b) > 0 if a > b

#
define ['vendor/jquery', 'app/common/StateMachine', './UnorderedList'], ($, StateMachine, UL) ->
define ['jquery', 'app/common/StateMachine', './UnorderedList'], ($, StateMachine, UL) ->
class GenericOrderedList extends UL
@StateMachineDefinition = $.extend {}, UL.StateMachineDefinition
@StateMachineDefinition.add = (element) ->
Expand Down
Expand Up @@ -3,7 +3,7 @@
# Each key can only appear once in this list. The API is accordingly modified:
# `add` will return `null` if the key was already present.

define ['vendor/jquery', './OrderedList'], ($, OL) ->
define ['jquery', './OrderedList'], ($, OL) ->
return (compare) ->
L = new OL(compare)
class OrderedUniqueList extends L
Expand Down
@@ -1,12 +1,12 @@
define ['./LinkedList', 'vendor/jquery', 'app/common/raphael/raphael.class'], (List, $, RC) ->
define ['./LinkedList', 'jquery', 'app/common/raphael/raphael.class'], (List, $, RC) ->
defaults =
x: 0
y: 0
hashContainerPadding: 15 # Between containing rectangle and list heads
verticalInnerPadding: 15 # Between lists
linkedListOptions: {} # Passed on to linked lists

RC class ChainedHashTable
RC 'ChainedHashTable', class ChainedHashTable
init: () ->
{x: @_x, y: @_y} = @_options
@_y += @_options.hashContainerPadding
Expand Down
@@ -1,5 +1,5 @@
define [
'vendor/underscore', 'vendor/jquery', 'app/common/raphael/raphael.class', 'app/common/raphael/RecText'
'underscore', 'jquery', 'app/common/raphael/raphael.class', 'app/common/raphael/RecText'
'app/common/raphael/raphael.setfixes', 'app/common/raphael/raphael.line'
], (_, $, RC) ->
defaults =
Expand All @@ -10,7 +10,7 @@ define [
pointerBoxWidth: 15 # Width of the last box, where the pointer arrow starts if there's a next item
pointerArrowLength: 20

RC class LinkedList
RC 'LinkedList', class LinkedList
constructor: (@_paper, opts) ->
@_items = @_paper.set()
@_options = $.extend {}, defaults, opts
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/modules/Graph.coffee
@@ -1,4 +1,4 @@
define ['vendor/jquery'
define ['jquery'
'app/common/i18n'
'app/modules/Graph/model/Graph', 'app/modules/Graph/model/Dijkstra'
'app/modules/Graph/raphael/GraphWidget', 'app/modules/Graph/widgets/GraphCodeListing'
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/modules/Graph/model/Graph.coffee
@@ -1,4 +1,4 @@
define ['app/common/UID', 'app/common/UIDMap', 'vendor/jquery', 'vendor/underscore'], (UID, UIDMap, $, _) ->
define ['app/common/UID', 'app/common/UIDMap', 'jquery', 'underscore'], (UID, UIDMap, $, _) ->

# An edge is an ordered pair of two Node instances with a weight and a UID
class Edge
Expand Down
2 changes: 1 addition & 1 deletion assets/js/app/modules/Graph/raphael/GraphController.coffee
@@ -1,4 +1,4 @@
define ['vendor/jquery', 'vendor/underscore'], ($, _) ->
define ['jquery', 'underscore'], ($, _) ->
actions =
noop: {}
createNode:
Expand Down
6 changes: 3 additions & 3 deletions assets/js/app/modules/Graph/raphael/GraphWidget.coffee
@@ -1,5 +1,5 @@
define ['vendor/jquery', 'vendor/raphael', 'vendor/underscore', 'app/common/raphael/raphael.class', 'app/common/Geometry', 'app/common/raphael/raphael.line', 'app/common/raphael/RecText'], ($, Raphael, _, RC, G) ->
RC class GraphWidget
define ['jquery', 'raphael', 'underscore', 'app/common/raphael/raphael.class', 'app/common/Geometry', 'app/common/raphael/raphael.line', 'app/common/raphael/RecText'], ($, Raphael, _, RC, G) ->
RC 'GraphWidget', class GraphWidget
@default_options = {
'background_color': '#fff'

Expand Down Expand Up @@ -182,4 +182,4 @@ define ['vendor/jquery', 'vendor/raphael', 'vendor/underscore', 'app/common/raph
removeNode: (node) -> node.remove()

setNodeCursor: (cursor) -> @_nodes.attr 'cursor', cursor
setEdgeCursor: (cursor) -> @_edges.attr 'cursor', cursor
setEdgeCursor: (cursor) -> @_edges.attr 'cursor', cursor
2 changes: 1 addition & 1 deletion assets/js/main.coffee
@@ -1,5 +1,5 @@
define [
'vendor/jquery', 'vendor/raphael', 'vendor/underscore',
'jquery', 'raphael', 'underscore',
'app/common/i18n'
]
, ($, Raphael, _, i18n) ->
Expand Down
2 changes: 1 addition & 1 deletion assets/js/test.coffee
@@ -1,5 +1,5 @@
define [].concat(
['vendor/qunit', 'vendor/jquery'],
['/qunit', '/jquery'],

'tests/common/' + m for m in \
['StateMachine', 'UID', 'UIDMap', 'raphael/raphael.setfixes'],
Expand Down
2 changes: 1 addition & 1 deletion assets/js/tests/common/StateMachine.coffee
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/jquery', 'app/common/StateMachine'], (T, $, SM) ->
define ['qunit', 'jquery', 'app/common/StateMachine'], (T, $, SM) ->
class S extends SM
@StateMachineDefinition:
entryPoints: ['s1', 's2', 's3'],
Expand Down
4 changes: 2 additions & 2 deletions assets/js/tests/common/UID.coffee
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'app/common/UID'], (T, U) ->
define ['qunit', 'app/common/UID'], (T, U) ->
T.module 'UID'

T.test 'Global series from 0', ->
Expand All @@ -11,4 +11,4 @@ define ['vendor/qunit', 'app/common/UID'], (T, U) ->
T.equal U('b'), 0
T.equal U('a'), 1
T.equal U('a'), 2
T.equal U('b'), 1
T.equal U('b'), 1
4 changes: 2 additions & 2 deletions assets/js/tests/common/UIDMap.coffee
@@ -1,9 +1,9 @@
define ['vendor/qunit', 'app/common/UIDMap'], (T, M) ->
define ['qunit', 'app/common/UIDMap'], (T, M) ->
T.module 'UIDMap',
setup: ->
@m = new M

T.test 'Can add item', ->
o = {UID: 0, x: 'foo'}
@m.add o
T.ok @m.exists o
T.ok @m.exists o
2 changes: 1 addition & 1 deletion assets/js/tests/common/raphael/raphael.setfixes.coffee
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/raphael',
define ['qunit', 'raphael',
'app/common/raphael/raphael.setfixes'], (T, R) ->
T.module 'Raphael Set enhancements',
setup: ->
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/jquery',
define ['qunit', 'jquery',
'app/modules/ChainedHashTable/model/ChainedHashTable',
'app/modules/ChainedHashTable/model/UnorderedList'],
(T, $, CHT, UL) ->
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit',
define ['qunit',
'app/modules/ChainedHashTable/model/Element',
'app/modules/ChainedHashTable/model/OrderedList'],
(T, E, OL) ->
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit',
define ['qunit',
'app/modules/ChainedHashTable/model/Element',
'app/modules/ChainedHashTable/model/OrderedUniqueList'], (T, E, OUL) ->
T.module 'Chained hash table: Ordered unique list',
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit',
define ['qunit',
'app/modules/ChainedHashTable/model/Element',
'app/modules/ChainedHashTable/model/UnorderedList'], (T, E, L) ->
T.module 'Chained hash table: Unordered list',
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/raphael',
define ['qunit', 'raphael',
'app/modules/ChainedHashTable/raphael/ChainedHashTableWidget'], (T, R) ->
T.module 'Widgets: ChainedHashTable',
setup: ->
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/raphael',
define ['qunit', 'raphael',
'app/modules/ChainedHashTable/raphael/LinkedList'], (T, R) ->
T.module 'Widgets: LinkedList',
setup: ->
Expand Down
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/raphael', 'app/common/raphael/RecText'], (T, R) ->
define ['qunit', 'raphael', 'app/common/raphael/RecText'], (T, R) ->
T.module 'Widgets: RecText',
setup: ->
@p = R('testpaper')
Expand Down Expand Up @@ -89,4 +89,4 @@ define ['vendor/qunit', 'vendor/raphael', 'app/common/raphael/RecText'], (T, R)
r.resizeX 300
rb = r._set.get('rect', 0).getBBox()
T.equal rb.width, 300
T.equal r._set.get('text', 0).attr('x'), rb.x
T.equal r._set.get('text', 0).attr('x'), rb.x
4 changes: 2 additions & 2 deletions assets/js/tests/modules/Graph/model/Graph.coffee
@@ -1,4 +1,4 @@
define ['vendor/qunit', 'vendor/jquery', 'app/modules/Graph/model/Graph'], (T, $, G) ->
define ['qunit', 'jquery', 'app/modules/Graph/model/Graph'], (T, $, G) ->
T.module 'Graph model',
setup: ->
@g = new G
Expand Down Expand Up @@ -47,4 +47,4 @@ define ['vendor/qunit', 'vendor/jquery', 'app/modules/Graph/model/Graph'], (T, $
n2 = @g.createNode()
@g.options.directed = false
@g.createEdge(n1, n2)
T.ok (@g.adjacent n1, n2)
T.ok (@g.adjacent n1, n2)
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
define(['vendor/jquery'], function(jQuery) {
define(['jquery'], function(jQuery) {

(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
Expand Down
File renamed without changes.

0 comments on commit 1909092

Please sign in to comment.