--- loncom/interface/lonhtmlcommon.pm 2012/05/28 19:11:00 1.316 +++ loncom/interface/lonhtmlcommon.pm 2012/09/24 11:04:20 1.325 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.316 2012/05/28 19:11:00 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.325 2012/09/24 11:04:20 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -209,9 +209,10 @@ dependencies for a web page uploaded dir =cut sub dependencycheck_js { - my ($symb,$title) = @_; + my ($symb,$title,$url) = @_; my $link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'). - '&title='.&HTML::Entities::encode($title,'<>&"'); + '&title='.&HTML::Entities::encode($title,'<>&"'). + '&url='.&HTML::Entities::encode($url,'<>&"'); return < // + + + + ENDJQUERY return $s; } @@ -1397,6 +1402,40 @@ sub htmlareaselectactive { }); } }); + + /* This code describes the spellcheck options that will be used for + items with class 'spellchecked'. It is necessary for those objects' + to explicitly request checking (e.g. onblur is a nice event for that). + */ + \$(document).ready(function() { + \$(".spellchecked").spellchecker({ + url: "/ajax/spellcheck", + lang: "en", + engine: "pspell", + suggestionBoxPosition: "below", + innerDocument: true + }); + \$("textarea.spellchecked").spellchecker({ + url: "/ajax/spellcheck", + lang: "en", + engine: "pspell", + suggestionBoxPosition: "below", + innerDocument: true + }); + + }); + + /* the muli colored editor can generate spellcheck with language 'none' + to disable spellcheck as well + */ + function doSpellcheck(element, lang) { + if (lang != 'none') { + \$(element).spellchecker('option', {lang: lang}); + \$(element).spellchecker('check'); + } + } + + JAVASCRIPT if ($dragmath_prefix ne '') { $output .= ' @@ -1453,7 +1492,7 @@ sub show_return_link { unless ($env{'request.course.id'}) { return 0; } if ($env{'request.noversionuri'}=~m{^/priv/} || - $env{'request.uri'}=~m{^/~}) { return 1; } + $env{'request.uri'}=~m{^/priv/}) { return 1; } if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)}) || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) { @@ -1617,9 +1656,11 @@ returns: nothing my $links; if ((&show_return_link) && (!$CourseBreadcrumbs)) { my $alttext = &mt('Go Back'); - $links=&htmltag( 'a',"$alttext", + $links=&htmltag( 'a',''.$alttext.'', { href => '/adm/flip?postdata=return:', - title => &mt("Back to most recent content resource") }); + title => &mt('Back to most recent content resource'), + class => 'LC_menubuttons_link', + }); $links=&htmltag('li',$links); } $links.= join "",