Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
da3ad00c
Commit
da3ad00c
authored
Jun 07, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Tipsy by Bootstrap's tooltips
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
47054451
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
55 deletions
+10
-55
app/assets/javascripts/peek.js
app/assets/javascripts/peek.js
+0
-1
vendor/assets/javascripts/peek.js
vendor/assets/javascripts/peek.js
+1
-12
vendor/assets/javascripts/peek.performance_bar.js
vendor/assets/javascripts/peek.performance_bar.js
+9
-18
vendor/assets/stylesheets/peek.scss
vendor/assets/stylesheets/peek.scss
+0
-24
No files found.
app/assets/javascripts/peek.js
View file @
da3ad00c
import
'
vendor/jquery.tipsy
'
;
import
'
vendor/peek
'
;
import
'
vendor/peek.performance_bar
'
;
import
'
vendor/peek.rblineprof
'
;
...
...
vendor/assets/javascripts/peek.js
View file @
da3ad00c
...
...
@@ -3,7 +3,7 @@ var requestId;
requestId
=
null
;
(
function
(
$
)
{
var
fetchRequestResults
,
getRequestId
,
initializeTipsy
,
peekEnabled
,
toggleBar
,
updatePerformanceBar
;
var
fetchRequestResults
,
getRequestId
,
peekEnabled
,
toggleBar
,
updatePerformanceBar
;
getRequestId
=
function
()
{
if
(
requestId
!=
null
)
{
return
requestId
;
...
...
@@ -42,16 +42,6 @@ requestId = null;
}
return
$
(
document
).
trigger
(
'
peek:render
'
,
[
getRequestId
(),
results
]);
};
initializeTipsy
=
function
()
{
return
$
(
'
#peek .peek-tooltip, #peek .tooltip
'
).
each
(
function
()
{
var
el
,
gravity
;
el
=
$
(
this
);
gravity
=
el
.
hasClass
(
'
rightwards
'
)
||
el
.
hasClass
(
'
leftwards
'
)
?
$
.
fn
.
tipsy
.
autoWE
:
$
.
fn
.
tipsy
.
autoNS
;
return
el
.
tipsy
({
gravity
:
gravity
});
});
};
toggleBar
=
function
(
event
)
{
var
wrapper
;
if
(
$
(
event
.
target
).
is
(
'
:input
'
))
{
...
...
@@ -80,7 +70,6 @@ requestId = null;
});
};
$
(
document
).
on
(
'
keypress
'
,
toggleBar
);
$
(
document
).
on
(
'
peek:update
'
,
initializeTipsy
);
$
(
document
).
on
(
'
peek:update
'
,
fetchRequestResults
);
$
(
document
).
on
(
'
pjax:end
'
,
function
(
event
,
xhr
,
options
)
{
if
(
xhr
!=
null
)
{
...
...
vendor/assets/javascripts/peek.performance_bar.js
View file @
da3ad00c
...
...
@@ -85,17 +85,15 @@ PerformanceBar = (function() {
width
=
this
.
mapH
(
time
);
title
=
name
+
"
:
"
+
(
PerformanceBar
.
formatTime
(
time
));
bar
=
$
(
'
<li></li>
'
,
{
title
:
title
,
"
class
"
:
'
peek-tooltip
'
'
data-title
'
:
title
,
'
data-toggle
'
:
'
tooltip
'
,
'
data-container
'
:
'
body
'
});
bar
.
css
({
width
:
width
+
"
px
"
,
left
:
left
+
"
px
"
,
background
:
color
});
bar
.
tipsy
({
gravity
:
$
.
fn
.
tipsy
.
autoNS
});
return
this
.
el
.
append
(
bar
);
};
...
...
@@ -114,12 +112,10 @@ renderPerformanceBar = function() {
bar
=
new
PerformanceBar
;
bar
.
render
(
time
);
span
=
$
(
'
<span>
'
,
{
'
class
'
:
'
peek-tooltip
'
,
title
:
'
Total navigation time for this page.
'
'
data-toggle
'
:
'
tooltip
'
,
'
data-title
'
:
'
Total navigation time for this page.
'
,
'
data-container
'
:
'
body
'
}).
text
(
PerformanceBar
.
formatTime
(
bar
.
total
()));
span
.
tipsy
({
gravity
:
$
.
fn
.
tipsy
.
autoNS
});
return
updateStatus
(
span
);
};
...
...
@@ -168,12 +164,10 @@ $(document).on('pjax:end page:load turbolinks:load', function(event, xhr) {
tech
=
'
Turbolinks
'
;
}
span
=
$
(
'
<span>
'
,
{
'
class
'
:
'
peek-tooltip
'
,
title
:
tech
+
"
navigation time
"
'
data-toggle
'
:
'
tooltip
'
,
'
data-title
'
:
tech
+
"
navigation time
"
,
'
data-container
'
:
'
body
'
}).
text
(
PerformanceBar
.
formatTime
(
total
));
span
.
tipsy
({
gravity
:
$
.
fn
.
tipsy
.
autoNS
});
updateStatus
(
span
);
return
ajaxStart
=
null
;
},
0
);
...
...
@@ -186,6 +180,3 @@ $(function() {
return
$
(
'
#peek-view-performance-bar
'
).
remove
();
}
});
// ---
// generated by coffee-script 1.9.2
vendor/assets/stylesheets/peek.scss
View file @
da3ad00c
...
...
@@ -86,29 +86,5 @@
}
#modal-peek-pg-queries-content
{
// background: #999;
color
:
#000
;
}
.tipsy
{
font-size
:
10px
;
position
:
absolute
;
padding
:
5px
;
z-index
:
100000
;
}
.tipsy-inner
{
background-color
:
#000
;
color
:
#FFF
;
max-width
:
200px
;
padding
:
5px
8px
4px
8px
;
text-align
:
center
;
}
/* Rounded corners */
.tipsy-inner
{
border-radius
:
3px
;
-moz-border-radius
:
3px
;
-webkit-border-radius
:
3px
;
}
.tipsy-arrow
{
position
:
absolute
;
width
:
0
;
height
:
0
;
line-height
:
0
;
border
:
5px
dashed
#000
;
}
/* Rules to colour arrows */
.tipsy-arrow-n
{
border-bottom-color
:
#000
;
}
.tipsy-arrow-s
{
border-top-color
:
#000
;
}
.tipsy-arrow-e
{
border-left-color
:
#000
;
}
.tipsy-arrow-w
{
border-right-color
:
#000
;
}
.tipsy-n
.tipsy-arrow
{
top
:
0px
;
left
:
50%
;
margin-left
:
-5px
;
border-bottom-style
:
solid
;
border-top
:
none
;
border-left-color
:
transparent
;
border-right-color
:
transparent
;
}
.tipsy-nw
.tipsy-arrow
{
top
:
0
;
left
:
10px
;
border-bottom-style
:
solid
;
border-top
:
none
;
border-left-color
:
transparent
;
border-right-color
:
transparent
;}
.tipsy-ne
.tipsy-arrow
{
top
:
0
;
right
:
10px
;
border-bottom-style
:
solid
;
border-top
:
none
;
border-left-color
:
transparent
;
border-right-color
:
transparent
;}
.tipsy-s
.tipsy-arrow
{
bottom
:
0
;
left
:
50%
;
margin-left
:
-5px
;
border-top-style
:
solid
;
border-bottom
:
none
;
border-left-color
:
transparent
;
border-right-color
:
transparent
;
}
.tipsy-sw
.tipsy-arrow
{
bottom
:
0
;
left
:
10px
;
border-top-style
:
solid
;
border-bottom
:
none
;
border-left-color
:
transparent
;
border-right-color
:
transparent
;
}
.tipsy-se
.tipsy-arrow
{
bottom
:
0
;
right
:
10px
;
border-top-style
:
solid
;
border-bottom
:
none
;
border-left-color
:
transparent
;
border-right-color
:
transparent
;
}
.tipsy-e
.tipsy-arrow
{
right
:
0
;
top
:
50%
;
margin-top
:
-5px
;
border-left-style
:
solid
;
border-right
:
none
;
border-top-color
:
transparent
;
border-bottom-color
:
transparent
;
}
.tipsy-w
.tipsy-arrow
{
left
:
0
;
top
:
50%
;
margin-top
:
-5px
;
border-right-style
:
solid
;
border-left
:
none
;
border-top-color
:
transparent
;
border-bottom-color
:
transparent
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment