lundi 23 mars 2015

How to publish adobe edge animation to custom wordpress plugin


Can anyone explain to me how I can publish an edge animation to a custom wordpress plugin. I've set the target directory and the images, and js folder relative to that, but when i run the page, its looking for a javascript relative to that wordpress page, where im using a custom short code.


Here is the files that are published



/wp-content/plugins/myplugin/edge_includes/edge.5.0.1.min.js
/wp-content/plugins/myplugin/eye_piece_edge.js
/wp-content/plugins/myplugin/eye_piece.html


I point to edge.5.0.1.min.js the following in plugin script



function myplugin_scripts() {
wp_enqueue_script(
'quiz-edge',
plugins_url('/edge_includes/edge.5.0.1.min.js', __FILE__ ),
array('jquery')
);
wp_enqueue_script(
'quiz-edge',
plugins_url('eye_piece_edge.js', __FILE__ ),
array('jquery')
);
wp_enqueue_script(
'quiz-init',
plugins_url('/js/init.js', __FILE__ ),
array('jquery')
);
}
add_action('wp_enqueue_scripts', 'myplugin_scripts');


/* init.js */

AdobeEdge.loadComposition('eye_piece', 'EDGE-52583590', {
scaleToFit: "none",
centerStage: "none",
minW: "0",
maxW: "undefined",
width: "460px",
height: "320px"
}, {dom: [ ]}, {dom: [ ]});


Im using short code to display markup on page http://ift.tt/1HtA4nG



function mypluginIndex( $atts, $content = "" ) {

global $wpdb;

$html = '<form name="quiz-form" action="/quiz/" method="post">';

$html .= '<ul class="quiz-list">';
$html .= '
<li>
<p>Statement 1</p>
<p><div id="Stage" class="EDGE-52583590"></div></p>
<p>
<input type="radio" name="question_one_choice" value="1">
<input type="radio" name="question_one_choice" value="2">
<input type="radio" name="question_one_choice" value="3">
<input type="radio" name="question_one_choice" value="4">
</p>
</li>';

return $html;

}
add_shortcode('myPuginShortCode', 'mypluginIndex');


I'm getting a 404 - http://ift.tt/1Hr5M1u


I'm assuming the eye_piece_edge.js is dynamically loaded when its defined here, AdobeEdge.loadComposition('eye_piece', 'EDGE-57338104', { but how can I override that, and use wp_enqueue_script


Im not getting any other errors, other than that 404, and the wp_enqueue is loading eye_piece_edge.js, but animation is not running.


Update:


I made an error on file names above. Edited to show eye_piece_edge.js rather than glasses_edge.js





Aucun commentaire:

Enregistrer un commentaire