replaced tipsy with bootstrap tooltip

This commit is contained in:
Hendrik Leppelsack 2015-06-22 12:48:04 +02:00
parent 9e48f7f3ba
commit f66e9af9a0
5 changed files with 186 additions and 3 deletions

119
core/css/tooltip.css Normal file
View File

@ -0,0 +1,119 @@
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.tooltip {
position: absolute;
z-index: 1070;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 12px;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
right: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}

View File

@ -10,7 +10,7 @@
],
"libraries": [
"jquery-showpassword.js",
"jquery-tipsy.js",
"tooltip.js",
"jquery.avatar.js",
"placeholder.js"
],

View File

@ -1742,3 +1742,61 @@ function getScrollBarWidth() {
return (w1 - w2);
}
/**
* jQuery tipsy shim for the bootstrap tooltip
*/
jQuery.fn.tipsy = function(argument) {
console.warn('Deprecation warning: tipsy is deprecated. Use tooltip instead.');
if(typeof argument === 'object' && argument !== null) {
// tipsy defaults
var options = {
placement: 'bottom',
delay: { 'show': 0, 'hide': 0},
trigger: 'hover',
html: false
};
console.log(argument);
// tooltip direction
if(argument.gravity) {
switch(argument.gravity) {
case 'n':
case 'nw':
case 'ne':
console.log('bottom');
options.placement='bottom';
break;
case 's':
case 'sw':
case 'se':
options.placement='top';
break;
case 'w':
console.log('right');
options.placement='right';
break;
case 'e':
options.placement='left';
break;
}
}
if(argument.trigger) {
options.trigger = argument.trigger;
}
if(argument.delayIn) {
options.delay["show"] = argument.delayIn;
}
if(argument.delayOut) {
options.delay["hide"] = argument.delayOut;
}
if(argument.html) {
options.html = true;
}
if(argument.title) {
options.title = argument.title;
}
jQuery.fn.tooltip.call(this, options);
}
jQuery.fn.tooltip.call(this, argument);
}

6
core/js/tooltip.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -392,7 +392,7 @@ class OC {
}
OC_Util::addScript("placeholders");
OC_Util::addScript("jquery-tipsy");
OC_Util::addScript("tooltip");
OC_Util::addScript("compatibility");
OC_Util::addScript("jquery.ocdialog");
OC_Util::addScript("oc-dialogs");
@ -426,7 +426,7 @@ class OC {
OC_Util::addStyle("multiselect");
OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui');
OC_Util::addStyle('jquery-ui-fixes');
OC_Util::addStyle("jquery-tipsy");
OC_Util::addStyle("tooltip");
OC_Util::addStyle("jquery.ocdialog");
}