/** * @file Contains all dynamic functionality needed on post and term pages. * * @output wp-admin/js/post.js */ /* global ajaxurl, wpAjax, postboxes, pagenow, tinymce, alert, deleteUserSetting, ClipboardJS */ /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply, commentsBox */ /* global WPSetThumbnailHTML, wptitlehint */ // Backward compatibility: prevent fatal errors. window.makeSlugeditClickable = window.editPermalink = function(){}; // Make sure the wp object exists. window.wp = window.wp || {}; ( function( $ ) { var titleHasFocus = false, __ = wp.i18n.__; /** * Control loading of comments on the post and term edit pages. * * @type {{st: number, get: commentsBox.get, load: commentsBox.load}} * * @namespace commentsBox */ window.commentsBox = { // Comment offset to use when fetching new comments. st : 0, /** * Fetch comments using Ajax and display them in the box. * * @memberof commentsBox * * @param {number} total Total number of comments for this post. * @param {number} num Optional. Number of comments to fetch, defaults to 20. * @return {boolean} Always returns false. */ get : function(total, num) { var st = this.st, data; if ( ! num ) num = 20; this.st += num; this.total = total; $( '#commentsdiv .spinner' ).addClass( 'is-active' ); data = { 'action' : 'get-comments', 'mode' : 'single', '_ajax_nonce' : $('#add_comment_nonce').val(), 'p' : $('#post_ID').val(), 'start' : st, 'number' : num }; $.post( ajaxurl, data, function(r) { r = wpAjax.parseAjaxResponse(r); $('#commentsdiv .widefat').show(); $( '#commentsdiv .spinner' ).removeClass( 'is-active' ); if ( 'object' == typeof r && r.responses[0] ) { $('#the-comment-list').append( r.responses[0].data ); theList = theExtraList = null; $( 'a[className*=\':\']' ).off(); // If the offset is over the total number of comments we cannot fetch any more, so hide the button. if ( commentsBox.st > commentsBox.total ) $('#show-comments').hide(); else $('#show-comments').show().children('a').text( __( 'Show more comments' ) ); return; } else if ( 1 == r ) { $('#show-comments').text( __( 'No more comments found.' ) ); return; } $('#the-comment-list').append(''+wpAjax.broken+''); } ); return false; }, /** * Load the next batch of comments. * * @memberof commentsBox * * @param {number} total Total number of comments to load. */ load: function(total){ this.st = jQuery('#the-comment-list tr.comment:visible').length; this.get(total); } }; /** * Overwrite the content of the Featured Image postbox * * @param {string} html New HTML to be displayed in the content area of the postbox. * * @global */ window.WPSetThumbnailHTML = function(html){ $('.inside', '#postimagediv').html(html); }; /** * Set the Image ID of the Featured Image * * @param {number} id The post_id of the image to use as Featured Image. * * @global */ window.WPSetThumbnailID = function(id){ var field = $('input[value="_thumbnail_id"]', '#list-table'); if ( field.length > 0 ) { $('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id); } }; /** * Remove the Featured Image * * @param {string} nonce Nonce to use in the request. * * @global */ window.WPRemoveThumbnail = function(nonce){ $.post( ajaxurl, { action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) }, /** * Handle server response * * @param {string} str Response, will be '0' when an error occurred otherwise contains link to add Featured Image. */ function(str){ if ( str == '0' ) { alert( __( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); } else { WPSetThumbnailHTML(str); } } ); }; /** * Heartbeat locks. * * Used to lock editing of an object by only one user at a time. * * When the user does not send a heartbeat in a heartbeat-time * the user is no longer editing and another user can start editing. */ $(document).on( 'heartbeat-send.refresh-lock', function( e, data ) { var lock = $('#active_post_lock').val(), post_id = $('#post_ID').val(), send = {}; if ( ! post_id || ! $('#post-lock-dialog').length ) return; send.post_id = post_id; if ( lock ) send.lock = lock; data['wp-refresh-post-lock'] = send; }).on( 'heartbeat-tick.refresh-lock', function( e, data ) { // Post locks: update the lock string or show the dialog if somebody has taken over editing. var received, wrap, avatar; if ( data['wp-refresh-post-lock'] ) { received = data['wp-refresh-post-lock']; if ( received.lock_error ) { // Show "editing taken over" message. wrap = $('#post-lock-dialog'); if ( wrap.length && ! wrap.is(':visible') ) { if ( wp.autosave ) { // Save the latest changes and disable. $(document).one( 'heartbeat-tick', function() { wp.autosave.server.suspend(); wrap.removeClass('saving').addClass('saved'); $(window).off( 'beforeunload.edit-post' ); }); wrap.addClass('saving'); wp.autosave.server.triggerSave(); } if ( received.lock_error.avatar_src ) { avatar = $( '', { 'class': 'avatar avatar-64 photo', width: 64, height: 64, alt: '', src: received.lock_error.avatar_src, srcset: received.lock_error.avatar_src_2x ? received.lock_error.avatar_src_2x + ' 2x' : undefined } ); wrap.find('div.post-locked-avatar').empty().append( avatar ); } wrap.show().find('.currently-editing').text( received.lock_error.text ); wrap.find('.wp-tab-first').trigger( 'focus' ); } } else if ( received.new_lock ) { $('#active_post_lock').val( received.new_lock ); } } }).on( 'before-autosave.update-post-slug', function() { titleHasFocus = document.activeElement && document.activeElement.id === 'title'; }).on( 'after-autosave.update-post-slug', function() { /* * Create slug area only if not already there * and the title field was not focused (user was not typing a title) when autosave ran. */ if ( ! $('#edit-slug-box > *').length && ! titleHasFocus ) { $.post( ajaxurl, { action: 'sample-permalink', post_id: $('#post_ID').val(), new_title: $('#title').val(), samplepermalinknonce: $('#samplepermalinknonce').val() }, function( data ) { if ( data != '-1' ) { $('#edit-slug-box').html(data); } } ); } }); }(jQuery)); /** * Heartbeat refresh nonces. */ (function($) { var check, timeout; /** * Only allow to check for nonce refresh every 30 seconds. */ function schedule() { check = false; window.clearTimeout( timeout ); timeout = window.setTimeout( function(){ check = true; }, 300000 ); } $( function() { schedule(); }).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) { var post_id, $authCheck = $('#wp-auth-check-wrap'); if ( check || ( $authCheck.length && ! $authCheck.hasClass( 'hidden' ) ) ) { if ( ( post_id = $('#post_ID').val() ) && $('#_wpnonce').val() ) { data['wp-refresh-post-nonces'] = { post_id: post_id }; } } }).on( 'heartbeat-tick.wp-refresh-nonces', function( e, data ) { var nonces = data['wp-refresh-post-nonces']; if ( nonces ) { schedule(); if ( nonces.replace ) { $.each( nonces.replace, function( selector, value ) { $( '#' + selector ).val( value ); }); } if ( nonces.heartbeatNonce ) window.heartbeatSettings.nonce = nonces.heartbeatNonce; } }); }(jQuery)); /** * All post and postbox controls and functionality. */ jQuery( function($) { var stamp, visibility, $submitButtons, updateVisibility, updateText, $textarea = $('#content'), $document = $(document), postId = $('#post_ID').val() || 0, $submitpost = $('#submitpost'), releaseLock = true, $postVisibilitySelect = $('#post-visibility-select'), $timestampdiv = $('#timestampdiv'), $postStatusSelect = $('#post-status-select'), isMac = window.navigator.platform ? window.navigator.platform.indexOf( 'Mac' ) !== -1 : false, copyAttachmentURLClipboard = new ClipboardJS( '.copy-attachment-url.edit-media' ), copyAttachmentURLSuccessTimeout, __ = wp.i18n.__, _x = wp.i18n._x; postboxes.add_postbox_toggles(pagenow); /* * Clear the window name. Otherwise if this is a former preview window where the user navigated to edit another post, * and the first post is still being edited, clicking Preview there will use this window to show the preview. */ window.name = ''; // Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item. $('#post-lock-dialog .notification-dialog').on( 'keydown', function(e) { // Don't do anything when [Tab] is pressed. if ( e.which != 9 ) return; var target = $(e.target); // [Shift] + [Tab] on first tab cycles back to last tab. if ( target.hasClass('wp-tab-first') && e.shiftKey ) { $(this).find('.wp-tab-last').trigger( 'focus' ); e.preventDefault(); // [Tab] on last tab cycles back to first tab. } else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) { $(this).find('.wp-tab-first').trigger( 'focus' ); e.preventDefault(); } }).filter(':visible').find('.wp-tab-first').trigger( 'focus' ); // Set the heartbeat interval to 10 seconds if post lock dialogs are enabled. if ( wp.heartbeat && $('#post-lock-dialog').length ) { wp.heartbeat.interval( 10 ); } // The form is being submitted by the user. $submitButtons = $submitpost.find( ':submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) { var $button = $(this); if ( $button.hasClass('disabled') ) { event.preventDefault(); return; } if ( $button.hasClass('submitdelete') || $button.is( '#post-preview' ) ) { return; } // The form submission can be blocked from JS or by using HTML 5.0 validation on some fields. // Run this only on an actual 'submit'. $('form#post').off( 'submit.edit-post' ).on( 'submit.edit-post', function( event ) { if ( event.isDefaultPrevented() ) { return; } // Stop auto save. if ( wp.autosave ) { wp.autosave.server.suspend(); } if ( typeof commentReply !== 'undefined' ) { /* * Warn the user they have an unsaved comment before submitting * the post data for update. */ if ( ! commentReply.discardCommentChanges() ) { return false; } /* * Close the comment edit/reply form if open to stop the form * action from interfering with the post's form action. */ commentReply.close(); } releaseLock = false; $(window).off( 'beforeunload.edit-post' ); $submitButtons.addClass( 'disabled' ); if ( $button.attr('id') === 'publish' ) { $submitpost.find( '#major-publishing-actions .spinner' ).addClass( 'is-active' ); } else { $submitpost.find( '#minor-publishing .spinner' ).addClass( 'is-active' ); } }); }); // Submit the form saving a draft or an autosave, and show a preview in a new tab. $('#post-preview').on( 'click.post-preview', function( event ) { var $this = $(this), $form = $('form#post'), $previewField = $('input#wp-preview'), target = $this.attr('target') || 'wp-preview', ua = navigator.userAgent.toLowerCase(); event.preventDefault(); if ( $this.hasClass('disabled') ) { return; } if ( wp.autosave ) { wp.autosave.server.tempBlockSave(); } $previewField.val('dopreview'); $form.attr( 'target', target ).trigger( 'submit' ).attr( 'target', '' ); // Workaround for WebKit bug preventing a form submitting twice to the same action. // https://bugs.webkit.org/show_bug.cgi?id=28633 if ( ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1 ) { $form.attr( 'action', function( index, value ) { return value + '?t=' + ( new Date() ).getTime(); }); } $previewField.val(''); }); // Auto save new posts after a title is typed. if ( $( '#auto_draft' ).val() ) { $( '#title' ).on( 'blur', function() { var cancel; if ( ! this.value || $('#edit-slug-box > *').length ) { return; } // Cancel the auto save when the blur was triggered by the user submitting the form. $('form#post').one( 'submit', function() { cancel = true; }); window.setTimeout( function() { if ( ! cancel && wp.autosave ) { wp.autosave.server.triggerSave(); } }, 200 ); }); } $document.on( 'autosave-disable-buttons.edit-post', function() { $submitButtons.addClass( 'disabled' ); }).on( 'autosave-enable-buttons.edit-post', function() { if ( ! wp.heartbeat || ! wp.heartbeat.hasConnectionError() ) { $submitButtons.removeClass( 'disabled' ); } }).on( 'before-autosave.edit-post', function() { $( '.autosave-message' ).text( __( 'Saving Draft…' ) ); }).on( 'after-autosave.edit-post', function( event, data ) { $( '.autosave-message' ).text( data.message ); if ( $( document.body ).hasClass( 'post-new-php' ) ) { $( '.submitbox .submitdelete' ).show(); } }); /* * When the user is trying to load another page, or reloads current page * show a confirmation dialog when there are unsaved changes. */ $( window ).on( 'beforeunload.edit-post', function( event ) { var editor = window.tinymce && window.tinymce.get( 'content' ); var changed = false; if ( wp.autosave ) { changed = wp.autosave.server.postChanged(); } else if ( editor ) { changed = ( ! editor.isHidden() && editor.isDirty() ); } if ( changed ) { event.preventDefault(); // The return string is needed for browser compat. // See https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event. return __( 'The changes you made will be lost if you navigate away from this page.' ); } }).on( 'pagehide.edit-post', function( event ) { if ( ! releaseLock ) { return; } /* * Unload is triggered (by hand) on removing the Thickbox iframe. * Make sure we process only the main document unload. */ if ( event.target && event.target.nodeName != '#document' ) { return; } var postID = $('#post_ID').val(); var postLock = $('#active_post_lock').val(); if ( ! postID || ! postLock ) { return; } var data = { action: 'wp-remove-post-lock', _wpnonce: $('#_wpnonce').val(), post_ID: postID, active_post_lock: postLock }; if ( window.FormData && window.navigator.sendBeacon ) { var formData = new window.FormData(); $.each( data, function( key, value ) { formData.append( key, value ); }); if ( window.navigator.sendBeacon( ajaxurl, formData ) ) { return; } } // Fall back to a synchronous POST request. // See https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon $.post({ async: false, data: data, url: ajaxurl }); }); // Multiple taxonomies. if ( $('#tagsdiv-post_tag').length ) { window.tagBox && window.tagBox.init(); } else { $('.meta-box-sortables').children('div.postbox').each(function(){ if ( this.id.indexOf('tagsdiv-') === 0 ) { window.tagBox && window.tagBox.init(); return false; } }); } // Handle categories. $('.categorydiv').each( function(){ var this_id = $(this).attr('id'), catAddBefore, catAddAfter, taxonomyParts, taxonomy, settingName; taxonomyParts = this_id.split('-'); taxonomyParts.shift(); taxonomy = taxonomyParts.join('-'); settingName = taxonomy + '_tab'; if ( taxonomy == 'category' ) { settingName = 'cats'; } // @todo Move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js. $('a', '#' + taxonomy + '-tabs').on( 'click', function( e ) { e.preventDefault(); var t = $(this).attr('href'); $(this).parent().addClass('tabs').siblings('li').removeClass('tabs'); $('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide(); $(t).show(); if ( '#' + taxonomy + '-all' == t ) { deleteUserSetting( settingName ); } else { setUserSetting( settingName, 'pop' ); } }); if ( getUserSetting( settingName ) ) $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').trigger( 'click' ); // Add category button controls. $('#new' + taxonomy).one( 'focus', function() { $( this ).val( '' ).removeClass( 'form-input-tip' ); }); // On [Enter] submit the taxonomy. $('#new' + taxonomy).on( 'keypress', function(event){ if( 13 === event.keyCode ) { event.preventDefault(); $('#' + taxonomy + '-add-submit').trigger( 'click' ); } }); // After submitting a new taxonomy, re-focus the input field. $('#' + taxonomy + '-add-submit').on( 'click', function() { $('#new' + taxonomy).trigger( 'focus' ); }); /** * Before adding a new taxonomy, disable submit button. * * @param {Object} s Taxonomy object which will be added. * * @return {Object} */ catAddBefore = function( s ) { if ( !$('#new'+taxonomy).val() ) { return false; } s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize(); $( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true ); return s; }; /** * Re-enable submit button after a taxonomy has been added. * * Re-enable submit button. * If the taxonomy has a parent place the taxonomy underneath the parent. * * @param {Object} r Response. * @param {Object} s Taxonomy data. * * @return {void} */ catAddAfter = function( r, s ) { var sup, drop = $('#new'+taxonomy+'_parent'); $( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false ); if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) { drop.before(sup); drop.remove(); } }; $('#' + taxonomy + 'checklist').wpList({ alt: '', response: taxonomy + '-ajax-response', addBefore: catAddBefore, addAfter: catAddAfter }); // Add new taxonomy button toggles input form visibility. $('#' + taxonomy + '-add-toggle').on( 'click', function( e ) { e.preventDefault(); $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' ); $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').trigger( 'click' ); $('#new'+taxonomy).trigger( 'focus' ); }); // Sync checked items between "All {taxonomy}" and "Most used" lists. $('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 'click', 'li.popular-category > label input[type="checkbox"]', function() { var t = $(this), c = t.is(':checked'), id = t.val(); if ( id && t.parents('#taxonomy-'+taxonomy).length ) { // Fixed for ticket #62504. See https://core.trac.wordpress.org/ticket/62504. $('input#in-' + taxonomy + '-' + id + ', input[id^="in-' + taxonomy + '-' + id + '-"]').prop('checked', c); $('input#in-popular-' + taxonomy + '-' + id).prop('checked', c); } } ); }); // End cats. // Custom Fields postbox. if ( $('#postcustom').length ) { $( '#the-list' ).wpList( { /** * Add current post_ID to request to fetch custom fields * * @ignore * * @param {Object} s Request object. * * @return {Object} Data modified with post_ID attached. */ addBefore: function( s ) { s.data += '&post_id=' + $('#post_ID').val(); return s; }, /** * Show the listing of custom fields after fetching. * * @ignore */ addAfter: function() { $('table#list-table').show(); } }); } /* * Publish Post box (#submitdiv) */ if ( $('#submitdiv').length ) { stamp = $('#timestamp').html(); visibility = $('#post-visibility-display').html(); /** * When the visibility of a post changes sub-options should be shown or hidden. * * @ignore * * @return {void} */ updateVisibility = function() { // Show sticky for public posts. if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) { $('#sticky').prop('checked', false); $('#sticky-span').hide(); } else { $('#sticky-span').show(); } // Show password input field for password protected post. if ( $postVisibilitySelect.find('input:radio:checked').val() != 'password' ) { $('#password-span').hide(); } else { $('#password-span').show(); } }; /** * Make sure all labels represent the current settings. * * @ignore * * @return {boolean} False when an invalid timestamp has been selected, otherwise True. */ updateText = function() { if ( ! $timestampdiv.length ) return true; var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'), optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(); attemptedDate = new Date( aa, mm - 1, jj, hh, mn ); originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() ); currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); // Catch unexpected date problems. if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) { $timestampdiv.find('.timestamp-wrap').addClass('form-invalid'); return false; } else { $timestampdiv.find('.timestamp-wrap').removeClass('form-invalid'); } // Determine what the publish should be depending on the date and post status. if ( attemptedDate > currentDate ) { publishOn = __( 'Schedule for:' ); $('#publish').val( _x( 'Schedule', 'post action/button label' ) ); } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) { publishOn = __( 'Publish on:' ); $('#publish').val( __( 'Publish' ) ); } else { publishOn = __( 'Published on:' ); $('#publish').val( __( 'Update' ) ); } // If the date is the same, set it to trigger update events. if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { // Re-set to the current value. $('#timestamp').html(stamp); } else { $('#timestamp').html( '\n' + publishOn + ' ' + // translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. __( '%1$s %2$s, %3$s at %4$s:%5$s' ) .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) ) .replace( '%2$s', parseInt( jj, 10 ) ) .replace( '%3$s', aa ) .replace( '%4$s', ( '00' + hh ).slice( -2 ) ) .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) + ' ' ); } // Add "privately published" to post status when applies. if ( $postVisibilitySelect.find('input:radio:checked').val() == 'private' ) { $('#publish').val( __( 'Update' ) ); if ( 0 === optPublish.length ) { postStatus.append(''); } else { optPublish.html( __( 'Privately Published' ) ); } $('option[value="publish"]', postStatus).prop('selected', true); $('#misc-publishing-actions .edit-post-status').hide(); } else { if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) { if ( optPublish.length ) { optPublish.remove(); postStatus.val($('#hidden_post_status').val()); } } else { optPublish.html( __( 'Published' ) ); } if ( postStatus.is(':hidden') ) $('#misc-publishing-actions .edit-post-status').show(); } // Update "Status:" to currently selected status. $('#post-status-display').text( // Remove any potential tags from post status text. wp.sanitize.stripTagsAndEncodeText( $('option:selected', postStatus).text() ) ); // Show or hide the "Save Draft" button. if ( $('option:selected', postStatus).val() == 'private' || $('option:selected', postStatus).val() == 'publish' ) { $('#save-post').hide(); } else { $('#save-post').show(); if ( $('option:selected', postStatus).val() == 'pending' ) { $('#save-post').show().val( __( 'Save as Pending' ) ); } else { $('#save-post').show().val( __( 'Save Draft' ) ); } } return true; }; // Show the visibility options and hide the toggle button when opened. $( '#visibility .edit-visibility').on( 'click', function( e ) { e.preventDefault(); if ( $postVisibilitySelect.is(':hidden') ) { updateVisibility(); $postVisibilitySelect.slideDown( 'fast', function() { $postVisibilitySelect.find( 'input[type="radio"]' ).first().trigger( 'focus' ); } ); $(this).hide(); } }); // Cancel visibility selection area and hide it from view. $postVisibilitySelect.find('.cancel-post-visibility').on( 'click', function( event ) { $postVisibilitySelect.slideUp('fast'); $('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true); $('#post_password').val($('#hidden-post-password').val()); $('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked')); $('#post-visibility-display').html(visibility); $('#visibility .edit-visibility').show().trigger( 'focus' ); updateText(); event.preventDefault(); }); // Set the selected visibility as current. $postVisibilitySelect.find('.save-post-visibility').on( 'click', function( event ) { // Crazyhorse branch - multiple OK cancels. var visibilityLabel = '', selectedVisibility = $postVisibilitySelect.find('input:radio:checked').val(); $postVisibilitySelect.slideUp('fast'); $('#visibility .edit-visibility').show().trigger( 'focus' ); updateText(); if ( 'public' !== selectedVisibility ) { $('#sticky').prop('checked', false); } switch ( selectedVisibility ) { case 'public': visibilityLabel = $( '#sticky' ).prop( 'checked' ) ? __( 'Public, Sticky' ) : __( 'Public' ); break; case 'private': visibilityLabel = __( 'Private' ); break; case 'password': visibilityLabel = __( 'Password Protected' ); break; } $('#post-visibility-display').text( visibilityLabel ); event.preventDefault(); }); // When the selection changes, update labels. $postVisibilitySelect.find('input:radio').on( 'change', function() { updateVisibility(); }); // Edit publish time click. $timestampdiv.siblings('a.edit-timestamp').on( 'click', function( event ) { if ( $timestampdiv.is( ':hidden' ) ) { $timestampdiv.slideDown( 'fast', function() { $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().trigger( 'focus' ); } ); $(this).hide(); } event.preventDefault(); }); // Cancel editing the publish time and hide the settings. $timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) { $timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().trigger( 'focus' ); $('#mm').val($('#hidden_mm').val()); $('#jj').val($('#hidden_jj').val()); $('#aa').val($('#hidden_aa').val()); $('#hh').val($('#hidden_hh').val()); $('#mn').val($('#hidden_mn').val()); updateText(); event.preventDefault(); }); // Save the changed timestamp. $timestampdiv.find('.save-timestamp').on( 'click', function( event ) { // Crazyhorse branch - multiple OK cancels. if ( updateText() ) { $timestampdiv.slideUp('fast'); $timestampdiv.siblings('a.edit-timestamp').show().trigger( 'focus' ); } event.preventDefault(); }); // Cancel submit when an invalid timestamp has been selected. $('#post').on( 'submit', function( event ) { if ( ! updateText() ) { event.preventDefault(); $timestampdiv.show(); if ( wp.autosave ) { wp.autosave.enableButtons(); } $( '#publishing-action .spinner' ).removeClass( 'is-active' ); } }); // Post Status edit click. $postStatusSelect.siblings('a.edit-post-status').on( 'click', function( event ) { if ( $postStatusSelect.is( ':hidden' ) ) { $postStatusSelect.slideDown( 'fast', function() { $postStatusSelect.find('select').trigger( 'focus' ); } ); $(this).hide(); } event.preventDefault(); }); // Save the Post Status changes and hide the options. $postStatusSelect.find('.save-post-status').on( 'click', function( event ) { $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' ); updateText(); event.preventDefault(); }); // Cancel Post Status editing and hide the options. $postStatusSelect.find('.cancel-post-status').on( 'click', function( event ) { $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' ); $('#post_status').val( $('#hidden_post_status').val() ); updateText(); event.preventDefault(); }); } /** * Handle the editing of the post_name. Create the required HTML elements and * update the changes via Ajax. * * @global * * @return {void} */ function editPermalink() { var i, slug_value, slug_label, $el, revert_e, c = 0, real_slug = $('#post_name'), revert_slug = real_slug.val(), permalink = $( '#sample-permalink' ), permalinkOrig = permalink.html(), permalinkInner = $( '#sample-permalink a' ).html(), buttons = $('#edit-slug-buttons'), buttonsOrig = buttons.html(), full = $('#editable-post-name-full'); // Deal with Twemoji in the post-name. full.find( 'img' ).replaceWith( function() { return this.alt; } ); full = full.html(); permalink.html( permalinkInner ); // Save current content to revert to when cancelling. $el = $( '#editable-post-name' ); revert_e = $el.html(); buttons.html( ' ' + '' ); // Save permalink changes. buttons.children( '.save' ).on( 'click', function() { var new_slug = $el.children( 'input' ).val(); if ( new_slug == $('#editable-post-name-full').text() ) { buttons.children('.cancel').trigger( 'click' ); return; } $.post( ajaxurl, { action: 'sample-permalink', post_id: postId, new_slug: new_slug, new_title: $('#title').val(), samplepermalinknonce: $('#samplepermalinknonce').val() }, function(data) { var box = $('#edit-slug-box'); box.html(data); if (box.hasClass('hidden')) { box.fadeIn('fast', function () { box.removeClass('hidden'); }); } buttons.html(buttonsOrig); permalink.html(permalinkOrig); real_slug.val(new_slug); $( '.edit-slug' ).trigger( 'focus' ); wp.a11y.speak( __( 'Permalink saved' ) ); } ); }); // Cancel editing of permalink. buttons.children( '.cancel' ).on( 'click', function() { $('#view-post-btn').show(); $el.html(revert_e); buttons.html(buttonsOrig); permalink.html(permalinkOrig); real_slug.val(revert_slug); $( '.edit-slug' ).trigger( 'focus' ); }); // If more than 1/4th of 'full' is '%', make it empty. for ( i = 0; i < full.length; ++i ) { if ( '%' == full.charAt(i) ) c++; } slug_value = ( c > full.length / 4 ) ? '' : full; slug_label = __( 'URL Slug' ); $el.html( '' + '' ).children( 'input' ).on( 'keydown', function( e ) { var key = e.which; // On [Enter], just save the new slug, don't save the post. if ( 13 === key ) { e.preventDefault(); buttons.children( '.save' ).trigger( 'click' ); } // On [Esc] cancel the editing. if ( 27 === key ) { buttons.children( '.cancel' ).trigger( 'click' ); } } ).on( 'keyup', function() { real_slug.val( this.value ); }).trigger( 'focus' ); } $( '#titlediv' ).on( 'click', '.edit-slug', function() { editPermalink(); }); /** * Adds screen reader text to the title label when needed. * * Use the 'screen-reader-text' class to emulate a placeholder attribute * and hide the label when entering a value. * * @param {string} id Optional. HTML ID to add the screen reader helper text to. * * @global * * @return {void} */ window.wptitlehint = function( id ) { id = id || 'title'; var title = $( '#' + id ), titleprompt = $( '#' + id + '-prompt-text' ); if ( '' === title.val() ) { titleprompt.removeClass( 'screen-reader-text' ); } title.on( 'input', function() { if ( '' === this.value ) { titleprompt.removeClass( 'screen-reader-text' ); return; } titleprompt.addClass( 'screen-reader-text' ); } ); }; wptitlehint(); // Resize the WYSIWYG and plain text editors. ( function() { var editor, offset, mce, $handle = $('#post-status-info'), $postdivrich = $('#postdivrich'); // If there are no textareas or we are on a touch device, we can't do anything. if ( ! $textarea.length || 'ontouchstart' in window ) { // Hide the resize handle. $('#content-resize-handle').hide(); return; } /** * Handle drag event. * * @param {Object} event Event containing details about the drag. */ function dragging( event ) { if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) { return; } if ( mce ) { editor.theme.resizeTo( null, offset + event.pageY ); } else { $textarea.height( Math.max( 50, offset + event.pageY ) ); } event.preventDefault(); } /** * When the dragging stopped make sure we return focus and do a confidence check on the height. */ function endDrag() { var height, toolbarHeight; if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) { return; } if ( mce ) { editor.focus(); toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 ); if ( toolbarHeight < 10 || toolbarHeight > 200 ) { toolbarHeight = 30; } height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28; } else { $textarea.trigger( 'focus' ); height = parseInt( $textarea.css('height'), 10 ); } $document.off( '.wp-editor-resize' ); // Confidence check: normalize height to stay within acceptable ranges. if ( height && height > 50 && height < 5000 ) { setUserSetting( 'ed_size', height ); } } $handle.on( 'mousedown.wp-editor-resize', function( event ) { if ( typeof tinymce !== 'undefined' ) { editor = tinymce.get('content'); } if ( editor && ! editor.isHidden() ) { mce = true; offset = $('#content_ifr').height() - event.pageY; } else { mce = false; offset = $textarea.height() - event.pageY; $textarea.trigger( 'blur' ); } $document.on( 'mousemove.wp-editor-resize', dragging ) .on( 'mouseup.wp-editor-resize mouseleave.wp-editor-resize', endDrag ); event.preventDefault(); }).on( 'mouseup.wp-editor-resize', endDrag ); })(); // TinyMCE specific handling of Post Format changes to reflect in the editor. if ( typeof tinymce !== 'undefined' ) { // When changing post formats, change the editor body class. $( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() { var editor, body, format = this.id; if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) { body = editor.getBody(); body.className = body.className.replace( /\bpost-format-[^ ]+/, '' ); editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format ); $( document ).trigger( 'editor-classchange' ); } }); // When changing page template, change the editor body class. $( '#page_template' ).on( 'change.set-editor-class', function() { var editor, body, pageTemplate = $( this ).val() || ''; pageTemplate = pageTemplate.substr( pageTemplate.lastIndexOf( '/' ) + 1, pageTemplate.length ) .replace( /\.php$/, '' ) .replace( /\./g, '-' ); if ( pageTemplate && ( editor = tinymce.get( 'content' ) ) ) { body = editor.getBody(); body.className = body.className.replace( /\bpage-template-[^ ]+/, '' ); editor.dom.addClass( body, 'page-template-' + pageTemplate ); $( document ).trigger( 'editor-classchange' ); } }); } // Save on pressing [Ctrl]/[Command] + [S] in the Text editor. $textarea.on( 'keydown.wp-autosave', function( event ) { // Key [S] has code 83. if ( event.which === 83 ) { if ( event.shiftKey || event.altKey || ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! isMac && ! event.ctrlKey ) ) { return; } wp.autosave && wp.autosave.server.triggerSave(); event.preventDefault(); } }); // If the last status was auto-draft and the save is triggered, edit the current URL. if ( $( '#original_post_status' ).val() === 'auto-draft' && window.history.replaceState ) { var location; $( '#publish' ).on( 'click', function() { location = window.location.href; location += ( location.indexOf( '?' ) !== -1 ) ? '&' : '?'; location += 'wp-post-new-reload=true'; window.history.replaceState( null, null, location ); }); } /** * Copies the attachment URL in the Edit Media page to the clipboard. * * @since 5.5.0 * * @param {MouseEvent} event A click event. * * @return {void} */ copyAttachmentURLClipboard.on( 'success', function( event ) { var triggerElement = $( event.trigger ), successElement = $( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) ); // Clear the selection and move focus back to the trigger. event.clearSelection(); // Show success visual feedback. clearTimeout( copyAttachmentURLSuccessTimeout ); successElement.removeClass( 'hidden' ); // Hide success visual feedback after 3 seconds since last success. copyAttachmentURLSuccessTimeout = setTimeout( function() { successElement.addClass( 'hidden' ); }, 3000 ); // Handle success audible feedback. wp.a11y.speak( __( 'The file URL has been copied to your clipboard' ) ); } ); } ); /** * TinyMCE word count display */ ( function( $, counter ) { $( function() { var $content = $( '#content' ), $count = $( '#wp-word-count' ).find( '.word-count' ), prevCount = 0, contentEditor; /** * Get the word count from TinyMCE and display it */ function update() { var text, count; if ( ! contentEditor || contentEditor.isHidden() ) { text = $content.val(); } else { text = contentEditor.getContent( { format: 'raw' } ); } count = counter.count( text ); if ( count !== prevCount ) { $count.text( count ); } prevCount = count; } /** * Bind the word count update triggers. * * When a node change in the main TinyMCE editor has been triggered. * When a key has been released in the plain text content editor. */ $( document ).on( 'tinymce-editor-init', function( event, editor ) { if ( editor.id !== 'content' ) { return; } contentEditor = editor; editor.on( 'nodechange keyup', _.debounce( update, 1000 ) ); } ); $content.on( 'input keyup', _.debounce( update, 1000 ) ); update(); } ); } )( jQuery, new wp.utils.WordCounter() );

