-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
191 lines (181 loc) · 8.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Brisk</title>
<link rel="stylesheet" type="text/css" href="css/all.css" media="all"/>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<script src="http://code.jquery.com/jquery-2.0.3.js" type="text/javascript"></script>
<script src="/brisk.js" type="text/javascript"></script>
<script src="/examples/like/actions/common.js" type="text/javascript"></script>
<script src="/examples/like/actions/rate.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/css/rate.css" media="all"/>
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="css/ie.css" media="screen"/><![endif]-->
</head>
<body>
<div id="wrapper">
<div id="header">
<strong class="logo"><a href="#">brisk</a></strong>
<span class="title">brisk</span>
<span class="version">v1.3</span>
<ul class="navigation">
<li><a href="#download">Download</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#about">About</a></li>
</ul>
<span class="discription">"Design-mode Bind Handler<br/>jQuery Plugin" − Brisk</span>
<ul class="social">
<li><a class="github" href="https://github.com/freeart/brisk" target="_blank"></a></li>
<li><a class="twitter" href="https://twitter.com/landgraf_paul" target="_blank"></a></li>
<li><a class="email" href="mailto:landgraf.paul@gmail.com"></a></li>
</ul>
</div>
<div id="main">
<div class="document">
<!--<div class="article">-->
<!--<h2 class="about">about</h2>-->
<!--<div>-->
<!--Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore-->
<!--et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut-->
<!--aliquip ex ea commodo consequat.-->
<!--<br/><br/>-->
<!--Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea-->
<!--commodo consequat aute irure dolor in reprehenderit in voluptate velit esse.-->
<!--<br/><br/>-->
<!--Duis aute irure dolor in reprehenderit in voluptate velit esse-->
<!--cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in-->
<!--culpa qui officia deserunt mollit anim id est laborum. Ut enim ad minim veniam, quis nostrud-->
<!--exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet,-->
<!--consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.-->
<!--</div>-->
<!--<hr/>-->
<!--</div>-->
<div id="download" class="article">
<h2 class="download">download</h2>
<div>
Click here for download <a href="/brisk.js">Brisk.js</a> or have to check my <a target="_blank"
href="https://github.com/freeart/brisk">github
page</a>
</div>
<hr/>
</div>
<div id="examples" class="article">
<h2 class="examples">examples</h2>
<div class="success">Click on the heart to add you LIKE: <a href="#" class="like" data-id="42"
data-rate="1"
role="block">♥ <em>1</em></a>
</div>
<div class="error">Click on the heart to try add you LIKE, but you get an error: <a href="#"
class="like"
data-id="42"
data-rate="1"
role="block">♥ <em>1</em></a>
</div>
<div class="output"></div>
<hr/>
</div>
<div class="article">
<h2 id="about" class="about">WAT?</h2>
<div>
"And what!?" - You can say.<br>
"I Can create this script in 1 min" - You can say. <br>
Yes, and you will be right!<br>
But just look at that:
<pre>
'.success .like': {
click: {
action: [
'common.stopEvent',
'common.addLoader',
'common.dataGrabber',
'output.tryToSave',
'rate.actionEmulationOnClient',
'rate.getResponseFromServer',
'common.render'
],
always: 'common.removeLoader',
fail: [
'rate.rollback',
'output.error'
],
done: [
'common.success',
'output.saved'
]
}
}
</pre>
It's like Functional programming, you use many simple functions for get big result.<br/>
If you want to create big system like FB (not FBI) you will like this style (paradigm).<br/>
Look. You have to make a button, a simple button that sends a result to the server (simple save).<br/>
And so over time you want fix many problems with the button like: need to block screen while have a
saving, show message after, rollback prev. data and etc.<br/>
So, I wrote many simple functions for resolving your little "problems". And you will create new and
new functions.<br/>
And after you can use them repeatedly.<br/>
You can use them in another projects. And you can very fast add or remove functionality without
problems.<br/>
If function have little size (about 10 lines) you can test it for errors and the most important
thing:<br/>
if something will be wrong you can get result and check for what happened at fail section.<br/>
How you can see it works very simple: step by step functions get result from prev. and return result
to next function in sequence.<br/>
If into the function you have a error (in action section) - result will return to section fail.<br/>
And after will post to section always.<br/>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var pageConfig = {
'.success .like': {
click: {
action: [
'common.stopEvent',
'common.addLoader',
'common.dataGrabber',
'output.tryToSave',
'rate.actionEmulationOnClient',
'rate.getResponseFromServer',
'common.render'
],
always: 'common.removeLoader',
fail: [
'rate.rollback',
'output.error'
],
done: [
'common.success',
'output.saved'
]
}
},
'.error .like': {
click: {
action: ['common.stopEvent',
'common.addLoader',
'common.dataGrabber',
'output.tryToSave',
'rate.actionEmulationOnClient',
'rate.getErrorFromServer',
'common.render'
],
always: 'common.removeLoader',
fail: ['rate.rollback',
'output.error'
],
done: ['common.success',
'output.saved'
]
}
}
}
$(document).ready(function () {
$.brisk(pageConfig, window.App.actions);
});
</script>
</body>
</html>