1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
|
CX("</div>"/*#wikiedit-tab-pages*/);
}
/******* Content tab *******/
{
CX("<div id='wikiedit-tab-content' "
"data-tab-parent='wikiedit-tabs' "
"data-tab-label='Wiki Editor' "
"class='hidden'"
">");
CX("<div class='flex-container flex-row child-gap-small'>");
CX("<span class='input-with-label'>"
"<label>Mime type</label>");
mimetype_option_menu(0);
CX("</span>");
style_select_list_int("select-font-size",
"editor_font_size", "Editor font size",
NULL/*tooltip*/,
100,
"100%", 100, "125%", 125,
"150%", 150, "175%", 175,
"200%", 200, NULL);
CX("<button class='wikiedit-content-reload' "
"title='Reload the file from the server, discarding "
"any local edits. To help avoid accidental loss of "
"edits, it requires confirmation (a second click) within "
"a few seconds or it will not reload.'"
">Discard & Reload</button>");
CX("</div>");
CX("<div class='flex-container flex-column stretch'>");
CX("<textarea name='content' id='wikiedit-content-editor' "
"class='wikiedit' "
"rows='25' cols='80'>");
CX("</textarea>");
CX("</div>"/*textarea wrapper*/);
CX("</div>"/*#tab-file-content*/);
}
/****** Preview tab ******/
{
CX("<div id='wikiedit-tab-preview' "
"data-tab-parent='wikiedit-tabs' "
"data-tab-label='Preview & Save' "
"class='hidden'"
">");
CX("<div class='wikiedit-options flex-container flex-row'>");
CX("<button id='btn-preview-refresh' "
"data-f-preview-from='wikiContent' "
/* ^^^ fossil.page[methodName]() OR text source elem ID,
** but we need a method in order to support clients swapping out
** the text editor with their own. */
"data-f-preview-via='_postPreview' "
/* ^^^ fossil.page[methodName](content, callback) */
"data-f-preview-to='#wikiedit-tab-preview-wrapper' "
/* ^^^ dest elem ID */
">Refresh</button>");
CX("<button class='wikiedit-save'>Save</button>");
/* Toggle auto-update of preview when the Preview tab is selected. */
style_labeled_checkbox("cb-preview-autoupdate",
NULL,
"Auto-refresh?",
"1", 1,
"If on, the preview will automatically "
"refresh when this tab is selected.");
CX("</div>"/*.wikiedit-options*/);
CX("<div id='wikiedit-tab-preview-wrapper'></div>");
CX("</div>"/*#wikiedit-tab-preview*/);
}
/****** Diff tab ******/
{
CX("<div id='wikiedit-tab-diff' "
"data-tab-parent='wikiedit-tabs' "
"data-tab-label='Diff' "
"class='hidden'"
">");
CX("<div class='wikiedit-options flex-container flex-row' "
"id='wikiedit-tab-diff-buttons'>");
CX("<button class='sbs'>Side-by-side</button>"
"<button class='unified'>Unified</button>");
CX("</div>");
CX("<div id='wikiedit-tab-diff-wrapper'>"
"Diffs will be shown here."
"</div>");
CX("</div>"/*#wikiedit-tab-diff*/);
}
|
|
>
>
>
|
<
>
>
|
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
|
CX("</div>"/*#wikiedit-tab-pages*/);
}
/******* Content tab *******/
{
CX("<div id='wikiedit-tab-content' "
"data-tab-parent='wikiedit-tabs' "
"data-tab-label='Editor' "
"class='hidden'"
">");
CX("<div class='flex-container flex-row child-gap-small'>");
CX("<span class='input-with-label'>"
"<label>Mime type</label>");
mimetype_option_menu(0);
CX("</span>");
style_select_list_int("select-font-size",
"editor_font_size", "Editor font size",
NULL/*tooltip*/,
100,
"100%", 100, "125%", 125,
"150%", 150, "175%", 175,
"200%", 200, NULL);
CX("<button class='wikiedit-content-reload' "
"title='Reload the file from the server, discarding "
"any local edits. To help avoid accidental loss of "
"edits, it requires confirmation (a second click) within "
"a few seconds or it will not reload.'"
">Discard & Reload</button>");
CX("<button class='wikiedit-save' disabled='disabled'>"
"Save</button>"/*will get moved around dynamically*/);
CX("<span class='save-button-slot'></span>");
CX("</div>");
CX("<div class='flex-container flex-column stretch'>");
CX("<textarea name='content' id='wikiedit-content-editor' "
"class='wikiedit' "
"rows='25' cols='80'>");
CX("</textarea>");
CX("</div>"/*textarea wrapper*/);
CX("</div>"/*#tab-file-content*/);
}
/****** Preview tab ******/
{
CX("<div id='wikiedit-tab-preview' "
"data-tab-parent='wikiedit-tabs' "
"data-tab-label='Preview' "
"class='hidden'"
">");
CX("<div class='wikiedit-options flex-container flex-row'>");
CX("<button id='btn-preview-refresh' "
"data-f-preview-from='wikiContent' "
/* ^^^ fossil.page[methodName]() OR text source elem ID,
** but we need a method in order to support clients swapping out
** the text editor with their own. */
"data-f-preview-via='_postPreview' "
/* ^^^ fossil.page[methodName](content, callback) */
"data-f-preview-to='#wikiedit-tab-preview-wrapper' "
/* ^^^ dest elem ID */
">Refresh</button>");
/* Toggle auto-update of preview when the Preview tab is selected. */
style_labeled_checkbox("cb-preview-autoupdate",
NULL,
"Auto-refresh?",
"1", 1,
"If on, the preview will automatically "
"refresh when this tab is selected.");
CX("<span class='save-button-slot'></span>");
CX("</div>"/*.wikiedit-options*/);
CX("<div id='wikiedit-tab-preview-wrapper'></div>");
CX("</div>"/*#wikiedit-tab-preview*/);
}
/****** Diff tab ******/
{
CX("<div id='wikiedit-tab-diff' "
"data-tab-parent='wikiedit-tabs' "
"data-tab-label='Diff' "
"class='hidden'"
">");
CX("<div class='wikiedit-options flex-container flex-row' "
"id='wikiedit-tab-diff-buttons'>");
CX("<button class='sbs'>Side-by-side</button>"
"<button class='unified'>Unified</button>");
CX("<span class='save-button-slot'></span>");
CX("</div>");
CX("<div id='wikiedit-tab-diff-wrapper'>"
"Diffs will be shown here."
"</div>");
CX("</div>"/*#wikiedit-tab-diff*/);
}
|