dynamic title input box - via fabrixxm

This commit is contained in:
friendica 2012-01-04 18:03:09 -08:00
parent b0c3dc00b9
commit 47edaf9ad7
14 changed files with 102 additions and 40 deletions

View File

@ -812,7 +812,8 @@ function status_editor($a,$x, $notes_cid = 0) {
'$audurl' => t("Please enter an audio link/URL:"), '$audurl' => t("Please enter an audio link/URL:"),
'$term' => t('Tag term:'), '$term' => t('Tag term:'),
'$whereareu' => t('Where are you right now?'), '$whereareu' => t('Where are you right now?'),
'$title' => t('Enter a title for this item') '$title' => t('Enter a title for this item'),
'$addtitle' => t('click here to add a title')
)); ));
@ -880,6 +881,8 @@ function status_editor($a,$x, $notes_cid = 0) {
'$acl' => $x['acl'], '$acl' => $x['acl'],
'$bang' => $x['bang'], '$bang' => $x['bang'],
'$profile_uid' => $x['profile_uid'], '$profile_uid' => $x['profile_uid'],
'$addtitle' => t('click here to add a title')
)); ));
return $o; return $o;

View File

@ -7,7 +7,6 @@ function ping_init(&$a) {
header("Content-type: text/xml"); header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<result>"; <result>";
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
if(local_user()){ if(local_user()){
@ -18,11 +17,10 @@ function ping_init(&$a) {
$dislikes = array(); $dislikes = array();
$friends = array(); $friends = array();
$posts = array(); $posts = array();
$cit = array();
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`,
`item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `item`.`body`, `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`,
`pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`
FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND
@ -31,8 +29,6 @@ function ping_init(&$a) {
intval(local_user()) intval(local_user())
); );
$network = count($r); $network = count($r);
foreach ($r as $it) { foreach ($r as $it) {
switch($it['verb']){ switch($it['verb']){
@ -53,11 +49,8 @@ function ping_init(&$a) {
$friends[] = $it; $friends[] = $it;
break; break;
default: default:
$reg = "|@\[url=".$a->get_baseurl()."/profile/".$a->user['nickname']."|";
if ($it['parent']!=$it['id']) { if ($it['parent']!=$it['id']) {
$comments[] = $it; $comments[] = $it;
} else if(preg_match( $reg, $it['body'])){
$cit[] = $it;
} else { } else {
$posts[] = $it; $posts[] = $it;
} }
@ -93,9 +86,6 @@ function ping_init(&$a) {
break; break;
default: default:
if ($it['parent']!=$it['id']) $comments[] = $it; if ($it['parent']!=$it['id']) $comments[] = $it;
if(preg_match("/@\[[^]]*\]".$a->user['username']."/", $it['body'])){
$cit[] = $it;
}
} }
} }
@ -128,9 +118,9 @@ function ping_init(&$a) {
); );
$mail = $mails[0]['total']; $mail = $mails[0]['total'];
if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()) { if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){
$regs = q("select register.created, contact.name, contact.url, contact.micro from register left join contact on register.uid = contact.uid where contact.self = 1"); $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1");
$register = count($regs); $register = $regs[0]['total'];
} else { } else {
$register = "0"; $register = "0";
} }
@ -150,12 +140,12 @@ function ping_init(&$a) {
<home>$home</home>"; <home>$home</home>";
if ($register!=0) echo "<register>$register</register>"; if ($register!=0) echo "<register>$register</register>";
$tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags)+count($cit); $tot = $mail+$intro+$register+count($comments)+count($likes)+count($dislikes)+count($friends)+count($posts)+count($tags);
echo ' <notif count="'.$tot.'">'; echo ' <notif count="'.$tot.'">';
if ($intro>0){ if ($intro>0){
foreach ($intros as $i) { foreach ($intros as $i) {
echo xmlize( $a->get_baseurl().'/notifications/intros/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") ); echo xmlize( $a->get_baseurl().'/notifications/'.$i['id'], $i['name'], $i['url'], $i['photo'], relative_date($i['datetime']), t("{0} wants to be your friend") );
}; };
} }
if ($mail>0){ if ($mail>0){
@ -191,7 +181,7 @@ function ping_init(&$a) {
} }
if (count($posts)){ if (count($posts)){
foreach ($posts as $i) { foreach ($posts as $i) {
echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} posted") ); echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} posted") ) );
}; };
} }
if (count($tags)){ if (count($tags)){
@ -199,11 +189,6 @@ function ping_init(&$a) {
echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) ); echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), sprintf( t("{0} tagged %s's post with #%s"), $i['pname'], $i['tname'] ) );
}; };
} }
if (count($cit)){
foreach ($cit as $i) {
echo xmlize( $a->get_baseurl().'/display/'.$a->user['nickname']."/".$i['parent'], $i['author-name'], $i['author-link'], $i['author-avatar'], relative_date($i['created']), t("{0} mentioned you in a post") );
};
}
echo " </notif>"; echo " </notif>";
} }

