To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 4466

Show
Ignore:
Timestamp:
01/11/12 15:29:25 (4 months ago)
Author:
tboutell
Message:

* Date widget sends change() events to the widgets it is enhancing
* timepicker2 (and therefore our time widget) sends change() events to the the widgets it is enhancing
* apostrophe.onBeforeUnload is called from globalJavascripts. If there is an edit view visible, or there is an event or blog post metadata form claiming to have unsaved changes, and the user tries to leave the page, they are warned that they may have unsaved data

Location:
plugins/apostrophePlugin/branches/1.5
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/branches/1.5/lib/widget/aWidgetFormJQueryDate.class.php

    r3508 r4466  
    125125    \$(day).val(''); 
    126126    \$(year).val(''); 
     127    \$(month).change(); 
     128    \$(day).change(); 
     129    \$(year).change(); 
    127130    return; 
    128131  } 
     
    132135  \$(day).val(components[2].replace(/^0+/, '')); 
    133136  \$(year).val(components[3].replace(/^0+/, '')); 
     137  \$(month).change(); 
     138  \$(day).change(); 
     139  \$(year).change(); 
    134140   
    135141  // Something we can bind to update other fields  
  • plugins/apostrophePlugin/branches/1.5/modules/a/templates/_globalJavascripts.php

    r4313 r4466  
    2121<?php // A handful of fundamental improvements like a-autosubmit for anchor buttons ?> 
    2222<?php a_js_call('apostrophe.smartCSS()') ?> 
     23<?php // Warn the user if they try to leave the page and it has open slot editors on it ?> 
     24<?php a_js_call('apostrophe.onBeforeUnload()') ?> 
    2325<?php // End of body - time to emit all of the queued JS as one script block ?> 
    2426 
  • plugins/apostrophePlugin/branches/1.5/web/js/a.js

    r4459 r4466  
    22742274        }; 
    22752275 
     2276  this.onBeforeUnload = function() 
     2277  { 
     2278    $(window).unbind('beforeunload.apostrophe').bind('beforeunload.apostrophe', function() { 
     2279      // Event first since it gets both classes 
     2280      if ($('.a-admin-event-form form').data('changed')) 
     2281      { 
     2282        return "You have not saved your changes to the settings for this event in the form at left. Any edits you have made will be lost if you do not save them first before leaving the page."; 
     2283      } 
     2284      if ($('.a-admin-blog-post-form form').data('changed')) 
     2285      { 
     2286        return "You have not saved your changes to the settings for this blog post in the form at left. Any edits you have made will be lost if you do not save them first before leaving the page."; 
     2287      } 
     2288      if ($('.a-slot.a-editing').length) 
     2289      { 
     2290        return "You are still editing content. Any edits you have made will be lost if you do not save them first before leaving the page."; 
     2291      } 
     2292    }); 
     2293  } 
     2294   
    22762295        // Breaks the url into a stem (everything before the query, inclusive of the ?), a query 
    22772296        // (the encoded query string), and queryData (the query string parsed into an object) 
  • plugins/apostrophePlugin/branches/1.5/web/js/timepicker.js

    r3480 r4466  
    206206                                $(inputs[0]).val(time.hours); 
    207207                                $(inputs[1]).val(time.minutes); 
     208                                $(inputs[0]).change(); 
     209                                $(inputs[1]).change(); 
    208210                        } 
    209211                }