summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-06 10:35:44 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-06 10:35:44 -0500
commit10f4420401c746540503f380a46d5cd13e160bec (patch)
treeca54edf78eb8e73ef95d36071dd1fe548df4e759
parent7312a17aff56c0b1f98efbc23f3916420220ecf3 (diff)
Auto-select input fields for copy/paste
-rw-r--r--app/Template/config/api.php2
-rw-r--r--app/Template/config/webhook.php2
-rw-r--r--app/Template/project/share.php6
-rw-r--r--app/Template/project/show.php2
-rw-r--r--assets/js/app.js9
-rw-r--r--assets/js/base.js9
6 files changed, 20 insertions, 10 deletions
diff --git a/app/Template/config/api.php b/app/Template/config/api.php
index 037ea08d..20a02340 100644
--- a/app/Template/config/api.php
+++ b/app/Template/config/api.php
@@ -9,7 +9,7 @@
</li>
<li>
<?= t('API endpoint:') ?>
- <input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().'jsonrpc.php' ?>">
+ <input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().'jsonrpc.php' ?>">
</li>
<li>
<?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
diff --git a/app/Template/config/webhook.php b/app/Template/config/webhook.php
index 052a2a99..abd8da5f 100644
--- a/app/Template/config/webhook.php
+++ b/app/Template/config/webhook.php
@@ -29,7 +29,7 @@
</li>
<li>
<?= t('URL for task creation:') ?>
- <input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
+ <input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
</li>
<li>
<?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
diff --git a/app/Template/project/share.php b/app/Template/project/share.php
index 8edcbbc0..10155492 100644
--- a/app/Template/project/share.php
+++ b/app/Template/project/share.php
@@ -6,10 +6,10 @@
<div class="listing">
<ul class="no-bullet">
- <li><strong><i class="fa fa-share-alt"></i> <?= Helper\a(t('Public link'), 'board', 'readonly', array('token' => $project['token'])) ?></strong></li>
- <li><strong><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></strong></li>
+ <li><strong><i class="fa fa-share-alt"></i> <?= Helper\a(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></strong></li>
+ <li><strong><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token']), false, '', '', true) ?></strong></li>
</ul>
- <input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('board', 'readonly', array('token' => $project['token'])) ?>"/>
+ <input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('board', 'readonly', array('token' => $project['token'])) ?>"/>
</div>
<?= Helper\a(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?>
diff --git a/app/Template/project/show.php b/app/Template/project/show.php
index b1b552df..bdb46ee3 100644
--- a/app/Template/project/show.php
+++ b/app/Template/project/show.php
@@ -60,7 +60,7 @@
</div>
<h3><i class="fa fa-github fa-fw"></i><?= t('Github webhook') ?></h3>
-<input type="text" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/>
+<input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'github', array('token' => $webhook_token, 'project_id' => $project['id'])) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/github-webhooks" target="_blank"><?= t('Help on Github webhook') ?></a></p>
<?php endif ?>
diff --git a/assets/js/app.js b/assets/js/app.js
index d91a0823..5e13d013 100644
--- a/assets/js/app.js
+++ b/assets/js/app.js
@@ -168,8 +168,13 @@ var Kanboard = (function() {
$("#markdown-preview").click(Kanboard.MarkdownPreview);
$("#markdown-write").click(Kanboard.MarkdownWriter);
- // Check the session every 10s
- window.setInterval(Kanboard.CheckSession, 10000);
+ // Check the session every 60s
+ window.setInterval(Kanboard.CheckSession, 60000);
+
+ // Auto-select input fields
+ $(".auto-select").focus(function() {
+ $(this).select();
+ });
}
};
diff --git a/assets/js/base.js b/assets/js/base.js
index 9303b348..2ad19ac0 100644
--- a/assets/js/base.js
+++ b/assets/js/base.js
@@ -153,8 +153,13 @@ var Kanboard = (function() {
$("#markdown-preview").click(Kanboard.MarkdownPreview);
$("#markdown-write").click(Kanboard.MarkdownWriter);
- // Check the session every 10s
- window.setInterval(Kanboard.CheckSession, 10000);
+ // Check the session every 60s
+ window.setInterval(Kanboard.CheckSession, 60000);
+
+ // Auto-select input fields
+ $(".auto-select").focus(function() {
+ $(this).select();
+ });
}
};