Commit ba6280b3 authored by Nick Stenning's avatar Nick Stenning

Use browserify to manage JavaScript packaging

parent a6aec003
var Klass = window.Annotator.Host;
require('./scripts/vendor/jquery.scrollintoview');
var Annotator = require('annotator');
var Klass = require('./scripts/host');
var docs = 'https://github.com/hypothesis/h/blob/master/README.rst#customized-embedding';
var options = {
app: jQuery('link[type="application/annotator+html"]').attr('href'),
......@@ -23,4 +26,4 @@ if (window.hasOwnProperty('hypothesisConfig')) {
}
window.annotator = new Klass(document.body, options);
window.Annotator.noConflict().$.noConflict(true);
Annotator.noConflict().$.noConflict(true);
angular = require('angular')
AUTH_SESSION_ACTIONS = [
'login'
'logout'
......@@ -124,3 +126,6 @@ angular.module('h')
.config(configure)
.controller('AuthAppController', AuthAppController)
.controller('AuthPageController', AuthPageController)
require('./account-controller')
require('./auth-controller')
Annotator = require('annotator')
# Save references to Range and Util (because we call Annotator.noConflict() when
# bootstrapping)
Range = Annotator.Range
......
Annotator = @Annotator
Annotator = require('annotator')
$ = Annotator.$
# Fake two-phase / pagination support, used for HTML documents
......
angular = require('angular')
uuid = require('./vendor/uuid')
# These services are provided in their own angular modules and thus must be
# loaded first.
require('./identity-service')
require('./streamer-service')
imports = [
'ngAnimate'
'ngRoute'
......@@ -92,3 +100,38 @@ module = angular.module('h', imports)
unless mocha? # Crude method of detecting test environment.
module.run(setupCrossFrame)
module.run(setupStreamer)
require('./vendor/annotator.auth.js')
require('./annotator/monkey')
require('./controllers')
require('./directives')
require('./directives/annotation')
require('./directives/deep-count')
require('./directives/markdown')
require('./directives/privacy')
require('./directives/simple-search')
require('./directives/status-button')
require('./directives/thread-filter')
require('./directives/thread')
require('./filters')
require('./searchfilters')
require('./services')
require('./annotation-mapper-service')
require('./annotation-ui-service')
require('./auth-service')
require('./cross-frame-service')
require('./flash-service')
require('./permissions-service')
require('./store-service')
require('./threading-service')
require('./streamsearch')
require('./annotation-sync')
require('./annotation-ui-sync')
require('./bridge')
require('./discovery')
$ = require('jquery')
Channel = require('./vendor/jschannel')
class Bridge
options:
# Scope identifier to distinguish this channel from any others
......
angular = require('angular')
Markdown = require('./vendor/Markdown.Converter')
class Converter extends Markdown.Converter
constructor: ->
super
......
Annotator = @Annotator
$ = Annotator.$
$ = require('jquery')
Annotator = require('annotator')
Channel = require('./vendor/jschannel')
# Monkeypatch annotator!
require('./annotator/monkey')
class Annotator.Guest extends Annotator
# Cross-frame communication
require('./annotator/plugin/cross-frame')
require('./annotation-sync')
require('./bridge')
require('./discovery')
# Document plugin
require('./vendor/annotator.document')
# Bucket bar
require('./annotator/plugin/bucket-bar')
# Toolbar
require('./annotator/plugin/toolbar')
# Drawing highlights
require('./annotator/plugin/texthighlights')
# Creating selections
require('./annotator/plugin/textselection')
# URL fragments
require('./annotator/plugin/fragmentselector')
# Anchoring
require('./vendor/dom_text_mapper')
require('./annotator/plugin/enhancedanchoring')
require('./annotator/plugin/domtextmapper')
require('./annotator/plugin/textposition')
require('./annotator/plugin/textquote')
require('./annotator/plugin/textrange')
# PDF
require('./vendor/page_text_mapper_core')
require('./annotator/plugin/pdf')
# Fuzzy
require('./vendor/dom_text_matcher')
require('./annotator/plugin/fuzzytextanchors')
module.exports = class Annotator.Guest extends Annotator
SHOW_HIGHLIGHTS_CLASS = 'annotator-highlights-always-on'
# Events to be bound on Annotator#element.
......
angular = require('angular')
angular.module('h.helpers', ['bootstrap'])
require('./form-helpers')
require('./string-helpers')
require('./time-helpers')
require('./ui-helpers')
require('./xsrf-service')
angular = require('angular')
unorm = require('../vendor/unorm')
# Shared helper methods for working with strings/unicode strings
# For unicode normalization we use the unorm library
createStringHelpers = ->
......
Annotator = @Annotator
$ = Annotator.$
$ = require('jquery')
Annotator = require('annotator')
Guest = require('./guest')
class Annotator.Host extends Annotator.Guest
module.exports = class Annotator.Host extends Annotator.Guest
# Drag state variables
drag:
delta: 0
......
angular = require('angular')
angular.module('h.session', ['ngResource', 'h.helpers'])
require('./session-service')
angular = require('angular')
mail = require('./vendor/jwz')
class ThreadingService
# Mix in message thread properties into the prototype. The body of the
# class will overwrite any methods applied here. If you need inheritance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment