Skip to content

Commit fb6a510

Browse files
Merge pull request #106 from humanmade/removes-line-breaks-spaces
Removes line breaks and spaces from inline js
2 parents c3705d4 + 2514df1 commit fb6a510

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

assets/csr.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
setTimeout( function () {
2+
document.getElementById( 'sso_form' ).submit();
3+
}, 100 );

inc/namespace.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -670,15 +670,14 @@ function cross_site_sso_redirect( $url ) {
670670
do_action( 'wpsimplesaml_cross_sso_form_inputs' );
671671
?>
672672
</form>
673-
<?php // @codingStandardsIgnoreEnd ?>
674-
675-
<script>
676-
setTimeout( function () {
677-
document.getElementById( 'sso_form' ).submit();
678-
}, 100 );
679-
</script>
680-
681-
<?php
673+
<?php
674+
wp_enqueue_script(
675+
'wp-simple-saml-csr',
676+
plugins_url( '/assets/csr.js', PLUGIN_FILE ),
677+
[],
678+
null
679+
);
680+
print_footer_scripts();
682681
exit;
683682
}
684683

plugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
use WP_CLI;
3333

34+
const PLUGIN_FILE = __FILE__;
35+
3436
require_once __DIR__ . '/inc/namespace.php';
3537
require_once __DIR__ . '/inc/admin/namespace.php';
3638

0 commit comments

Comments
 (0)