summaryrefslogtreecommitdiff
path: root/tbc/templates
diff options
context:
space:
mode:
authorhardythe12014-07-03 12:42:20 +0530
committerhardythe12014-07-03 12:42:20 +0530
commit36e7f06608eb339082c2e905133bd7d83d9b36f0 (patch)
tree365530a000ced2ae1a574640e425fa78b296f93c /tbc/templates
parent614491e6b59f9cd394b4866afd3686a778db8594 (diff)
downloadPython-TBC-Interface-36e7f06608eb339082c2e905133bd7d83d9b36f0.tar.gz
Python-TBC-Interface-36e7f06608eb339082c2e905133bd7d83d9b36f0.tar.bz2
Python-TBC-Interface-36e7f06608eb339082c2e905133bd7d83d9b36f0.zip
Correcting JS: file names with '.' in it apart from file extension was not allowing .png files to be uploaded
Diffstat (limited to 'tbc/templates')
-rw-r--r--tbc/templates/tbc/upload-content.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/tbc/templates/tbc/upload-content.html b/tbc/templates/tbc/upload-content.html
index 5f6025c..62d2941 100644
--- a/tbc/templates/tbc/upload-content.html
+++ b/tbc/templates/tbc/upload-content.html
@@ -15,7 +15,7 @@ function validate_content()
alert("Chapter names & file fields cannot be empty !!");
return false;
}
- if(extension[1] == "ipynb")
+ if(extension.slice(Math.max(extension.length - 1, 1)) == "ipynb")
continue;
else
alert("Oops !! You can upload only Ipython Notebooks (.ipynb extension)");
@@ -32,7 +32,7 @@ function validate_content()
return false;
}
- if(extension[1] == "png")
+ if(extension.slice(Math.max(extension.length - 1, 1)) == "png")
continue;
else
alert("Only .png files are allowed for screenshots");