Skip to content

Commit

Permalink
Refine ZK-3155: Config CheckStyle for ZK JavaScript coding style check
Browse files Browse the repository at this point in the history
Signed-off-by: SEFI <sefilin@potix.com>
  • Loading branch information
SEFI committed Mar 31, 2016
1 parent 1f8fdac commit 8676bc6
Show file tree
Hide file tree
Showing 185 changed files with 2,216 additions and 2,215 deletions.
3 changes: 2 additions & 1 deletion bin/zk_jscheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"excludeFiles":["/**/mold/", "/**/debug/", "/**/codegen/", "/**/.git/", "/**/node_module/", "/**/jquery.js"],
/*"disallowEmptyBlocks": true,*/
"disallowKeywords": ["with"],
/*disallowMixedSpacesAndTabs": true,*/
"disallowMixedSpacesAndTabs": "smart",
"disallowTrailingWhitespace": "ignoreEmptyLines",
"disallowMultipleSpaces": {"allowEOLComments": true},
"disallowNewlineBeforeBlockStatements": true,
"disallowOperatorBeforeLineBreak": ["+", "-", "*", "/", "."],
Expand Down
6 changes: 3 additions & 3 deletions zk/src/archive/web/js/zk/anima.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ zk.copy(zjq.prototype, {
opts.afterAnima = function () {
if (prop) _restoreProp(self, prop);
if (visible) {
/*
/*
* fixed a bug of the finished animation for IE
* refix for ZK-568: Open combobox then select last item. reopen combobox then you should see selected item without scroll
* refix for ZK-568: Open combobox then select last item. reopen combobox then you should see selected item without scroll
*/
if (zk.ie == 8 || zk.ie == 10) zk(self.jq[0]).redoCSS();
if (zk.ie == 8 || zk.ie == 10) zk(self.jq[0]).redoCSS();
zUtl.fireShown(wgt);
} else {
self.jq.hide();
Expand Down
28 changes: 14 additions & 14 deletions zk/src/archive/web/js/zk/au.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Copyright (C) 2008 Potix Corporation. All Rights Reserved.
return;
}
if (v != 410 && //not timeout (SC_GONE)
(!reqInf.rtags || !reqInf.rtags.onTimer || zk.timerAlive)) // Bug ZK-2720 only timer-keep-alive should reset the timeout
(!reqInf.rtags || !reqInf.rtags.onTimer || zk.timerAlive)) // Bug ZK-2720 only timer-keep-alive should reset the timeout
zAu._resetTimeout();

if (pushReqCmds(reqInf, req)) { //valid response
Expand Down Expand Up @@ -276,14 +276,14 @@ Copyright (C) 2008 Potix Corporation. All Rights Reserved.

function ajaxSend(dt, aureq, timeout) {
//ZK-1523: dt(desktop) could be null, so search the desktop from target's parent.
//call stack: echo2() -> send()
//call stack: echo2() -> send()
if (!dt) {
//original dt is decided by aureq.target.desktop, so start by it's parent.
var wgt = aureq.target.parent;
while(!wgt.desktop) {
wgt = wgt.parent;
}
dt = wgt.desktop;
dt = wgt.desktop;
}
////
zAu.addAuRequest(dt, aureq);
Expand Down Expand Up @@ -647,11 +647,11 @@ zAu = {
//2011/04/22 feature 3291332
//Use sync request for chrome, safari and firefox (4 and later).
//Note: when pressing F5, the request's URL still arrives before this even async:false
async: !!zk.ie // (!!) coerce to boolean, undefined will be wrong for safari and chrome.
async: !!zk.ie // (!!) coerce to boolean, undefined will be wrong for safari and chrome.
// conservative, though it shall be (!zk.safari || zk.ff >= 4)
}, zAu.ajaxSettings), null, true/*fixed IE memory issue for jQuery 1.6.x*/);

// B65-ZK-2210: clean up portlet2 data when desktop removed.
// B65-ZK-2210: clean up portlet2 data when desktop removed.
if (!dummy && zk.portlet2Data && zk.portlet2Data[dt.id]) {
delete zk.portlet2Data[dt.id];
}
Expand Down Expand Up @@ -918,7 +918,7 @@ zAu.beforeSend = function (uri, req, dt) {
if (content)
ajaxSendNow({
sid: seqId, uri: requri, dt: dt, content: content,
implicit: implicit,
implicit: implicit,
ignorable: ignorable, tmout: 0, rtags: rtags
});
return true;
Expand Down Expand Up @@ -1034,15 +1034,15 @@ zAu.beforeSend = function (uri, req, dt) {
* The function receives four arguments: The XHR (XMLHttpRequest) object,
* a number describing the status of the request, a string describing the text
* of the status, and a number describing the retry value to re-send.
*
*
* <p>For example,
<pre><code>
zAu.ajaxErrorHandler = function (req, status, statusText, ajaxReqTries) {
if (ajaxReqTries == null)
ajaxReqTries = 3; // retry 3 times
// reset the resendTimeout, for more detail, please refer to
// http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_client-config_Element/The_auto-resend-timeout_Element
// reset the resendTimeout, for more detail, please refer to
// http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_client-config_Element/The_auto-resend-timeout_Element
zk.resendTimeout = 2000;//wait 2 seconds to resend.
if (!zAu.confirmRetry("FAILED_TO_RESPONSE", status+(statusText?": "+statusText:"")))
Expand Down Expand Up @@ -1173,11 +1173,11 @@ zAu.cmd0 = /*prototype*/ { //no uuid at all
aureqs = zAu.getAuRequests(dt);
// Bug ZK-2741
for (var i = 0, j = aureqs.length; i < j; i++) {
var aureq0 = aureqs[i];
if ((!aureq0.target || aureq0.target.$instanceof(zk.Desktop)) && aureq0.name == 'dummy') {
return; //no need to send more
}
}
var aureq0 = aureqs[i];
if ((!aureq0.target || aureq0.target.$instanceof(zk.Desktop)) && aureq0.name == 'dummy') {
return; //no need to send more
}
}
zAu.send(new zk.Event(dt, 'dummy', null, {ignorable: true}));
},
/** Ask the client to echo back globally.
Expand Down
2 changes: 1 addition & 1 deletion zk/src/archive/web/js/zk/bookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ zk.bmk = (function () { //used internally
_startCheck = null;
checkBookmark();
setInterval(checkBookmark, 250);
//Though IE use bookmark.html, timer is still required
//Though IE use bookmark.html, timer is still required
//because user might specify URL directly
};
zk._apac(_startCheck); //see mount.js (after page AU cmds)
Expand Down
8 changes: 4 additions & 4 deletions zk/src/archive/web/js/zk/canvas/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ zk.canvas.Canvas = {
* main.append(canvas);
* var canvas = zk.canvas.Canvas.create(main.clientWidth, main.clientHeight);
* var ctx = canvas.getContext("2d");
* ctx.fillStyle = "rgb(200,0,0)";
* ctx.fillRect (10, 10, 55, 50);
*
* ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
* ctx.fillStyle = "rgb(200,0,0)";
* ctx.fillRect (10, 10, 55, 50);
*
* ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
* ctx.fillRect (30, 30, 255, 50);
* </code></pre>
*
Expand Down
10 changes: 5 additions & 5 deletions zk/src/archive/web/js/zk/crashmsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* 5 -> user server no response
Customization in zk.xml:
* init crash page layout by defining window.zkShowCrashMessage function
* init crash timeout by giving a number(sec)
* init crash timeout by giving a number(sec)
History:
Wed, Nov 12, 2014 5:10:36 PM, Created by Chunfu
Expand All @@ -20,22 +20,22 @@ Copyright (C) Potix Corporation. All Rights Reserved.
*/
window.zkInitCrashTimer = setTimeout(function () {
var zkErrorCode,
z_runonce = document.querySelectorAll('.z-runonce')[0],
z_runonce = document.querySelectorAll('.z-runonce')[0],
zk_proc = document.getElementById('zk_proc'),
ztemp = document.querySelectorAll('.z-temp')[0],
zna = document.getElementById('zna'),
body = document.body;
if (zk_proc) {
if (z_runonce) { //zk error
if (ztemp) {
if (ztemp) {
if (!zna)
zkErrorCode = 1;
else
else
zkErrorCode = 2;
} else
zkErrorCode = 3;
} else { // user error
if (ztemp)
if (ztemp)
zkErrorCode = 4;
else
zkErrorCode = 5;
Expand Down
Loading

0 comments on commit 8676bc6

Please sign in to comment.