cewebs-transformationengine 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/AUTHORS +1 -0
- data/LICENSE.GPL +674 -0
- data/README.md +99 -0
- data/Rakefile +19 -0
- data/cewebs-transformationengine.gemspec +25 -0
- data/index.html +37 -0
- data/lib/cewebs-transformationengine/helpers/site.rb +343 -0
- data/lib/cewebs-transformationengine/implementation.rb +514 -0
- data/lib/cewebs-transformationengine/implementation.xml +14 -0
- data/lib/cewebs-transformationengine/sites.xml +131 -0
- data/menupoints.rng +27 -0
- data/server/data/Default/aman.xml +16 -0
- data/server/data/Default/custom.xml +15 -0
- data/server/data/Default/persons.rng +106 -0
- data/server/data/Default/strings.default.xml +104 -0
- data/server/data/Default/strings.rng +674 -0
- data/server/data/Default/strings.xml +106 -0
- data/server/data/engine.xml +11 -0
- data/server/engine +15 -0
- data/static/icons/large/accessories-calculator.png +0 -0
- data/static/icons/large/accessories-character-map.png +0 -0
- data/static/icons/large/accessories-text-editor.png +0 -0
- data/static/icons/large/address-book-new.png +0 -0
- data/static/icons/large/application-certificate.png +0 -0
- data/static/icons/large/application-magicpoint.png +0 -0
- data/static/icons/large/application-msword.png +0 -0
- data/static/icons/large/application-ogg.png +0 -0
- data/static/icons/large/application-pdf.png +0 -0
- data/static/icons/large/application-postscript.png +0 -0
- data/static/icons/large/application-rtf.png +0 -0
- data/static/icons/large/application-vnd.lotus-1-2-3.png +0 -0
- data/static/icons/large/application-vnd.ms-excel.png +0 -0
- data/static/icons/large/application-vnd.ms-powerpoint.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.graphics-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.graphics.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.image.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.presentation-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.presentation.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.spreadsheet-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.spreadsheet.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.text-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.text-web.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.text.png +0 -0
- data/static/icons/large/application-vnd.rn-realmedia-secure.png +0 -0
- data/static/icons/large/application-vnd.rn-realmedia-vbr.png +0 -0
- data/static/icons/large/application-vnd.rn-realmedia.png +0 -0
- data/static/icons/large/application-vnd.stardivision.calc.png +0 -0
- data/static/icons/large/application-vnd.stardivision.impress.png +0 -0
- data/static/icons/large/application-vnd.stardivision.writer.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.calc.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.calc.template.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.draw.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.draw.template.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.impress.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.impress.template.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.writer.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.writer.template.png +0 -0
- data/static/icons/large/application-wordperfect.png +0 -0
- data/static/icons/large/application-x-7z-compressed.png +0 -0
- data/static/icons/large/application-x-abiword.png +0 -0
- data/static/icons/large/application-x-applix-spreadsheet.png +0 -0
- data/static/icons/large/application-x-applix-word.png +0 -0
- data/static/icons/large/application-x-archive.png +0 -0
- data/static/icons/large/application-x-arj.png +0 -0
- data/static/icons/large/application-x-bzip-compressed-tar.png +0 -0
- data/static/icons/large/application-x-bzip.png +0 -0
- data/static/icons/large/application-x-compress.png +0 -0
- data/static/icons/large/application-x-compressed-tar.png +0 -0
- data/static/icons/large/application-x-cpio-compressed.png +0 -0
- data/static/icons/large/application-x-cpio.png +0 -0
- data/static/icons/large/application-x-deb.png +0 -0
- data/static/icons/large/application-x-dvi.png +0 -0
- data/static/icons/large/application-x-executable.png +0 -0
- data/static/icons/large/application-x-font-afm.png +0 -0
- data/static/icons/large/application-x-font-bdf.png +0 -0
- data/static/icons/large/application-x-font-linux-psf.png +0 -0
- data/static/icons/large/application-x-font-pcf.png +0 -0
- data/static/icons/large/application-x-font-sunos-news.png +0 -0
- data/static/icons/large/application-x-font-ttf.png +0 -0
- data/static/icons/large/application-x-gnumeric.png +0 -0
- data/static/icons/large/application-x-gzip.png +0 -0
- data/static/icons/large/application-x-gzpostscript.png +0 -0
- data/static/icons/large/application-x-jar.png +0 -0
- data/static/icons/large/application-x-killustrator.png +0 -0
- data/static/icons/large/application-x-kpresenter.png +0 -0
- data/static/icons/large/application-x-kspread.png +0 -0
- data/static/icons/large/application-x-kword.png +0 -0
- data/static/icons/large/application-x-lha.png +0 -0
- data/static/icons/large/application-x-lhz.png +0 -0
- data/static/icons/large/application-x-ms-dos-executable.png +0 -0
- data/static/icons/large/application-x-perl.png +0 -0
- data/static/icons/large/application-x-python-bytecode.png +0 -0
- data/static/icons/large/application-x-rar.png +0 -0
- data/static/icons/large/application-x-rpm.png +0 -0
- data/static/icons/large/application-x-scribus.png +0 -0
- data/static/icons/large/application-x-shellscript.png +0 -0
- data/static/icons/large/application-x-stuffit.png +0 -0
- data/static/icons/large/application-x-tar.png +0 -0
- data/static/icons/large/application-x-tarz.png +0 -0
- data/static/icons/large/application-x-tex.png +0 -0
- data/static/icons/large/application-xhtml+xml.png +0 -0
- data/static/icons/large/application-zip.png +0 -0
- data/static/icons/large/applications-accessories.png +0 -0
- data/static/icons/large/applications-development.png +0 -0
- data/static/icons/large/applications-games.png +0 -0
- data/static/icons/large/applications-graphics.png +0 -0
- data/static/icons/large/applications-internet.png +0 -0
- data/static/icons/large/applications-multimedia.png +0 -0
- data/static/icons/large/applications-office.png +0 -0
- data/static/icons/large/applications-other.png +0 -0
- data/static/icons/large/applications-system.png +0 -0
- data/static/icons/large/appointment-new.png +0 -0
- data/static/icons/large/audio-card.png +0 -0
- data/static/icons/large/audio-input-microphone.png +0 -0
- data/static/icons/large/audio-volume-high.png +0 -0
- data/static/icons/large/audio-volume-low.png +0 -0
- data/static/icons/large/audio-volume-medium.png +0 -0
- data/static/icons/large/audio-volume-muted.png +0 -0
- data/static/icons/large/audio-x-generic.png +0 -0
- data/static/icons/large/audio.png +0 -0
- data/static/icons/large/battery-caution.png +0 -0
- data/static/icons/large/battery.png +0 -0
- data/static/icons/large/bookmark-new.png +0 -0
- data/static/icons/large/camera-photo.png +0 -0
- data/static/icons/large/camera-video.png +0 -0
- data/static/icons/large/computer.png +0 -0
- data/static/icons/large/contact-new.png +0 -0
- data/static/icons/large/dialog-error.png +0 -0
- data/static/icons/large/dialog-information.png +0 -0
- data/static/icons/large/dialog-warning.png +0 -0
- data/static/icons/large/document-new.png +0 -0
- data/static/icons/large/document-open.png +0 -0
- data/static/icons/large/document-print-preview.png +0 -0
- data/static/icons/large/document-print.png +0 -0
- data/static/icons/large/document-properties.png +0 -0
- data/static/icons/large/document-save-as.png +0 -0
- data/static/icons/large/document-save.png +0 -0
- data/static/icons/large/drive-harddisk.png +0 -0
- data/static/icons/large/drive-optical.png +0 -0
- data/static/icons/large/drive-removable-media.png +0 -0
- data/static/icons/large/edit-clear.png +0 -0
- data/static/icons/large/edit-copy.png +0 -0
- data/static/icons/large/edit-cut.png +0 -0
- data/static/icons/large/edit-delete.png +0 -0
- data/static/icons/large/edit-find-replace.png +0 -0
- data/static/icons/large/edit-find.png +0 -0
- data/static/icons/large/edit-paste.png +0 -0
- data/static/icons/large/edit-redo.png +0 -0
- data/static/icons/large/edit-select-all.png +0 -0
- data/static/icons/large/edit-undo.png +0 -0
- data/static/icons/large/emblem-favorite.png +0 -0
- data/static/icons/large/emblem-important.png +0 -0
- data/static/icons/large/emblem-photos.png +0 -0
- data/static/icons/large/emblem-readonly.png +0 -0
- data/static/icons/large/emblem-symbolic-link.png +0 -0
- data/static/icons/large/emblem-system.png +0 -0
- data/static/icons/large/emblem-unreadable.png +0 -0
- data/static/icons/large/face-angel.png +0 -0
- data/static/icons/large/face-crying.png +0 -0
- data/static/icons/large/face-devil-grin.png +0 -0
- data/static/icons/large/face-glasses.png +0 -0
- data/static/icons/large/face-grin.png +0 -0
- data/static/icons/large/face-kiss.png +0 -0
- data/static/icons/large/face-monkey.png +0 -0
- data/static/icons/large/face-plain.png +0 -0
- data/static/icons/large/face-sad.png +0 -0
- data/static/icons/large/face-smile-big.png +0 -0
- data/static/icons/large/face-smile.png +0 -0
- data/static/icons/large/face-surprise.png +0 -0
- data/static/icons/large/face-wink.png +0 -0
- data/static/icons/large/folder-drag-accept.png +0 -0
- data/static/icons/large/folder-new.png +0 -0
- data/static/icons/large/folder-open.png +0 -0
- data/static/icons/large/folder-remote.png +0 -0
- data/static/icons/large/folder-saved-search.png +0 -0
- data/static/icons/large/folder-visiting.png +0 -0
- data/static/icons/large/folder.png +0 -0
- data/static/icons/large/font-x-generic.png +0 -0
- data/static/icons/large/format-indent-less.png +0 -0
- data/static/icons/large/format-indent-more.png +0 -0
- data/static/icons/large/format-justify-center.png +0 -0
- data/static/icons/large/format-justify-fill.png +0 -0
- data/static/icons/large/format-justify-left.png +0 -0
- data/static/icons/large/format-justify-right.png +0 -0
- data/static/icons/large/format-text-bold.png +0 -0
- data/static/icons/large/format-text-italic.png +0 -0
- data/static/icons/large/format-text-strikethrough.png +0 -0
- data/static/icons/large/format-text-underline.png +0 -0
- data/static/icons/large/go-bottom.png +0 -0
- data/static/icons/large/go-down.png +0 -0
- data/static/icons/large/go-first.png +0 -0
- data/static/icons/large/go-home.png +0 -0
- data/static/icons/large/go-jump.png +0 -0
- data/static/icons/large/go-last.png +0 -0
- data/static/icons/large/go-next.png +0 -0
- data/static/icons/large/go-previous.png +0 -0
- data/static/icons/large/go-top.png +0 -0
- data/static/icons/large/go-up.png +0 -0
- data/static/icons/large/help-browser.png +0 -0
- data/static/icons/large/image-loading.png +0 -0
- data/static/icons/large/image-missing.png +0 -0
- data/static/icons/large/image-x-generic.png +0 -0
- data/static/icons/large/input-gaming.png +0 -0
- data/static/icons/large/input-keyboard.png +0 -0
- data/static/icons/large/input-mouse.png +0 -0
- data/static/icons/large/internet-group-chat.png +0 -0
- data/static/icons/large/internet-mail.png +0 -0
- data/static/icons/large/internet-news-reader.png +0 -0
- data/static/icons/large/internet-web-browser.png +0 -0
- data/static/icons/large/list-add.png +0 -0
- data/static/icons/large/list-remove.png +0 -0
- data/static/icons/large/mail-attachment.png +0 -0
- data/static/icons/large/mail-forward.png +0 -0
- data/static/icons/large/mail-mark-junk.png +0 -0
- data/static/icons/large/mail-mark-not-junk.png +0 -0
- data/static/icons/large/mail-message-new.png +0 -0
- data/static/icons/large/mail-reply-all.png +0 -0
- data/static/icons/large/mail-reply-sender.png +0 -0
- data/static/icons/large/mail-send-receive.png +0 -0
- data/static/icons/large/media-eject.png +0 -0
- data/static/icons/large/media-flash.png +0 -0
- data/static/icons/large/media-floppy.png +0 -0
- data/static/icons/large/media-optical.png +0 -0
- data/static/icons/large/media-playback-pause.png +0 -0
- data/static/icons/large/media-playback-start.png +0 -0
- data/static/icons/large/media-playback-stop.png +0 -0
- data/static/icons/large/media-record.png +0 -0
- data/static/icons/large/media-seek-backward.png +0 -0
- data/static/icons/large/media-seek-forward.png +0 -0
- data/static/icons/large/media-skip-backward.png +0 -0
- data/static/icons/large/media-skip-forward.png +0 -0
- data/static/icons/large/mime-application-x-php.png +0 -0
- data/static/icons/large/mime-application-x-shockwave-flash.png +0 -0
- data/static/icons/large/mime-image.png +0 -0
- data/static/icons/large/multimedia-player.png +0 -0
- data/static/icons/large/network-error.png +0 -0
- data/static/icons/large/network-idle.png +0 -0
- data/static/icons/large/network-offline.png +0 -0
- data/static/icons/large/network-receive.png +0 -0
- data/static/icons/large/network-server.png +0 -0
- data/static/icons/large/network-transmit-receive.png +0 -0
- data/static/icons/large/network-transmit.png +0 -0
- data/static/icons/large/network-wired.png +0 -0
- data/static/icons/large/network-wireless-encrypted.png +0 -0
- data/static/icons/large/network-wireless.png +0 -0
- data/static/icons/large/network-workgroup.png +0 -0
- data/static/icons/large/office-calendar.png +0 -0
- data/static/icons/large/package-x-generic.png +0 -0
- data/static/icons/large/preferences-desktop-accessibility.png +0 -0
- data/static/icons/large/preferences-desktop-assistive-technology.png +0 -0
- data/static/icons/large/preferences-desktop-font.png +0 -0
- data/static/icons/large/preferences-desktop-keyboard-shortcuts.png +0 -0
- data/static/icons/large/preferences-desktop-locale.png +0 -0
- data/static/icons/large/preferences-desktop-peripherals.png +0 -0
- data/static/icons/large/preferences-desktop-remote-desktop.png +0 -0
- data/static/icons/large/preferences-desktop-screensaver.png +0 -0
- data/static/icons/large/preferences-desktop-sound.png +0 -0
- data/static/icons/large/preferences-desktop-theme.png +0 -0
- data/static/icons/large/preferences-desktop-wallpaper.png +0 -0
- data/static/icons/large/preferences-desktop.png +0 -0
- data/static/icons/large/preferences-system-network-proxy.png +0 -0
- data/static/icons/large/preferences-system-session.png +0 -0
- data/static/icons/large/preferences-system-windows.png +0 -0
- data/static/icons/large/preferences-system.png +0 -0
- data/static/icons/large/printer-error.png +0 -0
- data/static/icons/large/printer.png +0 -0
- data/static/icons/large/process-stop.png +0 -0
- data/static/icons/large/process-working.png +0 -0
- data/static/icons/large/start-here.png +0 -0
- data/static/icons/large/system-file-manager.png +0 -0
- data/static/icons/large/system-installer.png +0 -0
- data/static/icons/large/system-lock-screen.png +0 -0
- data/static/icons/large/system-log-out.png +0 -0
- data/static/icons/large/system-search.png +0 -0
- data/static/icons/large/system-shutdown.png +0 -0
- data/static/icons/large/system-software-update.png +0 -0
- data/static/icons/large/system-users.png +0 -0
- data/static/icons/large/tab-new.png +0 -0
- data/static/icons/large/text-html.png +0 -0
- data/static/icons/large/text-vnd.wap.wml.png +0 -0
- data/static/icons/large/text-x-csh.png +0 -0
- data/static/icons/large/text-x-generic-template.png +0 -0
- data/static/icons/large/text-x-generic.png +0 -0
- data/static/icons/large/text-x-python.png +0 -0
- data/static/icons/large/text-x-script.png +0 -0
- data/static/icons/large/text-x-sh.png +0 -0
- data/static/icons/large/text-x-vcalendar.png +0 -0
- data/static/icons/large/text-x-vcard.png +0 -0
- data/static/icons/large/text-x-zsh.png +0 -0
- data/static/icons/large/text.png +0 -0
- data/static/icons/large/user-desktop.png +0 -0
- data/static/icons/large/user-home.png +0 -0
- data/static/icons/large/user-trash-full.png +0 -0
- data/static/icons/large/user-trash.png +0 -0
- data/static/icons/large/utilities-system-monitor.png +0 -0
- data/static/icons/large/utilities-terminal.png +0 -0
- data/static/icons/large/video-display.png +0 -0
- data/static/icons/large/video-x-generic.png +0 -0
- data/static/icons/large/video.png +0 -0
- data/static/icons/large/view-fullscreen.png +0 -0
- data/static/icons/large/view-refresh.png +0 -0
- data/static/icons/large/weather-clear-night.png +0 -0
- data/static/icons/large/weather-clear.png +0 -0
- data/static/icons/large/weather-few-clouds-night.png +0 -0
- data/static/icons/large/weather-few-clouds.png +0 -0
- data/static/icons/large/weather-overcast.png +0 -0
- data/static/icons/large/weather-severe-alert.png +0 -0
- data/static/icons/large/weather-showers-scattered.png +0 -0
- data/static/icons/large/weather-showers.png +0 -0
- data/static/icons/large/weather-snow.png +0 -0
- data/static/icons/large/weather-storm.png +0 -0
- data/static/icons/large/window-new.png +0 -0
- data/static/icons/large/x-font-afm.png +0 -0
- data/static/icons/large/x-office-address-book.png +0 -0
- data/static/icons/large/x-office-calendar.png +0 -0
- data/static/icons/large/x-office-document-template.png +0 -0
- data/static/icons/large/x-office-document.png +0 -0
- data/static/icons/large/x-office-drawing-template.png +0 -0
- data/static/icons/large/x-office-drawing.png +0 -0
- data/static/icons/large/x-office-presentation-template.png +0 -0
- data/static/icons/large/x-office-presentation.png +0 -0
- data/static/icons/large/x-office-spreadsheet-template.png +0 -0
- data/static/icons/large/x-office-spreadsheet.png +0 -0
- data/static/icons/small/accessories-calculator.png +0 -0
- data/static/icons/small/accessories-character-map.png +0 -0
- data/static/icons/small/accessories-text-editor.png +0 -0
- data/static/icons/small/address-book-new.png +0 -0
- data/static/icons/small/application-certificate.png +0 -0
- data/static/icons/small/application-magicpoint.png +0 -0
- data/static/icons/small/application-msword.png +0 -0
- data/static/icons/small/application-ogg.png +0 -0
- data/static/icons/small/application-pdf.png +0 -0
- data/static/icons/small/application-postscript.png +0 -0
- data/static/icons/small/application-rar.png +0 -0
- data/static/icons/small/application-rtf.png +0 -0
- data/static/icons/small/application-vnd.lotus-1-2-3.png +0 -0
- data/static/icons/small/application-vnd.ms-excel.png +0 -0
- data/static/icons/small/application-vnd.ms-powerpoint.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.chart.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.formula.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.graphics-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.graphics.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.image.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.presentation-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.presentation.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.spreadsheet-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.spreadsheet.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.text-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.text-web.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.text.png +0 -0
- data/static/icons/small/application-vnd.rn-realmedia-secure.png +0 -0
- data/static/icons/small/application-vnd.rn-realmedia-vbr.png +0 -0
- data/static/icons/small/application-vnd.rn-realmedia.png +0 -0
- data/static/icons/small/application-vnd.stardivision.calc.png +0 -0
- data/static/icons/small/application-vnd.stardivision.impress.png +0 -0
- data/static/icons/small/application-vnd.stardivision.writer.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.calc.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.calc.template.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.draw.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.draw.template.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.impress.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.impress.template.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.writer.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.writer.template.png +0 -0
- data/static/icons/small/application-wordperfect.png +0 -0
- data/static/icons/small/application-x-7z-compressed.png +0 -0
- data/static/icons/small/application-x-abiword.png +0 -0
- data/static/icons/small/application-x-applix-spreadsheet.png +0 -0
- data/static/icons/small/application-x-applix-word.png +0 -0
- data/static/icons/small/application-x-archive.png +0 -0
- data/static/icons/small/application-x-arj.png +0 -0
- data/static/icons/small/application-x-bzip-compressed-tar.png +0 -0
- data/static/icons/small/application-x-bzip.png +0 -0
- data/static/icons/small/application-x-chm.png +0 -0
- data/static/icons/small/application-x-compress.png +0 -0
- data/static/icons/small/application-x-compressed-tar.png +0 -0
- data/static/icons/small/application-x-cpio-compressed.png +0 -0
- data/static/icons/small/application-x-cpio.png +0 -0
- data/static/icons/small/application-x-deb.png +0 -0
- data/static/icons/small/application-x-debian-package.png +0 -0
- data/static/icons/small/application-x-dvi.png +0 -0
- data/static/icons/small/application-x-executable.png +0 -0
- data/static/icons/small/application-x-font-afm.png +0 -0
- data/static/icons/small/application-x-font-bdf.png +0 -0
- data/static/icons/small/application-x-font-linux-psf.png +0 -0
- data/static/icons/small/application-x-font-pcf.png +0 -0
- data/static/icons/small/application-x-font-sunos-news.png +0 -0
- data/static/icons/small/application-x-font-ttf.png +0 -0
- data/static/icons/small/application-x-gnumeric.png +0 -0
- data/static/icons/small/application-x-gtar.png +0 -0
- data/static/icons/small/application-x-gzip.png +0 -0
- data/static/icons/small/application-x-gzpostscript.png +0 -0
- data/static/icons/small/application-x-httpd-php.png +0 -0
- data/static/icons/small/application-x-iso9660-image.png +0 -0
- data/static/icons/small/application-x-jar.png +0 -0
- data/static/icons/small/application-x-javascript.png +0 -0
- data/static/icons/small/application-x-killustrator.png +0 -0
- data/static/icons/small/application-x-kpresenter.png +0 -0
- data/static/icons/small/application-x-kspread.png +0 -0
- data/static/icons/small/application-x-kword.png +0 -0
- data/static/icons/small/application-x-lha.png +0 -0
- data/static/icons/small/application-x-lhz.png +0 -0
- data/static/icons/small/application-x-ms-dos-executable.png +0 -0
- data/static/icons/small/application-x-perl.png +0 -0
- data/static/icons/small/application-x-python-bytecode.png +0 -0
- data/static/icons/small/application-x-rar.png +0 -0
- data/static/icons/small/application-x-redhat-package-manager.png +0 -0
- data/static/icons/small/application-x-rpm.png +0 -0
- data/static/icons/small/application-x-scribus.png +0 -0
- data/static/icons/small/application-x-shellscript.png +0 -0
- data/static/icons/small/application-x-shockwave-flash.png +0 -0
- data/static/icons/small/application-x-stuffit.png +0 -0
- data/static/icons/small/application-x-tar.png +0 -0
- data/static/icons/small/application-x-tarz.png +0 -0
- data/static/icons/small/application-x-tex.png +0 -0
- data/static/icons/small/application-x-xpinstall.png +0 -0
- data/static/icons/small/application-xhtml+xml.png +0 -0
- data/static/icons/small/application-xml.png +0 -0
- data/static/icons/small/application-zip.png +0 -0
- data/static/icons/small/applications-accessories.png +0 -0
- data/static/icons/small/applications-development.png +0 -0
- data/static/icons/small/applications-games.png +0 -0
- data/static/icons/small/applications-graphics.png +0 -0
- data/static/icons/small/applications-internet.png +0 -0
- data/static/icons/small/applications-multimedia.png +0 -0
- data/static/icons/small/applications-office.png +0 -0
- data/static/icons/small/applications-other.png +0 -0
- data/static/icons/small/applications-system.png +0 -0
- data/static/icons/small/appointment-new.png +0 -0
- data/static/icons/small/audio-card.png +0 -0
- data/static/icons/small/audio-input-microphone.png +0 -0
- data/static/icons/small/audio-mpeg.png +0 -0
- data/static/icons/small/audio-volume-high.png +0 -0
- data/static/icons/small/audio-volume-low.png +0 -0
- data/static/icons/small/audio-volume-medium.png +0 -0
- data/static/icons/small/audio-volume-muted.png +0 -0
- data/static/icons/small/audio-x-aiff.png +0 -0
- data/static/icons/small/audio-x-generic.png +0 -0
- data/static/icons/small/audio-x-ms-wma.png +0 -0
- data/static/icons/small/audio-x-pn-realaudio.png +0 -0
- data/static/icons/small/audio-x-wav.png +0 -0
- data/static/icons/small/audio.png +0 -0
- data/static/icons/small/battery-caution.png +0 -0
- data/static/icons/small/battery.png +0 -0
- data/static/icons/small/bookmark-new.png +0 -0
- data/static/icons/small/camera-photo.png +0 -0
- data/static/icons/small/camera-video.png +0 -0
- data/static/icons/small/chemical-x-mopac-input.png +0 -0
- data/static/icons/small/computer.png +0 -0
- data/static/icons/small/contact-new.png +0 -0
- data/static/icons/small/dialog-error.png +0 -0
- data/static/icons/small/dialog-information.png +0 -0
- data/static/icons/small/dialog-warning.png +0 -0
- data/static/icons/small/document-new.png +0 -0
- data/static/icons/small/document-open.png +0 -0
- data/static/icons/small/document-print-preview.png +0 -0
- data/static/icons/small/document-print.png +0 -0
- data/static/icons/small/document-properties.png +0 -0
- data/static/icons/small/document-save-as.png +0 -0
- data/static/icons/small/document-save.png +0 -0
- data/static/icons/small/drive-harddisk.png +0 -0
- data/static/icons/small/drive-optical.png +0 -0
- data/static/icons/small/drive-removable-media.png +0 -0
- data/static/icons/small/edit-clear.png +0 -0
- data/static/icons/small/edit-copy.png +0 -0
- data/static/icons/small/edit-cut.png +0 -0
- data/static/icons/small/edit-delete.png +0 -0
- data/static/icons/small/edit-find-replace.png +0 -0
- data/static/icons/small/edit-find.png +0 -0
- data/static/icons/small/edit-paste.png +0 -0
- data/static/icons/small/edit-redo.png +0 -0
- data/static/icons/small/edit-select-all.png +0 -0
- data/static/icons/small/edit-undo.png +0 -0
- data/static/icons/small/emblem-favorite.png +0 -0
- data/static/icons/small/emblem-important.png +0 -0
- data/static/icons/small/emblem-photos.png +0 -0
- data/static/icons/small/emblem-readonly.png +0 -0
- data/static/icons/small/emblem-symbolic-link.png +0 -0
- data/static/icons/small/emblem-system.png +0 -0
- data/static/icons/small/emblem-unreadable.png +0 -0
- data/static/icons/small/face-angel.png +0 -0
- data/static/icons/small/face-crying.png +0 -0
- data/static/icons/small/face-devil-grin.png +0 -0
- data/static/icons/small/face-glasses.png +0 -0
- data/static/icons/small/face-grin.png +0 -0
- data/static/icons/small/face-kiss.png +0 -0
- data/static/icons/small/face-monkey.png +0 -0
- data/static/icons/small/face-plain.png +0 -0
- data/static/icons/small/face-sad.png +0 -0
- data/static/icons/small/face-smile-big.png +0 -0
- data/static/icons/small/face-smile.png +0 -0
- data/static/icons/small/face-surprise.png +0 -0
- data/static/icons/small/face-wink.png +0 -0
- data/static/icons/small/folder-drag-accept.png +0 -0
- data/static/icons/small/folder-new.png +0 -0
- data/static/icons/small/folder-open.png +0 -0
- data/static/icons/small/folder-remote.png +0 -0
- data/static/icons/small/folder-saved-search.png +0 -0
- data/static/icons/small/folder-visiting.png +0 -0
- data/static/icons/small/folder.png +0 -0
- data/static/icons/small/font-x-generic.png +0 -0
- data/static/icons/small/format-indent-less.png +0 -0
- data/static/icons/small/format-indent-more.png +0 -0
- data/static/icons/small/format-justify-center.png +0 -0
- data/static/icons/small/format-justify-fill.png +0 -0
- data/static/icons/small/format-justify-left.png +0 -0
- data/static/icons/small/format-justify-right.png +0 -0
- data/static/icons/small/format-text-bold.png +0 -0
- data/static/icons/small/format-text-italic.png +0 -0
- data/static/icons/small/format-text-strikethrough.png +0 -0
- data/static/icons/small/format-text-underline.png +0 -0
- data/static/icons/small/go-bottom.png +0 -0
- data/static/icons/small/go-down.png +0 -0
- data/static/icons/small/go-first.png +0 -0
- data/static/icons/small/go-home.png +0 -0
- data/static/icons/small/go-jump.png +0 -0
- data/static/icons/small/go-last.png +0 -0
- data/static/icons/small/go-next.png +0 -0
- data/static/icons/small/go-previous.png +0 -0
- data/static/icons/small/go-top.png +0 -0
- data/static/icons/small/go-up.png +0 -0
- data/static/icons/small/help-browser.png +0 -0
- data/static/icons/small/image-gif.png +0 -0
- data/static/icons/small/image-jpeg.png +0 -0
- data/static/icons/small/image-loading.png +0 -0
- data/static/icons/small/image-missing.png +0 -0
- data/static/icons/small/image-png.png +0 -0
- data/static/icons/small/image-x-generic.png +0 -0
- data/static/icons/small/input-gaming.png +0 -0
- data/static/icons/small/input-keyboard.png +0 -0
- data/static/icons/small/input-mouse.png +0 -0
- data/static/icons/small/internet-group-chat.png +0 -0
- data/static/icons/small/internet-mail.png +0 -0
- data/static/icons/small/internet-news-reader.png +0 -0
- data/static/icons/small/internet-web-browser.png +0 -0
- data/static/icons/small/list-add.png +0 -0
- data/static/icons/small/list-remove.png +0 -0
- data/static/icons/small/locked.png +0 -0
- data/static/icons/small/mail-attachment.png +0 -0
- data/static/icons/small/mail-forward.png +0 -0
- data/static/icons/small/mail-mark-junk.png +0 -0
- data/static/icons/small/mail-mark-not-junk.png +0 -0
- data/static/icons/small/mail-message-new.png +0 -0
- data/static/icons/small/mail-reply-all.png +0 -0
- data/static/icons/small/mail-reply-sender.png +0 -0
- data/static/icons/small/mail-send-receive.png +0 -0
- data/static/icons/small/media-eject.png +0 -0
- data/static/icons/small/media-flash.png +0 -0
- data/static/icons/small/media-floppy.png +0 -0
- data/static/icons/small/media-optical.png +0 -0
- data/static/icons/small/media-playback-pause.png +0 -0
- data/static/icons/small/media-playback-start.png +0 -0
- data/static/icons/small/media-playback-stop.png +0 -0
- data/static/icons/small/media-record.png +0 -0
- data/static/icons/small/media-seek-backward.png +0 -0
- data/static/icons/small/media-seek-forward.png +0 -0
- data/static/icons/small/media-skip-backward.png +0 -0
- data/static/icons/small/media-skip-forward.png +0 -0
- data/static/icons/small/multimedia-player.png +0 -0
- data/static/icons/small/network-error.png +0 -0
- data/static/icons/small/network-idle.png +0 -0
- data/static/icons/small/network-offline.png +0 -0
- data/static/icons/small/network-receive.png +0 -0
- data/static/icons/small/network-server.png +0 -0
- data/static/icons/small/network-transmit-receive.png +0 -0
- data/static/icons/small/network-transmit.png +0 -0
- data/static/icons/small/network-wired.png +0 -0
- data/static/icons/small/network-wireless-encrypted.png +0 -0
- data/static/icons/small/network-wireless.png +0 -0
- data/static/icons/small/network-workgroup.png +0 -0
- data/static/icons/small/office-calendar.png +0 -0
- data/static/icons/small/package-x-generic.png +0 -0
- data/static/icons/small/preferences-desktop-accessibility.png +0 -0
- data/static/icons/small/preferences-desktop-assistive-technology.png +0 -0
- data/static/icons/small/preferences-desktop-font.png +0 -0
- data/static/icons/small/preferences-desktop-keyboard-shortcuts.png +0 -0
- data/static/icons/small/preferences-desktop-locale.png +0 -0
- data/static/icons/small/preferences-desktop-peripherals.png +0 -0
- data/static/icons/small/preferences-desktop-remote-desktop.png +0 -0
- data/static/icons/small/preferences-desktop-screensaver.png +0 -0
- data/static/icons/small/preferences-desktop-sound.png +0 -0
- data/static/icons/small/preferences-desktop-theme.png +0 -0
- data/static/icons/small/preferences-desktop-wallpaper.png +0 -0
- data/static/icons/small/preferences-desktop.png +0 -0
- data/static/icons/small/preferences-system-network-proxy.png +0 -0
- data/static/icons/small/preferences-system-session.png +0 -0
- data/static/icons/small/preferences-system-windows.png +0 -0
- data/static/icons/small/preferences-system.png +0 -0
- data/static/icons/small/printer-error.png +0 -0
- data/static/icons/small/printer.png +0 -0
- data/static/icons/small/process-stop.png +0 -0
- data/static/icons/small/process-working.png +0 -0
- data/static/icons/small/start-here.png +0 -0
- data/static/icons/small/system-file-manager.png +0 -0
- data/static/icons/small/system-installer.png +0 -0
- data/static/icons/small/system-lock-screen.png +0 -0
- data/static/icons/small/system-log-out.png +0 -0
- data/static/icons/small/system-search.png +0 -0
- data/static/icons/small/system-shutdown.png +0 -0
- data/static/icons/small/system-software-update.png +0 -0
- data/static/icons/small/system-users.png +0 -0
- data/static/icons/small/tab-new.png +0 -0
- data/static/icons/small/text-css.png +0 -0
- data/static/icons/small/text-html.png +0 -0
- data/static/icons/small/text-plain.png +0 -0
- data/static/icons/small/text-vnd.wap.wml.png +0 -0
- data/static/icons/small/text-x-c++src.png +0 -0
- data/static/icons/small/text-x-chdr.png +0 -0
- data/static/icons/small/text-x-cppsrc.png +0 -0
- data/static/icons/small/text-x-csh.png +0 -0
- data/static/icons/small/text-x-csrc.png +0 -0
- data/static/icons/small/text-x-generic-template.png +0 -0
- data/static/icons/small/text-x-generic.png +0 -0
- data/static/icons/small/text-x-java.png +0 -0
- data/static/icons/small/text-x-perl.png +0 -0
- data/static/icons/small/text-x-python.png +0 -0
- data/static/icons/small/text-x-script.png +0 -0
- data/static/icons/small/text-x-sh.png +0 -0
- data/static/icons/small/text-x-tex.png +0 -0
- data/static/icons/small/text-x-vcalendar.png +0 -0
- data/static/icons/small/text-x-vcard.png +0 -0
- data/static/icons/small/text-x-zsh.png +0 -0
- data/static/icons/small/text.png +0 -0
- data/static/icons/small/unlocked.png +0 -0
- data/static/icons/small/user-desktop.png +0 -0
- data/static/icons/small/user-home.png +0 -0
- data/static/icons/small/user-trash-full.png +0 -0
- data/static/icons/small/user-trash.png +0 -0
- data/static/icons/small/utilities-system-monitor.png +0 -0
- data/static/icons/small/utilities-terminal.png +0 -0
- data/static/icons/small/video-display.png +0 -0
- data/static/icons/small/video-mpeg.png +0 -0
- data/static/icons/small/video-quicktime.png +0 -0
- data/static/icons/small/video-x-generic.png +0 -0
- data/static/icons/small/video-x-ms-wmv.png +0 -0
- data/static/icons/small/video.png +0 -0
- data/static/icons/small/view-fullscreen.png +0 -0
- data/static/icons/small/view-refresh.png +0 -0
- data/static/icons/small/weather-clear-night.png +0 -0
- data/static/icons/small/weather-clear.png +0 -0
- data/static/icons/small/weather-few-clouds-night.png +0 -0
- data/static/icons/small/weather-few-clouds.png +0 -0
- data/static/icons/small/weather-overcast.png +0 -0
- data/static/icons/small/weather-severe-alert.png +0 -0
- data/static/icons/small/weather-showers-scattered.png +0 -0
- data/static/icons/small/weather-showers.png +0 -0
- data/static/icons/small/weather-snow.png +0 -0
- data/static/icons/small/weather-storm.png +0 -0
- data/static/icons/small/window-new.png +0 -0
- data/static/icons/small/x-font-afm.png +0 -0
- data/static/icons/small/x-office-address-book.png +0 -0
- data/static/icons/small/x-office-calendar.png +0 -0
- data/static/icons/small/x-office-document-template.png +0 -0
- data/static/icons/small/x-office-document.png +0 -0
- data/static/icons/small/x-office-drawing-template.png +0 -0
- data/static/icons/small/x-office-drawing.png +0 -0
- data/static/icons/small/x-office-presentation-template.png +0 -0
- data/static/icons/small/x-office-presentation.png +0 -0
- data/static/icons/small/x-office-spreadsheet-template.png +0 -0
- data/static/icons/small/x-office-spreadsheet.png +0 -0
- data/static/icons/tiny/blank.png +0 -0
- data/static/icons/tiny/go-down.png +0 -0
- data/static/icons/tiny/go-down.svg +199 -0
- data/static/icons/tiny/go-up.png +0 -0
- data/static/icons/tiny/go-up.svg +195 -0
- data/static/icons/tiny/sort-ascending.png +0 -0
- data/static/icons/tiny/sort-ascending.svg +308 -0
- data/static/icons/tiny/sort-descending.png +0 -0
- data/static/icons/tiny/sort-descending.svg +308 -0
- data/static/js/administration.js +306 -0
- data/static/js/engine.js +414 -0
- data/static/js/jquery/base64.js +133 -0
- data/static/js/jquery/jquery-ui.min.js +6 -0
- data/static/js/jquery/jquery.min.js +2 -0
- data/static/js/jquery/printf.js +155 -0
- data/static/styles/AdwaitaSans-Latin.woff2 +0 -0
- data/static/styles/AdwaitaSans-Regular.ttf +0 -0
- data/static/styles/AdwaitaSans-Regular.ttf.License +96 -0
- data/static/styles/CEWebS.ico +0 -0
- data/static/styles/content.css +757 -0
- data/static/styles/fullplain.css +6 -0
- data/static/styles/jquery-ui/custom.css +75 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/static/styles/jquery-ui/jquery-ui.css +1312 -0
- data/static/styles/plain.css +246 -0
- data/static/styles/plain_ohne.css +6 -0
- data/static/styles/print.css +28 -0
- data/static/styles/uni.compact.css +262 -0
- data/static/styles/uni.css +299 -0
- data/static/styles/uni_big.css +5 -0
- data/tools/cewebs-transformationengine +98 -0
- metadata +785 -0
data/static/js/engine.js
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
// Please see the LICENSE.GPL file for copyright and distribution information
|
|
2
|
+
//
|
|
3
|
+
// index.html?t={target}&c={command}&CEWebS_{parameter}=... content of a service
|
|
4
|
+
// index.html?m={LOGIN|EMAIL|CHANGE|REPORT|ADMIN...} pages of the engine
|
|
5
|
+
var CEWebS = (function() {
|
|
6
|
+
// links and forms lead to index.html
|
|
7
|
+
if (location.pathname.endsWith('/')) history.replaceState(null, '', 'index.html' + location.search + location.hash);
|
|
8
|
+
// one engine for all sites, the name of a site is its path with : instead of /
|
|
9
|
+
var engine = '/CEWebSEngine/' + (location.pathname.split('/').slice(1, -1).join(':') || ':') + '/';
|
|
10
|
+
var page;
|
|
11
|
+
// speed of the last request (only for administrators), and when loading began
|
|
12
|
+
var times, began = 0;
|
|
13
|
+
var loaded = {};
|
|
14
|
+
var bundles = {
|
|
15
|
+
jquery: ['jquery.min', 'jquery-ui.min', 'base64', 'printf'].map(function(f) { return 'jquery/' + f + '.js'; })
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// element, attributes starting with on are event handlers, html is markup
|
|
19
|
+
function el(name, attributes, children) {
|
|
20
|
+
var ret = document.createElement(name);
|
|
21
|
+
Object.entries(attributes || {}).forEach(function([key, value]) {
|
|
22
|
+
if (value === null || value === undefined || value === false) return;
|
|
23
|
+
if (key == 'html') ret.innerHTML = value;
|
|
24
|
+
else if (key.startsWith('on')) ret.addEventListener(key.substring(2), value);
|
|
25
|
+
else ret.setAttribute(key, value);
|
|
26
|
+
});
|
|
27
|
+
[].concat(children === undefined ? [] : children).forEach(function(c) { if (c !== null) ret.append(c); });
|
|
28
|
+
return ret;
|
|
29
|
+
}
|
|
30
|
+
function id(name) { return document.getElementById(name); }
|
|
31
|
+
function value(node, path) {
|
|
32
|
+
var ret = node.querySelector(':scope > ' + path);
|
|
33
|
+
return ret ? ret.textContent : '';
|
|
34
|
+
}
|
|
35
|
+
function all(node, path) { return Array.from(node.querySelectorAll(':scope > ' + path)); }
|
|
36
|
+
function string(name) { return value(page, 'strings > ' + name); }
|
|
37
|
+
// for buttons and attributes
|
|
38
|
+
function plain(markup) { return new DOMParser().parseFromString(markup, 'text/html').body.textContent; }
|
|
39
|
+
function text(name) { return plain(string(name)); }
|
|
40
|
+
|
|
41
|
+
// data is FormData or an object, errors have a status. started is a fetch that is already running
|
|
42
|
+
async function request(method, path, data, started) {
|
|
43
|
+
var options = { method: method, credentials: 'same-origin' };
|
|
44
|
+
if (data) options.body = data instanceof FormData || data instanceof URLSearchParams ? data : new URLSearchParams(data);
|
|
45
|
+
var response = await (started || fetch(engine + path, options));
|
|
46
|
+
var body = await response.text();
|
|
47
|
+
times = response.headers.get('Server-Timing');
|
|
48
|
+
if (!response.ok) throw Object.assign(new Error(response.status == 429 ? text('blocked') : body), { status: response.status });
|
|
49
|
+
if (!(response.headers.get('Content-Type') || '').startsWith('text/xml')) return body;
|
|
50
|
+
return new DOMParser().parseFromString(body, 'text/xml').documentElement;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function show(children, title) {
|
|
54
|
+
id('content').replaceChildren.apply(id('content'), [].concat(title ? el('h1', { html: title }) : [], children));
|
|
55
|
+
}
|
|
56
|
+
function error(e) { show(el('div', { class: 'urgent' }, e.message)); }
|
|
57
|
+
|
|
58
|
+
/* ---- layout ---- */
|
|
59
|
+
|
|
60
|
+
function peg(href, label, title, post) { return ['[', el('a', { href: href, title: title, 'data-post': post, html: label }), '] ']; }
|
|
61
|
+
|
|
62
|
+
// the body is hidden until its stylesheet is loaded
|
|
63
|
+
async function layout() {
|
|
64
|
+
await new Promise(function(done) {
|
|
65
|
+
document.head.append(el('link', { rel: 'stylesheet', media: 'screen', href: 'static/styles/' + value(page, 'style') + '.css', onload: done, onerror: done }));
|
|
66
|
+
});
|
|
67
|
+
document.body.hidden = false;
|
|
68
|
+
document.title = text('name');
|
|
69
|
+
// %Y is the current year
|
|
70
|
+
['title1', 'title2', 'youarehere', 'contact'].forEach(function(n) { id(n).innerHTML = string(n).replace('%Y', new Date().getFullYear()); });
|
|
71
|
+
var user = page.querySelector(':scope > user');
|
|
72
|
+
var nav = [];
|
|
73
|
+
if (user) {
|
|
74
|
+
var role = value(user, 'role');
|
|
75
|
+
if (role == 'true' || role == 'limited') nav.push(peg('?m=REPORT', string('report')));
|
|
76
|
+
if (role == 'true') nav.push(peg('?m=ADMIN', string('administration')));
|
|
77
|
+
nav.push(peg('?m=CHANGE', string('change')));
|
|
78
|
+
nav.push(['[', el('a', { href: '#', title: value(user, 'name'), html: string('logout'), onclick: logout }), ']']);
|
|
79
|
+
} else {
|
|
80
|
+
nav.push(peg('?m=LOGIN', string('login')));
|
|
81
|
+
}
|
|
82
|
+
id('hnav').append.apply(id('hnav'), nav.flat());
|
|
83
|
+
document.querySelector('#header .search').replaceChildren(el('form', { action: 'index.html' }, [
|
|
84
|
+
el('input', { type: 'hidden', name: 'm', value: 'SEARCH' }),
|
|
85
|
+
el('input', { type: 'text', name: 'search', placeholder: text('search'), value: new URLSearchParams(location.search).get('search') })
|
|
86
|
+
]));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// a service that is opened directly belongs to the last menu point, mode is a page of the engine
|
|
90
|
+
function menu(target, mode) {
|
|
91
|
+
var key = 'cewebs_active' + location.pathname;
|
|
92
|
+
var points = Array.from(page.querySelectorAll('menu point'));
|
|
93
|
+
function find(name) { return points.find(function(p) { return p.getAttribute('name') == name; }); }
|
|
94
|
+
if (find(target)) sessionStorage.setItem(key, target);
|
|
95
|
+
var active = sessionStorage.getItem(key);
|
|
96
|
+
var visible = !mode && target != 'CEWebSInternalReport';
|
|
97
|
+
function build(points) {
|
|
98
|
+
return points.map(function(p) {
|
|
99
|
+
var name = p.getAttribute('name');
|
|
100
|
+
var service = p.getAttribute('service');
|
|
101
|
+
if (service == 'spacer') return el('li', { class: 'spacer' }, ' ');
|
|
102
|
+
var label = value(p, 'text');
|
|
103
|
+
var href = service == 'hyperlink' ? value(p, 'command') : '?t=' + name;
|
|
104
|
+
var children = all(p, 'point');
|
|
105
|
+
var cls = ['menu'];
|
|
106
|
+
if (visible && name == active) cls.push('theActiveMenuPoint');
|
|
107
|
+
if (visible && children.some(function(c) { return c.getAttribute('name') == active; })) cls.push('theParentActiveMenuPoint');
|
|
108
|
+
return el('li', { class: cls.join(' ') }, [
|
|
109
|
+
service == 'plain' ? label : el('a', { href: href, target: service == 'hyperlink' ? '_blank' : null }, label),
|
|
110
|
+
children.length > 0 ? el('ul', {}, build(children)) : null
|
|
111
|
+
]);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
id('points').replaceChildren.apply(id('points'), build(all(page, 'menu > point')));
|
|
115
|
+
|
|
116
|
+
var point = find(active);
|
|
117
|
+
document.title = text('name') + (point ? ' - ' + value(point, 'text') : '');
|
|
118
|
+
var crumbs = [];
|
|
119
|
+
if (/^ADMIN/.test(mode) || target == 'CEWebSInternalAdministration') {
|
|
120
|
+
crumbs.push(el('a', { href: '?m=ADMIN', html: string('administration') }));
|
|
121
|
+
} else if (mode == 'REPORT' || target == 'CEWebSInternalReport') {
|
|
122
|
+
crumbs.push(el('a', { href: '?m=REPORT', html: string('report') }));
|
|
123
|
+
} else if (!mode && !find(target) && value(page, 'target > description')) {
|
|
124
|
+
crumbs.push(value(page, 'target > description'));
|
|
125
|
+
} else {
|
|
126
|
+
for (var p = point; p && p.nodeName == 'point'; p = p.parentNode) {
|
|
127
|
+
var label = value(p, 'text');
|
|
128
|
+
crumbs.unshift(p.getAttribute('service') == 'plain' ? label : el('a', { href: '?t=' + p.getAttribute('name') }, label));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
id('bread').replaceChildren.apply(id('bread'), crumbs.flatMap(function(c, i) { return i == 0 ? [c] : [' » ', c]; }));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* ---- content of services ---- */
|
|
135
|
+
|
|
136
|
+
// loaded at the same time, executed in order
|
|
137
|
+
function load(src) {
|
|
138
|
+
return new Promise(function(resolve, reject) {
|
|
139
|
+
var script = el('script', { src: src, onload: resolve, onerror: reject });
|
|
140
|
+
script.async = false;
|
|
141
|
+
document.head.append(script);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// only for pages that need it
|
|
145
|
+
function bundle(name) {
|
|
146
|
+
if (!bundles[name]) return Promise.resolve();
|
|
147
|
+
if (!loaded[name]) {
|
|
148
|
+
if (name == 'jquery') {
|
|
149
|
+
document.head.append(el('link', { rel: 'stylesheet', href: 'static/styles/jquery-ui/jquery-ui.css' }));
|
|
150
|
+
document.head.append(el('link', { rel: 'stylesheet', href: 'static/styles/jquery-ui/custom.css' }));
|
|
151
|
+
}
|
|
152
|
+
loaded[name] = Promise.all(bundles[name].map(function(f) { return load('static/js/' + f); }));
|
|
153
|
+
}
|
|
154
|
+
return loaded[name];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// the time the engine needed, details are in the tooltip
|
|
158
|
+
function speed(times) {
|
|
159
|
+
var ms = {};
|
|
160
|
+
times.split(', ').forEach(function(t) { var parts = t.split(';dur='); ms[parts[0]] = Math.round(parts[1]); });
|
|
161
|
+
var lines = ['prepare', 'document', 'engine'].map(function(n) { return n + ': ' + ms[n] + 'ms' + (n == 'document' && 'cache' in ms ? ' (from cache)' : ''); });
|
|
162
|
+
lines.push('browser, total: ' + Math.round(performance.now() - began) + 'ms');
|
|
163
|
+
return el('span', { id: 'speed', title: lines.join('\n') }, '(' + ms.total + 'ms)');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async function display(doc) {
|
|
167
|
+
var measured = times;
|
|
168
|
+
var to = all(doc, 'headers').find(function(h) { return value(h, 'name') == 'Location'; });
|
|
169
|
+
if (to) {
|
|
170
|
+
var url = new URL(value(to, 'value'), location.href);
|
|
171
|
+
if (url.href == location.href) location.reload(); else location.assign(url);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
all(doc, 'links').forEach(function(l) {
|
|
175
|
+
document.head.append(el('link', { rel: value(l, 'rel'), type: value(l, 'type'), href: plain(value(l, 'href')) }));
|
|
176
|
+
});
|
|
177
|
+
var crumbs = all(doc, 'breadcrumbs');
|
|
178
|
+
crumbs.forEach(function(b) { id('bread').append(' » ', el('a', { href: plain(value(b, 'href')) }, value(b, 'text'))); });
|
|
179
|
+
var access = all(doc, 'access').flatMap(function(a) { return peg(plain(value(a, 'href')), el('span', {}, value(a, 'text')).innerHTML, null, value(a, 'post') || null); });
|
|
180
|
+
id('access').replaceChildren.apply(id('access'), access.length > 0 ? [el('span', {}, 'Quick Access:'), ' '].concat(access) : []);
|
|
181
|
+
id('content').innerHTML = value(doc, 'content');
|
|
182
|
+
// the content is already visible while its libraries are loaded
|
|
183
|
+
var scripts = id('content').querySelectorAll('script');
|
|
184
|
+
await bundle(value(doc, 'js'));
|
|
185
|
+
// scripts that are added as markup are not executed
|
|
186
|
+
scripts.forEach(function(old) {
|
|
187
|
+
var script = document.createElement('script');
|
|
188
|
+
Array.from(old.attributes).forEach(function(a) { script.setAttribute(a.name, a.value); });
|
|
189
|
+
script.textContent = old.textContent;
|
|
190
|
+
old.replaceWith(script);
|
|
191
|
+
});
|
|
192
|
+
id('contentcontainer').scrollTop = 0;
|
|
193
|
+
if (location.hash) {
|
|
194
|
+
var anchor = id(decodeURIComponent(location.hash.substring(1)));
|
|
195
|
+
if (anchor) anchor.scrollIntoView();
|
|
196
|
+
}
|
|
197
|
+
if (measured) id('access').append(speed(measured));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// requested while the layout is still loading, ready is when it can be shown
|
|
201
|
+
async function content(parameters, ready) {
|
|
202
|
+
var target = page.querySelector(':scope > target');
|
|
203
|
+
if (!target) {
|
|
204
|
+
await ready;
|
|
205
|
+
return show(el('div', {}, text('error')));
|
|
206
|
+
}
|
|
207
|
+
var command = parameters.get('c');
|
|
208
|
+
var query = new URLSearchParams(parameters);
|
|
209
|
+
if (!query.get('t')) query.set('t', value(target, 'name'));
|
|
210
|
+
if (!command) {
|
|
211
|
+
command = value(target, 'command');
|
|
212
|
+
new URLSearchParams(plain(value(target, 'parameters'))).forEach(function(v, k) { query.append(k, v); });
|
|
213
|
+
}
|
|
214
|
+
query.delete('c');
|
|
215
|
+
try {
|
|
216
|
+
var doc = await request('GET', 'content/document/' + encodeURIComponent(command) + '?' + query);
|
|
217
|
+
await ready;
|
|
218
|
+
await display(doc);
|
|
219
|
+
} catch (e) {
|
|
220
|
+
await ready;
|
|
221
|
+
if (e.status == 401) ask(login(function() { location.reload(); })); else error(e);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// forms that lead to a page are sent in the background
|
|
226
|
+
function intercept(form, submitter) {
|
|
227
|
+
var method = (form.getAttribute('method') || 'get').toLowerCase();
|
|
228
|
+
var url = new URL(form.getAttribute('action') || '', location.href);
|
|
229
|
+
if (method != 'post' || url.pathname != location.pathname || !url.searchParams.get('c')) return false;
|
|
230
|
+
var data = new FormData(form, submitter || undefined);
|
|
231
|
+
if (form.getAttribute('enctype') != 'multipart/form-data') data = new URLSearchParams(data);
|
|
232
|
+
var query = new URLSearchParams(url.search);
|
|
233
|
+
query.delete('c');
|
|
234
|
+
function send() {
|
|
235
|
+
began = performance.now();
|
|
236
|
+
return request('POST', 'content/document/' + encodeURIComponent(url.searchParams.get('c')) + '?' + query, data).then(function(doc) {
|
|
237
|
+
menu(url.searchParams.get('t'));
|
|
238
|
+
return display(doc);
|
|
239
|
+
}).catch(function(e) {
|
|
240
|
+
// keep what has been entered
|
|
241
|
+
if (e.status != 401) return alert(e.message);
|
|
242
|
+
var box = login(function() { box.remove(); send(); });
|
|
243
|
+
id('content').prepend(box);
|
|
244
|
+
box.scrollIntoView();
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
send();
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
var submit = HTMLFormElement.prototype.submit;
|
|
251
|
+
HTMLFormElement.prototype.submit = function() { if (!intercept(this)) submit.call(this); };
|
|
252
|
+
// after the handlers of the form itself
|
|
253
|
+
window.addEventListener('submit', function(event) {
|
|
254
|
+
if (!event.defaultPrevented && intercept(event.target, event.submitter)) event.preventDefault();
|
|
255
|
+
});
|
|
256
|
+
// links that change something are sent like forms
|
|
257
|
+
window.addEventListener('click', function(event) {
|
|
258
|
+
var link = event.target.closest('a[data-post]');
|
|
259
|
+
if (!link || event.defaultPrevented) return;
|
|
260
|
+
event.preventDefault();
|
|
261
|
+
intercept(el('form', { method: 'post', action: link.getAttribute('href') }));
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
/* ---- users ---- */
|
|
265
|
+
|
|
266
|
+
// the last field of a form has a button
|
|
267
|
+
function field(label, name, type, size, button) {
|
|
268
|
+
return el('tr', {}, [
|
|
269
|
+
el('td', { class: 'margin-right-huge align-vertical-center', html: label + ':' }),
|
|
270
|
+
el('td', { class: 'margin-right-huge' }, el('input', { name: name, type: type, size: size, maxlength: 50 })),
|
|
271
|
+
button ? el('td', {}, el('input', { type: 'submit', value: text(button) })) : null
|
|
272
|
+
]);
|
|
273
|
+
}
|
|
274
|
+
function choice(name, value, label, checked) {
|
|
275
|
+
return el('tr', {}, [
|
|
276
|
+
el('td', { class: 'margin-right-huge align-vertical-center' }, el('input', { name: name, type: 'radio', value: value, checked: checked })),
|
|
277
|
+
el('td', { class: 'align-vertical-center', html: label })
|
|
278
|
+
]);
|
|
279
|
+
}
|
|
280
|
+
// form that is processed by a function, which returns a message
|
|
281
|
+
function form(children, process) {
|
|
282
|
+
var message = el('div', { class: 'urgent' });
|
|
283
|
+
return el('form', {
|
|
284
|
+
onsubmit: async function(event) {
|
|
285
|
+
event.preventDefault();
|
|
286
|
+
message.innerHTML = await process(new FormData(event.target)) || '';
|
|
287
|
+
}
|
|
288
|
+
}, [message].concat(children));
|
|
289
|
+
}
|
|
290
|
+
function ask(children) {
|
|
291
|
+
show(children);
|
|
292
|
+
id('content').querySelector('input').focus();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function login(success) {
|
|
296
|
+
return el('div', {}, [
|
|
297
|
+
el('div', { class: 'margin-bottom-huge', html: string('info') }),
|
|
298
|
+
form([
|
|
299
|
+
el('table', { class: 'margin-bottom-huge' }, [field(string('username'), 'user', 'text', 30), field(string('password'), 'password', 'password', 30, 'identify')]),
|
|
300
|
+
el('table', {}, [choice('permanent', 'false', string('public'), 'checked'), choice('permanent', 'true', string('home'))])
|
|
301
|
+
], async function(data) {
|
|
302
|
+
try {
|
|
303
|
+
await request('POST', 'session', { user: data.get('user'), password: data.get('password'), permanent: data.get('permanent') });
|
|
304
|
+
success();
|
|
305
|
+
} catch (e) {
|
|
306
|
+
return e.status == 403 ? string('failed') : e.message;
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
]);
|
|
310
|
+
}
|
|
311
|
+
async function logout(event) {
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
await request('DELETE', 'session');
|
|
314
|
+
location.assign('index.html');
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
var pages = {
|
|
318
|
+
LOGIN: function() { ask(login(function() { location.assign('index.html'); })); },
|
|
319
|
+
EMAIL: function() {
|
|
320
|
+
ask([
|
|
321
|
+
el('div', { class: 'margin-bottom-huge', html: string('sendinfo') }),
|
|
322
|
+
form(el('table', {}, field(string('username'), 'user', 'text', 20, 'send')), async function(data) {
|
|
323
|
+
if (!data.get('user').trim()) return alert(text('fieldsemptyerror'));
|
|
324
|
+
try {
|
|
325
|
+
await request('POST', 'password', { user: data.get('user') });
|
|
326
|
+
show(el('div', { html: string('sendthanks') }));
|
|
327
|
+
} catch (e) {
|
|
328
|
+
return e.status == 404 ? string('sendnotfound') : e.message;
|
|
329
|
+
}
|
|
330
|
+
})
|
|
331
|
+
]);
|
|
332
|
+
},
|
|
333
|
+
// the link in the email
|
|
334
|
+
RESET: function() {
|
|
335
|
+
ask(form(el('table', {}, [
|
|
336
|
+
field(string('newpassword'), 'new', 'password', 20),
|
|
337
|
+
field(string('repeatpassword'), 'repeat', 'password', 20, 'identify')
|
|
338
|
+
]), async function(data) {
|
|
339
|
+
if (['new', 'repeat'].some(function(n) { return !data.get(n).trim(); })) return alert(text('fieldsemptyerror'));
|
|
340
|
+
if (data.get('new') != data.get('repeat')) return alert(text('notthesamepasserror'));
|
|
341
|
+
try {
|
|
342
|
+
await request('PUT', 'reset', { token: location.hash.substring(1), 'new': data.get('new') });
|
|
343
|
+
show(el('div', { html: string('passchangethanks') }));
|
|
344
|
+
} catch (e) {
|
|
345
|
+
return e.status == 403 ? string('sendinvalid') : e.message;
|
|
346
|
+
}
|
|
347
|
+
}));
|
|
348
|
+
},
|
|
349
|
+
CHANGE: function() {
|
|
350
|
+
ask([
|
|
351
|
+
el('div', { class: 'margin-bottom-huge', html: string('passchangeinfo') }),
|
|
352
|
+
form(el('table', { class: 'margin-bottom-huge' }, [
|
|
353
|
+
field(string('oldpassword'), 'old', 'password', 20),
|
|
354
|
+
field(string('newpassword'), 'new', 'password', 20),
|
|
355
|
+
field(string('repeatpassword'), 'repeat', 'password', 20, 'identify')
|
|
356
|
+
]), async function(data) {
|
|
357
|
+
if (['old', 'new', 'repeat'].some(function(n) { return !data.get(n).trim(); })) return alert(text('fieldsemptyerror'));
|
|
358
|
+
if (data.get('new') != data.get('repeat')) return alert(text('notthesamepasserror'));
|
|
359
|
+
try {
|
|
360
|
+
await request('PUT', 'password', { old: data.get('old'), 'new': data.get('new') });
|
|
361
|
+
show(el('div', { html: string('passchangethanks') }));
|
|
362
|
+
} catch (e) {
|
|
363
|
+
return e.status == 403 ? string('passchangeerror') : e.message;
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
]);
|
|
367
|
+
},
|
|
368
|
+
SEARCH: async function() {
|
|
369
|
+
var search = new URLSearchParams(location.search).get('search') || '';
|
|
370
|
+
var hits = all(await request('GET', 'search?' + new URLSearchParams({ q: search })), 'item');
|
|
371
|
+
show([
|
|
372
|
+
el('h1', {}, text('searchresults').replace('%s', function() { return search; })),
|
|
373
|
+
hits.length == 0 ? el('em', { html: string('nosearchresults') }) : el('ol', { style: 'counter-reset: item 0;' }, hits.map(function(h) {
|
|
374
|
+
return el('li', { style: 'counter-increment: item 1;' }, [el('strong', {}, value(h, 'service')), ': ', el('a', { href: value(h, 'href') }, value(h, 'description'))]);
|
|
375
|
+
}))
|
|
376
|
+
]);
|
|
377
|
+
},
|
|
378
|
+
REPORT: async function() {
|
|
379
|
+
var services = all(await request('GET', 'reports'), 'service');
|
|
380
|
+
show([
|
|
381
|
+
el('p', { html: string('reports_desc') }),
|
|
382
|
+
el('ul', {}, services.map(function(s) {
|
|
383
|
+
return el('li', {}, [
|
|
384
|
+
el('span', { html: string('reportsfor') }), ' ',
|
|
385
|
+
el('a', { href: '?t=CEWebSInternalReport&c=show&CEWebS_t=' + s.getAttribute('name') }, value(s, 'comment'))
|
|
386
|
+
]);
|
|
387
|
+
}))
|
|
388
|
+
], string('reports'));
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
async function start() {
|
|
393
|
+
var parameters = new URLSearchParams(location.search);
|
|
394
|
+
var target = parameters.get('t') || '';
|
|
395
|
+
try {
|
|
396
|
+
page = await request('GET', 'page?' + new URLSearchParams({ t: target }), null, window.CEWebS_page);
|
|
397
|
+
var name = parameters.get('m');
|
|
398
|
+
var mode = pages[name] || CEWebS_Administration[name];
|
|
399
|
+
var ready = layout().then(function() { menu(mode ? '' : target || value(page, 'target > name'), mode ? name : ''); });
|
|
400
|
+
if (mode) {
|
|
401
|
+
await ready;
|
|
402
|
+
await mode(CEWebS);
|
|
403
|
+
} else {
|
|
404
|
+
await content(parameters, ready);
|
|
405
|
+
}
|
|
406
|
+
} catch (e) {
|
|
407
|
+
document.body.hidden = false;
|
|
408
|
+
if (page && e.status == 401) ask(login(function() { location.reload(); })); else error(e);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
document.addEventListener('DOMContentLoaded', start);
|
|
412
|
+
|
|
413
|
+
return { el: el, all: all, value: value, string: string, text: text, plain: plain, request: request, show: show, bundle: bundle };
|
|
414
|
+
})();
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
var Base64 = {
|
|
2
|
+
// private property
|
|
3
|
+
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
|
4
|
+
|
|
5
|
+
// public method for encoding
|
|
6
|
+
encode : function (input) {
|
|
7
|
+
var output = "";
|
|
8
|
+
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
|
9
|
+
var i = 0;
|
|
10
|
+
|
|
11
|
+
input = Base64._utf8_encode(input);
|
|
12
|
+
|
|
13
|
+
while (i < input.length) {
|
|
14
|
+
|
|
15
|
+
chr1 = input.charCodeAt(i++);
|
|
16
|
+
chr2 = input.charCodeAt(i++);
|
|
17
|
+
chr3 = input.charCodeAt(i++);
|
|
18
|
+
|
|
19
|
+
enc1 = chr1 >> 2;
|
|
20
|
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
|
21
|
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
|
22
|
+
enc4 = chr3 & 63;
|
|
23
|
+
|
|
24
|
+
if (isNaN(chr2)) {
|
|
25
|
+
enc3 = enc4 = 64;
|
|
26
|
+
} else if (isNaN(chr3)) {
|
|
27
|
+
enc4 = 64;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
output = output +
|
|
31
|
+
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
|
32
|
+
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return output;
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// public method for decoding
|
|
40
|
+
decode : function (input) {
|
|
41
|
+
var output = "";
|
|
42
|
+
var chr1, chr2, chr3;
|
|
43
|
+
var enc1, enc2, enc3, enc4;
|
|
44
|
+
var i = 0;
|
|
45
|
+
|
|
46
|
+
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
|
47
|
+
|
|
48
|
+
while (i < input.length) {
|
|
49
|
+
|
|
50
|
+
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
|
51
|
+
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
|
52
|
+
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
|
53
|
+
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
|
54
|
+
|
|
55
|
+
chr1 = (enc1 << 2) | (enc2 >> 4);
|
|
56
|
+
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
|
57
|
+
chr3 = ((enc3 & 3) << 6) | enc4;
|
|
58
|
+
|
|
59
|
+
output = output + String.fromCharCode(chr1);
|
|
60
|
+
|
|
61
|
+
if (enc3 != 64) {
|
|
62
|
+
output = output + String.fromCharCode(chr2);
|
|
63
|
+
}
|
|
64
|
+
if (enc4 != 64) {
|
|
65
|
+
output = output + String.fromCharCode(chr3);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
output = Base64._utf8_decode(output);
|
|
71
|
+
|
|
72
|
+
return output;
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
// private method for UTF-8 encoding
|
|
77
|
+
_utf8_encode : function (string) {
|
|
78
|
+
string = string.replace(/\r\n/g,"\n");
|
|
79
|
+
var utftext = "";
|
|
80
|
+
|
|
81
|
+
for (var n = 0; n < string.length; n++) {
|
|
82
|
+
|
|
83
|
+
var c = string.charCodeAt(n);
|
|
84
|
+
|
|
85
|
+
if (c < 128) {
|
|
86
|
+
utftext += String.fromCharCode(c);
|
|
87
|
+
}
|
|
88
|
+
else if((c > 127) && (c < 2048)) {
|
|
89
|
+
utftext += String.fromCharCode((c >> 6) | 192);
|
|
90
|
+
utftext += String.fromCharCode((c & 63) | 128);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
utftext += String.fromCharCode((c >> 12) | 224);
|
|
94
|
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
|
95
|
+
utftext += String.fromCharCode((c & 63) | 128);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return utftext;
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
// private method for UTF-8 decoding
|
|
104
|
+
_utf8_decode : function (utftext) {
|
|
105
|
+
var string = "";
|
|
106
|
+
var i = 0;
|
|
107
|
+
var c = c1 = c2 = 0;
|
|
108
|
+
|
|
109
|
+
while ( i < utftext.length ) {
|
|
110
|
+
|
|
111
|
+
c = utftext.charCodeAt(i);
|
|
112
|
+
|
|
113
|
+
if (c < 128) {
|
|
114
|
+
string += String.fromCharCode(c);
|
|
115
|
+
i++;
|
|
116
|
+
}
|
|
117
|
+
else if((c > 191) && (c < 224)) {
|
|
118
|
+
c2 = utftext.charCodeAt(i+1);
|
|
119
|
+
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
|
120
|
+
i += 2;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
c2 = utftext.charCodeAt(i+1);
|
|
124
|
+
c3 = utftext.charCodeAt(i+2);
|
|
125
|
+
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
|
126
|
+
i += 3;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return string;
|
|
132
|
+
}
|
|
133
|
+
}
|