Commit 856b9f23 authored by Saskia Schreiber's avatar Saskia Schreiber

Merge branch 'master' into feature-text-checker

parents 3f405c97 d199d92f
...@@ -25,7 +25,7 @@ Minor features and changes: ...@@ -25,7 +25,7 @@ Minor features and changes:
Project management: Klaus Quibeldey-Cirkel Project management: Klaus Quibeldey-Cirkel
Lead programming: Andreas Gärtner, Daniel Gerhardt, Christoph Thelen Lead programming: Andreas Gärtner, Daniel Gerhardt, Christoph Thelen
Contributions: Felix Schmidt, Artjom Siebert, Daniel Vogel Contributions: Felix Schmidt, Artjom Siebert, Daniel Vogel
Sponsoring: [AG QLS](https://www.thm.de/zqe/qmnetzwerk/agqls), Sponsoring: [AG QLS](https://www.thm.de/site/en/hochschule/service/ag-qls.html),
[HMWK](https://wissenschaft.hessen.de/wissenschaft/it-neue-medien/kompetenznetz-e-learning-hessen) [HMWK](https://wissenschaft.hessen.de/wissenschaft/it-neue-medien/kompetenznetz-e-learning-hessen)
...@@ -61,7 +61,7 @@ Contributions: Colin Appel, Sören Gutzeit, Julian Hochstetter, Jan Kammer, ...@@ -61,7 +61,7 @@ Contributions: Colin Appel, Sören Gutzeit, Julian Hochstetter, Jan Kammer,
Daniel Knapp, Alexander Nadler, Julian Rossback, Karolina Rozanka, Jannik Daniel Knapp, Alexander Nadler, Julian Rossback, Karolina Rozanka, Jannik
Schaaf, Felix Schmidt, Artjom Siebert, Daniel Vogel Schaaf, Felix Schmidt, Artjom Siebert, Daniel Vogel
Testing & Feedback: Kevin Atkins, Kathrin Jäger Testing & Feedback: Kevin Atkins, Kathrin Jäger
Sponsoring: [AG QLS](https://www.thm.de/zqe/qmnetzwerk/agqls), Sponsoring: [AG QLS](https://www.thm.de/site/en/hochschule/service/ag-qls.html),
[HMWK](https://wissenschaft.hessen.de/wissenschaft/it-neue-medien/kompetenznetz-e-learning-hessen), [HMWK](https://wissenschaft.hessen.de/wissenschaft/it-neue-medien/kompetenznetz-e-learning-hessen),
[@LLZ](http://llz.uni-halle.de/) [@LLZ](http://llz.uni-halle.de/)
......
...@@ -224,6 +224,9 @@ Ext.application({ ...@@ -224,6 +224,9 @@ Ext.application({
/* show diagnosis tab panel */ /* show diagnosis tab panel */
mainTabPanel.diagnosisPanel.tab.show(); mainTabPanel.diagnosisPanel.tab.show();
/* check existing login in stored session */
ARSnova.app.getController('Sessions').checkExistingSessionLogin();
mainTabPanel.animateActiveItem(mainTabPanel.homeTabPanel, 'slide'); mainTabPanel.animateActiveItem(mainTabPanel.homeTabPanel, 'slide');
var hTP = mainTabPanel.homeTabPanel; var hTP = mainTabPanel.homeTabPanel;
switch (ARSnova.app.userRole) { switch (ARSnova.app.userRole) {
...@@ -237,12 +240,6 @@ Ext.application({ ...@@ -237,12 +240,6 @@ Ext.application({
default: default:
break; break;
} }
if (sessionStorage.getItem("keyword") !== null && sessionStorage.getItem("keyword") !== "") {
return ARSnova.app.getController('Sessions').login({
keyword: sessionStorage.getItem("keyword")
});
}
}, },
/** /**
...@@ -299,23 +296,48 @@ Ext.application({ ...@@ -299,23 +296,48 @@ Ext.application({
} }
}, },
showMask: function (mask, duration) {
var minimumDuration = 800;
Ext.Viewport.setMasked(mask);
this.maskedMessage = mask.message;
var hideLoadMask = Ext.Function.createDelayed(function (message) {
if (this.maskedMessage === message) {
Ext.Viewport.setMasked(false);
}
}, minimumDuration, this, [mask.message]);
Ext.defer(hideLoadMask, (duration || 5000) - minimumDuration);
return hideLoadMask;
},
/** /**
* Wrapper for an invidivudal LoadMask * Wrapper for an individual loading mask
*/ */
showLoadMask: function (message, duration) { showLoadMask: function (message, duration) {
var minimumDuration = 800; return this.showMask({
Ext.Viewport.setMasked({
xtype: 'loadmask', xtype: 'loadmask',
message: message || "" message: message || ""
}); }, duration);
},
var hideLoadMask = Ext.Function.createDelayed(function () { /**
Ext.Viewport.setMasked(false); * Wrapper for an individual load indicator
}, minimumDuration); */
Ext.defer(hideLoadMask, (duration || 5000) - minimumDuration); showLoadIndicator: function (message, duration) {
var screenWidth = (window.innerWidth > 0) ? window.innerWidth : screen.width;
var indicatorCls = 'x-loading-mask customLoadingIndicator ' +
(screenWidth < 720 ? 'overlayLoadingIndicator' : 'toolbarLoadingIndicator');
return hideLoadMask; return this.showMask({
xtype: 'loadmask',
baseCls: '',
top: 'initial',
right: 'initial',
cls: indicatorCls,
message: message || '',
bottom: screenWidth < 720 ? '60px' : '4px'
}, duration);
}, },
/** /**
......
...@@ -87,14 +87,23 @@ Ext.define("ARSnova.controller.Application", { ...@@ -87,14 +87,23 @@ Ext.define("ARSnova.controller.Application", {
cachedY = 0; cachedY = 0;
var preventClick = function (e) { var preventClick = function (e) {
var prevent = false;
e = e || window.event; e = e || window.event;
var element = e.target || e.srcElement; var element = e.target || e.srcElement;
if (element.tagName === 'IMG' && element.className === 'resizeableImage' || if (element.tagName === 'IMG' && element.className === 'resizeableImage' ||
element.tagName === 'SPAN' && element.className === 'videoImageContainer' || element.tagName === 'SPAN' && element.className === 'videoImageContainer' ||
element.tagName === 'A' && element.className !== "session-export") { element.tagName === 'A' && element.className !== 'session-export') {
return true; prevent = true;
if (element.tagName === 'A' &&
!ARSnova.app.getController('Application').checkHrefProtocol(element.href)) {
element.target = '_blank'; // open link in new tab
prevent = false;
}
} }
return false;
return prevent;
}; };
document.onclick = function (e) { document.onclick = function (e) {
...@@ -156,10 +165,6 @@ Ext.define("ARSnova.controller.Application", { ...@@ -156,10 +165,6 @@ Ext.define("ARSnova.controller.Application", {
controller.toggleHrefPanelActive(); controller.toggleHrefPanelActive();
controller.handleInternEmbeddedPageLoading(controller, title, url); controller.handleInternEmbeddedPageLoading(controller, title, url);
} }
return false; // prevent default action and stop event propagation
} else {
element.target = '_blank'; // open link in new tab
} }
} }
}, },
......
...@@ -148,6 +148,37 @@ Ext.define("ARSnova.controller.Auth", { ...@@ -148,6 +148,37 @@ Ext.define("ARSnova.controller.Auth", {
} }
}, },
changeRole: function (role, callback) {
console.debug("Controller: Auth.changeRole", role);
var mainTabPanel = ARSnova.app.mainTabPanel.tabPanel;
var hTP = mainTabPanel.homeTabPanel;
ARSnova.app.userRole =
role === ARSnova.app.USER_ROLE_STUDENT ||
role === ARSnova.app.USER_ROLE_SPEAKER ?
role : ARSnova.app.userRole;
var animation = {
type: 'flip',
direction: role ? 'right' : 'left',
listeners: !callback ? {} : {
animationend: callback
}
};
switch (ARSnova.app.userRole) {
case ARSnova.app.USER_ROLE_STUDENT:
hTP.homePanel.checkLogin();
hTP.animateActiveItem(hTP.homePanel, animation);
break;
case ARSnova.app.USER_ROLE_SPEAKER:
hTP.animateActiveItem(hTP.mySessionsPanel, animation);
break;
}
localStorage.setItem('role', ARSnova.app.userRole);
},
checkLogin: function () { checkLogin: function () {
console.debug("Controller: Auth.checkLogin"); console.debug("Controller: Auth.checkLogin");
var promise = new RSVP.Promise(); var promise = new RSVP.Promise();
......
...@@ -105,16 +105,5 @@ Ext.define("ARSnova.controller.Feedback", { ...@@ -105,16 +105,5 @@ Ext.define("ARSnova.controller.Feedback", {
fP.activeItem = 1; fP.activeItem = 1;
} }
tP.setActiveItem(fP); tP.setActiveItem(fP);
},
statistic: function () {
ARSnova.app.showLoadMask("Erzeuge die Grafik...");
var fP = ARSnova.app.mainTabPanel.tabPanel.feedbackTabPanel;
fP.statisticPanel.backButton.show();
ARSnova.app.mainTabPanel.tabPanel.setActiveItem(fP);
ARSnova.app.mainTabPanel.tabPanel.feedbackTabPanel.addListener('deactivate', function (panel) {
panel.statisticPanel.backButton.hide();
}, this, {single: true});
} }
}); });
...@@ -292,9 +292,16 @@ Ext.define("ARSnova.controller.Questions", { ...@@ -292,9 +292,16 @@ Ext.define("ARSnova.controller.Questions", {
return; return;
} }
var hideLoadMask = ARSnova.app.showLoadIndicator(Messages.LOAD_MASK_SAVE);
question.saveSkillQuestion({ question.saveSkillQuestion({
success: options.successFunc, success: function () {
failure: options.failureFunc options.successFunc();
hideLoadMask();
},
failure: function () {
options.failureFunc();
hideLoadMask();
}
}); });
}, },
......
...@@ -50,6 +50,7 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -50,6 +50,7 @@ Ext.define("ARSnova.controller.Sessions", {
return; return;
} }
/* do login stuff */ /* do login stuff */
var hideLoadMask = ARSnova.app.showLoadIndicator(Messages.LOAD_MASK_LOGIN);
var res = ARSnova.app.sessionModel.checkSessionLogin(options.keyword, { var res = ARSnova.app.sessionModel.checkSessionLogin(options.keyword, {
success: function (obj) { success: function (obj) {
// check if user is creator of this session // check if user is creator of this session
...@@ -95,12 +96,15 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -95,12 +96,15 @@ Ext.define("ARSnova.controller.Sessions", {
}, },
notFound: function () { notFound: function () {
Ext.Msg.alert(Messages.NOTIFICATION, Messages.SESSION_NOT_FOUND); Ext.Msg.alert(Messages.NOTIFICATION, Messages.SESSION_NOT_FOUND);
hideLoadMask();
}, },
forbidden: function () { forbidden: function () {
Ext.Msg.alert(Messages.NOTIFICATION, Messages.SESSION_LOCKED); Ext.Msg.alert(Messages.NOTIFICATION, Messages.SESSION_LOCKED);
hideLoadMask();
}, },
failure: function () { failure: function () {
Ext.Msg.alert(Messages.NOTIFICATION, Messages.CONNECTION_PROBLEM); Ext.Msg.alert(Messages.NOTIFICATION, Messages.CONNECTION_PROBLEM);
hideLoadMask();
} }
}); });
}, },
...@@ -172,10 +176,15 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -172,10 +176,15 @@ Ext.define("ARSnova.controller.Sessions", {
tabPanel.feedbackTabPanel.tab.hide(); tabPanel.feedbackTabPanel.tab.hide();
}, },
reloadData: function () { reloadData: function (animation) {
var tabPanel = ARSnova.app.mainTabPanel.tabPanel; var tabPanel = ARSnova.app.mainTabPanel.tabPanel;
var hideLoadMask = Ext.emptyFn; var hideLoadMask = Ext.emptyFn;
animation = !!animation ? animation : {
type: 'slide',
duration: 700
};
if (ARSnova.app.isSessionOwner && ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) { if (ARSnova.app.isSessionOwner && ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) {
ARSnova.app.sessionModel.fireEvent(ARSnova.app.sessionModel.events.sessionJoinAsSpeaker); ARSnova.app.sessionModel.fireEvent(ARSnova.app.sessionModel.events.sessionJoinAsSpeaker);
/* add speaker in class panel */ /* add speaker in class panel */
...@@ -183,14 +192,10 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -183,14 +192,10 @@ Ext.define("ARSnova.controller.Sessions", {
tabPanel.speakerTabPanel = Ext.create('ARSnova.view.speaker.TabPanel'); tabPanel.speakerTabPanel = Ext.create('ARSnova.view.speaker.TabPanel');
tabPanel.insert(1, tabPanel.speakerTabPanel); tabPanel.insert(1, tabPanel.speakerTabPanel);
} else { } else {
hideLoadMask = ARSnova.app.showLoadMask(Messages.LOAD_MASK_LOGIN, 3000);
tabPanel.speakerTabPanel.tab.show(); tabPanel.speakerTabPanel.tab.show();
tabPanel.speakerTabPanel.renew(); tabPanel.speakerTabPanel.renew();
} }
tabPanel.animateActiveItem(tabPanel.speakerTabPanel, { tabPanel.animateActiveItem(tabPanel.speakerTabPanel, animation);
type: 'slide',
duration: 700
});
tabPanel.speakerTabPanel.inClassPanel.registerListeners(); tabPanel.speakerTabPanel.inClassPanel.registerListeners();
/* add feedback statistic panel*/ /* add feedback statistic panel*/
...@@ -231,21 +236,22 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -231,21 +236,22 @@ Ext.define("ARSnova.controller.Sessions", {
tabPanel.feedbackTabPanel.renew(); tabPanel.feedbackTabPanel.renew();
} }
tabPanel.animateActiveItem(tabPanel.userTabPanel, { tabPanel.animateActiveItem(tabPanel.userTabPanel, animation);
type: 'slide',
duration: 700
});
} }
/* add feedback questions panel*/ /* add feedback questions panel*/
if (!tabPanel.feedbackQuestionsPanel) { if (!tabPanel.feedbackQuestionsPanel) {
tabPanel.feedbackQuestionsPanel = Ext.create('ARSnova.view.feedbackQuestions.TabPanel'); tabPanel.feedbackQuestionsPanel = Ext.create('ARSnova.view.feedbackQuestions.TabPanel');
if (ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) {
tabPanel.insert(2, tabPanel.feedbackQuestionsPanel);
} else {
tabPanel.insert(4, tabPanel.feedbackQuestionsPanel);
}
} }
if (!tabPanel.userTabPanel) { if (ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) {
tabPanel.insert(2, tabPanel.feedbackQuestionsPanel);
tabPanel.feedbackQuestionsPanel.tab.show(); tabPanel.feedbackQuestionsPanel.tab.show();
} else { } else {
tabPanel.insert(4, tabPanel.feedbackQuestionsPanel);
tabPanel.feedbackQuestionsPanel.tab.hide(); tabPanel.feedbackQuestionsPanel.tab.hide();
} }
...@@ -257,8 +263,8 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -257,8 +263,8 @@ Ext.define("ARSnova.controller.Sessions", {
create: function (options) { create: function (options) {
var session = Ext.create('ARSnova.model.Session', { var session = Ext.create('ARSnova.model.Session', {
type: 'session', type: 'session',
name: options.name, name: options.name.trim(),
shortName: options.shortName, shortName: options.shortName.trim(),
creator: localStorage.getItem('login'), creator: localStorage.getItem('login'),
courseId: options.courseId, courseId: options.courseId,
courseType: options.courseType, courseType: options.courseType,
...@@ -377,6 +383,70 @@ Ext.define("ARSnova.controller.Sessions", { ...@@ -377,6 +383,70 @@ Ext.define("ARSnova.controller.Sessions", {
}); });
}, },
changeRole: function () {
var tabPanel = ARSnova.app.mainTabPanel.tabPanel;
var hideLoadMask = ARSnova.app.showLoadIndicator(Messages.CHANGE_ROLE + '...', 2000);
var reloadSession = function (animationDirection, onAnimationEnd) {
tabPanel.updateHomeBadge();
ARSnova.app.socket.setSession(null);
ARSnova.app.socket.setSession(sessionStorage.getItem('keyword'));
onAnimationEnd = (typeof onAnimationEnd === 'function') ?
onAnimationEnd : hideLoadMask;
ARSnova.app.getController('Sessions').reloadData({
listeners: {animationend: onAnimationEnd},
direction: animationDirection,
type: 'flip'
});
};
if (ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) {
localStorage.setItem('lastVisitedRole', ARSnova.app.USER_ROLE_SPEAKER);
localStorage.setItem('role', ARSnova.app.USER_ROLE_STUDENT);
ARSnova.app.userRole = ARSnova.app.USER_ROLE_STUDENT;
/* hide speaker tab panel and destroy listeners */
tabPanel.speakerTabPanel.tab.hide();
tabPanel.speakerTabPanel.inClassPanel.destroyListeners();
reloadSession('right');
} else {
if (localStorage.getItem('lastVisitedRole') === ARSnova.app.USER_ROLE_SPEAKER) {
localStorage.setItem('role', ARSnova.app.USER_ROLE_SPEAKER);
ARSnova.app.userRole = ARSnova.app.USER_ROLE_SPEAKER;
localStorage.removeItem('lastVisitedRole');
/* hide user tab panels and destroy listeners */
tabPanel.userTabPanel.tab.hide();
tabPanel.userQuestionsPanel.tab.hide();
tabPanel.userTabPanel.inClassPanel.destroyListeners();
reloadSession('left', function () {
/* remove user tab panel and user questions panel*/
tabPanel.remove(tabPanel.userQuestionsPanel);
tabPanel.remove(tabPanel.userTabPanel);
delete tabPanel.userQuestionsPanel;
delete tabPanel.userTabPanel;
hideLoadMask();
});
}
}
},
checkExistingSessionLogin: function () {
if (localStorage.getItem('lastVisitedRole') === ARSnova.app.USER_ROLE_SPEAKER) {
localStorage.setItem('role', ARSnova.app.USER_ROLE_SPEAKER);
ARSnova.app.userRole = ARSnova.app.USER_ROLE_SPEAKER;
localStorage.removeItem('lastVisitedRole');
} else {
if (sessionStorage.getItem("keyword") !== null && sessionStorage.getItem("keyword") !== "") {
ARSnova.app.getController('Sessions').login({
keyword: sessionStorage.getItem("keyword")
});
}
}
},
setActive: function (options) { setActive: function (options) {
ARSnova.app.sessionModel.lock(sessionStorage.getItem("keyword"), options.active, { ARSnova.app.sessionModel.lock(sessionStorage.getItem("keyword"), options.active, {
success: function () { success: function () {
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
/* LOAD MASK */ /* LOAD MASK */
LOAD_MASK: "Lade Daten...", LOAD_MASK: "Lade Daten...",
LOAD_MASK_LOGIN: "Login...", LOAD_MASK_LOGIN: "Login...",
LOAD_MASK_SAVE: 'Speichern...',
LOAD_MASK_SEARCH: "Suche Sessions...", LOAD_MASK_SEARCH: "Suche Sessions...",
LOAD_MASK_SEARCH_QUESTIONS: "Suche Fragen...", LOAD_MASK_SEARCH_QUESTIONS: "Suche Fragen...",
LOAD_MASK_SEARCH_COURSES: "Suche Kurse...", LOAD_MASK_SEARCH_COURSES: "Suche Kurse...",
...@@ -248,7 +249,7 @@ ...@@ -248,7 +249,7 @@
ONE_NEW_LECTURE_QUESTION: 'Es gibt eine neue Hörsaalfrage.', ONE_NEW_LECTURE_QUESTION: 'Es gibt eine neue Hörsaalfrage.',
ONE_NEW_PREPARATION_QUESTION: 'Es gibt eine neue Vorbereitungsaufgabe.', ONE_NEW_PREPARATION_QUESTION: 'Es gibt eine neue Vorbereitungsaufgabe.',
SEVERAL_NEW_LECTURE_QUESTIONS: 'Es gibt ### neue Hörsaalfragen.', SEVERAL_NEW_LECTURE_QUESTIONS: 'Es gibt ### neue Hörsaalfragen.',
SEVERAL_PREPARATION_QUESTIONS: 'Es gibt ### neue Vorbereitungsaufgaben.', SEVERAL_NEW_PREPARATION_QUESTIONS: 'Es gibt ### neue Vorbereitungsaufgaben.',
WANNA_ANSWER: 'Möchten Sie jetzt antworten?', WANNA_ANSWER: 'Möchten Sie jetzt antworten?',
THERE_ARE: "Es gibt", THERE_ARE: "Es gibt",
NEW_QUESTIONS: "neue Fragen.", NEW_QUESTIONS: "neue Fragen.",
...@@ -673,6 +674,7 @@ ...@@ -673,6 +674,7 @@
/* LOAD MASK */ /* LOAD MASK */
LOAD_MASK: "Loading...", LOAD_MASK: "Loading...",
LOAD_MASK_LOGIN: "Login...", LOAD_MASK_LOGIN: "Login...",
LOAD_MASK_SAVE: 'Saving...',
LOAD_MASK_SEARCH: "Looking for sessions...", LOAD_MASK_SEARCH: "Looking for sessions...",
LOAD_MASK_SEARCH_QUESTIONS: "Looking for questions...", LOAD_MASK_SEARCH_QUESTIONS: "Looking for questions...",
LOAD_MASK_SEARCH_COURSES: "Looking for courses...", LOAD_MASK_SEARCH_COURSES: "Looking for courses...",
...@@ -824,7 +826,7 @@ ...@@ -824,7 +826,7 @@
ONE_NEW_LECTURE_QUESTION: 'There is one new lecture question.', ONE_NEW_LECTURE_QUESTION: 'There is one new lecture question.',
ONE_NEW_PREPARATION_QUESTION: 'There is one new preparation task.', ONE_NEW_PREPARATION_QUESTION: 'There is one new preparation task.',
SEVERAL_NEW_LECTURE_QUESTIONS: 'There are ### new lecture questions.', SEVERAL_NEW_LECTURE_QUESTIONS: 'There are ### new lecture questions.',
SEVERAL_PREPARATION_QUESTIONS: 'There are ### new preparation tasks.', SEVERAL_NEW_PREPARATION_QUESTIONS: 'There are ### new preparation tasks.',
WANNA_ANSWER: 'Would you like to answer now?', WANNA_ANSWER: 'Would you like to answer now?',
THERE_ARE: "There are", THERE_ARE: "There are",
NEW_QUESTIONS: "new questions.", NEW_QUESTIONS: "new questions.",
......
...@@ -46,6 +46,15 @@ Ext.define('ARSnova.proxy.RestProxy', { ...@@ -46,6 +46,15 @@ Ext.define('ARSnova.proxy.RestProxy', {
}, this, {single: true}); }, this, {single: true});
}, },
/**
* @param start index
* @param end index
* @return formatted range header string
*/
constructRangeRequestString: function (offset, limit) {
return 'items=' + offset + '-' + limit;
},
/** /**
* Search for a session with specified keyword * Search for a session with specified keyword
* @param keyword of session * @param keyword of session
...@@ -134,7 +143,7 @@ Ext.define('ARSnova.proxy.RestProxy', { ...@@ -134,7 +143,7 @@ Ext.define('ARSnova.proxy.RestProxy', {
* @return session-objects, if found * @return session-objects, if found
* @return false, if nothing found * @return false, if nothing found
*/ */
getMySessions: function (callbacks, sortby) { getMySessions: function (callbacks, sortby, offset, limit) {
this.arsjax.request({ this.arsjax.request({
url: "session/", url: "session/",
method: "GET", method: "GET",
...@@ -142,7 +151,6 @@ Ext.define('ARSnova.proxy.RestProxy', { ...@@ -142,7 +151,6 @@ Ext.define('ARSnova.proxy.RestProxy', {
statusonly: true, statusonly: true,
sortby: sortby sortby: sortby
}, },
success: callbacks.success, success: callbacks.success,
204: callbacks.empty, 204: callbacks.empty,
...@@ -987,7 +995,7 @@ Ext.define('ARSnova.proxy.RestProxy', { ...@@ -987,7 +995,7 @@ Ext.define('ARSnova.proxy.RestProxy', {
getVimeoThumbnailUrl: function (videoId, callbacks) { getVimeoThumbnailUrl: function (videoId, callbacks) {
Ext.Ajax.request({ Ext.Ajax.request({
type: 'GET', type: 'GET',
url: 'http://vimeo.com/api/v2/video/' + videoId + '.json', url: '//vimeo.com/api/v2/video/' + videoId + '.json',
useDefaultXhrHeader: false, useDefaultXhrHeader: false,
success: function (response) { success: function (response) {
var json = response.responseText || "{}"; var json = response.responseText || "{}";
......
...@@ -34,6 +34,8 @@ Ext.define('ARSnova.view.Caption', { ...@@ -34,6 +34,8 @@ Ext.define('ARSnova.view.Caption', {
this.listButton = Ext.create('ARSnova.view.MultiBadgeButton', { this.listButton = Ext.create('ARSnova.view.MultiBadgeButton', {
ui: 'small', ui: 'small',
text: "", text: "",
disabled: true,
disabledCls: '',
cls: 'forwardListButton caption', cls: 'forwardListButton caption',
style: this.getStyle() style: this.getStyle()
}); });
......
...@@ -71,12 +71,12 @@ Ext.define('ARSnova.view.Question', { ...@@ -71,12 +71,12 @@ Ext.define('ARSnova.view.Question', {
answerStore.each(function (item) { answerStore.each(function (item) {
if (ARSnova.app.globalConfig.parseAnswerOptionFormatting) { if (ARSnova.app.globalConfig.parseAnswerOptionFormatting) {
var md = Ext.create('ARSnova.view.MathJaxMarkDownPanel'); var md = Ext.create('ARSnova.view.MathJaxMarkDownPanel');
md.setContent(item.get('text'), true, true, function (html) { md.setContent(item.get('text'), true, false, function (html) {
item.set('formattedText', html.getHtml()); item.set('formattedText', '<p>' + html.getHtml() + '</p>');
md.destroy(); md.destroy();
}); });
} else { } else {
item.set('formattedText', Ext.util.Format.htmlEncode(item.get('text'))); item.set('formattedText', '<p>' + Ext.util.Format.htmlEncode(item.get('text')) + '</p>');
} }
}); });
...@@ -524,6 +524,11 @@ Ext.define('ARSnova.view.Question', { ...@@ -524,6 +524,11 @@ Ext.define('ARSnova.view.Question', {
0.9 : 0.75 0.9 : 0.75
}); });
/* update disabled state on initialize */
if (this.questionObj.votingDisabled) {
this.disableQuestion();
}
this.add([ this.add([
this.formPanel, this.countdownTimer, this.formPanel, this.countdownTimer,
this.editButtons ? this.editButtons : {} this.editButtons ? this.editButtons : {}
...@@ -692,24 +697,17 @@ Ext.define('ARSnova.view.Question', { ...@@ -692,24 +697,17 @@ Ext.define('ARSnova.view.Question', {
setZoomLevel: function (size) { setZoomLevel: function (size) {
this.formPanel.setStyle('font-size: ' + size + '%;'); this.formPanel.setStyle('font-size: ' + size + '%;');
this.answerList.fireEvent('resizeList', this.answerList.element);
ARSnova.app.getController('Application').setGlobalZoomLevel(size); ARSnova.app.getController('Application').setGlobalZoomLevel(size);
this.updateListHeight(); this.updateListHeight();
}, },
updateListHeight: function () { updateListHeight: function () {
var me = this; if (this.questionObj.questionType !== 'grid') {
var listItemsDom = this.answerList.element.select(".x-list .x-inner .x-inner").elements[0];
if (!me.resizeListFlag && this.questionObj.questionType !== 'grid') { listItemsDom.style.display = 'none';
me.resizeListFlag = true; this.answerList.fireEvent('resizeList', this.answerList.element);
Ext.create('Ext.util.DelayedTask', function () { listItemsDom.style.display = '';
if (me.answerList.element.dom.style.display !== 'none') { this.answerList.fireEvent('resizeList', this.answerList.element);
me.answerList.element.dom.style.display = 'none';
me.answerList.fireEvent('resizeList', me.answerList.element);
me.answerList.element.dom.style.display = '';
me.resizeListFlag = false;
}
}).delay(2000);
} }
}, },
......
...@@ -34,7 +34,7 @@ Ext.define('ARSnova.view.SessionStatusButton', { ...@@ -34,7 +34,7 @@ Ext.define('ARSnova.view.SessionStatusButton', {
this.sessionIsClosed = Ext.create('ARSnova.view.MatrixButton', { this.sessionIsClosed = Ext.create('ARSnova.view.MatrixButton', {
buttonConfig: 'icon', buttonConfig: 'icon',
cls: 'actionButton',