Commit 24d22c20 authored by Nick Stenning's avatar Nick Stenning

Merge pull request #2387 from hypothesis/code-style-conformance

Getting picky with our code styles
parents ca5467c1 fdef5dd9
{
"preset": "google",
"requireSemicolons": true,
"excludeFiles": [
"node_modules/**",
"h/static/scripts/vendor"
......
......@@ -2,26 +2,28 @@ var Annotator = require('annotator');
// Scroll plugin for jQuery
// TODO: replace me
require('jquery-scrollintoview')
require('jquery-scrollintoview');
// Polyfills
var g = Annotator.Util.getGlobal();
if (g.wgxpath) g.wgxpath.install();
if (g.wgxpath) {
g.wgxpath.install();
}
require('es6-promise')
require('es6-promise');
var nodeIteratorShim = require('node-iterator-shim')
var nodeIteratorShim = require('node-iterator-shim');
nodeIteratorShim();
// Applications
Annotator.Guest = require('./guest')
Annotator.Host = require('./host')
Annotator.Guest = require('./guest');
Annotator.Host = require('./host');
// Cross-frame communication
Annotator.Plugin.CrossFrame = require('./plugin/cross-frame')
Annotator.Plugin.CrossFrame.Bridge = require('../bridge')
Annotator.Plugin.CrossFrame.AnnotationSync = require('../annotation-sync')
Annotator.Plugin.CrossFrame.Discovery = require('../discovery')
Annotator.Plugin.CrossFrame = require('./plugin/cross-frame');
Annotator.Plugin.CrossFrame.Bridge = require('../bridge');
Annotator.Plugin.CrossFrame.AnnotationSync = require('../annotation-sync');
Annotator.Plugin.CrossFrame.Discovery = require('../discovery');
// Bucket bar
require('./plugin/bucket-bar');
......@@ -32,7 +34,6 @@ require('./plugin/toolbar');
// Creating selections
require('./plugin/textselection');
var docs = 'https://h.readthedocs.org/en/latest/hacking/customized-embedding.html';
var options = {
app: jQuery('link[type="application/annotator+html"]').attr('href'),
......@@ -42,12 +43,12 @@ var options = {
// Document metadata plugins
if (window.PDFViewerApplication) {
require('./plugin/pdf')
options['BucketBar']['scrollables'] = ['#viewerContainer']
options['PDF'] = {};
require('./plugin/pdf');
options.BucketBar.scrollables = ['#viewerContainer'];
options.PDF = {};
} else {
require('../vendor/annotator.document');
options['Document'] = {};
options.Document = {};
}
if (window.hasOwnProperty('hypothesisConfig')) {
......@@ -58,7 +59,8 @@ if (window.hasOwnProperty('hypothesisConfig')) {
}
}
Annotator.noConflict().$.noConflict(true)(function () {
Annotator.noConflict().$.noConflict(true)(function() {
'use strict';
var Klass = Annotator.Host;
if (options.hasOwnProperty('constructor')) {
Klass = options.constructor;
......
module.exports = ['$animate', function ($animate) {
module.exports = ['$animate', function($animate) {
'use strict';
return {
link: function (scope, elem, attrs) {
link: function(scope, elem) {
// ngAnimate conflicts with the spinners own CSS
$animate.enabled(false, elem);
},
restrict: 'C',
template: '<span><span></span></span>'
}
};
}];
......@@ -19,7 +19,7 @@
* change at any time and should write code accordingly. Feature flags should
* not be cached, and should not be interrogated only at setup time.
*/
"use strict";
'use strict';
var CACHE_TTL = 5 * 60 * 1000; // 5 minutes
......
......@@ -7,7 +7,6 @@ module.exports = function(config) {
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [
......@@ -15,7 +14,6 @@ module.exports = function(config) {
'mocha'
],
// list of files / patterns to load in the browser
files: [
// Application external deps
......@@ -49,7 +47,6 @@ module.exports = function(config) {
'**/*-test.js'
],
// list of files to exclude
exclude: [
],
......@@ -78,24 +75,19 @@ module.exports = function(config) {
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['dots'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
......
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