diff --git a/services/web/app/coffee/Features/Captcha/CaptchaMiddleware.coffee b/services/web/app/coffee/Features/Captcha/CaptchaMiddleware.coffee new file mode 100644 index 0000000000..4a3ce18b5e --- /dev/null +++ b/services/web/app/coffee/Features/Captcha/CaptchaMiddleware.coffee @@ -0,0 +1,21 @@ +request = require 'request' +logger = require 'logger-sharelatex' +Settings = require 'settings-sharelatex' + +module.exports = CaptchaMiddleware = + validateCaptcha: (req, res, next) -> + if !Settings.recaptcha? + return next() + response = req.body['g-recaptcha-response'] + options = + form: + secret: Settings.recaptcha.secretKey + response: response + json: true + request.post "https://www.google.com/recaptcha/api/siteverify", options, (error, response, body) -> + return next(error) if error? + if !body?.success + logger.warn {statusCode: response.statusCode, body: body}, 'failed recaptcha siteverify request' + return res.sendStatus 400 + else + return next() diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee index e00f7807f5..28f0cbb5ee 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsInviteController.coffee @@ -11,6 +11,7 @@ NotificationsBuilder = require("../Notifications/NotificationsBuilder") AnalyticsManger = require("../Analytics/AnalyticsManager") AuthenticationController = require("../Authentication/AuthenticationController") rateLimiter = require("../../infrastructure/RateLimiter") +request = require 'request' module.exports = CollaboratorsInviteController = @@ -32,7 +33,7 @@ module.exports = CollaboratorsInviteController = callback(null, userExists) else callback(null, true) - + _checkRateLimit: (user_id, callback = (error) ->) -> LimitationsManager.allowedNumberOfCollaboratorsForUser user_id, (err, collabLimit = 1)-> return callback(err) if err? diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee index 721e5a7b62..90fc704659 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsRouter.coffee @@ -3,6 +3,7 @@ AuthenticationController = require('../Authentication/AuthenticationController') AuthorizationMiddlewear = require('../Authorization/AuthorizationMiddlewear') CollaboratorsInviteController = require('./CollaboratorsInviteController') RateLimiterMiddlewear = require('../Security/RateLimiterMiddlewear') +CaptchaMiddleware = require '../Captcha/CaptchaMiddleware' module.exports = apply: (webRouter, apiRouter) -> @@ -32,6 +33,7 @@ module.exports = maxRequests: 100 timeInterval: 60 * 10 }), + CaptchaMiddleware.validateCaptcha, AuthenticationController.requireLogin(), AuthorizationMiddlewear.ensureUserCanAdminProject, CollaboratorsInviteController.inviteToProject diff --git a/services/web/app/coffee/Features/Email/EmailSender.coffee b/services/web/app/coffee/Features/Email/EmailSender.coffee index f65f04ebdf..d5ae949f74 100644 --- a/services/web/app/coffee/Features/Email/EmailSender.coffee +++ b/services/web/app/coffee/Features/Email/EmailSender.coffee @@ -4,6 +4,7 @@ Settings = require('settings-sharelatex') nodemailer = require("nodemailer") sesTransport = require('nodemailer-ses-transport') sgTransport = require('nodemailer-sendgrid-transport') +mandrillTransport = require('nodemailer-mandrill-transport') rateLimiter = require('../../infrastructure/RateLimiter') _ = require("underscore") @@ -17,22 +18,22 @@ client = sendMail: (options, callback = (err,status) ->) -> logger.log options:options, "Would send email if enabled." callback() - if Settings?.email?.parameters?.AWSAccessKeyID? or Settings?.email?.driver == 'ses' logger.log "using aws ses for email" nm_client = nodemailer.createTransport(sesTransport(Settings.email.parameters)) else if Settings?.email?.parameters?.sendgridApiKey? logger.log "using sendgrid for email" nm_client = nodemailer.createTransport(sgTransport({auth:{api_key:Settings?.email?.parameters?.sendgridApiKey}})) +else if Settings?.email?.parameters?.MandrillApiKey? + logger.log "using mandril for email" + nm_client = nodemailer.createTransport(mandrillTransport({auth:{apiKey:Settings?.email?.parameters?.MandrillApiKey}})) else if Settings?.email?.parameters? - smtp = _.pick(Settings?.email?.parameters, "host", "port", "secure", "auth", "ignoreTLS") - - logger.log "using smtp for email" + smtp = _.pick(Settings?.email?.parameters, "host", "port", "secure", "auth", "ignoreTLS") nm_client = nodemailer.createTransport(smtp) else - nm_client = client logger.warn "Email transport and/or parameters not defined. No emails will be sent." + nm_client = client if nm_client? client = nm_client diff --git a/services/web/app/coffee/Features/Errors/Errors.coffee b/services/web/app/coffee/Features/Errors/Errors.coffee index 2e46dd692d..d88b243418 100644 --- a/services/web/app/coffee/Features/Errors/Errors.coffee +++ b/services/web/app/coffee/Features/Errors/Errors.coffee @@ -26,8 +26,16 @@ InvalidNameError = (message) -> return error InvalidNameError.prototype.__proto__ = Error.prototype +UnsupportedFileTypeError = (message) -> + error = new Error(message) + error.name = "UnsupportedFileTypeError" + error.__proto__ = UnsupportedFileTypeError.prototype + return error +UnsupportedFileTypeError.prototype.__proto___ = Error.prototype + module.exports = Errors = NotFoundError: NotFoundError ServiceNotConfiguredError: ServiceNotConfiguredError TooManyRequestsError: TooManyRequestsError InvalidNameError: InvalidNameError + UnsupportedFileTypeError: UnsupportedFileTypeError diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index 2fdf219962..b126819f56 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -292,3 +292,14 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)-> res.locals.moduleIncludes = Modules.moduleIncludes res.locals.moduleIncludesAvailable = Modules.moduleIncludesAvailable next() + + webRouter.use (req, res, next) -> + isOl = (Settings.brandPrefix == 'ol-') + res.locals.uiConfig = + defaultResizerSizeOpen : if isOl then 2 else 24 + defaultResizerSizeClosed : if isOl then 2 else 24 + eastResizerCursor : if isOl then "ew-resize" else null + westResizerCursor : if isOl then "ew-resize" else null + chatResizerSizeOpen : if isOl then 2 else 12 + chatResizerSizeClosed : 0 + next() diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index 31afc17d29..e12d7d6f81 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -97,6 +97,15 @@ html(itemscope, itemtype='http://schema.org/Product') } body + if(settings.recaptcha) + script(src="https://www.google.com/recaptcha/api.js?render=explicit") + div( + id="recaptcha" + class="g-recaptcha" + data-sitekey=settings.recaptcha.siteKey + data-size="invisible" + data-badge="inline" + ) - if(typeof(suppressSystemMessages) == "undefined") .system-messages( diff --git a/services/web/app/views/project/editor.pug b/services/web/app/views/project/editor.pug index 625bea883d..ec1d129714 100644 --- a/services/web/app/views/project/editor.pug +++ b/services/web/app/views/project/editor.pug @@ -43,8 +43,8 @@ block content #chat-wrapper.full-size( layout="chat", - spacing-open="12", - spacing-closed="0", + spacing-open="{{ui.chatResizerSizeOpen}}", + spacing-closed="{{ui.chatResizerSizeClosed}}", initial-size-east="250", init-closed-east="true", open-east="ui.chatOpen", @@ -158,6 +158,7 @@ block requirejs window.aceFingerprint = "#{fingerprint(jsPath + lib('ace') + '/ace.js')}" window.aceWorkerPath = "#{aceWorkerPath}"; window.pdfCMapsPath = "#{pdfCMapsPath}" + window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}'); script( data-main=buildJsPath("ide.js", {fingerprint:false}), diff --git a/services/web/app/views/project/editor/editor.pug b/services/web/app/views/project/editor/editor.pug index d1c6fa8156..1ed95a75ac 100644 --- a/services/web/app/views/project/editor/editor.pug +++ b/services/web/app/views/project/editor/editor.pug @@ -73,21 +73,20 @@ div.full-size( ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs'" ng-controller="PdfSynctexController" ) - a.btn.btn-default.btn-xs( + a.btn.btn-default.btn-xs.synctex-control.synctex-control-goto-pdf( tooltip=translate('go_to_code_location_in_pdf') tooltip-placement="right" tooltip-append-to-body="true" ng-click="syncToPdf()" ) - i.fa.fa-long-arrow-right - br - a.btn.btn-default.btn-xs( + i.synctex-control-icon + a.btn.btn-default.btn-xs.synctex-control.synctex-control-goto-code( tooltip-html="'"+translate('go_to_pdf_location_in_code', {}, true)+"'" tooltip-placement="right" tooltip-append-to-body="true" ng-click="syncToCode()" ) - i.fa.fa-long-arrow-left + i.synctex-control-icon div.full-size( ng-if="ui.pdfLayout == 'flat'" diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index deecc46911..7ee28763a8 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -63,6 +63,12 @@ block content aside.project-list-sidebar.col-md-2.col-xs-3 include ./list/side-bar + if isShowingV1Projects && settings.overleaf && settings.overleaf.host + .project-list-sidebar-v1-link.col-md-2.col-xs-3 + span Want to go back to the V1 dashboard? + a.btn.btn-default(href=settings.overleaf.host + "/dash?prefer-v1-dash=1") + | Go back to V1 + .project-list-main.col-md-10.col-xs-9 include ./list/notifications include ./list/project-list diff --git a/services/web/npm-shrinkwrap.json b/services/web/npm-shrinkwrap.json index 6ece76837e..f72adf81e5 100644 --- a/services/web/npm-shrinkwrap.json +++ b/services/web/npm-shrinkwrap.json @@ -173,6 +173,12 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.0.tgz", "integrity": "sha1-rD76xxew57vcd4zgvec4GsZgQ5M=" }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -565,7 +571,6 @@ "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-0.22.1.tgz", "integrity": "sha1-Agw4O+1iWvXGyINN2MSsoN0Pdlw=", "requires": { - "dtrace-provider": "0.2.8", "mv": "0.0.5" } }, @@ -754,6 +759,21 @@ "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.4.tgz", "integrity": "sha1-/hvO2X/h+zknuZjytFYW4GWL4f8=" }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "colors": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", @@ -777,16 +797,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", - "requires": { - "inherits": "2.0.3", - "readable-stream": "1.0.34", - "typedarray": "0.0.6" - } - }, "connect": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.2.tgz", @@ -1166,6 +1176,11 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, + "denque": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.2.2.tgz", + "integrity": "sha512-x92Ql74lcTbGylXILO9Xf9S0cMpEPP04zVp2bB9e2C7G/n/Q1SgLl78RaSYEPSgpDX9uLgQXCEGAS5BI5dP3yA==" + }, "depd": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", @@ -1277,12 +1292,6 @@ "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" }, - "dtrace-provider": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.2.8.tgz", - "integrity": "sha1-4kPxkhmqlfvw2PL/sH9b1k6U/iA=", - "optional": true - }, "each-series": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/each-series/-/each-series-1.0.0.tgz", @@ -1552,27 +1561,6 @@ "resolved": "https://registry.npmjs.org/extendible/-/extendible-0.1.1.tgz", "integrity": "sha1-4qN+2HEp+0+VM+io11BiMKU5yQU=" }, - "extract-zip": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.5.tgz", - "integrity": "sha1-maBnNbbqIOqbcF13ms/8yHz/BEA=", - "requires": { - "concat-stream": "1.6.0", - "debug": "1.0.5", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" - }, - "dependencies": { - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "requires": { - "fd-slicer": "1.0.1" - } - } - } - }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -1834,7 +1822,7 @@ "requires": { "graceful-fs": "4.1.11", "inherits": "2.0.3", - "mkdirp": "0.5.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "rimraf": "2.2.6" } }, @@ -2647,7 +2635,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -2662,7 +2650,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -2762,32 +2750,42 @@ "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" }, "ioredis": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-2.5.0.tgz", - "integrity": "sha1-+2/fChp+CXRhTGe25eETCKjPlbk=", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-3.2.2.tgz", + "integrity": "sha512-g+ShTQYLsCcOUkNOK6CCEZbj3aRDVPw3WOwXk+LxlUKvuS9ujEqP2MppBHyRVYrNNFW/vcPaTBUZ2ctGNSiOCA==", "requires": { "bluebird": "3.5.0", "cluster-key-slot": "1.0.8", - "debug": "2.6.8", - "double-ended-queue": "2.1.0-0", + "debug": "2.6.9", + "denque": "1.2.2", "flexbuffer": "0.0.6", - "lodash": "4.17.4", + "lodash.assign": "4.2.0", + "lodash.bind": "4.2.1", + "lodash.clone": "4.5.0", + "lodash.clonedeep": "4.5.0", + "lodash.defaults": "4.2.0", + "lodash.difference": "4.5.0", + "lodash.flatten": "4.4.0", + "lodash.foreach": "4.5.0", + "lodash.isempty": "4.4.0", + "lodash.keys": "4.2.0", + "lodash.noop": "3.0.1", + "lodash.partial": "4.2.1", + "lodash.pick": "4.4.0", + "lodash.sample": "4.2.1", + "lodash.shuffle": "4.2.0", + "lodash.values": "4.3.0", "redis-commands": "1.3.1", - "redis-parser": "1.3.0" + "redis-parser": "2.6.0" }, "dependencies": { "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } - }, - "redis-parser": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-1.3.0.tgz", - "integrity": "sha1-gG6+e7+3005NfB6e8oLvz60EEmo=" } } }, @@ -3020,9 +3018,9 @@ } }, "just-extend": { - "version": "1.1.22", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.22.tgz", - "integrity": "sha1-MzCvdWyralQnAMZLLk5KoGLVL/8=" + "version": "1.1.27", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", + "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==" }, "jwa": { "version": "1.1.5", @@ -3202,7 +3200,7 @@ "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", "optional": true, "requires": { - "mkdirp": "0.5.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "ncp": "2.0.0", "rimraf": "2.4.5" } @@ -3252,7 +3250,6 @@ "asn1": "0.2.1", "assert-plus": "0.1.5", "bunyan": "0.22.1", - "dtrace-provider": "0.2.8", "nopt": "2.1.1", "pooling": "0.4.6" }, @@ -3372,16 +3369,78 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "lodash.bind": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", + "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" + }, + "lodash.clone": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", + "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" + }, + "lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, "lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" }, + "lodash.isarray": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-4.0.0.tgz", + "integrity": "sha1-KspJayjEym1yZxUxNZDALm6jRAM=", + "dev": true + }, "lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" }, + "lodash.isempty": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=" + }, "lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", @@ -3402,18 +3461,59 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, + "lodash.keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.2.0.tgz", + "integrity": "sha1-oIYCrBLk+4P5H8H7ejYKTZujUgU=" + }, + "lodash.mergewith": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz", + "integrity": "sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU=", + "dev": true + }, + "lodash.noop": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash.noop/-/lodash.noop-3.0.1.tgz", + "integrity": "sha1-OBiPTWUKOkdCWEObluxFsyYXEzw=" + }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, + "lodash.partial": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.partial/-/lodash.partial-4.2.1.tgz", + "integrity": "sha1-SfPYz9qjv/izqR0SfpIyRUGJYdQ=" + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" + }, "lodash.reduce": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" }, + "lodash.sample": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.sample/-/lodash.sample-4.2.1.tgz", + "integrity": "sha1-XkKRsMdT+hq+sKq4+ynfG2bwf20=" + }, + "lodash.shuffle": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.shuffle/-/lodash.shuffle-4.2.0.tgz", + "integrity": "sha1-FFtQU8+HX29cKjP0i26ZSMbse0s=" + }, + "lodash.values": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", + "integrity": "sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=" + }, "logger-sharelatex": { - "version": "git+https://github.com/sharelatex/logger-sharelatex.git#b2956ec56b582b9f4fc8fdda8dc00c06e77c5537", + "version": "git+https://github.com/sharelatex/logger-sharelatex.git#13562f8866708fc86aef8202bf5a2ce4d1c6eed7", "requires": { "bunyan": "1.5.1", "chai": "4.1.2", @@ -3426,8 +3526,8 @@ "grunt-mocha-test": "0.11.0", "raven": "1.2.1", "sandboxed-module": "2.0.3", - "sinon": "3.2.1", - "timekeeper": "1.0.0" + "sinon": "4.1.3", + "timekeeper": "2.0.0" }, "dependencies": { "ansi-regex": { @@ -3460,7 +3560,7 @@ "deep-eql": "3.0.1", "get-func-name": "2.0.0", "pathval": "1.1.0", - "type-detect": "4.0.3" + "type-detect": "4.0.5" } }, "chalk": { @@ -3483,9 +3583,9 @@ "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "requires": { - "type-detect": "4.0.3" + "type-detect": "4.0.5" } }, "dtrace-provider": { @@ -3502,7 +3602,25 @@ "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", "integrity": "sha1-87IWfZBoxGmKjVH092CjmlTYGOs=", "requires": { - "samsam": "1.2.1" + "samsam": "1.1.2" + } + }, + "fs-extra": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.9.1.tgz", + "integrity": "sha1-h9v8ATg6jdzn2dVJbzYIVkiJ8VY=", + "requires": { + "jsonfile": "1.1.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "ncp": "0.5.1", + "rimraf": "2.4.5" + }, + "dependencies": { + "ncp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.5.1.tgz", + "integrity": "sha1-dDmFMW49tFkoG1hxaehFc1oFQ58=" + } } }, "glob": { @@ -3570,24 +3688,6 @@ "fs-extra": "0.9.1", "hooker": "0.2.3", "mocha": "1.20.1" - }, - "dependencies": { - "fs-extra": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.9.1.tgz", - "integrity": "sha1-h9v8ATg6jdzn2dVJbzYIVkiJ8VY=", - "requires": { - "jsonfile": "1.1.1", - "mkdirp": "0.5.1", - "ncp": "0.5.1", - "rimraf": "2.4.5" - } - }, - "ncp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.5.1.tgz", - "integrity": "sha1-dDmFMW49tFkoG1hxaehFc1oFQ58=" - } } }, "has-ansi": { @@ -3598,6 +3698,11 @@ "ansi-regex": "0.2.1" } }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, "jade": { "version": "0.26.3", "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", @@ -3630,14 +3735,14 @@ "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" }, "lolex": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.1.2.tgz", - "integrity": "sha1-JpS5U8nqTQE+W4v7qJHJkQJbJik=" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.1.tgz", + "integrity": "sha512-mQuW55GhduF3ppo+ZRUTz1PRjEh1hS5BbqU7d8D0ez2OKxHDod7StPPeAVKisZR5aLkHZjdGWSL42LSONUJsZw==" }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "1.1.8" } @@ -3688,19 +3793,11 @@ "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", "optional": true, "requires": { - "mkdirp": "0.5.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "ncp": "2.0.0", "rimraf": "2.4.5" } }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "requires": { - "isarray": "0.0.1" - } - }, "rimraf": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", @@ -3709,11 +3806,6 @@ "glob": "6.0.4" } }, - "samsam": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.2.1.tgz", - "integrity": "sha1-7dOQk6MYQ3DLhZJDsr3yVefY6mc=" - }, "sandboxed-module": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-2.0.3.tgz", @@ -3724,25 +3816,31 @@ } }, "sinon": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-3.2.1.tgz", - "integrity": "sha1-2K2r2QBzD9SXeIoCcEnGSwi+kcI=", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.1.3.tgz", + "integrity": "sha512-c7u0ZuvBRX1eXuB4jN3BRCAOGiUTlM8SE3TxbJHrNiHUKL7wonujMOB6Fi1gQc00U91IscFORQHDga/eccqpbw==", "requires": { - "diff": "3.3.1", + "diff": "3.4.0", "formatio": "1.2.0", - "lolex": "2.1.2", - "native-promise-only": "0.8.1", - "nise": "1.0.1", - "path-to-regexp": "1.7.0", - "samsam": "1.2.1", - "text-encoding": "0.6.4", - "type-detect": "4.0.3" + "lodash.get": "4.4.2", + "lolex": "2.3.1", + "nise": "1.2.0", + "supports-color": "4.5.0", + "type-detect": "4.0.5" }, "dependencies": { "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha1-qoVnpu7QPFMfyJ0/cRzQ5SWd7HU=" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==" + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "requires": { + "has-flag": "2.0.0" + } } } }, @@ -3759,15 +3857,10 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=" }, - "timekeeper": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/timekeeper/-/timekeeper-1.0.0.tgz", - "integrity": "sha1-Lziu4elLEd1m2FgP8aqdzGoroNg=" - }, "type-detect": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.3.tgz", - "integrity": "sha1-Dj8mcLRAmbC0bChNE2p+9Jx0wuo=" + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.5.tgz", + "integrity": "sha512-N9IvkQslUGYGC24RkJk1ba99foK6TkwC2FHAEBlQFBP0RxQZS8ZpJuAZcwiY/w9ZJHFQb1aOXBI60OdxhTrwEQ==" } } }, @@ -3816,6 +3909,11 @@ "libmime": "2.0.0" } }, + "mandrill-api": { + "version": "1.0.45", + "resolved": "https://registry.npmjs.org/mandrill-api/-/mandrill-api-1.0.45.tgz", + "integrity": "sha1-Fjk5z0hr0YJ3sPO69BLD5l2Epy0=" + }, "marked": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", @@ -3929,8 +4027,7 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -4309,11 +4406,6 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.3.5.tgz", "integrity": "sha1-gioNwmYpDOTNOhIoLKPn42Rmigg=" }, - "native-promise-only": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", - "integrity": "sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE=" - }, "nconf": { "version": "0.6.9", "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.6.9.tgz", @@ -4355,14 +4447,15 @@ "integrity": "sha1-Jp1cR2gQ7JLtvntsLygxY4T5p+g=" }, "nise": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.0.1.tgz", - "integrity": "sha1-DakrEKhU6XwPSW9sKEWjASgLPu8=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.2.0.tgz", + "integrity": "sha512-q9jXh3UNsMV28KeqI43ILz5+c3l+RiNW8mhurEwCKckuHQbL+hTJIKKTiUlCPKlgQ/OukFvSnKB/Jk3+sFbkGA==", "requires": { "formatio": "1.2.0", - "just-extend": "1.1.22", + "just-extend": "1.1.27", "lolex": "1.6.0", - "path-to-regexp": "1.7.0" + "path-to-regexp": "1.7.0", + "text-encoding": "0.6.4" }, "dependencies": { "formatio": { @@ -4408,7 +4501,7 @@ "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.30.tgz", "integrity": "sha1-ZNMHOm9XMANxfM/jDIkCMpe6u6E=", "requires": { - "mkdirp": "0.5.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "nopt": "3.0.6", "npmlog": "4.1.2", "rc": "1.1.7", @@ -4477,6 +4570,23 @@ "resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.2.1.tgz", "integrity": "sha1-78GM7CBbT/BR0gWHPXkGStGFCeM=" }, + "nodemailer-mandrill-transport": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/nodemailer-mandrill-transport/-/nodemailer-mandrill-transport-1.2.0.tgz", + "integrity": "sha1-aZaQKdJZtGkhzBLbcMoVUb85SwQ=", + "requires": { + "addressparser": "1.0.1", + "extend": "3.0.1", + "mandrill-api": "1.0.45" + }, + "dependencies": { + "addressparser": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/addressparser/-/addressparser-1.0.1.tgz", + "integrity": "sha1-R6++GiqSYhkdtoOOT9HTm0CCF0Y=" + } + } + }, "nodemailer-sendgrid-transport": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/nodemailer-sendgrid-transport/-/nodemailer-sendgrid-transport-0.2.0.tgz", @@ -5042,7 +5152,6 @@ "requires": { "assert-plus": "0.1.5", "bunyan": "0.22.1", - "dtrace-provider": "0.2.8", "once": "1.3.0", "vasync": "1.4.0" }, @@ -5464,9 +5573,9 @@ } }, "redis": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/redis/-/redis-0.10.1.tgz", - "integrity": "sha1-TwkliTHZYTdyOf29SV4dmaJjqOw=" + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/redis/-/redis-0.12.1.tgz", + "integrity": "sha1-ZN92rQ/IrOuuvSoGReikj6xJGF4=" }, "redis-commands": { "version": "1.3.1", @@ -5500,67 +5609,24 @@ } }, "redis-sharelatex": { - "version": "git+https://github.com/sharelatex/redis-sharelatex.git#143b7eb192675f36d835080e534a4ac4899f918a", + "version": "git+https://github.com/sharelatex/redis-sharelatex.git#ca4e906559c1405d132e8edd7db763d64a57be62", "requires": { - "async": "2.5.0", - "chai": "1.9.1", + "async": "2.6.0", "coffee-script": "1.8.0", - "grunt": "0.4.5", - "grunt-contrib-coffee": "0.11.1", - "grunt-mocha-test": "0.12.0", - "ioredis": "2.5.0", - "mocha": "1.21.4", + "ioredis": "3.2.2", "redis": "0.12.1", "redis-sentinel": "0.1.1", - "sandboxed-module": "1.0.1", - "sinon": "1.10.3", "underscore": "1.7.0" }, "dependencies": { - "ansi-regex": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=" - }, - "ansi-styles": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", - "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=" - }, - "assertion-error": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.0.tgz", - "integrity": "sha1-x/hUOP3UZrx8oWq5DIFRN5el0js=" - }, "async": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", - "integrity": "sha1-hDGQ/WtzV6C54clW7d3V7IRitU0=", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", "requires": { "lodash": "4.17.4" } }, - "chai": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-1.9.1.tgz", - "integrity": "sha1-NxG7ZwbhVo80wLNgmL+PGUVcga4=", - "requires": { - "assertion-error": "1.0.0", - "deep-eql": "0.1.3" - } - }, - "chalk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", - "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", - "requires": { - "ansi-styles": "1.1.0", - "escape-string-regexp": "1.0.5", - "has-ansi": "0.1.0", - "strip-ansi": "0.3.0", - "supports-color": "0.2.0" - } - }, "coffee-script": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.8.0.tgz", @@ -5569,249 +5635,11 @@ "mkdirp": "0.3.5" } }, - "commander": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.0.0.tgz", - "integrity": "sha1-0bhvkB+LZL2UG96tr5JFMDk76Sg=" - }, - "deep-eql": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", - "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", - "requires": { - "type-detect": "0.1.1" - } - }, - "formatio": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.0.2.tgz", - "integrity": "sha1-55kcoUT/fYz/B7uayGqbeca6R+8=", - "requires": { - "samsam": "1.1.3" - } - }, - "fs-extra": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.11.1.tgz", - "integrity": "sha1-3xBPlMyEHu+Pr+KkRsiPXTW7Lnk=", - "requires": { - "jsonfile": "2.4.0", - "mkdirp": "0.5.1", - "ncp": "0.6.0", - "rimraf": "2.6.2" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - } - } - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.3.3", - "path-is-absolute": "1.0.1" - } - }, - "growl": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.8.1.tgz", - "integrity": "sha1-Sy3sjZB+k9szZiTc7AGDUC+MlCg=" - }, - "grunt-contrib-coffee": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/grunt-contrib-coffee/-/grunt-contrib-coffee-0.11.1.tgz", - "integrity": "sha1-+v48nuikQryNF9WlwZ/I5i2fP0U=", - "requires": { - "chalk": "0.5.1", - "coffee-script": "1.7.1", - "lodash": "2.4.2" - }, - "dependencies": { - "coffee-script": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.7.1.tgz", - "integrity": "sha1-YplqhheAx15tUGnROCJyO3NAS/w=", - "requires": { - "mkdirp": "0.3.5" - } - }, - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - } - } - }, - "grunt-mocha-test": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/grunt-mocha-test/-/grunt-mocha-test-0.12.0.tgz", - "integrity": "sha1-nQu5enkEQIr9x64qAj3X1rJg5uM=", - "requires": { - "fs-extra": "0.11.1", - "hooker": "0.2.3" - } - }, - "has-ansi": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", - "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", - "requires": { - "ansi-regex": "0.2.1" - } - }, - "jade": { - "version": "0.26.3", - "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", - "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", - "requires": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "dependencies": { - "commander": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", - "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=" - }, - "mkdirp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", - "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=" - } - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "requires": { - "graceful-fs": "4.1.11" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "requires": { - "brace-expansion": "1.1.8" - } - }, "mkdirp": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=" }, - "mocha": { - "version": "1.21.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-1.21.4.tgz", - "integrity": "sha1-531pw3c7o+K0/mtijCi13UOICtw=", - "requires": { - "commander": "2.0.0", - "debug": "1.0.5", - "diff": "1.0.7", - "glob": "3.2.3", - "growl": "1.8.1", - "jade": "0.26.3", - "mkdirp": "0.3.5" - }, - "dependencies": { - "glob": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz", - "integrity": "sha1-4xPusknHr/qlxHUoaw4RW1mDlGc=", - "requires": { - "graceful-fs": "2.0.3", - "inherits": "2.0.3", - "minimatch": "0.2.14" - } - }, - "graceful-fs": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", - "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=" - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } - } - }, - "ncp": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.6.0.tgz", - "integrity": "sha1-34zgIeJiviG1L+s9Plz6qxJJHw0=" - }, - "redis": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/redis/-/redis-0.12.1.tgz", - "integrity": "sha1-ZN92rQ/IrOuuvSoGReikj6xJGF4=" - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", - "requires": { - "glob": "7.1.2" - } - }, - "samsam": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.1.3.tgz", - "integrity": "sha1-n1CHQZtNCR8jJXHn+lLpCw9VJiE=" - }, - "sandboxed-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-1.0.1.tgz", - "integrity": "sha1-/XVEsYgexul8kd8r0CE8Nbj8P0s=", - "requires": { - "require-like": "0.1.2", - "stack-trace": "0.0.9" - } - }, - "sinon": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-1.10.3.tgz", - "integrity": "sha1-wGPg6Z2DJ9wZkROqtS64Oi6ePCw=", - "requires": { - "formatio": "1.0.2", - "util": "0.10.3" - } - }, - "strip-ansi": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", - "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", - "requires": { - "ansi-regex": "0.2.1" - } - }, - "supports-color": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", - "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=" - }, - "type-detect": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", - "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=" - }, "underscore": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", @@ -5829,12 +5657,6 @@ "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" }, - "regexp-quote": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/regexp-quote/-/regexp-quote-0.0.0.tgz", - "integrity": "sha1-Hg9GUMhi3L/tVP1CsUjpuxch/PI=", - "dev": true - }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -6038,14 +5860,73 @@ } }, "sanitize-html": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.14.1.tgz", - "integrity": "sha1-cw/6Ikm98YMz7/5FsoYXPJxa0Lg=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.16.1.tgz", + "integrity": "sha512-w3++cRkD2krVl8Zn70l7OcrF+zQc6lF0EVzCrcyFA3LR3AofZb2AuC3HRWyyNq225kSvl5K7IxSpQMkTQ+bHkw==", "dev": true, "requires": { "htmlparser2": "3.9.2", - "regexp-quote": "0.0.0", + "lodash.clonedeep": "4.5.0", + "lodash.escaperegexp": "4.1.2", + "lodash.isarray": "4.0.0", + "lodash.mergewith": "4.6.0", + "postcss": "6.0.14", + "srcset": "1.0.0", "xtend": "4.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } } }, "sanitizer": { @@ -6321,6 +6202,16 @@ "amdefine": "1.0.1" } }, + "srcset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", + "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", + "dev": true, + "requires": { + "array-uniq": "1.0.3", + "number-is-nan": "1.0.1" + } + }, "sshpk": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", @@ -6773,6 +6664,29 @@ } } }, + "translations-sharelatex": { + "version": "git+https://github.com/sharelatex/translations-sharelatex.git#507b6b945bedc604f5db7185ad66386209f95c18", + "dev": true, + "requires": { + "async": "2.6.0", + "coffee-script": "1.12.4", + "i18next": "1.7.10", + "onesky": "0.1.6", + "sanitize-html": "1.16.1", + "underscore": "1.6.0" + }, + "dependencies": { + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + } + } + }, "tsscmp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.5.tgz", @@ -6807,11 +6721,6 @@ "mime-types": "2.1.17" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, "uglify-js": { "version": "2.4.24", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz", @@ -6893,6 +6802,7 @@ "version": "0.10.3", "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, "requires": { "inherits": "2.0.1" }, @@ -6900,7 +6810,8 @@ "inherits": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true } } }, @@ -6918,7 +6829,7 @@ "async": "0.2.10", "deep-equal": "1.0.1", "i": "0.3.5", - "mkdirp": "0.5.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "ncp": "0.4.2", "rimraf": "2.2.6" }, @@ -7000,7 +6911,7 @@ "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.37.tgz", "integrity": "sha1-PIcrI2suJm5BQFeP4e6I9pMyOgU=", "requires": { - "mkdirp": "0.5.1", + "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "nopt": "4.0.1", "npmlog": "4.1.2", "rc": "1.1.7", diff --git a/services/web/package.json b/services/web/package.json index 59087dfa89..a1cf0fd6e0 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -56,6 +56,7 @@ "multer": "^0.1.8", "node-html-encoder": "0.0.2", "nodemailer": "2.1.0", + "nodemailer-mandrill-transport": "^1.2.0", "nodemailer-sendgrid-transport": "^0.2.0", "nodemailer-ses-transport": "^1.3.0", "optimist": "0.6.1", diff --git a/services/web/public/coffee/directives/asyncForm.coffee b/services/web/public/coffee/directives/asyncForm.coffee index 0e6ae19ec2..15e3c9b3fe 100644 --- a/services/web/public/coffee/directives/asyncForm.coffee +++ b/services/web/public/coffee/directives/asyncForm.coffee @@ -2,7 +2,7 @@ define [ "base" "libs/passfield" ], (App) -> - App.directive "asyncForm", ($http) -> + App.directive "asyncForm", ($http, validateCaptcha) -> return { controller: ['$scope', ($scope) -> @getEmail = () -> @@ -17,11 +17,23 @@ define [ element.on "submit", (e) -> e.preventDefault() + validateCaptchaIfEnabled (response) -> + submitRequest response + validateCaptchaIfEnabled = (callback = (response) ->) -> + if attrs.captcha? + validateCaptcha callback + else + callback() + + submitRequest = (grecaptchaResponse) -> formData = {} for data in element.serializeArray() formData[data.name] = data.value + if grecaptchaResponse? + formData['g-recaptcha-response'] = grecaptchaResponse + scope[attrs.name].inflight = true # for asyncForm prevent automatic redirect to /login if diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 728300456c..dbf6a2724e 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -33,6 +33,7 @@ define [ "directives/expandableTextArea" "directives/videoPlayState" "services/queued-http" + "services/validateCaptcha" "filters/formatDate" "main/event" "main/account-upgrade" @@ -76,6 +77,8 @@ define [ pdfWidth: 0 reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}") miniReviewPanelVisible: false + chatResizerSizeOpen: window.uiConfig.chatResizerSizeOpen + chatResizerSizeClosed: window.uiConfig.chatResizerSizeClosed } $scope.onboarding = { autoCompile: if window.showAutoCompileOnboarding then 'unseen' else 'dismissed' diff --git a/services/web/public/coffee/ide/directives/layout.coffee b/services/web/public/coffee/ide/directives/layout.coffee index 21d9230b52..fcc75b29a1 100644 --- a/services/web/public/coffee/ide/directives/layout.coffee +++ b/services/web/public/coffee/ide/directives/layout.coffee @@ -11,12 +11,12 @@ define [ if attrs.spacingOpen? spacingOpen = parseInt(attrs.spacingOpen, 10) else - spacingOpen = 24 + spacingOpen = window.uiConfig.defaultResizerSizeOpen if attrs.spacingClosed? spacingClosed = parseInt(attrs.spacingClosed, 10) else - spacingClosed = 24 + spacingClosed = window.uiConfig.defaultResizerSizeClosed options = spacing_open: spacingOpen @@ -44,6 +44,12 @@ define [ if !attrs.minimumRestoreSizeWest? or (state.west.size >= attrs.minimumRestoreSizeWest and !state.west.initClosed) options.west = state.west + if window.uiConfig.eastResizerCursor? + options.east.resizerCursor = window.uiConfig.eastResizerCursor + + if window.uiConfig.westResizerCursor? + options.west.resizerCursor = window.uiConfig.westResizerCursor + repositionControls = () -> state = element.layout().readState() if state.east? @@ -53,9 +59,7 @@ define [ else controls.show() controls.css({ - position: "absolute" right: state.east.size - "z-index": 3 }) resetOpenStates = () -> @@ -112,7 +116,7 @@ define [ # Set the panel as overflowing (gives it higher z-index and sets overflow rules) layoutObj.allowOverflow overflowPane # Read the given z-index value and increment it, so that it's higher than synctex controls. - overflowPaneZVal = overflowPaneEl.css "z-index" + overflowPaneZVal = overflowPaneEl.zIndex() overflowPaneEl.css "z-index", overflowPaneZVal + 1 resetOpenStates() diff --git a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee index 789f6272ca..0c16dcbb39 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareProjectModalController.coffee @@ -1,7 +1,7 @@ define [ "base" ], (App) -> - App.controller "ShareProjectModalController", ($scope, $modalInstance, $timeout, projectMembers, projectInvites, $modal, $http, ide) -> + App.controller "ShareProjectModalController", ($scope, $modalInstance, $timeout, projectMembers, projectInvites, $modal, $http, ide, validateCaptcha) -> $scope.inputs = { privileges: "readAndWrite" contacts: [] @@ -100,7 +100,7 @@ define [ if email in currentInviteEmails and inviteId = _.find(($scope.project.invites || []), (invite) -> invite.email == email)?._id request = projectInvites.resendInvite(inviteId) else - request = projectInvites.sendInvite(email, $scope.inputs.privileges) + request = projectInvites.sendInvite(email, $scope.inputs.privileges, $scope.grecaptchaResponse) request .then (response) -> @@ -135,7 +135,9 @@ define [ else $scope.state.errorReason = null - $timeout addMembers, 50 # Give email list a chance to update + validateCaptcha (response) -> + $scope.grecaptchaResponse = response + $timeout addMembers, 50 # Give email list a chance to update $scope.removeMember = (member) -> $scope.state.error = null @@ -210,6 +212,8 @@ define [ $scope.cancel = () -> $modalInstance.dismiss() + + App.controller "MakePublicModalController", ["$scope", "$modalInstance", "settings", ($scope, $modalInstance, settings) -> $scope.inputs = { privileges: "readAndWrite" @@ -244,4 +248,4 @@ define [ $scope.cancel = () -> $modalInstance.dismiss() - ] + ] \ No newline at end of file diff --git a/services/web/public/coffee/ide/share/services/projectInvites.coffee b/services/web/public/coffee/ide/share/services/projectInvites.coffee index 4c0d30add6..84757915df 100644 --- a/services/web/public/coffee/ide/share/services/projectInvites.coffee +++ b/services/web/public/coffee/ide/share/services/projectInvites.coffee @@ -4,11 +4,12 @@ define [ App.factory "projectInvites", ["ide", "$http", (ide, $http) -> return { - sendInvite: (email, privileges) -> + sendInvite: (email, privileges, grecaptchaResponse) -> $http.post("/project/#{ide.project_id}/invite", { email: email privileges: privileges _csrf: window.csrfToken + 'g-recaptcha-response': grecaptchaResponse }) revokeInvite: (inviteId) -> diff --git a/services/web/public/coffee/main.coffee b/services/web/public/coffee/main.coffee index 5ad6f37d34..e361f583c8 100644 --- a/services/web/public/coffee/main.coffee +++ b/services/web/public/coffee/main.coffee @@ -30,6 +30,7 @@ define [ "directives/maxHeight" "directives/creditCards" "services/queued-http" + "services/validateCaptcha" "filters/formatDate" "__MAIN_CLIENTSIDE_INCLUDES__" ], () -> diff --git a/services/web/public/coffee/services/validateCaptcha.coffee b/services/web/public/coffee/services/validateCaptcha.coffee new file mode 100644 index 0000000000..7dfc038fbc --- /dev/null +++ b/services/web/public/coffee/services/validateCaptcha.coffee @@ -0,0 +1,24 @@ +define [ + "base" +], (App) -> + App.factory "validateCaptcha", () -> + _recaptchaCallbacks = [] + onRecaptchaSubmit = (token) -> + for cb in _recaptchaCallbacks + cb(token) + _recaptchaCallbacks = [] + + recaptchaId = null + validateCaptcha = (callback = (response) ->) => + if !grecaptcha? + return callback() + reset = () -> + grecaptcha.reset() + _recaptchaCallbacks.push callback + _recaptchaCallbacks.push reset + if !recaptchaId? + el = $('#recaptcha')[0] + recaptchaId = grecaptcha.render(el, {callback: onRecaptchaSubmit}) + grecaptcha.execute(recaptchaId) + + return validateCaptcha diff --git a/services/web/public/stylesheets/_ol_style_includes.less b/services/web/public/stylesheets/_ol_style_includes.less new file mode 100644 index 0000000000..c8505c2e56 --- /dev/null +++ b/services/web/public/stylesheets/_ol_style_includes.less @@ -0,0 +1 @@ +@import "app/sidebar-v1-dash-link.less"; diff --git a/services/web/public/stylesheets/app/base.less b/services/web/public/stylesheets/app/base.less index 7f2d9a55ed..2f7b939fda 100644 --- a/services/web/public/stylesheets/app/base.less +++ b/services/web/public/stylesheets/app/base.less @@ -104,3 +104,7 @@ -ms-transform-origin: center bottom; transform-origin: center bottom; } + +.grecaptcha-badge { + display: none; +} \ No newline at end of file diff --git a/services/web/public/stylesheets/app/editor.less b/services/web/public/stylesheets/app/editor.less index e37d829710..9224dbe181 100644 --- a/services/web/public/stylesheets/app/editor.less +++ b/services/web/public/stylesheets/app/editor.less @@ -14,6 +14,9 @@ @import "./editor/review-panel.less"; @import "./editor/feature-onboarding.less"; +@ui-layout-toggler-def-height: 50px; +@ui-resizer-extra-hit-area: 8px; + @keyframes blink { 0% { opacity: 0.2; @@ -261,9 +264,9 @@ } } -.ui-layout-resizer { +.ui-layout-resizer when (@is-overleaf = false) { width: 6px; - background-color: #f4f4f4; + background-color: @editor-resizer-bg-color; border-left: 1px solid @editor-border-color; border-right: 1px solid @editor-border-color; .ui-layout-toggler { @@ -276,28 +279,117 @@ -moz-osx-font-smoothing: grayscale; font-size: 16px !important; line-height: 50px; + background-color: @editor-toggler-bg-color; &:hover { - background-color: #ddd; + background-color: @editor-toggler-hover-bg-color; color: #333; } } } -.ui-layout-resizer-west.ui-layout-resizer-open, .ui-layout-resizer-east.ui-layout-resizer-closed { + +.ui-layout-resizer when (@is-overleaf = true) { + margin-left: -(@ui-resizer-extra-hit-area) !important; + margin-right: -(@ui-resizer-extra-hit-area - 1px) !important; + padding-left: @ui-resizer-extra-hit-area !important; + padding-right: @ui-resizer-extra-hit-area !important; + z-index: 5 !important; + box-sizing: content-box; + background-image: linear-gradient(90deg, + transparent, + transparent (@ui-resizer-extra-hit-area - 1px), + @editor-resizer-bg-color (@ui-resizer-extra-hit-area - 1px), + @editor-resizer-bg-color (@ui-resizer-extra-hit-area + 1px), + transparent (@ui-resizer-extra-hit-area + 1px), + transparent); + .ui-layout-toggler { + padding: 0 @ui-resizer-extra-hit-area !important; + background-image: linear-gradient(90deg, + transparent, + transparent (@ui-resizer-extra-hit-area - 1px), + @editor-toggler-bg-color (@ui-resizer-extra-hit-area - 1px), + @editor-toggler-bg-color (@ui-resizer-extra-hit-area + 1px), + transparent (@ui-resizer-extra-hit-area + 1px), + transparent); + + &:hover { + background-image: linear-gradient(90deg, + transparent, + transparent (@ui-resizer-extra-hit-area - 2px), + @editor-toggler-hover-bg-color (@ui-resizer-extra-hit-area - 2px), + @editor-toggler-hover-bg-color (@ui-resizer-extra-hit-area + 2px), + transparent (@ui-resizer-extra-hit-area + 2px), + transparent); + } + } +} + +.ui-layout-resizer-west.ui-layout-resizer-open, .ui-layout-resizer-east.ui-layout-resizer-closed { + .ui-layout-toggler when (@is-overleaf = false) { &:before { content: "\f104" } } } .ui-layout-resizer-east.ui-layout-resizer-open, .ui-layout-resizer-west.ui-layout-resizer-closed { - .ui-layout-toggler { + .ui-layout-toggler when (@is-overleaf = false) { &:before { content: "\f105" } } } + +.ui-layout-toggler.ui-layout-toggler-closed when (@is-overleaf = true) { + background-color: @editor-resizer-bg-color; + background-image: none; + line-height: @ui-layout-toggler-def-height; + + &::before { + content: "\22EE"; // Vertical ellipsis + display: block; + color: #FFF; + font-weight: 700; + font-size: @font-size-h2; + width: @ui-resizer-extra-hit-area / 2; + } + &:hover { + background-color: @editor-toggler-hover-bg-color; + background-image: none; + } + .ui-layout-resizer-west > & { + border-radius: 0 @border-radius-base @border-radius-base 0; + &::before { + margin-left: -2px; + } + } + .ui-layout-resizer-east > & { + border-radius: @border-radius-base 0 0 @border-radius-base; + &::before { + margin-left: (-1 - @ui-resizer-extra-hit-area); + } + } +} + +.ui-layout-toggler-east when (@is-overleaf = true) { + &.ui-layout-toggler-open { + cursor: e-resize !important + } + &.ui-layout-toggler-closed { + cursor: w-resize !important + } +} + +.ui-layout-toggler-west when (@is-overleaf = true) { + &.ui-layout-toggler-open { + cursor: w-resize !important + } + &.ui-layout-toggler-closed { + cursor: e-resize !important + } +} + .ui-layout-resizer-dragging { - background-color: #ddd; + background-color: @editor-resizer-bg-color-dragging; } .context-menu { diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index a873cd5e8f..e602d2d99b 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -229,14 +229,69 @@ } .synctex-controls { + position: absolute; + z-index: @synctex-controls-z-index; + padding: @synctex-controls-padding; top: 68px; - padding: 0px 2px; - .btn-xs { - line-height: 1.3; - padding: 0 2px 0; - } } +.synctex-controls when (@is-overleaf = true) { + margin-right: -11px; +} + .synctex-control { + display: block; + margin-bottom: 3px; + + > .synctex-control-icon { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + } + + .synctex-control when (@is-overleaf = true) { + @ol-synctex-control-size: 24px; + display: flex; + align-items: center; + justify-content: center; + font-size: 1em; + width: @ol-synctex-control-size; + height: @ol-synctex-control-size; + border-radius: @ol-synctex-control-size / 2; + padding: 0 0 2px; + background-color: fade(@btn-default-bg, 80%); + transition: background 0.15s ease; + margin-bottom: @ol-synctex-control-size / 2; + } + + .synctex-control when (@is-overleaf = false) { + line-height: 1.3; + padding: 0 2px; + } + + .synctex-control-goto-pdf > .synctex-control-icon when (@is-overleaf = true) { + text-indent: 1px; // "Optical" adjustment. + &::before { + content: "\f061"; + } + } + .synctex-control-goto-code > .synctex-control-icon when (@is-overleaf = true) { + text-indent: -1px; // "Optical" adjustment. + &::before { + content: "\f060"; + } + } + + .synctex-control-goto-pdf > .synctex-control-icon::before when (@is-overleaf = false) { + content: "\f178"; + } + .synctex-control-goto-code > .synctex-control-icon::before when (@is-overleaf = false) { + content: "\f177"; + } + .editor-dark { .pdf-logs { background-color: lighten(@editor-dark-background-color, 10%); diff --git a/services/web/public/stylesheets/app/project-list.less b/services/web/public/stylesheets/app/project-list.less index 732b2e7903..1c3c4490ae 100644 --- a/services/web/public/stylesheets/app/project-list.less +++ b/services/web/public/stylesheets/app/project-list.less @@ -57,7 +57,6 @@ } .project-list-sidebar when (@is-overleaf) { - height: 100%; overflow-x: hidden; overflow-y: auto; -ms-overflow-style: -ms-autohiding-scrollbar; diff --git a/services/web/public/stylesheets/app/sidebar-v1-dash-link.less b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less new file mode 100644 index 0000000000..072042226e --- /dev/null +++ b/services/web/public/stylesheets/app/sidebar-v1-dash-link.less @@ -0,0 +1,32 @@ +@v1-dash-link-height: 130px; + +.project-list-sidebar { + height: calc(~"100% -" @v1-dash-link-height); +} + +.project-list-sidebar-v1-link { + position: absolute; + bottom: 0; + height: @v1-dash-link-height; + background-color: @v1-dash-link-bg; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + color: white; +} + + .project-list-sidebar-v1-link a { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 12.5px; + padding-top: 0; + padding-bottom: 0; + background-color: @v1-dash-link-btn-bg; + color: #fff; + } + + .project-list-sidebar-v1-link a:hover { + background-color: @v1-dash-link-btn-hover-bg; + } \ No newline at end of file diff --git a/services/web/public/stylesheets/core/_common-variables.less b/services/web/public/stylesheets/core/_common-variables.less index acf6bcc91f..ab3ef2ccc9 100644 --- a/services/web/public/stylesheets/core/_common-variables.less +++ b/services/web/public/stylesheets/core/_common-variables.less @@ -889,34 +889,42 @@ @footer-padding : 2em; // Editor header -@toolbar-header-bg-color : transparent; -@toolbar-header-shadow : 0 0 2px #ccc; -@toolbar-btn-color : @link-color; -@toolbar-btn-hover-color : @link-hover-color; -@toolbar-btn-hover-bg-color : darken(white, 10%); -@toolbar-btn-hover-text-shadow : 0 1px 0 rgba(0, 0, 0, 0.15); -@toolbar-btn-active-color : white; -@toolbar-btn-active-bg-color : @link-color; -@toolbar-btn-active-shadow : inset 0 3px 5px rgba(0, 0, 0, 0.225); -@toolbar-alt-bg-color : #fafafa; -@toolbar-icon-btn-color : @gray-light; -@toolbar-icon-btn-hover-color : @gray-dark; -@toolbar-icon-btn-hover-shadow : 0 1px 0 rgba(0, 0, 0, 0.25); +@toolbar-header-bg-color : transparent; +@toolbar-header-shadow : 0 0 2px #ccc; +@toolbar-btn-color : @link-color; +@toolbar-btn-hover-color : @link-hover-color; +@toolbar-btn-hover-bg-color : darken(white, 10%); +@toolbar-btn-hover-text-shadow : 0 1px 0 rgba(0, 0, 0, 0.15); +@toolbar-btn-active-color : white; +@toolbar-btn-active-bg-color : @link-color; +@toolbar-btn-active-shadow : inset 0 3px 5px rgba(0, 0, 0, 0.225); +@toolbar-alt-bg-color : #fafafa; +@toolbar-icon-btn-color : @gray-light; +@toolbar-icon-btn-hover-color : @gray-dark; +@toolbar-icon-btn-hover-shadow : 0 1px 0 rgba(0, 0, 0, 0.25); @toolbar-icon-btn-hover-boxshadow : inset 0 3px 5px rgba(0, 0, 0, 0.225); -@toolbar-border-bottom : 1px solid @toolbar-border-color; +@toolbar-border-bottom : 1px solid @toolbar-border-color; // Editor file-tree -@file-tree-bg : transparent; -@file-tree-line-height : 2.6; -@file-tree-item-color : @gray-darker; -@file-tree-item-toggle-color : @gray; -@file-tree-item-icon-color : @gray-light; -@file-tree-item-input-color : inherit; -@file-tree-item-folder-color : lighten(desaturate(@link-color, 10%), 5%); -@file-tree-item-hover-bg : @gray-lightest; -@file-tree-item-selected-bg : transparent; -@file-tree-multiselect-bg : lighten(@brand-info, 40%); -@file-tree-multiselect-hover-bg : lighten(@brand-info, 30%); +@file-tree-bg : transparent; +@file-tree-line-height : 2.6; +@file-tree-item-color : @gray-darker; +@file-tree-item-toggle-color : @gray; +@file-tree-item-icon-color : @gray-light; +@file-tree-item-input-color : inherit; +@file-tree-item-folder-color : lighten(desaturate(@link-color, 10%), 5%); +@file-tree-item-hover-bg : @gray-lightest; +@file-tree-item-selected-bg : transparent; +@file-tree-multiselect-bg : lighten(@brand-info, 40%); +@file-tree-multiselect-hover-bg : lighten(@brand-info, 30%); + +// Editor resizers +@editor-resizer-bg-color : #F4F4F4; +@editor-resizer-bg-color-dragging : #ddd; +@editor-toggler-bg-color : transparent; +@editor-toggler-hover-bg-color : #DDD; +@synctex-controls-z-index : 3; +@synctex-controls-padding : 0 2px; // Tags @tag-border-radius : 0.25em; @tag-bg-color : @label-default-bg; diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index 5c15ad2d3d..508ae6ed37 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -110,6 +110,9 @@ @sidebar-active-bg : @ol-blue-gray-6; @sidebar-hover-bg : @ol-blue-gray-4; @sidebar-hover-text-decoration : none; +@v1-dash-link-bg : @ol-blue-gray-4; +@v1-dash-link-btn-bg : @ol-blue-gray-5; +@v1-dash-link-btn-hover-bg : @ol-blue-gray-6; @folders-menu-margin : 0 -(@grid-gutter-width / 2); @folders-menu-line-height : @structured-list-line-height; @@ -171,23 +174,28 @@ @toolbar-icon-btn-color : #FFF; @toolbar-icon-btn-hover-color : #FFF; @toolbar-icon-btn-hover-shadow : none; -@toolbar-icon-btn-hover-boxshadow : none; @toolbar-border-bottom : 1px solid @toolbar-border-color; +@toolbar-icon-btn-hover-boxshadow : none; // Editor file-tree -@file-tree-bg : @ol-blue-gray-4; -@file-tree-line-height : 2.05; -@file-tree-item-color : #FFF; -@file-tree-item-input-color : @ol-blue-gray-5; -@file-tree-item-toggle-color : @ol-blue-gray-2; -@file-tree-item-icon-color : @ol-blue-gray-2; -@file-tree-item-folder-color : @ol-blue-gray-2; -@file-tree-item-hover-bg : @ol-blue-gray-5; -@file-tree-item-selected-bg : @ol-green; -@file-tree-multiselect-bg : @ol-blue; -@file-tree-multiselect-hover-bg : @ol-dark-blue; -@file-tree-droppable-bg-color : tint(@ol-green, 5%); -//== Colors -// +@file-tree-bg : @ol-blue-gray-4; +@file-tree-line-height : 2.05; +@file-tree-item-color : #FFF; +@file-tree-item-input-color : @ol-blue-gray-5; +@file-tree-item-toggle-color : @ol-blue-gray-2; +@file-tree-item-icon-color : @ol-blue-gray-2; +@file-tree-item-folder-color : @ol-blue-gray-2; +@file-tree-item-hover-bg : @ol-blue-gray-5; +@file-tree-item-selected-bg : @ol-green; +@file-tree-multiselect-bg : @ol-blue; +@file-tree-multiselect-hover-bg : @ol-dark-blue; +@file-tree-droppable-bg-color : tint(@ol-green, 5%); +// Editor resizers +@editor-resizer-bg-color : @ol-blue-gray-6; +@editor-resizer-bg-color-dragging : transparent; +@editor-toggler-bg-color : @ol-blue-gray-2; +@editor-toggler-hover-bg-color : @ol-green; +@synctex-controls-z-index : 6; +@synctex-controls-padding : 0; //## Gray and brand colors for use across Bootstrap. @gray-darker: #252525; @gray-dark: #505050; diff --git a/services/web/public/stylesheets/ol-style.less b/services/web/public/stylesheets/ol-style.less index 1e48b7284d..2a9a140611 100644 --- a/services/web/public/stylesheets/ol-style.less +++ b/services/web/public/stylesheets/ol-style.less @@ -1,4 +1,5 @@ // Core variables and mixins @import "core/ol-variables.less"; @import "app/ol-style-guide.less"; -@import "_style_includes.less"; \ No newline at end of file +@import "_style_includes.less"; +@import "_ol_style_includes.less"; \ No newline at end of file diff --git a/services/web/test/unit/coffee/Email/EmailSenderTests.coffee b/services/web/test/unit/coffee/Email/EmailSenderTests.coffee index 84efd2c0ca..958cf208b3 100644 --- a/services/web/test/unit/coffee/Email/EmailSenderTests.coffee +++ b/services/web/test/unit/coffee/Email/EmailSenderTests.coffee @@ -31,6 +31,8 @@ describe "EmailSender", -> @sender = SandboxedModule.require modulePath, requires: 'nodemailer': @ses + "nodemailer-mandrill-transport":{} + "nodemailer-sendgrid-transport":{} "settings-sharelatex":@settings '../../infrastructure/RateLimiter':@RateLimiter "logger-sharelatex":