Using the Vizit JavaScript Namespace

Using the Content Editor Web part with the Vizit JavaScript Namespace:

  1. Open the page for editing: Under Site Actions, click "Edit Page." This requires the user to have edit permissions for the page.
  2. Add the Content Editor Web Part: Click the "Add a Web Part" box on the page.  In the "Media and Content" folder, select the "Content Editor" Web Part, then click "Add".
  3. Open HTML editing: Click the Content Editor Web Part now on the page.  Select the "Format Text" tab at the top of the page.  Click the "HTML" button, then "Edit HTML Source". 
  4. Adding content: Using HTML formatting, you can add Vizit to the page.  Example 1 shows the basics of adding Vizit to a page, with a button to open a particular document.  Example 2 shows how to add buttons to navigate the document.
  5. Close and save: In the current box, click "OK".  Select the "Page" tab at the top of the screen, then "Stop Editing".

Examples

Example 1

<div id="test" style="width: 500px; height: 500px;"></div>
<input type="button" onclick="MyStuff.Controller.Open({ url: 'http://server/file/path/file_name.ext' });" value="Load Document"/>
<script type="text/javascript">
var MyStuff = {};
MyStuff.Controller = new Vizit.Essential.Controller({ renderTo: 'test' });
</script>​

Example 1 creates a 500 pixel by 500 pixel Vizit Essential window, and adds a button to load a specific file when the button is pressed. 

Example 2

<div id="test" style="width: 500px; height: 500px;"></div>
<input type="button" onclick="MyStuff.Controller.Open({ url: 'http://server/file/path/file_name.ext' });" value="Load Document"/>
<br />
<input type="button" onclick="MyStuff.Controller.GetDocumentPanel().FirstPage()" value="First Page"/>
<input type="button" onclick="MyStuff.Controller.GetDocumentPanel().PrevPage()" value="Prev Page"/>
<input type="button" onclick="MyStuff.Controller.GetDocumentPanel().NextPage()" value="Next Page"/>
<input type="button" onclick="MyStuff.Controller.GetDocumentPanel().LastPage()" value="Last Page"/>

​<script type="text/javascript">
var MyStuff = {};
MyStuff.Controller = new Vizit.Essential.Controller({ renderTo: 'test' });
</script>​

Example 2 does the same, also adding four buttons below to navigate to the first, previous, next, and last pages.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk