Permalink
Browse files

MINOR Added history.js dependency

  • Loading branch information...
1 parent 8378a9d commit a5f841764de94d768990f4776c905ecfe8daf201 @chillu chillu committed May 20, 2011
Showing with 27,308 additions and 0 deletions.
  1. +8 −0 admin/thirdparty/history-js/.piston.yml
  2. +311 −0 admin/thirdparty/history-js/README.md
  3. +351 −0 admin/thirdparty/history-js/cli
  4. +58 −0 admin/thirdparty/history-js/demo/bcherry-orig.html
  5. +62 −0 admin/thirdparty/history-js/demo/bcherry.html
  6. +37 −0 admin/thirdparty/history-js/demo/chrome.html
  7. +101 −0 admin/thirdparty/history-js/demo/index.html
  8. +43 −0 admin/thirdparty/history-js/demo/native-auto.html
  9. +62 −0 admin/thirdparty/history-js/demo/native.html
  10. +23 −0 admin/thirdparty/history-js/demo/navigator.html
  11. +61 −0 admin/thirdparty/history-js/demo/safari.html
  12. +10 −0 admin/thirdparty/history-js/license.txt
  13. +74 −0 admin/thirdparty/history-js/package.json
  14. +1 −0 admin/thirdparty/history-js/scripts/compressed/amplify.store.js
  15. 0 admin/thirdparty/history-js/scripts/compressed/history.adapter.dojo.js
  16. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.adapter.jquery.js
  17. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.adapter.mootools.js
  18. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.adapter.prototype.js
  19. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.adapter.yui.js
  20. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.adapter.zepto.js
  21. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.html4.js
  22. +1 −0 admin/thirdparty/history-js/scripts/compressed/history.js
  23. +1 −0 admin/thirdparty/history-js/scripts/compressed/json2.js
  24. +247 −0 admin/thirdparty/history-js/scripts/uncompressed/amplify.store.js
  25. +1 −0 admin/thirdparty/history-js/scripts/uncompressed/history.adapter.dojo.js
  26. +58 −0 admin/thirdparty/history-js/scripts/uncompressed/history.adapter.jquery.js
  27. +66 −0 admin/thirdparty/history-js/scripts/uncompressed/history.adapter.mootools.js
  28. +197 −0 admin/thirdparty/history-js/scripts/uncompressed/history.adapter.prototype.js
  29. +64 −0 admin/thirdparty/history-js/scripts/uncompressed/history.adapter.yui.js
  30. +58 −0 admin/thirdparty/history-js/scripts/uncompressed/history.adapter.zepto.js
  31. +606 −0 admin/thirdparty/history-js/scripts/uncompressed/history.html4.js
  32. +1,867 −0 admin/thirdparty/history-js/scripts/uncompressed/history.js
  33. +480 −0 admin/thirdparty/history-js/scripts/uncompressed/json2.js
  34. +28 −0 admin/thirdparty/history-js/tests.src/_header.php
  35. +59 −0 admin/thirdparty/history-js/tests.src/all.php
  36. +62 −0 admin/thirdparty/history-js/tests.src/each.php
  37. +25 −0 admin/thirdparty/history-js/tests.src/index.php
  38. +13 −0 admin/thirdparty/history-js/tests/.htaccess
  39. +47 −0 admin/thirdparty/history-js/tests/compressed-html4-nonpersistant-jquery.html
  40. +47 −0 admin/thirdparty/history-js/tests/compressed-html4-nonpersistant-mootools.html
  41. +47 −0 admin/thirdparty/history-js/tests/compressed-html4-nonpersistant-prototype.html
  42. +47 −0 admin/thirdparty/history-js/tests/compressed-html4-nonpersistant-zepto.html
  43. +48 −0 admin/thirdparty/history-js/tests/compressed-html4-persistant-jquery.html
  44. +48 −0 admin/thirdparty/history-js/tests/compressed-html4-persistant-mootools.html
  45. +48 −0 admin/thirdparty/history-js/tests/compressed-html4-persistant-prototype.html
  46. +48 −0 admin/thirdparty/history-js/tests/compressed-html4-persistant-zepto.html
  47. +46 −0 admin/thirdparty/history-js/tests/compressed-html5-nonpersistant-jquery.html
  48. +46 −0 admin/thirdparty/history-js/tests/compressed-html5-nonpersistant-mootools.html
  49. +46 −0 admin/thirdparty/history-js/tests/compressed-html5-nonpersistant-prototype.html
  50. +46 −0 admin/thirdparty/history-js/tests/compressed-html5-nonpersistant-zepto.html
  51. +47 −0 admin/thirdparty/history-js/tests/compressed-html5-persistant-jquery.html
  52. +47 −0 admin/thirdparty/history-js/tests/compressed-html5-persistant-mootools.html
  53. +47 −0 admin/thirdparty/history-js/tests/compressed-html5-persistant-prototype.html
  54. +47 −0 admin/thirdparty/history-js/tests/compressed-html5-persistant-zepto.html
  55. +3 −0 admin/thirdparty/history-js/tests/image.php
  56. +28 −0 admin/thirdparty/history-js/tests/index.html
  57. +254 −0 admin/thirdparty/history-js/tests/tests.js
  58. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html4-nonpersistant-jquery.html
  59. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html4-nonpersistant-mootools.html
  60. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html4-nonpersistant-prototype.html
  61. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html4-nonpersistant-zepto.html
  62. +48 −0 admin/thirdparty/history-js/tests/uncompressed-html4-persistant-jquery.html
  63. +48 −0 admin/thirdparty/history-js/tests/uncompressed-html4-persistant-mootools.html
  64. +48 −0 admin/thirdparty/history-js/tests/uncompressed-html4-persistant-prototype.html
  65. +48 −0 admin/thirdparty/history-js/tests/uncompressed-html4-persistant-zepto.html
  66. +46 −0 admin/thirdparty/history-js/tests/uncompressed-html5-nonpersistant-jquery.html
  67. +46 −0 admin/thirdparty/history-js/tests/uncompressed-html5-nonpersistant-mootools.html
  68. +46 −0 admin/thirdparty/history-js/tests/uncompressed-html5-nonpersistant-prototype.html
  69. +46 −0 admin/thirdparty/history-js/tests/uncompressed-html5-nonpersistant-zepto.html
  70. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html5-persistant-jquery.html
  71. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html5-persistant-mootools.html
  72. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html5-persistant-prototype.html
  73. +47 −0 admin/thirdparty/history-js/tests/uncompressed-html5-persistant-zepto.html
  74. +8,316 −0 admin/thirdparty/history-js/vendor/jquery.js
  75. +5,491 −0 admin/thirdparty/history-js/vendor/mootools.js
  76. +6,082 −0 admin/thirdparty/history-js/vendor/prototype.js
  77. +13 −0 admin/thirdparty/history-js/vendor/yui.js
  78. +576 −0 admin/thirdparty/history-js/vendor/zepto.js
