diff --git a/addon/README b/addon/README index 2e4ed60290..fb1c6340a5 100644 --- a/addon/README +++ b/addon/README @@ -156,7 +156,8 @@ Current hooks: 'page_end' - called after HTML content functions have completed $b is (string) HTML of content div - +'jot_plugin' - add tools to jot toolbar + $b is (string) HTML for tool icon *** = subject to change diff --git a/addon/oembed/oembed.js b/addon/oembed/oembed.js new file mode 100644 index 0000000000..54547a86ec --- /dev/null +++ b/addon/oembed/oembed.js @@ -0,0 +1,10 @@ +function oembed(){ + $("#oembed").toggleClass('hide'); +} + +function oembed_do(){ + embed = "[embed]"+$('#oembed_url').attr('value')+"[/embed]"; + + tinyMCE.execCommand('mceInsertRawHTML',false,embed); + oembed(); +} diff --git a/addon/oembed/oembed.php b/addon/oembed/oembed.php new file mode 100644 index 0000000000..82183f3cce --- /dev/null +++ b/addon/oembed/oembed.php @@ -0,0 +1,101 @@ + + '; + + $b .= ' +
  + + +

Paste a link from 5min.com, Amazon Product Image, blip.tv, Clikthrough, CollegeHumor Video, + Daily Show with Jon Stewart, Dailymotion, dotSUB.com, Flickr Photos, Funny or Die Video, + Google Video, Hulu, Kinomap, LiveJournal UserPic, Metacafe, National Film Board of Canada, + Phodroid Photos, Photobucket, Qik Video, Revision3, Scribd, SlideShare, TwitPic, Twitter Status, + Viddler Video, Vimeo, Wikipedia, Wordpress.com, XKCD Comic, YFrog, YouTube

