Merge pull request #10104 from druiz17/tablet-webView3.0

Remove unnecessary prints and code for tabletWebView.qml
This commit is contained in:
Seth Alves 2017-04-03 16:10:54 -07:00 committed by GitHub
commit cb787c2862
2 changed files with 26 additions and 48 deletions

View file

@ -110,7 +110,6 @@ Item {
Component.onCompleted: {
// Ensure the JS from the web-engine makes it to our logging
webview.javaScriptConsoleMessage.connect(function(level, message, lineNumber, sourceID) {
console.log("TabletBrowser");
console.log("Web Entity JS message: " + sourceID + " " + lineNumber + " " + message);
});
@ -138,18 +137,7 @@ Item {
}
}
onActiveFocusOnPressChanged: {
console.log("on active focus changed");
setActiveFocusOnPress(true);
}
onNewViewRequested: {
// desktop is not defined for web-entities
if (stackRoot.isDesktop) {
var component = Qt.createComponent("./Browser.qml");
var newWindow = component.createObject(desktop);
request.openIn(newWindow.webView);
} else {
var component = Qt.createComponent("./TabletBrowser.qml");
if (component.status != Component.Ready) {
@ -164,7 +152,7 @@ Item {
newWindow.eventBridge = web.eventBridge;
stackRoot.push(newWindow);
newWindow.webView.forceActiveFocus();
}
}
}

View file

@ -112,6 +112,7 @@ Item {
currentItem.goBack();
} else {
stackRoot.pop();
currentItem.webView.focus = true;
currentItem.webView.forceActiveFocus();
web.address = currentItem.webView.url;
}
@ -186,7 +187,6 @@ Item {
Component.onCompleted: {
// Ensure the JS from the web-engine makes it to our logging
root.javaScriptConsoleMessage.connect(function(level, message, lineNumber, sourceID) {
console.log("WebView.qml");
console.log("Web Entity JS message: " + sourceID + " " + lineNumber + " " + message);
});
@ -202,7 +202,6 @@ Item {
keyboardRaised = false;
punctuationMode = false;
keyboard.resetShiftMode(false);
console.log("[DR] -> printing user string " + root.profile.httpUserAgent);
// Required to support clicking on "hifi://" links
if (WebEngineView.LoadStartedStatus == loadRequest.status) {
var url = loadRequest.url.toString();
@ -215,15 +214,7 @@ Item {
}
onNewViewRequested:{
// desktop is not defined for web-entities
if (web.isDesktop) {
var component = Qt.createComponent("../Browser.qml");
var newWindow = component.createObject(desktop);
newWindow.setProfile(root.profile);
request.openIn(newWindow.webView);
} else {
var component = Qt.createComponent("../TabletBrowser.qml");
if (component.status != Component.Ready) {
if (component.status == Component.Error) {
console.log("Error: " + component.errorString());
@ -237,7 +228,6 @@ Item {
stackRoot.push(newWindow);
}
}
}
HiFiControls.Keyboard {
id: keyboard