mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-10 06:52:05 +01:00
Implemented hash link for each expression
This commit is contained in:
@@ -9,6 +9,8 @@ code { font-size: 1.2em; font-weight: bold; }
|
||||
.result .input { margin-bottom: 10px; }
|
||||
.result .content { padding-left: 10px}
|
||||
.result .cur { color: lightgray; margin-right: 5px; }
|
||||
.hashLink { text-decoration: none; margin-left: 5px; }
|
||||
.hashLink:hover { text-decoration: underline; margin-left: 5px; }
|
||||
|
||||
.expression .label { font-weight: bold; padding-right: 5px; text-align: right; }
|
||||
.expression .bin { letter-spacing: 3px; }
|
||||
@@ -38,6 +40,9 @@ code { font-size: 1.2em; font-weight: bold; }
|
||||
.light .on { color: #121212; }
|
||||
.light .prefix { color: #888}
|
||||
.light .other { color: #bbb }
|
||||
.light .hashLink, .light .hashLink:visited { color: #ddd }
|
||||
.light .hashLink:hover { color: #888 }
|
||||
|
||||
|
||||
/* Dark */
|
||||
.dark { background: #121212; color: white;}
|
||||
@@ -48,5 +53,6 @@ code { font-size: 1.2em; font-weight: bold; }
|
||||
.dark .zero { color: #999;}
|
||||
.dark .prefix { color: #999}
|
||||
.dark .other { color: #444;}
|
||||
|
||||
.dark .hashLink, .dark .hashLink:visited { color: #333 }
|
||||
.dark .hashLink:hover { color: #999 }
|
||||
|
||||
|
||||
@@ -116,9 +116,9 @@
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script data-template="resultView" type="text/template">
|
||||
<script data-template="resultView" data-compiled="" type="text/template">
|
||||
<div class="result">
|
||||
<div class="input mono"><span class="cur">></span>{input}</div>
|
||||
<div class="input mono"><span class="cur">></span>{m.input}<a class="hashLink" title="Link for this expression" href="{window.location.pathname}#{m.inputHash}">#</a></div>
|
||||
<div class="content"></div>
|
||||
</div>
|
||||
</script>
|
||||
@@ -199,7 +199,8 @@
|
||||
cmd.execute('help');
|
||||
|
||||
if(window.location.hash.length > 1) {
|
||||
cmd.execute(window.location.hash.substr(1).replace(/,/g,' '));
|
||||
|
||||
cmd.execute(app.get('hash').decodeHash(window.location.hash));
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
function DisplayResult (input, content) {
|
||||
this.input = input;
|
||||
this.inputHash = app.get('hash').encodeHash(input);
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,15 @@
|
||||
app.set('should', core.should);
|
||||
app.set('bindr', core.bindr);
|
||||
|
||||
app.set('hash', function () {
|
||||
return {
|
||||
encodeHash: function(string) {
|
||||
return encodeURI(string.trim()).replace(/\s/g,',');
|
||||
},
|
||||
decodeHash: function(hashValue) {
|
||||
return decodeURI(hashValue).replace(/^\#/, '').replace(/,/g,' ');
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
})(window.app, window.core);
|
||||
Reference in New Issue
Block a user