Yuki Takei 8 лет назад
Родитель
Сommit
11b434589a
3 измененных файлов с 7 добавлено и 43 удалено
  1. 3 3
      lib/util/swigFunctions.js
  2. 0 36
      resource/js/components/Page/PagePath.js
  3. 4 4
      test/models/page.test.js

+ 3 - 3
lib/util/swigFunctions.js

@@ -41,7 +41,7 @@ module.exports = function(crowi, app, req, locals) {
    * return app title
    */
   locals.appTitle = function() {
-    var config = crowi.getConfig()
+    var config = crowi.getConfig();
     return Config.appTitle(config);
   }
 
@@ -49,7 +49,7 @@ module.exports = function(crowi, app, req, locals) {
    * return true if enabled
    */
   locals.isEnabledPassport = function() {
-    var config = crowi.getConfig()
+    var config = crowi.getConfig();
     return Config.isEnabledPassport(config);
   }
 
@@ -137,7 +137,7 @@ module.exports = function(crowi, app, req, locals) {
   }
 
   locals.behaviorType = function() {
-    var config = crowi.getConfig()
+    var config = crowi.getConfig();
     return Config.behaviorType(config);
   }
 

+ 0 - 36
resource/js/components/Page/PagePath.js

@@ -3,42 +3,6 @@ import PropTypes from 'prop-types';
 
 export default class PagePath extends React.Component {
 
-  // Original Crowi.linkPath
-  /*
-  Crowi.linkPath = function(revisionPath) {
-    var $revisionPath = revisionPath || '#revision-path';
-    var $title = $($revisionPath);
-    var pathData = $('#content-main').data('path');
-
-    if (!pathData) {
-      return ;
-    }
-
-    var realPath = pathData.trim();
-    if (realPath.substr(-1, 1) == '/') {
-      realPath = realPath.substr(0, realPath.length - 1);
-    }
-
-    var path = '';
-    var pathHtml = '';
-    var splittedPath = realPath.split(/\//);
-    splittedPath.shift();
-    splittedPath.forEach(function(sub) {
-      path += '/';
-      pathHtml += ' <a href="' + path + '">/</a> ';
-      if (sub) {
-        path += sub;
-        pathHtml += '<a href="' + path + '">' + sub + '</a>';
-      }
-    });
-    if (path.substr(-1, 1) != '/') {
-      path += '/';
-      pathHtml += ' <a href="' + path + '" class="last-path">/</a>';
-    }
-    $title.html(pathHtml);
-  };
-  */
-
   linkPath(path) {
     return path;
   }

+ 4 - 4
test/models/page.test.js

@@ -194,10 +194,10 @@ describe('Page', () => {
       expect(Page.isCreatableName('/hoge/xx.md')).to.be.false;
 
       // start with https?
-      expect(Page.isCreatableName('/http://demo.crowi.wiki/user/sotarok/hoge')).to.be.false;
-      expect(Page.isCreatableName('/https://demo.crowi.wiki/user/sotarok/hoge')).to.be.false;
-      expect(Page.isCreatableName('http://demo.crowi.wiki/user/sotarok/hoge')).to.be.false;
-      expect(Page.isCreatableName('https://demo.crowi.wiki/user/sotarok/hoge')).to.be.false;
+      expect(Page.isCreatableName('/http://demo.growi.org/hoge')).to.be.false;
+      expect(Page.isCreatableName('/https://demo.growi.org/hoge')).to.be.false;
+      expect(Page.isCreatableName('http://demo.growi.org/hoge')).to.be.false;
+      expect(Page.isCreatableName('https://demo.growi.org/hoge')).to.be.false;
 
       expect(Page.isCreatableName('/ the / path / with / space')).to.be.false;