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
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
23 deletions
+16
-23
common_utils.js.es6
app/assets/javascripts/lib/utils/common_utils.js.es6
+15
-0
param_helper.js.es6
app/assets/javascripts/lib/utils/param_helper.js.es6
+0
-21
index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+0
-2
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 @@
}, 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);
}).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 */
/* eslint-disable no-param-reassign, no-plusplus */
/*= require lib/utils/param_helper.js.es6 */
((gl) => {
const PAGINATION_UI_BUTTON_LIMIT = 4;
const UI_LIMIT = 6;
...
...
spec/javascripts/vue_pagination/pagination_spec.js.es6
View file @
55df5536
//= require vue
//= require lib/utils/common_utils
//= require vue_pagination/index
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