Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel'
Browse files Browse the repository at this point in the history
Conflicts:
	.idea/workspace.xml
	app.js
  • Loading branch information
Matthew Casperson committed Feb 23, 2014
2 parents a7c04c5 + 8a12f23 commit f74130a
Show file tree
Hide file tree
Showing 19 changed files with 1,767 additions and 1,771 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*.*~

1,455 changes: 842 additions & 613 deletions .idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions PressZilla.meta.js~

This file was deleted.

7 changes: 3 additions & 4 deletions PressZilla.user.js
Expand Up @@ -8,19 +8,18 @@
// @include http://docbuilder.ecs.eng.bne.redhat.com/*
// @include https://docbuilder.usersys.redhat.com/*
// @include https://docbuilder.ecs.eng.bne.redhat.com/*
// @include http://documentation-devel.engineering.redhat.com/site/documentation/*
// @include https://documentation-devel.engineering.redhat.com/site/documentation/*
// @require http://code.jquery.com/jquery-2.0.3.min.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaCommonUtils_v2.1.1.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaKeywordExtraction_v2.2.8.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaBugzillaIntegration_v3.7.9.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaBugzillaIntegration_v3.8.3.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaSolutionsIntegration_v2.7.1.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaMojoIntegration_v2.6.8.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaJbossOrgIntegration_v2.6.8.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaBugzillaSearchIntegration_v3.8.0.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaPnTIntegration_v2.7.4.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaProductPagesIntegration_v3.7.9.js
// @version 3.8.1
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaLinkChecker_v4.0.5.js
// @version 4.0.5
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @downloadURL https://docbuilder.usersys.redhat.com/PressZilla.user.js
Expand Down
530 changes: 0 additions & 530 deletions PressZilla.user.js~

This file was deleted.

18 changes: 18 additions & 0 deletions PressZillaDocsStage.user.js
@@ -0,0 +1,18 @@
// ==UserScript==
// @name PressZilla Docs Stage
// @namespace https://www.jboss.org/pressgang
// @description PressGang BugZilla customization
// @author Matthew Casperson
// @include https://bugzilla.redhat.com/*
// @include http://documentation-devel.engineering.redhat.com/site/documentation/*
// @include https://documentation-devel.engineering.redhat.com/site/documentation/*
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaCommonUtils_v2.1.1.js
// @require http://docbuilder.ecs.eng.bne.redhat.com/presszilla/PressZillaBugzillaIntegration_v3.8.3.js
// @version 4.0.5
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @downloadURL https://docbuilder.usersys.redhat.com/PressZillaDocsStage.user.js
// @updateURL https://docbuilder.usersys.redhat.com/PressZillaDocsStage.user.js
// @homepageURL https://docbuilder.usersys.redhat.com
// ==/UserScript==

39 changes: 37 additions & 2 deletions app.js
Expand Up @@ -53,6 +53,16 @@ var BUILD_BOOK_SCRIPT = "/home/pressgang/DocBuilder2/build_original_books.sh";
* @type {number}
*/
var DELAY_WHEN_NO_UPDATES = 60000;
/**
* The frozen tag id
* @type {number}
*/
var FROZEN_TAG = 669;
/**
* The obsolete tag id
* @type {number}
*/
var OBSOLETE_TAG = 652;

/**
* true when the modified topics have been processed.
Expand Down Expand Up @@ -111,6 +121,8 @@ var contentSpecRESTCallFailed = false;
*/
var topicRESTCallFailed = false;



/**
* Called when the modified topics and specs have been found. Once both
* functions have called this function, the process of actually building the
Expand All @@ -130,7 +142,7 @@ function buildBooks(updatedSpecs, allSpecsArray) {
<div class=\"container\">\n\
<div class=\"langBar\">Language:\n\
<select id=\"lang\" class=\"langSelect\" onchange=\"changeLang(this)\">\n\
<option selected value=\"\">English</option>\n\
<option selected value=\"\">English</option>\n\
<option value=\"zh-Hans\">Chinese (Simplified)</option>\n\
<option value=\"zh-TW\">Chinese (Taiwan)</option>\n\
<option value=\"fr\">French</option>\n\
Expand Down Expand Up @@ -317,6 +329,27 @@ function buildBooks(updatedSpecs, allSpecsArray) {
// select an image based on the presence of the index.html file
var image = fs.existsSync(deployment.APACHE_HTML_DIR + "/" + specId + "/index.html") ? 'url(/images/tick.png)' : 'url(/images/cross.png)';

var isFrozen = false;

for (var tagIndex = 0, tagCount = fixedSpecDetails.tags.length; tagIndex < tagCount; ++tagIndex ) {
if (fixedSpecDetails.tags[tagIndex] == FROZEN_TAG) {
isFrozen = true;
break;
}
}

var isObsolete = false;

for (var tagIndex = 0, tagCount = fixedSpecDetails.tags.length; tagIndex < tagCount; ++tagIndex ) {
if (fixedSpecDetails.tags[tagIndex] == OBSOLETE_TAG) {
isObsolete = true;
break;
}
}

var freezeLabel = isFrozen ? "Unfreeze" : "Freeze";
var obsoleteLabel = isObsolete ? "Unobsolete" : "Obsolete";

indexHtml += "{\n\
idRaw: " + specId + ",\n\
id: '<a href=\"" + deployment.EDIT_LINK.replace(deployment.OPEN_LINK_ID_REPLACE, specId) + "\" target=\"_top\">" + specId + "</a>',\n\
Expand All @@ -330,7 +363,9 @@ function buildBooks(updatedSpecs, allSpecsArray) {
publicanbook: '<a href=\"" + PUBLICAN_BOOK_ZIPS + "/" + latestFileFixed + "\"><button>Publican ZIP</button></a>',\n\
publicanlog: '<a href=\"" + specId + "/publican.log\"><button>Publican Log</button></a>',\n\
tags: [" + fixedSpecDetails.tags.toString() + "],\n\
status: '<div style=\"width: 32px; height: 32px; background-image: " + image + "; background-size: cover\"/>'\n\
status: '<div style=\"width: 32px; height: 32px; background-image: " + image + "; background-size: cover\"/>',\n\
freeze: '<button onclick=\"javascript:freezeSpec(" + isFrozen + ", \\'" + REST_SERVER + "\\', " + specId + ")\">" + freezeLabel + "</button>',\n\
obsolete: '<button onclick=\"javascript:obsoleteSpec(" + isObsolete + ", \\'" + REST_SERVER + "\\', " + specId + ")\">" + obsoleteLabel + "</button>'\n\
},\n";

processSpecDetails(++processIndex);
Expand Down

0 comments on commit f74130a

Please sign in to comment.