You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							45 lines
						
					
					
						
							1.6 KiB
						
					
					
				
			
		
		
	
	
							45 lines
						
					
					
						
							1.6 KiB
						
					
					
				<div class="text-center">
 | 
						|
    <p>{{ 'YouNeedToIdentifyYourselfToAnswerThisQuestion'|get_plugin_lang('WhispeakAuthPlugin') }}</p>
 | 
						|
 | 
						|
    <button type="button" class="btn btn-info" id="whispeak-question-{{ question }}" data-loading-text="{{ 'PleaseWaitWhileLoading'|get_plugin_lang('WhispeakAuthPlugin')|escape('html') }}">
 | 
						|
        {{ 'IdentifyMe'|get_plugin_lang('WhispeakAuthPlugin') }}
 | 
						|
    </button>
 | 
						|
</div>
 | 
						|
 | 
						|
<script>
 | 
						|
    $(function () {
 | 
						|
        function loadAuth() {
 | 
						|
            var $btnTrigger = $('#whispeak-question-{{ question }}'),
 | 
						|
                originalText = $btnTrigger.text(),
 | 
						|
                $modal = $('#global-modal'),
 | 
						|
                $modalTitle = $modal.find('.modal-title'),
 | 
						|
                $modalBody = $modal.find('.modal-body'),
 | 
						|
                $originalLoadingText = $btnTrigger.data('loading-text');
 | 
						|
 | 
						|
            $btnTrigger.text($originalLoadingText).prop('disabled', true);
 | 
						|
 | 
						|
            $modalTitle.text($originalLoadingText);
 | 
						|
            $modalBody.html('');
 | 
						|
            $modal.modal('show');
 | 
						|
 | 
						|
            $
 | 
						|
                .ajax({
 | 
						|
                    url: _p.web_plugin + 'whispeakauth/authentify.php'
 | 
						|
                })
 | 
						|
                .then(function (response) {
 | 
						|
                    $modalBody.html(response);
 | 
						|
 | 
						|
                    $modalTitle.text('{{ 'plugin_title'|get_plugin_lang('WhispeakAuthPlugin') }}');
 | 
						|
                    $btnTrigger.text(originalText).prop('disabled', false);
 | 
						|
                });
 | 
						|
        }
 | 
						|
 | 
						|
        $('#whispeak-question-{{ question }}').on('click', function (e) {
 | 
						|
            e.preventDefault();
 | 
						|
 | 
						|
            loadAuth();
 | 
						|
        });
 | 
						|
 | 
						|
        loadAuth();
 | 
						|
    });
 | 
						|
</script>
 | 
						|
 |