startups 0.0.3.3 → 0.0.3.4

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.
Files changed (34) hide show
  1. data/rails_generators/startup/USAGE +11 -0
  2. data/rails_generators/startup/startup_generator.rb +23 -0
  3. data/rails_generators/startup_content/USAGE +11 -0
  4. data/rails_generators/startup_content/startup_content_generator.rb +41 -0
  5. data/rails_generators/startup_content/templates/content_controller.rb +7 -0
  6. data/rails_generators/startup_content/templates/content_controller_test.rb +14 -0
  7. data/rails_generators/startup_content/templates/content_helper.rb +3 -0
  8. data/rails_generators/startup_content/templates/example.html.erb +3 -0
  9. data/rails_generators/startup_content/templates/help.html.erb +3 -0
  10. data/rails_generators/startup_content/templates/home.html.erb +4 -0
  11. data/rails_generators/startup_layout/USAGE +11 -0
  12. data/rails_generators/startup_layout/startup_layout_generator.rb +48 -0
  13. data/rails_generators/startup_layout/templates/app/helpers/layout_helper.rb +71 -0
  14. data/rails_generators/startup_layout/templates/app/views/layouts/_startup_layout_footer.html.erb +6 -0
  15. data/rails_generators/startup_layout/templates/app/views/layouts/_startup_layout_header.html.erb +4 -0
  16. data/rails_generators/startup_layout/templates/app/views/layouts/startup_layout.html.erb +54 -0
  17. data/rails_generators/startup_layout/templates/public/images/blank.gif +0 -0
  18. data/rails_generators/startup_layout/templates/public/javascripts/startup_application.js +42 -0
  19. data/rails_generators/startup_layout/templates/public/javascripts/startup_iepngfix.js +173 -0
  20. data/rails_generators/startup_layout/templates/public/javascripts/startup_imgSizer.js +61 -0
  21. data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout.css +21 -0
  22. data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout_ie6.css +13 -0
  23. data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout_ie7.css +5 -0
  24. data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout_iepngfix.htc +198 -0
  25. data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout_master.css +293 -0
  26. data/rails_generators/startup_layout/templates/public/stylesheets/startup_layout_reset.css +47 -0
  27. data/rails_generators/startup_layout/templates/public/stylesheets/startup_white.css +23 -0
  28. data/rails_generators/startup_nav/USAGE +12 -0
  29. data/rails_generators/startup_nav/startup_nav_generator.rb +35 -0
  30. data/rails_generators/startup_nav/templates/_nav.html.erb +7 -0
  31. data/rails_generators/startup_nav/templates/nav.css +36 -0
  32. data/rails_generators/startup_nav/templates/nav_helper.rb +76 -0
  33. data/startups.gemspec +2 -2
  34. metadata +35 -3
@@ -0,0 +1,11 @@
1
+ Description:
2
+ The startup generator runs all of the startup generators, creating a ready-to-go wireframe layout with navigation and example files.
3
+
4
+ Examples:
5
+ script/generate startup
6
+
7
+
8
+ #TODO UPDATE THIS OUTPUT
9
+ Template: app/views/layouts/application.html.erb
10
+ Stylesheet: public/stylesheets/startup.css
11
+ Helper: app/helpers/startup_helper.rb
@@ -0,0 +1,23 @@
1
+ require 'startups'
2
+
3
+ class StartupGenerator < Rails::Generator::Base
4
+
5
+ def manifest
6
+ record do |m|
7
+ m.generate('startup_content')
8
+ m.generate('startup_layout')
9
+ m.generate('startup_nav')
10
+ end
11
+ end
12
+
13
+ protected
14
+
15
+ def banner
16
+ <<-EOS
17
+ Runs all of the startup generators, creating a ready-to-go wireframe layout with navigation and example files.
18
+
19
+ USAGE: #{$0} #{spec.name}
20
+ EOS
21
+ end
22
+
23
+ end
@@ -0,0 +1,11 @@
1
+ Description:
2
+ The startup_content generator creates a content controller for home and other non-rest pages.
3
+
4
+ Examples:
5
+ script/generate startup_content
6
+
7
+
8
+ #TODO UPDATE THIS OUTPUT
9
+ Template: app/views/layouts/application.html.erb
10
+ Stylesheet: public/stylesheets/startup.css
11
+ Helper: app/helpers/startup_helper.rb
@@ -0,0 +1,41 @@
1
+ require 'startups'
2
+
3
+ class StartupContentGenerator < Rails::Generator::Base
4
+
5
+ def manifest
6
+ record do |m|
7
+ m.directory 'app/helpers'
8
+ m.directory 'app/controllers'
9
+ m.directory 'app/views/content'
10
+ m.directory 'test/functional'
11
+
12
+ m.file "content_controller.rb", "app/controllers/content_controller.rb"
13
+ m.file "home.html.erb", "app/views/content/home.html.erb"
14
+ m.file "help.html.erb", "app/views/content/help.html.erb"
15
+ m.file "example.html.erb", "app/views/content/example.html.erb"
16
+ m.file "content_helper.rb", "app/helpers/content_helper.rb"
17
+ m.file "content_controller_test.rb", "test/functional/content_controller_test.rb"
18
+
19
+ m.route %{
20
+ map.with_options(:controller => "content") do |content_map|
21
+ content_map.help 'help', :action => 'help'
22
+ content_map.placeholder 'placeholder/:name', :action => 'placeholder'
23
+ end }
24
+ m.route 'map.root :controller => "content", :action => "home"'
25
+
26
+ # example
27
+ # m.route :name => 'version', :controller => 'version', :action => 'display_version'
28
+ end
29
+ end
30
+
31
+ protected
32
+
33
+ def banner
34
+ <<-EOS
35
+ Creates content controller for home and other non-rest pages.
36
+
37
+ USAGE: #{$0} #{spec.name}
38
+ EOS
39
+ end
40
+
41
+ end
@@ -0,0 +1,7 @@
1
+ class ContentController < ApplicationController
2
+
3
+ def placeholder
4
+ render :action => params[:name]
5
+ end
6
+
7
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class ContentControllerTest < ActionController::TestCase
4
+
5
+ # def setup
6
+ # setup_test_data
7
+ # login_user
8
+ # end
9
+
10
+ # Replace this with your real tests.
11
+ test "the truth" do
12
+ assert true
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ module ContentHelper
2
+
3
+ end
@@ -0,0 +1,3 @@
1
+ <% layout_options :nav => :example, :heading => "Example Page Heading", :title => "Example Page Window Title", :crumbs => [link_to('Home',root_url),'example crumb'] %>
2
+
3
+ Blah Blah Blah
@@ -0,0 +1,3 @@
1
+ <% layout_options :nav => :help, :heading => "Help" %>
2
+
3
+ Blah Blah Blah
@@ -0,0 +1,4 @@
1
+ <% layout_options :nav => :home, :heading => "Home Page" %>
2
+
3
+ Blah Blah Blah
4
+
@@ -0,0 +1,11 @@
1
+ Description:
2
+ The startup_layout generator creates a basic layout with the necessary helpers, stylesheet etc.
3
+ For now, the startup_nav startup is a prerequisite.
4
+
5
+ Examples:
6
+ script/generate startup_layout
7
+
8
+ #TODO UPDATE THIS OUTPUT
9
+ Template: app/views/layouts/application.html.erb
10
+ Stylesheet: public/stylesheets/startup.css
11
+ Helper: app/helpers/startup_helper.rb
@@ -0,0 +1,48 @@
1
+ require 'startups'
2
+
3
+ class StartupLayoutGenerator < Rails::Generator::Base
4
+
5
+ def manifest
6
+ record do |m|
7
+ m.directory 'public/stylesheets'
8
+ m.directory 'public/javascripts'
9
+ m.directory 'app/helpers'
10
+ m.directory 'app/views/layouts'
11
+
12
+ m.file "app/helpers/layout_helper.rb", "app/helpers/layout_helper.rb"
13
+
14
+ #TODO add checks here for other startups so the layout can include eg. the nav stuff, etc.
15
+ #TODO possibly add shway versions of things as well.
16
+ m.template "app/views/layouts/startup_layout.html.erb", "app/views/layouts/application.html.erb"#, :assigns => { :foo => 'foo' }
17
+ m.file "app/views/layouts/_startup_layout_footer.html.erb", "app/views/layouts/_footer.html.erb"
18
+ m.file "app/views/layouts/_startup_layout_header.html.erb", "app/views/layouts/_header.html.erb"
19
+
20
+ m.file "public/stylesheets/startup_layout_reset.css", "public/stylesheets/reset.css"
21
+ m.file "public/stylesheets/startup_layout.css", "public/stylesheets/application.css"
22
+ m.file "public/stylesheets/startup_white.css", "public/stylesheets/white.css"
23
+ m.file "public/stylesheets/startup_layout_master.css", "public/stylesheets/master.css"
24
+ m.file "public/stylesheets/startup_layout_ie6.css", "public/stylesheets/global-ie6.css"
25
+ m.file "public/stylesheets/startup_layout_ie7.css", "public/stylesheets/global-ie7.css"
26
+ m.file "public/styelsheets/startup_layout_iepngfix.htc", "public/stylesheets/iepngfix.htc"
27
+
28
+ m.file "public/javascripts/startup_application.js", "public/javascripts/application.js"
29
+ m.file "public/javascripts/startup_imgSizer.js", "public/javascripts/imgSizer.js"
30
+ m.file "public/javascripts/startup_iepngfix.js", "public/javascripts/iepngfix_tilebg.js"
31
+
32
+ m.file "public/images/blank.gif", "public/images/blank.gif"
33
+
34
+ m.rm 'public/index.html'
35
+ end
36
+ end
37
+
38
+ protected
39
+
40
+ def banner
41
+ <<-EOS
42
+ Creates a basic layout with the necessary helpers, stylesheet etc.
43
+
44
+ USAGE: #{$0} #{spec.name}
45
+ EOS
46
+ end
47
+
48
+ end
@@ -0,0 +1,71 @@
1
+ module LayoutHelper
2
+
3
+ attr_accessor :title, :heading, :heading_image, :body_class, :crumbs
4
+
5
+ #for any options that match setter methods, set them. Raise errors for the rest.
6
+ def layout_options(options={})
7
+ return if options.blank?
8
+ options = options.clone
9
+ options.keys.each do |key|
10
+ #if there is a layout_ version of the setter, call it
11
+ layout_setter = "layout_#{key}=".intern
12
+ if self.respond_to? layout_setter
13
+ self.send layout_setter, options.delete(key)
14
+ next
15
+ end
16
+ setter = "#{key}=".intern
17
+ #if there is a setter, call it
18
+ if self.respond_to? setter
19
+ self.send setter, options.delete(key)
20
+ next
21
+ end
22
+ #if there is a no setter, but there is a method, call it with *args
23
+ #TODO write some tests for varying method signatures
24
+ if self.respond_to?(key) && (method(key).arity == 1 || method(key).arity <= -2)
25
+ self.send key, *options.delete(key)
26
+ next
27
+ end
28
+ #if there was no setter and no method available, raise
29
+ raise "No setter or method was found for the layout_option: #{key}"
30
+ end
31
+ nil
32
+ end
33
+
34
+ def layout_title
35
+ #NOTE: @selected_nav_title may get set by the nav startup if it's installed. Using the instance var makes it easier to mix and match the startups.
36
+ @title || @selected_nav_title || @heading || 'Default Title (CHANGEME)'
37
+ end
38
+
39
+ def layout_heading(text=@heading,options={})
40
+ options[:img] = @heading_image unless options.has_key? :img
41
+ if options[:img].blank?
42
+ text.blank? ? nil : %{<h1>#{text}</h1>}
43
+ #TODO make sifrd an option
44
+ # text.blank? ? nil : %{<h1 class="sifrd">#{text}</h1>}
45
+ else
46
+ %{<h1>#{image_tag(options[:img], :alt => text)}</h1>} unless text.blank?
47
+ end
48
+ end
49
+
50
+ def layout_crumbs
51
+ return if @crumbs.blank?
52
+ html = []
53
+ html << '<div class="crumbs">'
54
+ @crumbs.each do |crumb|
55
+ html << crumb
56
+ html << '<span>&raquo;</span>'
57
+ end
58
+ html << '</div>'
59
+ html.join
60
+ end
61
+
62
+ def layout_body_tag
63
+ class_att = body_class ? %{ class="#{body_class}"} : nil
64
+ if @layout_nav
65
+ %{<body id="#{@layout_nav}"#{class_att}>}
66
+ else
67
+ '<body>'
68
+ end
69
+ end
70
+
71
+ end
@@ -0,0 +1,6 @@
1
+ <div id="footer">
2
+ <div id="footer_content">
3
+ <%# NOTE: the const_defined? check is here to allow this to function if the nav startup wasn't installed, and should be removed after the initial setup. %>
4
+ <%= render :partial => 'layouts/footer_nav' if Object.const_defined? :NavHelper %>
5
+ </div>
6
+ </div>
@@ -0,0 +1,4 @@
1
+ <div id="masthead">
2
+ <%# NOTE: the const_defined? check is here to allow this to function if the nav startup wasn't installed, and should be removed after the initial setup. %>
3
+ <%= render :partial => 'layouts/top_nav' if Object.const_defined? :NavHelper %>
4
+ </div>
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+
6
+ <title><%%= layout_title %></title>
7
+
8
+ <meta name="distribution" content="all" />
9
+ <meta name="robots" content="all" />
10
+ <meta name="resource-type" content="document" />
11
+ <meta name="MSSmartTagsPreventParsing" content="true" />
12
+ <meta http-equiv="imagetoolbar" content="no" />
13
+
14
+ <meta http-equiv="cache-control" content="no-cache"> <!-- tells browser not to cache -->
15
+ <meta http-equiv="expires" content="0"> <!-- says that the cache expires 'now' -->
16
+ <meta http-equiv="pragma" content="no-cache"> <!-- says not to use cached stuff, if there is any -->
17
+
18
+ <%%= stylesheet_link_tag 'application' %>
19
+ <!-- http://www.quirksmode.org/css/condcom.html for MSIE Conditional Statements -->
20
+ <!--[if lt IE 7]><%%= stylesheet_link_tag 'global-ie6', :media => 'screen, projector' %><![endif]-->
21
+ <!--[if IE 7]><%%= stylesheet_link_tag 'global-ie7', :media => 'screen, projector' %><![endif] -->
22
+ <%%= stylesheet_link_tag 'nav' if Object.const_defined? :NavHelper %>
23
+
24
+ <%%= javascript_include_tag :defaults %>
25
+ <%%= javascript_include_tag 'imgSizer' %>
26
+
27
+ <%%= csrf_meta_tag %>
28
+ </head>
29
+
30
+ <%%= layout_body_tag %>
31
+ <div id="all">
32
+ <%%= render :partial => 'layouts/header' unless @omit_header %>
33
+ <div id="content">
34
+ <%%= layout_crumbs %>
35
+ <%%= layout_heading %>
36
+ <%% if flash[:notice] %>
37
+ <div class="notice confirm">
38
+ <%%= flash[:notice] %>
39
+ </div>
40
+ <%% end %>
41
+ <%% if flash[:error ] %>
42
+ <div class='notice error'>
43
+ <%%= flash[:error ]%>
44
+ </div>
45
+ <%% end %>
46
+ <%%#= fancy_heading unless @heading.blank? && @right_heading.blank? %>
47
+ <%%= yield %>
48
+ </div>
49
+ <%%= render :partial => 'layouts/footer' %>
50
+ </div>
51
+
52
+ </body>
53
+
54
+ </html>
@@ -0,0 +1,42 @@
1
+ // Place your application-specific JavaScript functions and classes here
2
+ // This file is automatically included by javascript_include_tag :defaults
3
+
4
+ // Calls a Safari specific stylesheet if you really need to hack directly
5
+ function isSafari(){
6
+ var app = navigator.userAgent;
7
+ if (app.indexOf('Safari') != -1) {
8
+ document.write(" <link href=\"/stylesheets/safari.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" /> ");
9
+ }
10
+ }
11
+ isSafari();
12
+
13
+ // Force Opera to reload when using the back button
14
+ // http://dev.opera.com/forums/topic/224464
15
+ function OperaReload() {
16
+ try {
17
+ var headElement = document.getElementsByTagName("head")[0];
18
+ if (headElement && headElement.innerHTML)
19
+ headElement.innerHTML += "<meta http-equiv=\"refresh\" content=\"1\">";
20
+ }
21
+ catch (e) {}
22
+ }
23
+
24
+ // Load Event
25
+
26
+ function addLoadEvent(func) {
27
+ var oldonload = window.onload;
28
+ if (typeof window.onload != 'function') {
29
+ window.onload = func;
30
+ } else {
31
+ window.onload = function() {
32
+ if (oldonload) {
33
+ oldonload();
34
+ }
35
+ func();
36
+ }
37
+ }
38
+ }
39
+ addLoadEvent(function() {
40
+ img.Sizer.collate();
41
+ });
42
+
@@ -0,0 +1,173 @@
1
+ // IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
2
+ // (c) 2008-2009 Angus Turnbull http://www.twinhelix.com
3
+
4
+ // This is licensed under the GNU LGPL, version 2.1 or later.
5
+ // For details, see: http://creativecommons.org/licenses/LGPL/2.1/
6
+
7
+ var IEPNGFix = window.IEPNGFix || {};
8
+
9
+ IEPNGFix.tileBG = function(elm, pngSrc, ready) {
10
+ // Params: A reference to a DOM element, the PNG src file pathname, and a
11
+ // hidden "ready-to-run" passed when called back after image preloading.
12
+
13
+ var data = this.data[elm.uniqueID],
14
+ elmW = Math.max(elm.clientWidth, elm.scrollWidth),
15
+ elmH = Math.max(elm.clientHeight, elm.scrollHeight),
16
+ bgX = elm.currentStyle.backgroundPositionX,
17
+ bgY = elm.currentStyle.backgroundPositionY,
18
+ bgR = elm.currentStyle.backgroundRepeat;
19
+
20
+ // Cache of DIVs created per element, and image preloader/data.
21
+ if (!data.tiles) {
22
+ data.tiles = {
23
+ elm: elm,
24
+ src: '',
25
+ cache: [],
26
+ img: new Image(),
27
+ old: {}
28
+ };
29
+ }
30
+ var tiles = data.tiles,
31
+ pngW = tiles.img.width,
32
+ pngH = tiles.img.height;
33
+
34
+ if (pngSrc) {
35
+ if (!ready && pngSrc != tiles.src) {
36
+ // New image? Preload it with a callback to detect dimensions.
37
+ tiles.img.onload = function() {
38
+ this.onload = null;
39
+ IEPNGFix.tileBG(elm, pngSrc, 1);
40
+ };
41
+ return tiles.img.src = pngSrc;
42
+ }
43
+ } else {
44
+ // No image?
45
+ if (tiles.src) ready = 1;
46
+ pngW = pngH = 0;
47
+ }
48
+ tiles.src = pngSrc;
49
+
50
+ if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
51
+ bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
52
+ return;
53
+ }
54
+
55
+ // Convert English and percentage positions to pixels.
56
+ var pos = {
57
+ top: '0%',
58
+ left: '0%',
59
+ center: '50%',
60
+ bottom: '100%',
61
+ right: '100%'
62
+ },
63
+ x,
64
+ y,
65
+ pc;
66
+ x = pos[bgX] || bgX;
67
+ y = pos[bgY] || bgY;
68
+ if (pc = x.match(/(\d+)%/)) {
69
+ x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
70
+ }
71
+ if (pc = y.match(/(\d+)%/)) {
72
+ y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
73
+ }
74
+ x = parseInt(x);
75
+ y = parseInt(y);
76
+
77
+ // Handle backgroundRepeat.
78
+ var repeatX = { 'repeat': 1, 'repeat-x': 1 }[bgR],
79
+ repeatY = { 'repeat': 1, 'repeat-y': 1 }[bgR];
80
+ if (repeatX) {
81
+ x %= pngW;
82
+ if (x > 0) x -= pngW;
83
+ }
84
+ if (repeatY) {
85
+ y %= pngH;
86
+ if (y > 0) y -= pngH;
87
+ }
88
+
89
+ // Go!
90
+ this.hook.enabled = 0;
91
+ if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
92
+ elm.style.position = 'relative';
93
+ }
94
+ var count = 0,
95
+ xPos,
96
+ maxX = repeatX ? elmW : x + 0.1,
97
+ yPos,
98
+ maxY = repeatY ? elmH : y + 0.1,
99
+ d,
100
+ s,
101
+ isNew;
102
+ if (pngW && pngH) {
103
+ for (xPos = x; xPos < maxX; xPos += pngW) {
104
+ for (yPos = y; yPos < maxY; yPos += pngH) {
105
+ isNew = 0;
106
+ if (!tiles.cache[count]) {
107
+ tiles.cache[count] = document.createElement('div');
108
+ isNew = 1;
109
+ }
110
+ var clipR = Math.max(0, xPos + pngW > elmW ? elmW - xPos : pngW),
111
+ clipB = Math.max(0, yPos + pngH > elmH ? elmH - yPos : pngH);
112
+ d = tiles.cache[count];
113
+ s = d.style;
114
+ s.behavior = 'none';
115
+ s.left = (xPos - parseInt(elm.currentStyle.paddingLeft)) + 'px';
116
+ s.top = yPos + 'px';
117
+ s.width = clipR + 'px';
118
+ s.height = clipB + 'px';
119
+ s.clip = 'rect(' +
120
+ (yPos < 0 ? 0 - yPos : 0) + 'px,' +
121
+ clipR + 'px,' +
122
+ clipB + 'px,' +
123
+ (xPos < 0 ? 0 - xPos : 0) + 'px)';
124
+ s.display = 'block';
125
+ if (isNew) {
126
+ s.position = 'absolute';
127
+ s.zIndex = -999;
128
+ if (elm.firstChild) {
129
+ elm.insertBefore(d, elm.firstChild);
130
+ } else {
131
+ elm.appendChild(d);
132
+ }
133
+ }
134
+ this.fix(d, pngSrc, 0);
135
+ count++;
136
+ }
137
+ }
138
+ }
139
+ while (count < tiles.cache.length) {
140
+ this.fix(tiles.cache[count], '', 0);
141
+ tiles.cache[count++].style.display = 'none';
142
+ }
143
+
144
+ this.hook.enabled = 1;
145
+
146
+ // Cache so updates are infrequent.
147
+ tiles.old = {
148
+ w: elmW,
149
+ h: elmH,
150
+ x: bgX,
151
+ y: bgY,
152
+ r: bgR
153
+ };
154
+ };
155
+
156
+
157
+ IEPNGFix.update = function() {
158
+ // Update all PNG backgrounds.
159
+ for (var i in IEPNGFix.data) {
160
+ var t = IEPNGFix.data[i].tiles;
161
+ if (t && t.elm && t.src) {
162
+ IEPNGFix.tileBG(t.elm, t.src);
163
+ }
164
+ }
165
+ };
166
+ IEPNGFix.update.timer = 0;
167
+
168
+ if (window.attachEvent && !window.opera) {
169
+ window.attachEvent('onresize', function() {
170
+ clearTimeout(IEPNGFix.update.timer);
171
+ IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
172
+ });
173
+ }
@@ -0,0 +1,61 @@
1
+ /* Dan Cederholm's resizing method for images in Internet Explorer so they don't look god awful. */
2
+
3
+ var imgSizer= {
4
+ Config : {
5
+ spacer : "/images/spacer.gif",
6
+ imgCache : []
7
+ }
8
+
9
+ ,collate : function(oScope) {
10
+ if (document.all && !window.opera) {
11
+ var c = imgSizer;
12
+ var imgCache = c.Config.imgCache;
13
+
14
+ var images = (oScope && oScope.length) ? oScope : document.getElementsByTagName("img");
15
+ for (var i = 0; i < images.length; i++) {
16
+ images[i].origWidth = images[i].offsetWidth;
17
+ images[i].origHeight = images[i].offsetHeight;
18
+
19
+ imgCache.push(images[i]);
20
+ c.ieAlpha(images[i]);
21
+ images[i].style.width = "100%";
22
+ }
23
+
24
+ if(imgCache.length) {
25
+ c.resize(function() {
26
+ for (var i = 0; i < imgCache.length; i++) {
27
+ var ratio = (imgCache[i].offsetWidth imgCache[i].origWidth);
28
+ imgCache[i].style.height = (imgCache[i].origHeight * ratio) + "px";
29
+ }
30
+ });
31
+ }
32
+ }
33
+ }
34
+
35
+ ,ieAlpha : function(img) {
36
+ var c = imgSizer;
37
+ if (img.oldSrc) {
38
+ img.src = img.oldSrc;
39
+ }
40
+ var src = img.src
41
+ img.style.width = img.offsetWidth + "px";
42
+ img.style.height = img.offsetHeight + "px";
43
+ img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale)"
44
+ img.oldSrc = src;
45
+ img.src = c.Config.spacer;
46
+ }
47
+
48
+ ,resize : function(func) {
49
+ var oldonresize = window.onresize;
50
+ if (typeof window.onresize != 'function') {
51
+ window.onresize = func;
52
+ } else {
53
+ window.onresize = function() {
54
+ if (oldonresize) {
55
+ oldonresize();
56
+ }
57
+ func();
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ Title: Screen styles and MSIE patches
3
+ Author: John Athayde for Infoether
4
+ */
5
+
6
+ /* import stylesheets and hide from IE/Mac \*/
7
+ @import url("reset.css") screen; /* Reset browsers */
8
+
9
+ /* Startups stylesheet would go here */
10
+
11
+ @import url("master.css") screen;
12
+ @import url("white.css") screen; /* This contains the infoether basic style for a no design app */
13
+
14
+ /* Plugin stylesheets */
15
+ /*@import url("uniform.default.css") screen;*/
16
+ /*@import url("buttons.css") screen;*/
17
+
18
+
19
+ /* end import/hide */
20
+
21
+ /* If there are any styles that we want IE5/Mac to see, we put them after this */
@@ -0,0 +1,13 @@
1
+ /* ### PNG Fix ### */
2
+ * html #selector {
3
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='img/image.png');
4
+ background-image: none;
5
+ background-repeat: no-repeat;
6
+ background-color: transparent;
7
+ }
8
+
9
+ /* ### IE6 Clearfix ### */
10
+
11
+ * html .group {
12
+ height: 1%;
13
+ }
@@ -0,0 +1,5 @@
1
+ /* ### IE7 Clearfix ### */
2
+
3
+ *:first-child+html .group {
4
+ min-height: 1px;
5
+ }