mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
All new strings should now be localized. There is a new function called localize in the scripts/load-ckeditor.js that translates any given string to the server's language (This function is SYNCHRONOUS). The editor area should make use of more room on bigger screens. The make install command should now behave correctly.
This commit is contained in:
parent
5e1898ff11
commit
4d6e68f9b1
18
Makefile
18
Makefile
@ -78,7 +78,7 @@ ifeq ($(OSTYPE),Linux)
|
||||
CC = gcc
|
||||
endif
|
||||
|
||||
CFLAGS += -I$(MXMLDIR)
|
||||
CFLAGS += -I$(MXMLDIR)
|
||||
|
||||
ifdef USE_SSL
|
||||
ifneq ($(USE_SSL),0)
|
||||
@ -157,7 +157,7 @@ update: $(EXECS)
|
||||
|
||||
install: $(EXECS)
|
||||
@$(INSTALL) -m 0755 -d $(DESTDIR) $(SDESTDIR) $(MANDIR)/man1/ $(MANDIR)/man8/
|
||||
@$(INSTALL) -m 0755 -d $(ELOGDIR)/scripts/ $(ELOGDIR)/resources/ $(ELOGDIR)/ssl/ $(ELOGDIR)/themes/default/icons
|
||||
@$(INSTALL) -m 0755 -d $(ELOGDIR)/scripts/ $(ELOGDIR)/resources/ $(ELOGDIR)/ssl/ $(ELOGDIR)/themes/default/icons
|
||||
@$(INSTALL) -m 0755 -d $(ELOGDIR)/logbooks/demo
|
||||
@$(INSTALL) -v -m 0755 ${BINFLAGS} elog elconv $(DESTDIR)
|
||||
@$(INSTALL) -v -m 0755 ${BINFLAGS} elogd $(SDESTDIR)
|
||||
@ -165,25 +165,21 @@ install: $(EXECS)
|
||||
@$(INSTALL) -v -m 0644 man/elogd.8 $(MANDIR)/man8/
|
||||
@$(INSTALL) -v -m 0644 scripts/*.js $(ELOGDIR)/scripts/
|
||||
|
||||
# @echo "Installing CKeditor to $(ELOGDIR)/scripts/ckeditor"
|
||||
# @unzip -q -o scripts/fckeditor.zip -d $(ELOGDIR)/scripts/
|
||||
# @$(INSTALL) -v -m 0644 scripts/fckeditor/fckelog.js $(ELOGDIR)/scripts/fckeditor/fckelog.js
|
||||
# @mkdir -p -m 0755 $(ELOGDIR)/scripts/fckeditor/editor/plugins/elog
|
||||
# @$(INSTALL) -v -m 0644 scripts/fckeditor/editor/plugins/elog/fckplugin.js $(ELOGDIR)/scripts/fckeditor/editor/plugins/elog/fckplugin.js
|
||||
# @$(INSTALL) -v -m 0644 scripts/fckeditor/editor/plugins/elog/inserttime.gif $(ELOGDIR)/scripts/fckeditor/editor/plugins/elog/inserttime.gif
|
||||
@echo "Installing CKeditor to $(ELOGDIR)/scripts/ckeditor"
|
||||
cp -r scripts/ $(ELOGDIR)/scripts
|
||||
|
||||
@echo "Installing resources to $(ELOGDIR)/resources"
|
||||
@echo "Installing resources to $(ELOGDIR)/resources"
|
||||
@$(INSTALL) -m 0644 resources/* $(ELOGDIR)/resources/
|
||||
@$(INSTALL) -m 0644 ssl/* $(ELOGDIR)/ssl/
|
||||
|
||||
@echo "Installing themes to $(ELOGDIR)/themes"
|
||||
@echo "Installing themes to $(ELOGDIR)/themes"
|
||||
@$(INSTALL) -m 0644 themes/default/icons/* $(ELOGDIR)/themes/default/icons/
|
||||
@for file in `find themes/default -type f | grep -v .svn` ; \
|
||||
do \
|
||||
$(INSTALL) -m 0644 $$file $(ELOGDIR)/themes/default/`basename $$file` ;\
|
||||
done
|
||||
|
||||
@echo "Installing example logbook to $(ELOGDIR)/logbooks/demo"
|
||||
@echo "Installing example logbook to $(ELOGDIR)/logbooks/demo"
|
||||
@if [ ! -f $(ELOGDIR)/logbooks/demo ]; then \
|
||||
$(INSTALL) -v -m 0644 logbooks/demo/* $(ELOGDIR)/logbooks/demo ; \
|
||||
fi
|
||||
|
||||
@ -3,7 +3,7 @@ port = 8080
|
||||
|
||||
[demo]
|
||||
Theme = default
|
||||
Comment = General linux tips & tricks
|
||||
Comment = SwissFEL DEMO
|
||||
Attributes = Author, Type, Category, Subject
|
||||
Options Type = Routine, Software Installation, Problem Fixed, Configuration, Other
|
||||
Options Category = General, Hardware, Software, Network, Other
|
||||
|
||||
@ -546,9 +546,11 @@ CKEDITOR.dialog.add( 'image2', function( editor ) {
|
||||
var dialog = this.getDialog();
|
||||
var files = dialog.getContentElement("Upload", "upload").getInputElement().$.files;
|
||||
|
||||
var file_missing_msg = localize("Please select a fileadaw!");
|
||||
|
||||
// no files were selected
|
||||
if(files.length == 0) {
|
||||
alert("Please select a file!");
|
||||
alert(file_missing_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,8 @@
|
||||
command.modes = { wysiwyg: !!( editor.element.$.form ) };
|
||||
|
||||
editor.ui.addButton && editor.ui.addButton( 'Save', {
|
||||
label: editor.lang.save.toolbar,
|
||||
label: localize("Submit"),
|
||||
// label: editor.lang.save.toolbar,
|
||||
command: pluginName,
|
||||
toolbar: 'document,10'
|
||||
} );
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
// This function takes a string that should be translated
|
||||
// and asks the server for the translation to the server's locale.
|
||||
// Translation of the string is returned.
|
||||
//
|
||||
// NOTE: This function works SYNCRHONOUSLY
|
||||
function localize(str) {
|
||||
var URL = '/' + parent.logbook + "/?cmd=loc&value=" + str;
|
||||
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
url: URL,
|
||||
async: false
|
||||
}).responseText;
|
||||
}
|
||||
|
||||
console.log(localize("Submit"));
|
||||
|
||||
// After the page has loaded, load the Ckeditor and the attachment dropbox
|
||||
$(document).ready(function() {
|
||||
|
||||
$('textarea').addClass("ckeditor");
|
||||
@ -9,8 +27,10 @@ $(document).ready(function() {
|
||||
|
||||
var editor = ev.editor;
|
||||
|
||||
// Make the editor bigger
|
||||
editor.resize("100%", "500");
|
||||
// Make the editor bigger (at least 500px high and 80% of the viewport otherwise)
|
||||
var width = Math.max(500, 0.8 * $(window).height() );
|
||||
console.log(width);
|
||||
editor.resize("100%", new String(width));
|
||||
|
||||
// Create a new command with the desired exec function
|
||||
var overridecmd = new CKEDITOR.command(editor, {
|
||||
|
||||
@ -11520,7 +11520,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
||||
rsprintf("<tr>\n");
|
||||
rsprintf("<td style=\"background: white;\" colspan=2>\n");
|
||||
rsprintf("<div id=\"holder\" style=\"background: white; border: 10px dashed #ccc; min-height: 200px; margin: 10px\" >");
|
||||
rsprintf("<p class=\"info\" style=\"color: #999; font-size: 2em; text-align: center; margin-top: 40px;\">Drop attachments here...</p></div>");
|
||||
rsprintf("<p class=\"info\" style=\"color: #999; font-size: 2em; text-align: center; margin-top: 40px;\">%s</p></div>", loc("Drop attachments here..."));
|
||||
rsprintf("</td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
#define GIT_REVISION "Tue Sep 23 17:21:20 2014 +0200 - 6a67f99"
|
||||
#define GIT_REVISION "Tue Sep 23 17:31:26 2014 +0200 - 5e1898f"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user