From bde353650554d7a81abe9f69d842b9330d062760 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 25 Nov 2011 10:06:17 -0500 Subject: [PATCH] initial commit, add all the things --- .gitignore | 5 + Gemfile | 4 + README.md | 12 + Rakefile | 74 + lib/vendor-all-the-javascripts.rb | 11 + lib/vendor-all-the-javascripts/version.rb | 9 + vendor-all-the-javascripts.gemspec | 28 + vendor/assets/javascripts/ajaxfileupload.js | 201 +++ .../javascripts/jquery-ui-timepicker-addon.js | 1276 +++++++++++++++++ .../javascripts/jquery.better-autocomplete.js | 863 +++++++++++ vendor/assets/javascripts/jquery.cookie.js | 41 + vendor/assets/javascripts/jquery.elastic.js | 162 +++ vendor/assets/javascripts/jquery.viewport.js | 220 +++ vendor/assets/javascripts/moment.js | 525 +++++++ .../stylesheets/better-autocomplete.css | 84 ++ 15 files changed, 3515 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 README.md create mode 100644 Rakefile create mode 100644 lib/vendor-all-the-javascripts.rb create mode 100644 lib/vendor-all-the-javascripts/version.rb create mode 100644 vendor-all-the-javascripts.gemspec create mode 100644 vendor/assets/javascripts/ajaxfileupload.js create mode 100644 vendor/assets/javascripts/jquery-ui-timepicker-addon.js create mode 100644 vendor/assets/javascripts/jquery.better-autocomplete.js create mode 100644 vendor/assets/javascripts/jquery.cookie.js create mode 100644 vendor/assets/javascripts/jquery.elastic.js create mode 100644 vendor/assets/javascripts/jquery.viewport.js create mode 100644 vendor/assets/javascripts/moment.js create mode 100644 vendor/assets/stylesheets/better-autocomplete.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b355420 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.gem +.bundle +Gemfile.lock +pkg/* +tmp/* diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9f39008 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source "http://rubygems.org" + +# Specify your gem's dependencies in vendor-all-the-javascripts.gemspec +gemspec diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ca5b42 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +Everything that I use JavaScript-wise goes in here, so I can pull it in to all my apps with ease. + +Every other project is owned by the original owner, I'm just aggregating for my own convenience. + +* [jquery.cookie.js](https://github.com/carhartl/jquery-cookie) +* [jquery.elastic.js](http://unwrongest.com/projects/elastic/) +* [jquery.viewport.js](https://github.com/borbit/jquery.viewport) +* [Better-Autocomplete](https://github.com/betamos/Better-Autocomplete) +* [Moment.js](https://github.com/timrwood/moment) +* [Ajax File Upload](http://phpletter.com/Our-Projects/AjaxFileUpload/) +* [jQuery UI Timepicker Addon](http://trentrichardson.com/examples/timepicker/) + diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..80e1467 --- /dev/null +++ b/Rakefile @@ -0,0 +1,74 @@ +require "bundler/gem_tasks" +require 'httparty' +require 'zip/zip' + +def process_zip_url(url, &block) + mkdir_p 'tmp' + + response = HTTParty.get(url) + File.open(target = 'tmp/elastic.zip', 'wb') { |fh| fh.print response.body } + + Zip::ZipFile.foreach(target, &block) +end + +sources = { + 'jquery.cookie' => [ + 'https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js' + ], + 'jquery-elastic' => lambda { + process_zip_url('http://jquery-elastic.googlecode.com/files/jquery.elastic-1.6.11.zip') do |entry| + if entry.name['jquery.elastic.source.js'] + entry.extract('vendor/assets/javascripts/jquery.elastic.js') { true } + end + end + }, + 'jquery-viewport' => [ + 'https://raw.github.com/borbit/jquery.viewport/master/jquery.viewport.js' + ], + 'better-autocomplete' => [ + 'https://raw.github.com/betamos/Better-Autocomplete/develop/src/jquery.better-autocomplete.js', + 'https://raw.github.com/betamos/Better-Autocomplete/develop/src/better-autocomplete.css' + ], + 'moment' => [ + 'https://raw.github.com/timrwood/moment/master/moment.js' + ], + 'ajaxfileuploader' => lambda { + process_zip_url('http://phpletter.com/download_project_version.php?version_id=34') do |entry| + if entry.name['ajaxfileupload.js'] + entry.extract('vendor/assets/javascripts/ajaxfileupload.js') { true } + end + end + }, + 'jquery-ui-timepicker' => [ + 'http://trentrichardson.com/examples/timepicker/js/jquery-ui-timepicker-addon.js' + ] +} + +desc 'Update verything' +task :update do + sources.each do |name, files| + case files + when Array + files.each do |url| + puts "Retrieving #{url} for #{name}..." + response = HTTParty.get(url, :format => 'application/octet-stream') + + case File.extname(url) + when '.js' + target = Pathname('vendor/assets/javascripts') + when '.css' + target = Pathname('vendor/assets/stylesheets') + end + + target.mkpath + target.join(File.basename(url)).open('wb') { |fh| fh.print response.body } + end + when Proc + puts "Executing code for #{name}..." + files.call + end + end +end + +task :default => :update + diff --git a/lib/vendor-all-the-javascripts.rb b/lib/vendor-all-the-javascripts.rb new file mode 100644 index 0000000..bfb05a1 --- /dev/null +++ b/lib/vendor-all-the-javascripts.rb @@ -0,0 +1,11 @@ +require "vendor-all-the-javascripts/version" + +module Vendor + module All + module The + module Javascripts + # Your code goes here... + end + end + end +end diff --git a/lib/vendor-all-the-javascripts/version.rb b/lib/vendor-all-the-javascripts/version.rb new file mode 100644 index 0000000..b19bffc --- /dev/null +++ b/lib/vendor-all-the-javascripts/version.rb @@ -0,0 +1,9 @@ +module Vendor + module All + module The + module Javascripts + VERSION = "0.0.1" + end + end + end +end diff --git a/vendor-all-the-javascripts.gemspec b/vendor-all-the-javascripts.gemspec new file mode 100644 index 0000000..6a701b2 --- /dev/null +++ b/vendor-all-the-javascripts.gemspec @@ -0,0 +1,28 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "vendor-all-the-javascripts/version" + +Gem::Specification.new do |s| + s.name = "vendor-all-the-javascripts" + s.version = Vendor::All::The::Javascripts::VERSION + s.authors = ["John Bintz"] + s.email = ["john@coswellproductions.com"] + s.homepage = "" + s.summary = %q{TODO: Write a gem summary} + s.description = %q{TODO: Write a gem description} + + s.rubyforge_project = "vendor-all-the-javascripts" + + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + s.require_paths = ["lib"] + + # specify any dependencies here; for example: + # s.add_development_dependency "rspec" + # s.add_runtime_dependency "rest-client" + # + s.add_development_dependency 'httparty' + s.add_development_dependency 'rake' + s.add_development_dependency 'rubyzip' +end diff --git a/vendor/assets/javascripts/ajaxfileupload.js b/vendor/assets/javascripts/ajaxfileupload.js new file mode 100644 index 0000000..e72fad3 --- /dev/null +++ b/vendor/assets/javascripts/ajaxfileupload.js @@ -0,0 +1,201 @@ + +jQuery.extend({ + + + createUploadIframe: function(id, uri) + { + //create frame + var frameId = 'jUploadFrame' + id; + var iframeHtml = '