• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

epgrecの検索フォームでキー入力による項目選択を可能に、種別選択で局の表示内容が変更されるようになります


Commit MetaInfo

修訂2c92917040263aab70d8077592729ab2c0c7817f (tree)
時間2012-03-10 16:41:04
作者trumphouse <trumphouse@user...>
Commitertrumphouse

Log Message

・Firefoxでブラウザのショートカットも実行されるバグ修正

・ループ、二重処理対応

Change Summary

差異

--- a/js/ch_form_assist.js
+++ b/js/ch_form_assist.js
@@ -9,8 +9,8 @@
99 * shiftキーを押している場合は前の候補を選択
1010 * ●放送波選択で選択可能チャンネル変更
1111 *
12- * Version 0.2.4
13- * 10:37 2012/03/04
12+ * Version 0.2.5
13+ * 16:34 2012/03/10
1414 *
1515 * Author : osamu - atelier TRUMPHOUSE
1616 *
@@ -54,8 +54,8 @@ ER_sub.FRM ={
5454 },
5555 selectAssist : function(tg, attr){
5656 if (!tg) { tg = 'select';}
57- attr = attr || 'html';
58- switch (attr.toLowerCase()) {
57+ attr = attr?attr.toLowerCase():'html';
58+ switch (attr) {
5959 case 'value':
6060 keyFn = function(t){return $(t).val();};break;
6161 case 'accesskey':
@@ -68,15 +68,18 @@ ER_sub.FRM ={
6868 keyFn = function(t){return $(t).attr(attr);};break;
6969 }
7070 $(tg).each(function(){
71- var $tg = $(this);
71+ var $tg = $(this), W = false,
72+ Ret = function(r){W=false;return r||false};
7273 $tg.focus(function(){
7374 $tg .bind('keydown', (function(ev){
75+ if ( W ) {return ;}
76+ W = true;
7477 if (ER_sub.STR.Hstr.indexOf(String.fromCharCode(ev.keyCode)) < 0) {
75- return ;
78+ return Ret(true) ;
7679 }
7780 var S = L = $tg.find('option:selected'),
7881 select, i=0,iMax=$tg.find('option:enabled').length;
79- if (iMax == 0) { return false; }
82+ if (iMax == 0) { return Ret(false); }
8083 while (!select) {
8184 if ( ev.shiftKey ){
8285 if (S.prevAll('option:enabled').length == 0) {
@@ -93,15 +96,21 @@ ER_sub.FRM ={
9396 }
9497 if ( ER_sub.FRM.key_is(ev.keyCode, keyFn(S)) && !S.attr('disabled')){
9598 select = S;
99+ // for Firefox
100+ if ($.browser.mozilla && !ev.shiftKey && (attr == 'html' || attr == 'text') && keyFn(S).match(/[A-Za-z0-9]/)) {
101+// console.log('FireFox:' + $.browser.version, navigator.userAgent);
102+ return Ret(true);
103+ }
96104 } else {
97105 i++;
98- if ( i == iMax -1 ) {
99- select = L;
106+ if ( i > iMax ) {
107+ return Ret(false);
108+// select = L;
100109 }
101110 }
102111 }
103112 $tg.val(select.val()).change();
104- return false;
113+ return Ret(false);
105114 }));
106115 }).blur(function(){
107116 $tg .unbind('keydown');
--- a/readme.txt
+++ b/readme.txt
@@ -8,6 +8,11 @@
88 * shiftキーを押している場合は前の候補を選択
99 * ●放送波選択で選択可能チャンネル変更
1010 *
11+ * Version 0.2.5
12+ * 16:34 2012/03/10
13+ * ・Firefoxでブラウザのショートカットも実行されるバグ修正
14+ * ・ループ、二重処理対応
15+ *
1116 * Version 0.2.4
1217 * 10:31 2012/03/04
1318 * ・放送波選択でチャンネルが消えるバグ、ドキュメント修正