Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ module.exports = function( grunt ) {
tasks: [ 'autoprefixer', 'cssmin' ]
},
js: {
files: [ '<%= uglify.backend.src %>' ],
files: [
'<%= uglify.backend.src %>',
'<%= uglify.footer.src %>',
],
tasks: [ 'uglify' ]
}
},
Expand Down
2 changes: 1 addition & 1 deletion admin/js/build/rt-transcoder-block-editor-support.build.js

Large diffs are not rendered by default.

58 changes: 13 additions & 45 deletions admin/js/rt-transcoder-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,24 @@
'click',
'#api-key-submit',
function( e ) {
e.preventDefault();

if ( $( this ).next( 'img' ).length === 0 ) {
$( this ).after( $( '<img/>' ).attr( 'src', rt_transcoder_script.loader_image ).addClass( 'rtt-loader' ) );
}

var data = {
action: 'rt_enter_api_key',
apikey: $( '#new-api-key' ).val()
};

// Since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php.
$.getJSON(
ajaxurl,
data,
function( response ) {
var apikey = document.getElementById( 'new-api-key' ).value;

var tempUrl = window.location.href;
var hash = window.location.hash;
if ( ! apikey ) {

if ( response.error === undefined && response.apikey ) {
$( '#api-key-error' ).remove();

tempUrl = tempUrl.replace( hash, '' );

if ( -1 === tempUrl.toString().indexOf( '&apikey=' + response.apikey ) ) {
tempUrl += '&apikey=' + response.apikey;
}

if ( -1 === tempUrl.toString().indexOf( '&update=true' ) ) {
tempUrl += '&update=true';
}

document.location.href = tempUrl + hash;
} else {
$( '#api-key-error' ).remove();

var error_div = $(
'<div/>',
{
id: 'api-key-error',
class: 'error'
}
);

$( 'h1:first' ).after( error_div.html( $( '<p/>' ).text( response.error ) ) ); // phpcs:ignoe WordPressVIPMinimum.JS.HTMLExecutingFunctions.html
var error_div = $(
'<div/>',
{
id: 'api-key-error',
class: 'error'
}
);

$( '#api-key-submit' ).next( 'img' ).remove();
}
);
$( 'h1:first' ).after( error_div.html( $( '<p/>' ).text( rt_transcoder_script.error_empty_key ) ) );

e.preventDefault();
}
}
);

Expand Down
2 changes: 1 addition & 1 deletion admin/js/rt-transcoder-admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions admin/js/rt-transcoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
check_status_element.hide();
}

span_status_element.html( obj.message );
span_status_element.text( obj.message );
span_status_element.show();
check_status_element.html( btn_text );
check_status_element.text( btn_text );
check_status_element.prop( 'disabled', false );
} );
} );
Expand Down
2 changes: 1 addition & 1 deletion admin/js/rt-transcoder.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* @package Transcoder
*/

!function(a){a(document).ready(function(){transcoding_status.load_flag&&a('[name="check_status_btn"]').live("click",function(b){var c=a(this).data("value"),d=a("#btn_check_status"+c).text();a("#span_status"+c).html(""),a("#btn_check_status"+c).html("Checking..."),a("#span_status"+c).hide(),a("#btn_check_status"+c).prop("disabled",!0);var e={action:"checkstatus",postid:c,security:transcoding_status.security_nonce};jQuery.post(ajaxurl,e,function(b){var e=jQuery.parseJSON(b.replace(/&quot;/g,'"'));"Success"===e.status&&a("#btn_check_status"+c).hide(),a("#span_status"+c).html(e.message),a("#span_status"+c).show(),a("#btn_check_status"+c).html(d),a("#btn_check_status"+c).prop("disabled",!1)})})})}(jQuery);
!function(a){a(document).ready(function(){transcoding_status.load_flag&&a('[name="check_status_btn"]').live("click",function(b){var c=a(this).data("value"),d=a("#btn_check_status"+c).text(),e=a("#span_status"+c),f=a("#btn_check_status"+c);e.text(""),f.text("Checking..."),e.hide(),f.prop("disabled",!0);var g={action:"checkstatus",postid:c,security:transcoding_status.security_nonce};jQuery.post(ajaxurl,g,function(a){var b=jQuery.parseJSON(a.replace(/&quot;/g,'"'));"Success"===b.status&&f.hide(),e.text(b.message),e.show(),f.text(d),f.prop("disabled",!1)})})})}(jQuery);
12 changes: 8 additions & 4 deletions admin/partials/rt-transcoder-admin-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @subpackage Transcoder/Admin/Partials
*/

$current_page = transcoder_filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
?>
<div class="wrap">
<h1 class="rtm-option-title">
Expand All @@ -23,18 +24,21 @@
</h1>
<div id="rtt-settings_updated" class="updated settings-error notice is-dismissible hide">
<p></p>
<button type="button" class="notice-dismiss"><span
class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice', 'transcoder' ); ?>.</span>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice', 'transcoder' ); ?>.</span>
</button>
</div>
<div class="transcoder-settings-boxes-wrapper">
<div id="transcoder-settings-boxes" class="transcoder-settings-boxes-container transcoder-setting-container">
<p>
<form method="get" action="/wp-admin/admin.php">
<label for="new-api-key">
<?php esc_html_e( 'Enter License Key', 'transcoder' ); ?>
</label>
<input id="new-api-key" type="text" name="new-api-key" value="<?php echo esc_attr( $this->stored_api_key ); ?>" size="60"/>
<input type="submit" id="api-key-submit" name="api-key-submit" value="<?php echo esc_attr__( 'Save Key', 'transcoder' ); ?>" class="button-primary"/>
<input type="hidden" name="page" value="<?php echo esc_attr( $current_page ); ?>">
<input id="new-api-key" type="text" name="apikey" value="<?php echo esc_attr( $this->stored_api_key ); ?>" size="60"/>
<button type="submit" id="api-key-submit" name="update" value="true" class="button-primary"><?php esc_html_e( 'Save Key', 'transcoder' ); ?></button>
</form>
</p>

<p>
Expand Down
1 change: 1 addition & 0 deletions admin/rt-transcoder-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public function enqueue_scripts_styles() {
'disable_encoding' => esc_html__( 'Are you sure you want to disable the transcoding service?', 'transcoder' ),
'enable_encoding' => esc_html__( 'Are you sure you want to enable the transcoding service?', 'transcoder' ),
'something_went_wrong' => esc_html__( 'Something went wrong. Please ', 'transcoder' ) . '<a href onclick="location.reload();">' . esc_html__( 'refresh', 'transcoder' ) . '</a>' . esc_html__( ' page.', 'transcoder' ),
'error_empty_key' => esc_html__( 'Please enter the license key.', 'transcoder' ),
);

wp_localize_script( 'rt-transcoder-main', 'rt_transcoder_script', $localize_script_data );
Expand Down
Loading