-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
892 lines (878 loc) · 53 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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
<!DOCTYPE html>
<html>
<head>
<title>fConsole.js v1.1.2 - For touch devices and desktop browsers</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Lato:400,300,700,900" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div class="header">
<div class="h-content">
<div class="menu clearfix">
<div class="js-logo"><img src="images/javascript-logo.png" /></div>
<ul>
<li><a href="#example1">Example 1</a></li>
<li><a href="#example2">Example 2</a></li>
<li><a href="#example3">Example 3</a></li>
<li><a href="#example4">Example 4</a></li>
<li><a href="#example5">Helper Methods</a></li>
<li><a href="#example6">Settings</a></li>
<li><a class="buy" href="https://codecanyon.net/item/javascript-console-fconsole/14351041">Buy</a></li>
</ul>
</div>
<div class="text">
<h1 class="title">fConsole.js v1.1.2</h1>
<p class="description">
A high-speed performance jQuery plugin for touch devices and desktop browsers.<br />
It will help you to get like any information you need (JavaScript | HTML | CSS)<br />
in environments like mobile phones, tables or browsers.
</p>
</div>
</div>
</div>
<div class="content">
<div class="example example1">
<a name="example1"></a>
<div class="text">
<h2>Example 1</h2>
<p>Execute simple function and see the results.</p>
</div>
<div class="actions">
<button id="a1">Get Current Url</button>
<button id="a2">Get Body BgColor</button>
<button id="a3">Get Current Date</button>
</div>
</div>
<div class="example example2">
<a name="example2"></a>
<div class="text">
<h2>Example 2</h2>
<p>Custom colors for your messages.</p>
</div>
<div class="actions">
<button id="a1">Message with Blue BgColor</button>
<button id="a2">Message with Yellow BgColor & Black Text</button>
<button id="a3">Message with Red BgColor</button>
</div>
</div>
<div class="example example3">
<a name="example3"></a>
<div class="text">
<h2>Example 3</h2>
<p>Show information in <b>real time</b>.</p>
</div>
<div class="actions">
<button id="a1">Show Current Time</button>
<button id="a2">Show Mouse Postion</button>
<button id="a3">Yellow Top Position</button>
<button id="a4">Red Left Position</button>
<button id="a5">Current BgColor</button>
</div>
<div class="animation-wrapper">
<div id="animation-element-1">test 1</div>
<div id="animation-element-2">test 2</div>
<div id="animation-element-3">test 3</div>
</div>
</div>
<div class="example example4">
<a name="example4"></a>
<div class="text">
<h2>Example 4</h2>
<p>Log JS errors.</p>
</div>
<div class="actions">
<button id="a1">Value of 'test' var</button>
<button id="a2">1 / 0</button>
<button id="a3">Execute metod 'someFunction'</button>
</div>
</div>
<div class="example example5">
<a name="example5"></a>
<div class="text">
<h2>Help Functions</h2>
<p>General methods that may help you.</p>
</div>
<div class="actions">
<ul>
<li>
<h3>Boolean:</h3>
<ul>
<!--isNumeric-->
<li>
<div class="method-name">fConsole.fn.isNumeric()</div>
<div class="method-use">
<p>Check if a string is a number</p>
<pre><span class="code">fConsole.fn.isNumeric("123");</span> //will return true<br /><span class="code">fConsole.fn.isNumeric("123$%");</span> //will return false</pre>
</div>
</li>
<!--isInt-->
<li>
<div class="method-name">fConsole.fn.isInt()</div>
<div class="method-use">
<p>Check if a number is integer</p>
<pre><span class="code">fConsole.fn.isInt(123);</span> //will return true<br /><span class="code">fConsole.fn.isInt(123.25);</span> //will return false</pre>
</div>
</li>
<!--isFloat-->
<li>
<div class="method-name">fConsole.fn.isFloat()</div>
<div class="method-use">
<p>Check if a number is float</p>
<pre><span class="code">fConsole.fn.isFloat(123.25);</span> //will return true<br /><span class="code">fConsole.fn.isFloat(123);</span> //will return false</pre>
</div>
</li>
<!--isBoolean-->
<li>
<div class="method-name">fConsole.fn.isBoolean()</div>
<div class="method-use">
<p>Check if a variable is of type boolean</p>
<pre><span class="code">var x = true;<br />fConsole.fn.isBoolean(x);</span> //will return true<br /><span class="code">var x = 123;<br />fConsole.fn.isBoolean(x);</span> //will return false</pre>
</div>
</li>
<!--isTouchDevice-->
<li>
<div class="method-name">fConsole.fn.isTouchDevice()</div>
<div class="method-use">
<p>Check if your using a touch device <span class="alert">(is not 100% accurate)</span></p>
<pre><span class="code">fConsole.fn.isTouchDevice();</span> //will return true or false</pre>
</div>
</li>
<!--isiOS-->
<li>
<div class="method-name">fConsole.fn.isiOS()</div>
<div class="method-use">
<p>Check if your devices is runging on iOS</p>
<pre><span class="code">fConsole.fn.isiOS();</span> //will return true or false</pre>
</div>
</li>
<!--isAndroid-->
<li>
<div class="method-name">fConsole.fn.isAndroid()</div>
<div class="method-use">
<p>Check if your device is runging on Andorid</p>
<pre><span class="code">fConsole.fn.isAndroid();</span> //will return true or false</pre>
</div>
</li>
<!--isWindowsPhone-->
<li>
<div class="method-name">fConsole.fn.isWindowsPhone()</div>
<div class="method-use">
<p>Check if your device is runging on Andorid</p>
<pre><span class="code">fConsole.fn.isWindowsPhone();</span> //will return true or false</pre>
</div>
</li>
<!--isMobile-->
<li>
<div class="method-name">fConsole.fn.isMobile()</div>
<div class="method-use">
<p>Check if your device is a mobile device <span class="alert">(is not 100% accurate)</span></p>
<pre><span class="code">fConsole.fn.isMobile();</span> //will return true or false</pre>
</div>
</li>
<!--jQueryIsAvailable-->
<li>
<div class="method-name">fConsole.fn.jQueryIsAvailable()</div>
<div class="method-use">
<p>Check if jQuery library is avaible</p>
<pre><span class="code">fConsole.fn.jQueryIsAvailable();</span> //will return true or false</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Colors:</h3>
<ul>
<!--rgbToHex-->
<li>
<div class="method-name">fConsole.fn.rgbToHex()</div>
<div class="method-use">
<p>Convert a RGB value into HEX value</p>
<pre><span class="code">fConsole.fn.rgbToHex("rgb(122,188,255)");</span> //will return "#7abcff"</pre>
</div>
</li>
<!--hexToRgb-->
<li>
<div class="method-name">fConsole.fn.hexToRgb()</div>
<div class="method-use">
<p>Convert a HEX value into RGB value</p>
<pre><span class="code">var rgb = fConsole.fn.hexToRgb("#7abcff");</span> //will return rgb.r => 122; rgb.g => 188; rgb.b => 255</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Size related:</h3>
<ul>
<!--getWindowWidth-->
<li>
<div class="method-name">fConsole.fn.getWindowWidth()</div>
<div class="method-use">
<p>Get screen width</p>
<pre><span class="code">fConsole.fn.getWindowWidth();</span> //will return your screen width</pre>
</div>
</li>
<!--getWindowHeight-->
<li>
<div class="method-name">fConsole.fn.getWindowHeight()</div>
<div class="method-use">
<p>Get screen height</p>
<pre><span class="code">fConsole.fn.getWindowHeight();</span> //will return your screen height</pre>
</div>
</li>
<!--getDocumetHeight-->
<li>
<div class="method-name">fConsole.fn.getDocumetHeight()</div>
<div class="method-use">
<p>Get documet height</p>
<pre><span class="code">fConsole.fn.getDocumetHeight();</span> //will return your documet height</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Cookies:</h3>
<ul>
<!--setCookie-->
<li>
<div class="method-name">fConsole.fn.setCookie()</div>
<div class="method-use">
<p>Create a new Cookie</p>
<pre><span class="code">fConsole.fn.setCookie("cookie-name", "cookie-value", 3);</span> //will create a cookie with the name "cookie-name" and value "cookie-value". Will expire in 3 days.</pre>
</div>
</li>
<!--setTempCookie-->
<li>
<div class="method-name">fConsole.fn.setTempCookie()</div>
<div class="method-use">
<p>Create a new Cookie that will expire when you close the browser</p>
<pre><span class="code">fConsole.fn.setTempCookie("cookie-name", "cookie-value");</span> //will create a cookie with the name "cookie-name" and value "cookie-value".</pre>
</div>
</li>
<!--setTempCookie-->
<li>
<div class="method-name">fConsole.fn.getCookie()</div>
<div class="method-use">
<p>Get the value of a specific Cookie</p>
<pre><span class="code">fConsole.fn.getCookie("cookie-name");</span> //will return cookie value or 'null' if the cookie donesn't exists.</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Validations:</h3>
<ul>
<!--validateEmail-->
<li>
<div class="method-name">fConsole.fn.validateEmail()</div>
<div class="method-use">
<p>Validate an email addrees</p>
<pre><span class="code">fConsole.fn.validateEmail("[email protected]");</span> //will return true<br /><span class="code">fConsole.fn.validateEmail("[email protected]");</span> //will return false</pre>
</div>
</li>
<!--validateIPaddress-->
<li>
<div class="method-name">fConsole.fn.validateIPaddress()</div>
<div class="method-use">
<p>Validate an IP addrees</p>
<pre><span class="code">fConsole.fn.validateIPaddress("192.168.1.1");</span> //will return true<br /><span class="code">fConsole.fn.validateIPaddress("210.110");</span> //will return false</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Strings:</h3>
<ul>
<!--format-->
<li>
<div class="method-name">fConsole.fn.format()</div>
<div class="method-use">
<p>Replaces one or more format items in a specified string with the string representation of a specified object.</p>
<pre><span class="code">fConsole.fn.format("{0} is in love with {1}", "black", "white");</span> //will return "black is in love with white"</pre>
</div>
</li>
<!--capitalize-->
<li>
<div class="method-name">fConsole.fn.capitalize()</div>
<div class="method-use">
<p>Capitalize words in a string</p>
<pre><span class="code">fConsole.fn.capitalize("your string");</span> //will return "Your String"</pre>
</div>
</li>
<!--capitalizeFirstLetter-->
<li>
<div class="method-name">fConsole.fn.capitalizeFirstLetter()</div>
<div class="method-use">
<p>Capitalize fist letter of a string</p>
<pre><span class="code">fConsole.fn.capitalizeFirstLetter("your string");</span> //will return "Your string"</pre>
</div>
</li>
<!--startsWith-->
<li>
<div class="method-name">fConsole.fn.startsWith()</div>
<div class="method-use">
<p>Determines whether the beginning of a string instance matches a specified string. Parameters string, prefix, ignoreCases</p>
<pre><span class="code">fConsole.fn.startsWith("your string", y);</span> //will return true<br /><span class="code">fConsole.fn.startsWith("your string", G);</span> //will return false<br /><span class="code">fConsole.fn.startsWith("your string", Y, true);</span> //will return true</pre>
</div>
</li>
<!--endsWith-->
<li>
<div class="method-name">fConsole.fn.endsWith()</div>
<div class="method-use">
<p>Determines whether the end of a string instance matches the specified string. Parameters string, suffix, ignoreCases</p>
<pre><span class="code">fConsole.fn.endsWith("your string", g);</span> //will return true<br /><span class="code">fConsole.fn.startsWith("your string", W);</span> //will return false<br /><span class="code">fConsole.fn.startsWith("your string", G, true);</span> //will return true</pre>
</div>
</li>
<!--replaceAll-->
<li>
<div class="method-name">fConsole.fn.replaceAll()</div>
<div class="method-use">
<p>Replace all occurrences of a string with another string</p>
<pre><span class="code">fConsole.fn.replaceAll("If it looks like a duck, quacks like a duck, it's a duck!", "duck", "dog");</span> //will return "If it looks like a dog, quacks like a dog, it's a dog!"</pre>
</div>
</li>
<!--linkify-->
<li>
<div class="method-name">fConsole.fn.linkify()</div>
<div class="method-use">
<p>Will replace plain URLs with links <span class="alert">(is not 100% accurate)</span></p>
<pre><span class="code">fConsole.fn.linkify("[email protected]");</span> //will return "<a href='mailto:[email protected]'>[email protected]</a>"</pre>
</div>
</li>
<!--linkify-->
<li>
<div class="method-name">fConsole.fn.contains()</div>
<div class="method-use">
<p>Returns true of false indicating whether a specified substring occurs within this string.</p>
<pre><span class="code">fConsole.fn.contains("foo", "oo");</span> //will return true</pre>
</div>
</li>
<!--encodeHTML-->
<li>
<div class="method-name">fConsole.fn.encodeHTML()</div>
<div class="method-use">
<p>This method makes sure that text is displayed correctly in the browser and not interpreted by the browser as HTML.</p>
<pre><span class="code">fConsole.fn.encodeHTML("<li><div class='method-name'>fConsole.fn.encodeHTML()</div>")</span> //will return "&lt;li&gt;&lt;div class='method-name'&gt;fConsole.fn.encodeHTML()&lt;/div&gt;"<br /></pre>
</div>
</li>
<!--decodeHTML-->
<li>
<div class="method-name">fConsole.fn.decodeHTML()</div>
<div class="method-use">
<p>Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.</p>
<pre><span class="code">fConsole.fn.decodeHTML("&lt;li&gt;&lt;div class='method-name'&gt;fConsole.fn.encodeHTML()&lt;/div&gt;")</span> //will return "<li><div class='method-name'>fConsole.fn.encodeHTML()</div>"<br /></pre>
</div>
</li>
<!--encodeBase64-->
<li>
<div class="method-name">fConsole.fn.encodeBase64()</div>
<div class="method-use">
<p>Encode a string in Base 64</p>
<pre><span class="code">fConsole.fn.encodeBase64("home sweet home");</span> //will return "aG9tZSBzd2VldCBob21l"</pre>
</div>
</li>
<!--decodeBase64-->
<li>
<div class="method-name">fConsole.fn.decodeBase64()</div>
<div class="method-use">
<p>Decode a string from Base 64</p>
<pre><span class="code">fConsole.fn.decodeBase64("aG9tZSBzd2VldCBob21l");</span> //will return "home sweet home"</pre>
</div>
</li>
<!--encodeUTF8Base64-->
<li>
<div class="method-name">fConsole.fn.encodeUTF8Base64()</div>
<div class="method-use">
<p>Encode a UTF-8 string in Base 64</p>
<pre><span class="code">fConsole.fn.encodeUTF8Base64("ăaîbțcșdțe");</span> //will return "ÄaîbÈcÈdÈe"</pre>
</div>
</li>
<!--decodeBase64-->
<li>
<div class="method-name">fConsole.fn.decodeBase64()</div>
<div class="method-use">
<p>Decode a UTF-8 string from Base 64</p>
<pre><span class="code">fConsole.fn.decodeUTF8Base64("ÄaîbÈcÈdÈe");</span> //will return "ăaîbțcșdțe"</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>URL:</h3>
<ul>
<!--getUrlParams-->
<li>
<div class="method-name">fConsole.fn.getUrlParams()</div>
<div class="method-use">
<p>Return url parameters and their values</p>
<pre><span class="code">var result = fConsole.fn.getUrlParams("http://compedio.ro/fConsole?param1=a&param2=b");</span> //will return result[0] => "param1" | result[1] => "param2" and result[result[0]] => "a" | result[result[1]] => "b"</pre>
</div>
</li>
<!--encodeURL-->
<li>
<div class="method-name">fConsole.fn.encodeURL()</div>
<div class="method-use">
<p>Encode a URL</p>
<pre><span class="code">fConsole.fn.encodeURL("page=2&sort=frequent&pagesize=15")</span> //will return "page%3D2%26sort%3Dfrequent%26pagesize%3D15"</pre>
</div>
</li>
<!--decodeURL-->
<li>
<div class="method-name">fConsole.fn.decodeURL()</div>
<div class="method-use">
<p>Decode a URL</p>
<pre><span class="code">fConsole.fn.decodeURL("page%3D2%26sort%3Dfrequent%26pagesize%3D15")</span> //will return "page=2&sort=frequent&pagesize=15"</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>JSON & Arrays:</h3>
<ul>
<!--sortJSONby-->
<li>
<div class="method-name">fConsole.fn.sortJSONby()</div>
<div class="method-use">
<p>Sort a JSON by a propery ASC or DESC</p>
<pre><span class="code">var jsonTest = [{ "letter": "c" }, { "letter": "a" }, { "letter": "b" }];<br />var result = fConsole.fn.sortJSONby(jsonTest, "letter", "asc");</span> //will return the json sorted ASC</pre>
</div>
</li>
<!--shuffleArray-->
<li>
<div class="method-name">fConsole.fn.shuffleArray()</div>
<div class="method-use">
<p>Randomize (shuffle) a Javascript array</p>
<pre><span class="code">var array = [2, 11, 37, 42];<br />fConsole.fn.shuffleArray(array);</span> //example of return -> [11, 37, 2, 42]</pre>
</div>
</li>
<!--uniqueArray-->
<li>
<div class="method-name">fConsole.fn.uniqueArray()</div>
<div class="method-use">
<p>Remove duplicates from an array</p>
<pre><span class="code">var array = [2, 11, 2, 42];<br />fConsole.fn.uniqueArray(array);</span> //will return -> [2, 11, 42]</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>DateTime:</h3>
<ul>
<!--getCurrentTime-->
<li>
<div class="method-name">fConsole.fn.getCurrentTime()</div>
<div class="method-use">
<p>Get current time. First parameter is format ("hh:mm:ss a") | (hh:mm) | etc. Second parameter is 24 hours format, and is true by default</p>
<pre><span class="code">fConsole.fn.getCurrentTime("hh:mm:ss a")</span> //will return "22:55:16 PM"<br /><span class="code">fConsole.fn.getCurrentTime("hh:mm", false)</span> //will return "10:55"</pre>
</div>
</li>
<!--getCurrentTimeAddHours-->
<li>
<div class="method-name">fConsole.fn.getCurrentTimeAddHours()</div>
<div class="method-use">
<p>Get current time with add/subtract hours. First parameter is how much hours to add/substract, second parameter is format ("hh:mm:ss a") | (hh:mm) | etc and third parameter is 24 hours format, and is true by default</p>
<pre><span class="code">fConsole.fn.getCurrentTimeAddHours(2, "hh:mm:ss a")</span> //will return "18:59:16 PM"<br /><span class="code">fConsole.fn.getCurrentTimeAddHours(1, "hh:mm", false)</span> //will return "06:01"</pre>
</div>
</li>
<!--getCurrentDate-->
<li>
<div class="method-name">fConsole.fn.getCurrentDate()</div>
<div class="method-use">
<p>Get current date (just the simple format, dd | mm | yyyy). First parameter is format ("dd/mm/yyyy")</p>
<pre><span class="code">fConsole.fn.getCurrentDate("dd/mm/yyyy")</span> //will return "11/01/2016"<br /><span class="code">fConsole.fn.getCurrentDate("mm-dd-yyyy")</span> //will return "01-11-2016"</pre>
</div>
</li>
<!--getCurrentDateTime-->
<li>
<div class="method-name">fConsole.fn.getCurrentDateTime()</div>
<div class="method-use">
<p>Get current date & time with add/subtract hours (just the simple format, dd | mm | yyyy | hh | mi | ss | a). First parameter is how much hours to add/substract, second parameter is format ("dd-mm-yyyy hh:mi:ss a") and third parameter is 24 hours format, and is true by default</p>
<pre><span class="code">fConsole.fn.getCurrentDateTime(1, "yyyy-mm-dd hh:mi:ss a", false)</span> //will return "2018-03-15 06:11:42 PM"<br /><span class="code">fConsole.fn.getCurrentDateTime(-2, "yyyy-mm-dd hh:mi:ss a", true)</span> //will return "2018-03-15 15:12:38 PM"</pre>
</div>
</li>
<!--getUTCDateTime-->
<li>
<div class="method-name">fConsole.fn.getUTCDateTime()</div>
<div class="method-use">
<p>Get UTC DateTime</p>
<pre><span class="code">fConsole.fn.getUTCDateTime()</span> //will return "2016-02-18 12:43:41.513"</pre>
</div>
</li>
<!--leapYear-->
<li>
<div class="method-name">fConsole.fn.leapYear()</div>
<div class="method-use">
<p>Check if year is leap year</p>
<pre><span class="code">fConsole.fn.leapYear(2016)</span> //will return true<br /></pre>
</div>
</li>
<!--getTimeAgoFromJsDate-->
<li>
<div class="method-name">fConsole.fn.getTimeAgoFromJsDate()</div>
<div class="method-use">
<p>Get time ago format from a JS date</p>
<pre><span class="code">fConsole.fn.getTimeAgoFromJsDate(Date.now() - 99999999999)</span> //3 years ago<br /></pre>
</div>
</li>
<!--getTimeAgoFromSqlDate-->
<li>
<div class="method-name">fConsole.fn.getTimeAgoFromSqlDate()</div>
<div class="method-use">
<p>Get time ago format from a SQL date - format should always be: yyyy-mm-dd hh:mm:ss.ms</p>
<pre><span class="code">fConsole.fn.getTimeAgoFromSqlDate("2016-03-15 10:00:00.00")</span> //Last week<br /></pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Random:</h3>
<ul>
<li class="type-of-methods">
<h2>Random</h2>
<hr class="divider" />
</li>
<!--generateRandomInt-->
<li>
<div class="method-name">fConsole.fn.generateRandomInt()</div>
<div class="method-use">
<p>Generate a random integer number. Parameteres are min and max.</p>
<pre><span class="code">fConsole.fn.generateRandomInt(1, 100)</span> //example of return 7</pre>
</div>
</li>
<!--generateRandomArbitrary-->
<li>
<div class="method-name">fConsole.fn.generateRandomArbitrary()</div>
<div class="method-use">
<p>Generate a random number. Parameteres are min, max and nrOfdecimallaces.</p>
<pre><span class="code">fConsole.fn.generateRandomArbitrary(1, 100, 3)</span> //example of return 99.309</pre>
</div>
</li>
<!--generateRandomString-->
<li>
<div class="method-name">fConsole.fn.generateRandomString()</div>
<div class="method-use">
<p>Generate a random string. Parameteres are len and charSet (-> is optional).</p>
<pre><span class="code">fConsole.fn.generateRandomString(5)</span> //example of return "nFkfL"<br /><span class="code">fConsole.fn.generateRandomString(3, "abcd")</span> //example of return "bba"</pre>
</div>
</li>
<!--generateGUID-->
<li>
<div class="method-name">fConsole.fn.generateGUID()</div>
<div class="method-use">
<p>Generate a GUID</p>
<pre><span class="code">fConsole.fn.generateGUID();</span> //example of return "c0e22597-3bc1-4830-98ef-84847211ca99"</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Devices:</h3>
<ul>
<!--isiOS-->
<li>
<div class="method-name">fConsole.fn.isiOS()</div>
<div class="method-use">
<p>check if a device it's an Apple device (iPhone, iPad, etc.)</p>
<pre><span class="code">fConsole.fn.isiOS();</span> //example of return true or false</pre>
</div>
</li>
<!--isAndroid-->
<li>
<div class="method-name">fConsole.fn.isAndroid()</div>
<div class="method-use">
<p>check if a device it's an run on a Android device</p>
<pre><span class="code">fConsole.fn.isAndroid();</span> //example of return true or false</pre>
</div>
</li>
</ul>
</li>
<li>
<h3>Others:</h3>
<ul>
<!--loadJSScriptDynamically-->
<li>
<div class="method-name">fConsole.fn.loadJSScriptDynamically()</div>
<div class="method-use">
<p>Load a Javascript dynamically. Parameters src | callback</p>
<pre><span class="code">fConsole.fn.loadJSScriptDynamically("http://code.jquery.com/jquery-1.12.0.min.js", function() { alert("jQuery is loaded."); });</span></pre>
</div>
</li>
<!--loadCssFile-->
<li>
<div class="method-name">fConsole.fn.loadCssFile()</div>
<div class="method-use">
<p>Load a CSS file</p>
<pre><span class="code">fConsole.fn.loadCssFile("http://website.com/css/stylesheet.css");</span></pre>
</div>
</li>
<!--cloneObj-->
<li>
<div class="method-name">fConsole.fn.cloneObj()</div>
<div class="method-use">
<p>Clone a JavaScript object <span class="alert">(is not 100% accurate)</span></p>
<pre><span class="code">var x = 7;<br />var y = fConsole.fn.cloneObj(x);</span> //will result y => 7;</pre>
</div>
</li>
<!--getBrowser-->
<li>
<div class="method-name">fConsole.fn.getBrowser()</div>
<div class="method-use">
<p>Get major browsers name</p>
<pre><span class="code">fConsole.fn.getBrowser();</span> //example of result "Chrome"</pre>
</div>
</li>
<!--getBrowserVersion-->
<li>
<div class="method-name">fConsole.fn.getBrowserVersion()</div>
<div class="method-use">
<p>Get major browsers version</p>
<pre><span class="code">fConsole.fn.getBrowserVersion();</span> //example of result "47.0.2526.106"</pre>
</div>
</li>
<!--getIEVersion-->
<li>
<div class="method-name">fConsole.fn.getIEVersion()</div>
<div class="method-use">
<p>Get Internet Explore version</p>
<pre><span class="code">fConsole.fn.getIEVersion();</span> //example of result on a IE browser = "11" else will return false</pre>
</div>
</li>
<!--getOS-->
<li>
<div class="method-name">fConsole.fn.getOS()</div>
<div class="method-use">
<p>Get the type and version of the Operating System</p>
<pre><span class="code">fConsole.fn.getOS();</span> //example of result "Windows 10"</pre>
</div>
</li>
<!--getDoctype-->
<li>
<div class="method-name">fConsole.fn.getDoctype()</div>
<div class="method-use">
<p>Get the doctype tag</p>
<pre><span class="code">fConsole.fn.getDoctype();</span> //example of result "<!DOCTYPE html>"</pre>
</div>
</li>
<!--getNumberOrdinal-->
<li>
<div class="method-name">fConsole.fn.getNumberOrdinal()</div>
<div class="method-use">
<p>add the st, th, rd etc to the end of the number</p>
<pre><span class="code">fConsole.fn.getNumberOrdinal(10);</span> //example of result "10th"</pre>
</div>
</li>
<!--copyToClipboard-->
<li>
<div class="method-name">fConsole.fn.copyToClipboard()</div>
<div class="method-use">
<p>copy a text into clipboard</p>
<pre><span class="code">fConsole.fn.copyToClipboard("some text");</span> //example of result true if browser support it or fase if not. If the result it's true then try paste the copied text.</pre>
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="example example6">
<a name="example6"></a>
<div class="text">
<h2>Settings</h2>
<p>Update some settings in real time.</p>
</div>
<div class="actions">
<ul>
<li>
<h3>Themes</h3>
<button id="a1">Default</button>
<button id="a2">Clasic</button>
<button id="a3">Light</button>
</li>
<li>
<h3>Opacity:</h3>
<button id="a4">Increase</button>
<button id="a5">Decrease</button>
</li>
<li>
<h3>Widht:</h3>
<button id="a6">Full Width</button>
<button id="a7">550px Width</button>
</li>
</ul>
<ul class="feature-list">
<li>
<h3>Full Features List</h3>
<ul>
<li>you will need <b class="c1">jQuery</b> plugin - you can download it from <a href="http://jquery.com/download/" class="c1" target="_blank"><b>here</b></a></li>
<li><b>very useful for environments who lack of a console eg. (mobile, tables - browsers) as well for desktop browsers</b></li>
<li>you can <b class="c1">dragg</b> the console around the browser (works on touch devices too)</li>
<li>you can <b class="c1">resize</b> the console (works on touch devices too)</li>
<li>you can run <b class="c1">JavaScript</b> code from fConsole and see the results by pressing <b class="c1">Enter Key</b> or <b class="c1">Exec</b> button</li>
<li>will log all JavaScript <b class="c1">errors</b></li>
<li>on desktop browsers use "<b class="c1">UP</b>" or "<b class="c1">DOWN</b>" keys to access typing history</li>
<li>you can clear/minimize the console</li>
<li>
available keyboard shortcuts:<br /><br />
<b class="c1">alt + c</b> - Open fConsole<br />
<b class="c1">alt + x</b> - Close fConsole<br />
<b class="c1">alt + z</b> - Minimize fConsole<br />
<b class="c1">alt + d</b> - Clear fConsole
</li>
<li>
available inline commands:<br /><br />
<b class="c1">/?</b> or <b class="c1">/help</b> - will show all avaiable commands<br />
<b class="c1">/cls</b> or <b class="c1">/clear</b> - Clear fConsole<br />
<b class="c1">/m</b> or <b class="c1">/min</b> or <b class="c1">/minimize</b> - Minimize fConsole<br />
<b class="c1">/c</b> or <b class="c1">/close</b> - Close fConsole
</li>
<li>
general <b class="c1">Help Functions</b>
<br /><br />
- you can access them like <b class="c1">fConsole.fn.<function-name></b>
</li>
</ul>
</li>
<li>
<h3>How to use this plugin</h3>
<ul>
<li>
<b class="c1">Direct usage - will use default options</b>
<pre>
$(document).ready(function () {
fConsole.log("Hello!"); //simple message
fConsole.log("Hello!", null, "#00FF00"); //message with custom BgColor
fConsole.log("Hello!", null, "#00FF00", "#000"); //message with custom BgColor and TextColor
fConsole.log(function() { return Date.now(); }, 1000); //message in realtime - get time stamp at one second interval
});
</pre>
</li>
<li>
<b class="c1">New object - using default options</b>
<pre>
$(document).ready(function () {
//init console
myConsole = new fConsole({
hideHeader: false, //if is true - will disable draggable option
hideFooter: false, //if is true - will no longer be able to run Javascript code
className: null, //if is set - you can control the console from CSS - all inline style will be removed
width: "250px",
minWidth: 0,
maxHeight: "250px",
position: "bottomLeft", //topLeft | topRight | bottomLeft | bottomRight
draggable: true,
opacity: 1,
fontSize: "12px",
fontFamily: "monospace",
theme: "default", //default | clasic | light
logJSErrors: true, //will log JS errors
zIndex: 2147483647
});
//myConsole.log method parameters
// first param - a string
// second param - interval - set in miliseconds
// third param - row background color
// four param - row text color
myConsole.log("Hello!"); //simple message
myConsole.log("Hello!", null, "#00FF00"); //message with custom BgColor
myConsole.log("Hello!", null, "#00FF00", "#000"); //message with custom BgColor and TextColor
myConsole.log(function() { return Date.now(); }, 1000); //message in realtime - get time stamp at one second interval
});
</pre>
</li>
<li>
<b class="c1">Change fConsole Settings like this</b>
<pre>
$(document).ready(function () {
myConsole = new fConsole();
myConsole.reloadSettings({ theme: "default" });
myConsole.reloadSettings({ width: "100%", minWidht: 0 });
});
</pre>
</li>
<li>
<b class="c1">Help Functions</b>
<pre>
$(document).ready(function () {
fConsole.fn.isNumeric("123"); //will return true
fConsole.fn.isNumeric("123$%"); //will return false
fConsole.fn.isInt(123); //will return true
fConsole.fn.isTouchDevice();
//etc...
});
</pre>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="example example7 last">
<a name="example7"></a>
<div class="text">
<h2>Change log</h2>
</div>
<div class="actions">
<ul>
<li>
<h3>v1.1.2 - 15 March, 2018</h3>
<ul>
<li>[FEATURE] – add new method fConsole.fn.getCurrentTimeAddHours() - thanks to <strong>Everardo T. Cunha</strong></li>
<li>[FEATURE] – add new method fConsole.fn.getCurrentDateTime() - thanks to <strong>Everardo T. Cunha</strong></li>
<li>[CHANGE] – rename method fConsole.fn.getGetOrdinal() to fConsole.fn.getNumberOrdinal()</li>
<li>[BUG FIXED] – fixed fConsole.fn.getCurrentDate() - thanks to <strong>Everardo T. Cunha</strong></li>
</ul>
</li>
<li>
<h3>v1.1.1 - 19 December, 2017</h3>
<ul>
<li>[FEATURE] – add new method fConsole.fn.copyToClipboard()</li>
<li>[FEATURE] – add new method fConsole.fn.getNumberOrdinal()</li>
<li>[FEATURE] – add new method fConsole.fn.isiOS()</li>
<li>[FEATURE] – add new method fConsole.fn.isAndroid()</li>
<li>[BUG FIXED] – fixed fConsole.fn.hexToRgb() - thanks to <strong>Huambo</strong></li>
<li>[BUG FIXED] – fixed fConsole.fn.getCurrentDate() - thanks to <strong>Huambo</strong></li>
<li>[BUG FIXED] – fixed minimize action</li>
<li>[BUG FIXED] – fixed fConsole.fn.generateGUID()</li>
<li>[BUG FIXED] – general code improvement - thanks to <strong>Huambo</strong></li>
</ul>
</li>
<li>
<h3>v1.1 - 24 July, 2016</h3>
<ul>
<li>[FEATURE] – add clear button into header</li>
<li>[FEATURE] – add resize functionality to make the resize more easy</li>
<li>[FEATURE] – add inline commands. Type in fConsole "<b class="c1">/?</b>" or "<b class="c1">/help</b>" to see them</li>
<li>[FEATURE] – minimize console by pressing "<b class="c1">ESC</b>" key, press again to close it</li>
<li>[FEATURE] – add lots of methods that may help you. Click <a href="#example6" class="c1"><b>here</b></a> to see them</li>
<li>[BUG FIXED] – fixed the eval js method</li>
<li>[BUG FIXED] – general code improvement</li>
</ul>
</li>
<li>
<h3>v1.0 - 11 January, 2016</h3>
<ul>
<li>initial release</li>
</ul>
</li>
</ul>
</div>
</div>
<img id="drag-me" src="images/dragg-me.png" />
</div>
<div class="footer">
<div class="f-content">
<p class="copyright">© 2016 Florin Paraschivescu. All Rights Reserved.</p>
</div>
</div>
<script type="text/javascript" src="js/libs/jQuery/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="js/libs/jQuery/jquery-migrate-1.4.1.min.js"></script>
<script type="text/javascript" src="js/fConsole-1.1.2.min.js"></script>
<script type="text/javascript" src="js/demo.js"></script>
</body>
</html>