README.md 3.13 KB
Newer Older
CupCakeArmy's avatar
CupCakeArmy committed
1
2
3
4
5
# Frontend

## Software

### Admintool:
CupCakeArmy's avatar
CupCakeArmy committed
6
7
8
* ```ubuntu /14.04.1```
* ```nginx /1.4.6```

CupCakeArmy's avatar
CupCakeArmy committed
9
10
11
12
### Website:
* undef.

# Admintool
CupCakeArmy's avatar
CupCakeArmy committed
13
### Dependecies:
CupCakeArmy's avatar
CupCakeArmy committed
14
15
16
* ```jQuery /2.2.2```
* ```bootstrap /3.3.6```
* ```amivaccess /1.0```
CupCakeArmy's avatar
CupCakeArmy committed
17

CupCakeArmy's avatar
CupCakeArmy committed
18
# Structure
CupCakeArmy's avatar
CupCakeArmy committed
19
20
21
22
* admin (Admintool)
	* lib (Libraries)
		* bootstrap
		* jquery
CupCakeArmy's avatar
CupCakeArmy committed
23
		* amiv (amivaccess)
CupCakeArmy's avatar
CupCakeArmy committed
24
25
26
27
28
29
30
31
32
33
34
35
		* cust (custom files)
			* main.js (our js file)
			* main.css (our css file)
	* res (Resources)
		* bg (big pictures and backgrounds)
		* favicon
		* fonts
		* logo
	* tools (tools)
		* main.tool
		* users.tool
		* ...
CupCakeArmy's avatar
CupCakeArmy committed
36
37
38
* public (Website)	
		
	
CupCakeArmy's avatar
CupCakeArmy committed
39

CupCakeArmy's avatar
CupCakeArmy committed
40
41
### 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.
CupCakeArmy's avatar
CupCakeArmy committed
42

CupCakeArmy's avatar
CupCakeArmy committed
43
#### log(msg, type, timeout)
CupCakeArmy's avatar
CupCakeArmy committed
44
45
46
47
48
49
50
51
######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.
	* s: success
	* i: information
	* 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.
CupCakeArmy's avatar
CupCakeArmy committed
52
##### Example:
CupCakeArmy's avatar
CupCakeArmy committed
53
54
55
* ``` 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.

CupCakeArmy's avatar
CupCakeArmy committed
56
#### tools.getTool(tool)
CupCakeArmy's avatar
CupCakeArmy committed
57
58
59
60
61
###### 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.

CupCakeArmy's avatar
CupCakeArmy committed
62
#### toggleSideMenu()
CupCakeArmy's avatar
CupCakeArmy committed
63
###### Toggles the sidebar
CupCakeArmy's avatar
CupCakeArmy committed
64
##### Example:
CupCakeArmy's avatar
CupCakeArmy committed
65
* ```tools.toggleSideMenu();``` Toggles the sidebar
CupCakeArmy's avatar
CupCakeArmy committed
66

CupCakeArmy's avatar
CupCakeArmy committed
67
#### mem.local & mem.session
CupCakeArmy's avatar
CupCakeArmy committed
68
######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.
CupCakeArmy's avatar
CupCakeArmy committed
69

CupCakeArmy's avatar
CupCakeArmy committed
70
#### set(name, value)
CupCakeArmy's avatar
CupCakeArmy committed
71
72
73
74
######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.

CupCakeArmy's avatar
CupCakeArmy committed
75
##### Example:
CupCakeArmy's avatar
CupCakeArmy committed
76
77
78
* ```tools.mem.session.set('currentUser', 'Sir Anon');``` Stores 'Sir Anon' in 'currentUser'.
* ```tools.mem.session.set('someData', {'car':'tesla'});``` Stores the object in 'someData'.

CupCakeArmy's avatar
CupCakeArmy committed
79
#### get(name)
CupCakeArmy's avatar
CupCakeArmy committed
80
81
82
###### Returnes the assosiated value. If there is no data it will return ```null```.
* ```name /text``` Name of the 'variable'.

CupCakeArmy's avatar
CupCakeArmy committed
83
##### Example:
CupCakeArmy's avatar
CupCakeArmy committed
84
85
86
87
88
89
* ```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```.


# Website