• R/O
  • SSH
  • HTTPS

opengion: 提交


Commit MetaInfo

修訂1527 (tree)
時間2017-12-20 08:43:30
作者takahashi_m

Log Message

(empty log message)

Change Summary

差異

--- trunk/opengionV5/uap/webapps/gf/doc/RELEASE-NOTES.txt (revision 1526)
+++ trunk/opengionV5/uap/webapps/gf/doc/RELEASE-NOTES.txt (revision 1527)
@@ -1,4 +1,10 @@
1-5.9.27.2 (2017/12/15)
1+5.9.27.3 (2017/12/22)
2+ [時間ピッカー改修]
3+ 24時以降の表示に対応します。
4+ ブレイクを12時単位にした上で、間を空けることで選択しやすくします。
5+ jsp/common/eventScript.js#ogClockpicker
6+
7+5.9.27.2 (2017/12/15)
28 [日本語ファイル名のEdge対応]
39 Edgeで日本語ファイル名をfileDownloadServlet経由で落とす場合に文字化けしていたため、IEと同様の処理としておきます。
410 判定はUserAgentの「Edge」の文字列有無としています。
--- trunk/opengionV5/uap/webapps/gf/src/script/common/eventScript.js (revision 1526)
+++ trunk/opengionV5/uap/webapps/gf/src/script/common/eventScript.js (revision 1527)
@@ -763,6 +763,7 @@
763763 @og.rev 5.9.12.3 (2015/09/23) 返す値に秒(00固定)を追加出来るようにする(useSecond)
764764 @og.rev 5.9.15.1 (2016/12/09) 数値変換不具合対応
765765 @og.rev 5.9.17.2 (2017/02/15) layout指定追加
766+@og.rev 5.9.**.* (2017/12/19) 選択時間を幅広く取れるように変更、及び方向キー対応
766767 ********************************************************************************************/
767768
768769 jQuery.fn.ogClockpicker = function(options, callback) {
@@ -854,10 +855,13 @@
854855 var $hourcont = jQuery("<div id='CP_hourcont' class='CP' />").appendTo( $body );
855856 !settings.useBgiframe ? $hourcont.css("opacity",settings.hoursopacity) : null;
856857 binder( $hourcont );
857-
858- var $hourcol1 = jQuery("<div class='CP_hourcol' id='hourcol1' />").appendTo( $body );
859- var $hourcol2 = jQuery("<div class='CP_hourcol' id='hourcol2' />").appendTo( $body );
860858
859+ //多数に対応させるため配列に代入 5.9.27.3 (2017/12/22)
860+ var $hourcol = [];
861+ for(var i=0;i<Math.floor(settings.endhour/12)-Math.floor(settings.starthour/12)+1;i++){
862+ $hourcol.push(jQuery("<div class='CP_hourcol' id='hourcol"+i+"' />").appendTo( $body ));
863+ }
864+
861865 // if showminutes, append minutes cont to body
862866
863867 if (settings.showminutes == "true") {
@@ -872,8 +876,9 @@
872876 }
873877 }
874878 else {
875- $hourcol1.addClass('floatleft');
876- $hourcol2.addClass('floatleft');
879+ for (i=0;i<$hourcol.length;i++){
880+ $hourcol[i].addClass('floatleft');
881+ }
877882 }
878883
879884 // all the action right here
@@ -887,11 +892,12 @@
887892 function renderhours() {
888893 // fill in the $hourcont div
889894 var c = 1;
895+ var numberC = 0;
890896 // counter as index 2 of hr id, gives us index
891897 // in group of hourdivs for calculating where to put minutecont on keydown
892898 for (var h=settings.starthour; h<=settings.endhour; h++) {
893899
894- if(h==12) { c = 1; } // reset counter for col 2
900+ if(h%12==0) { c = 1; } // reset counter for col 2
895901
896902 var displayhours = ((!settings.military && h > 12) ? h - 12 : h);
897903 var valuehouers = h; // opengion
@@ -916,12 +922,29 @@
916922 if (!v) {
917923 $hd.css("float","left");
918924 }
919- (h<12) ? $hourcol1.append($hd) : $hourcol2.append($hd);
925+ $hourcol[numberC].append($hd);
926+ if((h+1)%12==0){
927+ numberC++;
928+ }
920929 c++;
921930 }
922- $hourcont.append($hourcol1);
923- !v ? $hourcont.append("<div style='clear:left' />") : '';
924- $hourcont.append($hourcol2);
931+
932+ // 5.9.27.3 (2017/12/22)
933+ for(var j=0; j<$hourcol.length;j++){
934+ if(v){
935+ if(j!=0&&j%2==0){
936+ $hourcol[j].css("margin-left",$mc.width()+4 + 'px');
937+ }
938+ }else{
939+ $hourcont.append("<div style='clear:left' />");
940+ if(j!=0&&j%2==0){
941+ //$mc.height()が0になってまう??
942+ $hourcol[j].css("margin-top","19px");
943+ }
944+ }
945+ $hourcont.append($hourcol[j]);
946+ }
947+
925948 }
926949
927950 function renderminutes( h ) {
@@ -1089,33 +1112,29 @@
10891112 var h = $obj.attr("id").split('_')[1],
10901113 i = $obj.attr("id").split('_')[2],
10911114 l,
1092- t;
1115+ t,
1116+ nn;
10931117 $obj.addClass("CP_over");
1094-
1118+
1119+ //何個目の要素を見ているか計算して、分表示を配置するための独立変数nnを算出 5.9.27.3 (2017/12/22)
1120+ nn = Math.ceil((Math.floor(h/12)-Math.floor(settings.starthour/12))/2);
1121+
10951122 if ( settings.showminutes == "true") {
10961123 $mc.hide();
10971124 renderminutes(h);
1098-
10991125 // set position & show minutes container
11001126 if (v) {
11011127 t = e.type == 'mouseover'
11021128 ? e.pageY - 15
11031129 : $hourcont.offset().top + 2 + ($obj.height() * i);
1104- if ( h < 12 )
1105- l = $hourcont.offset().left - $mc.width() - 2;
1106- else
1107- l = $hourcont.offset().left + $hourcont.width() + 2;
1130+ l = $hourcont.offset().left + $hourcol[0].width()*2*nn + $mc.width()*(nn-1) + 4*nn-2; // 5.9.27.3 (2017/12/22)
11081131 }
11091132 else {
11101133 l = (e.type == 'mouseover')
11111134 ? e.pageX - 10
11121135 : $hourcont.offset().left + ($obj.width()-5) * i;
1113- if(h<12) {
1114- t = $hourcont.offset().top - $mc.height() - 2;
1115- }
1116- else {
1117- t = $hourcont.offset().top + $hourcont.height();
1118- }
1136+ //$hourcol[0].height()は出ないため全体から各要素を引いて導出
1137+ t = $hourcont.offset().top + ($hourcont.height()-($mc.height()+2)*(Math.ceil($hourcol.length/2)-1))/$hourcol.length*2*nn + $mc.height()*(nn-1) + 2*nn-1; // (2017/12/19)
11191138 }
11201139 $mc.css("left",l+'px').css("top",t+'px');
11211140 rectify( $mc );
@@ -1201,11 +1220,22 @@
12011220 divtype = $obj.is(".CP_hour") ? 'hour' : 'minute',
12021221 hi = (divtype == 'hour') ? $obj[0].id.split('_')[2] : 0, // hour index
12031222 h = (divtype == 'minute') ? $obj[0].id.split('_')[0] : $obj[0].id.split('_')[1]; // real hour
1204- if (divtype == 'minute')
1205- { var curloc = h<12 ? 'm1' : 'm2' }
1206- else
1207- { var curloc = h<12 ? 'h1' : 'h2' }
1208-
1223+ // 5.9.27.3 (2017/12/22)
1224+ if (divtype == 'minute') {
1225+ if((Math.floor(h/12)-Math.floor(settings.starthour/12))==0){
1226+ var curloc = 'm1';
1227+ }else if((Math.floor(h/12)-Math.floor(settings.endhour/12))==0&&(Math.floor(h/12)-Math.floor(settings.starthour/12))%2!=0){
1228+ var curloc = 'm2';
1229+ }else{
1230+ var curloc = 'm3';
1231+ }
1232+ }else{
1233+ if((Math.floor(h/12)-Math.floor(settings.starthour/12))%2==0){
1234+ var curloc = 'h1';
1235+ }else{
1236+ var curloc = 'h2';
1237+ }
1238+ }
12091239 function divprev($obj) {
12101240 if ($obj.prev().size()) {
12111241 eval(divtype + 'div_out($obj)');
@@ -1223,7 +1253,13 @@
12231253 }
12241254
12251255 function hourtohour($obj) {
1226- var ctx = h>=12 ? '#hourcol1' : '#hourcol2';
1256+ // 5.9.27.3 (2017/12/22)
1257+ if((Math.floor(h/12)-Math.floor(settings.starthour/12))%2==0){
1258+ var next = String((Math.floor(h/12)-Math.floor(settings.starthour/12))+1);
1259+ }else{
1260+ var next = String((Math.floor(h/12)-Math.floor(settings.starthour/12))-1);
1261+ }
1262+ var ctx = '#hourcol'+next;
12271263 $newobj = jQuery(".CP_hour[id$=_" + hi + "]", ctx );
12281264 if ($newobj.size()) {
12291265 hourdiv_out($obj);
@@ -1237,11 +1273,27 @@
12371273 minutediv_over($(".CP_minute:first"));
12381274 }
12391275
1240- function minutetohour($obj) {
1276+ function minutetohour($obj,where) {
12411277 minutediv_out($obj);
1242- var ctx = h>=12 ? '#hourcol2' : '#hourcol1';
1278+ // 5.9.27.3 (2017/12/22)
1279+ if(where<0){
1280+ if((Math.floor(h/12)-Math.floor(settings.starthour/12))%2==0){
1281+ var next = String((Math.floor(h/12)-Math.floor(settings.starthour/12))+where);
1282+ h = String(Number(h)-12);
1283+ }else{
1284+ var next = String((Math.floor(h/12)-Math.floor(settings.starthour/12)));
1285+ }
1286+ }else{
1287+ if((Math.floor(h/12)-Math.floor(settings.starthour/12))%2==0){
1288+ var next = String((Math.floor(h/12)-Math.floor(settings.starthour/12)));
1289+ }else{
1290+ var next = String((Math.floor(h/12)-Math.floor(settings.starthour/12))+where);
1291+ h = String(Number(h)+12);
1292+ }
1293+ }
1294+ var ctx = '#hourcol'+next;
1295+ var $newobj = jQuery(".CP_hour[id^=hr_" + h + "]", ctx);
12431296 // extract hour from minutediv, then find hourdiv with that hour
1244- var $newobj = jQuery(".CP_hour[id^=hr_" + h + "]", ctx);
12451297 hourdiv_over($newobj, e);
12461298 }
12471299
@@ -1253,8 +1305,11 @@
12531305 return false;
12541306 break;
12551307 case 'm2':
1256- minutetohour($obj);
1308+ minutetohour($obj,-1);
12571309 break;
1310+ case 'm3':
1311+ minutetohour($obj,-1); // 5.9.27.3 (2017/12/22)
1312+ break;
12581313 case 'h1':
12591314 hourtominute($obj);
12601315 break;
@@ -1278,8 +1333,11 @@
12781333 return false;
12791334 break;
12801335 case 'm2':
1281- minutetohour($obj);
1336+ minutetohour($obj,-1);
12821337 break;
1338+ case 'm3':
1339+ minutetohour($obj,-1); // 5.9.27.3 (2017/12/22)
1340+ break;
12831341 case 'h1':
12841342 hourtominute($obj);
12851343 break;
@@ -1293,11 +1351,14 @@
12931351 if (v) {
12941352 switch (curloc) {
12951353 case 'm1':
1296- minutetohour($obj);
1354+ minutetohour($obj,1);
12971355 break;
12981356 case 'm2':
12991357 return false;
13001358 break;
1359+ case 'm3':
1360+ minutetohour($obj,1); // 5.9.27.3 (2017/12/22)
1361+ break;
13011362 case 'h1':
13021363 hourtohour($obj);
13031364 break;
@@ -1318,11 +1379,14 @@
13181379 else {
13191380 switch (curloc) {
13201381 case 'm1':
1321- minutetohour($obj);
1382+ minutetohour($obj,1);
13221383 break;
13231384 case 'm2':
13241385 return false;
13251386 break;
1387+ case 'm3':
1388+ minutetohour($obj,1); // 5.9.27.3 (2017/12/22)
1389+ break;
13261390 case 'h1':
13271391 hourtohour($obj);
13281392 break;
Show on old repository browser