Skip to content

Commit

Permalink
move to 6.0.0
Browse files Browse the repository at this point in the history
lint
  • Loading branch information
hkollmann committed Feb 5, 2021
1 parent 2b5b5b9 commit 3da5076
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 39 deletions.
7 changes: 2 additions & 5 deletions Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"translation": "source/translation"
},
"requires": {
"@qooxdoo/framework": "^6.0.0-beta",
"@qooxdoo/compiler": "^1.0.0-beta",
"qooxdoo/qxl.logpane": "^1.0.0-beta.0",
"qooxdoo/qxl.versionlabel": "^1.0.0-beta.0",
"maettu/qx-showdown": "^1.8.7"
"@qooxdoo/framework": "^6.0.0",
"@qooxdoo/compiler": "^1.0.0"
}
}
19 changes: 11 additions & 8 deletions compile.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"$schema": "https://qooxdoo.org/schema/compile-1-0-0.json",
"targets": [
{
"targets": [{
"type": "source",
"outputPath": "compiled/source",
"bundle": {
"include": "qx.*"
}
},
{
}, {
"type": "build",
"outputPath": "compiled/build"
}
Expand All @@ -17,14 +15,19 @@
"locales": ["en"],

"environment": {
"qxl.packagebrowser.cache-url" : "https://raw.githubusercontent.com/qooxdoo/qx-contrib/master/cache.json"
"qxl.packagebrowser.cache-url": "https://raw.githubusercontent.com/qooxdoo/qx-contrib/master/cache.json"
},
"applications": [
{
"applications": [{
"title": "Qooxdoo Package Browser",
"class": "qxl.packagebrowser.Application",
"theme": "qxl.packagebrowser.Theme",
"name": "qxl.packagebrowser"
}
]
],
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 2018
}
}

}
12 changes: 6 additions & 6 deletions qx-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"libraries": [
{
"library_name": "logpane",
"library_version": "1.0.0",
"path": "qx_packages/qooxdoo_qxl_logpane_v1_0_0",
"library_version": "1.0.2",
"path": "qx_packages/qooxdoo_qxl_logpane_v1_0_2",
"uri": "qooxdoo/qxl.logpane",
"repo_name": "qooxdoo/qxl.logpane",
"repo_tag": "v1.0.0"
"repo_tag": "v1.0.2"
},
{
"library_name": "versionlabel",
"library_version": "1.0.0",
"path": "qx_packages/qooxdoo_qxl_versionlabel_v1_0_0",
"library_version": "1.0.4",
"path": "qx_packages/qooxdoo_qxl_versionlabel_v1_0_4",
"uri": "qooxdoo/qxl.versionlabel",
"repo_name": "qooxdoo/qxl.versionlabel",
"repo_tag": "v1.0.0"
"repo_tag": "v1.0.4"
},
{
"library_name": "qxShowdown",
Expand Down
50 changes: 30 additions & 20 deletions source/class/qxl/packagebrowser/PackageBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@
* @asset(qxl/packagebrowser/icon/github-16x16.png)
*
* @ignore(location.*)
* @ignore(showdown)
* @ignore(qx.$$appRoot)
*/
/* global showdown */
qx.Class.define("qxl.packagebrowser.PackageBrowser", {
extend: qx.ui.container.Composite,

Expand All @@ -77,7 +79,6 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
},

construct: function () {

qxShowdown.Load;
this.base(arguments);

Expand Down Expand Up @@ -254,8 +255,8 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {

// -- documentaton
var docButton = new qx.ui.toolbar.Button(this.tr("Documentation"), "icon/22/apps/internet-web-browser.png");
docButton.addListener("execute",() => {
window.open('https://www.qooxdoo.org/docs/#/cli/packages');
docButton.addListener("execute", () => {
window.open("https://www.qooxdoo.org/docs/#/cli/packages");
}, this);
docButton.setToolTipText("Open package system documentation");
bar.add(docButton);
Expand Down Expand Up @@ -501,7 +502,6 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
leftReloadTree: function (e) {
this._sampleToTreeNodeMap = {};
var _sampleToTreeNodeMap = this._sampleToTreeNodeMap;
var _initialSection = null;
var _initialNode = null;

// set a section to open initially
Expand Down Expand Up @@ -584,15 +584,14 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {

// -- Main --------------------------------
var ttree = this.tests.handler.ttree;
var that = this;

// Handle current Tree Selection and Content
this.tree.setUserData("modelLink", ttree); // link top level widgets and model

this.tree.getRoot().setOpen(true);
buildSubTree(this.tree.getRoot(), ttree);

if (_initialNode != null) {
if (_initialNode !== null) {
this.updateIframe(_initialNode);
} else {
this.tree.setSelection([this.tree.getRoot()]);
Expand Down Expand Up @@ -673,13 +672,15 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
case "problems":
html = this.__getProblemsHtml(modelNode);
break;
default:
default: {
let children = modelNode.getChildren();
if (Array.isArray(children) && children.length && children[0].type === "library") {
/* eslint-disable-next-line consistent-return */
return this.updateIframe(children[0]);
}
state = modelNode.pwd().slice(1).concat([modelNode.label]).join("/");
url = this.welcomeUrl;
}
}
} else if (!url) {
url = this.welcomeUrl;
Expand Down Expand Up @@ -749,10 +750,18 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
const repo_url = "https://github.com/" + modelNode.uri.split(/\//).slice(0, 2).join("/");
const display = v => v ? "" : "display:none";

/**
* @param {...any} args
*/
function createTableRow(...args) {
return "<tr>" + args.map(arg => `<td>${arg}</td>`).join("") + "</tr>";
}

/**
* @param href
* @param linktext
* @param target
*/
function createAnchor(href, linktext, target="_blank") {
return `<a href="${href}" ${target ? "target=\"" + target + "\"" : ""}>${linktext || href}</a>`;
}
Expand All @@ -761,6 +770,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
if (!pkg_uri.startsWith("@") && !pkg_uri.startsWith("qooxdoo-")) {
return createTableRow(createAnchor(`javascript:void(top.location.hash='${pkg_uri.replace("/", "~")}~library')`, pkg_uri), range);
}
return null;
}).filter(v => Boolean(v));
let html = `
<h1>${lib.info.name}</h1>
Expand All @@ -771,7 +781,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
${createTableRow("Authors:", this.__getAuthorsHtml(lib.info.authors))}
${createTableRow("Homepage:", createAnchor(lib.info.homepage))}
${createTableRow("Repository:", createAnchor(repo_url))}
${createTableRow("Issues:", createAnchor(this.__getNewIssueUrl(modelNode.uri), "List of issues") + " | " + createAnchor(this.__getNewIssueUrl(modelNode.uri,true), "Create new issue"))}
${createTableRow("Issues:", createAnchor(this.__getNewIssueUrl(modelNode.uri), "List of issues") + " | " + createAnchor(this.__getNewIssueUrl(modelNode.uri, true), "Create new issue"))}
${createTableRow("Keywords:", this.__getKeywordssHtml(lib.info.keywords || []))}
</table>
<h2 style="${display(lib.info.description)}">Description</h2>
Expand Down Expand Up @@ -808,7 +818,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
},

__getNewIssueUrl(uri, newIssue=false) {
uri = uri.split("/").slice(0,2).join("/");
uri = uri.split("/").slice(0, 2).join("/");
return `https://github.com/${uri}/issues${newIssue ? "/new" : ""}`;
},

Expand Down Expand Up @@ -839,7 +849,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
The package author should run <span class="code">qx package migrate</span>
in the root folder of this package, follow the instructions, and
release a new version of the package.</p>`;
log = log.replace(migrateSignal,"");
log = log.replace(migrateSignal, "");
}
const newIssueBody = [
`Compiling package '${info.name}' with the following environment:`, "",
Expand Down Expand Up @@ -899,7 +909,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
result.push(line.replace(explanation.regex, explanation.description));
}
return result;
},[]);
}, []);
if (explainMessages.length) {
html += `<h2>Explanation</h2>
<ul><li>${explainMessages.join("</li><li>")}</li></ul>`;
Expand All @@ -918,7 +928,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
const appsHtml = children.map(childNode => {
const hash = childNode.pwd().slice(1).concat([childNode.label]).join("~");
return `<a href="javascript:void(top.location.hash='${hash}')"><h2>${childNode.label}</h2></a>` +
(childNode.description ? `<p>${childNode.description}</p>` : "")
(childNode.description ? `<p>${childNode.description}</p>` : "");
}
).join("\n");
return `<h1>Demo Applications</h1>
Expand Down Expand Up @@ -958,8 +968,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
},

async __getReleasesHtml(modelNode, treeNode) {

let uri = modelNode.uri.split("/").slice(0,2).join("/");
let uri = modelNode.uri.split("/").slice(0, 2).join("/");
let apiUrl = `https://api.github.com/repos/${uri}/releases`;
qxl.packagebrowser.Popup.getInstance().useIcon("waiting").display(`Loading, please wait... `);
try {
Expand All @@ -969,7 +978,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
let result = await (await fetch(apiUrl)).json();
if (result.length) {
html = `<h1>Releases</h1>`;
html += result.map( release => {
html += result.map(release => {
if (release.draft) {
return null;
}
Expand All @@ -990,7 +999,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
if (release.tag_name === modelNode.latestVersion) {
titleSuffixes.push("current version");
}
let div = document.createElement('div');
let div = document.createElement("div");
div.innerText = release.body;
let description = div.innerHTML;
return `
Expand Down Expand Up @@ -1036,7 +1045,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
// check for the tags
var tags = folder.getUserData("tags");
var inTags = false;
if (tags != null) {
if (tags !== null) {
for (let j = 0; j < tags.length; j++) {
inTags = Boolean(tags[j].match(searchRegExp));
if (inTags) {
Expand Down Expand Up @@ -1097,10 +1106,11 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
req.addListener("success", function (evt) {
var content = evt.getTarget().getResponse();
if (!content) {
alert("Failed to load package data");
/* eslint-disable-next-line no-alert */
alert("Failed to load package data");
return;
}

/* eslint-disable-next-line no-eval */
let treeData = eval(content);

// give the browser a chance to update its UI before doing more
Expand All @@ -1114,7 +1124,7 @@ qx.Class.define("qxl.packagebrowser.PackageBrowser", {
if (state.startsWith("filter/")) {
qx.event.Timer.once(() => {
this._searchTextField.setValue(state.slice(7));
},null,1000);
}, null, 1000);
} else {
this.updateIframe(state);
}
Expand Down
3 changes: 3 additions & 0 deletions source/class/qxl/packagebrowser/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ qx.Class.define("qxl.packagebrowser.Tree", {
var agenda = [this];
var depthfirst = style === "depth" ? 1 : 0;

/**
*
*/
function f() {
var curr;

Expand Down
3 changes: 3 additions & 0 deletions source/class/qxl/packagebrowser/TreeDataHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ qx.Class.define("qxl.packagebrowser.TreeDataHandler", {

/**
* create a new tree path from path, under parent node
* @param parent
* @param path
* @param types
*/
__createPath(parent, path, types) {
var head = path[0];
Expand Down

0 comments on commit 3da5076

Please sign in to comment.