mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-04-17 05:20:57 +00:00
Fixed bug with the switch back into NORMAL mode from replay or capture
This commit is contained in:
parent
cf8cbe7b3d
commit
a90af10461
5 changed files with 22 additions and 8 deletions
|
|
@ -89,10 +89,10 @@ var Bus = function() {
|
|||
setup: function() {
|
||||
this.mode = NORMAL_MODE;
|
||||
this.context = undefined;
|
||||
},
|
||||
}.bind(this),
|
||||
teardown: function() {
|
||||
// no-op
|
||||
}
|
||||
}.bind(this)
|
||||
};
|
||||
|
||||
this.init = function() {
|
||||
|
|
|
|||
|
|
@ -176,7 +176,14 @@ var ReplayPanel = function() {
|
|||
_html = '<div class="postal-replay-title">Postal Message Replay</div> <input disabled class="postal-replay-button" type="button" id="btnRealTime" value="Play" onclick="postal.replay.replayRealTime()"> <input disabled class="postal-replay-button" type="button" id="btnStop" value="Stop" onclick="postal.replay.replayStop()"> <input disabled class="postal-replay-button" type="button" id="btnAdvance" value="Step" onclick="postal.replay.replayAdvance()"> <input disabled class="postal-replay-button" type="button" id="btnImmediate" value="Immediate" onclick="postal.replay.replayImmediate()"> <div class="postal-replay-load"> <select class="postal-replay-dropdown" id="drpBatches"></select> <input class="postal-replay-button" type="button" id="btnLoad" value="Load Batch" onclick="postal.replay.loadBatch()"> <div class="info-msg" id="info-msg"></div> </div> <div id="currentBatch"> <div class="postal-replay-row"> <div class="postal-replay-label">Batch ID:</div> <div class="postal-replay-value" id="batchId"></div> </div> <div class="postal-replay-row"> <div class="postal-replay-label">Description:</div> <div class="postal-replay-value" id="description"></div> </div> <div class="postal-replay-row"> <div class="postal-replay-label">Msg Count:</div> <div class="postal-replay-value" id="messageCount"></div> </div> </div> <input class="postal-replay-button postal-replay-exit" type="button" id="btnExitReplay" value="Exit Replay Mode" onclick="postal.replay.exitReplay()">';
|
||||
|
||||
this.exitReplay = function() {
|
||||
postal.publish(postal.SYSTEM_EXCHANGE, "mode.set", { mode: postal.NORMAL_MODE });
|
||||
var regex = /(postalmode=\w+)&*/i,
|
||||
match = regex.exec(window.location.hash);
|
||||
if(match && match.length >= 2) {
|
||||
window.location.hash = window.location.hash.replace(match[1], "postalmode=Normal");
|
||||
}
|
||||
else {
|
||||
postal.publish(postal.SYSTEM_EXCHANGE, "mode.set", { mode: postal.NORMAL_MODE });
|
||||
}
|
||||
};
|
||||
|
||||
this.replayRealTime = function() {
|
||||
|
|
|
|||
|
|
@ -87,10 +87,10 @@ var Bus = function() {
|
|||
setup: function() {
|
||||
this.mode = NORMAL_MODE;
|
||||
this.context = undefined;
|
||||
},
|
||||
}.bind(this),
|
||||
teardown: function() {
|
||||
// no-op
|
||||
}
|
||||
}.bind(this)
|
||||
};
|
||||
|
||||
this.init = function() {
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ var Bus = function() {
|
|||
setup: function() {
|
||||
this.mode = NORMAL_MODE;
|
||||
this.context = undefined;
|
||||
},
|
||||
}.bind(this),
|
||||
teardown: function() {
|
||||
// no-op
|
||||
}
|
||||
}.bind(this)
|
||||
};
|
||||
|
||||
this.init = function() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,14 @@ var ReplayPanel = function() {
|
|||
_html = '<div class="postal-replay-title">Postal Message Replay</div> <input disabled class="postal-replay-button" type="button" id="btnRealTime" value="Play" onclick="postal.replay.replayRealTime()"> <input disabled class="postal-replay-button" type="button" id="btnStop" value="Stop" onclick="postal.replay.replayStop()"> <input disabled class="postal-replay-button" type="button" id="btnAdvance" value="Step" onclick="postal.replay.replayAdvance()"> <input disabled class="postal-replay-button" type="button" id="btnImmediate" value="Immediate" onclick="postal.replay.replayImmediate()"> <div class="postal-replay-load"> <select class="postal-replay-dropdown" id="drpBatches"></select> <input class="postal-replay-button" type="button" id="btnLoad" value="Load Batch" onclick="postal.replay.loadBatch()"> <div class="info-msg" id="info-msg"></div> </div> <div id="currentBatch"> <div class="postal-replay-row"> <div class="postal-replay-label">Batch ID:</div> <div class="postal-replay-value" id="batchId"></div> </div> <div class="postal-replay-row"> <div class="postal-replay-label">Description:</div> <div class="postal-replay-value" id="description"></div> </div> <div class="postal-replay-row"> <div class="postal-replay-label">Msg Count:</div> <div class="postal-replay-value" id="messageCount"></div> </div> </div> <input class="postal-replay-button postal-replay-exit" type="button" id="btnExitReplay" value="Exit Replay Mode" onclick="postal.replay.exitReplay()">';
|
||||
|
||||
this.exitReplay = function() {
|
||||
postal.publish(postal.SYSTEM_EXCHANGE, "mode.set", { mode: postal.NORMAL_MODE });
|
||||
var regex = /(postalmode=\w+)&*/i,
|
||||
match = regex.exec(window.location.hash);
|
||||
if(match && match.length >= 2) {
|
||||
window.location.hash = window.location.hash.replace(match[1], "postalmode=Normal");
|
||||
}
|
||||
else {
|
||||
postal.publish(postal.SYSTEM_EXCHANGE, "mode.set", { mode: postal.NORMAL_MODE });
|
||||
}
|
||||
};
|
||||
|
||||
this.replayRealTime = function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue