Le langage SMS est exclu sur les forums ProgBoards, tout message ne respectant pas la charte sera déplacé, modifié, ou supprimé par nos modérateurs.

Forum ProgBoards » Développement » Wall intégre

neamar
Modérateur
Citer Windows NT Firefox 2 - Posté le 17/02/2008 à 12:33
Deux trois petites idées en plus : pendant le chargement, changer "Afficher le code source" en "Chargement...", en utilisant la propriété .innerHTML, ce n'est pas compliqué et ca aiderait à la compréhension...(chez moi, il faut parfois trois secondes avant que le code n'arrive).
Ensuite, pourquoi utiliser une requete de type post ? C'est plus complexe à utiliser qu'une simple GEt, qui aurait suffi dans ce cas là !
Et enfin, pourquoi mettre une quarantaine de lignes vides au début du code chargé ?
Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.

http://neamar.free.fr
Ou le portail général : http://neamar.fr
RemonterCiter Linux Firefox 2 - Posté le 17/02/2008 à 12:40
Le changement de lien n'est pas vraiment compatible avec le code actuel, ça je te l'ai déjà dit. Si ça te perturbe à ce point, je peux voir ce qu'il est possible de faire.

Pour la requête POST, pourquoi changer maintenant que c'est fait? Que peut apporter un passage en GET? Restons sur l'utile stp...

Une quarantaine de lignes vides avant le code? Je ne vois pas du tout ça ici, le code démarre immédiatement. Tu as un exemple de poste et une version de navigateur à me donner?
Computaid SPRL - Conception - Développement - Infogérance : http://www.computaid.be
eTigris - Hébergement mutualisé - Serveurs dédiés : http://www.etigris.com
neamar
Modérateur
RemonterCiter Windows NT Firefox 2 - Posté le 17/02/2008 à 12:48
Pour la requête POST, pourquoi changer maintenant que c'est fait? Que peut apporter un passage en GET? Restons sur l'utile stp.. =>Je suis d'accord, maintenant que c'est fait, il n'y a pas de raisons de changer...j'aurais juste aimé savoir pourquoi tu avais choisi cette solution.

Le changement de lien n'est pas vraiment compatible avec le code actuel, ça je te l'ai déjà dit. =>
Pourquoi ne pas modifier simplement cette ligne :


<a href="javascript:wall_affiche(54);">Afficher le code source</a>
par
<a href="#" onclick="javascript:wall_affiche(54); this.innerHTML='Chargement'; return false">Afficher le code source</a>



