Browse Source

Merge pull request 'Move upload-selection.js call inline' (#60) from upload-selection-inline into config

Reviewed-on: #60
pull/61/head
discomrade 1 year ago
parent
commit
0eeb42b3ce
  1. 6
      js/upload-selection.js
  2. 6
      templates/post_form.html

6
js/upload-selection.js

@ -9,10 +9,10 @@
* $config['additional_javascript'][] = 'js/jquery.min.js';
* //$config['additional_javascript'][] = 'js/wpaint.js';
* $config['additional_javascript'][] = 'js/upload-selection.js';
*
*
*/
$(function(){
function init_upload_selection(){
var enabled_file = true;
var enabled_url = $("#upload_url").length > 0;
var enabled_embed = $("#upload_embed").length > 0;
@ -84,4 +84,4 @@ $(function(){
enable_file();
}
});
}

6
templates/post_form.html

@ -148,7 +148,10 @@
<td class="upload-area">
<input type="file" name="file" id="upload_file">
{% if 'js/file-selector.js' in config.additional_javascript %}
<script type="text/javascript">if (typeof init_file_selector !== 'undefined') init_file_selector({{ config.max_images }});</script>
{% endif %}
{% if config.allow_upload_by_url %}
<div style="float:none;text-align:left" id="upload_url">
@ -210,6 +213,9 @@
<input type="hidden" name="hash" value="{{ antibot.hash() }}">
</form>
{% if 'js/upload-selection.js' in config.additional_javascript %}
<script type="text/javascript">if (typeof init_upload_selection !== 'undefined') init_upload_selection();</script>
{% endif %}
<script type="text/javascript">{% raw %}
rememberStuff();
{% endraw %}</script>

Loading…
Cancel
Save