diff options
| author | Ev Bogue <ev@evbogue.com> | 2019-07-29 09:35:17 -0500 | 
|---|---|---|
| committer | Ev Bogue <ev@evbogue.com> | 2019-07-29 09:35:17 -0500 | 
| commit | 52561b0bbbdcd41401265ed37c667ff2402f90b7 (patch) | |
| tree | 316861cca8e696b7fba43052852b7e77b34aa923 | |
| parent | b274bd838dca5f36d08a2cf0b4946d5e3cb7174d (diff) | |
implement search
| -rw-r--r-- | app.js | 2 | ||||
| -rw-r--r-- | views.js | 17 | 
2 files changed, 19 insertions, 0 deletions
| @@ -57,6 +57,8 @@ function route (keys) {      pubs()    } else if (src[0] === '@') {      profilePage(src, keys) +  } else if (src[0] === '?') { +    searchPage(src, keys)    } else if (src[0] === '%') {      threadPage(src, keys)    } else { @@ -95,6 +95,23 @@ function profilePage (src, keys) {    })  } +function searchPage (src, keys) { +  var search = src.substring(1).replace("%20"," ") +  console.log(search) +  scroller.appendChild(composer(keys)) +  bog().then(log => { +    if (log) { +      log.forEach(function (msg) { +        if (msg.text) { +          if (msg.text.includes(search)) { +            scroller.appendChild(render(msg, keys)) +          } +        } +      }) +    } +  }) +} +  function publicPage (keys) {    localforage.getItem('subscriptions').then(function (subs) { | 
