From 0dc95e9151619a5b81999f74b8a7471f9611966c Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Thu, 27 Oct 2011 13:26:31 -0400 Subject: [PATCH] Remove whitespace [Gun.io WhitespaceBot] --- README | 1 - configurations/development.rb | 6 +- configurations/production.rb | 10 +- controllers/blog.rb | 8 +- controllers/calendar.rb | 8 +- controllers/default.rb | 2 +- controllers/gallery.rb | 8 +- controllers/media.rb | 6 +- controllers/payment.rb | 12 +- controllers/site_old.rb | 10 +- controllers/story.rb | 10 +- controllers/user.rb | 10 +- doc/TODO | 10 +- example_db/localhost/blog/test-blog.yml | 4 +- example_db/localhost/image/banner.yml | 4 +- example_db/localhost/site.yml | 8 +- example_db/localhost/story/banner.yml | 2 +- example_db/localhost/story/footer.yml | 2 +- example_db/localhost/story/head.yml | 2 +- example_db/localhost/story/home.yml | 4 +- example_db/localhost/story/menu.yml | 2 +- example_db/localhost/story/sidebar.yml | 2 +- example_db/localhost/story/test-story-1.yml | 2 +- example_db/localhost/story/test-story-2.yml | 6 +- example_db/localhost/theme/comments.css | 4 +- example_db/localhost/theme/site.css | 20 +-- example_db/localhost/theme/site.js | 4 +- helpers/default.rb | 24 +-- lib/gallery.rb | 22 +-- lib/image.rb | 12 +- lib/response_mixin.rb | 2 +- lib/short_url.rb | 36 ++--- lib/twitter_client.rb | 36 ++--- models/blog.rb | 18 +-- models/calendar.rb | 16 +- models/comment.rb | 16 +- models/default.rb | 6 +- models/event.rb | 32 ++-- models/gallery.rb | 22 +-- models/listing.rb | 20 +-- models/site.rb | 20 +-- models/story.rb | 36 ++--- models/user.rb | 28 ++-- public/css/.old/admin.css.old | 46 +++--- public/css/.old/editor.css.old | 2 +- public/css/admin.css | 6 +- public/css/container.css | 2 +- public/css/editor.css | 4 +- public/css/quick_add.css | 2 +- public/css/wysiwyg.css | 2 +- public/javascript/.old/admin.js.old | 24 +-- public/javascript/.old/editor.js.old | 6 +- .../.svn/text-base/core.js.svn-base | 2 +- .../.svn/text-base/enumerable.js.svn-base | 20 +-- .../.svn/text-base/firebug.html.svn-base | 2 +- .../.svn/text-base/firebug.js.svn-base | 146 +++++++++--------- .../.svn/text-base/parsing.js.svn-base | 84 +++++----- public/javascript/base.js | 6 +- public/javascript/container.js | 2 +- public/javascript/editor.js | 14 +- public/javascript/firebug/firebug.html | 2 +- public/javascript/firebug/firebug.js | 146 +++++++++--------- public/javascript/jquery.flash.js | 62 ++++---- .../jquery.ui-1.0/jquery.dimensions.js | 38 ++--- .../jquery.ui-1.0/themes/dark/dark.tree.css | 2 +- .../jquery.ui-1.0/themes/light/light.tree.css | 2 +- .../javascript/jquery.ui-1.0/ui.resizable.js | 126 +++++++-------- .../jquery.ui-1.0/ui.tablesorter.js | 6 +- public/javascript/jquery.ui-1.0/ui.tabs.js | 4 +- public/javascript/login.js | 2 +- public/javascript/quick_add.js | 2 +- public/javascript/slideshow.js | 26 ++-- .../tiny_mce/plugins/style/props.htm | 4 +- public/javascript/wysiwyg.js | 4 +- resources/blog.rb | 2 +- resources/default.rb | 4 +- resources/image.rb | 10 +- resources/map.rb | 20 +-- resources/payment.rb | 24 +-- resources/site.rb | 30 ++-- resources/social.rb | 28 ++-- resources/user.rb | 30 ++-- templates/blog/content.mab | 10 +- templates/blog/editor.mab | 20 +-- templates/blog/patch.erb | 6 +- templates/blog/quick_add.mab | 2 +- templates/blog/show.mab | 4 +- templates/calendar/content.mab | 10 +- templates/calendar/editor.mab | 18 +-- templates/calendar/quick_add.mab | 2 +- templates/calendar/show.mab | 4 +- templates/catalog/show.mab | 16 +- templates/event/editor.mab | 12 +- templates/event/quick_add.mab | 2 +- templates/form/date.mab | 6 +- templates/form/file.mab | 6 +- templates/form/text.mab | 6 +- templates/gallery/editor.mab | 27 ++-- templates/gallery/quick_add.mab | 2 +- templates/gallery/show.mab | 12 +- templates/image/list.mab | 2 +- templates/image/quick_add.mab | 6 +- templates/layouts/errors.mab | 4 +- templates/layouts/show.mab | 2 +- templates/rss/show.mab | 10 +- templates/site/admin.mab | 4 +- templates/site/editor.mab | 6 +- templates/site/login.mab | 6 +- templates/story/quick_add.mab | 2 +- templates/story/show.mab | 2 +- templates/user/editor.mab | 6 +- templates/user/login.mab | 6 +- templates/user/quick_add.mab | 2 +- templates/user/register.mab | 20 +-- templates/user/show.mab | 4 +- 115 files changed, 851 insertions(+), 853 deletions(-) diff --git a/README b/README index 6610751..01fc4d0 100644 --- a/README +++ b/README @@ -2,4 +2,3 @@ Pages expects to find FileBase datastores for each domain in a directory named " $ mkdir db $ cp -pr example_db/localhost db/ - \ No newline at end of file diff --git a/configurations/development.rb b/configurations/development.rb index 696a572..3c0f778 100644 --- a/configurations/development.rb +++ b/configurations/development.rb @@ -2,16 +2,16 @@ module Pages module Configurations class Development < Default - + reloadable [ Pages ] - + #include Waves::Cache::RackCache application.use Rack::Session::Cookie, :key => 'rack.session', # :domain => 'foo.com', :path => '/', :expire_after => 2592000, :secret => 'Change it' - + application.run Waves::Dispatchers::Default.new server Waves::Servers::Mongrel diff --git a/configurations/production.rb b/configurations/production.rb index 1313271..90b7594 100644 --- a/configurations/production.rb +++ b/configurations/production.rb @@ -2,24 +2,24 @@ module Pages module Configurations - + class Production < Default - + reloadable [] log :level => :info, :output => ( :log / 'log.out' ) host '0.0.0.0' port 2020 debug false - + include Waves::Cache::RackCache application.use Rack::Session::Cookie, :key => 'rack.session', # :domain => 'foo.com', :path => '/', :expire_after => 2592000, :secret => 'Change it' - + application.run Waves::Dispatchers::Default.new - + server Waves::Servers::Mongrel end end diff --git a/controllers/blog.rb b/controllers/blog.rb index 6b589ea..938ea8c 100644 --- a/controllers/blog.rb +++ b/controllers/blog.rb @@ -1,17 +1,17 @@ module Pages module Controllers - + class Blog < Default - + def update( name ) # Hack for supporting single story added to the blog query[model_name].entries = query[model_name].entries.to_a if query[model_name].entries super end - + end - + end end \ No newline at end of file diff --git a/controllers/calendar.rb b/controllers/calendar.rb index 0075fc5..c10dfe7 100644 --- a/controllers/calendar.rb +++ b/controllers/calendar.rb @@ -1,17 +1,17 @@ module Pages module Controllers - + class Calendar < Default - + def update( name ) # Hack for supporting single event added to the calendar query[model_name].events = query[model_name].events.to_a if query[model_name].events super end - + end - + end end \ No newline at end of file diff --git a/controllers/default.rb b/controllers/default.rb index efdfd5d..42d1dae 100644 --- a/controllers/default.rb +++ b/controllers/default.rb @@ -16,7 +16,7 @@ def update( name ) obj.save end def delete( name ) ; find( name ).delete ; end - + def assign( assigns ) assigns[ :key ] ||= assigns['title'].downcase.gsub(/\s+/,'-').gsub(/[^\w\-]/,'') assigns[ :published ] ||= Time.now diff --git a/controllers/gallery.rb b/controllers/gallery.rb index e909bc1..89c11c8 100644 --- a/controllers/gallery.rb +++ b/controllers/gallery.rb @@ -1,17 +1,17 @@ module Pages module Controllers - + class Gallery < Default - + def update( name ) # Hack for supporting single image added to the gallery query[model_name].images = query[model_name].images.to_a if query[model_name].images super end - + end - + end end \ No newline at end of file diff --git a/controllers/media.rb b/controllers/media.rb index bf5883c..a68c861 100644 --- a/controllers/media.rb +++ b/controllers/media.rb @@ -1,10 +1,10 @@ module Pages module Controllers class Media < Default - + def get( media, name ) - data = [ :public / media / name, - :db / domain / :file / name, + data = [ :public / media / name, + :db / domain / :file / name, :db / domain / :theme / name ].each do |path| return File.read( path ) if File.exist?( path ) end diff --git a/controllers/payment.rb b/controllers/payment.rb index 6e1fe13..c650253 100644 --- a/controllers/payment.rb +++ b/controllers/payment.rb @@ -1,19 +1,19 @@ module Pages module Controllers - + class Payment < Default - + def store( transaction ) model.create( transaction ) end - + def notification( transaction ) model.find( transaction['key'] ).assign( info ).save end - + end - + end - + end \ No newline at end of file diff --git a/controllers/site_old.rb b/controllers/site_old.rb index e32af13..09944ba 100644 --- a/controllers/site_old.rb +++ b/controllers/site_old.rb @@ -1,11 +1,11 @@ # module Pages # module Controllers # class Site < Default -# -# -# +# +# +# # end -# +# # end -# +# # end diff --git a/controllers/story.rb b/controllers/story.rb index f7b6ab4..669e470 100644 --- a/controllers/story.rb +++ b/controllers/story.rb @@ -1,13 +1,13 @@ module Pages module Controllers - + class Story < Default - - - + + + end - + end end diff --git a/controllers/user.rb b/controllers/user.rb index 253da5c..3b8ba8b 100644 --- a/controllers/user.rb +++ b/controllers/user.rb @@ -1,18 +1,18 @@ module Pages module Controllers class User < Default - + def assign( assigns ) assigns[ :key ] ||= assigns['email'].downcase.gsub(/\s+/,'-').gsub(/[^\w\-]/,'-') assigns[ :date_joined ] ||= Time.now assigns end - + def authenticate email_key = attributes[ :email ].gsub(/\s+/,'-').gsub(/[^\w\-]/,'-') user = find( email_key ) auth = false - if(user && ( user['email'] == attributes[:email] ) && + if(user && ( user['email'] == attributes[:email] ) && ( user['password'] == attributes[:password] )) auth = true end @@ -26,12 +26,12 @@ def authenticate # redirect(paths.login) end end - + def logout session.clear redirect('/') end - + end end end diff --git a/doc/TODO b/doc/TODO index 4cee8f5..c457d71 100644 --- a/doc/TODO +++ b/doc/TODO @@ -7,7 +7,7 @@ - field validation - comment support for stories - in progress - theme development / selection - - user registration + - user registration - change password - wiki support - mailing list support @@ -26,17 +26,17 @@ TODO - 3/5/2009 - above list is still valid - model - relation has_one :x, is not validate/enforced/respected (I can associate a story to different blogs, which brings to incongruence in the story model ) - + - published method (and the alias date) is sort of an hack for supporting old Date type and new Time type. - controller - deleting a story/image/event doesn't remove that from his container, causing the admin page to crash trying to render an entry not available anymore. - + - view - rethink the design of admin page. maybe is ok, but look to some alternative way to display categories. It doesn't seem to scale very well if we add lot of possible entries. - + - replace the horrible javascript hack in base.js (for posting the drag&drop box) with ajax call. - + - the checkbox in stories and images editor where you can choose one blog/gallery doesn't have much sense.. and it complicates a lot the controller.update. diff --git a/example_db/localhost/blog/test-blog.yml b/example_db/localhost/blog/test-blog.yml index 00f630e..e639771 100644 --- a/example_db/localhost/blog/test-blog.yml +++ b/example_db/localhost/blog/test-blog.yml @@ -1,10 +1,10 @@ ---- +--- title: test blog tags: "" published: Sun Apr 19 12:53:04 -0700 2009 author: Example summary: my first blog. -entries: +entries: - test-story-1 - test-story-2 key: test-blog diff --git a/example_db/localhost/image/banner.yml b/example_db/localhost/image/banner.yml index 3246a62..8158631 100644 --- a/example_db/localhost/image/banner.yml +++ b/example_db/localhost/image/banner.yml @@ -1,4 +1,4 @@ ---- +--- content_type: image/jpeg title: banner published: "2009-04-29" @@ -8,4 +8,4 @@ filepath: files/banner summary: "" orig_name: banner.jpg key: banner -file: +file: diff --git a/example_db/localhost/site.yml b/example_db/localhost/site.yml index 535fd12..ce5142c 100644 --- a/example_db/localhost/site.yml +++ b/example_db/localhost/site.yml @@ -1,14 +1,14 @@ ---- +--- twitter_password: none name: Pages.CMS -roles: +roles: - Admin - Member twitter_account: none title: hello world domain: localhost description: sample app. -Admin: +Admin: - property - story - image @@ -17,6 +17,6 @@ Admin: Member: - story - image -authors: +authors: - Example key: site diff --git a/example_db/localhost/story/banner.yml b/example_db/localhost/story/banner.yml index 4af18b7..59c448e 100644 --- a/example_db/localhost/story/banner.yml +++ b/example_db/localhost/story/banner.yml @@ -1,4 +1,4 @@ ---- +--- format: mab blog: "" title: "" diff --git a/example_db/localhost/story/footer.yml b/example_db/localhost/story/footer.yml index bd1d2d2..fdd6ae4 100644 --- a/example_db/localhost/story/footer.yml +++ b/example_db/localhost/story/footer.yml @@ -1,4 +1,4 @@ ---- +--- format: textile title: "" blog: "" diff --git a/example_db/localhost/story/head.yml b/example_db/localhost/story/head.yml index 3deb188..7a49a55 100644 --- a/example_db/localhost/story/head.yml +++ b/example_db/localhost/story/head.yml @@ -1,4 +1,4 @@ ---- +--- format: mab blog: "" title: "" diff --git a/example_db/localhost/story/home.yml b/example_db/localhost/story/home.yml index 6629a8e..9021bab 100644 --- a/example_db/localhost/story/home.yml +++ b/example_db/localhost/story/home.yml @@ -1,4 +1,4 @@ ---- +--- format: mab blog: "" title: "" @@ -8,6 +8,6 @@ author: Example summary: "" content: |- p "Hello world." - + p "This is my first app.. :)" key: home diff --git a/example_db/localhost/story/menu.yml b/example_db/localhost/story/menu.yml index 52ff684..ac30d4e 100644 --- a/example_db/localhost/story/menu.yml +++ b/example_db/localhost/story/menu.yml @@ -1,4 +1,4 @@ ---- +--- format: mab blog: "" title: "" diff --git a/example_db/localhost/story/sidebar.yml b/example_db/localhost/story/sidebar.yml index 1ec07c7..cb14545 100644 --- a/example_db/localhost/story/sidebar.yml +++ b/example_db/localhost/story/sidebar.yml @@ -1,4 +1,4 @@ ---- +--- format: mab title: "" blog: "" diff --git a/example_db/localhost/story/test-story-1.yml b/example_db/localhost/story/test-story-1.yml index 617a129..09bfdfb 100644 --- a/example_db/localhost/story/test-story-1.yml +++ b/example_db/localhost/story/test-story-1.yml @@ -1,4 +1,4 @@ ---- +--- format: wysiwyg blog: "" title: test story 1 diff --git a/example_db/localhost/story/test-story-2.yml b/example_db/localhost/story/test-story-2.yml index 243fcfb..3a5fc88 100644 --- a/example_db/localhost/story/test-story-2.yml +++ b/example_db/localhost/story/test-story-2.yml @@ -1,4 +1,4 @@ ---- +--- format: mab blog: "" title: test story 2 @@ -8,8 +8,8 @@ author: Example summary: "i'm on the way" content: |- p "Well, using this think is easy after all.." - - p "Remember, this is what you need:" + + p "Remember, this is what you need:" ul.rooms do li {"#Waves"} li {"#Filebase"} diff --git a/example_db/localhost/theme/comments.css b/example_db/localhost/theme/comments.css index 4a1d167..c68bce3 100644 --- a/example_db/localhost/theme/comments.css +++ b/example_db/localhost/theme/comments.css @@ -5,8 +5,8 @@ div.comment p { font-size: 10pt; } div.comment p.byline { font-family: verdana, arial, sans-serif; font-size: 8pt; } /* formatting specific to the comment form */ -form.comment { height: 640px; width: 515px; +form.comment { height: 640px; width: 515px; background: url(http://studio.zeraweb.com/s/rectangle?w=516&h=648&r=12&c=060) no-repeat; } -form.comment h1, form.comment h2, form.comment h3, +form.comment h1, form.comment h2, form.comment h3, form.comment p, form.comment label { color: white; } form.comment *.value { color: #333; } diff --git a/example_db/localhost/theme/site.css b/example_db/localhost/theme/site.css index 6343281..0452389 100644 --- a/example_db/localhost/theme/site.css +++ b/example_db/localhost/theme/site.css @@ -1,8 +1,8 @@ -* { margin: 0; padding: 0; +* { margin: 0; padding: 0; font-family: helvetica, verdana, sans-serif; } /* basic page outline */ -body { +body { background: #110f0d; } @@ -16,11 +16,11 @@ h2 { font-size: 17pt; } h2, p, li { font-size: 12pt; } p { text-align: justify; } h3 { font-size: 12pt; } -p.subtitle { +p.subtitle { display: none; margin-top: 1px; margin-left: 2px; - font-family: verdana, arial, sans-serif; - font-size: 14px; font-style: italic; + font-family: verdana, arial, sans-serif; + font-size: 14px; font-style: italic; border-bottom: 1px dotted #390; } p.warning, p.error { border-top: 1px solid; border-bottom: 1px solid; } p.warning { color: orange; } @@ -34,13 +34,13 @@ a:hover { color: #110f0d; text-decoration: underline; } /* page layout */ /*div.banner > div.menu { height: 30px; }*/ /*div.banner > div.title h1 { - font-size: 15pt; text-align: right; letter-spacing: 0; padding-top: 20px; margin-right:30px; + font-size: 15pt; text-align: right; letter-spacing: 0; padding-top: 20px; margin-right:30px; color: #110f0d; margin-bottom: 0; }*/ div.banner.image { width:1050px; background-image: url( /images/banner );} /*div.banner h1 { font-size: 40px; }*/ div.banner ul.menu { display: block; float: right; margin-right: 30px; } -div.banner ul.menu li { display: block; float: right; margin-left: 20px; text-transform: uppercase; font-size: 14px; } +div.banner ul.menu li { display: block; float: right; margin-left: 20px; text-transform: uppercase; font-size: 14px; } div.banner img { width: 1050px; } /*div.menu { height: 50px; background: url(/images/bar-bg) repeat-x; }*/ @@ -57,7 +57,7 @@ div.sidebar hr { margin: 20px 0; } div.sidebar div.block { margin-bottom: 30px; } div.main { border-top: 2px solid ##110f0d; padding: 50px 35px; min-height: 400px; margin-left: 320px; } - + /* default image formatting */ /*img { border: none }*/ #home img { width:180px; height:250px; } @@ -79,8 +79,8 @@ div.entries h2 { font-family: verdana, arial, sans-serif; margin-top: 20px; } span.author, span.date { font-weight: bold; } -p.more { font-family: verdana, arial, sans-serif; font-size: 12pt; - padding-bottom: 20px; +p.more { font-family: verdana, arial, sans-serif; font-size: 12pt; + padding-bottom: 20px; border-bottom: 1px solid #390; } div.footer { clear: both; text-align: center; } diff --git a/example_db/localhost/theme/site.js b/example_db/localhost/theme/site.js index 72f1aa1..8f579fe 100644 --- a/example_db/localhost/theme/site.js +++ b/example_db/localhost/theme/site.js @@ -1,7 +1,7 @@ -//$(document).ready( function() { +//$(document).ready( function() { // $.ajax({ type: 'get', url: '/social/twitter-this', // beforeSend : function(xhr) { xhr.setRequestHeader('Accept','text/html-fragment') }, // success: function( html ) { -// $('div.twitter_this').replaceWith( html ); +// $('div.twitter_this').replaceWith( html ); // }}); //}); diff --git a/helpers/default.rb b/helpers/default.rb index 86f8f09..944e269 100644 --- a/helpers/default.rb +++ b/helpers/default.rb @@ -1,33 +1,33 @@ require 'simple-rss' require 'open-uri' module Pages - + module Helpers - + module Default - + include Waves::Helpers::Extended include Pages::ResponseMixin - + def show( model, name, assigns = {} ) assigns[ model ] = find( model, name ) view( model, :content, assigns ) if assigns[ model ] end - + def story( name, assigns = {} ) show( :story, name, assigns ) end - + def format( options ) - self << if ( options[:format] && - options[:format] != 'html' && + self << if ( options[:format] && + options[:format] != 'html' && respond_to?( options[:format] ) ) self.send options[:format], options[:content] else options[:content] end end - + def feed( options ) begin SimpleRSS.parse( open( options[:url] ) ) @@ -35,9 +35,9 @@ def feed( options ) options[:url] end end - + def mab( content ) ; markaby( content ) ; end - + def buttons( list ) div.buttons do list.each do |button| @@ -45,7 +45,7 @@ def buttons( list ) end end end - + end end end \ No newline at end of file diff --git a/lib/gallery.rb b/lib/gallery.rb index 7afd398..12e3eef 100644 --- a/lib/gallery.rb +++ b/lib/gallery.rb @@ -1,42 +1,42 @@ module Pages module Utilities - + # WARNING: this code has not been tested! It was extracted from an IRB session # and generalized. It needs to be tested. # # TODO: Need to add zip file support. Then we can do an upload gallery feature # using the file upload of the zip. See rubyzip on sourceforge. # - + module Gallery - + # options should include domain, path, title, and key def self.import( options ) I = Pages::Models::Images[ options[ :domain ] ] G = Pages::Models::Gallery[ options[ :domain ] ] # first copy the files into the file directory - Dir["#{path}/*"].each do |path| + Dir["#{path}/*"].each do |path| src = options[ :path ] dst = :db / options[ :domain ] / :file / File.basename( options[ :path ] ) FileUtils.cp( src, dst ) end # next, create all the images ... - keys = Dir[ "#{ options[ :path ] }/*" ].map do |path| + keys = Dir[ "#{ options[ :path ] }/*" ].map do |path| type = path.match( /\.(\w+)$/ ) key = File.basename( path, ".#{type}" ) I.create( 'key' => key, 'file' => "#{key}.#{type}", 'content-type' => "image/#{type}" ) end.map { |image| image.key } # finally, create the gallery - G.create( 'key' => options[ :key ], - 'title' => options[ :title ], - 'display' => 'Album', 'images' => keys ) + G.create( 'key' => options[ :key ], + 'title' => options[ :title ], + 'display' => 'Album', 'images' => keys ) end - + end - + end - + end \ No newline at end of file diff --git a/lib/image.rb b/lib/image.rb index 059be2b..40c13b0 100644 --- a/lib/image.rb +++ b/lib/image.rb @@ -1,23 +1,23 @@ require 'RMagick' class Image - + API = Magick::Image # width, height Dimensions = { :xlarge => [ 1200, 900 ], :large => [ 800, 600 ], :medium => [ 600, 400 ], :small => [ 300, 200 ], :xsmall => [ 200, 150 ], :thumb => [ 150, 100 ] } - + attr_reader :data def initialize( data = nil ) @data = data end - + def Image.read( path ) - Image.new( ::File.read( path ) ) + Image.new( ::File.read( path ) ) end - + def resize!( size = nil ) return self unless ( size && Array === size ) width, height = *size @@ -25,7 +25,7 @@ def resize!( size = nil ) @data = image.resize_to_fit!(width,height).to_blob self end - + def to_blob ; @data ; end end \ No newline at end of file diff --git a/lib/response_mixin.rb b/lib/response_mixin.rb index 1cf9c6e..bdad20d 100644 --- a/lib/response_mixin.rb +++ b/lib/response_mixin.rb @@ -6,5 +6,5 @@ def model( name ) ; app::Models[ name ][ domain ]; end alias_method :models, :model def find( m, n ); model( m ).find(n) ; end def all( m ) ; model(m).all ; end - end + end end \ No newline at end of file diff --git a/lib/short_url.rb b/lib/short_url.rb index be74d79..aec2474 100644 --- a/lib/short_url.rb +++ b/lib/short_url.rb @@ -1,45 +1,45 @@ require 'net/http' require 'json' require 'logger' - + module ShortUrl class Client - + # wrapping my key here def initialize @auth = { :user => 'polymar', :password => 'R_9d491bcf62b85b75c42d415a561c5d74' } end - + # get a shorter url. - # the json returned looks like this: + # the json returned looks like this: # {"results"=>{"http://dev.zeraweb.com"=>{"userHash"=>"YrDMv", "hash"=>"AbLkr", "shortKeywordUrl"=>"", "shortUrl"=>"http://bit.ly/YrDMv"}}, "errorMessage"=>"", "errorCode"=>0, "statusCode"=>"OK"} def short_url( dest_url ) return '' if dest_url.nil? or dest_url.empty? http_reg = Regexp.new('^([a-zA-Z]+:\/\/)') dest_url = 'http://' + dest_url if( !http_reg.match( dest_url )) bit_reg = Regexp.new('^([a-zA-Z]+:\/\/bit.ly\/)') - return dest_url if bit_reg.match( dest_url ) + return dest_url if bit_reg.match( dest_url ) call( 'shorten', { :longUrl => dest_url, :version => '2.0.1', :format => 'json' } ) # this is not documented, but adding :history => 1 should add the short_url to your history on bit.ly. end - + private - + def call( path, params = {} ) logger.info "Calling #{url( path, params ) } ..." request = Net::HTTP::Get.new( url( path, params ) ) request.basic_auth( login, password ) - response = Net::HTTP.start( 'api.bit.ly' ) do |h| + response = Net::HTTP.start( 'api.bit.ly' ) do |h| h.request( request ) end response.value # triggers error if not 2xx logger.info "Success!" JSON.parse( response.body )['results'][params[:longUrl]]['shortUrl'] end - + def url( path, params ) "http://api.bit.ly/#{path}#{query(params)}" end - + def query( params ) return '' if params.nil? or params.empty? params.inject('?') { |q,p| q << "#{p[0]}=#{p[1]}&" } @@ -48,17 +48,17 @@ def query( params ) def logger @logger ||= Logger.new( $stderr ) end - + def login @auth[:user] end - + def password @auth[:password] end - + end - + end #client = ShortUrl::Client.new @@ -66,23 +66,23 @@ def password # resp = client.short_url( 'http://www.google.com' ) # p resp #rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" #end #begin # resp = client.short_url( 'www.google.com' ) # p resp #rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" #end #begin # resp = client.short_url( 'google.com' ) # p resp #rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" #end #begin # resp = client.short_url( 'http://bit.ly/fICXX' ) # p resp #rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" #end \ No newline at end of file diff --git a/lib/twitter_client.rb b/lib/twitter_client.rb index bd63dc8..8cf71c5 100644 --- a/lib/twitter_client.rb +++ b/lib/twitter_client.rb @@ -2,14 +2,14 @@ require 'json' require 'lib/short_url' require 'logger' - + module Twitter class Client - + def initialize( auth ) @auth = auth end - + # public method for updating twitter status def update_status( status ) # status = { :message => 'new post on ruby', :url => 'http://www.ruby-lang.com' } message = status[:message] @@ -26,14 +26,14 @@ def update_status( status ) # status = { :message => 'new post on ruby', :url => call( 'statuses/update', { :status => posted } , :post ) end end - + # public method for getting public timelines def public_timeline call( 'statuses/public_timeline.json' ) end - + private - + def call( path, params = {}, method = :get ) if method == :get logger.info "Calling #{get_url( path, params ) } ..." @@ -44,7 +44,7 @@ def call( path, params = {}, method = :get ) request.set_form_data( params ) end request.basic_auth( login, password ) - response = Net::HTTP.start( 'twitter.com' ) do |h| + response = Net::HTTP.start( 'twitter.com' ) do |h| h.request( request ) end logger.info "tweet: " + response.code @@ -52,7 +52,7 @@ def call( path, params = {}, method = :get ) logger.info "Success!" JSON.parse( response.body ) end - + def get_url( path, params ) "http://twitter.com/#{path}.json#{query(params)}" end @@ -60,7 +60,7 @@ def get_url( path, params ) def post_url( path ) "http://twitter.com/#{path}.json" end - + def query( params ) return '' if params.nil? or params.empty? params.inject('?') { |q,p| q << "#{p[0]}=#{p[1]}&" } @@ -69,17 +69,17 @@ def query( params ) def login @auth[:user] end - + def password @auth[:password] - end - + end + def logger @logger ||= Logger.new( $stderr ) end - + end - + end # client = Twitter::Client.new( :user => 'duckonice', :password => 'bolognasalvati' ) @@ -87,23 +87,23 @@ def logger # resp = client.update_status( { :message => 'testing from' } ) # p resp # rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" # end # begin # resp = client.update_status( { :url => 'http://www.gazzetta.it' } ) # p resp # rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" # end # begin # resp = client.update_status( { :message => 'testing from' , :url => 'http://www.google.com' } ) # p resp # rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" # end # begin # resp = client.update_status( { :ciao => 'testing from' } ) # p resp # rescue Object => e -# puts "Log to logger message: #{e.message}" +# puts "Log to logger message: #{e.message}" # end diff --git a/models/blog.rb b/models/blog.rb index 797c8a1..8817c71 100644 --- a/models/blog.rb +++ b/models/blog.rb @@ -1,9 +1,9 @@ module Pages - - module Models - + + module Models + class Blog < Default - + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain / superclass.basename.snake_case ] ) @@ -25,14 +25,14 @@ def self.[]( domain ) end end - + def self.associate( domain ) has_many :entries, :class => Pages::Models::Story[ domain ] end - + end - + end - + end - + diff --git a/models/calendar.rb b/models/calendar.rb index f15d8b3..9c49585 100644 --- a/models/calendar.rb +++ b/models/calendar.rb @@ -1,9 +1,9 @@ module Pages - - module Models - + + module Models + class Calendar < Default - + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain / superclass.basename.snake_case ] ) @@ -25,13 +25,13 @@ def self.[]( domain ) end end - + def self.associate( domain ) has_many :events, :class => Pages::Models::Event[ domain ] end - + end - + end - + end \ No newline at end of file diff --git a/models/comment.rb b/models/comment.rb index 2ef02cb..eadbfa4 100644 --- a/models/comment.rb +++ b/models/comment.rb @@ -1,19 +1,19 @@ module Pages - - module Models - + + module Models + class Comment < Default - + def associate( domain ) has_one :story, :class => Pages::Models::Story[ domain ] end - + def attribution name.nil? || name.empty? ? 'anonymous coward' : name end - + end - + end - + end \ No newline at end of file diff --git a/models/default.rb b/models/default.rb index 34d4e72..420c314 100644 --- a/models/default.rb +++ b/models/default.rb @@ -23,14 +23,14 @@ def title ; get( :title ) or ''; end # def readable_key # return get( :key ).to_s.gsub(/\b\w/){$&.upcase}.gsub('-',' ') # end - + # used whenever we want to display a human readable - # name for this object ... + # name for this object ... def label return name.titlecase if title.nil? or title.empty? title end - + # we have to support old formats. def published diff --git a/models/event.rb b/models/event.rb index 7024938..7a9188a 100644 --- a/models/event.rb +++ b/models/event.rb @@ -1,14 +1,14 @@ module Pages - - module Models - + + module Models + class Event < Default - + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain / superclass.basename.snake_case ] ) associate( domain ) - + # callback from filebase before deleting before_delete do |obj| g = Pages::Models[ 'calendar' ][ domain ].find( obj.calendar ) @@ -17,31 +17,31 @@ def self.[]( domain ) end obj end - + end end - + def associate( domain ) has_one :calendar, :class => Pages::Models::Calendar[ domain ] end - - FORMATS = [ + + FORMATS = [ ['Formatted Text','wysiwyg'], - ['Plain Text','text'], - ['HTML','html'], + ['Plain Text','text'], + ['HTML','html'], ['Textile','textile'] ] - + def self.formats FORMATS end - + def date published end - + end - + end - + end diff --git a/models/gallery.rb b/models/gallery.rb index 45b419c..43cd017 100644 --- a/models/gallery.rb +++ b/models/gallery.rb @@ -1,9 +1,9 @@ module Pages - - module Models - + + module Models + class Gallery < Default - + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain / superclass.basename.snake_case ] ) @@ -25,18 +25,18 @@ def self.[]( domain ) end end - + def self.associate( domain ) has_many :images, :class => Pages::Models::Image[ domain ] end - + DISPLAYS = [ ['Album', 'Album' ], ['Slideshow','Slideshow'] ] - + def self.displays; DISPLAYS; end - + end - + end - + end - + diff --git a/models/listing.rb b/models/listing.rb index 38e26e7..072af75 100644 --- a/models/listing.rb +++ b/models/listing.rb @@ -1,25 +1,25 @@ module Pages - - module Models - + + module Models + class Listing < Default - + def associate( domain ) # TODO associate listing with announcements end - - PHONE_TYPE = [ + + PHONE_TYPE = [ 'Phone', 'Fax', 'Messages' ] - + def self.phone_types PHONE_TYPE end - + end - + end - + end diff --git a/models/site.rb b/models/site.rb index 9f731da..5bed421 100644 --- a/models/site.rb +++ b/models/site.rb @@ -1,28 +1,28 @@ module Pages - + module Models - + class Site < Default - - ROLES = [ + + ROLES = [ 'administrator', 'member', 'subscriber' ] - + def self.roles ROLES end - - def self.[]( domain ) + + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain ] ) associate( domain ) end end - + end - + end - + end diff --git a/models/story.rb b/models/story.rb index c966ac7..11fbe2f 100644 --- a/models/story.rb +++ b/models/story.rb @@ -1,14 +1,14 @@ module Pages - - module Models - + + module Models + class Story < Default - + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain / superclass.basename.snake_case ] ) associate( domain ) - + # callback from filebase before deleting before_delete do |obj| g = Pages::Models[ 'blog' ][ domain ].find( obj.blog ) @@ -17,15 +17,15 @@ def self.[]( domain ) end obj end - + end end - + def associate( domain ) has_one :blog, :class => Pages::Models::Blog[ domain ] has_many :comments, :class => Pages::Models::Comment[ domain ] end - + def comment_number n = comments.size case n @@ -37,26 +37,26 @@ def comment_number "#{n} Comments" end end - - FORMATS = [ + + FORMATS = [ ['Formatted Text','wysiwyg'], - ['Plain Text','text'], - ['HTML','html'], + ['Plain Text','text'], + ['HTML','html'], ['Textile','textile'] ] - + LAYOUTS = [ 'home', 'head', 'menu', 'banner', 'sidebar', 'footer', 'feed'] - + def self.formats FORMATS end - + def self.layouts LAYOUTS end - + end - + end - + end diff --git a/models/user.rb b/models/user.rb index c721394..e626d33 100644 --- a/models/user.rb +++ b/models/user.rb @@ -1,22 +1,22 @@ module Pages - + module Models - + class User < Default - - def self.[]( domain ) + + def self.[]( domain ) Class.new( self ) do include( Filebase::Model[ :db / domain / superclass.basename.snake_case ] ) associate( domain ) end end - + def self.associate( domain ) has_many :entries, :class => Pages::Models::Story[ domain ] has_many :listings, :class => Pages::Models::Listing[ domain ] #has_many :announcements, :class => Pages::Models::Announcement[ domain ] end - + def date_joined rval = get( :date_joined ) return rval if rval.is_a? Time @@ -25,21 +25,21 @@ def date_joined end def username ; get( :key ) or '' ; end - + # TODO .. better identify the hierarchy of roles, not only driven by DW - ROLES = [ - ['Admin', 'Admin' ], + ROLES = [ + ['Admin', 'Admin' ], ['Member','Member'], ['Subscriber', 'Subscriber' ] ] - + def self.roles ROLES end - + end - + end - + end - + diff --git a/public/css/.old/admin.css.old b/public/css/.old/admin.css.old index 4c4a58b..2968d27 100644 --- a/public/css/.old/admin.css.old +++ b/public/css/.old/admin.css.old @@ -2,7 +2,7 @@ body { margin-left: 40px; width: 1000px; padding: 10px; font-family: verdana; font-size: 12px; background: white; } h1 { margin-bottom: 10px; color: #666; float: left; font-size: 20px; width: 300px;} h2, h3 { color: #999; margin-bottom: 10px; } -a, a:visited, a:hover { color: #393; } +a, a:visited, a:hover { color: #393; } a, a:visited { text-decoration: none; } a:hover { text-decoration: underline; } div.header { margin: 5px; padding: 5px; } @@ -10,16 +10,16 @@ p.warning { clear: both; color: #993; } div.dialog { display: none; } div.page#admin p { margin: 10px 0 10px 0; } div.page#admin div.add { margin-top: 10px; margin-bottom: 10px;} -div.page#admin div.add form { display: none; +div.page#admin div.add form { display: none; padding: 5px; border: 1px solid #ccc; } -div.page#admin div.add form a.close { float: right; border: 1px solid #ccc; +div.page#admin div.add form a.close { float: right; border: 1px solid #ccc; padding: 0px 3px; margin-top: -2px; cursor: pointer; } div.page#admin div.add div.property { margin-bottom: 4px;} -div.page#admin div.add label { margin: 0 5px; +div.page#admin div.add label { margin: 0 5px; font-weight: bold; font-size: 11px; color: #666; } -div.page#admin div.add input { - margin: 0 5px; padding: 5px; - width: 150px; border: 1px solid #999; +div.page#admin div.add input { + margin: 0 5px; padding: 5px; + width: 150px; border: 1px solid #999; font-size: 11px; } div.page#admin div.add div.buttons input { width: 90px; font-size: 10px; padding: 2px; @@ -29,32 +29,32 @@ div.page#admin div.add p { margin: 5px; float: none; font-size: 11px; } div.page#admin div.list#images { width: 200px; } div.page#admin div.list { overflow: hidden; } -div.page#admin div.list li, #editor ul.container li { display: block; clear: both; +div.page#admin div.list li, #editor ul.container li { display: block; clear: both; margin-left: 0; } -div.page#admin div.list#images li, div.gallery#editor ul.container li { display: block; +div.page#admin div.list#images li, div.gallery#editor ul.container li { display: block; clear: none; float: left; margin-left: 0; padding: 2px; height: 54px; } div.list#images a:hover img, div.gallery#editor a:hover img { border: 1px solid #393; } -div.list#images img, div.gallery#editor img { border: 1px solid white; +div.list#images img, div.gallery#editor img { border: 1px solid white; width: 50px; height: 50px; } -div#editor div.main { float: left; clear: both; width: 650px; margin: 5px; padding: 5px; +div#editor div.main { float: left; clear: both; width: 650px; margin: 5px; padding: 5px; border: 1px dotted #ccc; } #login div.main { width: 400px; } div.main div.properties { padding: 10px;} div.main div.property {} div.main label { clear: both; display: block; margin-bottom: 10px; padding-top: 5px; font-weight: bold; font-size: 12px; color: #666; } -div.main div.property input, +div.main div.property input, div.main div.property textarea, -div.main div.property select { +div.main div.property select { font-size: 12px; - display: block; margin-bottom: 10px; padding: 5px; + display: block; margin-bottom: 10px; padding: 5px; border: 1px solid #333; } div.main div.property #wysiwyg_container { margin: 10px; } #wysiwyg_container iframe { padding: 10px; } div.image#editor div.property img { display: block; margin: 10px; padding: 10px; border: 1px solid #ccc; } -p.help, p.error { clear: both; float: left; +p.help, p.error { clear: both; float: left; font-size: 10px; color: #999; } div.page#admin p.help { float: none; } form p { margin-bottom: 20px; } @@ -66,31 +66,31 @@ div.main #content textarea { width: 600px; height: 450px; div.main #email input { width: 200px; } div.main #password input { width: 200px; } div.main select { width: 200px;} - + div.sidebar { float: left; width: 280px; border: 1px dotted #ccc; margin: 5px; padding: 5px; } div.sidebar div.property { float: left; } div.sidebar label { float: left; width: 90px; margin: 5px; padding-top: 5px; font-weight: bold; font-size: 11px; text-align: right; color: #666; } -div.sidebar div.property input, +div.sidebar div.property input, div.sidebar div.property textarea, - div.sidebar div.property select { - float: left; margin: 5px; padding: 5px; - width: 150px; border: 1px solid #333; + div.sidebar div.property select { + float: left; margin: 5px; padding: 5px; + width: 150px; border: 1px solid #333; font-size: 11px; } div.sidebar p.help { clear: both; float: left; margin-left: 105px; margin-bottom: 10px; font-size: 10px; color: #999; } div.sidebar #summary textarea { height: 150px; font-family: 'Lucida Sans Typewriter', 'Courier New', courier; } div.header div.buttons { float: left; width: 400px; - margin-bottom: 10px; padding-bottom: 10px; + margin-bottom: 10px; padding-bottom: 10px; text-align: left; } div.header div.confirmation { display: inline; margin-left: 20px; } div.page#login div.buttons { clear: both; margin: 5px; padding-top: 20px;} div.buttons input { padding: 5px; } -div.buttons input, div.buttons a { +div.buttons input, div.buttons a { margin-right: 10px; - font-size: 11px; font-weight: bold; + font-size: 11px; font-weight: bold; cursor: pointer; font-weight: bold; } form.site div.buttons input { float: left; margin-top: 20px; } form.site div.buttons a { float: left; margin-top: 20px; } diff --git a/public/css/.old/editor.css.old b/public/css/.old/editor.css.old index a2d2035..a84f72d 100644 --- a/public/css/.old/editor.css.old +++ b/public/css/.old/editor.css.old @@ -1 +1 @@ -* { font-family: verdana,arial,sans-serif; font-size: 14px; color: #666; } \ No newline at end of file +* { font-family: verdana,arial,sans-serif; font-size: 14px; color: #666; } \ No newline at end of file diff --git a/public/css/admin.css b/public/css/admin.css index 0d2dfae..01bccea 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -2,9 +2,9 @@ @import url(/media/css/quick_add.css); div.page { width: 1200px; } -div.panel { float: left; width: 250px; height: 622px; - border: solid 1px #ccc; padding: 5px; - margin-right: 10px; margin-bottom: 10px; +div.panel { float: left; width: 250px; height: 622px; + border: solid 1px #ccc; padding: 5px; + margin-right: 10px; margin-bottom: 10px; overflow-y: scroll; } div.panel ul { margin: 20px 0 0 0; padding: 0; } div.panel ul * { margin: 0; padding: 0; } diff --git a/public/css/container.css b/public/css/container.css index 3803114..81e134d 100644 --- a/public/css/container.css +++ b/public/css/container.css @@ -3,5 +3,5 @@ ul.container:first { clear: both; } /* actually implemented in javascript */ ul.container { float: left; width: 290px; border: 1px solid #ccc; padding: 5px; margin: 2px; min-height: 100px; } #gallery-editor ul.container li { display: inline; } -#gallery-editor ul.container img { border: 1px solid white; +#gallery-editor ul.container img { border: 1px solid white; width: 50px; height: 50px; } diff --git a/public/css/editor.css b/public/css/editor.css index d10a1c3..d804fba 100644 --- a/public/css/editor.css +++ b/public/css/editor.css @@ -22,9 +22,9 @@ div.property select { div.sidebar div.property input, div.sidebar div.property textarea, div.sidebar div.property select { float: left; width: 150px; font-size: 11px; } -div.sidebar label { float: left; width: 75px; text-align: right; +div.sidebar label { float: left; width: 75px; text-align: right; margin-right: 10px; padding-top: 5px; } -div.sidebar p.help { clear: both; margin-left: 85px; +div.sidebar p.help { clear: both; margin-left: 85px; font-size: 11px; } div.main div.property input.text { width: 500px; } diff --git a/public/css/quick_add.css b/public/css/quick_add.css index a8bc39a..302f87b 100644 --- a/public/css/quick_add.css +++ b/public/css/quick_add.css @@ -3,7 +3,7 @@ div.quick_add a.open, div.quick_add a.submit { font-weight: bold; font-size: 12p div.quick_add a.close { display: block; float: right; cursor: pointer; } div.quick_add label, div.quick_add input.text { float: left; } -div.quick_add label { font-weight: bold; font-size: 11px; +div.quick_add label { font-weight: bold; font-size: 11px; margin-top: 5px; margin-right: 5px; } div.quick_add p { clear: both; margin-top: 10px; font-size: 11px; color: #666; } div.quick_add p.error { color: #933; } \ No newline at end of file diff --git a/public/css/wysiwyg.css b/public/css/wysiwyg.css index 9308305..380c9f4 100644 --- a/public/css/wysiwyg.css +++ b/public/css/wysiwyg.css @@ -1 +1 @@ -body { font-family: verdana,arial,sans-serif; font-size: 14px; color: #666; } \ No newline at end of file +body { font-family: verdana,arial,sans-serif; font-size: 14px; color: #666; } \ No newline at end of file diff --git a/public/javascript/.old/admin.js.old b/public/javascript/.old/admin.js.old index d03b8e9..30395b2 100644 --- a/public/javascript/.old/admin.js.old +++ b/public/javascript/.old/admin.js.old @@ -1,5 +1,5 @@ $(document).ready( function() { - + $('input[type="submit"]').each( function() { $(this).replaceWith(""+$(this).val()+""); }); @@ -23,7 +23,7 @@ $(document).ready( function() { } }); } - + $('div.buttons a.submit').click( function() { var form = $(this).parents('form'); var failed = form.find('.required') @@ -33,17 +33,17 @@ $(document).ready( function() { if ( failed.size() == 0 ) { form.submit(); } return false; }); - - + + $('#site, #stories, #images').each( function() { if ( this.scrollHeight > 580 ) { $(this).css({'overflow-y': 'scroll'}); - } + } }); $('#galleries, #blogs').each( function() { if ( this.scrollHeight > 290 ) { $(this).css({'overflow-y': 'scroll'}); - } + } }); $('div.list').hover( function() { $(this).css({ border: '1px solid #333'}); @@ -52,7 +52,7 @@ $(document).ready( function() { $(this).find('h2, h3').css({color: '#999' }); $(this).css({ border: '1px solid #999'}); }); - + $('a.delete').click( function() { var href = $(this).attr('href'); $(this).hide(); @@ -63,12 +63,12 @@ $(document).ready( function() { ); $('a.yes').click( function() { var el = this; - $.blockUI("Okay, just a second ...", + $.blockUI("Okay, just a second ...", { 'font-weight': 'bold', border: 'none' }); - $.ajax({ - type: 'delete', - url: href, - success: function() { + $.ajax({ + type: 'delete', + url: href, + success: function() { window.location = '/admin'; }, error: function() { diff --git a/public/javascript/.old/editor.js.old b/public/javascript/.old/editor.js.old index 409c6ac..8bfa0cf 100644 --- a/public/javascript/.old/editor.js.old +++ b/public/javascript/.old/editor.js.old @@ -1,9 +1,9 @@ $(document).ready( function() { - + var wysiwyg = function() { var el; if ( $(this).val() == 'wysiwyg' ) { - tinyMCE.execCommand('mceAddControl',false,'wysiwyg'); + tinyMCE.execCommand('mceAddControl',false,'wysiwyg'); } else if ( el = tinyMCE.getInstanceById('wysiwyg') ) { tinyMCE.execCommand('mceRemoveControl',false,'wysiwyg'); $('#wysiwyg_container').hide(); @@ -27,4 +27,4 @@ tinyMCE.init({ mode : "none", theme : "advanced", theme_advanced_buttons2: '', theme_advanced_buttons3: '', relative_urls: false -}); +}); diff --git a/public/javascript/.svn/text-base/core.js.svn-base b/public/javascript/.svn/text-base/core.js.svn-base index 07b5269..c1c3ebe 100644 --- a/public/javascript/.svn/text-base/core.js.svn-base +++ b/public/javascript/.svn/text-base/core.js.svn-base @@ -23,7 +23,7 @@ Cruiser.String = { map: function( args, f ) { var g = function( s, p ) { return f.apply( s, p ); } return args.inject( this, g ); - }, + }, toCharArray: String.prototype.toArray, toArray: function( separator ) { if ( separator ) { diff --git a/public/javascript/.svn/text-base/enumerable.js.svn-base b/public/javascript/.svn/text-base/enumerable.js.svn-base index fb23454..662817d 100644 --- a/public/javascript/.svn/text-base/enumerable.js.svn-base +++ b/public/javascript/.svn/text-base/enumerable.js.svn-base @@ -4,21 +4,21 @@ var Hash = function(object) { } }; Hash.convert = function(object) { - for( var k in Hash.prototype ) { object[k] = Hash.prototype[k] }; return object; + for( var k in Hash.prototype ) { object[k] = Hash.prototype[k] }; return object; }; Hash.prototype = { - each: function( fn ) { + each: function( fn ) { for( var k in this ) { if (! ( typeof this[k] == 'function' )) { fn({0:k, 1: this[k], key: k, value: this[k]}) } } - return this; + return this; }, merge: function( hash ) { var self = this; new Hash(hash).each( function(item) { self[item.key] = item.value }); return this; } }; -Array.convert = function(object) { +Array.convert = function(object) { if (object instanceof Array ) { return object } else if (object.toArray) { return object.toArray() } else { @@ -30,7 +30,7 @@ Array.prototype.each = function( fn ) { for(var i = 0; i
- + diff --git a/public/javascript/.svn/text-base/firebug.js.svn-base b/public/javascript/.svn/text-base/firebug.js.svn-base index 14eaad2..e5b1624 100644 --- a/public/javascript/.svn/text-base/firebug.js.svn-base +++ b/public/javascript/.svn/text-base/firebug.js.svn-base @@ -2,33 +2,33 @@ if (!window.console || !console.firebug) { (function() { - window.console = + window.console = { log: function() { logFormatted(arguments, ""); }, - + debug: function() { logFormatted(arguments, "debug"); }, - + info: function() { logFormatted(arguments, "info"); }, - + warn: function() { logFormatted(arguments, "warning"); }, - + error: function() { logFormatted(arguments, "error"); }, - + assert: function(truth, message) { if (!truth) @@ -36,16 +36,16 @@ if (!window.console || !console.firebug) { var args = []; for (var i = 1; i < arguments.length; ++i) args.push(arguments[i]); - + logFormatted(args.length ? args : ["Assertion Failure"], "error"); throw message ? message : "Assertion Failure"; } }, - + dir: function(object) { var html = []; - + var pairs = []; for (var name in object) { @@ -57,48 +57,48 @@ if (!window.console || !console.firebug) { { } } - + pairs.sort(function(a, b) { return a[0] < b[0] ? -1 : 1; }); - + html.push(''); for (var i = 0; i < pairs.length; ++i) { var name = pairs[i][0], value = pairs[i][1]; - - html.push('', + + html.push('', '', ''); } html.push('
', escapeHTML(name), ''); appendObject(value, html); html.push('
'); - + logRow(html, "dir"); }, - + dirxml: function(node) { var html = []; - + appendNode(node, html); logRow(html, "dirxml"); }, - + group: function() { logRow(arguments, "group", pushGroup); }, - + groupEnd: function() { logRow(arguments, "", popGroup); }, - + time: function(name) { timeMap[name] = (new Date()).getTime(); }, - + timeEnd: function(name) { if (name in timeMap) @@ -108,26 +108,26 @@ if (!window.console || !console.firebug) { delete timeMap[name]; } }, - + count: function() { this.warn(["count() not supported."]); }, - + trace: function() { this.warn(["trace() not supported."]); }, - + profile: function() { this.warn(["profile() not supported."]); }, - + profileEnd: function() { }, - + clear: function() { consoleBody.innerHTML = ""; @@ -137,27 +137,27 @@ if (!window.console || !console.firebug) { { toggleConsole(true); }, - + close: function() { if (frameVisible) toggleConsole(); } }; - + // ******************************************************************************************** - + var consoleFrame = null; var consoleBody = null; var commandLine = null; - + var frameVisible = false; var messageQueue = []; var groupStack = []; var timeMap = {}; - + var clPrefix = ">>> "; - + var isFirefox = navigator.userAgent.indexOf("Firefox") != -1; var isIE = navigator.userAgent.indexOf("MSIE") != -1; var isOpera = navigator.userAgent.indexOf("Opera") != -1; @@ -187,13 +187,13 @@ if (!window.console || !console.firebug) { createFrame(); else setTimeout(waitForBody, 200); - } + } function createFrame() { if (consoleFrame) return; - + window.onFirebugReady = function(doc) { window.onFirebugReady = null; @@ -205,7 +205,7 @@ if (!window.console || !console.firebug) { addEvent(commandLine, "keydown", onCommandLineKeyDown); addEvent(doc, isIE || isSafari ? "keydown" : "keypress", onKeyDown); - + consoleBody = doc.getElementById("log"); layout(); flush(); @@ -216,7 +216,7 @@ if (!window.console || !console.firebug) { consoleFrame = document.createElement("iframe"); consoleFrame.setAttribute("src", baseURL+"/firebug.html"); consoleFrame.setAttribute("frameBorder", "0"); - consoleFrame.style.visibility = (frameVisible ? "visible" : "hidden"); + consoleFrame.style.visibility = (frameVisible ? "visible" : "hidden"); consoleFrame.style.zIndex = "2147483583"; consoleFrame.style.position = document.all ? "absolute" : "fixed"; consoleFrame.style.width = "100%"; @@ -225,7 +225,7 @@ if (!window.console || !console.firebug) { consoleFrame.style.height = "200px"; document.body.appendChild(consoleFrame); } - + function getFirebugURL() { var scripts = document.getElementsByTagName("script"); @@ -238,14 +238,14 @@ if (!window.console || !console.firebug) { } } } - + function evalCommandLine() { var text = commandLine.value; commandLine.value = ""; logRow([clPrefix, text], "command"); - + var value; try { @@ -257,17 +257,17 @@ if (!window.console || !console.firebug) { console.log(value); } - + function layout() { var toolbar = consoleBody.ownerDocument.getElementById("toolbar"); var height = consoleFrame.offsetHeight - (toolbar.offsetHeight + commandLine.offsetHeight); consoleBody.style.top = toolbar.offsetHeight + "px"; consoleBody.style.height = height + "px"; - + commandLine.style.top = (consoleFrame.offsetHeight - commandLine.offsetHeight) + "px"; } - + function logRow(message, className, handler) { if (consoleBody) @@ -278,12 +278,12 @@ if (!window.console || !console.firebug) { waitForBody(); } } - + function flush() { var queue = messageQueue; messageQueue = []; - + for (var i = 0; i < queue.length; ++i) writeMessage(queue[i][0], queue[i][1], queue[i][2]); } @@ -295,13 +295,13 @@ if (!window.console || !console.firebug) { if (!handler) handler = writeRow; - + handler(message, className); - + if (isScrolledToBottom) consoleBody.scrollTop = consoleBody.scrollHeight - consoleBody.offsetHeight; } - + function appendRow(row) { var container = groupStack.length ? groupStack[groupStack.length-1] : consoleBody; @@ -333,7 +333,7 @@ if (!window.console || !console.firebug) { { groupStack.pop(); } - + // ******************************************************************************************** function logFormatted(objects, className) @@ -365,14 +365,14 @@ if (!window.console || !console.firebug) { for (var i = objIndex+1; i < objects.length; ++i) { appendText(" ", html); - + var object = objects[i]; if (typeof(object) == "string") appendText(object, html); else appendObject(object, html); } - + logRow(html, className); } @@ -380,7 +380,7 @@ if (!window.console || !console.firebug) { { var parts = []; - var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; + var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; var appenderMap = {s: appendText, d: appendInteger, i: appendInteger, f: appendFloat}; for (var m = reg.exec(format); m; m = reg.exec(format)) @@ -469,7 +469,7 @@ if (!window.console || !console.firebug) { var name = m ? m[1] : "function"; html.push('', escapeHTML(name), '()'); } - + function appendObject(object, html) { try @@ -495,7 +495,7 @@ if (!window.console || !console.firebug) { { } } - + function appendObjectFormatted(object, html) { var text = objectToString(object); @@ -504,7 +504,7 @@ if (!window.console || !console.firebug) { var m = reObject.exec(text); html.push('', m ? m[1] : text, '') } - + function appendSelector(object, html) { html.push(''); @@ -531,7 +531,7 @@ if (!window.console || !console.firebug) { var attr = node.attributes[i]; if (!attr.specified) continue; - + html.push(' ', attr.nodeName.toLowerCase(), '="', escapeHTML(attr.nodeValue), '"') @@ -543,8 +543,8 @@ if (!window.console || !console.firebug) { for (var child = node.firstChild; child; child = child.nextSibling) appendNode(child, html); - - html.push('
</', + + html.push('
</', node.nodeName.toLowerCase(), '>
'); } else @@ -558,7 +558,7 @@ if (!window.console || !console.firebug) { } // ******************************************************************************************** - + function addEvent(object, name, handler) { if (document.all) @@ -566,7 +566,7 @@ if (!window.console || !console.firebug) { else object.addEventListener(name, handler, false); } - + function removeEvent(object, name, handler) { if (document.all) @@ -574,27 +574,27 @@ if (!window.console || !console.firebug) { else object.removeEventListener(name, handler, false); } - + function cancelEvent(event) { if (document.all) event.cancelBubble = true; else - event.stopPropagation(); + event.stopPropagation(); } function onError(msg, href, lineNo) { var html = []; - + var lastSlash = href.lastIndexOf("/"); var fileName = lastSlash == -1 ? href : href.substr(lastSlash+1); - + html.push( - '', msg, '', + '', msg, '', '' ); - + logRow(html, "error"); }; @@ -607,7 +607,7 @@ if (!window.console || !console.firebug) { focusCommandLine(); else return; - + cancelEvent(event); } @@ -615,7 +615,7 @@ if (!window.console || !console.firebug) { { if (isSafari || isOpera) return; - + addEvent(document, "mousemove", onSplitterMouseMove); addEvent(document, "mouseup", onSplitterMouseUp); @@ -625,7 +625,7 @@ if (!window.console || !console.firebug) { addEvent(frames[i].document, "mouseup", onSplitterMouseUp); } } - + function onSplitterMouseMove(event) { var win = document.all @@ -635,14 +635,14 @@ if (!window.console || !console.firebug) { var clientY = event.clientY; if (win != win.parent) clientY += win.frameElement ? win.frameElement.offsetTop : 0; - + var height = consoleFrame.offsetTop + consoleFrame.clientHeight; var y = height - clientY; - + consoleFrame.style.height = y + "px"; layout(); } - + function onSplitterMouseUp(event) { removeEvent(document, "mousemove", onSplitterMouseMove); @@ -654,7 +654,7 @@ if (!window.console || !console.firebug) { removeEvent(frames[i].document, "mouseup", onSplitterMouseUp); } } - + function onCommandLineKeyDown(event) { if (event.keyCode == 13) @@ -662,10 +662,10 @@ if (!window.console || !console.firebug) { else if (event.keyCode == 27) commandLine.value = ""; } - + window.onerror = onError; addEvent(document, isIE || isSafari ? "keydown" : "keypress", onKeyDown); - + if (document.documentElement.getAttribute("debug") == "true") toggleConsole(true); })(); diff --git a/public/javascript/.svn/text-base/parsing.js.svn-base b/public/javascript/.svn/text-base/parsing.js.svn-base index 91b64a8..233bc93 100644 --- a/public/javascript/.svn/text-base/parsing.js.svn-base +++ b/public/javascript/.svn/text-base/parsing.js.svn-base @@ -9,8 +9,8 @@ Cruiser.Parser = { } }; var Parser = {}; -Parser.Exception = function(s) { - this.message = "Parse error at '" + s.substring(0,10) + " ...'"; +Parser.Exception = function(s) { + this.message = "Parse error at '" + s.substring(0,10) + " ...'"; }; Parser.Operators = { // @@ -30,18 +30,18 @@ Parser.Operators = { }, stoken: function(s) { // string token - return Parser.Operators.rtoken( new RegExp('^'+s) ); + return Parser.Operators.rtoken( new RegExp('^'+s) ); }, // // Atomic Operators - // - + // + until: function(p) { return function(s) { var qx = [], rx = null; - while( s.length ) { - try { rx = p.call(this,s); } + while( s.length ) { + try { rx = p.call(this,s); } catch (e) { qx.push(rx[0]); s = rx[1]; continue; } break; } @@ -49,9 +49,9 @@ Parser.Operators = { }; }, many: function( p ) { - var _ = Parser.Operators; + var _ = Parser.Operators; return function(s) { - var rx = [], r = null; while (s.length) { + var rx = [], r = null; while (s.length) { try { r = p.call(this,s); } catch (e) { return [ rx, s ]; } rx.push(r[0]); s = r[1]; } @@ -76,7 +76,7 @@ Parser.Operators = { return p ? function(s) { var r = null; r = p.call(this,s); return [ null, r[1] ]; } : null; }, product: function() { - var _ = Parser.Operators, px = arguments[0], + var _ = Parser.Operators, px = arguments[0], qx = Array.prototype.slice.call(arguments, 1), rx = []; for ( var i = 0 ; i < px.length ; i++ ) { rx.push( _.each( px[i], qx ) ); @@ -86,27 +86,27 @@ Parser.Operators = { // vector operators any: function() { var px = arguments; - return function(s) { + return function(s) { var r = null; - for (var i = 0; i 0 && ! last ) { - try { q = d.call(this,r[1]); } catch(e) { last = true; } + try { q = d.call(this,r[1]); } catch(e) { last = true; } } else { last = true; } - if ( ! last ) { + if ( ! last ) { if ( q[1].length > 0 ) { var qx = []; for( var j = 0; j < px.length ; j++ ) { if ( i!=j ) { qx.push(px[j]); } @@ -179,7 +179,7 @@ Parser.Operators = { } if ( !r ) { return best; } if ( c ) { - try { c.call( this, r[1] ); } + try { c.call( this, r[1] ); } catch(e) { throw new Parser.Exception(r[1]); } } return best; @@ -188,7 +188,7 @@ Parser.Operators = { forward: function( gr, fname ) { return function(s) { return gr[fname].call(this,s); } }, - + // // Translation Operators // @@ -198,7 +198,7 @@ Parser.Operators = { process: function(rule,fn) { return function(s) { var r = rule.call(this,s); return [ fn.call(this,r[0]),r[1] ]; } }, - cache: function(rule) { + cache: function(rule) { var cache = {}, val = null; return function(s) { try{ val = cache[s] = ( cache[s] || rule.call(this,s) ); } catch(e) { val = cache[s] = e; } if ( val instanceof Parser.Exception ) { throw val; } @@ -214,7 +214,7 @@ Parser.Operators = { }; (function() { - var _ = Parser.Operators, + var _ = Parser.Operators, _cached = function( op ) { return function() { var cache = {}, fn = op.apply(null,arguments); val = null; @@ -222,7 +222,7 @@ Parser.Operators = { try { val = cache[s] = ( cache[s] || fn.call(this,s) ); } catch( e ) { val = cache[s] = e; } if ( val instanceof Parser.Exception ) { throw val; } - else { return val; } + else { return val; } } } }, @@ -233,7 +233,7 @@ Parser.Operators = { var args = Array.prototype.slice.call(arguments), rx = []; for ( var i = 0, px = args.shift() ; i < px.length ; i++ ) { args.unshift(px[i]); rx.push( op.apply( null, args ) ); args.shift(); - } + } return rx; } else { return op.apply( null, arguments ); } } @@ -241,11 +241,11 @@ Parser.Operators = { gx = 'optional not ignore cache'.split(/\s/); for ( var i = 0 ; i < cx.length ; i++ ) { _[ cx[i] ] = _cached( _[ cx[i] ] ); } for ( var i = 0 ; i < gx.length ; i++ ) { _[ gx[i] ] = _generator( _[ gx[i] ] ); } - //_.set = function(px,d,c) { - // return function(s) { + //_.set = function(px,d,c) { + // return function(s) { // var rx = _._set(px,d,c).call(this,s); - // return (( rx[0] instanceof Array ) ? - // [ rx[0].flatten().compact(), rx[1] ] : rx ); + // return (( rx[0] instanceof Array ) ? + // [ rx[0].flatten().compact(), rx[1] ] : rx ); // }; //}; -}()); +}()); diff --git a/public/javascript/base.js b/public/javascript/base.js index e85e4c5..e7057af 100644 --- a/public/javascript/base.js +++ b/public/javascript/base.js @@ -25,10 +25,10 @@ $(document).ready( function() { $(this).replaceWith(""); }); } - form.submit(); + form.submit(); } return false; }); - - + + }); diff --git a/public/javascript/container.js b/public/javascript/container.js index d12a803..b69f50a 100644 --- a/public/javascript/container.js +++ b/public/javascript/container.js @@ -10,7 +10,7 @@ $(document).ready( function() { $('ul.container:first').css({clear: 'both'}) $('ul.container li').draggable({helper:'clone'}); $('ul.container').droppable({ - accept: 'li', tolerance: 'pointer', + accept: 'li', tolerance: 'pointer', drop: function(ev,ui) { $(this).append( ui.draggable.element ); } }); } diff --git a/public/javascript/editor.js b/public/javascript/editor.js index 8059636..ec063e9 100644 --- a/public/javascript/editor.js +++ b/public/javascript/editor.js @@ -9,12 +9,12 @@ $(document).ready( function() { ); $('a.yes').click( function() { var el = this; - $.blockUI("Okay, just a second ...", + $.blockUI("Okay, just a second ...", { 'font-weight': 'bold', border: 'none' }); - $.ajax({ - type: 'delete', - url: href, - success: function() { + $.ajax({ + type: 'delete', + url: href, + success: function() { window.location = '/admin'; }, error: function() { @@ -34,5 +34,5 @@ $(document).ready( function() { if ( date === null ) { date = Date.today(); } $(this).val( date.toString('yyyy-MM-dd')); }); - -}); + +}); diff --git a/public/javascript/firebug/firebug.html b/public/javascript/firebug/firebug.html index 861e639..967e1d9 100644 --- a/public/javascript/firebug/firebug.html +++ b/public/javascript/firebug/firebug.html @@ -17,7 +17,7 @@
- + diff --git a/public/javascript/firebug/firebug.js b/public/javascript/firebug/firebug.js index 14eaad2..e5b1624 100644 --- a/public/javascript/firebug/firebug.js +++ b/public/javascript/firebug/firebug.js @@ -2,33 +2,33 @@ if (!window.console || !console.firebug) { (function() { - window.console = + window.console = { log: function() { logFormatted(arguments, ""); }, - + debug: function() { logFormatted(arguments, "debug"); }, - + info: function() { logFormatted(arguments, "info"); }, - + warn: function() { logFormatted(arguments, "warning"); }, - + error: function() { logFormatted(arguments, "error"); }, - + assert: function(truth, message) { if (!truth) @@ -36,16 +36,16 @@ if (!window.console || !console.firebug) { var args = []; for (var i = 1; i < arguments.length; ++i) args.push(arguments[i]); - + logFormatted(args.length ? args : ["Assertion Failure"], "error"); throw message ? message : "Assertion Failure"; } }, - + dir: function(object) { var html = []; - + var pairs = []; for (var name in object) { @@ -57,48 +57,48 @@ if (!window.console || !console.firebug) { { } } - + pairs.sort(function(a, b) { return a[0] < b[0] ? -1 : 1; }); - + html.push(''); for (var i = 0; i < pairs.length; ++i) { var name = pairs[i][0], value = pairs[i][1]; - - html.push('', + + html.push('', '', ''); } html.push('
', escapeHTML(name), ''); appendObject(value, html); html.push('
'); - + logRow(html, "dir"); }, - + dirxml: function(node) { var html = []; - + appendNode(node, html); logRow(html, "dirxml"); }, - + group: function() { logRow(arguments, "group", pushGroup); }, - + groupEnd: function() { logRow(arguments, "", popGroup); }, - + time: function(name) { timeMap[name] = (new Date()).getTime(); }, - + timeEnd: function(name) { if (name in timeMap) @@ -108,26 +108,26 @@ if (!window.console || !console.firebug) { delete timeMap[name]; } }, - + count: function() { this.warn(["count() not supported."]); }, - + trace: function() { this.warn(["trace() not supported."]); }, - + profile: function() { this.warn(["profile() not supported."]); }, - + profileEnd: function() { }, - + clear: function() { consoleBody.innerHTML = ""; @@ -137,27 +137,27 @@ if (!window.console || !console.firebug) { { toggleConsole(true); }, - + close: function() { if (frameVisible) toggleConsole(); } }; - + // ******************************************************************************************** - + var consoleFrame = null; var consoleBody = null; var commandLine = null; - + var frameVisible = false; var messageQueue = []; var groupStack = []; var timeMap = {}; - + var clPrefix = ">>> "; - + var isFirefox = navigator.userAgent.indexOf("Firefox") != -1; var isIE = navigator.userAgent.indexOf("MSIE") != -1; var isOpera = navigator.userAgent.indexOf("Opera") != -1; @@ -187,13 +187,13 @@ if (!window.console || !console.firebug) { createFrame(); else setTimeout(waitForBody, 200); - } + } function createFrame() { if (consoleFrame) return; - + window.onFirebugReady = function(doc) { window.onFirebugReady = null; @@ -205,7 +205,7 @@ if (!window.console || !console.firebug) { addEvent(commandLine, "keydown", onCommandLineKeyDown); addEvent(doc, isIE || isSafari ? "keydown" : "keypress", onKeyDown); - + consoleBody = doc.getElementById("log"); layout(); flush(); @@ -216,7 +216,7 @@ if (!window.console || !console.firebug) { consoleFrame = document.createElement("iframe"); consoleFrame.setAttribute("src", baseURL+"/firebug.html"); consoleFrame.setAttribute("frameBorder", "0"); - consoleFrame.style.visibility = (frameVisible ? "visible" : "hidden"); + consoleFrame.style.visibility = (frameVisible ? "visible" : "hidden"); consoleFrame.style.zIndex = "2147483583"; consoleFrame.style.position = document.all ? "absolute" : "fixed"; consoleFrame.style.width = "100%"; @@ -225,7 +225,7 @@ if (!window.console || !console.firebug) { consoleFrame.style.height = "200px"; document.body.appendChild(consoleFrame); } - + function getFirebugURL() { var scripts = document.getElementsByTagName("script"); @@ -238,14 +238,14 @@ if (!window.console || !console.firebug) { } } } - + function evalCommandLine() { var text = commandLine.value; commandLine.value = ""; logRow([clPrefix, text], "command"); - + var value; try { @@ -257,17 +257,17 @@ if (!window.console || !console.firebug) { console.log(value); } - + function layout() { var toolbar = consoleBody.ownerDocument.getElementById("toolbar"); var height = consoleFrame.offsetHeight - (toolbar.offsetHeight + commandLine.offsetHeight); consoleBody.style.top = toolbar.offsetHeight + "px"; consoleBody.style.height = height + "px"; - + commandLine.style.top = (consoleFrame.offsetHeight - commandLine.offsetHeight) + "px"; } - + function logRow(message, className, handler) { if (consoleBody) @@ -278,12 +278,12 @@ if (!window.console || !console.firebug) { waitForBody(); } } - + function flush() { var queue = messageQueue; messageQueue = []; - + for (var i = 0; i < queue.length; ++i) writeMessage(queue[i][0], queue[i][1], queue[i][2]); } @@ -295,13 +295,13 @@ if (!window.console || !console.firebug) { if (!handler) handler = writeRow; - + handler(message, className); - + if (isScrolledToBottom) consoleBody.scrollTop = consoleBody.scrollHeight - consoleBody.offsetHeight; } - + function appendRow(row) { var container = groupStack.length ? groupStack[groupStack.length-1] : consoleBody; @@ -333,7 +333,7 @@ if (!window.console || !console.firebug) { { groupStack.pop(); } - + // ******************************************************************************************** function logFormatted(objects, className) @@ -365,14 +365,14 @@ if (!window.console || !console.firebug) { for (var i = objIndex+1; i < objects.length; ++i) { appendText(" ", html); - + var object = objects[i]; if (typeof(object) == "string") appendText(object, html); else appendObject(object, html); } - + logRow(html, className); } @@ -380,7 +380,7 @@ if (!window.console || !console.firebug) { { var parts = []; - var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; + var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; var appenderMap = {s: appendText, d: appendInteger, i: appendInteger, f: appendFloat}; for (var m = reg.exec(format); m; m = reg.exec(format)) @@ -469,7 +469,7 @@ if (!window.console || !console.firebug) { var name = m ? m[1] : "function"; html.push('', escapeHTML(name), '()'); } - + function appendObject(object, html) { try @@ -495,7 +495,7 @@ if (!window.console || !console.firebug) { { } } - + function appendObjectFormatted(object, html) { var text = objectToString(object); @@ -504,7 +504,7 @@ if (!window.console || !console.firebug) { var m = reObject.exec(text); html.push('', m ? m[1] : text, '') } - + function appendSelector(object, html) { html.push(''); @@ -531,7 +531,7 @@ if (!window.console || !console.firebug) { var attr = node.attributes[i]; if (!attr.specified) continue; - + html.push(' ', attr.nodeName.toLowerCase(), '="', escapeHTML(attr.nodeValue), '"') @@ -543,8 +543,8 @@ if (!window.console || !console.firebug) { for (var child = node.firstChild; child; child = child.nextSibling) appendNode(child, html); - - html.push('
</', + + html.push('
</', node.nodeName.toLowerCase(), '>
'); } else @@ -558,7 +558,7 @@ if (!window.console || !console.firebug) { } // ******************************************************************************************** - + function addEvent(object, name, handler) { if (document.all) @@ -566,7 +566,7 @@ if (!window.console || !console.firebug) { else object.addEventListener(name, handler, false); } - + function removeEvent(object, name, handler) { if (document.all) @@ -574,27 +574,27 @@ if (!window.console || !console.firebug) { else object.removeEventListener(name, handler, false); } - + function cancelEvent(event) { if (document.all) event.cancelBubble = true; else - event.stopPropagation(); + event.stopPropagation(); } function onError(msg, href, lineNo) { var html = []; - + var lastSlash = href.lastIndexOf("/"); var fileName = lastSlash == -1 ? href : href.substr(lastSlash+1); - + html.push( - '', msg, '', + '', msg, '', '' ); - + logRow(html, "error"); }; @@ -607,7 +607,7 @@ if (!window.console || !console.firebug) { focusCommandLine(); else return; - + cancelEvent(event); } @@ -615,7 +615,7 @@ if (!window.console || !console.firebug) { { if (isSafari || isOpera) return; - + addEvent(document, "mousemove", onSplitterMouseMove); addEvent(document, "mouseup", onSplitterMouseUp); @@ -625,7 +625,7 @@ if (!window.console || !console.firebug) { addEvent(frames[i].document, "mouseup", onSplitterMouseUp); } } - + function onSplitterMouseMove(event) { var win = document.all @@ -635,14 +635,14 @@ if (!window.console || !console.firebug) { var clientY = event.clientY; if (win != win.parent) clientY += win.frameElement ? win.frameElement.offsetTop : 0; - + var height = consoleFrame.offsetTop + consoleFrame.clientHeight; var y = height - clientY; - + consoleFrame.style.height = y + "px"; layout(); } - + function onSplitterMouseUp(event) { removeEvent(document, "mousemove", onSplitterMouseMove); @@ -654,7 +654,7 @@ if (!window.console || !console.firebug) { removeEvent(frames[i].document, "mouseup", onSplitterMouseUp); } } - + function onCommandLineKeyDown(event) { if (event.keyCode == 13) @@ -662,10 +662,10 @@ if (!window.console || !console.firebug) { else if (event.keyCode == 27) commandLine.value = ""; } - + window.onerror = onError; addEvent(document, isIE || isSafari ? "keydown" : "keypress", onKeyDown); - + if (document.documentElement.getAttribute("debug") == "true") toggleConsole(true); })(); diff --git a/public/javascript/jquery.flash.js b/public/javascript/jquery.flash.js index e47cc2e..2608834 100644 --- a/public/javascript/jquery.flash.js +++ b/public/javascript/jquery.flash.js @@ -1,7 +1,7 @@ /** * Flash (http://jquery.lukelutman.com/plugins/flash) * A jQuery plugin for embedding Flash movies. - * + * * Version 1.0 * November 9th, 2006 * @@ -9,24 +9,24 @@ * Dual licensed under the MIT and GPL licenses. * http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/gpl-license.php - * + * * Inspired by: * SWFObject (http://blog.deconcept.com/swfobject/) * UFO (http://www.bobbyvandersluis.com/ufo/) * sIFR (http://www.mikeindustries.com/sifr/) - * - * IMPORTANT: + * + * IMPORTANT: * The packed version of jQuery breaks ActiveX control * activation in Internet Explorer. Use JSMin to minifiy * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex). * - **/ + **/ ;(function(){ - + var $$; /** - * + * * @desc Replace matching elements with a flash movie. * @author Luke Lutman * @version 1.0.1 @@ -39,7 +39,7 @@ var $$; * @type jQuery * * @cat plugins/flash - * + * * @example $('#hello').flash({ src: 'hello.swf' }); * @desc Embed a Flash movie. * @@ -54,24 +54,24 @@ var $$; * **/ $$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) { - + // Set the default block. var block = replace || $$.replace; - + // Merge the default and passed plugin options. pluginOptions = $$.copy($$.pluginOptions, pluginOptions); - + // Detect Flash. if(!$$.hasFlash(pluginOptions.version)) { // Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed). if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) { // Add the necessary flashvars (merged later). var expressInstallOptions = { - flashvars: { + flashvars: { MMredirectURL: location, MMplayerType: 'PlugIn', - MMdoctitle: jQuery('title').text() - } + MMdoctitle: jQuery('title').text() + } }; // Ask the user to update (if specified). } else if (pluginOptions.update) { @@ -86,22 +86,22 @@ $$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) { return this; } } - + // Merge the default, express install and passed html options. htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions); - + // Invoke $block (with a copy of the merged html options) for each element. return this.each(function(){ block.call(this, $$.copy(htmlOptions)); }); - + }; /** * * @name flash.copy * @desc Copy an arbitrary number of objects into a new object. * @type Object - * + * * @example $$.copy({ foo: 1 }, { bar: 2 }); * @result { foo: 1, bar: 2 }; * @@ -157,8 +157,8 @@ $$.hasFlash.playerVersion = function() { // avoid fp6 minor version lookup issues // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); - try { axo.AllowScriptAccess = 'always'; } - catch(e) { return '6,0,0'; } + try { axo.AllowScriptAccess = 'always'; } + catch(e) { return '6,0,0'; } } catch(e) {} return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; // other browsers @@ -167,7 +167,7 @@ $$.hasFlash.playerVersion = function() { if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; } - } catch(e) {} + } catch(e) {} } return '0,0,0'; }; @@ -183,7 +183,7 @@ $$.htmlOptions = { pluginspage: 'http://www.adobe.com/go/getflashplayer', src: '#', type: 'application/x-shockwave-flash', - width: 320 + width: 320 }; /** * @@ -226,7 +226,7 @@ $$.update = function(htmlOptions) { }; /** * - * @desc Convert a hash of html options to a string of attributes, using Function.apply(). + * @desc Convert a hash of html options to a string of attributes, using Function.apply(). * @example toAttributeString.apply(htmlOptions) * @result foo="bar" foo="bar" * @@ -236,11 +236,11 @@ function toAttributeString() { for(var key in this) if(typeof this[key] != 'function') s += key+'="'+this[key]+'" '; - return s; + return s; }; /** * - * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). + * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). * @example toFlashvarsString.apply(flashvarsObject) * @result foo=bar&foo=bar * @@ -250,27 +250,27 @@ function toFlashvarsString() { for(var key in this) if(typeof this[key] != 'function') s += key+'='+encodeURIComponent(this[key])+'&'; - return s.replace(/&$/, ''); + return s.replace(/&$/, ''); }; /** * * @name flash.transform * @desc Transform a set of html options into an embed tag. - * @type String + * @type String * * @example $$.transform(htmlOptions) * @result * - * Note: The embed tag is NOT standards-compliant, but it + * Note: The embed tag is NOT standards-compliant, but it * works in all current browsers. flash.transform can be - * overwritten with a custom function to generate more + * overwritten with a custom function to generate more * standards-compliant markup. * **/ $$.transform = function(htmlOptions) { htmlOptions.toString = toAttributeString; if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString; - return ''; + return ''; }; /** @@ -284,5 +284,5 @@ if (window.attachEvent) { __flash_savedUnloadHandler = function() {}; }); } - + })(); \ No newline at end of file diff --git a/public/javascript/jquery.ui-1.0/jquery.dimensions.js b/public/javascript/jquery.ui-1.0/jquery.dimensions.js index b7e6f7e..ad2bb24 100644 --- a/public/javascript/jquery.ui-1.0/jquery.dimensions.js +++ b/public/javascript/jquery.ui-1.0/jquery.dimensions.js @@ -11,33 +11,33 @@ */ (function($){ - + $.dimensions = { version: '@VERSION' }; // Create innerHeight, innerWidth, outerHeight and outerWidth methods $.each( [ 'Height', 'Width' ], function(i, name){ - + // innerHeight and innerWidth $.fn[ 'inner' + name ] = function() { if (!this[0]) return; - + var torl = name == 'Height' ? 'Top' : 'Left', // top or left borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right - + return this[ name.toLowerCase() ]() + num(this, 'padding' + torl) + num(this, 'padding' + borr); }; - + // outerHeight and outerWidth $.fn[ 'outer' + name ] = function(options) { if (!this[0]) return; - + var torl = name == 'Height' ? 'Top' : 'Left', // top or left borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right - + options = $.extend({ margin: false }, options || {}); - + return this[ name.toLowerCase() ]() + num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width') + num(this, 'padding' + torl) + num(this, 'padding' + borr) @@ -49,19 +49,19 @@ $.each( [ 'Height', 'Width' ], function(i, name){ $.each( ['Left', 'Top'], function(i, name) { $.fn[ 'scroll' + name ] = function(val) { if (!this[0]) return; - + return val != undefined ? - + // Set the scroll offset this.each(function() { this == window || this == document ? - window.scrollTo( + window.scrollTo( name == 'Left' ? val : $(window)[ 'scrollLeft' ](), name == 'Top' ? val : $(window)[ 'scrollTop' ]() ) : this[ 'scroll' + name ] = val; }) : - + // Return the scroll offset this[0] == window || this[0] == document ? self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] || @@ -74,33 +74,33 @@ $.each( ['Left', 'Top'], function(i, name) { $.fn.extend({ position: function() { var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results; - + if (elem) { // Get *real* offsetParent offsetParent = this.offsetParent(); - + // Get correct offsets offset = this.offset(); parentOffset = offsetParent.offset(); - + // Subtract element margins offset.top -= num(elem, 'marginTop'); offset.left -= num(elem, 'marginLeft'); - + // Add offsetParent borders parentOffset.top += num(offsetParent, 'borderTopWidth'); parentOffset.left += num(offsetParent, 'borderLeftWidth'); - + // Subtract the two offsets results = { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; } - + return results; }, - + offsetParent: function() { var offsetParent = this[0].offsetParent; while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') ) diff --git a/public/javascript/jquery.ui-1.0/themes/dark/dark.tree.css b/public/javascript/jquery.ui-1.0/themes/dark/dark.tree.css index a5c0f68..c979967 100644 --- a/public/javascript/jquery.ui-1.0/themes/dark/dark.tree.css +++ b/public/javascript/jquery.ui-1.0/themes/dark/dark.tree.css @@ -19,7 +19,7 @@ body.dark { font:11pt Calibri; background:#111; color:snow; } .dark .ui-tree-node-text { text-decoration:none; color:snow; - padding:0 .3em; + padding:0 .3em; } .dark .ui-tree-node-selected > .ui-tree-node-text { diff --git a/public/javascript/jquery.ui-1.0/themes/light/light.tree.css b/public/javascript/jquery.ui-1.0/themes/light/light.tree.css index c8fd0a9..cf2a7e1 100644 --- a/public/javascript/jquery.ui-1.0/themes/light/light.tree.css +++ b/public/javascript/jquery.ui-1.0/themes/light/light.tree.css @@ -19,7 +19,7 @@ body.light { font:10pt Verdana; background:#FFF; color:#111; } .light .ui-tree-node-text { text-decoration:none; color:#222; - padding:0 .3em; + padding:0 .3em; } .light .ui-tree-node-selected > .ui-tree-node-text { diff --git a/public/javascript/jquery.ui-1.0/ui.resizable.js b/public/javascript/jquery.ui-1.0/ui.resizable.js index 169c2f0..f2a6999 100644 --- a/public/javascript/jquery.ui-1.0/ui.resizable.js +++ b/public/javascript/jquery.ui-1.0/ui.resizable.js @@ -3,10 +3,10 @@ //Make nodes selectable by expression $.extend($.expr[':'], { resizable: "(' '+a.className+' ').indexOf(' ui-resizable ')" }); - + $.fn.resizable = function(o) { return this.each(function() { - if(!$(this).is(".ui-resizable")) new $.ui.resizable(this,o); + if(!$(this).is(".ui-resizable")) new $.ui.resizable(this,o); }); } @@ -17,20 +17,20 @@ eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-resizable")) jQuery.data(this, "ui-resizable")["'+cur+'"](a); if(jQuery(this.parentNode).is(".ui-resizable")) jQuery.data(this, "ui-resizable")["'+cur+'"](a); }); }'); $.fn["resizable"+cur.substr(0,1).toUpperCase()+cur.substr(1)] = f; }; - + //get instance method $.fn.resizableInstance = function() { if($(this[0]).is(".ui-resizable") || $(this[0].parentNode).is(".ui-resizable")) return $.data(this[0], "ui-resizable"); return false; }; - - + + $.ui.resizable = function(el,o) { - + var options = {}; o = o || {}; $.extend(options, o); //Extend and copy options this.element = el; var self = this; //Do bindings $.data(this.element, "ui-resizable", this); - + if(options.proxy) { var helper = function(e,that) { var helper = $('
').css({ @@ -41,31 +41,31 @@ top: that.options.co.top }).addClass(that.options.proxy); return helper; - } + } } else { - var helper = "original"; + var helper = "original"; } - + //Destructive mode wraps the original element if(el.nodeName.match(/textarea|input|select|button|img/i)) options.destructive = true; if(options.destructive) { - + $(el).wrap('
'); var oel = el; el = el.parentNode; this.element = el; - + //Move margins to the wrapper $(el).css({ marginLeft: $(oel).css("marginLeft"), marginTop: $(oel).css("marginTop"), marginRight: $(oel).css("marginRight"), marginBottom: $(oel).css("marginBottom")}); $(oel).css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); - + o.proportionallyResize = o.proportionallyResize || []; o.proportionallyResize.push(oel); - + var b = [parseInt($(oel).css('borderTopWidth')),parseInt($(oel).css('borderRightWidth')),parseInt($(oel).css('borderBottomWidth')),parseInt($(oel).css('borderLeftWidth'))]; } else { - var b = [0,0,0,0]; + var b = [0,0,0,0]; } - + if(options.destructive || !$(".ui-resizable-handle",el).length) { //Adding handles (disabled not so common ones) var t = function(a,b) { $(el).append("
"); }; @@ -78,9 +78,9 @@ //t('ne','top: '+b[0]+'px; right: '+b[1]+'px;'); //t('nw','top: '+b[0]+'px; left: '+b[3]+'px;'); } - - - + + + //If other elements should be modified, we have to copy that array options.modifyThese = []; if(o.proportionallyResize) { @@ -88,42 +88,42 @@ var propRes = options.proportionallyResize; for(var i in propRes) { - + if(propRes[i].constructor == String) propRes[i] = $(propRes[i], el); - + if(!$(propRes[i]).length) continue; - - + + var x = $(propRes[i]).width() - $(el).width(); var y = $(propRes[i]).height() - $(el).height(); options.modifyThese.push([$(propRes[i]),x,y]); } } - + options.handles = {}; if(!o.handles) o.handles = { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }; - + for(var i in o.handles) { options.handles[i] = o.handles[i]; } //Copying the object - + for(var i in options.handles) { - + if(options.handles[i].constructor == String) options.handles[i] = $(options.handles[i], el); - + if(!$(options.handles[i]).length) continue; - + $(options.handles[i]).bind('mousedown', function(e) { self.interaction.options.axis = this.resizeAxis; })[0].resizeAxis = i; - + } - + //If we want to auto hide the elements if(o.autohide) $(this.element).addClass("ui-resizable-autohide").hover(function() { $(this).removeClass("ui-resizable-autohide"); }, function() { if(self.interaction.options.autohide && !self.interaction.init) $(this).addClass("ui-resizable-autohide"); }); - + $.extend(options, { helper: helper, @@ -139,24 +139,24 @@ return false; }, _start: function(h,p,c,t,e) { - self.start.apply(t, [self, e]); // Trigger the start callback + self.start.apply(t, [self, e]); // Trigger the start callback }, _beforeStop: function(h,p,c,t,e) { self.stop.apply(t, [self, e]); // Trigger the stop callback }, _drag: function(h,p,c,t,e) { self.drag.apply(t, [self, e]); // Trigger the start callback - } + } }); - + //Initialize mouse interaction this.interaction = new $.ui.mouseInteraction(el,options); - + //Add the class for themeing $(this.element).addClass("ui-resizable"); - + } - + $.extend($.ui.resizable.prototype, { plugins: {}, prepareCallbackObj: function(self) { @@ -165,7 +165,7 @@ resizable: self, axis: self.options.axis, options: self.options - } + } }, destroy: function() { $(this.element).removeClass("ui-resizable").removeClass("ui-resizable-disabled"); @@ -185,31 +185,31 @@ this.options.originalPositionValues = $(this.element).position(); this.options.modifyThese.push([$(this.helper),0,0]); - - $(that.element).triggerHandler("resizestart", [e, that.prepareCallbackObj(this)], this.options.start); + + $(that.element).triggerHandler("resizestart", [e, that.prepareCallbackObj(this)], this.options.start); return false; }, - stop: function(that, e) { - + stop: function(that, e) { + var o = this.options; - $(that.element).triggerHandler("resizestop", [e, that.prepareCallbackObj(this)], this.options.stop); + $(that.element).triggerHandler("resizestop", [e, that.prepareCallbackObj(this)], this.options.stop); if(o.proxy) { $(this.element).css({ width: $(this.helper).width(), height: $(this.helper).height() }); - + if(o.originalPosition == "absolute" || o.originalPosition == "fixed") { $(this.element).css({ top: $(this.helper).css("top"), left: $(this.helper).css("left") - }); + }); } } return false; - + }, drag: function(that, e) { @@ -222,7 +222,7 @@ var nw = p[0] + (this.pos[0] - co.left); var nh = p[1] + (this.pos[1] - co.top); - + if(o.axis) { switch(o.axis) { case 'e': @@ -234,36 +234,36 @@ case 'n': case 'ne': - + if(!o.proxy && (o.originalPosition != "absolute" && o.originalPosition != "fixed")) return false; - + if(o.axis == 'n') nw = p[0]; var mod = (this.pos[1] - co.top); nh = nh - (mod*2); mod = nh <= o.minHeight ? p[1] - o.minHeight : (nh >= o.maxHeight ? 0-(o.maxHeight-p[1]) : mod); $(this.helper).css('top', co.top + mod); break; - + case 'w': case 'sw': if(!o.proxy && (o.originalPosition != "absolute" && o.originalPosition != "fixed")) return false; - + if(o.axis == 'w') nh = p[1]; var mod = (this.pos[0] - co.left); nw = nw - (mod*2); mod = nw <= o.minWidth ? p[0] - o.minWidth : (nw >= o.maxWidth ? 0-(o.maxWidth-p[0]) : mod); $(this.helper).css('left', co.left + mod); break; - + case 'nw': - + if(!o.proxy && (o.originalPosition != "absolute" && o.originalPosition != "fixed")) return false; - + var modx = (this.pos[0] - co.left); nw = nw - (modx*2); modx = nw <= o.minWidth ? p[0] - o.minWidth : (nw >= o.maxWidth ? 0-(o.maxWidth-p[0]) : modx); - + var mody = (this.pos[1] - co.top); nh = nh - (mody*2); mody = nh <= o.minHeight ? p[1] - o.minHeight : (nh >= o.maxHeight ? 0-(o.maxHeight-p[1]) : mody); @@ -271,24 +271,24 @@ left: co.left + modx, top: co.top + mody }); - + break; - } + } } if(e.shiftKey) nh = nw * (p[1]/p[0]); - + if(o.minWidth) nw = nw <= o.minWidth ? o.minWidth : nw; if(o.minHeight) nh = nh <= o.minHeight ? o.minHeight : nh; - + if(o.maxWidth) nw = nw >= o.maxWidth ? o.maxWidth : nw; if(o.maxHeight) nh = nh >= o.maxHeight ? o.maxHeight : nh; - + if(e.shiftKey) nh = nw * (p[1]/p[0]); var modifier = $(that.element).triggerHandler("resize", [e, that.prepareCallbackObj(this)], o.resize); if(!modifier) modifier = {}; - + for(var i in this.options.modifyThese) { var c = this.options.modifyThese[i]; c[0].css({ @@ -297,7 +297,7 @@ }); } return false; - + } }); diff --git a/public/javascript/jquery.ui-1.0/ui.tablesorter.js b/public/javascript/jquery.ui-1.0/ui.tablesorter.js index 5bd1871..0f1b071 100644 --- a/public/javascript/jquery.ui-1.0/ui.tablesorter.js +++ b/public/javascript/jquery.ui-1.0/ui.tablesorter.js @@ -286,7 +286,7 @@ if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); } return $tableHeaders; - + }; function checkCellColSpan(table, headerArr, row) { @@ -350,7 +350,7 @@ var l = a.length; for(var i=0; i < l; i++) { if(a[i][0] == v) { - return true; + return true; } } return false; @@ -546,7 +546,7 @@ // stop normal event by returning false return false; } - // cancel selection + // cancel selection }).mousedown(function() { if(config.cancelSelection) { this.onselectstart = function() {return false}; diff --git a/public/javascript/jquery.ui-1.0/ui.tabs.js b/public/javascript/jquery.ui-1.0/ui.tabs.js index fd00090..9ceeed9 100644 --- a/public/javascript/jquery.ui-1.0/ui.tabs.js +++ b/public/javascript/jquery.ui-1.0/ui.tabs.js @@ -119,7 +119,7 @@ this.$containers = $([]); var self = this, o = this.options; - + this.$tabs.each(function(i, a) { // inline tab if (a.hash && a.hash.replace('#', '')) { // safari 2 reports '#' for an empty hash @@ -282,7 +282,7 @@ this.blur(); return false; } - + // if tab may be closed if (o.unselect) { if ($li.is('.' + o.selectedClass)) { diff --git a/public/javascript/login.js b/public/javascript/login.js index e8c4a70..4fb231f 100644 --- a/public/javascript/login.js +++ b/public/javascript/login.js @@ -1,5 +1,5 @@ $.getScript( '/javascript/base.js'); -$(document).ready( function() { +$(document).ready( function() { // return out of password $('input[type="password"]').blur( function() { $(this).parents('form').submit(); diff --git a/public/javascript/quick_add.js b/public/javascript/quick_add.js index 7acb33c..6781ceb 100644 --- a/public/javascript/quick_add.js +++ b/public/javascript/quick_add.js @@ -1,4 +1,4 @@ -$(document).ready( function() { +$(document).ready( function() { $('div.quick_add a.open').click( function() { $(this).hide(); $(this).next().slideDown(); }); diff --git a/public/javascript/slideshow.js b/public/javascript/slideshow.js index 16ad4ba..af94902 100644 --- a/public/javascript/slideshow.js +++ b/public/javascript/slideshow.js @@ -1,53 +1,53 @@ $(document).ready( function(){ - + // center a slide in the slideshow ... NOT for use otherwise ... var centerSlide = function() { // this is triggered off the CONTENT of the slide, not the slide itself, // so we first must get the slide and then the frame ... var slide = $(this).parent(); var frame = slide.parent(); - + // next, make it possible to get the width/height of the slide ... slide.css({visibility:'hidden',display:'block',position:'absolute'}); - + // we can use jQuery for the frame because it was displayed to begin with // but for some reason I get weird values using CSS height/width for the slide // so we will just use the offset* functions var top = Math.round(( frame.height() - slide[0].offsetHeight ) / 2); var left = Math.round(( frame.width() - slide[0].offsetWidth ) / 2); - + // set the padding, and restore the slide to display: none ... and we're done - slide.css({ + slide.css({ 'padding-top': top + 'px', 'padding-left': left+'px', visibility:'visible', display:'none' }); }; - // first, go ahead and center non-images - + // first, go ahead and center non-images - // use of first-child ensures that we don't call it multiple times - //$('div.slide > *:first-child:not(img)').each( centerSlide ); - + //$('div.slide > *:first-child:not(img)').each( centerSlide ); + // do the same thing for images on the load event to ensure that the // browser has the image actually loaded ... $('div.slide > img:first-child').load( centerSlide ); - + // whent the img for the loading slide is itself loaded, go ahead // and show it while we wait for the rest of the images to load $('div.slide.loading img').load( function() { $(this).parent().show(); } ); - + // once the first few images have loaded (or all of them if there are // fewer than 3), go ahead and get rid of the loading slide and start // the slideshow, using the cycle plug-in ... note there must be at least // one image in the slideshow, which is okay, because it is for a gallery - var images = $('div.slide img'); + var images = $('div.slide img'); console.log(images); var size = images.size(); console.log(size); var obj = images.eq( ( size > 3 )? 3 : size ); console.log(obj); //images.eq( ( size > 3 )? 3 : size ).load( function() { - obj.load( function() { + obj.load( function() { console.log('loading'); - $('div.slide.loading').fadeOut(3000, function() { + $('div.slide.loading').fadeOut(3000, function() { $(this).remove(); $('div.slide:first-child').fadeIn(3000, function() { $('div.gallery div.frame').cycle({ diff --git a/public/javascript/tiny_mce/plugins/style/props.htm b/public/javascript/tiny_mce/plugins/style/props.htm index fa8d492..bc15e18 100644 --- a/public/javascript/tiny_mce/plugins/style/props.htm +++ b/public/javascript/tiny_mce/plugins/style/props.htm @@ -136,8 +136,8 @@ - - + +
 
diff --git a/public/javascript/wysiwyg.js b/public/javascript/wysiwyg.js index 036d5b6..018b042 100644 --- a/public/javascript/wysiwyg.js +++ b/public/javascript/wysiwyg.js @@ -11,12 +11,12 @@ tinyMCE.init({ mode : "none", theme : "advanced", theme_advanced_buttons2: '', theme_advanced_buttons3: '', relative_urls: false -}); +}); $(document).ready( function() { var wysiwyg = function() { var el; if ( $(this).val() == 'wysiwyg' ) { - tinyMCE.execCommand('mceAddControl',false,'wysiwyg'); + tinyMCE.execCommand('mceAddControl',false,'wysiwyg'); } else if ( el = tinyMCE.getInstanceById('wysiwyg') ) { tinyMCE.execCommand('mceRemoveControl',false,'wysiwyg'); $('#wysiwyg_container').hide(); diff --git a/resources/blog.rb b/resources/blog.rb index 1944d11..42cbbd3 100644 --- a/resources/blog.rb +++ b/resources/blog.rb @@ -4,7 +4,7 @@ module Resources class Blog < Default - # feed removed till we have a more understanding of extension matching + # feed removed till we have a more understanding of extension matching on( :get, { :feed => [ 'blog', :name ] }, :ext => [ :xml, :rss ] ) do view.feed( :blog => controller.find( basename( captured.name ) ) ) end diff --git a/resources/default.rb b/resources/default.rb index 6ae9051..0d277a4 100644 --- a/resources/default.rb +++ b/resources/default.rb @@ -17,7 +17,7 @@ class Default end on( :get, :edit => [ 'admin', :resource, :name ] ) do - response.content_type = 'text/html' ; + response.content_type = 'text/html' ; view.editor( singular => controller.find( captured.name ) ) end @@ -31,7 +31,7 @@ class Default private def show - response.content_type = 'text/html' ; + response.content_type = 'text/html' ; if request.accept[0] == 'text/html-fragment' view.content( :story => controller.find( captured.name )) else diff --git a/resources/image.rb b/resources/image.rb index bb5b8c5..0832357 100644 --- a/resources/image.rb +++ b/resources/image.rb @@ -1,18 +1,18 @@ module Pages - + module Resources - + class Image < Default - + # special image handling to deal with image resizing on( :get, :get => [ 'images', { :asset => true } ] ) do # example of http freshness - images are valid for 1 hour - rack-cache will return the cached copy. response['Cache-Control'] = 'max-age=3600' unless response['Cache-Control'] controller.get( captured.asset * '/' ) end - + end - + end end diff --git a/resources/map.rb b/resources/map.rb index c83399b..1f95e6f 100644 --- a/resources/map.rb +++ b/resources/map.rb @@ -2,10 +2,10 @@ module Pages module Resources class Map include Waves::Resources::Mixin - + # default to story if nothing else matches on( true ) { to( :story ) } - + # otherwise assume we are matching against a resource on( true, [ :resource, { :rest => true } ] ) { to( captured.resource ) } @@ -15,31 +15,31 @@ class Map # special URL just for login and authenticating on( [ :get, :post ], [ 'login' ] ) { to( :user ) } - + # logout on( :get, [ 'logout' ] ) { to( :user ) } - + # register on( :get, :register => [ 'user' ] ) { to( :user ) } - + # images on( :get, [ 'images' , true ] ) { to( :image ) } - + # whatever as an extension comes from public or theme directory. # on( :get, true, :ext => [ :css, :js, :swf, :gif, :png, :jpg, :htm, :ico ] ) { to( :media ) } # on( :get, true, :ext => [ :* ] ) { to( :media ) } on( true, [ :resource, { :rest => true } ], :ext => [ :rss, :xml ] ) { to( captured.resource ) } - + # before anything else, check the accepts headers and route accordingly on( :get, true, :accept => [ :rss ] ) { to( :blog ) } - + # updating status on social network on( true, [ 'social' , :name ] ) { to( :social ) } - + # # special URL just payment notification # on( :post, [ 'donation' ] ) { to( :payment ) } # on( [ :get, :post ], [ 'payment-notification' ] ) { to( :payment ) } - + end end end \ No newline at end of file diff --git a/resources/payment.rb b/resources/payment.rb index 6ef7486..effda00 100644 --- a/resources/payment.rb +++ b/resources/payment.rb @@ -1,12 +1,12 @@ module Pages - + module Resources - + class Payment < Default - + # special URL just payment return url -> get with all the parameters related to the payment in the query - on( [ :get, :post ], [ 'payment' ] ) { - + on( [ :get, :post ], [ 'payment' ] ) { + info = { :key => params['transactionId'], :transaction_date => params['transactionDate'], :email => params['buyerEmail'], @@ -17,10 +17,10 @@ class Payment < Default :operation => params['operation'] } controller.store( info ) #saving the payment info in a yml file with name = transactionId - + #status == PI : indicates the payment has been initiated. #status == PS : indicates that the payment transaction was successful. - #status == PR : indicates the reserve transaction was successful. + #status == PR : indicates the reserve transaction was successful. if (params['status'] == 'PI' || params['status'] == 'PS' || params['status'] == 'PR') redirect('/thank-you') else @@ -30,8 +30,8 @@ class Payment < Default #status == SE : indicates a temporary system unavailable error redirect('/donation-failed') end - } - + } + # special URL just payment notification -> post that confirms the payment on( [ :get, :post ], [ 'payment-notification' ] ) { info = { :key => query['transactionId'], @@ -46,12 +46,12 @@ class Payment < Default controller.notification( info ) #updating the payment info with the new information. #redirect('/thank-you') #just return something. } - + #placeholder for a fake donation - on( :post, [ 'donation' ] ) { + on( :post, [ 'donation' ] ) { redirect('/thank-you') } - + end end end diff --git a/resources/site.rb b/resources/site.rb index 97cf87f..4be7d13 100644 --- a/resources/site.rb +++ b/resources/site.rb @@ -1,43 +1,43 @@ module Pages - + module Resources - + class Site - + include Waves::Resources::Mixin include Pages::ResponseMixin - + on( true, [ 'admin', :resource ] ) { to( captured.resource ) } on( true, [ 'admin', :resource, { :rest => true } ] ) { to( captured.resource ) } - + # admin access on( :get, :admin => [ 'admin' ] ) { response.content_type = 'text/html' ; view.admin } - + # updating admin properties on( :post, :admin => [ 'admin' ] ) { controller.update( model_name ); redirect( paths.admin ) } - - - on( :get, [ 'admin', 'twitter' ] ) { + + + on( :get, [ 'admin', 'twitter' ] ) { message = site.default_message || '' domain = site['domain'] || '' user = site.twitter_account || '' pwd = site.twitter_password || '' view(:social).configure( :user => user, :pwd => pwd, :url => domain ) } - + # admin auth before( [ 'admin', { :rest => true } ] ) { authenticated? } before( [ 'admin' ] ) { authenticated? } - + private - + def authenticated? redirect( paths( :user ).login ) unless session[:user] && session[:role] == 'Admin' end - + end - + end - + end \ No newline at end of file diff --git a/resources/social.rb b/resources/social.rb index 0a0e50b..e17503c 100644 --- a/resources/social.rb +++ b/resources/social.rb @@ -1,38 +1,38 @@ require 'lib/twitter_client' module Pages - + module Resources - + class Social < Default - on( :post, [ 'social' , 'twitter' ] ) { + on( :post, [ 'social' , 'twitter' ] ) { resp = tweet tweet_result = (resp[:error]) ? 'Failed' : 'Completed' redirect('/home') } - + # on( :post, [ 'admin', 'social' , 'twitter' ] ) { # resp = tweet # tweet_result = (resp[:error]) ? 'Failed' : 'Completed' # view.spread( :result => tweet_result ) # } - - on( :get, [ 'admin', 'social' , 'twitter' ] ) { + + on( :get, [ 'admin', 'social' , 'twitter' ] ) { message = site.default_message || '' domain = site['domain'] || '' user = site.twitter_account || '' pwd = site.twitter_password || '' view.spread( :user => user, :pwd => pwd, :url => domain, :message => message ) } - - on( :get, [ 'social' , 'twitter' ] ) { + + on( :get, [ 'social' , 'twitter' ] ) { message = params[:message] || '' url = params[:url] || '' view.spread( :message => message, :url => url ) } - - private - + + private + def tweet user = params[:user] pwd = params[:password] @@ -45,9 +45,9 @@ def tweet return { :error => "#{e.message}" } end end - + end - + end - + end diff --git a/resources/user.rb b/resources/user.rb index 242d9c9..21b9982 100644 --- a/resources/user.rb +++ b/resources/user.rb @@ -1,7 +1,7 @@ module Pages - + module Resources - + class User < Default # create a new user from the register page @@ -9,44 +9,44 @@ class User < Default controller.create['key'] redirect(paths.login) end - + #on( :get, :edit => [ 'user', :name ] ) do # view.editor( singular => controller.find( captured.name ) ) #end - + #on( :post, :update => [ 'user', :name ] ) do # controller.update( captured.name ) and redirect( paths( :site ).admin ) #end - + #on( :delete, :delete => [ 'user', :name ] ) do # controller.delete( captured.name ) and redirect( paths( :site ).admin ) #end - + # login post on( :post, :authenticate => [ 'login' ] ) { controller.authenticate } - + # login page on( :get, :login => [ 'login' ] ) { response.content_type = 'text/html' ; view.login } - + # logout on( :get, [ 'logout' ] ) { controller.logout } - + # register page on( :get, :register => [ 'user' ] ) { response.content_type = 'text/html' ; view.register } - + # user accessing personal page - on( :get, :role => [ 'user', :name ] ) { view.show( singular => controller.find( captured.name ) )} + on( :get, :role => [ 'user', :name ] ) { view.show( singular => controller.find( captured.name ) )} # authentication, avoiding logged user to jump into another account before( [ 'user', :name ] ) { authenticated? captured.name } - + private - + def authenticated?(name) redirect( paths.login ) unless session[:user] == name end end - + end - + end diff --git a/templates/blog/content.mab b/templates/blog/content.mab index f3e317d..2c0a5f8 100644 --- a/templates/blog/content.mab +++ b/templates/blog/content.mab @@ -8,24 +8,24 @@ p.subtitle @blog.summary if @blog.summary div.entries do @blog.entries.sort_by(&:published).reverse[0..4].each do | entry | - + h2 do a entry.title, :href => "/#{entry.name}/" end - + if entry.author and (Date === entry.published or Time === entry.published) p.byline do text 'by '; span.author entry.author text ' on '; span.date entry.published.strftime('%b %d, %Y') end end - + format( :content => entry.summary, :format => entry.format ) - + p do a 'More ...', :href => "/#{entry.name}/" end - + end end diff --git a/templates/blog/editor.mab b/templates/blog/editor.mab index 585fa14..3f4deb1 100644 --- a/templates/blog/editor.mab +++ b/templates/blog/editor.mab @@ -1,19 +1,19 @@ -layout :admin, :title => 'Edit Blog', :name => 'blog-editor', - :styles => %w( base editor container ), - :scripts => %w( - jquery.ui-1.0/ui.mouse - jquery.ui-1.0/ui.draggable jquery.ui-1.0/ui.draggable.ext +layout :admin, :title => 'Edit Blog', :name => 'blog-editor', + :styles => %w( base editor container ), + :scripts => %w( + jquery.ui-1.0/ui.mouse + jquery.ui-1.0/ui.draggable jquery.ui-1.0/ui.draggable.ext jquery.ui-1.0/ui.droppable jquery.ui-1.0/ui.droppable.ext - jquery.blockUI base editor container + jquery.blockUI base editor container ) do - form :action => url, :method => 'POST' do + form :action => url, :method => 'POST' do buttons [ { :label => 'Save Changes', :type => :submit }, { :label => 'Delete This Blog', :type => :delete, :href => url } ] div.main do properties do - property :label => 'Title', :name => 'blog.title', + property :label => 'Title', :name => 'blog.title', :type => :text, :value => @blog.title, :help => 'The title of the blog will show up in captions.' div.property :id => 'blog-entries' do @@ -40,11 +40,11 @@ layout :admin, :title => 'Edit Blog', :name => 'blog-editor', property :label => 'Author', :name => 'blog.author', :type => :choice, :value => @blog.author, :options => site.authors.map { |author| [ author, author ] }, :help => "'Author' is the person responsible for maintaining this content." - property :label => 'Published', :name => 'blog.published', + property :label => 'Published', :name => 'blog.published', :type => 'date', :value => @blog.published, :help => "When was this content first published? Just type in a date." << " Example: apr 12, 2007." - property :label => 'Tags', :type => 'text', + property :label => 'Tags', :type => 'text', :name => 'blog.tags', :value => @blog.tags, :help => "Words you would associate with this content, separated by commas." << " Example: sports, basketball, Michael Jordan." diff --git a/templates/blog/patch.erb b/templates/blog/patch.erb index 4ea4710..bc29e01 100644 --- a/templates/blog/patch.erb +++ b/templates/blog/patch.erb @@ -5,9 +5,9 @@ - <%= @blog.subtitle %> + <%= Erubis::XmlHelper.escape_xml @blog.subtitle %> en - - <% - @blog.entries.sort_by(&:published).reverse.each do | entry | + + <% + @blog.entries.sort_by(&:published).reverse.each do | entry | %> - <%= entry.title %> diff --git a/templates/blog/quick_add.mab b/templates/blog/quick_add.mab index 91ddcac..19f8f15 100644 --- a/templates/blog/quick_add.mab +++ b/templates/blog/quick_add.mab @@ -1,4 +1,4 @@ -div.quick_add do +div.quick_add do a.open 'Add a new blog.', :href => '#' form.blog :action => '/admin/blog/', :method => 'post' do a.close do diff --git a/templates/blog/show.mab b/templates/blog/show.mab index 9d21034..67bc649 100644 --- a/templates/blog/show.mab +++ b/templates/blog/show.mab @@ -1,9 +1,9 @@ layout :show, :title => @blog.title do div.main.blog :id => @name do - + view( :blog, :content, :blog => @blog ) - + end end diff --git a/templates/calendar/content.mab b/templates/calendar/content.mab index a5ae024..ce3505d 100644 --- a/templates/calendar/content.mab +++ b/templates/calendar/content.mab @@ -8,23 +8,23 @@ p.subtitle @calendar.summary if @calendar.summary div.events do @calendar.events.sort_by(&:date).reverse[0..4].each do | event | - + h2 do a event.title, :href => "/#{event.name}/" end - + if (Date === entry.published or Time === entry.published) p.byline do text ' on '; span.date event.date.strftime('%A, %b %d, %Y %H:%m %z') end end - + format( :content => event.content, :format => event.format ) - + p do a 'More ...', :href => "/#{event.name}/" end - + end end diff --git a/templates/calendar/editor.mab b/templates/calendar/editor.mab index 4ca1f9d..e726e10 100644 --- a/templates/calendar/editor.mab +++ b/templates/calendar/editor.mab @@ -1,19 +1,19 @@ -layout :admin, :title => 'Edit Calendar', :name => 'calendar-editor', - :styles => %w( base editor container ), - :scripts => %w( - jquery.ui-1.0/ui.mouse - jquery.ui-1.0/ui.draggable jquery.ui-1.0/ui.draggable.ext +layout :admin, :title => 'Edit Calendar', :name => 'calendar-editor', + :styles => %w( base editor container ), + :scripts => %w( + jquery.ui-1.0/ui.mouse + jquery.ui-1.0/ui.draggable jquery.ui-1.0/ui.draggable.ext jquery.ui-1.0/ui.droppable jquery.ui-1.0/ui.droppable.ext - jquery.blockUI base editor container + jquery.blockUI base editor container ) do - form :action => url, :method => 'POST' do + form :action => url, :method => 'POST' do buttons [ { :label => 'Save Changes', :type => :submit }, { :label => 'Delete This Blog', :type => :delete, :href => url } ] div.main do properties do - property :label => 'Title', :name => 'calendar.title', + property :label => 'Title', :name => 'calendar.title', :type => :text, :value => @calendar.title div.property :id => 'calendar-events' do label 'Events' @@ -36,7 +36,7 @@ layout :admin, :title => 'Edit Calendar', :name => 'calendar-editor', end # div.main div.sidebar do properties do - property :label => 'Tags', :type => 'text', + property :label => 'Tags', :type => 'text', :name => 'calendar.tags', :value => @calendar.tags, :help => "Words you would associate with this content, separated by commas." << " Example: conferences, meetings, mindshare." diff --git a/templates/calendar/quick_add.mab b/templates/calendar/quick_add.mab index b41474b..966d27c 100644 --- a/templates/calendar/quick_add.mab +++ b/templates/calendar/quick_add.mab @@ -1,4 +1,4 @@ -div.quick_add do +div.quick_add do a.open 'Add a new Calendar.', :href => '#' form.calendar :action => '/admin/calendar/', :method => 'post' do a.close do diff --git a/templates/calendar/show.mab b/templates/calendar/show.mab index 0c8331f..5e022cc 100644 --- a/templates/calendar/show.mab +++ b/templates/calendar/show.mab @@ -1,9 +1,9 @@ layout :show, :title => @calendar.label do div.main.calendar :id => @name do - + view( :calendar, :content, :calendar => @calendar ) - + end end diff --git a/templates/catalog/show.mab b/templates/catalog/show.mab index d8a3faa..5df2deb 100644 --- a/templates/catalog/show.mab +++ b/templates/catalog/show.mab @@ -17,20 +17,20 @@ layout :show, :title => @catalog.title do div.product do h2 product.title - + image = find( :image, product.image ) a.image :href => "/images/#{image.name}" do img :src => "/images/#{image.name}?size=thumb" p 'Click to enlarge.' end - div.overview do - + div.overview do + format( :content => product.description, :format => product.format ) - p do + p do # numeric formatting regex from tom copeland - strong 'Price:' + strong 'Price:' text '$'<< product.price.to_s.gsub(/(\d\d$)/,'.\1'). gsub(/(\d)(?=\d{3}+(?:\.|$))(\d{3}\..*)?/,'\1,\2') end @@ -39,11 +39,11 @@ layout :show, :title => @catalog.title do input :type => 'hidden', :name => 'item_name_1', :value => product.label input :type => 'hidden', :name => 'item_description_1', :value => product.summary input :type => 'hidden', :name => 'item_quantity_1', :value => '1' - input :type => 'hidden', :name => 'item_price_1', + input :type => 'hidden', :name => 'item_price_1', :value => product.price.to_s.gsub(/(\d\d$)/,'.\1') if product.shipping && product.shipping != 0 input :type => 'hidden', :name => 'ship_method_name_1', :value => 'USPS' - input :type => 'hidden', :name => 'ship_method_price_1', + input :type => 'hidden', :name => 'ship_method_price_1', :value => product.shipping end input :type => 'hidden', :name => '_charset_', :value => 'utf-8' @@ -53,7 +53,7 @@ layout :show, :title => @catalog.title do end end - + end end \ No newline at end of file diff --git a/templates/event/editor.mab b/templates/event/editor.mab index 65bacda..869f811 100644 --- a/templates/event/editor.mab +++ b/templates/event/editor.mab @@ -1,4 +1,4 @@ -layout :admin, :title => 'Edit Event', :name => 'event-editor', :styles => %w( base editor ), +layout :admin, :title => 'Edit Event', :name => 'event-editor', :styles => %w( base editor ), :scripts => %w( jquery.blockUI tiny_mce/tiny_mce base editor wysiwyg ) do form :action => url, :method => 'POST' do buttons [ @@ -7,7 +7,7 @@ layout :admin, :title => 'Edit Event', :name => 'event-editor', :styles => %w( b ] div.main do properties do - property :label => 'Title', :name => 'event.title', + property :label => 'Title', :name => 'event.title', :type => :text, :value => @event.title, :help => "The title will show up in the title bar of the browser window and " << "be displayed as the top-level heading at the beginning of the event." @@ -17,13 +17,13 @@ layout :admin, :title => 'Edit Event', :name => 'event-editor', :styles => %w( b end div.sidebar do properties do - unless @event.format == 'mab' - property :label => 'Format', :name => 'event.format', :type => :choice, + unless @event.format == 'mab' + property :label => 'Format', :name => 'event.format', :type => :choice, :value => @event.format, :options => model( :event ).formats, :help => "Use 'Formatted Text' unless you know what you're doing. :)" end - property :label => 'Date', :name => 'event.date', - :type => 'date', :value => @event.date, + property :label => 'Date', :name => 'event.date', + :type => 'date', :value => @event.date, :help => "When this event happens? Just type in the date." << "
Example: apr 12, 2007." property :label => 'Tags', :type => 'text', :name => 'event.tags', :value => @event.tags, diff --git a/templates/event/quick_add.mab b/templates/event/quick_add.mab index 1762065..ca42933 100644 --- a/templates/event/quick_add.mab +++ b/templates/event/quick_add.mab @@ -1,4 +1,4 @@ -div.quick_add do +div.quick_add do a.open 'Add a new event.', :href => '#' form.event :action => '/admin/event/', :method => 'post' do a.close do diff --git a/templates/form/date.mab b/templates/form/date.mab index 261b0cd..9b07d06 100644 --- a/templates/form/date.mab +++ b/templates/form/date.mab @@ -1,9 +1,9 @@ div.property :id => @name.gsub(/\./,'-') do label @label - input({ - :type => :text, + input({ + :type => :text, :class => @required ? 'date required' : 'date' , - :name => @name, :value => @value + :name => @name, :value => @value }.merge( @options||{} ) ) p.help do text @help diff --git a/templates/form/file.mab b/templates/form/file.mab index 2db2298..5755cd7 100644 --- a/templates/form/file.mab +++ b/templates/form/file.mab @@ -1,9 +1,9 @@ div.property :id => @name do label @label - input.file({ - :type => :file, + input.file({ + :type => :file, :class => @required ? 'required' : '' , - :name => @name, :value => @value + :name => @name, :value => @value }.merge( @options||{} ) ) p.help do text @help diff --git a/templates/form/text.mab b/templates/form/text.mab index 3a88ed4..3ca68c7 100644 --- a/templates/form/text.mab +++ b/templates/form/text.mab @@ -1,9 +1,9 @@ div.property :id => @name.gsub(/\./,'-') do label @label - input.text({ - :type => :text, + input.text({ + :type => :text, :class => @required ? 'text required' : 'text' , - :name => @name, :value => @value + :name => @name, :value => @value }.merge( @options||{} ) ) p.help do text @help diff --git a/templates/gallery/editor.mab b/templates/gallery/editor.mab index 251e3ac..061ca58 100644 --- a/templates/gallery/editor.mab +++ b/templates/gallery/editor.mab @@ -1,23 +1,23 @@ -layout :admin, :title => 'Edit Gallery', :name => 'gallery-editor', - :styles => %w( base editor container ), - :scripts => %w( - jquery.ui-1.0/ui.mouse - jquery.ui-1.0/ui.draggable jquery.ui-1.0/ui.draggable.ext +layout :admin, :title => 'Edit Gallery', :name => 'gallery-editor', + :styles => %w( base editor container ), + :scripts => %w( + jquery.ui-1.0/ui.mouse + jquery.ui-1.0/ui.draggable jquery.ui-1.0/ui.draggable.ext jquery.ui-1.0/ui.droppable jquery.ui-1.0/ui.droppable.ext - jquery.blockUI base editor container + jquery.blockUI base editor container ) do - form :action => url, :method => 'POST' do + form :action => url, :method => 'POST' do buttons [ { :label => 'Save Changes', :type => :submit }, { :label => 'Delete This Gallery', :type => :delete, :href => url } ] div.main do properties do - property :label => 'Title', :name => 'gallery.title', + property :label => 'Title', :name => 'gallery.title', :type => :text, :value => @gallery.title, :help => 'The title of the gallery will show up in captions.' - property :label => 'Display', :name => 'gallery.display', - :type => :choice, :options => models('gallery').displays, :value => @gallery['display'], + property :label => 'Display', :name => 'gallery.display', + :type => :choice, :options => models('gallery').displays, :value => @gallery['display'], :help => 'This controls how you want to present the gallery - ' << 'as a photo album where you can click on an image to zoom in, ' << 'or as a slideshow, where the images display one at a time.' @@ -47,11 +47,11 @@ layout :admin, :title => 'Edit Gallery', :name => 'gallery-editor', property :label => 'Author', :name => 'gallery.author', :type => :choice, :value => @gallery.author, :options => site.authors.map { |author| [ author, author ] }, :help => "'Author' is the person responsible for maintaining this content." - property :label => 'Published', :name => 'gallery.published', - :type => 'date', :value => @gallery.published, + property :label => 'Published', :name => 'gallery.published', + :type => 'date', :value => @gallery.published, :help => "When was this content first published? Just type in a date." << " Example: apr 12, 2007." - property :label => 'Tags', :type => 'text', + property :label => 'Tags', :type => 'text', :name => 'gallery.tags', :value => @gallery.tags, :help => "Words you would associate with this content, separated by commas." << " Example: sports, basketball, Michael Jordan." @@ -62,4 +62,3 @@ layout :admin, :title => 'Edit Gallery', :name => 'gallery-editor', end end end - \ No newline at end of file diff --git a/templates/gallery/quick_add.mab b/templates/gallery/quick_add.mab index 411b418..bb3b10b 100644 --- a/templates/gallery/quick_add.mab +++ b/templates/gallery/quick_add.mab @@ -1,4 +1,4 @@ -div.quick_add do +div.quick_add do a.open 'Add a new gallery.', :href => '#' form.gallery :action => '/admin/gallery/', :method => 'post' do a.close do diff --git a/templates/gallery/show.mab b/templates/gallery/show.mab index b7e5f0c..35c9333 100644 --- a/templates/gallery/show.mab +++ b/templates/gallery/show.mab @@ -14,16 +14,16 @@ html do link :type => 'text/css', :rel => 'stylesheet', :href => '/css/album.css' end end - + body do - div.page do + div.page do [ :banner, :sidebar ].each { |name| self << story( name ) rescue nil } div.main.gallery :id => @name do - + h1 @gallery.title if @gallery.title? - + images = @gallery.images case @gallery[:display] when 'Slideshow' @@ -45,12 +45,12 @@ html do end end end - + div.footer do story :footer end end end - + end \ No newline at end of file diff --git a/templates/image/list.mab b/templates/image/list.mab index 9cec9f4..31e2c09 100644 --- a/templates/image/list.mab +++ b/templates/image/list.mab @@ -3,7 +3,7 @@ ul do @images.sort_by(&:label).each do |image| li do a :href => "/admin/image/#{image.key}/" do - img :src => "/images/#{image.key}?size=thumb", + img :src => "/images/#{image.key}?size=thumb", :title => image.label, :alt => image.label end end diff --git a/templates/image/quick_add.mab b/templates/image/quick_add.mab index 56fdfb0..e058170 100644 --- a/templates/image/quick_add.mab +++ b/templates/image/quick_add.mab @@ -1,6 +1,6 @@ -div.quick_add do +div.quick_add do a.open 'Upload a new image.', :href => '#' - form.image :action => '/admin/image/', :method => 'post', + form.image :action => '/admin/image/', :method => 'post', :enctype => 'multipart/form-data' do a.close do img :src => '/images/icons/lime/16x16/box_closed.png', @@ -10,7 +10,7 @@ div.quick_add do property :label => 'Title', :name => 'image.title', :type => :text, :value => '', :required => true, :help => 'The title of the for use in listings and captions.' - property :label => 'Select File ...', :name => 'image.file', + property :label => 'Select File ...', :name => 'image.file', :type => :file, :required => true, :options => { :size => 10 } end buttons [{ :label => 'Upload Image', :type => :submit }] diff --git a/templates/layouts/errors.mab b/templates/layouts/errors.mab index 8ac7306..50221bc 100644 --- a/templates/layouts/errors.mab +++ b/templates/layouts/errors.mab @@ -8,9 +8,9 @@ html do text 'p { font-size: 24px; }' end end - + body do layout_content end - + end \ No newline at end of file diff --git a/templates/layouts/show.mab b/templates/layouts/show.mab index 8d55c64..fa82ee7 100644 --- a/templates/layouts/show.mab +++ b/templates/layouts/show.mab @@ -1,5 +1,5 @@ doctype( :html4_strict ) -html do +html do head do story( :head, :title => @title ) end diff --git a/templates/rss/show.mab b/templates/rss/show.mab index b1e216d..a8783c1 100644 --- a/templates/rss/show.mab +++ b/templates/rss/show.mab @@ -1,19 +1,19 @@ # hack!! dependencies on SimpleRSS gem.. need to be more generic if @feed.is_a? SimpleRSS - if @feed.entries[0].pubDate + if @feed.entries[0].pubDate sort_f = lambda { |x| x.pubDate } #rss date is in pubDate tag else sort_f = lambda { |x| x.published } #atom date is in published tag end - + div.feed.entries do - + @feed.entries.sort_by { |f| sort_f.call(f) } .reverse[0..4].each do | entry | h2 do entry.title end - + div.content do if entry.content.nil? unescape_html( entry.description ) if entry.description @@ -21,7 +21,7 @@ if @feed.is_a? SimpleRSS unescape_html( entry.content ) if entry.content end end - + p do a 'More ...', :href => "#{entry.link}/" end diff --git a/templates/site/admin.mab b/templates/site/admin.mab index 6fb2790..da31c27 100644 --- a/templates/site/admin.mab +++ b/templates/site/admin.mab @@ -1,11 +1,11 @@ -layout :admin, :name => 'admin', :title => 'Site Administration', +layout :admin, :name => 'admin', :title => 'Site Administration', :subtitle => 'Click on a link or image below to edit it.', :styles => %w( base admin quick_add social), :scripts => %w( base admin quick_add ) do admin_layouts = site.send(session[:role]) div.main do admin_layouts.each{ |layout| view( :site, layout.to_sym ) - } + } end end diff --git a/templates/site/editor.mab b/templates/site/editor.mab index 8c2d5cf..a39018f 100644 --- a/templates/site/editor.mab +++ b/templates/site/editor.mab @@ -2,10 +2,10 @@ link :type => 'text/css', :rel => 'stylesheet', :href => '/media/css/thickbox.cs script :type => 'text/javascript', :src => '/media/javascript/thickbox-compressed.js' form.editor :action => '/admin', :method => 'post' do properties do - property :label => 'Title', :name => 'site.title', :type => :text, + property :label => 'Title', :name => 'site.title', :type => :text, :value => site.title, :required => true, :help => 'The title is how your site will display in listings, like search results.' - property :label => 'Description', :name => 'site.description', :type => :textarea, + property :label => 'Description', :name => 'site.description', :type => :textarea, :value => site.description, :required => true, :size => :small, :help => 'The description displays in search results and helps ' << 'people determine whether to "click-through" to view your site.' @@ -14,7 +14,7 @@ form.editor :action => '/admin', :method => 'post' do # property :label => 'Twitter Password', :name => 'site.twitter_password', :type => :password, # :value => site.twitter_password, :required => false a.thickbox :href => "/admin/social/twitter?" do - + end div.twitter do p do diff --git a/templates/site/login.mab b/templates/site/login.mab index 8629869..a524a4f 100644 --- a/templates/site/login.mab +++ b/templates/site/login.mab @@ -5,11 +5,11 @@ layout :admin, :title => 'Login', :name => 'login', p.warning 'Login failed. Please try again.' if @retry form :action =>request.url, :method => 'POST' do properties do - property :label => 'Email', :type => 'text', + property :label => 'Email', :type => 'text', :name => 'site.email', :value => '', :help => 'Your email address used as your login. Example: jdoe@gmail.com.' - property :label => 'Password', :type => 'password', - :name => 'site.password', :value => '', + property :label => 'Password', :type => 'password', + :name => 'site.password', :value => '', :help => "If you've forgotten your password, " + "email us." end diff --git a/templates/story/quick_add.mab b/templates/story/quick_add.mab index c9776a5..bc99819 100644 --- a/templates/story/quick_add.mab +++ b/templates/story/quick_add.mab @@ -1,4 +1,4 @@ -div.quick_add do +div.quick_add do a.open 'Add a new story.', :href => '#' form.story :action => '/admin/story/', :method => 'post' do a.close do diff --git a/templates/story/show.mab b/templates/story/show.mab index 47c78a1..51c6c8a 100644 --- a/templates/story/show.mab +++ b/templates/story/show.mab @@ -1,7 +1,7 @@ layout :show, :title => @story.title do div.main.story :id => @story.name do view( :story, :content, :story => @story ) - end + end # if @story.comments # h3 @story.comment_number # view :comment, :list, :comments => @story.comments diff --git a/templates/user/editor.mab b/templates/user/editor.mab index 1f76e04..938b2ef 100644 --- a/templates/user/editor.mab +++ b/templates/user/editor.mab @@ -1,4 +1,4 @@ -layout :admin, :title => 'Edit Profile', :name => 'user-editor', :styles => %w( base editor ), +layout :admin, :title => 'Edit Profile', :name => 'user-editor', :styles => %w( base editor ), :scripts => %w( jquery.blockUI tiny_mce/tiny_mce base editor wysiwyg ) do form :action => url, :method => 'POST' do buttons [ @@ -7,9 +7,9 @@ layout :admin, :title => 'Edit Profile', :name => 'user-editor', :styles => %w( ] div.main do properties do - property :label => 'Email', :name => 'user.email', + property :label => 'Email', :name => 'user.email', :type => :text, :value => @user.email, :required => true - property :label => 'Password', :name => 'user.password', + property :label => 'Password', :name => 'user.password', :type => :password, :value => @user.password, :required => true property :label => 'Role', :name => 'user.role', :type => :choice, :value => @user.role, :options => models('user').roles diff --git a/templates/user/login.mab b/templates/user/login.mab index 1a3bcd1..4dc37d7 100644 --- a/templates/user/login.mab +++ b/templates/user/login.mab @@ -5,11 +5,11 @@ layout :admin, :title => 'Login', :name => 'login', p.warning 'Login failed. Please try again.' if @retry form :action =>request.url, :method => 'POST' do properties do - property :label => 'Email', :type => 'text', + property :label => 'Email', :type => 'text', :name => 'user.email', :value => '', :help => 'Your email address used as your login. Example: jdoe@gmail.com.' - property :label => 'Password', :type => 'password', - :name => 'user.password', :value => '', + property :label => 'Password', :type => 'password', + :name => 'user.password', :value => '', :help => "If you've forgotten your password, " + "email us." end diff --git a/templates/user/quick_add.mab b/templates/user/quick_add.mab index c18e801..7e084bb 100644 --- a/templates/user/quick_add.mab +++ b/templates/user/quick_add.mab @@ -1,4 +1,4 @@ -div.quick_add do +div.quick_add do a.open 'Create a new user.', :href => '#' form.user :action => '/admin/user/', :method => 'post' do a.close do diff --git a/templates/user/register.mab b/templates/user/register.mab index bdf4c4a..8d138dd 100644 --- a/templates/user/register.mab +++ b/templates/user/register.mab @@ -5,25 +5,25 @@ layout :admin, :title => 'Register', :name => 'register', p.warning 'Sorry, email already in use.' if @retry form :action =>request.url, :method => 'POST' do properties do - property :label => 'Email', :type => 'text', + property :label => 'Email', :type => 'text', :name => 'user.email', :value => '' - property :label => 'Password', :type => 'password', + property :label => 'Password', :type => 'password', :name => 'user.password', :value => '' - property :label => 'Firstname', :type => 'text', + property :label => 'Firstname', :type => 'text', :name => 'user.firstname', :value => '' - property :label => 'Middle Initial', :type => 'text', + property :label => 'Middle Initial', :type => 'text', :name => 'user.middle', :value => '' - property :label => 'Lastname', :type => 'text', + property :label => 'Lastname', :type => 'text', :name => 'user.lastname', :value => '' - property :label => 'Address', :type => 'text', + property :label => 'Address', :type => 'text', :name => 'user.address', :value => '' - property :label => 'City', :type => 'text', + property :label => 'City', :type => 'text', :name => 'user.city', :value => '' - property :label => 'State', :type => 'text', + property :label => 'State', :type => 'text', :name => 'user.state', :value => '' - property :label => 'Zip', :type => 'text', + property :label => 'Zip', :type => 'text', :name => 'user.zip', :value => '' - property :label => 'Phone Number', :type => 'text', + property :label => 'Phone Number', :type => 'text', :name => 'user.phone', :value => '' property :label => 'Role', :type => 'text', :name => 'user.role', :value => 'Member' end diff --git a/templates/user/show.mab b/templates/user/show.mab index e179c87..208f8e3 100644 --- a/templates/user/show.mab +++ b/templates/user/show.mab @@ -1,11 +1,11 @@ layout :show, :title => @user.username do div.main.profile :id => @user .username do view( :user, :content, :user => @user ) - end + end user_layouts = site.send(session[:role]) div.main.user do user_layouts.each{ |layout| view( :site, layout.to_sym ) - } + } end end \ No newline at end of file