be smarter again .. and encode the size of the popup in the className :)
authorx2000habouzit <x2000habouzit>
Sat, 13 Nov 2004 22:49:34 +0000 (22:49 +0000)
committerx2000habouzit <x2000habouzit>
Sat, 13 Nov 2004 22:49:34 +0000 (22:49 +0000)
<a href='....' class='popup_640x480'> ... </a> automagically makes this anchor been open as a 640x480 popup !
without toolbars and stuff, for the equivalent of target='_blank' just use class='popup'
class='popup2' is used for fiche.php (and fiche.php olny)

I plan to rename popup2 popup_f or sth like that. maybe... one day. it's cool atm

htdocs/javascript/xorg.js
templates/admin/utilisateurs.tpl
templates/docs/doc_carva.tpl
templates/profil/adresses.tpl
templates/profil/emploi.tpl
templates/profil/general.tpl
templates/profil/skill.tpl

index 241b32d..fbd8c9f 100644 (file)
@@ -37,11 +37,13 @@ function getNow() {
 }
 
 
-function popWin2(theNode) {
+function popWin(theNode,w,h) {
     window.open(theNode.href, '_blank',
-       'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=900,height=700');
+       'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h);
 }
 
+function popWin2(theNode) { popWin(theNode,900,700); }
+
 function auto_links() {
     nodes = document.getElementsByTagName('a');
     fqdn = document.URL;
@@ -55,6 +57,10 @@ function auto_links() {
        if(node.className == 'popup2') {
            node.onclick = function () { popWin2(this); return false; };
        }
+       if(matches = (/^popup_([0-9]*)x([0-9]*)$/).exec(node.className)) {
+           var w = matches[1], h = matches[2];
+           node.onclick = function () { popWin(this,w,h); return false; };
+       }
     }
 }
 
index 5500b5f..8fff56a 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: utilisateurs.tpl,v 1.19 2004-11-13 15:56:35 x2000habouzit Exp $
+        $Id: utilisateurs.tpl,v 1.20 2004-11-13 22:49:35 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -165,7 +165,7 @@ function del_fwd(fwd) {
     </tr>
     <tr class="center">
       <td>
-        <a href="{"fiche.php?user=`$mr.forlife`"|url}" class="popup2">[Voir fiche]</a>
+        <a href="{"fiche.php"|url}?user={$mr.forlife}" class="popup2">[Voir fiche]</a>
       </td>
       <td>
         <input onclick="doEditUser(); return true;" type="submit" name="u_edit" value="UPDATE" />
index 14cdd36..641c51e 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: doc_carva.tpl,v 1.12 2004-11-13 15:56:36 x2000habouzit Exp $
+        $Id: doc_carva.tpl,v 1.13 2004-11-13 22:49:35 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -44,7 +44,7 @@
 <h2>Pourquoi le nom de domaine carva.org ?</h2>
 <p>
   Dans le jargon de l'école, un 'carva' signifiait un 'X' lorsque celle-ci était 
-  située sur la montagne Ste Geneviève (<a href="{"docs/index.php#carva"|url}" class="popup2">
+  située sur la montagne Ste Geneviève (<a href="{"docs/index.php#carva"|url}" class="popup_800x480">
     voir la FAQ à ce sujet</a>). 
 </p>
 <br />
index 43a8534..2dde7cc 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: adresses.tpl,v 1.8 2004-11-13 15:56:43 x2000habouzit Exp $
+        $Id: adresses.tpl,v 1.9 2004-11-13 22:49:35 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -76,7 +76,7 @@
               transmis à l'AX
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
               transmis à l'AX
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
index 6711af7..94c92f3 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: emploi.tpl,v 1.8 2004-11-13 15:56:43 x2000habouzit Exp $
+        $Id: emploi.tpl,v 1.9 2004-11-13 22:49:35 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -49,7 +49,7 @@
               transmis à l'AX
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
               transmis à l'AX
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
               transmis à l'AX
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
       <td class="dcolg">
         <span class="titre">Curriculum vitae</span><br />
         <span class="comm">Le CV n'est <strong>jamais</strong> public.<br />
-          <a href="{"docs/faq.php"|url}#cv" class="popup2">Comment remplir mon CV ?</a></span>
+          <a href="{"docs/faq.php"|url}#cv" class="popup_800x480">Comment remplir mon CV ?</a></span>
       </td>
       <td class="dcold">
         <textarea name="cv" rows="15" cols="33">{$cv}</textarea>
index 3032ea5..37d6588 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: general.tpl,v 1.16 2004-11-13 15:56:43 x2000habouzit Exp $
+        $Id: general.tpl,v 1.17 2004-11-13 22:49:35 x2000habouzit Exp $
  ***************************************************************************}
 
 
               transmis à l'AX
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
               site public
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
               site public
             </td>
             <td class="texte">
-              <a href="{"docs/faq.php"|url}#flags" class="popup2">Quelle couleur ??</a>
+              <a href="{"docs/faq.php"|url}#flags" class="popup_800x240">Quelle couleur ??</a>
             </td>
           </tr>
         </table>
index 6b2b2e3..8f62e2b 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: skill.tpl,v 1.8 2004-11-13 15:56:43 x2000habouzit Exp $
+        $Id: skill.tpl,v 1.9 2004-11-13 22:49:35 x2000habouzit Exp $
  ***************************************************************************}
 
 
         <span class="titre">Niveau</span>
       </td>
       <td class="cold" style="width:15%">
-        <span class="lien"><a href="{"docs/faq.php"|url}#niveau_langue" class="popup2">Quel niveau ?</a></span>
+        <span class="lien"><a href="{"docs/faq.php"|url}#niveau_langue" class="popup_800x600">Quel niveau ?</a></span>
       </td>
     </tr>
     {foreach from=$langue_name item=name key=i}