From ab63008e10f580eb33a41b27c12a406f64566ec9 Mon Sep 17 00:00:00 2001 From: hehongxing Date: Sat, 7 May 2022 17:52:03 +0800 Subject: [PATCH] commit --- .../App/Content/images/clear-gray.png | Bin 0 -> 1110 bytes .../Content/scripts/beijing/play-control.js | 49 ++++++++++++++++++ .../Content/scripts/menggu/play-control.js | 49 ++++++++++++++++++ .../Content/scripts/tiananmen/play-control.js | 41 +++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 04.系统编码/App/Content/images/clear-gray.png create mode 100644 04.系统编码/App/Content/scripts/beijing/play-control.js create mode 100644 04.系统编码/App/Content/scripts/menggu/play-control.js create mode 100644 04.系统编码/App/Content/scripts/tiananmen/play-control.js diff --git a/04.系统编码/App/Content/images/clear-gray.png b/04.系统编码/App/Content/images/clear-gray.png new file mode 100644 index 0000000000000000000000000000000000000000..c8b7731d87e503659d12b811bcf52a9989af5506 GIT binary patch literal 1110 zcmaJ=&rj1(94{J(Vi2Oy1Y+W|MA5{qecjfsg$Z4|$pS+%mH-JRbnOEww6C@gH;4zs z#6Y|ePo9kNswR3dYLo-Us3%Vvz4;FiFD6`!udty9q)Fe;@8|RRzVDCK;i1bd%^l4Q z!?fi4jUt^7MgO5DI&QSSxl5;Zk{u%>c#2fa05O`4%LwFMa~c(qX)j#=fO;6_pyQOr z$XH=ewXhpABb!*&^(mTRdU~tAY0V-6%4pj0((LA|w=8h%G&`Cs2nAn9Gfw|vfJPRF zO4j16rPyrmCD2nOBaDCK!q1lJdAS!R0T;*%AoeKR4uTl)S{8AY0+Jpogu_mdA?Gq#47O^ z4yJjiD3n9wMUkTxT)5y7v&wm4XPv=7p%pkjaj*v>Mzf6PNt&ge?mWTu3x!=`FRTTM zhK#S8J`ZC8@4C^uwyi@_M1S4b(>g3I_=qo}5YGn|&Bs({9ZX}lzffdIy-}|O4o!+V zXJBjIMIOl;X_nr^Y{ypRa@@9{06B!@IG0osBBzLAoU={Igiw~tqG{H7_QJ=tlmG=m z&@xbjFsmzyE-P7G%q5d4K}+d%Y~Blr=~<|*?NIFqE97#yeX*(@Ad}#rgz;Rx3WjGe z!Ql+{fv$t|qmF0eN_Zj4(9VMm6gW4KoeQuFwnMBsd&olM~2UfbrAE@UtXJvisOyBF18hRYU>#MGWz^+)am)`kntolx%>yyI$II| literal 0 HcmV?d00001 diff --git a/04.系统编码/App/Content/scripts/beijing/play-control.js b/04.系统编码/App/Content/scripts/beijing/play-control.js new file mode 100644 index 0000000..34993de --- /dev/null +++ b/04.系统编码/App/Content/scripts/beijing/play-control.js @@ -0,0 +1,49 @@ +var PlayControl = function (parent, id) { + this.Self = $(id); + this.Parent = parent; + + this.PlayTimer = null; + this.CurrentTimeList = null; + + this.PrevButton = this.Self.find('.prev-btn:first'); + this.NextButton = this.Self.find('.next-btn:first'); + this.PlayButton = this.Self.find('.play-btn:first'); + this.PauseButton = this.Self.find('.pause-btn:first'); + + this.Startup = function () { + this.PrevButton.on('click', this.OnPreButtonClick.bind(this)); + this.NextButton.on('click', this.OnNextButtonClick.bind(this)); + this.PlayButton.on('click', this.OnPlayButtonClick.bind(this)); + this.PauseButton.on('click', this.OnPauseButtonClick.bind(this)); + }; + + this.OnPreButtonClick = function () { + var active = this.CurrentTimeList.find('.active:first'); + var prev = active.prev(); + if (prev.length === 0) + prev = this.CurrentTimeList.find('li:last'); + + prev.trigger('click'); + }; + + this.OnNextButtonClick = function () { + var active = this.CurrentTimeList.find('.active:first'); + var next = active.next(); + if (next.length === 0) + next = this.CurrentTimeList.find('li:first'); + + next.trigger('click'); + }; + + this.OnPlayButtonClick = function () { + this.PlayTimer = setInterval(this.OnNextButtonClick.bind(this), 1500); + this.PauseButton.parent('.pause').show(); + this.PlayButton.parent('.play').hide(); + }; + + this.OnPauseButtonClick = function () { + clearInterval(this.PlayTimer); + this.PauseButton.parent('.pause').hide(); + this.PlayButton.parent('.play').show(); + }; +}; \ No newline at end of file diff --git a/04.系统编码/App/Content/scripts/menggu/play-control.js b/04.系统编码/App/Content/scripts/menggu/play-control.js new file mode 100644 index 0000000..34993de --- /dev/null +++ b/04.系统编码/App/Content/scripts/menggu/play-control.js @@ -0,0 +1,49 @@ +var PlayControl = function (parent, id) { + this.Self = $(id); + this.Parent = parent; + + this.PlayTimer = null; + this.CurrentTimeList = null; + + this.PrevButton = this.Self.find('.prev-btn:first'); + this.NextButton = this.Self.find('.next-btn:first'); + this.PlayButton = this.Self.find('.play-btn:first'); + this.PauseButton = this.Self.find('.pause-btn:first'); + + this.Startup = function () { + this.PrevButton.on('click', this.OnPreButtonClick.bind(this)); + this.NextButton.on('click', this.OnNextButtonClick.bind(this)); + this.PlayButton.on('click', this.OnPlayButtonClick.bind(this)); + this.PauseButton.on('click', this.OnPauseButtonClick.bind(this)); + }; + + this.OnPreButtonClick = function () { + var active = this.CurrentTimeList.find('.active:first'); + var prev = active.prev(); + if (prev.length === 0) + prev = this.CurrentTimeList.find('li:last'); + + prev.trigger('click'); + }; + + this.OnNextButtonClick = function () { + var active = this.CurrentTimeList.find('.active:first'); + var next = active.next(); + if (next.length === 0) + next = this.CurrentTimeList.find('li:first'); + + next.trigger('click'); + }; + + this.OnPlayButtonClick = function () { + this.PlayTimer = setInterval(this.OnNextButtonClick.bind(this), 1500); + this.PauseButton.parent('.pause').show(); + this.PlayButton.parent('.play').hide(); + }; + + this.OnPauseButtonClick = function () { + clearInterval(this.PlayTimer); + this.PauseButton.parent('.pause').hide(); + this.PlayButton.parent('.play').show(); + }; +}; \ No newline at end of file diff --git a/04.系统编码/App/Content/scripts/tiananmen/play-control.js b/04.系统编码/App/Content/scripts/tiananmen/play-control.js new file mode 100644 index 0000000..aa8d069 --- /dev/null +++ b/04.系统编码/App/Content/scripts/tiananmen/play-control.js @@ -0,0 +1,41 @@ +var PlayControl = function (parent) { + this.Parent = parent; + this.Timer = null; + + this.Startup = function () { + $('#prev').on('click', this.ActivePrevImage.bind(this)); + $('#next').on('click', this.ActiveNextImage.bind(this)); + $('#play').on('click', this.OnPlayButtonClick.bind(this)); + $('#pause').on('click', this.OnPauseButtonClick.bind(this)); + }; + + this.ActivePrevImage = function () { + var index = parseInt($(".calc-list").attr("index")); + var count = parseInt($(".calc-list").attr("count")); + var prevIndex = index > 0 ? index - 1 : count - 1; + this.Parent.SetActiveImage(prevIndex); + }; + + this.ActiveNextImage = function () { + var index = parseInt($(".calc-list").attr("index")); + var count = parseInt($(".calc-list").attr("count")); + var nextIndex = index < count - 1 ? index + 1 : 0; + this.Parent.SetActiveImage(nextIndex); + }; + + this.AutoPlay = function () { + this.Timer = setInterval(this.ActiveNextImage.bind(this), 1500); + }; + + this.OnPlayButtonClick = function () { + this.AutoPlay(); + $('.btn-group div.pause').show(); + $('.btn-group div.play').hide(); + }; + + this.OnPauseButtonClick = function () { + clearInterval(this.Timer); + $('.btn-group div.pause').hide(); + $('.btn-group div.play').show(); + }; +}; \ No newline at end of file