sideshow 0.4.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/.bowerrc +3 -0
- data/.csslintrc +37 -0
- data/.editorconfig +27 -0
- data/.gitattributes +1 -0
- data/.gitignore +23 -0
- data/BUILDING.md +4 -0
- data/CHANGELOG.md +47 -0
- data/Gulpfile.js +404 -0
- data/LICENSE +191 -0
- data/README.md +342 -0
- data/VERSION +1 -0
- data/bower.json +61 -0
- data/distr/dependencies/jazz.min.js +8 -0
- data/distr/dependencies/jquery.min.js +5 -0
- data/distr/dependencies/pagedown.min.js +1 -0
- data/distr/fonts/open-sans-family/opensans-bold.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-bold.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-bold.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-bold.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-bolditalic.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-bolditalic.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-bolditalic.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-bolditalic.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-extrabold.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-extrabold.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-extrabold.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-extrabold.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-extrabolditalic.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-extrabolditalic.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-extrabolditalic.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-extrabolditalic.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-italic.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-italic.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-italic.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-italic.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-light.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-light.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-light.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-light.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-lightitalic.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-lightitalic.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-lightitalic.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-lightitalic.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-regular.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-regular.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-regular.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-regular.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-semibold.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-semibold.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-semibold.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-semibold.woff +0 -0
- data/distr/fonts/open-sans-family/opensans-semibolditalic.eot +0 -0
- data/distr/fonts/open-sans-family/opensans-semibolditalic.svg +1825 -0
- data/distr/fonts/open-sans-family/opensans-semibolditalic.ttf +0 -0
- data/distr/fonts/open-sans-family/opensans-semibolditalic.woff +0 -0
- data/distr/fonts/sideshow-fontface.min.css +1 -0
- data/distr/fonts/sideshow-icons/sideshow-icons.eot +0 -0
- data/distr/fonts/sideshow-icons/sideshow-icons.svg +16 -0
- data/distr/fonts/sideshow-icons/sideshow-icons.ttf +0 -0
- data/distr/fonts/sideshow-icons/sideshow-icons.woff +0 -0
- data/distr/sideshow.js +2510 -0
- data/distr/sideshow.min.js +10 -0
- data/distr/stylesheets/sideshow.min.css +1 -0
- data/docs/api.js +29 -0
- data/docs/assets/css/external-small.png +0 -0
- data/docs/assets/css/logo.png +0 -0
- data/docs/assets/css/main.css +783 -0
- data/docs/assets/favicon.png +0 -0
- data/docs/assets/img/spinner.gif +0 -0
- data/docs/assets/index.html +10 -0
- data/docs/assets/js/api-filter.js +52 -0
- data/docs/assets/js/api-list.js +251 -0
- data/docs/assets/js/api-search.js +98 -0
- data/docs/assets/js/apidocs.js +370 -0
- data/docs/assets/js/yui-prettify.js +17 -0
- data/docs/assets/vendor/prettify/CHANGES.html +130 -0
- data/docs/assets/vendor/prettify/COPYING +202 -0
- data/docs/assets/vendor/prettify/README.html +203 -0
- data/docs/assets/vendor/prettify/prettify-min.css +1 -0
- data/docs/assets/vendor/prettify/prettify-min.js +1 -0
- data/docs/classes/Arrow.html +541 -0
- data/docs/classes/Arrows.html +805 -0
- data/docs/classes/ControlVariables.html +1005 -0
- data/docs/classes/DetailsPanel.html +672 -0
- data/docs/classes/FadableItem.html +613 -0
- data/docs/classes/HidableItem.html +495 -0
- data/docs/classes/Mask.CloseButton.html +706 -0
- data/docs/classes/Mask.CompositeMask.html +721 -0
- data/docs/classes/Mask.CornerPart.html +613 -0
- data/docs/classes/Mask.Part.html +395 -0
- data/docs/classes/Mask.Polling.html +809 -0
- data/docs/classes/Mask.Subject.html +199 -0
- data/docs/classes/Mask.SubjectMask.html +417 -0
- data/docs/classes/Mask.WizardMenu.html +1401 -0
- data/docs/classes/SS.html +267 -0
- data/docs/classes/SSException.html +203 -0
- data/docs/classes/Screen.html +363 -0
- data/docs/classes/StepDescription.html +1025 -0
- data/docs/classes/StepDescriptionNextButton.html +746 -0
- data/docs/classes/VisualItem.html +339 -0
- data/docs/classes/Wizard.html +967 -0
- data/docs/files/c +0 -0
- data/docs/index.html +162 -0
- data/example.html +81 -0
- data/examples/images/clemenza.jpg +0 -0
- data/examples/images/doc_brown.png +0 -0
- data/examples/images/forkme.png +0 -0
- data/examples/images/fortes-logo.png +0 -0
- data/examples/images/sideshow-logo.png +0 -0
- data/examples/images/sideshow-logo.svg +155 -0
- data/examples/scripts/sideshow.config.js +2 -0
- data/examples/scripts/tutorials/introducing_sideshow.js +259 -0
- data/examples/stylesheets/example.min.css +1 -0
- data/examples/stylesheets/styl/example.styl +272 -0
- data/gulp/config.js +0 -0
- data/gulp/extensions/gulp-html-extend.js +151 -0
- data/gulp/tasks/.gitkeep +0 -0
- data/icons/iconfont.zip +0 -0
- data/package.json +56 -0
- data/sideshow.gemspec +20 -0
- data/sideshow.nuspec +72 -0
- data/sideshow.sublime-project +22 -0
- data/src/copyright_info.js +8 -0
- data/src/general/config.js +42 -0
- data/src/general/dictionary.js +42 -0
- data/src/general/exception.js +15 -0
- data/src/general/global_object.js +287 -0
- data/src/general/polling.js +151 -0
- data/src/general/screen.js +39 -0
- data/src/general/utility_functions.js +88 -0
- data/src/general/variables.js +42 -0
- data/src/interface_itens/fadable_item.js +55 -0
- data/src/interface_itens/hidable_item.js +32 -0
- data/src/interface_itens/visual_item.js +42 -0
- data/src/main.js +52 -0
- data/src/mask/composite_mask.js +193 -0
- data/src/mask/composite_mask_corner_part.js +105 -0
- data/src/mask/composite_mask_part.js +51 -0
- data/src/mask/mask.js +6 -0
- data/src/mask/subject_mask.js +34 -0
- data/src/step/arrow.js +88 -0
- data/src/step/arrows.js +155 -0
- data/src/step/step_description.js +165 -0
- data/src/step/step_description_next_button.js +55 -0
- data/src/step/step_details_panel.js +87 -0
- data/src/step/subject.js +100 -0
- data/src/wizard/wizard.js +395 -0
- data/src/wizard/wizard_control_variables.js +95 -0
- data/src/wizard/wizard_menu.js +101 -0
- data/stylesheets/_animations.styl +87 -0
- data/stylesheets/_font-face.styl +135 -0
- data/stylesheets/_icons.styl +27 -0
- data/stylesheets/_layout.styl +362 -0
- data/stylesheets/_mixins.styl +52 -0
- data/stylesheets/_variables.styl +35 -0
- data/stylesheets/sideshow-fontface.styl +4 -0
- data/stylesheets/sideshow.styl +7 -0
- data/yuidoc.json +15 -0
- metadata +246 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
/**
|
2
|
+
A corner part composing the mask
|
3
|
+
|
4
|
+
@class CornerPart
|
5
|
+
@@initializer
|
6
|
+
@param {Object} position The positioning information
|
7
|
+
@param {Object} dimension The dimension information
|
8
|
+
**/
|
9
|
+
Mask.CompositeMask.CornerPart = jazz.Class().extending(VisualItem);
|
10
|
+
|
11
|
+
/**
|
12
|
+
@@alias CornerPart
|
13
|
+
@@to Mask.CompositeMask.CornerPart
|
14
|
+
**/
|
15
|
+
var CornerPart = Mask.CompositeMask.CornerPart;
|
16
|
+
|
17
|
+
/**
|
18
|
+
An object holding positioning information for the mask corner part
|
19
|
+
|
20
|
+
@@field position
|
21
|
+
@type Object
|
22
|
+
**/
|
23
|
+
CornerPart.field("position", {});
|
24
|
+
|
25
|
+
/**
|
26
|
+
An object holding dimension information for the mask corner part
|
27
|
+
|
28
|
+
@@field position
|
29
|
+
@type Object
|
30
|
+
**/
|
31
|
+
CornerPart.field("dimension", {});
|
32
|
+
|
33
|
+
/**
|
34
|
+
An object holding border radius information for the mask corner part
|
35
|
+
|
36
|
+
@@field borderRadius
|
37
|
+
@type Object
|
38
|
+
**/
|
39
|
+
CornerPart.field("borderRadius", 0);
|
40
|
+
|
41
|
+
/**
|
42
|
+
Formats the SVG path for the corner part
|
43
|
+
|
44
|
+
@method SVGPathPointsTemplate
|
45
|
+
@param {Number} borderRadius The corner part border radius
|
46
|
+
@static
|
47
|
+
**/
|
48
|
+
CornerPart.static.SVGPathPointsTemplate = function(borderRadius) {
|
49
|
+
return "m 0,0 0," + borderRadius + " C 0," + borderRadius * 0.46 + " " + borderRadius * 0.46 + ",0 " + borderRadius + ",0";
|
50
|
+
};
|
51
|
+
|
52
|
+
/**
|
53
|
+
Renders the SVG for the corner part
|
54
|
+
|
55
|
+
@method buildSVG
|
56
|
+
@param {Number} borderRadius The corner part border radius
|
57
|
+
@static
|
58
|
+
**/
|
59
|
+
CornerPart.static.buildSVG = function(borderRadius) {
|
60
|
+
function SVG(nodeName) {
|
61
|
+
return document.createElementNS("http://www.w3.org/2000/svg", nodeName);
|
62
|
+
}
|
63
|
+
|
64
|
+
var bezierPoints = this.SVGPathPointsTemplate(borderRadius);
|
65
|
+
var $svg = $(SVG("svg"));
|
66
|
+
var $path = $(SVG("path"));
|
67
|
+
|
68
|
+
$path.attr("d", bezierPoints);
|
69
|
+
$svg.append($path);
|
70
|
+
|
71
|
+
return $svg[0];
|
72
|
+
};
|
73
|
+
|
74
|
+
/**
|
75
|
+
Renders the mask corner part
|
76
|
+
|
77
|
+
@method render
|
78
|
+
@return {Object} The corner part jQuery wrapped DOM element
|
79
|
+
**/
|
80
|
+
CornerPart.prototype.render = function() {
|
81
|
+
this.$el = $("<div>")
|
82
|
+
.addClass("sideshow-mask-corner-part")
|
83
|
+
.addClass("sideshow-hidden")
|
84
|
+
.addClass("sideshow-invisible");
|
85
|
+
this.$el.append(CornerPart.buildSVG(this.borderRadius));
|
86
|
+
$body.append(this.$el);
|
87
|
+
return this.$el;
|
88
|
+
};
|
89
|
+
|
90
|
+
/**
|
91
|
+
Updates the positioning and border radius of the mask corner part
|
92
|
+
|
93
|
+
@method update
|
94
|
+
@param {Object} position The positioning information
|
95
|
+
@param {Object} borderRadius The border radius information
|
96
|
+
**/
|
97
|
+
CornerPart.prototype.update = function(position, borderRadius) {
|
98
|
+
this.$el
|
99
|
+
.css("left", position.x)
|
100
|
+
.css("top", position.y)
|
101
|
+
.css("width", borderRadius)
|
102
|
+
.css("height", borderRadius);
|
103
|
+
|
104
|
+
$(this.$el).find("path").attr("d", CornerPart.SVGPathPointsTemplate(borderRadius));
|
105
|
+
};
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/**
|
2
|
+
@@alias Part
|
3
|
+
@@to Mask.CompositeMask.Part
|
4
|
+
**/
|
5
|
+
var Part = Mask.CompositeMask.Part;
|
6
|
+
|
7
|
+
/**
|
8
|
+
An object holding positioning information for the mask part
|
9
|
+
|
10
|
+
@@field position
|
11
|
+
@type Object
|
12
|
+
**/
|
13
|
+
Part.field("position", {});
|
14
|
+
|
15
|
+
/**
|
16
|
+
An object holding dimension information for the mask part
|
17
|
+
|
18
|
+
@@field position
|
19
|
+
@type Object
|
20
|
+
**/
|
21
|
+
Part.field("dimension", {});
|
22
|
+
|
23
|
+
/**
|
24
|
+
Renders the mask part
|
25
|
+
|
26
|
+
@method render
|
27
|
+
**/
|
28
|
+
Part.method("render", function() {
|
29
|
+
this.$el = $("<div>")
|
30
|
+
.addClass("sideshow-mask-part")
|
31
|
+
.addClass("sideshow-hidden")
|
32
|
+
.addClass("sideshow-invisible");
|
33
|
+
this.callSuper("render");
|
34
|
+
});
|
35
|
+
|
36
|
+
/**
|
37
|
+
Updates the dimension and positioning of the subject mask part
|
38
|
+
|
39
|
+
@method update
|
40
|
+
@param {Object} position The positioning information
|
41
|
+
@param {Object} dimension The dimension information
|
42
|
+
**/
|
43
|
+
Part.method("update", function(position, dimension) {
|
44
|
+
this.position = position;
|
45
|
+
this.dimension = dimension;
|
46
|
+
this.$el
|
47
|
+
.css("left", position.x)
|
48
|
+
.css("top", position.y)
|
49
|
+
.css("width", dimension.width)
|
50
|
+
.css("height", dimension.height);
|
51
|
+
});
|
data/src/mask/mask.js
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
Controls the mask that covers the subject during a step transition
|
3
|
+
|
4
|
+
@class SubjectMask
|
5
|
+
@@singleton
|
6
|
+
**/
|
7
|
+
Mask.SubjectMask = jazz.Class().extending(FadableItem).singleton;
|
8
|
+
|
9
|
+
/**
|
10
|
+
Renders the subject mask
|
11
|
+
|
12
|
+
@method render
|
13
|
+
**/
|
14
|
+
Mask.SubjectMask.method("render", function() {
|
15
|
+
this.$el = $("<div>").addClass("sideshow-subject-mask");
|
16
|
+
this.callSuper("render");
|
17
|
+
});
|
18
|
+
|
19
|
+
/**
|
20
|
+
Updates the dimension, positioning and border radius of the subject mask
|
21
|
+
|
22
|
+
@method update
|
23
|
+
@param {Object} position The positioning information
|
24
|
+
@param {Object} dimension The dimension information
|
25
|
+
@param {Object} borderRadius The border radius information
|
26
|
+
**/
|
27
|
+
Mask.SubjectMask.method("update", function(position, dimension, borderRadius) {
|
28
|
+
this.$el
|
29
|
+
.css("left", position.x)
|
30
|
+
.css("top", position.y)
|
31
|
+
.css("width", dimension.width)
|
32
|
+
.css("height", dimension.height)
|
33
|
+
.css("border-radius", borderRadius.leftTop + "px " + borderRadius.rightTop + "px " + borderRadius.leftBottom + "px " + borderRadius.rightBottom + "px ");
|
34
|
+
});
|
data/src/step/arrow.js
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
/**
|
2
|
+
A single arrow for pointing individual items in current subject
|
3
|
+
|
4
|
+
@class Arrow
|
5
|
+
**/
|
6
|
+
var Arrow = jazz.Class().extending(FadableItem);
|
7
|
+
|
8
|
+
/**
|
9
|
+
The jQuery wrapped object which will be pointed by this arrow
|
10
|
+
|
11
|
+
@@field target
|
12
|
+
@type Object
|
13
|
+
**/
|
14
|
+
Arrow.field("target", {});
|
15
|
+
|
16
|
+
/**
|
17
|
+
Flag created to set if the arrow was visible once, this is used for recreating references to the targets DOM objects
|
18
|
+
|
19
|
+
@@field onceVisible
|
20
|
+
@type Object
|
21
|
+
**/
|
22
|
+
Arrow.field("onceVisible", false);
|
23
|
+
|
24
|
+
/**
|
25
|
+
Renders the Arrow
|
26
|
+
|
27
|
+
@method render
|
28
|
+
**/
|
29
|
+
Arrow.method("render", function() {
|
30
|
+
this.$el = $("<div>")
|
31
|
+
.addClass("sideshow-subject-arrow")
|
32
|
+
.addClass("sideshow-hidden")
|
33
|
+
.addClass("sideshow-invisible");
|
34
|
+
this.callSuper("render");
|
35
|
+
});
|
36
|
+
|
37
|
+
/**
|
38
|
+
Positionates the Arrow according to its target
|
39
|
+
|
40
|
+
@method positionate
|
41
|
+
**/
|
42
|
+
Arrow.method("positionate", function() {
|
43
|
+
var target = this.target;
|
44
|
+
target.position = {
|
45
|
+
x: target.$el.offset().left - $window.scrollLeft(),
|
46
|
+
y: target.$el.offset().top - $window.scrollTop()
|
47
|
+
};
|
48
|
+
target.dimension = {
|
49
|
+
width: target.$el.outerWidth(),
|
50
|
+
height: target.$el.outerHeight()
|
51
|
+
};
|
52
|
+
|
53
|
+
this.$el.css("top", target.position.y - 30 + "px")
|
54
|
+
.css("left", target.position.x + (parsePxValue(target.dimension.width) / 2) - 12 + "px");
|
55
|
+
});
|
56
|
+
|
57
|
+
/**
|
58
|
+
Shows the Arrow
|
59
|
+
|
60
|
+
@method show
|
61
|
+
**/
|
62
|
+
Arrow.method("show", function() {
|
63
|
+
this.callSuper("show");
|
64
|
+
this.positionate();
|
65
|
+
});
|
66
|
+
|
67
|
+
/**
|
68
|
+
Does a fade in transition in the Arrow
|
69
|
+
|
70
|
+
@method fadeIn
|
71
|
+
**/
|
72
|
+
Arrow.method("fadeIn", function() {
|
73
|
+
this.callSuper("fadeIn");
|
74
|
+
this.positionate();
|
75
|
+
});
|
76
|
+
|
77
|
+
/**
|
78
|
+
Checks if the arrow's target position or dimension has changed
|
79
|
+
|
80
|
+
@method hasChanged
|
81
|
+
@return boolean
|
82
|
+
**/
|
83
|
+
Arrow.method("hasChanged", function() {
|
84
|
+
return (this.target.dimension.width !== this.target.$el.outerWidth() ||
|
85
|
+
this.target.dimension.height !== this.target.$el.outerHeight() ||
|
86
|
+
this.target.position.y !== (this.target.$el.offset().top - $window.scrollTop())||
|
87
|
+
this.target.position.x !== (this.target.$el.offset().left - $window.scrollLeft()));
|
88
|
+
});
|
data/src/step/arrows.js
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
/**
|
2
|
+
Class representing all the current shown arrows
|
3
|
+
|
4
|
+
@class Arrows
|
5
|
+
@static
|
6
|
+
**/
|
7
|
+
var Arrows = {};
|
8
|
+
|
9
|
+
Arrows.arrows = [];
|
10
|
+
|
11
|
+
/**
|
12
|
+
Clear the currently defined arrows
|
13
|
+
|
14
|
+
@method clear
|
15
|
+
@static
|
16
|
+
**/
|
17
|
+
Arrows.clear = function() {
|
18
|
+
this.arrows = [];
|
19
|
+
};
|
20
|
+
|
21
|
+
/**
|
22
|
+
Sets the targets for arrows to point
|
23
|
+
|
24
|
+
@method setTargets
|
25
|
+
@static
|
26
|
+
**/
|
27
|
+
Arrows.setTargets = function(targets, targetsChanged) {
|
28
|
+
if (targets.constructor === String) targets = $(targets);
|
29
|
+
|
30
|
+
if (targets instanceof $ && targets.length > 0) {
|
31
|
+
targets.each(function() {
|
32
|
+
var arrow = Arrow.build();
|
33
|
+
arrow.target.$el = $(this);
|
34
|
+
if (arrow.target.$el.is(":visible")) {
|
35
|
+
Arrows.arrows.push(arrow);
|
36
|
+
arrow.onceVisible = true;
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
else if(!targetsChanged)
|
41
|
+
throw new SSException("150", "Invalid targets.");
|
42
|
+
};
|
43
|
+
|
44
|
+
Arrows.recreateDOMReferences = function() {
|
45
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
46
|
+
var arrow = this.arrows[a];
|
47
|
+
arrow.$el.remove();
|
48
|
+
}
|
49
|
+
|
50
|
+
Arrows.clear();
|
51
|
+
Arrows.setTargets(currentWizard.currentStep.targets, true);
|
52
|
+
Arrows.render();
|
53
|
+
Arrows.positionate();
|
54
|
+
Arrows.show();
|
55
|
+
};
|
56
|
+
|
57
|
+
/**
|
58
|
+
Iterates over the arrows collection showing each arrow
|
59
|
+
|
60
|
+
@method show
|
61
|
+
@static
|
62
|
+
**/
|
63
|
+
Arrows.show = function() {
|
64
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
65
|
+
var arrow = this.arrows[a];
|
66
|
+
arrow.show();
|
67
|
+
}
|
68
|
+
};
|
69
|
+
|
70
|
+
/**
|
71
|
+
Iterates over the arrows collection hiding each arrow
|
72
|
+
|
73
|
+
@method hide
|
74
|
+
@static
|
75
|
+
**/
|
76
|
+
Arrows.hide = function() {
|
77
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
78
|
+
var arrow = this.arrows[a];
|
79
|
+
arrow.hide();
|
80
|
+
}
|
81
|
+
};
|
82
|
+
|
83
|
+
/**
|
84
|
+
Iterates over the arrows collection fading in each arrow
|
85
|
+
|
86
|
+
@method fadeIn
|
87
|
+
@static
|
88
|
+
**/
|
89
|
+
Arrows.fadeIn = function() {
|
90
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
91
|
+
var arrow = this.arrows[a];
|
92
|
+
arrow.fadeIn();
|
93
|
+
}
|
94
|
+
};
|
95
|
+
|
96
|
+
/**
|
97
|
+
Iterates over the arrows collection fading out each arrow
|
98
|
+
|
99
|
+
@method fadeOut
|
100
|
+
@static
|
101
|
+
**/
|
102
|
+
Arrows.fadeOut = function() {
|
103
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
104
|
+
var arrow = this.arrows[a];
|
105
|
+
registerFadeOut(arrow);
|
106
|
+
}
|
107
|
+
|
108
|
+
function registerFadeOut(arrow) {
|
109
|
+
arrow.fadeOut(function() {
|
110
|
+
arrow.destroy();
|
111
|
+
});
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
/**
|
116
|
+
Iterates over the arrows collection repositionating each arrow
|
117
|
+
|
118
|
+
@method positionate
|
119
|
+
@static
|
120
|
+
**/
|
121
|
+
Arrows.positionate = function() {
|
122
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
123
|
+
var arrow = this.arrows[a];
|
124
|
+
arrow.positionate();
|
125
|
+
}
|
126
|
+
};
|
127
|
+
|
128
|
+
/**
|
129
|
+
Iterates over the arrows collection rendering each arrow
|
130
|
+
|
131
|
+
@method render
|
132
|
+
@static
|
133
|
+
**/
|
134
|
+
Arrows.render = function() {
|
135
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
136
|
+
var arrow = this.arrows[a];
|
137
|
+
arrow.render();
|
138
|
+
}
|
139
|
+
};
|
140
|
+
|
141
|
+
/**
|
142
|
+
A Polling function to check if arrows coordinates has changed
|
143
|
+
|
144
|
+
@method pollForArrowsChanges
|
145
|
+
**/
|
146
|
+
Arrows.pollForArrowsChanges = function() {
|
147
|
+
var brokenReference = false;
|
148
|
+
for (var a = 0; a < this.arrows.length; a++) {
|
149
|
+
var arrow = this.arrows[a];
|
150
|
+
if (arrow.hasChanged()) arrow.positionate();
|
151
|
+
if (arrow.onceVisible && !arrow.target.$el.is(":visible")) brokenReference = true;
|
152
|
+
}
|
153
|
+
|
154
|
+
if (brokenReference) this.recreateDOMReferences();
|
155
|
+
};
|
@@ -0,0 +1,165 @@
|
|
1
|
+
/**
|
2
|
+
Represents a panel holding the step description
|
3
|
+
|
4
|
+
@class StepDescription
|
5
|
+
@extends FadableItem
|
6
|
+
@@initializer
|
7
|
+
**/
|
8
|
+
var StepDescription = jazz.Class(function() {
|
9
|
+
this.nextButton = StepDescriptionNextButton.build();
|
10
|
+
}).extending(FadableItem).singleton;
|
11
|
+
|
12
|
+
/**
|
13
|
+
The step description text content
|
14
|
+
|
15
|
+
@@field text
|
16
|
+
@type String
|
17
|
+
**/
|
18
|
+
StepDescription.field("text", "");
|
19
|
+
|
20
|
+
/**
|
21
|
+
The title text for the step description panel
|
22
|
+
|
23
|
+
@@field title
|
24
|
+
@type String
|
25
|
+
**/
|
26
|
+
StepDescription.field("title", "");
|
27
|
+
|
28
|
+
/**
|
29
|
+
An object holding dimension information for the Step Description panel
|
30
|
+
|
31
|
+
@@field dimension
|
32
|
+
@type Object
|
33
|
+
**/
|
34
|
+
StepDescription.field("dimension", {});
|
35
|
+
|
36
|
+
/**
|
37
|
+
An object holding positioning information for the Step Description panel
|
38
|
+
|
39
|
+
@@field position
|
40
|
+
@type Object
|
41
|
+
**/
|
42
|
+
StepDescription.field("position", {});
|
43
|
+
|
44
|
+
/**
|
45
|
+
An object representing the next button for a step description panel
|
46
|
+
|
47
|
+
@@field nextButton
|
48
|
+
@type Object
|
49
|
+
**/
|
50
|
+
StepDescription.field("nextButton");
|
51
|
+
|
52
|
+
/**
|
53
|
+
Sets the text for the step description panel
|
54
|
+
|
55
|
+
@method setText
|
56
|
+
@param {String} text The text for the step description panel
|
57
|
+
**/
|
58
|
+
StepDescription.method("setText", function(text) {
|
59
|
+
this.text = text;
|
60
|
+
this.$el.find(".sideshow-step-text").text(text);
|
61
|
+
});
|
62
|
+
|
63
|
+
/**
|
64
|
+
Sets the HTML content for the step description panel
|
65
|
+
|
66
|
+
@method setHTML
|
67
|
+
@param {String} text The HTML content for step description panel
|
68
|
+
**/
|
69
|
+
StepDescription.method("setHTML", function(text) {
|
70
|
+
this.text = text;
|
71
|
+
this.$el.find(".sideshow-step-text").html(text);
|
72
|
+
});
|
73
|
+
|
74
|
+
/**
|
75
|
+
Sets the title for the step description panel
|
76
|
+
|
77
|
+
@method setTitle
|
78
|
+
@param {String} title The text for the step description panel
|
79
|
+
**/
|
80
|
+
StepDescription.method("setTitle", function(title) {
|
81
|
+
this.title = title;
|
82
|
+
this.$el.find("h2:first").text(title);
|
83
|
+
});
|
84
|
+
|
85
|
+
/**
|
86
|
+
Sets the title for the step description panel
|
87
|
+
|
88
|
+
@method setStepPosition
|
89
|
+
@param {String} title The text for the step description panel
|
90
|
+
**/
|
91
|
+
StepDescription.method("setStepPosition", function(stepPosition) {
|
92
|
+
this.stepPosition = stepPosition;
|
93
|
+
this.$el.find(".sideshow-step-position").text(stepPosition);
|
94
|
+
});
|
95
|
+
|
96
|
+
/**
|
97
|
+
Renders the step description panel
|
98
|
+
|
99
|
+
@method render
|
100
|
+
**/
|
101
|
+
StepDescription.method("render", function() {
|
102
|
+
this.$el = $("<div>")
|
103
|
+
.addClass("sideshow-step-description")
|
104
|
+
.addClass("sideshow-hidden")
|
105
|
+
.addClass("sideshow-invisible");
|
106
|
+
|
107
|
+
var stepPosition = $("<span>").addClass("sideshow-step-position");
|
108
|
+
this.$el.append(stepPosition);
|
109
|
+
if (currentWizard.showStepPosition === false) stepPosition.hide();
|
110
|
+
|
111
|
+
this.$el.append($("<h2>"));
|
112
|
+
this.$el.append($("<div>").addClass("sideshow-step-text"));
|
113
|
+
this.nextButton.render(this.$el);
|
114
|
+
this.nextButton.$el.click(function() {
|
115
|
+
currentWizard.next();
|
116
|
+
});
|
117
|
+
DetailsPanel.singleInstance.$el.append(this.$el);
|
118
|
+
});
|
119
|
+
|
120
|
+
/**
|
121
|
+
Shows the step description panel
|
122
|
+
|
123
|
+
@method show
|
124
|
+
**/
|
125
|
+
StepDescription.method("show", function(displayButKeepTransparent) {
|
126
|
+
this.callSuper("show", displayButKeepTransparent);
|
127
|
+
//this.positionate();
|
128
|
+
});
|
129
|
+
|
130
|
+
/**
|
131
|
+
Positionates the step description panel
|
132
|
+
|
133
|
+
@method positionate
|
134
|
+
**/
|
135
|
+
StepDescription.method("positionate", function() {
|
136
|
+
var dp = DetailsPanel.singleInstance;
|
137
|
+
|
138
|
+
if (dp.dimension.width >= 900)
|
139
|
+
this.dimension.width = 900;
|
140
|
+
else
|
141
|
+
this.dimension.width = dp.dimension.width * 0.9;
|
142
|
+
|
143
|
+
this.$el.css("width", this.dimension.width);
|
144
|
+
|
145
|
+
var paddingLeftRight = (parsePxValue(this.$el.css("padding-left")) + parsePxValue(this.$el.css("padding-right"))) / 2;
|
146
|
+
var paddingTopBottom = (parsePxValue(this.$el.css("padding-top")) + parsePxValue(this.$el.css("padding-bottom"))) / 2;
|
147
|
+
|
148
|
+
this.dimension.height = parsePxValue(this.$el.outerHeight());
|
149
|
+
|
150
|
+
//Checks if the description dimension overflow the available space in the details panel
|
151
|
+
if (this.dimension.height > dp.dimension.height || this.dimension.width < 400) {
|
152
|
+
this.dimension.width = $window.width() * 0.9;
|
153
|
+
this.$el.css("width", this.dimension.width);
|
154
|
+
this.dimension.height = parsePxValue(this.$el.outerHeight());
|
155
|
+
|
156
|
+
this.position.x = ($window.width() - this.dimension.width) / 2;
|
157
|
+
this.position.y = ($window.height() - this.dimension.height) / 2;
|
158
|
+
} else {
|
159
|
+
this.position.x = (dp.dimension.width - this.dimension.width) / 2;
|
160
|
+
this.position.y = (dp.dimension.height - this.dimension.height) / 2;
|
161
|
+
}
|
162
|
+
|
163
|
+
this.$el.css("left", this.position.x - paddingLeftRight);
|
164
|
+
this.$el.css("top", this.position.y - paddingTopBottom);
|
165
|
+
});
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/**
|
2
|
+
Step next button
|
3
|
+
|
4
|
+
@class StepDescriptionNextButton
|
5
|
+
@extends HidableItem
|
6
|
+
**/
|
7
|
+
var StepDescriptionNextButton = jazz.Class().extending(HidableItem);
|
8
|
+
|
9
|
+
/**
|
10
|
+
The text for the next button
|
11
|
+
|
12
|
+
@@field _text
|
13
|
+
@private
|
14
|
+
**/
|
15
|
+
StepDescriptionNextButton.field("_text");
|
16
|
+
|
17
|
+
/**
|
18
|
+
Disables the next button
|
19
|
+
|
20
|
+
@method disable
|
21
|
+
**/
|
22
|
+
StepDescriptionNextButton.method("disable", function() {
|
23
|
+
this.$el.attr("disabled", "disabled");
|
24
|
+
});
|
25
|
+
|
26
|
+
/**
|
27
|
+
Enables the next button
|
28
|
+
|
29
|
+
@method enable
|
30
|
+
**/
|
31
|
+
StepDescriptionNextButton.method("enable", function() {
|
32
|
+
this.$el.attr("disabled", null);
|
33
|
+
});
|
34
|
+
|
35
|
+
/**
|
36
|
+
Sets the text for the next button
|
37
|
+
|
38
|
+
@method setText
|
39
|
+
@param {String} text The text for the next button
|
40
|
+
**/
|
41
|
+
StepDescriptionNextButton.method("setText", function(text) {
|
42
|
+
this._text = text;
|
43
|
+
this.$el.text(text);
|
44
|
+
});
|
45
|
+
|
46
|
+
/**
|
47
|
+
Renders the Next Button
|
48
|
+
|
49
|
+
@method render
|
50
|
+
@param {Object} $stepDescriptionEl The jQuery wrapped DOM element for the Step Description panel
|
51
|
+
**/
|
52
|
+
StepDescriptionNextButton.method("render", function($stepDescriptionEl) {
|
53
|
+
this.$el = $("<button>").addClass("sideshow-next-step-button");
|
54
|
+
this.callSuper("render", $stepDescriptionEl);
|
55
|
+
});
|