diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-07-07 19:37:19 -0300 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-07-07 19:37:19 -0300 |
commit | 7a64053cb818931e38af8c9138a259a711ea4da7 (patch) | |
tree | a4f159b458af4fea8cfde1e192d258cf516defa7 /app | |
parent | 9f93407b5e7d2bb0827fb638e68d0d6a8b7ae6ca (diff) |
Improve javascript code and remove CSP errors
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/Base.php | 2 | ||||
-rw-r--r-- | app/Templates/board_index.php | 2 | ||||
-rw-r--r-- | app/Templates/board_task.php | 6 | ||||
-rw-r--r-- | app/Templates/file_show.php | 2 | ||||
-rw-r--r-- | app/Templates/layout.php | 1 | ||||
-rw-r--r-- | app/Templates/task_edit.php | 16 | ||||
-rw-r--r-- | app/Templates/task_layout.php | 4 | ||||
-rw-r--r-- | app/Templates/task_new.php | 4 |
8 files changed, 15 insertions, 22 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 25a72f15..8890db4c 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -107,7 +107,7 @@ abstract class Base $this->session->open(BASE_URL_DIRECTORY, SESSION_SAVE_PATH); // HTTP secure headers - $this->response->csp(); + $this->response->csp(array('style-src' => "'self' 'unsafe-inline'")); $this->response->nosniff(); $this->response->xss(); $this->response->hsts(); diff --git a/app/Templates/board_index.php b/app/Templates/board_index.php index 4b9b107c..c168d11a 100644 --- a/app/Templates/board_index.php +++ b/app/Templates/board_index.php @@ -29,5 +29,3 @@ <?php endif ?> </section> - -<?= Helper\js('assets/js/board.js') ?> diff --git a/app/Templates/board_task.php b/app/Templates/board_task.php index 89f768e0..2c82b375 100644 --- a/app/Templates/board_task.php +++ b/app/Templates/board_task.php @@ -20,13 +20,13 @@ <?php else: ?> - <a class="task-board-popover" href="?controller=task&action=edit&task_id=<?= $task['id'] ?>" title="<?= t('Edit this task') ?>">#<?= $task['id'] ?></a> - + <a class="task-edit-popover" href="?controller=task&action=edit&task_id=<?= $task['id'] ?>" title="<?= t('Edit this task') ?>">#<?= $task['id'] ?></a> - <span class="task-board-user"> <?php if (! empty($task['owner_id'])): ?> - <a class="task-board-popover" href="?controller=board&action=assign&task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>"><?= t('Assigned to %s', $task['username']) ?></a> + <a class="assignee-popover" href="?controller=board&action=assign&task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>"><?= t('Assigned to %s', $task['username']) ?></a> <?php else: ?> - <a class="task-board-popover" href="?controller=board&action=assign&task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>" class="task-board-nobody"><?= t('Nobody assigned') ?></a> + <a class="assignee-popover" href="?controller=board&action=assign&task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>" class="task-board-nobody"><?= t('Nobody assigned') ?></a> <?php endif ?> </span> diff --git a/app/Templates/file_show.php b/app/Templates/file_show.php index 674861dd..b570de2d 100644 --- a/app/Templates/file_show.php +++ b/app/Templates/file_show.php @@ -8,7 +8,7 @@ <a href="?controller=file&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a> <span class="task-show-file-actions"> <?php if ($file['is_image']): ?> - <a href="?controller=file&action=open&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>, + <a href="?controller=file&action=open&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="file-popover"><?= t('open') ?></a>, <?php endif ?> <a href="?controller=file&action=confirm&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a> </span> diff --git a/app/Templates/layout.php b/app/Templates/layout.php index 22440bb7..2b66c685 100644 --- a/app/Templates/layout.php +++ b/app/Templates/layout.php @@ -10,6 +10,7 @@ <?= Helper\js('assets/js/jquery-ui-1.10.4.custom.min.js') ?> <?= Helper\js('assets/js/jquery.ui.touch-punch.min.js') ?> <?= Helper\js('assets/js/chosen.jquery.min.js') ?> + <?= Helper\js('assets/js/app.js') ?> <?= Helper\css('assets/css/app.css') ?> <?= Helper\css('assets/css/font-awesome.min.css') ?> diff --git a/app/Templates/task_edit.php b/app/Templates/task_edit.php index 07c3539b..0f1ec6f7 100644 --- a/app/Templates/task_edit.php +++ b/app/Templates/task_edit.php @@ -1,11 +1,11 @@ <section id="main"> <div class="page-header"> <h2><?= t('Edit a task') ?></h2> -<?php if (!$ajax): ?> + <?php if (! $ajax): ?> <ul> <li><a href="?controller=board&action=show&project_id=<?= $task['project_id'] ?>"><?= t('Back to the board') ?></a></li> </ul> -<?php endif ?> + <?php endif ?> </div> <section> <form method="post" action="?controller=task&action=update&task_id=<?= $task['id'] ?>&ajax=<?= $ajax ?>" autocomplete="off"> @@ -50,14 +50,12 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> -<?php if ($ajax): ?> - <a href="?controller=board&action=show&project_id=<?= $task['project_id'] ?>"><?= t('cancel') ?></a> -<?php else: ?> - <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> -<?php endif ?> + <?php if ($ajax): ?> + <a href="?controller=board&action=show&project_id=<?= $task['project_id'] ?>"><?= t('cancel') ?></a> + <?php else: ?> + <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> + <?php endif ?> </div> </form> </section> </section> - -<?= Helper\js('assets/js/task.js'); ?> diff --git a/app/Templates/task_layout.php b/app/Templates/task_layout.php index cc711b78..9a6bbd00 100644 --- a/app/Templates/task_layout.php +++ b/app/Templates/task_layout.php @@ -13,6 +13,4 @@ <?= $task_content_for_layout ?> </div> </section> -</section> - -<?= Helper\js('assets/js/task.js') ?> +</section>
\ No newline at end of file diff --git a/app/Templates/task_new.php b/app/Templates/task_new.php index 392330ae..5e4e3ee6 100644 --- a/app/Templates/task_new.php +++ b/app/Templates/task_new.php @@ -49,6 +49,4 @@ </div> </form> </section> -</section> - -<?= Helper\js('assets/js/task.js'); ?> +</section>
\ No newline at end of file |