forked from menusal/printMe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
291 lines (269 loc) · 7.56 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title> jQuery - PrintMe</title>
<meta name="author" content="Daniel Arlandis - daniarlandis.es">
<meta name="description" content="jQuery PrintMe - A jQuery plugin for print any page element ">
<meta name="viewport" content="width=device-width">
<link href="bootstrap.min.css" rel="stylesheet">
<link href="main.css" rel="stylesheet">
<script src="jquery.min.js"></script>
<script src="jquery-printme.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#example1").click(function(){
$("#dataexample").printMe();
});
$("#example2").click(function(){
$("#dataexample2").printMe({
"path" : ["example.css","example2.css"]
});
});
$("#example3").click(function(){
$("#dataexample3").printMe({
"path" : ["example.css"],
"title" : "Document title"
});
});
});
</script>
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">PrintMe</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#options">Options</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#about">About</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container main">
<div class="jumbotron">
<h1>jQuery PrintMe</h1>
<h3>Yes! Another jQuery plugin for print any page element</h3>
<p>PrintMe is a lightweight Plugin to print any html element.</p>
<p><a href="https://github.com/menusal/printMe" class="btn btn-primary btn-lg" role="button">Get from github</a></p>
</div>
<div class="page-header" id="usage">
<h1>Why PrintMe?</h1>
<p>I'm bored and a plugin was born. It is the story of my life. I'm bored, plugin, again and again ...</p>
<br/>
</div>
<div class="page-header" id="usage">
<h1>Usage</h1>
<br/>
</div>
<div class="row">
<h2>Step 1 - Include your Javascript </h2>
<p>printMe is a jQuery plugin, so you gotta have that first:</p>
<code>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</code>
<p>Then, just include jquery-printme.js, wherever it lives on your server:</p>
<code>
<span><script src="path_to/jquery-printme.js"></script></span>
</code>
<h2>Step 2 - PrintMe!</h2>
<p>Now you can print any element.</p>
<p>Here are a few examples:</p>
</div>
<div class="row">
<p>Basic:</p>
<p>
<code>
$("#example").printMe();
</code>
</p>
<p>With external css styles, add all stylesheets you can need in the array</p>
<p>
<code>
$("#example").printMe({ "path": ["path_to/eternal.css","path_to/eternal2.css"] });
</code>
</p>
<p>With title</p>
<p>
<code>
$("#example").printMe({ "title": "The title" });
</code>
</p>
</div>
<div class="page-header" id="options">
<h1>Options</h1>
</div>
<div class="row">
<p>Options:</p>
<ul>
<li> <b>path:</b> Array with a external css file location </li>
<li> <b>title:</b> The document header title </li>
</ul>
</div>
<div class="page-header" id="examples">
<h1>Examples</h1>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Print without css styles</h3>
</div>
<div id="dataexample">
<table class="table">
<thead>
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
</tr>
</thead>
<tbody>
<tr>
<td> A </td>
<td> B </td>
<td> C </td>
</tr>
<tr>
<td> D </td>
<td> E </td>
<td> F </td>
</tr>
</tbody>
</table>
</div>
<div class="panel-body">
<p>Code:</p>
<p>
<code>
$("#example").printMe();
</code>
</p>
<hr/>
<p>
<button id="example1" class="btn btn-primary"> Print </button>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Print with external css styles</h3>
</div>
<div id="dataexample2">
<table class="table">
<thead>
<tr>
<th class="blue">Col1</th>
<th class="blue">Col2</th>
<th class="blue">Col3</th>
</tr>
</thead>
<tbody>
<tr>
<td> A </td>
<td> B </td>
<td> C </td>
</tr>
<tr>
<td> D </td>
<td> E </td>
<td> F </td>
</tr>
</tbody>
</table>
</div>
<div class="panel-body">
<p>Code:</p>
<p>
<code>
$("#example").printMe({
"path": ["path_to/eternal.css"]
});
</code>
</p>
<hr/>
<p>
<button id="example2" class="btn btn-primary"> Print with external css </button>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Print with title</h3>
</div>
<div id="dataexample3">
<table class="table">
<thead>
<tr>
<th class="blue">Col1</th>
<th class="blue">Col2</th>
<th class="blue">Col3</th>
</tr>
</thead>
<tbody>
<tr>
<td> A </td>
<td> B </td>
<td> C </td>
</tr>
<tr>
<td> D </td>
<td> E </td>
<td> F </td>
</tr>
</tbody>
</table>
</div>
<div class="panel-body">
<p>Code:</p>
<p>
<code>
$("#example").printMe({
"path": ["path_to/eternal.css"],
"title": "Document title"
});
</code>
</p>
<hr/>
<p>
<button id="example3" class="btn btn-primary"> Print with title</button>
</p>
</div>
</div>
</div>
</div>
<div class="page-header" id="about">
<h1>About</h1>
</div>
<div class="row">
<p>PrintMe has been developped by Daniel Arlandis <a href="https://twitter.com/menusal">@menusal</a></p>
<br/>
<p>That's about all there is to know! Happy printing! If you find any interesting uses for this little library, please let me know!
<br/>Issues and Pull Requests are more than welcome!
<br/><br/>If you have any questions, drop me a line at: daniarlandis@gmail.com</p>
</div>
</div>
</body>
</html>