Yuki Takei 8 лет назад
Родитель
Сommit
a8fee6939c

+ 1 - 7
resource/js/components/NewPageNameInputter.js

@@ -1,12 +1,6 @@
 import React from 'react';
-import { FormGroup } from 'react-bootstrap/es/FormGroup';
-import { Button } from 'react-bootstrap/es/Button';
-import { InputGroup } from 'react-bootstrap/es/InputGroup';
-
-import UserPicture from './User/UserPicture';
-import PageListMeta from './PageList/PageListMeta';
-import PagePath from './PageList/PagePath';
 import PropTypes from 'prop-types';
+
 import SearchTypeahead from './SearchTypeahead';
 
 export default class NewPageNameInputter extends React.Component {

+ 2 - 2
resource/js/components/Page.js

@@ -60,7 +60,7 @@ export default class Page extends React.Component {
         return;
       }
       const k = keyword
-            .replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
+            .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
             .replace(/(^"|"$)/g, ''); // for phrase (quoted) keyword
       const keywordExp = new RegExp(`(${k}(?!(.*?")))`, 'ig');
       returnBody = returnBody.replace(keywordExp, '<em class="highlighted">$&</em>');
@@ -117,7 +117,7 @@ export default class Page extends React.Component {
           isMathJaxEnabled={isMathJaxEnabled}
           renderMathJaxOnInit={true}
       />
-    )
+    );
   }
 }
 

+ 8 - 8
resource/js/components/Page/RevisionPath.js

@@ -60,22 +60,22 @@ export default class RevisionPath extends React.Component {
       return <span>/</span>;
     }
     else {
-      return <span></span>
+      return <span></span>;
     }
   }
 
   render() {
     // define styles
     const rootStyle = {
-      marginRight: "0.2em",
-    }
+      marginRight: '0.2em',
+    };
     const separatorStyle = {
-      marginLeft: "0.2em",
-      marginRight: "0.2em",
-    }
+      marginLeft: '0.2em',
+      marginRight: '0.2em',
+    };
     const editButtonStyle = {
-      marginLeft: "0.5em",
-      padding: "0 2px",
+      marginLeft: '0.5em',
+      padding: '0 2px',
     };
 
     const pageLength = this.state.pages.length;

+ 3 - 3
resource/js/components/Page/RevisionUrl.js

@@ -7,12 +7,12 @@ export default class RevisionUrl extends React.Component {
 
   render() {
     const buttonStyle = {
-      fontSize: "1em"
+      fontSize: '1em'
     }
 
     const url = (this.props.pageId == null)
-        ? decodeURIComponent(location.href)
-        : `${location.origin}/${this.props.pageId}`;
+      ? decodeURIComponent(location.href)
+      : `${location.origin}/${this.props.pageId}`;
     const copiedText = this.props.pagePath + '\n' + url;
 
     return (

+ 2 - 2
resource/js/components/PageEditor/Editor.js

@@ -485,7 +485,7 @@ export default class Editor extends React.Component {
                 'Enter': this.handleEnterKey,
                 'Tab': 'indentMore',
                 'Shift-Tab': 'indentLess',
-                'Ctrl-Q': (cm) => { cm.foldCode(cm.getCursor()); },
+                'Ctrl-Q': (cm) => { cm.foldCode(cm.getCursor()) },
               }
             }}
             onScroll={(editor, data) => {
@@ -511,7 +511,7 @@ export default class Editor extends React.Component {
         </Dropzone>
 
         <button type="button" className="btn btn-default btn-block btn-open-dropzone"
-          onClick={() => {this.refs.dropzone.open();}}>
+          onClick={() => {this.refs.dropzone.open()}}>
 
           <i className="icon-paper-clip" aria-hidden="true"></i>&nbsp;
           Attach files by dragging &amp; dropping,&nbsp;

+ 8 - 8
resource/js/components/PageEditor/EmojiAutoCompleteHelper.js

@@ -90,34 +90,34 @@ class EmojiAutoCompleteHelper {
     const maxLength = 12;
 
     let results1 = [], results2 = [], results3 = [], results4 = [];
-    const countLen1 = () => { results1.length; }
-    const countLen2 = () => { countLen1() + results2.length; }
-    const countLen3 = () => { countLen2() + results3.length; }
-    const countLen4 = () => { countLen3() + results4.length; }
+    const countLen1 = () => { results1.length };
+    const countLen2 = () => { countLen1() + results2.length };
+    const countLen3 = () => { countLen2() + results3.length };
+    const countLen4 = () => { countLen3() + results4.length };
     // TODO performance tune
     // when total length of all results is less than `maxLength`
     for (let unicode in this.emojiStrategy) {
       const data = this.emojiStrategy[unicode];
 
-      if (maxLength <= countLen1()) { break; }
+      if (maxLength <= countLen1()) { break }
       // prefix match to shortname
       else if (data.shortname.indexOf(`:${term}`) > -1) {
         results1.push(data.shortname);
         continue;
       }
-      else if (maxLength <= countLen2()) { continue; }
+      else if (maxLength <= countLen2()) { continue }
       // partial match to shortname
       else if (data.shortname.indexOf(term) > -1) {
         results2.push(data.shortname);
         continue;
       }
-      else if (maxLength <= countLen3()) { continue; }
+      else if (maxLength <= countLen3()) { continue }
       // partial match to elements of aliases
       else if ((data.aliases != null) && data.aliases.find(elem => elem.indexOf(term) > -1)) {
         results3.push(data.shortname);
         continue;
       }
-      else if (maxLength <= countLen4()) { continue; }
+      else if (maxLength <= countLen4()) { continue }
       // partial match to elements of keywords
       else if ((data.keywords != null) && data.keywords.find(elem => elem.indexOf(term) > -1)) {
         results4.push(data.shortname);