เลือกซื้อเลขยังไงให้คุ้มกับเงินที่จ่าย

แทงหวยยังไงให้ได้เงิน วิธีแทงหวยออนไลน์ที่ได้ผลจริง เริ่มเลยวันนี้

หลายคนอาจไม่รู้ว่า แทงหวยเป็นกิจกรรมที่คนไทยนิยมเล่นกันมานานหลายสิบปี โดยไม่ใช่แค่การเสี่ยงโชค แต่เป็นวิธีสร้างความสนุกและความหวังในทุกงวด เพียงเลือกเลขที่ถูกใจแล้วส่งผ่านเจ้ามือหรือแอปพลิเคชัน คุณก็มีลุ้นรับรางวัลเงินสดทันที แถมยังสามารถแทงได้ทั้งเลข 2 ตัว 3 ตัว และชุดแบบจุกๆ เพื่อเพิ่มโอกาสถูกหวยได้ง่ายขึ้น การแทงหวยจึงเป็นทางเลือกยอดนิยมที่ให้ทั้งความตื่นเต้นและผลตอบแทนคุ้มค่า สำหรับใครที่อยากลอง เพียงกำหนดงบประมาณที่สบายใจ แล้วเลือกเลขมงคลหรือเลขเด็ดจากชีวิตประจำวันมาเสี่ยงดวงได้ทันที

