Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
b88c4cde
Commit
b88c4cde
authored
Feb 11, 2016
by
Carsten Rose
Browse files
Merge remote-tracking branch 'origin/Typo3integrated' into Typo3integrated
parents
f1b89abd
47d358a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Gruntfile.js
View file @
b88c4cde
...
...
@@ -53,6 +53,19 @@ module.exports = function (grunt) {
}
]
},
jquery_devel
:
{
files
:
[
{
cwd
:
'
bower_components/jquery/dist/
'
,
src
:
[
'
jquery.min.js
'
],
expand
:
true
,
dest
:
"
js/
"
,
flatten
:
true
}
]
},
jqwidgets
:
{
files
:
[
{
...
...
javascript/src/PageState.js
View file @
b88c4cde
...
...
@@ -12,6 +12,7 @@ if (!QfqNS) {
n
.
PageState
=
function
()
{
this
.
pageState
=
location
.
hash
.
slice
(
1
);
this
.
data
=
null
;
this
.
inPoppingHandler
=
false
;
this
.
userPopStateHandlers
=
[];
...
...
@@ -29,10 +30,11 @@ if (!QfqNS) {
this
.
inPoppingHandler
=
true
;
this
.
pageState
=
location
.
hash
.
slice
(
1
);
this
.
data
=
window
.
history
.
state
;
QfqNS
.
Log
.
debug
(
"
PageState.popStateHandler(): invoke user pop state handler(s)
"
);
this
.
userPopStateHandlers
.
forEach
(
function
(
handler
)
{
handler
(
this
.
pageState
);
handler
(
this
);
},
this
);
this
.
inPoppingHandler
=
false
;
...
...
@@ -44,24 +46,31 @@ if (!QfqNS) {
return
this
.
pageState
;
};
n
.
PageState
.
prototype
.
setPageState
=
function
(
state
)
{
n
.
PageState
.
prototype
.
getPageData
=
function
()
{
return
this
.
data
;
};
n
.
PageState
.
prototype
.
setPageState
=
function
(
state
,
data
)
{
if
(
state
.
startsWith
(
'
#
'
))
{
this
.
pageState
=
state
.
slice
(
1
);
window
.
history
.
replaceState
(
null
,
null
,
state
);
window
.
history
.
replaceState
(
data
,
null
,
state
);
}
else
{
this
.
pageState
=
state
;
window
.
history
.
replaceState
(
null
,
null
,
'
#
'
+
state
);
window
.
history
.
replaceState
(
data
,
null
,
'
#
'
+
state
);
}
this
.
data
=
data
;
};
n
.
PageState
.
prototype
.
newPageState
=
function
(
state
)
{
n
.
PageState
.
prototype
.
newPageState
=
function
(
state
,
data
)
{
if
(
state
.
startsWith
(
'
#
'
))
{
this
.
pageState
=
state
.
slice
(
1
);
window
.
history
.
pushState
(
null
,
null
,
state
);
window
.
history
.
pushState
(
data
,
null
,
state
);
}
else
{
this
.
pageState
=
state
;
window
.
history
.
pushState
(
null
,
null
,
'
#
'
+
state
);
window
.
history
.
pushState
(
data
,
null
,
'
#
'
+
state
);
}
this
.
data
=
data
;
};
n
.
PageState
.
prototype
.
addStateActivationHandler
=
function
(
handler
)
{
...
...
javascript/src/QfqPage.js
View file @
b88c4cde
...
...
@@ -22,8 +22,12 @@ if (!QfqNS) {
this
.
bsTabs
=
new
QfqNS
.
BSTabs
(
this
.
settings
.
tabsId
);
if
(
this
.
settings
.
pageState
.
getPageState
()
!==
""
)
{
this
.
bsTabs
.
activateTab
(
this
.
settings
.
pageState
.
getPageState
());
var
currentState
=
this
.
settings
.
pageState
.
getPageState
();
if
(
currentState
!==
""
)
{
this
.
bsTabs
.
activateTab
(
currentState
);
QfqNS
.
PageTitle
.
setSubTitle
(
this
.
bsTabs
.
getTabName
(
currentState
));
}
else
{
this
.
settings
.
pageState
.
setPageState
(
this
.
bsTabs
.
getCurrentTab
(),
QfqNS
.
PageTitle
.
get
());
}
this
.
bsTabs
.
addTabShowHandler
(
this
.
tabShowHandler
.
bind
(
this
));
...
...
@@ -37,18 +41,20 @@ if (!QfqNS) {
// Therefore, we have to make sure, that tabShowHandler() does not save the page state while we're restoring
// a previous state, i.e. we're called because of the popStateHandler() below.
if
(
this
.
settings
.
pageState
.
inPoppingHandler
)
{
QfqNS
.
Log
.
debug
(
"
Prematurely terminating QfqPage.tabShowHandler(): called
while
due to page state
"
+
QfqNS
.
Log
.
debug
(
"
Prematurely terminating QfqPage.tabShowHandler(): called due to page state
"
+
"
restoration.
"
);
return
;
}
var
currentTabId
=
bsTabs
.
getCurrentTab
();
QfqNS
.
Log
.
debug
(
'
Saving state:
'
+
currentTabId
);
this
.
settings
.
pageState
.
newPageState
(
currentTabId
);
QfqNS
.
PageTitle
.
setSubTitle
(
bsTabs
.
getTabName
(
currentTabId
));
this
.
settings
.
pageState
.
newPageState
(
currentTabId
,
QfqNS
.
PageTitle
.
get
());
};
n
.
QfqPage
.
prototype
.
popStateHandler
=
function
(
state
)
{
this
.
bsTabs
.
activateTab
(
state
);
n
.
QfqPage
.
prototype
.
popStateHandler
=
function
(
pageState
)
{
this
.
bsTabs
.
activateTab
(
pageState
.
getPageState
());
QfqNS
.
PageTitle
.
set
(
pageState
.
getPageData
());
};
})(
QfqNS
);
\ No newline at end of file
Write
Preview
Supports
Markdown
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