+
+ '; +} + + +function oembed_hook_jot_tool($a, &$b) { + $b .= ' +
+ Embed +
+ '; +} + +function oembed_replacecb($matches){ + $embedurl=$matches[1]; + $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl); + $txt = fetch_url($ourl); + $j = json_decode($txt); + $ret=""; + switch ($j->type) { + case "video": { + if (isset($j->thumbnail_url)) { + $tw = (isset($j->thumbnail_width)) ? $j->thumbnail_width:200; + $th = (isset($j->thumbnail_height)) ? $j->thumbnail_height:180; + $ret = ""; + $ret.= ""; + $ret.= ""; + } else { + $ret=$j->html; + } + $ret.="
"; + }; break; + case "photo": { + $ret = ""; + $ret.="
"; + }; break; + case "link": { + //$ret = "".$j->title.""; + }; break; + case "rich": { + // not so safe.. + $ret = "
".$j->html."
"; + }; break; + } + + $embedlink = (isset($j->title))?$j->title:$embedurl; + $ret .= "$embedlink"; + if (isset($j->author_name)) $ret.=" by ".$j->author_name; + if (isset($j->provider_name)) $ret.=" on ".$j->provider_name; + $ret.=""; + return $ret; +} + +function oembed_hook_bbcode($a, &$text){ + $text = preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", oembed_replacecb ,$text); +} + + +?> \ No newline at end of file diff --git a/addon/oembed/oembed.png b/addon/oembed/oembed.png new file mode 100644 index 0000000000..6fc3794bba Binary files /dev/null and b/addon/oembed/oembed.png differ diff --git a/mod/network.php b/mod/network.php index 02e458d8fb..50d7134c17 100644 --- a/mod/network.php +++ b/mod/network.php @@ -79,6 +79,9 @@ function network_content(&$a, $update = 0) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); + $jotplugins = ""; + call_hooks('jot_tool', $jotplugins); + $o .= replace_macros($tpl,array( '$return_path' => $a->cmd, '$baseurl' => $a->get_baseurl(), @@ -87,7 +90,8 @@ function network_content(&$a, $update = 0) { '$lockstate' => $lockstate, '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), '$bang' => (($group) ? '!' : ''), - '$profile_uid' => $_SESSION['uid'] + '$profile_uid' => $_SESSION['uid'], + '$jotplugins' => $jotplugins )); diff --git a/mod/profile.php b/mod/profile.php index 505edf5ced..c84b493c50 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -134,6 +134,10 @@ function profile_content(&$a, $update = 0) { $lockstate = 'lock'; else $lockstate = 'unlock'; + + $jotplugins = ""; + call_hooks('jot_tool', $jotplugins); + $o .= replace_macros($tpl,array( '$baseurl' => $a->get_baseurl(), '$defloc' => (($is_owner) ? $a->user['default-location'] : ''), @@ -142,7 +146,8 @@ function profile_content(&$a, $update = 0) { '$lockstate' => $lockstate, '$bang' => '', '$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''), - '$profile_uid' => $a->profile['profile_uid'] + '$profile_uid' => $a->profile['profile_uid'], + '$jotplugins' => $jotplugins )); } diff --git a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js index f12975ba21..ebccfb3115 100644 --- a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -53,6 +53,10 @@ rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); rep(/(.*?)<\/font>/gi,"$1"); + rep(//gi,"[img=$1x$2]$3[/img]"); + rep(//gi,"[img=$2x$1]$3[/img]"); + rep(//gi,"[img=$3x$2]$1[/img]"); + rep(//gi,"[img=$2x$3]$1[/img]"); rep(//gi,"[img]$1[/img]"); rep(/(.*?)<\/code>/gi,"[code]$1[/code]"); rep(/<\/(strong|b)>/gi,"[/b]"); @@ -96,6 +100,7 @@ rep(/\[\/u\]/gi,""); rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); rep(/\[url\](.*?)\[\/url\]/gi,"$1"); + rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,""); rep(/\[img\](.*?)\[\/img\]/gi,""); rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); // rep(/\[\/code\]\s*\[code\]/gi,"
"); // fold multiline code diff --git a/view/en/jot.tpl b/view/en/jot.tpl index 6590cace8f..de88fb84f7 100644 --- a/view/en/jot.tpl +++ b/view/en/jot.tpl @@ -15,6 +15,11 @@ +
+ $jotplugins +
+
+
diff --git a/view/fr/jot.tpl b/view/fr/jot.tpl index 6590cace8f..9a5c581531 100644 --- a/view/fr/jot.tpl +++ b/view/fr/jot.tpl @@ -15,6 +15,12 @@ +
+ $jotplugins +
+
+ +
diff --git a/view/it/jot.tpl b/view/it/jot.tpl index 5aaf9b9232..b0c90ddf5d 100644 --- a/view/it/jot.tpl +++ b/view/it/jot.tpl @@ -15,6 +15,11 @@ +
+ $jotplugins +
+
+
@@ -40,6 +45,8 @@
+ +
diff --git a/view/theme/default/style.css b/view/theme/default/style.css index fcc9c94a88..6e643d4fe2 100644 --- a/view/theme/default/style.css +++ b/view/theme/default/style.css @@ -1034,7 +1034,7 @@ input#dfrn-url { margin-left: 110px; margin-top: 10px; } - +#profile-jot-plugin-wrapper, #profile-jot-submit-wrapper { margin-top: 15px; } @@ -1078,7 +1078,9 @@ input#dfrn-url { #profile-jot-perms-end { clear: both; } - +#profile-jot-plugin-end { + clear:both; +} #profile-jot-end { clear: both; margin-bottom: 30px; @@ -2000,3 +2002,10 @@ a.mail-list-link { margin-bottom: 15px; } +.tool-wrapper { + float: left; + margin-left: 5px; +} +.tool-link { + cursor: pointer; +} diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 3351b35a17..7fbeed4fe0 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -809,6 +809,8 @@ input#dfrn-url { } .wall-item-wrapper { float: left; + margin-right: 5px; + width: 80px; } .wall-item-lock { height: 20px; @@ -851,7 +853,7 @@ input#dfrn-url { } .wall-item-content { float: left; - width: 450px; + /*width: 450px;*/ margin-left: 10px; margin-bottom: 20px; padding: 20px; @@ -905,6 +907,7 @@ input#dfrn-url { margin: 10px 0px 10px 110px; } +#profile-jot-plugin-wrapper, #profile-jot-submit-wrapper { margin-top: 15px; } @@ -950,6 +953,9 @@ input#dfrn-url { height: 30px; } +#profile-jot-plugin-end{ + clear: both; +} #profile-jot-end { /*clear: both;*/ margin-bottom: 30px; @@ -1456,8 +1462,9 @@ input#dfrn-url { margin-top: 10px; } a.mail-list-link { - display: block; - padding: 4px 5px; + display: block; + font-size: 1.3em; + padding: 4px 0; } /* @@ -1495,8 +1502,8 @@ a.mail-list-link { } .mail-conv-subject { - font-size: 1.1em; - margin-top: 10px; + font-size: 1.4em; + margin: 10px 0; } .mail-conv-outside-wrapper-end { @@ -1882,3 +1889,11 @@ a.mail-list-link { margin-bottom: 15px; } + +.tool-wrapper { + float: left; + margin-left: 5px; +} +.tool-link { + cursor: pointer; +}