Plugin Directory

Changeset 1442213


Ignore:
Timestamp:
06/23/2016 03:58:28 AM (10 years ago)
Author:
Estmob
Message:

Fixed multi-plugin load error

Location:
send-anywhere-file-transfer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • send-anywhere-file-transfer/trunk/platform.js

    r1269976 r1442213  
    4040    /******** starting point for your widget ********/
    4141    function main() {
    42       //your widget code goes here
    43    
    44         jQuery(document).ready(function ($) {
    45           //or you could wait until the page is ready
    46           var $plugin = $('.sa-plugin');
    47           if ($plugin) {
    48               $plugin.css({'text-indect':'0px', 'margin':'0px', 'padding':'0px', 'border-style':'none', 'line-height':'normal', 'display': 'inline-block', 'background':'transparent'});
     42        //your widget code goes here
    4943
    50               var $ifrm = $('<iframe>');
    51               $ifrm.attr('frameborder', 0);
    52               $ifrm.css({'border-radius': '5px', 'box-shadow':'0px 2px 2px 0px rgba(0,0,0,0.3)'});
    53               $ifrm.attr('hspace', 0);
    54               $ifrm.attr('vspace', 0);
    55               $ifrm.attr('marginheight', 0);
    56               $ifrm.attr('marginwidth', 0);
    57               $ifrm.attr('scrolling', 0);
    58               $ifrm.attr('tabindex', 0);
    59               var src = "https://send-anywhere.com/web/v1/widgets/";
     44        jQuery(document).ready(function($) {
     45            //or you could wait until the page is ready
     46            var $plugins = $('.sa-plugin');
     47            $plugins.each(function(index, plugin) {
     48                if (plugin) {
     49                    $(plugin).css({
     50                        'text-indect': '0px',
     51                        'margin': '0px',
     52                        'padding': '0px',
     53                        'border-style': 'none',
     54                        'line-height': 'normal',
     55                        'display': 'inline-block',
     56                        'background': 'transparent',
     57                    });
    6058
    61               switch($plugin.data('type')){
    62                 case "send": src += "plugin_s"; break;
    63                 case "receive": src += "plugin_r"; break;
    64                 case "send-receive": src += "plugin_sr"; break;
    65               }
    66               $ifrm.attr('src', src);
     59                    var $ifrm = $('<iframe>');
     60                    $ifrm.attr('frameborder', 0);
     61                    $ifrm.css({
     62                        'border-radius': '5px',
     63                        'box-shadow': '0px 2px 2px 0px rgba(0,0,0,0.3)',
     64                        'overflow': 'hidden'
     65                    });
     66                    $ifrm.attr('hspace', 0);
     67                    $ifrm.attr('vspace', 0);
     68                    $ifrm.attr('marginheight', 0);
     69                    $ifrm.attr('marginwidth', 0);
     70                    $ifrm.attr('scrolling', 'no');
     71                    $ifrm.attr('tabindex', 0);
     72                    var src = "https://send-anywhere.com/web/v1/widgets/";
    6773
    68               $plugin.append($ifrm);
     74                    switch ($(plugin).data('type')) {
     75                        case "send":
     76                            src += "plugin_s";
     77                            break;
     78                        case "receive":
     79                            src += "plugin_r";
     80                            break;
     81                        case "send-receive":
     82                            src += "plugin_sr";
     83                            break;
     84                    }
     85                    if ($(plugin).data('locale')) {
     86                        src += "/?lang=" + $plugin.data('locale');
     87                    }
     88                    $ifrm.attr('src', src);
    6989
    70               var width = $plugin.data('width');
    71               if (width) {
    72                   $plugin.css('width', width);
    73                   $ifrm.css('width', width);
    74               }
    75               var height = $plugin.data('height');
    76               if (height) {
    77                   $plugin.css('height', height);
    78                   $ifrm.css('height', height);
    79               }
    80           }
     90                    $(plugin).append($ifrm);
     91
     92                    var width = $(plugin).data('width');
     93                    if (width) {
     94                        $(plugin).css('width', width);
     95                        $ifrm.css('width', width);
     96                    }
     97                    var height = $(plugin).data('height');
     98                    if (height) {
     99                        $(plugin).css('height', height);
     100                        $ifrm.css('height', height);
     101                    }
     102                }
     103            });
    81104        });
    82        
    83105    }
    84106 
  • send-anywhere-file-transfer/trunk/readme.txt

    r1350701 r1442213  
    44Author: Estmob Inc.
    55Author URI: https://send-anywhere.com/
    6 Version: 1.0.1
    7 Stable tag: 1.0.1
     6Version: 1.1.0
     7Stable tag: 1.1.0
    88Requires at least: 3.5
    99Tested up to: 4.4.2
Note: See TracChangeset for help on using the changeset viewer.