Index: /en/dev/translation/editor.css =================================================================== --- /en/dev/translation/editor.css (revision 187) +++ /en/dev/translation/editor.css (revision 187) @@ -0,0 +1,393 @@ +/** + * t29.de translation system inline editor styles. + * (c) Sven Koeppel September 2010 + **/ + +span.tr-editable { display: block; } + +span.tr-editable.tr-inspecting { + background-color: #fffdd3; /* #e6ecf9; */ + outline: 1px dashed #aaa; + /*margin: -4px; padding: 4px;*//* laesst gefloatete bilder haesslich huepfen */ +} + +span.tr-corrected.tr-inspecting { + background-color: #e6f9ec; +} + +span.tr-editing { + margin: -8px; + padding: 8px; + outline: 1px inset gray; + background-color: white; + color: black; +} + +body.tr-editing { background-color: #eee; } +body.tr-editing #content { color: #555; } +body.tr-editing #content img { position: relative; } + + +#tr-info { + position: absolute; + background-color: #fffdbc; + border: 1px dashed #aaa; + border-bottom: none; + margin-top: 1px; margin-left: -1px; + padding: 8px; + font-size: 120%; +} + +#tr-info.tr-corrected { + background-color: #acdca1; +} + +#tr-info .thanks { + color: #2e8027; + font-weight: bold; + text-shadow: 1px 1px 2px white; +} + + #tr-editor { + width: 50%; /* body width - will be fixed with javascript */ + position: absolute; + background-color: white; + border: 1px inset gray; + border-bottom: 1px dashed #ccc; + margin-top: 1px; + margin-left: -1px; + padding: 8px; /* Gleicher Padding wie .tr-editing! */ +} + +#tr-editor h3 { + margin: 0; margin-top: 2px; + font-size: 110%; +} + +#tr-editor p { + margin: 0; + text-align: left; font-size: 90%; + color: #666; +} + +#tr-editor .buttons, #tr-editor .smaller { float: right; margin-left: 5px; } +#tr-editor .submit { font-size: 108%; font-weight: bold; } +#tr-editor .help, #tr-editor .cancel { + display: block; + margin-bottom: 3px; +} +#tr-editor.success { background-color: #ACDCA1; } +#tr-editor.success .buttons { visibility:hidden; } +#tr-editor .response { + font-size: 154%; + color: white; + font-weight: bold; + text-align: right; + text-shadow: 2px 2px 3px #333; + width: 90%; + position: absolute; +} + + +#sidebar-tr, #sidebar .box { + position: relative; + background: none repeat scroll 0 0 rgba(196,212,236,0.49); +} +#sidebar-tr .arrow { + border-color: transparent #acdca1 transparent transparent; + border-style: solid; + border-width: 32px 20px 32px 0; + height: 0; + left: -20px; + position: absolute; + top: 0; + width: 0; +} + +body.tr-enabled #sidebar-tr { + color: black; + background-color: #acdca1; + -moz-box-shadow: 1px 0 8px #999; +} + +body.tr-enabled .tr-disabled, body.tr-disabled .tr-enabled { display: none; } +body.tr-enabled .tr-enabled, body.tr-disabled .tr-disabled { display: block; } + +#sidebar-tr .tr-disabled h3 { margin: 0; font-size: 100%; } +#sidebar-tr .tr-disabled p { margin: 5px 0; font-size: 90%; } +#sidebar-tr .tr-disabled { color: #444;} +#sidebar-tr .tr-disabled a { opacity: .8; } + +#sidebar-tr .tr-enabled h3 { + margin: 0; + color:white; + font-size:218%; + font-weight:bold; + line-height:90%; + text-decoration:none; + text-shadow:1px 1px 2px #555555; + text-transform:uppercase; + outline: none; +} + +#sidebar-tr .tr-enabled p { + color: #333; + margin-top: 1em; + font-size: 109%; + font-weight: bold; + text-align: left; +} + +/** Link resets **/ +#sidebar-tr a:link, #sidebar-tr a:visited, +#sidebar-tr a:hover, #sidebar-tr a:active { + color: inherit; + text-decoration: none; +} + +/* + CSS3 Buttons + http://www.webdesignerwall.com/tutorials/css3-gradient-buttons/ +*/ +.button { + display: inline-block; + zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */ + *display: inline; + vertical-align: baseline; + margin: 0 2px; + outline: none; + cursor: pointer; + text-align: center; + text-decoration: none; + font: 14px/100% Arial, Helvetica, sans-serif; + padding: .5em 2em .55em; + text-shadow: 0 1px 1px rgba(0,0,0,.3); + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + border-radius: .5em; + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2); + -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2); + box-shadow: 0 1px 2px rgba(0,0,0,.2); +} +.button:hover { + text-decoration: none; +} +.button:active { + position: relative; + top: 1px; +} + +.bigrounded { + -webkit-border-radius: 2em; + -moz-border-radius: 2em; + border-radius: 2em; +} +.medium { + font-size: 12px; + padding: .4em 1.5em .42em; +} +.small { + font-size: 11px; + padding: .2em 1em .275em; +} + +/* color styles - !important nachtraeglich, wg. zu schwachen selektoren +---------------------------------------------- */ + +/* black */ +.black { + color: #d7d7d7 !important; + border: solid 1px #333 !important; + background: #333 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000)) !important; + background: -moz-linear-gradient(top, #666, #000) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000') !important; +} +.black:hover { + background: #000 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000)) !important; + background: -moz-linear-gradient(top, #444, #000) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000') !important; +} +.black:active { + color: #666 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444)) !important; + background: -moz-linear-gradient(top, #000, #444) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666') !important; +} + +/* gray */ +.gray { + color: #e9e9e9 !important; + border: solid 1px #555 !important; + background: #6e6e6e !important; + background: -webkit-gradient(linear, left top, left bottom, from(#888), to(#575757)) !important; + background: -moz-linear-gradient(top, #888, #575757) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757') !important; +} +.gray:hover { + background: #616161 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#757575), to(#4b4b4b)) !important; + background: -moz-linear-gradient(top, #757575, #4b4b4b) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#757575', endColorstr='#4b4b4b') !important; +} +.gray:active { + color: #afafaf !important; + background: -webkit-gradient(linear, left top, left bottom, from(#575757), to(#888)) !important; + background: -moz-linear-gradient(top, #575757, #888) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#575757', endColorstr='#888888') !important; +} + +/* white */ +.white { + color: #606060 !important; + border: solid 1px #b7b7b7 !important; + background: #fff !important; + background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed)) !important; + background: -moz-linear-gradient(top, #fff, #ededed) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed') !important; +} +.white:hover { + background: #ededed !important; + background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc)) !important; + background: -moz-linear-gradient(top, #fff, #dcdcdc) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc') !important; +} +.white:active { + color: #999 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff)) !important; + background: -moz-linear-gradient(top, #ededed, #fff) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff') !important; +} + +/* orange */ +.orange { + color: #fef4e9 !important; + border: solid 1px #da7c0c !important; + background: #f78d1d !important; + background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20)) !important; + background: -moz-linear-gradient(top, #faa51a, #f47a20) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20') !important; +} +.orange:hover { + background: #f47c20 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015)) !important; + background: -moz-linear-gradient(top, #f88e11, #f06015) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015') !important; +} +.orange:active { + color: #fcd3a5 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a)) !important; + background: -moz-linear-gradient(top, #f47a20, #faa51a) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a') !important; +} + +/* red */ +.red { + color: #faddde !important; + border: solid 1px #980c10 !important; + background: #d81b21 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#ed1c24), to(#aa1317)) !important; + background: -moz-linear-gradient(top, #ed1c24, #aa1317) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed1c24', endColorstr='#aa1317') !important; +} +.red:hover { + background: #b61318 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#c9151b), to(#a11115)) !important; + background: -moz-linear-gradient(top, #c9151b, #a11115) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9151b', endColorstr='#a11115') !important; +} +.red:active { + color: #de898c !important; + background: -webkit-gradient(linear, left top, left bottom, from(#aa1317), to(#ed1c24)) !important; + background: -moz-linear-gradient(top, #aa1317, #ed1c24) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#aa1317', endColorstr='#ed1c24') !important; +} + +/* blue */ +.blue { + color: #d9eef7 !important; + border: solid 1px #0076a3 !important; + background: #0095cd !important; + background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5)) !important; + background: -moz-linear-gradient(top, #00adee, #0078a5) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5') !important; +} +.blue:hover { + background: #007ead !important; + background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e)) !important; + background: -moz-linear-gradient(top, #0095cc, #00678e) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e') !important; +} +.blue:active { + color: #80bed6 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee)) !important; + background: -moz-linear-gradient(top, #0078a5, #00adee) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee') !important; +} + +/* rosy */ +.rosy { + color: #fae7e9 !important; + border: solid 1px #b73948 !important; + background: #da5867 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#f16c7c), to(#bf404f)) !important; + background: -moz-linear-gradient(top, #f16c7c, #bf404f) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f16c7c', endColorstr='#bf404f') !important; +} +.rosy:hover { + background: #ba4b58 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#cf5d6a), to(#a53845)) !important; + background: -moz-linear-gradient(top, #cf5d6a, #a53845) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cf5d6a', endColorstr='#a53845') !important; +} +.rosy:active { + color: #dca4ab !important; + background: -webkit-gradient(linear, left top, left bottom, from(#bf404f), to(#f16c7c)) !important; + background: -moz-linear-gradient(top, #bf404f, #f16c7c) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bf404f', endColorstr='#f16c7c') !important; +} + +/* green */ +.green { + color: #e8f0de !important; + border: solid 1px #538312 !important; + background: #64991e !important; + background: -webkit-gradient(linear, left top, left bottom, from(#7db72f), to(#4e7d0e)) !important; + background: -moz-linear-gradient(top, #7db72f, #4e7d0e) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7db72f', endColorstr='#4e7d0e') !important; +} +.green:hover { + background: #538018 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#6b9d28), to(#436b0c)) !important; + background: -moz-linear-gradient(top, #6b9d28, #436b0c) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6b9d28', endColorstr='#436b0c') !important; +} +.green:active { + color: #a9c08c !important; + background: -webkit-gradient(linear, left top, left bottom, from(#4e7d0e), to(#7db72f)) !important; + background: -moz-linear-gradient(top, #4e7d0e, #7db72f) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4e7d0e', endColorstr='#7db72f') !important; +} + +/* pink */ +.pink { + color: #feeef5 !important; + border: solid 1px #d2729e !important; + background: #f895c2 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#feb1d3), to(#f171ab)) !important; + background: -moz-linear-gradient(top, #feb1d3, #f171ab) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#feb1d3', endColorstr='#f171ab') !important; +} +.pink:hover { + background: #d57ea5 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#f4aacb), to(#e86ca4)) !important; + background: -moz-linear-gradient(top, #f4aacb, #e86ca4) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4aacb', endColorstr='#e86ca4') !important; +} +.pink:active { + color: #f3c3d9 !important; + background: -webkit-gradient(linear, left top, left bottom, from(#f171ab), to(#feb1d3)) !important; + background: -moz-linear-gradient(top, #f171ab, #feb1d3) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f171ab', endColorstr='#feb1d3') !important; +} Index: /en/dev/translation/editor.js =================================================================== --- /en/dev/translation/editor.js (revision 187) +++ /en/dev/translation/editor.js (revision 187) @@ -0,0 +1,351 @@ +/** + * technikum29.de | Translation contribution system + * + * This is a one-of-a-kind "almost wiki" interactive feedback system for user driven + * improvements directly on the page. There is almost no way to make it more easier + * for users to improve the translation. + * + * (c) GPL, Sven Koeppel, 01.09.2010 + **/ + +if(!t29) t29 = {}; // defined in tools.js +t29.tr = {}; // this namespace + +t29.tr.settings = { + disable_img_license_system: true, // when tr system enabled, disable img licenses for more cleareness + editable_elements: function(){ return $("#content").find("p, ul, blockquote, h2, h3"); }, + infobox_default: "Click to contribute a better translation", + infobox_corrected: "Thank you for your correction. Click to improve your text again.", + editorbox_heading: "Contribute a better translation" +}; + +/* SYSTEM STATE: PAGE STATE: USER STATE: + enabled = true inspecting already_edited = true => cookie + disabled = false editing never_edited = false +*/ + + +/** + * Onload handler: Some basic preparations for translation system. + * tasks: + * - Prepare sidebar box link handlers + **/ +t29.tr.onload = function(){ + if(!t29.tr.is_enabled()) $("body").addClass("tr-disabled"); // prepare + t29.tr.sidebar = $("#sidebar-tr"); + t29.tr.sidebar.find(".tr-disabled a").click(function() { + t29.tr.set_enabled(true); + return false; + }).attr('href', '#help_with_mistakes'); // href for nicer look + + t29.tr.sidebar.find(".tr-enabled .button").click(t29.tr.call("set_enabled",false)); + + // initial value + //t29.tr.set_enabled(true); +}; + +// helper: foobar.click(t29.tr.call(anything, value)); is shorthand for +// """.call(function(){ t29.tr.anything(value); }); +t29.tr.call = function(f, v){ return function(){ t29.tr[f](v);} }; +t29.tr.arrow = function() { + // update the nice arrow in the sidebar =) + t29.tr.sidebar.find(".arrow").css({ "border-bottom-width": (a=Math.floor(t29.tr.sidebar.outerHeight()/2-1)), + "border-top-width": a }); +}; + +/** + * Tells if the translation system is started up (e.g. the user started it) or not + * (which means just an ordinary page) + * @returns boolean + **/ +t29.tr.is_enabled = function() { + return t29.tr.enabled ? true : false; +}; + +/** + * The main switch to turn the translation system on or off. Turning on will always + * success (the system switches into inspection mode immediately), turning off will + * check if the user just modified a text - if yes and if the user want to continue, + * it will fail. In every case this is a clean operation. + * @param value boolean true: Turn system on, false: Turn it off + * @returns boolean if operation succeeded. + **/ +t29.tr.set_enabled = function(value) { + if(!value && t29.tr.is_really_editing() && t29.tr.stop_editing()) { + // currently enabled + user is editing + // + user interrupted process => fail, still enabled + return false; + } + + t29.tr.enabled = value; + // toggle image license system + if(t29.tr.settings.disable_img_license_system) + t29.img_license_settings.enabled = ! t29.tr.enabled; + // set infos on body + $("body").toggleClass("tr-enabled", t29.tr.enabled) + .toggleClass("tr-inspecting", t29.tr.enabled && !t29.tr.is_editing()) + .toggleClass("tr-disabled", !t29.tr.enabled); + + if(t29.tr.enabled) { + // system powered on. + t29.tr.create_ui(); + t29.tr.arrow(); // ;-) + t29.tr.editables + .hover(t29.tr.mouseover_editables, t29.tr.mouseout_editables) + .click(t29.tr.click_editables); + } else { + // system powered off + // t29.tr.set_editing(false) already called. + // so we can safely remove any handlers + t29.tr.editables.unbind(); + } + return true; // success +} // set_enabled + +/** + * Mouseover (mouseenter) handler for all editables. This will handle infobox + * styling and content and setup other handlers. + **/ +t29.tr.mouseover_editables = function() { + if(t29.tr.is_editing()) return; // disable while editing + t29.tr.current_editable = $(this).addClass('tr-inspecting'); + + // show infobox for current editable + t29.tr.infobox.html( (h=t29.tr.current_editable.hasClass("tr-corrected")) + ? t29.tr.settings.infobox_corrected : t29.tr.settings.infobox_default); + if(h) t29.tr.infobox.addClass("tr-corrected"); // tell infobox that current editable is corrected (for css) + + // position infobox for current editable + t29.tr.infobox.css({ + top: t29.tr.current_editable.offset().top - t29.tr.infobox.outerHeight(), + left: t29.tr.current_editable.offset().left + }).show(); + + $(document).bind("mousemove", t29.tr.mouseover_editables_positioner); +}; + +/** + * Mouseover helper: Another handler for mouse movements to nicely arrange the + * infobox according to the mouse cursor x position. + **/ +t29.tr.mouseover_editables_positioner = function(e) { + if(e.pageX) { // document.mousemove event + var left = e.pageX - t29.tr.infobox.outerWidth()/2; + // check boundaries + left = Math.max(left, t29.tr.current_editable.offset().left); + left = Math.min(left, t29.tr.current_editable.offset().left + t29.tr.current_editable.outerWidth() - t29.tr.infobox.outerWidth()); + t29.tr.infobox.css("left", left); + } +} + +/** + * Mouseout (mouseleave) handler: Makes a nice cleanup. Can be called multiple times, + * will detect if already cleaned up. This should be done, since it unbinds a + * nervous mousemove handler. + **/ +t29.tr.mouseout_editables = function() { + if(t29.tr.current_editable) { + t29.tr.current_editable.removeClass('tr-inspecting'); + t29.tr.current_editable = null; + t29.tr.infobox.hide().removeClass(); // remove all classes + $(document).unbind("mousemove", t29.tr.mouseover_editables_positioner); + } +}; + +/** + * Click handler for clicking editables. This will immediately start the editing + * engine if the user is not already editing another text. + **/ +t29.tr.click_editables = function() { + if(t29.tr.is_editing()) return; + t29.tr.set_editing($(this)); +}; + +/** + * Testing function to find out if user is currently editing, that is: There is an editor + * window currently open. ("The editor engine is running"). + * @returns boolean value if an editor window is open + **/ +t29.tr.is_editing = function() { + // user is editing. + return (t29.tr.editor && !jQuery.isEmptyObject(t29.tr.editor)); +}; + +/** + * Testing function to find out if user modified something in the currently opened editing, + * if avaliable. If the user doesn't currently edit at all, this returns false. + * @returns boolean User works with local modified text and will be angry if you delete it + */ +t29.tr.is_really_editing = function() { + // user is editing and has made some changes + return t29.tr.is_editing() && (t29.tr.editor.html() != t29.tr.initial_editor.html()) +}; + +/** + * This is the main switch for the editor engine. Calling this function you can safely + * start or stop editing. Starting is simple: Just tell it what to edit: + * t29.tr.set_editing($("your element")); + * Stopping is a brutal action, since this low level function does NOT check if there + * are modifications. Use stop_editing() for an interactive version. Especially, + * set_editing(false) won't fail :-) + * @param editing_target_or_false false for turning off, any jQuery object for turning on + * @returns nothing + */ +t29.tr.set_editing = function(editing_target_or_false) { + if(editing_target_or_false && t29.tr.is_editing()) { + alert("Bad state: Starting editing while editing?"); + return; // bad + } + + var old_editor = t29.tr.editor; // backup old editor for cleanup + t29.tr.editor = editing_target_or_false; + $("body").toggleClass("tr-editing", t29.tr.is_editing()); + $("body").toggleClass("tr-inspecting", t29.tr.is_enabled() && !t29.tr.is_editing()); + + if(t29.tr.is_editing()) { + // start up editing + + // setup editor + t29.tr.initial_editor = t29.tr.editor.clone(); // make a backup of the original, for the form + t29.tr.editor.attr("contenteditable", "true").addClass("tr-editing").focus(); + + // switch the boxes + t29.tr.mouseout_editables(); // rauemt vom editing auf (infobox.hide(), etc.) + t29.tr.create_editorui(); + + // ask at window unloading + window.onbeforeunload = function() { + if(t29.tr.is_really_editing()) { + return ("You have made changes on this page that you have not yet submitted." + +"If you navigate away from this page you will loose your work."); + } + }; + } else { + // stop editing + t29.tr.initial_editor = null; + old_editor.attr("contenteditable", "false").removeClass("tr-editing"); + t29.tr.editorbox.hide(); + } +}; // set_editing + +/** + * This is the interactive version of set_editing(false). If the user modified the + * document, it will ask him if he wants to quit. If no, it returns false. + * @returns boolean true if editing was stopped, false if not. + **/ +t29.tr.stop_editing = function() { + // Frontend Function to *ask* user if he wants to stop editing + if(!t29.tr.is_really_editing(true) || + confirm("Do you want to quit the currently edited paragraph and loose all changes?")) { + t29.tr.set_editing(false); + return true; + } else { + return false; + } +}; + +/** + * Button callback for Submitting in the Editor engine. This will compose the + * HTTP POST call and send it via AJAX. Especially it immediately returns. + **/ +t29.tr.submit_editing = function() { + // button submitting + if(!t29.tr.is_really_editing()) { + alert("You didn't make any changes to the text. Where's the improvement? :-)"); + return false; + } + + $.ajax({ + type: 'POST', + url: '/en/dev/translation/submit.php', + success: t29.tr.submit_successful, + error: function(req, textStatus) { + alert("I'm sorry, submitting the text failed due to "+textStatus + +"\nPlease mail your text to "+"ed.92mukinhcet@ved".split("").reverse().join("")); + }, + data: { + source: 'ajax', + page: location.href, + node: "foobar", // t29.tr.editor XQUERY PATH + initial_text: t29.tr.initial_editor.html(), + new_text: t29.tr.editor.html() + } + }); +}; + +/** + * Callback function for success AJAX submission call. This will display a short + * nice message before shutting down nicely the editor engine, leaving the user back + * to inspect just another element. + **/ +t29.tr.submit_successful = function(server_data) { + // Editorbox + t29.tr.editorbox.addClass('success').prepend("
Just start to type in the text field
" + +"This site was voluntarily translated by project collaborators. + We'ld love to get your help!
+ " + title="Edit sentences directly inline!">Improve this page +Now simply click on any paragraph to correct it. Thank you!
+ +