Commit 04b68050 authored by CupCakeArmy's avatar CupCakeArmy
Browse files

New Documentation

parent b5d85753
# Frontend
# AMIV-Frontend
###### New Admintools & Website for AMIV;
## Software
# Software
### Admintool:
* ```ubuntu /14.04.1```
......@@ -11,16 +12,18 @@
# Admintool
### Dependecies:
* ```jQuery /2.2.2```
* ```bootstrap /3.3.6```
* ```amivaccess /1.0```
* ```jQuery /2.2.2 (Public)```
* ```bootstrap /3.3.6 (Public)```
* ```amivcore /1.0 (Private)```
* ```tools /1.0 (Private)```
# Structure
* admin (Admintool)
* lib (Libraries)
* bootstrap
* jquery
* amiv (amivaccess)
* amiv
* amivcore (JS Library for API)
* cust (custom files)
* main.js (our js file)
* main.css (our css file)
......@@ -34,13 +37,12 @@
* users.tool
* ...
* public (Website)
### Library ```tools```:
## Library ```tools```:
The JS library ```tools``` is the backbone of the single tools. It enables the tool itself to take actions, such as store data, spawn alert boxes, load new tools and more.
#### log(msg, type, timeout)
### log(msg, type, timeout)
######Displays an alert box to the user.
* ```msg /text,HTML``` The message or html to be displayed in the alert box
* ```type /('s', 'i', 'w', 'e')``` Specifies the type of message. Displays different colors for each type.
......@@ -49,41 +51,46 @@ The JS library ```tools``` is the backbone of the single tools. It enables the t
* w: warning
* e: error
* ```timeout (optional)/int``` Number of milliseconds that the message will be displayed. If not specified the default time is 5s, or 5000ms.
##### Example:
#### Example:
* ``` tools.log('User updated!', 's'); ``` Creates a green alert box with the message specified that will disappear after 5000ms.
* ``` tools.log('Error!', 'e', 10000); ``` Creates a gred alert box with the message specified that will disappear after 10s.
#### tools.getTool(tool)
### tools.getTool(tool)
###### Loads the specified tool. If no tool is specified the tool in the navigaton bar (hashtag) will be choesn.
* ```tool (optional)/text``` Specifies the tool.
##### Example:
* ``` tools.getTool('home'); ``` Will get the /res/tools/```home```.tool and loads it into the site.
#### toggleSideMenu()
### ui.toggleSideMenu()
###### Toggles the sidebar
##### Example:
* ```tools.toggleSideMenu();``` Toggles the sidebar
#### Example:
* ```tools.ui.toggleSideMenu();```
#### mem.local & mem.session
######The mem element can store data for the tools, used for multiple cases. There are 2 tyoes of storage: ```local``` hast no expiration and ```session``` is stored until you close the window or tab. Every tool has separated storage, so you don't need to worry about conflicting with other tools. The subfunctions are the same, a so only ```session``` wil be demonstraded here. local works identically.
### mem.local & mem.session
######The mem element can store data for the tools, used for multiple cases. There are 2 types of storage: ```local``` hast no expiration and ```session``` is stored until you close the window or tab. Every tool has separated storage, so you don't need to worry about conflicting with other tools. The subfunctions are the same, a so only ```session``` wil be demonstraded here. local works identically.
#### set(name, value)
### set(name, value)
######Sets and stores a value. If the value already exists it will be overwritten!
* ```name /text``` Name of the 'variable'.
* ```value /any``` The data to be stored. Can be any valid JS data, object, etc.
##### Example:
#### Example:
* ```tools.mem.session.set('currentUser', 'Sir Anon');``` Stores 'Sir Anon' in 'currentUser'.
* ```tools.mem.session.set('someData', {'car':'tesla'});``` Stores the object in 'someData'.
#### get(name)
### get(name)
###### Returnes the assosiated value. If there is no data it will return ```null```.
* ```name /text``` Name of the 'variable'.
##### Example:
#### Example:
* ```tools.mem.session.get('currentUser'); > 'Sir Anon'``` Retrieves 'currentUser'.
* ```tools.mem.session.set('someData'); > {'car':'tesla'}``` Retrieves 'someData'.
* ```tools.mem.session.set('nopeFoo'); > null``` No data stored unter 'nopeFoo', so returns ```null```.
## Library ```amivcore```:
###### This library serves as medium from the tools to the API, handling all the authentication, requests, etc. Whenever you need to speak with the API it's raccomendet you use ```amivcore```. This is for consistency and usability. Since most of the functions of ```amivcore``` are asyncronous requests, they will need callbackback functions in order to return data.
# Website
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment