familiarity 0.2.2 → 0.2.4
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 +4 -4
- data/README.rdoc +2 -1
- data/app/assets/javascripts/familiarity/application.js +1 -0
- data/app/assets/javascripts/familiarity/familiarity.js.erb +1 -1
- data/app/assets/javascripts/familiarity/familiarity_admin.js.erb +2 -25
- data/app/assets/javascripts/familiarity/jquery.getpath.js +22 -0
- data/app/assets/stylesheets/familiarity/familiarity.css.scss +24 -3
- data/app/helpers/familiarity/application_helper.rb +8 -3
- data/lib/familiarity/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 092b699b9b7fb8e45211c4ef2e7e4784574573a8
|
4
|
+
data.tar.gz: 165072572198d16c97d31f8d8dc281bbd2712d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1498e768a9bea9757dd95f6fe55a9998d4f494c0c97bd934cb5c5aabae19e569eebe6b9d9e9d356a92a6212f49042fc3e9adc8352d9e8e014d61b2dc94659f59
|
7
|
+
data.tar.gz: b646166761515ae8b65c71f110d4e094f7242c2dcd05fc973e765bf68a0bc08ba06e3be9d5b0427fc9c27245416cb48ede19ceb474a5707e1501934f731b7109
|
data/README.rdoc
CHANGED
@@ -37,6 +37,7 @@ Add familiarity's view on all the pages (append following helper at the end as b
|
|
37
37
|
To provide a switch board where an user (or may be a bunch of users in any specific environment of application) want to add/edit/update or delete annotations on any page .
|
38
38
|
|
39
39
|
<%= familiaritySwitchBoard %>
|
40
|
+
<%= familiaritySwitchBoard(position: 'topLeft') %> #Possible options are topLeft, topRight, bottomRight(default) and bottomLeft
|
40
41
|
|
41
42
|
|
42
43
|
To provide annotations view of elements, one element at a time on the first visit of page.
|
@@ -44,7 +45,7 @@ To provide annotations view of elements, one element at a time on the first visi
|
|
44
45
|
<%= familiarityView %>
|
45
46
|
<%= familiarityView({
|
46
47
|
escape_to_exit: true, #Exits on ESC key press.
|
47
|
-
f1_to_start: true, #Starts on F1 key press.
|
48
|
+
f1_to_start: true, #Starts on F1 key press. In Chromium based browser Ctrl+F1 key press
|
48
49
|
show_tips_recursively: false, #To restart annotations display after complete traverse of available annotations.
|
49
50
|
mandatory_all_tips: true, #To show all tips(annotations) at least once (before enabling ESC key for exit).
|
50
51
|
traverse_back: true, #By default 'LEFT' arrow key is available to visit back but which can be disabled with a 'false' here.
|
@@ -10,6 +10,7 @@
|
|
10
10
|
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
12
12
|
//
|
13
|
+
//= require ../familiarity/jquery.getpath
|
13
14
|
//= require ../familiarity/jquery.cookie
|
14
15
|
//= require ../familiarity/jquery.tooltipster
|
15
16
|
//= require_tree .
|
@@ -169,7 +169,7 @@ Familiarity.prototype = {
|
|
169
169
|
}
|
170
170
|
|
171
171
|
$(document).on("page:change", function () {
|
172
|
-
// Show and hide on F1 and ESC key respectively
|
172
|
+
// Show and hide on F1(Ctrl +F1 on chrome) and ESC key respectively
|
173
173
|
$('body').keyup(function (e) {
|
174
174
|
var _this = Familiarity.getCurrentObject();
|
175
175
|
if (typeof(_this) != "undefined" && e.keyCode == 27 && _this.escape_to_exit && _this.familiarityRenderedFlag) { //ESC key pressed
|
@@ -1,33 +1,10 @@
|
|
1
|
-
jQuery.fn.getPath = function () {
|
2
|
-
if (this.length != 1) throw 'Requires one element.';
|
3
|
-
|
4
|
-
var path, node = this;
|
5
|
-
while (node.length) {
|
6
|
-
var realNode = node[0], name = realNode.localName;
|
7
|
-
if (!name) break;
|
8
|
-
name = name.toLowerCase();
|
9
|
-
|
10
|
-
var parent = node.parent();
|
11
|
-
|
12
|
-
var siblings = parent.children(name);
|
13
|
-
if (siblings.length > 1) {
|
14
|
-
name += ':eq(' + siblings.index(realNode) + ')';
|
15
|
-
}
|
16
|
-
|
17
|
-
path = name + (path ? '>' + path : '');
|
18
|
-
node = parent;
|
19
|
-
}
|
20
|
-
|
21
|
-
return path;
|
22
|
-
};
|
23
|
-
|
24
1
|
var FamiliarityAdmin = function () {
|
25
2
|
this.familiarityEditorialSet = {};
|
26
3
|
this.familiaritySaveUrl = '<%=Familiarity::Engine.routes.url_helpers.save_familiarities_path(format: :json)%>';
|
27
4
|
this.familiaritiesUrl = '<%= Familiarity::Engine.routes.url_helpers.familiarities_path(format: :json) %>';
|
28
5
|
}
|
29
6
|
|
30
|
-
FamiliarityAdmin.familiaritySwitchBoard = function () {
|
7
|
+
FamiliarityAdmin.familiaritySwitchBoard = function (options) {
|
31
8
|
var familiarity_admin = new FamiliarityAdmin();
|
32
9
|
|
33
10
|
var switch_state = 'On';
|
@@ -36,7 +13,7 @@ FamiliarityAdmin.familiaritySwitchBoard = function () {
|
|
36
13
|
familiarity_admin.familiaritySwitch(switch_state);
|
37
14
|
switch_state = (switch_state == "On") ? "Off" : "On";
|
38
15
|
$(this).html('<div class="text_content">Switch ' + switch_state + ' familiarity!</div>');
|
39
|
-
}).appendTo($('body'));
|
16
|
+
}).appendTo($('body')).addClass("fs_"+options.position);
|
40
17
|
}
|
41
18
|
|
42
19
|
FamiliarityAdmin.prototype = {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
jQuery.fn.getPath = function () {
|
2
|
+
if (this.length != 1) throw 'Requires one element.';
|
3
|
+
|
4
|
+
var path, node = this;
|
5
|
+
while (node.length) {
|
6
|
+
var realNode = node[0], name = realNode.localName;
|
7
|
+
if (!name) break;
|
8
|
+
name = name.toLowerCase();
|
9
|
+
|
10
|
+
var parent = node.parent();
|
11
|
+
|
12
|
+
var siblings = parent.children(name);
|
13
|
+
if (siblings.length > 1) {
|
14
|
+
name += ':eq(' + siblings.index(realNode) + ')';
|
15
|
+
}
|
16
|
+
|
17
|
+
path = name + (path ? '>' + path : '');
|
18
|
+
node = parent;
|
19
|
+
}
|
20
|
+
|
21
|
+
return path;
|
22
|
+
};
|
@@ -9,9 +9,6 @@
|
|
9
9
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#131313', GradientType=0); /* ie */
|
10
10
|
|
11
11
|
border-radius: 15px;
|
12
|
-
bottom: 10px;
|
13
|
-
right: 10px;
|
14
|
-
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.8);
|
15
12
|
cursor: pointer;
|
16
13
|
height: 30px;
|
17
14
|
position: fixed;
|
@@ -29,6 +26,30 @@
|
|
29
26
|
}
|
30
27
|
}
|
31
28
|
|
29
|
+
.fs_topLeft {
|
30
|
+
top: 10px;
|
31
|
+
left: 10px;
|
32
|
+
box-shadow: -5px -5px 5px rgba(0, 0, 0, 0.8)
|
33
|
+
}
|
34
|
+
|
35
|
+
.fs_topRight {
|
36
|
+
top: 10px;
|
37
|
+
right: 10px;
|
38
|
+
box-shadow: 5px -5px 5px rgba(0, 0, 0, 0.8)
|
39
|
+
}
|
40
|
+
|
41
|
+
.fs_bottomRight {
|
42
|
+
bottom: 10px;
|
43
|
+
right: 10px;
|
44
|
+
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.8);
|
45
|
+
}
|
46
|
+
|
47
|
+
.fs_bottomLeft {
|
48
|
+
bottom: 10px;
|
49
|
+
left: 10px;
|
50
|
+
box-shadow: -5px 5px 5px rgba(0, 0, 0, 0.8);
|
51
|
+
}
|
52
|
+
|
32
53
|
//.familiaritySwitch {
|
33
54
|
// background-color: white;
|
34
55
|
// border-color: #787878;
|
@@ -1,9 +1,14 @@
|
|
1
1
|
module Familiarity
|
2
2
|
module ApplicationHelper
|
3
|
-
|
3
|
+
|
4
|
+
def familiaritySwitchBoard(options={})
|
5
|
+
_options= {
|
6
|
+
position: 'bottomLeft' # Options are, topLeft, topRight, bottomRight, bottomLeft
|
7
|
+
}.merge(options)
|
8
|
+
|
4
9
|
content_tag('script') do
|
5
|
-
# raw "$(document).on(\"page:change\", function () {FamiliarityAdmin.familiaritySwitchBoard();});"
|
6
|
-
raw "FamiliarityAdmin.familiaritySwitchBoard();"
|
10
|
+
# raw "$(document).on(\"page:change\", function () {FamiliarityAdmin.familiaritySwitchBoard(#{_options.to_json});});"
|
11
|
+
raw "FamiliarityAdmin.familiaritySwitchBoard(#{_options.to_json});"
|
7
12
|
end
|
8
13
|
end
|
9
14
|
|
data/lib/familiarity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: familiarity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Praveen Kumar Sinha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- app/assets/javascripts/familiarity/familiarity.js.erb
|
54
54
|
- app/assets/javascripts/familiarity/familiarity_admin.js.erb
|
55
55
|
- app/assets/javascripts/familiarity/jquery.cookie.js
|
56
|
+
- app/assets/javascripts/familiarity/jquery.getpath.js
|
56
57
|
- app/assets/javascripts/familiarity/jquery.tooltipster.js
|
57
58
|
- app/assets/stylesheets/familiarity/application.css
|
58
59
|
- app/assets/stylesheets/familiarity/familiarities.css
|