aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Article_edit.php1
-rw-r--r--Zotlabs/Module/Card_edit.php1
-rw-r--r--Zotlabs/Module/Editblock.php1
-rw-r--r--Zotlabs/Module/Editlayout.php1
-rw-r--r--Zotlabs/Module/Editpost.php1
-rw-r--r--Zotlabs/Module/Editwebpage.php1
-rw-r--r--Zotlabs/Module/Rpost.php1
-rwxr-xr-xview/tpl/edpost_head.tpl7
-rwxr-xr-xview/tpl/jot-header.tpl10
9 files changed, 21 insertions, 3 deletions
diff --git a/Zotlabs/Module/Article_edit.php b/Zotlabs/Module/Article_edit.php
index 758c1db2e..89abccc40 100644
--- a/Zotlabs/Module/Article_edit.php
+++ b/Zotlabs/Module/Article_edit.php
@@ -128,6 +128,7 @@ class Article_edit extends \Zotlabs\Web\Controller {
'$title' => t('Edit Article'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
+ '$cancel' => t('Cancel'),
'$editor' => $editor
));
diff --git a/Zotlabs/Module/Card_edit.php b/Zotlabs/Module/Card_edit.php
index 7cc563fd2..694bdc4ea 100644
--- a/Zotlabs/Module/Card_edit.php
+++ b/Zotlabs/Module/Card_edit.php
@@ -128,6 +128,7 @@ class Card_edit extends \Zotlabs\Web\Controller {
'$title' => t('Edit Card'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
+ '$cancel' => t('Cancel'),
'$editor' => $editor
));
diff --git a/Zotlabs/Module/Editblock.php b/Zotlabs/Module/Editblock.php
index 8a7e87a09..563ad9ca2 100644
--- a/Zotlabs/Module/Editblock.php
+++ b/Zotlabs/Module/Editblock.php
@@ -138,6 +138,7 @@ class Editblock extends \Zotlabs\Web\Controller {
'$title' => t('Edit Block'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
+ '$cancel' => t('Cancel'),
'$editor' => $editor
));
diff --git a/Zotlabs/Module/Editlayout.php b/Zotlabs/Module/Editlayout.php
index 3d6a79507..67e0bcd32 100644
--- a/Zotlabs/Module/Editlayout.php
+++ b/Zotlabs/Module/Editlayout.php
@@ -137,6 +137,7 @@ class Editlayout extends \Zotlabs\Web\Controller {
'$title' => t('Edit Layout'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
+ '$cancel' => t('Cancel'),
'$editor' => $editor
));
diff --git a/Zotlabs/Module/Editpost.php b/Zotlabs/Module/Editpost.php
index 57a4cb97f..45d8e7644 100644
--- a/Zotlabs/Module/Editpost.php
+++ b/Zotlabs/Module/Editpost.php
@@ -106,6 +106,7 @@ class Editpost extends \Zotlabs\Web\Controller {
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post'),
+ '$cancel' => t('Cancel'),
'$editor' => $editor
));
diff --git a/Zotlabs/Module/Editwebpage.php b/Zotlabs/Module/Editwebpage.php
index da536a729..b67421cd5 100644
--- a/Zotlabs/Module/Editwebpage.php
+++ b/Zotlabs/Module/Editwebpage.php
@@ -166,6 +166,7 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'$title' => t('Edit Webpage'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$editor' => $editor,
+ '$cancel' => t('Cancel'),
'$id' => $itm[0]['id']
));
diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php
index f0c4a06b9..86ee296ec 100644
--- a/Zotlabs/Module/Rpost.php
+++ b/Zotlabs/Module/Rpost.php
@@ -142,6 +142,7 @@ class Rpost extends \Zotlabs\Web\Controller {
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post'),
+ '$cancel' => '',
'$editor' => $editor
));
diff --git a/view/tpl/edpost_head.tpl b/view/tpl/edpost_head.tpl
index b2ab5db4e..4f39137ab 100755
--- a/view/tpl/edpost_head.tpl
+++ b/view/tpl/edpost_head.tpl
@@ -1,10 +1,13 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
- {{if $delete}}
<div class="pull-right">
+ {{if $cancel}}
+ <button id="dbtn-cancel" class="btn btn-warning btn-sm" onclick="itemCancel(); return false;">{{$cancel}}</button>
+ {{/if}}
+ {{if $delete}}
<a href="item/drop/{{$id}}" id="delete-btn" class="btn btn-sm btn-danger" onclick="return confirmDelete();"><i class="fa fa-trash-o"></i>&nbsp;{{$delete}}</a>
+ {{/if}}
</div>
- {{/if}}
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index df67e9b2d..f2b68ece0 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -357,6 +357,14 @@ var activeCommentText = '';
}
}
+ function itemCancel() {
+ $("#jot-title").val('');
+ $("#profile-jot-text").val('');
+ $("#jot-category").val('');
+ postSaveChanges('clean','');
+ window.history.back();
+ }
+
function itemFiler(id) {
if($('#item-filer-dialog').length)
$('#item-filer-dialog').remove();
@@ -575,7 +583,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del
localStorage.setItem("post_title" + postid, $("#jot-title").val());
localStorage.setItem("post_body" + postid, $("#profile-jot-text").val());
if($("#jot-category").length)
- localStorage.setItem("post_category + postid", $("#jot-category").val());
+ localStorage.setItem("post_category" + postid, $("#jot-category").val());
}
if(action == 'start') {