settings_org: Move 'time_limit_dropdown_values' to top-level.

This commit is contained in:
Shubham Dhama 2018-05-30 22:31:46 +05:30
parent 0caf55f2f0
commit 402bd4a4c6
2 changed files with 33 additions and 37 deletions

View File

@ -190,42 +190,40 @@ function set_video_chat_provider_dropdown() {
}
}
exports.setup_time_limit_dropdown_values = function () {
var time_limit_dropdown_values = {
any_time: {
text: i18n.t("Any time"),
seconds: 0,
},
never: {
text: i18n.t("Never"),
},
upto_two_min: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("2 minutes")}),
seconds: 2*60,
},
upto_ten_min: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("10 minutes")}),
seconds: 10*60,
},
upto_one_hour: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("1 hour")}),
seconds: 60*60,
},
upto_one_day: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("1 day")}),
seconds: 24*60*60,
},
upto_one_week: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("1 week")}),
seconds: 7*24*60*60,
},
custom_limit: {
text: i18n.t("Up to N minutes after posting"),
},
};
exports.msg_edit_limit_dropdown_values = time_limit_dropdown_values;
exports.msg_delete_limit_dropdown_values = time_limit_dropdown_values;
var time_limit_dropdown_values = {
any_time: {
text: i18n.t("Any time"),
seconds: 0,
},
never: {
text: i18n.t("Never"),
},
upto_two_min: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("2 minutes")}),
seconds: 2*60,
},
upto_ten_min: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("10 minutes")}),
seconds: 10*60,
},
upto_one_hour: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("1 hour")}),
seconds: 60*60,
},
upto_one_day: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("1 day")}),
seconds: 24*60*60,
},
upto_one_week: {
text: i18n.t("Up to __time_limit__ after posting", {time_limit: i18n.t("1 week")}),
seconds: 7*24*60*60,
},
custom_limit: {
text: i18n.t("Up to N minutes after posting"),
},
};
exports.msg_edit_limit_dropdown_values = time_limit_dropdown_values;
exports.msg_delete_limit_dropdown_values = time_limit_dropdown_values;
function set_msg_edit_limit_dropdown() {
var value = get_property_value("realm_msg_edit_limit_setting");

View File

@ -16,8 +16,6 @@ exports.initialize = function () {
failure: i18n.t("Save failed"),
saving: i18n.t("Saving"),
};
settings_org.setup_time_limit_dropdown_values();
};
// Generic function for informing users about changes to the settings