Skip to content

Instantly share code, notes, and snippets.

@ino46
Created January 20, 2009 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ino46/49535 to your computer and use it in GitHub Desktop.
Save ino46/49535 to your computer and use it in GitHub Desktop.
iKnow! 学習最適化(for Opera)
// ==UserScript==
// @include http://www.iknow.co.jp/mypage
// @include http://www.iknow.co.jp/flash*
// ==/UserScript==
//
// name iKnow! customize (for Opera)
// auther ino46
// website http://d.hatena.ne.jp/ino46/
// version 0.0.3.1 (2009-01-21T01:28:49+09:00)
// defaulticon
// copyright
//
// special thanks to
// css http://d.hatena.ne.jp/os0x/20080109
// キーボードフォーカス
// http://www.adobe.com/jp/support/flash/ts/documents/tn_15586.htm
// http://d.hatena.ne.jp/nacookan/20080308/1204982293
//
// ToDo
// キーボードフォーカス
//
(function(){
//コースを十件表示に
//http://www.iknow.co.jp/mypage で実行
if( location.href.match(/http:\/\/www\.iknow\.co\.jp\/mypage) ){
var css ="\
#content_panel_container > .clr,\
body > .body > .left {\
display:none !important;\
}\
body > .body > .center {\
float:none !important;\
width:100% !important;\
}\
#tab {\
width:100% !important;\
}\
#content_panel_container > .courses_panel {\
margin:0 auto 2em !important;\
width:65em !important;\
}\
";
var head = document.getElementsByTagName('head');
if (!!head) {
var style = document.createElement('style');
style.type = 'text/css';
style.textContent = css;
head[0].appendChild(style);
}
//イベントリスナーをセット。DOM 構築&画像読み込み終了後
window.addEventListener('load',function(){
spin_div('pagination_content_for_mypage_courses_url');
new Ajax.Request('http://www.iknow.co.jp/mypage/courses?application=iknow&page=1&per_page=10', {asynchronous:true, evalScripts:true});
//asynchronous 非同期通信なら true 同期通信は false
//evalScripts true にすると、サーバからの結果に script 要素が含まれる場合、その内容を評価することができる
//イベントリスナーを削除。arguments.callee は自身。
window.removeEventListener('load', arguments.callee, false);
return false;
}, false);
}
//ロードされた際にキーボードフォーカスを与える
//http://www.iknow.co.jp/flash* で実行
//if( location.href.match(/http:\/\/www\.iknow\.co\.jp\/flash.*/) ){
/*
//イベントリスナーをセット。DOM 構築&画像読み込み終了後
window.addEventListener('load', function(){
//App は embed 要素の name 属性
window.document.App.focus();
//イベントリスナーを削除。arguments.callee は自身。
window.removeEventListener('load', arguments.callee, false);
}, false);
*/
//}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment