Labs/Jetpack/JEP/31: Difference between revisions

Jump to navigation Jump to search
Line 19: Line 19:


We want to allow developers to be able to search bookmarks and history as well as add and perhaps edit bookmarks via Jetpack.
We want to allow developers to be able to search bookmarks and history as well as add and perhaps edit bookmarks via Jetpack.
== A minimal amount of API ==
=== Searching ===


<pre class="brush:js;">
<pre class="brush:js;">
// let's work out the minimal amount of API here


let places = jetpack.places.find("cnn.com"); // searches both History and Bookmarks
let places = jetpack.places.find("cnn.com"); // searches both History and Bookmarks
Line 35: Line 37:


let places = jetpack.bookmarks.find("cnn.com") // only search bookmarks
let places = jetpack.bookmarks.find("cnn.com") // only search bookmarks
</pre>
=== Create a bookmark ===
<pre class="brush:js;">
jetpack.bookmarks.create(
  { title:'foo.com',
    url:'http://foo.com',
    tags: ['fun', 'technical'],
    path: 'computers/tech/reading' // <-- if the path does not exist create it?
  }
);


</pre>
</pre>
564

edits

Navigation menu