Permalink
Browse files

added "Sites" in www/index.html

  • Loading branch information...
1 parent 40a6a10 commit 62fda181408b309102be7a46f846683987c47f5a @tekezo committed May 28, 2011
Showing with 43 additions and 2 deletions.
  1. +1 −1 cli/sites.php
  2. +1 −1 lib/ImageLnk.php
  3. +10 −0 www/index.html
  4. +18 −0 www/js/jquery-1.6.1.min.js
  5. +13 −0 www/js/sites.js
View
@@ -5,7 +5,7 @@
class ImageLnkCLI_sites {
public function control() {
foreach (ImageLnk::getSites() as $s) {
- print $s['name'] . "\n";
+ print $s . "\n";
}
}
}
View
@@ -37,7 +37,7 @@ public static function getSites() {
$sites = array();
foreach (ImageLnkEngine::getEngines() as $classname) {
if ($classname::sitename) {
- $sites[] = array('name' => $classname::sitename);
+ $sites[] = $classname::sitename;
}
}
sort($sites);
View
@@ -23,5 +23,15 @@
<input type="submit" value="Get image information" style="font-size: 26px" />
</div>
</form>
+
+ <div style="width: 100%; border-top: 1px solid gray; margin-top: 80px;">
+ Sites
+
+ <div style="width: 50%; height: 200px; overflow: auto; border: 1px solid gray; margin: 10px auto; font-size: 20px" id="sites">
+ </div>
+ </div>
+
+ <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
+ <script type="text/javascript" src="js/sites.js"></script>
</body>
</html>
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,13 @@
+// -*- Mode: js2; indent-tabs-mode: nil; -*-
+
+jQuery(function() {
+ jQuery.getJSON('api/sites', function(data) {
+ var sites = [];
+ var length = data['sites'].length;
+ for (var i = 0; i < length; ++i) {
+ jQuery('<div/>', {
+ html: data['sites'][i]
+ }).appendTo('#sites');
+ }
+ });
+ });

0 comments on commit 62fda18

Please sign in to comment.