aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-02 19:06:36 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-02 19:06:36 -0700
commit93d0ef4042bdfe06b77cdbe56ec4e55143e4fc1e (patch)
tree87dad282e59c5472ee878f6faf0e96630c18c3c9
parent3fd4b4264ef8c418bbf78edaa02f7e4e32f5022e (diff)
downloadvolse-hubzilla-93d0ef4042bdfe06b77cdbe56ec4e55143e4fc1e.tar.gz
volse-hubzilla-93d0ef4042bdfe06b77cdbe56ec4e55143e4fc1e.tar.bz2
volse-hubzilla-93d0ef4042bdfe06b77cdbe56ec4e55143e4fc1e.zip
fixup image on wall
-rw-r--r--include/ajaxupload.js3
-rw-r--r--include/items.php28
-rw-r--r--mod/dfrn_poll.php2
-rw-r--r--mod/wall_upload.php7
-rw-r--r--view/jot-header.tpl37
-rw-r--r--view/jot.tpl4
6 files changed, 46 insertions, 35 deletions
diff --git a/include/ajaxupload.js b/include/ajaxupload.js
index f0fbfe6c2..ef872b52f 100644
--- a/include/ajaxupload.js
+++ b/include/ajaxupload.js
@@ -4,6 +4,7 @@
* Licensed under the MIT license ( http://valums.com/mit-license/ )
* Thanks to Gary Haran, David Mark, Corey Burns and others for contributions.
*/
+
(function () {
/* global window */
/* jslint browser: true, devel: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true */
@@ -354,7 +355,7 @@
var input = document.createElement("input");
input.setAttribute('type', 'file');
input.setAttribute('name', this._settings.name);
-
+
addStyles(input, {
'position' : 'absolute',
// in Opera only 'browse' button
diff --git a/include/items.php b/include/items.php
index d160ff131..e74132c6a 100644
--- a/include/items.php
+++ b/include/items.php
@@ -34,12 +34,14 @@ function get_feed_for(&$a,$dfrn_id,$owner_id,$last_update) {
$contact = $r[0];
$groups = init_groups_visitor($contact['id']);
-
- $gs = '<<>>'; // should be impossible to match
if(count($groups)) {
- foreach($groups as $g)
- $gs .= '|<' . intval($g) . '>';
- }
+ for($x = 0; $x < count($groups); $x ++)
+ $groups[$x] = '<' . intval($groups[$x]) . '>' ;
+ $gs = implode('|', $groups);
+ }
+ else
+ $gs = '<<>>' ; // Impossible to match
+
$sql_extra = sprintf(
" AND ( `allow_cid` = '' OR `allow_cid` REGEXP '<%d>' )
AND ( `deny_cid` = '' OR NOT `deny_cid` REGEXP '<%d>' )
@@ -158,7 +160,7 @@ function get_atom_elements($item) {
if($maxlen && (strlen($res['body']) > $maxlen))
$res['body'] = substr($res['body'],0, $maxlen);
- $allow = $item->get_item_tags('http://purl.org/macgirvin/dfrn/1.0','comment-allow');
+ $allow = $item->get_item_tags(NAMESPACE_DFRN,'comment-allow');
if($allow && $allow[0]['data'] == 1)
$res['last-child'] = 1;
else
@@ -172,13 +174,13 @@ function get_atom_elements($item) {
if($rawedited)
$res['edited'] = unxmlify($rawcreated[0]['data']);
- $rawowner = $item->get_item_tags('http://purl.org/macgirvin/dfrn/1.0', 'owner');
- if($rawowner[0]['child']['http://purl.org/macgirvin/dfrn/1.0']['name'][0]['data'])
- $res['owner-name'] = unxmlify($rawowner[0]['child']['http://purl.org/macgirvin/dfrn/1.0']['name'][0]['data']);
- if($rawowner[0]['child']['http://purl.org/macgirvin/dfrn/1.0']['uri'][0]['data'])
- $res['owner-link'] = unxmlify($rawowner[0]['child']['http://purl.org/macgirvin/dfrn/1.0']['uri'][0]['data']);
- if($rawowner[0]['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data'])
- $res['owner-avatar'] = unxmlify($rawowner[0]['child']['http://purl.org/macgirvin/dfrn/1.0']['avatar'][0]['data']);
+ $rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner');
+ if($rawowner[0]['child'][NAMESPACE_DFRN]['name'][0]['data'])
+ $res['owner-name'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['name'][0]['data']);
+ if($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data'])
+ $res['owner-link'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data']);
+ if($rawowner[0]['child'][NAMESPACE_DFRN]['avatar'][0]['data'])
+ $res['owner-avatar'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['avatar'][0]['data']);
return $res;
}
diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php
index e3da6c952..dadcd3148 100644
--- a/mod/dfrn_poll.php
+++ b/mod/dfrn_poll.php
@@ -19,7 +19,7 @@ function dfrn_poll_init(&$a) {
return;
- if(($dfrn_id == '*') && ($a->argc > 1) && (intval($a->argv[1]))) {
+ if(($dfrn_id == '*') && ($a->argc > 1)) {
$o = get_feed_for($a,'*', $a->argv[1],$last_update);
echo $o;
killme();
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index d2e732545..bd7cf8560 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -9,6 +9,9 @@ function wall_upload_post(&$a) {
killme();
}
+ if(! x($_FILES,'userfile'))
+ killme();
+
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
@@ -87,8 +90,8 @@ function wall_upload_post(&$a) {
}
$basename = basename($filename);
+ echo "<br /><br /><img src=\"".$a->get_baseurl(). "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /><br /><br />";
- echo "<img src=\"".$a->get_baseurl(). "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" />";
killme();
-
+ return; // NOTREACHED
} \ No newline at end of file
diff --git a/view/jot-header.tpl b/view/jot-header.tpl
index 34837d075..fc05a40be 100644
--- a/view/jot-header.tpl
+++ b/view/jot-header.tpl
@@ -1,7 +1,6 @@
-<script language="javascript" type="text/javascript"
- src="$baseurl/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
- <script language="javascript" type="text/javascript">
+<script language="javascript" type="text/javascript" src="$baseurl/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
+<script language="javascript" type="text/javascript">
tinyMCE.init({
theme : "advanced",
@@ -18,6 +17,7 @@ tinyMCE.init({
entity_encoding : "raw",
add_unload_trigger : false,
remove_linebreaks : false,
+ convert_urls: false,
content_css: "$baseurl/view/custom_tinymce.css"
});
@@ -31,7 +31,7 @@ tinyMCE.init({
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
- tinyMCE.execCommand('mceInsertRawHTML',false,response);
+alert(response); tinyMCE.execCommand('mceInsertRawHTML',false,response);
$('#profile-rotator').hide();
}
}
@@ -39,7 +39,6 @@ tinyMCE.init({
});
-
function jotGetLink() {
reply = prompt("Please enter a link URL:");
if(reply && reply.length) {
@@ -51,18 +50,24 @@ tinyMCE.init({
}
}
+ function linkdropper(event) {
+ var linkFound = event.dataTransfer.types.contains("text/uri-list");
+ if(linkFound)
+ event.preventDefault();
+ }
-
+ function linkdrop(event) {
+ var reply = event.dataTransfer.getData("text/uri-list");
+ event.target.textContent = reply;
+ event.preventDefault();
+ if(reply && reply.length) {
+ $('#profile-rotator').show();
+ $.get('parse_url?url=' + reply, function(data) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ $('#profile-rotator').hide();
+ });
+ }
+ }
</script>
-<!--
-
- relative_urls: false,
- document_base_url : "$baseurl/",
- external_image_list_url : "$baseurl/include/imagelist-js.php",
- content_css : "$baseurl/view/tiny.css"
-
-});
-</script>
---> \ No newline at end of file
diff --git a/view/jot.tpl b/view/jot.tpl
index 24b6babcb..9e9ab6468 100644
--- a/view/jot.tpl
+++ b/view/jot.tpl
@@ -16,8 +16,8 @@ What's on your mind?
<div id="profile-upload-wrapper" style="display: $visitor;" >
<div id="wall-image-upload-div" ><img id="wall-image-upload" src="images/camera-icon.gif" alt="Upload Photo" title="Upload Photo" /></div>
</div>
- <div id="profile-link-wrapper" style="display: $visitor;" >
- <img id="profile-link" src="images/link-icon.gif" alt="Insert web link" title="Insert web link" onclick="jotGetLink();" />
+ <div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
+ <img id="profile-link" src="images/link-icon.gif" alt="Insert web link" title="Insert web link" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink();" />
</div>
<div id="profile-rotator-wrapper" style="display: $visitor;" >
<img id="profile-rotator" src="images/rotator.gif" alt="Please wait" title="Please wait" style="display: none;" />