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
6d7384f5
Commit
6d7384f5
authored
Oct 30, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'es-module-autosave' into 'master'
Remove Autosave class from global namespace See merge request gitlab-org/gitlab-ce!14856
parents
1aae91cf
f7bdfe50
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
27 deletions
+17
-27
autosave.js
app/assets/javascripts/autosave.js
+12
-19
issuable_form.js
app/assets/javascripts/issuable_form.js
+1
-1
main.js
app/assets/javascripts/main.js
+0
-1
notes.js
app/assets/javascripts/notes.js
+2
-2
issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+1
-2
autosave.js
app/assets/javascripts/notes/mixins/autosave.js
+1
-2
No files found.
app/assets/javascripts/autosave.js
View file @
6d7384f5
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-param-reassign, quotes, prefer-template, no-var, one-var, no-unused-vars, one-var-declaration-per-line, no-void, consistent-return, no-empty, max-len */
/* eslint-disable no-param-reassign, prefer-template, no-var, no-void, consistent-return */
import
AccessorUtilities
from
'./lib/utils/accessor'
;
window
.
Autosave
=
(
function
()
{
function
Autosave
(
field
,
key
,
resource
)
{
export
default
class
Autosave
{
constructor
(
field
,
key
,
resource
)
{
this
.
field
=
field
;
this
.
isLocalStorageAvailable
=
AccessorUtilities
.
isLocalStorageAccessSafe
();
this
.
resource
=
resource
;
...
...
@@ -12,14 +13,10 @@ window.Autosave = (function() {
this
.
key
=
'autosave/'
+
key
;
this
.
field
.
data
(
'autosave'
,
this
);
this
.
restore
();
this
.
field
.
on
(
'input'
,
(
function
(
_this
)
{
return
function
()
{
return
_this
.
save
();
};
})(
this
));
this
.
field
.
on
(
'input'
,
()
=>
this
.
save
());
}
Autosave
.
prototype
.
restore
=
function
()
{
restore
()
{
var
text
;
if
(
!
this
.
isLocalStorageAvailable
)
return
;
...
...
@@ -40,9 +37,9 @@ window.Autosave = (function() {
field
.
dispatchEvent
(
event
);
}
}
}
;
}
Autosave
.
prototype
.
save
=
function
()
{
save
()
{
var
text
;
text
=
this
.
field
.
val
();
...
...
@@ -51,15 +48,11 @@ window.Autosave = (function() {
}
return
this
.
reset
();
}
;
}
Autosave
.
prototype
.
reset
=
function
()
{
reset
()
{
if
(
!
this
.
isLocalStorageAvailable
)
return
;
return
window
.
localStorage
.
removeItem
(
this
.
key
);
};
return
Autosave
;
})();
export
default
window
.
Autosave
;
}
}
app/assets/javascripts/issuable_form.js
View file @
6d7384f5
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-useless-escape, no-new, quotes, object-shorthand, no-unused-vars, comma-dangle, no-alert, consistent-return, no-else-return, prefer-template, one-var, one-var-declaration-per-line, curly, max-len */
/* global GitLab */
/* global Autosave */
import
Pikaday
from
'pikaday'
;
import
Autosave
from
'./autosave'
;
import
UsersSelect
from
'./users_select'
;
import
GfmAutoComplete
from
'./gfm_auto_complete'
;
import
ZenMode
from
'./zen_mode'
;
...
...
app/assets/javascripts/main.js
View file @
6d7384f5
...
...
@@ -41,7 +41,6 @@ import './behaviors/';
import
'./activities'
;
import
'./admin'
;
import
'./aside'
;
import
'./autosave'
;
import
loadAwardsHandler
from
'./awards_handler'
;
import
bp
from
'./breakpoints'
;
import
'./commits'
;
...
...
app/assets/javascripts/notes.js
View file @
6d7384f5
...
...
@@ -5,7 +5,7 @@ default-case, prefer-template, consistent-return, no-alert, no-return-assign,
no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new,
brace-style, no-lonely-if, vars-on-top, no-unused-vars, no-sequences, no-shadow,
newline-per-chained-call, no-useless-escape, class-methods-use-this */
/* global Autosave */
/* global ResolveService */
/* global mrRefreshWidgetUrl */
...
...
@@ -20,7 +20,7 @@ import Flash from './flash';
import
CommentTypeToggle
from
'./comment_type_toggle'
;
import
GLForm
from
'./gl_form'
;
import
loadAwardsHandler
from
'./awards_handler'
;
import
'./autosave'
;
import
Autosave
from
'./autosave'
;
import
TaskList
from
'./task_list'
;
import
{
ajaxPost
,
isInViewport
,
getPagePath
,
scrollToElement
,
isMetaKey
}
from
'./lib/utils/common_utils'
;
import
imageDiffHelper
from
'./image_diff/helpers/index'
;
...
...
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
6d7384f5
<
script
>
/* global Autosave */
import
{
mapActions
,
mapGetters
}
from
'vuex'
;
import
_
from
'underscore'
;
import
autosize
from
'vendor/autosize'
;
import
Flash
from
'../../flash'
;
import
'../../autosave'
;
import
Autosave
from
'../../autosave'
;
import
TaskList
from
'../../task_list'
;
import
*
as
constants
from
'../constants'
;
import
eventHub
from
'../event_hub'
;
...
...
app/assets/javascripts/notes/mixins/autosave.js
View file @
6d7384f5
/* globals Autosave */
import
'../../autosave'
;
import
Autosave
from
'../../autosave'
;
export
default
{
methods
:
{
...
...
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