BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8f0f79f6
Commit
8f0f79f6
authored
Jan 24, 2018
by
Phil Hughes
Committed by
Ian Baum
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '32546-cannot-copy-paste-on-ios' into 'master'
Resolve "Cannot copy/paste on iOS" Closes #32546 See merge request gitlab-org/gitlab-ce!15804
parent
f4ee2001
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
copy_as_gfm.js
app/assets/javascripts/behaviors/copy_as_gfm.js
+7
-0
32546-cannot-copy-paste-on-ios.yml
changelogs/unreleased/32546-cannot-copy-paste-on-ios.yml
+5
-0
No files found.
app/assets/javascripts/behaviors/copy_as_gfm.js
View file @
8f0f79f6
...
...
@@ -299,6 +299,13 @@ const gfmRules = {
export
class
CopyAsGFM
{
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'
,
'pre.code.highlight, .diff-content .line_content'
,
(
e
)
=>
{
CopyAsGFM
.
copyAsGFM
(
e
,
CopyAsGFM
.
transformCodeSelection
);
});
$
(
document
).
on
(
'paste'
,
'.js-gfm-input'
,
CopyAsGFM
.
pasteGFM
);
...
...
changelogs/unreleased/32546-cannot-copy-paste-on-ios.yml
0 → 100644
View file @
8f0f79f6
---
title
:
Fix copy/paste on iOS devices due to a bug in webkit
merge_request
:
15804
author
:
type
:
fixed
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