<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Great explanation Ryan!&nbsp; Thanks!<br>
<br>
Greg<br>
<br>
Ryan Brindley wrote:
<blockquote
 cite="mid:9409590.819811252070946398.JavaMail.root@jupiler.digium.com"
 type="cite">
  <style type="text/css">p { margin: 0; }</style>
  <div style="font-family: Arial; font-size: 10pt; color: rgb(0, 0, 0);">Hey
gents,<br>
I recently explained to someone a brief overview of the code and
decided this list might like to hear it as well...so here it is:<br>
  <br>
  <br>
First off the project has a simplistic file structure. When you pull
down the source, the config dir holds all the code you'll ever need to
modify. Directly inside the config dir are the html files. These files
contain all the HTML, file specific CSS and loading JS. The config
folder also contains directories for global JS (js/), global CSS
(stylesheets/), and images (images/). <br>
  <br>
The JS can be divided into three sections: loading JS, page JS, and JS
libraries. The loading JS is usually jQuery's $(document).ready()
function and any directly related helper functions and can be found in
the HTML files. Page JS is all the functions needed to make a page what
it is. If an HTML has over ~100 lines of JS code, that code is moved
into its own JS file. For example, users.html has js/users.js. The JS
libraries hold all the objects and functions that are commonly used
through-out the project. They are also located in the js/ directory.<br>
  <br>
Now, there are 5 important files to the GUI: index.html, index.js,
astman.js, pbx.js and pbx2.js. <br>
  <br>
Index.html is the main page. It contains the majority of the
'sessionData' variable instantiations as well as the HTML for the main
menu and the iframe for the pages. <br>
  <br>
Index.js contains all the initial loading javascript. It's purpose is
to validate that the system, detect hardware changes, and login the
user. <br>
  <br>
Astman.js is a rather unorganized file. It contains all the array and
string custom functions and then the ASTGUI object. the ASTGUI object
is the main function object for the GUI. It holds all the AJAX
functions, global variables, Asterisk context variables and some random
HTML template variables. You'll probably see this object used in every
JS you encounter. <br>
  <br>
Pbx.js use to contain all of the data models, but that's been moved to
pbx2.js (I'll explain later). The only thing that hasn't been ported
over to pbx2.js is pbx.js's checkEssentials object. These functions
verify that specific dailplan contexts are exactly as expected. If they
aren't the functions replace the current context with what it should
be. This is the only place in the GUI where the GUI actually forces no
customizations. These functions also load all the configs and create
the client-side data cache, which is the sessionData object. <br>
  <br>
Pbx2.js holds all the data models. If you look at the file, you'll see
a clear system. pbx is the main object with many members, such as:
users, trunks, queues, etc. etc. Each pbx member has all the necessary
methods needed to configure Asterisk. For example, the users member has
add, edit, remove, and list methods. This allows any page to add a user
by calling pbx.users.add(); Its important to note that if you are
looking for where the GUI modifies some file, its most likely going to
be in pbx2.js sparing a few exceptions.<br>
  <br>
-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
Ryan Brindley &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
Digium, Inc. | Software Developer &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
main: +1 256-428-6000 &nbsp; fax: +1 256-864-0464 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
Check us out at: <a class="moz-txt-link-freetext" href="http://digium.com">http://digium.com</a> &amp; <a class="moz-txt-link-freetext" href="http://asterisk.org">http://asterisk.org</a><br>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
--Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a>--

asterisk-gui mailing list
To UNSUBSCRIBE or update options visit:
   <a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-gui">http://lists.digium.com/mailman/listinfo/asterisk-gui</a></pre>
</blockquote>
<br>
</body>
</html>