elastic_rails 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENCE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Ivan Torres (@mexpolk)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,8 @@
1
+ LICENCE
2
+ Manifest
3
+ README.rdoc
4
+ Rakefile
5
+ bin/elasticss
6
+ javascripts/elastic.js
7
+ stylesheets/elastic.css
8
+ stylesheets/elastic.print.css
@@ -0,0 +1,19 @@
1
+ = Elastic CSS Framework Plugin for Rails
2
+
3
+ == What is Elastic?
4
+
5
+ A simple css framework to layout web-based interfaces, based on the printed layout techniques of 4 columns but with capabilities to unlimited column combinations. and capacity to make elastic, fixed and liquid layout easily.
6
+
7
+ == Installation
8
+
9
+ Install the gem in your machine (this is required only once):
10
+
11
+ sudo gem install elastic_css
12
+
13
+ and from your Rails application root directory run:
14
+
15
+ elasticss
16
+
17
+ == About Elastic
18
+
19
+ Current stable version is 2.0.2. For more information about Elastic please visit http://elasticss.com
@@ -0,0 +1,10 @@
1
+ require 'echoe'
2
+
3
+ Echoe.new('elastic_rails', '2.0.2') do |e|
4
+ e.description = "."
5
+ e.url = "http://github.com/mexpolk/elastic_rails"
6
+ e.author = "Ivan Torres"
7
+ e.email = "mexpolk@gmail.com"
8
+ e.ignore_pattern = ["tmp/*", "script/*"]
9
+ e.development_dependencies = []
10
+ end
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+
5
+ # Load Rails environment
6
+ ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development'
7
+
8
+ begin
9
+
10
+ require File.expand_path('config/environment')
11
+
12
+ puts 'Copying files...'
13
+
14
+ javascripts_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
15
+ stylesheets_dir = File.join(RAILS_ROOT, 'public', 'stylesheets')
16
+
17
+ javascripts = Dir[File.join(File.dirname(__FILE__), '..', '/javascripts/', '*.js')]
18
+ stylesheets = Dir[File.join(File.dirname(__FILE__), '..', '/stylesheets/', '*.css')]
19
+
20
+ FileUtils.cp(javascripts, javascripts_dir)
21
+ FileUtils.cp(stylesheets, stylesheets_dir)
22
+
23
+ puts 'files copied successfully'
24
+
25
+ rescue LoadError
26
+ puts 'Couldn\'t find Rails. Exiting'
27
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{elastic_rails}
5
+ s.version = "2.0.2"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Ivan Torres"]
9
+ s.date = %q{2009-10-21}
10
+ s.default_executable = %q{elasticss}
11
+ s.description = %q{.}
12
+ s.email = %q{mexpolk@gmail.com}
13
+ s.executables = ["elasticss"]
14
+ s.extra_rdoc_files = ["README.rdoc", "bin/elasticss"]
15
+ s.files = ["LICENCE", "Manifest", "README.rdoc", "Rakefile", "bin/elasticss", "javascripts/elastic.js", "stylesheets/elastic.css", "stylesheets/elastic.print.css", "elastic_rails.gemspec"]
16
+ s.homepage = %q{http://github.com/mexpolk/elastic_rails}
17
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Elastic_rails", "--main", "README.rdoc"]
18
+ s.require_paths = ["lib"]
19
+ s.rubyforge_project = %q{elastic_rails}
20
+ s.rubygems_version = %q{1.3.5}
21
+ s.summary = %q{.}
22
+
23
+ if s.respond_to? :specification_version then
24
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
+ s.specification_version = 3
26
+
27
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
+ else
29
+ end
30
+ else
31
+ end
32
+ end
@@ -0,0 +1,13 @@
1
+ /*
2
+ Elastic CSS Framework
3
+ Released under the MIT, BSD, and GPL Licenses.
4
+ More information http://elasticss.com
5
+
6
+ Elastic Engine
7
+
8
+ @author Fernando Trasviña (@azendal)
9
+ @core team Sergio de la Garza (@sgarza), Javier Ayala (@javi_ayala)
10
+ @copyright 2009 Elastic CSS framework
11
+ @version 2.0.2
12
+ */
13
+ (function($){var CStyle=function(element,pseudoElement){if(window.getComputedStyle){return window.getComputedStyle(element,pseudoElement);}else{return element.currentStyle;}};var width=function(element){var width=CStyle(element).width;if(width=='auto'||width.indexOf('px')<0){return $(element).width();}else{return parseFloat(width);}};window.Elastic=function Elastic(context){var r,ra,i,j,k,l,il,jl,kl,ll,econs,econ,econw,econclass,ecols,ecol,ecolclass,eg,egml,egcl,egnl,ecrw,ecw,escol,rp,ig,efcs,efcsw,eecs,eecsw,eecw,eecrw,ecs,ecsw,ec,ecclass,eecfw,ecolminw,ecolmaxw,egreg=/(^|\s+)on\-(\d+)(\s+|$)/,esreg=/(^|\s+)span\-(\d+)(\s+|$)/,eareg=/(^|\s+)adaptive\-(\d+)\-(\d+)(\s+|$)/;eg=[];egcl=egnl=0;econs=$.find('.columns',context);for(i=0,il=econs.length;i<il;i++){econ=econs[i];econclass=econ.className;if(econclass.indexOf('on-')>-1&&egreg.test(econclass)){egml=Number(RegExp.$2);}else{egml=$.find('> .column, > .container > .column',econ).length;}econ=$.find('> .container',econ)[0]||econ;econw=width(econ);ecrw=econw/egml;ecw=Math.round(ecrw);if(econclass.indexOf('adaptive-')>-1&&eareg.test(econclass)){ecolminw=Number(RegExp.$2);ecolmaxw=Number(RegExp.$3);if(ecw>ecolmaxw){while(ecw>ecolmaxw){egml=egml+1;ecrw=econw/egml;ecw=Math.round(ecrw);}}else if(ecw<ecolminw){while(ecw<ecolminw){egml=egml-1;ecrw=econw/egml;ecw=Math.round(ecrw);}}}ecols=$.find('> .column',econ);for(j=0,jl=ecols.length;j<jl;j++){efcs=[];eecs=[];ecs=[];rp=ig=efcsw=ecsw=0;ecol=ecols[j];ecolclass=ecol.className;escol=1;if(ecolclass.indexOf('span-')>-1&&esreg.test(ecolclass)){escol=Number(RegExp.$2);}ecol.escol=escol=((escol<=egml)?escol:egml);egnl+=escol;if(egnl==egml||j==(jl-1)||ecolclass.indexOf('final')>-1){eg.push(ecol);egcl=0;rp=1;}else if(egnl<egml){eg.push(ecol);egcl=egnl;}else if(egnl>egml){egcl=escol;rp=1;ig=1;}if(rp){for(k=0,kl=eg.length;k<kl;k++){ec=eg[k];ecclass=ec.className;if(ecclass.indexOf('fixed')>-1){efcs.push(ec);efcsw+=width(ec);}else if(ecclass.indexOf('elastic')>-1){eecs.push(ec);}else{ecs.push(ec);if(ec==eg[kl-1]){ec.style.width=Math.round(ecrw*ec.escol)+'px';}else{ec.style.width=Math.round(ecw*ec.escol)+'px';}ecsw=ecsw+width(ec);}}ll=eecs.length;if(ll>0){eecfw=econw-(ecsw+efcsw);eecrw=eecfw/ll;eecw=Math.round(eecrw);eecsw=eecw*ll;for(l=0;l<ll;l++){eecs[l].style.width=eecw+'px';}if(eecsw>eecfw){ra=eecsw-eecfw+1;for(r=1;r<ra;r++){eecs[eecs.length-r].style.width=(eecw-1)+'px';}}else if(eecsw<eecfw){ra=eecfw-eecsw+1;for(r=1;r<ra;r++){eecs[eecs.length-r].style.width=(eecw+1)+'px';}}var tcw=0;for(var f=0;f<ll-1;f++){tcw+=Number(eecs[f].style.width.replace('px',''));}eecs[ll-1].style.width=(econw-(ecsw+efcsw+(tcw)))+'px';}else if(ecol.escol==egml&&efcs.length===0){ecol.style.width=econw+'px';}else if(ecs.length>0&&efcs.length===0&&egnl==egml){if(ecsw>econw){ra=ecsw-econw+1;for(r=1;r<ra;r++){ecs[ecs.length-r].style.width=((ecw-1)*ecs[ecs.length-r].escol)+'px';}}else if(ecsw<econw){ra=econw-ecsw+1;for(r=1;r<ra;r++){ecs[ecs.length-r].style.width=((ecw+1)*ecs[ecs.length-r].escol)+'px';}}var tcw=0;for(var f=0;f<ecs.length-1;f++){tcw+=Number(ecs[f].style.width.replace('px',''));}ec.style.width=(econw-(tcw))+'px';}else if(egnl<egml&&ecolclass.indexOf('final')>-1){ecol.style['margin'+((econclass.indexOf('inverted')>-1)?'Left':'Right')]=(econw-ecsw-efcsw)+'px';}eg=[];egnl=0;}if(ig){eg=[ecol];egnl=escol;}}}for(i in Elastic.helpers){if(Elastic.helpers.hasOwnProperty(i)){Elastic.helpers[i](context);}}};var Elastic=window.Elastic;Elastic.version='2.0.2';Elastic.reset=function Elastic_reset(context){var doc=$(document);doc.trigger('elastic:beforeReset');var i,w,wl,h,hl,p,pl,m,ml;h=$.find('.same-height > *, .full-height, .elastic-height',context);for(i=0,hl=h.length;i<hl;i++){h[i].style.height='';}p=$.find('.vertical-center, .center, .bottom',context);for(i=0,pl=p.length;i<pl;i++){p[i].parentNode.style.paddingTop='';p[i].parentNode.style.height='';}w=$.find('.column:not(.fixed), .full-width',context);for(i=0,wl=w.length;i<wl;i++){w[i].style.width='';}m=$.find('.column.final',context);for(i=0,ml=m.length;i<ml;i++){m[i].style.marginLeft='';m[i].style.marginRight='';}doc.trigger('elastic:reset');};Elastic.refresh=function Elastic_refresh(context){var doc=$(document);doc.trigger('elastic:beforeRefresh');Elastic.reset(context);Elastic(context);doc.trigger('elastic:refresh');};Elastic.configuration={refreshOnResize:true};Elastic.helpers={'full-width':function Elastic_helper_fullWidth(context){var i,$el;var els=$.find('.full-width',context);var elsl=els.length;for(i=0;i<elsl;i++){$el=$(els[i]);$el.width($el.parent().width()-($el.outerWidth(true)-$el.width()));}},'same-height':function Elastic_helper_sameHeight(context){$('.same-height',context).each(function(){var columns=$('> *',this);var maxHeight=0;columns.each(function(){var currentHeight=$(this).outerHeight(true);maxHeight=(maxHeight>currentHeight)?maxHeight:currentHeight;}).each(function(){$(this).css('height',maxHeight);});});},'full-height':function Elastic_helper_fullHeight(context){$('.full-height',context).each(function(){var _this=$(this);_this.css('height',$(this.parentNode).height()-(_this.outerHeight(true)-_this.height()));});},'elastic-height':function Elastic_helper_elasticHeight(context){$('.elastic-height',context).each(function(){var _this=$(this);var h=0;$('> *:not(.elastic-height)',this.parentNode).each(function(){h+=$(this).outerHeight(true);});_this.css('height',Math.round(_this.parent().height()-h));Elastic.refresh(this);});},'center':function Elastic_helper_center(context){$('.vertical-center, .center',context).each(function(){var parentNode=$(this.parentNode);var paddingTop=Math.round((parentNode.height()-$(this).outerHeight(true))/2);parentNode.css({paddingTop:paddingTop+'px',height:(parentNode.css('height'))?(parentNode.outerHeight()-paddingTop):''});});},'bottom':function Elastic_helper_bottom(context){$('.bottom',context).each(function(){var parentNode=$(this.parentNode);var paddingTop=Math.round(parentNode.height()-$(this).outerHeight(true));parentNode.css({paddingTop:paddingTop+'px',height:(parentNode.css('height'))?(parentNode.outerHeight()-paddingTop):''});});}};$(document).bind('elastic:beforeInitialize',function(){var r=/(^|\s+)display\s+([\w\_\-\d]+)(\s+|$)/;$('.display').each(function Elastic_layout(){r.test(this.className);var c='.position-'+RegExp.$2;$(c).removeClass(c).appendTo(this);});});})(jQuery);jQuery(window).bind('load',function(){var doc=jQuery(document);var iw=document.body.clientWidth;doc.trigger('elastic:beforeInitialize');Elastic();if(iw!=document.body.clientWidth){Elastic.refresh();}jQuery(window).bind('resize',function Elastic_resizeHandler(){if(Elastic.configuration.refreshOnResize){Elastic.refresh();}});doc.bind('elastic',Elastic.refresh);doc.trigger('elastic:initialize');});
@@ -0,0 +1,17 @@
1
+ /*
2
+ Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.net/yui/license.txt
5
+ version: 3.0.0pr1
6
+ */
7
+ html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td {margin:0;padding:0;}table {border-collapse:collapse;border-spacing:0;}fieldset,img {border:0;}address,caption,cite,code,dfn,em,strong,th,var {font-style:normal;font-weight:normal;}li {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6 {font-size:100%;font-weight:normal;}q:before,q:after {content:'';}abbr,acronym {border:0;font-variant:normal;}sup {vertical-align:text-top;}sub {vertical-align:text-bottom;}input,textarea,select {font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select {*font-size:100%;}legend {color:#000;}h1 {font-size : 138.5%; }h2 {font-size : 123.1%; }h3 {font-size : 108%; }h1,h2,h3 {margin : 1em 0;}h1,h2,h3,h4,h5,h6,strong {font-weight : bold; }abbr,acronym {border-bottom : 1px dotted #000;cursor : help;} em {font-style : italic;}blockquote,ul,ol,dl {margin : 1em;}ol,ul,dl {margin-left : 2em;}ol li {list-style : decimal outside;}ul li {list-style : disc outside;}dl dd {margin-left : 1em;}th {font-weight : bold;text-align : center;}caption {margin-bottom : .5em;text-align : center;}p,fieldset,table,pre {margin-bottom : 1em;}input[type=text],input[type=password],textarea{width : 12.25em;*width : 11.9em;}body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea {font:99% arial,helvetica,clean,sans-serif;}table {font-size:inherit;font:100%;}pre,code,kbd,samp,tt {font-family:monospace;*font-size:108%;}
8
+
9
+ /*
10
+ Elastic CSS Framework
11
+ Released under the MIT, BSD, and GPL Licenses.
12
+ More information http://elasticss.com
13
+
14
+ @author Fernando Trasvi�a (@azendal)
15
+ @core team Sergio de la Garza (@sgarza), Javier Ayala (@javi_ayala)
16
+ */
17
+ .unit:after,.container:after,.columns:after,.column:after,.clearfix:after{content:" ";display:block;height:0;clear:both;visibility:hidden;}.unit,.container,.columns,.column,.clearfix{display:block;*zoom:1;*display:inline-block;}.full-height{display:block;}.same-height{display:block;}.elastic-height{height:0;}.horizontal-center{margin:0 auto;}.vertical-center{/* margin:auto 0; */display:block;}.center{/* margin:auto */margin:0 auto;}.column{float:left;}.column.final{display:block;}.column.fixed{width:auto;}.column.elastic{display:block;}.inverted>.column,.inverted>.container>.column{float:right;}.on-2.columns>.column:not(.fixed),.on-2.columns>.container>.column:not(.fixed){width:50%;}.on-3.columns>.column:not(.fixed),.on-3.columns>.container>.column:not(.fixed){width:33.33%;}.on-3.columns>.column.span-2,.on-3.columns>.container>.column.span-2{width:66.66%;}.on-4.columns>.column:not(.fixed),.on-4.columns>.container>.column:not(.fixed){width:25%;}.on-4.columns>.column.span-2,.on-4.columns>.container>.column.span-2{width:50%;}.on-4.columns>.column.span-3,.on-4.columns>.container>.column.span-2{width:75%;}
@@ -0,0 +1 @@
1
+ .print-only{display:none;}.no-print{display:none;}.no-print-content{visibility:hidden;}.print-only,div.print-only{display:block;}span.print-only,label.print-only{display:inline;}table.print-only{display:table;}tr.print-only{display:table-row;}td.print-only{display:table-cell;}
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: elastic_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Ivan Torres
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-21 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: .
17
+ email: mexpolk@gmail.com
18
+ executables:
19
+ - elasticss
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.rdoc
24
+ - bin/elasticss
25
+ files:
26
+ - LICENCE
27
+ - Manifest
28
+ - README.rdoc
29
+ - Rakefile
30
+ - bin/elasticss
31
+ - javascripts/elastic.js
32
+ - stylesheets/elastic.css
33
+ - stylesheets/elastic.print.css
34
+ - elastic_rails.gemspec
35
+ has_rdoc: true
36
+ homepage: http://github.com/mexpolk/elastic_rails
37
+ licenses: []
38
+
39
+ post_install_message:
40
+ rdoc_options:
41
+ - --line-numbers
42
+ - --inline-source
43
+ - --title
44
+ - Elastic_rails
45
+ - --main
46
+ - README.rdoc
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "1.2"
60
+ version:
61
+ requirements: []
62
+
63
+ rubyforge_project: elastic_rails
64
+ rubygems_version: 1.3.5
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: .
68
+ test_files: []
69
+