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
615f1927
Commit
615f1927
authored
Jan 04, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] Fix some rules
parent
41cc4cf5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
156 additions
and
135 deletions
+156
-135
.eslintrc
.eslintrc
+1
-1
app/assets/javascripts/boards/components/board_card.vue
app/assets/javascripts/boards/components/board_card.vue
+31
-8
app/assets/javascripts/commit/image_file.js
app/assets/javascripts/commit/image_file.js
+97
-97
app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue
...ts/javascripts/vue_shared/components/time_ago_tooltip.vue
+7
-9
app/assets/javascripts/vue_shared/components/toggle_button.vue
...ssets/javascripts/vue_shared/components/toggle_button.vue
+10
-10
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue
...s/vue_shared/components/user_avatar/user_avatar_image.vue
+4
-4
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_link.vue
...ts/vue_shared/components/user_avatar/user_avatar_link.vue
+4
-4
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_svg.vue
...pts/vue_shared/components/user_avatar/user_avatar_svg.vue
+2
-2
No files found.
.eslintrc
View file @
615f1927
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
"promise"
"promise"
],
],
"settings": {
"settings": {
"html/html-extensions": [".html", ".html.raw"
, ".vue"
],
"html/html-extensions": [".html", ".html.raw"],
"import/resolver": {
"import/resolver": {
"webpack": {
"webpack": {
"config": "./config/webpack.config.js"
"config": "./config/webpack.config.js"
...
...
app/assets/javascripts/boards/components/board_card.vue
View file @
615f1927
...
@@ -10,12 +10,30 @@ export default {
...
@@ -10,12 +10,30 @@ export default {
'
issue-card-inner
'
:
gl
.
issueBoards
.
IssueCardInner
,
'
issue-card-inner
'
:
gl
.
issueBoards
.
IssueCardInner
,
},
},
props
:
{
props
:
{
list
:
Object
,
list
:
{
issue
:
Object
,
type
:
Object
,
issueLinkBase
:
String
,
default
:
()
=>
({}),
disabled
:
Boolean
,
},
index
:
Number
,
issue
:
{
rootPath
:
String
,
type
:
Object
,
default
:
()
=>
({}),
},
issueLinkBase
:
{
type
:
String
,
default
:
''
,
},
disabled
:
{
type
:
Boolean
,
default
:
false
,
},
index
:
{
type
:
Number
,
default
:
0
,
},
rootPath
:
{
type
:
String
,
default
:
''
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -54,8 +72,13 @@ export default {
...
@@ -54,8 +72,13 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<li
class=
"card"
<li
:class=
"
{ 'user-can-drag': !disabled
&&
issue.id, 'is-disabled': disabled || !issue.id, 'is-active': issueDetailVisible }"
class=
"card"
:class=
"
{
'user-can-drag': !disabled
&&
issue.id,
'is-disabled': disabled || !issue.id,
'is-active': issueDetailVisible
}"
:index="index"
:index="index"
:data-issue-id="issue.id"
:data-issue-id="issue.id"
@mousedown="mouseDown"
@mousedown="mouseDown"
...
...
app/assets/javascripts/commit/image_file.js
View file @
615f1927
...
@@ -23,103 +23,6 @@ export default class ImageFile {
...
@@ -23,103 +23,6 @@ export default class ImageFile {
});
});
};
};
})(
this
));
})(
this
));
this
.
views
=
{
'
two-up
'
:
function
()
{
return
$
(
'
.two-up.view .wrap
'
,
this
.
file
).
each
((
function
(
_this
)
{
return
function
(
index
,
wrap
)
{
$
(
'
img
'
,
wrap
).
each
(
function
()
{
var
currentWidth
;
currentWidth
=
$
(
this
).
width
();
if
(
currentWidth
>
availWidth
/
2
)
{
return
$
(
this
).
width
(
availWidth
/
2
);
}
});
return
_this
.
requestImageInfo
(
$
(
'
img
'
,
wrap
),
function
(
width
,
height
)
{
$
(
'
.image-info .meta-width
'
,
wrap
).
text
(
width
+
"
px
"
);
$
(
'
.image-info .meta-height
'
,
wrap
).
text
(
height
+
"
px
"
);
return
$
(
'
.image-info
'
,
wrap
).
removeClass
(
'
hide
'
);
});
};
})(
this
));
},
'
swipe
'
:
function
()
{
var
maxHeight
,
maxWidth
;
maxWidth
=
0
;
maxHeight
=
0
;
return
$
(
'
.swipe.view
'
,
this
.
file
).
each
((
function
(
_this
)
{
return
function
(
index
,
view
)
{
var
$swipeWrap
,
$swipeBar
,
$swipeFrame
,
wrapPadding
,
ref
;
ref
=
_this
.
prepareFrames
(
view
),
maxWidth
=
ref
[
0
],
maxHeight
=
ref
[
1
];
$swipeFrame
=
$
(
'
.swipe-frame
'
,
view
);
$swipeWrap
=
$
(
'
.swipe-wrap
'
,
view
);
$swipeBar
=
$
(
'
.swipe-bar
'
,
view
);
$swipeFrame
.
css
({
width
:
maxWidth
+
16
,
height
:
maxHeight
+
28
});
$swipeWrap
.
css
({
width
:
maxWidth
+
1
,
height
:
maxHeight
+
2
});
// Set swipeBar left position to match image frame
$swipeBar
.
css
({
left
:
1
});
wrapPadding
=
parseInt
(
$swipeWrap
.
css
(
'
right
'
).
replace
(
'
px
'
,
''
),
10
);
_this
.
initDraggable
(
$swipeBar
,
wrapPadding
,
function
(
e
,
left
)
{
if
(
left
>
0
&&
left
<
$swipeFrame
.
width
()
-
(
wrapPadding
*
2
))
{
$swipeWrap
.
width
((
maxWidth
+
1
)
-
left
);
$swipeBar
.
css
(
'
left
'
,
left
);
}
});
};
})(
this
));
},
'
onion-skin
'
:
function
()
{
var
dragTrackWidth
,
maxHeight
,
maxWidth
;
maxWidth
=
0
;
maxHeight
=
0
;
dragTrackWidth
=
$
(
'
.drag-track
'
,
this
.
file
).
width
()
-
$
(
'
.dragger
'
,
this
.
file
).
width
();
return
$
(
'
.onion-skin.view
'
,
this
.
file
).
each
((
function
(
_this
)
{
return
function
(
index
,
view
)
{
var
$frame
,
$track
,
$dragger
,
$frameAdded
,
framePadding
,
ref
,
dragging
=
false
;
ref
=
_this
.
prepareFrames
(
view
),
maxWidth
=
ref
[
0
],
maxHeight
=
ref
[
1
];
$frame
=
$
(
'
.onion-skin-frame
'
,
view
);
$frameAdded
=
$
(
'
.frame.added
'
,
view
);
$track
=
$
(
'
.drag-track
'
,
view
);
$dragger
=
$
(
'
.dragger
'
,
$track
);
$frame
.
css
({
width
:
maxWidth
+
16
,
height
:
maxHeight
+
28
});
$
(
'
.swipe-wrap
'
,
view
).
css
({
width
:
maxWidth
+
1
,
height
:
maxHeight
+
2
});
$dragger
.
css
({
left
:
dragTrackWidth
});
$frameAdded
.
css
(
'
opacity
'
,
1
);
framePadding
=
parseInt
(
$frameAdded
.
css
(
'
right
'
).
replace
(
'
px
'
,
''
),
10
);
_this
.
initDraggable
(
$dragger
,
framePadding
,
function
(
e
,
left
)
{
var
opacity
=
left
/
dragTrackWidth
;
if
(
opacity
>=
0
&&
opacity
<=
1
)
{
$dragger
.
css
(
'
left
'
,
left
);
$frameAdded
.
css
(
'
opacity
'
,
opacity
);
}
});
};
})(
this
));
}
};
}
}
initViewModes
()
{
initViewModes
()
{
...
@@ -192,6 +95,103 @@ export default class ImageFile {
...
@@ -192,6 +95,103 @@ export default class ImageFile {
return
[
maxWidth
,
maxHeight
];
return
[
maxWidth
,
maxHeight
];
}
}
views
=
{
'
two-up
'
:
function
()
{
return
$
(
'
.two-up.view .wrap
'
,
this
.
file
).
each
((
function
(
_this
)
{
return
function
(
index
,
wrap
)
{
$
(
'
img
'
,
wrap
).
each
(
function
()
{
var
currentWidth
;
currentWidth
=
$
(
this
).
width
();
if
(
currentWidth
>
availWidth
/
2
)
{
return
$
(
this
).
width
(
availWidth
/
2
);
}
});
return
_this
.
requestImageInfo
(
$
(
'
img
'
,
wrap
),
function
(
width
,
height
)
{
$
(
'
.image-info .meta-width
'
,
wrap
).
text
(
width
+
"
px
"
);
$
(
'
.image-info .meta-height
'
,
wrap
).
text
(
height
+
"
px
"
);
return
$
(
'
.image-info
'
,
wrap
).
removeClass
(
'
hide
'
);
});
};
})(
this
));
},
'
swipe
'
:
function
()
{
var
maxHeight
,
maxWidth
;
maxWidth
=
0
;
maxHeight
=
0
;
return
$
(
'
.swipe.view
'
,
this
.
file
).
each
((
function
(
_this
)
{
return
function
(
index
,
view
)
{
var
$swipeWrap
,
$swipeBar
,
$swipeFrame
,
wrapPadding
,
ref
;
ref
=
_this
.
prepareFrames
(
view
),
maxWidth
=
ref
[
0
],
maxHeight
=
ref
[
1
];
$swipeFrame
=
$
(
'
.swipe-frame
'
,
view
);
$swipeWrap
=
$
(
'
.swipe-wrap
'
,
view
);
$swipeBar
=
$
(
'
.swipe-bar
'
,
view
);
$swipeFrame
.
css
({
width
:
maxWidth
+
16
,
height
:
maxHeight
+
28
});
$swipeWrap
.
css
({
width
:
maxWidth
+
1
,
height
:
maxHeight
+
2
});
// Set swipeBar left position to match image frame
$swipeBar
.
css
({
left
:
1
});
wrapPadding
=
parseInt
(
$swipeWrap
.
css
(
'
right
'
).
replace
(
'
px
'
,
''
),
10
);
_this
.
initDraggable
(
$swipeBar
,
wrapPadding
,
function
(
e
,
left
)
{
if
(
left
>
0
&&
left
<
$swipeFrame
.
width
()
-
(
wrapPadding
*
2
))
{
$swipeWrap
.
width
((
maxWidth
+
1
)
-
left
);
$swipeBar
.
css
(
'
left
'
,
left
);
}
});
};
})(
this
));
},
'
onion-skin
'
:
function
()
{
var
dragTrackWidth
,
maxHeight
,
maxWidth
;
maxWidth
=
0
;
maxHeight
=
0
;
dragTrackWidth
=
$
(
'
.drag-track
'
,
this
.
file
).
width
()
-
$
(
'
.dragger
'
,
this
.
file
).
width
();
return
$
(
'
.onion-skin.view
'
,
this
.
file
).
each
((
function
(
_this
)
{
return
function
(
index
,
view
)
{
var
$frame
,
$track
,
$dragger
,
$frameAdded
,
framePadding
,
ref
,
dragging
=
false
;
ref
=
_this
.
prepareFrames
(
view
),
maxWidth
=
ref
[
0
],
maxHeight
=
ref
[
1
];
$frame
=
$
(
'
.onion-skin-frame
'
,
view
);
$frameAdded
=
$
(
'
.frame.added
'
,
view
);
$track
=
$
(
'
.drag-track
'
,
view
);
$dragger
=
$
(
'
.dragger
'
,
$track
);
$frame
.
css
({
width
:
maxWidth
+
16
,
height
:
maxHeight
+
28
});
$
(
'
.swipe-wrap
'
,
view
).
css
({
width
:
maxWidth
+
1
,
height
:
maxHeight
+
2
});
$dragger
.
css
({
left
:
dragTrackWidth
});
$frameAdded
.
css
(
'
opacity
'
,
1
);
framePadding
=
parseInt
(
$frameAdded
.
css
(
'
right
'
).
replace
(
'
px
'
,
''
),
10
);
_this
.
initDraggable
(
$dragger
,
framePadding
,
function
(
e
,
left
)
{
var
opacity
=
left
/
dragTrackWidth
;
if
(
opacity
>=
0
&&
opacity
<=
1
)
{
$dragger
.
css
(
'
left
'
,
left
);
$frameAdded
.
css
(
'
opacity
'
,
opacity
);
}
});
};
})(
this
));
}
}
requestImageInfo
(
img
,
callback
)
{
requestImageInfo
(
img
,
callback
)
{
const
domImg
=
img
.
get
(
0
);
const
domImg
=
img
.
get
(
0
);
if
(
domImg
)
{
if
(
domImg
)
{
...
...
app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue
View file @
615f1927
...
@@ -8,6 +8,12 @@ import '../../lib/utils/datetime_utility';
...
@@ -8,6 +8,12 @@ import '../../lib/utils/datetime_utility';
*/
*/
export
default
{
export
default
{
directives
:
{
tooltip
,
},
mixins
:
[
timeagoMixin
,
],
props
:
{
props
:
{
time
:
{
time
:
{
type
:
String
,
type
:
String
,
...
@@ -26,14 +32,6 @@ export default {
...
@@ -26,14 +32,6 @@ export default {
default
:
''
,
default
:
''
,
},
},
},
},
mixins
:
[
timeagoMixin
,
],
directives
:
{
tooltip
,
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -43,6 +41,6 @@ export default {
...
@@ -43,6 +41,6 @@ export default {
:title=
"tooltipTitle(time)"
:title=
"tooltipTitle(time)"
:data-placement=
"tooltipPlacement"
:data-placement=
"tooltipPlacement"
data-container=
"body"
>
data-container=
"body"
>
{{
timeFormated
(
time
)
}}
{{
timeFormated
(
time
)
}}
</time>
</time>
</
template
>
</
template
>
app/assets/javascripts/vue_shared/components/toggle_button.vue
View file @
615f1927
...
@@ -9,6 +9,16 @@
...
@@ -9,6 +9,16 @@
const
LABEL_OFF
=
s__
(
'
ToggleButton|Toggle Status: OFF
'
);
const
LABEL_OFF
=
s__
(
'
ToggleButton|Toggle Status: OFF
'
);
export
default
{
export
default
{
components
:
{
icon
,
loadingIcon
,
},
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
props
:
{
props
:
{
name
:
{
name
:
{
type
:
String
,
type
:
String
,
...
@@ -31,16 +41,6 @@
...
@@ -31,16 +41,6 @@
},
},
},
},
components
:
{
icon
,
loadingIcon
,
},
model
:
{
prop
:
'
value
'
,
event
:
'
change
'
,
},
computed
:
{
computed
:
{
toggleIcon
()
{
toggleIcon
()
{
return
this
.
value
?
ICON_ON
:
ICON_OFF
;
return
this
.
value
?
ICON_ON
:
ICON_OFF
;
...
...
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue
View file @
615f1927
...
@@ -22,6 +22,9 @@ import tooltip from '../../directives/tooltip';
...
@@ -22,6 +22,9 @@ import tooltip from '../../directives/tooltip';
export
default
{
export
default
{
name
:
'
UserAvatarImage
'
,
name
:
'
UserAvatarImage
'
,
directives
:
{
tooltip
,
},
props
:
{
props
:
{
lazy
:
{
lazy
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -59,9 +62,6 @@ export default {
...
@@ -59,9 +62,6 @@ export default {
default
:
'
top
'
,
default
:
'
top
'
,
},
},
},
},
directives
:
{
tooltip
,
},
computed
:
{
computed
:
{
// API response sends null when gravatar is disabled and
// API response sends null when gravatar is disabled and
// we provide an empty string when we use it inside user avatar link.
// we provide an empty string when we use it inside user avatar link.
...
@@ -87,7 +87,7 @@ export default {
...
@@ -87,7 +87,7 @@ export default {
v-tooltip
v-tooltip
class=
"avatar"
class=
"avatar"
:class=
"
{
:class=
"
{
lazy,
lazy
: lazy
,
[avatarSizeClass]: true,
[avatarSizeClass]: true,
[cssClasses]: true
[cssClasses]: true
}"
}"
...
...
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_link.vue
View file @
615f1927
...
@@ -26,6 +26,9 @@ export default {
...
@@ -26,6 +26,9 @@ export default {
components
:
{
components
:
{
userAvatarImage
,
userAvatarImage
,
},
},
directives
:
{
tooltip
,
},
props
:
{
props
:
{
linkHref
:
{
linkHref
:
{
type
:
String
,
type
:
String
,
...
@@ -76,9 +79,6 @@ export default {
...
@@ -76,9 +79,6 @@ export default {
return
this
.
shouldShowUsername
?
''
:
this
.
tooltipText
;
return
this
.
shouldShowUsername
?
''
:
this
.
tooltipText
;
},
},
},
},
directives
:
{
tooltip
,
},
};
};
</
script
>
</
script
>
...
@@ -98,6 +98,6 @@ export default {
...
@@ -98,6 +98,6 @@ export default {
v-tooltip
v-tooltip
:title=
"tooltipText"
:title=
"tooltipText"
:tooltip-placement=
"tooltipPlacement"
:tooltip-placement=
"tooltipPlacement"
>
{{
username
}}
</span>
>
{{
username
}}
</span>
</a>
</a>
</
template
>
</
template
>
app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_svg.vue
View file @
615f1927
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
:class=
"avatarSizeClass"
:class=
"avatarSizeClass"
:height=
"size"
:height=
"size"
:width=
"size"
:width=
"size"
v-html=
"svg"
>
v-html=
"svg"
</svg
>
/
>
</
template
>
</
template
>
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