{ "id": "91279", "key": "TIMOB-9080", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13406", "description": "Sprint 2012-10 API", "name": "Sprint 2012-10 API", "archived": true, "released": true, "releaseDate": "2012-05-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-11T10:38:50.000+0000", "created": "2012-05-03T10:39:37.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "community", "core", "module_webview", "qe-testadded" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-25T08:51:46.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Implement UIWebViewNavigationType such that the beforeload event will include this in its parameters\r\n\r\nhttp://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html\r\n\r\nTest case:\r\n\r\n{code:javascript}\r\nvar win1 = Titanium.UI.createWindow({ \r\n navBarHidden:false\r\n});\r\n\r\nvar webview1 = Ti.UI.createWebView({\r\n url: 'http://www.gmail.com'\r\n});\r\n\r\nwebview1.addEventListener('beforeload', function(e){\r\n var navigationType = e.navigationType;\r\n\r\n if(Ti.UI.iOS.WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED == navigationType){\r\n Ti.API.info(\"WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED\");\r\n } else if (Ti.UI.iOS.WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED == navigationType){\r\n Ti.API.info(\"WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED\");\r\n } else if (Ti.UI.iOS.WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD == navigationType){\r\n Ti.API.info(\"WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD\");\r\n } else if (Ti.UI.iOS.WEBVIEW_NAVIGATIONTYPE_RELOAD == navigationType){\r\n Ti.API.info(\"WEBVIEW_NAVIGATIONTYPE_RELOAD\");\r\n } else if (Ti.UI.iOS.WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED == navigationType){\r\n Ti.API.info(\"WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED\");\r\n } else if (Ti.UI.iOS.WEBVIEW_NAVIGATIONTYPE_OTHER == navigationType){\r\n Ti.API.info(\"WEBVIEW_NAVIGATIONTYPE_OTHER\");\r\n }\r\n});\r\n\r\nvar bb2 = Titanium.UI.createButtonBar({\r\n labels:['Back', 'Reload', 'Forward'],\r\n bottom: 0\r\n});\r\nvar flexSpace = Titanium.UI.createButton({\r\n systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE\r\n});\r\nbb2.addEventListener('click',function(ce){\r\n if (ce.index == 0) { webview1.goBack(); }\r\n else if (ce.index == 1) { webview1.reload(); }\r\n else { webview1.goForward(); }\r\n});\r\n\r\nwin1.add(webview1);\r\nwin1.add(bb2);\r\n\r\nwin1.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: send navigationType when beforeload event is fired in iOS webview", "creator": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "environment": "Mac OS X 10.6.8\r\nTitanium Studio 2.0.1.201204132053\r\nTitanium Mobile CI", "comment": { "comments": [ { "id": "193590", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "Pull request https://github.com/appcelerator/titanium_mobile/pull/1902", "updateAuthor": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "created": "2012-05-03T10:44:52.000+0000", "updated": "2012-05-03T10:44:52.000+0000" }, { "id": "194541", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR merged https://github.com/appcelerator/titanium_mobile/pull/1902", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-11T10:38:50.000+0000", "updated": "2012-05-11T10:38:50.000+0000" }, { "id": "198195", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 2.1.0.201206111802\r\nTi Mobile SDK 2.1.0.v20120612102301 hash refeef019\r\nOSX Lion 10.7.3\r\niPhone 4S OS 5.1\r\n\r\nVerified that the navigation type is sent to the before load event", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-12T12:27:18.000+0000", "updated": "2012-06-12T12:27:18.000+0000" }, { "id": "281120", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil test case added.\nPR link:\nhttps://github.com/appcelerator/titanium_mobile/pull/5020", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-25T08:51:46.000+0000", "updated": "2013-11-25T08:51:46.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }