Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
9dfecadc
Commit
9dfecadc
authored
10 years ago
by
Jared Hancock
Committed by
Peter Rotich
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Float draft-saved box inside redactor editors
parent
33a0c71f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/staff/tpl.inc.php
+1
-1
1 addition, 1 deletion
include/staff/tpl.inc.php
js/redactor-osticket.js
+30
-34
30 additions, 34 deletions
js/redactor-osticket.js
scp/css/scp.css
+9
-0
9 additions, 0 deletions
scp/css/scp.css
with
40 additions
and
35 deletions
include/staff/tpl.inc.php
+
1
−
1
View file @
9dfecadc
...
@@ -97,7 +97,7 @@ $tpl=$msgtemplates[$selected];
...
@@ -97,7 +97,7 @@ $tpl=$msgtemplates[$selected];
<div>
<div>
<input
type=
"text"
name=
"subject"
size=
"65"
value=
"
<?php
echo
$info
[
'subject'
];
?>
"
<input
type=
"text"
name=
"subject"
size=
"65"
value=
"
<?php
echo
$info
[
'subject'
];
?>
"
style=
"font-size:14pt"
>
style=
"font-size:14pt
;width:100%;box-sizing:border-box
"
>
<div
style=
"margin-bottom:0.5em;margin-top:0.5em"
>
<div
style=
"margin-bottom:0.5em;margin-top:0.5em"
>
</div>
</div>
<input
type=
"hidden"
name=
"draft_id"
value=
""
/>
<input
type=
"hidden"
name=
"draft_id"
value=
""
/>
...
...
This diff is collapsed.
Click to expand it.
js/redactor-osticket.js
+
30
−
34
View file @
9dfecadc
...
@@ -4,8 +4,8 @@ if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
...
@@ -4,8 +4,8 @@ if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
* automatically, along with draft autosave, and image uploading.
* automatically, along with draft autosave, and image uploading.
*
*
* Configuration:
* Configuration:
* draft
_n
amespace: namespace for the draft retrieval
* draft
N
amespace: namespace for the draft retrieval
* draft
_o
bject
_i
d: extension to the namespace for draft retrieval
* draft
O
bject
I
d: extension to the namespace for draft retrieval
*
*
* Caveats:
* Caveats:
* Login (staff only currently) is required server-side for drafts and image
* Login (staff only currently) is required server-side for drafts and image
...
@@ -14,17 +14,37 @@ if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
...
@@ -14,17 +14,37 @@ if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
*/
*/
RedactorPlugins
.
draft
=
{
RedactorPlugins
.
draft
=
{
init
:
function
()
{
init
:
function
()
{
if
(
!
this
.
opts
.
draft
_n
amespace
)
if
(
!
this
.
opts
.
draft
N
amespace
)
return
;
return
;
this
.
opts
.
changeCallback
=
this
.
hideDraftSaved
;
this
.
opts
.
changeCallback
=
this
.
hideDraftSaved
;
var
autosave_url
=
'
ajax.php/draft/
'
+
this
.
opts
.
draft
_n
amespace
;
var
autosave_url
=
'
ajax.php/draft/
'
+
this
.
opts
.
draft
N
amespace
;
if
(
this
.
opts
.
draft
_o
bject
_i
d
)
if
(
this
.
opts
.
draft
O
bject
I
d
)
autosave_url
+=
'
.
'
+
this
.
opts
.
draft
_o
bject
_i
d
;
autosave_url
+=
'
.
'
+
this
.
opts
.
draft
O
bject
I
d
;
this
.
opts
.
autosave
=
autosave_url
;
this
.
opts
.
autosave
=
autosave_url
;
this
.
opts
.
autosaveInterval
=
10
;
this
.
opts
.
autosaveInterval
=
10
;
this
.
opts
.
autosaveCallback
=
this
.
setupDraftUpdate
;
this
.
opts
.
autosaveCallback
=
this
.
setupDraftUpdate
;
this
.
opts
.
initCallback
=
this
.
recoverDraft
;
this
.
opts
.
initCallback
=
this
.
recoverDraft
;
this
.
$draft_saved
=
$
(
'
<span>
'
)
.
addClass
(
"
pull-right draft-saved faded
"
)
.
css
({
'
position
'
:
'
absolute
'
,
'
top
'
:
'
3em
'
,
'
right
'
:
'
0.5em
'
})
.
hide
()
.
append
(
$
(
'
<span>
'
)
.
text
(
'
Draft Saved
'
));
if
(
this
.
opts
.
draftDelete
)
{
this
.
$draft_saved
.
append
(
$
(
'
<span>
'
)
.
css
({
'
padding-left
'
:
'
1em
'
,
'
cursor
'
:
'
pointer
'
})
.
click
(
$
.
proxy
(
function
()
{
this
.
deleteDraft
();
return
false
;
},
this
))
.
append
(
$
(
'
<i>
'
)
.
addClass
(
'
icon-trash
'
)
)
);
}
this
.
$toolbar
.
append
(
this
.
$draft_saved
);
},
},
recoverDraft
:
function
()
{
recoverDraft
:
function
()
{
var
self
=
this
;
var
self
=
this
;
...
@@ -62,11 +82,11 @@ RedactorPlugins.draft = {
...
@@ -62,11 +82,11 @@ RedactorPlugins.draft = {
});
});
},
},
setupDraftUpdate
:
function
(
data
)
{
setupDraftUpdate
:
function
(
data
)
{
this
.
$
box
.
parent
().
find
(
'
.
draft
-
saved
'
)
.
show
();
this
.
$draft
_
saved
.
show
()
.
delay
(
5000
).
fadeOut
()
;
// Slight workaround. Signal the 'keyup' event normally signaled
// Slight workaround. Signal the 'keyup' event normally signaled
// from typing in the <textarea>
// from typing in the <textarea>
if
(
$
.
autoLock
&&
this
.
opts
.
draft
_n
amespace
==
'
ticket.response
'
)
if
(
$
.
autoLock
&&
this
.
opts
.
draft
N
amespace
==
'
ticket.response
'
)
if
(
this
.
get
())
if
(
this
.
get
())
$
.
autoLock
.
handleEvent
();
$
.
autoLock
.
handleEvent
();
...
@@ -102,7 +122,7 @@ RedactorPlugins.draft = {
...
@@ -102,7 +122,7 @@ RedactorPlugins.draft = {
},
},
hideDraftSaved
:
function
()
{
hideDraftSaved
:
function
()
{
this
.
$
box
.
parent
().
find
(
'
.
draft
-
saved
'
)
.
hide
();
this
.
$draft
_
saved
.
hide
();
},
},
deleteDraft
:
function
()
{
deleteDraft
:
function
()
{
...
@@ -238,33 +258,9 @@ $(function() {
...
@@ -238,33 +258,9 @@ $(function() {
});
});
}
}
if
(
el
.
hasClass
(
'
draft
'
))
{
if
(
el
.
hasClass
(
'
draft
'
))
{
var
draft_saved
=
$
(
'
<span>
'
)
.
addClass
(
"
pull-right draft-saved faded
"
)
.
css
({
'
position
'
:
'
absolute
'
,
'
top
'
:
'
0.2em
'
,
'
right
'
:
'
1em
'
})
.
hide
()
.
append
(
$
(
'
<span>
'
)
.
css
({
'
position
'
:
'
relative
'
,
'
top
'
:
'
0.17em
'
})
.
text
(
'
Draft Saved
'
));
el
.
closest
(
'
form
'
).
append
(
$
(
'
<input type="hidden" name="draft_id"/>
'
));
el
.
closest
(
'
form
'
).
append
(
$
(
'
<input type="hidden" name="draft_id"/>
'
));
if
(
el
.
hasClass
(
'
draft-delete
'
))
{
draft_saved
.
append
(
$
(
'
<span>
'
)
.
addClass
(
'
action-button
'
)
.
click
(
function
()
{
el
.
redactor
(
'
deleteDraft
'
);
return
false
;
})
.
append
(
$
(
'
<i>
'
)
.
addClass
(
'
icon-trash
'
)
)
);
}
el
.
parent
().
css
(
'
position
'
,
'
relative
'
);
draft_saved
.
insertBefore
(
el
);
options
[
'
plugins
'
].
push
(
'
draft
'
);
options
[
'
plugins
'
].
push
(
'
draft
'
);
if
(
el
.
data
(
'
draftNamespace
'
))
options
.
draftDelete
=
el
.
hasClass
(
'
draft-delete
'
);
options
[
'
draft_namespace
'
]
=
el
.
data
(
'
draftNamespace
'
);
if
(
el
.
data
(
'
draftObjectId
'
))
options
[
'
draft_object_id
'
]
=
el
.
data
(
'
draftObjectId
'
);
}
}
el
.
redactor
(
options
);
el
.
redactor
(
options
);
},
},
...
...
This diff is collapsed.
Click to expand it.
scp/css/scp.css
+
9
−
0
View file @
9dfecadc
...
@@ -1817,3 +1817,12 @@ table.custom-info td {
...
@@ -1817,3 +1817,12 @@ table.custom-info td {
.ui-datepicker
{
.ui-datepicker
{
z-index
:
100
!important
;
z-index
:
100
!important
;
}
}
.draft-saved
{
background-color
:
black
;
background-color
:
rgba
(
0
,
0
,
0
,
0.7
);
color
:
white
;
padding
:
4px
8px
6px
;
border-radius
:
3px
;
text-shadow
:
0
-1px
0
rgba
(
0
,
0
,
0
,
0.25
);
line-height
:
14px
;
}
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