Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, one can only guess without having access to the page itself (and it's source code). I can, however, make an educated guess on how it works.</p> <p>The URL params follows a pattern. First you have a token that is equal in all templates. This probably means the token does not have any relevance to the template mechanism itself. Maybe it's an authentication token or something. Not relevant though.</p> <p>Then you have the template identification (templateOne, templateTwo, etc...) followed by a HubId that is empty. Lastly you have a goalComplete=200 which might correspond to the HTTP success code 200 (OK).</p> <hr> <p>Based on this, my guess would be that they are probably using AJAX on the background, to fetch those templates from the server. Then, via JScript, those templates are inserted into the editor box itself.</p> <p>Using JQuery, something like this is trivial. here's an example:</p> <p><strong>template.html</strong></p> <pre><code>&lt;div&gt; &lt;h1&gt;TEST&lt;/h1&gt; &lt;span&gt;This is a template&lt;/span&gt; &lt;/div&gt; </code></pre> <p><strong>editor.html</strong></p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div contenteditable="true" id="myEditor"&gt; replaced stuff &lt;/div&gt; &lt;button id="btn"&gt;Load TPL&lt;/button&gt; &lt;script&gt; $("#btn").click(function() { $("#myEditor").load("template.html"); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h1>Edit:</h1> <p>1) Well, since those templates are quite complex and include CSS, you probably want to keep them separated from you editor page (or the template's CSS will mess up your page's css). However, since you're using TinyMCE, it comes with a template manager built in, so you probably want to use that. Check this link here <a href="http://www.tinymce.com/wiki.php/Configuration%3atemplates" rel="nofollow">http://www.tinymce.com/wiki.php/Configuration:templates</a> for documentation.</p> <p>2) I think 1 answers your question but, just in case, my method above works for any page in any directory, provided it lives on the same domain. Example:</p> <pre><code>&lt;script&gt; $("#btn").click(function() { $("#myEditor").load("someDirectory/template.html"); }); &lt;/script&gt; </code></pre> <p>I recomend you check this page for the specifics on using TinyMCE <a href="http://www.tinymce.com/wiki.php/Configuration%3atemplates" rel="nofollow">http://www.tinymce.com/wiki.php/Configuration:templates</a></p> <h1>EDIT2:</h1> <p>Let me explain the above code:</p> <pre><code>$("#btn").click(function() { }); </code></pre> <p>This basically tells the browser to run the code inside the brackets when you click the element with an id="btn"</p> <pre><code>$("#myEditor").load("someDirectory/template.html"); </code></pre> <p>This is an AJAX request (<a href="http://api.jquery.com/load/" rel="nofollow">check the documentation here</a>). It grabs the contents of <code>someDirectory/template.html</code> and places them inside the element whose id="myEditor"</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload