/usr/share/moodle/mod/jclic/jclicplugin.js is in jclicmoodle 0.2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | // This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* jclicplugin.js file adapted for Moodle (instead of use the clic.xtec.cat one)
*
* @package mod
* @subpackage jclic
* @copyright 2011 Departament d'Ensenyament de la Generalitat de Catalunya
* @author Sara Arjona Téllez <sarjona@xtec.cat>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
var player_files = "jclic.jar";
var player_versions = "0.2.2.0";
var author_files = "jclicauthor.jar";
var author_versions = "0.2.2.0";
var jar_cache_files = player_files;
var jar_cache_versions = player_versions;
var mainClass="JClicApplet";
var _info = navigator.userAgent;
var _ns = false;
var _mac = false;
var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
if(_info.indexOf("Opera")>=0){
_ie=false;
_ns=true;
}
else if(_ie==false){
_ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0)));
_mac = _info.indexOf("Mac_PowerPC") > 0;
}
var jarBase='http://clic.xtec.cat/dist/jclic';
function setJarBase(base){
jarBase=base;
}
var useLanguage=false;
var language='';
var country='';
var variant='';
function setLanguage(l, c, v){
if(l!=null){
language=l.toString();
if(c!=null) country=c.toString();
if(v!=null) variant=v.toString();
useLanguage=true;
}
}
var useReporter=false;
var reporterClass='';
var reporterParams='';
function setReporter(rClass, rParams){
if(rClass!=null){
reporterClass=rClass.toString();
if(rParams!=null) reporterParams=rParams.toString();
useReporter=true;
}
}
var useSkin=false;
var skinName='';
function setSkin(skName){
if(skName!=null){
skinName=skName.toString();
useSkin=true;
}
}
var useCookie=false;
var cookie='';
function setCookie(text){
if(text!=null){
cookie=text.toString();
useCookie=true;
}
}
var useExitUrl=false;
var exitUrl='';
function setExitUrl(text){
if(text!=null){
exitUrl=text.toString();
useExitUrl=true;
}
}
var useInfoUrlFrame=false;
var infoUrlFrame='';
function setInfoUrlFrame(text){
if(text!=null){
infoUrlFrame=text.toString();
useInfoUrlFrame=true;
}
}
var useSequence=false;
var sequence='';
function setSequence(text){
if(text!=null){
sequence=text.toString();
useSequence=true;
}
}
var useSystemSounds=false;
var systemSounds=false;
function setSystemSounds(value){
if(value!=null){
systemSounds=value.toString();
useSystemSounds=true;
}
}
var useCompressImages=false;
var compressImages=true;
function setCompressImages(value){
if(value!=null){
compressImages=value.toString();
useCompressImages=true;
}
}
var useTrace=false;
var trace=false;
function setTrace(value){
if(value!=null){
trace=value.toString();
useTrace=true;
}
}
var authorApplet=false;
function setAuthorApplet(value){
if(value!=null){
authorApplet=value;
if(authorApplet==true){
jar_cache_files = player_files+","+author_files;
jar_cache_versions = player_versions+","+author_versions;
mainClass="JClicAuthorApplet";
} else {
jar_cache_files = player_files;
jar_cache_versions = player_versions;
mainClass="JClicApplet";
}
}
}
function writePlugin(project, width, height, rWidth, rHeight){
document.writeln(getPlugin(project, width, height, rWidth, rHeight));
}
function writeCacheInfo(p){
document.writeln(getCacheInfo(p));
}
function writeDownloadPageInfo(){
document.writeln(getDownloadPageInfo());
}
function writeParams(project, p){
document.writeln(getParams(project, p));
}
function writeTable(w, h, nsw, nsh, s){
document.write(getTable(w, h, nsw, nsh, s));
}
function getPlugin(project, width, height, rWidth, rHeight){
var htmlcode = '';
var w=width.toString();
var h=height.toString();
var nsw=w;
var nsh=h;
if(rWidth!=null) w=rWidth.toString();
if(rHeight!=null) h=rHeight.toString();
if (_ie == true){
htmlcode += '<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"' +
' width="' +w+ '" height="' +h+ '">';
htmlcode += '<param name="code" value="' +mainClass+ '">';
htmlcode += '<param name="codebase" value="' +jarBase+ '">';
htmlcode += getCacheInfo(true);
htmlcode += '<param name="type" value="application/x-java-applet;jpi-version=1.4">';
htmlcode += '<param name="scriptable" value="false">';
htmlcode += getParams(project, true);
htmlcode += getDownloadPageInfo();
htmlcode += '</object>';
}
else if (_ns == true){
htmlcode += '<embed type="application/x-java-applet;version=1.4"'+
' code="' +mainClass+ '" codebase="' +jarBase+ '"'+
' width="' +nsw+ '" height="' +nsh +'" ';
htmlcode += getCacheInfo(false);
htmlcode += getParams(project, false);
htmlcode += ' scriptable="false"'+
' pluginspage="http://www.java.com/">';
htmlcode += '<noembed>';
htmlcode += getDownloadPageInfo();
htmlcode += '</noembed>';
htmlcode += "</embed>";
}
else{
htmlcode += '<applet code="' +mainClass+ '" codebase="' +jarBase+ '"';
htmlcode += ' archive="'+ jar_cache_files +'"';
htmlcode += ' width="' +nsw+ '" height="' +nsh+ '">';
htmlcode += '<param name="type" value="application/x-java-applet;version=1.4">';
htmlcode += '<param name="scriptable" value="false">';
htmlcode += getParams(project, true);
htmlcode += '</applet>';
}
return htmlcode;
}
function getCacheInfo(p){
var htmlcode = '';
if(p){
htmlcode += '<param name="cache_option" value="Plugin">';
htmlcode += '<param name="cache_archive" value="' +jar_cache_files+ '">';
htmlcode += '<param name="cache_version" value="' +jar_cache_versions+ '">';
}else{
htmlcode += ' cache_option="Plugin"';
htmlcode += ' cache_archive="' +jar_cache_files+ '"';
htmlcode += ' cache_version="' +jar_cache_versions+ '"';
}
return htmlcode;
}
function getParams(project, p){
var htmlcode = '';
if(p) htmlcode += '<param name="activityPack" value="' +project+ '">';
else htmlcode += ' activityPack="' +project+ '"';
if(useSequence){
if(p) htmlcode += '<param name="sequence" value="' +sequence+ '">';
else htmlcode += ' sequence="' +sequence+ '" ';
}
if(useLanguage){
if(p){
htmlcode += '<param name="language" value="' +language+ '">';
htmlcode += '<param name="country" value="' +country+ '">';
htmlcode += '<param name="variant" value="' +variant+ '">';
}
else htmlcode += ' language="' +language+ '" country="' +country+ '" variant="' +variant+ '" ';
}
if(useSkin){
if(p) htmlcode += '<param name="skin" value="' +skinName+ '">';
else htmlcode += ' skin="' +skinName+ '" ';
}
if(useExitUrl){
if(p) htmlcode += '<param name="exitUrl" value="' +exitUrl+ '">';
else htmlcode += ' exitUrl="' +exitUrl+ '" ';
}
if(useInfoUrlFrame){
if(p) htmlcode += '<param name="infoUrlFrame" value="' +infoUrlFrame+ '">';
else htmlcode += ' infoUrlFrame="' +infoUrlFrame+ '" ';
}
if(useReporter){
if(p){
htmlcode += '<param name="reporter" value="' +reporterClass+ '">';
htmlcode += '<param name="reporterParams" value="' +reporterParams+ '">';
}
else htmlcode += ' reporter="' +reporterClass+ '" reporterParams="' +reporterParams+ '" ';
}
if(useCookie){
if(p) htmlcode += '<param name="cookie" value="' +cookie+ '">';
else htmlcode += ' cookie="' +cookie+ '" ';
}
if(useSystemSounds){
if(p) htmlcode += '<param name="systemSounds" value="' +systemSounds+ '">';
else htmlcode += ' systemSounds="' +systemSounds+ '" ';
}
if(useCompressImages){
if(p) htmlcode += '<param name="compressImages" value="' +compressImages+ '">';
else htmlcode += ' compressImages="' +compressImages+ '" ';
}
if(useTrace){
if(p) htmlcode += '<param name="trace" value="' +trace+ '">';
else htmlcode += ' trace="' +trace+ '" ';
}
return htmlcode;
}
function getDownloadPageInfo(){
var htmlcode = '';
var pluginBase="http://clic.xtec.cat/";
var pluginCat=pluginBase+"ca/jclic/instjava.htm";
var pluginEsp=pluginBase+"es/jclic/instjava.htm";
var pluginEng=pluginBase+"en/jclic/instjava.htm";
htmlcode += '<span style="background-color: #F5DEB3; color: Black; display: block; padding: 10; font-family: Verdana,Arial; border-style: solid; border-width: thin; font-size: 12px; text-align: center; font-weight: bold;">'+
'Per utilitzar aquesta aplicació cal instal·lar un plug-in Java™ actualitzat<br><a href="'+pluginCat+'" target="_blank">Feu clic aquí per descarregar-lo</a><br> <br>'+
'Para utilizar esta aplicación es necesario un plug-in Java™ actualizado<br><a href="'+pluginEsp+'" target="_blank">Haga clic aquí para descargarlo</a><br> <br>'+
'In order to run this program you need an updated Java™ plug-in<br><a href="'+pluginEng+'" target="_blank">Click here to download it</a><br>'+
'</span>';
return htmlcode;
}
function getTable(w, h, nsw, nsh, s){
var htmlcode = '';
htmlcode += '<table '+ s;
if(_ie == true){
if(w!=null) htmlcode += ' width='+ w;
if(h!=null) htmlcode += ' height='+ h;
}
else{
if(nsw!=null) htmlcode += ' width='+ nsw;
if(nsh!=null) htmlcode += ' height='+ nsh;
}
htmlcode += '>';
return htmlcode;
}
|