Site Tools


Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
onny:notizen:programmierung

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
onny:notizen:programmierung [2022/03/08 10:48] – [wordpress] 46.223.163.98onny:notizen:programmierung [2022/09/05 13:43] – [javascript] 10.25.0.100
Line 176: Line 176:
 </code> </code>
 ===== javascript ===== ===== javascript =====
 +
 split up javascript files split up javascript files
 <code javascript> <code javascript>
Line 192: Line 193:
 }(MODULE || {})); }(MODULE || {}));
 </code> </code>
 +
 jquery select by attribute content jquery select by attribute content
 +
 <code javascript> <code javascript>
 $( "tr[data-id='"+data[station]["stationid"]+"']" ).remove(); $( "tr[data-id='"+data[station]["stationid"]+"']" ).remove();
Line 203: Line 206:
 }); });
 </code> </code>
 +
 jquery set background color jquery set background color
 +
 <code javascript> <code javascript>
 $(this).parent().css("background-color", "yellow"); $(this).parent().css("background-color", "yellow");
Line 211: Line 216:
 console.log('%d: %s', i, value); console.log('%d: %s', i, value);
 </code> </code>
-javascript document ready+ 
 +on document ready 
 <code javascript> <code javascript>
-$(document).ready(function(){ +document.addEventListener("DOMContentLoaded", function() { 
-  console.log('ready');+  your_function(...);
 }); });
 +
 </code> </code>
-vanilla js change content text+ 
 +change content text 
 <code javascript> <code javascript>
     var webgl_field = document.getElementById('webgl');     var webgl_field = document.getElementById('webgl');
Line 257: Line 267:
  
 trim string to max length trim string to max length
 +
 <code javascript> <code javascript>
 var string = string.substring(0,100); var string = string.substring(0,100);
 </code> </code>
  
-vanilla js onclick class element+onclick class element 
 <code javascript> <code javascript>
 document.getElementsByClassName('navbar-burger')[0].onclick = function(){ document.getElementsByClassName('navbar-burger')[0].onclick = function(){
   console.log('ready');   console.log('ready');
 }; };
 +</code>
 +
 +smooth scrolling anchor links
 +
 +<code javascript>
 +document.addEventListener("DOMContentLoaded", function() {
 +  your_function(...);
 +});
 </code> </code>
 ==== vuejs ==== ==== vuejs ====
Line 675: Line 695:
     'walker'          => new Nav_Footer_Walker(),     'walker'          => new Nav_Footer_Walker(),
 ) ); ) );
 +</code>
 +
 +customizer add option custom text
 +<code php>
 +function theme_customize_register( $wp_customize ) {
 +
 +    $wp_customize->add_setting( 'fachwerksauna_footer-text', array(
 +        'default' => '',
 +        'type' => 'option',
 +        'capability' => 'edit_theme_options'
 +    ),);
 +
 +    $wp_customize->add_control( new WP_Customize_Control(
 +        $wp_customize, 'footer-text_control', array(
 +            'label'      => __( 'Footer text', 'fachwerksauna' ),
 +            'description' => __( 'Text in footer area', 'fachwerksauna' ),
 +            'settings'   => 'fachwerksauna_footer-text',
 +            'priority'   => 10,
 +            'section'    => 'title_tagline',
 +            'type'       => 'text',
 +        )
 +    ) );
 +
 +}
 +
 +add_action( 'customize_register', 'theme_customize_register' );
 </code> </code>
 ===== sql ===== ===== sql =====
onny/notizen/programmierung.txt · Last modified: 2023/11/07 15:40 by 127.0.0.1