Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
250e021f
Commit
250e021f
authored
Jan 08, 2014
by
soundarapandian
Committed by
XhmikosR
Jun 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate ZeroClipboard to easily copy code snippets
parent
9e1652aa
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1091 additions
and
0 deletions
+1091
-0
Gruntfile.js
Gruntfile.js
+1
-0
docs/assets/css/_src/docs.css
docs/assets/css/_src/docs.css
+33
-0
docs/assets/flash/zero-clipboard.swf
docs/assets/flash/zero-clipboard.swf
+0
-0
docs/assets/js/_src/application.js
docs/assets/js/_src/application.js
+47
-0
docs/assets/js/_vendor/zero-clipboard.js
docs/assets/js/_vendor/zero-clipboard.js
+1010
-0
No files found.
Gruntfile.js
View file @
250e021f
...
...
@@ -137,6 +137,7 @@ module.exports = function (grunt) {
},
src
:
[
'
docs/assets/js/_vendor/holder.js
'
,
'
docs/assets/js/_vendor/zero-clipboard.js
'
,
'
docs/assets/js/_src/application.js
'
],
dest
:
'
docs/assets/js/docs.min.js
'
...
...
docs/assets/css/_src/docs.css
View file @
250e021f
...
...
@@ -1466,3 +1466,36 @@ h1[id] {
-webkit-box-shadow
:
0
0
8px
rgba
(
82
,
168
,
236
,
.6
);
box-shadow
:
0
0
8px
rgba
(
82
,
168
,
236
,
.6
);
}
/*
* ZeroClipboard styles
*/
.zero-clipboard
{
position
:
relative
;
}
.btn-clipboard
{
position
:
absolute
;
right
:
0
;
z-index
:
10
;
padding
:
5px
10px
;
cursor
:
pointer
;
border-color
:
#e1e1e8
;
border-bottom
:
1px
solid
transparent
;
border-left
:
1px
solid
transparent
;
border-radius
:
0
4px
0
0
;
}
.btn-clipboard-hover
{
background-color
:
#e1e1e8
;
}
@media
(
max-width
:
768px
)
{
.btn-clipboard.with-example
{
top
:
10px
;
border
:
1px
solid
#e1e1e8
;
border-radius
:
0
;
}
}
docs/assets/flash/zero-clipboard.swf
0 → 100644
View file @
250e021f
File added
docs/assets/js/_src/application.js
View file @
250e021f
...
...
@@ -15,6 +15,19 @@
$
(
function
()
{
// Insert copy to clipboard button before .highlight or .bs-example
$
(
'
.highlight
'
).
each
(
function
()
{
var
highlight
=
$
(
this
)
var
previous
=
highlight
.
prev
()
var
btnHtml
=
'
<div class="zero-clipboard"><span class="glyphicon glyphicon-list-alt btn-clipboard"></span></div>
'
if
(
previous
.
hasClass
(
'
bs-example
'
))
{
previous
.
before
(
btnHtml
.
replace
(
/btn-clipboard/
,
'
btn-clipboard with-example
'
))
}
else
{
highlight
.
before
(
btnHtml
)
}
})
var
$window
=
$
(
window
)
var
$body
=
$
(
document
.
body
)
...
...
@@ -102,6 +115,40 @@
btn
.
button
(
'
reset
'
)
},
3000
)
})
// Handlers for ZeroClipboard
zeroClipboard
.
on
(
'
load
'
,
function
(
client
)
{
htmlBridge
.
data
(
'
placement
'
,
'
left
'
)
.
attr
(
'
title
'
,
'
copy to clipboard
'
)
.
tooltip
()
})
// Copy to clipboard
zeroClipboard
.
on
(
'
dataRequested
'
,
function
(
client
)
{
var
highlight
=
$
(
this
).
parent
().
nextAll
(
'
.highlight
'
).
first
()
client
.
setText
(
highlight
.
text
())
})
// Notify copy success and reset tooltip title
zeroClipboard
.
on
(
'
complete
'
,
function
(
client
)
{
htmlBridge
.
attr
(
'
title
'
,
'
copied!
'
)
.
tooltip
(
'
fixTitle
'
)
.
tooltip
(
'
show
'
)
.
attr
(
'
title
'
,
'
copy to clipboard
'
)
.
tooltip
(
'
fixTitle
'
)
})
// Notify copy failure
zeroClipboard
.
on
(
'
noflash wrongflash
'
,
function
(
client
)
{
htmlBridge
.
attr
(
'
title
'
,
'
flash not supported!
'
)
.
tooltip
(
'
fixTitle
'
)
.
tooltip
(
'
show
'
)
})
})
}(
jQuery
)
docs/assets/js/_vendor/zero-clipboard.js
0 → 100644
View file @
250e021f
This diff is collapsed.
Click to expand it.
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