2009�N06��10��

AJAX Libraries API �̗��p

AJAX Libraries API �́A�L���� JavaScript ���C�u������
Google ���z�X�e�B���O����o�[�W�������w�肵�Ď��R�Ɏg����
�T�[�r�X�ł��B

�Ⴆ�΁Aprototype.js �𗘗p�������ꍇ�͈ȉ��̂悤�Ɏw�肵�܂��B
<script
	src="http://www.google.com/jsapi"
	type="text/javascript"
	charset="utf-8"
></script>
<script language="javascript" type="text/javascript">

// Google �� HOSTING����Ă��郉�C�u�������g��
google.load("prototype", "1.6");

</script>

�� ���p�T���v��( Form(�T�[�o�[���M)�ėp�X�P���g�� )

prototype.js �̑��ɂ��A�ȉ��̂悤�ȃ��C�u�������g�p�”\�ł�

google.load("jquery", "1.3.1"); google.load("jqueryui", "1.5.3"); google.load("scriptaculous", "1.8.2"); google.load("mootools", "1.2.1"); google.load("dojo", "1.2.3"); google.load("swfobject", "2.1"); google.load("yui", "2.6.0"); jsapi �� API �L�[��K�v�Ƃ���̂́AGoogle MAP�n�݂̂ł��B ���� API �̏ꍇ�͈ȉ��̂悤�ɋL�q����Ă��܂�
Google AJAX Search API �ł́AJavaScript ���g�p���Ċe���̃E�F�u�y�[�W�� 
Google ������g�ݍ��ނ��Ƃ��ł��܂��B���� API ���g�p���邽�߂ɃL�[�͕K�v����܂���B
�A�v���P�[�V������T�C�g�ŃL�[���g�p���邩�ǂ����́A���S�ɔC�ӂł��B
�������A�L�[���g�p����ƕ֗��ł��B���̗��R�́A�L�[������΁A
���g�̃A�v���P�[�V�����܂��̓T�C�g�Ɋ֌W�����肪���o���ꂽ�ꍇ�AGoogle �����̃L�[��
�g�p���ĘA���ł��邩��ł��B
�L�[���Ȃ���΁A��肪���������Ƃ��ɘA�������i������܂���B 
��L�L�q�́AGoogle AJAX Search API �̋L�q�ŁAAJAX Libraries API �̃y�[�W��
���̂悤�ȋL�q�͂���܂��񂪁A����������̂ƍl�����܂��B

�� Google AJAX Search API �̃G���g���y�[�W
�� Google AJAX API �̃G���g���y�[�W
�� Google AJAX API �̑S�̑�( �h�L�������g )


posted by night wálker at 09:58| Google AJAX Libraries API

2009�N06��07��

shCore.js��viewSource�̃I�[�o�[���C�h

SyntaxHighlighter 2.0

�w�b�_�[����shCore.js��ǂݍ��񂾌�ɏ��������܂��B
sh �͓����ϐ��ł����ASyntaxHighlighter �� sh �� return 
���Ă���̂œ������̂ł��B

�� ������ viewSource �́A���̃R�[�h�ŃI�[�o�[���C�h���Ă��܂��B
( ���̋L�����\������Ă���y�[�W���͑S�đΏۂƂȂ�܂� )
<script type="text/javascript">
SyntaxHighlighter.toolbar.items.viewSource = 
function(highlighter)
{
	this.create = function()
	{
		return SyntaxHighlighter.config.strings.viewSource;
	};
	
	this.execute = function(sender, event, args)
	{
		var code = SyntaxHighlighter.utils.fixForBlogger(highlighter.originalCode);
		code = code.replace(/</g, '&lt;');

		var wndParam = 'location=0,resizable=1,menubar=0,scrollbars=1';
		wnd = SyntaxHighlighter.utils.popup('','_blank',800, 600,wndParam);

		code = SyntaxHighlighter.utils.unindent(code);

		wnd.document.write('<input type="button" value="�_�E�����[�h"><br>');
		wnd.document.write('<pre>' + code + '</pre>');
		wnd.document.close();
	};
}
</script>

posted by night wálker at 00:47| SyntaxHighlighter

2009�N06��06��

�c�[���o�[��viewSource�Œlj��@�\����

SyntaxHighlighter 2.0

SyntaxHighlighter 2.0 �̉����ł��B

�ł��������₷���ꏊ�́AshCore.js �́AviewSource : function(highlighter) �ł��B
���X�w�Nj@�\�������AJavaScript ��m��l�ł���΂��Ȃ��
�g�����ł���悤�ɂȂ��Ă��܂��B�����A�\�[�X���̏���
�����Œm��K�v������̂ŁA�ȉ��̂悤�ɂ��܂�
<pre name="code0001" class="brush: cpp; download: lighbox; ext: lzh">

class �ɂ́A���R�Ƀp�����[�^��lj��ł���d�l�ɂȂ��Ă��܂��̂ŁA
��L�̂悤�ɐݒ肷�邾���ŁAparams �͈ȉ��̂悤�ɂȂ�܂��B
auto-links true
brush "cpp"
class-name ""
collapse "false"
download "lighbox"
ext "lzh"
first-line "1"
font-size undefined
gutter "true"
highlight undefined
light false
ruler "false"
smart-tabs true
tab-size 4
toolbar "true"
params �́AviewSource ���ňȉ��̂悤�ɂ��ĎQ�Ƃł��܂��B

highlighter.params.download
highlighter.params.ext
posted by night wálker at 23:38| SyntaxHighlighter

shLegacy.js��Opera�̃^�u�����f����Ȃ�

SyntaxHighlighter 2.0

dp.SyntaxHighlighter.HighlightAll ���g���āA�����ł�����
�R�[�h�̕ϊ����悤�Ƃ��Ă���ꍇ�AOpera �ł̓^�u�����������悤�ł��B

�����ŁAshLegacy.js ��ύX���āAOpera �̎����� SyntaxHighlighter.all() ��
�g�p����悤�ɂ��܂����B

������Ă΂�鎖�ɂȂ�܂����A���ɖ��͏o�Ă��܂���

����ƁA���̏ꍇ�ł� brush:�^�C�v �Ƃ����V�����������łȂ���
���f����Ȃ��̂Œ��ӂ��ĉ������B
HighlightAll: function(
					name, 
					showGutter /* optional */, 
					showControls /* optional */, 
					collapseAll /* optional */, 
					firstLine /* optional */, 
					showColumns /* optional */
					)
{
	function findValue()
	{
		var a = arguments;
		
		for (var i = 0; i < a.length; i++) 
		{
			if (a[i] === null) 
				continue;
			
			if (typeof(a[i]) == 'string' && a[i] != '') 
				return a[i] + '';
			
			if (typeof(a[i]) == 'object' && a[i].value != '') 
				return a[i].value + '';
		}
		
		return null;
	};

	function findTagsByName(list, name, tagName)
	{
		var tags = document.getElementsByTagName(tagName);
		
		for (var i = 0; i < tags.length; i++) 
			if (tags[i].getAttribute('name') == name) 
				list.push(tags[i]);
	}

	var userAgent = window.navigator.userAgent.toLowerCase();
	var appVersion = window.navigator.appVersion.toLowerCase();

	if (userAgent.indexOf("opera") > -1) {
		SyntaxHighlighter.all();
		return;
	}

	var elements = [],
		highlighter = null,
		registered = {},
		propertyName = 'innerHTML'
		;
	
	// for some reason IE doesn't find <pre/> by name, however it does see them just fine by tag name... 
	findTagsByName(elements, name, 'pre');
	findTagsByName(elements, name, 'textarea');

	if (elements.length === 0)
		return;
	
	for (var i = 0; i < elements.length; i++)
	{
		var element = elements[i],
			params = findValue(
				element.attributes['class'], element.className, 
				element.attributes['language'], element.language
				),
			language = ''
			;
		
		if (params === null) 
			continue;

		params = dp.SyntaxHighlighter.parseParams(
			params,
			showGutter, 
			showControls, 
			collapseAll, 
			firstLine, 
			showColumns
			);

		SyntaxHighlighter.highlight(params, element);
	}
}

posted by night wálker at 19:59| SyntaxHighlighter

2009�N05��24��

�e�L�X�g�G���A�̉E�[�Ő܂�Ԃ��Ȃ�

�ǂ����AFirefox ���X�N���v�g�ŕύX����ƌ������𕷂��Ȃ��̂ŁA
innerHTML �ő��ւ��ł��B
<script type="text/javascript">
function change_wraptype(obj) {

	var svdata;

	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		if(obj.checked){
			document.getElementById("text_unit").wrap = "off";
		}
		else{
			document.getElementById("text_unit").wrap = "soft";
		}
	}
	else {
		svdata = document.getElementById("text_unit").value;

		if(obj.checked){
			str = str="<textarea id=\"text_unit\" cols=80 rows=20 wrap=\"off\"></textarea>";
		}
		else{
			str = str="<textarea id=\"text_unit\" cols=80 rows=20 wrap=\"soft\"></textarea>";
		}
		document.getElementById("control_unit").innerHTML = str;
		document.getElementById("text_unit").value = svdata;
	}
}
</script>

�܂�Ԃ��Ȃ� <input
	type="checkbox"
	onClick='change_wraptype(this)'
>
<div id=control_unit>
<script type="text/javascript">
document.write("<textarea id=\"text_unit\" cols=80 rows=20 wrap=\"soft\"></textarea>");
</script>
</div>

�܂�Ԃ��Ȃ�
posted by night wálker at 17:56| �N���X�u���E�W���O
JavaScript �x�[�V�b�N
SyntaxHighlighter
�N���X�u���E�W���O
���̑�
Highslide JS
�v���̑��Y��ɎB�ꂽ��
�u���O���ʂ�ɂ́AJavaScript ���K���K�v�ł��B
���ɁAGoogle �̑��݂͑傫���AGoogle MAP ���͂��߂Ƃ���
���낢��Ȑ�i�̋Z�p���ȒP�ɗ��p�ł��܂��B
���\�m���Ă��Ȃ����̂�����A���� JavaScript ��׋�����Ύg����悤�ɂȂ���
�����̃u���O�ɂ��낢��ȉԂ�Y���鎖���ł���悤�ɂȂ�Ǝv���܂��B
�� ���̉Ԃ� Highslide JS �ƌ����� Google �Ƃ͊֌W����܂���B



Admin