Skip to content
Snippets Groups Projects
Commit 11f7636f authored by Brett Bieber's avatar Brett Bieber
Browse files

Store client viewport in the database.

parent fd4619f9
Branches
Tags
No related merge requests found
...@@ -37,6 +37,7 @@ voting_system.prototype = { ...@@ -37,6 +37,7 @@ voting_system.prototype = {
starForm: function() { return this.dispatcher.doCall('starForm',arguments); }, starForm: function() { return this.dispatcher.doCall('starForm',arguments); },
handlePostData: function() { return this.dispatcher.doCall('handlePostData',arguments); }, handlePostData: function() { return this.dispatcher.doCall('handlePostData',arguments); },
storeResponse: function() { return this.dispatcher.doCall('storeResponse',arguments); }, storeResponse: function() { return this.dispatcher.doCall('storeResponse',arguments); },
thankyou: function() { return this.dispatcher.doCall('thankyou',arguments); } thankyou: function() { return this.dispatcher.doCall('thankyou',arguments); },
saveViewport: function() { return this.dispatcher.doCall('saveViewport',arguments); }
} }
...@@ -270,7 +270,8 @@ class Voting_System ...@@ -270,7 +270,8 @@ class Voting_System
<img src="images/design_survey_12.gif" alt="proceed" /> <img src="images/design_survey_12.gif" alt="proceed" />
</a> </a>
</p> </p>
</div><!--close introduction-->'; </div><!--close introduction-->
<script type="text/javascript">setViewPort();</script>';
} }
function introduction() function introduction()
...@@ -770,4 +771,10 @@ class Voting_System ...@@ -770,4 +771,10 @@ class Voting_System
</div><!--close introduction-->'; </div><!--close introduction-->';
} }
function saveViewport($viewport)
{
$this->voter->viewport = $viewport;
$this->voter->update();
}
} }
...@@ -230,6 +230,6 @@ function setViewPort() ...@@ -230,6 +230,6 @@ function setViewPort()
viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
viewportheight = document.getElementsByTagName('body')[0].clientHeight viewportheight = document.getElementsByTagName('body')[0].clientHeight
} }
voter.saveViewport(viewportwidth+'x'+viewportheight);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment