]> git.mxchange.org Git - friendica.git/commitdiff
bypass D* markdown bug for now
authorfriendica <info@friendica.com>
Tue, 10 Jan 2012 02:52:49 +0000 (18:52 -0800)
committerfriendica <info@friendica.com>
Tue, 10 Jan 2012 02:52:49 +0000 (18:52 -0800)
boot.php
include/bb2diaspora.php
js/main.js
mod/item.php
view/theme/duepuntozero/jot.tpl

index 2bbe3fd04e7a5c6cb228017b133a7ea12c7112ad..1ad3249c189753b0ab82062ee405a89ab9bac371 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '2.3.1220' );
+define ( 'FRIENDICA_VERSION',      '2.3.1221' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
 define ( 'DB_UPDATE_VERSION',      1115      );
 
index 38f5c6735d5d3429cb0a98ac20827001e7753e40..e819976a7a85ffc10a529ec6c5a347435307ff85 100644 (file)
@@ -94,8 +94,12 @@ function bb2diaspora($Text,$preserve_nl = false) {
 
        // [img]pathtoimage[/img]
 
-//     $Text = preg_replace("/\[url\=([$URLSearchString]*)\]\[img\](.*?)\[\/img\]\[\/url\]/ism", 
-//             '![' . t('image/photo') . '](' . '$2' . ')' . "\n" . '[' . t('link') . '](' . '$1' . ')', $Text);
+       // the following was added on 10-January-2012 due to an inability of Diaspora's
+       // new javascript markdown processor to handle links with images as the link "text"
+       // It is not optimal and may be removed if this ability is restored in the future
+
+       $Text = preg_replace("/\[url\=([$URLSearchString]*)\]\[img\](.*?)\[\/img\]\[\/url\]/ism", 
+               '![' . t('image/photo') . '](' . '$2' . ')' . "\n" . '[' . t('link') . '](' . '$1' . ')', $Text);
 
        $Text = preg_replace("/\[bookmark\]([$URLSearchString]*)\[\/bookmark\]/ism", '[$1]($1)', $Text);
        $Text = preg_replace("/\[bookmark\=([$URLSearchString]*)\](.*?)\[\/bookmark\]/ism", '[$2]($1)', $Text);
index 009fb55bbbf11fcff4b173fff478e4b1a8d9ef5d..be6b5dbae90825be0e9063fefc7ac67da2c73852 100644 (file)
 
 
 
+       function preview_post() {
+               $("#jot-preview").val("1");
+               $("#jot-preview-content").show();
+               tinyMCE.triggerSave();
+               $.post(  
+                       "item",  
+                       $("#profile-jot-form").serialize(),
+                       function(data) {
+                               if(data.preview) {                      
+                                       $("#jot-preview-content").html(data.preview);
+                                       $("#jot-preview-content" + " a").removeAttr('href');
+                               }
+                       },
+                       "json"  
+               );  
+               $("#jot-preview").val("1");
+               return true;  
+       }
+
 
        function unpause() {
                // unpause auto reloads if they are currently stopped
index 6b294b93e5bd1ddcd6b8c218f5c8104817be1c0c..a5fb81263f1837863a55971abd0cb051e5fbdce9 100644 (file)
@@ -38,6 +38,8 @@ function item_post(&$a) {
 
        call_hooks('post_local_start', $_POST);
 
+       logger('postvars' . print_r($_POST,true));
+
        $api_source = ((x($_POST,'api_source') && $_POST['api_source']) ? true : false);
        $return_path = ((x($_POST,'return')) ? $_POST['return'] : '');
 
index 6a105e1da4912276b7eb4f64e3e8c22e2e35541a..1a3cc92e7ebaf5071bacfa711dd2e11037854d25 100644 (file)
@@ -68,6 +68,9 @@
                </div>
        </div>
 
+       <span onclick="preview_post();" id="jot-preview-link" class="fakelink">$preview</span>
+       <div id="jot-preview-content" style="display:none;"></div>
+
 </div>
 
 <div id="profile-jot-end"></div>