diff options
| author | Avi Dessauer <avi.the.coder@gmail.com> | 2019-08-21 06:03:31 -0400 | 
|---|---|---|
| committer | Alexey Kiryushin <alexey.a.kiryushin@gmail.com> | 2019-08-21 13:03:31 +0300 | 
| commit | af41ab40e1fc4888d1873a9ffe681ddafdfb4ee0 (patch) | |
| tree | 219315a1ef02ae0d0f21889e7b88e08318b308a2 /javascript/app/components | |
| parent | 5295ac7f7f26c3a43f0fe9b9c826e876b29cf666 (diff) | |
Delete trailing whitespace (#42)
Diffstat (limited to 'javascript/app/components')
| -rw-r--r-- | javascript/app/components/bottom-panel.js | 6 | ||||
| -rw-r--r-- | javascript/app/components/file-tree.js | 30 | ||||
| -rw-r--r-- | javascript/app/components/haskell-module.js | 136 | ||||
| -rw-r--r-- | javascript/app/components/identifier-info.js | 16 | ||||
| -rw-r--r-- | javascript/app/components/identifier-name.js | 4 | ||||
| -rw-r--r-- | javascript/app/components/infinite-list.js | 14 | ||||
| -rw-r--r-- | javascript/app/components/info-window.js | 30 | ||||
| -rw-r--r-- | javascript/app/components/input-with-autocomplete.js | 14 | ||||
| -rw-r--r-- | javascript/app/components/instance-info.js | 2 | ||||
| -rw-r--r-- | javascript/app/components/paginated-list.js | 10 | ||||
| -rw-r--r-- | javascript/app/components/resizable-panel.js | 4 | ||||
| -rw-r--r-- | javascript/app/components/text-file.js | 6 | ||||
| -rw-r--r-- | javascript/app/components/type-signature-text.js | 2 | ||||
| -rw-r--r-- | javascript/app/components/type-signature.js | 8 | 
14 files changed, 141 insertions, 141 deletions
diff --git a/javascript/app/components/bottom-panel.js b/javascript/app/components/bottom-panel.js index 5d8b5bc..6415d0e 100644 --- a/javascript/app/components/bottom-panel.js +++ b/javascript/app/components/bottom-panel.js @@ -1,6 +1,6 @@  import Ember from 'ember'; -function show(component) {   +function show(component) {    const height = Math.floor(component.$containerElement.height() /2);    component.$().css({      "display":"block", @@ -40,13 +40,13 @@ export default Ember.Component.extend({          }        });      }); -  },   +  },    visibilityObserver : Ember.observer('visible',function () {      this.get('visible') ? show(this) : hide(this);    }),    actions : {      close () { -      this.set('visible',false);       +      this.set('visible',false);      }    }  }); diff --git a/javascript/app/components/file-tree.js b/javascript/app/components/file-tree.js index d255229..7c5e112 100644 --- a/javascript/app/components/file-tree.js +++ b/javascript/app/components/file-tree.js @@ -10,7 +10,7 @@ const directoryTreeToJsTree = function (packageId,directoryTree) {        jsTreeNode.a_attr = {href:"/package/" + packageId + "/show/" + node.path};      }      if(node.tag === "Dir") { -      jsTreeNode.children = directoryTreeToJsTree(packageId,node);       +      jsTreeNode.children = directoryTreeToJsTree(packageId,node);        jsTreeNode.state = {"opened" : containsHaskellModule(node)};      } else {        if(node.isHaskellModule) { @@ -25,8 +25,8 @@ const directoryTreeToJsTree = function (packageId,directoryTree) {    });  }; -const containsHaskellModule = function(node) {   -  return node.contents.some((n) => {     +const containsHaskellModule = function(node) { +  return node.contents.some((n) => {      if(n.tag === "File") {        return n.isHaskellModule;      } else { @@ -35,9 +35,9 @@ const containsHaskellModule = function(node) {    });  } -const fileExtension = function (filename) {   -  const idx = filename.lastIndexOf('.');   -  return (idx < 1) ? "" : filename.substr(idx + 1);   +const fileExtension = function (filename) { +  const idx = filename.lastIndexOf('.'); +  return (idx < 1) ? "" : filename.substr(idx + 1);  }  export default Ember.Component.extend({ @@ -49,10 +49,10 @@ export default Ember.Component.extend({      });    }),    didInsertElement : function () { -    this._super(...arguments);     +    this._super(...arguments);      const element = this.element.getElementsByClassName('file-tree')[0];      const component = this; -     +      const jstreeElement = Ember.$(element).jstree({        'core' : {          'data' : directoryTreeToJsTree(this.get('packageId'),this.get('directoryTree')) @@ -69,16 +69,16 @@ export default Ember.Component.extend({        'sort' : function (a,b) {          const node1 = this.get_node(a).data;          const node2 = this.get_node(b).data; -        if(component.get("sortType") === "alphabetical") {           +        if(component.get("sortType") === "alphabetical") {            return node1.name > node2.name; -        } else {           +        } else {            const extendedName1 = (node1.tag === "Dir" ? "0" : "1") + fileExtension(node1.name) + node1.name; -          const extendedName2 = (node2.tag === "Dir" ? "0" : "1") + fileExtension(node2.name) + node2.name;           +          const extendedName2 = (node2.tag === "Dir" ? "0" : "1") + fileExtension(node2.name) + node2.name;            return extendedName1 > extendedName2;          }        }      }); -     +      jstreeElement.on("select_node.jstree",(event,data) => {        const file = data.node.data;        if(file.tag != "Dir") { @@ -86,8 +86,8 @@ export default Ember.Component.extend({        }      }); -    const jstree = jstreeElement.jstree(true);     -             +    const jstree = jstreeElement.jstree(true); +      if(this.get('currentFile')) {        jstree.select_node(this.get('currentFile'));        const node = jstree.get_node(this.get('currentFile'),true)[0]; @@ -111,7 +111,7 @@ export default Ember.Component.extend({      }    }),    actions : { -    hide() {       +    hide() {        this.get('hide')();      }    } diff --git a/javascript/app/components/haskell-module.js b/javascript/app/components/haskell-module.js index 7084510..187e6c5 100644 --- a/javascript/app/components/haskell-module.js +++ b/javascript/app/components/haskell-module.js @@ -19,17 +19,17 @@ function compareLocations (p1,p2) {    }  } -function buildSrcSpan(sourceCodeLines,start,end) {   +function buildSrcSpan(sourceCodeLines,start,end) {    if(sourceCodeLines[start.line] && sourceCodeLines[end.line]) {      if(start.line === end.line) {        return sourceCodeLines[start.line].slice(start.column-1,end.column-1); -    } else {     +    } else {        const firstLine = sourceCodeLines[start.line];        let middleLines = []; -      for(let i = start.line + 1; i < end.line;i ++) {       +      for(let i = start.line + 1; i < end.line;i ++) {          middleLines.push(sourceCodeLines[i]);        } -      const lastLine = sourceCodeLines[end.line];    +      const lastLine = sourceCodeLines[end.line];        const minOffset = Math.min(start.column,                                   (middleLines.concat([lastLine]))                                   .map((line) => line.search(/\S/)) @@ -52,7 +52,7 @@ function modifyClass(element,on) {  }  function highlightIdentifiers(parentElement,identifierElement,on) { -  if(identifierElement.id) {     +  if(identifierElement.id) {      const identifiers = Array.prototype.slice.call(parentElement.querySelectorAll("span[id='"+identifierElement.id+"']"));      identifiers.forEach((identifier) => {        modifyClass(identifier,on); @@ -63,7 +63,7 @@ function highlightIdentifiers(parentElement,identifierElement,on) {  }  //divident is a string -//divident may have any number of digits  +//divident may have any number of digits  function modulo(divident, divisor) {    return Array.from(divident).map(c => parseInt(c))      .reduce((acc, value) => { @@ -82,12 +82,12 @@ function identifierStyle(identifierElement,                           occurrences,                           path,                           colorTheme, -                         moduleName) {   +                         moduleName) {    const idOcc = occurrences[identifierElement.dataset.occurrence]; -   +    let color = colorTheme.defaultColor; -  let fontWeight;   -   +  let fontWeight; +    if(idOcc) {      if(idOcc.sort.tag === 'TypeId') {        color = colorTheme.typeColor; @@ -102,7 +102,7 @@ function identifierStyle(identifierElement,        const idInfo = identifiers[identifierElement.dataset.identifier];        if(idInfo) {          if(isDefinedInCurrentModule(moduleName,path,idInfo)) { -          color = colorTheme.topLevelIdFromCurrentModule;          +          color = colorTheme.topLevelIdFromCurrentModule;          } else if(idInfo.sort === "Internal" && idInfo.locationInfo.tag === "ExactLocation") {            const colorNumber = modulo(identifierElement.id,colorTheme.localIdentifierColor.length);            color = colorTheme.localIdentifierColor[colorNumber]; @@ -111,7 +111,7 @@ function identifierStyle(identifierElement,        }      }    } -   +    return "color:"+color+";"      +(fontWeight ? "font-weight:" + fontWeight : "")+";"      +(idOcc.isBinder ? "text-decoration:underline;" : ""); @@ -122,16 +122,16 @@ function initializeIdentifiers (sourceCodeContainerElement,component) {    if(identifierElements.length > 0) {      const timeout = 250;//milliseconds      let timer = null; -     +      identifierElements.forEach((identifierElement) => { -       +        const cssText = identifierStyle(identifierElement,                                        component.get('identifiers'), -                                      component.get('occurrences'),                                      +                                      component.get('occurrences'),                                        component.get('path'),                                        component.get('colorTheme'),                                        component.get('name')); -       +        identifierElement.style.cssText = cssText;        //go to definition @@ -139,31 +139,31 @@ function initializeIdentifiers (sourceCodeContainerElement,component) {          if(timer) {            clearTimeout(timer);          } -         +          if(!window.getSelection().isCollapsed) {            return;          } -        const identifierInfo = component.get('identifiers')[identifierElement.dataset.identifier];  +        const identifierInfo = component.get('identifiers')[identifierElement.dataset.identifier];          const idOccurrenceInfo = component.get('occurrences')[identifierElement.dataset.occurrence];          const currentLineNumber = parseInt(identifierElement.parentNode.dataset.line); -         +          if(idOccurrenceInfo.sort.tag === "ModuleId") {            goToDefinition(component.get('store'),                           idOccurrenceInfo.sort.contents,                           event.which,                           currentLineNumber);          } -        else {           -          if(identifierInfo && (event.which === 1 || event.which === 2)) {             +        else { +          if(identifierInfo && (event.which === 1 || event.which === 2)) {              if(!idOccurrenceInfo.isBinder) {                goToDefinition(component.get('store'),                               identifierInfo.locationInfo,                               event.which,                               currentLineNumber);              } else { -              if(identifierInfo.sort === "External") {                 +              if(identifierInfo.sort === "External") {                  component.get('findReferences')(component.get('packageId'),                                                  identifierInfo.externalId,                                                  identifierInfo.demangledOccName, @@ -173,7 +173,7 @@ function initializeIdentifiers (sourceCodeContainerElement,component) {              }            }          } -      }       +      }        identifierElement.onmouseover = () => {          highlightIdentifiers(sourceCodeContainerElement,identifierElement,true);          if(timer) { @@ -185,27 +185,27 @@ function initializeIdentifiers (sourceCodeContainerElement,component) {              const identifierOccurrence = component.get('occurrences')[identifierElement.dataset.occurrence];              console.log(identifierOccurrence);              console.log(identifierInfo); -             +              component.set('selectedIdentifier',identifierElement);              component.set('currentLineNumber',parseInt(identifierElement.parentNode.dataset.line) || 1);              component.set('identifierInfo',identifierInfo);              component.set('identifierOccurrence',identifierOccurrence);              component.set('hasSelectedExpression',false);              component.set('isHoveredOverIdentifier',true); -             +            });          },timeout);        }; -       +        identifierElement.onmouseout = () => {          highlightIdentifiers(sourceCodeContainerElement,identifierElement,false); -         +          if(timer) {            clearTimeout(timer);          } -                 +          timer = setTimeout (() => { -          Ember.run.next(component,() => {             +          Ember.run.next(component,() => {              component.set('isHoveredOverIdentifier',false);            });          },timeout); @@ -224,19 +224,19 @@ function contains (node, other) {  function initializeExpressionInfo(sourceCodeContainerElement,component) {    const lineElements = Array.prototype.slice.call(sourceCodeContainerElement.querySelectorAll("td.line-content"));    if(lineElements.length > 0) { -     +      //Line numbers start with 1      let sourceCodeLines = [""]; -     +      lineElements.forEach((el) => {        sourceCodeLines.push(el.textContent);      }); -     -    const allowedNodeNames = ["#text","SPAN","TD"];     + +    const allowedNodeNames = ["#text","SPAN","TD"];      let isLoading = false;      let shouldWait = false;      const timeout = 400;//milliseconds -     +      const onmouseup = function()  {        Ember.run.next(() => {          if(isLoading || shouldWait) { @@ -244,14 +244,14 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {          }          shouldWait = true;          setTimeout(() => {shouldWait = false;},timeout); -         +          component.set('hasSelectedExpression',false); -         -        const selection = window.getSelection();         -         + +        const selection = window.getSelection(); +          //Selection of multiple lines inside a table doesn't work in Firefox          //https://bugzilla.mozilla.org/show_bug.cgi?id=365900 -         +          if(!(selection.anchorNode && selection.focusNode)             || !contains(sourceCodeContainerElement,selection.anchorNode)             || !contains(sourceCodeContainerElement,selection.focusNode) @@ -259,16 +259,16 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {             || (allowedNodeNames.indexOf(selection.focusNode.nodeName) === -1)             || selection.isCollapsed) {            return; -        }         -         +        } +          // Detects whether the selection is backwards          const detectionRange = document.createRange();          detectionRange.setStart(selection.anchorNode, selection.anchorOffset);          detectionRange.setEnd(selection.focusNode, selection.focusOffset);          const isBackward = detectionRange.collapsed; -         +          let startNode,startNodeOffset,endNode,endNodeOffset; -         +          if(isBackward) {            startNode = selection.focusNode;            startNodeOffset = selection.focusOffset; @@ -283,8 +283,8 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {          let lineStart,columnStart,lineEnd,columnEnd;          let infoWindowTargetElement; -         -         + +          //HTML inside source code container :          //<tr><td><span data-start="1" date-end="3">abc</span><span>...</span></td></tr>          //<tr>...</tr> @@ -292,17 +292,17 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {            const parent = startNode.parentNode;//<span>            columnStart = parseInt(parent.dataset.start) + startNodeOffset;            lineStart = parseInt(parent.parentNode.dataset.line); -           +            if(startNodeOffset === startNode.textContent.length && parent.nextSibling === null) {              const tr = startNode.parentNode.parentNode.parentNode;// span -> td -> tr -             +              //Skipping empty lines -            let nextLine = tr.nextSibling;             +            let nextLine = tr.nextSibling;              while(nextLine.children[1].textContent === "") {                nextLine = nextLine.nextSibling;              }              infoWindowTargetElement = nextLine.children[1].children[0]; -             +            } else {              if(!(startNodeOffset === 0) && (parent.nextSibling)) {                infoWindowTargetElement = parent.nextSibling; @@ -320,7 +320,7 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {              nextLine = nextLine.nextSibling;            }            infoWindowTargetElement = nextLine.children[1].children[0]; -           +          } else if(startNode.nodeName === "TD") {            if(startNodeOffset > 0) {              const child = startNode.children[startNodeOffset-1]; @@ -330,10 +330,10 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {            }            lineStart = parseInt(startNode.id.slice(2));            infoWindowTargetElement = startNode.children[0]; -        }  -         +        } +          if(endNode.nodeName === "#text") { -          columnEnd = parseInt(endNode.parentNode.dataset.start) + endNodeOffset;           +          columnEnd = parseInt(endNode.parentNode.dataset.start) + endNodeOffset;            lineEnd = parseInt(endNode.parentNode.parentNode.dataset.line);          } else if(endNode.nodeName === "SPAN") {            columnEnd = 1; @@ -341,22 +341,22 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {          } else if(endNode.nodeName === "TD"){            if(endNodeOffset > 0) {              const child = endNode.children[endNodeOffset-1]; -            columnEnd = parseInt(child.dataset.start);             +            columnEnd = parseInt(child.dataset.start);            } else {              columnEnd = 1;            }            lineEnd = parseInt(endNode.id.slice(2)); -        }         -         +        } +          const loadExprPromise = component.get('store').loadExpressions(            component.get('packageId'), -          component.get('path'),           +          component.get('path'),            lineStart,            columnStart,            lineEnd,            columnEnd);          isLoading = true; -                 +          loadExprPromise.then((expressions) => {            Ember.run.next(() => {              if(expressions && expressions.length > 0) { @@ -368,7 +368,7 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {                    return 1;                  }                }); -               +                const expressionsWithSourceCode = expressions.reduce((result,expression) => {                  const object = Ember.copy(expression);                  const srcSpan = buildSrcSpan(sourceCodeLines, @@ -387,15 +387,15 @@ function initializeExpressionInfo(sourceCodeContainerElement,component) {                  component.set('expressions',expressionsWithSourceCode);                  component.set('currentLineNumber',parseInt(infoWindowTargetElement.parentNode.dataset.line) || 1);                  component.set('hasSelectedExpression',true); -                 +                }              }              isLoading = false;            }); -        });         +        });        });      }; -     +      sourceCodeContainerElement.addEventListener('mouseup',onmouseup);      component._onmouseup = onmouseup;    } @@ -418,10 +418,10 @@ export default Ember.Component.extend({          this.set('filteredDeclarations',filteredDeclarations);        });      }, 300); -  }),   +  }),    identifierLocationInfo : Ember.computed('identifierInfo','identifierOccurrence',function() {      const idOcc = this.get('identifierOccurrence'); -    const idInfo = this.get('identifierInfo');     +    const idInfo = this.get('identifierInfo');      if(idOcc) {        if(idOcc.sort.tag === "ModuleId") {          return idOcc.sort.contents; @@ -470,10 +470,10 @@ export default Ember.Component.extend({    didReceiveAttrs() {      this.set('filteredDeclarations',this.get('declarations'));    }, -  didInsertElement() {     +  didInsertElement() {      this._super(...arguments);      const sourceCodeContainerElement = this.element.querySelector('.source-code-container'); -    sourceCodeContainerElement.innerHTML = this.get('html');     +    sourceCodeContainerElement.innerHTML = this.get('html');      this.sourceCodeContainerElement = sourceCodeContainerElement;      // Add links to Haskell language extensions docs @@ -493,7 +493,7 @@ export default Ember.Component.extend({        }        i = i + 1;      } -     +      this.element.parentNode.scrollTop = 0;      const declarations = this.element.querySelector('.declarations-content');      this.set('query',''); @@ -510,7 +510,7 @@ export default Ember.Component.extend({      this.cleanup();    },    actions : { -    goToLine(lineNumber) {    +    goToLine(lineNumber) {        window.location.hash = "L"+lineNumber;      },      toggleShowDeclarations() { diff --git a/javascript/app/components/identifier-info.js b/javascript/app/components/identifier-info.js index 0e870a2..79c35c6 100644 --- a/javascript/app/components/identifier-info.js +++ b/javascript/app/components/identifier-info.js @@ -1,7 +1,7 @@  import Ember from 'ember';  import {goToDefinition} from '../utils/go-to-definition'; -export default Ember.Component.extend({   +export default Ember.Component.extend({    store : Ember.inject.service('store'),    downloadedDocumentation : null,    didInsertElement () { @@ -26,25 +26,25 @@ export default Ember.Component.extend({        this.element.removeEventListener('mouseup',this._onmouseup);      }    }, -  //Naughty record selectors :  +  //Naughty record selectors :    //https://github.com/ghc/ghc/blob/ced2cb5e8fbf4493488d1c336da7b00d174923ce/compiler/typecheck/TcTyDecls.hs#L940-L961    isNaughtyRecSel : Ember.computed('identifierInfo',function () {      const idInfo = this.get('identifierInfo'); -    return idInfo ? (idInfo.details === "RecSelIdNaughty") : false;    +    return idInfo ? (idInfo.details === "RecSelIdNaughty") : false;    }),    isExternalIdentifier : Ember.computed('identifierInfo',function () {      const idInfo = this.get('identifierInfo'); -    return idInfo ? (idInfo.sort === "External") : false;  +    return idInfo ? (idInfo.sort === "External") : false;    }),    identifierObserver : Ember.observer('identifierInfo',function () {      this.set("downloadedDocumentation","");      const idInfo = this.get('identifierInfo'); -    if(idInfo) {       +    if(idInfo) {        const locationInfo = idInfo.locationInfo;        if(locationInfo.tag === "ApproximateLocation") {          const packageId = locationInfo.packageId.name + "-" + locationInfo.packageId.version;          const currentIdentifier = idInfo; -         +          this.get('store').loadDefinitionSite(packageId,                                               locationInfo.moduleName,                                               locationInfo.componentId, @@ -52,10 +52,10 @@ export default Ember.Component.extend({                                               locationInfo.name)            .then((definitionSite) => {              Ember.run.next(this,() => { -              if(currentIdentifier === this.get('identifierInfo')) {                 +              if(currentIdentifier === this.get('identifierInfo')) {                  this.set('downloadedDocumentation',definitionSite.documentation);                }}) -          }).catch(() => {             +          }).catch(() => {              this.get('store').loadHoogleDocs(packageId,                                               locationInfo.moduleName,                                               locationInfo.entity, diff --git a/javascript/app/components/identifier-name.js b/javascript/app/components/identifier-name.js index e0f8c3c..4b01b03 100644 --- a/javascript/app/components/identifier-name.js +++ b/javascript/app/components/identifier-name.js @@ -11,7 +11,7 @@ export default Ember.Component.extend({    }),    style : Ember.computed('identifierElement',function() {      const element = this.get('identifierElement'); -    if(element) {       +    if(element) {        return new Ember.String.htmlSafe("color:"+element.style.color);      }    }), @@ -44,7 +44,7 @@ export default Ember.Component.extend({      return (this.get('identifierInfo.sort') === "External");    }),    actions : { -    goToDefinition (event) {       +    goToDefinition (event) {        goToDefinition(this.get('store'),                       this.get('locationInfo'),                       event.which, diff --git a/javascript/app/components/infinite-list.js b/javascript/app/components/infinite-list.js index b73b6d4..02e1943 100644 --- a/javascript/app/components/infinite-list.js +++ b/javascript/app/components/infinite-list.js @@ -10,34 +10,34 @@ function initialize(component) {    pageNumber = 1;  } -export default Component.extend({   +export default Component.extend({    renderedElements : [],    init() {      this._super(...arguments);      initialize(this);    }, -  elementsObserver : observer('elements',function() {     +  elementsObserver : observer('elements',function() {      initialize(this);      const containerElement = document.getElementById(this.get('containerElementId')); -    if(containerElement) {  +    if(containerElement) {        containerElement.scrollTop = 0;      }    }),    didInsertElement() {      const containerElement = document.getElementById(this.get('containerElementId'));      if(containerElement) { -      const component = this;                        +      const component = this;        containerElement.onscroll = function() {          const perPage = component.get('perPage');          const elements = component.get('elements'); -         +          if(!updating &&             (pageNumber * perPage < elements.length) &&             (containerElement.scrollTop + containerElement.offsetHeight              > component.element.offsetHeight - 100)) { -           +            updating = true; -          run.next(component,() => {                         +          run.next(component,() => {              const newElements = elements.slice(pageNumber * perPage,(pageNumber + 1) * perPage);              component.get('renderedElements').pushObjects(newElements);              pageNumber ++; diff --git a/javascript/app/components/info-window.js b/javascript/app/components/info-window.js index a011f99..da669f1 100644 --- a/javascript/app/components/info-window.js +++ b/javascript/app/components/info-window.js @@ -8,27 +8,27 @@ function updatePosition(component) {    if(targetElement) {      const infoWindowHeight = component.element.offsetHeight;      const targetElementHeight = targetElement.offsetHeight; -     -    const parent = targetElement.parentNode;//<td> element     -    const containerElement = document.querySelector("#" + component.get('containerElementId'));     + +    const parent = targetElement.parentNode;//<td> element +    const containerElement = document.querySelector("#" + component.get('containerElementId'));      //getBoundingClientRect() returns the smallest rectangle which contains      //the entire element, with read-only left, top, right, bottom, x, y, width,      //and height properties describing the overall border-box in pixels. Properties      //other than width and height are relative to the top-left of the *viewport*.      const targetTopViewport = targetElement.getBoundingClientRect().top; -     +      let containerTopViewport;      if (containerElement) {        containerTopViewport = containerElement.getBoundingClientRect().top;      } else {        containerTopViewport = 0;      } -     +      let infoWindowTop;      if(targetTopViewport < infoWindowHeight + containerTopViewport) {        //offsetTop is the number of pixels from the top of the closest relatively -      //positioned parent element.       +      //positioned parent element.        infoWindowTop = targetElement.offsetTop + parent.offsetTop          + targetElementHeight + 10 + "px";      } else { @@ -37,7 +37,7 @@ function updatePosition(component) {      }      const infoWindowLeft = targetElement.offsetLeft + parent.offsetLeft + "px"; -     +      component.$().css({        top:infoWindowTop,        left:infoWindowLeft @@ -54,16 +54,16 @@ export default Ember.Component.extend({    isFocused: false,    didInsertElement () {      const component = this; -     +      const $headerElement = Ember.$(component.element.querySelector(".info-window-header"));      const $contentElement = Ember.$(component.element.querySelector(".info-window-content"));      const $infoWindowElement = Ember.$(component.element.querySelector(".info-window"));      const $infoWindowContainerElement = Ember.$(component.element); -     +      this.$headerElement = $headerElement; -    this.$contentElement = $contentElement;     +    this.$contentElement = $contentElement; -    this.$().resizable({     +    this.$().resizable({        handles: "n,w",        minHeight: 80,        minWidth: 400, @@ -74,10 +74,10 @@ export default Ember.Component.extend({          resizing = false;        },        resize : function() { -        const containerHeight = $infoWindowContainerElement.height();                +        const containerHeight = $infoWindowContainerElement.height();          $infoWindowElement.css({            "height": containerHeight + 2 + "px" -        });         +        });          $contentElement.css({            "max-height":(containerHeight - $headerElement.outerHeight(true)) + "px"          }); @@ -104,7 +104,7 @@ export default Ember.Component.extend({      const element = document.elementFromPoint(event.clientX,event.clientY);      if(element && element.classList.contains('link')) {        return; -    }     +    }      if(!resizing         && !dragging         && !this.get('isPinned') @@ -122,7 +122,7 @@ export default Ember.Component.extend({      if (this.get('isPinned')          || this.get('isFocused')          || this.get('isHoveredOverIdentifier') -        || this.get('hasSelectedExpression')) {       +        || this.get('hasSelectedExpression')) {        return false;      } else {        return true; diff --git a/javascript/app/components/input-with-autocomplete.js b/javascript/app/components/input-with-autocomplete.js index 34abe7a..5960c46 100644 --- a/javascript/app/components/input-with-autocomplete.js +++ b/javascript/app/components/input-with-autocomplete.js @@ -1,14 +1,14 @@  import Ember from 'ember';  export default Ember.Component.extend({ -  store : Ember.inject.service('store'),   +  store : Ember.inject.service('store'),    highlightedItemIndex: -1,    items : [],    query: null,    didInsertElement() {      const $input = Ember.$(this.element).find(".search-input"); -    const $autocompleteContainer = Ember.$(this.element).find(".autocomplete-container");     -    this.$input = $input;         -    this.$autocompleteContainer = $autocompleteContainer;     +    const $autocompleteContainer = Ember.$(this.element).find(".autocomplete-container"); +    this.$input = $input; +    this.$autocompleteContainer = $autocompleteContainer;      const width = $input.width() + 300;      $autocompleteContainer.css({        "width" : width+"px", @@ -23,9 +23,9 @@ export default Ember.Component.extend({          this.onDown();        } else if(e.which === 38) {          this.onUp(); -      }  +      }      }); -    $input.focusin(() => {       +    $input.focusin(() => {        this.showAutocompleteList();      });      $input.focusout(() => { @@ -105,7 +105,7 @@ export default Ember.Component.extend({    },    searchUrlObserver : Ember.observer('createSearchUrlFunction',function() {      this.notifyPropertyChange('query'); -  }),   +  }),    queryObserver : Ember.observer("query",function() {      if(this.get('query')) {        const perPage = this.get('maxItems') ? this.get('maxItems') : 10; diff --git a/javascript/app/components/instance-info.js b/javascript/app/components/instance-info.js index a0e04ed..339d415 100644 --- a/javascript/app/components/instance-info.js +++ b/javascript/app/components/instance-info.js @@ -10,7 +10,7 @@ export default Ember.Component.extend({      return this.get('nestedLevel') + 1;    }),    actions : { -    goToDefinition (event) {       +    goToDefinition (event) {        goToDefinition(this.get('store'),                       this.get('instance.location'),                       event.which, diff --git a/javascript/app/components/paginated-list.js b/javascript/app/components/paginated-list.js index 9d85610..d4b6609 100644 --- a/javascript/app/components/paginated-list.js +++ b/javascript/app/components/paginated-list.js @@ -8,10 +8,10 @@ function loadItems(store,component,url) {        component.set('next',result.linkHeader.next);        component.set('prev',result.linkHeader.prev);        component.set('last',result.linkHeader.last); -       +        const pageMatch = url.match(/(&|\?)page=(\d+)/);        const perPageMatch = url.match(/(&|\?)per_page=(\d+)/); -       +        const page = pageMatch ? pageMatch[2] : 1;        const perPage = perPageMatch ? perPageMatch[2] : 20; @@ -36,11 +36,11 @@ export default Ember.Component.extend({      }    },    urlObserver : Ember.observer('url',function () { -    loadItems(this.get('store'),this,this.get('url'));     -    this.element.querySelector(".paginated-list-content").scrollTop = 0;     +    loadItems(this.get('store'),this,this.get('url')); +    this.element.querySelector(".paginated-list-content").scrollTop = 0;    }),    actions : { -    update(url) {       +    update(url) {        this.element.querySelector(".paginated-list-content").scrollTop = 0;        loadItems(this.get('store'),this,url);      } diff --git a/javascript/app/components/resizable-panel.js b/javascript/app/components/resizable-panel.js index 20d781b..fe51ade 100644 --- a/javascript/app/components/resizable-panel.js +++ b/javascript/app/components/resizable-panel.js @@ -24,7 +24,7 @@ export default Ember.Component.extend({    hidden:false,    hiddenByUser:false,    didInsertElement : function () { -    this._super(...arguments);     +    this._super(...arguments);      Ember.run.next(this,() => {        const onresize = () => {          if(!this.get('hiddenByUser')) { @@ -50,7 +50,7 @@ export default Ember.Component.extend({          }        });        this.$alsoResizeElement = $alsoResizeElement; -      if(window.innerWidth < 700) {       +      if(window.innerWidth < 700) {          this.set('hidden',true);          hide(this,false);        } diff --git a/javascript/app/components/text-file.js b/javascript/app/components/text-file.js index 05be31a..2239571 100644 --- a/javascript/app/components/text-file.js +++ b/javascript/app/components/text-file.js @@ -37,7 +37,7 @@ export default Ember.Component.extend({    }),    init() {      this._super(...arguments); -    this.markdownConverter = new showdown.Converter();     +    this.markdownConverter = new showdown.Converter();    },    didInsertElement() {      const sourceCodeContainerElement = this.element.querySelector('.source-code-container'); @@ -48,7 +48,7 @@ export default Ember.Component.extend({      this.cleanup();    },    cleanup() { -    if(this._onhashchange) {       +    if(this._onhashchange) {        window.removeEventListener('hashchange',this._onhashchange);      }      if(this._onkeydown) { @@ -61,7 +61,7 @@ export default Ember.Component.extend({    pathObserver : Ember.observer('path',function() {      Ember.run.next(this,() => {        this.cleanup(); -      this.didInsertElement();       +      this.didInsertElement();      });    })  }); diff --git a/javascript/app/components/type-signature-text.js b/javascript/app/components/type-signature-text.js index e4eb200..ce33607 100644 --- a/javascript/app/components/type-signature-text.js +++ b/javascript/app/components/type-signature-text.js @@ -1,4 +1,4 @@  import Ember from 'ember';  export default Ember.Component.extend({ -  tagName : "span"   +  tagName : "span"  }); diff --git a/javascript/app/components/type-signature.js b/javascript/app/components/type-signature.js index ed1849c..8e7545f 100644 --- a/javascript/app/components/type-signature.js +++ b/javascript/app/components/type-signature.js @@ -1,11 +1,11 @@  import Ember from 'ember';  export default Ember.Component.extend({ -  tagName : "span",   -  expandTypeSynonyms: false,   +  tagName : "span", +  expandTypeSynonyms: false,    expandTypeSynonymsLabel : Ember.computed('expandTypeSynonyms',function() {      return this.get('expandTypeSynonyms') ? "Show type synonyms" : "Expand type synonyms";    }), -  components : Ember.computed('type','expandTypeSynonyms',function() {    +  components : Ember.computed('type','expandTypeSynonyms',function() {      if(this.get('expandTypeSynonyms') && this.get('type.componentsExpanded')) {        return this.get('type.componentsExpanded');      } else { @@ -14,7 +14,7 @@ export default Ember.Component.extend({    }),    typeObserver : Ember.observer('type',function() {      this.set('expandTypeSynonyms',false); -  }),   +  }),    actions : {      toggleExpandTypeSynonyms () {        this.toggleProperty('expandTypeSynonyms');  | 
