Some correction for previous patch by DAVP: 1) Fixed so content-id, userid and userna...
authorKristian Kræmmer Nielsen <jkkn@jkkn.dk>
Mon, 25 Aug 2008 16:30:50 +0000 (18:30 +0200)
committerKristian Kræmmer Nielsen <jkkn@jkkn.dk>
Mon, 25 Aug 2008 16:30:50 +0000 (18:30 +0200)
content/about.xul
content/quickbox.js
content/quickbox.xul
locale/da-DK/tv2developer.dtd
locale/da-DK/tv2developer.properties
locale/en-US/tv2developer.dtd
locale/en-US/tv2developer.properties
version
webroot/index.html

index f9ac958dc4f6c6d9489d5e0cc5e4af27354b5b01..c173dc08d0a0cb117d41f4f925f0cb87a19a8102 100644 (file)
@@ -21,6 +21,7 @@
   <separator class="thin"/>
   <text value="&patchesBy;" style="font-weight: bold;"/>
   <text value="Adrian Bak &lt;adba@tv2.dk&gt;"/>
+  <text value="David Reuss &lt;davp@tv2.dk&gt;"/>
   <separator class="thin"/>
     <text value="&homePage;" style="font-weight: bold;"/>
     <text value="http://jkkn.dk/tv2developer/"
