From f944f509fcbd3e6fcf317505f9609271f9e9020f Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Mon, 27 Aug 2012 21:46:02 +1000 Subject: [PATCH] Added copyright notice and animation for Ajax --- anim.svg | 65 +++++++++++++++++++++++++++++++++++++++++++++++ icon-progress.svg | 21 +++++++++++++++ icon.svg | 21 +++++++++++++++ main.js | 48 ++++++++++++++++++++++++++-------- pgb.css | 35 +++++++++++++++++++++++++ qrcode.js | 1 + 6 files changed, 181 insertions(+), 10 deletions(-) create mode 100644 anim.svg diff --git a/anim.svg b/anim.svg new file mode 100644 index 0000000..8bad87a --- /dev/null +++ b/anim.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icon-progress.svg b/icon-progress.svg index c39ad40..9b50716 100644 --- a/icon-progress.svg +++ b/icon-progress.svg @@ -1,3 +1,24 @@ + diff --git a/main.js b/main.js index 851d474..83e82d9 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. + * + * 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. + * + */ + /*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ /*global define, $, brackets, window */ @@ -68,13 +91,15 @@ define(function (require, exports, module) { console.log(path2); var $panel = $('
\ -
\ -
PhoneGap Build
\ -
\ - ×\ -
\ -
\ -
'); +
\ +
PhoneGap Build
\ +
\ + ×\ +
\ +
\ +
 
\ + '), + anim = $("#pgb-anim", $panel); $(".content").append($panel); $(".close", $panel).click(eve.f("pgb.panel.close")); var $tableContainer = $(".table-container", $panel), @@ -96,9 +121,12 @@ define(function (require, exports, module) { }); } eve.on("pgb.status", function () { - button[0].className = eve.nt().split(/[\.\/]/)[2]; + var type = eve.nt().split(/[\.\/]/)[2]; + button[0].className = type; + anim[type == "progress" ? "show" : "hide" ](); }); eve.on("pgb.login", function (login, password) { + eve("pgb.anim"); ajax("token", "login", "post", login, password); }); eve.on("pgb.list", function () { @@ -151,7 +179,7 @@ define(function (require, exports, module) { eve.on("pgb.success.list", function (json) { console.warn(json); // eve("pgb.projectinfo", null, json.apps[0].id); - var html = '
'; + var html = '
'; for (var i = 0; i < json.apps.length; i++) { var app = json.apps[i]; html += format('\n', app); } - html += "
icon{title}\ @@ -163,7 +191,7 @@ define(function (require, exports, module) { \ {description}
"; + html += ""; $tableContainer.html(html); $tableContainer.click(eve.f("pgb.click.qr")); }); diff --git a/pgb.css b/pgb.css index 6705a5c..00808c5 100644 --- a/pgb.css +++ b/pgb.css @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. + * + * 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. + * + */ + #pgb-btn:link { opacity: .5; } @@ -106,4 +129,16 @@ #pgb-panel td { white-space: nowrap; text-overflow: ellipsis; +} +#pgb-panel { + position: relative; +} +#pgb-anim { + background: rgba(0, 0, 0, .75) url("anim.svg") no-repeat 50% 50%; + display: none; + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; } \ No newline at end of file diff --git a/qrcode.js b/qrcode.js index 9c1a4e7..e351f18 100644 --- a/qrcode.js +++ b/qrcode.js @@ -465,6 +465,7 @@ var qrcode = function() { } ); }; + // Brackets plugins addon: export as SVG Path. _this.createSVGPath = function (cellSize) { cellSize = cellSize || 2;