Skip to content

Commit

Permalink
Merge pull request #14 from chad1008/v2-beta
Browse files Browse the repository at this point in the history
Merge v2 beta fixes
  • Loading branch information
chad1008 authored Mar 23, 2021
2 parents e1bd890 + c6350fb commit 2954014
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/classes/class-workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ public function add_gif( $input ) {
'next_step' => is_valid_url( $input ) ? 'gif_name' : 'gif_url',
'standby_title' => 'Saving your GIF...',
'standby_text' => 'This should only take a moment, please stand by',
'original_input' => '',
),
);
}
Expand Down Expand Up @@ -614,7 +615,8 @@ public function launch_editor( $the_gif ) {
),
'variables' => array(
'next_step' => 'save_gif',
'external' => 'search',
'trash_mode' => 'true',
'external' => 'restart',
'notification_title' => "GIF trashed!",
'notification_text' => '"' . $the_gif->name . '" will be permanently deleted in 30 days.',
'exit' => 'false',
Expand Down
6 changes: 3 additions & 3 deletions src/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@

// If this is the manage_tags step, output the tag management interface
} elseif ( 'manage_tags' === $flow->next_step ) {
// Alert if input is provided
$flow->alert_select_option( $input );

// If the current GIF has no tags, skip ahead to the adding tags interface
if ( empty( $the_gif->tags ) ) {
$flow->add_tags( $input, $the_gif, $tags );
} else {
// Alert if input is provided
$flow->alert_select_option( $input );

$flow->launch_tag_management();
}

Expand Down
14 changes: 5 additions & 9 deletions src/save.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
// If the current item is a GIF, enter the GIF saving flow
if ( is_gif() ) {
// If the selected item is an existing GIF, query it using the ID
if (false != $flow->item_id) {
if ( false != $flow->item_id ) {
$the_gif = new GIF( $flow->item_id );

// Otherwise, initialize a new, empty GIF object
// Otherwise, initialize a new, empty GIF object
} else {
$the_gif = new GIF();

// Stage the date for saving later
$the_gif->new_props['date'] = date('F d, Y');
$the_gif->new_props['date'] = date( 'F d, Y' );
}

// If this GIF was marked to be trashed, trash it
if ('true' === $flow->trash_mode) {
if ( 'true' === $flow->trash_mode ) {
// Trash the GIF
$the_gif->trash();

Expand Down Expand Up @@ -61,7 +60,6 @@
// Output workflow configuration
$flow->output_config( 'save_gif', $the_gif );
}

// If the current item is a tag, enter the tag saving flow
} elseif ( is_tag() ) {
$the_tag = new Tag( $flow->item_id );
Expand All @@ -70,8 +68,7 @@
if ( 'true' === $flow->confirmed_delete ) {

$the_tag->delete();

// Otherwise, proceed with updating the tag
// Otherwise, proceed with updating the tag
} else {
// Set the tag's new name
$the_tag->new_name = $flow->tag_name;
Expand All @@ -82,7 +79,6 @@

// Output workflow configuration
$flow->output_config( 'save_tag' );

// If the selected item was neither a GIF or a tag, abandon all hope
} else {
// Output workflow error configuration
Expand Down

0 comments on commit 2954014

Please sign in to comment.