Set year of c9.ide.help dinamically

pull/477/head
Ozcan Ovunc 2018-01-24 11:44:36 +00:00
rodzic 718f53d835
commit 6e23b7834b
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -22,6 +22,9 @@ define(function(require, exports, module) {
var aboutDialog;
function load() {
var year = (new Date()).getFullYear();
markup = formatString(markup, year);
menus.addItemByPath("Cloud9/About Cloud9", new ui.item({
onclick: function() { showAbout(); }
}), 100, plugin);
@ -135,6 +138,13 @@ define(function(require, exports, module) {
var version = c9.version.replace(/([a-f\d]{10})[a-f\d]{30}/, "$1");
document.getElementById("c9Version").textContent = "Version " + version;
}
function formatString(str) {
var args = Array.prototype.slice.call(arguments).slice(1);
return str.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined' ? args[number] : match;
});
}
/***** Lifecycle *****/

Wyświetl plik

@ -25,7 +25,7 @@
</p>
</div>
<div class="c9Copyright">
<p>&#169; 2010 — 2017 Cloud9 Inc. All rights reserved</p>
<p>&#169; 2010 — {0} Cloud9 Inc. All rights reserved</p>
</div>
</div>
</a:window>