| 10 | | if(form.addEventListener) { |
|---|
| 11 | | form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false); |
|---|
| 12 | | } |
|---|
| 13 | | if(form.attachEvent) { |
|---|
| 14 | | form.save ? form.save.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
|---|
| 15 | | form.submit ? form.submit.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
|---|
| 16 | | form.publish ? form.publish.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
|---|
| 17 | | form.deletepost ? form.deletepost.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
|---|
| 18 | | } |
|---|
| | 9 | jQuery("#post #submit").submit(function () { autosavePeriodical.currentlyExecuting = true; }); |
|---|
| | 10 | |
|---|
| | 11 | jQuery("#post #save").click(function () { autosavePeriodical.currentlyExecuting = true; }); |
|---|
| | 12 | jQuery("#post #submit").click(function () { autosavePeriodical.currentlyExecuting = true; }); |
|---|
| | 13 | jQuery("#post #publish").click(function () { autosavePeriodical.currentlyExecuting = true; }); |
|---|
| | 14 | jQuery("#post #deletepost").click(function () { autosavePeriodical.currentlyExecuting = true; }); |
|---|
| 46 | | nonceAjax = new sack(); |
|---|
| 47 | | nonceAjax.element = null; |
|---|
| 48 | | nonceAjax.setVar("action", "autosave-generate-nonces"); |
|---|
| 49 | | nonceAjax.setVar("post_ID", res); |
|---|
| 50 | | nonceAjax.setVar("cookie", document.cookie); |
|---|
| 51 | | nonceAjax.setVar("post_type", $('post_type').value); |
|---|
| 52 | | nonceAjax.requestFile = autosaveL10n.requestFile; |
|---|
| 53 | | nonceAjax.onCompletion = autosave_update_nonce; |
|---|
| 54 | | nonceAjax.method = "POST"; |
|---|
| 55 | | nonceAjax.runAJAX(); |
|---|
| 56 | | $('hiddenaction').value = 'editpost'; |
|---|
| | 36 | jQuery.post(autosaveL10n.requestFile, { |
|---|
| | 37 | data: { |
|---|
| | 38 | action: "autosave-generate-nonces", |
|---|
| | 39 | post_ID: res, |
|---|
| | 40 | cookie: document.cookie, |
|---|
| | 41 | post_type: jQuery('#post_type').val() |
|---|
| | 42 | }, |
|---|
| | 43 | }, function(html) { |
|---|
| | 44 | jQuery('#_wpnonce').val(html); |
|---|
| | 45 | }); |
|---|
| | 46 | jQuery('#hiddenaction').val('editpost'); |
|---|
| 81 | | var form = $('post'); |
|---|
| 82 | | form.save ? form.save.disabled = 'disabled' : null; |
|---|
| 83 | | form.submit ? form.submit.disabled = 'disabled' : null; |
|---|
| 84 | | form.publish ? form.publish.disabled = 'disabled' : null; |
|---|
| 85 | | form.deletepost ? form.deletepost.disabled = 'disabled' : null; |
|---|
| | 70 | jQuery("#post #save:enabled").attr('disabled', 'disabled'); |
|---|
| | 71 | jQuery("#post #submit:enabled").attr('disabled', 'disabled'); |
|---|
| | 72 | jQuery("#post #publish:enabled").attr('disabled', 'disabled'); |
|---|
| | 73 | jQuery("#post #deletepost:enabled").attr('disabled', 'disabled'); |
|---|
| 90 | | var form = $('post'); |
|---|
| 91 | | form.save ? form.save.disabled = '' : null; |
|---|
| 92 | | form.submit ? form.submit.disabled = '' : null; |
|---|
| 93 | | form.publish ? form.publish.disabled = '' : null; |
|---|
| 94 | | form.deletepost ? form.deletepost.disabled = '' : null; |
|---|
| | 78 | jQuery("#post #save:disabled").attr('disabled', ''); |
|---|
| | 79 | jQuery("#post #submit:disabled").attr('disabled', ''); |
|---|
| | 80 | jQuery("#post #publish:disabled").attr('disabled', ''); |
|---|
| | 81 | jQuery("#post #deletepost:disabled").attr('disabled', ''); |
|---|
| 128 | | autosaveAjax.setVar("action", "autosave"); |
|---|
| 129 | | autosaveAjax.setVar("cookie", document.cookie); |
|---|
| 130 | | autosaveAjax.setVar("catslist", catslist); |
|---|
| 131 | | autosaveAjax.setVar("post_ID", $("post_ID").value); |
|---|
| 132 | | autosaveAjax.setVar("post_title", form.post_title.value); |
|---|
| 133 | | autosaveAjax.setVar("post_type", form.post_type.value); |
|---|
| 134 | | autosaveAjax.setVar("tags_input", form.tags_input.value); |
|---|
| 135 | | if ( form.comment_status.checked ) |
|---|
| 136 | | autosaveAjax.setVar("comment_status", 'open'); |
|---|
| 137 | | if ( form.ping_status.checked ) |
|---|
| 138 | | autosaveAjax.setVar("ping_status", 'open'); |
|---|
| 139 | | if(form.excerpt) |
|---|
| 140 | | autosaveAjax.setVar("excerpt", form.excerpt.value); |
|---|
| | 121 | if ( jQuery("#comment_status").attr("checked") ) |
|---|
| | 122 | post_data["comment_status"] = 'open'; |
|---|
| | 123 | if ( jQuery("#ping_status").attr("checked") ) |
|---|
| | 124 | post_data["ping_status"] = 'open'; |
|---|
| | 125 | if( jQuery("#excerpt")) |
|---|
| | 126 | post_data["excerpt"] = jQuery("#excerpt").val(); |
|---|
| 149 | | autosaveAjax.requestFile = autosaveL10n.requestFile; |
|---|
| 150 | | autosaveAjax.method = "POST"; |
|---|
| 151 | | autosaveAjax.element = null; |
|---|
| 152 | | autosaveAjax.onLoading = autosave_loading; |
|---|
| 153 | | autosaveAjax.onInteractive = autosave_loading; |
|---|
| 154 | | if(parseInt($("post_ID").value) < 1) |
|---|
| 155 | | autosaveAjax.onCompletion = autosave_update_post_ID; |
|---|
| 156 | | else |
|---|
| 157 | | autosaveAjax.onCompletion = autosave_saved; |
|---|
| 158 | | autosaveAjax.runAJAX(); |
|---|
| | 135 | if(parseInt(jQuery("#post_ID").val()) < 1) { |
|---|
| | 136 | jQuery.ajaxSetup({ |
|---|
| | 137 | success: function(html) { autosave_update_post_ID(html); } |
|---|
| | 138 | }); |
|---|
| | 139 | } else { |
|---|
| | 140 | jQuery.ajaxSetup({ |
|---|
| | 141 | success: function(html) { autosave_saved(html); } |
|---|
| | 142 | }); |
|---|
| | 143 | } |
|---|
| | 144 | jQuery.ajax({ |
|---|
| | 145 | data: post_data, |
|---|
| | 146 | beforeSend: function() { autosave_loading() }, |
|---|
| | 147 | type: "POST", |
|---|
| | 148 | url: autosaveL10n.requestFile |
|---|
| | 149 | }); |
|---|