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
Tatuya Kamada
gitlab-ce
Commits
55df5536
Commit
55df5536
authored
Jan 09, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move param helper to common utils
parent
54984485
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
app/assets/javascripts/lib/utils/common_utils.js.es6
app/assets/javascripts/lib/utils/common_utils.js.es6
+15
-0
app/assets/javascripts/lib/utils/param_helper.js.es6
app/assets/javascripts/lib/utils/param_helper.js.es6
+0
-21
app/assets/javascripts/vue_pagination/index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+0
-2
spec/javascripts/vue_pagination/pagination_spec.js.es6
spec/javascripts/vue_pagination/pagination_spec.js.es6
+1
-0
No files found.
app/assets/javascripts/lib/utils/common_utils.js
→
app/assets/javascripts/lib/utils/common_utils.js
.es6
View file @
55df5536
...
@@ -139,6 +139,21 @@
...
@@ -139,6 +139,21 @@
}, 200);
}, 200);
};
};
/**
this will take in the `name` of the param you want to parse in the url
if the name does not exist this function will return `null`
otherwise it will return the value of the param key provided
*/
w.gl.utils.getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
})(window);
})(window);
}).call(this);
}).call(this);
app/assets/javascripts/lib/utils/param_helper.js.es6
deleted
100644 → 0
View file @
54984485
/* eslint-disable no-param-reassign */
((gl) => {
gl.utils = gl.utils || (gl.utils = {});
/**
this will take in the `name` of the param you want to parse in the url
if the name does not exist this function will return `null`
otherwise it will return the value of the param key provided
*/
gl.utils.getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pagination/index.js.es6
View file @
55df5536
/* global Vue, gl */
/* global Vue, gl */
/* eslint-disable no-param-reassign, no-plusplus */
/* eslint-disable no-param-reassign, no-plusplus */
/*= require lib/utils/param_helper.js.es6 */
((gl) => {
((gl) => {
const PAGINATION_UI_BUTTON_LIMIT = 4;
const PAGINATION_UI_BUTTON_LIMIT = 4;
const UI_LIMIT = 6;
const UI_LIMIT = 6;
...
...
spec/javascripts/vue_pagination/pagination_spec.js.es6
View file @
55df5536
//= require vue
//= require vue
//= require lib/utils/common_utils
//= require vue_pagination/index
//= require vue_pagination/index
describe('Pagination component', () => {
describe('Pagination component', () => {
...
...
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