diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php
index e3192ad6..f41c48bb 100644
--- a/application/views/station_profile/edit.php
+++ b/application/views/station_profile/edit.php
@@ -354,9 +354,10 @@
+
- 240.
+
diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js
index 123cb4a0..2c557560 100644
--- a/assets/js/sections/common.js
+++ b/assets/js/sections/common.js
@@ -295,8 +295,16 @@ function qso_edit(id) {
}
});
// [eQSL default msg] change value (for qso edit page) //
- $('.modal-content #stationProfile').change(function() { qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),false,'.modal-content'); });
- $('.modal-content .qso_eqsl_qslmsg_update').off('click').on('click',function() { qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),true,'.modal-content'); });
+ $('.modal-content #stationProfile').change(function() {
+ qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),false,'.modal-content');
+ });
+ $('.modal-content .qso_eqsl_qslmsg_update').off('click').on('click',function() {
+ qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),true,'.modal-content');
+ $('.modal-content #charsLeft').text(" ");
+ });
+ $('.modal-content #qslmsg').keyup(function(event) {
+ calcRemainingChars(event, '.modal-content');
+ });
},
});
}
diff --git a/assets/js/sections/eqslcharcounter.js b/assets/js/sections/eqslcharcounter.js
new file mode 100644
index 00000000..0f1e6826
--- /dev/null
+++ b/assets/js/sections/eqslcharcounter.js
@@ -0,0 +1,18 @@
+$('#eqslDefaultQSLMsg').keyup(function(event) {
+ calcRemainingChars(event);
+});
+
+$('.qso_panel #qslmsg').keyup(function(event) {
+ calcRemainingChars(event, '.qso_panel');
+});
+
+function calcRemainingChars(event, object = '') {
+ var remainingChars = 240 - $(event.target).val().length;
+ $(object + ' #charsLeft').text(remainingChars + "/240");
+
+ if (remainingChars < 5) {
+ $(object + ' #charsLeft').css('color', 'red');
+ } else {
+ $(object + ' #charsLeft').css('color', '');
+ }
+}
\ No newline at end of file