begin process at 2012 05 27 06:23:29
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Application

 > CRÉER DES PAGES WEB EN WYSIWIG DANS IE

CRÉER DES PAGES WEB EN WYSIWIG DANS IE


 Information sur la source

Note :
9,67 / 10 - par 3 personnes
9,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Application Niveau :Initié Date de création :20/01/2002 Date de mise à jour :27/01/2002 12:19:10 Vu / téléchargé :7 490 / 450

Auteur : gedeef

Ecrire un message privé
Site perso
Commentaire sur cette source (1)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Le but de cette application est de permettre la construction de pages web en quasi WYSIWYG dans IE.
Elle utilise des fichiers XML pour stocker la liste des éléments de la page (images et texte) ainsi que leurs propriétés.
Une interface permet de déplacer chacun des élements (texte ou image) simplement en les faisant glisser à l'aide de la souris et de modifier leurs propriétés grâce à une feuille de propriétés de type VB (sans avoir la prétention d'être aussi complet :)

Il y a quelques fonctionnalités à ajouter mais le code constitue déjà une bonne base.

Les fichiers générés ne s'affichent pas correctement sous Netscape. Il faudrait que je génère un code spécifique pour Netscape... Elles fonctionent sous IE (dernières versions) et sous Mozilla (testé avec un BSD).


  

Source

  • <!-- Fichier /test.asp : utilisé pour afficher la page, on y définit le nom du fichier xml à utiliser -->
  • <!--
  • Author : Emmanuel BRUNO-GAZIGNAIRE
  • Email : ___nospam___bmanu@francenet.fr
  • Web Site: http://gdf.zalem.net
  • -->
  • <!-- #include virtual="/functions/loadfromfile.asp" -->
  • <%
  • Dim XmlDataFile
  • 'Put your statements here in order to intialize you variable :
  • MyVariable = "This is an example of dynamic text included in your page"
  • 'Choose your xml file for this page
  • XmlDataFile = Server.MapPath(Application("xmlFolder") & "/test.xml")
  • %>
  • <!-- #include virtual="/functions/doReadXml.asp" -->
  • <html>
  • <head>
  • <link rel="stylesheet" type="text/css" href="/css/oop.css">
  • <style type="text/css">
  • <%= strStyle %>
  • </style>
  • <script language="javascript">
  • </script>
  • </head>
  • <body>
  • <div id="main" class="main">
  • <%= strElts %>
  • </div>
  • </body>
  • </html>
  • <!-- Fichier /xml/test.xml : contient la description des données de la page -->
  • <?xml version="1.0" ?>
  • <!DOCTYPE page SYSTEM "main.dtd"[]>
  • <page>
  • <pageItem>
  • <texte src="test1.htm" class="TexteAccueil" leftPos="11" topPos="127" width="200" height="50" zIndex="0" autreProp="" />
  • </pageItem>
  • <pageItem>
  • <image src="MSDN_banner.gif" srcClick="net_small.gif" alt="" leftPos="199" topPos="91" width="250" height="60" onclick="" zIndex="1" autreProp="" />
  • </pageItem>
  • <pageItem>
  • <variable name="MyVariable" class="TexteAccueilFB" leftPos="362" topPos="126" width="200" height="80" zIndex="2" autreProp="" />
  • </pageItem>
  • </page>
  • <-- fichier /functions/doReadXml.asp -->
  • <!--
  • Author : Emmanuel BRUNO-GAZIGNAIRE
  • Email : ___nospam___bmanu@francenet.fr
  • Web Site: http://gdf.zalem.net
  • -->
  • <%
  • 'Load and read file
  • %>
  • <!-- #include virtual="/functions/loadXmlFile.asp" -->
  • <!-- #include virtual="/functions/readPageitemXMLFile.asp" -->
  • <%
  • 'get values
  • set result = readPageItemXmlFile(pageItem)
  • strStyle = result.strStyle
  • strScript = result.strScript
  • strElts = result.strElts
  • set result = nothing
  • %>
  • <!-- fichier /functions/loadXmlFile.asp -->
  • <%
  • 'Author : Emmanuel BRUNO-GAZIGNAIRE
  • 'Email : ___nospam___bmanu@francenet.fr
  • 'Web Site: http://gdf.zalem.net
  • 'Creates an object objParser. It will call an instance of the system XML parser :
  • Dim objParser
  • Set objParser = Server.CreateObject("Microsoft.XMLDOM" )
  • 'and an object XML Document. It will contain loaded data :
  • Dim xDoc
  • Set xDoc = Server.CreateObject("MSXML.DOMDocument")
  • 'Put Async property of object XML Document (xdoc) to false
  • 'for more information, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmproasync.asp
  • xDoc.Async = false
  • 'verify validity of the XML loaded document with the parser :
  • 'for more information, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmprovalidateonparse.asp
  • xDoc.validateOnParse = True
  • 'Load file
  • Dim XmlFileLoaded
  • XmlFileLoaded = xDoc.Load(XmlDataFile)
  • If not XmlFileLoaded then
  • Response.Clear
  • Dim strErrText
  • Dim xPE
  • Set xPE = xDoc.parseError
  • With xPE
  • strErrText = "<pre>An XML Document failed to load " & _
  • "due the following error." & vbCrLf & _
  • "Error #: " & .errorCode & ": " & .reason & _
  • "Line #: " & .Line & vbCrLf & _
  • "Line Position: " & .linepos & vbCrLf & _
  • "Position In File: " & .filepos & vbCrLf & _
  • "Source Text: " & .srcText & vbCrLf & _
  • "Document URL: " & .url & "</pre>"
  • End With
  • Response.Write strErrText
  • Response.End
  • End if
  • %>
  • <!-- J'arrête là, les fichiers sont tous dans le zip. -->
<!-- Fichier /test.asp : utilisé pour afficher la page, on y définit le nom du fichier xml à utiliser -->
<!--
Author	: Emmanuel BRUNO-GAZIGNAIRE
Email	: ___nospam___bmanu@francenet.fr
Web Site: http://gdf.zalem.net
-->
<!-- #include virtual="/functions/loadfromfile.asp" -->
<%

	Dim XmlDataFile

	'Put your statements here in order to intialize you variable :
	MyVariable = "This is an example of dynamic text included in your page" 

	'Choose your xml file for this page
		XmlDataFile = Server.MapPath(Application("xmlFolder") & "/test.xml")
		
		%>
<!-- #include virtual="/functions/doReadXml.asp" -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/oop.css">
<style type="text/css">
<%= strStyle %>
</style>
<script language="javascript">

</script>
</head>
<body>
<div id="main" class="main">
<%= strElts %>
</div>
</body>
</html>




<!-- Fichier /xml/test.xml : contient la description des données de la page -->
<?xml version="1.0" ?>
<!DOCTYPE page SYSTEM "main.dtd"[]>
<page>
	<pageItem>
		<texte src="test1.htm" class="TexteAccueil" leftPos="11" topPos="127" width="200" height="50" zIndex="0" autreProp="" />
	</pageItem>
	<pageItem>
		<image src="MSDN_banner.gif" srcClick="net_small.gif" alt="" leftPos="199" topPos="91" width="250" height="60" onclick="" zIndex="1" autreProp="" />
	</pageItem>
	<pageItem>
		<variable name="MyVariable" class="TexteAccueilFB" leftPos="362" topPos="126" width="200" height="80" zIndex="2" autreProp="" />
	</pageItem>
</page>




<-- fichier /functions/doReadXml.asp -->
<!--
Author	: Emmanuel BRUNO-GAZIGNAIRE
Email	: ___nospam___bmanu@francenet.fr
Web Site: http://gdf.zalem.net
-->
<%
		'Load and read file
		%>
		<!-- #include virtual="/functions/loadXmlFile.asp" -->
		<!-- #include virtual="/functions/readPageitemXMLFile.asp" -->
		<%
		
		'get values
		set result = readPageItemXmlFile(pageItem)
		strStyle = result.strStyle
		strScript = result.strScript
		strElts = result.strElts
		set result = nothing
%>

<!-- fichier /functions/loadXmlFile.asp -->
<%

'Author	: Emmanuel BRUNO-GAZIGNAIRE
'Email	: ___nospam___bmanu@francenet.fr
'Web Site: http://gdf.zalem.net
	
		'Creates an object objParser. It will call an instance of the system XML parser :
		Dim objParser
		Set objParser = Server.CreateObject("Microsoft.XMLDOM" )
		
		'and an object XML Document. It will contain loaded data :
		Dim xDoc 
		Set xDoc = Server.CreateObject("MSXML.DOMDocument")
		
		'Put Async property of object XML Document (xdoc) to false 
		'for more information, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmproasync.asp
		xDoc.Async = false
		
		'verify validity of the XML loaded document with the parser :
		'for more information, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmprovalidateonparse.asp
		xDoc.validateOnParse = True

		'Load file
		
		Dim XmlFileLoaded
		XmlFileLoaded = xDoc.Load(XmlDataFile)
			
		If not XmlFileLoaded then
			Response.Clear
			Dim strErrText 
			Dim xPE 
			Set xPE = xDoc.parseError
			With xPE
				strErrText = "<pre>An XML Document failed to load " & _
				"due the following error." & vbCrLf & _
				"Error #: " & .errorCode & ": " & .reason & _
				"Line #: " & .Line & vbCrLf & _
				"Line Position: " & .linepos & vbCrLf & _
				"Position In File: " & .filepos & vbCrLf & _
				"Source Text: " & .srcText & vbCrLf & _
				"Document URL: " & .url & "</pre>"
			End With
			Response.Write strErrText
			Response.End
		End if
%>

<!-- J'arrête là, les fichiers sont tous dans le zip. -->  

 Conclusion

Je ferai sans doute un site de démo sur ma machine dès que j'aurai un peu de temps.
Avant il faut que je limite le type et la taille des fichiers à uploader.

L'appli a été testée avec IE 6.
Elle utilise du DHTML donc il est probable qu'elle ne fonctionne pas sur de vieilles versions.  

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

EXÉCUTER PÉRIODIQUEMENT DU CODE SUR UN SERVEUR AUQUEL VOUS N...
FAIRE DES REQUÊTES SQL SUR UNE BASE PAR L'INTERMÉDIAIRE D'UN...
CRÉER UNE LISTE SELECT À PARTIR D'UNE REQUETE SQL

 Sources de la même categorie

Source avec Zip Source .NET (Dotnet) GESTION DE QUIZ par ysfhor
Source avec Zip Source avec une capture UPLOAD FILES WITH A PROGRESSBAR ( ASPUPLOAD ) par chunait
Source avec Zip GESTION PLANNING par Cpustack
ENVOI (SAUVEGARDE) D'UN FICHIER BINAIRE SUR UN SITE DISTANT ... par Chrigou
Source avec Zip MINI MESSAGERIE par Simo_TSSI

Commentaires et avis

Commentaire de softghost le 04/12/2006 18:35:17

bonjour


je veux juste savoir c quoi ca c plein d'erreur

oh my goooooooood..........

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 2,215 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales