Skip to content

Commit

Permalink
V2.5 - Imp enhanced hide mode with black font.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeddaZ committed May 26, 2020
1 parent e85d2cd commit 755972e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 24 deletions.
8 changes: 8 additions & 0 deletions ShadowStock/stock/content/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,12 @@ iframe.impexp {

#stockTable td.btn-default {
background-color: transparent;
}

.display-block {
display: block;
}

.font-weight-normal {
font-weight: normal !important;
}
29 changes: 21 additions & 8 deletions ShadowStock/stock/scripts/shadowstock.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
_userSettings,
defaultUserSettings = {
refreshInterval: 5000,
blackMode: false,
displayColumns: [
{ id: 50, name: '操作' },
{ id: 54, name: '名称代码' },
Expand Down Expand Up @@ -432,10 +433,15 @@
/******************** 内部方法 ********************/
getClassDefault = function (data) {
if (this._class == undefined) {
var value = this.siblings[_appSettings.changeColumnId].getValue(data);
this._class = value > 0
? 'positive'
: (value < 0 ? 'negative' : '');
if (!_userSettings.blackMode) {
var value = this.siblings[_appSettings.changeColumnId].getValue(data);
this._class = value > 0
? 'positive'
: (value < 0 ? 'negative' : '');
}
else {
this._class = '';
}
}
return this._class;
},
Expand Down Expand Up @@ -492,10 +498,15 @@
},
getClassForGainLoss = function (data) {
if (this._class == undefined) {
var value = this.siblings[_appSettings.gainLossColumnId].getValue(data);
this._class = value > 0
? 'btn-danger'
: (value < 0 ? 'btn-success' : 'btn-default disabled');
if (!_userSettings.blackMode) {
var value = this.siblings[_appSettings.gainLossColumnId].getValue(data);
this._class = value > 0
? 'btn-danger'
: (value < 0 ? 'btn-success' : 'disabled');
}
else {
this._class = 'disabled';
}
}
return this._class;
},
Expand Down Expand Up @@ -761,6 +772,7 @@
switch (args.result) {
case 'save':
_userSettings.refreshInterval = args.refreshInterval;
_userSettings.blackMode = args.blackMode;
_userSettings.displayColumns = args.displayColumns;
setUserSettings();
showAlert('设置已更新,立即生效');
Expand Down Expand Up @@ -867,6 +879,7 @@
token: _appId,
callback: 'ShadowStock.settingsCallback',
refreshInterval: _userSettings.refreshInterval,
blackMode: _userSettings.blackMode,
displayColumns: displayColumnsKey,
availableColumns: availableColumnsKey,
actionsColumnId: _appSettings.actionsColumnId
Expand Down
29 changes: 21 additions & 8 deletions ShadowStock/stock/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,30 @@
<body>
<div class="container-fluid container-settings">
<div class="row">
<div class="col-xs-12">
<div class="col-xs-5">
<div class="form-group">
<label for="refreshInterval">刷新间隔(秒)</label>
<label for="refreshInterval">刷新间隔</label>
<select id="refreshInterval" class="form-control input-sm">
<option value="3000">3</option>
<option value="5000">5</option>
<option value="8000">8</option>
<option value="10000">10</option>
<option value="30000">30</option>
<option value="60000">60</option>
<option value="3000">3</option>
<option value="5000">5</option>
<option value="8000">8</option>
<option value="10000">10</option>
<option value="30000">30</option>
<option value="60000">60</option>
</select>
</div>
</div>
<div class="col-xs-2">
</div>
<div class="col-xs-5">
<div class="form-group">
<label class="display-block">强化隐蔽</label>
<label class="font-weight-normal">
<input type="checkbox" id="blackMode" />
启用黑色字体
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-5">
Expand Down Expand Up @@ -72,6 +83,7 @@
}

var _refreshInterval = $('#refreshInterval').val(_args.refreshInterval);
var _blackMode = $('#blackMode').attr('checked', _args.blackMode);

var _availableColumns = $('#availableColumns').empty().dblclick(function () {
$('[data-action="addColumn"]').click();
Expand Down Expand Up @@ -142,6 +154,7 @@
token: _args.token,
result: $(this).data('result'),
refreshInterval: _refreshInterval.val(),
blackMode: _blackMode.is(':checked'),
displayColumns: displayColumns
};
eval('window.parent.' + _args.callback + '(args)');
Expand Down
12 changes: 6 additions & 6 deletions Shadowin/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<value>Desktop</value>
</setting>
<setting name="Opacity" serializeAs="String">
<value>0.6</value>
<value>0.5</value>
</setting>
<setting name="FormMinimumSize" serializeAs="String">
<value>1000, 210</value>
Expand All @@ -39,25 +39,25 @@
<!-- 页面缩放 -->
<add key="PageZoom" value="100%"/>

<!-- 热键:窗口宽度 -->
<!-- 窗口宽度热键(默认 Ctrl + ← 和 Ctrl + →) -->
<add key="IncreaseWidthHotKeyModifierKey" value="Control"/>
<add key="IncreaseWidthHotKeyKey" value="Left"/>
<add key="DecreaseWidthHotKeyModifierKey" value="Control"/>
<add key="DecreaseWidthHotKeyKey" value="Right"/>
<!-- 热键:窗口高度 -->
<!-- 窗口高度热键(默认 Ctrl + ↑ 和 Ctrl + ↓) -->
<add key="IncreaseHeightHotKeyModifierKey" value="Control"/>
<add key="IncreaseHeightHotKeyKey" value="Up"/>
<add key="DecreaseHeightHotKeyModifierKey" value="Control"/>
<add key="DecreaseHeightHotKeyKey" value="Down"/>
<!-- 热键:窗口透明度 -->
<!-- 窗口透明度热键(默认 Ctrl + + 和 Ctrl + -) -->
<add key="IncreaseOpacityHotKeyModifierKey" value="Control"/>
<add key="IncreaseOpacityHotKeyKey" value="Oemplus"/>
<add key="DecreaseOpacityHotKeyModifierKey" value="Control"/>
<add key="DecreaseOpacityHotKeyKey" value="OemMinus"/>
<!-- 热键:窗口显示/隐藏 -->
<!-- 窗口显隐热键(默认 Ctrl + ~) -->
<add key="ShowHideHotKeyModifierKey" value="Control"/>
<add key="ShowHideHotKeyKey" value="Oemtilde"/>
<!-- 热键:退出程序 -->
<!-- 退出程序热键(默认 Ctrl + 0) -->
<add key="ExitHotKeyModifierKey" value="Control"/>
<add key="ExitHotKeyKey" value="D0"/>

Expand Down
4 changes: 2 additions & 2 deletions Shadowin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.*")]
[assembly: AssemblyFileVersion("2.4.0.0")]
[assembly: AssemblyVersion("2.5.*")]
[assembly: AssemblyFileVersion("2.5.0.0")]
Binary file modified Shadowin/Resources/donate-wechat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 755972e

Please sign in to comment.