better url handling
This commit is contained in:
parent
4f96f6d7d6
commit
60ea16271c
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
grep -rli "$1" | xargs -i@ sed -i "s/${1}/s\/${1}/g" @
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
grep -rli "${1}" * | xargs -i@ sed -i "s/${1}/s\/${1}/g" @
|
|
||||||
|
|
|
@ -3,25 +3,31 @@
|
||||||
*/
|
*/
|
||||||
import { buildPopUpUrl } from '../../components/windows/popUpAvailable';
|
import { buildPopUpUrl } from '../../components/windows/popUpAvailable';
|
||||||
|
|
||||||
|
function setFullTitle(windowType, title) {
|
||||||
|
const name = windowType[0] + windowType.substring(1).toLowerCase();
|
||||||
|
document.title = (title) ? `${name} - ${title}` : name;
|
||||||
|
}
|
||||||
|
|
||||||
export default (store) => (next) => (action) => {
|
export default (store) => (next) => (action) => {
|
||||||
const ret = next(action);
|
const ret = next(action);
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'SET_WIN_TITLE': {
|
case 'SET_WIN_TITLE': {
|
||||||
const { windowType } = store.getState().popup;
|
const { windowType, title } = store.getState().popup;
|
||||||
const { title } = action;
|
setFullTitle(windowType, title);
|
||||||
const name = windowType[0] + windowType.substring(1).toLowerCase();
|
|
||||||
document.title = (title) ? `${name} - ${title}` : name;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'CHANGE_WIN_TYPE':
|
||||||
case 'SET_WIN_ARGS': {
|
case 'SET_WIN_ARGS': {
|
||||||
const {
|
const {
|
||||||
args,
|
args,
|
||||||
windowType,
|
windowType,
|
||||||
|
title,
|
||||||
} = store.getState().popup;
|
} = store.getState().popup;
|
||||||
const url = buildPopUpUrl(windowType, args);
|
const url = buildPopUpUrl(windowType, args);
|
||||||
window.history.pushState({}, undefined, url);
|
window.history.pushState({}, undefined, url);
|
||||||
|
setFullTitle(windowType, title);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,14 @@ export default function popup(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'SET_WIN_TITLE': {
|
||||||
|
const { title } = action;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
title,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case 'CHANGE_WIN_TYPE': {
|
case 'CHANGE_WIN_TYPE': {
|
||||||
const {
|
const {
|
||||||
windowType,
|
windowType,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user