Plugin Directory

Changeset 681590


Ignore:
Timestamp:
03/14/2013 02:15:02 AM (13 years ago)
Author:
withinboredom
Message:

v1.8

Location:
abundatrade-plugin
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • abundatrade-plugin/tags/1.8/abundatrade_pugin.php

    r670086 r681590  
    22/**
    33 * @package abundatrade_plugin
    4  * @version 1.7.7
     4 * @version 1.8
    55 * @author Robert Landers (landers.robert@gmail.com)
    66 */
     
    1010Description: Earn extra income for your site via the Abundatrade affiliate program!
    1111Author: withinboredom
    12 Version: 1.7.7
     12Version: 1.8
    1313Author URI: http://withinboredom.info
    1414 */
     
    9090        $all_valid = false;
    9191        $show_all = "style='display:none'";
     92       
     93        preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
     94
     95        $use_labels = false;
     96        if (count($matches)>1){
     97            //Then we're using IE
     98            $version = $matches[1];
     99
     100            $use_labels = true;
     101            switch(true){
     102                case ($version<=8):
     103                    //IE 8 or under!
     104                    $use_labels = true;
     105                    break;
     106
     107                case ($version==9):
     108                    //IE9!
     109                    $use_labels = true;
     110                    break;
     111                case ($version == 10):
     112                    $use_labels = false;
     113                default:
     114                //You get the idea
     115            }
     116        }
     117       
     118        if (isset($atts['gad_cat'])) {
     119            $this->export = array('gad_cat' => $atts['gad_cat']);
     120        }
    92121       
    93122        if(isset($_REQUEST['gad_cat'])) {
     
    188217        else {
    189218           
    190             $display = "<form method='get' action='#'><input type='hidden' name='gadget' value='true'/><div id='abundatrade_gadget'>";
     219            $display = "<form method='get' action='#'><input type='hidden' id='is_gadget' name='gadget' value='true'/><input type='hidden' name='unknown' value='false'><div id='abundatrade_gadget'>";
    191220            $display .= "<h1 id='finalize' style='display:none'></h1>";
    192221            $display .= "<div class='category_selector select_container'><div id='category_selection' $gad_cat class='selection sel_center'>This form requires javascript. Please use a javascript enabled browser";
     
    210239            $display .= "<div class='description_container'><div id='description' class='box_center'>";
    211240            $display .= "<p id='desc_desc'>Tell us more about your gadget including complete model #, make, etc...</p>";
    212             $display .= "<textarea name='description_entry'></textarea>";
     241            $display .= "<textarea name='description_entry' " . ($use_labels ? "rows='10'" : "") . "></textarea>";
    213242            $display .= $closediv . $closediv;
    214243            $display .= "<div id='master_container_contact' $show_all>";
    215244            $display .= "<div class='contact_form_container'><div class='contact_form_thirds'>";
     245            if ($use_labels) {
     246                $display .= "<label for='my_name'>Your name*</label><br>";
     247            }
    216248            $display .= "<input $name type='text' placeholder='Your name*' name='my_name' value='" . $this->get_value("my_name") . "' /><span class='required'>*</span>";
    217249            $display .= $closediv;
    218250            $display .= "<div class='contact_form_thirds'>";
     251            if ($use_labels) {
     252                $display .= "<label for='email'>Your Email*</label><br>";
     253            }
    219254            $display .= "<input $email type='text' placeholder='Your email*' name='email' value='" . $this->get_value("email") . "'/><span class='required'>*</span>";
    220255            $display .= $closediv;
    221256            $display .= "<div class='contact_form_thirds'>";
     257            if ($use_labels) {
     258                $display .= "<label for='phone'>Your phone #</label><br>";
     259            }
    222260            $display .= "<input $phone type='text' placeholder='Your phone #' name='phone' value = '" . $this->get_value("phone") . "'/>";
    223261            $display .= $closediv . $closediv;
    224262            $display .= "<div class='contact_form_container'><div class='contact_form_thirds' style='width:49%'>";
     263            if ($use_labels) {
     264                $display .= "<label for='address_street'>Address*</label><br>";
     265            }
    225266            $display .= "<input $address_street type='text' placeholder='Address*' name='address_street' value='" . $this->get_value("address_street") . "'/><span class='required'>*</span>";
    226267            $display .= $closediv;
    227268            $display .= "<div class='contact_form_thirds' style='width:49%'>";
     269            if ($use_labels) {
     270                $display .= "<label for='address_street_two'>Address Line 2</label><br>";
     271            }
    228272            $display .= "<input $address_street_two type='text' placeholder='Address Line 2' name='address_street_two' value='" . $this->get_value("address_street_two") . "'/>";
    229273            $display .= $closediv . $closediv;
    230274            $display .= "<div class='contact_form_container'><div class='contact_form_thirds'>";
     275            if ($use_labels) {
     276                $display .= "<label for='address_city'>City*</label><br>";
     277            }
    231278            $display .= "<input $address_city type='text' placeholder='City*' name='address_city' value='" . $this->get_value("address_city") . "'/><span class='required'>*</span>";
    232279            $display .= $closediv;
    233280            $display .= "<div class='contact_form_thirds'>";
     281            if ($use_labels) {
     282                $display .= "<label for='address_state'>State*</label><br>";
     283            }
    234284            $display .= "<input $address_state type='text' placeholder='State*' name='address_state' value='" . $this->get_value("address_state") . "'/><span class='required'>*</span>";
    235285            $display .= $closediv;
    236286            $display .= "<div class='contact_form_thirds'>";
     287            if ($use_labels) {
     288                $display .= "<label for='address_zip'>Zip Code*</label><br>";
     289            }
    237290            $display .= "<input $address_zip type='text' placeholder='Zip Code*' name='address_zip' value='" . $this->get_value("address_zip") . "'/><span class='required'>*</span>";
    238291            $display .= $closediv . $closediv;
     
    252305        }
    253306       
    254         if ($_GET['gadget'] == true) {
     307        if (!isset($this->export)) {
     308            $this->export = array();
     309        }
     310       
     311        $display .= "<script type='text/javascript'> /* <![CDATA[ */ var abundacalc_gad = " . json_encode($this->export) . ";/* ]]> */</script>";
     312       
     313        if (true) {
    255314            return $display;
    256315        }
     
    477536        wp_enqueue_script("abundatrade_gadgets");
    478537        $abundacalc = array('server' => 'abundatrade.com',
    479             'url' => $this->folders['PluginUrl'],
     538            'url' => $this->folders['PluginUrl'],
     539            'export' => $this->export,
    480540            'thanks' => $this->settings->Thank_you_page);
    481541        if (isset($_REQUEST['upload_id']) && $_REQUEST['upload_id'] != '') {
  • abundatrade-plugin/tags/1.8/js/abunda_gadgets_short.js

    r670086 r681590  
    11// JScript File
     2
     3Object.keys = Object.keys || (function () {
     4    var hasOwnProperty = Object.prototype.hasOwnProperty,
     5        hasDontEnumBug = !{ toString: null }.propertyIsEnumerable("toString"),
     6        DontEnums = [
     7            'toString',
     8            'toLocaleString',
     9            'valueOf',
     10            'hasOwnProperty',
     11            'isPrototypeOf',
     12            'propertyIsEnumerable',
     13            'constructor'
     14        ],
     15        DontEnumsLength = DontEnums.length;
     16
     17    return function (o) {
     18        if (typeof o != "object" && typeof o != "function" || o === null)
     19            throw new TypeError("Object.keys called on a non-object");
     20
     21        var result = [];
     22        for (var name in o) {
     23            if (hasOwnProperty.call(o, name))
     24                result.push(name);
     25        }
     26
     27        if (hasDontEnumBug) {
     28            for (var i = 0; i < DontEnumsLength; i++) {
     29                if (hasOwnProperty.call(o, DontEnums[i]))
     30                    result.push(DontEnums[i]);
     31            }
     32        }
     33
     34        return result;
     35    };
     36})();
    237
    338function drawCategoryPage(data) {
     
    126161var setMan = null;
    127162
     163var unknown = false;
     164
    128165function changeCond() {
    129166    var catID = jQuery("#gad_cat").val();
     
    287324    if (anyDevice == 'featured') {
    288325        jQuery("#desc_desc").get(0).innerHTML = "Please add any additional information such as detailed condition description and accessories included or not included.";
     326        makeUnknown('false');
    289327    }
    290328    else if (anyDevice == 'damaged') {
    291329        jQuery("#desc_desc").get(0).innerHTML = "Please add any additional information such as detailed condition description and accessories included or not included.";
     330        makeUnknown('false');
    292331    }
    293332    else {
    294333        jQuery("#desc_desc").get(0).innerHTML = "Please tell us about your gadget including complete model information, detailed condition description, and accessories included or not included.";
     334        makeUnknown('true');
    295335    }
    296336    if (!jQuery(".description_container").is(":visible")) {
     
    341381    }
    342382    return 4;
     383}
     384
     385function makeUnknown(ival) {
     386    jQuery("[name='unknown']").val(ival);
     387    unknown = ival;
    343388}
    344389
     
    355400            phone: getParameterByName('phone'),
    356401            street: getParameterByName('address_street'),
     402            street_two: getParameterByName('address_street_two'),
    357403            city: getParameterByName('address_city'),
    358404            state: getParameterByName('address_state'),
    359             zip: getParameterByName('address_zip')
     405            zip: getParameterByName('address_zip'),
     406            cat: getParameterByName('gad_cat'),
     407            dvd: getParameterByName('dvd'),
     408            unknown: getParameterByName('unknown')
    360409        }
    361410    });
    362411   
    363412    request.success(function (data) {
    364         window.location.href = "http://abundatrade.com/free-cd-dvd-with-gadget-trade.php";
     413        if (data.success) {
     414            window.location.href = "http://abundatrade.com/free-cd-dvd-with-gadget-trade.php";
     415        }
    365416    });
    366417}
    367418
    368419function determineStart() {
    369     if (getParameterByName("gadget") == 'true') {
     420    if (jQuery("#is_gadget").val() == 'true' || getParameterByName('gadget') == 'true') {
     421
     422        if (abundacalc_gad.gad_cat) {
     423            setCat = abundacalc_gad.gad_cat;
     424        }
    370425
    371426        if (getParameterByName("gad_cat") != "") {
    372427            setCat = getParameterByName("gad_cat");
    373428        }
     429
    374430        if (getParameterByName("gad_man") != "") {
    375431            setMan = getParameterByName("gad_man");
     
    381437            setDev = getParameterByName("gad_dev");
    382438        }
     439        if (getParameterByName("ean") != "") {
     440            setDev = getParameterByName("ean");
     441        }
    383442        if (getParameterByName("gad_cond") != "") {
    384443            setCond = getParameterByName("gad_cond");
     
    389448}
    390449
    391 jQuery(determineStart());
     450jQuery(determineStart);
  • abundatrade-plugin/tags/1.8/js/register.js

    r650598 r681590  
    127127                                jQuery.prompt.goToState('nomatch');
    128128                            } else if (validateEmail(val['email'], val['confirm_email'])) {
    129                                 mystate += but;
     129                                mystate += 4;
    130130                                jQuery.prompt.goToState('state' + mystate);
    131131                            }
     
    133133                                jQuery.prompt.goToState('invalid');
    134134                            }
    135                             return false;
    136                         }
    137                         else {
    138                             just_logging_in = false;
    139                             jQuery.prompt.close();
    140                         }
    141                     }
    142                 },
    143                 state2: {
    144                     html: passState,
    145                     buttons: {Back: -1,Cancel:0, Next: 1},
    146                     submit: function (ev, but, message, val) {
    147                         mystate = 2;
    148                         if (but > 0) {
    149                             if (val['password'] != null) {
    150                                 pass = message.children('password');
    151                                 conf = message.children('confirmPass');
    152                                 if (val['password'] != val['confirmPass']) {
    153                                     jQuery('#password').css("border", "solid #ff0000 2px");
    154                                     jQuery('#confirmPass').css("border", "solid #ff0000 2px");
    155                                     jQuery('#badpass').show();
    156                                     return false;
    157                                 }
    158                                 if (val['password'].length < 8) {
    159                                     jQuery("#password").css("border", "solid #ff0000 2px");
    160                                     jQuery("#shortpass").show();
    161                                     return false;
    162                                 }
    163                             }
    164                             if (val['address_zip'] == '') {
    165                                 jQuery("#address_zip").css("border", "solid #ff0000 2px");
    166                                 return false;
    167                             }
    168                             if (val['address_state'] == '') {
    169                                 jQuery("#address_state").css("border", "solid #ff0000 2px");
    170                                 return false;
    171                             }
    172                             if (val['address_city'] == '') {
    173                                 jQuery("#address_city").css("border", "solid #ff0000 2px");
    174                                 return false;
    175                             }
    176                             if (val['address_street'] == '') {
    177                                 jQuery("#address_street").css("border", "solid #ff0000 2px");
    178                                 return false;
    179                             }
    180                         }
    181                        
    182                         if (but != 0) {
    183                             mystate+= but;
    184                             jQuery.prompt.goToState('state' + mystate);
    185                             return false;
    186                         }
    187                         just_logging_in = false;
    188                         jQuery.prompt.close();
    189                     }
    190                 },
    191                 state3: {
    192                     buttons: { Back: -1, Cancel: 0, Next: 1 },
    193                     focus: 2,
    194                     submit: function (ev, but, message, val) {
    195                         mystate = 3
    196                         if (but > 0) {
    197 
    198                             lname = message.children('#referrals');
    199                            
    200                             if (val['hvReferral'] == '9' && val['txtOther'] == '') {
    201                                 jQuery('#other').css('border', 'solid #ff0000 2px');
    202                                 return false;
    203                             }
    204                            
    205                             if (val['hvReferral'] == '3' && val['referred'] == '') {
    206                                 jQuery('#friend').css('border', 'solid #ff0000 2px');
    207                                 return false;
    208                             }
    209 
    210                             if (val['hvReferral'] == '-1') {
    211                                 jQuery('#referrals').css("border", "solid #ff0000 2px");
    212                                 return false;
    213                             }
    214                             else {
    215                                 jQuery('#referrals').css("border", "")
    216                             }
    217                         }
    218                         if (but != 0) {
    219 
    220                             if (val['phone_request'] == 'on') {
    221                                 mystate += but;
    222                             }
    223                             else {
    224                                 if (but == 1) {
    225                                     mystate += 2;
    226                                 }
    227                                 else {
    228                                     mystate += but;
    229                                 }
    230                             }
    231                             if (mystate == 5 && just_logging_in) {
    232                                 var str = '';
    233                                 jQuery.each(val, function (i, obj) {
    234                                     str += '&' + i + '=' + obj;
    235                                 });
    236 
    237                                 request = jQuery.ajax(
    238                                                         {
    239                                                             type: 'POST',
    240                                                             url: 'http://' + abundacalc.server + '/trade/process/user/create/',
    241                                                             data: '?action=create_user' + str,
    242                                                             dataType: 'jsonp'
    243                                                         });
    244                                 request.done(function(data) {
    245                                         get_login_status();
    246                                         just_logging_in = false;
    247                                         jQuery.prompt.close();
    248                                        
    249                                 });
    250 
    251                             }
    252                             else {
    253                                 jQuery.prompt.goToState('state' + mystate);
    254                             }
    255                             return false;
    256                         }
    257                         else {
    258                             just_logging_in = false;
    259                             jQuery.prompt.close();
    260                         }
    261                     },
    262                     html: referral
    263                 },
    264                 state4: {
    265                     html: phone,
    266                     buttons: { Back: -1, Cancel: 0, Next: 1 },
    267                     focus: 2,
    268                     submit: function (ev, but, message, val) {
    269                         mystate = 4;
    270                         if (but > 0) {
    271                             lname = message.children('#phone_type');
    272 
    273                             if (val['phone_type'] == '') {
    274                                 lname.css("border", "solid #ff0000 2px");
    275                                 return false;
    276                             }
    277                             else {
    278                                 lname.css("border", "");
    279                             }
    280                         }
    281                         if (but != 0) {
    282 
    283                             var str = '';
    284                             mystate += but;
    285                             if (mystate == 5 && just_logging_in) {
    286                                 jQuery.each(val, function (i, obj) {
    287                                     str += '&' + i + '=' + obj;
    288                                 });
    289 
    290                                 request = jQuery.ajax(
    291                                                         {
    292                                                             type: 'POST',
    293                                                             url: 'http://' + abundacalc.server + '/trade/process/user/create/',
    294                                                             data: '?action=create_user' + str,
    295                                                             dataType: 'jsonp'
    296                                                         });
    297                                 request.done(function(data) {
    298                                         get_login_status();
    299                                         just_logging_in = false;
    300                                         jQuery.prompt.close();
    301                                        
    302                                 });
    303 
    304                             }
    305                             else {
    306                                 jQuery.prompt.goToState('state' + mystate);
    307                             }
    308                            
    309135                            return false;
    310136                        }
  • abundatrade-plugin/tags/1.8/js/remote.js

    r670086 r681590  
    620620            return { Cancel: 0, Login: -1, Register: 1 };
    621621        }
    622         return { Cancel: 0, Login: -1, Register: 1, 'Continue as Guest': 2 };
     622        return { Cancel: 0, Login: -1, Submit: 1, };
    623623    }
    624624}
     
    10941094}
    10951095
    1096 /** Submission of a list done the old fashioned way via jsonp */
     1096/** Submission of a list done the old fashioned way via jsonp ACTUAL SUBMISSION */
    10971097function submit_my_list(f) {
    10981098    str = "";
     
    11011101        str += '&' + i + '=' + obj;
    11021102    });
     1103
     1104    str += "&simple=true";
    11031105
    11041106    if (isguest) {
     
    12861288    {
    12871289        title: 'Add it',
    1288         html: 'Add your item to your working trade list, you can signin, signup, or submit as a guest for an instant quote.',
     1290        html: 'Add your item to your working trade list, you can signin or submit for an instant quote.',
    12891291        buttons: { Done: 2 },
    12901292        focus: 1,
     
    13451347    {
    13461348        title: 'Submit',
    1347         html: 'Once you\'re done building your list how you want it; login, sign up, or submit the list as a guest; print out your shipping information, and send it in. We will keep you up to date while it goes through the receiving process and get you your cash.',
     1349        html: 'Once you\'re done building your list how you want it; login or submit the list; print out your shipping information, and send it in. We will keep you up to date while it goes through the receiving process and get you your cash.',
    13481350        buttons: { Back: -1, Next: 1 },
    13491351        focus: 1,
  • abundatrade-plugin/tags/1.8/readme.txt

    r670086 r681590  
    66Requires at least: 3.3
    77Tested up to: 3.5
    8 Stable tag: 1.7.7
     8Stable tag: 1.8
    99
    1010Earn extra income for your site via the Abundatrade affiliate program.  The shortcode puts the calculator on your website that shows visitors how much cash they will get for their used CDs, DVDs, and books.
     
    6767
    6868== Changelog ==
     69
     70= v1.8 =
     71
     72* Bug Fixes
     73* No registration required
    6974
    7075= v1.7.7 (Feb 18, 2013) =
  • abundatrade-plugin/trunk/abundatrade_pugin.php

    r670086 r681590  
    22/**
    33 * @package abundatrade_plugin
    4  * @version 1.7.7
     4 * @version 1.8
    55 * @author Robert Landers (landers.robert@gmail.com)
    66 */
     
    1010Description: Earn extra income for your site via the Abundatrade affiliate program!
    1111Author: withinboredom
    12 Version: 1.7.7
     12Version: 1.8
    1313Author URI: http://withinboredom.info
    1414 */
     
    9090        $all_valid = false;
    9191        $show_all = "style='display:none'";
     92       
     93        preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
     94
     95        $use_labels = false;
     96        if (count($matches)>1){
     97            //Then we're using IE
     98            $version = $matches[1];
     99
     100            $use_labels = true;
     101            switch(true){
     102                case ($version<=8):
     103                    //IE 8 or under!
     104                    $use_labels = true;
     105                    break;
     106
     107                case ($version==9):
     108                    //IE9!
     109                    $use_labels = true;
     110                    break;
     111                case ($version == 10):
     112                    $use_labels = false;
     113                default:
     114                //You get the idea
     115            }
     116        }
     117       
     118        if (isset($atts['gad_cat'])) {
     119            $this->export = array('gad_cat' => $atts['gad_cat']);
     120        }
    92121       
    93122        if(isset($_REQUEST['gad_cat'])) {
     
    188217        else {
    189218           
    190             $display = "<form method='get' action='#'><input type='hidden' name='gadget' value='true'/><div id='abundatrade_gadget'>";
     219            $display = "<form method='get' action='#'><input type='hidden' id='is_gadget' name='gadget' value='true'/><input type='hidden' name='unknown' value='false'><div id='abundatrade_gadget'>";
    191220            $display .= "<h1 id='finalize' style='display:none'></h1>";
    192221            $display .= "<div class='category_selector select_container'><div id='category_selection' $gad_cat class='selection sel_center'>This form requires javascript. Please use a javascript enabled browser";
     
    210239            $display .= "<div class='description_container'><div id='description' class='box_center'>";
    211240            $display .= "<p id='desc_desc'>Tell us more about your gadget including complete model #, make, etc...</p>";
    212             $display .= "<textarea name='description_entry'></textarea>";
     241            $display .= "<textarea name='description_entry' " . ($use_labels ? "rows='10'" : "") . "></textarea>";
    213242            $display .= $closediv . $closediv;
    214243            $display .= "<div id='master_container_contact' $show_all>";
    215244            $display .= "<div class='contact_form_container'><div class='contact_form_thirds'>";
     245            if ($use_labels) {
     246                $display .= "<label for='my_name'>Your name*</label><br>";
     247            }
    216248            $display .= "<input $name type='text' placeholder='Your name*' name='my_name' value='" . $this->get_value("my_name") . "' /><span class='required'>*</span>";
    217249            $display .= $closediv;
    218250            $display .= "<div class='contact_form_thirds'>";
     251            if ($use_labels) {
     252                $display .= "<label for='email'>Your Email*</label><br>";
     253            }
    219254            $display .= "<input $email type='text' placeholder='Your email*' name='email' value='" . $this->get_value("email") . "'/><span class='required'>*</span>";
    220255            $display .= $closediv;
    221256            $display .= "<div class='contact_form_thirds'>";
     257            if ($use_labels) {
     258                $display .= "<label for='phone'>Your phone #</label><br>";
     259            }
    222260            $display .= "<input $phone type='text' placeholder='Your phone #' name='phone' value = '" . $this->get_value("phone") . "'/>";
    223261            $display .= $closediv . $closediv;
    224262            $display .= "<div class='contact_form_container'><div class='contact_form_thirds' style='width:49%'>";
     263            if ($use_labels) {
     264                $display .= "<label for='address_street'>Address*</label><br>";
     265            }
    225266            $display .= "<input $address_street type='text' placeholder='Address*' name='address_street' value='" . $this->get_value("address_street") . "'/><span class='required'>*</span>";
    226267            $display .= $closediv;
    227268            $display .= "<div class='contact_form_thirds' style='width:49%'>";
     269            if ($use_labels) {
     270                $display .= "<label for='address_street_two'>Address Line 2</label><br>";
     271            }
    228272            $display .= "<input $address_street_two type='text' placeholder='Address Line 2' name='address_street_two' value='" . $this->get_value("address_street_two") . "'/>";
    229273            $display .= $closediv . $closediv;
    230274            $display .= "<div class='contact_form_container'><div class='contact_form_thirds'>";
     275            if ($use_labels) {
     276                $display .= "<label for='address_city'>City*</label><br>";
     277            }
    231278            $display .= "<input $address_city type='text' placeholder='City*' name='address_city' value='" . $this->get_value("address_city") . "'/><span class='required'>*</span>";
    232279            $display .= $closediv;
    233280            $display .= "<div class='contact_form_thirds'>";
     281            if ($use_labels) {
     282                $display .= "<label for='address_state'>State*</label><br>";
     283            }
    234284            $display .= "<input $address_state type='text' placeholder='State*' name='address_state' value='" . $this->get_value("address_state") . "'/><span class='required'>*</span>";
    235285            $display .= $closediv;
    236286            $display .= "<div class='contact_form_thirds'>";
     287            if ($use_labels) {
     288                $display .= "<label for='address_zip'>Zip Code*</label><br>";
     289            }
    237290            $display .= "<input $address_zip type='text' placeholder='Zip Code*' name='address_zip' value='" . $this->get_value("address_zip") . "'/><span class='required'>*</span>";
    238291            $display .= $closediv . $closediv;
     
    252305        }
    253306       
    254         if ($_GET['gadget'] == true) {
     307        if (!isset($this->export)) {
     308            $this->export = array();
     309        }
     310       
     311        $display .= "<script type='text/javascript'> /* <![CDATA[ */ var abundacalc_gad = " . json_encode($this->export) . ";/* ]]> */</script>";
     312       
     313        if (true) {
    255314            return $display;
    256315        }
     
    477536        wp_enqueue_script("abundatrade_gadgets");
    478537        $abundacalc = array('server' => 'abundatrade.com',
    479             'url' => $this->folders['PluginUrl'],
     538            'url' => $this->folders['PluginUrl'],
     539            'export' => $this->export,
    480540            'thanks' => $this->settings->Thank_you_page);
    481541        if (isset($_REQUEST['upload_id']) && $_REQUEST['upload_id'] != '') {
  • abundatrade-plugin/trunk/js/abunda_gadgets_short.js

    r670086 r681590  
    11// JScript File
     2
     3Object.keys = Object.keys || (function () {
     4    var hasOwnProperty = Object.prototype.hasOwnProperty,
     5        hasDontEnumBug = !{ toString: null }.propertyIsEnumerable("toString"),
     6        DontEnums = [
     7            'toString',
     8            'toLocaleString',
     9            'valueOf',
     10            'hasOwnProperty',
     11            'isPrototypeOf',
     12            'propertyIsEnumerable',
     13            'constructor'
     14        ],
     15        DontEnumsLength = DontEnums.length;
     16
     17    return function (o) {
     18        if (typeof o != "object" && typeof o != "function" || o === null)
     19            throw new TypeError("Object.keys called on a non-object");
     20
     21        var result = [];
     22        for (var name in o) {
     23            if (hasOwnProperty.call(o, name))
     24                result.push(name);
     25        }
     26
     27        if (hasDontEnumBug) {
     28            for (var i = 0; i < DontEnumsLength; i++) {
     29                if (hasOwnProperty.call(o, DontEnums[i]))
     30                    result.push(DontEnums[i]);
     31            }
     32        }
     33
     34        return result;
     35    };
     36})();
    237
    338function drawCategoryPage(data) {
     
    126161var setMan = null;
    127162
     163var unknown = false;
     164
    128165function changeCond() {
    129166    var catID = jQuery("#gad_cat").val();
     
    287324    if (anyDevice == 'featured') {
    288325        jQuery("#desc_desc").get(0).innerHTML = "Please add any additional information such as detailed condition description and accessories included or not included.";
     326        makeUnknown('false');
    289327    }
    290328    else if (anyDevice == 'damaged') {
    291329        jQuery("#desc_desc").get(0).innerHTML = "Please add any additional information such as detailed condition description and accessories included or not included.";
     330        makeUnknown('false');
    292331    }
    293332    else {
    294333        jQuery("#desc_desc").get(0).innerHTML = "Please tell us about your gadget including complete model information, detailed condition description, and accessories included or not included.";
     334        makeUnknown('true');
    295335    }
    296336    if (!jQuery(".description_container").is(":visible")) {
     
    341381    }
    342382    return 4;
     383}
     384
     385function makeUnknown(ival) {
     386    jQuery("[name='unknown']").val(ival);
     387    unknown = ival;
    343388}
    344389
     
    355400            phone: getParameterByName('phone'),
    356401            street: getParameterByName('address_street'),
     402            street_two: getParameterByName('address_street_two'),
    357403            city: getParameterByName('address_city'),
    358404            state: getParameterByName('address_state'),
    359             zip: getParameterByName('address_zip')
     405            zip: getParameterByName('address_zip'),
     406            cat: getParameterByName('gad_cat'),
     407            dvd: getParameterByName('dvd'),
     408            unknown: getParameterByName('unknown')
    360409        }
    361410    });
    362411   
    363412    request.success(function (data) {
    364         window.location.href = "http://abundatrade.com/free-cd-dvd-with-gadget-trade.php";
     413        if (data.success) {
     414            window.location.href = "http://abundatrade.com/free-cd-dvd-with-gadget-trade.php";
     415        }
    365416    });
    366417}
    367418
    368419function determineStart() {
    369     if (getParameterByName("gadget") == 'true') {
     420    if (jQuery("#is_gadget").val() == 'true' || getParameterByName('gadget') == 'true') {
     421
     422        if (abundacalc_gad.gad_cat) {
     423            setCat = abundacalc_gad.gad_cat;
     424        }
    370425
    371426        if (getParameterByName("gad_cat") != "") {
    372427            setCat = getParameterByName("gad_cat");
    373428        }
     429
    374430        if (getParameterByName("gad_man") != "") {
    375431            setMan = getParameterByName("gad_man");
     
    381437            setDev = getParameterByName("gad_dev");
    382438        }
     439        if (getParameterByName("ean") != "") {
     440            setDev = getParameterByName("ean");
     441        }
    383442        if (getParameterByName("gad_cond") != "") {
    384443            setCond = getParameterByName("gad_cond");
     
    389448}
    390449
    391 jQuery(determineStart());
     450jQuery(determineStart);
  • abundatrade-plugin/trunk/js/register.js

    r650598 r681590  
    127127                                jQuery.prompt.goToState('nomatch');
    128128                            } else if (validateEmail(val['email'], val['confirm_email'])) {
    129                                 mystate += but;
     129                                mystate += 4;
    130130                                jQuery.prompt.goToState('state' + mystate);
    131131                            }
     
    133133                                jQuery.prompt.goToState('invalid');
    134134                            }
    135                             return false;
    136                         }
    137                         else {
    138                             just_logging_in = false;
    139                             jQuery.prompt.close();
    140                         }
    141                     }
    142                 },
    143                 state2: {
    144                     html: passState,
    145                     buttons: {Back: -1,Cancel:0, Next: 1},
    146                     submit: function (ev, but, message, val) {
    147                         mystate = 2;
    148                         if (but > 0) {
    149                             if (val['password'] != null) {
    150                                 pass = message.children('password');
    151                                 conf = message.children('confirmPass');
    152                                 if (val['password'] != val['confirmPass']) {
    153                                     jQuery('#password').css("border", "solid #ff0000 2px");
    154                                     jQuery('#confirmPass').css("border", "solid #ff0000 2px");
    155                                     jQuery('#badpass').show();
    156                                     return false;
    157                                 }
    158                                 if (val['password'].length < 8) {
    159                                     jQuery("#password").css("border", "solid #ff0000 2px");
    160                                     jQuery("#shortpass").show();
    161                                     return false;
    162                                 }
    163                             }
    164                             if (val['address_zip'] == '') {
    165                                 jQuery("#address_zip").css("border", "solid #ff0000 2px");
    166                                 return false;
    167                             }
    168                             if (val['address_state'] == '') {
    169                                 jQuery("#address_state").css("border", "solid #ff0000 2px");
    170                                 return false;
    171                             }
    172                             if (val['address_city'] == '') {
    173                                 jQuery("#address_city").css("border", "solid #ff0000 2px");
    174                                 return false;
    175                             }
    176                             if (val['address_street'] == '') {
    177                                 jQuery("#address_street").css("border", "solid #ff0000 2px");
    178                                 return false;
    179                             }
    180                         }
    181                        
    182                         if (but != 0) {
    183                             mystate+= but;
    184                             jQuery.prompt.goToState('state' + mystate);
    185                             return false;
    186                         }
    187                         just_logging_in = false;
    188                         jQuery.prompt.close();
    189                     }
    190                 },
    191                 state3: {
    192                     buttons: { Back: -1, Cancel: 0, Next: 1 },
    193                     focus: 2,
    194                     submit: function (ev, but, message, val) {
    195                         mystate = 3
    196                         if (but > 0) {
    197 
    198                             lname = message.children('#referrals');
    199                            
    200                             if (val['hvReferral'] == '9' && val['txtOther'] == '') {
    201                                 jQuery('#other').css('border', 'solid #ff0000 2px');
    202                                 return false;
    203                             }
    204                            
    205                             if (val['hvReferral'] == '3' && val['referred'] == '') {
    206                                 jQuery('#friend').css('border', 'solid #ff0000 2px');
    207                                 return false;
    208                             }
    209 
    210                             if (val['hvReferral'] == '-1') {
    211                                 jQuery('#referrals').css("border", "solid #ff0000 2px");
    212                                 return false;
    213                             }
    214                             else {
    215                                 jQuery('#referrals').css("border", "")
    216                             }
    217                         }
    218                         if (but != 0) {
    219 
    220                             if (val['phone_request'] == 'on') {
    221                                 mystate += but;
    222                             }
    223                             else {
    224                                 if (but == 1) {
    225                                     mystate += 2;
    226                                 }
    227                                 else {
    228                                     mystate += but;
    229                                 }
    230                             }
    231                             if (mystate == 5 && just_logging_in) {
    232                                 var str = '';
    233                                 jQuery.each(val, function (i, obj) {
    234                                     str += '&' + i + '=' + obj;
    235                                 });
    236 
    237                                 request = jQuery.ajax(
    238                                                         {
    239                                                             type: 'POST',
    240                                                             url: 'http://' + abundacalc.server + '/trade/process/user/create/',
    241                                                             data: '?action=create_user' + str,
    242                                                             dataType: 'jsonp'
    243                                                         });
    244                                 request.done(function(data) {
    245                                         get_login_status();
    246                                         just_logging_in = false;
    247                                         jQuery.prompt.close();
    248                                        
    249                                 });
    250 
    251                             }
    252                             else {
    253                                 jQuery.prompt.goToState('state' + mystate);
    254                             }
    255                             return false;
    256                         }
    257                         else {
    258                             just_logging_in = false;
    259                             jQuery.prompt.close();
    260                         }
    261                     },
    262                     html: referral
    263                 },
    264                 state4: {
    265                     html: phone,
    266                     buttons: { Back: -1, Cancel: 0, Next: 1 },
    267                     focus: 2,
    268                     submit: function (ev, but, message, val) {
    269                         mystate = 4;
    270                         if (but > 0) {
    271                             lname = message.children('#phone_type');
    272 
    273                             if (val['phone_type'] == '') {
    274                                 lname.css("border", "solid #ff0000 2px");
    275                                 return false;
    276                             }
    277                             else {
    278                                 lname.css("border", "");
    279                             }
    280                         }
    281                         if (but != 0) {
    282 
    283                             var str = '';
    284                             mystate += but;
    285                             if (mystate == 5 && just_logging_in) {
    286                                 jQuery.each(val, function (i, obj) {
    287                                     str += '&' + i + '=' + obj;
    288                                 });
    289 
    290                                 request = jQuery.ajax(
    291                                                         {
    292                                                             type: 'POST',
    293                                                             url: 'http://' + abundacalc.server + '/trade/process/user/create/',
    294                                                             data: '?action=create_user' + str,
    295                                                             dataType: 'jsonp'
    296                                                         });
    297                                 request.done(function(data) {
    298                                         get_login_status();
    299                                         just_logging_in = false;
    300                                         jQuery.prompt.close();
    301                                        
    302                                 });
    303 
    304                             }
    305                             else {
    306                                 jQuery.prompt.goToState('state' + mystate);
    307                             }
    308                            
    309135                            return false;
    310136                        }
  • abundatrade-plugin/trunk/js/remote.js

    r670086 r681590  
    620620            return { Cancel: 0, Login: -1, Register: 1 };
    621621        }
    622         return { Cancel: 0, Login: -1, Register: 1, 'Continue as Guest': 2 };
     622        return { Cancel: 0, Login: -1, Submit: 1, };
    623623    }
    624624}
     
    10941094}
    10951095
    1096 /** Submission of a list done the old fashioned way via jsonp */
     1096/** Submission of a list done the old fashioned way via jsonp ACTUAL SUBMISSION */
    10971097function submit_my_list(f) {
    10981098    str = "";
     
    11011101        str += '&' + i + '=' + obj;
    11021102    });
     1103
     1104    str += "&simple=true";
    11031105
    11041106    if (isguest) {
     
    12861288    {
    12871289        title: 'Add it',
    1288         html: 'Add your item to your working trade list, you can signin, signup, or submit as a guest for an instant quote.',
     1290        html: 'Add your item to your working trade list, you can signin or submit for an instant quote.',
    12891291        buttons: { Done: 2 },
    12901292        focus: 1,
     
    13451347    {
    13461348        title: 'Submit',
    1347         html: 'Once you\'re done building your list how you want it; login, sign up, or submit the list as a guest; print out your shipping information, and send it in. We will keep you up to date while it goes through the receiving process and get you your cash.',
     1349        html: 'Once you\'re done building your list how you want it; login or submit the list; print out your shipping information, and send it in. We will keep you up to date while it goes through the receiving process and get you your cash.',
    13481350        buttons: { Back: -1, Next: 1 },
    13491351        focus: 1,
  • abundatrade-plugin/trunk/readme.txt

    r670086 r681590  
    66Requires at least: 3.3
    77Tested up to: 3.5
    8 Stable tag: 1.7.7
     8Stable tag: 1.8
    99
    1010Earn extra income for your site via the Abundatrade affiliate program.  The shortcode puts the calculator on your website that shows visitors how much cash they will get for their used CDs, DVDs, and books.
     
    6767
    6868== Changelog ==
     69
     70= v1.8 =
     71
     72* Bug Fixes
     73* No registration required
    6974
    7075= v1.7.7 (Feb 18, 2013) =
Note: See TracChangeset for help on using the changeset viewer.