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
Léo-Paul Géneau
gitlab-ce
Commits
1f7631e3
Commit
1f7631e3
authored
Apr 13, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove-iife-boards-bundle' into 'master'
Remove IIFEs in boards_bundle.js See merge request !10612
parents
9daf4f64
6c4d6117
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1232 additions
and
1269 deletions
+1232
-1269
app/assets/javascripts/boards/components/board.js
app/assets/javascripts/boards/components/board.js
+83
-85
app/assets/javascripts/boards/components/board_delete.js
app/assets/javascripts/boards/components/board_delete.js
+13
-15
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+55
-57
app/assets/javascripts/boards/components/issue_card_inner.js
app/assets/javascripts/boards/components/issue_card_inner.js
+122
-124
app/assets/javascripts/boards/components/modal/empty_state.js
...assets/javascripts/boards/components/modal/empty_state.js
+59
-61
app/assets/javascripts/boards/components/modal/footer.js
app/assets/javascripts/boards/components/modal/footer.js
+62
-64
app/assets/javascripts/boards/components/modal/header.js
app/assets/javascripts/boards/components/modal/header.js
+64
-66
app/assets/javascripts/boards/components/modal/index.js
app/assets/javascripts/boards/components/modal/index.js
+135
-137
app/assets/javascripts/boards/components/modal/list.js
app/assets/javascripts/boards/components/modal/list.js
+133
-135
app/assets/javascripts/boards/components/modal/lists_dropdown.js
...ets/javascripts/boards/components/modal/lists_dropdown.js
+50
-52
app/assets/javascripts/boards/components/modal/tabs.js
app/assets/javascripts/boards/components/modal/tabs.js
+42
-44
app/assets/javascripts/boards/components/new_list_dropdown.js
...assets/javascripts/boards/components/new_list_dropdown.js
+59
-61
app/assets/javascripts/boards/components/sidebar/remove_issue.js
...ets/javascripts/boards/components/sidebar/remove_issue.js
+48
-50
app/assets/javascripts/boards/mixins/modal_mixins.js
app/assets/javascripts/boards/mixins/modal_mixins.js
+10
-12
app/assets/javascripts/boards/mixins/sortable_default_options.js
...ets/javascripts/boards/mixins/sortable_default_options.js
+29
-31
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+107
-109
app/assets/javascripts/boards/stores/modal_store.js
app/assets/javascripts/boards/stores/modal_store.js
+77
-79
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/lib/utils/url_utility.js
+84
-87
No files found.
app/assets/javascripts/boards/components/board.js
View file @
1f7631e3
...
@@ -7,13 +7,12 @@ import boardBlankState from './board_blank_state';
...
@@ -7,13 +7,12 @@ import boardBlankState from './board_blank_state';
require
(
'
./board_delete
'
);
require
(
'
./board_delete
'
);
require
(
'
./board_list
'
);
require
(
'
./board_list
'
);
(()
=>
{
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
Board
=
Vue
.
extend
({
gl
.
issueBoards
.
Board
=
Vue
.
extend
({
template
:
'
#js-board-template
'
,
template
:
'
#js-board-template
'
,
components
:
{
components
:
{
boardList
,
boardList
,
...
@@ -102,5 +101,4 @@ require('./board_list');
...
@@ -102,5 +101,4 @@ require('./board_list');
this
.
sortable
=
Sortable
.
create
(
this
.
$el
.
parentNode
,
this
.
sortableOptions
);
this
.
sortable
=
Sortable
.
create
(
this
.
$el
.
parentNode
,
this
.
sortableOptions
);
},
},
});
});
})();
app/assets/javascripts/boards/components/board_delete.js
View file @
1f7631e3
...
@@ -2,11 +2,10 @@
...
@@ -2,11 +2,10 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
(()
=>
{
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
BoardDelete
=
Vue
.
extend
({
gl
.
issueBoards
.
BoardDelete
=
Vue
.
extend
({
props
:
{
props
:
{
list
:
Object
list
:
Object
},
},
...
@@ -19,5 +18,4 @@ import Vue from 'vue';
...
@@ -19,5 +18,4 @@ import Vue from 'vue';
}
}
}
}
}
}
});
});
})();
app/assets/javascripts/boards/components/board_sidebar.js
View file @
1f7631e3
...
@@ -8,13 +8,12 @@ import Vue from 'vue';
...
@@ -8,13 +8,12 @@ import Vue from 'vue';
require
(
'
./sidebar/remove_issue
'
);
require
(
'
./sidebar/remove_issue
'
);
(()
=>
{
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
BoardSidebar
=
Vue
.
extend
({
gl
.
issueBoards
.
BoardSidebar
=
Vue
.
extend
({
props
:
{
props
:
{
currentUser
:
Object
currentUser
:
Object
},
},
...
@@ -69,5 +68,4 @@ require('./sidebar/remove_issue');
...
@@ -69,5 +68,4 @@ require('./sidebar/remove_issue');
components
:
{
components
:
{
removeBtn
:
gl
.
issueBoards
.
RemoveIssueBtn
,
removeBtn
:
gl
.
issueBoards
.
RemoveIssueBtn
,
},
},
});
});
})();
app/assets/javascripts/boards/components/issue_card_inner.js
View file @
1f7631e3
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
eventHub
from
'
../eventhub
'
;
import
eventHub
from
'
../eventhub
'
;
(()
=>
{
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
IssueCardInner
=
Vue
.
extend
({
gl
.
issueBoards
.
IssueCardInner
=
Vue
.
extend
({
props
:
{
props
:
{
issue
:
{
issue
:
{
type
:
Object
,
type
:
Object
,
...
@@ -137,5 +136,4 @@ import eventHub from '../eventhub';
...
@@ -137,5 +136,4 @@ import eventHub from '../eventhub';
</div>
</div>
</div>
</div>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/empty_state.js
View file @
1f7631e3
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalEmptyState
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalEmptyState
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
data
()
{
data
()
{
return
ModalStore
.
store
;
return
ModalStore
.
store
;
...
@@ -67,5 +66,4 @@ import Vue from 'vue';
...
@@ -67,5 +66,4 @@ import Vue from 'vue';
</div>
</div>
</section>
</section>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/footer.js
View file @
1f7631e3
...
@@ -5,10 +5,9 @@ import Vue from 'vue';
...
@@ -5,10 +5,9 @@ import Vue from 'vue';
require
(
'
./lists_dropdown
'
);
require
(
'
./lists_dropdown
'
);
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalFooter
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalFooter
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
data
()
{
data
()
{
return
{
return
{
...
@@ -80,5 +79,4 @@ require('./lists_dropdown');
...
@@ -80,5 +79,4 @@ require('./lists_dropdown');
</button>
</button>
</footer>
</footer>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/header.js
View file @
1f7631e3
...
@@ -3,10 +3,9 @@ import modalFilters from './filters';
...
@@ -3,10 +3,9 @@ import modalFilters from './filters';
require
(
'
./tabs
'
);
require
(
'
./tabs
'
);
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalHeader
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalHeader
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
props
:
{
props
:
{
projectId
:
{
projectId
:
{
...
@@ -78,5 +77,4 @@ require('./tabs');
...
@@ -78,5 +77,4 @@ require('./tabs');
</div>
</div>
</div>
</div>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/index.js
View file @
1f7631e3
...
@@ -8,10 +8,9 @@ require('./list');
...
@@ -8,10 +8,9 @@ require('./list');
require
(
'
./footer
'
);
require
(
'
./footer
'
);
require
(
'
./empty_state
'
);
require
(
'
./empty_state
'
);
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
IssuesModal
=
Vue
.
extend
({
gl
.
issueBoards
.
IssuesModal
=
Vue
.
extend
({
props
:
{
props
:
{
blankStateImage
:
{
blankStateImage
:
{
type
:
String
,
type
:
String
,
...
@@ -163,5 +162,4 @@ require('./empty_state');
...
@@ -163,5 +162,4 @@ require('./empty_state');
</div>
</div>
</div>
</div>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/list.js
View file @
1f7631e3
...
@@ -3,10 +3,9 @@
...
@@ -3,10 +3,9 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalList
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalList
=
Vue
.
extend
({
props
:
{
props
:
{
issueLinkBase
:
{
issueLinkBase
:
{
type
:
String
,
type
:
String
,
...
@@ -157,5 +156,4 @@ import Vue from 'vue';
...
@@ -157,5 +156,4 @@ import Vue from 'vue';
</div>
</div>
</section>
</section>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/lists_dropdown.js
View file @
1f7631e3
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalFooterListsDropdown
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalFooterListsDropdown
=
Vue
.
extend
({
data
()
{
data
()
{
return
{
return
{
modal
:
ModalStore
.
store
,
modal
:
ModalStore
.
store
,
...
@@ -53,5 +52,4 @@ import Vue from 'vue';
...
@@ -53,5 +52,4 @@ import Vue from 'vue';
</div>
</div>
</div>
</div>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/modal/tabs.js
View file @
1f7631e3
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalTabs
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalTabs
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
data
()
{
data
()
{
return
ModalStore
.
store
;
return
ModalStore
.
store
;
...
@@ -44,5 +43,4 @@ import Vue from 'vue';
...
@@ -44,5 +43,4 @@ import Vue from 'vue';
</ul>
</ul>
</div>
</div>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/components/new_list_dropdown.js
View file @
1f7631e3
/* eslint-disable comma-dangle, func-names, no-new, space-before-function-paren, one-var */
/* eslint-disable comma-dangle, func-names, no-new, space-before-function-paren, one-var */
(()
=>
{
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
$
(
document
).
off
(
'
created.label
'
).
on
(
'
created.label
'
,
(
e
,
label
)
=>
{
$
(
document
).
off
(
'
created.label
'
).
on
(
'
created.label
'
,
(
e
,
label
)
=>
{
Store
.
new
({
Store
.
new
({
title
:
label
.
title
,
title
:
label
.
title
,
position
:
Store
.
state
.
lists
.
length
-
2
,
position
:
Store
.
state
.
lists
.
length
-
2
,
...
@@ -17,9 +16,9 @@
...
@@ -17,9 +16,9 @@
color
:
label
.
color
color
:
label
.
color
}
}
});
});
});
});
gl
.
issueBoards
.
newListDropdownInit
=
()
=>
{
gl
.
issueBoards
.
newListDropdownInit
=
()
=>
{
$
(
'
.js-new-board-list
'
).
each
(
function
()
{
$
(
'
.js-new-board-list
'
).
each
(
function
()
{
const
$this
=
$
(
this
);
const
$this
=
$
(
this
);
new
gl
.
CreateLabelDropdown
(
$this
.
closest
(
'
.dropdown
'
).
find
(
'
.dropdown-new-label
'
),
$this
.
data
(
'
namespace-path
'
),
$this
.
data
(
'
project-path
'
));
new
gl
.
CreateLabelDropdown
(
$this
.
closest
(
'
.dropdown
'
).
find
(
'
.dropdown-new-label
'
),
$this
.
data
(
'
namespace-path
'
),
$this
.
data
(
'
project-path
'
));
...
@@ -72,5 +71,4 @@
...
@@ -72,5 +71,4 @@
}
}
});
});
});
});
};
};
})();
app/assets/javascripts/boards/components/sidebar/remove_issue.js
View file @
1f7631e3
...
@@ -3,13 +3,12 @@
...
@@ -3,13 +3,12 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
(()
=>
{
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
RemoveIssueBtn
=
Vue
.
extend
({
gl
.
issueBoards
.
RemoveIssueBtn
=
Vue
.
extend
({
props
:
{
props
:
{
issue
:
{
issue
:
{
type
:
Object
,
type
:
Object
,
...
@@ -57,5 +56,4 @@ import Vue from 'vue';
...
@@ -57,5 +56,4 @@ import Vue from 'vue';
</button>
</button>
</div>
</div>
`
,
`
,
});
});
})();
app/assets/javascripts/boards/mixins/modal_mixins.js
View file @
1f7631e3
(()
=>
{
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalMixins
=
{
gl
.
issueBoards
.
ModalMixins
=
{
methods
:
{
methods
:
{
toggleModal
(
toggle
)
{
toggleModal
(
toggle
)
{
ModalStore
.
store
.
showAddIssuesModal
=
toggle
;
ModalStore
.
store
.
showAddIssuesModal
=
toggle
;
...
@@ -10,5 +9,4 @@
...
@@ -10,5 +9,4 @@
ModalStore
.
store
.
activeTab
=
tab
;
ModalStore
.
store
.
activeTab
=
tab
;
},
},
},
},
};
};
})();
app/assets/javascripts/boards/mixins/sortable_default_options.js
View file @
1f7631e3
/* eslint-disable no-unused-vars, no-mixed-operators, comma-dangle */
/* eslint-disable no-unused-vars, no-mixed-operators, comma-dangle */
/* global DocumentTouch */
/* global DocumentTouch */
((
w
)
=>
{
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
onStart
=
()
=>
{
gl
.
issueBoards
.
onStart
=
()
=>
{
$
(
'
.has-tooltip
'
).
tooltip
(
'
hide
'
)
$
(
'
.has-tooltip
'
).
tooltip
(
'
hide
'
)
.
tooltip
(
'
disable
'
);
.
tooltip
(
'
disable
'
);
document
.
body
.
classList
.
add
(
'
is-dragging
'
);
document
.
body
.
classList
.
add
(
'
is-dragging
'
);
};
};
gl
.
issueBoards
.
onEnd
=
()
=>
{
gl
.
issueBoards
.
onEnd
=
()
=>
{
$
(
'
.has-tooltip
'
).
tooltip
(
'
enable
'
);
$
(
'
.has-tooltip
'
).
tooltip
(
'
enable
'
);
document
.
body
.
classList
.
remove
(
'
is-dragging
'
);
document
.
body
.
classList
.
remove
(
'
is-dragging
'
);
};
};
gl
.
issueBoards
.
touchEnabled
=
(
'
ontouchstart
'
in
window
)
||
window
.
DocumentTouch
&&
document
instanceof
DocumentTouch
;
gl
.
issueBoards
.
touchEnabled
=
(
'
ontouchstart
'
in
window
)
||
window
.
DocumentTouch
&&
document
instanceof
DocumentTouch
;
gl
.
issueBoards
.
getBoardSortableDefaultOptions
=
(
obj
)
=>
{
gl
.
issueBoards
.
getBoardSortableDefaultOptions
=
(
obj
)
=>
{
const
defaultSortOptions
=
{
const
defaultSortOptions
=
{
animation
:
200
,
animation
:
200
,
forceFallback
:
true
,
forceFallback
:
true
,
...
@@ -35,5 +34,4 @@
...
@@ -35,5 +34,4 @@
Object
.
keys
(
obj
).
forEach
((
key
)
=>
{
defaultSortOptions
[
key
]
=
obj
[
key
];
});
Object
.
keys
(
obj
).
forEach
((
key
)
=>
{
defaultSortOptions
[
key
]
=
obj
[
key
];
});
return
defaultSortOptions
;
return
defaultSortOptions
;
};
};
})(
window
);
app/assets/javascripts/boards/stores/boards_store.js
View file @
1f7631e3
...
@@ -3,11 +3,10 @@
...
@@ -3,11 +3,10 @@
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
(()
=>
{
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
gl
.
issueBoards
.
BoardsStore
=
{
gl
.
issueBoards
.
BoardsStore
=
{
disabled
:
false
,
disabled
:
false
,
filter
:
{
filter
:
{
path
:
''
,
path
:
''
,
...
@@ -123,5 +122,4 @@ import Cookies from 'js-cookie';
...
@@ -123,5 +122,4 @@ import Cookies from 'js-cookie';
updateFiltersUrl
()
{
updateFiltersUrl
()
{
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
history
.
pushState
(
null
,
null
,
`?
${
this
.
filter
.
path
}
`
);
}
}
};
};
})();
app/assets/javascripts/boards/stores/modal_store.js
View file @
1f7631e3
(()
=>
{
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
class
ModalStore
{
class
ModalStore
{
constructor
()
{
constructor
()
{
this
.
store
=
{
this
.
store
=
{
columns
:
3
,
columns
:
3
,
...
@@ -94,7 +93,6 @@
...
@@ -94,7 +93,6 @@
return
this
.
store
.
selectedIssues
return
this
.
store
.
selectedIssues
.
filter
(
filteredIssue
=>
filteredIssue
.
id
===
issue
.
id
)[
0
];
.
filter
(
filteredIssue
=>
filteredIssue
.
id
===
issue
.
id
)[
0
];
}
}
}
}
gl
.
issueBoards
.
ModalStore
=
new
ModalStore
();
gl
.
issueBoards
.
ModalStore
=
new
ModalStore
();
})();
app/assets/javascripts/lib/utils/url_utility.js
View file @
1f7631e3
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, one-var, one-var-declaration-per-line, no-void, guard-for-in, no-restricted-syntax, prefer-template, quotes, max-len */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, one-var, one-var-declaration-per-line, no-void, guard-for-in, no-restricted-syntax, prefer-template, quotes, max-len */
(
function
()
{
var
base
;
(
function
(
w
)
{
var
w
=
window
;
var
base
;
if
(
w
.
gl
==
null
)
{
if
(
w
.
gl
==
null
)
{
w
.
gl
=
{};
w
.
gl
=
{};
}
}
if
((
base
=
w
.
gl
).
utils
==
null
)
{
if
((
base
=
w
.
gl
).
utils
==
null
)
{
base
.
utils
=
{};
base
.
utils
=
{};
}
}
// Returns an array containing the value(s) of the
// Returns an array containing the value(s) of the
// of the key passed as an argument
// of the key passed as an argument
w
.
gl
.
utils
.
getParameterValues
=
function
(
sParam
)
{
w
.
gl
.
utils
.
getParameterValues
=
function
(
sParam
)
{
var
i
,
sPageURL
,
sParameterName
,
sURLVariables
,
values
;
var
i
,
sPageURL
,
sParameterName
,
sURLVariables
,
values
;
sPageURL
=
decodeURIComponent
(
window
.
location
.
search
.
substring
(
1
));
sPageURL
=
decodeURIComponent
(
window
.
location
.
search
.
substring
(
1
));
sURLVariables
=
sPageURL
.
split
(
'
&
'
);
sURLVariables
=
sPageURL
.
split
(
'
&
'
);
...
@@ -25,10 +24,10 @@
...
@@ -25,10 +24,10 @@
i
+=
1
;
i
+=
1
;
}
}
return
values
;
return
values
;
};
};
// @param {Object} params - url keys and value to merge
// @param {Object} params - url keys and value to merge
// @param {String} url
// @param {String} url
w
.
gl
.
utils
.
mergeUrlParams
=
function
(
params
,
url
)
{
w
.
gl
.
utils
.
mergeUrlParams
=
function
(
params
,
url
)
{
var
lastChar
,
newUrl
,
paramName
,
paramValue
,
pattern
;
var
lastChar
,
newUrl
,
paramName
,
paramValue
,
pattern
;
newUrl
=
decodeURIComponent
(
url
);
newUrl
=
decodeURIComponent
(
url
);
for
(
paramName
in
params
)
{
for
(
paramName
in
params
)
{
...
@@ -48,9 +47,9 @@
...
@@ -48,9 +47,9 @@
newUrl
=
newUrl
.
slice
(
0
,
-
1
);
newUrl
=
newUrl
.
slice
(
0
,
-
1
);
}
}
return
newUrl
;
return
newUrl
;
};
};
// removes parameter query string from url. returns the modified url
// removes parameter query string from url. returns the modified url
w
.
gl
.
utils
.
removeParamQueryString
=
function
(
url
,
param
)
{
w
.
gl
.
utils
.
removeParamQueryString
=
function
(
url
,
param
)
{
var
urlVariables
,
variables
;
var
urlVariables
,
variables
;
url
=
decodeURIComponent
(
url
);
url
=
decodeURIComponent
(
url
);
urlVariables
=
url
.
split
(
'
&
'
);
urlVariables
=
url
.
split
(
'
&
'
);
...
@@ -65,15 +64,15 @@
...
@@ -65,15 +64,15 @@
}
}
return
results
;
return
results
;
})()).
join
(
'
&
'
);
})()).
join
(
'
&
'
);
};
};
w
.
gl
.
utils
.
removeParams
=
(
params
)
=>
{
w
.
gl
.
utils
.
removeParams
=
(
params
)
=>
{
const
url
=
new
URL
(
window
.
location
.
href
);
const
url
=
new
URL
(
window
.
location
.
href
);
params
.
forEach
((
param
)
=>
{
params
.
forEach
((
param
)
=>
{
url
.
search
=
w
.
gl
.
utils
.
removeParamQueryString
(
url
.
search
,
param
);
url
.
search
=
w
.
gl
.
utils
.
removeParamQueryString
(
url
.
search
,
param
);
});
});
return
url
.
href
;
return
url
.
href
;
};
};
w
.
gl
.
utils
.
getLocationHash
=
function
(
url
)
{
w
.
gl
.
utils
.
getLocationHash
=
function
(
url
)
{
var
hashIndex
;
var
hashIndex
;
if
(
typeof
url
===
'
undefined
'
)
{
if
(
typeof
url
===
'
undefined
'
)
{
// Note: We can't use window.location.hash here because it's
// Note: We can't use window.location.hash here because it's
...
@@ -82,12 +81,10 @@
...
@@ -82,12 +81,10 @@
}
}
hashIndex
=
url
.
indexOf
(
'
#
'
);
hashIndex
=
url
.
indexOf
(
'
#
'
);
return
hashIndex
===
-
1
?
null
:
url
.
substring
(
hashIndex
+
1
);
return
hashIndex
===
-
1
?
null
:
url
.
substring
(
hashIndex
+
1
);
};
};
w
.
gl
.
utils
.
refreshCurrentPage
=
()
=>
gl
.
utils
.
visitUrl
(
document
.
location
.
href
);
w
.
gl
.
utils
.
refreshCurrentPage
=
()
=>
gl
.
utils
.
visitUrl
(
document
.
location
.
href
);
w
.
gl
.
utils
.
visitUrl
=
(
url
)
=>
{
w
.
gl
.
utils
.
visitUrl
=
(
url
)
=>
{
document
.
location
.
href
=
url
;
document
.
location
.
href
=
url
;
};
};
})(
window
);
}).
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