]> git.mxchange.org Git - friendica.git/commitdiff
Use tabindex to enable easy navigation in the dialog to write private mails; Recipien...
authorTobias Hößl <tobias@hoessl.eu>
Fri, 16 Mar 2012 17:45:07 +0000 (17:45 +0000)
committerTobias Hößl <tobias@hoessl.eu>
Fri, 16 Mar 2012 17:45:07 +0000 (17:45 +0000)
include/acl_selectors.php
mod/message.php
view/msg-header.tpl
view/prv_message.tpl

index 67d8cebdebde0989efb5922730625c69605a39d6..a5f5aff532fbe0487cd5c4cc2a3835c57b367381 100755 (executable)
@@ -113,11 +113,13 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
                $str_nets = implode(',',$x['networks']);
                $sql_extra .= " AND `network` IN ( $str_nets ) ";
        }
+       
+       $tabindex = (x($options, 'tabindex') ? "tabindex=\"" . $options["tabindex"] . "\"" : "");
 
        if($x['single'])
-               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"" . $x['size'] . "\" >\r\n";
+               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"" . $x['size'] . "\" $tabindex >\r\n";
        else 
-               $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"" . $x['size'] . "$\" >\r\n";
+               $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"" . $x['size'] . "$\" $tabindex >\r\n";
 
        $r = q("SELECT `id`, `name`, `url`, `network` FROM `contact` 
                WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
@@ -156,7 +158,7 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
 
 
 
-function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false) {
+function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) {
 
        $a = get_app();
 
@@ -178,12 +180,12 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
                $sql_extra .= " AND `network` IN ( 'dfrn', 'mail', 'face', 'dspr' ) ";
        }
 
-
+       $tabindex = ($tabindex > 0 ? "tabindex=\"$tabindex\"" : "");
 
        if($privmail)
-               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" >\r\n";
+               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" $tabindex >\r\n";
        else 
-               $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
+               $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" $tabindex >\r\n";
 
        $r = q("SELECT `id`, `name`, `url`, `network` FROM `contact` 
                WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
index 55e313776d6c0897f0cf2f426377c19891c1c048..0907abd77f29fd0de4f370be3f126684bb91a43a 100755 (executable)
@@ -154,7 +154,7 @@ function message_content(&$a) {
        
                $preselect = (isset($a->argv[2])?array($a->argv[2]):false);
        
-               $select = contact_select('messageto','message-to-select', $preselect, 4, true);
+               $select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10);
                $tpl = get_markup_template('prv_message.tpl');
                $o .= replace_macros($tpl,array(
                        '$header' => t('Send Private Message'),
index b5c78345a318f4b570172db08edb3d82fa1f1237..1f8650bfe3ea7146ad28e6e8f74931708dcf6763 100755 (executable)
@@ -30,8 +30,15 @@ if(plaintext != 'none') {
                setup : function(ed) {
                        ed.onInit.add(function(ed) {
                                ed.pasteAsPlainText = true;
+                               var editorId = ed.editorId;
+                               var textarea = $('#'+editorId);
+                               console.log(textarea);
+                               if (typeof(textarea.attr('tabindex')) != "undefined") {
+                                       $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
+                                       textarea.attr('tabindex', null);
+                               }
                        });
-               }
+               },
        });
 }
 
index 4b904cbcd6dc4328a4f693ce592121fecd9da691..2ce07ce6fd9ce5b0a2b53f457d3f74db04337bde 100755 (executable)
@@ -10,14 +10,14 @@ $parent
 $select
 
 <div id="prvmail-subject-label">$subject</div>
-<input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="$subjtxt" $readonly />
+<input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="$subjtxt" $readonly tabindex="11" />
 
 <div id="prvmail-message-label">$yourmessage</div>
-<textarea rows="8" cols="72" class="prvmail-text" id="prvmail-text" name="body" >$text</textarea>
+<textarea rows="8" cols="72" class="prvmail-text" id="prvmail-text" name="body" tabindex="12">$text</textarea>
 
 
 <div id="prvmail-submit-wrapper" >
-       <input type="submit" id="prvmail-submit" name="submit" value="Submit" />
+       <input type="submit" id="prvmail-submit" name="submit" value="Submit" tabindex="13" />
        <div id="prvmail-upload-wrapper" >
                <div id="prvmail-upload" class="icon border camera" title="$upload" ></div>
        </div>