@@ -0,0 +1,8 @@
+---
+format: 1
+handler:
+ commit: 861b4b1f7240b9d5e50d560ba5b94de78aa439e5
+ branch: master
+lock: false
+repository_class: Piston::Git::Repository
+repository_url: https://github.com/balupton/history.js.git
Oops, something went wrong.
@@ -0,0 +1,351 @@
+#!/usr/bin/env ruby
+
+# == Name
+# cli - BalCMS Command Line Interface
+#
+# == Synopsis
+# cli check-env
+# cli birth
+# cli init-commit
+# cli init-new
+# cli init-existing
+# cli configure
+# cli install
+# cli permissions
+# cli setup
+# cli cron
+#
+# cli add
+# cli stable
+# cli master
+# cli upgrade
+# cli update
+# cli deploy
+#
+# cli clean
+# cli clean-media
+# cli clean-config
+# cli clean-styles
+# cli clean-scripts
+#
+# cli [options]
+#
+# == Examples
+# cli check-env
+# Checks to see that our environment is properly configured and will support a BalCMS installation.
+#
+# cli birth
+# Executes: init-new, configure, install, init-commit
+#
+# cli init-commit
+# Performs the initial commit (commits new and modified files during the installation to the git repo).
+#
+# cli init-new
+# Initialises the repository as a new installation. Only run this once.
+#
+# TODO: finish this example section
+#
+# == Options
+# -h, --help Displays help message
+# -v, --version Display the version, then exit
+# -q, --quiet Output as little as possible, overrides verbose
+# -V, --verbose Verbose output
+#
+# == Author
+# Benjamin Arthur Lupton
+#
+# == Copyright
+# Copyright (c) 2008-2011 Benjamin Arthur Lupton
+# Licensed under the New BSD License
+# http://creativecommons.org/licenses/BSD/
+
+require 'optparse'
+require 'rdoc/usage'
+require 'ostruct'
+require 'date'
+
+class App
+ SOURCEMAP = './scripts/closure.map'
+ BUILDDIR = './.build'
+ UGLIFYURL = 'https://github.com/mishoo/UglifyJS/raw/master/bin/uglifyjs'
+ UGLIFYDIR = './.build/uglify'
+ UGLIFYFILE = './.build/uglify/uglify'
+ CLOSUREURL = 'http://closure-compiler.googlecode.com/files/compiler-latest.zip'
+ CLOSUREDIR = './.build/closure'
+ CLOSUREZIP = './.build/closure/compiler.zip'
+ CLOSUREFILE = './.build/closure/compiler.jar'
+ YUIURL = 'http://yuilibrary.com/downloads/yuicompressor/yuicompressor-2.4.2.zip'
+ YUIDIR = './.build/yui'
+ YUIZIP = './.build/yui/compiler.zip'
+ YUIFILE = './.build/yui/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar'
+
+ def initialize
+ init_env
+ end
+
+ def init_env
+ # Check for Requirements
+ reqs = ['mkdir','curl','tar','git']
+ reqs.each do |req|
+ has_req = `which #{req}`.strip
+ if has_req.empty?
+ abort("CLI requires the following binary which is not installed: #{req}")
+ end
+ end
+
+ # Check for Closure Compiler
+ if !File.exists?(CLOSUREFILE)
+ `mkdir -p #{CLOSUREDIR}`
+ puts "Downloading the Closure Compiler..."
+ download(CLOSUREURL, CLOSUREZIP)
+ extract(CLOSUREDIR, CLOSUREZIP)
+ `chmod +x #{CLOSUREFILE}`
+ end
+
+ # Check for Uglify
+ if !File.exists?(UGLIFYFILE)
+ `mkdir -p #{UGLIFYDIR}`
+ puts "Downloading the Uglify Compiler..."
+ download(UGLIFYURL, UGLIFYFILE)
+ `chmod +x #{UGLIFYFILE}`
+ end
+
+ # Check for YUI Compiler
+ if !File.exists?(YUIFILE)
+ `mkdir -p #{YUIDIR}`
+ puts "Downloading the YUI Compiler..."
+ download(YUIURL, (YUIZIP))
+ extract(YUIDIR, YUIZIP)
+ `chmod +x #{YUIFILE}`
+ end
+ end
+
+ def has_changes
+ result = `git status`
+ if result.include? 'Changed but not updated'
+ abort("You have un-committed changes that need to be committed before we can proceed.\n#{result}")
+ end
+ end
+
+ # ===========================================================================
+ # Helpers
+
+ def download ( url, file )
+ result = `curl -L #{url} -o #{file}`
+ end
+
+ def extract ( dir, file )
+ file = file.gsub(dir,'.')
+ result = `cd #{dir} ; tar -xf #{file} ; rm -Rf #{file}`
+ end
+
+ def compressJavascriptFile ( in_file, out_file )
+ # Calculate
+ in_file_size = File.size(in_file)
+
+ # Handle
+ if in_file.equal? out_file
+ out_file = out_file.gsub(/\.js$/, '.min.js')
+ compressFileUglify(in_file,out_file)
+ `rm #{in_file}`
+ `mv #{out_file} #{in_file}`
+ out_file = in_file
+ else
+ compressFileUglify(in_file,out_file)
+ out_file_size = File.size(out_file)
+ end
+
+ # Calculate
+ out_file_size = File.size(out_file)
+ ratio = Float(out_file_size)/Float(in_file_size)
+ reduction = ((1-ratio)*100).round
+
+ # Log
+ puts "Compressed the file [#{in_file}] to [#{out_file}] with a #{reduction}% reduction"
+ end
+
+ def compressFileUglify ( in_file, out_file )
+ result = `#{UGLIFYFILE} -o #{out_file} #{in_file}`
+ end
+
+ def compressFileClosure ( in_file, out_file )
+ result = `java -jar #{CLOSUREFILE} --js_output_file=#{out_file} --js=#{in_file}`
+ end
+
+ # ===========================================================================
+ # Installers
+
+ def build
+
+ end
+
+ # ===========================================================================
+ # Git Helpers
+
+ def add
+ puts \
+ ` git add -u;`
+ end
+
+ def stable
+ puts \
+ ` git checkout #{BRANCH_STABLE};`
+ end
+
+ def dev
+ puts \
+ ` git checkout #{BRANCH_DEV};`
+ end
+
+ def master
+ puts \
+ ` git checkout master;`
+ end
+
+ def upgrade
+ puts \
+ ` git checkout #{BRANCH_BALCMS};
+ git pull balcms #{BRANCH_STABLE};
+ git checkout #{BRANCH_DEV};
+ git merge #{BRANCH_BALCMS};`
+ end
+
+ def update
+ puts \
+ ` git pull;`
+ configure
+ end
+
+ def deploy
+ puts \
+ ` git checkout #{BRANCH_STABLE};
+ git merge #{BRANCH_DEV};
+ git checkout #{BRANCH_MASTER};
+ git merge #{BRANCH_STABLE};
+ git checkout #{BRANCH_DEV};
+ git push origin --all;`
+ end
+
+end
+
+# ===========================================================================
+# Booter
+
+class Booter
+ VERSION = :'0.0.1'
+
+ attr_reader :options
+
+ def initialize(arguments, stdin)
+ @arguments = arguments
+ @stdin = stdin
+
+ # Set defaults
+ @options = OpenStruct.new
+ @options.verbose = false
+ @options.quiet = false
+ # TO DO - add additional defaults
+ end
+
+ # Parse options, check arguments, then process the command
+ def run
+
+ if parsed_options? && arguments_valid?
+
+ puts "Start at #{DateTime.now}\n\n" if @options.verbose
+
+ output_options if @options.verbose # [Optional]
+
+ process_arguments
+ process_command
+
+ puts "\nFinished at #{DateTime.now}" if @options.verbose
+
+ else
+ output_usage
+ end
+
+ end
+
+ protected
+
+ def parsed_options?
+
+ # Specify options
+ opts = OptionParser.new
+ opts.on('-v', '--version') { output_version ; exit 0 }
+ opts.on('-h', '--help') { output_help }
+ opts.on('-V', '--verbose') { @options.verbose = true }
+ opts.on('-q', '--quiet') { @options.quiet = true }
+ # TO DO - add additional options
+
+ opts.parse!(@arguments) rescue return false
+
+ process_options
+ true
+ end
+
+ # Performs post-parse processing on options
+ def process_options
+ @options.verbose = false if @options.quiet
+ end
+
+ def output_options
+ puts :"Options:\n"
+
+ @options.marshal_dump.each do |name, val|
+ puts " #{name} = #{val}"
+ end
+ end
+
+ # True if required arguments were provided
+ def arguments_valid?
+ # TO DO - implement your real logic here
+ true if @arguments.length == 1
+ end
+
+ # Setup the arguments
+ def process_arguments
+ # TO DO - place in local vars, etc
+ end
+
+ def output_help
+ output_version
+ RDoc::usage() #exits app
+ end
+
+ def output_usage
+ RDoc::usage(:'usage') # gets usage from comments above
+ end
+
+ def output_version
+ puts "#{File.basename(__FILE__)} version #{VERSION}"
+ end
+
+ def process_command
+ # Create Application
+ app = App.new
+
+ # Fetch + Execute
+ command = @arguments[0].gsub('-','_')
+ unless app.respond_to?(command)
+ abort("Unknown command: #{command}")
+ end
+ app.send(command)
+ end
+
+ def process_standard_input
+ input = @stdin.read
+ # TO DO - process input
+
+ # [Optional]
+ #@stdin.each do |line|
+ # # TO DO - process each line
+ #end
+ end
+end
+
+
+# Create Booter
+booter = Booter.new(ARGV, STDIN)
+booter.run
Oops, something went wrong.

0 comments on commit a5f8417

Please sign in to comment.