index 3964bdd8ed4b859cc1e9ad7bed5574084ef3d119..708eeb9e98efc9fd645507f8ab3f326c1090f58b 100644 (file)
@@ -242,18 +242,27 @@ var TV2DeveloperQuickBox = {
             } else {
                 // determind action
                 var cur_action = document.getElementById('action').selectedItem;
-                if (this._reg_ttv.exec(site)) {
-                    auto_action = 'go-ttv-page';
-                } else if (this._reg_nodeid.exec(site)) {
-                    auto_action = 'go-node';
-                } else if (this._reg_classname.exec(shorturl)) {
-                    auto_action = 'go-viewcvs';
-                } else {
-                    // if we are using the user input as an url we keep an eventually already selected action
-                    if (!this._shouldMakeURL(cur_action.id)) {
-                        auto_action = 'go-site';
-                    } else {
+                // lock action and environment for these actions
+                switch (cur_action.id) {
+                    case 'go-content-id':
+                    case 'go-userid':
+                    case 'go-username':
                         auto_action = cur_action.id;
+                        break;
+                    default:
+                    if (this._reg_ttv.exec(site)) {
+                        auto_action = 'go-ttv-page';
+                    } else if (this._reg_nodeid.exec(site)) {
+                        auto_action = 'go-node';
+                    } else if (this._reg_classname.exec(shorturl)) {
+                        auto_action = 'go-viewcvs';
+                    } else {
+                        // if we are using the user input as an url we keep an eventually already selected action
+                        if (!this._shouldMakeURL(cur_action.id)) {
+                            auto_action = 'go-site';
+                        } else {
+                            auto_action = cur_action.id;
+                        }
                     }
                 }
                 // set options
@@ -290,12 +299,14 @@ var TV2DeveloperQuickBox = {
 
             // Handle actions - part one set host
             var longest_id = null;
-            var action_uses_i2_opdatering = false;
+            var action_uses_opdatering = false;
             var action_on_url_encoded;
+            var go_username;
             switch (action) {
             case 'go-node':
             case 'go-content-id':
             case 'go-ttv-page':
+            case 'go-userid':
                 // find longest id in entered url
                 var max_len = 0;
                 var cur_id;
@@ -309,7 +320,8 @@ var TV2DeveloperQuickBox = {
                     validState = false;
                     longest_id = '?';
                 }
-                action_uses_i2_opdatering = true;
+                action_uses_opdatering = true;
+                site = (action == 'go-userid' ? 'login' : 'i2');
                 break;
             case 'go-pdolog':
                 php4 = false; // not allowed
@@ -317,28 +329,31 @@ var TV2DeveloperQuickBox = {
             case 'go-tango-requeue':
             case 'go-dynamic':
                 action_on_url_encoded = encodeURIComponent(this._makeUrl(protocol, env, sitetype, php4, username, site, uri, true));
-                action_uses_i2_opdatering = true;
+                action_uses_opdatering = true;
+                site = 'i2';
                 break;
             case 'go-viewcvs':
                 break;
+            case 'go-username':
+                action_uses_opdatering = true;
+                go_username = site;
+                site = 'login';
+                break;
             }
-            if (action_uses_i2_opdatering) {
+            if (action_uses_opdatering) {
                 protocol='http';
-                site = 'i2';
                 sitetype = 'opdatering';
                 php4 = false;
-            }                
+            }
             // Handle actions - part two set uri
             switch (action) {
-            case 'go-user-id':
+            case 'go-userid':
                 // Use longest_id as the userid
-                site = 'login';
-                uri = 'opslag.php?user_id=' + longest_id;
+                uri = '/opslag.php?user_id=' + longest_id;
                 break;
-            case 'go-user-name':
-                site = 'login';
+            case 'go-username':
                 // Just assume a username was entered
-                uri = 'opslag.php?username=' + shorturl;
+                uri = '/opslag.php?username=' + go_username;
                 break;
             case 'go-node':
                 uri = '/tool/node/?id=' + longest_id;
@@ -464,7 +479,8 @@ var TV2DeveloperQuickBox = {
     _reg_fromviewcvs: /^http:\/\/viewcvs\.tv2.dk:7467\/cgi-bin\/viewvc\.cgi\/(([^/.]+)(?:\.tv2\.dk)?(?:\/(?:(webroot|robot|opdatering|template\/))|(\/[^#?/]*))([^#?]*)(.*)?)?/,
     _reg_viewcvsbranch: /^\?(?:.*&)?pathrev=PHP5(?:&|#|$)/,
     _reg_viewcvsviewsource: /^\?(?:.*&)?view=markup(?:&|#|$)/,
-    _reg_fromi2if: /^http:\/\/i2\.(?:[^.]+\.)?opdatering\.(?:(?:test|snapshot)\.)?tv2\.dk\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(\?|&)url=([^&]+)/,
+    _reg_fromi2if: /^http:\/\/i2\.(?:[^.]+\.)?opdatering\.(?:(?:test|snapshot)\.)?tv2\.dk\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(?:\?|&)url=([^&]+)/,
+    _reg_fromloginif: /^http:\/\/login\.(?:([^.]+)\.)?opdatering\.(?:(test|snapshot)\.)?tv2\.dk\/opslag\.php.*?(?:\?|&)(user_id|username)=([^&]+)/,
     _extractURL: function(url) {
         var action = 'go-site';
         
@@ -485,8 +501,38 @@ var TV2DeveloperQuickBox = {
                 action = 'go-pdolog';
                 break;
             }
-            url = decodeURIComponent(tangoif[4]);
+            url = decodeURIComponent(tangoif[3]);
+        }
+        
+        /* Extract from login interface */
+        var loginif = this._reg_fromloginif.exec(url);
+        if (loginif) {
+            switch (loginif[3]) {
+                case 'user_id':
+                action = 'go-userid';
+                break;
+                case 'username':
+                action = 'go-username';
+                break;
+            }
+            url = loginif[4]; /* username or user_id */
+            /* extract environment */
+            if (loginif[2]) {
+                var env = loginif[2];
+                if (env == 'test') {
+                    var current_user = TV2Util.getPref('developer-initials');
+                    if (loginif[1] != current_user) {
+                        url += '.' + loginif[1] + '.t'; // othertest
+                    } else {
+                        url += '.t';  // test
+                    }
+                } else {
+                    url += '.s'; // snapshot
+                }
+                document.getElementById('environment').selectedItem = document.getElementById(env);
+            }
         }
+        
         /* Extract link from ViewCVS site */
         var fromviewcvs = this._reg_fromviewcvs.exec(url);
         if (fromviewcvs) {
@@ -537,9 +583,13 @@ var TV2DeveloperQuickBox = {
     
     /* onload */
     setupQuickbox: function() {
+        // extract parameters
         if (window.arguments && window.arguments[0]) {
             this._extractURL(window.arguments[0]);
         }
+        // init saved fields
+        document.getElementById('testname').value = TV2Util.getPref('alternativ-initials', '');
+        // init box
         this.updateQuickbox();
         document.getElementById('php4site').addEventListener('CheckboxStateChange',
             function() { TV2DeveloperQuickBox.setManuel(this); }, false);
@@ -547,8 +597,6 @@ var TV2DeveloperQuickBox = {
             function() { TV2DeveloperQuickBox.setManuel(this); }, false);
         document.getElementById('viewsource').addEventListener('CheckboxStateChange',
             function() { TV2DeveloperQuickBox.setManuel(this); }, false);
-        // init saved fields
-        document.getElementById('testname').value = TV2Util.getPref('alternativ-initials', '');
         // auto go (ALT+4)
         if (window.arguments && window.arguments[1]) {
             this.goQuickbox();
index e243983d294ae9e8b6d54f9bea503066134cf96f..8e05e50475c0c5e0fa9a1c6387d1a7472ef029e0 100644 (file)
@@ -27,7 +27,7 @@
        <groupbox flex="2">
         <caption label="&quickbox.sitetype;" />
         <radiogroup id="sitetype" onselect="TV2DeveloperQuickBox.setManuel(this)">
-          <radio id="webroot"    label="webroot"    accesskey="w"/>
+          <radio id="webroot"    label="webroot"    accesskey="w" selected="true"/>
           <radio id="opdatering" label="opdatering" accesskey="o"/>
           <radio id="robot"      label="robot"      accesskey="r"/>
           <radio id="template"   label="template"   accesskey="e"/>
@@ -36,7 +36,7 @@
       <groupbox flex="1">
         <caption label="&quickbox.environment;"/>
         <radiogroup id="environment" onselect="TV2DeveloperQuickBox.setManuel(this)">
-          <radio id="live"      label="Live site"       accesskey="l"/>
+          <radio id="live"      label="Live site"       accesskey="l" selected="true"/>
           <radio id="test"      label="Test site"       accesskey="t"/>
           <radio id="snapshot"  label="Snapshot site"   accesskey="s"/>
           <hbox>
@@ -78,8 +78,8 @@
           <radio id="go-node" label="&quickbox.nodeid;" accesskey="&quickbox.nodeid.accesskey;"/>
           <radio id="go-content-id" label="&quickbox.contentid;" accesskey="&quickbox.contentid.accesskey;"/>
           <radio id="go-ttv-page" label="&quickbox.ttvpage;" accesskey="&quickbox.ttvpage.accesskey;"/>
-          <radio id="go-user-id" label="&quickbox.userid;" accesskey="&quickbox.userid.accesskey;"/>
-          <radio id="go-user-name" label="&quickbox.username;" accesskey="&quickbox.username.accesskey;"/>
+          <radio id="go-userid" label="&quickbox.userid;" accesskey="&quickbox.userid.accesskey;"/>
+          <radio id="go-username" label="&quickbox.username;" accesskey="&quickbox.username.accesskey;"/>
       </groupbox>
      </hbox>
     </radiogroup>
index 620a852674220e389e9f367fe743d885c5f87682..1a59b2d7df1070d353e4fe4f852068bfcc858655 100644 (file)
 <!ENTITY quickbox.ttvpage.accesskey "v">
 
 <!ENTITY quickbox.username "Slå op som Brugernavn">
-<!ENTITY quickbox.username.accesskey "b">
+<!ENTITY quickbox.username.accesskey "f">
 
 <!ENTITY quickbox.userid "Slå op som Bruger ID">
-<!ENTITY quickbox.userid.accesskey "i">
+<!ENTITY quickbox.userid.accesskey "j">
 
 <!ENTITY quickbox.openin "Åbn i">
 <!ENTITY quickbox.openin.current "nuværende vindue">
index 43c674c9c78b94225be9fe3c0876a17536d749f2..a760a8a5f417c7a243b3df3d119779e664f84648 100644 (file)
@@ -19,12 +19,6 @@ performDbPdoLog.accesskey=x
 lookupTTVPage=Åbn I2 TTV side
 lookupTTVPage.accesskey=p
 
-lookupUserId=Åbn som Bruger ID
-lookupUserId.accesskey=i
-
-lookupUserName=Åbn som Brugernavn
-lookupUserName.accesskey=b
-
 lookupContent=Åbn I2 content ID
 lookupContent.type=type
 lookupContent.accesskey=k
index e9f866a299f269bc04ce1fb048ad8bcd392ff69f..97d9019ad820db07019ca483d26794d2c9ca4a71 100644 (file)
 <!ENTITY quickbox.ttvpage.accesskey "v">
 
 <!ENTITY quickbox.username "Lookup as Username">
-<!ENTITY quickbox.username.accesskey "b">
+<!ENTITY quickbox.username.accesskey "f">
 
-<!ENTITY quickbox.username "Lookup as User ID">
-<!ENTITY quickbox.username.accesskey "i">
+<!ENTITY quickbox.userid "Lookup as User ID">
+<!ENTITY quickbox.userid.accesskey "j">
 
 <!ENTITY quickbox.openin "Open in">
 <!ENTITY quickbox.openin.current "current window">
index e5be7f4cf11030cc8c8b3852b99c3a07f78925ec..b669f3bba4eeaa6458f1d6b5c6d3a4ce2433d853 100644 (file)
@@ -19,12 +19,6 @@ performDbPdoLog.accesskey=x
 lookupTTVPage=Lookup TTV page
 lookupTTVPage.accesskey=p
 
-lookupUserId=Lookup User ID
-lookupUserId.accesskey=i
-
-lookupUserId=Lookup Username
-lookupUserId.accesskey=b
-
 lookupContent=Lookup content ID
 lookupContent.type=type
 lookupContent.accesskey=k
diff --git a/version b/version
index d9df1bbc0c7befdbc28d61efc28ed3e5c08d015f..af88ba824866fdf61bd6e3c8f83203f5d93d062b 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.11.0
+0.11.1
index c9669bfe7cc446a9ad98477af0279299c6fb6aba..8fe95497d0dda9c2f515ad70f1243d2704ab7ddf 100644 (file)
@@ -96,6 +96,7 @@
                 <li>Navigér videre rundt i ViewCVS let ved hjælp af korte url'er, prøv <code>ALT+3</code> i ViewCVS</li>
                 <li>Genkender URL angivet som parameter i fleste i2-interfaces</li>
                 <li>Ved ViewCVS genkendes specielle sites så som <code>globals</code> og specielle mapper så som <code>inc</code>, brug dobbelt slash (<code>//</code>) efter projektnavn for at undgå dette.</li>
+                <li>Slå TV 2 Login brugere op pr. navn eller id</li>
             </ul>
             <div class="center">
                 <a href="https://jkkn.dk/tv2developer/tv2developer.xpi">Install now</a>