Added way to lookup R7 Program IDs
authorKristian Kraemmer Nielsen <jkkn@jkkn.dk>
Sat, 3 Apr 2010 03:58:18 +0000 (05:58 +0200)
committerKristian Kraemmer Nielsen <jkkn@jkkn.dk>
Sat, 3 Apr 2010 03:58:18 +0000 (05:58 +0200)
At the same time less used actions were placed into a drop
down selection box with their own access keys.

content/quickbox.js
content/quickbox.xul
content/tv2developer.js
locale/da-DK/tv2developer.dtd
locale/da-DK/tv2developer.properties
locale/en-US/tv2developer.dtd
locale/en-US/tv2developer.properties
version
webroot/index.html
webroot/whatsnew.xhtml

index 2d8036f47ebdc71ec07c8b51a3825bbe0007d11c..1a360d956b1a5b2b6d6f872f25dc5de6369c323d 100644 (file)
@@ -91,9 +91,29 @@ var TV2DeveloperQuickBox = {
         }
     },
     
+    /* Updates action selection (handles drop down if needed) */
+    _setCurAction: function(action) {
+               if (action.tagName != 'menuitem') {
+                       document.getElementById('action').selectedItem = action;
+               } else {
+                       document.getElementById('action').selectedItem =
+                               document.getElementById('go-other');
+                       document.getElementById('action-other').selectedItem = action;
+               }
+    },
+    
+    /* Returns selected action (hanlding drop down of actions) */
+    _getCurAction: function() {
+               var action = document.getElementById('action').selectedItem;
+               if (action.id == 'go-other') {
+                       action = document.getElementById('action-other').selectedItem;
+               }
+               return action;
+    },
+    
     /* Change action manually */
     setManuel: function(target, doReturnFocus) {
-         if (typeof doReturnFocus == 'undefined') doReturnFocus = true;
+       if (typeof doReturnFocus == 'undefined') doReturnFocus = true;
         var action = document.getElementById('action').selectedItem.id;
         var makeSiteURL = this._shouldMakeURL(action);
         var environment = document.getElementById('environment').selectedItem;
@@ -110,6 +130,11 @@ var TV2DeveloperQuickBox = {
             document.getElementById('php4branch').disabled = (action != 'go-gitweb');
             document.getElementById('viewcontent').disabled = (action != 'go-gitweb');
             document.getElementById('environment').disabled = (action == 'go-gitweb' || action == 'go-bugzilla');
+            document.getElementById('action-other').disabled = (action != 'go-other');
+            if (action == 'go-other' && !this._autoChange) {
+                               document.getElementById('action-other').focus();
+                               doReturnFocus = false;
+            }
         }
         document.getElementById('php4site').disabled = (!makeSiteURL || action == 'go-pdolog' || action == 'go-gitweb')
                                                       || (environment && environment.id == 'live');
@@ -274,7 +299,7 @@ var TV2DeveloperQuickBox = {
                 // read options
                 env = document.getElementById('environment').selectedItem.id;
                 sitetype = document.getElementById('sitetype').selectedItem.id;
-                action = document.getElementById('action').selectedItem.id;
+                action = this._getCurAction().id;
                 php4 = document.getElementById('php4site').checked;
                 if (env == 'othertest') {
                     env = 'test';
@@ -285,12 +310,13 @@ var TV2DeveloperQuickBox = {
                 }
             } else {
                 // determind action
-                var cur_action = document.getElementById('action').selectedItem;
+                var cur_action = this._getCurAction();
                 // lock action and environment for these actions
                 switch (cur_action.id) {
                     case 'go-content-id':
                     case 'go-userid':
                     case 'go-username':
+                    case 'go-r7program':
                     case 'go-bugzilla':
                     case 'go-registry':
                         auto_action = cur_action.id;
@@ -336,7 +362,7 @@ var TV2DeveloperQuickBox = {
                                branch = auto_branch;
                                document.getElementById('subdomain').value=branch;
                 document.getElementById('sitetype').selectedItem=document.getElementById(sitetype);
-                document.getElementById('action').selectedItem=document.getElementById(action);
+                this._setCurAction(document.getElementById(action));
                 document.getElementById('php4site').checked = php4;
                 this._autoChange = false;
             }
@@ -356,6 +382,7 @@ var TV2DeveloperQuickBox = {
             case 'go-content-id':
             case 'go-ttv-page':
             case 'go-userid':
+            case 'go-r7program':
             case 'go-bugzilla':
                 // find longest id in entered url
                 var max_len = 0;
@@ -421,6 +448,10 @@ var TV2DeveloperQuickBox = {
                 // Just assume a username was entered
                 uri = '/opslag.php?username=' + escape(shorturl);
                 break;
+            case 'go-r7program':
+                               // Lookup R7 using longest id entered
+                               uri = '/tool/r7/?1=' + longest_id;
+                               break;
             case 'go-bugzilla':
                 // Use longest_id as bugzilla number
                 uri = '/show_bug.cgi?format=multiple&id=' + longest_id;
@@ -744,7 +775,7 @@ var TV2DeveloperQuickBox = {
         }
         
         this._autoChange = true;
-        document.getElementById('action').selectedItem = document.getElementById(action);
+        this._setCurAction(document.getElementById(action));
         document.getElementById('shorturl').value = url;
         this._autoChange = false;
 
index 5c7806076cac5632391998dc662262968500e02d..b6435ce0c177f620863b2f244e406d0aa0793edb 100644 (file)
           <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-userid" label="&quickbox.userid;" accesskey="&quickbox.userid.accesskey;"/>
-          <radio id="go-username" label="&quickbox.username;" accesskey="&quickbox.username.accesskey;"/>
           <radio id="go-bugzilla" label="&quickbox.bugzilla;" accesskey="&quickbox.bugzilla.accesskey;"/>
           <radio id="go-registry" label="&quickbox.registry;" accesskey="&quickbox.registry.accesskey;"/>
+          <radio id="go-other" label="&quickbox.other;" accesskey="&quickbox.other.accesskey;"/>
+          <menulist id="action-other" disabled="true">
+            <menupopup>
+             <menuitem id="go-userid" label="&quickbox.userid;" accesskey="&quickbox.userid.accesskey;"/>
+             <menuitem id="go-username" label="&quickbox.username;" accesskey="&quickbox.username.accesskey;"/>
+             <menuitem id="go-r7program" label="&quickbox.r7program;" accesskey="&quickbox.r7program.accesskey;"/>
+            </menupopup>
+          </menulist>
       </groupbox>
      </hbox>
     </radiogroup>
index bb5db129d8fb5f836694005162109d986a286794..289db7169095a5f57915ff108a7deaf28098f2a6 100644 (file)
@@ -5,6 +5,7 @@
 // Keyboard shortcuts
 // . = Prompttest
 // 2 = Back from i2
+// 7 = Lookup R7 video clip
 // A = Template
 // B = Robot
 // C = Gitweb
@@ -205,6 +206,7 @@ var TV2Developer = {
     _reg_php: /^(.*\.php)/,
     _reg_nodeid: /([0-9]{2,})/g,
     _reg_i2files: /\/([0-9]+)-/,
+    _reg_r7program: /-([0-9]+)\//,
     _reg_fromgitweb: /^https?:\/\/flimmer\.tv2\.dk\/git\/\?p=([^/]+)\.tv2\.dk\.git.*(?:f=(webroot|robot|opdatering|template)([^;&]*))/,
     _reg_fromi2if: /^\/(tango\/(entry|requeue|dynamic)|tool\/pdo_log\/frameset)\.php.*?(\?|&)url=([^&]+)/,
     _reg_cutdomain: /^(.*)\.tv2\.dk$/,
@@ -478,6 +480,20 @@ var TV2Developer = {
                 }
             }
             
+                       // Sputnik R7 program links
+            if (tv2_sitename == 'sputnik') {
+                var programId = this._reg_r7program.exec(tv2_uriOnly);
+                if (programId) {
+                                       skip_treenodes = true;
+                    links.push(new this.TV2LinkSplit());
+                    links.push(new this.TV2LinkWithLabel('r7program', TV2Util.getStr('lookupR7Program') + ' ' + programId[1],
+                        i2link + 
+                            '/tool/r7/?1='+programId[1],
+                            TV2Util.getStr('lookupR7Program.accesskey')
+                            ));
+                }
+            }
+            
             // Try to extract node id and add links to the node tool
             if (!skip_treenodes) {
                 var i2node = i2link + '/tool/node/?id=';
index 0b5def5ec0e7123cb1c61bfc3fd4d598a8a6b068..9a69cdee7ed3d1acf1c59943bcff5eb7670d09c6 100644 (file)
 <!ENTITY quickbox.ttvpage "Slå op som TTV side i I2">
 <!ENTITY quickbox.ttvpage.accesskey "v">
 
-<!ENTITY quickbox.username "Slå op som Brugernavn">
-<!ENTITY quickbox.username.accesskey "f">
-
-<!ENTITY quickbox.userid "Slå op som Bruger ID">
-<!ENTITY quickbox.userid.accesskey "j">
-
 <!ENTITY quickbox.bugzilla "Slå op i Bugzilla">
 <!ENTITY quickbox.bugzilla.accesskey "z">
 
 <!ENTITY quickbox.registry "Slå op som Registry namespace">
 <!ENTITY quickbox.registry.accesskey "1">
 
+<!ENTITY quickbox.other "Flere muligheder:">
+<!ENTITY quickbox.other.accesskey "f">
+
+<!-- free key: j -->
+
+<!ENTITY quickbox.username "Slå op som Brugernavn">
+<!ENTITY quickbox.username.accesskey "b">
+
+<!ENTITY quickbox.userid "Slå op som Bruger ID">
+<!ENTITY quickbox.userid.accesskey "i">
+
+<!ENTITY quickbox.r7program "Slå op som R7 Program">
+<!ENTITY quickbox.r7program.accesskey "r">
+
 <!ENTITY quickbox.openin "Åbn i">
 <!ENTITY quickbox.openin.current "nuværende vindue">
 <!ENTITY quickbox.openin.current.accesskey "m">
index 5d658b847e4653bcab8b3b1f89b239456cb3d771..f670a6e627eb97696051bf002dd924eabc0b5dae 100644 (file)
@@ -23,6 +23,9 @@ lookupContent=Åbn I2 content ID
 lookupContent.type=type
 lookupContent.accesskey=k
 
+lookupR7Program=Åbn R7 Program ID
+lookupR7Program.accesskey=7
+
 lookupTreeNode=Åbn I2 node med ID
 lookupTreeNode.accesskey=n
 notTV2Site=Ikke på et tv2.dk site
index eee7d62b83c28c440cbfaaf039acbf5194e8136e..748a9bde9c7d41a2a129d28b206e32e6de3fb212 100644 (file)
 <!ENTITY quickbox.ttvpage "Lookup as TTV Page">
 <!ENTITY quickbox.ttvpage.accesskey "v">
 
-<!ENTITY quickbox.username "Lookup as Username">
-<!ENTITY quickbox.username.accesskey "f">
-
-<!ENTITY quickbox.userid "Lookup as User ID">
-<!ENTITY quickbox.userid.accesskey "j">
-
 <!ENTITY quickbox.bugzilla "Lookup as Bugzilla ID">
 <!ENTITY quickbox.bugzilla.accesskey "z">
 
 <!ENTITY quickbox.registry "Lookup as Registry namespace">
 <!ENTITY quickbox.registry.accesskey "1">
 
+<!ENTITY quickbox.other "Other action:">
+<!ENTITY quickbox.other.accesskey "f">
+
+<!-- free key: j -->
+
+<!ENTITY quickbox.username "Lookup as Username">
+<!ENTITY quickbox.username.accesskey "u">
+
+<!ENTITY quickbox.userid "Lookup as User ID">
+<!ENTITY quickbox.userid.accesskey "i">
+
+<!ENTITY quickbox.r7program "Lookup as R7 Program">
+<!ENTITY quickbox.r7program.accesskey "r">
+
 <!ENTITY quickbox.openin "Open in">
 <!ENTITY quickbox.openin.current "current window">
 <!ENTITY quickbox.openin.current.accesskey "k">
index d7ba40520f0446c81fcbee2fcce01e6610c0ddce..17ab78ff612440bc38a75bc8223aa119a0e7fcf1 100644 (file)
@@ -23,6 +23,9 @@ lookupContent=Lookup content ID
 lookupContent.type=type
 lookupContent.accesskey=k
 
+lookupR7Program=Lookup R7 Program ID
+lookupR7Program.accesskey=7
+
 lookupTreeNode=Lookup tree node with ID
 lookupTreeNode.accesskey=n
 notTV2Site=Not a tv2.dk site
diff --git a/version b/version
index 5daaa7ba8837e91e7b27c4b2ac7dc5eafee6d08e..058051861079d18facf2f17de12bdc8fe1b37a54 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.13.7
+0.13.8
\ No newline at end of file
index e9d2634af400e10df044ac274e6e214f8d3a1b08..26e046aeea2a5454b8b14719452e219a8b6af531 100644 (file)
                 <li>Returnér til tilhørende url fra følgende interfaces:<br/>
                 PDO_Log, Tango Query, Tango Requeue og Dynamic Version.</li>
             </ul>
+            <h3>Feature liste på sputnik:</h3>
+            <ul>
+                <li>R7_Program Id'er genkendes og det tilbydes at slå disse op i I2.</li>
+            </ul>
             <h3>Generelle links</h3>
             <ul>
                 <li>tv2.dk (hvis ikke allerede på en tv2.dk side).</li>
                 <li>Genkender URL angivet som parameter i fleste i2-interfaces</li>
                 <li>Ved GitWeb 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>
+                <li>Slå R7 programmer op i I2 via deres R7 Program id</li>
                 <li>Slå Bugzilla opgave op</li>
                 <li>Slå et I2 Regsitry namespace op i node-værktøjet</li>
                                <li>Eksempler på GIT opslags tricks:</li>
index 3accb0f0dcde42388958668e76d358093d52150d..87599ae430f4c9cbf32486e49bdb143ca820e2e9 100644 (file)
@@ -6,6 +6,10 @@
     </head>
     <body>
         <h1>What's new:</h1>
+        <li>0.13.8</li>
+        <ul>
+            <li>Genkender nu R7 id'er på Sputnik og kan slå disse op.</li>
+        </ul>
         <li>0.13.6</li>
         <ul>
             <li>Tilføjede support for branches/subdomains, e.x. vmhf2010.query.php5.stage.tv2.dk</li>