Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shows results from Searcher actions #234

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/pastebin/pastebin.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<require from = "traceSearch/trace-search.html"></require>

<require from="searcher/searcher.html"></require>
<require from="searcher/searcher-container.html"></require>

<div id = "mainContainer" class = "box-shadow-bottom">
<div id = "main-splitter-left" class = "split split-horizontal container-fluid">
Expand Down Expand Up @@ -61,6 +62,11 @@
Debug
</a>
</li>
<li id = "searcherTab" role = "tab" aria-controls = "search-container">
<a href = "#searcher-container" data-toggle = "tab">
Searcher
</a>
</li>
</ul>
<div class = "tab-content">
<div id = "preview" class = "tab-pane fade in active" role = "tabpanel" aria-labelledby="previewTab">
Expand All @@ -71,6 +77,9 @@
<vis-viewer vis-viewer.bind = "visViewer"></vis-viewer>
<trace-search trace-search.bind = "traceSearch"></trace-search>
</div>
<div id="searcher-container">
<searcher-container trace-search.bind = "searcher.searcherContainer"></searcher-container>
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/persistence/firebase-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class FirebaseManager {
return new Firebase(`${this.baseURL}/${pastebinId}/metags/urls`);
}

makeGlobalMetagsURLsFirebase(pastebinId = this.pastebinId) {
makeGlobalMetagsURLsFirebase() {
return new Firebase(`${this.baseURL}/metags/urls`);
}

Expand Down
Empty file.
12 changes: 12 additions & 0 deletions src/searcher/searcher-container.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template bindable="searcher">
<require from="./searcher-container.css"></require>
<div >
<div class='seecoderun-chat-toolbar'>
<input type='text' placeholder='Type search Here...'>
</div>
<ul id="urlList"></ul>
<footer>
<input type='text' placeholder='Type search Here...'>
</footer>
</div>
</template>
17 changes: 17 additions & 0 deletions src/searcher/searcher-container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Created by DavidIgnacio on 7/17/2017.
*/
export class SearcherContainer{

constructor(firebaseManager){
this.firebaseManager = firebaseManager;
}
attached(){
let firebaseURLs = this.firebaseManager.makeGlobalMetagsURLsFirebase();
firebaseURLs.on("child_added", function(snapshot){
let data = snapshot.val();
$("#urlList").append(`<li> ${JSON.stringify(data)}</li>`);
});
}

}
4 changes: 4 additions & 0 deletions src/searcher/searcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
*/
import {customElement} from 'aurelia-framework';
import {draggable} from 'jquery-ui';
import {SearcherContainer} from './searcher-container';

@customElement('pastebin')
export class Searcher {
searcherContainer = null;
searcherSelector = "#searcher";
isFirstSearch = true;
searcherQueryDefaultHeight = 38;
Expand All @@ -24,6 +26,7 @@ export class Searcher {
constructor(eventAggregator, firebaseManager) {
this.eventAggregator = eventAggregator;
this.firebaseManager = firebaseManager;
this.searcherContainer = new SearcherContainer(firebaseManager);
}

// storing hashes in Firebase, hence normal strings cannot be indexes. null, undefined throw errors
Expand All @@ -39,6 +42,7 @@ export class Searcher {
};

attached() {
this.searcherContainer.attached();
this.metagsURLsFirebase = this.firebaseManager.makePastebinMetagsURLsFirebase();
this.globalMetagsURLsFirebase = this.firebaseManager.makeGlobalMetagsURLsFirebase();

Expand Down