View File

@ -7,7 +7,7 @@ var textlen = 0;
function initEditor(cb){ function initEditor(cb){
if (editor==false){ if (editor==false){
$("#profile-jot-text-loading").show(); $("#profile-jot-text-loading").show();
// $("#jot-title").show(); $("#jot-title-desc").show();
tinyMCE.init({ tinyMCE.init({
theme : "advanced", theme : "advanced",
mode : "specific_textareas", mode : "specific_textareas",
@ -111,7 +111,11 @@ function initEditor(cb){
$(this).val(""); $(this).val("");
initEditor(); initEditor();
}); });
$("#jot-title-desc").click(function() {
$("#jot-title-desc").hide();
$("#jot-title").show();
});
var uploader = new window.AjaxUpload( var uploader = new window.AjaxUpload(
'wall-image-upload', 'wall-image-upload',

View File

@ -14,6 +14,7 @@
<input type="hidden" name="coord" id="jot-coord" value="" /> <input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="post_id" value="$post_id" /> <input type="hidden" name="post_id" value="$post_id" />
<div id="jot-title-wrapper"> <div id="jot-title-wrapper">
<span id="jot-title-desc" style="display: none;">$addtitle</span>
<input type="text" name="title" id="jot-title" value="" style="display: none;" /> <input type="text" name="title" id="jot-title" value="" style="display: none;" />
</div> </div>
@ -46,9 +47,6 @@
<div id="profile-nolocation-wrapper" style="display: none;" > <div id="profile-nolocation-wrapper" style="display: none;" >
<a id="profile-nolocation" class="icon noglobe" title="$noloc" onclick="jotClearLocation();return false;"></a> <a id="profile-nolocation" class="icon noglobe" title="$noloc" onclick="jotClearLocation();return false;"></a>
</div> </div>
<div id="profile-title-wrapper" style="display: $visitor;" >
<a id="profile-title" class="icon article" title="$title" onclick="jotTitle();return false;"></a>
</div>
<div id="profile-jot-plugin-wrapper"> <div id="profile-jot-plugin-wrapper">
$jotplugins $jotplugins

View File

@ -8,6 +8,7 @@ var textlen = 0;
function initEditor(cb) { function initEditor(cb) {
if (editor==false) { if (editor==false) {
$("#profile-jot-text-loading").show(); $("#profile-jot-text-loading").show();
$("#jot-title-desc").show();
tinyMCE.init({ tinyMCE.init({
theme : "advanced", theme : "advanced",
mode : "specific_textareas", mode : "specific_textareas",
@ -100,6 +101,12 @@ function initEditor(cb) {
$(this).val(""); $(this).val("");
initEditor(); initEditor();
}); });
$("#jot-title-desc").click(function() {
$("#jot-title-desc").hide();
$("#jot-title").show();
});
var uploader = new window.AjaxUpload( var uploader = new window.AjaxUpload(
'wall-image-upload', 'wall-image-upload',
{ action: 'wall_upload/$nickname', { action: 'wall_upload/$nickname',

View File

@ -14,8 +14,11 @@
<input type="hidden" name="return" value="$return_path" /> <input type="hidden" name="return" value="$return_path" />
<input type="hidden" name="location" id="jot-location" value="$defloc" /> <input type="hidden" name="location" id="jot-location" value="$defloc" />
<input type="hidden" name="coord" id="jot-coord" value="" /> <input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="title" id="jot-title" value="" />
<input type="hidden" name="post_id" value="$post_id" /> <input type="hidden" name="post_id" value="$post_id" />
<div id="jot-title-wrapper">
<span id="jot-title-desc" style="display: none;">$addtitle</span>
<input type="text" name="title" id="jot-title" value="" style="display: none;" />
</div>
<img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea>
@ -49,9 +52,6 @@
<div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;" > <div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;" >
<a id="profile-nolocation" class="icon border noglobe" title="$noloc" onclick="jotClearLocation(); return false;"></a> <a id="profile-nolocation" class="icon border noglobe" title="$noloc" onclick="jotClearLocation(); return false;"></a>
</div> </div>
<div id="profile-title-wrapper" class="jot-tool" style="display: none;" >
<a id="profile-title" class="icon border article" title="$title" onclick="jotTitle(); return false;"></a>
</div>
<div id="profile-jot-plugin-wrapper" style="display: none;"> <div id="profile-jot-plugin-wrapper" style="display: none;">
$jotplugins $jotplugins

View File

@ -342,6 +342,19 @@ aside #viewcontacts { text-align: right;}
#acl-deny-text-end { clear: both; } #acl-deny-text-end { clear: both; }
#jot-title-desc {
color: #cccccc;
}
#jot-title-wrapper {
margin-bottom: 5px;
}
#jot-title {
border: 1px solid #cccccc;
width: 530px;
}
/** /**
* section * section

View File

@ -269,6 +269,19 @@ div.wall-item-content-wrapper.shiny {
float: left; float: left;
} }
#jot-title-desc {
color: #cccccc;
}
#jot-title-wrapper {
margin-bottom: 5px;
}
#jot-title {
border: 1px solid #cccccc;
width: 530px;
}
.fakelink, .fakelink:visited, .fakelink:link { .fakelink, .fakelink:visited, .fakelink:link {
color: #3465a4; color: #3465a4;
text-decoration: none; text-decoration: none;

View File

@ -131,6 +131,20 @@ blockquote:before {
float: left; float: left;
} }
#jot-title-desc {
color: #cccccc;
}
#jot-title-wrapper {
margin-bottom: 5px;
}
#jot-title {
border: 1px solid #cccccc;
width: 530px;
}
.fakelink, .fakelink:visited { .fakelink, .fakelink:visited {
color: #15607B; color: #15607B;
text-decoration: none; text-decoration: none;

View File

@ -12,8 +12,11 @@
<input type="hidden" name="return" value="$return_path" /> <input type="hidden" name="return" value="$return_path" />
<input type="hidden" name="location" id="jot-location" value="$defloc" /> <input type="hidden" name="location" id="jot-location" value="$defloc" />
<input type="hidden" name="coord" id="jot-coord" value="" /> <input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="title" id="jot-title" value="" />
<input type="hidden" name="post_id" value="$post_id" /> <input type="hidden" name="post_id" value="$post_id" />
<div id="jot-title-wrapper">
<span id="jot-title-desc" style="display: none;">$addtitle</span>
<input type="text" name="title" id="jot-title" value="" style="display: none;" />
</div>
<img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea>
@ -43,9 +46,6 @@
<div id="profile-nolocation-wrapper" style="display: none;" > <div id="profile-nolocation-wrapper" style="display: none;" >
<a id="profile-nolocation" class="noglobe" title="$noloc" onclick="jotClearLocation();return false;">no location</a> <a id="profile-nolocation" class="noglobe" title="$noloc" onclick="jotClearLocation();return false;">no location</a>
</div> </div>
<div id="profile-title-wrapper" style="display: $visitor;" >
<a id="profile-title" class="article" title="$title" onclick="jotTitle();return false;">title</a>
</div>
<div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" > <div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" >
<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="$lockstate" title="$permset" >permissions</a>$bang <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="$lockstate" title="$permset" >permissions</a>$bang
</div> </div>

View File

@ -528,6 +528,8 @@ section {
#about-jot-submit-wrapper { #about-jot-submit-wrapper {
margin-top: 15px; margin-top: 15px;
} }
/** buttons **/ /** buttons **/
/*input[type="submit"] { /*input[type="submit"] {
border: 0px; border: 0px;

View File

@ -8,6 +8,7 @@ var textlen = 0;
function initEditor(cb) { function initEditor(cb) {
if (editor==false) { if (editor==false) {
$("#profile-jot-text-loading").show(); $("#profile-jot-text-loading").show();
$("#jot-title-desc").show();
tinyMCE.init({ tinyMCE.init({
theme : "advanced", theme : "advanced",
mode : "specific_textareas", mode : "specific_textareas",
@ -122,6 +123,13 @@ function initEditor(cb) {
$(this).val(""); $(this).val("");
initEditor(); initEditor();
}); });
$("#jot-title-desc").click(function() {
$("#jot-title-desc").hide();
$("#jot-title").show();
});
var uploader = new window.AjaxUpload( var uploader = new window.AjaxUpload(
'wall-image-upload', 'wall-image-upload',
{ action: 'wall_upload/$nickname', { action: 'wall_upload/$nickname',

View File

@ -14,9 +14,13 @@
<input type="hidden" name="return" value="$return_path" /> <input type="hidden" name="return" value="$return_path" />
<input type="hidden" name="location" id="jot-location" value="$defloc" /> <input type="hidden" name="location" id="jot-location" value="$defloc" />
<input type="hidden" name="coord" id="jot-coord" value="" /> <input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="title" id="jot-title" value="" />
<input type="hidden" name="post_id" value="$post_id" /> <input type="hidden" name="post_id" value="$post_id" />
<div id="jot-title-wrapper">
<span id="jot-title-desc" style="display: none;">$addtitle</span>
<input type="text" name="title" id="jot-title" value="" style="display: none;" />
</div>
<img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea>
{{ if $content }}<script>initEditor();</script>{{ endif }} {{ if $content }}<script>initEditor();</script>{{ endif }}
@ -42,9 +46,6 @@
<div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;" > <div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;" >
<a id="profile-nolocation" class="icon border noglobe" title="$noloc" onclick="jotClearLocation(); return false;"></a> <a id="profile-nolocation" class="icon border noglobe" title="$noloc" onclick="jotClearLocation(); return false;"></a>
</div> </div>
<div id="profile-title-wrapper" class="jot-tool" style="display: none;" >
<a id="profile-title" class="icon border article" title="$title" onclick="jotTitle(); return false;"></a>
</div>
<div id="profile-jot-submit-wrapper" style="display:none;padding-left: 400px;"> <div id="profile-jot-submit-wrapper" style="display:none;padding-left: 400px;">
<input type="submit" id="profile-jot-submit" name="submit" value="$share" /> <input type="submit" id="profile-jot-submit" name="submit" value="$share" />

View File

@ -744,6 +744,20 @@ ul .sidebar-group-li .icon{
#profile-jot-submit-wrapper { #profile-jot-submit-wrapper {
} }
#jot-title-desc {
color: #cccccc;
}
#jot-title-wrapper {
margin-bottom: 5px;
}
#jot-title {
border: 1px solid #cccccc;
width: 460px;
}
#profile-jot-perms, #profile-jot-submit { #profile-jot-perms, #profile-jot-submit {
width: 60px; width: 60px;
font-size: 12px; font-size: 12px;