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

Merge official crowi (master branch)

# Conflicts:
#	npm-shrinkwrap.json
#	package.json
Yuki Takei 8 лет назад
Родитель
Сommit
76c1c22133
4 измененных файлов с 15 добавлено и 6 удалено
  1. 5 2
      .babelrc
  2. 0 1
      package.json
  3. 8 1
      resource/js/legacy/crowi.js
  4. 2 2
      resource/js/util/PostProcessor/Mathjax.js

+ 5 - 2
.babelrc

@@ -1,7 +1,10 @@
 {
 {
   "presets": [
   "presets": [
-    "env",
-    "es2015",
+    ["env", {
+      "targets": {
+        "browsers": ["last 2 versions"]
+      }
+    }],
     "react"
     "react"
   ]
   ]
 }
 }

+ 0 - 1
package.json

@@ -51,7 +51,6 @@
     "babel-core": "^6.24.0",
     "babel-core": "^6.24.0",
     "babel-loader": "^7.0.0",
     "babel-loader": "^7.0.0",
     "babel-preset-env": "^1.4.0",
     "babel-preset-env": "^1.4.0",
-    "babel-preset-es2015": "^6.24.0",
     "babel-preset-react": "^6.23.0",
     "babel-preset-react": "^6.23.0",
     "basic-auth-connect": "~1.0.0",
     "basic-auth-connect": "~1.0.0",
     "body-parser": "^1.17.1",
     "body-parser": "^1.17.1",

+ 8 - 1
resource/js/legacy/crowi.js

@@ -183,13 +183,20 @@ $(function() {
 
 
 
 
   $('#create-page').on('shown.bs.modal', function (e) {
   $('#create-page').on('shown.bs.modal', function (e) {
+    // quick hack: replace from server side rendering "date" to client side "date"
+    var today = new Date();
+    var month = ('0' + (today.getMonth() + 1)).slice(-2);
+    var day = ('0' + today.getDate()).slice(-2);
+    var dateString = today.getFullYear() + '/' + month + '/' + day;
+    $('#create-page-today .page-today-suffix').text('/' + dateString + '/');
+    $('#create-page-today .page-today-input2').data('prefix', '/' + dateString + '/');
 
 
     var input2Width = $('#create-page-today .col-xs-10').outerWidth() - 1;
     var input2Width = $('#create-page-today .col-xs-10').outerWidth() - 1;
     var newWidth = input2Width
     var newWidth = input2Width
       - $('#create-page-today .page-today-prefix').outerWidth()
       - $('#create-page-today .page-today-prefix').outerWidth()
       - $('#create-page-today .page-today-input1').outerWidth()
       - $('#create-page-today .page-today-input1').outerWidth()
       - $('#create-page-today .page-today-suffix').outerWidth()
       - $('#create-page-today .page-today-suffix').outerWidth()
-      - 40
+      - 42
       ;
       ;
     $('#create-page-today .form-control.page-today-input2').css({width: newWidth}).focus();
     $('#create-page-today .form-control.page-today-input2').css({width: newWidth}).focus();
 
 

+ 2 - 2
resource/js/util/PostProcessor/Mathjax.js

@@ -25,8 +25,8 @@ export default class Mathjax {
       extensions: ["tex2jax.js"],
       extensions: ["tex2jax.js"],
       jax: ["input/TeX", "output/SVG"],
       jax: ["input/TeX", "output/SVG"],
       tex2jax: {
       tex2jax: {
-        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
-        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
+        inlineMath: [ ['$','$'] ],
+        displayMath: [ ['$$','$$'] ],
         processEscapes: true
         processEscapes: true
       },
       },
       showMathMenu: false,
       showMathMenu: false,