l'admin.
Demande #988
from django.views.decorators.cache import never_cache
from django.contrib.auth import authenticate, login
from django.shortcuts import get_object_or_404
+from savoirs.models import PageStatique
def index(request):
"""Répertoire des chercheurs"""
chercheurs = chercheurs.order_by_pays(direction)
else:
chercheurs = chercheurs.order_by('-date_modification')
+
+ try:
+ p = PageStatique.objects.get(id='repertoire')
+ entete = p.contenu
+ except PageStatique.DoesNotExist:
+ entete = u'<h1>Répertoire des chercheurs</h1>'
nb_chercheurs = chercheurs.count()
return render_to_response("chercheurs/index.html",
- dict(chercheurs=chercheurs, nb_chercheurs=nb_chercheurs, search_form=search_form),
+ dict(chercheurs=chercheurs, nb_chercheurs=nb_chercheurs,
+ search_form=search_form, entete=entete),
context_instance=RequestContext(request))
def inscription(request):
#flash-message { margin: 10px 20px; background: #f3e3e7; color: #b03d5e; padding: 1em; font-size: 120%;
border: 1px solid #b03d5e; -moz-border-radius: 5px; -webkit-border-radius: 5px; }
-#contenu { position: relative; padding: 5px 20px; }
+#contenu { position: relative; padding: 5px 20px; background: white; }
#contenu img.top, .resultats img.top { height:10px; position:relative; top:-10px; left:0;}
#contenu img.bottom, .resultats img.bottom{ height:10px; position:relative; bottom:-10px; left:0;}
--- /dev/null
+tinyMCE.addI18n({en:{\r
+common:{\r
+edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",\r
+apply:"Apply",\r
+insert:"Insert",\r
+update:"Update",\r
+cancel:"Cancel",\r
+close:"Close",\r
+browse:"Browse",\r
+class_name:"Class",\r
+not_set:"-- Not set --",\r
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",\r
+clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",\r
+popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",\r
+invalid_data:"Error: Invalid values entered, these are marked in red.",\r
+more_colors:"More colors"\r
+},\r
+contextmenu:{\r
+align:"Alignment",\r
+left:"Left",\r
+center:"Center",\r
+right:"Right",\r
+full:"Full"\r
+},\r
+insertdatetime:{\r
+date_fmt:"%Y-%m-%d",\r
+time_fmt:"%H:%M:%S",\r
+insertdate_desc:"Insert date",\r
+inserttime_desc:"Insert time",\r
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",\r
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",\r
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",\r
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"\r
+},\r
+print:{\r
+print_desc:"Print"\r
+},\r
+preview:{\r
+preview_desc:"Preview"\r
+},\r
+directionality:{\r
+ltr_desc:"Direction left to right",\r
+rtl_desc:"Direction right to left"\r
+},\r
+layer:{\r
+insertlayer_desc:"Insert new layer",\r
+forward_desc:"Move forward",\r
+backward_desc:"Move backward",\r
+absolute_desc:"Toggle absolute positioning",\r
+content:"New layer..."\r
+},\r
+save:{\r
+save_desc:"Save",\r
+cancel_desc:"Cancel all changes"\r
+},\r
+nonbreaking:{\r
+nonbreaking_desc:"Insert non-breaking space character"\r
+},\r
+iespell:{\r
+iespell_desc:"Run spell checking",\r
+download:"ieSpell not detected. Do you want to install it now?"\r
+},\r
+advhr:{\r
+advhr_desc:"Horizontal rule"\r
+},\r
+emotions:{\r
+emotions_desc:"Emotions"\r
+},\r
+searchreplace:{\r
+search_desc:"Find",\r
+replace_desc:"Find/Replace"\r
+},\r
+advimage:{\r
+image_desc:"Insert/edit image"\r
+},\r
+advlink:{\r
+link_desc:"Insert/edit link"\r
+},\r
+xhtmlxtras:{\r
+cite_desc:"Citation",\r
+abbr_desc:"Abbreviation",\r
+acronym_desc:"Acronym",\r
+del_desc:"Deletion",\r
+ins_desc:"Insertion",\r
+attribs_desc:"Insert/Edit Attributes"\r
+},\r
+style:{\r
+desc:"Edit CSS Style"\r
+},\r
+paste:{\r
+paste_text_desc:"Paste as Plain Text",\r
+paste_word_desc:"Paste from Word",\r
+selectall_desc:"Select All",\r
+plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",\r
+plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."\r
+},\r
+paste_dlg:{\r
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",\r
+text_linebreaks:"Keep linebreaks",\r
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."\r
+},\r
+table:{\r
+desc:"Inserts a new table",\r
+row_before_desc:"Insert row before",\r
+row_after_desc:"Insert row after",\r
+delete_row_desc:"Delete row",\r
+col_before_desc:"Insert column before",\r
+col_after_desc:"Insert column after",\r
+delete_col_desc:"Remove column",\r
+split_cells_desc:"Split merged table cells",\r
+merge_cells_desc:"Merge table cells",\r
+row_desc:"Table row properties",\r
+cell_desc:"Table cell properties",\r
+props_desc:"Table properties",\r
+paste_row_before_desc:"Paste table row before",\r
+paste_row_after_desc:"Paste table row after",\r
+cut_row_desc:"Cut table row",\r
+copy_row_desc:"Copy table row",\r
+del:"Delete table",\r
+row:"Row",\r
+col:"Column",\r
+cell:"Cell"\r
+},\r
+autosave:{\r
+unload_msg:"The changes you made will be lost if you navigate away from this page.",\r
+restore_content:"Restore auto-saved content.",\r
+warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."\r
+},\r
+fullscreen:{\r
+desc:"Toggle fullscreen mode"\r
+},\r
+media:{\r
+desc:"Insert / edit embedded media",\r
+edit:"Edit embedded media"\r
+},\r
+fullpage:{\r
+desc:"Document properties"\r
+},\r
+template:{\r
+desc:"Insert predefined template content"\r
+},\r
+visualchars:{\r
+desc:"Visual control characters on/off."\r
+},\r
+spellchecker:{\r
+desc:"Toggle spellchecker",\r
+menu:"Spellchecker settings",\r
+ignore_word:"Ignore word",\r
+ignore_words:"Ignore all",\r
+langs:"Languages",\r
+wait:"Please wait...",\r
+sug:"Suggestions",\r
+no_sug:"No suggestions",\r
+no_mpell:"No misspellings found."\r
+},\r
+pagebreak:{\r
+desc:"Insert page break."\r
+},\r
+advlist:{\r
+types:"Types",\r
+def:"Default",\r
+lower_alpha:"Lower alpha",\r
+lower_greek:"Lower greek",\r
+lower_roman:"Lower roman",\r
+upper_alpha:"Upper alpha",\r
+upper_roman:"Upper roman",\r
+circle:"Circle",\r
+disc:"Disc",\r
+square:"Square"\r
+}}});
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n({fr:{common:{more_colors:"Plus de couleurs",invalid_data:"Erreur : saisie de valeurs incorrectes. Elles sont mises en \u00e9vidence en rouge.",popup_blocked:"D\u00e9sol\u00e9, nous avons d\u00e9tect\u00e9 que votre bloqueur de popup a bloqu\u00e9 une fen\u00eatre dont l\'application a besoin. Vous devez d\u00e9sactiver votre bloqueur de popup pour pouvoir utiliser cet outil.",clipboard_no_support:"Actuellement non support\u00e9 par votre navigateur.\\n Veuillez utiliser les raccourcis clavier \u00e0 la place.",clipboard_msg:"Les fonctions Copier/Couper/Coller ne sont pas valables sur Mozilla et Firefox.\\nSouhaitez-vous avoir plus d\'informations sur ce sujet ?",not_set:"-- non d\u00e9fini --",class_name:"Classe",browse:"parcourir",close:"Fermer",cancel:"Annuler",update:"Mettre \u00e0 jour",insert:"Ins\u00e9rer",apply:"Appliquer",edit_confirm:"Souhaitez-vous utiliser le mode WYSIWYG pour cette zone de texte ?"},contextmenu:{full:"Justifi\u00e9",right:"Droite",center:"Centr\u00e9",left:"Gauche",align:"Alignement"},insertdatetime:{day_short:"Dim,Lun,Mar,Mer,Jeu,Ven,Sam,Dim",day_long:"Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi,Dimanche",months_short:"Jan,F\u00e9v,Mar,Avr,Mai,Juin,Juil,Ao\u00fbt,Sep,Oct,Nov,D\u00e9c",months_long:"Janvier,F\u00e9vrier,Mars,Avril,Mai,Juin,Juillet,Ao\u00fbt,Septembre,Octobre,Novembre,D\u00e9cembre",inserttime_desc:"Ins\u00e9rer l\'heure",insertdate_desc:"Ins\u00e9rer la date",time_fmt:"%H:%M:%S",date_fmt:"%d-%m-%Y"},print:{print_desc:"Imprimer"},preview:{preview_desc:"Pr\u00e9visualiser"},directionality:{rtl_desc:"\u00c9criture de droite \u00e0 gauche",ltr_desc:"\u00c9criture de gauche \u00e0 droite"},layer:{content:"Nouvelle couche\u2026",absolute_desc:"Activer le positionnement absolu",backward_desc:"D\u00e9placer vers l\'arri\u00e8re",forward_desc:"D\u00e9placer vers l\'avant",insertlayer_desc:"Ins\u00e9rer une nouvelle couche"},save:{save_desc:"Enregistrer",cancel_desc:"Annuler toutes les modifications"},nonbreaking:{nonbreaking_desc:"Ins\u00e9rer une espace ins\u00e9cable"},iespell:{download:"ieSpell n\'est pas install\u00e9. Souhaitez-vous l\'installer maintenant ?",iespell_desc:"Lancer le v\u00e9rificateur d\'orthographe"},advhr:{delta_height:"Ecart de hauteur",delta_width:"Ecart de largeur",advhr_desc:"Ins\u00e9rer un trait horizontal"},emotions:{emotions_desc:"\u00c9motic\u00f4nes",delta_height:"",delta_width:""},searchreplace:{replace_desc:"Rechercher / remplacer",search_desc:"Rechercher",delta_width:"",delta_height:""},advimage:{image_desc:"Ins\u00e9rer / \u00e9diter une image",delta_width:"",delta_height:""},advlink:{link_desc:"Ins\u00e9rer / \u00e9diter un lien",delta_height:"",delta_width:""},xhtmlxtras:{attribs_desc:"Ins\u00e9rer / \u00e9diter les attributs",ins_desc:"Ins\u00e9r\u00e9",del_desc:"Barr\u00e9",acronym_desc:"Acronyme",abbr_desc:"Abr\u00e9viation",cite_desc:"Citation",attribs_delta_height:"",attribs_delta_width:"",ins_delta_height:"",ins_delta_width:"",del_delta_height:"",del_delta_width:"",acronym_delta_height:"",acronym_delta_width:"",abbr_delta_height:"",abbr_delta_width:"",cite_delta_height:"",cite_delta_width:""},style:{desc:"\u00c9diter la feuille de style (CSS)",delta_height:"",delta_width:""},paste:{plaintext_mode:"Le collage est actuellement en mode texte non format\u00e9. Cliquez \u00e0 nouveau pour revenir en mode de collage ordinaire.",plaintext_mode_sticky:"Le collage est actuellement en mode texte non format\u00e9. Cliquez \u00e0 nouveau pour revenir en mode de collage ordinaire. Apr\u00e8s avoir coll\u00e9 quelque chose, vous retournerez en mode de collage ordinaire.",selectall_desc:"Tout s\u00e9lectionner",paste_word_desc:"Coller un texte cr\u00e9\u00e9 sous Word",paste_text_desc:"Coller comme texte brut"},paste_dlg:{word_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00eatre.",text_linebreaks:"Conserver les retours \u00e0 la ligne",text_title:"Utilisez CTRL+V sur votre clavier pour coller le texte dans la fen\u00eatre."},table:{cell:"Cellule",col:"Colonne",row:"Ligne",del:"Effacer le tableau",copy_row_desc:"Copier la ligne",cut_row_desc:"Couper la ligne",paste_row_after_desc:"Coller la ligne apr\u00e8s",paste_row_before_desc:"Coller la ligne avant",props_desc:"Propri\u00e9t\u00e9s du tableau",cell_desc:"Propri\u00e9t\u00e9s de la cellule",row_desc:"Propri\u00e9t\u00e9s de la ligne",merge_cells_desc:"Fusionner les cellules",split_cells_desc:"Scinder les cellules fusionn\u00e9es",delete_col_desc:"Effacer la colonne",col_after_desc:"Ins\u00e9rer une colonne apr\u00e8s",col_before_desc:"Ins\u00e9rer une colonne avant",delete_row_desc:"Effacer la ligne",row_after_desc:"Ins\u00e9rer une ligne apr\u00e8s",row_before_desc:"Ins\u00e9rer une ligne avant",desc:"Ins\u00e9rer un nouveau tableau",merge_cells_delta_height:"",merge_cells_delta_width:"",table_delta_height:"",table_delta_width:"",cellprops_delta_height:"",cellprops_delta_width:"",rowprops_delta_height:"",rowprops_delta_width:""},autosave:{warning_message:"Si vous restaurez le contenu sauv\u00e9, vous perdrez le contenu qui est actuellement dans l\'\u00e9diteur.\\n\\n\u00cates-vous s\u00fbr de vouloir restaurer le contenu sauv\u00e9 ?",restore_content:"Restaurer le contenu auto-sauvegard\u00e9.",unload_msg:"Les modifications apport\u00e9es seront perdus si vous quittez cette page."},fullscreen:{desc:"Passer en mode plein \u00e9cran"},media:{edit:"\u00c9diter un m\u00e9dia incorpor\u00e9",desc:"Ins\u00e9rer / \u00e9diter un m\u00e9dia incorpor\u00e9",delta_height:"",delta_width:""},fullpage:{desc:"Propri\u00e9t\u00e9s du document",delta_width:"",delta_height:""},template:{desc:"Ins\u00e9rer un mod\u00e8le pr\u00e9d\u00e9fini."},visualchars:{desc:"Activer les caract\u00e8res de mise en page."},spellchecker:{desc:"Activer le v\u00e9rificateur d\'orthographe",menu:"Param\u00e8tres du v\u00e9rificateur d\'orthographe",ignore_word:"Ignorer le mot",ignore_words:"Tout ignorer",langs:"Langues",wait:"Veuillez patienter\u2026",sug:"Suggestions",no_sug:"Aucune suggestion",no_mpell:"Aucune erreur trouv\u00e9e."},pagebreak:{desc:"Ins\u00e9rer un saut de page."},advlist:{types:"Types",def:"Defaut",lower_alpha:"Alpha minuscule",lower_greek:"Grec minuscule",lower_roman:"Romain minuscule",upper_alpha:"Alpha majuscule",upper_roman:"Romain majuscule",circle:"Cercle",disc:"Disque",square:"Carr\u00e9"}}});
\ No newline at end of file
--- /dev/null
+ GNU LESSER GENERAL PUBLIC LICENSE\r
+ Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL. It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+ Preamble\r
+\r
+ The licenses for most software are designed to take away your\r
+freedom to share and change it. By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+ This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it. You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+ When we speak of free software, we are referring to freedom of use,\r
+not price. Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+ To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights. These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+ For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you. You must make sure that they, too, receive or can get the source\r
+code. If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it. And you must show them these terms so they know their rights.\r
+\r
+ We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+ To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library. Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+ Finally, software patents pose a constant threat to the existence of\r
+any free program. We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder. Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+ Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License. This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License. We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+ When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library. The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom. The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+ We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License. It also provides other free software developers Less\r
+of an advantage over competing non-free programs. These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries. However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+ For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard. To achieve this, non-free programs must be\r
+allowed to use the library. A more frequent case is that a free\r
+library does the same job as widely used non-free libraries. In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+ In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software. For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+ Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+ The precise terms and conditions for copying, distribution and\r
+modification follow. Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library". The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+ GNU LESSER GENERAL PUBLIC LICENSE\r
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+ 0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+ A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+ The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms. A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language. (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+ "Source code" for a work means the preferred form of the work for\r
+making modifications to it. For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+ Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope. The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it). Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+ \r
+ 1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+ You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+ 2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+ a) The modified work must itself be a software library.\r
+\r
+ b) You must cause the files modified to carry prominent notices\r
+ stating that you changed the files and the date of any change.\r
+\r
+ c) You must cause the whole of the work to be licensed at no\r
+ charge to all third parties under the terms of this License.\r
+\r
+ d) If a facility in the modified Library refers to a function or a\r
+ table of data to be supplied by an application program that uses\r
+ the facility, other than as an argument passed when the facility\r
+ is invoked, then you must make a good faith effort to ensure that,\r
+ in the event an application does not supply such function or\r
+ table, the facility still operates, and performs whatever part of\r
+ its purpose remains meaningful.\r
+\r
+ (For example, a function in a library to compute square roots has\r
+ a purpose that is entirely well-defined independent of the\r
+ application. Therefore, Subsection 2d requires that any\r
+ application-supplied function or table used by this function must\r
+ be optional: if the application does not supply it, the square\r
+ root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole. If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works. But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+ 3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library. To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License. (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.) Do not make any other change in\r
+these notices.\r
+\r
+ Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+ This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+ 4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+ If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+ 5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library". Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+ However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library". The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+ When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library. The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+ If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work. (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+ Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+ 6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+ You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License. You must supply a copy of this License. If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License. Also, you must do one\r
+of these things:\r
+\r
+ a) Accompany the work with the complete corresponding\r
+ machine-readable source code for the Library including whatever\r
+ changes were used in the work (which must be distributed under\r
+ Sections 1 and 2 above); and, if the work is an executable linked\r
+ with the Library, with the complete machine-readable "work that\r
+ uses the Library", as object code and/or source code, so that the\r
+ user can modify the Library and then relink to produce a modified\r
+ executable containing the modified Library. (It is understood\r
+ that the user who changes the contents of definitions files in the\r
+ Library will not necessarily be able to recompile the application\r
+ to use the modified definitions.)\r
+\r
+ b) Use a suitable shared library mechanism for linking with the\r
+ Library. A suitable mechanism is one that (1) uses at run time a\r
+ copy of the library already present on the user's computer system,\r
+ rather than copying library functions into the executable, and (2)\r
+ will operate properly with a modified version of the library, if\r
+ the user installs one, as long as the modified version is\r
+ interface-compatible with the version that the work was made with.\r
+\r
+ c) Accompany the work with a written offer, valid for at\r
+ least three years, to give the same user the materials\r
+ specified in Subsection 6a, above, for a charge no more\r
+ than the cost of performing this distribution.\r
+\r
+ d) If distribution of the work is made by offering access to copy\r
+ from a designated place, offer equivalent access to copy the above\r
+ specified materials from the same place.\r
+\r
+ e) Verify that the user has already received a copy of these\r
+ materials or that you have already sent this user a copy.\r
+\r
+ For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it. However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+ It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system. Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+ 7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+ a) Accompany the combined library with a copy of the same work\r
+ based on the Library, uncombined with any other library\r
+ facilities. This must be distributed under the terms of the\r
+ Sections above.\r
+\r
+ b) Give prominent notice with the combined library of the fact\r
+ that part of it is a work based on the Library, and explaining\r
+ where to find the accompanying uncombined form of the same work.\r
+\r
+ 8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License. Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License. However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+ 9. You are not required to accept this License, since you have not\r
+signed it. However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works. These actions are\r
+prohibited by law if you do not accept this License. Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+ 10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions. You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+ 11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License. If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all. For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices. Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+ 12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded. In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+ 13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number. If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation. If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+ 14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission. For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this. Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+ NO WARRANTY\r
+\r
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ How to Apply These Terms to Your New Libraries\r
+\r
+ If you develop a new library, and you want it to be of the greatest\r
+possible use to the public, we recommend making it free software that\r
+everyone can redistribute and change. You can do so by permitting\r
+redistribution under these terms (or, alternatively, under the terms of the\r
+ordinary General Public License).\r
+\r
+ To apply these terms, attach the following notices to the library. It is\r
+safest to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least the\r
+"copyright" line and a pointer to where the full notice is found.\r
+\r
+ <one line to give the library's name and a brief idea of what it does.>\r
+ Copyright (C) <year> <name of author>\r
+\r
+ This library is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU Lesser General Public\r
+ License as published by the Free Software Foundation; either\r
+ version 2.1 of the License, or (at your option) any later version.\r
+\r
+ This library is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ Lesser General Public License for more details.\r
+\r
+ You should have received a copy of the GNU Lesser General Public\r
+ License along with this library; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the library, if\r
+necessary. Here is a sample; alter the names:\r
+\r
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
+\r
+ <signature of Ty Coon>, 1 April 1990\r
+ Ty Coon, President of Vice\r
+\r
+That's all there is to it!\r
+\r
+\r
--- /dev/null
+input.radio {border:1px none #000; background:transparent; vertical-align:middle;}\r
+.panel_wrapper div.current {height:80px;}\r
+#width {width:50px; vertical-align:middle;}\r
+#width2 {width:50px; vertical-align:middle;}\r
+#size {width:100px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.AdvancedHRPlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceAdvancedHr', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/rule.htm',\r
+ width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),\r
+ height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('advhr', {\r
+ title : 'advhr.advhr_desc',\r
+ cmd : 'mceAdvancedHr'\r
+ });\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ cm.setActive('advhr', n.nodeName == 'HR');\r
+ });\r
+\r
+ ed.onClick.add(function(ed, e) {\r
+ e = e.target;\r
+\r
+ if (e.nodeName === 'HR')\r
+ ed.selection.select(e);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced HR',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+var AdvHRDialog = {\r
+ init : function(ed) {\r
+ var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;\r
+\r
+ w = dom.getAttrib(n, 'width');\r
+ f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');\r
+ f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';\r
+ f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');\r
+ selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');\r
+ },\r
+\r
+ update : function() {\r
+ var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';\r
+\r
+ h = '<hr';\r
+\r
+ if (f.size.value) {\r
+ h += ' size="' + f.size.value + '"';\r
+ st += ' height:' + f.size.value + 'px;';\r
+ }\r
+\r
+ if (f.width.value) {\r
+ h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';\r
+ st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';\r
+ }\r
+\r
+ if (f.noshade.checked) {\r
+ h += ' noshade="noshade"';\r
+ st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';\r
+ }\r
+\r
+ if (ed.settings.inline_styles)\r
+ h += ' style="' + tinymce.trim(st) + '"';\r
+\r
+ h += ' />';\r
+\r
+ ed.execCommand("mceInsertContent", false, h);\r
+ tinyMCEPopup.close();\r
+ }\r
+};\r
+\r
+tinyMCEPopup.requireLangPack();\r
+tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.advhr_dlg',{\r
+width:"Width",\r
+size:"Height",\r
+noshade:"No shadow"\r
+});
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n('fr.advhr_dlg',{size:"Hauteur",noshade:"Pas d\'ombre",width:"Largeur"});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advhr.advhr_desc}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/rule.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <link href="css/advhr.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body>\r
+<form onsubmit="AdvHRDialog.update();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="width">{#advhr_dlg.width}</label></td>\r
+ <td class="nowrap">\r
+ <input id="width" name="width" type="text" value="" class="mceFocus" />\r
+ <select name="width2" id="width2">\r
+ <option value="">px</option>\r
+ <option value="%">%</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="size">{#advhr_dlg.size}</label></td>\r
+ <td><select id="size" name="size">\r
+ <option value="">Normal</option>\r
+ <option value="1">1</option>\r
+ <option value="2">2</option>\r
+ <option value="3">3</option>\r
+ <option value="4">4</option>\r
+ <option value="5">5</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="noshade">{#advhr_dlg.noshade}</label></td>\r
+ <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+#src_list, #over_list, #out_list {width:280px;}\r
+.mceActionPanel {margin-top:7px;}\r
+.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}\r
+.checkbox {border:0;}\r
+.panel_wrapper div.current {height:305px;}\r
+#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}\r
+#align, #classlist {width:150px;}\r
+#width, #height {vertical-align:middle; width:50px; text-align:center;}\r
+#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}\r
+#class_list {width:180px;}\r
+input {width: 280px;}\r
+#constrain, #onmousemovecheck {width:auto;}\r
+#id, #dir, #lang, #usemap, #longdesc {width:200px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.AdvancedImagePlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceAdvImage', function() {\r
+ // Internal image object like a flash placeholder\r
+ if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\r
+ return;\r
+\r
+ ed.windowManager.open({\r
+ file : url + '/image.htm',\r
+ width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),\r
+ height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('image', {\r
+ title : 'advimage.image_desc',\r
+ cmd : 'mceAdvImage'\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced image',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advimage_dlg.dialog_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/image.js"></script>\r
+ <link href="css/advimage.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advimage" style="display: none">\r
+ <form onsubmit="ImageDialog.insert();return false;" action="#"> \r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>\r
+ <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.general}</legend>\r
+\r
+ <table class="properties">\r
+ <tr>\r
+ <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>\r
+ <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr> \r
+ <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td> \r
+ <td id="srcbrowsercontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="src_list">{#advimage_dlg.image_list}</label></td>\r
+ <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr> \r
+ <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> \r
+ <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> \r
+ </tr> \r
+ <tr> \r
+ <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> \r
+ <td colspan="2"><input id="title" name="title" type="text" value="" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.preview}</legend>\r
+ <div id="prev"></div>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="appearance_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.tab_appearance}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr> \r
+ <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> \r
+ <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="baseline">{#advimage_dlg.align_baseline}</option>\r
+ <option value="top">{#advimage_dlg.align_top}</option>\r
+ <option value="middle">{#advimage_dlg.align_middle}</option>\r
+ <option value="bottom">{#advimage_dlg.align_bottom}</option>\r
+ <option value="text-top">{#advimage_dlg.align_texttop}</option>\r
+ <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>\r
+ <option value="left">{#advimage_dlg.align_left}</option>\r
+ <option value="right">{#advimage_dlg.align_right}</option>\r
+ </select> \r
+ </td>\r
+ <td rowspan="6" valign="top">\r
+ <div class="alignPreview">\r
+ <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />\r
+ Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam\r
+ nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum\r
+ edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam\r
+ erat volutpat.\r
+ </div>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>\r
+ <td class="nowrap">\r
+ <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x \r
+ <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td> </td>\r
+ <td><table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>\r
+ <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> \r
+ <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />\r
+ </td>\r
+ </tr>\r
+\r
+ <tr> \r
+ <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> \r
+ <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> \r
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="class_list">{#class_name}</label></td>\r
+ <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> \r
+ <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> \r
+ </tr>\r
+\r
+ <!-- <tr>\r
+ <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> \r
+ <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> \r
+ </tr> -->\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.swap_image}</legend>\r
+\r
+ <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />\r
+ <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+ <tr>\r
+ <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> \r
+ <td><table border="0" cellspacing="0" cellpadding="0"> \r
+ <tr> \r
+ <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> \r
+ <td id="onmouseoversrccontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="over_list">{#advimage_dlg.image_list}</label></td>\r
+ <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr> \r
+ <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> \r
+ <td class="column2"><table border="0" cellspacing="0" cellpadding="0"> \r
+ <tr> \r
+ <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> \r
+ <td id="onmouseoutsrccontainer"> </td>\r
+ </tr> \r
+ </table></td> \r
+ </tr>\r
+ <tr>\r
+ <td><label for="out_list">{#advimage_dlg.image_list}</label></td>\r
+ <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.misc}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#advimage_dlg.ltr}</option> \r
+ <option value="rtl">{#advimage_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> \r
+ <td>\r
+ <input id="usemap" name="usemap" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>\r
+ <td><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="longdesc" name="longdesc" type="text" value="" /></td>\r
+ <td id="longdesccontainer"> </td>\r
+ </tr>\r
+ </table></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body> \r
+</html> \r
--- /dev/null
+var ImageDialog = {\r
+ preInit : function() {\r
+ var url;\r
+\r
+ tinyMCEPopup.requireLangPack();\r
+\r
+ if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+ },\r
+\r
+ init : function(ed) {\r
+ var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();\r
+\r
+ tinyMCEPopup.resizeToInnerSize();\r
+ this.fillClassList('class_list');\r
+ this.fillFileList('src_list', 'tinyMCEImageList');\r
+ this.fillFileList('over_list', 'tinyMCEImageList');\r
+ this.fillFileList('out_list', 'tinyMCEImageList');\r
+ TinyMCE_EditableSelects.init();\r
+\r
+ if (n.nodeName == 'IMG') {\r
+ nl.src.value = dom.getAttrib(n, 'src');\r
+ nl.width.value = dom.getAttrib(n, 'width');\r
+ nl.height.value = dom.getAttrib(n, 'height');\r
+ nl.alt.value = dom.getAttrib(n, 'alt');\r
+ nl.title.value = dom.getAttrib(n, 'title');\r
+ nl.vspace.value = this.getAttrib(n, 'vspace');\r
+ nl.hspace.value = this.getAttrib(n, 'hspace');\r
+ nl.border.value = this.getAttrib(n, 'border');\r
+ selectByValue(f, 'align', this.getAttrib(n, 'align'));\r
+ selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);\r
+ nl.style.value = dom.getAttrib(n, 'style');\r
+ nl.id.value = dom.getAttrib(n, 'id');\r
+ nl.dir.value = dom.getAttrib(n, 'dir');\r
+ nl.lang.value = dom.getAttrib(n, 'lang');\r
+ nl.usemap.value = dom.getAttrib(n, 'usemap');\r
+ nl.longdesc.value = dom.getAttrib(n, 'longdesc');\r
+ nl.insert.value = ed.getLang('update');\r
+\r
+ if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))\r
+ nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
+\r
+ if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))\r
+ nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
+\r
+ if (ed.settings.inline_styles) {\r
+ // Move attribs to styles\r
+ if (dom.getAttrib(n, 'align'))\r
+ this.updateStyle('align');\r
+\r
+ if (dom.getAttrib(n, 'hspace'))\r
+ this.updateStyle('hspace');\r
+\r
+ if (dom.getAttrib(n, 'border'))\r
+ this.updateStyle('border');\r
+\r
+ if (dom.getAttrib(n, 'vspace'))\r
+ this.updateStyle('vspace');\r
+ }\r
+ }\r
+\r
+ // Setup browse button\r
+ document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
+ if (isVisible('srcbrowser'))\r
+ document.getElementById('src').style.width = '260px';\r
+\r
+ // Setup browse button\r
+ document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');\r
+ if (isVisible('overbrowser'))\r
+ document.getElementById('onmouseoversrc').style.width = '260px';\r
+\r
+ // Setup browse button\r
+ document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');\r
+ if (isVisible('outbrowser'))\r
+ document.getElementById('onmouseoutsrc').style.width = '260px';\r
+\r
+ // If option enabled default contrain proportions to checked\r
+ if (ed.getParam("advimage_constrain_proportions", true))\r
+ f.constrain.checked = true;\r
+\r
+ // Check swap image if valid data\r
+ if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)\r
+ this.setSwapImage(true);\r
+ else\r
+ this.setSwapImage(false);\r
+\r
+ this.changeAppearance();\r
+ this.showPreviewImage(nl.src.value, 1);\r
+ },\r
+\r
+ insert : function(file, title) {\r
+ var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];\r
+\r
+ if (f.src.value === '') {\r
+ if (ed.selection.getNode().nodeName == 'IMG') {\r
+ ed.dom.remove(ed.selection.getNode());\r
+ ed.execCommand('mceRepaint');\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {\r
+ if (!f.alt.value) {\r
+ tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {\r
+ if (s)\r
+ t.insertAndClose();\r
+ });\r
+\r
+ return;\r
+ }\r
+ }\r
+\r
+ t.insertAndClose();\r
+ },\r
+\r
+ insertAndClose : function() {\r
+ var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ // Fixes crash in Safari\r
+ if (tinymce.isWebKit)\r
+ ed.getWin().focus();\r
+\r
+ if (!ed.settings.inline_styles) {\r
+ args = {\r
+ vspace : nl.vspace.value,\r
+ hspace : nl.hspace.value,\r
+ border : nl.border.value,\r
+ align : getSelectValue(f, 'align')\r
+ };\r
+ } else {\r
+ // Remove deprecated values\r
+ args = {\r
+ vspace : '',\r
+ hspace : '',\r
+ border : '',\r
+ align : ''\r
+ };\r
+ }\r
+\r
+ tinymce.extend(args, {\r
+ src : nl.src.value,\r
+ width : nl.width.value,\r
+ height : nl.height.value,\r
+ alt : nl.alt.value,\r
+ title : nl.title.value,\r
+ 'class' : getSelectValue(f, 'class_list'),\r
+ style : nl.style.value,\r
+ id : nl.id.value,\r
+ dir : nl.dir.value,\r
+ lang : nl.lang.value,\r
+ usemap : nl.usemap.value,\r
+ longdesc : nl.longdesc.value\r
+ });\r
+\r
+ args.onmouseover = args.onmouseout = '';\r
+\r
+ if (f.onmousemovecheck.checked) {\r
+ if (nl.onmouseoversrc.value)\r
+ args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";\r
+\r
+ if (nl.onmouseoutsrc.value)\r
+ args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";\r
+ }\r
+\r
+ el = ed.selection.getNode();\r
+\r
+ if (el && el.nodeName == 'IMG') {\r
+ ed.dom.setAttribs(el, args);\r
+ } else {\r
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});\r
+ ed.dom.setAttribs('__mce_tmp', args);\r
+ ed.dom.setAttrib('__mce_tmp', 'id', '');\r
+ ed.undoManager.add();\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ getAttrib : function(e, at) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
+\r
+ if (ed.settings.inline_styles) {\r
+ switch (at) {\r
+ case 'align':\r
+ if (v = dom.getStyle(e, 'float'))\r
+ return v;\r
+\r
+ if (v = dom.getStyle(e, 'vertical-align'))\r
+ return v;\r
+\r
+ break;\r
+\r
+ case 'hspace':\r
+ v = dom.getStyle(e, 'margin-left')\r
+ v2 = dom.getStyle(e, 'margin-right');\r
+\r
+ if (v && v == v2)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+\r
+ case 'vspace':\r
+ v = dom.getStyle(e, 'margin-top')\r
+ v2 = dom.getStyle(e, 'margin-bottom');\r
+ if (v && v == v2)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+\r
+ case 'border':\r
+ v = 0;\r
+\r
+ tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
+ sv = dom.getStyle(e, 'border-' + sv + '-width');\r
+\r
+ // False or not the same as prev\r
+ if (!sv || (sv != v && v !== 0)) {\r
+ v = 0;\r
+ return false;\r
+ }\r
+\r
+ if (sv)\r
+ v = sv;\r
+ });\r
+\r
+ if (v)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (v = dom.getAttrib(e, at))\r
+ return v;\r
+\r
+ return '';\r
+ },\r
+\r
+ setSwapImage : function(st) {\r
+ var f = document.forms[0];\r
+\r
+ f.onmousemovecheck.checked = st;\r
+ setBrowserDisabled('overbrowser', !st);\r
+ setBrowserDisabled('outbrowser', !st);\r
+\r
+ if (f.over_list)\r
+ f.over_list.disabled = !st;\r
+\r
+ if (f.out_list)\r
+ f.out_list.disabled = !st;\r
+\r
+ f.onmouseoversrc.disabled = !st;\r
+ f.onmouseoutsrc.disabled = !st;\r
+ },\r
+\r
+ fillClassList : function(id) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
+ cl = [];\r
+\r
+ tinymce.each(v.split(';'), function(v) {\r
+ var p = v.split('=');\r
+\r
+ cl.push({'title' : p[0], 'class' : p[1]});\r
+ });\r
+ } else\r
+ cl = tinyMCEPopup.editor.dom.getClasses();\r
+\r
+ if (cl.length > 0) {\r
+ lst.options.length = 0;\r
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+\r
+ tinymce.each(cl, function(o) {\r
+ lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ fillFileList : function(id, l) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ l = window[l];\r
+ lst.options.length = 0;\r
+\r
+ if (l && l.length > 0) {\r
+ lst.options[lst.options.length] = new Option('', '');\r
+\r
+ tinymce.each(l, function(o) {\r
+ lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ resetImageData : function() {\r
+ var f = document.forms[0];\r
+\r
+ f.elements.width.value = f.elements.height.value = '';\r
+ },\r
+\r
+ updateImageData : function(img, st) {\r
+ var f = document.forms[0];\r
+\r
+ if (!st) {\r
+ f.elements.width.value = img.width;\r
+ f.elements.height.value = img.height;\r
+ }\r
+\r
+ this.preloadImg = img;\r
+ },\r
+\r
+ changeAppearance : function() {\r
+ var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');\r
+\r
+ if (img) {\r
+ if (ed.getParam('inline_styles')) {\r
+ ed.dom.setAttrib(img, 'style', f.style.value);\r
+ } else {\r
+ img.align = f.align.value;\r
+ img.border = f.border.value;\r
+ img.hspace = f.hspace.value;\r
+ img.vspace = f.vspace.value;\r
+ }\r
+ }\r
+ },\r
+\r
+ changeHeight : function() {\r
+ var f = document.forms[0], tp, t = this;\r
+\r
+ if (!f.constrain.checked || !t.preloadImg) {\r
+ return;\r
+ }\r
+\r
+ if (f.width.value == "" || f.height.value == "")\r
+ return;\r
+\r
+ tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;\r
+ f.height.value = tp.toFixed(0);\r
+ },\r
+\r
+ changeWidth : function() {\r
+ var f = document.forms[0], tp, t = this;\r
+\r
+ if (!f.constrain.checked || !t.preloadImg) {\r
+ return;\r
+ }\r
+\r
+ if (f.width.value == "" || f.height.value == "")\r
+ return;\r
+\r
+ tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;\r
+ f.width.value = tp.toFixed(0);\r
+ },\r
+\r
+ updateStyle : function(ty) {\r
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});\r
+\r
+ if (tinyMCEPopup.editor.settings.inline_styles) {\r
+ // Handle align\r
+ if (ty == 'align') {\r
+ dom.setStyle(img, 'float', '');\r
+ dom.setStyle(img, 'vertical-align', '');\r
+\r
+ v = getSelectValue(f, 'align');\r
+ if (v) {\r
+ if (v == 'left' || v == 'right')\r
+ dom.setStyle(img, 'float', v);\r
+ else\r
+ img.style.verticalAlign = v;\r
+ }\r
+ }\r
+\r
+ // Handle border\r
+ if (ty == 'border') {\r
+ dom.setStyle(img, 'border', '');\r
+\r
+ v = f.border.value;\r
+ if (v || v == '0') {\r
+ if (v == '0')\r
+ img.style.border = '0';\r
+ else\r
+ img.style.border = v + 'px solid black';\r
+ }\r
+ }\r
+\r
+ // Handle hspace\r
+ if (ty == 'hspace') {\r
+ dom.setStyle(img, 'marginLeft', '');\r
+ dom.setStyle(img, 'marginRight', '');\r
+\r
+ v = f.hspace.value;\r
+ if (v) {\r
+ img.style.marginLeft = v + 'px';\r
+ img.style.marginRight = v + 'px';\r
+ }\r
+ }\r
+\r
+ // Handle vspace\r
+ if (ty == 'vspace') {\r
+ dom.setStyle(img, 'marginTop', '');\r
+ dom.setStyle(img, 'marginBottom', '');\r
+\r
+ v = f.vspace.value;\r
+ if (v) {\r
+ img.style.marginTop = v + 'px';\r
+ img.style.marginBottom = v + 'px';\r
+ }\r
+ }\r
+\r
+ // Merge\r
+ dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');\r
+ }\r
+ },\r
+\r
+ changeMouseMove : function() {\r
+ },\r
+\r
+ showPreviewImage : function(u, st) {\r
+ if (!u) {\r
+ tinyMCEPopup.dom.setHTML('prev', '');\r
+ return;\r
+ }\r
+\r
+ if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))\r
+ this.resetImageData();\r
+\r
+ u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);\r
+\r
+ if (!st)\r
+ tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');\r
+ else\r
+ tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');\r
+ }\r
+};\r
+\r
+ImageDialog.preInit();\r
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.advimage_dlg',{\r
+tab_general:"General",\r
+tab_appearance:"Appearance",\r
+tab_advanced:"Advanced",\r
+general:"General",\r
+title:"Title",\r
+preview:"Preview",\r
+constrain_proportions:"Constrain proportions",\r
+langdir:"Language direction",\r
+langcode:"Language code",\r
+long_desc:"Long description link",\r
+style:"Style",\r
+classes:"Classes",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+id:"Id",\r
+map:"Image map",\r
+swap_image:"Swap image",\r
+alt_image:"Alternative image",\r
+mouseover:"for mouse over",\r
+mouseout:"for mouse out",\r
+misc:"Miscellaneous",\r
+example_img:"Appearance preview image",\r
+missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",\r
+dialog_title:"Insert/edit image",\r
+src:"Image URL",\r
+alt:"Image description",\r
+list:"Image list",\r
+border:"Border",\r
+dimensions:"Dimensions",\r
+vspace:"Vertical space",\r
+hspace:"Horizontal space",\r
+align:"Alignment",\r
+align_baseline:"Baseline",\r
+align_top:"Top",\r
+align_middle:"Middle",\r
+align_bottom:"Bottom",\r
+align_texttop:"Text top",\r
+align_textbottom:"Text bottom",\r
+align_left:"Left",\r
+align_right:"Right",\r
+image_list:"Image list"\r
+});
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n('fr.advimage_dlg',{image_list:"Liste d\'images",align_right:"Droite (flottant)",align_left:"Gauche (flottant)",align_textbottom:"Texte en bas",align_texttop:"Texte en haut",align_bottom:"En bas",align_middle:"Au milieu",align_top:"En haut",align_baseline:"Normal",align:"Alignement",hspace:"Espacement horizontal",vspace:"Espacement vertical",dimensions:"Dimensions",border:"Bordure",list:"Liste d\'images",alt:"Description de l\'image",src:"URL de l\'image",dialog_title:"Ins\u00e9rer / \u00e9diter une image",missing_alt:"\u00cates-vous s\u00fbr de vouloir continuer sans d\u00e9finir de description pour l\'image ? Sans elle, l\'image peut ne pas \u00eatre accessible \u00e0 certains utilisateurs handicap\u00e9s, ceux utilisant un navigateur texte ou ceux qui naviguent sans affichage des images.",example_img:"Apparence de l\'image",misc:"Divers",mouseout:"\u00e0 la sortie de la souris",mouseover:"au survol de la souris",alt_image:"Image alternative",swap_image:"Image de remplacement",map:"Image cliquable",id:"Id",rtl:"De droite \u00e0 gauche",ltr:"De gauche \u00e0 droite",classes:"Classes",style:"Style",long_desc:"Description longue du lien",langcode:"Code de la langue",langdir:"Sens de lecture",constrain_proportions:"Conserver les proportions",preview:"Pr\u00e9visualisation",title:"Titre",general:"G\u00e9n\u00e9ral",tab_advanced:"Avanc\u00e9",tab_appearance:"Apparence",tab_general:"G\u00e9n\u00e9ral"});
\ No newline at end of file
--- /dev/null
+.mceLinkList, .mceAnchorList, #targetlist {width:280px;}\r
+.mceActionPanel {margin-top:7px;}\r
+.panel_wrapper div.current {height:320px;}\r
+#classlist, #title, #href {width:280px;}\r
+#popupurl, #popupname {width:200px;}\r
+#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}\r
+#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}\r
+#events_panel input {width:200px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {\r
+ init : function(ed, url) {\r
+ this.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceAdvLink', function() {\r
+ var se = ed.selection;\r
+\r
+ // No selection and not in link\r
+ if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))\r
+ return;\r
+\r
+ ed.windowManager.open({\r
+ file : url + '/link.htm',\r
+ width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),\r
+ height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('link', {\r
+ title : 'advlink.link_desc',\r
+ cmd : 'mceAdvLink'\r
+ });\r
+\r
+ ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n, co) {\r
+ cm.setDisabled('link', co && n.nodeName != 'A');\r
+ cm.setActive('link', n.nodeName == 'A' && !n.name);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced link',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+/* Functions for the advlink plugin popup */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var templates = {\r
+ "window.open" : "window.open('${url}','${target}','${options}')"\r
+};\r
+\r
+function preinit() {\r
+ var url;\r
+\r
+ if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+}\r
+\r
+function changeClass() {\r
+ var f = document.forms[0];\r
+\r
+ f.classes.value = getSelectValue(f, 'classlist');\r
+}\r
+\r
+function init() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ var formObj = document.forms[0];\r
+ var inst = tinyMCEPopup.editor;\r
+ var elm = inst.selection.getNode();\r
+ var action = "insert";\r
+ var html;\r
+\r
+ document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');\r
+ document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');\r
+ document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');\r
+ document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');\r
+ document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');\r
+\r
+ // Link list\r
+ html = getLinkListHTML('linklisthref','href');\r
+ if (html == "")\r
+ document.getElementById("linklisthrefrow").style.display = 'none';\r
+ else\r
+ document.getElementById("linklisthrefcontainer").innerHTML = html;\r
+\r
+ // Resize some elements\r
+ if (isVisible('hrefbrowser'))\r
+ document.getElementById('href').style.width = '260px';\r
+\r
+ if (isVisible('popupurlbrowser'))\r
+ document.getElementById('popupurl').style.width = '180px';\r
+\r
+ elm = inst.dom.getParent(elm, "A");\r
+ if (elm != null && elm.nodeName == "A")\r
+ action = "update";\r
+\r
+ formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); \r
+\r
+ setPopupControlsDisabled(true);\r
+\r
+ if (action == "update") {\r
+ var href = inst.dom.getAttrib(elm, 'href');\r
+ var onclick = inst.dom.getAttrib(elm, 'onclick');\r
+\r
+ // Setup form data\r
+ setFormValue('href', href);\r
+ setFormValue('title', inst.dom.getAttrib(elm, 'title'));\r
+ setFormValue('id', inst.dom.getAttrib(elm, 'id'));\r
+ setFormValue('style', inst.dom.getAttrib(elm, "style"));\r
+ setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));\r
+ setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));\r
+ setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));\r
+ setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));\r
+ setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));\r
+ setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));\r
+ setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
+ setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
+ setFormValue('type', inst.dom.getAttrib(elm, 'type'));\r
+ setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));\r
+ setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));\r
+ setFormValue('onclick', onclick);\r
+ setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));\r
+ setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));\r
+ setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));\r
+ setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));\r
+ setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));\r
+ setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));\r
+ setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));\r
+ setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));\r
+ setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));\r
+ setFormValue('target', inst.dom.getAttrib(elm, 'target'));\r
+ setFormValue('classes', inst.dom.getAttrib(elm, 'class'));\r
+\r
+ // Parse onclick data\r
+ if (onclick != null && onclick.indexOf('window.open') != -1)\r
+ parseWindowOpen(onclick);\r
+ else\r
+ parseFunction(onclick);\r
+\r
+ // Select by the values\r
+ selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));\r
+ selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));\r
+ selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));\r
+ selectByValue(formObj, 'linklisthref', href);\r
+\r
+ if (href.charAt(0) == '#')\r
+ selectByValue(formObj, 'anchorlist', href);\r
+\r
+ addClassesToList('classlist', 'advlink_styles');\r
+\r
+ selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);\r
+ selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);\r
+ } else\r
+ addClassesToList('classlist', 'advlink_styles');\r
+}\r
+\r
+function checkPrefix(n) {\r
+ if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))\r
+ n.value = 'mailto:' + n.value;\r
+\r
+ if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))\r
+ n.value = 'http://' + n.value;\r
+}\r
+\r
+function setFormValue(name, value) {\r
+ document.forms[0].elements[name].value = value;\r
+}\r
+\r
+function parseWindowOpen(onclick) {\r
+ var formObj = document.forms[0];\r
+\r
+ // Preprocess center code\r
+ if (onclick.indexOf('return false;') != -1) {\r
+ formObj.popupreturn.checked = true;\r
+ onclick = onclick.replace('return false;', '');\r
+ } else\r
+ formObj.popupreturn.checked = false;\r
+\r
+ var onClickData = parseLink(onclick);\r
+\r
+ if (onClickData != null) {\r
+ formObj.ispopup.checked = true;\r
+ setPopupControlsDisabled(false);\r
+\r
+ var onClickWindowOptions = parseOptions(onClickData['options']);\r
+ var url = onClickData['url'];\r
+\r
+ formObj.popupname.value = onClickData['target'];\r
+ formObj.popupurl.value = url;\r
+ formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');\r
+ formObj.popupheight.value = getOption(onClickWindowOptions, 'height');\r
+\r
+ formObj.popupleft.value = getOption(onClickWindowOptions, 'left');\r
+ formObj.popuptop.value = getOption(onClickWindowOptions, 'top');\r
+\r
+ if (formObj.popupleft.value.indexOf('screen') != -1)\r
+ formObj.popupleft.value = "c";\r
+\r
+ if (formObj.popuptop.value.indexOf('screen') != -1)\r
+ formObj.popuptop.value = "c";\r
+\r
+ formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";\r
+ formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";\r
+ formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";\r
+ formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";\r
+ formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";\r
+ formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";\r
+ formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";\r
+\r
+ buildOnClick();\r
+ }\r
+}\r
+\r
+function parseFunction(onclick) {\r
+ var formObj = document.forms[0];\r
+ var onClickData = parseLink(onclick);\r
+\r
+ // TODO: Add stuff here\r
+}\r
+\r
+function getOption(opts, name) {\r
+ return typeof(opts[name]) == "undefined" ? "" : opts[name];\r
+}\r
+\r
+function setPopupControlsDisabled(state) {\r
+ var formObj = document.forms[0];\r
+\r
+ formObj.popupname.disabled = state;\r
+ formObj.popupurl.disabled = state;\r
+ formObj.popupwidth.disabled = state;\r
+ formObj.popupheight.disabled = state;\r
+ formObj.popupleft.disabled = state;\r
+ formObj.popuptop.disabled = state;\r
+ formObj.popuplocation.disabled = state;\r
+ formObj.popupscrollbars.disabled = state;\r
+ formObj.popupmenubar.disabled = state;\r
+ formObj.popupresizable.disabled = state;\r
+ formObj.popuptoolbar.disabled = state;\r
+ formObj.popupstatus.disabled = state;\r
+ formObj.popupreturn.disabled = state;\r
+ formObj.popupdependent.disabled = state;\r
+\r
+ setBrowserDisabled('popupurlbrowser', state);\r
+}\r
+\r
+function parseLink(link) {\r
+ link = link.replace(new RegExp(''', 'g'), "'");\r
+\r
+ var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");\r
+\r
+ // Is function name a template function\r
+ var template = templates[fnName];\r
+ if (template) {\r
+ // Build regexp\r
+ var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));\r
+ var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";\r
+ var replaceStr = "";\r
+ for (var i=0; i<variableNames.length; i++) {\r
+ // Is string value\r
+ if (variableNames[i].indexOf("'${") != -1)\r
+ regExp += "'(.*)'";\r
+ else // Number value\r
+ regExp += "([0-9]*)";\r
+\r
+ replaceStr += "$" + (i+1);\r
+\r
+ // Cleanup variable name\r
+ variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");\r
+\r
+ if (i != variableNames.length-1) {\r
+ regExp += "\\s*,\\s*";\r
+ replaceStr += "<delim>";\r
+ } else\r
+ regExp += ".*";\r
+ }\r
+\r
+ regExp += "\\);?";\r
+\r
+ // Build variable array\r
+ var variables = [];\r
+ variables["_function"] = fnName;\r
+ var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');\r
+ for (var i=0; i<variableNames.length; i++)\r
+ variables[variableNames[i]] = variableValues[i];\r
+\r
+ return variables;\r
+ }\r
+\r
+ return null;\r
+}\r
+\r
+function parseOptions(opts) {\r
+ if (opts == null || opts == "")\r
+ return [];\r
+\r
+ // Cleanup the options\r
+ opts = opts.toLowerCase();\r
+ opts = opts.replace(/;/g, ",");\r
+ opts = opts.replace(/[^0-9a-z=,]/g, "");\r
+\r
+ var optionChunks = opts.split(',');\r
+ var options = [];\r
+\r
+ for (var i=0; i<optionChunks.length; i++) {\r
+ var parts = optionChunks[i].split('=');\r
+\r
+ if (parts.length == 2)\r
+ options[parts[0]] = parts[1];\r
+ }\r
+\r
+ return options;\r
+}\r
+\r
+function buildOnClick() {\r
+ var formObj = document.forms[0];\r
+\r
+ if (!formObj.ispopup.checked) {\r
+ formObj.onclick.value = "";\r
+ return;\r
+ }\r
+\r
+ var onclick = "window.open('";\r
+ var url = formObj.popupurl.value;\r
+\r
+ onclick += url + "','";\r
+ onclick += formObj.popupname.value + "','";\r
+\r
+ if (formObj.popuplocation.checked)\r
+ onclick += "location=yes,";\r
+\r
+ if (formObj.popupscrollbars.checked)\r
+ onclick += "scrollbars=yes,";\r
+\r
+ if (formObj.popupmenubar.checked)\r
+ onclick += "menubar=yes,";\r
+\r
+ if (formObj.popupresizable.checked)\r
+ onclick += "resizable=yes,";\r
+\r
+ if (formObj.popuptoolbar.checked)\r
+ onclick += "toolbar=yes,";\r
+\r
+ if (formObj.popupstatus.checked)\r
+ onclick += "status=yes,";\r
+\r
+ if (formObj.popupdependent.checked)\r
+ onclick += "dependent=yes,";\r
+\r
+ if (formObj.popupwidth.value != "")\r
+ onclick += "width=" + formObj.popupwidth.value + ",";\r
+\r
+ if (formObj.popupheight.value != "")\r
+ onclick += "height=" + formObj.popupheight.value + ",";\r
+\r
+ if (formObj.popupleft.value != "") {\r
+ if (formObj.popupleft.value != "c")\r
+ onclick += "left=" + formObj.popupleft.value + ",";\r
+ else\r
+ onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";\r
+ }\r
+\r
+ if (formObj.popuptop.value != "") {\r
+ if (formObj.popuptop.value != "c")\r
+ onclick += "top=" + formObj.popuptop.value + ",";\r
+ else\r
+ onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";\r
+ }\r
+\r
+ if (onclick.charAt(onclick.length-1) == ',')\r
+ onclick = onclick.substring(0, onclick.length-1);\r
+\r
+ onclick += "');";\r
+\r
+ if (formObj.popupreturn.checked)\r
+ onclick += "return false;";\r
+\r
+ // tinyMCE.debug(onclick);\r
+\r
+ formObj.onclick.value = onclick;\r
+\r
+ if (formObj.href.value == "")\r
+ formObj.href.value = url;\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+ var formObj = document.forms[0];\r
+ var valueElm = formObj.elements[attrib.toLowerCase()];\r
+ var dom = tinyMCEPopup.editor.dom;\r
+\r
+ if (typeof(value) == "undefined" || value == null) {\r
+ value = "";\r
+\r
+ if (valueElm)\r
+ value = valueElm.value;\r
+ }\r
+\r
+ // Clean up the style\r
+ if (attrib == 'style')\r
+ value = dom.serializeStyle(dom.parseStyle(value), 'a');\r
+\r
+ dom.setAttrib(elm, attrib, value);\r
+}\r
+\r
+function getAnchorListHTML(id, target) {\r
+ var inst = tinyMCEPopup.editor;\r
+ var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;\r
+ var html = "";\r
+\r
+ html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';\r
+ html += 'this.options[this.selectedIndex].value;">';\r
+ html += '<option value="">---</option>';\r
+\r
+ for (i=0; i<nodes.length; i++) {\r
+ if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")\r
+ html += '<option value="#' + name + '">' + name + '</option>';\r
+ }\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+}\r
+\r
+function insertAction() {\r
+ var inst = tinyMCEPopup.editor;\r
+ var elm, elementArray, i;\r
+\r
+ elm = inst.selection.getNode();\r
+ checkPrefix(document.forms[0].href);\r
+\r
+ elm = inst.dom.getParent(elm, "A");\r
+\r
+ // Remove element if there is no href\r
+ if (!document.forms[0].href.value) {\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+ i = inst.selection.getBookmark();\r
+ inst.dom.remove(elm, 1);\r
+ inst.selection.moveToBookmark(i);\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+\r
+ // Create new anchor elements\r
+ if (elm == null) {\r
+ inst.getDoc().execCommand("unlink", false, null);\r
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});\r
+\r
+ elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});\r
+ for (i=0; i<elementArray.length; i++)\r
+ setAllAttribs(elm = elementArray[i]);\r
+ } else\r
+ setAllAttribs(elm);\r
+\r
+ // Don't move caret if selection was image\r
+ if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {\r
+ inst.focus();\r
+ inst.selection.select(elm);\r
+ inst.selection.collapse(0);\r
+ tinyMCEPopup.storeSelection();\r
+ }\r
+\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function setAllAttribs(elm) {\r
+ var formObj = document.forms[0];\r
+ var href = formObj.href.value;\r
+ var target = getSelectValue(formObj, 'targetlist');\r
+\r
+ setAttrib(elm, 'href', href);\r
+ setAttrib(elm, 'title');\r
+ setAttrib(elm, 'target', target == '_self' ? '' : target);\r
+ setAttrib(elm, 'id');\r
+ setAttrib(elm, 'style');\r
+ setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));\r
+ setAttrib(elm, 'rel');\r
+ setAttrib(elm, 'rev');\r
+ setAttrib(elm, 'charset');\r
+ setAttrib(elm, 'hreflang');\r
+ setAttrib(elm, 'dir');\r
+ setAttrib(elm, 'lang');\r
+ setAttrib(elm, 'tabindex');\r
+ setAttrib(elm, 'accesskey');\r
+ setAttrib(elm, 'type');\r
+ setAttrib(elm, 'onfocus');\r
+ setAttrib(elm, 'onblur');\r
+ setAttrib(elm, 'onclick');\r
+ setAttrib(elm, 'ondblclick');\r
+ setAttrib(elm, 'onmousedown');\r
+ setAttrib(elm, 'onmouseup');\r
+ setAttrib(elm, 'onmouseover');\r
+ setAttrib(elm, 'onmousemove');\r
+ setAttrib(elm, 'onmouseout');\r
+ setAttrib(elm, 'onkeypress');\r
+ setAttrib(elm, 'onkeydown');\r
+ setAttrib(elm, 'onkeyup');\r
+\r
+ // Refresh in old MSIE\r
+ if (tinyMCE.isMSIE5)\r
+ elm.outerHTML = elm.outerHTML;\r
+}\r
+\r
+function getSelectValue(form_obj, field_name) {\r
+ var elm = form_obj.elements[field_name];\r
+\r
+ if (!elm || elm.options == null || elm.selectedIndex == -1)\r
+ return "";\r
+\r
+ return elm.options[elm.selectedIndex].value;\r
+}\r
+\r
+function getLinkListHTML(elm_id, target_form_element, onchange_func) {\r
+ if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)\r
+ return "";\r
+\r
+ var html = "";\r
+\r
+ html += '<select id="' + elm_id + '" name="' + elm_id + '"';\r
+ html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';\r
+ html += 'this.options[this.selectedIndex].value;';\r
+\r
+ if (typeof(onchange_func) != "undefined")\r
+ html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';\r
+\r
+ html += '"><option value="">---</option>';\r
+\r
+ for (var i=0; i<tinyMCELinkList.length; i++)\r
+ html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+\r
+ // tinyMCE.debug('-- image list start --', html, '-- image list end --');\r
+}\r
+\r
+function getTargetListHTML(elm_id, target_form_element) {\r
+ var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');\r
+ var html = '';\r
+\r
+ html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';\r
+ html += 'this.options[this.selectedIndex].value;">';\r
+ html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';\r
+ html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';\r
+ html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';\r
+ html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';\r
+\r
+ for (var i=0; i<targets.length; i++) {\r
+ var key, value;\r
+\r
+ if (targets[i] == "")\r
+ continue;\r
+\r
+ key = targets[i].split('=')[0];\r
+ value = targets[i].split('=')[1];\r
+\r
+ html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';\r
+ }\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+}\r
+\r
+// While loading\r
+preinit();\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.advlink_dlg',{\r
+title:"Insert/edit link",\r
+url:"Link URL",\r
+target:"Target",\r
+titlefield:"Title",\r
+is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",\r
+is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",\r
+list:"Link list",\r
+general_tab:"General",\r
+popup_tab:"Popup",\r
+events_tab:"Events",\r
+advanced_tab:"Advanced",\r
+general_props:"General properties",\r
+popup_props:"Popup properties",\r
+event_props:"Events",\r
+advanced_props:"Advanced properties",\r
+popup_opts:"Options",\r
+anchor_names:"Anchors",\r
+target_same:"Open in this window / frame",\r
+target_parent:"Open in parent window / frame",\r
+target_top:"Open in top frame (replaces all frames)",\r
+target_blank:"Open in new window",\r
+popup:"Javascript popup",\r
+popup_url:"Popup URL",\r
+popup_name:"Window name",\r
+popup_return:"Insert 'return false'",\r
+popup_scrollbars:"Show scrollbars",\r
+popup_statusbar:"Show status bar",\r
+popup_toolbar:"Show toolbars",\r
+popup_menubar:"Show menu bar",\r
+popup_location:"Show location bar",\r
+popup_resizable:"Make window resizable",\r
+popup_dependent:"Dependent (Mozilla/Firefox only)",\r
+popup_size:"Size",\r
+popup_position:"Position (X/Y)",\r
+id:"Id",\r
+style:"Style",\r
+classes:"Classes",\r
+target_name:"Target name",\r
+langdir:"Language direction",\r
+target_langcode:"Target language",\r
+langcode:"Language code",\r
+encoding:"Target character encoding",\r
+mime:"Target MIME type",\r
+rel:"Relationship page to target",\r
+rev:"Relationship target to page",\r
+tabindex:"Tabindex",\r
+accesskey:"Accesskey",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+link_list:"Link list"\r
+});
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n('fr.advlink_dlg',{target_name:"Nom de la cible",classes:"Classes",style:"Style",id:"Id",popup_position:"Position (X/Y)",langdir:"Sens de lecture",popup_size:"Taille",popup_dependent:"D\u00e9pendante (seulement sous Mozilla/Firefox)",popup_resizable:"Autoriser le redimensionnement de la fen\u00eatre",popup_location:"Afficher la barre d\'adresse",popup_menubar:"Afficher la barre de menu",popup_toolbar:"Afficher la barre d\'outils",popup_statusbar:"Afficher la barre d\'\u00e9tat",popup_scrollbars:"Afficher les ascenseurs",popup_return:"Ins\u00e9rer \'return false\'",popup_name:"Nom de la fen\u00eatre",popup_url:"URL de la popup",popup:"Popup Javascript",target_blank:"Ouvrir dans une nouvelle fen\u00eatre",target_top:"Ouvrir dans le cadre principal (remplace tous les cadres)",target_parent:"Ouvrir dans la fen\u00eatre / le cadre parent",target_same:"Ouvrir dans cette fen\u00eatre / dans ce cadre",anchor_names:"Ancres",popup_opts:"Options",advanced_props:"Propri\u00e9t\u00e9s avanc\u00e9es",event_props:"\u00c9v\u00e8nements",popup_props:"Propri\u00e9t\u00e9s de la popup",general_props:"Propri\u00e9t\u00e9s g\u00e9n\u00e9rales",advanced_tab:"Avanc\u00e9",events_tab:"\u00c9v\u00e8nements",popup_tab:"Popup",general_tab:"G\u00e9n\u00e9ral",list:"Liste de liens",is_external:"L\'URL que vous avez saisie semble \u00eatre une adresse web externe. Souhaitez-vous ajouter le pr\u00e9fixe \u00ab http:// \u00bb ?",is_email:"L\'URL que vous avez saisie semble \u00eatre une adresse e-mail, souhaitez-vous ajouter le pr\u00e9fixe \u00ab mailto: \u00bb ?",titlefield:"Titre",target:"Cible",url:"URL du lien",title:"Ins\u00e9rer / \u00e9diter un lien",link_list:"Liste des liens",rtl:"Droite \u00e0 gauche",ltr:"Gauche \u00e0 droite",accesskey:"Touche d\'acc\u00e8s rapide",tabindex:"Tabindex",rev:"Relation de la cible \u00e0 la page",rel:"Relation de la page \u00e0 la cible",mime:"Type MIME de la cible",encoding:"Encodage de la cible",langcode:"Code de la langue",target_langcode:"Langue de la cible"});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advlink_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="js/advlink.js"></script>\r
+ <link href="css/advlink.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advlink" style="display: none">\r
+ <form onsubmit="insertAction();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>\r
+ <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>\r
+ <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.general_props}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>\r
+ <td><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>\r
+ <td id="hrefbrowsercontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr id="linklisthrefrow">\r
+ <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>\r
+ <td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>\r
+ <td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>\r
+ <td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>\r
+ <td><input id="title" name="title" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
+ <td>\r
+ <select id="classlist" name="classlist" onchange="changeClass();">\r
+ <option value="" selected="selected">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="popup_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.popup_props}</legend>\r
+\r
+ <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />\r
+ <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td>\r
+ <td>\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>\r
+ <td id="popupurlbrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td>\r
+ <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label>{#advlink_dlg.popup_size}</label> </td>\r
+ <td class="nowrap">\r
+ <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x\r
+ <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label> </td>\r
+ <td class="nowrap">\r
+ <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> / \r
+ <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)\r
+ </td>\r
+ </tr>\r
+ </table>\r
+\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.popup_opts}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>\r
+ <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>\r
+ </tr>\r
+ <tr>\r
+ <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>\r
+ <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>\r
+ </tr>\r
+ <tr>\r
+ <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>\r
+ <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>\r
+ </tr>\r
+ <tr>\r
+ <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>\r
+ <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>\r
+ <td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.advanced_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>\r
+ <td><input type="text" id="style" name="style" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>\r
+ <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>\r
+ <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#advlink_dlg.ltr}</option> \r
+ <option value="rtl">{#advlink_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>\r
+ <td><input type="text" id="hreflang" name="hreflang" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>\r
+ <td><input type="text" id="charset" name="charset" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>\r
+ <td><input type="text" id="type" name="type" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>\r
+ <td><select id="rel" name="rel"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="lightbox">Lightbox</option> \r
+ <option value="alternate">Alternate</option> \r
+ <option value="designates">Designates</option> \r
+ <option value="stylesheet">Stylesheet</option> \r
+ <option value="start">Start</option> \r
+ <option value="next">Next</option> \r
+ <option value="prev">Prev</option> \r
+ <option value="contents">Contents</option> \r
+ <option value="index">Index</option> \r
+ <option value="glossary">Glossary</option> \r
+ <option value="copyright">Copyright</option> \r
+ <option value="chapter">Chapter</option> \r
+ <option value="subsection">Subsection</option> \r
+ <option value="appendix">Appendix</option> \r
+ <option value="help">Help</option> \r
+ <option value="bookmark">Bookmark</option>\r
+ <option value="nofollow">No Follow</option>\r
+ <option value="tag">Tag</option>\r
+ </select> \r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>\r
+ <td><select id="rev" name="rev"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="alternate">Alternate</option> \r
+ <option value="designates">Designates</option> \r
+ <option value="stylesheet">Stylesheet</option> \r
+ <option value="start">Start</option> \r
+ <option value="next">Next</option> \r
+ <option value="prev">Prev</option> \r
+ <option value="contents">Contents</option> \r
+ <option value="index">Index</option> \r
+ <option value="glossary">Glossary</option> \r
+ <option value="copyright">Copyright</option> \r
+ <option value="chapter">Chapter</option> \r
+ <option value="subsection">Subsection</option> \r
+ <option value="appendix">Appendix</option> \r
+ <option value="help">Help</option> \r
+ <option value="bookmark">Bookmark</option> \r
+ </select> \r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>\r
+ <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>\r
+ <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.event_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label for="onfocus">onfocus</label></td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onblur">onblur</label></td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onclick">onclick</label></td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="ondblclick">ondblclick</label></td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmousedown">onmousedown</label></td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmouseup">onmouseup</label></td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmouseover">onmouseover</label></td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmousemove">onmousemove</label></td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmouseout">onmouseout</label></td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onkeypress">onkeypress</label></td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onkeydown">onkeydown</label></td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onkeyup">onkeyup</label></td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.plugins.AdvListPlugin', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ function buildFormats(str) {\r
+ var formats = [];\r
+\r
+ each(str.split(/,/), function(type) {\r
+ formats.push({\r
+ title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),\r
+ styles : {\r
+ listStyleType : type == 'default' ? '' : type\r
+ }\r
+ });\r
+ });\r
+\r
+ return formats;\r
+ };\r
+\r
+ // Setup number formats from config or default\r
+ t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");\r
+ t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");\r
+ },\r
+\r
+ createControl: function(name, cm) {\r
+ var t = this, btn, format;\r
+\r
+ if (name == 'numlist' || name == 'bullist') {\r
+ // Default to first item if it's a default item\r
+ if (t[name][0].title == 'advlist.def')\r
+ format = t[name][0];\r
+\r
+ function hasFormat(node, format) {\r
+ var state = true;\r
+\r
+ each(format.styles, function(value, name) {\r
+ // Format doesn't match\r
+ if (t.editor.dom.getStyle(node, name) != value) {\r
+ state = false;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return state;\r
+ };\r
+\r
+ function applyListFormat() {\r
+ var list, ed = t.editor, dom = ed.dom, sel = ed.selection;\r
+\r
+ // Check for existing list element\r
+ list = dom.getParent(sel.getNode(), 'ol,ul');\r
+\r
+ // Switch/add list type if needed\r
+ if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))\r
+ ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');\r
+\r
+ // Append styles to new list element\r
+ if (format) {\r
+ list = dom.getParent(sel.getNode(), 'ol,ul');\r
+\r
+ if (list) {\r
+ dom.setStyles(list, format.styles);\r
+ list.removeAttribute('_mce_style');\r
+ }\r
+ }\r
+ };\r
+\r
+ btn = cm.createSplitButton(name, {\r
+ title : 'advanced.' + name + '_desc',\r
+ 'class' : 'mce_' + name,\r
+ onclick : function() {\r
+ applyListFormat();\r
+ }\r
+ });\r
+\r
+ btn.onRenderMenu.add(function(btn, menu) {\r
+ menu.onShowMenu.add(function() {\r
+ var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList;\r
+\r
+ if (list || format) {\r
+ fmtList = t[name];\r
+\r
+ // Unselect existing items\r
+ each(menu.items, function(item) {\r
+ var state = true;\r
+\r
+ item.setSelected(0);\r
+\r
+ if (list && !item.isDisabled()) {\r
+ each(fmtList, function(fmt) {\r
+ if (fmt.id == item.id) {\r
+ if (!hasFormat(list, fmt)) {\r
+ state = false;\r
+ return false;\r
+ }\r
+ }\r
+ });\r
+\r
+ if (state)\r
+ item.setSelected(1);\r
+ }\r
+ });\r
+\r
+ // Select the current format\r
+ if (!list)\r
+ menu.items[format.id].setSelected(1);\r
+ }\r
+ });\r
+\r
+ menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+ each(t[name], function(item) {\r
+ item.id = t.editor.dom.uniqueId();\r
+\r
+ menu.add({id : item.id, title : item.title, onclick : function() {\r
+ format = item;\r
+ applyListFormat();\r
+ }});\r
+ });\r
+ });\r
+\r
+ return btn;\r
+ }\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced lists',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
\ No newline at end of file
--- /dev/null
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ /**
+ * Auto Resize
+ *
+ * This plugin automatically resizes the content area to fit its content height.
+ * It will retain a minimum height, which is the height of the content area when
+ * it's initialized.
+ */
+ tinymce.create('tinymce.plugins.AutoResizePlugin', {
+ /**
+ * Initializes the plugin, this will be executed after the plugin has been created.
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
+ * of the editor instance to intercept that event.
+ *
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+ * @param {string} url Absolute URL to where the plugin is located.
+ */
+ init : function(ed, url) {
+ var t = this;
+
+ if (ed.getParam('fullscreen_is_enabled'))
+ return;
+
+ /**
+ * This method gets executed each time the editor needs to resize.
+ */
+ function resize() {
+ var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
+
+ // Get height differently depending on the browser used
+ myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
+
+ // Don't make it smaller than the minimum height
+ if (myHeight > t.autoresize_min_height)
+ resizeHeight = myHeight;
+
+ // Resize content element
+ DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
+
+ // if we're throbbing, we'll re-throb to match the new size
+ if (t.throbbing) {
+ ed.setProgressState(false);
+ ed.setProgressState(true);
+ }
+ };
+
+ t.editor = ed;
+
+ // Define minimum height
+ t.autoresize_min_height = ed.getElement().offsetHeight;
+
+ // Add appropriate listeners for resizing content area
+ ed.onChange.add(resize);
+ ed.onSetContent.add(resize);
+ ed.onPaste.add(resize);
+ ed.onKeyUp.add(resize);
+ ed.onPostRender.add(resize);
+
+ if (ed.getParam('autoresize_on_init', true)) {
+ // Things to do when the editor is ready
+ ed.onInit.add(function(ed, l) {
+ // Show throbber until content area is resized properly
+ ed.setProgressState(true);
+ t.throbbing = true;
+
+ // Hide scrollbars
+ ed.getBody().style.overflowY = "hidden";
+ });
+
+ ed.onLoadContent.add(function(ed, l) {
+ resize();
+
+ // Because the content area resizes when its content CSS loads,
+ // and we can't easily add a listener to its onload event,
+ // we'll just trigger a resize after a short loading period
+ setTimeout(function() {
+ resize();
+
+ // Disable throbber
+ ed.setProgressState(false);
+ t.throbbing = false;
+ }, 1250);
+ });
+ }
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+ ed.addCommand('mceAutoResize', resize);
+ },
+
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ getInfo : function() {
+ return {
+ longname : 'Auto Resize',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
+})();
\ No newline at end of file
--- /dev/null
+(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();m.save("TinyMCE")},getItem:function(l){var m=i.getElement();m.load("TinyMCE");return m.getAttribute(l)},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ *\r
+ * Adds auto-save capability to the TinyMCE text editor to rescue content\r
+ * inadvertently lost. This plugin was originally developed by Speednet\r
+ * and that project can be found here: http://code.google.com/p/tinyautosave/\r
+ *\r
+ * TECHNOLOGY DISCUSSION:\r
+ * \r
+ * The plugin attempts to use the most advanced features available in the current browser to save\r
+ * as much content as possible. There are a total of four different methods used to autosave the\r
+ * content. In order of preference, they are:\r
+ * \r
+ * 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain\r
+ * on the client computer. Data stored in the localStorage area has no expiration date, so we must\r
+ * manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed\r
+ * to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As\r
+ * HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,\r
+ * localStorage is stored in the following folder:\r
+ * C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]\r
+ * \r
+ * 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,\r
+ * except it is designed to expire after a certain amount of time. Because the specification\r
+ * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and\r
+ * manage the expiration ourselves. sessionStorage has similar storage characteristics to\r
+ * localStorage, although it seems to have better support by Firefox 3 at the moment. (That will\r
+ * certainly change as Firefox continues getting better at HTML 5 adoption.)\r
+ * \r
+ * 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a\r
+ * way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client\r
+ * computer. The feature is available for IE 5+, which makes it available for every version of IE\r
+ * supported by TinyMCE. The content is persistent across browser restarts and expires on the\r
+ * date/time specified, just like a cookie. However, the data is not cleared when the user clears\r
+ * cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData,\r
+ * like other Microsoft IE browser technologies, is implemented as a behavior attached to a\r
+ * specific DOM object, so in this case we attach the behavior to the same DOM element that the\r
+ * TinyMCE editor instance is attached to.\r
+ */\r
+\r
+(function(tinymce) {\r
+ // Setup constants to help the compressor to reduce script size\r
+ var PLUGIN_NAME = 'autosave',\r
+ RESTORE_DRAFT = 'restoredraft',\r
+ TRUE = true,\r
+ undefined,\r
+ unloadHandlerAdded,\r
+ Dispatcher = tinymce.util.Dispatcher;\r
+\r
+ /**\r
+ * This plugin adds auto-save capability to the TinyMCE text editor to rescue content\r
+ * inadvertently lost. By using localStorage.\r
+ *\r
+ * @class tinymce.plugins.AutoSave\r
+ */\r
+ tinymce.create('tinymce.plugins.AutoSave', {\r
+ /**\r
+ * Initializes the plugin, this will be executed after the plugin has been created.\r
+ * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+ * of the editor instance to intercept that event.\r
+ *\r
+ * @method init\r
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+ * @param {string} url Absolute URL to where the plugin is located.\r
+ */\r
+ init : function(ed, url) {\r
+ var self = this, settings = ed.settings;\r
+\r
+ self.editor = ed;\r
+\r
+ // Parses the specified time string into a milisecond number 10m, 10s etc.\r
+ function parseTime(time) {\r
+ var multipels = {\r
+ s : 1000,\r
+ m : 60000\r
+ };\r
+\r
+ time = /^(\d+)([ms]?)$/.exec('' + time);\r
+\r
+ return (time[2] ? multipels[time[2]] : 1) * parseInt(time);\r
+ };\r
+\r
+ // Default config\r
+ tinymce.each({\r
+ ask_before_unload : TRUE,\r
+ interval : '30s',\r
+ retention : '20m',\r
+ minlength : 50\r
+ }, function(value, key) {\r
+ key = PLUGIN_NAME + '_' + key;\r
+\r
+ if (settings[key] === undefined)\r
+ settings[key] = value;\r
+ });\r
+\r
+ // Parse times\r
+ settings.autosave_interval = parseTime(settings.autosave_interval);\r
+ settings.autosave_retention = parseTime(settings.autosave_retention);\r
+\r
+ // Register restore button\r
+ ed.addButton(RESTORE_DRAFT, {\r
+ title : PLUGIN_NAME + ".restore_content",\r
+ onclick : function() {\r
+ if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {\r
+ // Show confirm dialog if the editor isn't empty\r
+ ed.windowManager.confirm(\r
+ PLUGIN_NAME + ".warning_message",\r
+ function(ok) {\r
+ if (ok)\r
+ self.restoreDraft();\r
+ }\r
+ );\r
+ } else\r
+ self.restoreDraft();\r
+ }\r
+ });\r
+\r
+ // Enable/disable restoredraft button depending on if there is a draft stored or not\r
+ ed.onNodeChange.add(function() {\r
+ var controlManager = ed.controlManager;\r
+\r
+ if (controlManager.get(RESTORE_DRAFT))\r
+ controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());\r
+ });\r
+\r
+ ed.onInit.add(function() {\r
+ // Check if the user added the restore button, then setup auto storage logic\r
+ if (ed.controlManager.get(RESTORE_DRAFT)) {\r
+ // Setup storage engine\r
+ self.setupStorage(ed);\r
+\r
+ // Auto save contents each interval time\r
+ setInterval(function() {\r
+ self.storeDraft();\r
+ ed.nodeChanged();\r
+ }, settings.autosave_interval);\r
+ }\r
+ });\r
+\r
+ /**\r
+ * This event gets fired when a draft is stored to local storage.\r
+ *\r
+ * @event onStoreDraft\r
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+ * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+ */\r
+ self.onStoreDraft = new Dispatcher(self);\r
+\r
+ /**\r
+ * This event gets fired when a draft is restored from local storage.\r
+ *\r
+ * @event onStoreDraft\r
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+ * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+ */\r
+ self.onRestoreDraft = new Dispatcher(self);\r
+\r
+ /**\r
+ * This event gets fired when a draft removed/expired.\r
+ *\r
+ * @event onRemoveDraft\r
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+ * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+ */\r
+ self.onRemoveDraft = new Dispatcher(self);\r
+\r
+ // Add ask before unload dialog only add one unload handler\r
+ if (!unloadHandlerAdded) {\r
+ window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;\r
+ unloadHandlerAdded = TRUE;\r
+ }\r
+ },\r
+\r
+ /**\r
+ * Returns information about the plugin as a name/value array.\r
+ * The current keys are longname, author, authorurl, infourl and version.\r
+ *\r
+ * @method getInfo\r
+ * @return {Object} Name/value array containing information about the plugin.\r
+ */\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Auto save',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ /**\r
+ * Returns an expiration date UTC string.\r
+ *\r
+ * @method getExpDate\r
+ * @return {String} Expiration date UTC string.\r
+ */\r
+ getExpDate : function() {\r
+ return new Date(\r
+ new Date().getTime() + this.editor.settings.autosave_retention\r
+ ).toUTCString();\r
+ },\r
+\r
+ /**\r
+ * This method will setup the storage engine. If the browser has support for it.\r
+ *\r
+ * @method setupStorage\r
+ */\r
+ setupStorage : function(ed) {\r
+ var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";\r
+\r
+ self.key = PLUGIN_NAME + ed.id;\r
+\r
+ // Loop though each storage engine type until we find one that works\r
+ tinymce.each([\r
+ function() {\r
+ // Try HTML5 Local Storage\r
+ if (localStorage) {\r
+ localStorage.setItem(testKey, testVal);\r
+\r
+ if (localStorage.getItem(testKey) === testVal) {\r
+ localStorage.removeItem(testKey);\r
+\r
+ return localStorage;\r
+ }\r
+ }\r
+ },\r
+\r
+ function() {\r
+ // Try HTML5 Session Storage\r
+ if (sessionStorage) {\r
+ sessionStorage.setItem(testKey, testVal);\r
+\r
+ if (sessionStorage.getItem(testKey) === testVal) {\r
+ sessionStorage.removeItem(testKey);\r
+\r
+ return sessionStorage;\r
+ }\r
+ }\r
+ },\r
+\r
+ function() {\r
+ // Try IE userData\r
+ if (tinymce.isIE) {\r
+ ed.getElement().style.behavior = "url('#default#userData')";\r
+\r
+ // Fake localStorage on old IE\r
+ return {\r
+ autoExpires : TRUE,\r
+\r
+ setItem : function(key, value) {\r
+ var userDataElement = ed.getElement();\r
+\r
+ userDataElement.setAttribute(key, value);\r
+ userDataElement.expires = self.getExpDate();\r
+ userDataElement.save("TinyMCE");\r
+ },\r
+\r
+ getItem : function(key) {\r
+ var userDataElement = ed.getElement();\r
+\r
+ userDataElement.load("TinyMCE");\r
+\r
+ return userDataElement.getAttribute(key);\r
+ },\r
+\r
+ removeItem : function(key) {\r
+ ed.getElement().removeAttribute(key);\r
+ }\r
+ };\r
+ }\r
+ },\r
+ ], function(setup) {\r
+ // Try executing each function to find a suitable storage engine\r
+ try {\r
+ self.storage = setup();\r
+\r
+ if (self.storage)\r
+ return false;\r
+ } catch (e) {\r
+ // Ignore\r
+ }\r
+ });\r
+ },\r
+\r
+ /**\r
+ * This method will store the current contents in the the storage engine.\r
+ *\r
+ * @method storeDraft\r
+ */\r
+ storeDraft : function() {\r
+ var self = this, storage = self.storage, editor = self.editor, expires, content;\r
+\r
+ // Is the contents dirty\r
+ if (storage) {\r
+ // If there is no existing key and the contents hasn't been changed since\r
+ // it's original value then there is no point in saving a draft\r
+ if (!storage.getItem(self.key) && !editor.isDirty())\r
+ return;\r
+\r
+ // Store contents if the contents if longer than the minlength of characters\r
+ content = editor.getContent({draft: true});\r
+ if (content.length > editor.settings.autosave_minlength) {\r
+ expires = self.getExpDate();\r
+\r
+ // Store expiration date if needed IE userData has auto expire built in\r
+ if (!self.storage.autoExpires)\r
+ self.storage.setItem(self.key + "_expires", expires);\r
+\r
+ self.storage.setItem(self.key, content);\r
+ self.onStoreDraft.dispatch(self, {\r
+ expires : expires,\r
+ content : content\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ /**\r
+ * This method will restore the contents from the storage engine back to the editor.\r
+ *\r
+ * @method restoreDraft\r
+ */\r
+ restoreDraft : function() {\r
+ var self = this, storage = self.storage;\r
+\r
+ if (storage) {\r
+ content = storage.getItem(self.key);\r
+\r
+ if (content) {\r
+ self.editor.setContent(content);\r
+ self.onRestoreDraft.dispatch(self, {\r
+ content : content\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ /**\r
+ * This method will return true/false if there is a local storage draft available.\r
+ *\r
+ * @method hasDraft\r
+ * @return {boolean} true/false state if there is a local draft.\r
+ */\r
+ hasDraft : function() {\r
+ var self = this, storage = self.storage, expDate, exists;\r
+\r
+ if (storage) {\r
+ // Does the item exist at all\r
+ exists = !!storage.getItem(self.key);\r
+ if (exists) {\r
+ // Storage needs autoexpire\r
+ if (!self.storage.autoExpires) {\r
+ expDate = new Date(storage.getItem(self.key + "_expires"));\r
+\r
+ // Contents hasn't expired\r
+ if (new Date().getTime() < expDate.getTime())\r
+ return TRUE;\r
+\r
+ // Remove it if it has\r
+ self.removeDraft();\r
+ } else\r
+ return TRUE;\r
+ }\r
+ }\r
+\r
+ return false;\r
+ },\r
+\r
+ /**\r
+ * Removes the currently stored draft.\r
+ *\r
+ * @method removeDraft\r
+ */\r
+ removeDraft : function() {\r
+ var self = this, storage = self.storage, key = self.key, content;\r
+\r
+ if (storage) {\r
+ // Get current contents and remove the existing draft\r
+ content = storage.getItem(key);\r
+ storage.removeItem(key);\r
+ storage.removeItem(key + "_expires");\r
+\r
+ // Dispatch remove event if we had any contents\r
+ if (content) {\r
+ self.onRemoveDraft.dispatch(self, {\r
+ content : content\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ "static" : {\r
+ // Internal unload handler will be called before the page is unloaded\r
+ _beforeUnloadHandler : function(e) {\r
+ var msg;\r
+\r
+ tinymce.each(tinyMCE.editors, function(ed) {\r
+ // Store a draft for each editor instance\r
+ if (ed.plugins.autosave)\r
+ ed.plugins.autosave.storeDraft();\r
+\r
+ // Never ask in fullscreen mode\r
+ if (ed.getParam("fullscreen_is_enabled"))\r
+ return;\r
+\r
+ // Setup a return message if the editor is dirty\r
+ if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))\r
+ msg = ed.getLang("autosave.unload_msg");\r
+ });\r
+\r
+ return msg;\r
+ }\r
+ }\r
+ });\r
+\r
+ tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);\r
+})(tinymce);\r
--- /dev/null
+tinyMCE.addI18n('en.autosave',{\r
+restore_content: "Restore auto-saved content",\r
+warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"\r
+});
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/ /gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.BBCodePlugin', {\r
+ init : function(ed, url) {\r
+ var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();\r
+\r
+ ed.onBeforeSetContent.add(function(ed, o) {\r
+ o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
+ });\r
+\r
+ ed.onPostProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
+\r
+ if (o.get)\r
+ o.content = t['_' + dialect + '_html2bbcode'](o.content);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ &n