Index: lams_central/web/newLesson.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/Attic/newLesson.jsp,v diff -u -r1.4 -r1.5 --- lams_central/web/newLesson.jsp 9 Jan 2013 15:18:37 -0000 1.4 +++ lams_central/web/newLesson.jsp 10 Jan 2013 18:52:49 -0000 1.5 @@ -70,7 +70,7 @@ -
+
@@ -99,7 +99,7 @@ -
+
@@ -138,7 +138,7 @@ -
+
@@ -150,13 +150,25 @@
-
- - -
- -
+
+ + + + + + + +
+ + + + +
+ + +
@@ -181,7 +193,7 @@
-
+
-
+

Index: lams_central/web/ckeditor/ckeditor.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/ckeditor/ckeditor.js,v diff -u -r1.4 -r1.5 --- lams_central/web/ckeditor/ckeditor.js 20 Dec 2011 06:20:59 -0000 1.4 +++ lams_central/web/ckeditor/ckeditor.js 10 Jan 2013 18:52:49 -0000 1.5 @@ -97,7 +97,7 @@ G=G.replace(/^[ \t]+|[ \t]+$/g,function(M,N,O){if(M.length==1)return ' ';else if(!N)return e.repeat(' ',M.length-1)+' ';else return ' '+e.repeat(' ',M.length-1);});G=G.replace(/[ \t]{2,}/g,function(M){return e.repeat(' ',M.length-1)+' ';});var H=E==1?'p':'div';if(!F)G=G.replace(/(\n{2})([\s\S]*?)(?:$|\1)/g,function(M,N,O){return '<'+H+'>'+O+'';});G=G.replace(/\n/g,'
');if(!(F||c))G=G.replace(new RegExp('
(?=)'),function(M){return e.repeat(M,2);});if(b.gecko||b.webkit){var I=new d.elementPath(D.getStartElement()),J=[];for(var K=0;K/));else if(L in f.$block)break;}G=J.join('')+G;}q.call(this,G);};function s(C){var D=this.getSelection(),E=D.getRanges(),F=C.getName(),G=f.$block[F],H=D.isLocked;if(H)D.unlock();var I,J,K,L;for(var M=E.length-1;M>=0;M--){I=E[M];if(!I.checkReadOnly()){I.deleteContents(1);J=!M&&C||C.clone(1);var N,O;if(G)while((N=I.getCommonAncestor(0,1))&&(O=f[N.getName()])&&!(O&&O[F])){if(N.getName() in f.span)I.splitElement(N);else if(I.checkStartOfBlock()&&I.checkEndOfBlock()){I.setStartBefore(N);I.collapse(true);N.remove();}else I.splitBlock();}I.insertNode(J);if(!K)K=J;}}if(K){I.moveToPosition(K,4);if(G){var P=K.getNext(n),Q=P&&P.type==1&&P.getName();if(Q&&f.$block[Q]&&f[Q]['#'])I.moveToElementEditStart(P);}}D.selectRanges([I]);if(H)this.getSelection().lock();};function t(C){if(!C.checkDirty())setTimeout(function(){C.resetDirty();},0);};var u=d.walker.whitespaces(true),v=d.walker.bookmark(false,true);function w(C){return u(C)&&v(C);};function x(C){return C.type==3&&e.trim(C.getText()).match(/^(?: |\xa0)$/);};function y(C){if(C.isLocked){C.unlock();setTimeout(function(){C.lock();},0);}};function z(C){return C.getOuterHtml().match(m);};u=d.walker.whitespaces(true);function A(C){var D=C.window,E=C.document,F=C.document.getBody(),G=F.getFirst(),H=F.getChildren().count();if(!H||H==1&&G.type==1&&G.hasAttribute('_moz_editor_bogus_node')){t(C);var I=C.element.getDocument(),J=I.getDocumentElement(),K=J.$.scrollTop,L=J.$.scrollLeft,M=E.$.createEvent('KeyEvents');M.initKeyEvent('keypress',true,true,D.$,false,false,false,false,0,32);E.$.dispatchEvent(M);if(K!=J.$.scrollTop||L!=J.$.scrollLeft)I.getWindow().$.scrollTo(L,K);H&&F.getFirst().remove();E.getBody().appendBogus();var N=new d.range(E);N.setStartAt(F,1);N.select();}};function B(C){var D=C.editor,E=C.data.path,F=E.blockLimit,G=C.data.selection,H=G.getRanges()[0],I=D.document.getBody(),J=D.config.enterMode; if(b.gecko){A(D);var K=E.block||E.blockLimit,L=K&&K.getLast(w);if(K&&K.isBlockBoundary()&&!(L&&L.type==1&&L.isBlockBoundary())&&!K.is('pre')&&!K.getBogus())K.appendBogus();}if(D.config.autoParagraph!==false&&J!=2&&H.collapsed&&F.getName()=='body'&&!E.block){var M=H.fixBlock(true,D.config.enterMode==3?'div':'p');if(c){var N=M.getFirst(w);N&&x(N)&&N.remove();}if(z(M)){var O=M.getNext(u);if(O&&O.type==1&&!o(O)){H.moveToElementEditStart(O);M.remove();}else{O=M.getPrevious(u);if(O&&O.type==1&&!o(O)){H.moveToElementEditEnd(O);M.remove();}}}H.select();C.cancel();}var P=new d.range(D.document);P.moveToElementEditEnd(D.document.getBody());var Q=new d.elementPath(P.startContainer);if(!Q.blockLimit.is('body')){var R;if(J!=2)R=I.append(D.document.createElement(J==1?'p':'div'));else R=I;if(!c)R.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(C){var D=C.config.enterMode!=2&&C.config.autoParagraph!==false?C.config.enterMode==3?'div':'p':false,E=C.lang.editorTitle.replace('%1',C.name),F;C.on('editingBlockReady',function(){var L,M,N,O,P,Q,R=b.isCustomDomain(),S=function(V){if(M)M.remove();var W='document.open();'+(R?'document.domain="'+document.domain+'";':'')+'document.close();';W=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(W)+'}())':'';M=h.createFromHtml('');if(document.location.protocol=='chrome:')a.event.useCapture=true;M.on('load',function(X){P=1;X.removeListener();var Y=M.getFrameDocument();Y.write(V);b.air&&U(Y.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;L.append(M);};F=e.addFunction(U);var T='';function U(V){if(!P)return;P=0;C.fire('ariaWidget',M);var W=V.document,X=W.body,Y=W.getElementById('cke_actscrpt');Y&&Y.parentNode.removeChild(Y);X.spellcheck=!C.config.disableNativeSpellChecker;var Z=!C.readOnly;if(c){X.hideFocus=true;X.disabled=true;X.contentEditable=Z;X.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)W.$.body.contentEditable=Z;else if(b.webkit)W.$.body.parentNode.contentEditable=Z;else W.$.designMode=Z?'off':'on';},0);Z&&b.gecko&&e.setTimeout(A,0,null,C);V=C.window=new d.window(V); W=C.document=new g(W);Z&&W.on('dblclick',function(af){var ag=af.data.getTarget(),ah={element:ag,dialog:''};C.fire('doubleclick',ah);ah.dialog&&C.openDialog(ah.dialog);});c&&W.on('click',function(af){var ag=af.data.getTarget();if(ag.is('input')){var ah=ag.getAttribute('type');if(ah=='submit'||ah=='reset')af.data.preventDefault();}});if(!(c||b.opera))W.on('mousedown',function(af){var ag=af.data.getTarget();if(ag.is('img','hr','input','textarea','select'))C.getSelection().selectElement(ag);});if(b.gecko)W.on('mouseup',function(af){if(af.data.$.button==2){var ag=af.data.getTarget();if(!ag.getOuterHtml().replace(m,'')){var ah=new d.range(W);ah.moveToElementEditStart(ag);ah.select(true);}}});W.on('click',function(af){af=af.data;if(af.getTarget().is('a')&&af.$.button!=2)af.preventDefault();});if(b.webkit){W.on('mousedown',function(){ac=1;});W.on('click',function(af){if(af.data.getTarget().is('input','select'))af.data.preventDefault();});W.on('mouseup',function(af){if(af.data.getTarget().is('input','textarea'))af.data.preventDefault();});}if(Z&&c&&W.$.compatMode=='CSS1Compat'||b.gecko||b.opera){var aa=W.getDocumentElement();aa.on('mousedown',function(af){if(af.data.getTarget().equals(aa)){if(b.gecko&&b.version>=10900)J();K.focus();}});}var ab=c?M:V;ab.on('blur',function(){C.focusManager.blur();});var ac;ab.on('focus',function(){var af=C.document;if(Z&&b.gecko&&b.version>=10900)J();else if(b.opera)af.getBody().focus();else if(b.webkit)if(!ac){C.document.getDocumentElement().focus();ac=1;}C.focusManager.focus();});var ad=C.keystrokeHandler;ad.blockedKeystrokes[8]=!Z;ad.attach(W);W.getDocumentElement().addClass(W.$.compatMode);Z&&W.on('keydown',function(af){var ag=af.data.getKeystroke();if(ag in {8:1,46:1}){var ah=C.getSelection(),ai=ah.getSelectedElement(),aj=ah.getRanges()[0];if(ai){C.fire('saveSnapshot');aj.moveToPosition(ai,3);ai.remove();aj.select();C.fire('saveSnapshot');af.data.preventDefault();return;}}});if(c&&W.$.compatMode=='CSS1Compat'){var ae={33:1,34:1};W.on('keydown',function(af){if(af.data.getKeystroke() in ae)setTimeout(function(){C.getSelection().scrollIntoView();},0);});}if(c&&C.config.enterMode!=1)W.on('selectionchange',function(){var af=W.getBody(),ag=C.getSelection().getRanges()[0];if(af.getHtml().match(/^

 <\/p>$/i)&&ag.startContainer.equals(af))setTimeout(function(){ag=C.getSelection().getRanges()[0];if(!ag.startContainer.equals('body')){af.getFirst().remove(1);ag.moveToElementEditEnd(af);ag.select(1);}},0);});if(C.contextMenu)C.contextMenu.addTarget(W,C.config.browserContextMenuOnCtrl!==false); -setTimeout(function(){C.fire('contentDom');if(Q){C.mode='wysiwyg';C.fire('mode',{previousMode:C._.previousMode});Q=false;}N=false;if(O){C.focus();O=false;}setTimeout(function(){C.fire('dataReady');},0);try{C.document.$.execCommand('enableInlineTableEditing',false,!C.config.disableNativeTableHandles);}catch(af){}if(C.config.disableObjectResizing)try{C.document.$.execCommand('enableObjectResizing',false,false);}catch(ag){C.document.getBody().on(c?'resizestart':'resize',function(ah){ah.data.preventDefault();});}if(c)setTimeout(function(){if(C.document){var ah=C.document.$.body;ah.runtimeStyle.marginBottom='0px';ah.runtimeStyle.marginBottom='';}},1000);},0);};C.addMode('wysiwyg',{load:function(V,W,X){L=V;if(c&&b.quirks)V.setStyle('position','relative');C.mayBeDirty=true;Q=true;if(X)this.loadSnapshotData(W);else this.loadData(W);},loadData:function(V){N=true;C._.dataStore={id:1};var W=C.config,X=W.fullPage,Y=W.docType,Z='';!X&&(Z=e.buildStyleHtml(C.config.contentsCss)+Z);var aa=W.baseHref?'':'';if(X)V=V.replace(/]*>/i,function(ab){C.docType=Y=ab;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ab){C.xmlDeclaration=ab;return '';});if(C.dataProcessor)V=C.dataProcessor.toHtml(V,D);if(X){if(!/]/.test(V))V=''+V;if(!/]/.test(V))V=''+V+'';if(!/]/.test(V))V=V.replace(/]*>/,'$&');else if(!/]/.test(V))V=V.replace(/]*>/,'$&');aa&&(V=V.replace(//,'$&'+aa));V=V.replace(/<\/head\s*>/,Z+'$&');V=Y+V;}else V=W.docType+''+''+''+E+''+aa+Z+''+''+V+'';if(b.gecko)V=V.replace(/
(?=\s*<\/(:?html|body)>)/,'$&
');V+=T;this.onDispose();S(V);},getData:function(){var V=C.config,W=V.fullPage,X=W&&C.docType,Y=W&&C.xmlDeclaration,Z=M.getFrameDocument(),aa=W?Z.getDocumentElement().getOuterHtml():Z.getBody().getHtml();if(b.gecko)aa=aa.replace(/
(?=\s*(:?$|<\/body>))/,'');if(C.dataProcessor)aa=C.dataProcessor.toDataFormat(aa,D);if(V.ignoreEmptyParagraph)aa=aa.replace(m,function(ab,ac){return ac;});if(Y)aa=Y+'\n'+aa;if(X)aa=X+'\n'+aa;return aa;},getSnapshotData:function(){return M.getFrameDocument().getBody().getHtml(); +setTimeout(function(){C.fire('contentDom');if(Q){C.mode='wysiwyg';C.fire('mode',{previousMode:C._.previousMode});Q=false;}N=false;if(O){C.focus();O=false;}setTimeout(function(){C.fire('dataReady');},0);try{C.document.$.execCommand('enableInlineTableEditing',false,!C.config.disableNativeTableHandles);}catch(af){}if(C.config.disableObjectResizing)try{C.document.$.execCommand('enableObjectResizing',false,false);}catch(ag){C.document.getBody().on(c?'resizestart':'resize',function(ah){ah.data.preventDefault();});}if(c)setTimeout(function(){if(C.document){var ah=C.document.$.body;ah.runtimeStyle.marginBottom='0px';ah.runtimeStyle.marginBottom='';}},1000);},0);};C.addMode('wysiwyg',{load:function(V,W,X){L=V;if(c&&b.quirks)V.setStyle('position','relative');C.mayBeDirty=true;Q=true;if(X)this.loadSnapshotData(W);else this.loadData(W);},loadData:function(V){N=true;C._.dataStore={id:1};var W=C.config,X=W.fullPage,Y=W.docType,Z='';!X&&(Z=e.buildStyleHtml(C.config.contentsCss)+Z);var aa=W.baseHref?'':'';if(X)V=V.replace(/]*>/i,function(ab){C.docType=Y=ab;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ab){C.xmlDeclaration=ab;return '';});if(C.dataProcessor)V=C.dataProcessor.toHtml(V,D);if(X){if(!/]/.test(V))V=''+V;if(!/]/.test(V))V=''+V+'';if(!/]/.test(V))V=V.replace(/]*>/,'$&');else if(!/]/.test(V))V=V.replace(/]*>/,'$&');aa&&(V=V.replace(//,'$&'+aa));V=V.replace(/<\/head\s*>/,Z+'$&');V=Y+V;}else V=W.docType+''+''+''+E+''+aa+Z+''+''+V+'';if(b.gecko)V=V.replace(/
(?=\s*<\/(:?html|body)>)/,'$&
');V+=T;this.onDispose();S(V);},getData:function(){var V=C.config,W=V.fullPage,X=W&&C.docType,Y=W&&C.xmlDeclaration,Z=M.getFrameDocument(),aa=W?Z.getDocumentElement().getOuterHtml():Z.getBody().getHtml();if(b.gecko)aa=aa.replace(/
(?=\s*(:?$|<\/body>))/,'');if(C.dataProcessor)aa=C.dataProcessor.toDataFormat(aa,D);if(V.ignoreEmptyParagraph)aa=aa.replace(m,function(ab,ac){return ac;});if(Y)aa=Y+'\n'+aa;if(X)aa=X+'\n'+aa;return aa;},getSnapshotData:function(){var b=M.getFrameDocument().getBody();return b.$?b.getHtml():null; },loadSnapshotData:function(V){M.getFrameDocument().getBody().setHtml(V);},onDispose:function(){if(!C.document)return;C.document.getDocumentElement().clearCustomData();C.document.getBody().clearCustomData();C.window.clearCustomData();C.document.clearCustomData();M.clearCustomData();M.remove();},unload:function(V){this.onDispose();C.window=C.document=M=L=O=null;C.fire('contentDomUnload');},focus:function(){var V=C.window;if(N)O=true;else if(V){b.air?setTimeout(function(){V.focus();},0):V.focus();C.selectionChange();}}});C.on('insertHtml',p(q),null,null,20);C.on('insertElement',p(s),null,null,20);C.on('insertText',p(r),null,null,20);C.on('selectionChange',function(V){if(C.readOnly)return;var W=C.getSelection();if(W&&!W.isLocked){var X=C.checkDirty();C.fire('saveSnapshot',{contentOnly:1});B.call(this,V);C.fire('updateSnapshot');!X&&C.resetDirty();}},null,null,1);});var G;C.on('contentDom',function(){var L=C.document.getElementsByTag('title').getItem(0);L.data('cke-title',C.document.$.title);C.document.$.title=E;});C.on('readOnly',function(){if(C.mode=='wysiwyg'){var L=C.getMode();L.loadData(L.getData());}});if(a.document.$.documentMode>=8){C.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var H=[];for(var I in f.$removeEmpty)H.push('html.CSS1Compat '+I+'[contenteditable=false]');C.addCss(H.join(',')+'{ display:inline-block;}');}else if(b.gecko){C.addCss('html { height: 100% !important; }');C.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\twidth : 24px; height : 24px; }');}C.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');C.addCss('img, input, textarea { cursor: default;}');function J(L){if(C.readOnly)return;e.tryThese(function(){C.document.$.designMode='on';setTimeout(function(){C.document.$.designMode='off';if(a.currentInstance==C)C.document.getBody().focus();},50);},function(){C.document.$.designMode='off';var M=C.document.getBody();M.setAttribute('contentEditable',false);M.setAttribute('contentEditable',true);!L&&J(1);});};if(b.gecko||c||b.opera){var K;C.on('uiReady',function(){K=C.container.append(h.createFromHtml(''));K.on('focus',function(){C.focus();});C.focusGrabber=K;});C.on('destroy',function(){e.removeFunction(F);K.clearCustomData();delete C.focusGrabber;});}C.on('insertElement',function(L){var M=L.data;if(M.type==1&&(M.is('input')||M.is('textarea'))){var N=M.getAttribute('contenteditable')=='false';if(!N){M.data('cke-editable',M.hasAttribute('contenteditable')?'true':'1'); M.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var C=document.body;if(!C)window.addEventListener('load',arguments.callee,false);else{var D=C.getAttribute('onpageshow');C.setAttribute('onpageshow',(D?D+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();');}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(S){return!!this._.tabs[S][0].$.offsetHeight;};function o(){var W=this;var S=W._.currentTabId,T=W._.tabIdList.length,U=e.indexOf(W._.tabIdList,S)+T;for(var V=U-1;V>U-T;V--){if(n.call(W,W._.tabIdList[V%T]))return W._.tabIdList[V%T];}return null;};function p(){var W=this;var S=W._.currentTabId,T=W._.tabIdList.length,U=e.indexOf(W._.tabIdList,S);for(var V=U+1;V div { - height: 420px; +div.tabContent { + height: 417px; + overflow: auto; } .ui-tabs .ui-tabs-panel { @@ -44,7 +45,7 @@ } table.tabTable { - height: 393px; + height: 390px; table-layout: fixed; border-top: thin dotted #2E6E9E; } @@ -75,7 +76,7 @@ div#learningDesignTree { overflow: auto; - height: 385px; + height: 384px; } .ygtv-highlight1, .ygtv-highlight1 .ygtvlabel { @@ -97,8 +98,8 @@ } div#canvasDiv { - overflow: visible; - height: 330px; + overflow: auto; + height: 327px; } .ldChoiceDependentCanvasElement { @@ -183,18 +184,31 @@ padding: 10px 0px 10px 0px; } -.fieldInnerSection { - padding: 10px 0px 0px 30px; +table#introDescriptionTable { + padding-left: 30px; } -div.fieldInnerSection span { - vertical-align: top; +textarea#introDescription { + display: none; } -textarea#introDescriptionField { - width: 200px; +table#introDescriptionTable td { + padding: 0px; } +td#introDescriptionLabelCell { + width: 80px; +} + +.cke_resizer { + height: 10px !important; + margin-top: 0px !important; +} + +#introImageField { + margin-top: 8px; +} + table#splitLearnersTable { height: 40px; } @@ -218,14 +232,18 @@ } #schedulingDatetimeField { - margin-left: 50px; + margin: 0px 0px 10px 50px; } #precedingLessonIdField { margin: 0px 0px 0px 70px; } +div#timeLimitDiv { + padding: 10px 0px 0px 30px; +} + #timeLimitDaysField { width: 50px; margin: 0px 0px 0px 5px !important; Index: lams_central/web/includes/javascript/ckconfig_custom.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/ckconfig_custom.js,v diff -u -r1.17 -r1.18 --- lams_central/web/includes/javascript/ckconfig_custom.js 13 Nov 2012 22:01:49 -0000 1.17 +++ lams_central/web/includes/javascript/ckconfig_custom.js 10 Jan 2013 18:52:49 -0000 1.18 @@ -35,7 +35,16 @@ ['Image','Link','Table','Smiley','Font','FontSize'] ] ; +CKEDITOR.config.toolbar_LessonDescription = [ + ['Bold','Italic','Underline', '-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], + ['TextColor','BGColor'], + ['Table','HorizontalRule','Smiley','SpecialChar'], + ['Format','Font','FontSize'] +] ; + CKEDITOR.config.contentsCss = CKEDITOR.basePath + '../css/defaultHTML_learner.css' ; CKEDITOR.config.skin = 'office2003' ; CKEDITOR.config.disableNativeSpellChecker = false; @@ -73,4 +82,4 @@ f.data.dataValue = tempDiv.innerHTML; }); -}); +}); \ No newline at end of file Index: lams_central/web/includes/javascript/newLesson.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/Attic/newLesson.js,v diff -u -r1.4 -r1.5 --- lams_central/web/includes/javascript/newLesson.js 9 Jan 2013 15:18:37 -0000 1.4 +++ lams_central/web/includes/javascript/newLesson.js 10 Jan 2013 18:52:49 -0000 1.5 @@ -1,7 +1,7 @@ // ********** MAIN FUNCTIONS ********** var tree; var lastSelectedUsers = {}; -var sortOrderDescending = {}; +var sortOrderAscending = {}; var submitInProgress = false; function initLessonTab(){ @@ -11,7 +11,7 @@ // show the thumbnail $('#ldScreenshotAuthor').css('display', 'inline'); // resize if needed - var resized = resizeImage('ldScreenshotAuthor', 400, null); + var resized = resizeImage('ldScreenshotAuthor', 383, null); toggleCanvasResize(resized ? CANVAS_RESIZE_OPTION_FIT : CANVAS_RESIZE_OPTION_NONE); }); @@ -125,14 +125,14 @@ }); $('.userContainer').each(function(){ - colorDraggableUsers(this); + var containerId = $(this).attr('id'); - $(this).droppable({'scope' : $(this).attr('id'), + $(this).droppable({'scope' : containerId, 'activeClass' : 'droppableHighlight', 'tolerance' : 'touch', 'accept' : function (draggable) { // forbid current user from being removed from monitors - return $(this).attr('id') != 'unselected-monitors' + return containerId != 'unselected-monitors' || $(draggable).attr('userId') != userId; }, 'drop' : function (event, ui) { @@ -153,19 +153,26 @@ colorDraggableUsers(this); colorDraggableUsers(previousContainer); - if ($(this).attr('id').indexOf('learners') > 0) { + if (containerId.indexOf('learners') > 0) { // number of selected learners changed, so update this control too updateSplitLearnersFields(); } } }); }); - $('.sortUsersButton').click(sortUsers); + $('.sortUsersButton').click(function(){ + sortUsers($(this).attr('id')); + }); } function initAdvancedTab(){ + CKEDITOR.on('instanceReady', function(e){ + // disable by default + e.editor.setReadOnly(true); + }); + $('#splitLearnersCountField').spinner({ 'disabled' : true, 'incremental' : false, @@ -179,7 +186,25 @@ }); $('#introEnableField').change(function(){ - $('#introDescriptionField, #introImageField').prop('disabled', !$(this).is(':checked')); + var checked = $(this).is(':checked'); + $('#introImageField').prop('disabled', !checked); + + // show/hide full CKEditor + var editor = CKEDITOR.instances['introDescription']; + var collapsed = $('.cke_toolbox_collapser_min').length > 0; + if (checked) { + editor.setReadOnly(false); + if (collapsed) { + $('.cke_toolbox_collapser').trigger('click'); + } + editor.resize(420, 250); + } else { + editor.setReadOnly(true); + if (!collapsed) { + $('.cke_toolbox_collapser').trigger('click'); + } + editor.resize(50, 20); + } }); $('#presenceEnableField').change(function(){ @@ -279,6 +304,9 @@ $('#splitNumberLessonsField').val(instances); } + // copy CKEditor contents to textarea for submit + $('#introDescription').val(CKEDITOR.instances['introDescription'].getData()); + submitInProgress = true; $('#lessonForm').ajaxSubmit({ 'success' : function(){ @@ -309,16 +337,14 @@ switch (mode) { case CANVAS_RESIZE_OPTION_NONE: toggleCanvasResizeLink.css('display', 'none'); - $('#canvasDiv').css('overflow', 'visible'); break; case CANVAS_RESIZE_OPTION_FIT: toggleCanvasResizeLink.html(CANVAS_RESIZE_LABEL_FULL).one('click', function() { toggleCanvasResize(CANVAS_RESIZE_OPTION_FULL) }); toggleCanvasResizeLink.css('display', 'inline'); - resizeImage('ldScreenshotAuthor', 385, null); - $('#canvasDiv').css('overflow', 'visible'); + resizeImage('ldScreenshotAuthor', 383, null); break; case CANVAS_RESIZE_OPTION_FULL: toggleCanvasResizeLink.html(CANVAS_RESIZE_LABEL_FIT).one('click', @@ -327,7 +353,6 @@ }); toggleCanvasResizeLink.css('display', 'inline'); $('#ldScreenshotAuthor').css('width', 'auto').css('height', 'auto'); - $('#canvasDiv').css('overflow', 'auto'); break; } } @@ -366,19 +391,21 @@ // ********** CLASS TAB FUNCTIONS ********** -function fillUserContainer(users, containerID) { +function fillUserContainer(users, containerId) { if (users) { // create user DIVs $.each(users, function(index, userJSON) { - $('#' + containerID).append($('

').attr({ + $('#' + containerId).append($('
').attr({ 'userId' : userJSON.userID, - 'sortKey' : userJSON.lastName + 'sortKey' : userJSON.lastName+userJSON.firstName }) .addClass('draggableUser') .text(userJSON.firstName + ' ' + userJSON.lastName + ' (' + userJSON.login + ')') ); }); + + sortUsers('sort-' + containerId); } } @@ -392,7 +419,7 @@ function colorDraggableUsers(container) { // every second line is different - $(container).find('div').each(function(index, userDiv){ + $(container).find('div.draggableUser').each(function(index, userDiv){ // exact colour should be defined in CSS, but it's easier this way... $(this).css('background-color', index % 2 ? '#dfeffc' : 'inherit'); }); @@ -407,30 +434,30 @@ return list; } -function sortUsers() { - var buttonId = $(this).attr('id'); +function sortUsers(buttonId) { var container = $('#' + buttonId.substring(buttonId.indexOf('-') + 1)); var users = container.children('div.draggableUser'); if (users.length > 1) { - var sortOrderDesc = sortOrderDescending[buttonId]; + var sortOrderAsc = sortOrderAscending[buttonId]; users.each(function(){ $(this).detach(); }).sort(function(a, b){ var keyA = $(a).attr('sortKey'); var keyB = $(b).attr('sortKey'); var result = keyA > keyB ? 1 : keyA < keyB ? -1 : 0; - return sortOrderDesc ? result : -result; + return sortOrderAsc ? -result : result; }).each(function(){ $(this).appendTo(container); }); - if (sortOrderDesc) { - $(this).html('▲'); - sortOrderDescending[buttonId] = false; + var button = $('#' + buttonId); + if (sortOrderAsc) { + button.html('▼'); + sortOrderAscending[buttonId] = false; } else { - $(this).html('▼'); - sortOrderDescending[buttonId] = true; + button.html('▲'); + sortOrderAscending[buttonId] = true; } colorDraggableUsers(container); Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java,v diff -u -r1.79 -r1.80 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 8 Jan 2013 11:19:43 -0000 1.79 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 10 Jan 2013 18:52:51 -0000 1.80 @@ -264,8 +264,8 @@ long ldId = WebUtil.readLongParam(request, AttributeNames.PARAM_LEARNINGDESIGN_ID); boolean introEnable = WebUtil.readBooleanParam(request, "introEnable", false); - String introDescription = request.getParameter("introDescription"); - boolean introImage = WebUtil.readBooleanParam(request, "introImage", false); + String introDescription = introEnable ? request.getParameter("introDescription") : null; + boolean introImage = introEnable ? WebUtil.readBooleanParam(request, "introImage", false) : false; boolean startMonitor = WebUtil.readBooleanParam(request, "startMonitor", false); boolean enableLiveEdit = WebUtil.readBooleanParam(request, "enableLiveEdit", false); boolean notificationsEnable = WebUtil.readBooleanParam(request, "notificationsEnable", false);