add buttons to submit editor
This commit is contained in:
parent
5ab3047bd2
commit
2eac8f71dc
|
@ -23,7 +23,7 @@
|
|||
$language_options->get_language_name($transcript['language'])
|
||||
)
|
||||
?></p>
|
||||
<div class="queued-transcription"><?php echo $transcript['transcript'] ?></div>
|
||||
<div class="queued-transcription transcript"><?php echo do_shortcode($transcript['transcript']) ?></div>
|
||||
<div class="queued-transcription-raw" style="display:none"><?php echo $transcript['transcript'] ?></div>
|
||||
<div style="padding: 10px 0">
|
||||
<a href="#" class="approve-transcript button">Approve</a>
|
||||
|
@ -54,7 +54,7 @@
|
|||
foreach ($approved_transcripts as $transcript) {
|
||||
if ($transcript['language'] == $code) { $approved_transcript_text = $transcript['transcript']; break; }
|
||||
} ?>
|
||||
<textarea class="edit-transcript" id="wdts-transcripts-<?php echo $code ?>" name="wdts[transcripts][<?php echo $code ?>]" style="display: none; width: 100%; height: 200px"><?php echo $approved_transcript_text ?></textarea>
|
||||
<textarea class="edit-transcript" id="wdts-transcripts-<?php echo $code ?>" name="wdts[transcripts][<?php echo $code ?>]" style="display: none; width: 95%; height: 200px"><?php echo $approved_transcript_text ?></textarea>
|
||||
<?php } ?>
|
||||
</p>
|
||||
|
||||
|
|
|
@ -27,10 +27,16 @@ var WDTSInjector = Class.create({
|
|||
}
|
||||
});
|
||||
|
||||
$$('#wdts-shorttags button').each(function(b) {
|
||||
Event.observe(window, 'load', function() {
|
||||
[
|
||||
[ '#wdts-shorttags button', $("wdts-transcripts-" + $F('wdts-language')) ],
|
||||
[ '#wdts-submit-shorttags button', $('wdts-transcript') ]
|
||||
].each(function(info) {
|
||||
$$(info[0]).each(function(b) {
|
||||
top.console.log(b);
|
||||
b.observe('click', function(e) {
|
||||
Event.stop(e);
|
||||
var current_transcript = $("wdts-transcripts-" + $F('wdts-language'));
|
||||
var current_transcript = info[1];
|
||||
if (current_transcript) {
|
||||
if (document.selection) {
|
||||
var range = document.selection.createRange();
|
||||
|
@ -87,6 +93,8 @@ $$('#wdts-shorttags button').each(function(b) {
|
|||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$$('.approve-transcript').each(function(b) {
|
||||
b.observe('click', function(e) {
|
||||
|
|
|
@ -153,8 +153,8 @@ function transcripts_display($dropdown_message = null, $single_language_message
|
|||
|
||||
if (count($transcripts) == 1) {
|
||||
list($code, $transcript) = each($transcripts);
|
||||
$output[] = apply_filters('the_language_name', get_the_language_name($code));
|
||||
$output[] = apply_filters('the_media_transcript', $transcript);
|
||||
$output[] = end(apply_filters('the_language_name', get_the_language_name($code)));
|
||||
$output[] = end(apply_filters('the_media_transcript', $transcript));
|
||||
} else {
|
||||
$output[] = $dropdown_message;
|
||||
$output[] = '<select>';
|
||||
|
@ -165,8 +165,8 @@ function transcripts_display($dropdown_message = null, $single_language_message
|
|||
}
|
||||
$output[] = '</select>';
|
||||
foreach ($transcripts as $code => $transcript) {
|
||||
$language_name = apply_filters('the_language_name', get_the_language_name($code));
|
||||
$transcript = apply_filters('the_media_transcript', $transcript);
|
||||
$language_name = end(apply_filters('the_language_name', get_the_language_name($code)));
|
||||
$transcript = end(apply_filters('the_media_transcript', $transcript));
|
||||
|
||||
$output[] = '<div '
|
||||
. (($code == $default_language) ? 'style="display:none"' : '')
|
||||
|
@ -215,13 +215,13 @@ function the_media_transcript_queue_editor() {
|
|||
<?php if (current_user_can('approve_transcriptions')) { ?>
|
||||
<h3><?php _e('Manage Transcripts:', 'what-did-they-say') ?></h3>
|
||||
<form method="post" class="transcript-editor">
|
||||
<?php include(dirname(__FILE__) . '/classes/meta-box.inc') ?>
|
||||
<?php include(dirname(__FILE__) . '/classes/partials/meta-box.inc') ?>
|
||||
<input type="submit" value="Modify Transcript" />
|
||||
</form>
|
||||
<?php } ?>
|
||||
<?php if (current_user_can('submit_transcriptions')) { ?>
|
||||
<?php if ($transcript_options->are_new_transcripts_allowed()) { ?>
|
||||
<h3><?php _e('Submit a new transcript:', 'what-did-they-say') ?></h3>
|
||||
<h3 style="margin-top: 0.5em"><?php _e('Submit a new transcript:', 'what-did-they-say') ?></h3>
|
||||
<form method="post" class="transcript-editor">
|
||||
<input type="hidden" name="wdts[_nonce]" value="<?php echo wp_create_nonce('what-did-they-say') ?>" />
|
||||
<input type="hidden" name="wdts[module]" value="queue-transcript" />
|
||||
|
@ -234,10 +234,14 @@ function the_media_transcript_queue_editor() {
|
|||
<?php } ?>
|
||||
</select>
|
||||
</label><br />
|
||||
<label>
|
||||
<?php _e('Transcription:', 'what-did-they-say') ?><br />
|
||||
<textarea style="height: 200px; width: 90%" name="wdts[transcript]"></textarea>
|
||||
</label>
|
||||
<?php _e('Transcript:', 'what-did-they-say') ?><br />
|
||||
<div id="wdts-submit-shorttags">
|
||||
<button class="wdts-create" id="wdts-scene-heading">Scene Heading</button>
|
||||
<button class="wdts-create" id="wdts-scene-action">Scene Action</button>
|
||||
<button class="wdts-create" id="wdts-dialog">Dialog</button>
|
||||
</div>
|
||||
|
||||
<textarea style="height: 200px; width: 90%" id="wdts-transcript" name="wdts[transcript]"></textarea>
|
||||
<input type="submit" value="<?php _e('Submit For Approval', 'what-did-they-say') ?>" />
|
||||
<?php } ?>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue