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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ac5cbb6c
Commit
ac5cbb6c
authored
Jan 23, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable CopyAsGFM on iOS due to bug in webkit
parent
584fc5c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
app/assets/javascripts/behaviors/copy_as_gfm.js
app/assets/javascripts/behaviors/copy_as_gfm.js
+7
-0
No files found.
app/assets/javascripts/behaviors/copy_as_gfm.js
View file @
ac5cbb6c
...
@@ -299,6 +299,13 @@ const gfmRules = {
...
@@ -299,6 +299,13 @@ const gfmRules = {
export
class
CopyAsGFM
{
export
class
CopyAsGFM
{
constructor
()
{
constructor
()
{
// iOS currently does not support clipboardData.setData(). This bug should
// be fixed in iOS 12, but for now we'll disable this for all iOS browsers
// ref: https://trac.webkit.org/changeset/222228/webkit
const
userAgent
=
(
typeof
navigator
!==
'
undefined
'
&&
navigator
.
userAgent
)
||
''
;
const
isIOS
=
/
\b(
iPad|iPhone|iPod
)(?=
;
)
/
.
test
(
userAgent
);
if
(
isIOS
)
return
;
$
(
document
).
on
(
'
copy
'
,
'
.md, .wiki
'
,
(
e
)
=>
{
CopyAsGFM
.
copyAsGFM
(
e
,
CopyAsGFM
.
transformGFMSelection
);
});
$
(
document
).
on
(
'
copy
'
,
'
.md, .wiki
'
,
(
e
)
=>
{
CopyAsGFM
.
copyAsGFM
(
e
,
CopyAsGFM
.
transformGFMSelection
);
});
$
(
document
).
on
(
'
copy
'
,
'
pre.code.highlight, .diff-content .line_content
'
,
(
e
)
=>
{
CopyAsGFM
.
copyAsGFM
(
e
,
CopyAsGFM
.
transformCodeSelection
);
});
$
(
document
).
on
(
'
copy
'
,
'
pre.code.highlight, .diff-content .line_content
'
,
(
e
)
=>
{
CopyAsGFM
.
copyAsGFM
(
e
,
CopyAsGFM
.
transformCodeSelection
);
});
$
(
document
).
on
(
'
paste
'
,
'
.js-gfm-input
'
,
CopyAsGFM
.
pasteGFM
);
$
(
document
).
on
(
'
paste
'
,
'
.js-gfm-input
'
,
CopyAsGFM
.
pasteGFM
);
...
...
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