mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 12:11:05 -05:00
Upgrade to bootstrap 2.0
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "bootstrap"]
|
||||||
|
path = bootstrap
|
||||||
|
url = https://github.com/twitter/bootstrap.git
|
||||||
@@ -34,3 +34,8 @@ I did file <https://dev.twitter.com/discussions/3414>, which later seemed to be
|
|||||||
## Shell script feedback on the Web works by disabling Apache's mod_deflate !
|
## Shell script feedback on the Web works by disabling Apache's mod_deflate !
|
||||||
|
|
||||||
<http://stackoverflow.com/a/9022823/4534>
|
<http://stackoverflow.com/a/9022823/4534>
|
||||||
|
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
Make fetch-tweets.sh return nicer output like a % for <http://twitter.github.com/bootstrap/components.html#progress>
|
||||||
|
|||||||
1
bootstrap
Submodule
1
bootstrap
Submodule
Submodule bootstrap added at 7f32d15fbb
62
bootstrap-buttons.js
vendored
62
bootstrap-buttons.js
vendored
@@ -1,62 +0,0 @@
|
|||||||
/* ============================================================
|
|
||||||
* bootstrap-buttons.js v1.4.0
|
|
||||||
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
|
||||||
* ============================================================
|
|
||||||
* Copyright 2011 Twitter, Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* ============================================================ */
|
|
||||||
|
|
||||||
!function( $ ){
|
|
||||||
|
|
||||||
"use strict"
|
|
||||||
|
|
||||||
function setState(el, state) {
|
|
||||||
var d = 'disabled'
|
|
||||||
, $el = $(el)
|
|
||||||
, data = $el.data()
|
|
||||||
|
|
||||||
state = state + 'Text'
|
|
||||||
data.resetText || $el.data('resetText', $el.html())
|
|
||||||
|
|
||||||
$el.html( data[state] || $.fn.button.defaults[state] )
|
|
||||||
|
|
||||||
state == 'loadingText' ?
|
|
||||||
$el.addClass(d).attr(d, d) :
|
|
||||||
$el.removeClass(d).removeAttr(d)
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle(el) {
|
|
||||||
$(el).toggleClass('active')
|
|
||||||
}
|
|
||||||
|
|
||||||
$.fn.button = function(options) {
|
|
||||||
return this.each(function () {
|
|
||||||
if (options == 'toggle') {
|
|
||||||
return toggle(this)
|
|
||||||
}
|
|
||||||
options && setState(this, options)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
$.fn.button.defaults = {
|
|
||||||
loadingText: 'loading...'
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$('body').delegate('.btn[data-toggle]', 'click', function () {
|
|
||||||
$(this).button('toggle')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}( window.jQuery || window.ender );
|
|
||||||
@@ -38,14 +38,14 @@ cat <<END
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Fetching tweets of $id</title>
|
<title>Fetching tweets of $id</title>
|
||||||
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
|
<link rel="stylesheet" href="/bootstrap/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
<h1 class="alert-message info">Fetching upto 3200 tweets from $id</h1>
|
<h1 class="alert alert-info">Fetching upto 3200 tweets from $id</h1>
|
||||||
|
|
||||||
<p class="help-inline">Please be patient. Closing this page prematurely you can limit the tweets <a href="https://github.com/kaihendry/Greptweet/blob/master/fetch-tweets.sh">fetch-tweets.sh</a> gets and trigger a locking bug.</p>
|
<p class="help-inline">Please be patient. Closing this page prematurely you can limit the tweets <a href="https://github.com/kaihendry/Greptweet/blob/master/fetch-tweets.sh">fetch-tweets.sh</a> gets and trigger a locking bug.</p>
|
||||||
|
|
||||||
@@ -93,12 +93,12 @@ then
|
|||||||
cd $oldpwd; ./users.sh > users.shtml
|
cd $oldpwd; ./users.sh > users.shtml
|
||||||
|
|
||||||
cat <<END
|
cat <<END
|
||||||
<a href="http://$HTTP_HOST/u/$id"><h1 class="alert-message success">Goto http://$HTTP_HOST/u/$id to grep!</h1></a>
|
<a href="http://$HTTP_HOST/u/$id"><h1 class="alert alert-success">Goto http://$HTTP_HOST/u/$id to grep!</h1></a>
|
||||||
END
|
END
|
||||||
|
|
||||||
else
|
else
|
||||||
rm -rf $oldpwd/u/$id
|
rm -rf $oldpwd/u/$id
|
||||||
echo '<h1 class="alert-message error">Sorry the Twitter API is failing. Try again later.</h1>'
|
echo '<h1 class="alert alert-error">Sorry the Twitter API is failing. Try again later.</h1>'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<END
|
cat <<END
|
||||||
|
|||||||
11
index.html
11
index.html
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Grepping twitter backup</title>
|
<title>Grepping twitter backup</title>
|
||||||
<meta content="width=device-width, initial-scale=1,maximum-scale=1.0;" name=viewport>
|
<meta content="width=device-width, initial-scale=1,maximum-scale=1.0;" name=viewport>
|
||||||
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
|
<link rel="stylesheet" href="/bootstrap/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -18,15 +18,16 @@
|
|||||||
<li id="name" class="active">You are here</li>
|
<li id="name" class="active">You are here</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<input type="search" name="q" class="xlarge" />
|
<div class="well">
|
||||||
<button class="btn primary">Greptweet</button>
|
<input type="search" class="input-medium search-query">
|
||||||
|
<button type="submit" class="btn btn-large btn-primary"><i class="icon-search"></i> Greptweet</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="results"></div>
|
<div id="results"></div>
|
||||||
|
|
||||||
|
|
||||||
<p class="help-inline">Type a search query like <a href="?foo">foo</a></p>
|
<p class="help-inline">Type a search query like <a href="?foo">foo</a></p>
|
||||||
|
|
||||||
|
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||||
<script async src="/main.js"></script>
|
<script async src="/main.js"></script>
|
||||||
|
|
||||||
|
|||||||
25
index.shtml
25
index.shtml
@@ -4,10 +4,10 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>GrepTweet</title>
|
<title>GrepTweet</title>
|
||||||
<meta content="width=device-width, initial-scale=1,maximum-scale=1.0;" name=viewport>
|
<meta content="width=device-width, initial-scale=1,maximum-scale=1.0;" name=viewport>
|
||||||
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
|
<link rel="stylesheet" href="/bootstrap/bootstrap/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css">
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||||
<script src="bootstrap-buttons.js"></script>
|
<script src="/bootstrap/js/bootstrap-button.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -20,8 +20,9 @@
|
|||||||
<h1><a href="http://twitter.com/greptweet">@Greptweet</a> <small>you can search your tweets</small></h1>
|
<h1><a href="http://twitter.com/greptweet">@Greptweet</a> <small>you can search your tweets</small></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form name="f" action="create.cgi" method="get" class="form-stacked">
|
<form name="f" action="create.cgi" method="get">
|
||||||
|
|
||||||
|
<div class="well">
|
||||||
|
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<label for="username">Twitter username</label>
|
<label for="username">Twitter username</label>
|
||||||
@@ -31,25 +32,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="clearfix">
|
<label class="checkbox">
|
||||||
<ul class="inputs-list">
|
<input type="checkbox" name="o">Fetch older tweets, instead of newer tweets when updating
|
||||||
<li>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" name="o" />
|
|
||||||
<span>Fetch older tweets, instead of newer tweets when updating</span>
|
|
||||||
</label>
|
</label>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="well">
|
|
||||||
<button class="btn large primary" id="b" data-loading-text="Fetching tweets..." onclick="submitPressed()">Fetch tweets</button>
|
<button class="btn btn-large btn-primary" id="b" data-loading-text="Fetching tweets..." onclick="submitPressed()">Fetch tweets</button>
|
||||||
<span class="help-inline">First fetch tweets to search "grep" them</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p><span class="label success">New</span> Try <a href="http://grepbook.co.uk/">Grepbook</a> for grepping Facebook.</p>
|
<p><span class="label label-success">New</span> Try <a href="http://grepbook.co.uk/">Grepbook</a> for grepping Facebook.</p>
|
||||||
|
|
||||||
<h3>Greppable tweeters</h3>
|
<h3>Greppable tweeters</h3>
|
||||||
|
|
||||||
|
|||||||
7
main.js
7
main.js
@@ -22,20 +22,21 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$("input[type=search]").change(function() {
|
$("input[type=search]").change(function() {
|
||||||
query = this.value;
|
query = this.value;
|
||||||
|
console.log(query);
|
||||||
window.location.search = query;
|
window.location.search = query;
|
||||||
grep(query);
|
grep(query);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.location.search) {
|
if (window.location.search) {
|
||||||
searchquery = window.decodeURIComponent(window.location.search.substr(1));
|
searchquery = window.decodeURIComponent(window.location.search.substr(1));
|
||||||
$("input[type=text]").val(searchquery);
|
$("input[type=search]").val(searchquery);
|
||||||
grep(searchquery);
|
grep(searchquery);
|
||||||
}
|
}
|
||||||
|
|
||||||
$("input[type=text]").focus();
|
$("input[type=text]").focus();
|
||||||
|
|
||||||
footer = '<div class="row"><div class="span4"><a href="' + NAME + '.txt">' + NAME + ' text backup file</a></div>';
|
footer = '<p><a href="' + NAME + '.txt" class="btn primary"><i class="icon-download"></i> Download</a>';
|
||||||
footer += '<div class="span4"><a href="' + "/create.cgi?id=" + NAME +'">Fetch ' + NAME + ' tweets</a></div></div>';
|
footer += '<a href="' + "/create.cgi?id=" + NAME +'" class="btn"><i class="icon-refresh"></i> Update</a></p>'
|
||||||
$("#source").html(footer);
|
$("#source").html(footer);
|
||||||
document.title = "Greptweet " + NAME;
|
document.title = "Greptweet " + NAME;
|
||||||
|
|
||||||
|
|||||||
18
style.css
18
style.css
@@ -1,19 +1 @@
|
|||||||
#users li { display: inline; }
|
#users li { display: inline; }
|
||||||
|
|
||||||
html, body {
|
|
||||||
background-color: #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* The white background content wrapper */
|
|
||||||
.content {
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20px;
|
|
||||||
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
|
|
||||||
-webkit-border-radius: 0 0 6px 6px;
|
|
||||||
-moz-border-radius: 0 0 6px 6px;
|
|
||||||
border-radius: 0 0 6px 6px;
|
|
||||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
|
||||||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
|
||||||
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user