Skip to content
Permalink
Browse files

編集フォームに現在時刻を挿入するボタンの追加

  • Loading branch information...
piyoyo
piyoyo committed Mar 22, 2015
1 parent e8edb93 commit 9d6e6cd0dc77469bd0ab80783d0f16260aa8d6b0
@@ -0,0 +1,24 @@

function edit_form_change_date_ByValue( list )
{
var id_lists = new Array("inputyear", "inputmonth", "inputday",
"inputhour", "inputminutes");
var i,e,v;
for(i =0; i<=id_lists.length-1; i++)
{
e = document.getElementById( id_lists[i] );
if ((e != null) && (e != undefined))
{
v = (i > list.length-1) ? "" : list[i];
e.value = (v != null) ? v : "";
}
}
}

function edit_form_change_date_now()
{
var e_now = new Date;
edit_form_change_date_ByValue( new Array( e_now.getFullYear(),
e_now.getMonth()+1, e_now.getDate(),
e_now.getHours(), e_now.getMinutes() ) );
}
17 nucleus/language/japanese-utf8.php 100755 → 100644
@@ -16,13 +16,16 @@
// Note for Japanese users
// このファイルは Nucleus の UTF-8 版日本語ランゲージファイルです。
/********************************************
* Start New for 3.64 *
********************************************/
define('_ERROR_USER_TOO_LONG', '名前を40文字以内で入力してください。');
define('_ERROR_EMAIL_TOO_LONG', 'eメールを40文字以内で入力してください。');
define('_ERROR_URL_TOO_LONG', 'ウェブサイトを40文字以内で入力してください。');
define('_ADD_DATEINPUTNOW', '現在時刻');
define('_ADD_DATEINPUTRESET', 'リセット');
/********************************************
* Start New for 3.64 *
********************************************/
define('_ERROR_USER_TOO_LONG', '名前を40文字以内で入力してください。');
define('_ERROR_EMAIL_TOO_LONG', 'eメールを40文字以内で入力してください。');
define('_ERROR_URL_TOO_LONG', 'ウェブサイトを40文字以内で入力してください。');
/********************************************
* Start New for 3.62 *
@@ -2,6 +2,7 @@

<%init%>
<script type="text/javascript" src="javascript/numbercheck.js"></script>
<script type="text/javascript" src="javascript/edit_date.js"></script>
<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>

<form id="addform" method="post" action="index.php" >
@@ -71,6 +72,9 @@
<input id="inputminutes" name="minutes" tabindex="67" size="2" value="<%currenttime(minutes)%>" onchange="document.forms[0].act_future.checked=true;" /><%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<br /><%text(_ITEM_ADDEDITTEMPLATE_FORMAT)%>(yyyy)<%text(_ITEM_ADDEDITTEMPLATE_YEAR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MONTH)%>(dd)<%text(_ITEM_ADDEDITTEMPLATE_DAY)%> (hh)<%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>

<input tabindex="68" type="button" value="<%text(_ADD_DATEINPUTNOW)%>" onclick = 'document.forms[0].act_future.checked=true; return edit_form_change_date_now();' />
<input tabindex="69" type="button" value="<%text(_ADD_DATEINPUTRESET)%>" onclick = 'return date_currenttime_reset();' />

<%ifblogsetting(ballowpast,0)%>
<br />
<%text(_ADD_NOPASTDATES)%>
@@ -143,3 +147,13 @@
var formtype = 'add'; // Add or edit form
</script>
<%endif%>

<script type="text/javascript">
// datetime reset functions
function date_currenttime_reset( )
{
edit_form_change_date_ByValue( new Array(
"<%currenttime(year)%>", "<%currenttime(mon)%>", "<%currenttime(mday)%>",
"<%currenttime(hours)%>", "<%currenttime(minutes)%>" ) );
}
</script>
@@ -2,6 +2,7 @@

<%init%>
<script type="text/javascript" src="javascript/numbercheck.js"></script>
<script type="text/javascript" src="javascript/edit_date.js"></script>
<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>

<form id="editform" method="post" action="index.php">
@@ -71,6 +72,8 @@
<input id="inputhour" name="hour" tabindex="74" size="2" value="<%currenttime(hours)%>" onchange="document.forms[0].act_future.checked=true;" /><%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>
<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%currenttime(minutes)%>" onchange="document.forms[0].act_future.checked=true;" /><%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<br /><%text(_ITEM_ADDEDITTEMPLATE_FORMAT)%>(yyyy)<%text(_ITEM_ADDEDITTEMPLATE_YEAR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MONTH)%>(dd)<%text(_ITEM_ADDEDITTEMPLATE_DAY)%> (hh)<%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<input tabindex="76" type="button" value="<%text(_ADD_DATEINPUTNOW)%>" onclick = 'document.forms[0].act_future.checked=true; return edit_form_change_date_now();' />
<input tabindex="77" type="button" value="<%text(_ADD_DATEINPUTRESET)%>" onclick = 'return date_currenttime_reset();' />
<%ifblogsetting(ballowpast,0)%>
<br />
<%text(_ADD_NOPASTDATES)%>
@@ -95,6 +98,8 @@
<input id="inputhour" name="hour" tabindex="74" size="2" value="<%itemtime(hours)%>" onchange="document.forms[0].act_changedate.checked=true;" /><%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>
<input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%itemtime(minutes)%>" onchange="document.forms[0].act_changedate.checked=true;" /><%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<br /><%text(_ITEM_ADDEDITTEMPLATE_FORMAT)%>(yyyy)<%text(_ITEM_ADDEDITTEMPLATE_YEAR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MONTH)%>(dd)<%text(_ITEM_ADDEDITTEMPLATE_DAY)%> (hh)<%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<input tabindex="76" type="button" value="<%text(_ADD_DATEINPUTNOW)%>" onclick = 'document.forms[0].act_changedate.checked=true; return edit_form_change_date_now();' />
<input tabindex="77" type="button" value="<%text(_ADD_DATEINPUTRESET)%>" onclick = 'return date_itemtime_reset();' />
</div>
<%endif%>
<input name="actiontype" value="backtodrafts" type="radio" id="act_backtodrafts" tabindex="71" /><label for="act_backtodrafts"><%text(_BMLET_BACKTODRAFTS)%></label> <%helplink(draft)%>
@@ -167,3 +172,19 @@
var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
var formtype = 'edit'; // Add or edit form
</script><%endif%>

<script type="text/javascript">
// datetime reset functions
function date_currenttime_reset( )
{
edit_form_change_date_ByValue( new Array(
"<%currenttime(year)%>", "<%currenttime(mon)%>", "<%currenttime(mday)%>",
"<%currenttime(hours)%>", "<%currenttime(minutes)%>" ) );
}
function date_itemtime_reset( )
{
edit_form_change_date_ByValue( new Array(
"<%itemtime(year)%>", "<%itemtime(mon)%>", "<%itemtime(mday)%>",
"<%itemtime(hours)%>", "<%itemtime(minutes)%>" ) );
}
</script>
@@ -20,6 +20,7 @@
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="javascript/bookmarklet.js"></script>
<script type="text/javascript" src="javascript/edit.js"></script>
<script type="text/javascript" src="javascript/edit_date.js"></script>
<script type="text/javascript" src="javascript/numbercheck.js"></script>
<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
@@ -125,6 +126,8 @@
<input class="addFuture" id="inputhour" name="hour" size="2" value="<%currenttime(hours)%>" tabindex="100" /><%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>
<input class="addFuture" id="inputminutes" name="minutes" size="2" value="<%currenttime(minutes)%>" tabindex="110" /><%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<br /><%text(_ITEM_ADDEDITTEMPLATE_FORMAT)%>(yyyy)<%text(_ITEM_ADDEDITTEMPLATE_YEAR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MONTH)%>(dd)<%text(_ITEM_ADDEDITTEMPLATE_DAY)%> (hh)<%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<input tabindex="120" type="button" value="<%text(_ADD_DATEINPUTNOW)%>" onclick = 'document.forms[0].act_future.checked=true; return edit_form_change_date_now();' />
<input tabindex="121" type="button" value="<%text(_ADD_DATEINPUTRESET)%>" onclick = 'return date_currenttime_reset();' />
<%ifblogsetting(ballowpast,0)%><br /><%text(_ADD_NOPASTDATES)%><%endif%>
</div>
</li>
@@ -170,5 +173,15 @@
var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
var formtype = 'add'; // Add or edit form
</script><%endif%>

<script type="text/javascript">
// datetime reset functions
function date_currenttime_reset( )
{
edit_form_change_date_ByValue( new Array(
"<%currenttime(year)%>", "<%currenttime(mon)%>", "<%currenttime(mday)%>",
"<%currenttime(hours)%>", "<%currenttime(minutes)%>" ) );
}
</script>
</body>
</html>
@@ -20,6 +20,7 @@
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="javascript/bookmarklet.js"></script>
<script type="text/javascript" src="javascript/edit.js"></script>
<script type="text/javascript" src="javascript/edit_date.js"></script>
<script type="text/javascript" src="javascript/numbercheck.js"></script>
<%ifautosave()%><script type="text/javascript" src="javascript/xmlhttprequest.js"></script><%endif%>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
@@ -126,6 +127,8 @@
<input class="chgDate" id="inputhour" name="hour" size="2" value="<%itemtime(hours)%>" tabindex="100" /><%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>
<input class="chgDate" id="inputminutes" name="minutes" size="2" value="<%itemtime(minutes)%>" tabindex="110" /><%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<br /><%text(_ITEM_ADDEDITTEMPLATE_FORMAT)%>(yyyy)<%text(_ITEM_ADDEDITTEMPLATE_YEAR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MONTH)%>(dd)<%text(_ITEM_ADDEDITTEMPLATE_DAY)%> (hh)<%text(_ITEM_ADDEDITTEMPLATE_HOUR)%>(mm)<%text(_ITEM_ADDEDITTEMPLATE_MINUTE)%>
<input tabindex="120" type="button" value="<%text(_ADD_DATEINPUTNOW)%>" onclick = 'document.forms[0].act_changedate.checked=true; return edit_form_change_date_now();' />
<input tabindex="121" type="button" value="<%text(_ADD_DATEINPUTRESET)%>" onclick = 'return date_itemtime_reset();' />
</div>
</li><%endif%>
<li>
@@ -170,5 +173,15 @@
var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved'
var formtype = 'edit'; // Add or edit form
</script><%endif%>

<script type="text/javascript">
// datetime reset functions
function date_itemtime_reset( )
{
edit_form_change_date_ByValue( new Array(
"<%itemtime(year)%>", "<%itemtime(mon)%>", "<%itemtime(mday)%>",
"<%itemtime(hours)%>", "<%itemtime(minutes)%>" ) );
}
</script>
</body>
</html>

0 comments on commit 9d6e6cd

Please sign in to comment.
You can’t perform that action at this time.