Files
Jihad-Browser/app/source/AddressInput.js
T
NotAlexNoyleandClaude Fable 5.1 62df604c54 Licensing audit: notices for everything bundled, no borrowed marks
The owner: "ensure that all software patent and trademark licenses in
the repo are being respected". A read-only audit of what the packages
carry found no blocker and these gaps, all closed here (the record is
impl-review-findings-6.md, "Licensing audit"):

- NOTICE names the runtime the engine ships with: glibc 2.23 as
  crosstool-NG modifies it (LGPL-2.1), the GCC 9.4.0 runtime (GPL-3.0
  with the Runtime Library Exception), and the eight Debian jessie
  libraries, with the FreeType disclaimer, Lato, the hyphenation
  patterns, and where the corresponding source is. licenses/ gains
  LGPL-2.1, GPL-3.0 and the GCC exception from the pinned tarballs and
  Debian's copyright files from the sysroot; every package ships all of
  licenses/ and CREDITS.md, checked in the payload preflight.
- NOTICE names the modified engine's source (the fork, branch, pinned
  commit, base release, the patches), as MPL-2.0 3.2 asks.
- README and LICENSE no longer call the packages Apache-2.0 and MPL-2.0
  only; the dead licensing.shtml reference is replaced by the UXP
  LICENSE and TRADEMARK files and Moonchild's legal and redist pages.
- Apache-2.0 4(b) change notices on the 29 HP-derived files changed
  since import.
- A drawn magnifier is the DuckDuckGo engines' icon; Google's logo is
  Google's only; the unused Bing logo is gone.
- The engine's services-sync.js defaults pointed at Moonchild's Sync,
  key server and add-on host: blanked at bundle time, checked.
- The "Blazer" keyword, the Goanna-mark tagline, a stray screenshot and
  a .bak dropped; the HP SDK's terms stated where it is downloaded;
  CREDITS records the logo's origin and the screenshot strip's licence.

Deferred to the next engine build: about:credits' URL and
--disable-ffmpeg (the system-libavcodec path is dead on the device).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XM9EDSp83ZFRhggY4RCT9X
2026-10-14 13:57:20 -04:00

157 lines
4.9 KiB
JavaScript

// Copyright 2012 Hewlett-Packard Development Company, L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Modified by the Jihad Browser project (2026), per Apache-2.0 section 4(b): this file differs from
// HP's isis-browser original. The changes are this repository's git history for this file.
enyo.kind({
name: "AddressInput",
kind: enyo.HFlexBox,
align: "center",
published: {
url: "",
loading: false,
//* The load of `url` failed: what is on screen is an error, not that site, and it
//* gets no padlock whatever the address says.
loadFailed: false,
//* `url` is a request the engine has not committed yet: the page on screen is still
//* the previous one, so its padlock (and its certificate) must not be shown under
//* the new address. Cleared when the engine reports the committed url.
pending: false
},
events: {
onBlur: "",
onInputChange: "",
onGo: "",
onStop: "",
onRefresh: "",
//* The padlock was tapped: whose certificate is this page's?
onSecureInfo: ""
},
chrome: [
{kind: "InputBox", layoutKind: "HFlexLayout", flex: 1, className: "enyo-tool-input", focusClassName: "enyo-tool-input-focus", spacingClassName: "enyo-tool-input-spacing", components: [
{name: "secureLock", kind: enyo.CustomButton, showing: false, className: "secure-lock", onclick: "doSecureInfo"},
{name: "userinput", kind: "Input", flex: 1, styled: false, inputType: "url", width: "100%", spellcheck: false, autocorrect: false, autoCapitalize: "lowercase", autoWordComplete: false, hint: $L("Enter URL or search terms"), selectAllOnFocus: true,
onfocus: "selectInput",
onblur: "deselectInput",
onkeydown: "inputKeydown",
oninput: "inputChange",
},
{name: "refreshButton", kind: "CustomButton", showing: false, className: "addressbar-button refresh-button", onclick: "doRefresh"},
{name: "clearButton", kind: "CustomButton", showing: true, className: "addressbar-button stop-button", onmousedown: "clearInput"},
{name: "stopButton", kind: "CustomButton", showing: false, className: "addressbar-button stop-button", onclick: "doStop"}
]}
],
//* @protected
_leftButton: "",
_rightButton: "clearButton",
selectInput: function() {
this.changeButtons();
},
deselectInput: function() {
if (this.$.userinput.getValue() === "") {
this.$.userinput.setValue(this.url);
}
this.changeButtons();
this.doBlur();
},
inputChange: function(inSender, inEvent, inValue) {
this.changeButtons();
this.doInputChange(inValue);
},
inputKeydown: function(inSender, inEvent) {
if (inEvent.keyCode == 13) {
this.go();
}
},
urlChanged: function() {
if (this.url) {
if (!this.hasFocus()) {
this.$.userinput.setValue(this.url);
}
this.changeButtons();
}
},
loadingChanged: function() {
this.changeButtons();
},
loadFailedChanged: function() {
this.changeButtons();
},
pendingChanged: function() {
this.changeButtons();
},
changeButtons: function() {
this.showLeftButton("");
if (this.hasFocus() && this.$.userinput.getValue().length >= 0) {
this.showRightButton("clearButton");
} else {
if (!this.loadFailed && !this.pending && this.url.toLowerCase().substring(0, 8) === "https://") {
this.showLeftButton("secureLock");
}
if (this.loading) {
this.showRightButton("stopButton");
} else {
this.showRightButton("refreshButton");
}
}
},
// need an IxD for secure lock icon (wireframe b5)
showLeftButton: function(inButton) {
this.showButton(inButton, this._leftButton);
this._leftButton = inButton;
},
showRightButton: function(inButton) {
this.showButton(inButton, this._rightButton);
this._rightButton = inButton;
},
showButton: function(inButton, inOldButton) {
if (inOldButton !== "") {
this.$[inOldButton].hide();
}
if (inButton !== "") {
this.$[inButton].show();
}
},
go: function() {
this.setLoading(true);
var value = this.getUserInput(true);
this.doGo(value);
document.activeElement.blur();
},
getUserInput: function(inRaw) {
var value = enyo.string.trim(this.$.userinput.getValue());
if (!inRaw) {
return enyo.string.escapeHtml(value);
} else {
return value;
}
},
clearInput: function() {
this.$.userinput.setValue("");
// input is blurred here causing the keyboard to reappear
this.$.userinput.forceFocus();
},
forceFocus: function() {
this.$.userinput.forceFocus();
},
//* public
hasFocus: function() {
return document.activeElement.tagName == "INPUT";
}
});