Changeset 1158 in ExiteCMS


Ignore:
Timestamp:
12/03/07 21:40:54 (4 years ago)
Author:
hverton
Message:

added a locale type selection per module
fixed typo from 404handler.php
updated English language pack
fixed not being able to move a post to a thread in the same forum.post.move.tpl
getusergroups() now returns the array ordered by name
upgraded tiny_mce to version 2.1.3

Location:
trunk
Files:
69 edited

Legend:

Unmodified
Added
Removed
  • trunk/404handler.php

    r1151 r1158  
    3333            $redirect = false; 
    3434            // preserve URL parameters (if any) 
    35             if (!$data['url_parms'] && isset($_SERVER['REDIRECT_QUERY_STRING'])) { 
     35            if ($data['url_parms'] && isset($_SERVER['REDIRECT_QUERY_STRING'])) { 
    3636                if (strpos($data['url_to'], '?') === false) { 
    3737                    $data['url_to'] .= "?" . $_SERVER['REDIRECT_QUERY_STRING']; 
     
    6969        include PATH_ROOT.$url; 
    7070    } 
     71    exit; 
    7172 
    7273} else { 
     
    9697        } 
    9798    } 
     99    exit; 
    98100} 
    99101?> 
  • trunk/administration/article_cats.php

    r1151 r1158  
    2929 
    3030// compose the query where clause based on the localisation method choosen 
    31 switch ($settings['localisation_method']) { 
     31switch ($settings['article_localisation']) { 
    3232    case "none": 
    3333        $where = ""; 
  • trunk/administration/articles.php

    r1145 r1158  
    4747 
    4848// compose the query where clause based on the localisation method choosen 
    49 switch ($settings['localisation_method']) { 
     49switch ($settings['article_localisation']) { 
    5050    case "none": 
    5151        $where = ""; 
  • trunk/administration/download_cats.php

    r1150 r1158  
    165165 
    166166// compose the query where clause based on the localisation method choosen 
    167 switch ($settings['localisation_method']) { 
     167switch ($settings['download_localisation']) { 
    168168    case "none": 
    169169        $where = ""; 
  • trunk/administration/modules.php

    r1151 r1158  
    4343    $module = stripinput($_GET['module']); 
    4444 
     45    // check if it exists, if so, bail out 
     46    if (dbrows($result)) fallback(FUSION_SELF.$aidlink); 
     47 
    4548    // load the module installer 
    4649    include PATH_MODULES.$module."/module_installer.php"; 
     
    8386            $link_panel = ($mod_link['panel'] != "" ? ($mod_link['panel']."_") : "").'menu_panel'; 
    8487 
    85             // if the panel doesn't exist, use the default menu panel 
     88            // check if this panel is installed 
    8689            $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 
    87             if (dbrows($result) == 0) $link_panel = "main_menu_panel"; 
     90            if (dbrows($result) == 0) { 
     91                // if the panel doesn't exist, try to find another menu panel (if multiple are installed, pick the first one in the ordered list) 
     92                $result = dbquery("SELECT panel_filename FROM ".$db_prefix."panels WHERE panel_filename LIKE '%_menu_panel' ORDER BY panel_order LIMIT 1"); 
     93                if (dbrows($result)) { 
     94                    $data = dbarray($result); 
     95                    $link_panel = $data['panel_filename']; 
     96                } else { 
     97                    // if still not found, fall back to the CMS default 
     98                    $link_panel = "main_menu_panel"; 
     99                } 
     100            } 
    88101 
    89102            // determine the next order in the menu for this link 
     
    91104 
    92105            // add the new link 
    93             $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order, panel_name)  
    94                 VALUES ('".$mod_link['name']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 
     106            switch ($settings['sitelinks_localisation']) { 
     107                case "multiple": 
     108                    $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_active = '1'"); 
     109                    while ($data = dbarray($result)) { 
     110                        $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_locale, link_url, link_visibility, link_position, link_window, link_order, panel_name)  
     111                            VALUES ('".$mod_link['name']."', '".$data['locale_code']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 
     112                    } 
     113                    break; 
     114                default: 
     115                    $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order, panel_name)  
     116                        VALUES ('".$mod_link['name']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 
     117            } 
    95118        } 
    96119    } 
     
    154177    if (!isNum($id)) fallback(FUSION_SELF.$aidlink); 
    155178     
    156     // check if it exists 
     179    // get the module data 
    157180    $result = dbquery("SELECT * FROM ".$db_prefix."modules WHERE mod_id='$id'"); 
    158     if (!$result)  fallback(FUSION_SELF.$aidlink); 
    159  
    160     // get the module data 
    161181    $data = dbarray($result); 
    162182 
     
    204224 
    205225            // and if so, remove it and adjust the link order 
    206             if (dbrows($result2) == "1") { 
     226            if (dbrows($result2)) { 
    207227                $data2 = dbarray($result2); 
    208228                $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order-1 WHERE panel_name = '$link_panel' AND link_order>'".$data2['link_order']."'"); 
  • trunk/administration/panel_editor.php

    r1148 r1158  
    3232 
    3333// panel_locale 
    34 switch($settings['localisation_method']) { 
     34switch($settings['panels_localisation']) { 
    3535    case "multiple": 
    3636        if (!isset($panel_locale)) { 
  • trunk/administration/panels.php

    r1148 r1158  
    3131 
    3232// compose the query where clause based on the localisation method choosen 
    33 switch ($settings['localisation_method']) { 
     33switch ($settings['panels_localisation']) { 
    3434    case "none": 
    3535        $where = ""; 
  • trunk/administration/settings_languages.php

    r1145 r1158  
    3131    $settings['locale'] = stripinput($_POST['localeset']); 
    3232    $old_localeset = stripinput($_POST['old_localeset']); 
    33     $localisation_method = stripinput($_POST['localisation_method']); 
     33    $panels_localisation = stripinput($_POST['panels_localisation']); 
     34    $sitelinks_localisation = stripinput($_POST['sitelinks_localisation']); 
     35    $article_localisation = stripinput($_POST['article_localisation']); 
     36    $download_localisation = stripinput($_POST['download_localisation']); 
     37    $news_localisation = stripinput($_POST['news_localisation']); 
    3438    $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$settings['locale']."' WHERE cfg_name = 'locale'"); 
    3539    if (empty($_POST['old_country'])) { 
     
    3842        $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$_POST['country']."' WHERE cfg_name = 'country'"); 
    3943    } 
    40     $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$localisation_method."' WHERE cfg_name = 'localisation_method'"); 
     44    $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$panels_localisation."' WHERE cfg_name = 'panels_localisation'"); 
     45    $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$sitelinks_localisation."' WHERE cfg_name = 'sitelinks_localisation'"); 
     46    $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$news_localisation."' WHERE cfg_name = 'news_localisation'"); 
     47    $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$download_localisation."' WHERE cfg_name = 'download_localisation'"); 
     48    $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$article_localisation."' WHERE cfg_name = 'article_localisation'"); 
    4149    redirect(FUSION_SELF.$aidlink); 
    4250} 
  • trunk/administration/site_links.php

    r1151 r1158  
    3131 
    3232// compose the query where clause based on the localisation method choosen 
    33 switch ($settings['localisation_method']) { 
     33switch ($settings['sitelinks_localisation']) { 
    3434    case "none": 
    3535        $where = ""; 
  • trunk/administration/tools/language_pack_English.php

    r1145 r1158  
    1111|                                                    | 
    1212| for their efforts in making this translation file. | 
    13 | They can be reached on http://exitecms.exite.eu    | 
     13| They can be contacted on http://exitecms.exite.eu  | 
    1414+----------------------------------------------------+ 
    1515| Released under the terms & conditions of v2 of the | 
     
    1717| the included gpl.txt file or visit http://gnu.org  | 
    1818+----------------------------------------------------*/ 
    19 if (!defined('CMS_SETUP')) require_once dirname(__FILE__)."/../../includes/core_functions.php"; 
    20  
    21 // check for the proper admin access rights 
    22 if (!CMS_CLI && (!checkrights("T") || !defined("iAUTH") || $aid != iAUTH)) fallback(ADMIN."index.php"); 
    23  
    24 // load the locale for this module 
    25 if (!CMS_CLI) locale_load("admin.main"); 
    26  
    27 /*---------------------------------------------------+ 
    28 | defines                                            | 
    29 +----------------------------------------------------*/ 
    30 define('LP_LOCALE', "en"); 
    31 define('LP_LANGUAGE', "English"); 
    32 define('LP_LOCALES', "en_US|en_GB|english|eng"); 
    33 define('LP_CHARSET', "iso-8859-1"); 
    34 define('LP_VERSION', "7.00"); 
    35 define('LP_DATE', "1195160770"); 
    36  
    37 /*---------------------------------------------------+ 
    38 | local functions                                    | 
    39 +----------------------------------------------------*/ 
    40 function load_localestrings($localestrings, $locales_name) { 
    41     global $step, $db_prefix; 
    42  
    43     // if this is an upgrade, remove the old locale strings first 
    44     if ($step == "upgrade") { 
    45         $result = dbquery("DELETE FROM ".$db_prefix."locales WHERE locales_code = '".LP_LOCALE."' AND locales_name = '$locales_name'"); 
    46     } 
    47  
    48     // proces the imported locale strings 
    49     foreach ($localestrings as $key => $value) { 
    50         if (is_array($value)) { 
    51             $value = "#ARRAY#\n".serialize($value); 
    52         } 
    53         $result = dbquery("INSERT INTO ".$db_prefix."locales (locales_code, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('".LP_LOCALE."', '$locales_name', '".mysql_escape_string($key)."', '".mysql_escape_string($value)."', '".time()."')"); 
    54     } 
    55     return true; 
    56 } 
    57  
    58 function install_language_pack() { 
    59     global $step, $db_prefix; 
    60  
    61     if ($step == "install") { 
    62         $result = dbquery("INSERT INTO ".$db_prefix."locale (locale_code, locale_name, locale_locale, locale_charset, locale_active) VALUES ('en', 'English', 'en_US|en_GB|english|eng', 'iso-8859-1', 1)"); 
    63     } 
     19function install_language_pack($step) { 
     20 
     21    $localestrings = array(); 
     22    $localestrings['404page'] = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\" align=\"center\"> <tbody><tr><td width=\"10\"> </td><td><div align=\"center\"><font size=\"6\"><span class=\"shoutboxname\"><br />404 - Page Not Found</span><br /></font></div><br /><br /><hr width=\"90%\" size=\"2\" /><br /><br /><div align=\"center\">We are sorry, but the document you requested cannot be found on this server.<br /></div><br /><div align=\"center\">Most likely, this is a result of yet another reorganization of this Website to reflect our constant evolution and ongoing development, coupled with a transition from an old server with lots of legacy files to a shiny new server.<br /></div><br /><div align=\"center\">But then again, it might just be a completely random event and the result of too many cosmic rays. Who knows?<br /></div><br /><br /><hr width=\"90%\" size=\"2\" /><br /><br /><div align=\"center\">Your best bet for finding what you seek is to start at our home page (<a href=\"/\">click here to jump to the home page</a>), check out our menu, or use the search menu option.<br /></div><br /><div align=\"center\">If that doesn't work, and you think it's a document that should be here, please send a PM to the webmaster and let us know about it (registered users only).</div></td><td width=\"10\"> </td></tr></tbody></table><br />"; 
     23    load_localestrings($localestrings, LP_LOCALE, "404page", $step); 
    6424 
    6525    $localestrings = array(); 
     
    8343    $localestrings['426'] = "UnCheck all"; 
    8444    $localestrings['427'] = "Modules & Plugins"; 
    85     load_localestrings($localestrings, "admin.admins"); 
     45    load_localestrings($localestrings, LP_LOCALE, "admin.admins", $step); 
    8646 
    8747    $localestrings = array(); 
     
    10464    $localestrings['465'] = "The blacklist is currently empty."; 
    10565    $localestrings['470'] = "Blacklisted because of an offensive, rude or inappropriate comments posting"; 
    106     load_localestrings($localestrings, "admin.blacklist"); 
     66    load_localestrings($localestrings, LP_LOCALE, "admin.blacklist", $step); 
    10767 
    10868    $localestrings = array(); 
     
    11676    $localestrings['414'] = "Delete Comment?"; 
    11777    $localestrings['415'] = "There are no comments for this item."; 
    118     load_localestrings($localestrings, "admin.comments"); 
     78    load_localestrings($localestrings, LP_LOCALE, "admin.comments", $step); 
    11979 
    12080    $localestrings = array(); 
     
    142102    $localestrings['436'] = "Preview Page"; 
    143103    $localestrings['437'] = "Save Page"; 
    144     load_localestrings($localestrings, "admin.custom_pages"); 
     104    load_localestrings($localestrings, LP_LOCALE, "admin.custom_pages", $step); 
    145105 
    146106    $localestrings = array(); 
     
    193153    $localestrings['480'] = "Restore Backup"; 
    194154    $localestrings['481'] = "Filename:"; 
    195     load_localestrings($localestrings, "admin.db-backup"); 
     155    load_localestrings($localestrings, LP_LOCALE, "admin.db-backup", $step); 
    196156 
    197157    $localestrings = array(); 
     
    255215    $localestrings['511'] = " to go to Download Categories"; 
    256216    $localestrings['512'] = "Sub Category of"; 
    257     $localestrings['520'] = "Download Bars Panel Content"; 
    258     $localestrings['521'] = "Bar Position"; 
    259     $localestrings['522'] = "Save Bar Content"; 
    260     $localestrings['523'] = "Download Bars Panel Content succesfully saved"; 
    261     $localestrings['524'] = "Download Bars Title"; 
    262     load_localestrings($localestrings, "admin.downloads"); 
     217    $localestrings['513'] = " for the locale "; 
     218    $localestrings['514'] = "Category Locale:"; 
     219    $localestrings['515'] = ""; 
     220    load_localestrings($localestrings, LP_LOCALE, "admin.downloads", $step); 
    263221 
    264222    $localestrings = array(); 
     
    288246    $localestrings['486'] = "No FAQ Categories defined."; 
    289247    $localestrings['487'] = "Delete FAQ?"; 
    290     load_localestrings($localestrings, "admin.faq"); 
     248    load_localestrings($localestrings, LP_LOCALE, "admin.faq", $step); 
    291249 
    292250    $localestrings = array(); 
     
    350308    $localestrings['492'] = "Move down"; 
    351309    $localestrings['493'] = "Refresh Forum Ordering"; 
    352     load_localestrings($localestrings, "admin.forums"); 
     310    load_localestrings($localestrings, LP_LOCALE, "admin.forums", $step); 
    353311 
    354312    $localestrings = array(); 
     
    435393    $localestrings['FPM_301'] = "Public - show who voted for which item"; 
    436394    $localestrings['FPM_400'] = "For the forums marked <font color='green'>green</font>, special settings have been defined. For forums marked <font color='red'>red</font>, global settings are used"; 
    437     load_localestrings($localestrings, "admin.forum_polls"); 
     395    load_localestrings($localestrings, LP_LOCALE, "admin.forum_polls", $step); 
    438396 
    439397    $localestrings = array(); 
     
    459417    $localestrings['464'] = "Update image list for TinyMCE editor"; 
    460418    $localestrings['465'] = "Cancel"; 
    461     load_localestrings($localestrings, "admin.image_uploads"); 
     419    load_localestrings($localestrings, LP_LOCALE, "admin.image_uploads", $step); 
    462420 
    463421    $localestrings = array(); 
     
    522480    $localestrings['308'] = "While processing the language pack for %s (%s), an error occured. The error is:"; 
    523481    $localestrings['309'] = "You can not install this language pack. This pack is for ExiteCMS version"; 
    524     load_localestrings($localestrings, "admin.main"); 
     482    load_localestrings($localestrings, LP_LOCALE, "admin.main", $step); 
    525483 
    526484    $localestrings = array(); 
     
    580538    $localestrings['478'] = "Return to Members Admin"; 
    581539    $localestrings['479'] = "Return to Admin Index"; 
    582     load_localestrings($localestrings, "admin.members"); 
     540    load_localestrings($localestrings, LP_LOCALE, "admin.members", $step); 
    583541 
    584542    $localestrings = array(); 
     
    613571    $localestrings['mod004'] = "This module can not be installed. Required information is missing from the modules installer.<br />"; 
    614572    $localestrings['mod005'] = "This module does not function beyond ExiteCMS revision level %s.<br />"; 
    615     load_localestrings($localestrings, "admin.modules"); 
     573    load_localestrings($localestrings, LP_LOCALE, "admin.modules", $step); 
    616574 
    617575    $localestrings = array(); 
     
    715673    $localestrings['553'] = "Select a language:"; 
    716674    $localestrings['554'] = "for the locale"; 
    717     load_localestrings($localestrings, "admin.news-articles"); 
     675    load_localestrings($localestrings, LP_LOCALE, "admin.news-articles", $step); 
    718676 
    719677    $localestrings = array(); 
     
    748706    $localestrings['444'] = "Down"; 
    749707    $localestrings['445'] = "Move to the upper body section"; 
    750     $localestrings['446'] = "Move to lower body section"; 
     708    $localestrings['446'] = "Move to the lower body section"; 
    751709    $localestrings['447'] = "No"; 
    752710    $localestrings['448'] = "Yes"; 
     
    785743    $localestrings['488'] = "Select a language:"; 
    786744    $localestrings['489'] = "for the locale"; 
    787     load_localestrings($localestrings, "admin.panels"); 
     745    $localestrings['490'] = "Header Panels"; 
     746    $localestrings['491'] = "Footer Panels"; 
     747    $localestrings['492'] = "Header"; 
     748    $localestrings['493'] = "Footer"; 
     749    $localestrings['494'] = "Move to the header section"; 
     750    $localestrings['495'] = "Move to the footer section"; 
     751    load_localestrings($localestrings, LP_LOCALE, "admin.panels", $step); 
    788752 
    789753    $localestrings = array(); 
     
    799763    $localestrings['425'] = "No"; 
    800764    $localestrings['426'] = "RegEx"; 
     765    $localestrings['427'] = "Retain URL parameters"; 
    801766    $localestrings['430'] = "Add this redirect URL"; 
    802767    $localestrings['431'] = "Save this redirect URL"; 
     
    804769    $localestrings['433'] = "Delete"; 
    805770    $localestrings['480'] = "No Redirect URLs present"; 
    806     $localestrings['481'] = "Note: the URL's you type here are relative to the root of the website, and should start with a '/'.<br />\n        Make sure you're not defining a redirect for any of the existing website functions (like /index.php)!"; 
     771    $localestrings['481'] = "Note: the URL's you type here are relative to the root of the website, and should start with a '/'.<br />\nYou can not redirect any of the existing website functions (like /index.php)!"; 
    807772    $localestrings['482'] = "New redirect URL saved successfully"; 
    808773    $localestrings['483'] = "Redirect URL saved successfully"; 
     
    814779    $localestrings['489'] = "Requested url_id is missing. Maybe it was deleted by someone else?"; 
    815780    $localestrings['490'] = "If checked, the first field is used to match, the second to convert the URL"; 
    816     load_localestrings($localestrings, "admin.redirects"); 
     781    $localestrings['491'] = "If checked, any parameters given will be appended to the new URL"; 
     782    $localestrings['492'] = "If checked, the site will redirect to the exact URL given"; 
     783    load_localestrings($localestrings, LP_LOCALE, "admin.redirects", $step); 
    817784 
    818785    $localestrings = array(); 
     
    884851    $localestrings['556'] = "Text"; 
    885852    $localestrings['557'] = "New members activated by admin?"; 
    886     $localestrings['558'] = "Site localisation method:"; 
    887     $localestrings['559'] = "No localisation (fixed layout)"; 
    888     $localestrings['560'] = "Single tree content (symmetric layout)"; 
    889     $localestrings['561'] = "Multiple tree content (a-symmetic layout)"; 
     853    $localestrings['558'] = "Localisation methods"; 
     854    $localestrings['559'] = "No localisation, all text is hardcoded"; 
     855    $localestrings['560'] = "Assign multiple languages to a single item"; 
     856    $localestrings['561'] = "Assign multiple items to a single language"; 
     857    $localestrings['570'] = "Panels:"; 
     858    $localestrings['571'] = "Menu sytem:"; 
     859    $localestrings['572'] = "Articles:"; 
     860    $localestrings['573'] = "News:"; 
     861    $localestrings['574'] = "Downloads:"; 
    890862    $localestrings['600'] = "Image"; 
    891863    $localestrings['601'] = "Thumb size:"; 
     
    948920    $localestrings['803'] = "Attachments deleted: "; 
    949921    $localestrings['850'] = "Languages"; 
    950     load_localestrings($localestrings, "admin.settings"); 
     922    load_localestrings($localestrings, LP_LOCALE, "admin.settings", $step); 
    951923 
    952924    $localestrings = array(); 
     
    988960    $localestrings['451'] = "Select a language:"; 
    989961    $localestrings['452'] = "for the locale"; 
    990     load_localestrings($localestrings, "admin.sitelinks"); 
     962    load_localestrings($localestrings, LP_LOCALE, "admin.sitelinks", $step); 
    991963 
    992964    $localestrings = array(); 
     
    1008980    $localestrings['422'] = "General error"; 
    1009981    $localestrings['430'] = "For more detailed information on these upgrades, check the changelogs on <a href='http://exitecms.exite.eu' alt='' target='_blank'>http://exitecms.exite.eu</a>"; 
    1010     load_localestrings($localestrings, "admin.upgrade"); 
     982    load_localestrings($localestrings, LP_LOCALE, "admin.upgrade", $step); 
    1011983 
    1012984    $localestrings = array(); 
     
    10631035    $localestrings['451'] = "Visible in user profiles:"; 
    10641036    $localestrings['452'] = "Visible in Forum posts:"; 
    1065     load_localestrings($localestrings, "admin.user_groups"); 
     1037    load_localestrings($localestrings, LP_LOCALE, "admin.user_groups", $step); 
    10661038 
    10671039    $localestrings = array(); 
     
    10891061    $localestrings['utf-7'] = "Unicode (UTF-7)"; 
    10901062    $localestrings['utf-8'] = "Unicode (UTF-8)"; 
    1091     load_localestrings($localestrings, "charsets"); 
     1063    load_localestrings($localestrings, LP_LOCALE, "charsets", $step); 
    10921064 
    10931065    $localestrings = array(); 
     
    11091081    $localestrings['white'] = "White"; 
    11101082    $localestrings['yellow'] = "Yellow"; 
    1111     load_localestrings($localestrings, "colors"); 
     1083    load_localestrings($localestrings, LP_LOCALE, "colors", $step); 
    11121084 
    11131085    $localestrings = array(); 
     
    11491121    $localestrings['ca'] = "Canada"; 
    11501122    $localestrings['cc'] = "Cocos (Keeling) Islands"; 
    1151     $localestrings['cd'] = "The Democratic Republic Of The Congo"; 
     1123    $localestrings['cd'] = "Congo, The Democratic Republic Of The"; 
    11521124    $localestrings['cf'] = "Central African Republic"; 
    11531125    $localestrings['cg'] = "Congo"; 
     
    12711243    $localestrings['ng'] = "Nigeria"; 
    12721244    $localestrings['ni'] = "Nicaragua"; 
    1273     $localestrings['nl'] = "The Netherlands"; 
     1245    $localestrings['nl'] = "Netherlands, The"; 
    12741246    $localestrings['no'] = "Norway"; 
    12751247    $localestrings['np'] = "Nepal"; 
     
    13471319    $localestrings['zm'] = "Zambia"; 
    13481320    $localestrings['zw'] = "Zimbabwe"; 
    1349     load_localestrings($localestrings, "countrycode"); 
     1321    load_localestrings($localestrings, LP_LOCALE, "countrycode", $step); 
    13501322 
    13511323    $localestrings = array(); 
     
    16051577    $localestrings['Zambia'] = "zm"; 
    16061578    $localestrings['Zimbabwe'] = "zw"; 
    1607     load_localestrings($localestrings, "countryname"); 
     1579    load_localestrings($localestrings, LP_LOCALE, "countryname", $step); 
    16081580 
    16091581    $localestrings = array(); 
     
    18411813    $localestrings['zm'] = "Kwacha"; 
    18421814    $localestrings['zw'] = "Zimbabwian Dollars"; 
    1843     load_localestrings($localestrings, "currency"); 
     1815    load_localestrings($localestrings, LP_LOCALE, "currency", $step); 
    18441816 
    18451817    $localestrings = array(); 
     
    20772049    $localestrings['zm'] = "ZMK"; 
    20782050    $localestrings['zw'] = "ZWD"; 
    2079     load_localestrings($localestrings, "currencycode"); 
     2051    load_localestrings($localestrings, LP_LOCALE, "currencycode", $step); 
    20802052 
    20812053    $localestrings = array(); 
     
    21632135    $localestrings['580'] = "skype"; 
    21642136    $localestrings['581'] = "Top"; 
    2165     load_localestrings($localestrings, "forum.main"); 
     2137    load_localestrings($localestrings, LP_LOCALE, "forum.main", $step); 
    21662138 
    21672139    $localestrings = array(); 
     
    21962168    $localestrings['464'] = "No matches found, please try again."; 
    21972169    $localestrings['465'] = "Please specify at least one word to search for."; 
    2198     load_localestrings($localestrings, "forum.options"); 
     2170    load_localestrings($localestrings, LP_LOCALE, "forum.options", $step); 
    21992171 
    22002172    $localestrings = array(); 
     
    23042276    $localestrings['550'] = "Thread Reply Notification - {THREAD_SUBJECT}"; 
    23052277    $localestrings['551'] = "Hello {USERNAME},\n\nA reply has been posted in the forum thread '{THREAD_SUBJECT}' which you are tracking at {SITE_NAME}. You can use the following link to view the reply:\n\n{THREAD_URL}\n\nIf you no longer wish to watch this thread you can click the 'Tracking Off' button located at the bottom of the thread.\n\nRegards,\n{SITE_WEBMASTER}."; 
    2306     load_localestrings($localestrings, "forum.post"); 
     2278    load_localestrings($localestrings, LP_LOCALE, "forum.post", $step); 
    23072279 
    23082280    $localestrings = array(); 
     
    23112283    $localestrings['402'] = "<b>New this week</b>"; 
    23122284    $localestrings['403'] = "No Articles have been added to this Category"; 
    2313     load_localestrings($localestrings, "main.articles"); 
     2285    load_localestrings($localestrings, LP_LOCALE, "main.articles", $step); 
    23142286 
    23152287    $localestrings = array(); 
     
    23232295    $localestrings['407'] = "No Article Categories defined"; 
    23242296    $localestrings['408'] = "of"; 
    2325     load_localestrings($localestrings, "main.article_cats"); 
     2297    load_localestrings($localestrings, LP_LOCALE, "main.article_cats", $step); 
    23262298 
    23272299    $localestrings = array(); 
     
    23352307    $localestrings['c107'] = " Disable smileys in this comment"; 
    23362308    $localestrings['c108'] = "Toggle smileys"; 
    2337     load_localestrings($localestrings, "main.comments"); 
     2309    load_localestrings($localestrings, LP_LOCALE, "main.comments", $step); 
    23382310 
    23392311    $localestrings = array(); 
     
    23542326    $localestrings['442'] = "Your message was not sent for the following reason(s):"; 
    23552327    $localestrings['443'] = "Please try again."; 
    2356     load_localestrings($localestrings, "main.contact"); 
     2328    load_localestrings($localestrings, LP_LOCALE, "main.contact", $step); 
    23572329 
    23582330    $localestrings = array(); 
     
    23602332    $localestrings['401'] = "Internal Error"; 
    23612333    $localestrings['402'] = "Unable to retrieve page content."; 
    2362     load_localestrings($localestrings, "main.custom_pages"); 
     2334    load_localestrings($localestrings, LP_LOCALE, "main.custom_pages", $step); 
    23632335 
    23642336    $localestrings = array(); 
     
    23782350    $localestrings['430'] = "No Download Categories defined"; 
    23792351    $localestrings['431'] = "No Downloads have been added to this Category"; 
    2380     load_localestrings($localestrings, "main.downloads"); 
     2352    load_localestrings($localestrings, LP_LOCALE, "main.downloads", $step); 
    23812353 
    23822354    $localestrings = array(); 
     
    23872359    $localestrings['420'] = "Question:"; 
    23882360    $localestrings['421'] = "Answer:"; 
    2389     load_localestrings($localestrings, "main.faq"); 
     2361    load_localestrings($localestrings, LP_LOCALE, "main.faq", $step); 
    23902362 
    23912363    $localestrings = array(); 
    23922364    $localestrings['400'] = "Forum:"; 
    2393     load_localestrings($localestrings, "main.feeds"); 
     2365    load_localestrings($localestrings, LP_LOCALE, "main.feeds", $step); 
    23942366 
    23952367    $localestrings = array(); 
     
    25212493    $localestrings['usera'] = "Anonymous"; 
    25222494    $localestrings['userf1'] = "Moderator"; 
    2523     load_localestrings($localestrings, "main.global"); 
     2495    load_localestrings($localestrings, LP_LOCALE, "main.global", $step); 
    25242496 
    25252497    $localestrings = array(); 
     
    25362508    $localestrings['410'] = "Hello [USER_NAME],\n\nYou have or someone has requested a new password to access your [SITENAME] account.\n\nTo change your password please click the following link:\n\n[NEW_PASS_LINK]\n\nRegards,\n[SITEUSERNAME]"; 
    25372509    $localestrings['411'] = "Hello [USER_NAME],\n\nYour new password to access your [SITENAME] account is:\n\n[NEW_PASS]\n\nRegards,\n[SITEUSERNAME]"; 
    2538     load_localestrings($localestrings, "main.lostpassword"); 
     2510    load_localestrings($localestrings, LP_LOCALE, "main.lostpassword", $step); 
    25392511 
    25402512    $localestrings = array(); 
     
    25782550    $localestrings['491'] = "We have detected that your email address is no longer valid.<br />Your accounts will be deactivated in %s days."; 
    25792551    $localestrings['499'] = "<br /><br />Please update your profile now."; 
    2580     load_localestrings($localestrings, "main.members-profile"); 
     2552    load_localestrings($localestrings, LP_LOCALE, "main.members-profile", $step); 
    25812553 
    25822554    $localestrings = array(); 
     
    25892561    $localestrings['406'] = "Show All Categories"; 
    25902562    $localestrings['407'] = "No News Categories defined"; 
    2591     load_localestrings($localestrings, "main.news_cats"); 
     2563    load_localestrings($localestrings, LP_LOCALE, "main.news_cats", $step); 
    25922564 
    25932565    $localestrings = array(); 
     
    27352707    $localestrings['639'] = "Headers only"; 
    27362708    $localestrings['640'] = "Message details"; 
    2737     load_localestrings($localestrings, "main.pm"); 
     2709    load_localestrings($localestrings, LP_LOCALE, "main.pm", $step); 
    27382710 
    27392711    $localestrings = array(); 
     
    27412713    $localestrings['401'] = " on "; 
    27422714    $localestrings['402'] = "Extended News"; 
    2743     load_localestrings($localestrings, "main.print"); 
     2715    load_localestrings($localestrings, LP_LOCALE, "main.print", $step); 
    27442716 
    27452717    $localestrings = array(); 
     
    27612733    $localestrings['r123'] = "Average"; 
    27622734    $localestrings['r124'] = "Poor"; 
    2763     load_localestrings($localestrings, "main.ratings"); 
     2735    load_localestrings($localestrings, LP_LOCALE, "main.ratings", $step); 
    27642736 
    27652737    $localestrings = array(); 
     
    28012773    $localestrings['551'] = "Please specify a password."; 
    28022774    $localestrings['552'] = "Please specify an email address."; 
    2803     load_localestrings($localestrings, "main.register"); 
     2775    load_localestrings($localestrings, LP_LOCALE, "main.register", $step); 
    28042776 
    28052777    $localestrings = array(); 
     
    28742846    $localestrings['480']['7']['0'] = "\" \""; 
    28752847    $localestrings['480']['7']['1'] = "Double quotes at the beginning and end of a phrase, matches only rows that contain the complete phrase, as it was typed."; 
    2876     load_localestrings($localestrings, "main.search"); 
     2848    load_localestrings($localestrings, LP_LOCALE, "main.search", $step); 
    28772849 
    28782850    $localestrings = array(); 
     
    29852957    $localestrings['580'] = "Setup is complete, ExiteCMS is now ready for use.<br>\n<a href='index.php'>Click here</a> to go to your ExiteCMS powered site.<br>\n<b>Note:</b> you should delete setup.php from your server<br>\nand chmod your config.php back to 644 for security purposes.<br><br>\nThank you for choosing ExiteCMS."; 
    29862958    $localestrings['title'] = "ExiteCMS Setup"; 
    2987     load_localestrings($localestrings, "main.setup"); 
     2959    load_localestrings($localestrings, LP_LOCALE, "main.setup", $step); 
    29882960 
    29892961    $localestrings = array(); 
     
    30463018    $localestrings['u061'] = "View all posts of this member"; 
    30473019    $localestrings['u901'] = "Full Name"; 
    3048     load_localestrings($localestrings, "main.user_fields"); 
     3020    load_localestrings($localestrings, LP_LOCALE, "main.user_fields", $step); 
    30493021    return ""; 
     3022} 
     3023 
     3024/*---------------------------------------------------+ 
     3025| start of the language pack load code               | 
     3026+----------------------------------------------------*/ 
     3027if (!defined('CMS_SETUP')) require_once dirname(__FILE__)."/../../includes/core_functions.php"; 
     3028 
     3029define('LP_LOCALE', "en"); 
     3030define('LP_LANGUAGE', "English"); 
     3031define('LP_LOCALES', "en_US|en_GB|english|eng"); 
     3032define('LP_CHARSET', "iso-8859-1"); 
     3033define('LP_VERSION', "7.00"); 
     3034define('LP_DATE', "1196416846"); 
     3035 
     3036/*---------------------------------------------------+ 
     3037| local functions                                    | 
     3038+----------------------------------------------------*/ 
     3039if (!function_exists('load_localestrings')) { 
     3040    function load_localestrings($localestrings, $locales_code, $locales_name, $step="") { 
     3041        global $db_prefix; 
     3042     
     3043        // if this is an upgrade, remove the old locale strings first 
     3044        if ($step == "upgrade") { 
     3045            $result = dbquery("DELETE FROM ".$db_prefix."locales WHERE locales_code = '$locales_code' AND locales_name = '$locales_name'"); 
     3046        } 
     3047     
     3048        // proces the imported locale strings 
     3049        foreach ($localestrings as $key => $value) { 
     3050            if (is_array($value)) { 
     3051                $value = "#ARRAY#\n".serialize($value); 
     3052            } 
     3053            $result = dbquery("INSERT INTO ".$db_prefix."locales (locales_code, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('$locales_code', '$locales_name', '".mysql_escape_string($key)."', '".mysql_escape_string($value)."', '".time()."')"); 
     3054        } 
     3055        return true; 
     3056    } 
    30503057} 
    30513058 
     
    30543061+----------------------------------------------------*/ 
    30553062 
     3063// when not in CLI mode, check the users rights, and load the locale strings 
     3064if (!CMS_CLI) { 
     3065    // check for the proper admin access rights 
     3066    if (!checkrights("T") || !defined("iAUTH") || $aid != iAUTH) { 
     3067        fallback(ADMIN."index.php"); 
     3068    } 
     3069    // load the locale for this module 
     3070    locale_load("admin.main"); 
     3071} 
    30563072 
    30573073if (defined('CMS_SETUP') && !defined('CMS_SETUP_LOAD')) { 
     
    30973113// install the language pack 
    30983114if ($step == "install" || $step == "upgrade") { 
    3099     if ($error = install_language_pack()) { 
     3115    if ($step == "install") { 
     3116        $result = dbquery("INSERT INTO ".$db_prefix."locale (locale_code, locale_name, locale_locale, locale_charset, locale_active) VALUES (LP_LOCALE, 'LP_LANGUAGE, LP_LOCALES, LP_CHARSET, 1)"); 
     3117    } 
     3118    if ($error = install_language_pack($step)) { 
    31003119        if (!CMS_CLI) $variables['message'] .= sprintf($locale['308'],LP_LOCALE, LP_LANGUAGE)."<br /><br />".$error; 
    31013120    } else { 
  • trunk/article_cats.php

    r1145 r1158  
    2929 
    3030// compose the query where clause based on the localisation method choosen 
    31 switch ($settings['localisation_method']) { 
     31switch ($settings['article_localisation']) { 
    3232    case "none": 
    3333        $where = ""; 
  • trunk/downloads.php

    r1150 r1158  
    4444 
    4545// compose the query where clause based on the localisation method choosen 
    46 switch ($settings['localisation_method']) { 
     46switch ($settings['download_localisation']) { 
    4747    case "none": 
    4848        $where = ""; 
     
    9191} 
    9292 
     93if (isset($cat_id)) { 
     94    // get the selected category, and all sub-categories of the requested download category 
     95    $variables['subcats'] = true; 
     96    $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'"); 
     97    if (dbrows($result) == 0) { 
     98        // not found. pretend none was given 
     99        unset($cat_id); 
     100    } else { 
     101        $variables['parent'] = dbarray($result); 
     102        $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_parent='$cat_id' AND ".groupaccess('download_cat_access')." ORDER BY ".$variables['parent']['download_cat_cat_sorting']); 
     103    } 
     104} 
     105 
    93106if (!isset($cat_id)) { 
    94107    // get all root categories 
     
    99112        $variables['parent'] = array('download_cat_access' => 0, 'download_cat_sorting' => 'download_id DESC');  
    100113        $cat_id = 0; 
     114    } else { 
     115        die('oops'); 
    101116    } 
    102 } else { 
    103     // get the selected category, and all sub-categories of the requested download category 
    104     $variables['subcats'] = true; 
    105     $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'"); 
    106     if (dbrows($result) == 0) { 
    107         redirect("downloads.php"); 
    108         exit; 
    109     } 
    110     $variables['parent'] = dbarray($result); 
    111     $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_parent='$cat_id' AND ".groupaccess('download_cat_access')." ORDER BY ".$variables['parent']['download_cat_cat_sorting']); 
    112117} 
    113118// fill the download_cats array with the result 
    114119$variables['cats_count'] = dbrows($result); 
    115120$variables['download_cats'] = array(); 
    116 while ($result && $data = dbarray($result)) { 
    117     $data['download_count'] = countdownloads($data['download_cat_id']); 
    118     $variables['download_cats'][] = $data; 
     121if ($variables['cats_count'] != 0) { 
     122    while ($data = dbarray($result)) { 
     123        $data['download_count'] = countdownloads($data['download_cat_id']); 
     124        $variables['download_cats'][] = $data; 
     125    } 
    119126} 
    120127 
  • trunk/forum/post.php

    r1120 r1158  
    819819            if ($data['lastpost'] < $pdata['post_datestamp']) 
    820820                $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".$pdata['post_datestamp']."', forum_lastuser='".$pdata['post_author']."' WHERE forum_id='".$forum_id."'"); 
    821             // get the access group number for the new forum 
     821            // get the access group number for the new forum 
    822822            $result = dbquery("SELECT forum_access from ".$db_prefix."forums WHERE forum_id = ".$_POST['new_forum_id']); 
    823823            $data = dbarray($result); 
    824824            $group_id = $data['forum_access']; 
    825             // check for group inheritance 
    826             $groups = array(); 
    827             getgroupmembers($group_id); 
     825            // check for group inheritance 
     826            $groups = array(); 
     827            getgroupmembers($group_id); 
    828828            // update the posts_unread pointers 
    829829            $result = dbquery("SELECT * FROM ".$db_prefix."posts_unread WHERE post_id = '$post_id'"); 
     
    882882 
    883883        // get the data for the threads dropdown 
    884         $result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE forum_id='".$_POST['new_forum_id']."' ORDER BY thread_lastpost DESC"); 
     884        $result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE forum_id='".$_POST['new_forum_id']."' AND thread_id != '$thread_id' ORDER BY thread_lastpost DESC"); 
    885885        $variables['threads'] = array(); 
    886886        while ($data = dbarray($result)) { 
     
    928928            $variables['forums'][] = $data2; 
    929929        } 
    930  
    931930        // define the panel 
    932931        $template_panels[] = array('type' => 'body', 'name' => 'forum.movepost.1', 'template' => 'forum.post.move.tpl', 'locale' => array("forum.main", "forum.post")); 
  • trunk/includes/jscripts/tiny_mce/plugins/_template/editor_plugin.js

    r10 r1158  
    1 tinyMCE.importPluginLanguagePack('template','en,tr,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl');var TinyMCE_TemplatePlugin={getInfo:function(){return{longname:'Template plugin',author:'Your name',authorurl:'http://www.yoursite.com',infourl:'http://www.yoursite.com/docs/template.html',version:"1.0"};},initInstance:function(inst){alert("Initialization parameter:"+tinyMCE.getParam("template_someparam",false));inst.addShortcut('ctrl','t','lang_template_desc','mceTemplate');},getControlHTML:function(cn){switch(cn){case"template":return tinyMCE.getButtonHTML(cn,'lang_template_desc','{$pluginurl}/images/template.gif','mceTemplate',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceTemplate":if(user_interface){var template=new Array();template['file']='../../plugins/template/popup.htm';template['width']=300;template['height']=200;tinyMCE.openWindow(template,{editor_id:editor_id,some_custom_arg:"somecustomdata"});tinyMCE.triggerNodeChange(false);}else{alert("execCommand: mceTemplate gets called from popup.");}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node.parentNode.nodeName=="STRONG"||node.parentNode.nodeName=="B"){tinyMCE.switchClass(editor_id+'_template','mceButtonSelected');return true;}tinyMCE.switchClass(editor_id+'_template','mceButtonNormal');},setupContent:function(editor_id,body,doc){},onChange:function(inst){},handleEvent:function(e){top.status="template plugin event: "+e.type;return true;},cleanup:function(type,content,inst){switch(type){case"get_from_editor":alert("[FROM] Value HTML string: "+content);break;case"insert_to_editor":alert("[TO] Value HTML string: "+content);break;case"get_from_editor_dom":alert("[FROM] Value DOM Element "+content.innerHTML);break;case"insert_to_editor_dom":alert("[TO] Value DOM Element: "+content.innerHTML);break;}return content;},_someInternalFunction:function(a,b){return 1;}};tinyMCE.addPlugin("template",TinyMCE_TemplatePlugin); 
     1tinyMCE.importPluginLanguagePack('template');var TinyMCE_TemplatePlugin={getInfo:function(){return{longname:'Template plugin',author:'Your name',authorurl:'http://www.yoursite.com',infourl:'http://www.yoursite.com/docs/template.html',version:"1.0"}},initInstance:function(inst){alert("Initialization parameter:"+tinyMCE.getParam("template_someparam",false));inst.addShortcut('ctrl','t','lang_template_desc','mceTemplate')},removeInstance:function(inst){},getControlHTML:function(cn){switch(cn){case"template":return tinyMCE.getButtonHTML(cn,'lang_template_desc','{$pluginurl}/images/template.gif','mceTemplate',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceTemplate":if(user_interface){var template=new Array();template['file']='../../plugins/template/popup.htm';template['width']=300;template['height']=200;tinyMCE.openWindow(template,{editor_id:editor_id,some_custom_arg:"somecustomdata"});tinyMCE.triggerNodeChange(false)}else{alert("execCommand: mceTemplate gets called from popup.")}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node.parentNode.nodeName=="STRONG"||node.parentNode.nodeName=="B"){tinyMCE.switchClass(editor_id+'_template','mceButtonSelected');return true}tinyMCE.switchClass(editor_id+'_template','mceButtonNormal')},setupContent:function(editor_id,body,doc){},onChange:function(inst){},handleEvent:function(e){top.status="template plugin event: "+e.type;return true;},cleanup:function(type,content,inst){switch(type){case"get_from_editor":alert("[FROM] Value HTML string: "+content);break;case"insert_to_editor":alert("[TO] Value HTML string: "+content);break;case"get_from_editor_dom":alert("[FROM] Value DOM Element "+content.innerHTML);break;case"insert_to_editor_dom":alert("[TO] Value DOM Element: "+content.innerHTML);break}return content},_someInternalFunction:function(a,b){return 1}};tinyMCE.addPlugin("template",TinyMCE_TemplatePlugin); 
  • trunk/includes/jscripts/tiny_mce/plugins/_template/editor_plugin_src.js

    r10 r1158  
    11/** 
    2  * $RCSfile: editor_plugin_src.js,v $ 
    3  * $Revision: 1.12 $ 
    4  * $Date: 2006/02/22 20:06:23 $ 
     2 * $Id: editor_plugin_src.js 166 2007-01-05 10:31:50Z spocke $ 
    53 * 
    64 * @author Moxiecode 
    7  * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. 
     5 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. 
    86 */ 
    97 
    108/* Import plugin specific language pack */ 
    11 tinyMCE.importPluginLanguagePack('template', 'en,tr,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl'); // <- Add a comma separated list of all supported languages 
     9tinyMCE.importPluginLanguagePack('template'); 
    1210 
    1311/**** 
     
    5654 
    5755    /** 
     56     * Gets executed when a TinyMCE editor instance is removed. 
     57     * 
     58     * @param {TinyMCE_Control} Removed TinyMCE editor control instance.  
     59     */ 
     60    removeInstance : function(inst) { 
     61        // Cleanup instance resources 
     62    }, 
     63 
     64    /** 
    5865     * Returns the HTML code for a specific control or empty string if this plugin doesn't have that control. 
    5966     * A control can be a button, select list or any other HTML item to present in the TinyMCE user interface. 
  • trunk/includes/jscripts/tiny_mce/plugins/advimage/jscripts/functions.js

    r581 r1158  
    240240 
    241241        eval('elm.' + attrib + "=value;"); 
    242     } else 
     242    } else { 
     243        if (attrib == 'class') 
     244            elm.className = ''; 
     245 
    243246        elm.removeAttribute(attrib); 
     247    } 
    244248} 
    245249 
     
    475479        elm.innerHTML = ""; 
    476480    else 
    477         elm.innerHTML = '<img id="previewImg" src="' + src + '" border="0" onload="updateImageData();" onerror="resetImageData();" />' 
    478 } 
    479  
    480 function updateImageData() { 
     481        elm.innerHTML = '<img id="previewImg" src="' + src + '" border="0" onload="updateImageData(' + start + ');" onerror="resetImageData();" />' 
     482} 
     483 
     484function updateImageData(start) { 
    481485    var formObj = document.forms[0]; 
    482486 
    483487    preloadImg = document.getElementById('previewImg'); 
    484488 
    485     if (formObj.width.value == "") 
     489    if (!start && formObj.width.value == "") 
    486490        formObj.width.value = preloadImg.width; 
    487491 
    488     if (formObj.height.value == "") 
     492    if (!start && formObj.height.value == "") 
    489493        formObj.height.value = preloadImg.height; 
    490494 
  • trunk/includes/jscripts/tiny_mce/plugins/advlink/editor_plugin.js

    r581 r1158  
    1 tinyMCE.importPluginLanguagePack('advlink');var TinyMCE_AdvancedLinkPlugin={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}},initInstance:function(inst){inst.addShortcut('ctrl','k','lang_advlink_desc','mceAdvLink')},getControlHTML:function(cn){switch(cn){case"link":return tinyMCE.getButtonHTML(cn,'lang_link_desc','{$themeurl}/images/link.gif','mceAdvLink')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvLink":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var selectedText=inst.selection.getSelectedText();if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){var template=new Array();template['file']='../../plugins/advlink/link.htm';template['width']=480;template['height']=400;template['width']+=tinyMCE.getLang('lang_advlink_delta_width',0);template['height']+=tinyMCE.getLang('lang_advlink_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"})}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_advlink','mceButtonSelected');return true}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_advlink','mceButtonNormal');return true}tinyMCE.switchClass(editor_id+'_advlink','mceButtonDisabled');return true}};tinyMCE.addPlugin("advlink",TinyMCE_AdvancedLinkPlugin); 
     1tinyMCE.importPluginLanguagePack('advlink');var TinyMCE_AdvancedLinkPlugin={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}},initInstance:function(inst){inst.addShortcut('ctrl','k','lang_advlink_desc','mceAdvLink')},getControlHTML:function(cn){switch(cn){case"link":return tinyMCE.getButtonHTML(cn,'lang_link_desc','{$themeurl}/images/link.gif','mceAdvLink')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvLink":var inst=tinyMCE.getInstanceById(editor_id),anySelection=!inst.selection.isCollapsed();var focusElm=inst.getFocusElement(),selectedText=inst.selection.getSelectedText();if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){tinyMCE.openWindow({file:'../../plugins/advlink/link.htm',width:480+tinyMCE.getLang('lang_advlink_delta_width',0),height:400+tinyMCE.getLang('lang_advlink_delta_height',0)},{editor_id:editor_id,inline:"yes"})}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_advlink','mceButtonSelected');return true}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_advlink','mceButtonNormal');return true}tinyMCE.switchClass(editor_id+'_advlink','mceButtonDisabled');return true}};tinyMCE.addPlugin("advlink",TinyMCE_AdvancedLinkPlugin); 
  • trunk/includes/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js

    r581 r1158  
    11/** 
    2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ 
     2 * $Id: editor_plugin_src.js 304 2007-10-25 13:30:51Z spocke $ 
    33 * 
    44 * @author Moxiecode 
     
    3636        switch (command) { 
    3737            case "mceAdvLink": 
    38                 var anySelection = false; 
    39                 var inst = tinyMCE.getInstanceById(editor_id); 
    40                 var focusElm = inst.getFocusElement(); 
    41                 var selectedText = inst.selection.getSelectedText(); 
    42  
    43                 if (tinyMCE.selectedElement) 
    44                     anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0); 
     38                var inst = tinyMCE.getInstanceById(editor_id), anySelection = !inst.selection.isCollapsed(); 
     39                var focusElm = inst.getFocusElement(), selectedText = inst.selection.getSelectedText(); 
    4540 
    4641                if (anySelection || (focusElm != null && focusElm.nodeName == "A")) { 
    47                     var template = new Array(); 
    48  
    49                     template['file']   = '../../plugins/advlink/link.htm'; 
    50                     template['width']  = 480; 
    51                     template['height'] = 400; 
    52  
    53                     // Language specific width and height addons 
    54                     template['width']  += tinyMCE.getLang('lang_advlink_delta_width', 0); 
    55                     template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0); 
    56  
    57                     tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); 
     42                    tinyMCE.openWindow({ 
     43                        file : '../../plugins/advlink/link.htm', 
     44                        width : 480 + tinyMCE.getLang('lang_advlink_delta_width', 0), 
     45                        height : 400 + tinyMCE.getLang('lang_advlink_delta_height', 0) 
     46                    }, { 
     47                        editor_id : editor_id, 
     48                        inline : "yes" 
     49                    }); 
    5850                } 
    5951 
  • trunk/includes/jscripts/tiny_mce/plugins/advlink/jscripts/functions.js

    r581 r1158  
    132132} 
    133133 
     134function checkPrefix(n) { 
     135    if (!Validator.isEmpty(n) && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCE.getLang('lang_is_email'))) 
     136        n.value = 'mailto:' + n.value; 
     137 
     138    if (/^\s*www./i.test(n.value) && confirm(tinyMCE.getLang('lang_is_external'))) 
     139        n.value = 'http://' + n.value; 
     140} 
     141 
    134142function setFormValue(name, value) { 
    135143    document.forms[0].elements[name].value = value; 
     
    392400function getAnchorListHTML(id, target) { 
    393401    var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); 
    394     var nodes = inst.getBody().getElementsByTagName("a"); 
    395  
     402    var nodes = inst.getBody().getElementsByTagName("a"), name, i; 
    396403    var html = ""; 
    397404 
     
    400407    html += '<option value="">---</option>'; 
    401408 
    402     for (var i=0; i<nodes.length; i++) { 
     409    for (i=0; i<nodes.length; i++) { 
    403410        if ((name = tinyMCE.getAttrib(nodes[i], "name")) != "") 
    404411            html += '<option value="#' + name + '">' + name + '</option>'; 
     
    413420    var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); 
    414421    var elm = inst.getFocusElement(); 
     422 
     423    checkPrefix(document.forms[0].href); 
    415424 
    416425    elm = tinyMCE.getParentElement(elm, "a"); 
     
    429438            var elm = elementArray[i]; 
    430439 
     440            // Move cursor to end 
     441            try { 
     442                tinyMCE.selectedInstance.selection.collapse(false); 
     443            } catch (ex) { 
     444                // Ignore 
     445            } 
     446 
    431447            // Move cursor behind the new anchor 
     448            // Don't remember why this was needed so it's now removed 
     449            /* 
    432450            if (tinyMCE.isGecko) { 
    433451                var sp = inst.getDoc().createTextNode(" "); 
     
    448466                sel.addRange(rng); 
    449467            } 
     468            */ 
    450469 
    451470            setAllAttribs(elm); 
     
    465484 
    466485    // Make anchors absolute 
    467     if (href.charAt(0) != '#') 
     486    if (href.charAt(0) != '#' && tinyMCE.getParam('convert_urls')) 
    468487        href = convertURL(href, elm); 
    469488 
  • trunk/includes/jscripts/tiny_mce/plugins/advlink/link.htm

    r581 r1158  
    55    <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script> 
    66    <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script> 
     7    <script language="javascript" type="text/javascript" src="../../utils/validate.js"></script> 
    78    <script language="javascript" type="text/javascript" src="jscripts/functions.js"></script> 
    89    <link href="css/advlink.css" rel="stylesheet" type="text/css" /> 
  • trunk/includes/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js

    r581 r1158  
    1 if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css")}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst)})}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu)},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst)}},_showContextMenu:function(e,inst){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A'&&tinyMCE.getAttrib(elm,'name')=='')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true))}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.hasPlugin('flash')&&tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else if(tinyMCE.hasPlugin('media')&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm,'class')))contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_media_title","mceMedia");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false)}break}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert")}}contextMenu.show(x,y)},10);tinyMCE.cancelEvent(e);return false},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide()},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value)},100)}else cm.inst.execCommand(command,ui,value)}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){var doc,self=this;function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val}this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('<html><head><link href="'+tinyMCE.baseURL+'/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');doc.close()}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML=""},addSeparator:function(){this.html+='<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="'+this.settings['spacer_image']+'" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="'+this.settings['spacer_image']+'" /></td></tr>'},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='<tr class="contextMenuItem">';else html+='<tr class="contextMenuItemDisabled">';html+='<td class="contextMenuIcon"><img src="'+icon+'" width="20" height="20" class="contextMenuImage" /></td>';html+='<td><div class="contextMenuText">';html+='<a href="javascript:void(0);" onclick="'+onMouseDown+'" onmousedown="return false;">&#160;';html+=title;html+='&#160;</a>';html+='</div></td>';html+='</tr>';this.html+=html},show:function(x,y){var vp,width,height,yo;if(this.html=="")return;var html='';html+='<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';html+=this.html;html+='</table>';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='<div class="contextMenu">'+html+"</div>";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height)}else{vp=this.getViewPort();yo=tinyMCE.isMSIE5_0?document.body.scrollTop:self.pageYOffset;this.contextMenuDiv.style.left=(x>vp.left+vp.width-width?vp.left+vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.top+vp.height-height?vp.top+vp.height-height:y)+'px';this.contextMenuDiv.style.display="block"}},getViewPort:function(){return{left:self.pageXOffset||self.document.documentElement.scrollLeft||self.document.body.scrollLeft,top:self.pageYOffset||self.document.documentElement.scrollTop||self.document.body.scrollTop,width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none"},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);")}}; 
     1if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css")}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst)})}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu)},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst)}},_showContextMenu:function(e,inst){if(e.ctrlKey)return true;function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A'&&tinyMCE.getAttrib(elm,'name')=='')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true))}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.hasPlugin('flash')&&tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else if(tinyMCE.hasPlugin('media')&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm,'class')))contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_media_title","mceMedia");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false)}break}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert")}}contextMenu.show(x,y)},10);tinyMCE.cancelEvent(e);return false},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide()},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value)},100)}else cm.inst.execCommand(command,ui,value)}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){var doc,self=this;function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val}this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('<html><head><link href="'+tinyMCE.baseURL+'/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');doc.close()}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML=""},addSeparator:function(){this.html+='<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="'+this.settings['spacer_image']+'" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="'+this.settings['spacer_image']+'" /></td></tr>'},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='<tr class="contextMenuItem">';else html+='<tr class="contextMenuItemDisabled">';html+='<td class="contextMenuIcon"><img src="'+icon+'" width="20" height="20" class="contextMenuImage" /></td>';html+='<td><div class="contextMenuText">';html+='<a href="javascript:void(0);" onclick="'+onMouseDown+'" onmousedown="return false;">&#160;';html+=title;html+='&#160;</a>';html+='</div></td>';html+='</tr>';this.html+=html},show:function(x,y){var vp,width,height,yo;if(this.html=="")return;var html='';html+='<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';html+=this.html;html+='</table>';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='<div class="contextMenu">'+html+"</div>";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height)}else{vp=this.getViewPort();yo=tinyMCE.isMSIE5_0?document.body.scrollTop:self.pageYOffset;this.contextMenuDiv.style.left=(x>vp.left+vp.width-width?vp.left+vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.top+vp.height-height?vp.top+vp.height-height:y)+'px';this.contextMenuDiv.style.display="block"}},getViewPort:function(){return{left:self.pageXOffset||self.document.documentElement.scrollLeft||self.document.body.scrollLeft,top:self.pageYOffset||self.document.documentElement.scrollTop||self.document.body.scrollTop,width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none"},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);")}}; 
  • trunk/includes/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js

    r581 r1158  
    11/** 
    2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ 
     2 * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ 
    33 * 
    44 * @author Moxiecode 
     
    7474 
    7575    _showContextMenu : function(e, inst) { 
     76        if (e.ctrlKey) 
     77            return true; 
     78 
    7679        function getAttrib(elm, name) { 
    7780            return elm.getAttribute(name) ? elm.getAttribute(name) : ""; 
  • trunk/includes/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css

    r10 r1158  
    171171    height: 22px; 
    172172} 
     173 
     174textarea { 
     175    height: 55px; 
     176} 
  • trunk/includes/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js

    r581 r1158  
    1 tinyMCE.importPluginLanguagePack('fullpage');var TinyMCE_FullPagePlugin={getInfo:function(){return{longname:'Fullpage',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"fullpage":return tinyMCE.getButtonHTML(cn,'lang_fullpage_desc','{$pluginurl}/images/fullpage.gif','mceFullPageProperties')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFullPageProperties":var template=new Array();template['file']='../../plugins/fullpage/fullpage.htm';template['width']=430;template['height']=485+(tinyMCE.isOpera?5:0);template['width']+=tinyMCE.getLang('lang_fullpage_delta_width',0);template['height']+=tinyMCE.getLang('lang_fullpage_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceFullPageUpdate":TinyMCE_FullPagePlugin._addToHead(tinyMCE.getInstanceById(editor_id));return true}return false},cleanup:function(type,content,inst){switch(type){case"insert_to_editor":var tmp=content.toLowerCase();var pos=tmp.indexOf('<body'),pos2;if(pos!=-1){pos=tmp.indexOf('>',pos);pos2=tmp.lastIndexOf('</body>');inst.fullpageTopContent=content.substring(0,pos+1);content=content.substring(pos+1,pos2);}else{if(!inst.fullpageTopContent){var docType=tinyMCE.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-/'+'/W3C//DTD XHTML 1.0 Transitional/'+'/EN" "http:/'+'/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');var enc=tinyMCE.getParam("fullpage_default_encoding",'utf-8');var title=tinyMCE.getParam("fullpage_default_title",'Untitled document');var lang=tinyMCE.getParam("fullpage_default_langcode",'en');var pi=tinyMCE.getParam("fullpage_default_xml_pi",true);var ff=tinyMCE.getParam("fullpage_default_font_family","");var fz=tinyMCE.getParam("fullpage_default_font_size","");var ds=tinyMCE.getParam("fullpage_default_style","");var dtc=tinyMCE.getParam("fullpage_default_text_color","");title=title.replace(/&/g,'&amp;');title=title.replace(/\"/g,'&quot;');title=title.replace(/</g,'&lt;');title=title.replace(/>/g,'&gt;');tmp='';if(pi)tmp+='<?xml version="1.0" encoding="'+enc+'"?>\n';tmp+=docType+'\n';tmp+='<html xmlns="http:/'+'/www.w3.org/1999/xhtml" lang="'+lang+'" xml:lang="'+lang+'">\n';tmp+='<head>\n';tmp+='\t<title>'+title+'</title>\n';tmp+='\t<meta http-equiv="Content-Type" content="text/html; charset='+enc+'" />\n';tmp+='</head>\n';tmp+='<body';if(ff!=''||fz!=''){tmp+=' style="';if(ds!='')tmp+=ds+";";if(ff!='')tmp+='font-family: '+ff+";";if(fz!='')tmp+='font-size: '+fz+";";tmp+='"'}if(dtc!='')tmp+=' text="'+dtc+'"';tmp+='>\n';inst.fullpageTopContent=tmp}}this._addToHead(inst);break;case"get_from_editor":if(inst.fullpageTopContent)content=inst.fullpageTopContent+content+"\n</body>\n</html>";break}return content},_addToHead:function(inst){var doc=inst.getDoc();var head=doc.getElementsByTagName("head")[0];var body=doc.body;var h=inst.fullpageTopContent;var e=doc.createElement("body");var nl,i,le,tmp;h=h.replace(/(\r|\n)/gi,'');h=h.replace(/<\?[^\>]*\>/gi,'');h=h.replace(/<\/?(!DOCTYPE|head|html)[^\>]*\>/gi,'');h=h.replace(/<script(.*?)<\/script>/gi,'');h=h.replace(/<title(.*?)<\/title>/gi,'');h=h.replace(/<(meta|base)[^>]*>/gi,'');h=h.replace(/<link([^>]*)\/>/gi,'<pre mce_type="link" $1></pre>');h=h.replace(/<body/gi,'<div mce_type="body"');h+='</div>';e.innerHTML=h;body.vLink=body.aLink=body.link=body.text='';body.style.cssText='';nl=head.getElementsByTagName('link');for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],'mce_head')=="true")nl[i].parentNode.removeChild(nl[i])}nl=e.getElementsByTagName('pre');for(i=0;i<nl.length;i++){tmp=tinyMCE.getAttrib(nl[i],'media');if(tinyMCE.getAttrib(nl[i],'mce_type')=="link"&&(tmp==""||tmp=="screen"||tmp=="all")&&tinyMCE.getAttrib(nl[i],'rel')=="stylesheet"){le=doc.createElement("link");le.rel="stylesheet";le.href=tinyMCE.getAttrib(nl[i],'href');le.setAttribute("mce_head","true");head.appendChild(le)}}nl=e.getElementsByTagName('div');if(nl.length>0){body.style.cssText=tinyMCE.getAttrib(nl[0],'style');if((tmp=tinyMCE.getAttrib(nl[0],'leftmargin'))!=''&&body.style.marginLeft=='')body.style.marginLeft=tmp+"px";if((tmp=tinyMCE.getAttrib(nl[0],'rightmargin'))!=''&&body.style.marginRight=='')body.style.marginRight=tmp+"px";if((tmp=tinyMCE.getAttrib(nl[0],'topmargin'))!=''&&body.style.marginTop=='')body.style.marginTop=tmp+"px";if((tmp=tinyMCE.getAttrib(nl[0],'bottommargin'))!=''&&body.style.marginBottom=='')body.style.marginBottom=tmp+"px";body.dir=tinyMCE.getAttrib(nl[0],'dir');body.vLink=tinyMCE.getAttrib(nl[0],'vlink');body.aLink=tinyMCE.getAttrib(nl[0],'alink');body.link=tinyMCE.getAttrib(nl[0],'link');body.text=tinyMCE.getAttrib(nl[0],'text');if((tmp=tinyMCE.getAttrib(nl[0],'background'))!='')body.style.backgroundImage="url('"+tmp+"')";if((tmp=tinyMCE.getAttrib(nl[0],'bgcolor'))!='')body.style.backgroundColor=tmp}}};tinyMCE.addPlugin("fullpage",TinyMCE_FullPagePlugin); 
     1tinyMCE.importPluginLanguagePack('fullpage');var TinyMCE_FullPagePlugin={getInfo:function(){return{longname:'Fullpage',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"fullpage":return tinyMCE.getButtonHTML(cn,'lang_fullpage_desc','{$pluginurl}/images/fullpage.gif','mceFullPageProperties')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFullPageProperties":var template=new Array();template['file']='../../plugins/fullpage/fullpage.htm';template['width']=430;template['height']=485+(tinyMCE.isOpera?5:0);template['width']+=tinyMCE.getLang('lang_fullpage_delta_width',0);template['height']+=tinyMCE.getLang('lang_fullpage_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceFullPageUpdate":TinyMCE_FullPagePlugin._addToHead(tinyMCE.getInstanceById(editor_id));return true}return false},cleanup:function(type,content,inst){switch(type){case"insert_to_editor":var tmp=content.toLowerCase();var pos=tmp.indexOf('<body'),pos2;if(pos!=-1){pos=tmp.indexOf('>',pos);pos2=tmp.lastIndexOf('</body>');inst.fullpageTopContent=content.substring(0,pos+1);content=content.substring(pos+1,pos2);}else{if(!inst.fullpageTopContent){var docType=tinyMCE.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-/'+'/W3C//DTD XHTML 1.0 Transitional/'+'/EN" "http:/'+'/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');var enc=tinyMCE.getParam("fullpage_default_encoding",'utf-8');var title=tinyMCE.getParam("fullpage_default_title",'Untitled document');var lang=tinyMCE.getParam("fullpage_default_langcode",'en');var pi=tinyMCE.getParam("fullpage_default_xml_pi",true);var ff=tinyMCE.getParam("fullpage_default_font_family","");var fz=tinyMCE.getParam("fullpage_default_font_size","");var ds=tinyMCE.getParam("fullpage_default_style","");var dtc=tinyMCE.getParam("fullpage_default_text_color","");title=title.replace(/&/g,'&amp;');title=title.replace(/\"/g,'&quot;');title=title.replace(/</g,'&lt;');title=title.replace(/>/g,'&gt;');tmp='';if(pi)tmp+='<?xml version="1.0" encoding="'+enc+'"?>\n';tmp+=docType+'\n';tmp+='<html xmlns="http:/'+'/www.w3.org/1999/xhtml" lang="'+lang+'" xml:lang="'+lang+'">\n';tmp+='<head>\n';tmp+='\t<title>'+title+'</title>\n';tmp+='\t<meta http-equiv="Content-Type" content="text/html; charset='+enc+'" />\n';tmp+='</head>\n';tmp+='<body';if(ff!=''||fz!=''){tmp+=' style="';if(ds!='')tmp+=ds+";";if(ff!='')tmp+='font-family: '+ff+";";if(fz!='')tmp+='font-size: '+fz+";";tmp+='"'}if(dtc!='')tmp+=' text="'+dtc+'"';tmp+='>\n';inst.fullpageTopContent=tmp}}this._addToHead(inst);break;case"get_from_editor":if(inst.fullpageTopContent&&!tinyMCE.getParam("fullpage_hide_in_source_view",false)){content=content.replace(/(\s)?mce\_[a-z_]+\=[^\s>]+(\s|\>)/i,'');content=inst.fullpageTopContent+content+"\n</body>\n</html>"}break;case"submit_content":if(inst.fullpageTopContent&&tinyMCE.getParam("fullpage_hide_in_source_view",false))content=inst.fullpageTopContent+content+"\n</body>\n</html>";break}return content},_addToHead:function(inst){var doc=inst.getDoc();var head=doc.getElementsByTagName("head")[0];var body=doc.body;var h=inst.fullpageTopContent;var e=doc.createElement("body");var nl,i,le,tmp;h=h.replace(/(\r|\n)/gi,'');h=h.replace(/<\?[^\>]*\>/gi,'');h=h.replace(/<\/?(!DOCTYPE|head|html)[^\>]*\>/gi,'');h=h.replace(/<script(.*?)<\/script>/gi,'');h=h.replace(/<title(.*?)<\/title>/gi,'');h=h.replace(/<(meta|base)[^>]*>/gi,'');h=h.replace(/<link([^>]*)\/>/gi,'<pre mce_type="link" $1></pre>');h=h.replace(/<body/gi,'<div mce_type="body"');h+='</div>';e.innerHTML=h;body.vLink=body.aLink=body.link=body.text='';body.style.cssText='';nl=head.getElementsByTagName('link');for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],'mce_head')=="true")nl[i].parentNode.removeChild(nl[i])}nl=e.getElementsByTagName('pre');for(i=0;i<nl.length;i++){tmp=tinyMCE.getAttrib(nl[i],'media');if(tinyMCE.getAttrib(nl[i],'mce_type')=="link"&&(tmp==""||tmp=="screen"||tmp=="all")&&tinyMCE.getAttrib(nl[i],'rel')=="stylesheet"){le=doc.createElement("link");le.rel="stylesheet";le.href=tinyMCE.getAttrib(nl[i],'href');le.setAttribute("mce_head","true");head.appendChild(le)}}nl=e.getElementsByTagName('div');if(nl.length>0){body.style.cssText=tinyMCE.getAttrib(nl[0],'style');if((tmp=tinyMCE.getAttrib(nl[0],'leftmargin'))!=''&&body.style.marginLeft=='')body.style.marginLeft=tmp+"px";if((tmp=tinyMCE.getAttrib(nl[0],'rightmargin'))!=''&&body.style.marginRight=='')body.style.marginRight=tmp+"px";if((tmp=tinyMCE.getAttrib(nl[0],'topmargin'))!=''&&body.style.marginTop=='')body.style.marginTop=tmp+"px";if((tmp=tinyMCE.getAttrib(nl[0],'bottommargin'))!=''&&body.style.marginBottom=='')body.style.marginBottom=tmp+"px";body.dir=tinyMCE.getAttrib(nl[0],'dir');body.vLink=tinyMCE.getAttrib(nl[0],'vlink');body.aLink=tinyMCE.getAttrib(nl[0],'alink');body.link=tinyMCE.getAttrib(nl[0],'link');body.text=tinyMCE.getAttrib(nl[0],'text');if((tmp=tinyMCE.getAttrib(nl[0],'background'))!='')body.style.backgroundImage="url('"+tmp+"')";if((tmp=tinyMCE.getAttrib(nl[0],'bgcolor'))!='')body.style.backgroundColor=tmp}}};tinyMCE.addPlugin("fullpage",TinyMCE_FullPagePlugin); 
  • trunk/includes/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js

    r581 r1158  
    11/** 
    2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ 
     2 * $Id: editor_plugin_src.js 232 2007-03-05 17:00:27Z spocke $ 
    33 * 
    44 * @author Moxiecode 
     
    128128 
    129129            case "get_from_editor": 
    130                 if (inst.fullpageTopContent) 
     130                if (inst.fullpageTopContent && !tinyMCE.getParam("fullpage_hide_in_source_view", false)) { 
     131                    content = content.replace(/(\s)?mce\_[a-z_]+\=[^\s>]+(\s|\>)/i, ''); // Remove internal stuff 
     132                    content = inst.fullpageTopContent + content + "\n</body>\n</html>"; 
     133                } 
     134 
     135                break; 
     136 
     137            case "submit_content": 
     138                if (inst.fullpageTopContent && tinyMCE.getParam("fullpage_hide_in_source_view", false)) 
    131139                    content = inst.fullpageTopContent + content + "\n</body>\n</html>"; 
    132140 
  • trunk/includes/jscripts/tiny_mce/plugins/fullpage/fullpage.htm

    r10 r1158  
    3232                        <tr> 
    3333                            <td nowrap="nowrap"><label for="metakeywords">{$lang_fullpage_meta_keywords}</label>&nbsp;</td> 
    34                             <td><textarea id="metakeywords" name="metakeywords" rows="3"></textarea></td> 
     34                            <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td> 
    3535                        </tr> 
    3636                        <tr> 
    3737                            <td nowrap="nowrap"><label for="metadescription">{$lang_fullpage_meta_description}</label>&nbsp;</td> 
    38                             <td><textarea id="metadescription" name="metadescription" rows="3"></textarea></td> 
     38                            <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td> 
    3939                        </tr> 
    4040                        <tr> 
  • trunk/includes/jscripts/tiny_mce/plugins/fullpage/jscripts/fullpage.js

    r10 r1158  
    55    'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' + 
    66    'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' + 
    7     'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">">,' + 
     7    'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' + 
    88    'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' + 
    99    'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' + 
     
    394394    h = h.substring(0, h.lastIndexOf('</body>')); 
    395395 
    396     if (h.indexOf('<title>') == -1) 
    397         h = h.replace(/<head.*?>/, '$&\n' + '<title>' + inst.cleanup.xmlEncode(f.metatitle.value) + '</title>'); 
    398     else 
    399         h = h.replace(/<title>(.*?)<\/title>/, '<title>' + inst.cleanup.xmlEncode(f.metatitle.value) + '</title>'); 
     396//  if (h.indexOf('<title>') == -1) 
     397//      h = h.replace(/<head.*?>/, '$&\n' + '<title>' + inst.cleanup.xmlEncode(f.metatitle.value) + '</title>'); 
     398//  else 
     399//      h = h.replace(/<title>(.*?)<\/title>/, '<title>' + inst.cleanup.xmlEncode(f.metatitle.value) + '</title>'); 
    400400 
    401401    if ((v = getSelectValue(f, 'doctypes')) != '') 
  • trunk/includes/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js

    r581 r1158  
    11/** 
    2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ 
     2 * $Id: editor_plugin_src.js 268 2007-04-28 15:52:59Z spocke $ 
    33 * 
    44 * Moxiecode DHTML Windows script. 
     
    8989TinyMCE_Engine.prototype.closeWindow = function(win) { 
    9090    var gotit = false, n, w; 
     91 
    9192    for (n in mcWindows.windows) { 
    9293        w = mcWindows.windows[n]; 
    93         if (typeof(w) == 'function') continue; 
     94 
     95        if (typeof(w) == 'function') 
     96            continue; 
     97 
    9498        if (win.name == w.id + '_iframe') { 
    9599            w.close(); 
     
    97101        } 
    98102    } 
     103 
    99104    if (!gotit) 
    100105        this.orgCloseWindow(win); 
  • trunk/includes/jscripts/tiny_mce/plugins/media/editor_plugin.js

    r581 r1158  
    1 tinyMCE.importPluginLanguagePack('media');var TinyMCE_MediaPlugin={getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(inst.hasPlugin('flash')&&!tinyMCE.flashWarn){alert('Flash plugin is deprecated and should not be used together with the media plugin.');tinyMCE.flashWarn=true}if(!tinyMCE.settings['media_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/media/css/content.css")},getControlHTML:function(cn){switch(cn){case"media":return tinyMCE.getButtonHTML(cn,'lang_media_desc','{$pluginurl}/images/media.gif','mceMedia')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceMedia":tinyMCE.openWindow({file:'../../plugins/media/media.htm',width:430+tinyMCE.getLang('lang_media_delta_width',0),height:470+tinyMCE.getLang('lang_media_delta_height',0)},{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content,inst){var nl,img,i,ne,d,s,ci;switch(type){case"insert_to_editor":img=tinyMCE.getParam("theme_href")+'/images/spacer.gif';content=content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,'<img class="mceItem$1" title="$2" src="'+img+'" />');content=content.replace(/<object([^>]*)>/gi,'<div class="mceItemObject" $1>');content=content.replace(/<embed([^>]*)>/gi,'<div class="mceItemObjectEmbed" $1>');content=content.replace(/<\/(object|embed)([^>]*)>/gi,'</div>');content=content.replace(/<param([^>]*)>/gi,'<div $1 class="mceItemParam"></div>');content=content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>','gi'),'class="mceItemParam"></div>');break;case"insert_to_editor_dom":d=inst.getDoc();nl=content.getElementsByTagName("img");for(i=0;i<nl.length;i++){if(/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)){nl[i].width=nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g,'$1');nl[i].height=nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g,'$1');}}nl=tinyMCE.selectElements(content,'DIV',function(n){return tinyMCE.hasCSSClass(n,'mceItemObject')});for(i=0;i<nl.length;i++){ci=tinyMCE.getAttrib(nl[i],"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash',d,nl[i]),nl[i]);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave',d,nl[i]),nl[i]);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia',d,nl[i]),nl[i]);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime',d,nl[i]),nl[i]);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia',d,nl[i]),nl[i]);break}}nl=tinyMCE.selectNodes(content,function(n){return n.className=='mceItemObjectEmbed'});for(i=0;i<nl.length;i++){switch(tinyMCE.getAttrib(nl[i],'type')){case'application/x-shockwave-flash':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemFlash');break;case'application/x-director':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemShockWave');break;case'application/x-mplayer2':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemWindowsMedia');break;case'video/quicktime':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemQuickTime');break;case'audio/x-pn-realaudio-plugin':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemRealMedia');break}}break;case"get_from_editor":var startPos=-1,endPos,attribs,chunkBefore,chunkAfter,embedHTML,at,pl,cb,mt,ex;while((startPos=content.indexOf('<img',startPos+1))!=-1){endPos=content.indexOf('/>',startPos);attribs=TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos+4,endPos));if(!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))continue;endPos+=2;at=attribs['title'];if(at){at=at.replace(/&(#39|apos);/g,"'");at=at.replace(/&#quot;/g,'"');try{pl=eval('x={'+at+'};')}catch(ex){pl={}}}if(!tinyMCE.getParam('media_use_script',false)){switch(attribs['class']){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166B1BCA-3F9C-11CF-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=tinyMCE.getParam('media_wmp6_compatible')?'05589FA1-C356-11CE-BF01-00AA0055595A':'6BF52A52-394A-11D3-B153-00C04F79FAA6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break}if(!tinyMCE.getParam("relative_urls"))pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);embedHTML=TinyMCE_MediaPlugin._getEmbed(ci,cb,mt,pl,attribs)}else{switch(attribs['class']){case'mceItemFlash':s='writeFlash';break;case'mceItemShockWave':s='writeShockWave';break;case'mceItemWindowsMedia':s='writeWindowsMedia';break;case'mceItemQuickTime':s='writeQuickTime';break;case'mceItemRealMedia':s='writeRealMedia';break}if(attribs.width)at=at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g,"width:'"+attribs.width+"'");if(attribs.height)at=at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g,"height:'"+attribs.height+"'");if(!tinyMCE.getParam("relative_urls")){pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);at=at.replace(new RegExp("src:'[^']*'","g"),"src:'"+pl.src+"'")}embedHTML='<script type="text/javascript">'+s+'({'+at+'});</script>'}chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node,'class'))){tinyMCE.switchClass(editor_id+'_media','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_media','mceButtonNormal');return true},_createImgFromEmbed:function(n,d,cl){var ne,at,i,ti='',an;ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;at=n.attributes;for(i=0;i<at.length;i++){if(at[i].specified&&at[i].nodeValue){an=at[i].nodeName.toLowerCase();if(an=='src')continue;if(an=='mce_src')an='src';if(an.indexOf('mce_')==-1&&!new RegExp('^(class|type)$').test(an))ti+=an.toLowerCase()+':\''+at[i].nodeValue+"',"}}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;n.parentNode.replaceChild(ne,n)},_createImg:function(cl,d,n){var i,nl,ti="",an,av,al=new Array();ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;al.id=tinyMCE.getAttrib(n,'id');al.name=tinyMCE.getAttrib(n,'name');al.width=tinyMCE.getAttrib(n,'width');al.height=tinyMCE.getAttrib(n,'height');al.bgcolor=tinyMCE.getAttrib(n,'bgcolor');al.align=tinyMCE.getAttrib(n,'align');al.class_name=tinyMCE.getAttrib(n,'mce_class');nl=n.getElementsByTagName('div');for(i=0;i<nl.length;i++){av=tinyMCE.getAttrib(nl[i],'value');av=av.replace(new RegExp('\\\\','g'),'\\\\');av=av.replace(new RegExp('"','g'),'\\"');av=av.replace(new RegExp("'",'g'),"\\'");an=tinyMCE.getAttrib(nl[i],'name');al[an]=av}if(al.movie){al.src=al.movie;al.movie=null}for(an in al){if(al[an]!=null&&typeof(al[an])!="function"&&al[an]!='')ti+=an.toLowerCase()+':\''+al[an]+"',"}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;return ne},_getEmbed:function(cls,cb,mt,p,at){var h='',n;p.width=at.width?at.width:p.width;p.height=at.height?at.height:p.height;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?' id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?' name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?' width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?' height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?' align="'+p.align+'"':'';h+='>';for(n in p){if(p[n]&&typeof(p[n])!="function"){h+='<param name="'+n+'" value="'+p[n]+'" />';if(n=='src'&&p[n].indexOf('://')!=-1&&mt=='application/x-mplayer2')h+='<param name="url" value="'+p[n]+'" />'}}h+='<embed type="'+mt+'"';for(n in p){if(typeof(p[n])=="function")continue;if(!(n=='url'&&mt=='application/x-mplayer2'))h+=' '+n+'="'+p[n]+'"'}h+='></embed></object>';return h},_parseAttributes:function(attribute_string){var attributeName="",endChr='"';var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue){withInValue=true;endChr=chr}else if(chr==endChr&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1);attributeName="";attributeValue=""}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr}return attributes}};tinyMCE.addPlugin("media",TinyMCE_MediaPlugin); 
     1tinyMCE.importPluginLanguagePack('media');var TinyMCE_MediaPlugin={getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(inst.hasPlugin('flash')&&!tinyMCE.flashWarn){alert('Flash plugin is deprecated and should not be used together with the media plugin.');tinyMCE.flashWarn=true}if(!tinyMCE.settings['media_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/media/css/content.css")},getControlHTML:function(cn){switch(cn){case"media":return tinyMCE.getButtonHTML(cn,'lang_media_desc','{$pluginurl}/images/media.gif','mceMedia')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceMedia":tinyMCE.openWindow({file:'../../plugins/media/media.htm',width:430+tinyMCE.getLang('lang_media_delta_width',0),height:470+tinyMCE.getLang('lang_media_delta_height',0)},{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content,inst){var nl,img,i,ne,d,s,ci;switch(type){case"insert_to_editor":img=tinyMCE.getParam("theme_href")+'/images/spacer.gif';content=content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,'<img class="mceItem$1" title="$2" src="'+img+'" />');content=content.replace(/<object([^>]*)>/gi,'<div class="mceItemObject" $1>');content=content.replace(/<embed([^>]*)>/gi,'<div class="mceItemObjectEmbed" $1>');content=content.replace(/<\/(object|embed)([^>]*)>/gi,'</div>');content=content.replace(/<param([^>]*)>/gi,'<div $1 class="mceItemParam"></div>');content=content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>','gi'),'class="mceItemParam"></div>');break;case"insert_to_editor_dom":d=inst.getDoc();nl=content.getElementsByTagName("img");for(i=0;i<nl.length;i++){if(/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)){nl[i].width=nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g,'$1');nl[i].height=nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g,'$1');}}nl=tinyMCE.selectElements(content,'DIV',function(n){return tinyMCE.hasCSSClass(n,'mceItemObject')});for(i=0;i<nl.length;i++){ci=tinyMCE.getAttrib(nl[i],"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash',d,nl[i]),nl[i]);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave',d,nl[i]),nl[i]);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia',d,nl[i]),nl[i]);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime',d,nl[i]),nl[i]);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia',d,nl[i]),nl[i]);break}}nl=tinyMCE.selectNodes(content,function(n){return n.className=='mceItemObjectEmbed'});for(i=0;i<nl.length;i++){switch(tinyMCE.getAttrib(nl[i],'type')){case'application/x-shockwave-flash':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemFlash');break;case'application/x-director':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemShockWave');break;case'application/x-mplayer2':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemWindowsMedia');break;case'video/quicktime':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemQuickTime');break;case'audio/x-pn-realaudio-plugin':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemRealMedia');break}}break;case"get_from_editor":var startPos=-1,endPos,attribs,chunkBefore,chunkAfter,embedHTML,at,pl,cb,mt,ex;while((startPos=content.indexOf('<img',startPos+1))!=-1){endPos=content.indexOf('/>',startPos);attribs=TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos+4,endPos));if(!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))continue;endPos+=2;at=attribs['title'];if(at){at=at.replace(/&(#39|apos);/g,"'");at=at.replace(/&#quot;/g,'"');try{pl=eval('x={'+at+'};')}catch(ex){pl={}}}if(!tinyMCE.getParam('media_use_script',false)){switch(attribs['class']){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166B1BCA-3F9C-11CF-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=tinyMCE.getParam('media_wmp6_compatible')?'05589FA1-C356-11CE-BF01-00AA0055595A':'6BF52A52-394A-11D3-B153-00C04F79FAA6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break}pl.src=tinyMCE.convertURL(pl.src,null,true);embedHTML=TinyMCE_MediaPlugin._getEmbed(ci,cb,mt,pl,attribs)}else{switch(attribs['class']){case'mceItemFlash':s='writeFlash';break;case'mceItemShockWave':s='writeShockWave';break;case'mceItemWindowsMedia':s='writeWindowsMedia';break;case'mceItemQuickTime':s='writeQuickTime';break;case'mceItemRealMedia':s='writeRealMedia';break}if(attribs.width)at=at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g,"width:'"+attribs.width+"'");if(attribs.height)at=at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g,"height:'"+attribs.height+"'");pl.src=tinyMCE.convertURL(pl.src,null,true);at=at.replace(new RegExp("src:'[^']*'","g"),"src:'"+pl.src+"'");embedHTML='<script type="text/javascript">'+s+'({'+at+'});</script>'}chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node,'class'))){tinyMCE.switchClass(editor_id+'_media','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_media','mceButtonNormal');return true},_createImgFromEmbed:function(n,d,cl){var ne,at,i,ti='',an;ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;at=n.attributes;for(i=0;i<at.length;i++){if(at[i].specified&&at[i].nodeValue){an=at[i].nodeName.toLowerCase();if(an=='src')continue;if(an=='mce_src')an='src';if(an.indexOf('mce_')==-1&&!new RegExp('^(class|type)$').test(an))ti+=an.toLowerCase()+':\''+at[i].nodeValue+"',"}}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;n.parentNode.replaceChild(ne,n)},_createImg:function(cl,d,n){var i,nl,ti="",an,av,al=new Array();ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;al.id=tinyMCE.getAttrib(n,'id');al.name=tinyMCE.getAttrib(n,'name');al.width=tinyMCE.getAttrib(n,'width');al.height=tinyMCE.getAttrib(n,'height');al.bgcolor=tinyMCE.getAttrib(n,'bgcolor');al.align=tinyMCE.getAttrib(n,'align');al.class_name=tinyMCE.getAttrib(n,'mce_class');nl=n.getElementsByTagName('div');for(i=0;i<nl.length;i++){av=tinyMCE.getAttrib(nl[i],'value');av=av.replace(new RegExp('\\\\','g'),'\\\\');av=av.replace(new RegExp('"','g'),'\\"');av=av.replace(new RegExp("'",'g'),"\\'");an=tinyMCE.getAttrib(nl[i],'name');al[an]=av}if(al.movie){al.src=al.movie;al.movie=null}for(an in al){if(al[an]!=null&&typeof(al[an])!="function"&&al[an]!='')ti+=an.toLowerCase()+':\''+al[an]+"',"}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;return ne},_getEmbed:function(cls,cb,mt,p,at){var h='',n;p.width=at.width?at.width:p.width;p.height=at.height?at.height:p.height;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?' id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?' name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?' width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?' height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?' align="'+p.align+'"':'';h+='>';for(n in p){if(typeof(p[n])!="undefined"&&typeof(p[n])!="function"){h+='<param name="'+n+'" value="'+p[n]+'" />';if(n=='src'&&p[n].indexOf('://')!=-1&&mt=='application/x-mplayer2')h+='<param name="url" value="'+p[n]+'" />'}}h+='<embed type="'+mt+'"';for(n in p){if(typeof(p[n])=="function")continue;if(!(n=='url'&&mt=='application/x-mplayer2'))h+=' '+n+'="'+p[n]+'"'}h+='></embed></object>';return h},_parseAttributes:function(attribute_string){var attributeName="",endChr='"';var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue){withInValue=true;endChr=chr}else if(chr==endChr&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1);attributeName="";attributeValue=""}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr}return attributes}};tinyMCE.addPlugin("media",TinyMCE_MediaPlugin); 
  • trunk/includes/jscripts/tiny_mce/plugins/media/editor_plugin_src.js

    r581 r1158  
    11/** 
    2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ 
     2 * $Id: editor_plugin_src.js 296 2007-08-21 10:36:35Z spocke $ 
    33 * 
    44 * @author Moxiecode 
     
    9999 
    100100                        case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': 
     101                        case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': 
     102                        case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': 
    101103                            nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia', d, nl[i]), nl[i]); 
    102104                            break; 
     
    107109 
    108110                        case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': 
    109                         case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': 
    110                         case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': 
    111111                            nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia', d, nl[i]), nl[i]); 
    112112                            break; 
     
    201201                        } 
    202202 
    203                         // Force absolute URL 
    204                         if (!tinyMCE.getParam("relative_urls")) 
    205                             pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); 
     203                        // Convert the URL 
     204                        pl.src = tinyMCE.convertURL(pl.src, null, true); 
    206205 
    207206                        embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs); 
     
    237236 
    238237                        // Force absolute URL 
    239                         if (!tinyMCE.getParam("relative_urls")) { 
    240                             pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src); 
    241                             at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'"); 
    242                         } 
     238                        pl.src = tinyMCE.convertURL(pl.src, null, true); 
     239                        at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'"); 
    243240 
    244241                        embedHTML = '<script type="text/javascript">' + s + '({' + at + '});</script>'; 
     
    361358 
    362359        for (n in p) { 
    363             if (p[n] && typeof(p[n]) != "function") { 
     360            if (typeof(p[n]) != "undefined" && typeof(p[n]) != "function") { 
    364361                h += '<param name="' + n + '" value="' + p[n] + '" />'; 
    365362 
  • trunk/includes/jscripts/tiny_mce/plugins/media/jscripts/media.js

    r581 r1158  
    210210        } 
    211211 
    212         if (fe.width != f.width.value || fe.height != f.width.height) 
     212        if (fe.width != f.width.value || fe.height != f.height.height) 
    213213            tinyMCE.selectedInstance.repaint(); 
    214214 
     
    276276 
    277277function getType(v) { 
    278     var fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'), i, c, el, x; 
     278    var fo, i, c, el, x, f = document.forms[0]; 
     279 
     280    fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); 
     281 
     282    // YouTube 
     283    if (v.indexOf('http://www.youtube.com/watch?v=') == 0 || v.indexOf('http://youtube.com/watch?v=') == 0) { 
     284        f.width.value = '425'; 
     285        f.height.value = '350'; 
     286 
     287        v = v.replace('http://youtube.com/watch?v=', ''); 
     288        v = v.replace('http://www.youtube.com/watch?v=', ''); 
     289 
     290        f.src.value = 'http://www.youtube.com/v/' + v; 
     291        return 'flash'; 
     292    } 
     293 
     294    // Google video 
     295    if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { 
     296        f.width.value = '425'; 
     297        f.height.value = '326'; 
     298        f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; 
     299        return 'flash'; 
     300    } 
    279301 
    280302    for (i=0; i<fo.length; i++) { 
     
    338360        case "qt": 
    339361            s += getBool('qt', 'loop', false); 
    340             s += getBool('qt', 'autoplay', false); 
     362            s += getBool('qt', 'autoplay', true); 
    341363            s += getBool('qt', 'cache', false); 
    342364            s += getBool('qt', 'controller', true); 
  • trunk/includes/jscripts/tiny_mce/plugins/media/langs/en.js

    r581 r1158  
    66general : 'General', 
    77advanced : 'Advanced', 
    8 file : 'File', 
     8file : 'File/URL', 
    99list : 'List', 
    1010size : 'Dimensions', 
  • trunk/includes/jscripts/tiny_mce/plugins/media/media.htm

    r581 r1158  
    3232                                        <option value="flash">Flash</option> 
    3333                                        <option value="qt">Quicktime</option> 
    34                                         <option value="shockwave">Shockware</option> 
     34                                        <option value="shockwave">Shockwave</option> 
    3535                                        <option value="wmp">Windows Media</option> 
    3636                                        <option value="rmp">Real Media</option> 
     
    243243                                <table border="0" cellpadding="0" cellspacing="0"> 
    244244                                    <tr> 
    245                                         <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" onchange="generatePreview();" /></td> 
     245                                        <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td> 
    246246                                        <td><label for="qt_autoplay">{$lang_media_play}</label></td> 
    247247                                    </tr> 
  • trunk/includes/jscripts/tiny_mce/plugins/save/editor_plugin.js

    r581 r1158  
    1 tinyMCE.importPluginLanguagePack('save');var TinyMCE_SavePlugin={getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','s','lang_save_desc','mceSave')},getControlHTML:function(cn){switch(cn){case"save":return tinyMCE.getButtonHTML(cn,'lang_save_desc','{$pluginurl}/images/save.gif','mceSave')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceSave":if(tinyMCE.getParam("fullscreen_is_enabled"))return true;var inst=tinyMCE.selectedInstance;var formObj=inst.formElement.form;if(tinyMCE.getParam("save_enablewhendirty")&&!inst.isDirty())return true;if(formObj){tinyMCE.triggerSave();var os;if((os=tinyMCE.getParam("save_onsavecallback"))){if(eval(os+'(inst);')){inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);tinyMCE.triggerNodeChange(false,true)}return true}for(var i=0;i<formObj.elements.length;i++){var elementId=formObj.elements[i].name?formObj.elements[i].name:formObj.elements[i].id;if(elementId.indexOf('mce_editor_')==0)formObj.elements[i].disabled=true}tinyMCE.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)inst.formElement.form.submit()}else alert("Error: No form element found.");return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(tinyMCE.getParam("fullscreen_is_enabled")){tinyMCE.switchClass(editor_id+'_save','mceButtonDisabled');return true}if(tinyMCE.getParam("save_enablewhendirty")){var inst=tinyMCE.getInstanceById(editor_id);if(inst.isDirty()){tinyMCE.switchClass(editor_id+'_save','mceButtonNormal');return true}tinyMCE.switchClass(editor_id+'_save','mceButtonDisabled')}return true}};tinyMCE.addPlugin("save",TinyMCE_SavePlugin); 
     1tinyMCE.importPluginLanguagePack('save');var TinyMCE_SavePlugin={getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','s','lang_save_desc','mceSave')},getControlHTML:function(cn){switch(cn){case"save":return tinyMCE.getButtonHTML(cn,'lang_save_desc','{$pluginurl}/images/save.gif','mceSave');case"cancel":return tinyMCE.getButtonHTML(cn,'lang_cancel_desc','{$pluginurl}/images/cancel.gif','mceCancel')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceSave":return this._save(editor_id,element,command,user_interface,value);case"mceCancel":return this._cancel(editor_id,element,command,user_interface,value)}return false},_save:function(editor_id,element,command,user_interface,value){var inst,formObj,os,i,elementId;if(tinyMCE.getParam("fullscreen_is_enabled"))return true;inst=tinyMCE.selectedInstance;formObj=inst.formElement.form;if(tinyMCE.getParam("save_enablewhendirty")&&!inst.isDirty())return true;if(formObj){tinyMCE.triggerSave();if((os=tinyMCE.getParam("save_onsavecallback"))){if(eval(os+'(inst);')){inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);tinyMCE.triggerNodeChange(false,true)}return true}for(i=0;i<formObj.elements.length;i++){elementId=formObj.elements[i].name?formObj.elements[i].name:formObj.elements[i].id;if(elementId.indexOf('mce_editor_')==0)formObj.elements[i].disabled=true}inst.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)inst.formElement.form.submit();tinyMCE.triggerNodeChange(false,true)}else alert("Error: No form element found.");return true},_cancel:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),os,h=tinyMCE.trim(inst.startContent);if((os=tinyMCE.getParam("save_oncancelcallback"))){if(eval(os+'(inst);'))return true}inst.setHTML(h);inst.undoRedo.undoLevels=[];inst.undoRedo.add({content:h});inst.undoRedo.undoIndex=0;inst.undoRedo.typingUndoIndex=-1;tinyMCE.triggerNodeChange(false,true);return true},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var inst;if(tinyMCE.getParam("fullscreen_is_enabled")){tinyMCE.switchClass(editor_id+'_save','mceButtonDisabled');return true}if(tinyMCE.getParam("save_enablewhendirty")){inst=tinyMCE.getInstanceById(editor_id);if(inst.isDirty()){tinyMCE.switchClass(editor_id+'_save','mceButtonNormal');return true}tinyMCE.switchClass(editor_id+'_save','mceButtonDisabled')}return true}};tinyMCE.addPlugin("save",TinyMCE_SavePlugin); 
  • trunk/includes/jscripts/tiny_mce/plugins/save/editor_plugin_src.js

    r581 r1158  
    11/** 
    2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ 
     2 * $Id: editor_plugin_src.js 251 2007-04-10 20:16:15Z spocke $ 
    33 * 
    44 * @author Moxiecode 
     
    3131            case "save": 
    3232                return tinyMCE.getButtonHTML(cn, 'lang_save_desc', '{$pluginurl}/images/save.gif', 'mceSave'); 
     33 
     34            case "cancel": 
     35                return tinyMCE.getButtonHTML(cn, 'lang_cancel_desc', '{$pluginurl}/images/cancel.gif', 'mceCancel'); 
    3336        } 
    3437 
     
    4346        switch (command) { 
    4447            case "mceSave": 
    45                 if (tinyMCE.getParam("fullscreen_is_enabled")) 
    46                     return true; 
     48                return this._save(editor_id, element, command, user_interface, value); 
    4749 
    48                 var inst = tinyMCE.selectedInstance; 
    49                 var formObj = inst.formElement.form; 
     50            case "mceCancel": 
     51                return this._cancel(editor_id, element, command, user_interface, value); 
     52        } 
    5053 
    51                 if (tinyMCE.getParam("save_enablewhendirty") && !inst.isDirty()) 
    52                     return true; 
    53  
    54                 if (formObj) { 
    55                     tinyMCE.triggerSave(); 
    56  
    57                     // Use callback instead 
    58                     var os; 
    59                     if ((os = tinyMCE.getParam("save_onsavecallback"))) { 
    60                         if (eval(os + '(inst);')) { 
    61                             inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); 
    62                             /*inst.undoLevels = new Array(); 
    63                             inst.undoIndex = 0; 
    64                             inst.typingUndoIndex = -1; 
    65                             inst.undoRedo = true; 
    66                             inst.undoLevels[inst.undoLevels.length] = inst.startContent;*/ 
    67                             tinyMCE.triggerNodeChange(false, true); 
    68                         } 
    69  
    70                         return true; 
    71                     } 
    72  
    73                     // Disable all UI form elements that TinyMCE created 
    74                     for (var i=0; i<formObj.elements.length; i++) { 
    75                         var elementId = formObj.elements[i].name ? formObj.elements[i].name : formObj.elements[i].id; 
    76  
    77                         if (elementId.indexOf('mce_editor_') == 0) 
    78                             formObj.elements[i].disabled = true; 
    79                     } 
    80  
    81                     tinyMCE.isNotDirty = true; 
    82  
    83                     if (formObj.onsubmit == null || formObj.onsubmit() != false) 
    84                         inst.formElement.form.submit(); 
    85                 } else 
    86                     alert("Error: No form element found."); 
    87  
    88                 return true; 
    89         } 
    9054        // Pass to next handler in chain 
    9155        return false; 
    9256    }, 
    9357 
     58    _save : function(editor_id, element, command, user_interface, value) { 
     59        var inst, formObj, os, i, elementId; 
     60 
     61        if (tinyMCE.getParam("fullscreen_is_enabled")) 
     62            return true; 
     63 
     64        inst = tinyMCE.selectedInstance; 
     65        formObj = inst.formElement.form; 
     66 
     67        if (tinyMCE.getParam("save_enablewhendirty") && !inst.isDirty()) 
     68            return true; 
     69 
     70        if (formObj) { 
     71            tinyMCE.triggerSave(); 
     72 
     73            // Use callback instead 
     74            if ((os = tinyMCE.getParam("save_onsavecallback"))) { 
     75                if (eval(os + '(inst);')) { 
     76                    inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); 
     77                    /*inst.undoLevels = new Array(); 
     78                    inst.undoIndex = 0; 
     79                    inst.typingUndoIndex = -1; 
     80                    inst.undoRedo = true; 
     81                    inst.undoLevels[inst.undoLevels.length] = inst.startContent;*/ 
     82                    tinyMCE.triggerNodeChange(false, true); 
     83                } 
     84 
     85                return true; 
     86            } 
     87 
     88            // Disable all UI form elements that TinyMCE created 
     89            for (i=0; i<formObj.elements.length; i++) { 
     90                elementId = formObj.elements[i].name ? formObj.elements[i].name : formObj.elements[i].id; 
     91 
     92                if (elementId.indexOf('mce_editor_') == 0) 
     93                    formObj.elements[i].disabled = true; 
     94            } 
     95 
     96            inst.isNotDirty = true; 
     97 
     98            if (formObj.onsubmit == null || formObj.onsubmit() != false) 
     99                inst.formElement.form.submit(); 
     100 
     101            tinyMCE.triggerNodeChange(false, true); 
     102        } else 
     103            alert("Error: No form element found."); 
     104 
     105        return true; 
     106    }, 
     107 
     108    _cancel : function(editor_id, element, command, user_interface, value) { 
     109        var inst = tinyMCE.getInstanceById(editor_id), os, h = tinyMCE.trim(inst.startContent); 
     110 
     111        // Use callback instead 
     112        if ((os = tinyMCE.getParam("save_oncancelcallback"))) { 
     113            if (eval(os + '(inst);')) 
     114                return true; 
     115        } 
     116 
     117        inst.setHTML(h); 
     118 
     119        inst.undoRedo.undoLevels = []; 
     120        inst.undoRedo.add({ content : h }); 
     121        inst.undoRedo.undoIndex = 0; 
     122        inst.undoRedo.typingUndoIndex = -1; 
     123 
     124        tinyMCE.triggerNodeChange(false, true); 
     125 
     126        return true; 
     127    }, 
     128 
    94129    handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { 
     130        var inst; 
     131 
    95132        if (tinyMCE.getParam("fullscreen_is_enabled")) { 
    96133            tinyMCE.switchClass(editor_id + '_save', 'mceButtonDisabled'); 
     
    99136 
    100137        if (tinyMCE.getParam("save_enablewhendirty")) { 
    101             var inst = tinyMCE.getInstanceById(editor_id); 
     138            inst = tinyMCE.getInstanceById(editor_id); 
    102139 
    103140            if (inst.isDirty()) { 
  • trunk/includes/jscripts/tiny_mce/plugins/save/langs/en.js

    r10 r1158  
    22 
    33tinyMCE.addToLang('',{ 
    4 save_desc : 'Save' 
     4save_desc : 'Save', 
     5cancel_desc : 'Cancel all changes' 
    56}); 
  • trunk/includes/jscripts/tiny_mce/plugins/table/langs/en.js

    r581 r1158  
    3939bgcolor : 'Background color', 
    4040merge_cells_title : 'Merge table cells', 
    41 split_cells_desc : 'Split table cells', 
     41split_cells_desc : 'Split merged table cells', 
    4242merge_cells_desc : 'Merge table cells', 
    4343cut_row_desc : 'Cut table row', 
  • trunk/includes/jscripts/tiny_mce/plugins/table/table.htm

    r581 r1158  
    6363                              <tr> 
    6464                                <td class="column1"><label for="caption">{$lang_table_caption}</label></td>  
    65                                 <td><input id="caption" name="caption" type="checkbox" value="true" /></td>  
     65                                <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td>  
    6666                              </tr> 
    6767                            </table> 
  • trunk/includes/jscripts/tiny_mce/plugins/template/blank.htm

    r581 r1158  
    1818    </script> 
    1919</head> 
    20 <body id="mceTemplatePreview"> 
     20<body id="mceTemplatePreview" class="mceContentBody"> 
    2121 
    2222</body> 
  • trunk/includes/jscripts/tiny_mce/plugins/template/jscripts/template.js

    r581 r1158  
    6060 
    6161        // Force complete document 
    62         if (!/<body/gi.test(this.currentTemplateHTML)) { 
     62/*      if (!/<body/gi.test(this.currentTemplateHTML)) { 
    6363            this.currentTemplateHTML = '<html xmlns="http://www.w3.org/1999/xhtml">' +  
    6464                '<head>' +  
     
    7070                '</body>' +  
    7171                '</html>'; 
    72         } 
     72        }*/ 
    7373 
    7474        // Write HTML to preview iframe 
  • trunk/includes/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js

    r581 r1158  
    1 tinyMCE.importPluginLanguagePack('xhtmlxtras');var TinyMCE_XHTMLXtrasPlugin={getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/xhtmlxtras/css/xhtmlxtras.css")},getControlHTML:function(cn){switch(cn){case"cite":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_cite_desc','{$pluginurl}/images/cite.gif','mceCite',true);case"acronym":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_acronym_desc','{$pluginurl}/images/acronym.gif','mceAcronym',true);case"abbr":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_abbr_desc','{$pluginurl}/images/abbr.gif','mceAbbr',true);case"del":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_del_desc','{$pluginurl}/images/del.gif','mceDel',true);case"ins":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_ins_desc','{$pluginurl}/images/ins.gif','mceIns',true);case"attribs":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_attribs_desc','{$pluginurl}/images/attribs.gif','mceAttributes',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var template,inst,elm;switch(command){case"mceCite":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/cite.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAcronym":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/acronym.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAbbr":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/abbr.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceIns":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/ins.htm';template['width']=350;template['height']=310;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceDel":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/del.htm';template['width']=350;template['height']=310;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAttributes":inst=tinyMCE.getInstanceById(editor_id);elm=inst.getFocusElement();if(elm&&elm.nodeName!=='BODY'&&elm.className.indexOf('mceItem')==-1){tinyMCE.openWindow({file:'../../plugins/xhtmlxtras/attributes.htm',width:380,height:370},{editor_id:editor_id})}return true}return false},cleanup:function(type,content,inst){if(type=='insert_to_editor'&&tinyMCE.isIE&&!tinyMCE.isOpera){content=content.replace(/<abbr([^>]+)>/gi,'<html:ABBR $1>');content=content.replace(/<\/abbr>/gi,'</html:ABBR>')}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var elm=tinyMCE.getParentElement(node);if(node==null)return;tinyMCE.switchClass(editor_id+'_attribs','mceButtonDisabled');if(!any_selection){tinyMCE.switchClass(editor_id+'_cite','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_acronym','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_abbr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_del','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_ins','mceButtonDisabled')}else{tinyMCE.switchClass(editor_id+'_cite','mceButtonNormal');tinyMCE.switchClass(editor_id+'_acronym','mceButtonNormal');tinyMCE.switchClass(editor_id+'_abbr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_del','mceButtonNormal');tinyMCE.switchClass(editor_id+'_ins','mceButtonNormal')}if(elm&&elm.nodeName!='BODY'&&elm.className.indexOf('mceItem')==-1)tinyMCE.switchClass(editor_id+'_attribs','mceButtonNormal');switch(node.nodeName){case"CITE":tinyMCE.switchClass(editor_id+'_cite','mceButtonSelected');return true;case"ACRONYM":tinyMCE.switchClass(editor_id+'_acronym','mceButtonSelected');return true;case"abbr":case"HTML:ABBR":case"ABBR":tinyMCE.switchClass(editor_id+'_abbr','mceButtonSelected');return true;case"DEL":tinyMCE.switchClass(editor_id+'_del','mceButtonSelected');return true;case"INS":tinyMCE.switchClass(editor_id+'_ins','mceButtonSelected');return true}return true},_anySel:function(editor_id){var inst=tinyMCE.getInstanceById(editor_id),t=inst.selection.getSelectedText(),pe;pe=tinyMCE.getParentElement(inst.getFocusElement(),'CITE,ACRONYM,ABBR,HTML:ABBR,DEL,INS');return pe||inst.getFocusElement().nodeName=="IMG"||(t&&t.length>0)}};tinyMCE.addPlugin("xhtmlxtras",TinyMCE_XHTMLXtrasPlugin); 
     1tinyMCE.importPluginLanguagePack('xhtmlxtras');var TinyMCE_XHTMLXtrasPlugin={getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/xhtmlxtras/css/xhtmlxtras.css")},getControlHTML:function(cn){switch(cn){case"cite":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_cite_desc','{$pluginurl}/images/cite.gif','mceCite',true);case"acronym":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_acronym_desc','{$pluginurl}/images/acronym.gif','mceAcronym',true);case"abbr":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_abbr_desc','{$pluginurl}/images/abbr.gif','mceAbbr',true);case"del":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_del_desc','{$pluginurl}/images/del.gif','mceDel',true);case"ins":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_ins_desc','{$pluginurl}/images/ins.gif','mceIns',true);case"attribs":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_attribs_desc','{$pluginurl}/images/attribs.gif','mceAttributes',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var template,inst,elm;switch(command){case"mceCite":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/cite.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAcronym":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/acronym.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAbbr":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/abbr.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceIns":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/ins.htm';template['width']=350;template['height']=310;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceDel":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/del.htm';template['width']=350;template['height']=310;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAttributes":inst=tinyMCE.getInstanceById(editor_id);elm=inst.getFocusElement();if(elm&&elm.nodeName!=='BODY'&&elm.className.indexOf('mceItem')==-1){tinyMCE.openWindow({file:'../../plugins/xhtmlxtras/attributes.htm',width:380,height:370},{editor_id:editor_id})}return true}return false},cleanup:function(type,content,inst){if(type=='insert_to_editor'&&tinyMCE.isIE&&!tinyMCE.isOpera){content=content.replace(/<abbr([^>]+)>/gi,'<html:ABBR $1>');content=content.replace(/<\/abbr>/gi,'</html:ABBR>')}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var elm=tinyMCE.getParentElement(node);if(node==null)return;tinyMCE.switchClass(editor_id+'_attribs','mceButtonDisabled');if(!any_selection){tinyMCE.switchClass(editor_id+'_cite','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_acronym','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_abbr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_del','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_ins','mceButtonDisabled')}else{tinyMCE.switchClass(editor_id+'_cite','mceButtonNormal');tinyMCE.switchClass(editor_id+'_acronym','mceButtonNormal');tinyMCE.switchClass(editor_id+'_abbr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_del','mceButtonNormal');tinyMCE.switchClass(editor_id+'_ins','mceButtonNormal')}if(elm&&elm.nodeName!='BODY'&&elm.className.indexOf('mceItem')==-1)tinyMCE.switchClass(editor_id+'_attribs','mceButtonNormal');switch(node.nodeName){case"CITE":tinyMCE.switchClass(editor_id+'_cite','mceButtonSelected');return true;case"ACRONYM":tinyMCE.switchClass(editor_id+'_acronym','mceButtonSelected');return true;case"abbr":case"HTML:ABBR":case"ABBR":tinyMCE.switchClass(editor_id+'_abbr','mceButtonSelected');return true;case"DEL":tinyMCE.switchClass(editor_id+'_del','mceButtonSelected');return true;case"INS":tinyMCE.switchClass(editor_id+'_ins','mceButtonSelected');return true}return true},_anySel:function(editor_id){var inst=tinyMCE.getInstanceById(editor_id),pe;pe=tinyMCE.getParentElement(inst.getFocusElement(),'CITE,ACRONYM,ABBR,HTML:ABBR,DEL,INS');return pe||!inst.selection.isCollapsed()}};tinyMCE.addPlugin("xhtmlxtras",TinyMCE_XHTMLXtrasPlugin); 
  • trunk/includes/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js

    r581 r1158  
    189189 
    190190    _anySel : function(editor_id) { 
    191         var inst = tinyMCE.getInstanceById(editor_id), t = inst.selection.getSelectedText(), pe; 
     191        var inst = tinyMCE.getInstanceById(editor_id), pe; 
    192192 
    193193        pe = tinyMCE.getParentElement(inst.getFocusElement(), 'CITE,ACRONYM,ABBR,HTML:ABBR,DEL,INS'); 
    194194 
    195         return pe || inst.getFocusElement().nodeName == "IMG" || (t && t.length > 0); 
     195        return pe || !inst.selection.isCollapsed(); 
    196196    } 
    197197}; 
  • trunk/includes/jscripts/tiny_mce/themes/advanced/editor_template.js

    r581 r1158  
    1 tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_defColors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','bullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lang_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','forecolor',true],['forecolorpicker','forecolor.gif','lang_theme_forecolor_desc','forecolorpicker',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','HiliteColor',true],['backcolorpicker','backcolor.gif','lang_theme_backcolor_desc','backcolorpicker',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',getControlHTML:function(button_name){var i,x,but;for(i=0;i<TinyMCE_AdvancedTheme._buttons.length;i++){but=TinyMCE_AdvancedTheme._buttons[i];if(but[0]==button_name&&(button_name=="forecolor"||button_name=="backcolor"))return tinyMCE.getMenuButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3]+"Menu",but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null));if(but[0]==button_name)return tinyMCE.getButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null))}switch(button_name){case"formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}'],['div','{$lang_theme_div}'],['blockquote','{$lang_theme_blockquote}'],['code','{$lang_theme_code}'],['dt','{$lang_theme_dt}'],['dd','{$lang_theme_dd}'],['samp','{$lang_theme_samp}']];html+='<option value="">{$lang_theme_block}</option>';for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0])html+='<option value="&lt;'+lookup[x][0]+'&gt;">'+lookup[x][1]+'</option>'}}html+='</select>';return html;case"styleselect":return'<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case"fontselect":var fontHTML='<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(i=0;i<fonts.length;i++){if(fonts[i]!=''){var parts=fonts[i].split('=');fontHTML+='<option value="'+parts[1]+'">'+parts[0]+'</option>'}}fontHTML+='</select>';return fontHTML;case"fontsizeselect":return'<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+'<option value="0">{$lang_theme_font_size}</option>'+'<option value="1">1 (8 pt)</option>'+'<option value="2">2 (10 pt)</option>'+'<option value="3">3 (12 pt)</option>'+'<option value="4">4 (14 pt)</option>'+'<option value="5">5 (18 pt)</option>'+'<option value="6">6 (24 pt)</option>'+'<option value="7">7 (36 pt)</option>'+'</select>';case"|":case"separator":return'<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';case"spacer":return'<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';case"rowseparator":return'<br />'}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case'mceHelp':tinyMCE.openWindow({file:'about.htm',width:480,height:380},{tinymce_version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion,tinymce_releasedate:tinyMCE.releaseDate,inline:"yes"});return true;case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);")}action="update"}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class'])}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"})}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h)}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:""}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);")}action="update"}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout'])}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"forecolor":var fcp=new TinyMCE_Layer(editor_id+'_fcPreview',false),p,img,elm;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!fcp.exists()){fcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=fcp.getElement();elm._editor_id=editor_id;elm._command="forecolor";elm._switchId=editor_id+"_forecolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_forecolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));fcp.moveTo(p.absLeft,p.absTop);fcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).foreColor;fcp.show();return false;case"forecolorpicker":this._pickColor(editor_id,'forecolor');return true;case"forecolorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_fcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_text_colors','forecolor'));tinyMCE.switchClass(editor_id+'_forecolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_forecolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"HiliteColor":var bcp=new TinyMCE_Layer(editor_id+'_bcPreview',false),p,img;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!bcp.exists()){bcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=bcp.getElement();elm._editor_id=editor_id;elm._command="HiliteColor";elm._switchId=editor_id+"_backcolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_backcolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));bcp.moveTo(p.absLeft,p.absTop);bcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).backColor;bcp.show();return false;case"HiliteColorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_bcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_background_colors','HiliteColor'));tinyMCE.switchClass(editor_id+'_backcolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_backcolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"backcolorpicker":this._pickColor(editor_id,'HiliteColor');return true;case"mceColorPicker":if(user_interface){var template=[];if(!value['callback']&&!value['color'])value['color']=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=380;template['height']=250;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:value['color']})}else{var savedVal=tinyMCE.lastColorPickerValue,elm;if(savedVal['callback']){savedVal['callback'](value);return true}elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();')}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true}return false},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array(),skip;for(var i=0;i<in_array.length;i++){skip=false;for(var j=0;j<remove_array.length;j++){if(in_array[i]==remove_array[j]){skip=true}}if(!skip){outArray[outArray.length]=in_array[i]}}return outArray}function addToArray(in_array,add_array){for(var i=0;i<add_array.length;i++){in_array[in_array.length]=add_array[i]}return in_array}var template=new Array();var deltaHeight=0;var resizing=tinyMCE.getParam("theme_advanced_resizing",false);var path=tinyMCE.getParam("theme_advanced_path",true);var statusbarHTML='<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: '+(path?"block":"none")+'">&#160;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: '+(resizing?"block":"none")+'" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='<option value="">{$lang_theme_style_select}</option>';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i<stylesAr.length;i++){var key,value;key=stylesAr[i].split('=')[0];value=stylesAr[i].split('=')[1];styleSelectHTML+='<option value="'+value+'">'+key+'</option>'}TinyMCE_AdvancedTheme._autoImportCSSClasses=false}switch(layoutManager){case"SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='<a href="#" accesskey="q" title="'+tinyMCE.getLang("lang_toolbar_focus")+'"';if(!tinyMCE.getParam("accessibility_focus"))toolbarHTML+=' onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"';toolbarHTML+='></a>';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b<buttons.length;b++)toolbarHTML+=tinyMCE.getControlHTML(buttons[b]);if(buttons.length>0){toolbarHTML+="<br />";deltaHeight-=23}}toolbarHTML+='<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"></a>';template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width_style};height:{$height_style}"><tbody>';if(toolbarLocation=="top")template['html']+='<tr><td dir="ltr" class="mceToolbarTop" align="'+toolbarAlign+'" height="1" nowrap="nowrap"><span id="'+editorId+'_toolbar" class="mceToolbarContainer">'+toolbarHTML+'</span></td></tr>';if(statusbarLocation=="top"){template['html']+='<tr><td class="mceStatusbarTop" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23}template['html']+='<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';if(toolbarLocation=="bottom")template['html']+='<tr><td dir="ltr" class="mceToolbarBottom" align="'+toolbarAlign+'" height="1"><span id="'+editorId+'_toolbar" class="mceToolbarContainer">'+toolbarHTML+'</span></td></tr>';if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null}if(statusbarLocation=="bottom"){template['html']+='<tr><td class="mceStatusbarBottom" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23}template['html']+='</tbody></table>';break;case"RowLayout":template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i<containers.length;i++){if(containers[i]=="mceEditor")template['html']+='<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom"}else if(i==0){pathClass="mceStatusbar"}else{deltaHeight-=2}template['html']+='<tr><td class="'+pathClass+'" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=22}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);curContainer=removeFromArray(curContainer,tinyMCE.getParam("theme_advanced_disable","",true,','));for(var j=0;j<curContainer.length;j++)curContainerHTML+=tinyMCE.getControlHTML(curContainer[j]);if(curContainer.length>0){curContainerHTML+="<br />";deltaHeight-=23}template['html']+='<tr><td class="'+curCSS+'" align="'+curAlign+'" height="1">'+curContainerHTML+'</td></tr>'}}template['html']+='</tbody></table>';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);")}break}if(resizing)template['html']+='<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);if(!template['delta_width'])template['delta_width']=0;if(!template['delta_height'])template['delta_height']=deltaHeight;return template},initInstance:function(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true))}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink')},removeInstance:function(inst){new TinyMCE_Layer(inst.editorId+'_fcMenu').remove();new TinyMCE_Layer(inst.editorId+'_bcMenu').remove()},hideInstance:function(inst){TinyMCE_AdvancedTheme._hideMenus(inst.editorId)},_handleMenuEvent:function(e){var te=tinyMCE.isMSIE?window.event.srcElement:e.target;tinyMCE._menuButtonEvent(e.type=="mouseover"?"over":"out",document.getElementById(te._switchId));if(e.type=="click")tinyMCE.execInstanceCommand(te._editor_id,te._command)},_hideMenus:function(id){var fcml=new TinyMCE_Layer(id+'_fcMenu'),bcml=new TinyMCE_Layer(id+'_bcMenu');if(fcml.exists()&&fcml.isVisible()){tinyMCE.switchClass(id+'_forecolor','mceMenuButton');fcml.hide()}if(bcml.exists()&&bcml.isVisible()){tinyMCE.switchClass(id+'_backcolor','mceMenuButton');bcml.hide()}},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){var alignNode,breakOut,classNode;function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i<select_elm.options.length;i++){var ov=""+select_elm.options[i].value;if(first_index&&ov.toLowerCase().indexOf(value.toLowerCase())==0){select_elm.selectedIndex=i;return true}if(ov==value){select_elm.selectedIndex=i;return true}}}return false};if(node==null)return;var pathElm=document.getElementById(editor_id+"_path");var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();TinyMCE_AdvancedTheme._hideMenus(editor_id);if(pathElm){var parentNode=node;var path=new Array();while(parentNode!=null){if(parentNode.nodeName.toUpperCase()=="BODY"){break}if(parentNode.nodeType==1&&tinyMCE.getAttrib(parentNode,"class").indexOf('mceItemHidden')==-1){path[path.length]=parentNode}parentNode=parentNode.parentNode}var html="";for(var i=path.length-1;i>=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName.indexOf("html:")==0)nodeName=nodeName.substring(5);if(nodeName=="b"){nodeName="strong"}if(nodeName=="i"){nodeName="em"}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+tinyMCE.xmlEncode(st)+" "}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+tinyMCE.xmlEncode(face)+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+tinyMCE.xmlEncode(size)+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+tinyMCE.xmlEncode(color)+" "}if(tinyMCE.getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" "}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(tinyMCE.getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+tinyMCE.xmlEncode(src)+" "}if(path[i].nodeName=='A'&&tinyMCE.getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+tinyMCE.xmlEncode(href)+" "}className=tinyMCE.getAttrib(path[i],"class");if((nodeName=="img"||nodeName=="span")&&className.indexOf('mceItem')!=-1){nodeName=className.replace(/mceItem([a-z]+)/gi,'$1').toLowerCase();nodeData=path[i].getAttribute('title')}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+tinyMCE.xmlEncode(anchor);nodeData=""}if(tinyMCE.getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+='<a title="'+nodeData+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" target="_self" class="mcePathItem">'+nodeName+'</a>';if(i>0){html+=" &raquo; "}}pathElm.innerHTML='<a href="#" accesskey="x"></a>'+tinyMCE.getLang('lang_theme_path')+": "+html+'&#160;'}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal')}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled')}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index<undo_levels-1&&undo_levels>0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i<selectElm.options.length;i++){if(selectElm.options[i].value==classNode.className){index=i;breakOut=true;break}}}}while(!breakOut&&classNode!=null&&(classNode=classNode.parentNode)!=null);selectElm.selectedIndex=index}var selectElm=document.getElementById(editor_id+"_formatSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm)selectByValue(selectElm,"<"+elm.nodeName.toLowerCase()+">");else selectByValue(selectElm,"")}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="")}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"")}else selectByValue(selectElm,"")}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size)}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i<sizes.length;i++){if((''+sizes[i])==size){size=i;break}}}if(!selectByValue(selectElm,size))selectByValue(selectElm,"")}else selectByValue(selectElm,"0")}}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case"left":tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case"right":tinyMCE.switchClass(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case"middle":case"center":tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case"justify":tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break}}while(!breakOut&&(alignNode=alignNode.parentNode)!=null);var div=tinyMCE.getParentElement(node,"div");if(div&&div.style.textAlign=="center")tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');if(!setup_content){var ar=new Array("Bold","_bold","Italic","_italic","Strikethrough","_strikethrough","superscript","_sup","subscript","_sub");for(var i=0;i<ar.length;i+=2){if(inst.queryCommandState(ar[i]))tinyMCE.switchClass(editor_id+ar[i+1],'mceButtonSelected')}if(inst.queryCommandState("Underline")&&(node.parentNode==null||node.parentNode.nodeName!="A"))tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected')}do{switch(node.nodeName){case"UL":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"OL":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;case"HR":tinyMCE.switchClass(editor_id+'_hr','mceButtonSelected');break;case"IMG":if(tinyMCE.getAttrib(node,'name').indexOf('mce_')!=0&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_image','mceButtonSelected')}break}}while((node=node.parentNode)!=null)},_setupCSSClasses:function(editor_id){var i,selectElm;if(!TinyMCE_AdvancedTheme._autoImportCSSClasses)return;selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(i=0;i<csses.length;i++)selectElm.options[selectElm.options.length]=new Option(csses[i],csses[i])}if(csses!=null&&csses.length>0)selectElm.setAttribute('cssImported','true')}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end))},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth<minIframeWidth){dx=minIframeWidth-inst.iframeElement.clientWidth;inst.iframeElement.style.width=(iw+dx)+"px"}}inst.useCSS=false},_resizeEventHandler:function(e){var resizer=TinyMCE_AdvancedTheme._resizer;if(!resizer.resizing)return;e=typeof(e)=="undefined"?window.event:e;var dx=e.screenX-resizer.downX;var dy=e.screenY-resizer.downY;var resizeBox=resizer.resizeBox;var editorId=resizer.editorId;switch(e.type){case"mousemove":var w,h;w=resizer.width+dx;h=resizer.height+dy;w=w<1?1:w;h=h<1?1:h;if(resizer.horizontal)resizeBox.style.width=w+"px";resizeBox.style.height=h+"px";break;case"mouseup":TinyMCE_AdvancedTheme._setResizing(e,editorId,false);TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId),resizer.width+dx,resizer.height+dy,resizer.horizontal);if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var expires=new Date();expires.setTime(expires.getTime()+3600000*24*30);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_width",""+(resizer.horizontal?resizer.width+dx:""),expires);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_height",""+(resizer.height+dy),expires)}break}},_setResizing:function(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_AdvancedTheme._resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";resizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_AdvancedTheme._resizeEventHandler);resizer.eventHandlers=true}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true)}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE&&!tinyMCE.isOpera?"block":"table";tinyMCE.execCommand('mceResetDesignMode')}},_getColorHTML:function(id,n,cm){var i,h,cl;h='<span class="mceMenuLine"></span>';cl=tinyMCE.getParam(n,TinyMCE_AdvancedTheme._defColors).split(',');h+='<table class="mceColors"><tr>';for(i=0;i<cl.length;i++){c='tinyMCE.execInstanceCommand(\''+id+'\', \''+cm+'\', false, \'#'+cl[i]+'\');';h+='<td><a href="javascript:'+c+'" style="background-color: #'+cl[i]+'" onclick="'+c+';return false;"></a></td>';if((i+1)%8==0)h+='</tr><tr>'}h+='</tr></table>';if(tinyMCE.getParam("theme_advanced_more_colors",true))h+='<a href="#" onclick="TinyMCE_AdvancedTheme._pickColor(\''+id+'\',\''+cm+'\');" class="mceMoreColors">'+tinyMCE.getLang('lang_more_colors')+'</a>';return h},_pickColor:function(id,cm){var inputColor,inst=tinyMCE.selectedInstance;if(cm=='forecolor'&&inst)inputColor=inst.foreColor;if((cm=='backcolor'||cm=='HiliteColor')&&inst)inputColor=inst.backColor;tinyMCE.execCommand('mceColorPicker',true,{color:inputColor,callback:function(c){tinyMCE.execInstanceCommand(id,cm,false,c)}})},_insertImage:function(src,alt,border,hspace,vspace,width,height,align,title,onmouseover,onmouseout){tinyMCE.execCommand('mceBeginUndoLevel');if(src=="")return;if(!tinyMCE.imgElement&&tinyMCE.isSafari){var html="";html+='<img src="'+src+'" alt="'+alt+'"';html+=' border="'+border+'" hspace="'+hspace+'"';html+=' vspace="'+vspace+'" width="'+width+'"';html+=' height="'+height+'" align="'+align+'" title="'+title+'" onmouseover="'+onmouseover+'" onmouseout="'+onmouseout+'" />';tinyMCE.execCommand("mceInsertContent",false,html)}else{if(!tinyMCE.imgElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'<img src="'+tinyMCE.uniqueURL+'" />');else tinyMCE.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL)}}if(tinyMCE.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=tinyMCE.imgElement.getAttribute("width")||height!=tinyMCE.imgElement.getAttribute("height")||align!=tinyMCE.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(tinyMCE.imgElement,'src',src);tinyMCE.setAttrib(tinyMCE.imgElement,'mce_src',msrc);tinyMCE.setAttrib(tinyMCE.imgElement,'alt',alt);tinyMCE.setAttrib(tinyMCE.imgElement,'title',title);tinyMCE.setAttrib(tinyMCE.imgElement,'align',align);tinyMCE.setAttrib(tinyMCE.imgElement,'border',border,true);tinyMCE.setAttrib(tinyMCE.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'width',width,true);tinyMCE.setAttrib(tinyMCE.imgElement,'height',height,true);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseout',onmouseout);if(width&&width!="")tinyMCE.imgElement.style.pixelWidth=width;if(height&&height!="")tinyMCE.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint()}tinyMCE.execCommand('mceEndUndoLevel')},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement)}return}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,'<a href="'+tinyMCE.uniqueURL+'">'+tinyMCE.selectedInstance.selection.getSelectedHTML()+'</a>')}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i<elementArray.length;i++){var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, elementArray[i]);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(elementArray[i],'href',thref);tinyMCE.setAttrib(elementArray[i],'mce_href',mhref);tinyMCE.setAttrib(elementArray[i],'target',target);tinyMCE.setAttrib(elementArray[i],'title',title);tinyMCE.setAttrib(elementArray[i],'onclick',onclick);tinyMCE.setAttrib(elementArray[i],'class',style_class)}tinyMCE.linkElement=elementArray[0]}if(tinyMCE.linkElement){var mhref=href;href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(tinyMCE.linkElement,'href',href);tinyMCE.setAttrib(tinyMCE.linkElement,'mce_href',mhref);tinyMCE.setAttrib(tinyMCE.linkElement,'target',target);tinyMCE.setAttrib(tinyMCE.linkElement,'title',title);tinyMCE.setAttrib(tinyMCE.linkElement,'onclick',onclick);tinyMCE.setAttrib(tinyMCE.linkElement,'class',style_class)}tinyMCE.execCommand('mceEndUndoLevel')}};tinyMCE.addTheme("advanced",TinyMCE_AdvancedTheme);tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap); 
     1tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_defColors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','bullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lang_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','forecolor',true],['forecolorpicker','forecolor.gif','lang_theme_forecolor_desc','forecolorpicker',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','HiliteColor',true],['backcolorpicker','backcolor.gif','lang_theme_backcolor_desc','backcolorpicker',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',getControlHTML:function(button_name){var i,x,but;for(i=0;i<TinyMCE_AdvancedTheme._buttons.length;i++){but=TinyMCE_AdvancedTheme._buttons[i];if(but[0]==button_name&&(button_name=="forecolor"||button_name=="backcolor"))return tinyMCE.getMenuButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3]+"Menu",but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null));if(but[0]==button_name)return tinyMCE.getButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null))}switch(button_name){case"formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}'],['div','{$lang_theme_div}'],['blockquote','{$lang_theme_blockquote}'],['code','{$lang_theme_code}'],['dt','{$lang_theme_dt}'],['dd','{$lang_theme_dd}'],['samp','{$lang_theme_samp}']];html+='<option value="">{$lang_theme_block}</option>';for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0])html+='<option value="&lt;'+lookup[x][0]+'&gt;">'+lookup[x][1]+'</option>'}}html+='</select>';return html;case"styleselect":return'<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case"fontselect":var fontHTML='<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(i=0;i<fonts.length;i++){if(fonts[i]!=''){var parts=fonts[i].split('=');fontHTML+='<option value="'+parts[1]+'">'+parts[0]+'</option>'}}fontHTML+='</select>';return fontHTML;case"fontsizeselect":return'<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+'<option value="0">{$lang_theme_font_size}</option>'+'<option value="1">1 (8 pt)</option>'+'<option value="2">2 (10 pt)</option>'+'<option value="3">3 (12 pt)</option>'+'<option value="4">4 (14 pt)</option>'+'<option value="5">5 (18 pt)</option>'+'<option value="6">6 (24 pt)</option>'+'<option value="7">7 (36 pt)</option>'+'</select>';case"|":case"separator":return'<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" alt="" />';case"spacer":return'<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" alt="" />';case"rowseparator":return'<br />'}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case'mceHelp':tinyMCE.openWindow({file:'about.htm',width:480,height:380},{tinymce_version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion,tinymce_releasedate:tinyMCE.releaseDate,inline:"yes"});return true;case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);")}action="update"}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class'])}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"})}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h)}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:""}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);")}action="update"}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout'])}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"forecolor":var fcp=new TinyMCE_Layer(editor_id+'_fcPreview',false),p,img,elm;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!fcp.exists()){fcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=fcp.getElement();elm._editor_id=editor_id;elm._command="forecolor";elm._switchId=editor_id+"_forecolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_forecolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));fcp.moveTo(p.absLeft,p.absTop);fcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).foreColor;fcp.show();return false;case"forecolorpicker":this._pickColor(editor_id,'forecolor');return true;case"forecolorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_fcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_text_colors','forecolor'));tinyMCE.switchClass(editor_id+'_forecolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_forecolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"HiliteColor":var bcp=new TinyMCE_Layer(editor_id+'_bcPreview',false),p,img;TinyMCE_AdvancedTheme._hideMenus(editor_id);if(!bcp.exists()){bcp.create('div','mceColorPreview',document.getElementById(editor_id+'_toolbar'));elm=bcp.getElement();elm._editor_id=editor_id;elm._command="HiliteColor";elm._switchId=editor_id+"_backcolor";tinyMCE.addEvent(elm,'click',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseover',TinyMCE_AdvancedTheme._handleMenuEvent);tinyMCE.addEvent(elm,'mouseout',TinyMCE_AdvancedTheme._handleMenuEvent)}img=tinyMCE.selectNodes(document.getElementById(editor_id+"_backcolor"),function(n){return n.nodeName=="IMG"})[0];p=tinyMCE.getAbsPosition(img,document.getElementById(editor_id+'_toolbar'));bcp.moveTo(p.absLeft,p.absTop);bcp.getElement().style.backgroundColor=value!=null?value:tinyMCE.getInstanceById(editor_id).backColor;bcp.show();return false;case"HiliteColorMenu":TinyMCE_AdvancedTheme._hideMenus(editor_id);var ml=new TinyMCE_Layer(editor_id+'_bcMenu');if(!ml.exists())ml.create('div','mceMenu',document.body,TinyMCE_AdvancedTheme._getColorHTML(editor_id,'theme_advanced_background_colors','HiliteColor'));tinyMCE.switchClass(editor_id+'_backcolor','mceMenuButtonFocus');ml.moveRelativeTo(document.getElementById(editor_id+"_backcolor"),'bl');ml.moveBy(tinyMCE.isMSIE&&!tinyMCE.isOpera?-1:1,-1);if(tinyMCE.isOpera)ml.moveBy(0,-2);ml.show();return true;case"backcolorpicker":this._pickColor(editor_id,'HiliteColor');return true;case"mceColorPicker":if(user_interface){var template=[];if(!value['callback']&&!value['color'])value['color']=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=380;template['height']=250;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:value['color']})}else{var savedVal=tinyMCE.lastColorPickerValue,elm;if(savedVal['callback']){savedVal['callback'](value);return true}elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();')}return true;case"mceCodeEditor":var template=new Array();