From 061f6f9e1a3c038b6fe7ff9f9de14afd0962894b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 26 Jan 2018 00:39:44 +0100 Subject: Use custom IDs for stylesheet and javascript resources --- include/pagelets.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/pagelets.php b/include/pagelets.php index 43d1992..412e530 100644 --- a/include/pagelets.php +++ b/include/pagelets.php @@ -16,8 +16,8 @@ $javascript = ($DEBUGGING ? 'Debugging' : 'BigPipe').'\Resource\Javascript'; #=============================================================================== $PageletRed = new $pagelet('redPL'); $PageletRed->addHTML('
I AM A PAGELET WITH RED BACKGROUND
'); -$PageletRed->addResource(new $stylesheet(NULL, 'static/red.php')); -$PageletRed->addResource(new $javascript(NULL, 'static/delayJS.php')); +$PageletRed->addResource(new $stylesheet('red-stylesheet', 'static/red.php')); +$PageletRed->addResource(new $javascript('delayed-javascript', 'static/delayJS.php')); $PageletRed->addJSCode("document.getElementById('red').innerHTML += ' [JS executed]';document.getElementById('red').style.borderRadius = '30px';"); #=============================================================================== @@ -25,8 +25,8 @@ $PageletRed->addJSCode("document.getElementById('red').innerHTML += ' [JS execut #=============================================================================== $PageletBlue = new $pagelet('bluePL', BigPipe\Pagelet::PRIORITY_HIGH); $PageletBlue->addHTML('
I AM A PAGELET WITH BLUE BACKGROUND
'); -$PageletBlue->addResource(new $stylesheet(NULL, 'static/blue.php')); -$PageletBlue->addResource(new $javascript(NULL, 'static/delayJS.php')); +$PageletBlue->addResource(new $stylesheet('blue-stylesheet', 'static/blue.php')); +$PageletBlue->addResource(new $javascript('delayed-javascript', 'static/delayJS.php')); $PageletBlue->addJSCode("document.getElementById('blue').innerHTML += ' [JS executed]';document.getElementById('blue').style.borderRadius = '30px';"); #=============================================================================== @@ -59,7 +59,7 @@ $PageletGreen = new $pagelet('greenPL'); } $PageletGreen->addHTML('
I AM A PAGELET WITH GREEN BACKGROUND'.$InnerPagelet.'
'); -$PageletGreen->addResource(new $stylesheet(NULL, 'static/green.php')); -$PageletGreen->addResource(new $javascript(NULL, 'static/delayJS.php')); +$PageletGreen->addResource(new $stylesheet('green-stylesheet', 'static/green.php')); +$PageletGreen->addResource(new $javascript('delayed-javascript', 'static/delayJS.php')); $PageletGreen->addJSCode("document.getElementById('green').innerHTML += ' [JS executed]';document.getElementById('green').style.borderRadius = '30px';"); ?> \ No newline at end of file -- cgit v1.2.3