Просмотр исходного кода

include moment in package versions

Brian Gough 10 лет назад
Родитель
Сommit
837151a395

+ 3 - 4
services/web/Gruntfile.coffee

@@ -1,6 +1,5 @@
 fs = require "fs"
 PackageVersions = require "./app/coffee/infrastructure/PackageVersions"
-pdfjs = PackageVersions.lib('pdfjs')
 
 module.exports = (grunt) ->
 	grunt.loadNpmTasks 'grunt-contrib-coffee'
@@ -159,12 +158,12 @@ module.exports = (grunt) ->
 					inlineText: false
 					preserveLicenseComments: false
 					paths:
-						"moment": "libs/moment-2.9.0"
+						"moment": "libs/#{PackageVersions.lib('moment')}"
 						"mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML"
-						"libs/pdf": "libs/#{pdfjs}/pdf"
+						"libs/pdf": "libs/#{PackageVersions.lib('pdfjs')}/pdf"
 					shim:
 						"libs/pdf":
-							deps: ["libs/#{pdfjs}/compatibility"]
+							deps: ["libs/#{PackageVersions.lib('pdfjs')}/compatibility"]
 
 					skipDirOptimize: true
 					modules: [

+ 1 - 0
services/web/app/coffee/infrastructure/PackageVersions.coffee

@@ -1,5 +1,6 @@
 version = {
 	"pdfjs": "1.3.91p1"
+	"moment": "2.9.0"
 }
 
 module.exports = {

+ 6 - 1
services/web/app/views/layout.jade

@@ -126,7 +126,12 @@ html(itemscope, itemtype='http://schema.org/Product')
 				window.requirejs = {
 					"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
 					"paths" : {
-						"moment": "libs/moment-2.7.0"
+						"moment": "libs/#{lib('moment')}"
+					},
+					"config":{
+						"moment":{
+							"noGlobal": true
+						}
 					}
 				};
 			script(

+ 1 - 1
services/web/app/views/project/editor.jade

@@ -101,7 +101,7 @@ block content
 		window.requirejs = {
 			"paths" : {
 				"mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {cdn:false, fingerprint:false, qs:{config:'TeX-AMS_HTML'}})}",
-				"moment": "libs/moment-2.7.0",
+				"moment": "libs/#{lib('moment')}",
 				"libs/pdf": "libs/#{lib('pdfjs')}/pdf",
 				"ace": "#{lib('ace')}"
 			},

+ 2 - 2
services/web/public/coffee/filters/formatDate.coffee

@@ -1,6 +1,6 @@
 define [
 	"base"
-	"libs/moment-2.9.0"
+	"moment"
 ], (App, moment) ->
 	moment.locale "en", calendar:
 		lastDay : '[Yesterday]'
@@ -16,4 +16,4 @@ define [
 
 	App.filter "relativeDate", () ->
 		(date) ->
-			moment(date).calendar()
+			moment(date).calendar()

+ 2 - 1
services/web/public/coffee/ide/track-changes/TrackChangesManager.coffee

@@ -1,8 +1,9 @@
 define [
+	"moment"
 	"ide/track-changes/controllers/TrackChangesListController"
 	"ide/track-changes/controllers/TrackChangesDiffController"
 	"ide/track-changes/directives/infiniteScroll"
-], () ->
+], (moment) ->
 	class TrackChangesManager
 		constructor: (@ide, @$scope) ->
 			@reset()

+ 1 - 1
services/web/public/coffee/libs.coffee

@@ -1,5 +1,5 @@
 define [
-	"libs/moment-2.9.0"
+	"moment"
 	"libs/angular-autocomplete/angular-autocomplete"
 	"libs/ui-bootstrap"
 	"libs/ng-context-menu-0.1.4"