Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
24d22c20
Commit
24d22c20
authored
Jul 21, 2015
by
Nick Stenning
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2387 from hypothesis/code-style-conformance
Getting picky with our code styles
parents
ca5467c1
fdef5dd9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
28 deletions
+25
-28
.jscsrc
.jscsrc
+2
-0
main.js
h/static/scripts/annotator/main.js
+18
-16
spinner.js
h/static/scripts/directive/spinner.js
+4
-3
features.js
h/static/scripts/features.js
+1
-1
karma.config.js
h/static/scripts/karma.config.js
+0
-8
No files found.
.jscsrc
View file @
24d22c20
{
"preset": "google",
"requireSemicolons": true,
"excludeFiles": [
"node_modules/**",
"h/static/scripts/vendor"
...
...
h/static/scripts/annotator/main.js
View file @
24d22c20
...
...
@@ -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
;
...
...
h/static/scripts/directive/spinner.js
View file @
24d22c20
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>'
}
}
;
}];
h/static/scripts/features.js
View file @
24d22c20
...
...
@@ -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
...
...
h/static/scripts/karma.config.js
View file @
24d22c20
...
...
@@ -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'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment