+ var selPageLang
+ = $.SELECT({},
+ $.OPTION({value: ""}, "(unspecified)"),
+ (function () {
+ var options = [];
+
+ $.each(Rakka.getSystemConfig().languages, function (tag, name) {
+ options.push(
+ $.OPTION({value: tag}, name));
+ });
+
+ return options;
+ })());
+
+ $(selPageLang).change(makeDirty);
+
+ if (lang == null || lang == "") {
+ $(selPageLang).val($("html").attr("xml:lang"));
+ }
+ else {
+ $(selPageLang).val(lang);
+ }
+
+ var trPageLang
+ = $.TR({},
+ $.TH({}, "Page language"),
+ $.TD({}, selPageLang));
+
+ var trOtherLangs = (function () {
+ var options = [];
+
+ $.each(Rakka.getSystemConfig().languages, function (tag, name) {
+ options.push(
+ $.OPTION({value: tag}, name));
+ });
+
+ var selLang = $.SELECT({}, options);
+ var fldLink = $.INPUT({type: "text", className: "smallField"});
+
+ $(selLang).change(function () {
+ var pageName = otherLangs[$(selLang).val()];
+ $(fldLink).val(
+ pageName == null ? "" : pageName
+ );
+ }).trigger("change");
+
+ var onLinkChanged = function () {
+ isDirty = true;
+
+ var lang = $(selLang).val();
+ var pageName = $(this).val();
+
+ if (pageName == "") {
+ delete otherLangs[lang];
+ }
+ else {
+ otherLangs[lang] = pageName;
+ }
+ };
+ $(fldLink).change(onLinkChanged).keyup(onLinkChanged);
+
+ return $.TR({},
+ $.TH({}, "Language links"),
+ $.TD({}, selLang, fldLink));
+ })();
+