Dependency based script loading
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ( ISQ::$general['clipboard'] && in_array( 'ZeroClipboard', $dependencies ) ) { ?>
|
<?php if ( in_array( 'ZeroClipboard', $dependencies ) ) { ?>
|
||||||
<script type="text/javascript" src="public/ZeroClipboard/ZeroClipboard.min.js"></script>
|
<script type="text/javascript" src="public/ZeroClipboard/ZeroClipboard.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
ZeroClipboard.config({
|
ZeroClipboard.config({
|
||||||
@@ -30,6 +30,10 @@
|
|||||||
event.target.innerHTML = copied;
|
event.target.innerHTML = copied;
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
|
<?php }
|
||||||
|
|
||||||
|
if ( in_array( 'reCAPTCHA', $dependencies ) ) { ?>
|
||||||
|
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ isq_load_textdomain();
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic"><!-- Ubuntu from Google Web Fonts -->
|
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic"><!-- Ubuntu from Google Web Fonts -->
|
||||||
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/style.css" /><!-- Theme CSS -->
|
<link rel="stylesheet" href="<?php echo YOURLS_SITE; ?>/public/style.css" /><!-- Theme CSS -->
|
||||||
<script src='https://www.google.com/recaptcha/api.js'></script><!-- reCAPTCHA -->
|
|
||||||
|
|
||||||
<!-- App icons generated using http://realfavicongenerator.net -->
|
<!-- App icons generated using http://realfavicongenerator.net -->
|
||||||
<link rel="apple-touch-icon" sizes="57x57" href="public/images/app-icons/apple-touch-icon-57x57.png">
|
<link rel="apple-touch-icon" sizes="57x57" href="public/images/app-icons/apple-touch-icon-57x57.png">
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ( !empty(ISQ::$recaptcha['sitekey']) && !empty(ISQ::$recaptcha['secret']) ) {
|
if ( !empty(ISQ::$recaptcha['sitekey']) && !empty(ISQ::$recaptcha['secret']) ) {
|
||||||
|
$dependencies[] = 'reCAPTCHA';
|
||||||
?>
|
?>
|
||||||
<div class="form-item recaptcha-container">
|
<div class="form-item recaptcha-container">
|
||||||
<p><label class="primary" title=""><?php yourls_e( 'Verification', 'isq_translation'); ?></label></p>
|
<p><label class="primary" title=""><?php yourls_e( 'Verification', 'isq_translation'); ?></label></p>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
$dependencies = array( 'ZeroClipboard' );
|
$dependencies = array();
|
||||||
|
|
||||||
include('header.php');
|
include('header.php');
|
||||||
|
|
||||||
|
if ( ISQ::$general['clipboard'] ) {
|
||||||
|
$dependencies[] = 'ZeroClipboard';
|
||||||
|
};
|
||||||
|
|
||||||
function display_error($message) {
|
function display_error($message) {
|
||||||
echo '<div class="content"><p class="error">' . $message . '</p></div>';
|
echo '<div class="content"><p class="error">' . $message . '</p></div>';
|
||||||
include('footer.php');
|
include('footer.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user