diff --git a/contrib/mobile/iOS/Onelab/AboutViewController.mm b/contrib/mobile/iOS/Onelab/AboutViewController.mm index 5d43bf2c9883f0a7cdec773d1112b231650b0362..9bb5dd442eadbb638531d855e4343d19dd1fe424 100644 --- a/contrib/mobile/iOS/Onelab/AboutViewController.mm +++ b/contrib/mobile/iOS/Onelab/AboutViewController.mm @@ -35,11 +35,16 @@ // Do any additional setup after loading the view. self.aboutView.delegate = self; self.aboutView.dataDetectorTypes = UIDataDetectorTypeNone; + [self loadContent]; +} + +-(void)loadContent +{ UIColor *tintColor = self.view.tintColor; CGFloat red, green, blue, alpha; [tintColor getRed: &red green: &green blue: &blue alpha: &alpha]; int r = (int)(red*255), g = (int)(green*255), b = (int)(blue*255); - + NSString *css = [NSString stringWithFormat:@"body { background-color: #FFFFFF; color: #252525; margin: 35px 10px 35px 10px; padding: 0; font-family: helvetica-neue,sans-serif; font-size: 1em; } b { font-weight: normal; color: rgb(%d,%d,%d); } a { color: rgb(%d,%d,%d); }", r, g, b, r, g, b]; if([self.fileToEdit isEqual:@"About"]){ @@ -73,9 +78,9 @@ UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(saveFile)]; [self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects: save, nil]]; } - } + -(void)saveFile { NSString *text = [self.aboutView stringByEvaluatingJavaScriptFromString: @@ -84,6 +89,7 @@ NSError *error; [text writeToFile:self.fileToEdit atomically:YES encoding:NSUTF8StringEncoding error:&error]; + [self loadContent]; } - (void)didReceiveMemoryWarning