Skip to content

justinfrankel/WHUMP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 

Repository files navigation

WHUMP v0.x
Web HTML Universal Music Player 
Copyright (C) 2015 Cockos Inc
License: GPL

To use, option 1:

Make a file whump_config.js and put it with whump.html:

	// can override pl_fntitle, db_fntitle, or fntourl() definitions

	function whump_init() {
		document.title = "test";
		document.getElementById("thdr").innerHTML = "WHUMP-test";
		document.getElementById("foot").innerHTML = "Powered by WHUMP";
		request_db("database-file.txt"); // can include multiple lines of these if you like
	};


To use, option 2:

(if you want search-engines getting your page and don't want the additional javascript file)

Search and replace, e.g. in PHP:

	$init_code = 'request_db("database-file.txt");' // can include multiple statements

	echo str_replace('<title>WHUMP</title>','<title>test</title>',
		str_replace('<div id="thdr"></div>', '<div id="thdr">WHUMP-test</div>',
		str_replace('<script src="whump_config.js"></script>','',
		str_replace('<div id="foot"></div>', '<div id="foot">Powered by WHUMP</div>', 
		str_replace('whump_init();', $init_code,
		file_get_contents("whump.html"))))));


--------

database-file.txt can be a URL, and the contents of which should be zero or more lines of (tab delimited):

  ; Prepopulated playlist item:
  pre	URL

  ; Item in database:
  item	URL	length_in_seconds



--------

BONUS: want to modify the CSS without having to modify the .html file? Use the following javascript:

function getcssrule(name) {
	if (!document.styleSheets) return false;
	var ss=document.styleSheets[0],c=0;
	for (;;) {
		for (var i = 0; i < ss.cssRules.length; i ++) {
			var r = ss.cssRules ? ss.cssRules[i] : ss.rules[i];
			if (r && r.selectorText.toLowerCase()==name) return r;
		}
		if (c++) return false;
		if (ss.addRule) ss.addRule(name, null,0);
	        else ss.insertRule(name+" { }", 0);
	}
}

Example:

	getcssrule("#foot a").style.color = "black";


About

Web HTML Universal Music Player

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages