projectdoc Toolbox

Displays the document properties of the projectdoc document currently shown in the browser.

The bookmarklet allows a quick overview over all document properties, including artificial properties, provided by a projectdoc document.

Bookmarklet

The bookmarklet is ready to use. Simply drag and drop the bookmarklet button to the bookmarks in your browser.

Ready to use!

Bookmarklets editor

 

The Bookmarklets Extension contains a doctype that provides a bookmarklets editor to edit and create bookmarklets.

Code

The code is available on the resource repository.

display-properties.js
var pageId = AJS.Meta.get('page-id');
var locale = AJS.Meta.get('user-locale');
var baseURL = AJS.Meta.get('base-url');

var result = $.ajax({
  url: baseURL + "/rest/projectdoc/1/document/" + pageId + ".json?expand=property&resource-mode=html",
  async: false,
  dataType: 'json'
}).responseText;

var htmlTitle = "Page Properties";
var html = "<html lang='" + locale + "'><head><title>" + htmlTitle + "</title><style>" +
  " .table-sm td, .table-sm th {padding: .1rem !important;}" +
  " .table td, .table th { font-size: 10px !important;}" +
  "</style>" +
  "<link rel=\"stylesheet\"" +
  " href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\"" +
  " integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T\"" +
  " crossorigin=\"anonymous\">" +
  "</head><body><h6>" + htmlTitle + "</h6>";
html += "<table class=\"table table-sm table-bordered table-striped\">";
$.each($.parseJSON(result).property,
  function (index, obj) {
    html = html + "<tr><th>" + obj.name + "</th><td>" + obj.value + "</td></tr>"
  }
);
html += "</table></body></html>";

var x = window.open('', '', 'width=600,height=800,location=no,toolbar=0');
x.document.body.innerHTML = html;

Work-in-progress

 

Note that the bookmarklets we present on this page are work-in-progress.

Currently we even refer to the master branch of the bookmark's JavaScript code. This will change in future once we have proper releases for our bookmarks project.

While we use the code in our daily work, your use case may be different. Therefore please check the code and maybe fork the projectdoc Bookmarklets Project to adjust the code according to your requirements.

Resources

Display All Document Properties Macro
Displays all properties of a document as a writing tool for authors.