Revision 3915
Added by walbridge almost 16 years ago
entryForm.js | ||
---|---|---|
1068 | 1068 |
new_row_button.type = 'button'; |
1069 | 1069 |
new_row_button.value = 'Delete'; |
1070 | 1070 |
|
1071 |
// Permissions check boxes |
|
1072 |
var radio_value_a = 'public'; |
|
1073 |
var radio_value_b = 'private'; |
|
1074 |
var new_radio_a = document.createElement('input'); |
|
1075 |
var new_radio_b = document.createElement('input'); |
|
1076 |
new_radio_a.type = new_radio_b.type = 'radio'; |
|
1077 |
// get the file upload name, use the number to keep track of the file we're setting permissions on |
|
1078 |
new_radio_a.name = new_radio_b.name = 'uploadperm_' + element.name.split("_")[1]; |
|
1079 |
new_radio_a.value = radio_value_a; |
|
1080 |
new_radio_b.value = radio_value_b; |
|
1081 |
new_radio_a.checked = false; |
|
1082 |
new_radio_b.checked = true; // when adding new files, default is private |
|
1083 |
|
|
1071 | 1084 |
// References |
1072 | 1085 |
new_row.element = element; |
1073 | 1086 |
|
... | ... | |
1089 | 1102 |
// which nixes your already queued uploads |
1090 | 1103 |
return false; |
1091 | 1104 |
}; |
1105 |
|
|
1106 |
// filename may include path, show only file name itself |
|
1107 |
var name_pattern = element.value.replace(/.*[\/\\](.*)/, "$1"); |
|
1092 | 1108 |
|
1093 | 1109 |
// Set row value |
1094 |
new_row.innerHTML = element.value + " "; |
|
1095 |
|
|
1110 |
new_row.appendChild( document.createTextNode(name_pattern + " ") ); |
|
1111 |
|
|
1112 |
// Add in radio buttons and their text |
|
1113 |
new_row.appendChild( new_radio_a ); |
|
1114 |
new_row.appendChild( document.createTextNode(capitalize(radio_value_a) + " ") ); |
|
1115 |
new_row.appendChild( new_radio_b ); |
|
1116 |
new_row.appendChild( document.createTextNode(capitalize(radio_value_b) + " ") ); |
|
1117 |
|
|
1096 | 1118 |
// Add button |
1097 | 1119 |
new_row.appendChild( new_row_button ); |
1098 | 1120 |
|
... | ... | |
1127 | 1149 |
} |
1128 | 1150 |
} |
1129 | 1151 |
} |
1152 |
|
|
1153 |
function capitalize(word) { |
|
1154 |
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase(); |
|
1155 |
} |
Also available in: Unified diff
Merging Perl changes into detokenization branch. Removes usage of tokens from all Perl and Perl Template Toolkit files, instead using pure Java .property files to manage settings. Basic path for eliminating .cfg files from Perl, and skin.config files from Java side. Backported changes from 1.8.1RC1 release.