
const DEFAULT_VIEWS = Object.freeze({
  NEW: 'new',
  EDIT: 'edit',
  VIEW: 'view'
})

function getCurrentUri () {
  const params = new URLSearchParams(window.location.search)
  const uri = params.get('uri')
  return uri
}

function getCurrentView () {
  const params = new URLSearchParams(window.location.search)
  const view = params.get('view')
  return view
}

function getViewUrl(uri, view) {
  return `${ROOT_URL}about?view=${view}&uri=${uri}`
}

function goToView(uri, view, args) {
  if(args){
    return window[args](getViewUrl(uri, view), '_blank')
  }
  return window.location = getViewUrl(uri, view)
}

export { DEFAULT_VIEWS, getCurrentUri, getCurrentView, getViewUrl, goToView }


const DEFAULT_VIEWS = Object.freeze({
  NEW: 'new',
  EDIT: 'edit',
  VIEW: 'view'
})

function getCurrentUri () {
  return NODE_URI
}

function getCurrentView () {
  const params = new URLSearchParams(window.location.search)
  const view = params.get('view')
  return view
}

function getViewUrl(uri, view) {
  return `${ROOT_URL}about?view=${view}&uri=${uri}`
}

function goToView(uri, view, args) {
  if(args){
    return window[args](getViewUrl(uri, view), '_blank')
  }
  return window.location = getViewUrl(uri, view)
}

export { DEFAULT_VIEWS, getCurrentUri, getCurrentView, getViewUrl, goToView }

Use NODE_URI instead of parsing uri from url
Use NODE_URI instead of parsing uri from url

Fixes #191
