2006.02.20 Monday | 21:39

  保存ボタンを入力テキスト上部に設置 ふるいむかし

edit_entry.tmpl の 以下の部分の直後にボタンを挿入します
<form name="entry_form" method="post"
 action="<TMPL_VAR NAME=SCRIPT_URL>">
entry_actions.tmpl の以下の部分を取り出して使用します
<input accesskey="s"
 type="button"
 value="<MT_TRANS phrase="Save">"
 title="<MT_TRANS phrase="Save this entry (s)">"
 onclick="submitForm(this.form, 'save_entry')" />




2006.02.20 Monday | 19:07

  テキストエリアの選択部分の置き換え 記録

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();
	}
}



2006.02.20 Monday | 18:13

  IFRAME内へのアクセス ふるいむかし

function chkIframe() {

	var obj = document.getElementsByTagName("IFRAME")[0];
	obj.contentWindow.document.getElementsByName("fld")[0].value = "表示";

}



もっときっちりまとめたページ



2006.02.20 Monday | 18:09

  Flash バージョンチェック ふるいむかし

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;

}



2006.02.20 Monday | 18:05

  現在のキャラクタセット ふるいむかし

function getCharsret() {

	var strData;
	if ( document.all ) {
		strData = document.charset;
	}
	else {
		strData = document.characterSet;
	}
	return( strData.toUpperCase() );

}



2006.02.17 Friday | 19:11

  クリップボードに貼り付け ふるいむかし

IE は普通に可能
問題はMozilla

http://a-h.parfe.jp/einfach/archives/2005/0706043145.html#footnote_122t1
Flash Player 7以上で動作
追加情報(2/22)->http://blog.dawgsdk.org/weblog/archives/410011
http://www.adobe.com/jp/support/flash/ts/documents/fl0013.html

import flash.net.FileReference;

var listener:Object = new Object();

listener.onSelect = function(file:FileReference):Void {
    trace("onSelect: " + file.name);
}

listener.onCancel = function(file:FileReference):Void {
    trace("onCancel");
}

listener.onOpen = function(file:FileReference):Void {
    trace("onOpen: " + file.name);
}

listener.onProgress = function(
file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
    trace("onProgress with bytesLoaded: "
 + bytesLoaded + " bytesTotal: " + bytesTotal);
}

listener.onComplete = function(file:FileReference):Void {
    trace("onComplete: " + file.name);
}

listener.onIOError = function(file:FileReference):Void {
    trace("onIOError: " + file.name);
}

var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = 
"http://www.macromedia.com/platform/whitepapers/platform_overview.pdf";
if(!fileRef.download(url, "FlashPlatform.pdf")) {
    trace("dialog box failed to open.");
}





<< 27/29 >>