เลือกซื้อเลขยังไงให้คุ้มกับเงินที่จ่าย

แทงหวย

การเลือกซื้อเลขให้คุ้มกับเงินที่จ่ายในแทงหวย ต้องเริ่มจากการกำหนดงบประมาณต่องวดอย่างชัดเจน และแบ่งเงินออกเป็นหลายชุดเพื่อกระจายความเสี่ยง แทนที่จะซื้อเลขเดียวเป็นจำนวนมาก ควรเน้นเลขที่ออกจากสถิติย้อนหลัง เช่น เลขท้าย 2 ตัวที่เคยออกซ้ำในรอบ 10 งวด หรือเลขจากเหตุการณ์ใกล้ตัวที่มีความหมายส่วนตัว เพราะช่วยเพิ่มโอกาสถูกโดยไม่ต้องซื้อทุกเลข อย่างไรก็ตาม การซื้อเลขเดียวแบบ “เต็มจำนวน” มักให้ผลตอบแทนต่อเงินที่จ่ายต่ำกว่าการซื้อหลายเลขแบบขั้นบันได เช่น แบ่งซื้อเลข 3 ตัว 2 ชุด และเลข 2 ตัว 4 ชุด จะทำให้เงินทุนหมุนเวียนและมีโอกาสคืนทุนได้หลายจุด ควรหลีกเลี่ยงเลขที่ “นิยม” เกินไป เพราะรางวัลจะถูกแบ่งกันหลายคน ทำให้เงินที่ได้ต่อบาทลดลง วิธีคุ้มที่สุดคือเลือกเลขที่คนส่วนใหญ่มองข้ามแต่ยังมีโอกาสออก เช่น เลขที่มีความสัมพันธ์กับวันสำคัญของตัวเอง

วิธีดูเลขเด็ดจากเหตุการณ์รอบตัวแบบง่ายๆ

การดูเลขเด็ดจากเหตุการณ์รอบตัวแบบง่ายๆ ไม่ต้องไปนั่งเดาให้ปวดหัว แค่สังเกตสิ่งที่เจอในชีวิตประจำวัน เช่น ทะเบียนรถคันหน้า เลขบิลค่าสินค้า หรือแม้แต่นาทีที่นาฬิกาดิจิทัลขึ้นเลขซ้ำอย่าง 11:11 หรือ 22:22 ก็เอามาเป็นแนวทางได้ ลองจดตัวเลขจากป้ายราคาในตลาด หรือเบอร์โทรที่โผล่ขึ้นจอตอนมีสายไม่รู้จักเข้าก็ได้เหมือนกัน เพราะเลขพวกนี้มักสะกิดใจให้เรารู้สึก “ใช่” โดยไม่รู้ตัว วิธีง่ายๆ คือเก็บรวบรวมตัวเลขที่เห็นบ่อยๆ ใน 2-3 วัน แล้วคัดเฉพาะตัวที่รู้สึกโดนสุดมาผสมกันเป็นชุด

ลองทำตามลำดับนี้เพื่อให้ได้เลขเด็ดที่ใกล้เคียงความต้องการ:

  1. สังเกตตัวเลขที่เกิดซ้ำมากกว่าหนึ่งครั้งในวันเดียว เช่น เวลา ป้ายทะเบียน หรือราคาอาหาร
  2. จดลงโน้ตในมือถือทันทีที่เห็น อย่าปล่อยให้ผ่านไปเพราะลืมง่าย
  3. เลือกตัวเลขที่ทำให้รู้สึกตื่นเต้นหรือผูกพันกับเรื่องราวตอนเห็น เช่น วันที่ได้เงินก้อน หรือเลขห้องที่เคยอยู่

