Last Updated: February 25, 2016
·
556
· yassoraa88

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>

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside