Index: lams_tool_forum/web/WEB-INF/tags/Head.tag =================================================================== diff -u -r6cd8cbab6859faed8f7709878af9b602b86976f6 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/WEB-INF/tags/Head.tag (.../Head.tag) (revision 6cd8cbab6859faed8f7709878af9b602b86976f6) +++ lams_tool_forum/web/WEB-INF/tags/Head.tag (.../Head.tag) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,42 +1,41 @@ -<%/**************************************************************** - * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) - * ============================================================= - * License Information: http://lamsfoundation.org/licensing/lams/2.0/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2.0 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - * - * http://www.gnu.org/licenses/gpl.txt - * **************************************************************** - */ - -/** - * Head.tag - * Author: Fiona Malikoff +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/** + * Head.tag + * Author: Fiona Malikoff * Description: Sets up the non-cache pragma statements and the UTF-8 - * encoding. Use in place of the normal head tag. - */ + * encoding. Use in place of the normal head tag. + */ %> + +<%@ tag body-content="scriptless"%> -<%@ tag body-content="scriptless"%> - - - + Index: lams_tool_forum/web/error.jsp =================================================================== diff -u -rf0c2b8f197da1cd58d9df772e6f0ef072d656602 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/error.jsp (.../error.jsp) (revision f0c2b8f197da1cd58d9df772e6f0ef072d656602) +++ lams_tool_forum/web/error.jsp (.../error.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,5 +1,4 @@ - + <%@ page language="java" isErrorPage="true" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> <%@ taglib uri="tags-lams" prefix="lams"%> Index: lams_tool_forum/web/includes/layout.jsp =================================================================== diff -u -r18e5e690d2e1a7c3d918759f7a2827c8205feaac -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/includes/layout.jsp (.../layout.jsp) (revision 18e5e690d2e1a7c3d918759f7a2827c8205feaac) +++ lams_tool_forum/web/includes/layout.jsp (.../layout.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,5 +1,4 @@ - + <%@ include file="/common/taglibs.jsp"%> <%@ taglib uri="tags-tiles" prefix="tiles"%> Index: lams_tool_forum/web/includes/learnerLayout.jsp =================================================================== diff -u -rc4854959d539a3b2d18dc30be9a11f7c127050aa -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/includes/learnerLayout.jsp (.../learnerLayout.jsp) (revision c4854959d539a3b2d18dc30be9a11f7c127050aa) +++ lams_tool_forum/web/includes/learnerLayout.jsp (.../learnerLayout.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,4 +1,4 @@ - + <%@ include file="/common/taglibs.jsp"%> <%@ taglib uri="tags-tiles" prefix="tiles"%> Index: lams_tool_forum/web/includes/mobileLearnerLayout.jsp =================================================================== diff -u -rc92604358056844c7736f2779398bbc38512928a -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/includes/mobileLearnerLayout.jsp (.../mobileLearnerLayout.jsp) (revision c92604358056844c7736f2779398bbc38512928a) +++ lams_tool_forum/web/includes/mobileLearnerLayout.jsp (.../mobileLearnerLayout.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,5 +1,4 @@ - +> <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_forum/web/includes/tablayout.jsp =================================================================== diff -u -r18e5e690d2e1a7c3d918759f7a2827c8205feaac -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/includes/tablayout.jsp (.../tablayout.jsp) (revision 18e5e690d2e1a7c3d918759f7a2827c8205feaac) +++ lams_tool_forum/web/includes/tablayout.jsp (.../tablayout.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,5 +1,4 @@ - + <%@ include file="/common/taglibs.jsp"%> <%@ taglib uri="tags-tiles" prefix="tiles"%> Index: lams_tool_forum/web/jsps/authoring/message/create.jsp =================================================================== diff -u -rff6b58bb3c688d45286625636c21d8fa96f83baa -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/authoring/message/create.jsp (.../create.jsp) (revision ff6b58bb3c688d45286625636c21d8fa96f83baa) +++ lams_tool_forum/web/jsps/authoring/message/create.jsp (.../create.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,4 +1,4 @@ - + <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_forum/web/jsps/authoring/message/edit.jsp =================================================================== diff -u -rff6b58bb3c688d45286625636c21d8fa96f83baa -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/authoring/message/edit.jsp (.../edit.jsp) (revision ff6b58bb3c688d45286625636c21d8fa96f83baa) +++ lams_tool_forum/web/jsps/authoring/message/edit.jsp (.../edit.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,4 +1,4 @@ - + <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_forum/web/jsps/authoring/message/forbiddenedit.jsp =================================================================== diff -u -r18e5e690d2e1a7c3d918759f7a2827c8205feaac -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/authoring/message/forbiddenedit.jsp (.../forbiddenedit.jsp) (revision 18e5e690d2e1a7c3d918759f7a2827c8205feaac) +++ lams_tool_forum/web/jsps/authoring/message/forbiddenedit.jsp (.../forbiddenedit.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,7 +1,5 @@ - + - <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_forum/web/jsps/learning/edit.jsp =================================================================== diff -u -rf5eeeffd8b43143cd80031a7b04af3b0de530680 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/learning/edit.jsp (.../edit.jsp) (revision f5eeeffd8b43143cd80031a7b04af3b0de530680) +++ lams_tool_forum/web/jsps/learning/edit.jsp (.../edit.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -15,9 +15,7 @@ e.stopPropagation(); }); - // The treetable code uses the clicks to expand and collapse the replies but then - // the buttons will not work. So stop the event propogating up the event chain. - $('#editForm').submit(function() { // catch the form's submit event + function submitEdit(){ disableSubmitButton(); if ( validateForm() ) { @@ -27,50 +25,71 @@ CKEDITOR.instances[instance].updateElement(); } - var formData = new FormData(this); - - $.ajax({ // create an AJAX call... - data: formData, - processData: false, // tell jQuery not to process the data - contentType: false, // tell jQuery not to set contentType - type: $(this).attr('method'), // GET or POST - url: $(this).attr('action'), // the file to call - success: function (response) { - var messageUid = response.messageUid; - if ( messageUid ) { - var rootUid = response.rootUid; - var messDiv = document.getElementById('msg'+messageUid); - if ( ! messDiv) { - alert(''); - } else { - // make sure the old edit form is gone, so if something goes wrong - // the user won't try to submit it again - $('#edit').remove(); - var loadString = '' + rootUid + "&sessionMapID=" + response.sessionMapID + "&messageUid="+messageUid; - $(messDiv).load(loadString, function() { - $('#msg'+messageUid).focus(); - setupJRating("?toolSessionID=${sessionMap.toolSessionID}&sessionMapID=${sessionMapID}"); - highlightMessage(); - }); - } + var replyForm = $("#editForm"); + if(typeof FormData == "undefined"){ + + if ( $("#attachmentFile").val() ) { + alert("Your browser is missing the required FormData component. Files cannot be uploaded."); + } - } else { - // No valid id? Validation failed! Assume it is the form coming back. - $('#edit').html(response); - } - } - }); + $.ajax({ // create an AJAX call... + data: replyForm.serialize(), + type: replyForm.attr('method'), // GET or POST + url: replyForm.attr('action'), // the file to call + success: function(response) { + submitSuccess(response); + } + }); + + } else { + + $.ajax({ // create an AJAX call... + data: new FormData(replyForm[0]), + processData: false, + contentType: false, + type: replyForm.attr('method'), // GET or POST + url: replyForm.attr('action'), // the file to call + success: function(response) { + submitSuccess(response); + } + }); + + } } // end validateForm() else { enableSubmitButton(); } return false; - }); + } function cancelEdit() { $('#edit').remove(); } - + + function submitSuccess(response) { + var messageUid = response.messageUid; + if ( messageUid ) { + var rootUid = response.rootUid; + var messDiv = document.getElementById('msg'+messageUid); + if ( ! messDiv) { + alert(''); + } else { + // make sure the old edit form is gone, so if something goes wrong + // the user won't try to submit it again + $('#edit').remove(); + var loadString = '' + rootUid + "&sessionMapID=" + response.sessionMapID + "&messageUid="+messageUid; + $(messDiv).load(loadString, function() { + $('#msg'+messageUid).focus(); + setupJRating("?toolSessionID=${sessionMap.toolSessionID}&sessionMapID=${sessionMapID}"); + highlightMessage(); + }); + } + + } else { + // No valid id? Validation failed! Assume it is the form coming back. + $('#edit').html(response); + } + } - + Index: lams_tool_forum/web/jsps/learning/message/msgviewwrapper.jsp =================================================================== diff -u -r7a8220da72ba9cbc4da8e29db84a0de86a275d8d -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/learning/message/msgviewwrapper.jsp (.../msgviewwrapper.jsp) (revision 7a8220da72ba9cbc4da8e29db84a0de86a275d8d) +++ lams_tool_forum/web/jsps/learning/message/msgviewwrapper.jsp (.../msgviewwrapper.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,4 +1,4 @@ - + <%-- Wraps up msgview.jsp for returning a single message - called when an edit is performed. It needs to do all the setup that topicview.jsp normally does. --%> Index: lams_tool_forum/web/jsps/learning/message/topiceditform.jsp =================================================================== diff -u -r3f65546d337cbe98aea623132d1835a770e6d1c8 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/learning/message/topiceditform.jsp (.../topiceditform.jsp) (revision 3f65546d337cbe98aea623132d1835a770e6d1c8) +++ lams_tool_forum/web/jsps/learning/message/topiceditform.jsp (.../topiceditform.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -33,8 +33,9 @@ - + - + Index: lams_tool_forum/web/jsps/learning/message/topicreplyform.jsp =================================================================== diff -u -refef5787566da02898fc3cb31a876749d3a0f368 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/learning/message/topicreplyform.jsp (.../topicreplyform.jsp) (revision efef5787566da02898fc3cb31a876749d3a0f368) +++ lams_tool_forum/web/jsps/learning/message/topicreplyform.jsp (.../topicreplyform.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -19,7 +19,7 @@
- +
@@ -36,8 +36,9 @@ styleClass="button"> - + - +
Index: lams_tool_forum/web/jsps/learning/message/topicviewwrapper.jsp =================================================================== diff -u -refef5787566da02898fc3cb31a876749d3a0f368 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/learning/message/topicviewwrapper.jsp (.../topicviewwrapper.jsp) (revision efef5787566da02898fc3cb31a876749d3a0f368) +++ lams_tool_forum/web/jsps/learning/message/topicviewwrapper.jsp (.../topicviewwrapper.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -1,4 +1,4 @@ - + Index: lams_tool_forum/web/jsps/learning/reply.jsp =================================================================== diff -u -rf5eeeffd8b43143cd80031a7b04af3b0de530680 -reb494d33ce36733d74648654ed8a7221f174b95a --- lams_tool_forum/web/jsps/learning/reply.jsp (.../reply.jsp) (revision f5eeeffd8b43143cd80031a7b04af3b0de530680) +++ lams_tool_forum/web/jsps/learning/reply.jsp (.../reply.jsp) (revision eb494d33ce36733d74648654ed8a7221f174b95a) @@ -16,7 +16,7 @@ }); - $('#replyForm').submit(function() { // catch the form's submit event + function submitReply(){ disableSubmitButton(); if ( validateForm() ) { @@ -25,66 +25,87 @@ for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); } - - var formData = new FormData(this); - $.ajax({ // create an AJAX call... - data: formData, - processData: false, // tell jQuery not to process the data - contentType: false, // tell jQuery not to set contentType - type: $(this).attr('method'), // GET or POST - url: $(this).attr('action'), // the file to call - success: function (response) { - var threadDiv = document.getElementById('thread'+response.threadUid); - var threadUid = response.threadUid; - var messageUid = response.messageUid; - var rootUid = response.rootUid; - - if ( rootUid ) { - if ( ! threadDiv) { - // must have replied to the top level, so show the posting at the top. - var threadDiv = document.getElementById('reply'); - threadDiv.id = 'thread'+messageUid; - } else { - // make sure the old reply form is gone, so if something goes wrong - // the user won't try to submit it again - $('#reply').remove(); - } - - if ( ! threadDiv) { - alert(''); - } else { - var loadString = '' + rootUid + "&sessionMapID=" + response.sessionMapID + "&threadUid=" + threadUid+"&messageUid="+messageUid; - $(threadDiv).load(loadString, function() { - // expand up to the reply - in case it is buried down in a lot of replies - // don't need to do this if we have started a new thread. - if ( threadUid != messageUid ) { - $('#tree' + threadUid).treetable("reveal",messageUid); - $('#msg'+messageUid).focus(); - } - setupJRating("?toolSessionID=${sessionMap.toolSessionID}&sessionMapID=${sessionMapID}"); - highlightMessage(); - }); - } + var replyForm = $("#replyForm"); + if(typeof FormData == "undefined"){ - if ( response.noMorePosts ) { - $('.replybutton').hide(); - } - - - } else { - // No new id? Validation failed! - $('#reply').html(response); - } - } - }); + if ( $("#attachmentFile").val() ) { + alert("Your browser is missing the required FormData component. Files cannot be uploaded."); + } + + $.ajax({ // create an AJAX call... + data: replyForm.serialize(), + type: replyForm.attr('method'), // GET or POST + url: replyForm.attr('action'), // the file to call + success: function(response) { + submitSuccess(response); + } + }); + + } else { + + $.ajax({ // create an AJAX call... + data: new FormData(replyForm[0]), + processData: false, + contentType: false, + type: replyForm.attr('method'), // GET or POST + url: replyForm.attr('action'), // the file to call + success: function(response) { + submitSuccess(response); + } + }); + } + } // end validateForm() else { enableSubmitButton(); } return false; - }); + } + function submitSuccess(response) { + var threadDiv = document.getElementById('thread'+response.threadUid); + var threadUid = response.threadUid; + var messageUid = response.messageUid; + var rootUid = response.rootUid; + + if ( rootUid ) { + if ( ! threadDiv) { + // must have replied to the top level, so show the posting at the top. + var threadDiv = document.getElementById('reply'); + threadDiv.id = 'thread'+messageUid; + } else { + // make sure the old reply form is gone, so if something goes wrong + // the user won't try to submit it again + $('#reply').remove(); + } + + if ( ! threadDiv) { + alert(''); + } else { + var loadString = '' + rootUid + "&sessionMapID=" + response.sessionMapID + "&threadUid=" + threadUid+"&messageUid="+messageUid; + $(threadDiv).load(loadString, function() { + // expand up to the reply - in case it is buried down in a lot of replies + // don't need to do this if we have started a new thread. + if ( threadUid != messageUid ) { + $('#tree' + threadUid).treetable("reveal",messageUid); + $('#msg'+messageUid).focus(); + } + setupJRating("?toolSessionID=${sessionMap.toolSessionID}&sessionMapID=${sessionMapID}"); + highlightMessage(); + }); + } + + if ( response.noMorePosts ) { + $('.replybutton').hide(); + } + + } else { + // No new id? Validation failed! + $('#reply').html(response); + } + } + function cancelReply() { $('#reply').remove(); }