diff --git a/Makefile b/Makefile index 714d9cff..19d55be9 100644 --- a/Makefile +++ b/Makefile @@ -165,12 +165,12 @@ install: $(EXECS) @$(INSTALL) -v -m 0644 man/elogd.8 $(MANDIR)/man8/ @$(INSTALL) -v -m 0644 scripts/*.js $(ELOGDIR)/scripts/ - @echo "Installing FCKeditor to $(ELOGDIR)/scripts/fckeditor" - @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" + # @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 resources to $(ELOGDIR)/resources" @$(INSTALL) -m 0644 resources/* $(ELOGDIR)/resources/ diff --git a/elogd.init b/elogd.init new file mode 100644 index 00000000..0f0be6f5 --- /dev/null +++ b/elogd.init @@ -0,0 +1,71 @@ +#!/bin/sh + +# chkconfig: 3 90 10 +# description: ELOG is a weblog with integrated database +# processname: elogd +# config: /usr/local/elog/elogd.cfg +# pidfile: /var/run/elogd.pid + +# Source function library. +# . /etc/rc.d/init.d/functions + +# Check for the config file +if [ ! -f /usr/local/elog/elogd.cfg ]; then + exit 0 +fi + + +# See how we were called. +case "$1" in + start) + if [ -f /var/run/elogd.pid ] ; then + pid=`cat /var/run/elogd.pid` + if [ -d /proc/$pid ] ; then + echo "elogd already running" + # echo_failure + exit 1 + fi + fi + if [ -f /var/run/elogd.pid ] ; then + rm -f /var/lock/subsys/elogd + rm -f /var/run/elogd.pid + fi + echo -n "Starting elogd: " + /usr/local/sbin/elogd -D -c /usr/local/elog/elogd.cfg > /dev/null 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + touch /var/lock/subsys/elogd + fi + echo + ;; + stop) + echo "" + if [ -f /var/run/elogd.pid ] ; then + echo -n "Stoping elogd: " + /bin/kill `cat /var/run/elogd.pid` + rm -f /var/lock/subsys/elogd + rm -f /var/run/elogd.pid + echo_success + echo + else + echo -n "No elogd running?" + echo + fi + + ;; + status) + status -p /var/run/elogd.pid /usr/local/sbin/elogd + RETVAL=$? + ;; + restart|reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac + +exit 0 + diff --git a/elogd.init_template b/elogd.init_template index c56e0652..6db4a283 100755 --- a/elogd.init_template +++ b/elogd.init_template @@ -7,7 +7,7 @@ # pidfile: /var/run/elogd.pid # Source function library. -. /etc/rc.d/init.d/functions +# . /etc/rc.d/init.d/functions # Check for the config file if [ ! -f @PREFIX@/elog/elogd.cfg ]; then @@ -22,7 +22,7 @@ case "$1" in pid=`cat /var/run/elogd.pid` if [ -d /proc/$pid ] ; then echo "elogd already running" - echo_failure + # echo_failure exit 1 fi fi @@ -35,9 +35,6 @@ case "$1" in RETVAL=$? if [ $RETVAL -eq 0 ] ; then touch /var/lock/subsys/elogd - echo_success - else - echo_failure fi echo ;; @@ -52,7 +49,6 @@ case "$1" in echo else echo -n "No elogd running?" - echo_failure echo fi diff --git a/scripts/ckeditor/plugins/dndfiles b/scripts/ckeditor/plugins/dndfiles index 41551357..83f4ac1b 160000 --- a/scripts/ckeditor/plugins/dndfiles +++ b/scripts/ckeditor/plugins/dndfiles @@ -1 +1 @@ -Subproject commit 41551357b1c8e24cc2640d8558f683a94a1df3e4 +Subproject commit 83f4ac1be652ca0db0ecb02e6a7bfa7daceec3f6 diff --git a/scripts/ckeditor/plugins/fileupload/dialogs/fileupload.js b/scripts/ckeditor/plugins/fileupload/dialogs/fileupload.js index e0e6d889..e67f1667 100644 --- a/scripts/ckeditor/plugins/fileupload/dialogs/fileupload.js +++ b/scripts/ckeditor/plugins/fileupload/dialogs/fileupload.js @@ -73,12 +73,16 @@ CKEDITOR.dialog.add( 'fileuploadDialog', function( editor ) { { var xhr = new window.XMLHttpRequest(); + // Start the progress bar + progressJs().start(); + //Upload progress xhr.upload.addEventListener("progress", function(evt){ if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; - //Do something with upload progress - console.log(percentComplete); + + //Update the progress bar + progressJs().set(percentComplete); } }, false); @@ -90,6 +94,10 @@ CKEDITOR.dialog.add( 'fileuploadDialog', function( editor ) { url: URL, data: formData, success: function(data) { + + // End the progress bar + progressJs().end(); + if(data.attachments[0]) { // check if we have the correct response dialog.getContentElement( 'Upload', 'src' ).setValue( data.attachments[0].fullName ); } else { @@ -97,6 +105,8 @@ CKEDITOR.dialog.add( 'fileuploadDialog', function( editor ) { } }, fail: function() { + // End the progress bar + progressJs().end(); console.log("error"); } }); diff --git a/scripts/ckeditor/plugins/image2/dialogs/image2.js b/scripts/ckeditor/plugins/image2/dialogs/image2.js index 03efb92c..a2ba2af4 100755 --- a/scripts/ckeditor/plugins/image2/dialogs/image2.js +++ b/scripts/ckeditor/plugins/image2/dialogs/image2.js @@ -568,12 +568,15 @@ CKEDITOR.dialog.add( 'image2', function( editor ) { { var xhr = new window.XMLHttpRequest(); + // Start the progress bar + progressJs().start(); + //Upload progress xhr.upload.addEventListener("progress", function(evt){ if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; - //Do something with upload progress - // console.log(percentComplete); + //Update the progress bar + progressJs().set(percentComplete); } }, false); @@ -585,6 +588,10 @@ CKEDITOR.dialog.add( 'image2', function( editor ) { url: URL, data: formData, success: function(data) { + + // End the progress bar + progressJs().end(); + if(data.attachments) { // check if we have the correct response dialog.getContentElement( 'info', 'src' ).setValue( data.attachments[0].fullName ); } else { @@ -592,6 +599,8 @@ CKEDITOR.dialog.add( 'image2', function( editor ) { } }, fail: function() { + // End the progress bar + progressJs().end(); console.log("error"); } }); diff --git a/scripts/load-ckeditor.js b/scripts/load-ckeditor.js index 1c575a0f..3354e3fd 100755 --- a/scripts/load-ckeditor.js +++ b/scripts/load-ckeditor.js @@ -1,4 +1,5 @@ $(document).ready(function() { + $('textarea').addClass("ckeditor"); // Need to wait for the ckeditor instance to finish initialization @@ -78,10 +79,10 @@ $(document).ready(function() { }, 1); }); - // self.on('drop', function(event) { - // collection = $(); - // self.trigger('dndHoverEnd'); - // }); + self.on('drop', function(event) { + collection = $(); + self.trigger('dndHoverEnd'); + }); }); }; @@ -148,24 +149,18 @@ $(document).ready(function() { { var xhr = new window.XMLHttpRequest(); + // Start the progress bar + progressJs().start(); + //Upload progress xhr.upload.addEventListener("progress", function(evt){ if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; - //Do something with upload progress - console.log(percentComplete); + //Update the progress bar + progressJs().set(percentComplete); } }, false); - //Download progress - // xhr.addEventListener("progress", function(evt){ - // if (evt.lengthComputable) { - // var percentComplete = evt.loaded / evt.total; - // //Do something with download progress - // console.log(percentComplete); - // } - // }, false); - return xhr; }, contentType: false, @@ -174,21 +169,21 @@ $(document).ready(function() { url: URL, data: formData, success: function(data) { - console.log(data); + // End the progress bar + progressJs().end(); + var attch = $(".attachment", $(data)); var attch_upload = $("#attachment_upload", $(data)); - // attch.each(function(idx, element) { - // $("#attachment_upload").before(element); - // console.log(element); - // }); // add the new attachments to the current page $("#attachment_upload").before(attch.slice(-files.length)); + // replace the attachment upload section $("#attachment_upload").replaceWith(attch_upload); - // console.log(attch.last()); }, fail: function() { + // End the progress bar + progressJs().end(); console.log("Error uploading files..."); } }); diff --git a/scripts/progress/progress.min.js b/scripts/progress/progress.min.js new file mode 100644 index 00000000..f7c5b41b --- /dev/null +++ b/scripts/progress/progress.min.js @@ -0,0 +1,11 @@ +(function(l,e){"object"===typeof exports?e(exports):"function"===typeof define&&define.amd?define(["exports"],e):e(l)})(this,function(l){function e(a){this._targetElement="undefined"!=typeof a.length?a:[a];"undefined"===typeof window._progressjsId&&(window._progressjsId=1);"undefined"===typeof window._progressjsIntervals&&(window._progressjsIntervals={});this._options={theme:"blue",overlayMode:!1,considerTransition:!0}}function m(a,c){var d=this;100<=c&&(c=100);a.hasAttribute("data-progressjs")&& +setTimeout(function(){"undefined"!=typeof d._onProgressCallback&&d._onProgressCallback.call(d,a,c);var b=h(a);b.style.width=parseInt(c)+"%";var b=b.querySelector(".progressjs-percent"),g=parseInt(b.innerHTML.replace("%","")),e=parseInt(c),j=function(a,b,c){var d=Math.abs(b-c);3>d?k=30:20>d?k=20:intervanIn=1;0!=b-c&&(a.innerHTML=(f?++b:--b)+"%",setTimeout(function(){j(a,b,c)},k))},f=!0;g>e&&(f=!1);var k=10;j(b,g,e)},50)}function h(a){a=parseInt(a.getAttribute("data-progressjs"));return document.querySelector('.progressjs-container > .progressjs-progress[data-progressjs="'+ +a+'"] > .progressjs-inner')}function p(a){for(var c=0,d=this._targetElement.length;cparseInt(e.style.width.replace("%",""))&&(m.call(this,b,100),l=500);(function(a,b){setTimeout(function(){a.parentNode.className+=" progressjs-end";setTimeout(function(){a.parentNode.parentNode.removeChild(a.parentNode);b.removeAttribute("data-progressjs")},1E3)},l)})(e,b)}if(window._progressjsIntervals[a])try{clearInterval(window._progressjsIntervals[a]),window._progressjsIntervals[a]=null,delete window._progressjsIntervals[a]}catch(j){}}return this}, +onbeforeend:function(a){if("function"===typeof a)this._onBeforeEndCallback=a;else throw Error("Provided callback for onbeforeend was not a function");return this},onbeforestart:function(a){if("function"===typeof a)this._onBeforeStartCallback=a;else throw Error("Provided callback for onbeforestart was not a function");return this},onprogress:function(a){if("function"===typeof a)this._onProgressCallback=a;else throw Error("Provided callback for onprogress was not a function");return this}};return l.progressJs= +n}); diff --git a/scripts/progress/progressjs.min.css b/scripts/progress/progressjs.min.css new file mode 100644 index 00000000..9ac739e8 --- /dev/null +++ b/scripts/progress/progressjs.min.css @@ -0,0 +1 @@ +.progressjs-inner{width:0}.progressjs-progress{z-index:9999999}.progressjs-theme-blue .progressjs-inner{height:2px;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db}.progressjs-theme-blue.progressjs-end{-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;transition:opacity .2s ease-out;opacity:0}.progressjs-theme-blue .progressjs-percent{display:none}.progressjs-theme-blueOverlay{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.progressjs-theme-blueOverlay .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db}.progressjs-theme-blueOverlay.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlay .progressjs-percent{display:none}.progressjs-theme-blueOverlay{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.progressjs-theme-blueOverlay .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db}.progressjs-theme-blueOverlay.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlay .progressjs-percent{display:none}.progressjs-theme-blueOverlayRadius{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:5px}.progressjs-theme-blueOverlayRadius .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db;border-radius:5px}.progressjs-theme-blueOverlayRadius.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlayRadius .progressjs-percent{display:none}.progressjs-theme-blueOverlayRadiusHalfOpacity{background-color:white;opacity:.5;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:5px}.progressjs-theme-blueOverlayRadiusHalfOpacity .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db;border-radius:5px}.progressjs-theme-blueOverlayRadiusHalfOpacity.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlayRadiusHalfOpacity .progressjs-percent{display:none}.progressjs-theme-blueOverlayRadiusWithPercentBar{background-color:white;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:5px}.progressjs-theme-blueOverlayRadiusWithPercentBar .progressjs-inner{height:100%;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;background-color:#3498db;border-radius:5px}.progressjs-theme-blueOverlayRadiusWithPercentBar.progressjs-end{opacity:0!important}.progressjs-theme-blueOverlayRadiusWithPercentBar .progressjs-percent{width:70px;text-align:center;height:40px;position:absolute;right:50%;margin-right:-35px;top:50%;margin-top:-20px;font-size:30px;opacity:.5}.progressjs-theme-blackRadiusInputs{height:10px;border-radius:10px;overflow:hidden}.progressjs-theme-blackRadiusInputs .progressjs-inner{height:2px;-webkit-transition:all 1s ease-out;-moz-transition:all 1s ease-out;-o-transition:all 1s ease-out;transition:all 1s ease-out;background-color:#34495e}.progressjs-theme-blackRadiusInputs.progressjs-end{-webkit-transition:opacity .2s ease-out;-moz-transition:opacity .2s ease-out;-o-transition:opacity .2s ease-out;transition:opacity .2s ease-out;opacity:0}.progressjs-theme-blackRadiusInputs .progressjs-percent{display:none} \ No newline at end of file diff --git a/src/elogd.c b/src/elogd.c index af1af53e..47a6a915 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -9915,7 +9915,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL if (enc_selected == 2 && fckedit_exist && show_text && !fixed_text) { rsprintf("\n"); rsprintf("\n"); - // rsprintf("\n"); + rsprintf("\n"); + rsprintf("\n"); } /* external script if requested */ diff --git a/src/git-revision.h b/src/git-revision.h index de639a57..6fcb9e00 100644 --- a/src/git-revision.h +++ b/src/git-revision.h @@ -1 +1 @@ -#define GIT_REVISION "Mon Aug 11 11:19:47 2014 +0200 - 228262b" +#define GIT_REVISION "Thu Aug 14 13:59:07 2014 +0200 - 74a2bb2" diff --git a/xcode/elogd.xcodeproj/project.xcworkspace/xcuserdata/dmilicic.xcuserdatad/UserInterfaceState.xcuserstate b/xcode/elogd.xcodeproj/project.xcworkspace/xcuserdata/dmilicic.xcuserdatad/UserInterfaceState.xcuserstate index a8135cf7..2286fade 100644 Binary files a/xcode/elogd.xcodeproj/project.xcworkspace/xcuserdata/dmilicic.xcuserdatad/UserInterfaceState.xcuserstate and b/xcode/elogd.xcodeproj/project.xcworkspace/xcuserdata/dmilicic.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/xcode/elogd.xcodeproj/xcuserdata/dmilicic.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/xcode/elogd.xcodeproj/xcuserdata/dmilicic.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index ce79d89b..dbe869a9 100644 --- a/xcode/elogd.xcodeproj/xcuserdata/dmilicic.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/xcode/elogd.xcodeproj/xcuserdata/dmilicic.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -19,38 +19,6 @@ landmarkType = "7"> - - - - - - - - + + + +