Et en ce qui concerne les lignes vides : (ca vient de http://www.progboards.com/sujet-1544_dessin_avec_line_et_circle_sous_qb4_5.php#10217 , les lignes blanches ne sont pas affichées, mais elles sont chargées)

<div style='float:left; padding-right:10px; color:gray; font-weight:bold;'><pre>1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

16.

17.

18.

19.

20.

21.

22.

23.

24.

25.

26.

27.

28.

29.

30.

31.

32.

33.

34.

35.

36.

37.

38.

39.

40.

41.

42.

43.

44.

45.

46.

47.

48.

49.

50.

51.

52.

53.

54.

55.

56.

57.

58.

59.

60.

61.

62.

63.

64.

65.

</pre></div><div><pre class="qbasic"><span style="color: #808080;">'********************************

***********</span>

<span style="color: #808080;">'* REPRESENTATION GRAPHIQUE d'une FONCTION * DECINGRA.BAS</span>

<span style="color: #808080;">'******************************************* </span>

<a href=" http://www.qbasicnews.com/qboho/qckscreen.shtml"><span style="color: #000066;">SCREEN</span

></a> <span style="color: #cc66cc;">12</span>: <a href=" http://www.qbasicnews.com/qboho/qckwindow.shtml "

><span style="color: #000066;">WINDOW</span></a> <span style="color: #66cc66;">&#40;</span><span style

="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">480</span><span style="color: #66cc66;">&

#41;</span>-<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">640</span>, <span

style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>: <a href=" http://www.qbasicnews

.com/qboho/qckcls.shtml"><span style="color: #000066;">CLS</span></a>

<a href=" http://www.qbasicnews.com/qboho/qckon.shtml"><span style="color: #000066;">ON</span></a

> <a href=" http://www.qbasicnews.com/qboho/qckerror.shtml"><span style="color: #000066;">ERROR</span

></a> <span style="color: #a1a100;">GOTO</span> E99.ERREUR

<span style="color: #808080;">' *** Coordonnées de l'angle supérieur gauche : X = 1 et Y = 480</span

>

<span style="color: #808080;">' *** Coordonnées de l'angle inférieur droit : X = 640 et Y = 1</span

>

Dx% = <span style="color: #cc66cc;">300</span> <span style="color: #808080;">' *** valeur de l'abscisse

X de l'axe des ordonnées</span>

<span style="color: #808080;">' *** pour déplacer l'axe des ordonnées à gauche ou à droite

</span>

Dy% = <span style="color: #cc66cc;">240</span> <span style="color: #808080;">' *** valeur de l'ordonn

ée Y de l'axe des abscisses</span>

<span style="color: #808080;">' *** pour déplacer l'axe des abscisses + haut ou + bas<

/span>

<span style="color: #808080;">' *** Il est possible de positionner HORS de l'ECRAN (exclamation)

!!</span>

<span style="color: #808080;">' *** Nous pouvons tracer les axes de coordonnées</span>

<a href=" http://www.qbasicnews.com/qboho/qckline.shtml"><span style="color: #000066;">LINE</span

></a> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, Dy% - <span style

="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>-<span style="color: #66cc66;">

&#40;</span><span style="color: #cc66cc;">640</span>, Dy% + <span style="color: #cc66cc;">1</span><span

style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">1</span>, BF<span style="color:

#808080;">' *** Abscisses</span>

<a href=" http://www.qbasicnews.com/qboho/qckline.shtml"><span style="color: #000066;">LINE</span

></a> <span style="color: #66cc66;">&#40;</span>Dx% - <span style="color: #cc66cc;">1</span>, <span style

="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>-<span style="color: #66cc66;">

&#40;</span>Dx% + <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">480</span><span

style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">1</span>, BF<span style="color:

#808080;">' *** Ordonnées</span>

<span style="color: #808080;">' *** Echelles (Essaye de les modifier)</span>

Ech.X! = <span style="color: #cc66cc;">1</span> <span style="color: #808080;">' *** échelle des

abscisses (1 pixel = Ech.X! unit‚s)</span>

Ech.Y! = .<span style="color: #cc66cc;">015</span> <span style="color: #808080;">' *** échelle

des ordonnées (1 pixel = Ech.Y! unit‚s)</span>

<span style="color: #808080;">' *** Petite graduation</span>

<span style="color: #a1a100;">FOR</span> X% = Dx% <span style="color: #a1a100;">TO</span> <span style

="color: #cc66cc;">640</span> + Dx% <span style="color: #a1a100;">STEP</span> <span style="color: #cc66cc

;">100</span> / Ech.X!

<a href=" http://www.qbasicnews.com/qboho/qckline.shtml"><span style="color: #000066;">LINE</span

></a> <span style="color: #66cc66;">&#40;</span>X% - <span style="color: #cc66cc;">1</span>, Dy% - <span

style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>-<span style="color: #66cc66

;">&#40;</span>X% + <span style="color: #cc66cc;">1</span>, Dy% + <span style="color: #cc66cc;">10</span

><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">2</span>, BF

<span style="color: #a1a100;">NEXT</span> X%

<span style="color: #a1a100;">FOR</span> X% = Dx% <span style="color: #a1a100;">TO</span> -<span

style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">640</span> + Dx%<span style="color

: #66cc66;">&#41;</span> <span style="color: #a1a100;">STEP</span> -<span style="color: #cc66cc;">100

</span> / Ech.X!

<a href=" http://www.qbasicnews.com/qboho/qckline.shtml"><span style="color: #000066;">LINE</span

></a> <span style="color: #66cc66;">&#40;</span>X% - <span style="color: #cc66cc;">1</span>, Dy% - <span

style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>-<span style="color: #66cc66

;">&#40;</span>X% + <span style="color: #cc66cc;">1</span>, Dy% + <span style="color: #cc66cc;">10</span

><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">2</span>, BF

<span style="color: #a1a100;">NEXT</span> X%

&nbsp;

<span style="color: #a1a100;">FOR</span> Y% = Dy% <span style="color: #a1a100;">TO</span> <span style

="color: #cc66cc;">480</span> <span style="color: #a1a100;">STEP</span> <span style="color: #cc66cc;"

>100</span> / Ech.Y!

<a href=" http://www.qbasicnews.com/qboho/qckline.shtml"><span style="color: #000066;">LINE</span

></a> <span style="color: #66cc66;">&#40;</span>Dx% - <span style="color: #cc66cc;">10</span>, Y% -

<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>-<span style="color:

#66cc66;">&#40;</span>Dx% + <span style="color: #cc66cc;">10</span>, Y% + <span style="color: #cc66cc

;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">2</span>, BF

<span style="color: #a1a100;">NEXT</span> Y%

<span style="color: #a1a100;">FOR</span> Y% = Dy% <span style="color: #a1a100;">TO</span> -<span

style="color: #cc66cc;">480</span> <span style="color: #a1a100;">STEP</span> -<span style="color: #cc66cc

;">100</span> / Ech.Y!

<a href=" http://www.qbasicnews.com/qboho/qckline.shtml"><span style="color: #000066;">LINE</span

></a> <span style="color: #66cc66;">&#40;</span>Dx% - <span style="color: #cc66cc;">10</span>, Y% -

<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>-<span style="color:

#66cc66;">&#40;</span>Dx% + <span style="color: #cc66cc;">10</span>, Y% + <span style="color: #cc66cc

;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">2</span>, BF

<span style="color: #a1a100;">NEXT</span> Y%



<span style="color: #808080;">' *** A MODIFIER SELON LE GRAPHIQUE A ETUDIER ET DESSINER</span>



<span style="color: #808080;">' *** Fonctions SINUS, COSINUS et TANGENTE (Angle en grades) comme

exemple</span>

<span style="color: #a1a100;">FOR</span> Couleur% = <span style="color: #cc66cc;">1</span> <span

style="color: #a1a100;">TO</span> <span style="color: #cc66cc;">12</span>

<span style="color: #a1a100;">FOR</span> I% = -<span style="color: #cc66cc;">5000</span> <span

style="color: #a1a100;">TO</span> <span style="color: #cc66cc;">5000</span> <span style="color: #808080

;">' *** Il est possible de sortir de l'écran (exclamation)!</span>

Grade! = I%

Radian! = Grade! * <span style="color: #cc66cc;">3</span>.<span style="color: #cc66cc;">141593

</span> / <span style="color: #cc66cc;">200</span>

Etape% = <span style="color: #cc66cc;">1</span> <span style="color: #808080;">' *** pour

que le ON ERROR détecte les divisions par 0 éventuelles</span>

Y! = <a href=" http://www.qbasicnews.com/qboho/qcksin.shtml"><span style="color: #000066;"

>SIN</span></a><span style="color: #66cc66;">&#40;</span>Radian!<span style="color: #66cc66;">&#41;<

/span>: X.d! = Grade! / Ech.X! + Dx%

Y.d! = Y! / Ech.Y! + Dy%

<a href=" http://www.qbasicnews.com/qboho/qckpset.shtml"><span style="color: #000066;">PSET

</span></a> <span style="color: #66cc66;">&#40;</span>X.d!, Y.d!<span style="color: #66cc66;">&#41;<

/span>, Couleur% <span style="color: #808080;">' *** Trace un point</span>

<a href=" http://www.qbasicnews.com/qboho/qckcircle.shtml"><span style="color: #000066;">CIRCLE

</span></a> <span style="color: #66cc66;">&#40;</span>X.d!, Y.d!<span style="color: #66cc66;">&#41;<

/span>, <span style="color: #cc66cc;">1</span>, Couleur% <span style="color: #808080;">' *** Cercle pour

+ de visibilité</span>

Y! = <a href=" http://www.qbasicnews.com/qboho/qckcos.shtml"><span style="color: #000066;"

>COS</span></a><span style="color: #66cc66;">&#40;</span>Radian!<span style="color: #66cc66;">&#41;<

/span>: Y.d! = Y! / Ech.Y! + Dy%

<a href=" http://www.qbasicnews.com/qboho/qckpset.shtml"><span style="color: #000066;">PSET

</span></a> <span style="color: #66cc66;">&#40;</span>X.d!, Y.d!<span style="color: #66cc66;">&#41;<

/span>, Couleur% + <span style="color: #cc66cc;">1</span>

<a href=" http://www.qbasicnews.com/qboho/qckcircle.shtml"><span style="color: #000066;">CIRCLE

</span></a> <span style="color: #66cc66;">&#40;</span>X.d!, Y.d!<span style="color: #66cc66;">&#41;<

/span>, <span style="color: #cc66cc;">1</span>, Couleur% + <span style="color: #cc66cc;">1</span>

Y! = <a href=" http://www.qbasicnews.com/qboho/qcktan.shtml"><span style="color: #000066;"

>TAN</span></a><span style="color: #66cc66;">&#40;</span>Radian!<span style="color: #66cc66;">&#41;<

/span>: Y.d! = Y! / Ech.Y! + Dy%

<a href=" http://www.qbasicnews.com/qboho/qckpset.shtml"><span style="color: #000066;">PSET

</span></a> <span style="color: #66cc66;">&#40;</span>X.d!, Y.d!<span style="color: #66cc66;">&#41;<

/span>, Couleur% + <span style="color: #cc66cc;">2</span>

<a href=" http://www.qbasicnews.com/qboho/qckcircle.shtml"><span style="color: #000066;">CIRCLE

</span></a> <span style="color: #66cc66;">&#40;</span>X.d!, Y.d!<span style="color: #66cc66;">&#41;<

/span>, <span style="color: #cc66cc;">1</span>, Couleur% + <span style="color: #cc66cc;">2</span>

Etape% = <span style="color: #cc66cc;">0</span>

NAIXT: <span style="color: #a1a100;">NEXT</span> I%

<a href=" http://www.qbasicnews.com/qboho/qcksleep.shtml"><span style="color: #000066;">SLEEP</span

></a> <span style="color: #cc66cc;">2</span> <span style="color: #808080;">' *** SANS le SLEEP, c'est

trop rapide</span>

<span style="color: #a1a100;">NEXT</span> Couleur%

COLOR <span style="color: #cc66cc;">15</span>: <a href=" http://www.qbasicnews.com/qboho/qckend.shtml "

><span style="color: #000066;">END</span></a>

&nbsp;

E99.ERREUR:

<span style="color: #a1a100;">IF</span> Etape% = <span style="color: #cc66cc;">1</span> <span style

="color: #a1a100;">THEN</span> <span style="color: #808080;">' *** Erreur de calcul (comme une division

par zéro)</span>

