Changeset 4467
- Timestamp:
- 01/11/12 15:29:55 (4 months ago)
- Location:
- plugins/apostropheBlogPlugin/branches/1.5
- Files:
-
- 3 modified
-
modules/aBlogAdmin/templates/editSuccess.php (modified) (1 diff)
-
modules/aEventAdmin/templates/editSuccess.php (modified) (1 diff)
-
web/js/aBlog.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostropheBlogPlugin/branches/1.5/modules/aBlogAdmin/templates/editSuccess.php
r3495 r4467 15 15 <div class="a-ui a-subnav-wrapper a-admin-sidebar"> 16 16 <div class="a-subnav-inner"> 17 <div id="a-uia-admin-blog-post-form">17 <div class="a-admin-blog-post-form"> 18 18 <form method="post" action="<?php echo url_for('a_blog_admin_update', $a_blog_post) ?>" id="a-admin-form" class="a-ui blog"> 19 19 <?php include_partial('aBlogAdmin/form', array('form' => $form, 'a_blog_post' => $a_blog_post, 'popularTags' => $popularTags, 'existingTags' => $existingTags)) ?> -
plugins/apostropheBlogPlugin/branches/1.5/modules/aEventAdmin/templates/editSuccess.php
r3495 r4467 15 15 <div class="a-ui a-subnav-wrapper a-admin-sidebar"> 16 16 <div class="a-subnav-inner"> 17 <div id="a-ui a-admin-blog-post-form"> 17 <?php // Yes I meant to set both classes, this way the event form can define small variations ?> 18 <?php // on what goes for the similar blog post form and we can select both when checking ?> 19 <?php // onbeforeunload with just one selector ?> 20 <div class="a-admin-blog-post-form a-admin-event-form"> 18 21 <form method="post" action="<?php echo url_for('a_event_admin_update', $a_event) ?>" id="a-admin-form" class="a-ui blog"> 19 22 <?php include_partial('aEventAdmin/form', array('form' => $form, 'a_event' => $a_event, 'popularTags' => $popularTags, 'existingTags' => $existingTags)) ?> -
plugins/apostropheBlogPlugin/branches/1.5/web/js/aBlog.js
r4449 r4467 73 73 function aBlogEnableForm(options) 74 74 { 75 var changed = false;76 75 var savedState = null; 77 76 var form = $('#a-admin-form'); 77 form.data('changed', false); 78 78 79 apostrophe.formUpdates({ selector: '#a-admin-form', update: 'a-admin-form' }); 79 80 // Due to the way our markup is structured this is a better place for the little … … 105 106 find('.a-save-blog-main .label').text(options['update-labels'][s]); 106 107 } 108 if (!init) 109 { 110 form.data('changed', true); 111 } 107 112 init = false; 108 113 }); 109 114 status.change(); 110 115 116 // On various fields, including the progressively enhanced fields whose PE code has been upgraded 117 // to send change events, just monitor change() and set the changed flag so it can be checked 118 // by onbeforeunload 119 120 form.find('#a_blog_item_location,#a_blog_item_all_day,#a_blog_item_start_date_month,#a_blog_item_start_date_day,#a_blog_item_start_date_year,#a_blog_item_start_time_hour,#a_blog_item_start_time_minute,#a_blog_item_end_date_month,#a_blog_item_end_date_day,#a_blog_item_end_date_year,#a_blog_item_end_time_hour,#a_blog_item_end_time_minute,#a_blog_item_published_at_hour,#a_blog_item_published_at_minute,#a_blog_item_author_id,#a-blog-post-tags-input').change(function() { 121 form.data('changed', true); 122 }); 123 124 // Listen to keystrokes in the location field. In Chrome at least, text fields don't get a 125 // change() event when you type in them and then click a link elsewhere on the page that leaves 126 // the page, so we need something else 127 form.find('#a_blog_item_location').keyup(function() { 128 form.data('changed', true); 129 }); 130 111 131 find('.template.section select').change(function() { 112 132 alert(options['template-change-warning']); 113 // Let the form submit as a full refresh 133 // Let the form submit as a full refresh. Don't complain of unsaved changes when we're about to save changes 134 $(form).data('changed', false); 114 135 $(form).unbind('submit.aFormUpdates'); 115 136 }); … … 121 142 }); 122 143 123 var p = { 'choose-one': options['editors-choose-label'] }; 144 var p = { 'choose-one': options['editors-choose-label'], 'onChange': function() { 145 form.data('changed', true); 146 } }; 124 147 aMultipleSelect('#editors-section', p); 125 p = { 'choose-one': options['categories-choose-label'] }; 148 p = { 'choose-one': options['categories-choose-label'], 'onChange': function() { 149 form.data('changed', true); 150 } }; 126 151 if (options['categories-add']) 127 152 {