แทงหวย

สุดท้าย อย่าลืมว่าตัวเลขจากสภาพแวดล้อมรอบตัวมักมาจาก “ความรู้สึกจับต้องได้” ซึ่งทำให้การแทงหวยสนุกขึ้นโดยไม่ต้องพึ่งดวงล้วนๆ วิธีดูเลขเด็ดจากเหตุการณ์รอบตัวแบบง่ายๆ คือการเปิดใจรับสัญญาณรอบกาย แล้วเลือกเฉพาะที่ตรงใจที่สุดไปเสี่ยงโชค

แทงหวย

คำนวณงบประมาณต่องวดที่ไม่ทำให้กระเป๋าแฉลบ

การคำนวณงบประมาณต่องวดที่ไม่ทำให้กระเป๋าแฉลบต้องเริ่มจากการกำหนดวงเงินสูงสุดที่ยอมรับได้ต่อเดือนก่อน แล้วหารด้วยจำนวนงวดหวยในเดือนนั้น (ปกติ 2 งวด) เพื่อให้ได้เพดานต่องวดที่ชัดเจน ตัวอย่างเช่น หากกำหนดวงเงินเดือนละ 1,000 บาท งวดละไม่ควรเกิน 500 บาท และควรแบ่งเงินส่วนนี้เป็น 3 ส่วน ได้แก่ เลขหลัก 70% เลขรอง 20% และเงินสำรองเผื่อพลาด 10% วิธีนี้ช่วยให้คุณเลือกซื้อเลขได้อย่างมีสติโดยไม่ต้องกู้ยืมหรือยืมเงินใคร เพราะทุกบาทที่ใช้ไปมาจากเงินที่จัดสรรไว้แล้วเท่านั้น และเมื่อชนะก็ควรรีบเก็บกำไรบางส่วนเข้าบัญชีสำรอง เพื่อให้งวดหน้าคุณมีเงินทุนเพิ่มขึ้นโดยไม่ต้องดึงเงินใช้จ่ายประจำมาเสี่ยง การตั้งเพดานต่องวดแบบตายตัว คือหัวใจสำคัญที่จะทำให้การแทงหวยเป็นเพียงความสนุกที่ไม่ทำลายฐานะ

สรุป: คำนวณงบประมาณต่องวดโดยหารวงเงินรายเดือนด้วยจำนวนงวด แบ่งเป็นเลขหลัก เลขรอง และเงินสำรอง แล้วชนะต้องเก็บกำไรเข้ากองกลาง เพื่อให้เล่นได้ต่อเนื่องแบบไม่เดือดร้อน

เทคนิคจัดชุดเลขลดความเสี่ยงพลาด

การจัดชุดเลขช่วยลดความเสี่ยงพลาดได้จริง เพราะคุณไม่ได้ทุ่มทั้งหมดไปกับเลขเดียว แต่กระจายเงินเป็นสัดส่วน เช่น ใช้สูตร เลขเด่นจัดชุด 3 ตัว กลับเลขทุกตำแหน่ง เพื่อกันพลาดกรณีสลับหลัก หรือเลือกเลขชุดที่มีทั้งเลขคู่-คี่ และสูง-ต่ำปนกัน แล้วแบ่งงบเป็น 2 ชุดหลัก คือ ชุดเน้น (ลงเงินเยอะ) กับชุดสำรอง (ลงเงินน้อย) หากเลขมาไม่ตรงตำแหน่งก็ยังได้คืนทุนบางส่วน เทคนิคนี้เหมาะกับคนที่อยาก ลดความเสี่ยง โดยไม่ต้องเดาเลขเดียวเป๊ะ ๆ แถมยังลุ้นได้หลายรางวัลในงบเดียว แค่อย่าลืมตั้งวงเงินชัดเจนก่อนจัดชุดทุกครั้ง

รูปแบบการเล่นที่เซียนใช้กับมือใหม่ไม่เหมือนกัน

การแทงหวยของเซียนกับมือใหม่ต่างกันที่รูปแบบการลงทุนไม่ใช่แค่ดวง มือใหม่มักกระจายเลขมั่วๆ หรือแทงตามเพื่อน แต่เซียนจะเลือกจับกลุ่มเลขเด่นจากสถิติและแทงแบบทบสเต็ปเฉพาะจุด เช่น เน้นเลขสองตัวล่างสามชุดรูดทุกหลัก มากกว่าไล่ซื้อทุกเลขแบบเสมอตัว ขณะที่มือใหม่ชอบแทงตัวเดียวเต็มจำนวนเงิน แต่เซียนจะแบ่งทุนเป็นหลายรอบเพื่อยืดโอกาส และที่สำคัญคือเซียนไม่โลภ—เขาจะหยุดเมื่อถึงเป้า ขณะที่มือใหม่มักเล่นจนหมดตัวเพราะหวังกำไรก้อนเดียว จังหวะการตัดใจของเซียนคือสิ่งที่มือใหม่ไม่มีวันเลียนแบบได้ถ้าไม่ฝึกควบคุมอารมณ์ สรุปคือเซียนเล่นด้วยระบบและวินัย ส่วนมือใหม่เล่นด้วยความรู้สึกและความคาดหวัง

เล่นเลขวิ่งกับเลขโต๊ดต่างกันยังไงและแบบไหนเหมาะกับเรา

เลขวิ่งกับเลขโต๊ดต่างกันที่กลไกการชนะและความเสี่ยงโดยสิ้นเชิง เลขวิ่งเหมาะกับคนที่อยากได้โอกาสถูกรางวัลบ่อยๆ เพราะแทงแค่เลขเดียวหรือสองตัว แล้วออกในหลักหน่วยหรือหลักสิบก็ชนะทันที ส่วนเลขโต๊ดต้องจับคู่เลข 2 ตัวให้ออกสลับตำแหน่งกันได้ เช่น แทง 12 แล้วออก 21 ก็ชนะ โอกาสน้อยกว่าแต่ได้เงินมากกว่า แบบแรกเหมาะกับมือใหม่ที่ต้องการลุ้นทุกงวด ส่วนเลขโต๊ดเหมาะกับเซียนที่วิเคราะห์เลขคู่แล้วอยากได้กำไรก้อนใหญ่ ถ้าทุนน้อยแล้วอยากเล่นได้นานเลือกเลขวิ่ง ถ้าทนรอแล้วต้องการผลตอบแทนสูงเลือกเลขโต๊ด

ถาม: เล่นเลขวิ่งกับเลขโต๊ดต่างกันยังไงและแบบไหนเหมาะกับเราในงบจำกัด?
ตอบ: ถ้างบจำกัด ควรเริ่มจากเลขวิ่งก่อน เพราะต้นทุนต่ำ โอกาสถูกง่าย และไม่ต้องรอเลขชุดตรงทั้งหมด เหมาะกับการเก็บกำไรเล็กน้อยแต่สม่ำเสมอ เมื่อเข้าใจจังหวะแล้วค่อยเพิ่มน้ำหนักไปเลขโต๊ด

จับคู่เลขสองตัวสามตัวให้ได้กำไรมากกว่าลงเดี่ยว

การจับคู่เลขสองตัวสามตัวให้ได้กำไรมากกว่าลงเดี่ยวคือกลยุทธ์ที่เซียนใช้กระจายความเสี่ยงโดยไม่เพิ่มต้นทุนรวมมากนัก ตัวอย่างเช่น การเลือกเลขเด่น 3 ตัวแล้วจับคู่เป็นชุดสองตัว (AB, AC, BC) จะสร้างโอกาสถูกมากกว่าการทุ่มทั้งหมดบนเลขเดียว แม้ว่าอัตราจ่ายต่อชุดจะต่ำกว่า แต่เมื่อคำนวณความถี่ของการถูกที่เพิ่มขึ้น ในระยะยาวยอดเงินคืนจะสูงกว่าการลงเดี่ยวที่ต้องพึ่งดวงล้วน ๆ การจับคู่แบบสามตัวเต็มรูปแบบเพิ่มโอกาสทำกำไรซ้ำได้ อย่างไรก็ตาม ต้องจัดสรรเงินให้พอดีกับจำนวนชุด เพื่อไม่ให้กำไรที่ได้ถูกกลบด้วยต้นทุนที่กระจายบาง ๆ เซียนจะกำหนดวงเงินต่อชุดให้ต่ำกว่าเดิม แต่เพิ่มจำนวนชุดจนกว่าความน่าจะเป็นรวมจะเกินจุดคุ้มทุน ซึ่งต่างจากมือใหม่ที่มักลงเดี่ยวสูงแล้วหมดตัวเมื่อพลาด

เลือกเล่นแบบกลับเลขเมื่ออยากเพิ่มโอกาสชนะ

การเลือกเล่นแบบกลับเลขเมื่ออยากเพิ่มโอกาสชนะคือกลยุทธ์ที่เซียนใช้เพื่อปิดความเสี่ยงจากการออกเลขสลับตำแหน่ง เช่น ซื้อ 23 แล้วกลับเป็น 32 ในงวดเดียวกัน ซึ่งต่างจากมือใหม่ที่มักยึดติดกับเลขเดียวโดยไม่กระจายความเสี่ยง การกลับเลขช่วยเพิ่มจำนวนชุดเดิมพันโดยไม่ต้องเดาทิศทางที่แน่นอน ทำให้โอกาสถูกต้องสูงขึ้นในเชิงคณิตศาสตร์ เพราะครอบคลุมสองความเป็นไปได้จากต้นทุนเท่าเดิม เซียนจะจัดสรรงบให้ชุดกลับเลขมีน้ำหนักน้อยกว่าชุดตรง แต่ยังเพียงพอต่อการคืนทุนเมื่อถูกเลขกลับ การวิเคราะห์สถิติเลขย้อนหลังช่วยเลือกคู่เลขที่มีแนวโน้มสลับกันสูง ซึ่งเป็น เทคนิคเพิ่มโอกาสชนะหวย ที่ต้องทำอย่างมีวินัย ไม่ใช่การสุ่มซื้อเพื่อความหวังลมๆ แล้งๆ แต่คือการบริหารความน่าจะเป็นอย่างเป็นระบบ

แทงหวย

เว็บหรือโต๊ะที่ใช้บริการต้องดูอะไรก่อนตัดสินใจ

ก่อนเลือกเว็บหรือโต๊ะแทงหวย สิ่งแรกที่ต้องดูคือความน่าเชื่อถือของระบบจ่ายเงิน—ต้องเช็คประวัติการโอนจริงจากสมาชิกเก่าในกลุ่มหรือเพจที่รีวิวโดยไม่มีการซื้อโฆษณา อย่าหลงแค่โปรโมชั่นแรงๆ เพราะอัตราจ่ายสูงเกินปกติมักมาพร้อมเงื่อนไขกากๆ ที่หักยอดเวลาถอน ความเร็วในการตอบแชทคือกระจกสะท้อนคุณภาพ ทดลองส่งข้อความถามยอดแทงตอนตีสอง ถ้าตอบช้าหรือปัดๆ แปลว่าแบ็กเอนด์ไม่พร้อมรองรับการแก้ไขผิดพลาด ตรวจสอบเลขที่ใช้แทงต้องตรงกับสลิปทุกครั้งก่อนยืนยัน เพราะโต๊ะบางเจ้าแก้ตัวว่า «ส่งผิดช่อง» เมื่อเลขผิดพลาด และควรดูฟีเจอร์การทบยอดหรือเครดิตเหลือสะสมว่ามีระบบป้องกันการทุจริตไหม ความไว้วางใจไม่ได้เกิดจากหน้าร้านสวย แต่เกิดจากวิธีจัดการข้อผิดพลาดที่คุณยังไม่เคยเจอ สุดท้าย ห้ามใช้โต๊ะที่ไม่มีประวัติการจ่ายจริงเกิน 6 เดือนเด็ดขาด—แม้ราคาจะดีแค่ไหนก็ตาม

เช็คเรตการจ่ายเงินต่อบาทว่าแพงหรือคุ้มค่า

ก่อนตัดสินใจใช้บริการแทงหวย สิ่งแรกที่ต้องโฟกัสคือ เช็คเรตการจ่ายเงินต่อบาทว่าแพงหรือคุ้มค่า เพราะเรตคือตัวชี้วัดกำไรโดยตรง บางเว็บให้แค่บาทละ 750 บาทแต่บางรายป้ายราคา 900 บาทขึ้นไป อย่าดูแค่ตัวเลขเลขท้าย 2 ตัว ต้องไล่เรตให้ครบทั้งสามตัวตรง โต๊ด และวิ่งบน-ล่าง เพราะแต่ละรูปแบบมีอัตราจ่ายไม่เท่ากัน เรตที่คุ้มค่า ควรเทียบกับเงินทุนที่เสียไป เช่น จ่ายบาทละ 850 แต่บิลขั้นต่ำสูง แถมหักค่าคอมฯ แบบนี้แพงจริง ส่วนเว็บที่ให้เรตสูงแต่วางยอดโอนช้า หรือจำกัดวงเงินต่อเลข ก็ไม่คุ้มเหมือนกัน ควรดูว่าจ่ายจริงตามเรตที่โฆษณาไหม และมีโบนัสเพิ่มจากเรตฐานหรือไม่ เปรียบเทียบ 3–4 เจ้าก่อนตัดสินใจ

ดูขั้นต่ำและสูงสุดในการแทงแต่ละครั้ง

ก่อนเลือกเว็บหรือโต๊ะหวยสักที่ ต้องดูขั้นต่ำและสูงสุดในการแทงแต่ละครั้งให้ชัดเจน เพราะแต่ละที่กำหนดวงเงินไม่เท่ากัน บางเว็บรับแทงเริ่มต้นแค่บาทเดียว แต่บางโต๊ะขั้นต่ำอาจสูงถึงสิบบาทหรือมากกว่า ซึ่งกระทบโดยตรงกับคนที่อยากแทงแบบสอยเล็กสอยน้อย ในทางกลับกัน เพดานสูงสุดก็สำคัญไม่แพ้กัน ถ้าคุณเล่นตัวใหญ่หรือแทงหลายชุด ต้องมั่นใจว่าเว็บรองรับยอดที่คุณต้องการได้โดยไม่ตัดยอด การดูขั้นต่ำและสูงสุดในการแทงแต่ละครั้ง ช่วยกันพลาดตอนจ่ายเงินตอนถูกรางวัล เพราะถ้าแทงเกินวงเงินที่กำหนด โต๊ะบางแห่งอาจจ่ายเพียงอัตราส่วนลดหรือไม่จ่ายเลย การเช็กลิมิตก่อนแทงทุกครั้งจึงเป็นนิสัยที่คุ้มค่ากว่าการเสียใจทีหลัง เลือกจุดที่ยืดหยุ่นพอดีกับงบประมาณของคุณ

ตรวจสอบระบบฝากถอนว่าเร็วและมีค่าธรรมเนียมแอบแฝงไหม

ก่อนตัดสินใจแทงหวยที่ไหน อย่าลืมทดสอบระบบฝากเงินถอนเงินให้ว่องไวโดยลองยิงจำนวนเล็กน้อยก่อน แล้วจับเวลาจากกดยืนยันจนเงินเข้าบัญชีจริง ถ้าช้าเกิน 5 นาทีหรือมีขั้นตอนให้กรอกข้อมูลซ้ำซ้อน ให้เลี่ยงทันที ส่วนค่าธรรมเนียมแอบแฝงนั้นต้องเช็คยอดที่ได้รับจริงเทียบกับยอดที่แจ้งฝาก หากมีการหักออกเกิน 1–2 บาทต่อครั้ง แสดงว่าเว็บกำลังคิดค่าธรรมเนียมซ่อนเร้น และที่อันตรายคือตอนถอน บางเว็บหักเปอร์เซ็นต์ตอนโอนออกโดยไม่แจ้งให้เห็นก่อน

  1. ทดสอบฝาก 100 บาท แล้วดูยอดเข้าจริงว่าตรงไหม ไม่มีการหัก 10–20 บาทแฝง
  2. ถอนขั้นต่ำสุด เช่น 50 บาท แล้วจับเวลาจนเงินถึงพร้อมเช็คค่าธเนียมที่หายไปกับยอดโอนจริง
  3. อ่านข้อตกลงหน้าเว็บในส่วน “หักค่าบริการ” หากไม่มีการระบุตัวเลขชัดเจน ให้ถือว่ามีค่าธรรมเนียมแอบแฝงแน่นอน

เคล็ดลับอ่านสถิติเลขออกบ่อยเพื่อประกอบการตัดสินใจ

การอ่านสถิติเลขออกบ่อยช่วยให้คุณเห็นแนวโน้มตัวเลขที่ปรากฏซ้ำในรอบ 10-20 งวดล่าสุด ซึ่งเป็นข้อมูลเชิงประจักษ์ที่นำมาประกอบการตัดสินใจแทงหวยได้จริง เริ่มจากจัดกลุ่มเลขที่ความถี่สูงสุด 3-5 ตัว แล้วจับคู่กับเลขที่ออกตามวันหรือเดือนที่ใกล้เคียงกัน เพื่อเพิ่มโอกาสในการล็อกเลขเด่น ควรใช้ เคล็ดลับอ่านสถิติเลขออกบ่อย ร่วมกับการวิเคราะห์ผลต่างของเลขจากงวดก่อนหน้า เช่น เลขที่ห่างกัน 1-2 ในตารางมักมีแนวโน้มวนกลับมาใหม่ อย่ามองแค่ตัวเลขเดี่ยว ให้ดูเลขคู่หรือเลขชุดที่ออกติดกันบ่อย ๆ เพื่อสร้างชุดแทงที่อิงข้อมูลจริง แทนการเดาสุ่มเพียงอย่างเดียว การบันทึกผลทุกงวดลงตารางส่วนตัวจะช่วยให้คุณเห็นรอบการซ้ำของเลขได้แม่นยำขึ้น นำไปปรับสัดส่วนเงินเดิมพันให้สมเหตุสมผล เช่น กระจายลงเลขที่ความถี่สูงสุด 60% และเลขรอง 40% เพื่อลดความเสี่ยงและเพิ่มประสิทธิภาพในการตัดสินใจแทงหวยในงวดถัดไป

จดบันทึกเลขที่ออกซ้ำในช่วงเดือนที่ผ่านมา

การจดบันทึกเลขที่ออกซ้ำในช่วงเดือนที่ผ่านมาคือการรวบรวมผลรางวัลทุกงวดในรอบ 30 วัน แล้วทำเครื่องหมายตัวเลขที่ปรากฏมากกว่าหนึ่งครั้ง วิธีนี้ช่วยให้เห็นเลขที่ออกซ้ำในช่วงเดือนที่ผ่านมาอย่างเป็นระบบ ไม่ใช่การเดาจากความรู้สึก โดยให้จดแยกเป็นชุดหลักและเลขท้ายสองตัว แล้วนับความถี่ เช่น เลข 27 ออกสามครั้งในเดือนนี้ ก็ควรจดไว้ในลำดับต้นของบันทึก การเทียบบัญชีรายสัปดาห์จะทำให้จับแนวโน้มการวนกลับของเลขเดิมได้แม่นยำขึ้น อย่าลืมทำเครื่องหมายวันที่ออกซ้ำด้วย เพื่อดูว่าช่วงห่างกันกี่วัน ซึ่งช่วยคาดเดาว่ารอบถัดไปอาจกลับมาอีกหรือไม่

คำถาม: การจดบันทึกเลขที่ออกซ้ำในช่วงเดือนที่ผ่านมาต้องบันทึกเฉพาะเลขท้ายสองตัวเท่านั้นหรือไม่?
ไม่จำเป็น ควรบันทึกทั้งเลขท้ายสองตัวและเลขสามตัวหน้า เพราะเลขที่ออกซ้ำในตำแหน่งต่างกันให้ข้อมูลเชิงลึกที่ไม่เหมือนกัน และต้องจดวันที่ออกทุกครั้งเพื่อวิเคราะห์ช่วงห่างของรอบการออกซ้ำได้อย่างถูกต้อง

ใช้เลขวันเกิดหรือเลขทะเบียนร่วมกับสถิติได้จริงไหม

การนำเลขวันเกิดหรือเลขทะเบียนมาผนวกกับสถิติเลขออกบ่อยนั้นใช้ได้จริงในเชิงปฏิบัติ แต่ต้องเข้าใจว่าจะช่วย «กรอง» มากกว่า «ทำนาย» https://www.rallylights.com/ เริ่มจากนำเลขเด่นจากสถิติย้อนหลังมาเป็นแกนหลัก เช่น หลักหน่วยที่ออกซ้ำบ่อย จากนั้นนำเลขวันเกิดหรือเลขทะเบียนของคุณมาตรวจสอบว่ามีหลักใดตรงกับเลขเด่นนั้นหรือไม่ หากตรงกันก็เพิ่มน้ำหนักในการเลือก
วิธีนี้ช่วยลดตัวเลขที่สุ่มออกไป และสร้างชุดเลขที่มีเหตุผลรองรับทั้งดวงและข้อมูล การผสมเลขมงคลกับสถิติเป็นกลยุทธ์ที่เพิ่มความมั่นใจได้จริง ไม่ใช่การเดาลอยๆ

วิเคราะห์เลขที่ไม่มาเลยเป็นเวลานานเพื่อรอจังหวะคืน

การวิเคราะห์เลขที่ไม่มาเลยเป็นเวลานานเพื่อรอจังหวะคืน อาศัยหลักสถิติการเว้นช่วงที่ยาวเกินรอบปกติ ตัวอย่างเช่น เลขสามตัวที่เคยออกถี่ทุก 10-15 งวด แต่เงียบหายไปเกิน 30 งวด แสดงว่าโมเมนตัมกำลังสะสม และโอกาสคืนชีพในอีกไม่กี่งวดข้างหน้ามีสูง คุณควรจดบันทึกเลขที่ “ค้างคืน” นานที่สุดในรอบ 6 เดือน แล้ววางแผนเล่นแบบถี่ขึ้นเป็นระยะเวลา 3 งวดติดต่อกัน เพื่อไม่ให้พลาดจังหวะที่เลขเริ่มไหลกลับมา แต่อย่าลืมกำหนดวงเงินรอคืนไว้ล่วงหน้า เพราะการรอคืนที่ยาวเกินไปอาจกลายเป็นกับดัก เลขค้างคืนมีรอบคืนจริง ใช้ตารางจับคู่ช่วงงวดที่หายไปกับงวดที่เคยออก เพื่อหาวันที่เหมาะสมที่สุดในการลงเดิมพัน

จัดการอารมณ์และความเสี่ยงเมื่อเล่นไปหลายงวด

การเล่นหวยหลายงวดติดต่อกันมักทำให้อารมณ์เราเริ่มสั่นคลอน โดยเฉพาะเมื่อผลออกมาไม่ตรงกับที่หวัง สมองจะจดจำความเสียหายสะสมจนเกิดเป็นความอยากแก้มือ ซึ่งเป็นจุดเริ่มต้นของความเสี่ยงที่คุมไม่ได้ ผมเคยเห็นนักเล่นหลายคนตั้งงบไว้ต่องวด แต่พอกลางเดือนพลาด ก็เทงวดถัดไปด้วยเงินที่เผื่อไว้ใช้จ่ายจริงๆ เพราะความรู้สึก “ต้องได้คืน” มันแรงกว่าสติ สิ่งที่ได้ผลสำหรับผมคือการตั้งกฎเหล็กว่าหากแพ้ติดกันสามงวด ต้องหยุดพักหนึ่งสัปดาห์ แล้วทบทวนว่าที่เล่นไปนั้นมาจากเหตุผลหรือเพียงความเดือดดาล การยอมรับว่าเสียแล้วคือกำไรทางใจที่แพงที่สุด และเมื่อกลับมาเล่นใหม่ ให้ลดวงเงินลงครึ่งหนึ่งของงวดแรกเสมอ คำถามที่ควรถามตัวเองก่อนกดซื้อทุกครั้งคือ “ถ้างวดนี้แพ้ เรายังมีเงินกินข้าวพรุ่งนี้ไหม?” ถ้าตอบไม่ได้ ก็หมายความว่าอารมณ์กำลังนำหน้าเหตุผลมากเกินไป ควรปิดแอปแล้วเดินออกจากบ้านทันที

กำหนดกำไรขาดทุนต่อเดือนแบบชัดเจนก่อนเริ่ม

ก่อนเริ่มแทงหวยแต่ละเดือน ต้องกำหนดกำไรขาดทุนต่อเดือนแบบชัดเจนก่อนเริ่ม โดยเขียนตัวเลขเป้าหมายกำไรสูงสุดและขาดทุนสูงสุดลงในกระดาษ เช่น กำไร 5,000 บาท หรือขาดทุนไม่เกิน 3,000 บาท เมื่อถึงจุดขาดทุนที่กำหนด ให้หยุดทันที อย่าเลื่อนเป้าเด็ดขาด เพราะการเลื่อนเป้าคือจุดเริ่มต้นของหายนะ การตั้งวงเงินล่วงหน้าช่วยตัดสินใจด้วยเหตุผล ไม่ใช่อารมณ์ หากทำกำไรถึงเป้าแล้ว ให้หยุดเล่นทันทีเพื่อล็อกผลลัพธ์ แม้รู้สึกว่ายังไหวก็ตาม การยอมหยุดตอนกำไรเป็นวินัยที่ยากกว่าการหยุดตอนขาดทุน แต่จำเป็นที่สุด กำหนดนี้ต้องยึดเป็นกฎเหล็ก ไม่ใช่คำแนะนำ

คำถาม: จะทำอย่างไรถ้าเล่นถึงเพดานขาดทุนแล้ว แต่รู้สึกว่าต้องได้คืน?
ตอบ: อย่าเล่นต่อ เด็ดขาด เพราะการเล่นต่อเมื่อถึงเพดานคือการทำลายแผนที่ตั้งไว้ ระบบจะพังและเสี่ยงเกินวงเงิน ควรเก็บเงินที่เหลือไว้เดือนหน้า เริ่มต้นใหม่ด้วยแผนเดิม

หยุดเล่นชั่วคราวเมื่อแพ้ติดต่อกันกี่ครั้งดี

สำหรับคำถามที่ว่า หยุดเล่นชั่วคราวเมื่อแพ้ติดต่อกันกี่ครั้งดี หลักการที่ได้ผลคือกำหนดเส้นตายไว้ที่ 3 งวดติดต่อกัน หากแพ้ครบ 3 ครั้ง คุณต้องหยุดทันทีโดยไม่มีข้อยกเว้น เพราะการฝืนเล่นต่อหลังแพ้ติดต่อกันมักเกิดจากอารมณ์追หนี้ (chasing losses) ซึ่งยิ่งเพิ่มความเสี่ยงให้เสียหายหนักขึ้น ควรวางแผนไว้ล่วงหน้าว่าจะหยุดเล่นเมื่อใด ไม่ใช่ตัดสินใจตอนแพ้แล้ว เพราะตอนนั้นสติไม่ปลอดโปร่ง

แทงหวย

  1. กำหนดตัวเลขไว้ที่ 3 งวดติดต่อกันเป็นขีดจำกัดสูงสุด
  2. เมื่อแพ้ครบ ให้หยุดเล่นทันที อย่างน้อย 2-3 งวดถัดไป
  3. กลับมาเล่นใหม่เมื่ออารมณ์สงบและวิเคราะห์งบประมาณใหม่เท่านั้น

ตั้งเป้าหมายผลตอบแทนขั้นต่ำแล้วเลิกเล่นทันที

การตั้งเป้าหมายผลตอบแทนขั้นต่ำไว้ล่วงหน้า เช่น กำไร 10–20% ของทุนที่ใช้เล่น เป็นเกณฑ์ตัดสินใจที่ชัดเจน เมื่อถึงจุดนั้นแล้วต้องหยุดทันทีโดยไม่ลังเล แม้รู้สึกว่าฟอร์มกำลังดี เพราะอารมณ์ที่อยากได้เพิ่มมักทำให้เสียทั้งกำไรและเงินต้น การกำหนดตัวเลขนี้ควรคำนวณจากทุนที่ยอมเสียได้จริง ไม่ใช่ความต้องการในฝัน เมื่อเล่นหลายงวดติดต่อกัน สมองจะล้าและการตัดสินใจคลาดเคลื่อน การยึดเป้าหมายขั้นต่ำช่วยสร้างวินัยป้องกันการเสียเงินสะสม ให้ถือว่าการได้กำไรตามเป้าแล้วเลิกคือความสำเร็จของรอบนั้น ไม่ต้องรอให้ได้สูงสุด การตั้งเป้าหมายผลตอบแทนขั้นต่ำแล้วเลิกเล่นทันทีคือเกราะป้องกันความโลภที่แข็งแกร่งที่สุดในเกมที่ไม่มีสูตรตายตัว

ตั้งเป้ากำไรขั้นต่ำที่พอใจ และหยุดเล่นทันทีที่ถึงจุดนั้น เพื่อปกป้องกำไรและตัดวงจรการเสียคืน