My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
function desktop_theme_status_form($text = '', $in_reply_to_id = NULL) {
if (user_is_authenticated()) {
if ($_SERVER['HTTPS'] == "on") {
$icon = "https://si0.twimg.com/images/dev/cms/intents/bird/bird_blue/bird_16_blue.png";
}
else {
$icon = "http://a1.twimg.com/images/dev/cms/intents/bird/bird_blue/bird_16_blue.png";
}

// adding ?status=foo will automaticall add "foo" to the text area.
if ($_GET['status'])
{
$text = $_GET['status'];
}

$output = '
<form method="post" action="update">
<fieldset>
<legend><img src="'.$icon.'" width="16" height="16" /> What\'s Happening?</legend>
<textarea id="status" name="status" rows="4" style="width:95%; max-width: 400px;">'.$text.'</textarea>
<div>
<input name="in_reply_to_id" value="'.$in_reply_to_id.'" type="hidden" />
<input type="submit" value="Tweet" />
<span id="remaining">140</span>
<span id="geo" style="display: none;">
<input onclick="goGeo()" type="checkbox" id="geoloc" name="location" />
<label for="geoloc" id="lblGeo"></label>
</span>
</div>
</fieldset>
<script type="text/javascript">
started = false;
chkbox = document.getElementById("geoloc");
if (navigator.geolocation) {
geoStatus("Tweet my location");
if ("'.$_COOKIE['geo'].'"=="Y") {
chkbox.checked = true;
goGeo();
}
}
function goGeo(node) {
if (started) return;
started = true;
geoStatus("Locating...");
navigator.geolocation.getCurrentPosition(geoSuccess, geoStatus , { enableHighAccuracy: true });
}
function geoStatus(msg) {
document.getElementById("geo").style.display = "inline";
document.getElementById("lblGeo").innerHTML = msg;
}
function geoSuccess(position) {
geoStatus("Tweet my <a href=\'http://maps.google.co.uk/m?q=" + position.coords.latitude + "," + position.coords.longitude + "\' target=\'blank\'>location</a>");
chkbox.value = position.coords.latitude + "," + position.coords.longitude;
}
</script>
</form>';
$output .= js_counter('status');
return $output;
}
}

function desktop_theme_search_form($query) {
$query = stripslashes(htmlentities($query,ENT_QUOTES,"UTF-8"));

return '
<form action="search" method="get"><input name="query" value="'. $query .'" />
<input type="submit" value="Search" />
<br />
<span id="geo" style="display: none;">
<input onclick="goGeo()" type="checkbox" id="geoloc" name="location" />
<label for="geoloc" id="lblGeo"></label>
<select name="radius">
<option value="1km">1 Km</option>
<option value="5km">5 Km</option>
<option value="10km">10 Km</option>
<option value="50km">50 Km</option>
</select>
</span>
<script type="text/javascript">
started = false;
chkbox = document.getElementById("geoloc");
if (navigator.geolocation) {
geoStatus("Search near my location");
if ("'.$_COOKIE['geo'].'"=="Y") {
chkbox.checked = true;
goGeo();
}
}
function goGeo(node) {
if (started) return;
started = true;
geoStatus("Locating...");
navigator.geolocation.getCurrentPosition(geoSuccess, geoStatus , { enableHighAccuracy: true });
}
function geoStatus(msg) {
document.getElementById("geo").style.display = "inline";
document.getElementById("lblGeo").innerHTML = msg;
}
function geoSuccess(position) {
geoStatus("Search near my <a href=\'http://maps.google.co.uk/m?q=" + position.coords.latitude + "," + position.coords.longitude + "\' target=\'blank\'>location</a>");
chkbox.value = position.coords.latitude + "," + position.coords.longitude;
}
</script>
</form>';
}
?>

Change log

r459 by terence.eden on Oct 16, 2011   Diff
Big check in... Several main changes
1) Rationalised the head, body, and footer
generation - only in one location. Makes
it a lot easier to make changes. HTML5
DOCTYPE - just for fun ;-)
2) Lots of other functions rationalised
3) Added "Pretty In Pink" as a theme! Set
as the default with a message telling
people to visit the settings if they've
never been there.
4) Search now does geo-search
5) Probably some other stuff....
Go to: 
Sign in to write a code review

Older revisions

r458 by terence.eden on Oct 10, 2011   Diff
Allows you to pass information to Dabr
via get
/dabr/?status=%40edent%20is%20great
will place the text "@edent is great"
in the text box.
...
r445 by terence.eden on Sep 4, 2011   Diff
https tweaks
Places non-https images on to the
correct domain
r436 by terence.eden on Aug 31, 2011   Diff
Allow native Twitter Image Upload
This patch does three things.
1) Replaces Twitpic with the native
Twitter media upload functionality.
2) Adds the tmhOAuth library.
...
All revisions of this file

File info

Size: 3682 bytes, 107 lines
Powered by Google Project Hosting