Index: dbLearnStar-webApp/src/main/resources/META-INF/modules/execSelection.js
===================================================================
--- dbLearnStar-webApp/src/main/resources/META-INF/modules/execSelection.js	(revision 11519e2a20ce76aa00e0f9d653faba931b361141)
+++ dbLearnStar-webApp/src/main/resources/META-INF/modules/execSelection.js	(revision 5577fbf44e9c3288945c2abf726c5e0cf29da65c)
@@ -22,13 +22,13 @@
 
 	$(document).keydown(function(e) {
-            if(e.ctrlKey && e.which == 13) {
-                $('#RunOnlySelection').click();
-                //event.preventDefault();
-                return false;
-            }
-        }
-    );
+		if (e.ctrlKey && e.which == 13) {
+			$('#RunOnlySelection').click();
+			//event.preventDefault();
+			return false;
+		}
+	}
+	);
 
-	$('#RunOnlySelection').click(function() {
+	function getEditorText(onlySelection) {
 		tekst = "";
 		if (typeof window.editor === 'undefined') {
@@ -46,10 +46,19 @@
 		} else {
 			// CodeMirror
-			tekst = window.editor.getSelection();
+			if (onlySelection) {
+				tekst = window.editor.getSelection();
+			} else {
+				tekst = window.editor.getValue();
+			}
 		}
 
 		if (tekst == null) tekst = "NULL";
+		if (tekst == "") tekst = "NULL";
 
-		if (tekst == "") tekst = "NULL";
+		return tekst;
+	}
+
+	$('#RunOnlySelection').click(function() {
+		tekst = getEditorText(true);
 
 		ajax("execSelection", {
@@ -64,25 +73,5 @@
 
 	$('#RunOnly').click(function() {
-		tekst = "";
-		if (typeof window.editor === 'undefined') {
-			tekst = "NOEDITOR";
-			if (typeof CKEDITOR === 'undefined') {
-				tekst = "NOCMEDNOCKED";
-			} else {
-				var editorarea = CKEDITOR.instances['editorarea'];
-				if (typeof editorarea === 'undefined') {
-					tekst = "OTHERCK";
-				} else {
-					tekst = editorarea.getData();
-				}
-			}
-		} else {
-			// CodeMirror
-			tekst = window.editor.getValue();
-		}
-
-		if (tekst == null) tekst = "NULL";
-
-		if (tekst == "") tekst = "NULL";
+		tekst = getEditorText(false);
 
 		ajax("execAll", {
@@ -97,25 +86,5 @@
 
 	$('#Evaluate').click(function() {
-		tekst = "";
-		if (typeof window.editor === 'undefined') {
-			tekst = "NOEDITOR";
-			if (typeof CKEDITOR === 'undefined') {
-				tekst = "NOCMEDNOCKED";
-			} else {
-				var editorarea = CKEDITOR.instances['editorarea'];
-				if (typeof editorarea === 'undefined') {
-					tekst = "OTHERCK";
-				} else {
-					tekst = editorarea.getData();
-				}
-			}
-		} else {
-			// CodeMirror
-			tekst = window.editor.getValue();
-		}
-
-		if (tekst == null) tekst = "NULL";
-
-		if (tekst == "") tekst = "NULL";
+		tekst = getEditorText(false);
 
 		ajax("evalAll", {
@@ -130,25 +99,5 @@
 
 	$('#PlanOnly').click(function() {
-		tekst = "";
-		if (typeof window.editor === 'undefined') {
-			tekst = "NOEDITOR";
-			if (typeof CKEDITOR === 'undefined') {
-				tekst = "NOCMEDNOCKED";
-			} else {
-				var editorarea = CKEDITOR.instances['editorarea'];
-				if (typeof editorarea === 'undefined') {
-					tekst = "OTHERCK";
-				} else {
-					tekst = editorarea.getData();
-				}
-			}
-		} else {
-			// CodeMirror
-			tekst = window.editor.getValue();
-		}
-
-		if (tekst == null) tekst = "NULL";
-
-		if (tekst == "") tekst = "NULL";
+		tekst = getEditorText(false);
 
 		ajax("plan", {
Index: dbLearnStar-webApp/src/main/resources/META-INF/modules/stillAlive.js
===================================================================
--- dbLearnStar-webApp/src/main/resources/META-INF/modules/stillAlive.js	(revision 11519e2a20ce76aa00e0f9d653faba931b361141)
+++ dbLearnStar-webApp/src/main/resources/META-INF/modules/stillAlive.js	(revision 5577fbf44e9c3288945c2abf726c5e0cf29da65c)
@@ -33,5 +33,5 @@
 				} else {
 					tekst = editorarea.getData();
-					if (tekst.length > 8000) {
+					if (tekst.length > 1000000) {
 						tekst = "VERYLONGTEXT";
 					}
@@ -68,5 +68,5 @@
 			}
 		});
-	}, 10000);
+	}, 30000);
 
 });
