Changeset 6663
- Timestamp:
- 08/20/2017 09:41:37 PM (7 years ago)
- Location:
- trunk/src/includes/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/assets/js/converter.js
r6636 r6663 80 80 81 81 if ( values['_bbp_converter_delay_time'] ) { 82 BBP_Converter. delay = parseInt( values['_bbp_converter_delay_time'], 10 ) * 1000;82 BBP_Converter.state.delay = parseInt( values['_bbp_converter_delay_time'], 10 ) * 1000; 83 83 } 84 84 … … 129 129 130 130 // Bail if not running 131 if ( ! BBP_Converter. running ) {131 if ( ! BBP_Converter.state.running ) { 132 132 return; 133 133 } … … 155 155 */ 156 156 function bbp_converter_wait() { 157 clearTimeout( BBP_Converter. running );157 clearTimeout( BBP_Converter.state.running ); 158 158 159 159 // Bail if not running 160 if ( ! BBP_Converter. running ) {160 if ( ! BBP_Converter.state.running ) { 161 161 return; 162 162 } 163 163 164 164 // Wait, then POST 165 BBP_Converter. running = setTimeout( function() {165 BBP_Converter.state.running = setTimeout( function() { 166 166 bbp_converter_post(); 167 }, parseInt( BBP_Converter. delay, 10 ) );167 }, parseInt( BBP_Converter.state.delay, 10 ) ); 168 168 } 169 169 … … 176 176 */ 177 177 function bbp_converter_start() { 178 clearTimeout( BBP_Converter. running );179 clearInterval( BBP_Converter.stat us );180 181 BBP_Converter. running = true;178 clearTimeout( BBP_Converter.state.running ); 179 clearInterval( BBP_Converter.state.status ); 180 181 BBP_Converter.state.running = true; 182 182 183 183 var log = BBP_Converter.strings.start_continue; 184 if ( BBP_Converter.started ) {184 if ( false === BBP_Converter.state.started ) { 185 185 log = BBP_Converter.strings.start_start; 186 BBP_Converter.sta rted = true;186 BBP_Converter.state.started = true; 187 187 } 188 188 … … 211 211 */ 212 212 function bbp_converter_stop( button, log ) { 213 clearTimeout( BBP_Converter. running );214 clearInterval( BBP_Converter.stat us );215 216 BBP_Converter. running = false;217 BBP_Converter.stat us = false;213 clearTimeout( BBP_Converter.state.running ); 214 clearInterval( BBP_Converter.state.status ); 215 216 BBP_Converter.state.running = false; 217 BBP_Converter.state.status = false; 218 218 219 219 if ( ! button ) { … … 262 262 */ 263 263 function bbp_converter_status( data ) { 264 var remaining = parseInt( BBP_Converter. delay, 10 ) / 1000;264 var remaining = parseInt( BBP_Converter.state.delay, 10 ) / 1000; 265 265 266 266 status.text( BBP_Converter.strings.status_counting.replace( '%s', remaining ) ); 267 clearInterval( BBP_Converter.stat us );268 269 BBP_Converter.stat us = setInterval( function() {267 clearInterval( BBP_Converter.state.status ); 268 269 BBP_Converter.state.status = setInterval( function() { 270 270 remaining--; 271 271 status.text( BBP_Converter.strings.status_counting.replace( '%s', remaining ) ); 272 272 273 273 if ( remaining <= 0 ) { 274 clearInterval( BBP_Converter.stat us );274 clearInterval( BBP_Converter.state.status ); 275 275 276 276 if ( parseInt( data.current_step, 10 ) < parseInt( data.final_step, 10 ) ) { -
trunk/src/includes/admin/classes/class-bbp-converter.php
r6661 r6663 128 128 wp_localize_script( 'bbp-converter', 'BBP_Converter', array( 129 129 130 // Vars130 // Nonce 131 131 'ajax_nonce' => wp_create_nonce( 'bbp_converter_process' ), 132 'delay' => (int) get_option( '_bbp_converter_delay_time', 2 ), 133 'running' => false, 134 'status' => false, 135 'started' => (bool) get_option( '_bbp_converter_step', 0 ), 132 133 // UI State 134 'state' => array( 135 'delay' => (int) get_option( '_bbp_converter_delay_time', 2 ), 136 'started' => (bool) get_option( '_bbp_converter_step', 0 ), 137 'running' => false, 138 'status' => false 139 ), 136 140 137 141 // Strings 138 'strings' 142 'strings' => array( 139 143 140 144 // Button text
Note: See TracChangeset
for help on using the changeset viewer.