Plugin Directory

Changeset 1030021


Ignore:
Timestamp:
11/21/2014 09:54:25 AM (11 years ago)
Author:
TheGP
Message:

3.0.2 - couple sync fixes

Location:
jumpout/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • jumpout/trunk/class.php

    r1005649 r1030021  
    124124        $result = json_decode($result);
    125125
    126         if (defined('JSON_ERROR_NONE') || json_last_error() == JSON_ERROR_NONE) {
     126        if (is_array($result) || (function_exists('json_last_error') && defined('JSON_ERROR_NONE') && json_last_error() == JSON_ERROR_NONE)) { // 3.0.2 even in 5.2 it can be no json_last_error function
     127        //if (defined('JSON_ERROR_NONE') || json_last_error() == JSON_ERROR_NONE) {
    127128
    128129            if ('error' == $result->status) {
  • jumpout/trunk/js/main.js

    r996491 r1030021  
    88        jQuery('.sync svg').css('display', 'inline');
    99
     10
     11
     12        jQuery.getJSON('?page=jumpout&action=sync&type=json')
     13            .done(function( data ) {
     14
     15                if ('undefined' != typeof(data.status)) {
     16                    if ('success' == data.status) {
     17                        location.reload();
     18
     19                        jQuery('.sync').css('background', '#199701');
     20                        jQuery('.sync').css('color', '#ffffff');
     21                        jQuery('.sync svg').css('display', 'none');
     22                        jQuery('.sync span').html('Готово! Перезагрузка страницы...');
     23                       
     24                    } else if ('error' == data.status) {
     25
     26                        syncError();
     27                        if ('session token not found' == data.message) {
     28                            window.location = '?page=jumpout&action=session_token_error';
     29                        } else if ('not enough params' == data.message) {
     30                            alert('Похоже при синхронизации плагин отправил неверный запрос. Попробуйте обновить плагин или напишите в техподдержку.');
     31                        }
     32                    }
     33                } else {
     34                    syncError();
     35                }
     36               
     37                //console.log(data);
     38                //jQuery('.sync span').html('Синхронизировать');
     39                //jQuery('.sync svg').css('display', 'none');
     40            })
     41            // 3.0.2 - just refreshing page if failed, maybe it was just an error when wp returned html instead of json, but sync completed
     42            .fail(function( jqxhr, textStatus, error ) {
     43                var err = textStatus + ", " + error;
     44                console.log( "Request Failed: " + err );
     45                location.reload();
     46        });
     47
     48
     49
     50
    1051        jQuery.getJSON('?page=jumpout&action=sync&type=json', function( data ) {
    1152
    12             if ('undefined' != typeof(data.status)) {
    13                 if ('success' == data.status) {
    14                     location.reload();
    15 
    16                     jQuery('.sync').css('background', '#199701');
    17                     jQuery('.sync').css('color', '#ffffff');
    18                     jQuery('.sync svg').css('display', 'none');
    19                     jQuery('.sync span').html('Готово! Перезагрузка страницы...');
    20                    
    21                 } else if ('error' == data.status) {
    22 
    23                     syncError();
    24                     if ('session token not found' == data.message) {
    25                         window.location = '?page=jumpout&action=session_token_error';
    26                     } else if ('not enough params' == data.message) {
    27                         alert('Похоже при синхронизации плагин отправил неверный запрос. Попробуйте обновить плагин или напишите в техподдержку.');
    28                     }
    29                 }
    30             } else {
    31                 syncError();
    32             }
    33            
    34             console.log(data);
    35 
    36 
    37             //jQuery('.sync span').html('Синхронизировать');
    38             //jQuery('.sync svg').css('display', 'none');
    3953
    4054        });
  • jumpout/trunk/readme.txt

    r1005649 r1030021  
    44Requires at least: 2.5.0
    55Tested up to: 4.0
    6 Stable tag: 3.0.1
     6Stable tag: 3.0.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4040= 3.0.1 =
    4141* Добавлена поддержка скрипта MagicBegins
     42= 3.0.2 =
     43* Исправлена проблема синхронизации на некоторых хостингах
Note: See TracChangeset for help on using the changeset viewer.