Commit 9fe21b1b authored by Andreas Gärtner's avatar Andreas Gärtner

Some further localForage retrieval tests.

parent 25b7dee6
......@@ -30,7 +30,7 @@ Ext.define("ARSnova.controller.Storage", {
initializeStorage: function() {
/** use localstorage as driver for debugging reasons */
localforage.setDriver('localStorageWrapper');
// localforage.setDriver('localStorageWrapper');
localforage.config({
name : 'ARSnovaDB',
......@@ -96,7 +96,7 @@ Ext.define("ARSnova.controller.Storage", {
var me = this;
localforage.getItem(key, function(err, obj) {
var value = obj[me.activeSessionId];
err = true;
if(err) {
console.log('storage error');
promise.failure ?
......
......@@ -76,7 +76,7 @@ Ext.define('ARSnova.view.speaker.ShowcaseQuestionPanel', {
this.add([this.toolbar]);
this.on('activate', this.onActivate);
this.onBefore('painted', this.onActivate);
this.on('activate', this.beforeActivate, this, null, 'before');
this.on('activeitemchange', this.onItemChange);
this.on('painted', function() { ARSnova.app.innerScrollPanel = this; });
......@@ -111,6 +111,7 @@ Ext.define('ARSnova.view.speaker.ShowcaseQuestionPanel', {
var hideIndicator = ARSnova.app.showLoadMask(Messages.LOAD_MASK_SEARCH_QUESTIONS);
var timestamp1 = Math.floor(Date.now());
var task = function() {
ARSnova.app.getController('Storage').getQuestionObj({
success: function(questions) {
var panel = ARSnova.app.mainTabPanel.tabPanel.speakerTabPanel.showcaseQuestionPanel;
......@@ -138,7 +139,7 @@ Ext.define('ARSnova.view.speaker.ShowcaseQuestionPanel', {
panel.checkFirstQuestion();
hideIndicator();
console.log(Math.floor(Date.now()) - timestamp1);
alert(Math.floor(Date.now()) - timestamp1);
},
failure: function() {
me.getController().getQuestions(sessionStorage.getItem("keyword"), {
......@@ -168,7 +169,7 @@ Ext.define('ARSnova.view.speaker.ShowcaseQuestionPanel', {
panel.setActiveItem(0);
panel.checkFirstQuestion();
hideIndicator();
console.log(Date.now() - timestamp1);
alert(Date.now() - timestamp1);
},
failure: function (response) {
console.log('error');
......@@ -177,6 +178,9 @@ Ext.define('ARSnova.view.speaker.ShowcaseQuestionPanel', {
});
}
});
};
Ext.create('Ext.util.DelayedTask', task, this).delay(1);
},
addQuestion: function (question) {
......
......@@ -9,7 +9,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/png">
<link rel="stylesheet" href="resources/css/index.css" type="text/css">
<!-- MathJax -->
<!-- MathJax
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX","output/HTML-CSS"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment