Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
9b0c9fc0
Commit
9b0c9fc0
authored
11 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Use PJAX to speed requests in the same panel
parent
6f9c14b2
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/staff/footer.inc.php
+11
-0
11 additions, 0 deletions
include/staff/footer.inc.php
include/staff/header.inc.php
+14
-7
14 additions, 7 deletions
include/staff/header.inc.php
js/jquery.pjax.js
+839
-0
839 additions, 0 deletions
js/jquery.pjax.js
scp/js/ticket.js
+4
-2
4 additions, 2 deletions
scp/js/ticket.js
with
868 additions
and
9 deletions
include/staff/footer.inc.php
+
11
−
0
View file @
9b0c9fc0
<?php
if
(
!
isset
(
$_SERVER
[
'HTTP_X_PJAX'
]))
{
?>
</div>
</div>
<div
id=
"footer"
>
<div
id=
"footer"
>
Copyright
©
2006-
<?php
echo
date
(
'Y'
);
?>
<?php
echo
(
string
)
$ost
->
company
?:
'osTicket.com'
;
?>
All Rights Reserved.
Copyright
©
2006-
<?php
echo
date
(
'Y'
);
?>
<?php
echo
(
string
)
$ost
->
company
?:
'osTicket.com'
;
?>
All Rights Reserved.
...
@@ -20,5 +21,15 @@ if(is_object($thisstaff) && $thisstaff->isStaff()) { ?>
...
@@ -20,5 +21,15 @@ if(is_object($thisstaff) && $thisstaff->isStaff()) { ?>
<div
class=
"dialog"
style=
"display:none;width:650px;"
id=
"popup"
>
<div
class=
"dialog"
style=
"display:none;width:650px;"
id=
"popup"
>
<div
class=
"body"
></div>
<div
class=
"body"
></div>
</div>
</div>
<script
type=
"text/javascript"
>
if
(
$
.
support
.
pjax
)
{
$
(
document
).
on
(
'
click
'
,
'
a
'
,
function
(
event
)
{
if
(
!
$
(
this
).
hasClass
(
'
no-pjax
'
))
$
.
pjax
.
click
(
event
,
{
container
:
$
(
'
#content
'
)})
})
}
</script>
</body>
</body>
</html>
</html>
<?php
}
# endif X_PJAX ?>
This diff is collapsed.
Click to expand it.
include/staff/header.inc.php
+
14
−
7
View file @
9b0c9fc0
<?php
if
(
!
isset
(
$_SERVER
[
'HTTP_X_PJAX'
]))
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<html>
<head>
<head>
...
@@ -13,6 +14,7 @@
...
@@ -13,6 +14,7 @@
<![endif]-->
<![endif]-->
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/jquery-1.8.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/jquery-1.8.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/jquery-ui-1.10.3.custom.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/jquery-ui-1.10.3.custom.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/jquery.pjax.js"
></script>
<script
type=
"text/javascript"
src=
"../js/jquery.multifile.js"
></script>
<script
type=
"text/javascript"
src=
"../js/jquery.multifile.js"
></script>
<script
type=
"text/javascript"
src=
"./js/tips.js"
></script>
<script
type=
"text/javascript"
src=
"./js/tips.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/redactor.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
ROOT_PATH
;
?>
js/redactor.min.js"
></script>
...
@@ -53,27 +55,31 @@
...
@@ -53,27 +55,31 @@
<p
id=
"info"
>
Welcome,
<strong>
<?php
echo
$thisstaff
->
getFirstName
();
?>
</strong>
<p
id=
"info"
>
Welcome,
<strong>
<?php
echo
$thisstaff
->
getFirstName
();
?>
</strong>
<?php
<?php
if
(
$thisstaff
->
isAdmin
()
&&
!
defined
(
'ADMINPAGE'
))
{
?>
if
(
$thisstaff
->
isAdmin
()
&&
!
defined
(
'ADMINPAGE'
))
{
?>
|
<a
href=
"admin.php"
>
Admin Panel
</a>
|
<a
href=
"admin.php"
class=
"no-pjax"
>
Admin Panel
</a>
<?php
}
else
{
?>
<?php
}
else
{
?>
|
<a
href=
"index.php"
>
Staff Panel
</a>
|
<a
href=
"index.php"
class=
"no-pjax"
>
Staff Panel
</a>
<?php
}
?>
<?php
}
?>
|
<a
href=
"profile.php"
>
My Preferences
</a>
|
<a
href=
"profile.php"
>
My Preferences
</a>
|
<a
href=
"logout.php?auth=
<?php
echo
$ost
->
getLinkToken
();
?>
"
>
Log Out
</a>
|
<a
href=
"logout.php?auth=
<?php
echo
$ost
->
getLinkToken
();
?>
"
class=
"no-pjax"
>
Log Out
</a>
</p>
</p>
</div>
</div>
<ul
id=
"nav"
>
<ul
id=
"nav"
>
<?php
<?php
if
((
$tabs
=
$nav
->
getTabs
())
&&
is_array
(
$tabs
)){
if
((
$tabs
=
$nav
->
getTabs
())
&&
is_array
(
$tabs
)){
foreach
(
$tabs
as
$name
=>
$tab
)
{
foreach
(
$tabs
as
$name
=>
$tab
)
{
echo
sprintf
(
'<li class="%s"><a href="%s">%s</a>'
,
$tab
[
'active'
]
?
'active'
:
'inactive'
,
$tab
[
'href'
],
$tab
[
'desc'
]);
echo
sprintf
(
'<li class="%s"><a href="%s"
class="no-pjax"
>%s</a>'
,
$tab
[
'active'
]
?
'active'
:
'inactive'
,
$tab
[
'href'
],
$tab
[
'desc'
]);
if
(
!
$tab
[
'active'
]
&&
(
$subnav
=
$nav
->
getSubMenu
(
$name
))){
if
(
!
$tab
[
'active'
]
&&
(
$subnav
=
$nav
->
getSubMenu
(
$name
))){
echo
"<ul>
\n
"
;
echo
"<ul>
\n
"
;
foreach
(
$subnav
as
$k
=>
$item
)
{
foreach
(
$subnav
as
$k
=>
$item
)
{
if
(
!
(
$id
=
$item
[
'id'
]))
if
(
!
(
$id
=
$item
[
'id'
]))
$id
=
"nav
$k
"
;
$id
=
"nav
$k
"
;
echo
sprintf
(
'<li><a class="%s" href="%s" title="%s" id="%s">%s</a></li>'
,
echo
sprintf
(
$item
[
'iconclass'
],
$item
[
'href'
],
$item
[
'title'
],
$id
,
$item
[
'desc'
]);
'<li><a class="%s %s" href="%s" title="%s" id="%s">%s</a></li>'
,
$item
[
'iconclass'
],
$tab
[
'active'
]
?
''
:
'no-pjax'
,
$item
[
'href'
],
$item
[
'title'
],
$id
,
$item
[
'desc'
]);
}
}
echo
"
\n
</ul>
\n
"
;
echo
"
\n
</ul>
\n
"
;
}
}
...
@@ -107,7 +113,8 @@
...
@@ -107,7 +113,8 @@
}
}
?>
?>
</ul>
</ul>
<div
id=
"content"
>
<div
id=
"content"
data-pjax-container
>
<?php
}
# endif X_PJAX ?>
<?
php
if
(
$errors
[
'err'
])
{
?>
<?
php
if
(
$errors
[
'err'
])
{
?>
<div
id=
"msg_error"
>
<?php
echo
$errors
[
'err'
];
?>
</div>
<div
id=
"msg_error"
>
<?php
echo
$errors
[
'err'
];
?>
</div>
<?php
}
elseif
(
$msg
)
{
?>
<?php
}
elseif
(
$msg
)
{
?>
...
...
This diff is collapsed.
Click to expand it.
js/jquery.pjax.js
0 → 100644
+
839
−
0
View file @
9b0c9fc0
This diff is collapsed.
Click to expand it.
scp/js/ticket.js
+
4
−
2
View file @
9b0c9fc0
...
@@ -265,7 +265,7 @@ $.autoLock = autoLock;
...
@@ -265,7 +265,7 @@ $.autoLock = autoLock;
UI & form events
UI & form events
*/
*/
jQuery
(
function
(
$
)
{
var
ticket_onload
=
function
(
$
)
{
$
(
'
#response_options form
'
).
hide
();
$
(
'
#response_options form
'
).
hide
();
$
(
'
#ticket_notes
'
).
hide
();
$
(
'
#ticket_notes
'
).
hide
();
if
(
location
.
hash
!=
""
&&
$
(
'
#response_options
'
+
location
.
hash
).
length
)
{
if
(
location
.
hash
!=
""
&&
$
(
'
#response_options
'
+
location
.
hash
).
length
)
{
...
@@ -407,7 +407,9 @@ jQuery(function($) {
...
@@ -407,7 +407,9 @@ jQuery(function($) {
// TODO: Add a hover-button to show just one image
// TODO: Add a hover-button to show just one image
});
});
});
});
});
};
$
(
ticket_onload
);
$
(
document
).
on
(
'
pjax:success
'
,
function
()
{
ticket_onload
(
jQuery
);
});
showImagesInline
=
function
(
urls
,
thread_id
)
{
showImagesInline
=
function
(
urls
,
thread_id
)
{
var
selector
=
(
thread_id
==
undefined
)
var
selector
=
(
thread_id
==
undefined
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment