diff --git a/src/pastebin/pastebin.html b/src/pastebin/pastebin.html index 12a5c274..1db89c4a 100644 --- a/src/pastebin/pastebin.html +++ b/src/pastebin/pastebin.html @@ -16,6 +16,7 @@ +
@@ -61,6 +62,11 @@ Debug +
@@ -71,6 +77,9 @@
+
+ +
diff --git a/src/persistence/firebase-manager.js b/src/persistence/firebase-manager.js index f2170e93..1aaa902b 100644 --- a/src/persistence/firebase-manager.js +++ b/src/persistence/firebase-manager.js @@ -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`); } diff --git a/src/searcher/searcher-container.css b/src/searcher/searcher-container.css new file mode 100644 index 00000000..e69de29b diff --git a/src/searcher/searcher-container.html b/src/searcher/searcher-container.html new file mode 100644 index 00000000..621b6fa6 --- /dev/null +++ b/src/searcher/searcher-container.html @@ -0,0 +1,12 @@ + diff --git a/src/searcher/searcher-container.js b/src/searcher/searcher-container.js new file mode 100644 index 00000000..af0f1d7c --- /dev/null +++ b/src/searcher/searcher-container.js @@ -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(`
  • ${JSON.stringify(data)}
  • `); + }); + } + +} diff --git a/src/searcher/searcher.js b/src/searcher/searcher.js index 63ee9264..c30aab13 100644 --- a/src/searcher/searcher.js +++ b/src/searcher/searcher.js @@ -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; @@ -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 @@ -39,6 +42,7 @@ export class Searcher { }; attached() { + this.searcherContainer.attached(); this.metagsURLsFirebase = this.firebaseManager.makePastebinMetagsURLsFirebase(); this.globalMetagsURLsFirebase = this.firebaseManager.makeGlobalMetagsURLsFirebase();