入力テキストエリアの行数変更 ふるいむかし
<textarea onkeypress="mtShortCuts(event)" class="full-width" name="text" id="text" tabindex="3" cols="72" rows="任意の行数"><TMPL_VAR NAME=TEXT ESCAPE=HTML></textarea>
|
|
<textarea onkeypress="mtShortCuts(event)" class="full-width" name="text" id="text" tabindex="3" cols="72" rows="任意の行数"><TMPL_VAR NAME=TEXT ESCAPE=HTML></textarea>
<form name="entry_form" method="post" action="<TMPL_VAR NAME=SCRIPT_URL>">
<input accesskey="s" type="button" value="<MT_TRANS phrase="Save">" title="<MT_TRANS phrase="Save this entry (s)">" onclick="submitForm(this.form, 'save_entry')" />
function ReplaceTextarea() {
var obj,objSel,strValue,nStart,nEnd;
obj = document.getElementsByName("text")[0];
if ( document.all ) {
objSel = document.selection;
obj.focus();
strValue = objSel.createRange().text;
if ( strValue == '' ) {
return;
}
objSel.createRange().text = "<b>" + strValue + "</b>";
}
else {
if ( obj.selectionEnd == obj.selectionStart ) {
return;
}
nStart = obj.selectionStart;
nEnd = obj.selectionEnd;
strValue = obj.value.substring(
nStart,
nEnd
);
strValue =
obj.value.substring(0, nStart) +
"<b>" +
strValue +
"</b>" +
obj.value.substring(nEnd,obj.value.length);
obj.value = strValue
obj.setSelectionRange(
nStart,
nEnd + 7);
obj.focus();
}
}
function chkIframe() {
var obj = document.getElementsByTagName("IFRAME")[0];
obj.contentWindow.document.getElementsByName("fld")[0].value = "表示";
}
function getFlashVarsion() {
var objFlash,i;
var description,flashPlugin;
if ( document.all ) {
for( i = 10; i >= 5; i-- ) {
try {
objFlash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i );
break;
}
catch( e ) {
if ( i == 5 ) {
i = 0;
break;
}
}
}
}
else {
i = 0;
if ( navigator.plugins && navigator.plugins.length > 0) {
flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') {
description = flashPlugin.description;
for( i = 10; i > 4; i-- ) {
if (description.indexOf(i+'.') != -1) {
break;
}
}
if ( i == 4 ) {
i = 0;
}
}
}
}
return i;
}
function getCharsret() {
var strData;
if ( document.all ) {
strData = document.charset;
}
else {
strData = document.characterSet;
}
return( strData.toUpperCase() );
}
|
|