Permalink
Browse files

Change Crucial images/colors/add info button

  • Loading branch information...
1 parent 9966486 commit 1abf1aaa2891d4037bab9a861caa5bf55a26f0ea @BaseInfinity BaseInfinity committed Jan 15, 2013
@@ -26,5 +26,6 @@
- (void)getAreas;
- (void)showLoading;
- (void)setData:(NSDictionary *)dict;
+- (void)createInfoButton;
@end
@@ -29,9 +29,14 @@ - (id)init {
#pragma mark -
#pragma mark View lifecycle
-- (void)viewWillAppear:(BOOL)animated {
+- (void)viewWillAppear:(BOOL)animated {
+ // We reuse this view, and only want to create the infoButton when
+ // the tree is empty
if (!tree)
[self getAreas];
+ else if ([Config currentConfig].site == ConfigCrucial) {
+ [self createInfoButton];
+ }
}
- (void)viewDidLoad {
@@ -40,7 +45,7 @@ - (void)viewDidLoad {
if (!self.title) {
self.title = @"Categories";
if ([Config currentConfig].site == ConfigCrucial) {
- UIImage *titleImage = [UIImage imageNamed:@"titleImage_crucial.png"];
+ UIImage *titleImage = [UIImage imageNamed:@"titleImage_crucial_white_centered.png"];
UIImageView *imageTitle = [[UIImageView alloc] initWithImage:titleImage];
imageTitle.contentMode = UIViewContentModeScaleAspectFit;
self.navigationItem.titleView = imageTitle;
@@ -103,7 +108,11 @@ - (void)getAreas {
}
- (void)gotAreas:(NSDictionary *)areas {
- self.navigationItem.rightBarButtonItem = nil;
+ if ([Config currentConfig].site == ConfigCrucial) {
+ [self createInfoButton];
+ } else {
+ self.navigationItem.rightBarButtonItem = nil;
+ }
if ([areas isKindOfClass:[NSDictionary class]]) {
[self setData:areas];
@@ -126,6 +135,34 @@ - (void)setTitle:(NSString *)title {
self.navigationItem.titleView = nil;
}
+- (void)createInfoButton {
+ UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
+ [infoButton addTarget:self action:@selector(infoButtonTouched) forControlEvents:UIControlEventTouchUpInside];
+ UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
+
+ self.navigationItem.rightBarButtonItem = infoItem;
+}
+
+- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex; {
+
+ // Take the user to Dozuki.com - This is only for Crucial. This will only be called from a Crucial
+ // So no need to check to see for their site until we add more custom sites that want an info button.
+ if (buttonIndex == 1) {
+ NSURL *url = [NSURL URLWithString:@"http://www.dozuki.com"];
+ [[UIApplication sharedApplication] openURL:url];
+ }
+
+}
+
+- (void)infoButtonTouched {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Powered by Dozuki"
+ message:@"This app is powered by the Dozuki platform. Create, update, and distribute all of your service documentation to the field instantly. Find out more at Dozuki.com"
+ delegate:self
+ cancelButtonTitle:@"Cancel"
+ otherButtonTitles:@"Visit Dozuki", nil];
+ [alert show];
+}
+\
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if ([Config currentConfig].site == ConfigMake || [Config currentConfig].site == ConfigMakeDev) {
View
@@ -76,7 +76,6 @@ - (void)setSite:(NSInteger)theSite {
// Make
case ConfigMake:
case ConfigMakeDev:
- case ConfigCrucial:
self.backgroundColor = [UIColor whiteColor];
self.textColor = [UIColor blackColor];
self.toolbarColor = [UIColor colorWithRed:0.16 green:0.67 blue:0.89 alpha:1.0];
@@ -85,12 +84,22 @@ - (void)setSite:(NSInteger)theSite {
self.introCSS = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"make_intro" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil];
self.stepCSS = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"make_step" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil];
break;
+ // Crucial
+ case ConfigCrucial:
+ self.backgroundColor = [UIColor whiteColor];
+ self.textColor = [UIColor blackColor];
+ self.toolbarColor = [UIColor colorWithRed:.19 green:.21 blue:.23 alpha:1.0];
+
+ // Load intro and step css from the css folder.
+ self.introCSS = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"make_intro" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil];
+ self.stepCSS = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"make_step" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil];
+ break;
+
// iFixit
case ConfigIFixit:
case ConfigIFixitDev:
self.backgroundColor = [UIColor blackColor];
self.textColor = [UIColor whiteColor];
- //self.toolbarColor = [UIColor blackColor];
self.toolbarColor = [UIColor colorWithRed:0.20 green:0.43 blue:0.66 alpha:1.0];
// Load intro and step css from the css folder.
@@ -101,7 +110,6 @@ - (void)setSite:(NSInteger)theSite {
default:
self.backgroundColor = [UIColor blackColor];
self.textColor = [UIColor whiteColor];
- //self.toolbarColor = [UIColor darkGrayColor];
self.toolbarColor = [UIColor colorWithRed:.19 green:.21 blue:.23 alpha:1.0];
// Load intro and step css from the css folder.
@@ -33,8 +33,8 @@ - (void)positionImages {
frame.origin.y = 270.0;
frame.origin.x = 126.0;
} else if ([Config currentConfig].site == ConfigCrucial) {
- frame.origin.y = 255.0;
- frame.origin.x = 12.0;
+ frame.origin.y = 280.0;
+ frame.origin.x = 170.0;
} else {
frame.origin.y = -60.0;
}
@@ -47,8 +47,8 @@ - (void)positionImages {
frame.origin.y = 210.0;
frame.origin.x = 156.0;
} else if ([Config currentConfig].site == ConfigCrucial) {
- frame.origin.y = 360.0;
- frame.origin.x = 47.0;
+ frame.origin.y = 420.0;
+ frame.origin.x = 200.0;
} else {
frame.origin.y = 192.0;
}
@@ -72,7 +72,7 @@ - (void)viewDidLoad {
text.frame = CGRectMake(text.frame.origin.x, text.frame.origin.y, 313.0, 174.0);
} else if ([Config currentConfig].site == ConfigCrucial) {
image.image = [UIImage imageNamed:@"logo_crucial_transparent.png"];
- image.frame = CGRectMake(image.frame.origin.x, image.frame.origin.y, 680.0, 154.0);
+ image.frame = CGRectMake(image.frame.origin.x, image.frame.origin.y, 380.0, 86.0);
image.center = self.view.center;
text.image = [UIImage imageNamed:@"detailViewTextGeneric.png"];
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
- <int key="IBDocument.SystemTarget">1280</int>
- <string key="IBDocument.SystemVersion">11C74</string>
- <string key="IBDocument.InterfaceBuilderVersion">1938</string>
- <string key="IBDocument.AppKitVersion">1138.23</string>
- <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <int key="IBDocument.SystemTarget">1536</int>
+ <string key="IBDocument.SystemVersion">11G63</string>
+ <string key="IBDocument.InterfaceBuilderVersion">3079</string>
+ <string key="IBDocument.AppKitVersion">1138.51</string>
+ <string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">933</string>
+ <string key="NS.object.0">2077</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
<string>IBUIImageView</string>
- <string>IBUIView</string>
<string>IBUILabel</string>
- <string>IBProxyObject</string>
+ <string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -41,7 +41,6 @@
<int key="NSvFlags">290</int>
<string key="NSFrame">{{0, 143}, {768, 768}}</string>
<reference key="NSSuperview" ref="766721923"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="485070877"/>
<string key="NSReuseIdentifierKey">_NS:569</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -56,7 +55,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{25, 10}, {379, 144}}</string>
<reference key="NSSuperview" ref="766721923"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="465954004"/>
<string key="NSReuseIdentifierKey">_NS:569</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -71,8 +69,6 @@
<int key="NSvFlags">-2147483355</int>
<string key="NSFrame">{{40, 193}, {688, 150}}</string>
<reference key="NSSuperview" ref="766721923"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:345</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
@@ -109,7 +105,6 @@
</array>
<string key="NSFrame">{{0, 64}, {768, 911}}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="622062036"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@@ -223,37 +218,7 @@
<nil key="sourceID"/>
<int key="maxID">9</int>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <array class="NSMutableArray" key="referencedPartialClassDescriptions">
- <object class="IBPartialClassDescription">
- <string key="className">DetailIntroViewController</string>
- <string key="superclassName">UIViewController</string>
- <dictionary class="NSMutableDictionary" key="outlets">
- <string key="image">UIImageView</string>
- <string key="siteLabel">UILabel</string>
- <string key="text">UIImageView</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="image">
- <string key="name">image</string>
- <string key="candidateClassName">UIImageView</string>
- </object>
- <object class="IBToOneOutletInfo" key="siteLabel">
- <string key="name">siteLabel</string>
- <string key="candidateClassName">UILabel</string>
- </object>
- <object class="IBToOneOutletInfo" key="text">
- <string key="name">text</string>
- <string key="candidateClassName">UIImageView</string>
- </object>
- </dictionary>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/DetailIntroViewController.h</string>
- </object>
- </object>
- </array>
- </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
@@ -262,6 +227,6 @@
<string key="detailViewFist.png">{768, 768}</string>
<string key="detailViewText.png">{379, 144}</string>
</dictionary>
- <string key="IBCocoaTouchPluginVersion">933</string>
+ <string key="IBCocoaTouchPluginVersion">2077</string>
</data>
</archive>
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">1280</int>
- <string key="IBDocument.SystemVersion">11C74</string>
- <string key="IBDocument.InterfaceBuilderVersion">1938</string>
- <string key="IBDocument.AppKitVersion">1138.23</string>
- <string key="IBDocument.HIToolboxVersion">567.00</string>
+ <int key="IBDocument.SystemTarget">1536</int>
+ <string key="IBDocument.SystemVersion">11G63</string>
+ <string key="IBDocument.InterfaceBuilderVersion">3079</string>
+ <string key="IBDocument.AppKitVersion">1138.51</string>
+ <string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">933</string>
+ <string key="NS.object.0">2077</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>IBUIWebView</string>
+ <string>IBProxyObject</string>
<string>IBUIToolbar</string>
<string>IBUIView</string>
- <string>IBProxyObject</string>
+ <string>IBUIWebView</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -45,7 +45,6 @@
<int key="NSvFlags">290</int>
<string key="NSFrameSize">{1024, 44}</string>
<reference key="NSSuperview" ref="647120888"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="742861885"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
@@ -63,7 +62,6 @@
<int key="NSvFlags">311</int>
<string key="NSFrame">{{0, 44}, {1024, 704}}</string>
<reference key="NSSuperview" ref="647120888"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="704696610"/>
<object class="NSColor" key="IBUIBackgroundColor" id="483207819">
<int key="NSColorSpace">1</int>
@@ -77,16 +75,13 @@
<int key="NSvFlags">-2147483337</int>
<string key="NSFrame">{{0, 44}, {1024, 704}}</string>
<reference key="NSSuperview" ref="647120888"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<reference key="IBUIBackgroundColor" ref="483207819"/>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBUIScalesPageToFit">YES</bool>
</object>
</object>
<string key="NSFrame">{{0, 20}, {1024, 748}}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="410698538"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@@ -223,7 +218,7 @@
<string>90.CustomClassName</string>
<string>90.IBPluginDependency</string>
</object>
- <object class="NSMutableArray" key="dict.values">
+ <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>DetailViewController</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -265,7 +260,7 @@
<string>toolbar</string>
<string>wikiWebView</string>
</object>
- <object class="NSMutableArray" key="dict.values">
+ <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>GuideCatchingWebView</string>
<string>UIToolbar</string>
@@ -280,7 +275,7 @@
<string>toolbar</string>
<string>wikiWebView</string>
</object>
- <object class="NSMutableArray" key="dict.values">
+ <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBToOneOutletInfo">
<string key="name">answersWebView</string>
@@ -313,16 +308,12 @@
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
- <real value="1280" key="NS.object.0"/>
- </object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">933</string>
+ <string key="IBCocoaTouchPluginVersion">2077</string>
</data>
</archive>
Oops, something went wrong.

0 comments on commit 1abf1aa

Please sign in to comment.