Refactored session_write_close() optimization and dashboard preloading

hack
This commit is contained in:
Albert Santoni 2015-04-09 13:03:06 -04:00
parent 3e255bfd37
commit 1734cc35c8
7 changed files with 35 additions and 31 deletions

View file

@ -19,23 +19,6 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
})(window,document,'script','dataLayer','GTM-55N6NH');</script>
<!-- End Google Tag Manager -->
<script type="text/javascript">
//Awful hack to speed up loading - Embed the schedule in the response so that the dashboard
//doesn't have to make a separate AJAX request to get this data.
var schedulePreLoaded = <?php
require_once("ScheduleController.php");
$front = Zend_Controller_Front::getInstance();
$foo = new ScheduleController($front->getRequest(), $front->getResponse());
$foo->getCurrentPlaylistAction();
echo(json_encode($foo->view));
?>;
parseItems(schedulePreLoaded.entries);
parseSourceStatus(schedulePreLoaded.source_status);
parseSwitchStatus(schedulePreLoaded.switch_status);
</script>
<?php echo $this->partial('partialviews/trialBox.phtml', array("is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?>
<div id="Panel">
<?php echo $this->versionNotify();
@ -46,6 +29,23 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
"scheduled_play_switch"=>$sss['scheduled_play'])) ?>
<?php $partial = array('menu.phtml', 'default');
$this->navigation()->menu()->setPartial($partial); ?>
<script type="text/javascript">
var schedulePreLoaded = <?php
//Awful hack to speed up loading - Embed the schedule in the response so that the dashboard
//doesn't have to make a separate AJAX request to get this data.
require_once("ScheduleController.php");
ScheduleController::printCurrentPlaylistForEmbedding();
?>;
//The DOM elements that these calls depend on exist by this point:
parseItems(schedulePreLoaded.entries);
parseSourceStatus(schedulePreLoaded.source_status);
parseSwitchStatus(schedulePreLoaded.switch_status);
</script>
<div id="nav">
<div class="logo"></div>
<div class="personal-block solo">