diff --git a/.gitignore b/.gitignore index 496ee2c..e63f4fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.DS_Store +/nbproject/private/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b557da3 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# jQuery Desktop by [Nathan Smith](https://github.com/nathansmith) + +## Some related links: +* [Online demo by code author](http://desktop.sonspring.com/) +* [Making the jQuery Desktop](http://sonspring.com/journal/jquery-desktop) +* [Leopard Desktop with jQDock](http://code.tutsplus.com/tutorials/leopard-desktop-with-jquery-using-jqdock--net-860) + +## What's changed by me: +* [DatePicker](https://gist.github.com/liketaurus/de02c6c197f0a93108a0) is shown when clicked on clock at right top corner +* [Current temperature](https://gist.github.com/liketaurus/c52b6b0dc574b8b46a24) in top bar + * detailed [weather forecast](https://gist.github.com/liketaurus/48e7746c470232bdb70b) opens in separate modal dialog when user clicks on a temperature +* draggable [analog clock desktop widget](https://gist.github.com/liketaurus/a0d8d630736961fc628a) + diff --git a/assets/js/jquery.desktop.js b/assets/js/jquery.desktop.js old mode 100755 new mode 100644 index 2d73cdd..3750f7f --- a/assets/js/jquery.desktop.js +++ b/assets/js/jquery.desktop.js @@ -20,6 +20,28 @@ var JQD = (function($, window, document, undefined) { // clock: function() { var clock = $('#clock'); + + var weather = $('#weather'); + var city = "Kyiv"; + var country = "Ukraine"; + var temp; + + $.ajax({ + type: "GET", + url: "http://www.webservicex.net//globalweather.asmx/GetWeather?CityName=" + city + "&CountryName=" + country + "", + dataType: "xml", + success: function (xml) { + + var t= new String (new XMLSerializer().serializeToString(xml.documentElement)); + var begin =t.indexOf('F ('); + var end =t.indexOf('C)'); + t = t.substring(begin+3,end); + + weather.html(' , '+t+'°C' ); + + } + }); + if (!clock.length) { return; diff --git a/index.html b/index.html old mode 100755 new mode 100644 index e20ad80..5333f0d --- a/index.html +++ b/index.html @@ -4,6 +4,10 @@ + + + +