<span style="color: #a1a100;">RESUME</span> NAIXT

<span style="color: #a1a100;">ELSE</span> <span style="color: #808080;">' *** Autres

erreurs éventuelles</span>

<a href=" http://www.qbasicnews.com/qboho/qcklocate.shtml"><span style="color: #000066;">LOCATE

</span></a> <span style="color: #cc66cc;">29</span>, <span style="color: #cc66cc;">5</span>: COLOR <span

style="color: #cc66cc;">15</span>: <a href=" http://www.qbasicnews.com/qboho/qckprint.shtml"><span style

="color: #000066;">PRINT</span></a> <span style="color: #ff0000;">"ERREUR "</span> + <a href="http:/

/www.qbasicnews.com/qboho/qckstr$.shtml"><span style="color: #000066;">STR$</span></a><span style="color

: #66cc66;">&#40;</span><a href=" http://www.qbasicnews.com/qboho/qckerr.shtml"><span style="color: #000066

;">ERR</span></a><span style="color: #66cc66;">&#41;</span>

<a href=" http://www.qbasicnews.com/qboho/qcksleep.shtml"><span style="color: #000066;">SLEEP

</span></a>: <a href=" http://www.qbasicnews.com/qboho/qckend.shtml"><span style="color: #000066;">END

</span></a>

<a href=" http://www.qbasicnews.com/qboho/qckend.shtml"><span style="color: #000066;">END</span><

/a> <span style="color: #a1a100;">IF</span>

&nbsp;</pre></div>

Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.

http://neamar.free.fr
Ou le portail général : http://neamar.fr
RemonterCiter Linux Firefox 2 - Posté le 17/02/2008 à 12:52
Je préfère tout simplement le POST au GET, mais dans notre cas ça n'a pas d'importance.

Le problème de ton changement de lien, c'est qu'une fois modifié pour afficher le code, si on le cache ensuite, on aura plus le lien pour l'afficher à nouveau. Il faut donc aller plus loin que ça, et c'est là que ça deviens incompatible avec le code actuel.

Pour les lignes vides, je ne sais pas si le forum affiche mal ton quote ou pas, il me faudrai un screenshot pour cerner le problème.
Computaid SPRL - Conception - Développement - Infogérance : http://www.computaid.be
eTigris - Hébergement mutualisé - Serveurs dédiés : http://www.etigris.com
neamar
Modérateur
RemonterCiter Windows NT Firefox 2 - Posté le 17/02/2008 à 13:06
OK, alors considérons comme résolu le problème GET/POST
Pour ce qui est du changement de lien, pourquoi ne pas donner un ID au <a , puis dans la fonction wall_affiche


if (xhr_object.status == 200)
{
var coderetour = xhr_object.responseText;
txt="<div class=codewall><a href='javascript:wall_cache("+numcodewall+")'>Cacher le code source</a><br><br>"+coderetour+"<br><br><a href='javascript:wall_cache("+numcodewall+")'>Cacher le code source</a></div>";
if (ie4){ document.all["overDivWall"+numcodewall].innerHTML=txt }else if(ns4){ eval('document.overDivWall'+numcodewall+'.document.write(txt)'); }else if(oth){ document.getElementById("overDivWall"+numcodewall).innerHTML=txt }
showObjectWall(overWall);
}


