Changeset 2158071
- Timestamp:
- 09/17/2019 08:06:37 PM (7 years ago)
- Location:
- sequence-animation/trunk
- Files:
-
- 5 edited
-
index.php (modified) (4 diffs)
-
js/anim_editor_class.js (modified) (11 diffs)
-
js/script.js (modified) (14 diffs)
-
js/spfa_effects-md.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sequence-animation/trunk/index.php
r2156939 r2158071 4 4 Plugin URI: 5 5 Description: Animate your page elements by adding animation in sequence, click the 'Suquence animation' button on the admin bar and select the element to animate 6 Version: 1. 16 Version: 1.2 7 7 Author: Deimos Mavrozoumis 8 8 Author URI: https://plugfame.wordpress.com … … 10 10 /*******************Include required files*******************/ 11 11 wp_enqueue_script( 'jquery' ); 12 include_once plugin_dir_path(__FILE__) . 'classes/utilities.php';13 //include_once plugin_dir_path(__FILE__) . 'classes/admin.php';14 /******Create table for holding animation sequences**********/15 /******call classes and initialise them **********/16 $spfa_utilities= new nsspfa_utilities\utilities_class();17 $spfa_utilities->init();18 // $spfa_admin= new nsspfa_admin\admin_class();19 // $spfa_admin->init();20 12 21 13 //add table at activation … … 56 48 'ajaxurl' => admin_url( 'admin-ajax.php' ), 57 49 'pluginsLogo' => plugins_url( 'cooltext333758638913341.png', __FILE__), 58 'init_hidden_elements' => spfa_set_element_initial_visibility() )); 50 'init_hidden_elements' => spfa_set_element_initial_visibility() )); 51 52 wp_enqueue_script( 'spectrum_color_script', plugins_url('/js/spectrum.js', __FILE__ ), array('jquery') ); 53 wp_enqueue_script( 'tooltips_script', plugins_url('/js/tooltips.js', __FILE__ ), array('jquery') ); 54 wp_enqueue_script( 'selector_script', plugins_url('/css-selector-generator-master/build/css-selector-generator.js', __FILE__ ), array('jquery') ); 55 //add all the avaliable effects 56 wp_enqueue_script( 'jquery-ui-dialog' ); 57 wp_enqueue_script( 'jquery-ui-draggable'); 58 wp_enqueue_script( 'jquery-ui-sortable'); 59 wp_enqueue_script( 'jquery-effects-core'); 60 wp_enqueue_style( 'wp-jquery-ui-dialog' ); 61 wp_enqueue_style( 'spectrum_color_style', plugins_url('/css/spectrum.css', __FILE__ )); 62 wp_enqueue_style( 'Editor_box_style', plugins_url('/css/style.css', __FILE__ )); 63 59 64 } 60 65 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 186 191 return $links; 187 192 } 188 189 190 193 191 194 function spfa_display_database(){ -
sequence-animation/trunk/js/anim_editor_class.js
r2156925 r2158071 1392 1392 1393 1393 else if(effect=='spfa_move'){ 1394 jQuery(element).animate({ " left": `+=${args[`frame${i}option1`]}px`,"top": `+=${args[`frame${i}option2`]}px`},{duration:frame_time});1394 jQuery(element).animate({ "margin-left": `+=${args[`frame${i}option1`]}px`,"margin-top": `+=${args[`frame${i}option2`]}px`},frame_time); 1395 1395 } 1396 1396 … … 1407 1407 jQuery(element).css( "max-height", "none" ); 1408 1408 jQuery(element).css( "max-width", "none" ); 1409 jQuery(element).animate({' margin-top':`${calc_margin_top}px`,'margin-left':`${calc_margin_left}px`,'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:Number(args[`frame${i}msec`])});1409 jQuery(element).animate({'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:frame_time}); 1410 1410 } 1411 1411 //give a delay … … 1425 1425 else{ 1426 1426 if(effect!=null){ 1427 jQuery(element).spfa_effect( effect, {duration:frame_time ,complete:function(){classInstance.spfa_ui_effect_complete(element,args,counter);counter++;}} );1427 jQuery(element).spfa_effect( effect, {duration:frame_time} ); 1428 1428 } 1429 1429 } … … 1435 1435 } 1436 1436 else{ 1437 jQuery(args.item_id).queue(function() { 1438 var placeholder_element=jQuery(args.item_id); 1439 jQuery.spfa_effects.restoreStyle(placeholder_element); 1440 jQuery.spfa_effects.removePlaceholder(placeholder_element); 1441 console.log(args.item_id,'placeholder deleted') 1442 jQuery(args.item_id).dequeue(); 1443 }); 1444 } 1437 var temp_item = args.item_id; 1438 jQuery(args.item_id).queue(function(temp_item) { 1439 var placeholder_element=jQuery(temp_item); 1440 jQuery.spfa_effects.restoreStyle(placeholder_element,'absolute'); 1441 jQuery.spfa_effects.removePlaceholder(placeholder_element); 1442 console.log(args.item_id,'placeholder deleted') 1443 jQuery(args.item_id).dequeue(); 1444 }); 1445 } 1445 1446 } 1446 1447 … … 1465 1466 jQuery(element).queue(function(){ 1466 1467 jQuery(element).dequeue(); 1467 if(args[`frame${i}effect`]!='spfa_bounce' && args[`frame${i}effect`]!='spfa_shake'){ 1468 jQuery(element).animate({ "left": `+=${args[`frame${i}option3`]}px`,"top": `+=${args[`frame${i}option4`]}px`},{duration:frame_time,queue:false}); 1469 } 1470 else{ 1471 jQuery(element).animate({ "margin-left": `+=${args[`frame${i}option3`]}px`,"margin-top": `+=${args[`frame${i}option4`]}px`},{duration:frame_time,queue:false}); 1472 } 1468 jQuery(element).animate({ "margin-left": `+=${args[`frame${i}option3`]}px`,"margin-top": `+=${args[`frame${i}option4`]}px`},{duration:frame_time,queue:false}); 1473 1469 }); 1474 1470 } … … 1488 1484 var current_margin_top = parseInt(jQuery(args.item_id).css('margin-top').replace('px','')); 1489 1485 var calc_margin_top = current_margin_top+(current_height - calc_height)/2; 1490 jQuery(element).animate({' margin-top':`${calc_margin_top}px`,'margin-left':`${calc_margin_left}px`,'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:frame_time,queue:false});1486 jQuery(element).animate({'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:frame_time,queue:false}); 1491 1487 }); 1492 1488 } … … 1525 1521 || primary_and_secondary_effects_array.includes('spfa_rotate') 1526 1522 ){ 1527 setTimeout(function(){ 1523 var temp_item = args.item_id; 1524 setTimeout(function(temp_item){ 1528 1525 //remove placeholder and restore 1529 var placeholder_element=jQuery( args.item_id);1530 jQuery.spfa_effects.restoreStyle(placeholder_element );1526 var placeholder_element=jQuery(temp_item); 1527 jQuery.spfa_effects.restoreStyle(placeholder_element,args.init_css_position); 1531 1528 jQuery.spfa_effects.removePlaceholder(placeholder_element); 1532 1529 },1000); … … 1535 1532 //remove placeholder and restore 1536 1533 var placeholder_element=jQuery(args.item_id); 1537 jQuery.spfa_effects.restoreStyle(placeholder_element );1534 jQuery.spfa_effects.restoreStyle(placeholder_element,args.init_css_position); 1538 1535 jQuery.spfa_effects.removePlaceholder(placeholder_element); 1539 1536 } … … 1545 1542 1546 1543 else if(item=='spfa_move'){ 1547 jQuery(element).animate({ " left": `${args.init_pos.left}px`,"top": `${args.init_pos.top}px`},{duration: 1000,queue:false});1544 jQuery(element).animate({ "margin-left": `${args.init_margin_left}`,"margin-top": `${args.init_margin_top}`},{duration: 1000,queue:false}); 1548 1545 } 1549 1546 … … 1555 1552 var current_margin_top = parseInt(jQuery(element).css('margin-top').replace('px','')); 1556 1553 var calc_margin_top = current_margin_top+(current_height - args.init_height)/2; 1557 jQuery(element).animate({ ' margin-top':`${calc_margin_top}px`,'margin-left':`${calc_margin_left}px`,'width':`${args.init_width}px`,'height':`${args.init_height}px`,'fontSize':args.init_fontsize},{duration: 1000,queue:false});1554 jQuery(element).animate({ 'width':`${args.init_width}px`,'height':`${args.init_height}px`,'fontSize':args.init_fontsize},{duration: 1000,queue:false}); 1558 1555 } 1559 1556 … … 1564 1561 1565 1562 } 1566 spfa_ui_effect_complete(element,args,i){ 1567 if(args[`frame${i}effect2`]=='spfa_move' && (args[`frame${i}effect`]=='spfa_bounce' || args[`frame${i}effect`]=='spfa_shake')){ 1568 jQuery(element).css('left',`+=${args[`frame${i}option3`]}px`); 1569 jQuery(element).css('top',`+=${args[`frame${i}option4`]}px`); 1570 jQuery(element).css('margin-left',`${args.init_margin_left}`); 1571 jQuery(element).css('margin-top',`${args.init_margin_top}`); 1572 } 1573 } 1563 1574 1564 } -
sequence-animation/trunk/js/script.js
r2156925 r2158071 50 50 //select element 51 51 if(jQuery('#spfa_instruction_box').length && !(jQuery('#spfa_j_dialog').length) && !(e.target.id == "spfa_tabs_div") && !(jQuery(e.target).parents("#spfa_tabs_div").length) && !(e.target.id == "wpadminbar") && !(jQuery(e.target).parents("#wpadminbar").length) ){ 52 53 52 var elem = e.target || e.srcElement; 54 53 var selector = my_selector_generator.getSelector(elem); … … 105 104 classInstance.generate_box(classInstance.browser_localstorage('get'),e.pageX,e.pageY); 106 105 classInstance.init_tab(); 107 // //clear every queue108 // jQuery(selector).stop(true);109 // //turn on all effects110 // jQuery.fx.off=false;111 106 //create tooltips 112 107 spfa_create_tooltips() … … 166 161 //add a delay for not opening the editor box immediatly 167 162 setTimeout(function(){ 168 //turn off all effects169 // if (toggle_effect=='off'){170 // jQuery.fx.off=true;171 // }172 163 var frame = document.createElement('ifrmame'); 173 164 var box = document.createElement("div"); … … 367 358 else if(effect=='spfa_move'){ 368 359 jQuery(args.item_id).css( "transition", "none" ); 369 jQuery(args.item_id).animate({ " left": `+=${args[`frame${i}option1`]}px`,"top": `+=${args[`frame${i}option2`]}px`},Number(args[`frame${i}msec`]));360 jQuery(args.item_id).animate({ "margin-left": `+=${args[`frame${i}option1`]}px`,"margin-top": `+=${args[`frame${i}option2`]}px`},Number(args[`frame${i}msec`])); 370 361 } 371 362 … … 383 374 jQuery(args.item_id).css( "max-height", "none" ); 384 375 jQuery(args.item_id).css( "max-width", "none" ); 385 jQuery(args.item_id).animate({' margin-top':`${calc_margin_top}px`,'margin-left':`${calc_margin_left}px`,'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:Number(args[`frame${i}msec`])});376 jQuery(args.item_id).animate({'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:Number(args[`frame${i}msec`])}); 386 377 } 387 378 … … 409 400 if(effect!=null){ 410 401 jQuery(args.item_id).css( "transition", "none" ); 411 jQuery(args.item_id).spfa_effect( effect, {duration:Number(args[`frame${i}msec`]) ,complete:function(){ spfa_ui_effect_complete(args.item_id,args,counter);counter++;}} );402 jQuery(args.item_id).spfa_effect( effect, {duration:Number(args[`frame${i}msec`])} ); 412 403 413 404 } … … 429 420 jQuery(args.item_id).queue(function() { 430 421 var placeholder_element=jQuery(args.item_id); 431 jQuery.spfa_effects.restoreStyle(placeholder_element );422 jQuery.spfa_effects.restoreStyle(placeholder_element,'absolute'); 432 423 jQuery.spfa_effects.removePlaceholder(placeholder_element); 433 424 jQuery(args.item_id).dequeue(); … … 457 448 jQuery(element).queue(function(){ 458 449 jQuery(element).dequeue(); 459 if(args[`frame${i}effect`]!='spfa_bounce' && args[`frame${i}effect`]!='spfa_shake'){ 460 jQuery(element).animate({ "left": `+=${args[`frame${i}option3`]}px`,"top": `+=${args[`frame${i}option4`]}px`},{duration:frame_time,queue:false}); 461 } 462 else{ 463 jQuery(element).animate({ "margin-left": `+=${args[`frame${i}option3`]}px`,"margin-top": `+=${args[`frame${i}option4`]}px`},{duration:frame_time,queue:false}); 464 } 465 }); 466 450 jQuery(element).animate({ "margin-left": `+=${args[`frame${i}option3`]}px`,"margin-top": `+=${args[`frame${i}option4`]}px`},{duration:frame_time,queue:false}); 451 }); 467 452 } 468 453 … … 481 466 var current_margin_top = parseInt(jQuery(args.item_id).css('margin-top').replace('px','')); 482 467 var calc_margin_top = current_margin_top+(current_height - calc_height)/2; 483 jQuery(element).animate({' margin-top':`${calc_margin_top}px`,'margin-left':`${calc_margin_left}px`,'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:frame_time,queue:false});468 jQuery(element).animate({'width':calc_width,'height':calc_height,'fontSize': `${calc_fontsize}px`},{duration:frame_time,queue:false}); 484 469 }); 485 470 } … … 561 546 //remove placeholder and restore 562 547 var placeholder_element=jQuery(args.item_id); 563 jQuery.spfa_effects.restoreStyle(placeholder_element );548 jQuery.spfa_effects.restoreStyle(placeholder_element,args.init_css_position); 564 549 jQuery.spfa_effects.removePlaceholder(placeholder_element); 565 550 },1000); … … 569 554 //remove placeholder and restore 570 555 var placeholder_element=jQuery(args.item_id); 571 jQuery.spfa_effects.restoreStyle(placeholder_element );556 jQuery.spfa_effects.restoreStyle(placeholder_element,args.init_css_position); 572 557 jQuery.spfa_effects.removePlaceholder(placeholder_element); 573 558 } … … 577 562 if (item=='spfa_color'){ 578 563 jQuery(args.item_id).animate({'color':`${args.init_color}`,'backgroundColor':`${args.init_background_color}`},{duration: 1000,queue:false}); 579 }580 581 else if(item=='spfa_move'){582 jQuery(args.item_id).animate({ "left": `${args.init_pos.left}px`,"top": `${args.init_pos.top}px`},{duration: 1000,queue:false});583 564 } 584 565 … … 590 571 var current_margin_top = parseInt(jQuery(args.item_id).css('margin-top').replace('px','')); 591 572 var calc_margin_top = current_margin_top+(current_height - args.init_height)/2; 592 jQuery(args.item_id).animate({ 'margin-top':`${calc_margin_top}px`,'margin-left':`${calc_margin_left}px`,'width':`${args.init_width}px`,'height':`${args.init_height}px`,'fontSize':args.init_fontsize},{duration: 1000,queue:false}); 573 jQuery(args.item_id).animate({ 'width':`${args.init_width}px`,'height':`${args.init_height}px`,'fontSize':args.init_fontsize},{duration: 1000,queue:false}); 574 } 575 576 else if(item=='spfa_move'){ 577 jQuery(args.item_id).animate({ "margin-left": `${args.init_margin_left}`,"margin-top": `${args.init_margin_top}`},{duration: 1000,queue:false}); 593 578 } 594 579 … … 643 628 644 629 } 645 646 function spfa_ui_effect_complete(element,args,i){647 if(args[`frame${i}effect2`]=='spfa_move' && (args[`frame${i}effect`]=='spfa_bounce' || args[`frame${i}effect`]=='spfa_shake')){648 jQuery(element).css('left',`+=${args[`frame${i}option3`]}px`);649 jQuery(element).css('top',`+=${args[`frame${i}option4`]}px`);650 jQuery(element).css('margin-left',`${args.init_margin_left}`);651 jQuery(element).css('margin-top',`${args.init_margin_top}`);652 }653 } -
sequence-animation/trunk/js/spfa_effects-md.js
r2156925 r2158071 231 231 }, 232 232 233 restoreStyle: function( element ) {233 restoreStyle: function( element, position ) { 234 234 //////////// 235 235 //deimos mod … … 268 268 element[ 0 ].style.top = temp_top; 269 269 element[ 0 ].style.transform = temp_transform; 270 element[ 0 ].style.position = position; 270 271 // if (element[ 0 ].style.marginLeft && element[ 0 ].style.marginLeft!=temp_margin_left){ 271 272 // element[ 0 ].style.marginLeft = `${margin_left+left}px`; -
sequence-animation/trunk/readme.txt
r2157406 r2158071 6 6 Requires at least: 4.7.8 7 7 Tested up to: 5.2.2 8 Stable tag: 1. 18 Stable tag: 1.2 9 9 License: GPLv2 or later 10 10 … … 52 52 = 1.1= 53 53 *Optimization in css position Date - 15 Sep 2019* 54 55 = 1.2= 56 *Restore previous css position Date - 17 Sep 2019*
Note: See TracChangeset
for help on using the changeset viewer.