Plugin Directory

Changeset 665554


Ignore:
Timestamp:
02/09/2013 10:50:51 AM (13 years ago)
Author:
ti2m
Message:

Bugfixes, jQuery no conflict, uninstall hook

Location:
edge-suite/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • edge-suite/trunk/edge-suite.php

    r632663 r665554  
    55Description: Upload Adobe Edge compositions to your website.
    66Author: Timm Jansen
    7 Author URI: http://timm-jansen.net/
    8 Version: 0.4
     7Author URI: http://www.timmjansen.com/
     8Donate link: http://www.timmjansen.com/donate
     9Version: 0.5
    910*/
    1011
    11 /*  Copyright 2012 Timm Jansen (email: info at timm-jansen.net)
     12/*  Copyright 2013 Timm Jansen (email: info at timmjansen.com)
    1213
    1314    This program is free software; you can redistribute it and/or modify
     
    7879      );
    7980    ";
    80 
    81     // TODO: Is this the correct way to do this?
    8281    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    8382    dbDelta($sql);
     
    8584
    8685  // Default options.
    87   add_option('edge_suite_max_size', 2);
     86  add_option('edge_suite_max_size', 5);
    8887  add_option('edge_suite_comp_default', -1);
    8988  add_option('edge_suite_comp_homepage', 0);
     
    101100
    102101function edge_suite_uninstall() {
     102  edge_suite_init_constants();
     103
     104  global $wpdb;
     105  $table_name = $wpdb->prefix . "edge_suite_composition_definition";
     106  if ($wpdb->get_var("show tables like '$table_name'") == $table_name) {
     107    $wpdb->query('DROP TABLE ' . $table_name);
     108  }
     109
     110  // Delete all edge directories
     111  rmdir_recursive(trailingslashit(EDGE_SUITE_PUBLIC_DIR));
     112
     113  // Delete options
     114  delete_option('edge_suite_max_size');
     115  delete_option('edge_suite_comp_default');
     116  delete_option('edge_suite_comp_homepage');
     117  delete_option('edge_suite_deactivation_delete');
     118  delete_option('edge_suite_widget_shortcode');
     119  delete_option('edge_suite_jquery_noconflict');
     120  delete_option('edge_suite_debug');
     121}
     122register_uninstall_hook(__FILE__, 'edge_suite_uninstall');
     123
     124
     125function edge_suite_deactivate() {
    103126  if(get_option('edge_suite_deactivation_delete') == 1){
    104     edge_suite_init_constants();
    105 
    106     global $wpdb;
    107     $table_name = $wpdb->prefix . "edge_suite_composition_definition";
    108     if ($wpdb->get_var("show tables like '$table_name'") == $table_name) {
    109       $wpdb->query('DROP TABLE ' . $table_name);
    110     }
    111 
    112     // Delete all edge directories
    113     rmdir_recursive(trailingslashit(EDGE_SUITE_PUBLIC_DIR));
    114 
    115     // Delete options
    116     delete_option('edge_suite_max_size');
    117     delete_option('edge_suite_comp_default');
    118     delete_option('edge_suite_comp_homepage');
    119     delete_option('edge_suite_deactivation_delete');
    120     delete_option('edge_suite_widget_shortcode');
    121     delete_option('edge_suite_jquery_noconflict');
    122     delete_option('edge_suite_debug');
    123   }
    124 }
    125 
    126 register_deactivation_hook(__FILE__, 'edge_suite_uninstall');
    127 //register_uninstall_hook(__FILE__, 'edge_suite_uninstall');
     127    edge_suite_uninstall();
     128  }
     129}
     130register_deactivation_hook(__FILE__, 'edge_suite_deactivate');
    128131
    129132
     
    164167  edge_suite_boot();
    165168
    166   // Get default composition.
    167   $definition_id = get_option('edge_suite_comp_default');
    168 
    169   // Get homepage composition.
    170   if (is_home()) {
    171     if (get_option('edge_suite_comp_homepage') != 0) {
    172       $definition_id = get_option('edge_suite_comp_homepage');
    173     }
    174   }
    175   //Get post composition
    176   else {
    177     global $post;
    178     $post_id = $post->ID;
    179     $post_reference_id = get_post_meta($post_id, '_edge_composition', TRUE);
    180     if (!empty($post_reference_id)) {
    181       $definition_id = $post_reference_id;
    182     }
    183   }
    184 
    185   // Render composition.
    186   global $edge_suite;
    187   $definition_res = edge_suite_comp_render($definition_id);
    188   // Split scripts and stage so they can be used by the respective functions.
    189   $edge_suite->scripts = isset($definition_res['scripts']) ? $definition_res['scripts'] : '';
    190   $edge_suite->stage = isset($definition_res['stage']) ? $definition_res['stage'] : '';
    191 
     169  if(!is_admin()){
     170    // Get default composition.
     171    $definition_id = get_option('edge_suite_comp_default');
     172
     173    // Get homepage composition.
     174    if (is_home()) {
     175      if (get_option('edge_suite_comp_homepage') != 0) {
     176        $definition_id = get_option('edge_suite_comp_homepage');
     177      }
     178    }
     179    //Get post composition
     180    else {
     181      global $post;
     182      if(isset($post->ID)){
     183        $post_id = $post->ID;
     184        $post_reference_id = get_post_meta($post_id, '_edge_composition', TRUE);
     185        if (!empty($post_reference_id)) {
     186          $definition_id = $post_reference_id;
     187        }
     188      }
     189    }
     190
     191    // Render composition.
     192    global $edge_suite;
     193    $definition_res = edge_suite_comp_render($definition_id);
     194    // Split scripts and stage so they can be used by the respective functions.
     195    $edge_suite->scripts = isset($definition_res['scripts']) ? $definition_res['scripts'] : '';
     196    $edge_suite->stage = isset($definition_res['stage']) ? $definition_res['stage'] : '';
     197  }
    192198}
    193199
     
    226232
    227233function edge_suite_menu() {
    228   // Todo: Create icon.
    229   // $icon_url = plugins_url('/edge-suite').'/admin/edge_icon.png';
    230   $icon_url = '';
    231   add_menu_page('Edge Suite', 'Edge Suite', 'edge_suite_administer', __FILE__, 'edge_suite_menu_main', $icon_url);
     234  add_menu_page('Edge Suite', 'Edge Suite', 'edge_suite_administer', __FILE__, 'edge_suite_menu_main');
    232235  add_submenu_page(__FILE__, 'Manage', 'Manage', 'edge_suite_administer', __FILE__, 'edge_suite_menu_main');
    233236  add_submenu_page(__FILE__, 'Settings', 'Settings', 'edge_suite_administer', 'edge_suite_menu_settings', 'edge_suite_menu_settings');
  • edge-suite/trunk/includes/edge-suite-comp-builder.inc

    r643431 r665554  
    319319    }
    320320
     321    // Todo: Directory seems to always exist already
    321322    // Delete old edge tmp dir.
    322323    if (is_dir($destination)) {
  • edge-suite/trunk/readme.txt

    r613974 r665554  
    1313== Description ==
    1414
    15 Upload of compositions through a zipped archive. Integrate Adobe Edge Animate compositions seamlessly into your website.
     15Upload of compositions through published OAM files. Integrate Adobe Edge Animate compositions seamlessly into your website.
    1616
    17 Since Edge Animate itself is still in pre-release this plugin is a moving target as well and should therefore not yet be used in production.
     17Detailed tutorials on how to install and use Edge Suite can be found is here:
    1818
    19 There have been problems with unzipping composition archives on shared hosting plans due to the wordpress filesystem. More detailed info is available in the FAQ section.
     19* <a href="http://edgedocks.com/content/edge-suite-integrate-edge-animate-wordpress">Edge Docks - written tutorial</a>
     20* <a href="http://edgedocks.com/content/edge-suite-integrate-edge-animate-wordpress">Adobe TV - video tutorial</a>
    2021
    21 Roadmap: FTP Filesystem support, data injection
     22More resources can be found at <a href="http://edgedocks.com/edge_suite_wp">EdgeDocks.com</a>.
    2223
    23 Please help to review and test the plugin. Feedback is appreciated.
    24 
    25 <a href="http://edgedocks.com/content/edge-suite-integrate-edge-animate-wordpress">Tutorial</a> on how to install and use Edge Suite. More resources can be found
    26 <a href="http://edgedocks.com/edge_suite_wp">EdgeDocks.com</a>.
     24The plugin has been intensively tested over the last couple of months and seems to be rather stable, it is up to you though if you want to try and use it in production. If you experience
     25any problems please open an issue in the support section. If you like the plugin please vote for it and let us know that it works for your wordpress version.
    2726
    2827== Features ==
    2928
    30 * Upload Edge Animate compositions within one zipped archive
     29* Upload Edge Animate compositions through published OAM files
    3130* Manage all compositions
    3231* Easy placement of compositions on the website
     32* Shortcode support for posts and widgets
     33* Sharing of resources
     34* jQuery no conflict mode
    3335
    3436== Frequently Asked Questions ==
     
    3840* Open the debug console in Chrome (mac: alt + cmd + j) or Firefox and check for JavaScript errors.
    3941
     42= jQuery issues =
     43
     44 Try to enable jQuery no conflict mode in the settings page, this might resolve conflicts between Edge Animates
     45 version of jQuery and other plugins.
     46
     47= Background animation =
     48
     49If you want to use your composition as a background animation, try the following CSS on your stage id, e.g. #Stage_mycomp
     50
     51    #Stage_mycomp{
     52        position: absolute !important; /* That is not pretty, but no way around it. */
     53        top: 0px; /* Aligns the animation with the top of the header (can be removed or changed) */
     54        z-index: 5; /* Sets animation as overlay, set to negative value for background placement */
     55
     56        /* Only use the following if you want to center the animation */
     57        left: 50%;
     58        margin-left: -346px; /* Half the width of the stage */
     59    }
     60
    4061= Animations don't show up =
    4162
    4263Uploading worked but nothings shows up on the page. Things to check:
    43 
    44 * Edge Suite doesn't support minified/published projects yet. Just zip the raw project folder (without the publish folder)
    4564
    4665* Look at the source code of the page and search for:
     
    5372
    5473* For testing remove all other fancy JavaScript like galleries, slideshows, etc. that are placed alongside the animation, the JS might collide.
     74
     75* Enable the JS debug log in the settings
     76
     77* Enable jQuery no-conflict mode in the settings
    5578
    5679= Head Cleaner: Animations don't show up =
     
    106129= 0.3 =
    107130Changes to support Edge Animate version 1.0, minified files, oam files
     131
     132= 0.4 =
     133Bugfixes
     134
     135= 0.5 =
     136Bugfixes, jQuery no conflict mode, readme update
     137
     138
     139
Note: See TracChangeset for help on using the changeset viewer.