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
Boxiang Sun
gitlab-ce
Commits
c06dad62
Commit
c06dad62
authored
Jul 05, 2017
by
Mike Greiling
Committed by
Clement Ho
Jul 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove IIFEs around several javascript classes
parent
11e03bf4
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
763 additions
and
785 deletions
+763
-785
app/assets/javascripts/signin_tabs_memoizer.js
app/assets/javascripts/signin_tabs_memoizer.js
+40
-42
app/assets/javascripts/single_file_diff.js
app/assets/javascripts/single_file_diff.js
+78
-80
app/assets/javascripts/smart_interval.js
app/assets/javascripts/smart_interval.js
+126
-127
app/assets/javascripts/snippets_list.js
app/assets/javascripts/snippets_list.js
+6
-10
app/assets/javascripts/star.js
app/assets/javascripts/star.js
+24
-26
app/assets/javascripts/subscription.js
app/assets/javascripts/subscription.js
+36
-38
app/assets/javascripts/subscription_select.js
app/assets/javascripts/subscription_select.js
+30
-31
app/assets/javascripts/syntax_highlight.js
app/assets/javascripts/syntax_highlight.js
+13
-14
app/assets/javascripts/tree.js
app/assets/javascripts/tree.js
+58
-60
app/assets/javascripts/user.js
app/assets/javascripts/user.js
+29
-28
app/assets/javascripts/user_tabs.js
app/assets/javascripts/user_tabs.js
+94
-93
app/assets/javascripts/username_validator.js
app/assets/javascripts/username_validator.js
+107
-109
app/assets/javascripts/visibility_select.js
app/assets/javascripts/visibility_select.js
+19
-22
app/assets/javascripts/wikis.js
app/assets/javascripts/wikis.js
+47
-48
app/assets/javascripts/zen_mode.js
app/assets/javascripts/zen_mode.js
+56
-57
No files found.
app/assets/javascripts/signin_tabs_memoizer.js
View file @
c06dad62
...
...
@@ -2,12 +2,11 @@
/* eslint no-new: "off" */
import
AccessorUtilities
from
'
./lib/utils/accessor
'
;
((
global
)
=>
{
/**
/**
* Memorize the last selected tab after reloading a page.
* Does that setting the current selected tab in the localStorage
*/
class
ActiveTabMemoizer
{
class
ActiveTabMemoizer
{
constructor
({
currentTabKey
=
'
current_signin_tab
'
,
tabSelector
=
'
ul.nav-tabs
'
}
=
{})
{
this
.
currentTabKey
=
currentTabKey
;
this
.
tabSelector
=
tabSelector
;
...
...
@@ -51,7 +50,6 @@ import AccessorUtilities from './lib/utils/accessor';
return
window
.
localStorage
.
getItem
(
this
.
currentTabKey
);
}
}
}
global
.
ActiveTabMemoizer
=
ActiveTabMemoizer
;
})(
window
);
window
.
ActiveTabMemoizer
=
ActiveTabMemoizer
;
app/assets/javascripts/single_file_diff.js
View file @
c06dad62
...
...
@@ -2,8 +2,7 @@
import
FilesCommentButton
from
'
./files_comment_button
'
;
(
function
()
{
window
.
SingleFileDiff
=
(
function
()
{
window
.
SingleFileDiff
=
(
function
()
{
var
COLLAPSED_HTML
,
ERROR_HTML
,
LOADING_HTML
,
WRAPPER
;
WRAPPER
=
'
<div class="diff-content"></div>
'
;
...
...
@@ -88,13 +87,12 @@ import FilesCommentButton from './files_comment_button';
};
return
SingleFileDiff
;
})();
})();
$
.
fn
.
singleFileDiff
=
function
()
{
$
.
fn
.
singleFileDiff
=
function
()
{
return
this
.
each
(
function
()
{
if
(
!
$
.
data
(
this
,
'
singleFileDiff
'
))
{
return
$
.
data
(
this
,
'
singleFileDiff
'
,
new
window
.
SingleFileDiff
(
this
));
}
});
};
}).
call
(
window
);
};
app/assets/javascripts/smart_interval.js
View file @
c06dad62
/*
* Instances of SmartInterval extend the functionality of `setInterval`, make it configurable
* and controllable by a public API.
*
* */
(()
=>
{
class
SmartInterval
{
/**
* Instances of SmartInterval extend the functionality of `setInterval`, make it configurable
* and controllable by a public API.
*/
class
SmartInterval
{
/**
* @param { function } opts.callback Function to be called on each iteration (required)
* @param { milliseconds } opts.startingInterval `currentInterval` is set to this initially
...
...
@@ -37,6 +35,7 @@
this
.
initInterval
();
}
/* public */
start
()
{
...
...
@@ -153,6 +152,6 @@
state
.
intervalId
=
window
.
clearInterval
(
state
.
intervalId
);
}
}
gl
.
SmartInterval
=
SmartInterval
;
})(
window
.
gl
||
(
window
.
gl
=
{}))
;
}
window
.
gl
.
SmartInterval
=
SmartInterval
;
app/assets/javascripts/snippets_list.js
View file @
c06dad62
/* eslint-disable arrow-parens, no-param-reassign, space-before-function-paren, func-names, no-var, max-len */
(
global
=>
{
global
.
gl
=
global
.
gl
||
{};
gl
.
SnippetsList
=
function
()
{
window
.
gl
.
SnippetsList
=
function
()
{
var
$holder
=
$
(
'
.snippets-list-holder
'
);
$holder
.
find
(
'
.pagination
'
).
on
(
'
ajax:success
'
,
(
e
,
data
)
=>
{
$holder
.
replaceWith
(
data
.
html
);
});
};
})(
window
);
};
app/assets/javascripts/star.js
View file @
c06dad62
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-unused-vars, one-var, no-var, one-var-declaration-per-line, prefer-arrow-callback, no-new, max-len */
/* global Flash */
(
function
()
{
this
.
Star
=
(
function
()
{
window
.
Star
=
(
function
()
{
function
Star
()
{
$
(
'
.project-home-panel .toggle-star
'
).
on
(
'
ajax:success
'
,
function
(
e
,
data
,
status
,
xhr
)
{
var
$starIcon
,
$starSpan
,
$this
,
toggleStar
;
...
...
@@ -26,5 +25,4 @@
}
return
Star
;
})();
}).
call
(
window
);
})();
app/assets/javascripts/subscription.js
View file @
c06dad62
(()
=>
{
class
Subscription
{
class
Subscription
{
constructor
(
containerElm
)
{
this
.
containerElm
=
containerElm
;
...
...
@@ -40,8 +39,7 @@
static
bindAll
(
selector
)
{
[].
forEach
.
call
(
document
.
querySelectorAll
(
selector
),
elm
=>
new
Subscription
(
elm
));
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
Subscription
=
Subscription
;
})();
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
Subscription
=
Subscription
;
app/assets/javascripts/subscription_select.js
View file @
c06dad62
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, object-shorthand, no-unused-vars, no-shadow, one-var, one-var-declaration-per-line, comma-dangle, max-len */
(
function
()
{
this
.
SubscriptionSelect
=
(
function
()
{
window
.
SubscriptionSelect
=
(
function
()
{
function
SubscriptionSelect
()
{
$
(
'
.js-subscription-event
'
).
each
(
function
(
i
,
el
)
{
var
fieldName
;
...
...
@@ -30,5 +30,4 @@
}
return
SubscriptionSelect
;
})();
}).
call
(
window
);
})();
app/assets/javascripts/syntax_highlight.js
View file @
c06dad62
...
...
@@ -9,8 +9,8 @@
//
// <div class="js-syntax-highlight"></div>
//
(
function
()
{
$
.
fn
.
syntaxHighlight
=
function
()
{
$
.
fn
.
syntaxHighlight
=
function
()
{
var
$children
;
if
(
$
(
this
).
hasClass
(
'
js-syntax-highlight
'
))
{
...
...
@@ -23,5 +23,4 @@
return
$children
.
syntaxHighlight
();
}
}
};
}).
call
(
window
);
};
app/assets/javascripts/tree.js
View file @
c06dad62
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, quotes, consistent-return, no-var, one-var, one-var-declaration-per-line, no-else-return, prefer-arrow-callback, max-len */
(
function
()
{
this
.
TreeView
=
(
function
()
{
window
.
TreeView
=
(
function
()
{
function
TreeView
()
{
this
.
initKeyNav
();
// Code browser tree slider
...
...
@@ -64,5 +63,4 @@
};
return
TreeView
;
})();
}).
call
(
window
);
})();
app/assets/javascripts/user.js
View file @
c06dad62
...
...
@@ -2,8 +2,7 @@
import
Cookies
from
'
js-cookie
'
;
((
global
)
=>
{
global
.
User
=
class
{
class
User
{
constructor
({
action
})
{
this
.
action
=
action
;
this
.
placeProfileAvatarsToTop
();
...
...
@@ -18,7 +17,7 @@ import Cookies from 'js-cookie';
}
initTabs
()
{
return
new
globa
l
.
UserTabs
({
return
new
window
.
g
l
.
UserTabs
({
parentEl
:
'
.user-profile
'
,
action
:
this
.
action
});
...
...
@@ -31,5 +30,7 @@ import Cookies from 'js-cookie';
$
(
this
).
parents
(
'
.project-limit-message
'
).
remove
();
});
}
};
})(
window
.
gl
||
(
window
.
gl
=
{}));
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
User
=
User
;
app/assets/javascripts/user_tabs.js
View file @
c06dad62
...
...
@@ -59,8 +59,8 @@ content on the Users#show page.
</div>
</div>
*/
((
global
)
=>
{
class
UserTabs
{
class
UserTabs
{
constructor
({
defaultAction
,
action
,
parentEl
})
{
this
.
loaded
=
{};
this
.
defaultAction
=
defaultAction
||
'
activity
'
;
...
...
@@ -170,6 +170,7 @@ content on the Users#show page.
getCurrentAction
()
{
return
this
.
$parentEl
.
find
(
'
.nav-links .active a
'
).
data
(
'
action
'
);
}
}
global
.
UserTabs
=
UserTabs
;
})(
window
.
gl
||
(
window
.
gl
=
{}));
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
UserTabs
=
UserTabs
;
app/assets/javascripts/username_validator.js
View file @
c06dad62
/* eslint-disable comma-dangle, consistent-return, class-methods-use-this, arrow-parens, no-param-reassign, max-len */
((
global
)
=>
{
const
debounceTimeoutDuration
=
1000
;
const
invalidInputClass
=
'
gl-field-error-outline
'
;
const
successInputClass
=
'
gl-field-success-outline
'
;
const
unavailableMessageSelector
=
'
.username .validation-error
'
;
const
successMessageSelector
=
'
.username .validation-success
'
;
const
pendingMessageSelector
=
'
.username .validation-pending
'
;
const
invalidMessageSelector
=
'
.username .gl-field-error
'
;
class
UsernameValidator
{
const
debounceTimeoutDuration
=
1000
;
const
invalidInputClass
=
'
gl-field-error-outline
'
;
const
successInputClass
=
'
gl-field-success-outline
'
;
const
unavailableMessageSelector
=
'
.username .validation-error
'
;
const
successMessageSelector
=
'
.username .validation-success
'
;
const
pendingMessageSelector
=
'
.username .validation-pending
'
;
const
invalidMessageSelector
=
'
.username .gl-field-error
'
;
class
UsernameValidator
{
constructor
()
{
this
.
inputElement
=
$
(
'
#new_user_username
'
);
this
.
inputDomElement
=
this
.
inputElement
.
get
(
0
);
...
...
@@ -129,7 +128,6 @@
this
.
inputElement
.
addClass
(
invalidInputClass
).
removeClass
(
successInputClass
);
$inputErrorMessage
.
show
();
}
}
}
global
.
UsernameValidator
=
UsernameValidator
;
})(
window
);
window
.
UsernameValidator
=
UsernameValidator
;
app/assets/javascripts/visibility_select.js
View file @
c06dad62
(()
=>
{
const
gl
=
window
.
gl
||
(
window
.
gl
=
{});
class
VisibilitySelect
{
class
VisibilitySelect
{
constructor
(
container
)
{
if
(
!
container
)
throw
new
Error
(
'
VisibilitySelect requires a container element as argument 1
'
);
this
.
container
=
container
;
...
...
@@ -21,7 +18,7 @@
updateHelpText
()
{
this
.
helpBlock
.
textContent
=
this
.
select
.
querySelector
(
'
option:checked
'
).
dataset
.
description
;
}
}
}
gl
.
VisibilitySelect
=
VisibilitySelect
;
})()
;
window
.
gl
=
window
.
gl
||
{}
;
window
.
gl
.
VisibilitySelect
=
VisibilitySelect
;
app/assets/javascripts/wikis.js
View file @
c06dad62
...
...
@@ -4,8 +4,7 @@
import
'
vendor/jquery.nicescroll
'
;
import
'
./breakpoints
'
;
((
global
)
=>
{
class
Wikis
{
class
Wikis
{
constructor
()
{
this
.
bp
=
Breakpoints
.
get
();
this
.
sidebarEl
=
document
.
querySelector
(
'
.js-wiki-sidebar
'
);
...
...
@@ -63,7 +62,7 @@ import './breakpoints';
classList
.
remove
(
'
right-sidebar-expanded
'
);
}
}
}
}
global
.
Wikis
=
Wikis
;
})(
window
.
gl
||
(
window
.
gl
=
{}))
;
window
.
gl
=
window
.
gl
||
{}
;
window
.
gl
.
Wikis
=
Wikis
;
app/assets/javascripts/zen_mode.js
View file @
c06dad62
...
...
@@ -34,8 +34,8 @@ window.Dropzone = Dropzone;
// **Cancelable** No
// **Target** a.js-zen-leave
//
(
function
()
{
this
.
ZenMode
=
(
function
()
{
window
.
ZenMode
=
(
function
()
{
function
ZenMode
()
{
this
.
active_backdrop
=
null
;
this
.
active_textarea
=
null
;
...
...
@@ -94,5 +94,4 @@ window.Dropzone = Dropzone;
};
return
ZenMode
;
})();
}).
call
(
window
);
})();
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