Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 39525
1
# Library file for SMC webapp
2
3
# These old-school JS files need to be on top, otherwise dependency issues arise
4
# (e.g. minified jquery isn't properly being detected, etc.)
5
6
# this loads the "traditional" js files via webpack.config.coffee
7
# it doesn't minify them – but webpack in production mode optimizes everything as a whole
8
# and evals them right into the global context
9
# TODO switch to npm packaging
10
11
require("script!primus/primus-engine.min.js")
12
13
# polyfill Number.isNaN for IE
14
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill
15
Number.isNaN = Number.isNaN || (value) ->
16
typeof value == "number" and isNaN(value)
17
18
# polyfill for internet explorer's lack of String.prototype.startswith
19
String::startsWith ?= (searchString, position) ->
20
pos = position ? 0
21
@indexOf(searchString, pos) == pos
22
23
# polyfill for internet explorer's lack of String.prototype.includes
24
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill
25
String::includes ?= (search, start) ->
26
if typeof start != 'number'
27
start = 0
28
if start + search.length > @length
29
return false
30
else
31
return @indexOf(search, start) != -1
32
33
# this must come before anything that touches event handling, etc.
34
require('webapp-lib/webapp-error-reporter.coffee')
35
36
# require("script!jquery/jquery.min.js")
37
$ = jQuery = window.$ = window.jQuery = require('jquery')
38
#require('jquery-ui')
39
# explicit jQuery UI widgets that we use -- no need to load the entire library
40
require("node_modules/jquery-ui/ui/widgets/draggable") # TODO: do we use?
41
require("node_modules/jquery-ui/ui/widgets/sortable") # TODO: do we use?
42
require("node_modules/jquery-ui/ui/widgets/slider")
43
require("node_modules/jquery-ui/ui/widgets/resizable") # TODO: do we use?
44
45
# $.tooltip() setup
46
require("jquery-focusable/jquery.focusable.js") # jquery-focusable is a peer dependency.
47
require("jquery-focus-exit/jquery.focusexit.js") # jquery-focus-exit is a peer dependency.
48
require("jquery-mouse-exit/jquery.mouseexit.js") # jquery-mouse-exit is a peer dependency.
49
require("jquery-stick/jquery.stick.js") # jquery-stick is a peer dependency.
50
require("imports?jQuery=jquery!jquery-tooltip/jquery.tooltip.js")
51
52
# Hack to make jQuery UI work on mobile devices: http://touchpunch.furf.com/
53
# require("script!jquery/plugins/jquery.ui.touch-punch.min.js")
54
require('jquery-ui-touch-punch')
55
56
# Hack to make jQuery hide and show not break with Bootstrap 3
57
require("./webapp-lib/jquery/plugins/bootstrap_hide_show.js")
58
59
# Timeago jQuery plugin
60
# require("script!jquery/plugins/jquery.timeago.min.js")
61
require('timeago')
62
63
# Scroll into view plugin
64
require("jquery.scrollintoview/jquery.scrollintoview.js")
65
66
# Highlight jQuery plugin: http://bartaz.github.io/sandbox.js/jquery.highlight.html
67
# require("script!jquery/plugins/jquery.highlight.min.js")
68
require('jquery-highlight')
69
70
# Caret Position jQuery plugin
71
#require("script!jquery/plugins/caret/jquery.caret.js")
72
require('jquery-caret')
73
74
# Bootstrap
75
# require("script!bootstrap-3.3.0/js/bootstrap.min.js")
76
require('bootstrap')
77
78
# Bootbox: usable dialogs for bootstrap
79
require("script!bootbox/bootbox.min.js") # loads from smc-webapp/node_modules
80
# require('bootbox') # this doesn't work, sadly (jquery initializiation with "modal" from bootstrap doesn't happen properly)
81
82
# Bootstrap switch: https://github.com/nostalgiaz/bootstrap-switch
83
#require("script!bootstrap-switch/bootstrap-switch.min.js")
84
require('bootstrap-switch')
85
86
# Bootstrap Colorpicker Plugin
87
# require("script!jquery/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js")
88
require('bootstrap-colorpicker')
89
90
# Pnotify: Notification framework from http://pinesframework.org/pnotify
91
require("script!pnotify/jquery.pnotify.min.js")
92
#PNotify = require("pnotify/src/pnotify.js");
93
require("pnotify/src/pnotify.mobile.js");
94
require("pnotify/src/pnotify.buttons.js");
95
require("pnotify/src/pnotify.desktop.js");
96
97
# Datetime picker
98
require("script!datetimepicker/bootstrap-datetimepicker.min.js")
99
# https://github.com/eonasdan/bootstrap-datetimepicker
100
# require("eonasdan-bootstrap-datetimepicker")
101
102
# XTerm terminal emulator
103
require("script!term/term.js")
104
require("script!term/color_themes.js")
105
106
# Make html look nice
107
require("script!jsbeautify/beautify-html.min.js")
108
109
# Make html into markdown
110
#require("script!remarked/reMarked.min.js")
111
112
# ********************************
113
# node_modules, mainly from inside smc-webapp
114
115
require("async")
116
require("events")
117
require("marked")
118
require("redux")
119
require("react")
120
require("react-redux")
121
require("react-timeago")
122
require("react-bootstrap")
123
require("sha1")
124
require("three")
125
require("underscore")
126
require("immutable")
127
require("react-dropzone-component")
128
require("jquery.payment")
129
require("react-widgets/lib/Combobox")
130
require("react-widgets/lib/DateTimePicker")
131
require("md5")
132
require("./smc-webapp/codemirror/codemirror.coffee")
133
134
# after this lib.js package, the real smc.js app starts loading
135
window.smcLoadStatus("Starting main application ...")
136
137