NimbleKit - fast iOS app development

NimbleKit 1.9.6 is released

Anything about NimbleKit SDK

Re: NimbleKit 1.9.6 is released

Postby eric.delcroix » Sat Mar 26, 2011 2:08 pm

I give an answer to myself 8-)
Xcode 3.2.6 with ios 4.3 is still available on apple's site (http://developer.apple.com/devcenter/ios/index.action#downloads)
I think they will abandon it with the arrival of version 4 ... fortunately not, if you say that version 4 is buggy.

Eric
User avatar
eric.delcroix
 
Posts: 28
Joined: Sat Mar 12, 2011 12:09 am

Re: NimbleKit 1.9.6 is released

Postby blazeman » Sat Mar 26, 2011 11:01 pm

sunny wrote:you can use javascript's history object for that as a workaround, but I can easily add methods to NKWebView directly, make requests for each function separately and I'll implement


Tried this workaround... am I doing it wrong? Button in NKToolbar pointing to the function

function back() {
history.back();
}

Did I do it wrong?
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Re: NimbleKit 1.9.6 is released

Postby Big-O » Sat Mar 26, 2011 11:33 pm

blazeman wrote:
sunny wrote:you can use javascript's history object for that as a workaround, but I can easily add methods to NKWebView directly, make requests for each function separately and I'll implement


Tried this workaround... am I doing it wrong? Button in NKToolbar pointing to the function

function back() {
history.back();
}

Did I do it wrong?


Depends on where you have that and where you are calling it. If you put it in the wrong place then it will try to move the main page, not the webview. What happens when you try it?
-- Big-O
-- Nimblekit Guru, Web Developer, Hopeless Geek

I do freelance!
http://realisticweb.com
User avatar
Big-O
NimbleKit Guru
 
Posts: 1231
Joined: Thu Sep 24, 2009 4:02 am

Re: NimbleKit 1.9.6 is released

Postby blazeman » Sat Mar 26, 2011 11:38 pm

Here's the entire page... nothing complex... just playing...

Code: Select all
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = yes" />
</head>
<body>
<script type="text/javascript" src="NKit.js"></script>
<script>
var toolbar = new NKToolBar();
toolbar.init(0);

toolbar.addDoneButton("Done", "closeit()");
toolbar.addButton("Back","" , "back()")
toolbar.addFlexibleSpace();
toolbar.setStyle("black");
var webView = new NKWebView
function openit(a) {
toolbar.show();
webView.init(0,44,330,380);
webView.loadURL(a);
webView.setScalesToFit("yes");
webView.show();
}
function back() {
history.back();
// NKAlert("Popup","back"); used to make sure button work... alert was fine
    }
function closeit() {
toolbar.hide();
//and then to hide (not TO DESTROY for NOW)
webView.hide();
}
</script>

<a href="javascript:openit('http://www.google.com')">Open WebView</a><BR>
</body>
</html>
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Re: NimbleKit 1.9.6 is released

Postby HughJohnson » Sun Mar 27, 2011 12:02 am

blazeman wrote:Here's the entire page... nothing complex... just playing...


I think you would need to move your history.back(); to be in the html that is inside the webview. Unless there is an NKExecuteJavascriptOnWebView() function or something that I'm missing.
Image
User avatar
HughJohnson
NimbleKit Expert
 
Posts: 286
Joined: Thu Jun 18, 2009 4:44 pm

Re: NimbleKit 1.9.6 is released

Postby Big-O » Sun Mar 27, 2011 5:11 am

HughJohnson wrote:
blazeman wrote:Here's the entire page... nothing complex... just playing...


I think you would need to move your history.back(); to be in the html that is inside the webview. Unless there is an NKExecuteJavascriptOnWebView() function or something that I'm missing.


Yeah, that's exactly what I was talking about. You are calling history.back on the NK page, not on the webview page and that sort of navigation doesn't work in NK, you have to use the nimblekit functions for navigation.
-- Big-O
-- Nimblekit Guru, Web Developer, Hopeless Geek

I do freelance!
http://realisticweb.com
User avatar
Big-O
NimbleKit Guru
 
Posts: 1231
Joined: Thu Sep 24, 2009 4:02 am

Re: NimbleKit 1.9.6 is released

Postby jomego » Sun Mar 27, 2011 1:39 pm

Big-O and could move through the history of NKWebView because I fail ... I could give you an example.

Thanks friend
User avatar
jomego
 
Posts: 100
Joined: Wed Dec 01, 2010 2:10 pm

Re: NimbleKit 1.9.6 is released

Postby blazeman » Sun Mar 27, 2011 3:56 pm

So Sunny.. is there a way to run the javascript buttons on the webview rather than the HTML page that is there?
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Re: NimbleKit 1.9.6 is released

Postby sunny » Sun Mar 27, 2011 4:49 pm

This solution works:
Code: Select all
<script>
var webView = new NKWebView;
webView.init(0,150,300,300);
webView.loadURL("http://nimblekit.com");
webView.setScalesToFit("yes");
webView.show();
function goBack()
{
    webView.loadHTML("<script>history.go(-1)<\/script>", "");
}

</script>

<a href="#" onClick="goBack()">Go Back</a><br>
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: NimbleKit 1.9.6 is released

Postby jomego » Sun Mar 27, 2011 5:52 pm

Thanks sunny
User avatar
jomego
 
Posts: 100
Joined: Wed Dec 01, 2010 2:10 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest