code to enable external links on monocle frames
// including monocle files
<script src="scripts/monocore.js"></script>
<script src="scripts/monoctrl.js"></script>
<link rel="stylesheet" type="text/css" href="styles/monocore.css" />
<link rel="stylesheet" type="text/css" href="styles/monoctrl.css" />
<script>
function createStencil(rdr) {
var stencil = new Monocle.Controls.Stencil(rdr);
rdr.addControl(stencil);
// This line is useful mostly for testing:
// it highlights the stencil's link cutouts.
stencil.toggleHighlights();
}
Monocle.Reader(' focused_item_id ',null, null, function (rdr) {
window.reader = rdr;
createStencil(rdr);
});</script>
Written by Yasser Arafa
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#