rajouter


if (xhr_object.status == 200)
{
document.getElementById('AfficherCodeSource').innerHTML="Afficher le code source"; (il fausra faire attention au fait qu'il peut y avoir plsusier Afficher le code source sur une page...
var coderetour = xhr_object.responseText;
txt="<div class=codewall><a href='javascript:wall_cache("+numcodewall+")'>Cacher le code source</a><br><br>"+coderetour+"<br><br><a href='javascript:wall_cache("+numcodewall+")'>Cacher le code source</a></div>";
if (ie4){ document.all["overDivWall"+numcodewall].innerHTML=txt }else if(ns4){ eval('document.overDivWall'+numcodewall+'.document.write(txt)'); }else if(oth){ document.getElementById("overDivWall"+numcodewall).innerHTML=txt }
showObjectWall(overWall);
}


Et pour les lignes vides, c'est moi qui me suis trompé..en fait, tu envoie d'abord les numéros de ligne, et ensuite le code source..je pensais qu'il y avait un problème, mais en fait ca doit être pour simplifier le copier coller... désolé (gêné)
Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.

http://neamar.free.fr
Ou le portail général : http://neamar.fr
RemonterCiter Linux Firefox 2 - Posté le 17/02/2008 à 13:14
Je vais vais étudier ce qu'il y a moyen de faire pour le lien, apparemment tu ne veux pas ce que je pensais, il doit du coup y avoir moyen avec l'id sur la balise a.

Pour les "lignes vides" oui, j'envoie les numéros de ligne avant pour la raison que tu as cité. Mais rassures-moi: sur ton navigateur les numéros de ligne s'affichent bien à gauche des ligne de codes, hein?
Computaid SPRL - Conception - Développement - Infogérance : http://www.computaid.be
eTigris - Hébergement mutualisé - Serveurs dédiés : http://www.etigris.com
neamar
Modérateur
RemonterCiter Windows NT Firefox 2 - Posté le 17/02/2008 à 13:16
Mais rassures-moi: sur ton navigateur les numéros de ligne s'affichent bien à gauche des ligne de codes, hein? => oui oui, pas d'inquiétude à avoir..c'est juste quand je regardais la source chargée que je me posais des questions !
Merci pour ta réaction rapide..comme d'habitude ! (meme le dimanche ! geek jusqu'au bout des doigts !)
Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.

http://neamar.free.fr
Ou le portail général : http://neamar.fr
RemonterCiter Linux Firefox 2 - Posté le 17/02/2008 à 13:20
Voilà qui est fait pour le changement du lien en "chargement..." puis retour au texte normal une fois le code chargé.

Ici l'affichage est un peu trop rapide pour que je vois ça clairement, mais ça a l'air de fonctionner.
Computaid SPRL - Conception - Développement - Infogérance : http://www.computaid.be
eTigris - Hébergement mutualisé - Serveurs dédiés : http://www.etigris.com
neamar
Modérateur
RemonterCiter Windows NT Firefox 2 - Posté le 17/02/2008 à 13:24
Effectivement, ca marche bien...merci !
Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.

http://neamar.free.fr
Ou le portail général : http://neamar.fr
neamar
Modérateur
RemonterCiter Windows NT Firefox 2 - Posté le 17/02/2008 à 22:02
Et en fait, je note l'apparition d'un "Cacher la source" en haut du code du wall...tout le monde est content !

Edité par neamar ( 17/02/2008 22:14:24 )
Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.

http://neamar.free.fr
Ou le portail général : http://neamar.fr
RemonterCiter MacOS Firefox 2 - Posté le 17/02/2008 à 22:50
Le "Cacher la source" n'est pas nouveau en fait: je l'avais ajouté la dernière fois qu'on avais parlé de remplacer le lien.
Computaid SPRL - Conception - Développement - Infogérance : http://www.computaid.be
eTigris - Hébergement mutualisé - Serveurs dédiés : http://www.etigris.com

Poster une réponse

STOP aux fautes volontaires !
Message
Formatage
Note: pour partager du code source, merci d'utiliser le wall !
Smileys (sourire) (yekyek) (clein d'oeil) (désapprouve) (triste) (cool) (langue) (confus) (gêné) (neutre) (eek) (surpris) (diable) (flèche) (exclamation) (question) (diable) (idée) (méchant)
Pseudonyme
Recopiez le code
v6 © Computaid SPRL 2005-2009 - Tous droits réservés - Hébergé par eTigris - Page générée en 0,091 s - Crédits - Stats
1 connecté