Tutorial Plugin : 6 - Liste des commandes
This is a short summary of all important Maxthon commands and links.
You can [javascript:external.addFavorite(document.location.href,'Maxthon Plugins Quick List')">bookmark] this page so you can quickly lookup this information.
Voici un court sommaire des commandes et des liens utiles de Maxthon.
Vous pouvez ajouter cette page à vos [javascript:external.addFavorite(document.location.href="http://www.ldfa.net/wiki/index.php/Tutorial_Plugin_:_6_-_Liste_des_commandes), 'Liste rapide des plugins de Maxthon')" > Favoris].
Ainsi vous accéderez plus rapidement à ces informations.
Commandes de Maxthon
Security_id: For Toolbar Plugins: %max_security_id For Sidebar Plugins: Inside max.src, called max_security_id
Security_id :
- Pour les plugins de barre d'outils : %max_security_id
- Pour les plugins de barre latérale : Inside max.src, called max_security_id
These are the Maxthon DHTML commands:
Voici les commandes DHTML de Maxthon :
-
readFile( security_id, plugin_name, file_name)
Read a text file.
Lire un fichier texte.var text = external.readFile(%max_security_id, "Test plugin","export.txt")
-
writeFile( security_id, plugin_name, file_name, content )
Write a text file.
Ecrire un fichier texte.external.writeFile(%max_security_id, "Test plugin","export.txt", "Some Data.")
-
m2_readIni( security_id, plugin_name , file_name , section_name , key , default_value)
Read an ini-file.
Lire un fichier 'ini'.path = external.m2_readIni(%max_security_id, "testplugin","settings.ini","general","save","0")
-
m2_writeIni( security_id , plugin_name , file_name , section_name , key , value )
Write an ini-file.
Ecrire dans un fichier 'ini'.external.m2_writeIni(%max_security_id, "testplugin","settings.ini","general","save","true")
-
tab_count
Total number of tabs.
Nombre total d'onglets.var total_tab = external.tab_count
-
activate_tab( security_id , index )
Activate tab number (starting from zero).
Active le numéro d'un onglet (commence à zéro).external.activate_tab(%max_security_id,2)
-
close_tab( security_id , index )
Close a tab.
Fermer un onglet.external.close_tab(%max_security_id,2)
-
get_tab( security_id , index )
Get the webpage object from tab 'index'.
Obtenir de l'index des onglets la variable objet d'une page web.var doc = external.get_tab(%max_security_id,2).document
-
cur_sel
The number of the active tab.
Le numéro de l'onglet actif.var cur_tab = external.cur_sel
-
m2_plugin_folder( security_id , plugin_name )
The local path of the plugin.
Le chemin local du plugin.var folder = external.m2_plugin_folder(%max_security_id, "ViewSource!")
-
m2_run_cmd( security_id , id )
Call a Maxthon command with the specified ID.
Appeler une commande de Maxthon avec une ID spécifiée.external.m2_run_cmd(%max_security_id,32772)
This will open a blank page.
Ceci ouvre une page blanche. -
m2_callerName( security_id, plugin_name)
This function tells Maxthon the call is made from a Plugin.
Cette fonction indique à Maxthon l'appel effectué à partir d'un plugin.external.m2_callerName(%max_security_id,"ViewSource!")
-
max_showConfig( security_id, plugin_name)
Show the plugin's config dialog.
Montre la boite de dialogue de configuration du plugin.external.max_showConfig(%max_security_id,"ViewSource!")
-
max_activex(security_id, prog_id)
Create an ActiveX object.
Crée un objet ActiveX.var tempwin = window.open() var XML=tempwin.external.max_activex(%max_security_id, "Microsoft.XMLDOM") tempwin.close()
-
max_modelessDialog( security_id , url , option , attr , window )
Open a modelessDialog.
Ouvre Une boite de dialogue modèle.external.max_modelessDialog(%max_security_id, 'example.htm',window, 'status:no;help:no;resizable:yes;scroll:yes;',window)
-
max_language_id
The user's current selected language.
Le langage en cours sélectionné par l'utiisateur.var language=external.max_language_id
-
max_actSideBarItem( plugin_name )
This function will activate the sidebar plugin named as 'plugin_name'.
Cette fonction activera le plugin de barre latérale dont le nom est "pluginname".external.max_actSideBarItem("Calculator++")
-
addFavorite( url , title ) , addFavorite( url )
Add the 'url' into favorites.
Ajoute l'adresse URL aux favoris.external.addFavorite( "http://www.google.com" ) external.addFavorite( "http://www.google.com", "This is google")
-
addProxy (name, address, speed, is_web_proxy)
Call Maxthon's add proxy dialog.
Appelle la boite de dialogue "Ajouter un proxy".external.addProxy("My proxy", "192.168.1.0:8080",1,0)
-
addFilter( address ) , addFilter( address, is_pop_filter )
Call Maxthon's add filter dialog.
Appelle la boite de dialogue "Ajouter un filtre".external.addFilter("http://www.yahoo.com/ad*") external.addFilter("http://www.yahoo.com/img/*", 0)
-
m2_search_text( security_id )
This property will return the text in Maxthon's search bar.
Cette propriété renverra le texte dans la barre de recherche de Maxthon.var text = external.m2_search_text(%max_security_id)
In a sidebar plugin you can implement a script function called max_callback(status).
Dans un plugin de barre latérale vous pouvez ajouter une fonction script appelée : max_callback(status).
- Created: URL = FILENAME?maxcmd=init
- Activated = max_callback('sidebar_activate')
- Deactivated = max_callback('sidebar_deactivate')
- Tab Change=max_callback('sidebar_tab_change')
- Unload=max_callback('sidebar_unload')
Useful Links
Liens utiles
These links are useful for reference and if you start learning HTML and Javascript.
- W3School Javascript Tutorial (Recommended for beginners)
- W3School HTML DOM reference (HTML DOM allows you to acces and modify HTML documents)
- W3School HTML reference (All HTML tags)
- Microsoft MSDN Javascript reference/guide
- Microsoft MSDN HTML/DHTML reference
- Devguru Javascript reference
- Devguru Scripting.FileSystemObject (ActiveX component) reference
- Webreference Regular Expressions tutorial
Useful Maxthon Links:
- Maxthon.com
- TaraPages.com (All Maxthon plugin can be found here)
- Maxthon Skins
- Maxthon Forum