Plugin Directory

Changeset 1777691


Ignore:
Timestamp:
11/29/2017 01:17:04 PM (8 years ago)
Author:
marcbousleiman
Message:

Updated

Location:
onesignal-sender
Files:
67 added
6 edited

Legend:

Unmodified
Added
Removed
  • onesignal-sender/trunk/admin_menu/admin-menu.php

    r1703336 r1777691  
    3737    wp_enqueue_script('oss_onesignal_sender_intimidate_js', plugins_url("js/Intimidatetime-master/dist/Intimidatetime.min.js", __FILE__), array('jquery'), '1.0', true);
    3838    wp_enqueue_script('oss_onesignal_sender_highcharts', plugins_url("js/highcharts/highcharts.js", __FILE__), array('jquery'), '1.0', true);
     39    wp_enqueue_script('oss_onesignal_sender_moment', plugins_url("js/moment/moment.js", __FILE__), array('jquery'), '1.0', true);
     40    wp_enqueue_script('oss_onesignal_sender_moment_timezone', plugins_url("js/moment/moment-timezone-with-data.js", __FILE__), array('jquery'), '1.0', true);
    3941}
    4042
  • onesignal-sender/trunk/admin_menu/ajax/sending-the-msg.php

    r1694014 r1777691  
    3535        $notify_url = strip_tags($_REQUEST['notify_url']);
    3636
    37         $date = new DateTime($notify_time);
     37//        $date = new DateTime($notify_time);
    3838
    39         $date_timestamp = $date->getTimestamp();
    40         $final_date = $date_timestamp - 10800;
     39//        $date_timestamp = $date->getTimestamp();
     40        $final_date = $notify_time;
    4141        $final_readable_date = date('Y-m-d h:i:00a', $final_date);
    4242        $content = array(
  • onesignal-sender/trunk/admin_menu/sections/all-nots.php

    r1703336 r1777691  
    8181                                    }
    8282                                    $notification_url = $response_array['url'];
    83                                     $notification_queued_at = $response_array['queued_at'] + 10800;
     83                                    $notification_queued_at = $response_array['queued_at'];
    8484                                    $final_readable_date_queued = date('d, F Y h:i:00a', $notification_queued_at);
    85                                     $final_readable_date_after = date('d, F Y h:i:00a', $notification_send_after + 10800);
     85                                    $final_readable_date_after = date('d, F Y h:i:00a', $notification_send_after);
    8686                                    $notification_message = $response_array['contents']['en'];
    8787                                    $notification_converted = $response_array['converted'];
    8888                                    $notification_delivered = $response_array['successful'];
    8989                                    ?>
    90                                     <tr class="notification-entry">
     90                                    <tr class="notification-entry" data-unix="<?php echo $notification_send_after; ?>">
    9191                                        <td colspan="2" class="one action text-center">
    9292                                            <a data-confirm="Cancel this notification?" data-placement="bottom" rel="nofollow" data-method="delete" href="#">
     
    102102                                        </td>
    103103                                        <td colspan="2" class="submitted date">
    104                                             <?php echo $final_readable_date_after; ?>
     104                                            -
    105105                                        </td>
    106106                                        <td colspan="2" class="notification-content">
     
    503503        };
    504504        jQuery(document).ready(function () {
     505            //convert unix time found in tr data attr to human date
     506            jQuery('#notifications > tbody  > tr').each(function() {
     507                var unix_value = jQuery(this).attr('data-unix');
     508                jQuery(this).find('td.submitted.date').html(moment.unix(unix_value).format('dddd, MMMM Do, YYYY h:mm:00a'));
     509            });
    505510            //canceling button notification
    506511            jQuery('.canceling_button').on('click', function (e) {
  • onesignal-sender/trunk/admin_menu/sections/send-nots.php

    r1703336 r1777691  
    5555                            <span class="section_title">DATE:</span>
    5656                            <input type="text" name="timepicker" class="timepicker"/>
    57         <!--                        <input id="time_picker_field" type="text" size="35" value="<?php // echo $_GET['src_date'];                                                             ?>"
     57        <!--                        <input id="time_picker_field" type="text" size="35" value="<?php // echo $_GET['src_date'];                                                               ?>"
    5858                                   name="src_date" placeholder="Enter username to search"/>-->
    5959                        </div>
     
    369369            jQuery(function ($) {
    370370                $('.timepicker').intimidatetime({
    371                     format: 'yyyy-MM-dd hh:mm:00tt',
    372                     previewFormat: 'yyyy-MM-dd hh:mmtt'
     371                    format: 'yyyy-MM-dd HH:mm:00',
     372                    previewFormat: 'yyyy-MM-dd HH:mm'
    373373                });
    374374            });
     
    393393                var notify_message = jQuery('#notification-message').val();
    394394                var notify_time = jQuery('.timepicker').val();
     395                var timestamp = moment(notify_time).format("X");
     396                var offset_in_min = (moment().utcOffset() * 60);
     397                alert(timestamp);
    395398                var notify_url = jQuery('#notification-url').val();
    396399                var nonce = jQuery(this).attr("data-nonce");
     
    426429                        if (notify_title && notify_message && notify_time) {
    427430                            loader.fadeIn();
    428                             jQuery.ajax({
    429                                 type: "post",
    430                                 dataType: "json",
    431                                 url: ajax_url,
    432                                 data: {action: "oss_sending_the_msg", nonce: nonce, selected_method: selected_method,
    433                                     notify_title: notify_title, notify_message: notify_message, notify_time: notify_time, notify_url: notify_url},
    434                                 success: function (response) {
    435                                     loader.fadeOut();
    436                                     if (response.type == "success") {
    437                                         jQuery('.ajax_result').html('<h5 style="color : green ">Message ' + response.msgstatus + '. Refreshing...</h5>');
    438                                         function reload() {
    439                                             location.reload(true);
     431                                jQuery.ajax({
     432                                    type: "post",
     433                                    dataType: "json",
     434                                    url: ajax_url,
     435                                    data: {action: "oss_sending_the_msg", nonce: nonce, selected_method: selected_method,
     436                                        notify_title: notify_title, notify_message: notify_message, notify_time: timestamp, notify_url: notify_url},
     437                                    success: function (response) {
     438                                        loader.fadeOut();
     439                                        if (response.type == "success") {
     440                                            jQuery('.ajax_result').html('<h5 style="color : green ">Message ' + response.msgstatus + '. Refreshing...</h5>');
     441        //                                        function reload() {
     442        //                                            location.reload(true);
     443        //                                        }
     444        //                                        setTimeout(reload, 1000);
     445                                        } else {
     446                                            jQuery('.ajax_result').html('<h5 style="color : red ">There was an error! Please try again.</h5>');
    440447                                        }
    441                                         setTimeout(reload, 1000);
    442                                     } else {
    443                                         jQuery('.ajax_result').html('<h5 style="color : red ">There was an error! Please try again.</h5>');
    444448                                    }
    445                                 }
    446                             });
     449                                });
    447450                        } else {
    448451                            jQuery('.ajax_result').html('<h5 style="color : red ">Please Select the schedule, fill the Date, Title and Message.</h5>');
  • onesignal-sender/trunk/admin_menu/sections/sent-nots.php

    r1703336 r1777691  
    7979                                        $if_canceled = $response_array['canceled'];
    8080                                        $notification_url = $response_array['url'];
    81                                         $notification_queued_at = $response_array['queued_at'] + 10800;
     81                                        $notification_queued_at = $response_array['queued_at'];
    8282                                        $final_readable_date_queued = date('d, F Y h:i:00a', $notification_queued_at);
    83                                         $final_readable_date_after = date('d, F Y h:i:00a', $notification_send_after + 10800);
     83                                        $final_readable_date_after = date('d, F Y h:i:00a', $notification_send_after);
    8484                                        $notification_message = $response_array['contents']['en'];
    8585                                        $notification_converted = $response_array['converted'];
     
    100100                                $decimal_not_converted = 100 - $decimal_converted;
    101101                                        ?>
    102                                         <tr class="notification-entry">
     102                                        <tr class="notification-entry" data-unix="<?php echo $notification_send_after; ?>">
    103103                                            <td colspan="2" class="one action text-center">
    104104                                        <span data-not-converted="<?php echo round($decimal_not_converted); ?>" data-converted="<?php echo round($decimal_converted); ?>" data-failed="<?php echo round($decimal_failed); ?>" data-delivered="<?php echo round($decimal_delivered); ?>" data-pending="<?php echo round($decimal_pending); ?>" class="view_statistics_button">View Statistics</span>
     
    110110                                            </td>
    111111                                            <td colspan="2" class="submitted date">
    112                                                 <?php echo $final_readable_date_after; ?>
     112                                                -
    113113                                            </td>
    114114                                            <td colspan="2" class="notification-content">
     
    178178        <script type="text/javascript">
    179179        jQuery(document).ready(function () {
     180            //convert unix time found in tr data attr to human date
     181            jQuery('#notifications > tbody  > tr').each(function() {
     182                var unix_value = jQuery(this).attr('data-unix');
     183                jQuery(this).find('td.submitted.date').html(moment.unix(unix_value).format('dddd, MMMM Do, YYYY h:mm:00a'));
     184            });
    180185         //on click open statistics div and scroll up
    181186//            var notification_failed;
  • onesignal-sender/trunk/readme.txt

    r1704291 r1777691  
    66Tags: onesignal, web push notifications, backend, dashboard
    77Requires at least: 3.8.0
    8 Stable tag: 1.1
    9 Tested up to: 4.8
     8Stable tag: 1.2
     9Tested up to: 4.9
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6262== Changelog ==
    6363
     64= 1.2 =
     65
     66* Scheduling feature bug fixed
     67
    6468= 1.1 =
    6569
Note: See TracChangeset for help on using the changeset viewer.