Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 55d9c512cf844c5c909aab4f89a97676acb183de @tjfontaine committed Nov 27, 2010
Showing with 168 additions and 0 deletions.
  1. +19 −0 LICENSE
  2. +7 −0 background.html
  3. BIN box1.gif
  4. BIN draggable.png
  5. +68 −0 manager.html
  6. +18 −0 manifest.json
  7. +40 −0 options.html
  8. +16 −0 popup.html
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Timothy J Fontaine
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ </head>
+ <body>
+ </body>
+</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="jquery-datalink/jquery.js"></script>
+ <script src="jquery-datalink/jquery.datalink.js"></script>
+ <script src="jquery-tmpl/jquery.tmpl.js"></script>
+ <script src="jquery-tmpl/jquery.tmplPlus.js"></script>
+ <script src="jquery.json.js"></script>
+ <script src="linode-javascript/linode.api.js"></script>
+ <script src="linode-javascript/linode.cache.js"></script>
+ <script src="linode-javascript/linode.datalink.js"></script>
+ <style>
+ #results li {
+ display: inline;
+ list-style-type: none;
+ padding-right: 20px;
+ }
+ </style>
+ <script type="text/x-jquery-tmpl" id="tmpl_linode_list">
+ <form id="linode-${LINODEID}">
+ <ul style=>
+ <li>Label <input type="text" name="LABEL" value="${LABEL}" size=25 /></li>
+ <li>Status <input type="text" name="STATUS" value="${STATUS}" disabled="disabled" size=10 /></li>
+ <li>Ram <input type="text" name="TOTALRAM" value="${TOTALRAM}" disabled="disabled" size=5 /></li>
+ <li>HD <input type="text" name="TOTALHD" value="${TOTALHD}" disabled="disabled" size=5 /></li>
+ <li>BW <input type="text" name="TOTALXFER" value="${TOTALXFER}" disabled="disabled" size=5 /></li>
+ <li>Datacenter <input type="text" name="DATACENTERID" value="${DATACENTERID.LOCATION}" disabled="disabled" /></li>
+ <li>Backups <input type="checkbox" name="BACKUPSENABLED" {{if BACKUPSENABLED}}checked="true"{{/if}} disabled="disabled" /></li>
+ <li>Lassie <input type="checkbox" name="WATCHDOG" {{if WATCHDOG}}checked="true"{{/if}} disabled="disabled" /></li>
+ </ul>
+ </form>
+ </script>
+ <script type="text/x-jquery-tmpl" id="tmpl_domain_list">
+ </script>
+ <script type="text/javascript">
+ $(function()
+ {
+ var cache = null;
+ var keys = localStorage["api_keys"].split(',')
+ var apis = []
+ $.each(keys, function(i, key)
+ {
+ if(key && key.length > 1)
+ {
+ apis.push(new LinodeApi(key))
+ }
+ })
+ cache = new Cache(apis);
+ function start()
+ {
+ var linodes = cache.getAll('LINODEID');
+ $('#tmpl_linode_list').tmpl(linodes).appendTo('#results')
+ $.each(linodes, function(i, l)
+ {
+ var elm = $('#linode-'+l.LINODEID)
+ elm.link(l, LINODE_OBJ_CONVERSION[l.key])
+ })
+ }
+ cache.fill(start)
+ });
+
+ </script>
+ </head>
+ <body>
+ <div id="results">
+ </div>
+ </body>
+</html>
@@ -0,0 +1,18 @@
+{
+ "name": "Linode Multiple Accounts",
+ "version": "0.0.1",
+ "description": "Manage Multiple Linode Accounts",
+ "permissions": [
+ "http://*.linode.com/*",
+ "https://*.linode.com/*",
+ "http://linode.com/*",
+ "https://linode.com/*"
+ ],
+ "background_page" : "background.html",
+ "browser_action": {
+ "default_icon": "box1.gif",
+ "default_title": "Linode",
+ "default_popup": "popup.html"
+ },
+ "options_page": "options.html"
+}
@@ -0,0 +1,40 @@
+<html>
+<head><title>Linode</title></head>
+<script src="jquery-datalink/jquery.js"></script>
+<script type="text/javascript">
+
+// Saves options to localStorage.
+function save_options() {
+ var keys = []
+ $('.api_key').each(function(i, v) {
+ keys.push($(v).val())
+ })
+
+ localStorage["api_keys"] = keys
+}
+
+// Restores select box state to saved value from localStorage.
+function restore_options() {
+ var k = localStorage["api_keys"];
+ if (!k) {
+ return;
+ }
+ k = k.split(',')
+ $.each(k, function(i, key) {
+ $('#api_keys_'+i).val(key)
+ })
+}
+
+</script>
+
+<body onload="restore_options()">
+
+API Keys<br/>
+<input type="text" id="api_keys_0" class="api_key"/><br/>
+<input type="text" id="api_keys_1" class="api_key"/><br/>
+<input type="text" id="api_keys_2" class="api_key"/><br/>
+<input type="text" id="api_keys_3" class="api_key"/><br/>
+<input type="text" id="api_keys_4" class="api_key"/><br/>
+<button onclick="save_options()">Save</button>
+</body>
+</html>
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="jquery-datalink/jquery.js"></script>
+ <script type="text/javascript">
+ $(function(){
+ $('#manager').click(function(){
+ chrome.tabs.create({url:'manager.html'})
+ })
+ });
+ </script>
+ </head>
+ <body>
+ <a href="#" id="manager">Manager</a>
+ </body>
+</html>

0 comments on commit 55d9c51

Please sign in to comment.