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
mahara
mahara
Commits
af028885
Commit
af028885
authored
Mar 15, 2017
by
Robert Lyon
Committed by
Gerrit Code Review
Mar 15, 2017
Browse files
Merge "Bug1670900: cant upload image"
parents
6957a254
7445e00a
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/js/filebrowser.js
View file @
af028885
...
...
@@ -44,7 +44,10 @@ var FileBrowser = (function($) {
};
this
.
submitform
=
function
()
{
$
(
self
.
form
).
triggerHandler
(
'
submit
'
);
// for some reason tinymce throws error when use native submit..
// introducing custom event and catching it in pieform solves the problem...
// TODO: fileuploader should be refactored in a nicer way
$
(
self
.
form
).
triggerHandler
(
'
onsubmit
'
);
self
.
form
.
submit
();
};
...
...
htdocs/js/tinymce/plugins/imagebrowser/plugin.js
View file @
af028885
...
...
@@ -181,10 +181,8 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
jQuery
(
browser
).
removeClass
(
'
hidden
'
);
(
function
(
$
)
{
// configblock.javascript might use MochiKit so $ must have its default value
eval
(
configblock
.
data
.
javascript
);
})(
getElement
);
// execute additional js for the config block
eval
(
configblock
.
data
.
javascript
);
if
(
deletebutton
.
length
)
{
deletebutton
.
focus
();
...
...
htdocs/lib/form/elements/filebrowser.php
View file @
af028885
...
...
@@ -185,7 +185,7 @@ function pieform_element_filebrowser(Pieform $form, $element) {
$_PIEFORM_FILEBROWSERS
[
$prefix
][
'views_js'
]
=
$initjs
;
$initjs
.
=
"jQuery(
{
$prefix
}
.init);"
;
$initjs
.
=
"jQuery(
window).load(
{
$prefix
}
.init);"
;
$initjs
.
=
"upload_max_filesize = '"
.
get_real_size
(
ini_get
(
'upload_max_filesize'
))
.
"';"
;
if
(
$form
->
is_submitted
()
&&
$form
->
has_errors
())
{
// need to reapply bootstrap file browser stuff
...
...
htdocs/lib/pieforms/static/core/pieforms.js
View file @
af028885
...
...
@@ -147,6 +147,9 @@ var Pieform = (function($) {
}
$
(
'
#
'
+
self
.
data
.
name
).
on
(
'
submit
'
,
self
.
processForm
);
// this is custom event that is triggered by filebrowser.js on form submit
$
(
'
#
'
+
self
.
data
.
name
).
on
(
'
onsubmit
'
,
self
.
processForm
);
self
.
connectSubmitButtons
();
// Hook for pieform elements that need to execute Javascript
...
...
htdocs/lib/web.php
View file @
af028885
...
...
@@ -223,6 +223,7 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
if
(
!
$found_tinymce
)
{
$found_tinymce
=
$check
[
$key
];
$javascript_array
[]
=
$wwwroot
.
'artefact/file/js/filebrowser.js'
;
$javascript_array
[]
=
$jsroot
.
'switchbox.js'
;
$javascript_array
[]
=
$jsroot
.
'tinymce/tinymce.js'
;
$stylesheets
=
array_merge
(
$stylesheets
,
array_reverse
(
array_values
(
$THEME
->
get_url
(
'style/tinymceskin.css'
,
true
))));
$content_css
=
json_encode
(
$THEME
->
get_url
(
'style/tinymce.css'
));
...
...
htdocs/theme/raw/plugintype/artefact/file/templates/form/editfile.tpl
View file @
af028885
...
...
@@ -76,19 +76,19 @@
<span
class=
"state-label on"
role=
"presentation"
aria-hidden=
"true"
tabindex=
"-1"
>
{
str
tag
=
switchbox
.
on
section
=
pieforms
}
</span>
<span
class=
"state-label off"
role=
"presentation"
aria-hidden=
"true"
tabindex=
"-1"
>
{
str
tag
=
switchbox
.
off
section
=
pieforms
}
<span>
</label>
</div>
</div>
<script
type=
"application/javascript"
>
Switchbox
.
computeWidth
(
"
{
$prefix
}
_edit_allowcomments
"
);
</script>
</div>
<div>
<div
class=
"submitcancel form-group"
>
<input
type=
"submit"
class=
"submit btn btn-primary"
name=
"
{
$prefix
}
_update[
{
$fileinfo
->
id
}
]"
id=
"
{
$prefix
}
_edit_artefact"
value=
"
{
str
tag
=
savechanges
section
=
artefact
.
file
}
"
/>
<input
type=
"submit"
class=
"cancel"
name=
"
{
$prefix
}
_canceledit"
id=
"
{
$prefix
}
_edit_cancel"
value=
"
{
str
tag
=
cancel
}
"
/>
<script
type=
"application/javascript"
>
Switchbox
.
computeWidth
(
"
{
$prefix
}
_edit_allowcomments
"
);
</script>
</div>
<div>
<div
id=
"
{
$prefix
}
_edit_messages"
>
<div
class=
"submitcancel form-group"
>
<input
type=
"submit"
class=
"submit btn btn-primary"
name=
"
{
$prefix
}
_update[
{
$fileinfo
->
id
}
]"
id=
"
{
$prefix
}
_edit_artefact"
value=
"
{
str
tag
=
savechanges
section
=
artefact
.
file
}
"
/>
<input
type=
"submit"
class=
"cancel"
name=
"
{
$prefix
}
_canceledit"
id=
"
{
$prefix
}
_edit_cancel"
value=
"
{
str
tag
=
cancel
}
"
/>
</div>
<div>
<div
id=
"
{
$prefix
}
_edit_messages"
>
</div>
</div>
</div>
</div>
</td>
</tr>
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