Browse Source

Call upload-selection.js inline

Makes the change happen earlier, reducing content shift
pull/60/head
discomrade 2 years ago
parent
commit
e1b83ec548
  1. 6
      js/upload-selection.js
  2. 3
      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();
}
});
}

3
templates/post_form.html

@ -210,6 +210,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