]> git.mxchange.org Git - friendica.git/commitdiff
post preview
authorfriendica <info@friendica.com>
Tue, 10 Jan 2012 04:03:00 +0000 (20:03 -0800)
committerfriendica <info@friendica.com>
Tue, 10 Jan 2012 04:03:00 +0000 (20:03 -0800)
include/conversation.php
js/main.js
mod/item.php
view/theme/duepuntozero/jot.tpl
view/theme/duepuntozero/search_item.tpl
view/theme/duepuntozero/style.css
view/theme/duepuntozero/wall_item.tpl
view/theme/duepuntozero/wallwall_item.tpl

index 4a53060e3bdcad5706714e6365b74af985264f10..293c5a84a39d1be96aa6ca5bd8cadebd19dd2656 100644 (file)
@@ -136,6 +136,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
        $profile_owner = 0;
        $page_writeable      = false;
 
+       $previewing = (($preview) ? ' preview ' : '');
+
        if($mode === 'network') {
                $profile_owner = local_user();
                $page_writeable = true;
@@ -261,7 +263,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                $body = prepare_body($item,true);
                                
                                $tmp_item = replace_macros($tpl,array(
-                                       '$id' => $item['item_id'],
+                                       '$id' => (($preview) ? 'P0' : $item['item_id']),
                                        '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
                                        '$profile_url' => $profile_link,
                                        '$item_photo_menu' => item_photo_menu($item),
@@ -288,6 +290,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                        '$dislike' => '',
                                        '$comment' => '',
                                        '$conv' => (($preview) ? '' : array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
+                                       '$previewing' => $previewing,
                                        '$wait' => t('Please wait'),
                                ));
 
@@ -624,6 +627,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                        '$like' => $like,
                                        '$dislike' => $dislike,
                                        '$comment' => $comment,
+                                       '$previewing' => $previewing,
                                        '$wait' => t('Please wait'),
 
                                ));
@@ -890,6 +894,7 @@ function status_editor($a,$x, $notes_cid = 0) {
                        '$acl' => $x['acl'],
                        '$bang' => $x['bang'],
                        '$profile_uid' => $x['profile_uid'],
+                       '$preview' => t('Preview'),
                ));
 
        return $o;
index be6b5dbae90825be0e9063fefc7ac67da2c73852..a156dbadd157a001838bcdfcceed8123f1db0da4 100644 (file)
                                if(data.preview) {
                                                
                                        $("#comment-edit-preview-" + id).html(data.preview);
-                                       $("#comment-edit-preview-" + id + " a").removeAttr('href');
+                                       $("#comment-edit-preview-" + id + " a").click(function() { return false; });
                                }
                        },
                        "json"  
                        function(data) {
                                if(data.preview) {                      
                                        $("#jot-preview-content").html(data.preview);
-                                       $("#jot-preview-content" + " a").removeAttr('href');
+                                       $("#jot-preview-content" + " a").click(function() { return false; });
                                }
                        },
                        "json"  
                );  
-               $("#jot-preview").val("1");
+               $("#jot-preview").val("0");
                return true;  
        }
 
index a5fb81263f1837863a55971abd0cb051e5fbdce9..93becdee4cad0270dc41c8de9490a89422988536 100644 (file)
@@ -201,6 +201,8 @@ function item_post(&$a) {
 
 
                if(! strlen($body)) {
+                       if($preview)
+                               killme();
                        info( t('Empty post discarded.') . EOL );
                        if(x($_POST,'return')) 
                                goaway($a->get_baseurl() . "/" . $return_path );
@@ -590,6 +592,7 @@ function item_post(&$a) {
        if($preview) {
                require_once('include/conversation.php');
                $o = conversation(&$a,array(array_merge($contact_record,$datarray)),'search',false,true);
+               logger('preview: ' . $o);
                echo json_encode(array('preview' => $o));
                killme();
        }
index 3ef902c63fb940ab914d474d4c8900c99bb64fbb..1a3cc92e7ebaf5071bacfa711dd2e11037854d25 100644 (file)
@@ -68,8 +68,8 @@
                </div>
        </div>
 
-       <!--span onclick="preview_post();" id="jot-preview-link" class="fakelink">$preview</span>
-       <div id="jot-preview-content" style="display:none;"></div-->
+       <span onclick="preview_post();" id="jot-preview-link" class="fakelink">$preview</span>
+       <div id="jot-preview-content" style="display:none;"></div>
 
 </div>
 
index b4a1c82cbf24ea21bbb5a6fab01b76125a99015f..f046e41ecf2881095a81dbb78e474661798f1f45 100644 (file)
@@ -1,4 +1,4 @@
-<div class="wall-item-outside-wrapper$indent" id="wall-item-outside-wrapper-$id" >
+<div class="wall-item-outside-wrapper$indent$previewing" id="wall-item-outside-wrapper-$id" >
        <div class="wall-item-content-wrapper$indent" id="wall-item-content-wrapper-$id" >
                <div class="wall-item-info" id="wall-item-info-$id">
                        <div class="wall-item-photo-wrapper" id="wall-item-photo-wrapper-$id" 
index 0251dae08a67c172255a482a11c623ac1455ee80..e84c500b746cec9c45abb53077b2168e6b27f28d 100644 (file)
@@ -247,6 +247,10 @@ div.wall-item-content-wrapper.shiny {
   background-repeat:no-repeat;
 }
 
+.preview {
+       background: #FFFFC8;
+}
+
 /* from default */
 #jot-perms-icon, 
 #profile-location,
index 62f33ddee4381cec1344783ce7b1335880cae846..5d54a1d6a58663b3ea2b914e308d391e9ff0aa7d 100644 (file)
@@ -1,4 +1,4 @@
-<div class="wall-item-outside-wrapper$indent" id="wall-item-outside-wrapper-$id" >
+<div class="wall-item-outside-wrapper$indent$previewing" id="wall-item-outside-wrapper-$id" >
        <div class="wall-item-content-wrapper$indent" id="wall-item-content-wrapper-$id" >
                <div class="wall-item-info" id="wall-item-info-$id">
                        <div class="wall-item-photo-wrapper" id="wall-item-photo-wrapper-$id" 
index 050abb02d511a6d5a082725e76187fb8333a1b8d..3ccd1224b21804d3832ea1fc17c863ab237f8755 100644 (file)
@@ -1,4 +1,4 @@
-<div class="wall-item-outside-wrapper$indent wallwall" id="wall-item-outside-wrapper-$id" >
+<div class="wall-item-outside-wrapper$indent$previewing wallwall" id="wall-item-outside-wrapper-$id" >
        <div class="wall-item-content-wrapper$indent" id="wall-item-content-wrapper-$id" >
                <div class="wall-item-info wallwall" id="wall-item-info-$id">
                        <div class="wall-item-photo-wrapper wwto" id="wall-item-ownerphoto-wrapper-$id" >