TimerJS 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/TimerJS.rb +8 -0
- data/lib/TimerJS/version.rb +5 -0
- data/vendor/assets/javascripts/timerjs.js +50 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 53571418715b7d3c72eaa4c4bdfa802dcb78423c
|
4
|
+
data.tar.gz: ddb323d107d38d2d2743d908ffe6a021fbea693a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 48856826326cdfd0afeffd9a521ab4679b1e91b80e8eb0221db91a7d8b1fc5f35e5bdf9e555439263b1f432bf6cb7f2b999e1e0cb57fd0f6101becd0fac76829
|
7
|
+
data.tar.gz: 6e085af5ee4eaaf88576ecb131e87e3471217a1990924fe46ecddc65431fa469105cc48e23363f0973adce2660de05cc62bcc6753671e9692a857116dde3dbb2
|
data/lib/TimerJS.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
// This gem is dedicated to the memory of my father, Mahesh Prasad Prajapati. I am missing him everyday.
|
2
|
+
// Author: Ashish Prajapati
|
3
|
+
// Email: mail@ashishprajapati.com
|
4
|
+
// Office Email : ashishprajapati040@gmail.com
|
5
|
+
|
6
|
+
// Main function that is called in every interval
|
7
|
+
var _ashish_timerjs = function(){
|
8
|
+
var _ashish_date = new Date();
|
9
|
+
|
10
|
+
var _ashish_H_ele = document.getElementsByName("timerjs-H");
|
11
|
+
_check_all_ele(_ashish_H_ele, _ashish_date.getHours())
|
12
|
+
|
13
|
+
var _ashish_h_ele = document.getElementsByName("timerjs-h");
|
14
|
+
_check_all_ele(_ashish_h_ele, (_ashish_date.getHours() % 12 || 12))
|
15
|
+
|
16
|
+
var _ashish_period_ele = document.getElementsByName("timerjs-period")
|
17
|
+
_check_all_period_ele(_ashish_period_ele, _ashish_date.getHours())
|
18
|
+
|
19
|
+
var _ashish_m_ele = document.getElementsByName("timerjs-m");
|
20
|
+
_check_all_ele(_ashish_m_ele, _ashish_date.getMinutes())
|
21
|
+
|
22
|
+
var _ashish_s_ele = document.getElementsByName("timerjs-s");
|
23
|
+
_check_all_ele(_ashish_s_ele, _ashish_date.getSeconds())
|
24
|
+
|
25
|
+
var _ashish_ms_ele = document.getElementsByName("timerjs-ms");
|
26
|
+
_check_all_ele(_ashish_ms_ele, _ashish_date.getMilliseconds())
|
27
|
+
}
|
28
|
+
|
29
|
+
var _check_all_ele = function(_ashish_ele, _time_type){
|
30
|
+
for (i = 0; i < _ashish_ele.length; i++) {
|
31
|
+
_ashish_ele[i].innerHTML = _right_timestyle(_time_type)
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
var _check_all_period_ele = function(_ashish_ele, _time_type){
|
36
|
+
for (i = 0; i < _ashish_ele.length; i++) {
|
37
|
+
_ashish_period_up = _ashish_ele[i].dataset["up"] || "AM"
|
38
|
+
_ashish_period_down = _ashish_ele[i].dataset["down"] || "PM"
|
39
|
+
_ashish_ele[i].innerHTML = _right_timestyle((_time_type < 12 ? _ashish_period_up : _ashish_period_down))
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
// Function suggested by Vaibhav Dwivedi ( vaibhav111dwivedi@gmail.com )
|
44
|
+
var _right_timestyle = function(time){
|
45
|
+
var str = ""+time
|
46
|
+
var timestyle = "00"
|
47
|
+
return timestyle.substring(0, timestyle.length - str.length) + str
|
48
|
+
}
|
49
|
+
|
50
|
+
setInterval('_ashish_timerjs()',1)
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: TimerJS
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ashish Prajapati
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-20 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: TimerJS for realtime dynamic clock. This gem is dedicated to the memory
|
14
|
+
of my father, Mahesh Prasad Prajapati as because of him I have a great mind. I am
|
15
|
+
missing him everyday. You can find out breif details of this gem on github repo.
|
16
|
+
Please click on Homepage below right side in links section.
|
17
|
+
email: mail@ashishprajapati.com
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- lib/TimerJS.rb
|
23
|
+
- lib/TimerJS/version.rb
|
24
|
+
- vendor/assets/javascripts/timerjs.js
|
25
|
+
homepage: https://github.com/ashishprajapati/TimerJS
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.4.8
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: TimerJS for realtime dynamic clock
|
49
|
+
test_files: []
|