jekyll-sharp-styleguide 0.1.0
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/LICENSE.txt +21 -0
- data/README.md +382 -0
- data/_includes/blockquotes.html +4 -0
- data/_includes/buttons.html +16 -0
- data/_includes/codes.html +64 -0
- data/_includes/colors.html +36 -0
- data/_includes/columns.html +10 -0
- data/_includes/favicons.html +9 -0
- data/_includes/footer.html +7 -0
- data/_includes/header.html +10 -0
- data/_includes/headings.html +10 -0
- data/_includes/icons.html +1068 -0
- data/_includes/image.html +4 -0
- data/_includes/inputs.html +50 -0
- data/_includes/lightbox.html +8 -0
- data/_includes/lists.html +44 -0
- data/_includes/loader.html +5 -0
- data/_includes/paragraphs.html +7 -0
- data/_includes/scripts.html +5 -0
- data/_includes/tags.html +23 -0
- data/_layouts/default.html +1 -0
- data/_layouts/page.html +5 -0
- data/_layouts/post.html +5 -0
- data/_sass/_blockquotes.scss +15 -0
- data/_sass/_buttons.scss +37 -0
- data/_sass/_codes.scss +253 -0
- data/_sass/_colors.scss +24 -0
- data/_sass/_columns.scss +42 -0
- data/_sass/_content.scss +26 -0
- data/_sass/_footer.scss +7 -0
- data/_sass/_header.scss +37 -0
- data/_sass/_headings.scss +66 -0
- data/_sass/_helpers.scss +85 -0
- data/_sass/_icons.scss +865 -0
- data/_sass/_inputs.scss +116 -0
- data/_sass/_lightbox.scss +67 -0
- data/_sass/_lists.scss +94 -0
- data/_sass/_loader.scss +53 -0
- data/_sass/_paragraphs.scss +60 -0
- data/_sass/_reset.scss +50 -0
- data/_sass/_tags.scss +21 -0
- data/_sass/_tooltips.scss +56 -0
- data/_sass/_variables.scss +30 -0
- data/_sass/main.scss +21 -0
- data/assets/css/main.scss +4 -0
- data/assets/fonts/Feather.svg +276 -0
- data/assets/fonts/Feather.ttf +0 -0
- data/assets/fonts/Feather.woff +0 -0
- data/assets/img/favicons/android-chrome-192x192.png +0 -0
- data/assets/img/favicons/android-chrome-512x512.png +0 -0
- data/assets/img/favicons/apple-touch-icon.png +0 -0
- data/assets/img/favicons/browserconfig.xml +9 -0
- data/assets/img/favicons/favicon-16x16.png +0 -0
- data/assets/img/favicons/favicon-32x32.png +0 -0
- data/assets/img/favicons/favicon.ico +0 -0
- data/assets/img/favicons/mstile-150x150.png +0 -0
- data/assets/img/favicons/safari-pinned-tab.svg +25 -0
- data/assets/img/favicons/site.webmanifest +19 -0
- data/assets/img/header_bg.webp +0 -0
- data/assets/img/lightbox.jpg +0 -0
- data/assets/img/logo.png +0 -0
- data/assets/js/copycode.js +49 -0
- data/assets/js/loader.js +11 -0
- data/assets/js/main.js +60 -0
- data/assets/js/tooltip.js +492 -0
- metadata +123 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
5
|
+
width="800.000000pt" height="800.000000pt" viewBox="0 0 800.000000 800.000000"
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
7
|
+
<metadata>
|
8
|
+
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
9
|
+
</metadata>
|
10
|
+
<g transform="translate(0.000000,800.000000) scale(0.100000,-0.100000)"
|
11
|
+
fill="#000000" stroke="none">
|
12
|
+
<path d="M560 7976 c-103 -31 -141 -49 -220 -101 -140 -93 -263 -252 -314
|
13
|
+
-407 l-26 -77 0 -3386 0 -3386 26 -77 c38 -114 96 -206 193 -303 129 -128 267
|
14
|
+
-200 441 -228 91 -15 6589 -15 6680 0 174 28 312 100 441 228 97 97 155 189
|
15
|
+
193 303 l26 77 0 3386 0 3386 -26 77 c-38 114 -96 206 -193 303 -97 97 -186
|
16
|
+
154 -306 196 l-80 28 -3380 2 -3380 2 -75 -23z m4385 -1225 c272 -61 502 -178
|
17
|
+
715 -363 230 -199 429 -502 529 -804 170 -510 110 -1079 -160 -1529 -138 -230
|
18
|
+
-380 -458 -602 -566 -37 -19 -65 -39 -63 -45 2 -6 266 -455 585 -998 320 -543
|
19
|
+
581 -989 581 -991 0 -3 -249 -5 -553 -5 l-554 0 -529 890 -529 890 -502 0
|
20
|
+
-503 0 0 -890 0 -890 -505 0 -505 0 0 2665 0 2666 1248 -4 1247 -3 100 -23z"/>
|
21
|
+
<path d="M3360 5010 l0 -860 668 0 c715 0 724 1 825 51 209 105 370 368 407
|
22
|
+
663 16 123 8 282 -20 396 -53 219 -209 431 -395 535 -129 72 -97 69 -827 73
|
23
|
+
l-658 3 0 -861z"/>
|
24
|
+
</g>
|
25
|
+
</svg>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "",
|
3
|
+
"short_name": "",
|
4
|
+
"icons": [
|
5
|
+
{
|
6
|
+
"src": "/assets/img/favicons/android-chrome-192x192.png",
|
7
|
+
"sizes": "192x192",
|
8
|
+
"type": "image/png"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"src": "/assets/img/favicons/android-chrome-512x512.png",
|
12
|
+
"sizes": "512x512",
|
13
|
+
"type": "image/png"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"theme_color": "#ffffff",
|
17
|
+
"background_color": "#ffffff",
|
18
|
+
"display": "standalone"
|
19
|
+
}
|
Binary file
|
Binary file
|
data/assets/img/logo.png
ADDED
Binary file
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// get the list of all highlight code blocks
|
2
|
+
const highlights = document.querySelectorAll('pre');
|
3
|
+
|
4
|
+
highlights.forEach((pre) => {
|
5
|
+
// create the copy button
|
6
|
+
const copy = document.createElement('button');
|
7
|
+
copy.innerHTML = 'Copy';
|
8
|
+
// add the event listener to each click
|
9
|
+
copy.addEventListener('click', handleCopyClick);
|
10
|
+
// append the copy button to each code block
|
11
|
+
pre.append(copy);
|
12
|
+
});
|
13
|
+
|
14
|
+
const copyToClipboard = (str) => {
|
15
|
+
const el = document.createElement('textarea'); // Create a <textarea> element
|
16
|
+
el.value = str; // Set its value to the string that you want copied
|
17
|
+
el.setAttribute('readonly', ''); // Make it readonly to be tamper-proof
|
18
|
+
el.style.position = 'absolute';
|
19
|
+
el.style.left = '-9999px'; // Move outside the screen to make it invisible
|
20
|
+
document.body.appendChild(el); // Append the <textarea> element to the HTML document
|
21
|
+
const selected =
|
22
|
+
document.getSelection().rangeCount > 0 // Check if there is any content selected previously
|
23
|
+
? document.getSelection().getRangeAt(0) // Store selection if found
|
24
|
+
: false; // Mark as false to know no selection existed before
|
25
|
+
el.select(); // Select the <textarea> content
|
26
|
+
document.execCommand('copy'); // Copy - only works as a result of a user action (e.g. click events)
|
27
|
+
document.body.removeChild(el); // Remove the <textarea> element
|
28
|
+
if (selected) {
|
29
|
+
// If a selection existed before copying
|
30
|
+
document.getSelection().removeAllRanges(); // Unselect everything on the HTML document
|
31
|
+
document.getSelection().addRange(selected); // Restore the original selection
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
function handleCopyClick(evt) {
|
36
|
+
// get the children of the parent element
|
37
|
+
const {children} = evt.target.parentElement;
|
38
|
+
// grab the first element (we append the copy button on afterwards, so the first will be the code element)
|
39
|
+
// destructure the innerText from the code block
|
40
|
+
const {innerText} = Array.from(children)[0];
|
41
|
+
// copy all of the code to the clipboard
|
42
|
+
copyToClipboard(innerText);
|
43
|
+
// Change the button's text to "Copied"
|
44
|
+
this.textContent = 'Copied';
|
45
|
+
// Change back the button text to "Copy" after 2 sec
|
46
|
+
setTimeout(() => {
|
47
|
+
this.textContent = 'Copy';
|
48
|
+
}, 2000);
|
49
|
+
}
|
data/assets/js/loader.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
document.body.addEventListener("touchmove", preventDefault, { passive: false });
|
2
|
+
window.addEventListener("load", function () {
|
3
|
+
//document.getElementById("loader").style.display = "none";
|
4
|
+
$("#loader").fadeOut(700);
|
5
|
+
document.body.removeEventListener("touchmove", preventDefault, {
|
6
|
+
passive: false,
|
7
|
+
});
|
8
|
+
});
|
9
|
+
function preventDefault(e) {
|
10
|
+
e.preventDefault();
|
11
|
+
}
|
data/assets/js/main.js
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
jQuery(document).ready(function ($) {
|
2
|
+
// ==================================================================================
|
3
|
+
|
4
|
+
// Creates an image lightbox
|
5
|
+
$(function () {
|
6
|
+
var lightbox = $("#lightbox");
|
7
|
+
lightbox.hide();
|
8
|
+
$(".allow-lightbox").click(function () {
|
9
|
+
var src = $(this).attr("src");
|
10
|
+
$("body").addClass("lightbox-opened");
|
11
|
+
lightbox.fadeIn().css("display", "flex");
|
12
|
+
lightbox.find("img").attr("src", src);
|
13
|
+
});
|
14
|
+
$("#lightbox .close").click(function () {
|
15
|
+
lightbox.fadeOut();
|
16
|
+
$("body").removeClass("lightbox-opened");
|
17
|
+
});
|
18
|
+
});
|
19
|
+
|
20
|
+
// Select field placeholder color
|
21
|
+
$(function(){
|
22
|
+
function select_placeholder() {
|
23
|
+
$("select").each(function () {
|
24
|
+
var select_val = $(this).val();
|
25
|
+
if (select_val != "") {
|
26
|
+
$(this).removeClass("select-placeholder");
|
27
|
+
} else {
|
28
|
+
$(this).addClass("select-placeholder");
|
29
|
+
}
|
30
|
+
});
|
31
|
+
}
|
32
|
+
$(document).on("change", "select", function () {
|
33
|
+
select_placeholder();
|
34
|
+
});
|
35
|
+
select_placeholder();
|
36
|
+
});
|
37
|
+
|
38
|
+
// Initialize tooltips on icons
|
39
|
+
$(function (){
|
40
|
+
$('.icons-list i').simpletooltip({
|
41
|
+
color: 'white',
|
42
|
+
});
|
43
|
+
});
|
44
|
+
|
45
|
+
// Make anchor headings hash in url
|
46
|
+
$(function () {
|
47
|
+
$("h2, h3, h4").each(function () {
|
48
|
+
var str = $(this).text().toLowerCase().replace(/\s+/g, "-");
|
49
|
+
//str.toString().replace(/\s+/g, "-");
|
50
|
+
$(this).attr("id", str);
|
51
|
+
$(this).prepend('<a class="anchor"><i class="feather-link"></i></a>');
|
52
|
+
});
|
53
|
+
$(".anchor").click(function (e) {
|
54
|
+
window.location.hash = $(this).parent().attr("id");
|
55
|
+
e.preventDefault();
|
56
|
+
});
|
57
|
+
});
|
58
|
+
|
59
|
+
// ==================================================================================
|
60
|
+
});
|
@@ -0,0 +1,492 @@
|
|
1
|
+
/**
|
2
|
+
* Simpletooltip is a JQuery plugin, thought to insert short tooltips to any element of your website more easily
|
3
|
+
* v1.3.0
|
4
|
+
*
|
5
|
+
* 2014 Carlos Sanz Garcia
|
6
|
+
* Distributed under GPL-3.0 license
|
7
|
+
*
|
8
|
+
* http://not-only-code.github.com/Simpletooltip
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function (a) {
|
12
|
+
'use strict';
|
13
|
+
var b,
|
14
|
+
c = null;
|
15
|
+
b = function (a) {
|
16
|
+
if (a === undefined || typeof a !== 'object') {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
this.$el = a.$el || null;
|
20
|
+
this.$tooltip = null;
|
21
|
+
this.$arrow = null;
|
22
|
+
this.margins = {
|
23
|
+
border: 6,
|
24
|
+
top: 15,
|
25
|
+
right: 15,
|
26
|
+
bottom: 15,
|
27
|
+
left: 15,
|
28
|
+
};
|
29
|
+
this.settings = {};
|
30
|
+
this.themes = {};
|
31
|
+
if (
|
32
|
+
!this.isJqueryObject(this.$el) ||
|
33
|
+
this.$el
|
34
|
+
.data()
|
35
|
+
.hasOwnProperty('simpletooltipInstanced')
|
36
|
+
) {
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
this.title = this.$el.attr('title');
|
40
|
+
if (this.title === undefined || !this.title.length) {
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
this.$el.attr('title', '');
|
44
|
+
this.setOptions(a.settings);
|
45
|
+
this.setTooltip();
|
46
|
+
this.initialize();
|
47
|
+
this.$el.data('simpletooltip-instanced', '1');
|
48
|
+
return this;
|
49
|
+
};
|
50
|
+
b.defaults = {
|
51
|
+
position: 'top',
|
52
|
+
color: '#DDDDDD',
|
53
|
+
background_color: '#222222',
|
54
|
+
border_width: 0,
|
55
|
+
arrow_width: 6,
|
56
|
+
padding: {
|
57
|
+
width: 8,
|
58
|
+
height: 6,
|
59
|
+
},
|
60
|
+
max_width: 200,
|
61
|
+
fade: true,
|
62
|
+
};
|
63
|
+
b.themes = {
|
64
|
+
dark: {
|
65
|
+
color: '#CCCCCC',
|
66
|
+
background_color: '#222222',
|
67
|
+
border_color: '#111111',
|
68
|
+
border_width: 4,
|
69
|
+
},
|
70
|
+
gray: {
|
71
|
+
color: '#434343',
|
72
|
+
background_color: '#DCDCDC',
|
73
|
+
border_color: '#BABABA',
|
74
|
+
border_width: 4,
|
75
|
+
},
|
76
|
+
white: {
|
77
|
+
color: '#6D7988',
|
78
|
+
background_color: '#CCDEF2',
|
79
|
+
border_color: '#FFFFFF',
|
80
|
+
border_width: 4,
|
81
|
+
},
|
82
|
+
blue: {
|
83
|
+
color: '#FFFFFF',
|
84
|
+
background_color: '#0088BE',
|
85
|
+
border_color: '#00669C',
|
86
|
+
border_width: 4,
|
87
|
+
},
|
88
|
+
};
|
89
|
+
b.templates = {
|
90
|
+
tooltip: '<div class="simple-tooltip"></div>',
|
91
|
+
arrow: '<span class="arrow"> </span>',
|
92
|
+
};
|
93
|
+
b.prototype.isJqueryObject = function (a) {
|
94
|
+
return (
|
95
|
+
a !== null &&
|
96
|
+
a !== undefined &&
|
97
|
+
typeof a === 'object' &&
|
98
|
+
a.jquery !== undefined
|
99
|
+
);
|
100
|
+
};
|
101
|
+
b.prototype.setTooltip = function () {
|
102
|
+
if (
|
103
|
+
this.isJqueryObject(this.$tooltip) &&
|
104
|
+
this.isJqueryObject(this.$arrow)
|
105
|
+
) {
|
106
|
+
return;
|
107
|
+
}
|
108
|
+
this.$tooltip = a(b.templates.tooltip);
|
109
|
+
this.$tooltip.html(this.title);
|
110
|
+
this.$tooltip.addClass(this.getAttribute('position'));
|
111
|
+
this.$arrow = a(b.templates.arrow);
|
112
|
+
this.$tooltip.append(this.$arrow);
|
113
|
+
return this.$tooltip;
|
114
|
+
};
|
115
|
+
b.prototype.setOptions = function (c) {
|
116
|
+
if (c === undefined || typeof c !== 'object') {
|
117
|
+
return;
|
118
|
+
}
|
119
|
+
this.settings = a.extend(b.defaults, c);
|
120
|
+
if (
|
121
|
+
this.settings['themes'] !== undefined &&
|
122
|
+
typeof this.settings.themes === 'object'
|
123
|
+
) {
|
124
|
+
this.themes = a.extend(
|
125
|
+
b.themes,
|
126
|
+
this.settings.themes
|
127
|
+
);
|
128
|
+
delete this.settings.themes;
|
129
|
+
}
|
130
|
+
if (this.themes[this.settings.theme] !== undefined) {
|
131
|
+
this.settings = a.extend(
|
132
|
+
this.settings,
|
133
|
+
this.themes[this.settings.theme]
|
134
|
+
);
|
135
|
+
}
|
136
|
+
};
|
137
|
+
b.prototype.initialize = function () {
|
138
|
+
this.$el.on(
|
139
|
+
'mouseenter',
|
140
|
+
{
|
141
|
+
that: this,
|
142
|
+
},
|
143
|
+
this.mouseOver
|
144
|
+
);
|
145
|
+
this.$el.on(
|
146
|
+
'mouseleave',
|
147
|
+
{
|
148
|
+
that: this,
|
149
|
+
},
|
150
|
+
this.mouseOut
|
151
|
+
);
|
152
|
+
this.$el.attr('title', '');
|
153
|
+
};
|
154
|
+
b.prototype.getAttribute = function (a) {
|
155
|
+
var b = 'simpletooltip-' + a.replace('_', '-'),
|
156
|
+
c;
|
157
|
+
if (this.$el.data(b) !== undefined) {
|
158
|
+
return this.$el.data(b);
|
159
|
+
}
|
160
|
+
if (
|
161
|
+
(c = this.$el.data('simpletooltip-theme')) !==
|
162
|
+
undefined
|
163
|
+
) {
|
164
|
+
if (
|
165
|
+
this.themes[c] !== undefined &&
|
166
|
+
this.themes[c][a] !== undefined
|
167
|
+
) {
|
168
|
+
return this.themes[c][a];
|
169
|
+
}
|
170
|
+
}
|
171
|
+
if (this.settings[a] !== undefined) {
|
172
|
+
return this.settings[a];
|
173
|
+
}
|
174
|
+
return false;
|
175
|
+
};
|
176
|
+
b.prototype.mouseOver = function (a) {
|
177
|
+
var b = a.data.that;
|
178
|
+
if (b.$tooltip.parent().length) {
|
179
|
+
return a;
|
180
|
+
}
|
181
|
+
c.append(b.$tooltip);
|
182
|
+
b.$tooltip.hide();
|
183
|
+
b.styleTooltip();
|
184
|
+
if (b.getAttribute('fade')) {
|
185
|
+
b.$tooltip.delay(180).fadeIn(200);
|
186
|
+
} else {
|
187
|
+
b.$tooltip.show();
|
188
|
+
}
|
189
|
+
return a;
|
190
|
+
};
|
191
|
+
b.prototype.mouseOut = function (a) {
|
192
|
+
var b = a.data.that;
|
193
|
+
if (!b.$tooltip.parent().length) {
|
194
|
+
return a;
|
195
|
+
}
|
196
|
+
if (!b.$tooltip.css('opacity')) {
|
197
|
+
b.$tooltip.remove();
|
198
|
+
return a;
|
199
|
+
}
|
200
|
+
if (b.getAttribute('fade')) {
|
201
|
+
b.$tooltip
|
202
|
+
.clearQueue()
|
203
|
+
.stop()
|
204
|
+
.fadeOut(100, function () {
|
205
|
+
b.$tooltip.remove();
|
206
|
+
});
|
207
|
+
} else {
|
208
|
+
b.$tooltip.remove();
|
209
|
+
}
|
210
|
+
return a;
|
211
|
+
};
|
212
|
+
b.prototype.styleTooltip = function () {
|
213
|
+
if (
|
214
|
+
!this.isJqueryObject(this.$el) ||
|
215
|
+
!this.isJqueryObject(this.$tooltip)
|
216
|
+
) {
|
217
|
+
return;
|
218
|
+
}
|
219
|
+
var b = this.$el.offset(),
|
220
|
+
c = this.getAttribute('background_color'),
|
221
|
+
d = this.getAttribute('border_color');
|
222
|
+
if (!this.isJqueryObject(this.$arrow)) {
|
223
|
+
this.$arrow = this.$tooltip.find(' > .arrow');
|
224
|
+
}
|
225
|
+
var e = this.getAttribute('border_width');
|
226
|
+
e =
|
227
|
+
!d || typeof e === 'boolean' || e === 'none'
|
228
|
+
? 0
|
229
|
+
: Number(e);
|
230
|
+
var f = !e || !d ? c : d;
|
231
|
+
var g = Math.round((this.settings.arrow_width * 3) / 4),
|
232
|
+
h = -parseInt(this.settings.arrow_width * 2 + e, 10),
|
233
|
+
i = -parseInt(g * 2 + e, 10);
|
234
|
+
var j = {
|
235
|
+
maxWidth: this.getAttribute('max_width'),
|
236
|
+
backgroundColor: c,
|
237
|
+
color: this.getAttribute('color'),
|
238
|
+
borderColor: d,
|
239
|
+
borderWidth: e,
|
240
|
+
};
|
241
|
+
switch (this.getAttribute('position')) {
|
242
|
+
case 'top-right':
|
243
|
+
b.top -= parseInt(
|
244
|
+
this.$tooltip.outerHeight() + this.margins.bottom,
|
245
|
+
10
|
246
|
+
);
|
247
|
+
b.left += parseInt(
|
248
|
+
this.$el.outerWidth() -
|
249
|
+
this.margins.right -
|
250
|
+
this.margins.border,
|
251
|
+
10
|
252
|
+
);
|
253
|
+
this.$arrow.css({
|
254
|
+
left: this.settings.padding.width - e,
|
255
|
+
borderWidth: g,
|
256
|
+
bottom: i,
|
257
|
+
borderTopColor: f,
|
258
|
+
borderLeftColor: f,
|
259
|
+
});
|
260
|
+
break;
|
261
|
+
|
262
|
+
case 'right-top':
|
263
|
+
b.top -= parseInt(
|
264
|
+
this.$tooltip.outerHeight() - this.margins.bottom,
|
265
|
+
10
|
266
|
+
);
|
267
|
+
b.left += parseInt(
|
268
|
+
this.$el.outerWidth() + this.margins.right,
|
269
|
+
10
|
270
|
+
);
|
271
|
+
this.$arrow.css({
|
272
|
+
bottom: this.settings.padding.height - e,
|
273
|
+
borderWidth: g,
|
274
|
+
left: i,
|
275
|
+
borderRightColor: f,
|
276
|
+
borderBottomColor: f,
|
277
|
+
});
|
278
|
+
break;
|
279
|
+
|
280
|
+
case 'right':
|
281
|
+
b.top += parseInt(
|
282
|
+
(this.$el.outerHeight() -
|
283
|
+
this.$tooltip.outerHeight()) /
|
284
|
+
2,
|
285
|
+
10
|
286
|
+
);
|
287
|
+
b.left += parseInt(
|
288
|
+
this.$el.outerWidth() + this.margins.right,
|
289
|
+
10
|
290
|
+
);
|
291
|
+
this.$arrow.css({
|
292
|
+
left: h,
|
293
|
+
borderRightColor: f,
|
294
|
+
marginTop: -this.settings.arrow_width,
|
295
|
+
});
|
296
|
+
break;
|
297
|
+
|
298
|
+
case 'right-bottom':
|
299
|
+
b.top += parseInt(
|
300
|
+
this.$el.outerHeight() - this.margins.bottom,
|
301
|
+
10
|
302
|
+
);
|
303
|
+
b.left += parseInt(
|
304
|
+
this.$el.outerWidth() + this.margins.right,
|
305
|
+
10
|
306
|
+
);
|
307
|
+
this.$arrow.css({
|
308
|
+
top: this.settings.padding.height - e,
|
309
|
+
borderWidth: g,
|
310
|
+
left: i,
|
311
|
+
borderRightColor: f,
|
312
|
+
borderTopColor: f,
|
313
|
+
});
|
314
|
+
break;
|
315
|
+
|
316
|
+
case 'bottom-right':
|
317
|
+
b.top += parseInt(
|
318
|
+
this.$el.outerHeight() + this.margins.bottom,
|
319
|
+
10
|
320
|
+
);
|
321
|
+
b.left += parseInt(
|
322
|
+
this.$el.outerWidth() -
|
323
|
+
this.margins.right -
|
324
|
+
this.margins.border,
|
325
|
+
10
|
326
|
+
);
|
327
|
+
this.$arrow.css({
|
328
|
+
left: this.settings.padding.width - e,
|
329
|
+
borderWidth: g,
|
330
|
+
top: i,
|
331
|
+
borderBottomColor: f,
|
332
|
+
borderLeftColor: f,
|
333
|
+
});
|
334
|
+
break;
|
335
|
+
|
336
|
+
case 'bottom':
|
337
|
+
b.top += parseInt(
|
338
|
+
this.$el.outerHeight() + this.margins.bottom,
|
339
|
+
10
|
340
|
+
);
|
341
|
+
b.left += parseInt(
|
342
|
+
(this.$el.outerWidth() -
|
343
|
+
this.$tooltip.outerWidth()) /
|
344
|
+
2,
|
345
|
+
10
|
346
|
+
);
|
347
|
+
this.$arrow.css({
|
348
|
+
top: h,
|
349
|
+
marginLeft: -this.settings.arrow_width,
|
350
|
+
borderBottomColor: f,
|
351
|
+
});
|
352
|
+
break;
|
353
|
+
|
354
|
+
case 'bottom-left':
|
355
|
+
b.top += parseInt(
|
356
|
+
this.$el.outerHeight() + this.margins.bottom,
|
357
|
+
10
|
358
|
+
);
|
359
|
+
b.left -= parseInt(
|
360
|
+
this.$tooltip.outerWidth() -
|
361
|
+
this.margins.left -
|
362
|
+
this.margins.border,
|
363
|
+
10
|
364
|
+
);
|
365
|
+
this.$arrow.css({
|
366
|
+
right: this.settings.padding.width - e,
|
367
|
+
borderWidth: g,
|
368
|
+
top: i,
|
369
|
+
borderBottomColor: f,
|
370
|
+
borderRightColor: f,
|
371
|
+
});
|
372
|
+
break;
|
373
|
+
|
374
|
+
case 'left-bottom':
|
375
|
+
b.top += parseInt(
|
376
|
+
this.$el.outerHeight() - this.margins.bottom,
|
377
|
+
10
|
378
|
+
);
|
379
|
+
b.left -= parseInt(
|
380
|
+
this.$tooltip.outerWidth() + this.margins.left,
|
381
|
+
10
|
382
|
+
);
|
383
|
+
this.$arrow.css({
|
384
|
+
top: this.settings.padding.height - e,
|
385
|
+
borderWidth: g,
|
386
|
+
right: i,
|
387
|
+
borderLeftColor: f,
|
388
|
+
borderTopColor: f,
|
389
|
+
});
|
390
|
+
break;
|
391
|
+
|
392
|
+
case 'left':
|
393
|
+
b.top += parseInt(
|
394
|
+
(this.$el.outerHeight() -
|
395
|
+
this.$tooltip.outerHeight()) /
|
396
|
+
2,
|
397
|
+
10
|
398
|
+
);
|
399
|
+
b.left -= parseInt(
|
400
|
+
this.$tooltip.outerWidth() + this.margins.left,
|
401
|
+
10
|
402
|
+
);
|
403
|
+
this.$arrow.css({
|
404
|
+
right: h,
|
405
|
+
borderLeftColor: f,
|
406
|
+
marginTop: -this.settings.arrow_width,
|
407
|
+
});
|
408
|
+
break;
|
409
|
+
|
410
|
+
case 'left-top':
|
411
|
+
b.top -= parseInt(
|
412
|
+
this.$tooltip.outerHeight() - this.margins.bottom,
|
413
|
+
10
|
414
|
+
);
|
415
|
+
b.left -= parseInt(
|
416
|
+
this.$tooltip.outerWidth() + this.margins.left,
|
417
|
+
10
|
418
|
+
);
|
419
|
+
this.$arrow.css({
|
420
|
+
bottom: this.settings.padding.height - e,
|
421
|
+
borderWidth: g,
|
422
|
+
right: i,
|
423
|
+
borderLeftColor: f,
|
424
|
+
borderBottomColor: f,
|
425
|
+
});
|
426
|
+
break;
|
427
|
+
|
428
|
+
case 'top-left':
|
429
|
+
b.top -= parseInt(
|
430
|
+
this.$tooltip.outerHeight() + this.margins.bottom,
|
431
|
+
10
|
432
|
+
);
|
433
|
+
b.left -= parseInt(
|
434
|
+
this.$tooltip.outerWidth() - this.margins.left,
|
435
|
+
10
|
436
|
+
);
|
437
|
+
this.$arrow.css({
|
438
|
+
right: this.settings.padding.width - e,
|
439
|
+
borderWidth: g,
|
440
|
+
bottom: i,
|
441
|
+
borderTopColor: f,
|
442
|
+
borderRightColor: f,
|
443
|
+
});
|
444
|
+
break;
|
445
|
+
|
446
|
+
default:
|
447
|
+
b.top -= parseInt(
|
448
|
+
this.$tooltip.outerHeight() + this.margins.top,
|
449
|
+
10
|
450
|
+
);
|
451
|
+
b.left += parseInt(
|
452
|
+
(this.$el.outerWidth() -
|
453
|
+
this.$tooltip.outerWidth()) /
|
454
|
+
2,
|
455
|
+
10
|
456
|
+
);
|
457
|
+
this.$arrow.css({
|
458
|
+
bottom: h,
|
459
|
+
borderTopColor: f,
|
460
|
+
marginLeft: -this.settings.arrow_width,
|
461
|
+
});
|
462
|
+
}
|
463
|
+
this.$tooltip.css(
|
464
|
+
a.extend(j, {
|
465
|
+
top: b.top,
|
466
|
+
left: b.left,
|
467
|
+
})
|
468
|
+
);
|
469
|
+
};
|
470
|
+
a.fn.simpletooltip = function (c) {
|
471
|
+
return this.each(function () {
|
472
|
+
var d = a(this);
|
473
|
+
if (
|
474
|
+
!d.data().hasOwnProperty('simpletooltipInstanced')
|
475
|
+
) {
|
476
|
+
var e = {
|
477
|
+
$el: d,
|
478
|
+
};
|
479
|
+
if (c !== undefined && typeof c === 'object') {
|
480
|
+
e.settings = c;
|
481
|
+
}
|
482
|
+
new b(e);
|
483
|
+
}
|
484
|
+
});
|
485
|
+
};
|
486
|
+
a(window).on('load', function () {
|
487
|
+
c = a('body');
|
488
|
+
a('[data-simpletooltip="init"]').each(function () {
|
489
|
+
a(this).simpletooltip();
|
490
|
+
});
|
491
|
+
});
|
492
|
+
})(jQuery);
|