mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib-form MDL-16706 Changed inline JS to use PAGE methods
- Loading branch information
samhemelryk
committed
Jul 7, 2009
1 parent
f77fcb5
commit e4e7044
Showing
5 changed files
with
55 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function updatefile(client_id, obj) { | ||
document.getElementById('repo_info_'+client_id).innerHTML = obj['file']; | ||
} | ||
function callpicker(client_id, id) { | ||
var picker = document.createElement('DIV'); | ||
picker.id = 'file-picker-'+client_id; | ||
picker.className = 'file-picker'; | ||
document.body.appendChild(picker); | ||
var el=document.getElementById(id); | ||
var params = {}; | ||
params.env = 'filepicker'; | ||
params.itemid = itemid; | ||
params.maxbytes = filepicker.maxbytes; | ||
params.maxfiles = filepicker.maxfiles; | ||
params.target = el; | ||
params.callback = updatefile; | ||
open_filepicker(client_id, params); | ||
return false; | ||
} | ||
alert('here'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var is_ie = (navigator.userAgent.toLowerCase().indexOf("msie") != -1); | ||
|
||
document.getElementById(punmask.id).setAttribute("autocomplete", "off"); | ||
|
||
var unmaskdiv = document.getElementById(punmask.id+"unmaskdiv"); | ||
|
||
var unmaskchb = document.createElement("input"); | ||
unmaskchb.setAttribute("type", "checkbox"); | ||
unmaskchb.setAttribute("id", punmask.id+"unmask"); | ||
unmaskchb.onchange = function() {unmaskPassword(punmask.id);}; | ||
unmaskdiv.appendChild(unmaskchb); | ||
|
||
var unmasklbl = document.createElement("label"); | ||
unmasklbl.innerHTML = punmask.unmaskstr; | ||
if (is_ie) { | ||
unmasklbl.setAttribute("htmlFor", punmask.id+"unmask"); | ||
} else { | ||
unmasklbl.setAttribute("for", punmask.id+"unmask"); | ||
} | ||
unmaskdiv.appendChild(unmasklbl); | ||
|
||
if (is_ie) { | ||
// ugly hack to work around the famous onchange IE bug | ||
unmaskchb.onclick = function() {this.blur();}; | ||
unmaskdiv.onclick = function() {this.blur();}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters