Changeset 209 in t29-www for en


Ignore:
Timestamp:
Oct 24, 2010, 10:10:33 PM (9 years ago)
Author:
sven
Message:

Minor translation system improvements:

  • New top notices to be shown when user comes on page, not while topbox is positioned fixed
  • Contributors/Credits in Sidebar, included pagewise via SSI, univac9200.shtm as testing page (imaginary contributors! :-) )
  • introduced jQuery event namespace "t29tr" for easy global signal unbinding.
Location:
en
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • en/computer/univac9200.shtm

    r203 r209  
    1010   --><!--#set var="next"         value="univac9400.shtm"
    1111   --><!--#set var="next_title"   value="UNIVAC 9400 mainframe computer, data center"
     12   --><!--#set var="credits"      value="B. Obama / Washington&nbsp;D.C.<li>M. Moore / Great Britain<li>N. Furthermore / Nevada"
    1213 --><title>technikum29 - <!--#echo var="title" --></title>
    1314
  • en/dev/translation/editor.css

    r208 r209  
    181181#tr-topbox .buttons .row  { display: table-row; }
    182182
    183 #tr-topbox .left {
     183#tr-topbox .startup {
    184184        padding: 15px;
    185         float: left;
    186         display: none;
    187 }
    188 
    189 #tr-topbox .left  h3 {
     185        display: none; /* activated via t29.tr.display_startup_notice */
     186}
     187
     188#tr-topbox.fixed .startup {
     189        /* Hide when user is scrolling */
     190        display: none !important;
     191}
     192
     193#tr-topbox .startup h3 {
    190194        margin: 0;
    191195        color:white;
     
    196200}
    197201
    198 #tr-topbox .left p {
     202#tr-topbox .startup p {
    199203        color: #666;
    200204        margin: .3em 0;
  • en/dev/translation/editor.js

    r208 r209  
    6666// usage: <input value="my default value bla" class="defaultvalue"/>
    6767t29.tr.defaultvalue = function(){
    68         $("input.defaultvalue").live('focus', function(){
     68        $("input.defaultvalue").live('focus.t29tr', function(){
    6969                if(!(dv=(t=$(this)).data('dv'))) t.data('dv', t.val());
    7070                if(t.val()==dv) t.val('');
    71         }).live('blur', function(){
     71        }).live('blur.t29tr', function(){
    7272                if((dv=((t=$(this)).data('dv'))) && /^\s*$/.test(t.val())) t.val(dv);
    7373        });
     
    127127                $(".tr-inspecting").removeClass("tr-inspecting");
    128128                t29.tr.mouseout_editables(); // falls noch was uebrig ist
     129               
     130                // remove *ALL* handlers anywhere (new namespace .t29tr)
     131                $("*").unbind(".t29tr");
    129132        }
    130133        return true; // success
     
    149152                $("#content").before(t29.tr.msg.create_ui_topbox);
    150153                $.each(["infobox", "editorbox", "topbox"], function(){ t29.tr[this] = $("#tr-"+this); });
     154                t29.tr.infobox.hide();
     155                t29.tr.editorbox.hide(); // default state
    151156               
    152157                // make topbox being fixed at top scrolling
    153158                var top = t29.tr.topbox.offset().top; // - parseFloat($('#comment').css('marginTop').replace(/auto/, 0))
    154                 $(window).scroll(function(e) {
     159                $(window).bind("scroll.t29tr", function(e) {
    155160                        var now_fixed = $(this).scrollTop() >= top;
    156161                        // since topbox was embedded in content (not sidebar), place is
     
    231236        }).show();
    232237       
    233         $(document).bind("mousemove", t29.tr.mouseover_editables_positioner);
     238        $(document).bind("mousemove.t29tr", t29.tr.mouseover_editables_positioner);
    234239};
    235240
     
    258263                t29.tr.current_editable = null;
    259264                t29.tr.infobox.hide().removeClass(); // remove all classes
    260                 $(document).unbind("mousemove", t29.tr.mouseover_editables_positioner);
     265                $(document).unbind("mousemove.t29tr", t29.tr.mouseover_editables_positioner);
    261266        }
    262267};
     
    459464
    460465
    461 t29.tr.display_top_notice = function() {
    462         //$("<div id='tr-topnotice'/>").html(t29.tr.settings.top_notice_text).prependTo("#content");
    463         alert("No one needs this method any more!");
     466t29.tr.display_startup_notice = function(msg) {
     467        // display a short text in the startup-thingy
     468        t29.tr.topbox.find('.startup').html( t29.tr.msg["startup_topbox_"+msg] ).show();
    464469};
    465470
  • en/dev/translation/messages.xml

    r208 r209  
    4444        </section>
    4545       
     46        <section id="startup_topbox_querystring">
     47                <!-- bnla -->
     48                <h3>Thank you for improving this page</h3>
     49                <p>Simply hover the text with your mouse and edit a paragraph by clicking on it.</p>
     50        </section>
     51       
     52        <section id="startup_topbox_editdomain">
     53                <!-- started via domain -->
     54                <h3>Welcome to the technikum29 translation website</h3>
     55                <p>You can fully edit this page and visit it afterwards, with all changes made.</p>
     56        </section>
     57       
    4658        <section id="create_ui_topbox">
    4759        <div class="external-content tr-enabled"><!-- to be placed before #content -->
    4860                <div id="tr-topbox">
    49                         <div class="left">
    50                                 <h3>Thank you for improving this page</h3>
    51                                 <p>Simply hover the text with your mouse and edit a paragraph by clicking on it.</p>
     61                        <div class="startup">
     62                                <!-- usually hidden startup message, to be activated via -->
    5263                        </div>
    5364                        <div class="buttons"><div class="row">
  • en/inc/menu.inc.shtm

    r205 r209  
    8686                        title="Edit sentences directly inline!">Improve this page</a>
    8787        </div>
     88        <!--#if expr="($credits)" -->
     89        <div class="credits tr-disabled">
     90                <h3>Contributors</h3>
     91                <p>These people already gave something back to the museum. Join them
     92                   and point out mistakes!</p>
     93
     94                <ul>
     95                   <li><!--#echo encoding="none" var="credits" -->
     96                </ul>
     97        </div>
     98        <!--#endif -->
    8899  </div><!--sidebar-tr-->
    89100</div><!-- id=sidebar -->
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License