-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
142 lines (119 loc) · 6.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>stProgress: A slim top progress bar</title>
<link rel="stylesheet" type="text/css" href="src/stprogress.css"></link>
<style>
body {
font-family: 'Palatino', sans-serif;
margin: 60px 8%;
line-height: 25px;
}
h1 {
border-bottom: 1px solid #000;
line-height: 50px;
}
a,
span {
color: #000;
text-decoration: none;
border-bottom: 1px solid #000;
padding-bottom: 3px;
cursor: pointer;
}
code {
background-color: #E8E8E8;
font-size: 15px;
}
</style>
</head>
<body>
<div id="progress"></div>
<h1>stProgress.js</h1>
<p>
<style>.bmc-button img{width: 27px !important;margin-bottom: 1px !important;box-shadow: none !important;border: none !important;vertical-align: middle !important;}.bmc-button{line-height: 36px !important;height:37px !important;text-decoration: none !important;display:inline-flex !important;color:#FFFFFF !important;background-color:#FF813F !important;border-radius: 3px !important;border: 1px solid transparent !important;padding: 1px 9px !important;font-size: 23px !important;letter-spacing: 0.6px !important;box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;margin: 0 auto !important;font-family:'Cookie', cursive !important;-webkit-box-sizing: border-box !important;box-sizing: border-box !important;-o-transition: 0.3s all linear !important;-webkit-transition: 0.3s all linear !important;-moz-transition: 0.3s all linear !important;-ms-transition: 0.3s all linear !important;transition: 0.3s all linear !important;}.bmc-button:hover, .bmc-button:active, .bmc-button:focus {-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;text-decoration: none !important;box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;opacity: 0.85 !important;color:#FFFFFF !important;}</style><link href="https://fonts.googleapis.com/css?family=Cookie" rel="stylesheet"><a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/rath"><img src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:5px; border-bottom: none">Buy me a coffee</span></a>
</p>
<p><a href="https://github.com/ShivrajRath/stprogress">Check on github</a></p>
<p>A light-weighted slim top progress bar to indicate service calls happening from your app. This is particularly useful for AJAX heavy applications. Just include the library and it takes care of rest.</p>
<h2>Install</h2>
<ul>
<li><a href="./src/stprogress.js">stprogress.js</a>
</li>
<li><a href="./src/stprogress.min.js">stprogress.min.js</a>
</li>
<li><code>npm install stprogress</code>
</li>
<li><code>bower install stprogress</code>
</li>
</ul>
<h2>How to use</h2>
<ul>
<li>Include the script.</li>
<li>Add <code><div id="progress"></div></code> to your primary html.</li>
<li>Move <a href="./src/stprogress.css">stprogress.css</a> content to your css. You can customize progress bar color.</li>
<li>That's all. <a href="http://novicelab.org/project/stprogress/591/">Read blog post</a></li>
</ul>
<h2>Features</h2>
<ul>
<li> No Configuration needed</li>
<li> Automatically displays progressbar if AJAX calls are in background</li>
<li> Runs with any framework</li>
<li> AMD/CommonJS Support</li>
<li> 1kb minified</li>
</ul>
<h2>Demo</h2>
<span onclick="singleService()">Single service</span>
<span href="#" onclick="multipleServices()">Mutiple services</span>
<div class="services"></div>
<h2>Licence</h2>
<p>
<p>The MIT License (MIT)</p>
<p>Copyright (c) 2015 Shivraj Rath</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
</p>
<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
</p>
<h3>
<a href="http://twitter.com/shivrajrath">Twitter</a>
<a href="http://github.com/shivrajrath">Github</a>
</h3>
<!--jQuery added for demo. stProgress.js is not dependent on jQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="src/stprogress.js"></script>
<script>
function makeRequest(requestStr) {
$.ajax({
type: "GET",
url: requestStr,
dataType: "json",
success: function (d) {
$('.services').append('<p>' + requestStr + ' service success</p>');
},
error: function (e) {
$('.services').append('<p><em>' + requestStr + '</em> service failure</p>')
}
});
}
function singleService() {
makeRequest('./data/data1.json');
}
function multipleServices() {
makeRequest('./data/data1.json');
makeRequest('./data/data2.json');
makeRequest('./data/data3.json');
// Error scenario
makeRequest('./data/data4.json');
}
singleService();
</script>
</body>
</html>
</html>