Skip to content

Instantly share code, notes, and snippets.

@kehh
Last active November 30, 2017 03:58
Show Gist options
  • Save kehh/b406b9554253332a2a3012c4590eb20a to your computer and use it in GitHub Desktop.
Save kehh/b406b9554253332a2a3012c4590eb20a to your computer and use it in GitHub Desktop.
View CollectiveAccess Record in JSON

Create a bookmark in your browser and pase the associated code into the URL of the link.

Creating a bookmarklet

javascript:(function () {
if (location.href.match(/.*index\.php\/editor\/.*_id\/\d+/)) {
window.open(location.href.replace(/(.*)index\.php\/editor\/([a-z]*)\/.*_id\/(\d*)/, '$1service.php/item/ca_$2/id/$3/lang/en_AU/pretty/1/format/import/flatten/locales;all'));
}
if (location.href.match(/(.*)index\.php\/administrate\/setup\/list_item_editor\/.*\/item_id\/\d+/)) {
window.open(location.href.replace(/(.*)index\.php\/.+item_id\/(\d*)/, '$1service.php/item/ca_list_items/id/$2/lang/en_AU/pretty/1/format/import/flatten/locales;all'));
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment