This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET http://127.0.0.1:8000/api/posts | |
[ | |
{ | |
"id": 6, | |
"author_id": 2, | |
"author": "test1", | |
"title": "My third post by API", | |
"text": "Yes, it's really work!", | |
"created_date": "2021-10-23T19:21:41.969850Z", | |
"date_modified": "23 Oct 2021", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list_of_vaccinations(request): | |
result_edit = False | |
if request.method == "POST": | |
if request.META.get('HTTP_REFERER').find('edit'): | |
vaccine = Vaccine.objects.get(id=request.POST.get('id')) | |
if vaccine: | |
vaccine.name = request.POST.get('name') | |
vaccine.date = request.POST.get('date') | |
vaccine.patient_id = request.POST.get('user_id') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// НЕ РАБОТАЕТ | |
$('body').on('DOMNodeInserted', '.js-auth-popup-box', function(){ | |
console.log($(this)); | |
}); | |
// РАБОТАЕТ | |
$('body').on('DOMNodeInserted', '.popup-wrapp', function(){ | |
console.log($(this)); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="popup-wrapp"> | |
<div class="popup-box js-auth-popup-box"> | |
<header class="popup-header"> | |
<span class="close-icon js-popup"></span> | |
</header> | |
<div class="popup-main"> | |
<div class="authorization-box"> | |
<h1 class="title center"> | |
Авторизация </h1> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fix jQuery after update WordPress | |
add_action( 'wp_enqueue_scripts', 'load_old_jquery_fix', 100 ); | |
function load_old_jquery_fix() { | |
if ( ! is_admin() ) { | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', ( "//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" ), false, '1.11.3' ); | |
wp_enqueue_script( 'jquery' ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = "\n"; | |
var INTERVAL = window.setInterval(function() { | |
window.clearInterval(INTERVAL); | |
var items = document.querySelectorAll('#jsc_c_13'); | |
for (var i=0; i < items.length; ++i) | |
{ | |
if (i == 0) { | |
continue; // skip author name | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( wp_verify_nonce( $_POST['fileup_nonce'], 'my_file_upload' ) ){ | |
if ( ! function_exists( 'wp_handle_upload' ) ) { | |
require_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
} | |
// require_once( ABSPATH . 'wp-admin/includes/image.php' ); | |
// require_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
// require_once( ABSPATH . 'wp-admin/includes/media.php' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clear_cart_after_logout() { | |
WC()->cart->empty_cart(); | |
// $cart = new WC_Cart(); | |
// $cart->empty_cart( $clear_persistent_cart = true ); | |
} | |
add_action('wp_logout', 'clear_cart_after_logout'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main-section > div.container > span { | |
font-size: 16px !important; | |
margin-bottom: 10px; | |
} | |
#main-section > div.container > h1 { | |
font-size: 23px !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = "\n"; | |
var INTERVAL = window.setInterval(function() { | |
window.clearInterval(INTERVAL); | |
var items = document.querySelectorAll('#repost_view_dialog .userContentWrapper'); | |
for (var i=0; i < items.length; ++i) | |
{ | |
var account = items[i].querySelector('.fwb.fcg > a'); | |
result += account.textContent + '\n'; | |
} |
NewerOlder