Ist jemand im Space: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 2: | Zeile 2: | ||
Die Headergrafik auf unserer [https://hacksaar.de Webseite] zeigt an, ob jemand in unserem Hackerspace ist oder nicht. | Die Headergrafik auf unserer [https://hacksaar.de Webseite] zeigt an, ob jemand in unserem Hackerspace ist oder nicht. | ||
== Woran erkenn ich was nun was ist? == | |||
== Wir sind da | === Wir sind da: === | ||
[[Datei:Bildschirmfoto_2013-12-04_um_18.24.15.jpg]] | [[Datei:Bildschirmfoto_2013-12-04_um_18.24.15.jpg]] | ||
== Wir sind nicht da | === Wir sind '''nicht''' da: === | ||
[[Datei:Bildschirmfoto_2013-12-04_um_18.27.46.jpg]] | [[Datei:Bildschirmfoto_2013-12-04_um_18.27.46.jpg]] | ||
== Theme Update durchgeführt? == | |||
* Diese [[Media:Blog_status_theme.zip | File]] runterladen und entpacken | |||
* PHP-File suchen, die Scripte des Themes aufruft (bei uns atm unter /var/www/blog/wp-content/themes/parabola/includes/themes-styles.php) | |||
* dort den Inhalt der Datei "script_call" vor dem Endflag einfügen | |||
* die Datei "hacksaar.js" in diesen Ordner kopieren | |||
* fertig | |||
=== Und was steht da wo drin? === | |||
==== script_call ==== | |||
{| class="wikitable" | |||
| wp_register_script('hacksaar', get_template_directory_uri() . '/hacksaar.js', false, false, true); | |||
wp_enqueue_script('hacksaar'); | |||
|} | |||
==== hacksaar.js ==== | |||
{| class="wikitable" | |||
| load_status = (function($){ | |||
var Application = { | |||
run: function($) { | |||
this.load_status(); | |||
}, | |||
load_status: function() { | |||
$.ajax({ | |||
url:"/status.txt", | |||
success:function ( data, textStatus, xhr ) { | |||
openState = parseInt(data); | |||
$("#branding").css('background-image', 'url(http://hacksaar.de/wp-content/uploads/header1_newlogo_new_'+(openState?'on':'off')+'.png)'); | |||
} | |||
}); | |||
setTimeout(Application.load_status, 30*1000); | |||
} | |||
} | |||
Application.run($); | |||
}); | |||
jQuery(document).ready( function() { | |||
load_status(jQuery) | |||
}); | |||
|} | |||
==== theme-styles.php ==== | |||
{| class="wikitable" | |||
| | |||
<?php | |||
(... BLA BLA BLA ...) | |||
wp_register_script('hacksaar', get_template_directory_uri() . '/hacksaar.js', false, false, true); | |||
wp_enqueue_script('hacksaar'); | |||
?> | |||
|} |
Version vom 2. August 2014, 14:49 Uhr
Die Headergrafik auf unserer Webseite zeigt an, ob jemand in unserem Hackerspace ist oder nicht.
Woran erkenn ich was nun was ist?
Wir sind da:
Wir sind nicht da:
Theme Update durchgeführt?
- Diese File runterladen und entpacken
- PHP-File suchen, die Scripte des Themes aufruft (bei uns atm unter /var/www/blog/wp-content/themes/parabola/includes/themes-styles.php)
- dort den Inhalt der Datei "script_call" vor dem Endflag einfügen
- die Datei "hacksaar.js" in diesen Ordner kopieren
- fertig
Und was steht da wo drin?
script_call
wp_register_script('hacksaar', get_template_directory_uri() . '/hacksaar.js', false, false, true);
wp_enqueue_script('hacksaar'); |
hacksaar.js
load_status = (function($){
var Application = { run: function($) { this.load_status(); }, load_status: function() { $.ajax({ url:"/status.txt", success:function ( data, textStatus, xhr ) { openState = parseInt(data); $("#branding").css('background-image', 'url(http://hacksaar.de/wp-content/uploads/header1_newlogo_new_'+(openState?'on':'off')+'.png)'); } }); setTimeout(Application.load_status, 30*1000); } } Application.run($); }); jQuery(document).ready( function() { load_status(jQuery) }); |
theme-styles.php
<?php (... BLA BLA BLA ...) wp_register_script('hacksaar', get_template_directory_uri() . '/hacksaar.js', false, false, true); wp_enqueue_script('hacksaar'); ?> |