home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / komunikace / maxthon / mx_2.0.4.5799.exe / template / Options / maxOptions.config.js < prev    next >
Text File  |  2007-09-27  |  91KB  |  1,697 lines

  1. maxOptions.isDebug=true;
  2. maxOptions.pages={};
  3. maxOptions.pages.general={type:"page",items:[{type:"checkbox",id:"gen_one_instance",key:"OneInstance",section:"General",defaultValue:"1",disabled:true},{type:"checkbox",id:"gen_check_default",key:"CheckDefaultBrowser",section:"Startup",defaultValue:"1",suf:"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.general.setDefaultBrowser();\">"+$lang("gen_default_browser")+"</a>"},{type:"hr"},{type:"checkbox",id:"gen_disable_image",key:"DisableImage",section:"General",defaultValue:"0"},{type:"checkbox",id:"gen_disable_script",key:"DisableScript",section:"General",defaultValue:"0"},{type:"checkbox",id:"gen_disable_gif",key:"DisableGif",section:"General",defaultValue:"0"},{type:"checkbox",id:"gen_disable_flash",key:"DisableFlash",section:"General",defaultValue:"0"},{type:"checkbox",id:"gen_disable_sound",key:"DisableSound",section:"General",defaultValue:"0"},{type:"checkbox",id:"gen_disable_activex",key:"DisableActiveX",section:"General",defaultValue:"0"},{type:"hr"},{type:"checkbox",id:"gen_tray_icon",key:"ShowTrayIcon",section:"General",defaultValue:"1"},{type:"checkbox",id:"gen_min_to_tray",key:"MinimizeToTray",section:"General",defaultValue:"0"},{type:"checkbox",id:"gen_close_to_tray",key:"CloseToTray",section:"General",defaultValue:"0"},{type:"hr"},{type:"html",html:"<div class=\"item\">"},{type:"checkbox",id:"gen_bosskey",key:"BossKey",section:"General",defaultValue:"1",suf:"   ",noWrapper:true},{type:"key",id:"gen_bosskey_code",key:"BossKeyCode",section:"General",defaultValue:"Csa_192$:$Ctrl + `",noWrapper:true},{type:"html",html:"</div>"},{type:"hr"},{type:"textbox",id:"gen_page_zoom",key:"GlobalZoom",section:"General",defaultValue:"100",pre:$lang("gen_page_zoom"),suf:"%",tagx:"style=\"width: 28px; text-align: center;\" maxlength=\"4\""},{type:"hr"},{type:"html",html:"<div class=\"item\">"+"<a href=\"javascript:;\" onclick=\"this.blur();maxOptions.action.restoreDefault();\">"+$lang("gen_restore_all_default")+"</a>"+"</div>"+"<div class=\"item comment\">"+$lang("gen_restore_all_note")+"</div>"}]};
  4. maxOptions.pages.startup={type:"page",items:[{type:"header",html:$lang("su_homepage")},{type:"textbox",id:"su_homepage",key:"HomePage",section:"Startup",defaultValue:"max:start",tagx:"style=\"width: 400px\""},{type:"html",html:"<div class=\"item\">"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.startup.setHomePage('about:blank')\">"+$lang("su_home_blank")+"</a>"+"    <a href=\"javascript:;\" onclick=\"maxOptions.pages.startup.setHomePage('max:start')\">"+$lang("su_home_startpage")+"</a>"+"</div>"},{type:"hr"},{type:"radio",id:"su_start_type",key:"StartPageType",section:"Startup",defaultValue:"home",choices:[{value:"home",html:$lang("su_page_homepage")},{value:"resume_list",html:$lang("su_page_resume_list")},{value:"resume",html:$lang("su_page_resume")},{value:"fav",html:$lang("su_page_fav_folder")}]},{type:"folder",subType:"fav",id:"su_fav_folder",key:"StartupFavFolder",section:"Startup",noWrapper:true,pre:"<div class=\"item indent\">  ",suf:"</div>"},{type:"hr"},{type:"checkbox",id:"su_check_update",key:"CheckUpdate",section:"Startup",defaultValue:"1"},{type:"checkbox",id:"su_no_start_page",key:"NoStartPageOnExternalCall",section:"Startup",defaultValue:"1"}]};
  5. maxOptions.pages.tab={type:"page",items:[{type:"radio",id:"tab_button_style",key:"ButtonStyle",section:"Tabs",defaultValue:"1",choices:[{value:"1",html:$lang("tab_style_auto")},{value:"2",html:$lang("tab_style_fixed")},{value:"4",html:$lang("tab_style_multiline")}]},{type:"hr"},{type:"checkbox",id:"tab_tab_on_bottom",key:"TabOnBottom",section:"Tabs",defaultValue:"0"},{type:"checkbox",id:"tab_bold_active",key:"BoldActive",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_close_act_left",key:"ActiveLeftAfterTabClose",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_ctrl_arrow",key:"CtrlArrowSwitchTab",section:"Tabs",defaultValue:"0"},{type:"checkbox",id:"tab_mouse_switch",key:"MouseWheelSwitchTab",section:"Tabs",defaultValue:"0"},{type:"checkbox",id:"tab_new_button",key:"NewTabButton",section:"Tabs",defaultValue:"1"},{type:"radio",id:"tab_close_button",key:"TabCloseButton",section:"Tabs",defaultValue:"1",choices:[{value:"0",html:$lang("tab_cb_none")},{value:"1",html:$lang("tab_cb_active")},{value:"2",html:$lang("tab_cb_all")}]},{type:"hr"},{type:"radio",id:"tab_new_behavior",key:"NewTabMode",section:"Tabs",defaultValue:"blank",disabled:true,choices:[{value:" blank",html:$lang("tab_open_blank")},{value:"current",html:$lang("tab_open_current")}]},{type:"checkbox",id:"tab_new_on_next",key:"NewTabOnNext",section:"Tabs",defaultValue:"1"},{type:"hr"},{type:"html",html:"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td width=\"50%\" valign=\"top\">"},{type:"header",html:$lang("tab_new")},{type:"checkbox",id:"tab_new_addr",key:"NewFromAddressBar",section:"Tabs",defaultValue:"0"},{type:"checkbox",id:"tab_new_search",key:"NewFromSearch",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_new_fav",key:"NewFromFavorites",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_new_history",key:"NewFromHistroy",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_new_home",key:"NewFromHomePage",section:"Tabs",defaultValue:"1"},{type:"html",html:"<td valign=\"top\">"},{type:"header",html:$lang("tab_activate")},{type:"checkbox",id:"tab_act_bars",key:"ActivateTabFromInputBar",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_act_fav_hist",key:"ActivateTabFromFavHist",section:"Tabs",defaultValue:"0"},{type:"checkbox",id:"tab_act_undo",key:"ActivateTabFromUndo",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_act_click",key:"ActivateTabFromClick",section:"Tabs",defaultValue:"1"},{type:"checkbox",id:"tab_act_mid",key:"ActivateTabFromMidButton",section:"Tabs",defaultValue:"0"},{type:"checkbox",id:"tab_act_dd",key:"ActivateTabFromDragDrop",section:"Tabs",defaultValue:"0"},{type:"html",html:"</tr></table><br/>"},{type:"checkbox",id:"tab_always_new",key:"AlwaysNewTab",section:"Tabs",defaultValue:"0",suf:"   <span class=\"note\">("+$lang("tab_always_new_note")+")</span>"},{type:"hr"},{type:"textbox",id:"tab_bar_limit",key:"MaxTabNumber",section:"Tabs",defaultValue:"50",pre:$lang("tab_bar_limit"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""},{type:"textbox",id:"tab_min_width",key:"MinWidth",section:"Tabs",defaultValue:"100",pre:$lang("tab_min_width"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""},{type:"textbox",id:"tab_max_width",key:"MaxWidth",section:"Tabs",defaultValue:"200",pre:$lang("tab_max_width"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""}]};
  6. maxOptions.pages.nav={type:"page",items:[{type:"header",html:$lang("nav_quick_complete")},{type:"html",html:"<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" class=\"item\">"},{type:"textbox",id:"nav_qc_c_p",key:"CtrlEnterP",section:"Navigation",defaultValue:"http://www.",noWrapper:true,tagx:" style=\"width:auto;\"",pre:"<tr><td align=\"right\">Ctrl+Enter</td><td>=</td><td>",suf:"</td><td> + "+$lang("url")+" +</td><td>"},{type:"textbox",id:"nav_qc_c_s",key:"CtrlEnterS",section:"Navigation",defaultValue:".com",noWrapper:true,tagx:" style=\"width:auto;\"",suf:"</td></tr>"},{type:"textbox",id:"nav_qc_s_p",key:"ShiftEnterP",section:"Navigation",defaultValue:"http://www.",noWrapper:true,tagx:" style=\"width:auto;\"",pre:"<tr><td align=\"right\">Shift+Enter</td><td>=</td><td>",suf:"</td><td> + "+$lang("url")+" +</td><td>"},{type:"textbox",id:"nav_qc_s_s",key:"ShiftEnterS",section:"Navigation",defaultValue:".net",noWrapper:true,tagx:" style=\"width:auto;\"",suf:"</td></tr>"},{type:"textbox",id:"nav_qc_a_p",key:"AltEnterP",section:"Navigation",defaultValue:"http://www.",noWrapper:true,tagx:" style=\"width:auto;\"",pre:"<tr><td align=\"right\">Alt+Enter</td><td>=</td><td>",suf:"</td><td> + "+$lang("url")+" +</td><td>"},{type:"textbox",id:"nav_qc_a_s",key:"AltEnterS",section:"Navigation",defaultValue:".org",noWrapper:true,tagx:" style=\"width:auto;\"",suf:"</td></tr>"},{type:"textbox",id:"nav_qc_cs_p",key:"CtrlShiftEnterP",section:"Navigation",defaultValue:"http://www.",noWrapper:true,tagx:" style=\"width:auto;\"",pre:"<tr><td align=\"right\">Ctrl+Shift+Enter</td><td>=</td><td>",suf:"</td><td> + "+$lang("url")+" +</td><td>"},{type:"textbox",id:"nav_qc_cs_s",key:"CtrlShiftEnterS",section:"Navigation",defaultValue:".com.cn",noWrapper:true,tagx:" style=\"width:auto;\"",suf:"</td></tr>"},{type:"textbox",id:"nav_qc_ca_p",key:"CtrlAltEnterP",section:"Navigation",defaultValue:"http://www.",noWrapper:true,tagx:" style=\"width:auto;\"",pre:"<tr><td align=\"right\">Ctrl+Alt+Enter</td><td>=</td><td>",suf:"</td><td> + "+$lang("url")+" +</td><td>"},{type:"textbox",id:"nav_qc_ca_s",key:"CtrlAltEnterS",section:"Navigation",defaultValue:".cn",noWrapper:true,tagx:" style=\"width:auto;\"",suf:"</td></tr>"},{type:"textbox",id:"nav_qc_sa_p",key:"ShiftAltEnterP",section:"Navigation",defaultValue:"http://www.",noWrapper:true,tagx:" style=\"width:auto;\"",pre:"<tr><td align=\"right\">Shift+Alt+Enter</td><td>=</td><td>",suf:"</td><td> + "+$lang("url")+" +</td><td>"},{type:"textbox",id:"nav_qc_sa_s",key:"ShiftAltEnterS",section:"Navigation",defaultValue:".gov",noWrapper:true,tagx:" style=\"width:auto;\"",suf:"</td></tr>"},{type:"html",html:"</table>"},{type:"hr"},{type:"header",html:$lang("nav_urlkey")},{type:"html",html:"<p class=\"note\">"+$lang("nav_urlkey_note")+"</p>"},{type:"html",html:"<div id=\"urlKeyTable_wrapper\"></div>"},{type:"hr"},{type:"header",html:$lang("nav_urlalias")},{type:"html",html:"<div id=\"urlAliasTable_wrapper\"></div>"},{type:"hr"},{type:"header",html:$lang("nav_web_service")},{type:"checkbox",id:"nav_server_list",key:"ServiceServerList",section:"Navigation",defaultValue:"1",suf:"<br/><br/>"},{type:"html",html:"<div id=\"webServiceTable_wrapper\"></div>"}]};
  7. maxOptions.pages.search={type:"page",items:[{type:"checkbox",id:"srch_quick_search",key:"QuickSearch",section:"Search",defaultValue:"1"},{type:"checkbox",id:"srch_auto_highlight",key:"AutoHighlight",section:"Search",defaultValue:"1"},{type:"textbox",id:"srch_max_history",key:"MaxSearchHistory",section:"Search",defaultValue:"20",pre:$lang("srch_max_history"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""},{type:"hr"},{type:"header",html:$lang("srch_list")},{type:"checkbox",id:"srch_server_list",key:"SearchServerList",section:"Search",defaultValue:"1"},{type:"checkbox",id:"srch_alt_addr_search",key:"AltQuickSearch",section:"Search",suf:"<br/><br/>"},{type:"html",html:"<div id=\"searchTable_wrapper\"></div>"}]};
  8. maxOptions.pages.fav={type:"page",items:[{type:"checkbox",id:"fav_add_here",key:"ShowAddFavHere",section:"Favorites",defaultValue:"1"},{type:"checkbox",id:"fav_tooltip",key:"FavMenuTooltip",section:"Favorites",defaultValue:"1"},{type:"textbox",id:"fav_menu_max_width",key:"FavMenuMaxWidth",section:"Favorites",defaultValue:"300",pre:$lang("fav_menu_max_width"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"5\""},{type:"hr"},{type:"html",html:"<div class=\"item\">"+$lang("fav_bar_root")+" <span id=\"fav_bar_root\" class=\"label-item\"></span>"+"   <a href=\"javascript:maxOptions.pages.fav.setFavRoot();\">"+$lang("browse")+"</a>"+"</div>"},{type:"checkbox",id:"fav_compact_favbar",key:"CompactFavBar",section:"Favorites",defaultValue:"0"},{type:"checkbox",id:"fav_multiline_favbar",key:"MultiFavBar",section:"Favorites",defaultValue:"0"},{type:"checkbox",id:"fav_favbar_recent",key:"FavBarRecentButton",section:"Favorites",defaultValue:"1"},{type:"checkbox",id:"fav_close_on_open_group",key:"CloseOnOpenGroup",section:"Favorites",defaultValue:"0"},{type:"hr"},{type:"checkbox",id:"fav_online_service",key:"FavService",section:"Services",defaultValue:"1",suf:" <span class=\"note\">"+$lang("require_restart")+"</span>"}]};
  9. maxOptions.pages.feed={type:"page",items:[{type:"checkbox",id:"fd_auto_discovery",key:"AutoDiscovery",section:"Feed",defaultValue:"1"},{type:"checkbox",id:"fd_discovery_notify",key:"DiscoveryNotify",section:"Feed",defaultValue:"1",disabled:true},{type:"hr"},{type:"header",html:$lang("fd_feed_reader")},{type:"checkbox",id:"fd_update_on_start",key:"UpdateAllOnStart",section:"Feed",defaultValue:"1"},{type:"checkbox",id:"fd_feed_tooltip",key:"TooltipView",section:"Feed",defaultValue:"1"},{type:"checkbox",id:"fd_feed_new_tab",key:"NewTabForChannelPage",section:"Feed",defaultValue:"1"},{type:"hr"},{type:"textbox",id:"fd_update_time_value",key:"DefaultUpdateDuration",section:"Feed",defaultValue:"0",disabled:true,pre:$lang("fd_auto_update_after"),suf:$lang("fd_auto_update_after1"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""}]};
  10. maxOptions.pages.form={type:"page",items:[{type:"checkbox",id:"form_save_notify",key:"SaveNotify",section:"Form",defaultValue:"1",suf:"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.form.cleanIgnoreList();\" id=\"btnCleanIgnoreList\">"+$lang("form_clean_ignore_list")+"</a>"},{type:"checkbox",id:"form_auto_fill",key:"AutoFill",section:"Form",defaultValue:"1"},{type:"hr"},{type:"header",html:$lang("form_profiles")},{type:"html",html:"<div id=\"profileTable_wrapper\"></div>"},{type:"hr"},{type:"header",html:$lang("form_saved_forms")},{type:"html",html:"<div id=\"savedFormTable_wrapper\"></div>"}]};
  11. maxOptions.pages.floatbutton={type:"page",items:[{type:"checkbox",id:"fb_enable",key:"Enable",section:"FloatButton",defaultValue:"1"},{type:"html",html:"<div class=\"indent\">"},{type:"checkbox",id:"fb_show_on_image",key:"OnImage",section:"FloatButton",defaultValue:"1"},{type:"checkbox",id:"fb_show_on_media",key:"OnMedia",section:"FloatButton",defaultValue:"1"},{type:"html",html:"</div>"},{type:"html",html:"<div class=\"item comment\">"},{type:"text",text:$lang("fb_note")},{type:"html",html:"</div>"},{type:"hr"},{type:"textbox",id:"fb_show_delay",key:"ShowDelay",section:"FloatButton",defaultValue:"2000",pre:$lang("fb_show_delay"),suf:$lang("fb_delay_ms"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"5\""},{type:"textbox",id:"fb_hide_delay",key:"HideDelay",section:"FloatButton",defaultValue:"2000",pre:$lang("fb_hide_delay"),suf:$lang("fb_delay_ms"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"5\""},{type:"hr"},{type:"textbox",id:"fb_min_width",key:"MinWidth",section:"FloatButton",defaultValue:"30",pre:$lang("fb_min_width"),suf:$lang("fb_delay_pixel"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"5\""},{type:"textbox",id:"fb_min_height",key:"MinHeight",section:"FloatButton",defaultValue:"30",pre:$lang("fb_min_height"),suf:$lang("fb_delay_pixel"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"5\""}]};
  12. maxOptions.pages.download={type:"page",items:[{type:"header",html:$lang("down_downloaders")},{type:"radio",id:"down_downloaders",key:"Use",section:"Download",defaultValue:"none",noHeader:true,choices:[{value:"none",html:$lang("down_no_downloader")},{value:"external",html:$lang("down_use_external_downloader")}]},{type:"hr"},{type:"header",html:$lang("down_file_type")},{type:"textarea",id:"down_file_type",key:"FileType",section:"Download",tagx:" rows=\"3\" style=\"width: 90%;\"",defaultValue:"7z aac ace aif arj asf avi bin bz2 exe gz gzip img iso lzh m4a mov mp3 mp4 mpa mpe mpeg mpg msi ogg pdf plj pps qt ra ram rar rm sea sit sitx tar wav wma wmv z zip"},{type:"hr"},{type:"header",html:$lang("down_save_folder")},{type:"html",html:"<div class=\"item\">"},{type:"folder",id:"down_save_folder",key:"SaveFolder",section:"Download",defaultValue:""},{type:"html",html:"</div>"},{type:"checkbox",id:"down_save_auto_category",key:"AutoFolder",section:"FloatButton",defaultValue:"1"},{type:"hr"},{type:"header",html:$lang("down_external_setup")},{type:"html",html:"<div id=\"downloaderList_wrapper\" class=\"item\"></div>"}]};
  13. maxOptions.pages.key={type:"page",items:[{type:"header",html:$lang("key_shortcut")},{type:"html",html:"<div id=\"customKeyTable_wrapper\"></div>"}]};
  14. maxOptions.pages.mouse={type:"page",items:[{type:"checkbox",id:"mou_super_dd",key:"SuperDragDrop",section:"General",defaultValue:"1"},{type:"checkbox",id:"mou_mouse_gesture",key:"MouseGesture",section:"General",defaultValue:"1"},{type:"html",html:"<div class=\"item\">"},{type:"checkbox",id:"mou_show_trail",key:"ShowTrail",section:"General",defaultValue:"1",noWrapper:true},{type:"color",id:"mou_trail_color",key:"TrailColor",section:"General",defaultValue:"#99CC00",pre:"   ",noWrapper:true},{type:"html",html:"</div>"},{type:"checkbox",id:"mou_mouse_tip",key:"MouseTip",section:"General",defaultValue:"1",disabled:true},{type:"hr"},{type:"header",html:$lang("mou_gestures")},{type:"html",html:"<div id=\"mouseTable_wrapper\"></div>"}]};
  15. maxOptions.pages.adhunter={type:"page",items:[{type:"checkbox",id:"adh_popup_blocker",key:"PopupBlocker",section:"AdHunter",defaultValue:"1",pre:"<h5>",suf:"</h5>",noWrapper:true},{type:"html",html:"<div class=\"indent\">"},{type:"checkbox",id:"adh_popup_infobar",key:"PopupInfoBar",section:"AdHunter",defaultValue:"1"},{type:"checkbox",id:"adh_popup_sound",key:"PopupSound",section:"AdHunter",defaultValue:"1"},{type:"html",html:"<div class=\"item\"><a href=\"javascript:;\" onclick=\"external.max_invoke('PopupWhiteListDialog')\">"+$lang("adh_edit_whitelist")+"</a></div>"},{type:"html",html:"</div>"},{type:"hr"},{type:"checkbox",id:"adh_content_filter",key:"ContentBlocker",section:"AdHunter",defaultValue:"1",pre:"<h5>",suf:"</h5>",noWrapper:true},{type:"html",html:"<div class=\"indent\">"},{type:"checkbox",id:"adh_notify",key:"NotifyBlockedAds",section:"AdHunter",defaultValue:"1"},{type:"textbox",id:"adh_replace_obj",key:"ReplaceObj",section:"AdHunter",defaultValue:$lang("Blocked Ad","Strings"),pre:$lang("adh_replace_obj"),tagx:"style=\"width: 200px;\" maxlength=\"250\""},{type:"html",html:"<div class=\"item comment\">"+$lang("adh_replace_obj_note")+"</div>"},{type:"html",html:"<div class=\"item\"><a href=\"javascript:;\" onclick=\"external.max_invoke('ContentFilterDialog')\">"+$lang("adh_edit_list")+"</a></div>"},{type:"html",html:"</div>"},{type:"hr"},{type:"checkbox",id:"adh_float_filter",key:"FloatAdsBlocker",section:"AdHunter",defaultValue:"1",pre:"<h5>",suf:"</h5>",noWrapper:true},{type:"hr"},{type:"checkbox",id:"adh_text_filter",key:"UseTextFilter",section:"AdHunter",defaultValue:"0",pre:"<h5>",suf:"</h5>",noWrapper:true},{type:"html",html:"<div class=\"indent\">"},{type:"html",html:"<div class=\"item comment\">"+$lang("adh_text_filter_note")+"</div>"},{type:"html",html:"<div class=\"item\"><a href=\"javascript:;\" onclick=\"maxOptions.action.activatePage('filter');\">"+$lang("adh_manage_filter_packs")+"</a></div>"},{type:"html",html:"</div>"}]};
  16. maxOptions.pages.safety={type:"page",items:[{type:"checkbox",id:"saf_enable_guardian",key:"SafeProtectEnable",section:"Safety",defaultValue:"1",pre:"<h5>",suf:" <span class=\"note\">"+$lang("require_restart")+"</span></h5>"},{type:"html",html:"<div class=\"item indent\"><a href=\"javascript:;\" onclick=\"external.max_invoke('SafeProtectEditDialog')\">"+$lang("saf_guardian_edit_list")+"</a></div>"},{type:"hr"},{type:"checkbox",id:"saf_clean_upon_close",key:"CleanUponClose",section:"Safety",defaultValue:"0",pre:"<h5>",suf:"</h5>",noWrapper:true},{type:"html",html:"<div class=\"indent\">"},{type:"checkbox",id:"saf_clean_undo",key:"CleanUndo",section:"Safety",defaultValue:"0"},{type:"checkbox",id:"saf_clean_history",key:"CleanHistory",section:"Safety",defaultValue:"0"},{type:"checkbox",id:"saf_clean_address",key:"CleanAddress",section:"Safety",defaultValue:"0"},{type:"checkbox",id:"saf_clean_search",key:"CleanSearch",section:"Safety",defaultValue:"0"},{type:"checkbox",id:"saf_clean_rss",key:"CleanRssHistory",section:"Safety",defaultValue:"0"},{type:"checkbox",id:"saf_clean_cookies",key:"CleanCookies",section:"Safety",defaultValue:"0"},{type:"checkbox",id:"saf_clean_cache",key:"CleanCache",section:"Safety",defaultValue:"0"},{type:"html",html:"</div>"},{type:"hr"},{type:"header",html:$lang("saf_security_update")},{type:"html",html:"<div class=\"item\">"+$lang("saf_security_update_comment")+"</div><br/>"},{type:"html",html:"<div id=\"patchTable_wrapper\"></div>"}]};
  17. maxOptions.pages.advanced={type:"page",items:[{type:"header",html:$lang("adv_ui")},{type:"checkbox",id:"adv_multi_thread",key:"TabInThread",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_vista_glass",key:"VistaGlass",section:"Advanced",defaultValue:"0",suf:" <span class=\"note\">"+$lang("require_restart")+"</span>"},{type:"checkbox",id:"adv_combine_refresh_stop",key:"CombineRefreshStop",section:"Advanced",defaultValue:"0"},{type:"checkbox",id:"adv_use_page_search",key:"UsePageSearch",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_site_icon",key:"ShowSiteIcons",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_multi_col_menu",key:"MultiColMenu",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_custom_context_menu",key:"CustomContextMenu",section:"Advanced",defaultValue:"1",suf:" <span class=\"note\">"+$lang("require_restart")+"</span>"},{type:"checkbox",id:"adv_status_tips",key:"ShowStatusTip",section:"Advanced",defaultValue:"1"},{type:"textbox",id:"adv_min_tab_man",key:"MinTabManager",section:"Advanced",defaultValue:"2",pre:$lang("adv_min_tab_man"),suf:$lang("adv_min_tab_man1"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""},{type:"hr"},{type:"header",html:$lang("adv_browse")},{type:"checkbox",id:"adv_popup_as_tab",key:"PopupAsTab",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_ie7_zoom",key:"UseIE7Zoom",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_accelerator",key:"WebAccelerator",section:"Advanced",defaultValue:"1",suf:"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.advanced.editSuperMSAList()\">"+$lang("adv_accelerator_site_list")+"</a>"},{type:"checkbox",id:"adv_flash_back_forward",key:"FlashBackForward",section:"Advanced",defaultValue:"1",pre:"<div class=\"indent\">",suf:"</div>"},{type:"checkbox",id:"adv_dis_refresh_current",key:"DisableAutoRefreshCurrent",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_dis_script_error_dlg",key:"DisableScriptErrorDialog",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_dd_open_multi_link",key:"OpenMultiLinksWithDragDrop",section:"Advanced",defaultValue:"0",disabled:true},{type:"checkbox",id:"adv_friendly_error_page",key:"FriendlyErrorPage",section:"Advanced",defaultValue:"1",disabled:true},{type:"checkbox",id:"adv_ignore_frameid",key:"IgnoreFrameId",section:"Advanced",defaultValue:"1",disabled:true},{type:"checkbox",id:"adv_dde_call",key:"HandleDDECall",section:"Advanced",defaultValue:"1",suf:" <span class=\"note\">"+$lang("require_restart")+"</span>",disabled:true},{type:"textbox",id:"adv_max_undo_list",key:"MaxUndoList",section:"Advanced",defaultValue:"15",pre:$lang("adv_max_undo_list"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""},{type:"textbox",id:"adv_max_history",key:"MaxHistoryDay",section:"Advanced",defaultValue:"20",pre:$lang("adv_max_history"),tagx:"style=\"width: 32px; text-align: center;\" maxlength=\"4\""},{type:"checkbox",id:"adv_custom_ua",key:"CustomUserAgent",section:"Advanced",defaultValue:"0",suf:" <span class=\"note\">"+$lang("require_restart")+"</span>   <span id=\"adv_ua_list_wrapper\"></span>"},{type:"textbox",id:"adv_useragent",key:"UserAgent",section:"Advanced",defaultValue:"",tagx:" style=\"width:90%;\" maxlength=\"1024\"",pre:"<div class=\"indent\">",suf:"</div>"},{type:"hr"},{type:"header",html:$lang("adv_confirm")},{type:"checkbox",id:"adv_confirm_close_all",key:"ConfirmCloseAll",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_confirm_exit",key:"ConfirmExit",section:"Advanced",defaultValue:"1"},{type:"hr"},{type:"radio",id:"adv_jvm",key:"JavaVM",section:"Advanced",defaultValue:"0",html:$lang("adv_jvm")+" <span class=\"note\">"+$lang("require_restart")+"</span>",choices:[{value:"0",html:$lang("adv_jvm_ms")},{value:"1",html:$lang("adv_jvm_other")}]}]};
  18. maxOptions.pages["sep1"]={type:"separator"};
  19. maxOptions.pages.skin={type:"page",items:[{type:"html",html:"<div class=\"mananger-top\">"+"<a href=\"http://addons.maxthon.com/category/MX2+Skins\" target=\"_blank\">"+$lang("get_more")+"</a>"+"</div>"},{type:"html",html:"<div id=\"skinTable_wrapper\"></div>"}]};
  20. maxOptions.pages.plugin={type:"page",items:[{type:"html",html:"<div class=\"mananger-top\">"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.plugin.toggleAllItems(true);\">"+$lang("enable_all")+"</a>  |  "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.plugin.toggleAllItems(false);\">"+$lang("disable_all")+"</a>  |  "+"<a href=\"http://addons.maxthon.com/category/Plugins\" target=\"_blank\">"+$lang("get_more")+"</a>"+"</div>"},{type:"html",html:"<div id=\"pluginTable_wrapper\"></div>"}]};
  21. maxOptions.pages.filter={type:"page",items:[{type:"html",html:"<div class=\"mananger-top\">"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.filter.toggleAllItems(true);\">"+$lang("enable_all")+"</a>  |  "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.filter.toggleAllItems(false);\">"+$lang("disable_all")+"</a>  |  "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.filter.addItem();\">"+$lang("create_new")+"</a>  |  "+"<a href=\"http://addons.maxthon.com/category/Filters\" target=\"_blank\">"+$lang("get_more")+"</a>"+"</div>"},{type:"html",html:"<div id=\"filterTable_wrapper\"></div>"}]};
  22. maxOptions.activePage="general";
  23. maxOptions.pages.general.setDefaultBrowser=function(){
  24. if(confirm($lang("su_confirm_default_browser"))){
  25. external.max_invoke("SetDefaultBrowser");
  26. }
  27. };
  28. maxOptions.pages.startup.setHomePage=function(_1){
  29. var _2=$id("su_homepage");
  30. if(_2){
  31. _2.value=_1;
  32. _2.fireEvent("onchange");
  33. }else{
  34. alert("No object: su_homepage");
  35. }
  36. };
  37. maxOptions.pages.nav.init=function(){
  38. maxOptions.pages.nav.urlKey.init();
  39. maxOptions.pages.nav.urlAlias.init();
  40. };
  41. maxOptions.pages.nav.destroy=function(){
  42. try{
  43. maxTable.destroy(urlKeyTable);
  44. maxTable.destroy(urlAliasTable);
  45. maxTable.destroy(webServiceTable);
  46. }
  47. catch(e){
  48. }
  49. };
  50. maxOptions.pages.nav.urlKey={};
  51. maxOptions.pages.nav.urlKey.init=function(){
  52. urlKeyTable=maxTable.create("urlKeyTable");
  53. urlKeyTable.columns=[{title:$lang("shortcut_key"),type:"select",selectOptions:[["F1","F1"],["F2","F2"],["F3","F3"],["F4","F4"],["F5","F5"],["F6","F6"],["F7","F7"],["F8","F8"],["F9","F9"],["F10","F10"],["F11","F11"],["F12","F12"]],width:200,tagx:"nowrap=\"nowrap\""},{title:$lang("url"),type:"textarea",rows:"3",required:true}];
  54. urlKeyTable.separatorType="none";
  55. urlKeyTable.defaultRowData=["F1",""];
  56. urlKeyTable.data=maxOptions.pages.nav.urlKey.loadList();
  57. urlKeyTable.editControl=[{type:"delete",hideOnNew:true},{type:"html",value:" | ",hideOnNew:true},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  58. urlKeyTable.controlUI["add"]=$lang("maxtable_new");
  59. urlKeyTable.controlUI["delete"]=$lang("delete");
  60. urlKeyTable.controlUI["save"]=$lang("save");
  61. urlKeyTable.controlUI["cancel"]=$lang("cancel");
  62. urlKeyTable.lang["require"]=$lang("maxtable_require_field");
  63. urlKeyTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  64. urlKeyTable.event["beforeAdd"]=maxOptions.pages.nav.urlKey.validateKey;
  65. urlKeyTable.event["afterAdd"]=maxOptions.pages.nav.urlKey.saveList;
  66. urlKeyTable.event["beforeUpdate"]=maxOptions.pages.nav.urlKey.validateKey;
  67. urlKeyTable.event["afterUpdate"]=maxOptions.pages.nav.urlKey.saveList;
  68. urlKeyTable.event["afterDelete"]=maxOptions.pages.nav.urlKey.saveList;
  69. maxTable.init(urlKeyTable);
  70. };
  71. maxOptions.pages.nav.urlKey.loadList=function(){
  72. var _3=maxConfig.ini.getArray("URLKey");
  73. _3.sort();
  74. for(var i=0;i<_3.length;i++){
  75. _3[i][1]=_3[i][1].replace(/\^\^/g,"\n");
  76. }
  77. return _3;
  78. };
  79. maxOptions.pages.nav.urlKey.saveList=function(){
  80. maxConfig.ini.deleteSection("URLKey");
  81. for(var i=0;i<urlKeyTable.data.length;i++){
  82. var _6=urlKeyTable.data[i][1].replace(/\n/g,"^^");
  83. _6=_6.replace(/\r/g,"");
  84. maxConfig.ini.setValue("URLKey",urlKeyTable.data[i][0],_6);
  85. }
  86. maxOptions.action.applyChanges();
  87. };
  88. maxOptions.pages.nav.urlKey.validateKey=function(){
  89. var _7=urlKeyTable.inEditResultData;
  90. if(_7[0]==""){
  91. alert($lang("key_blank_key"));
  92. return false;
  93. }
  94. for(var i=0;i<urlKeyTable.data.length;i++){
  95. if(_7[0]==urlKeyTable.data[i][0]&&urlKeyTable.inEditDataIndex!=i){
  96. alert($lang("key_duplicate_key"));
  97. return false;
  98. }
  99. }
  100. return true;
  101. };
  102. maxOptions.pages.nav.urlAlias={};
  103. maxOptions.pages.nav.urlAlias.init=function(){
  104. urlAliasTable=maxTable.create("urlAliasTable");
  105. urlAliasTable.columns=[{title:$lang("alias"),type:"text",width:200,required:true},{title:$lang("url"),type:"text",required:true}];
  106. urlAliasTable.separatorType="none";
  107. urlAliasTable.defaultRowData=[$lang("alias"),"http://"];
  108. urlAliasTable.data=maxOptions.pages.nav.urlAlias.loadList();
  109. urlAliasTable.editControl=[{type:"delete",hideOnNew:true},{type:"html",value:" | ",hideOnNew:true},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  110. urlAliasTable.controlUI["add"]=$lang("maxtable_new");
  111. urlAliasTable.controlUI["add_sep"]=$lang("maxtable_new_sep");
  112. urlAliasTable.controlUI["delete"]=$lang("delete");
  113. urlAliasTable.controlUI["save"]=$lang("save");
  114. urlAliasTable.controlUI["cancel"]=$lang("cancel");
  115. urlAliasTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  116. urlAliasTable.lang["require"]=$lang("maxtable_require_field");
  117. urlAliasTable.event["afterAdd"]=maxOptions.pages.nav.urlAlias.saveList;
  118. urlAliasTable.event["afterUpdate"]=maxOptions.pages.nav.urlAlias.saveList;
  119. urlAliasTable.event["afterDelete"]=maxOptions.pages.nav.urlAlias.saveList;
  120. urlAliasTable.event["afterRadioClick"]=maxOptions.pages.nav.urlAlias.saveList;
  121. maxTable.init(urlAliasTable);
  122. };
  123. maxOptions.pages.nav.urlAlias.loadList=function(){
  124. var _9=maxConfig.ini.getArray("URLAlias");
  125. _9.sort();
  126. return _9;
  127. };
  128. maxOptions.pages.nav.urlAlias.saveList=function(){
  129. maxConfig.ini.deleteSection("URLAlias");
  130. maxConfig.ini.setArray("URLAlias",urlAliasTable.data,false);
  131. maxOptions.action.applyChanges();
  132. };
  133. maxOptions.pages.nav.webService={};
  134. maxOptions.pages.nav.webService.init=function(){
  135. webServiceTable=maxTable.create("webServiceTable");
  136. webServiceTable.columns=[{title:$lang("title"),type:"text",width:200,required:true},{title:$lang("url"),type:"text",required:true}];
  137. webServiceTable.separatorType="line";
  138. webServiceTable.defaultRowData=[$lang("title"),"http://"];
  139. webServiceTable.data=maxConfig.ini.getArray("WebServices",true);
  140. webServiceTable.controlUI["add"]=$lang("maxtable_new");
  141. webServiceTable.controlUI["add_sep"]=$lang("maxtable_new_sep");
  142. webServiceTable.controlUI["delete"]=$lang("delete");
  143. webServiceTable.controlUI["save"]=$lang("save");
  144. webServiceTable.controlUI["cancel"]=$lang("cancel");
  145. webServiceTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  146. webServiceTable.lang["require"]=$lang("maxtable_require_field");
  147. webServiceTable.event["afterAdd"]=maxOptions.pages.nav.webService.saveList;
  148. webServiceTable.event["afterUpdate"]=maxOptions.pages.nav.webService.saveList;
  149. webServiceTable.event["afterDelete"]=maxOptions.pages.nav.webService.saveList;
  150. webServiceTable.event["afterRadioClick"]=maxOptions.pages.nav.webService.saveList;
  151. maxTable.init(webServiceTable);
  152. };
  153. maxOptions.pages.nav.webService.saveList=function(){
  154. maxConfig.ini.deleteSection("WebServices");
  155. maxConfig.ini.setArray("WebServices",webServiceTable.data,true);
  156. };
  157. maxOptions.pages.search.init=function(){
  158. maxOptions.pages.search.searchEngine.init();
  159. };
  160. maxOptions.pages.search.destroy=function(){
  161. try{
  162. maxTable.destroy(searchTable);
  163. }
  164. catch(e){
  165. }
  166. };
  167. maxOptions.pages.search.searchEngine={};
  168. maxOptions.pages.search.searchEngine.init=function(){
  169. searchTable=maxTable.create("searchTable");
  170. searchTable.columns=[{title:" ",type:"radio",width:18},{title:$lang("title"),type:"text",width:200,required:true},{title:$lang("alias"),type:"text",width:100,required:false},{title:$lang("url"),type:"text",required:true}];
  171. searchTable.separatorType="line";
  172. searchTable.defaultRowData=[false,$lang("title"),"","http://"];
  173. searchTable.data=maxConfig.ini.getArray("SearchEngines",true);
  174. maxOptions.pages.search.searchEngine.attachDefaultColumn();
  175. searchTable.controlUI["add"]=$lang("maxtable_new");
  176. searchTable.controlUI["add_sep"]=$lang("maxtable_new_sep");
  177. searchTable.controlUI["delete"]=$lang("delete");
  178. searchTable.controlUI["save"]=$lang("save");
  179. searchTable.controlUI["cancel"]=$lang("cancel");
  180. searchTable.controlUI["radio"]="<img src=\"../_shared/images/btn_radio.png\" alt=\""+$lang("srch_set_default")+"\" />";
  181. searchTable.controlUI["radio_checked"]="<img src=\"../_shared/images/btn_radio_checked.png\" alt=\""+$lang("srch_set_default")+"\" />";
  182. searchTable.controlUI["move_up"]="<img src=\"../_shared/images/btn_up.png\" />";
  183. searchTable.controlUI["move_down"]="<img src=\"../_shared/images/btn_down.png\" />";
  184. searchTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  185. searchTable.lang["require"]=$lang("maxtable_require_field");
  186. searchTable.event["afterAdd"]=maxOptions.pages.search.searchEngine.saveList;
  187. searchTable.event["afterUpdate"]=maxOptions.pages.search.searchEngine.saveList;
  188. searchTable.event["afterDelete"]=maxOptions.pages.search.searchEngine.saveList;
  189. searchTable.event["afterRadioClick"]=maxOptions.pages.search.searchEngine.saveList;
  190. maxTable.init(searchTable);
  191. };
  192. maxOptions.pages.search.searchEngine.attachDefaultColumn=function(){
  193. if(searchTable.data.length<1){
  194. return;
  195. }
  196. var _a=maxConfig.ini.getValue("Search","Default");
  197. if(_a==""){
  198. _a=searchTable.data[0].join("$,$");
  199. }
  200. for(var i=0;i<searchTable.data.length;i++){
  201. if(typeof (searchTable.data[i])!="string"){
  202. if(_a==searchTable.data[i].join("$,$")){
  203. searchTable.data[i].unshift("-",true);
  204. }else{
  205. searchTable.data[i].unshift("-",false);
  206. }
  207. searchTable.data[i].shift();
  208. }
  209. }
  210. };
  211. maxOptions.pages.search.searchEngine.detachDefaultColumn=function(){
  212. for(var i=0;i<searchTable.data.length;i++){
  213. if(typeof (searchTable.data[i])!="string"){
  214. if(searchTable.data[i][0]==true){
  215. searchTable.data[i].shift();
  216. maxConfig.ini.setValue("Search","Default",searchTable.data[i].join("$,$"));
  217. }else{
  218. searchTable.data[i].shift();
  219. }
  220. }
  221. }
  222. };
  223. maxOptions.pages.search.searchEngine.saveList=function(){
  224. maxOptions.pages.search.searchEngine.detachDefaultColumn();
  225. maxConfig.ini.deleteSection("SearchEngines");
  226. maxConfig.ini.setArray("SearchEngines",searchTable.data,true);
  227. maxOptions.pages.search.searchEngine.attachDefaultColumn();
  228. maxOptions.action.applyChanges();
  229. };
  230. maxOptions.pages.fav.init=function(){
  231. maxOptions.pages.fav.getFavRoot();
  232. };
  233. maxOptions.pages.fav.writeFavRoot=function(_d){
  234. _d=maxConfig.ui.folder.cutString(_d);
  235. $id("fav_bar_root").innerHTML=_d.$encodeHTML();
  236. };
  237. maxOptions.pages.fav.getFavRoot=function(){
  238. var _e=external.max_getObj(max_security_id,"FavManager");
  239. var _f=_e.toolbarRoot;
  240. if(_f==""){
  241. _f="ROOT";
  242. }
  243. maxOptions.pages.fav.writeFavRoot(_f);
  244. };
  245. maxOptions.pages.fav.setFavRoot=function(){
  246. var _10=external.max_invoke("SelFavFolder");
  247. if(_10!=0){
  248. var _11=external.max_getObj(max_security_id,"FavManager");
  249. _11.toolbarRoot=_10;
  250. maxOptions.pages.fav.writeFavRoot(_10);
  251. }
  252. };
  253. maxOptions.pages.form.init=function(){
  254. maxOptions.pages.form.checkIgnoreList();
  255. maxOptions.pages.form.profile.init();
  256. maxOptions.pages.form.profile.showSingleProfile();
  257. maxOptions.pages.form.savedForm.init();
  258. };
  259. maxOptions.pages.form.destroy=function(){
  260. try{
  261. maxTable.destroy(profileTable);
  262. maxTable.destroy(dataViewTable);
  263. maxTable.destroy(savedFormTable);
  264. }
  265. catch(e){
  266. }
  267. };
  268. maxOptions.pages.form.checkIgnoreList=function(){
  269. var obj=$id("btnCleanIgnoreList");
  270. var _13=maxConfig.ini.getArray("FormNotifyIgnore",false);
  271. if(_13.length<1){
  272. obj.style.display="none";
  273. }else{
  274. obj.style.display="inline";
  275. }
  276. };
  277. maxOptions.pages.form.cleanIgnoreList=function(){
  278. maxConfig.ini.deleteSection("FormNotifyIgnore");
  279. maxOptions.action.applyChanges();
  280. };
  281. maxOptions.pages.form.validatePassword=function(){
  282. if(!maxOptions.pages.form.passwordValidated){
  283. maxOptions.pages.form.passwordValidated=external.max_invoke("VerifyPassport");
  284. }
  285. return maxOptions.pages.form.passwordValidated;
  286. };
  287. maxOptions.pages.form.profile={};
  288. maxOptions.pages.form.profile.isNew=false;
  289. maxOptions.pages.form.profile.init=function(){
  290. profileTable=maxTable.create("profileTable");
  291. profileTable.columns=[{title:" ",name:"_default",type:"radio",width:18,required:false},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.form.profile.buildHTML}];
  292. profileTable.showEditControl=false;
  293. profileTable.allowInsert=true;
  294. profileTable.dataType="object";
  295. profileTable.defaultRowData=maxOptions.pages.form.profile.createProfileObject();
  296. profileTable.data=maxOptions.pages.form.profile.loadList();
  297. profileTable.editControl=[{type:"delete",hideOnNew:true},{type:"html",value:" | ",hideOnNew:true},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  298. profileTable.style["edit"]="maxTable-edit-no-control";
  299. profileTable.controlUI["add"]=$lang("maxtable_new");
  300. profileTable.controlUI["save"]=$lang("save");
  301. profileTable.controlUI["delete"]=$lang("delete");
  302. profileTable.controlUI["cancel"]=$lang("cancel");
  303. profileTable.controlUI["radio"]="<img src=\"../_shared/images/btn_radio.png\" />";
  304. profileTable.controlUI["radio_checked"]="<img src=\"../_shared/images/btn_radio_checked.png\" />";
  305. profileTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  306. profileTable.event["afterEdit"]=maxOptions.pages.form.profile.editTable.init;
  307. profileTable.event["beforeAdd"]=maxOptions.pages.form.profile.validateItem;
  308. profileTable.event["afterAdd"]=maxOptions.pages.form.profile.saveList;
  309. profileTable.event["beforeUpdate"]=maxOptions.pages.form.profile.validateItem;
  310. profileTable.event["afterUpdate"]=maxOptions.pages.form.profile.saveList;
  311. profileTable.event["afterDelete"]=maxOptions.pages.form.profile.saveList;
  312. profileTable.event["afterRadioClick"]=maxOptions.pages.form.profile.saveList;
  313. maxTable.init(profileTable);
  314. };
  315. maxOptions.pages.form.profile.createProfileObject=function(){
  316. return {title:"",_default:false,firstname:"",lastname:"",birth_year:"",birth_month:1,birth_day:1,gender:0,username:"",password:"",pwd_q:"",pwd_a:"",email:"",website:"",phone:"",address1:"",address2:"",postcode:"",city:"",state:"",country:"",timezone:0};
  317. };
  318. maxOptions.pages.form.profile.loadList=function(){
  319. maxConfig.setActiveFile("$form");
  320. var _14=maxConfig.ini.getArray("profiles",false);
  321. maxConfig.setActiveFile("$main");
  322. if(_14.length>0){
  323. var _15=false;
  324. for(var i=0;i<_14.length;i++){
  325. _14[i]=maxOptions.pages.form.profile.parseItem(_14[i]);
  326. if(_14[i]._default==true){
  327. if(_15){
  328. _14[i]._default=false;
  329. }
  330. _15=true;
  331. }
  332. }
  333. if(!_15){
  334. _14[0]._default=true;
  335. }
  336. _14.sort(function(_17,_18){
  337. if(_17.title.length<_18.title.length){
  338. return -1;
  339. }
  340. if(_17.title.length>_18.title.length){
  341. return 1;
  342. }
  343. if(_17.title>_18.title){
  344. return -1;
  345. }
  346. if(_17.title==_18.title){
  347. return 0;
  348. }
  349. return 1;
  350. });
  351. }else{
  352. var _19=maxOptions.pages.form.profile.createProfileObject();
  353. _19.title=$lang("form_profile_default");
  354. _19._default=true;
  355. _14.push(_19);
  356. maxOptions.pages.form.profile.isNew=true;
  357. }
  358. return _14;
  359. };
  360. maxOptions.pages.form.profile.parseItem=function(_1a){
  361. var _1b=maxOptions.pages.form.profile.createProfileObject();
  362. _1b._default=_1a[0].indexOf("*")>-1?true:false;
  363. _1b.title=_1a[0].replace(/\*/g,"");
  364. for(var i=0;i<_1a.length;i++){
  365. var _1d=_1a[i].split("$:$");
  366. if(_1d.length==2){
  367. _1b[_1d[0]]=_1d[1];
  368. }
  369. }
  370. return _1b;
  371. };
  372. maxOptions.pages.form.profile.saveList=function(){
  373. maxConfig.setActiveFile("$form");
  374. maxConfig.ini.deleteSection("profiles");
  375. if(profileTable.data.length==0){
  376. profileTable.data=maxOptions.pages.form.profile.loadList();
  377. maxTable.init(profileTable);
  378. return;
  379. }
  380. for(var i=0;i<profileTable.data.length;i++){
  381. var _1f=profileTable.data[i];
  382. var _20=[];
  383. for(var key in _1f){
  384. if(key=="_default"||key=="title"){
  385. continue;
  386. }
  387. _20.push(key+"$:$"+_1f[key]);
  388. }
  389. _20=_20.join("$,$");
  390. maxConfig.ini.setValue("profiles",_1f.title+(_1f._default?"*":""),_20);
  391. }
  392. maxOptions.action.applyChanges();
  393. maxConfig.setActiveFile("$main");
  394. };
  395. maxOptions.pages.form.profile.buildHTML=function(_22,_23){
  396. var _24=profileTable.data[_22];
  397. var _25="";
  398. if(profileTable.inAction=="edit"||profileTable.inAction=="add"){
  399. _25+="<div id=\"profile_editTable\"></div>";
  400. }else{
  401. _25+="<strong>"+_24.title.$encodeHTML()+"</strong>"+"<br/><span class=\"item-note\">"+(_24.username+" <"+_24.email+">").$encodeHTML()+"</span>";
  402. }
  403. return _25;
  404. };
  405. maxOptions.pages.form.profile.validateItem=function(){
  406. var _26=profileTable.data[profileTable.inEditDataIndex];
  407. if(_26.title==""){
  408. alert($lang("form_blank_title"));
  409. return false;
  410. }
  411. for(var i=0;i<profileTable.length;i++){
  412. if(profileTable[i].title==_26.title&&i!=profileTable.inEditDataIndex){
  413. alert($lang("form_duplicate_title"));
  414. return false;
  415. }
  416. }
  417. return true;
  418. };
  419. maxOptions.pages.form.profile.showSingleProfile=function(){
  420. if(!maxOptions.pages.form.profile.isNew){
  421. return;
  422. }
  423. var _28=$id(profileTable.id);
  424. if(_28){
  425. _28=_28.rows(1);
  426. }
  427. if(_28){
  428. maxTable.action.editRow(profileTable,_28);
  429. }
  430. };
  431. maxOptions.pages.form.profile.editTable={};
  432. maxOptions.pages.form.profile.editTable.init=function(){
  433. maxOptions.pages.form.profile.editTable.buildHTML();
  434. var _29=profileTable.data[profileTable.inEditDataIndex];
  435. for(var key in _29){
  436. maxOptions.pages.form.profile.editTable.bindData(key,_29[key]);
  437. }
  438. };
  439. maxOptions.pages.form.profile.editTable.buildHTML=function(){
  440. var _2b="";
  441. for(var i=-12;i<13;i++){
  442. _2b+="<option value=\""+i+"\">GMT "+(i==0?"":(i>0?"+"+i:i))+"</option>";
  443. }
  444. var _2d="";
  445. _2d+="<p>"+"<strong>"+$lang("title")+":</strong>"+"   <input type=\"text\" name=\"profile_title\" maxlength=\"255\" class=\"text\" style=\"width: 50%\" />"+"</p>";
  446. _2d+="<div class=\"inner-table-wrapper\">"+"<table width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" class=\"form-table\">"+"<tr>"+"<th colspan=\"4\">"+$lang("form_ps_general")+"</th>"+"</tr>"+"<tr>"+"<td width=\"10%\" class=\"form-table-header\">"+$lang("form_p_firstname")+"</td>"+"<td width=\"40%\"><input type=\"text\" name=\"profile_firstname\" maxlength=\"255\" class=\"text\" /></td>"+"<td width=\"10%\" class=\"form-table-header\">"+$lang("form_p_lastname")+"</td>"+"<td width=\"40%\"><input type=\"text\" name=\"profile_lastname\" maxlength=\"255\" class=\"text\" /></td>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_gender")+"</td>"+"<td>"+"<input type=\"radio\" id=\"profile_gender_0\" name=\"profile_gender\" value=\"0\" /><label for=\"profile_gender_0\">"+$lang("form_p_gender_blank")+"</label>   "+"<input type=\"radio\" id=\"profile_gender_1\" name=\"profile_gender\" value=\"1\" /><label for=\"profile_gender_1\">"+$lang("form_p_gender_male")+"</label>   "+"<input type=\"radio\" id=\"profile_gender_2\" name=\"profile_gender\" value=\"2\" /><label for=\"profile_gender_2\">"+$lang("form_p_gender_female")+"</label>"+"</td>"+"<td class=\"form-table-header\">"+$lang("form_p_birthday")+"</td>"+"<td>"+"<input type=\"text\" name=\"profile_birth_year\" maxlength=\"4\" class=\"text\" style=\"width: 4em;\" />"+" - "+"<select name=\"profile_birth_month\" onchange=\"maxOptions.pages.form.profile.editTable.updateBirthDayList()\" style=\"width: auto;\">"+"<option value=\"1\">1</option>"+"<option value=\"2\">2</option>"+"<option value=\"3\">3</option>"+"<option value=\"4\">4</option>"+"<option value=\"5\">5</option>"+"<option value=\"6\">6</option>"+"<option value=\"7\">7</option>"+"<option value=\"8\">8</option>"+"<option value=\"9\">9</option>"+"<option value=\"10\">10</option>"+"<option value=\"11\">11</option>"+"<option value=\"12\">12</option>"+"</select>"+" - "+"<select name=\"profile_birth_day\" style=\"width: auto;\">"+"</select>"+" <span class=\"comment\">(YYYY-MM-DD)</span> "+"</td>"+"</tr>"+"<tr>"+"<th colspan=\"4\">"+$lang("form_ps_reg")+"</th>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_username")+"</td>"+"<td><input type=\"text\" id=\"profile_username\" maxlength=\"255\" class=\"text\" /></td>"+"<td class=\"form-table-header\">"+$lang("form_p_pwd_q")+"</td>"+"<td><input type=\"text\" id=\"profile_pwd_q\" maxlength=\"255\" class=\"text\"/></td>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_password")+"</td>"+"<td>"+"<input type=\"password\" id=\"profile_password\" maxlength=\"255\" class=\"text\" style=\"width: 70%;\" />"+"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.form.profile.editTable.togglePasswordInput()\" />"+$lang("form_show_password")+"</a>"+"</td>"+"<td class=\"form-table-header\">"+$lang("form_p_pwd_a")+"</td>"+"<td><input type=\"text\" id=\"profile_pwd_a\" maxlength=\"255\" class=\"text\" /></td>"+"</tr>"+"<tr>"+"<th colspan=\"4\">"+$lang("form_ps_contact")+"</th>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_email")+"</td>"+"<td><input type=\"text\" id=\"profile_email\" maxlength=\"255\" class=\"text\" /></td>"+"<td class=\"form-table-header\">"+$lang("form_p_timezone")+"</td>"+"<td><select name=\"profile_timezone\">"+_2b+"</select></td>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_website")+"</td>"+"<td><input type=\"text\" id=\"profile_website\" maxlength=\"255\" class=\"text\" /></td>"+"<td class=\"form-table-header\">"+$lang("form_p_postcode")+"</td>"+"<td><input type=\"text\" id=\"profile_postcode\" maxlength=\"255\" class=\"text\" /></td>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_phone")+"</td>"+"<td><input type=\"text\" id=\"profile_phone\" maxlength=\"255\" class=\"text\" /></td>"+"<td class=\"form-table-header\">"+$lang("form_p_city")+"</td>"+"<td><input type=\"text\" id=\"profile_city\" maxlength=\"255\" class=\"text\" /></td>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_address").replace("%n","1")+"</td>"+"<td><input type=\"text\" id=\"profile_address1\" maxlength=\"255\" class=\"text\" /></td>"+"<td class=\"form-table-header\">"+$lang("form_p_state")+"</td>"+"<td><input type=\"text\" id=\"profile_state\" maxlength=\"255\" class=\"text\" /></td>"+"</tr>"+"<tr>"+"<td class=\"form-table-header\">"+$lang("form_p_address").replace("%n","2")+"</td>"+"<td><input type=\"text\" id=\"profile_address2\" maxlength=\"255\" class=\"text\" /></td>"+"<td class=\"form-table-header\">"+$lang("form_p_country")+"</td>"+"<td><input type=\"text\" id=\"profile_country\" maxlength=\"255\" class=\"text\" /></td>"+"</tr>"+"</table>"+"</div>";
  447. _2d+="<br/>"+maxTable.ui.buildEditControls(profileTable)+"<br/>";
  448. var obj=$id("profile_editTable");
  449. if(obj){
  450. obj.innerHTML=_2d+"<br/>";
  451. }
  452. };
  453. maxOptions.pages.form.profile.editTable.updateBirthDayList=function(){
  454. var _2f=[31,28,31,30,31,30,31,31,30,31,30,31];
  455. var obj=document.getElementsByName("profile_birth_month");
  456. var _31=parseInt(obj[0].value,10);
  457. if(_31==2){
  458. obj=document.getElementsByName("profile_birth_year");
  459. var _32=parseInt(obj[0].value,10);
  460. if(_32!=NaN){
  461. if((_32%4==0&&_32%100!=0)||(_32%100==0&&(_32/100)%4==0)){
  462. _2f[1]=29;
  463. }
  464. }
  465. }
  466. var _33=_2f[_31-1];
  467. obj=document.getElementsByName("profile_birth_day");
  468. obj=obj[0];
  469. obj.innerHTML="";
  470. for(var i=1;i<=_33;i++){
  471. var opt=document.createElement("option");
  472. var _36=document.createTextNode(i);
  473. opt.appendChild(_36);
  474. opt.setAttribute("value",i);
  475. obj.appendChild(opt);
  476. }
  477. };
  478. maxOptions.pages.form.profile.editTable.bindData=function(key,_38){
  479. var _39=document.getElementsByName("profile_"+key);
  480. if(!_39[0]){
  481. return;
  482. }
  483. if(_39[0].type=="text"||_39[0].type=="password"){
  484. _39[0].value=_38;
  485. _39[0].attachEvent("onchange",function(){
  486. return maxOptions.pages.form.profile.editTable.updateItem(key);
  487. });
  488. }else{
  489. if(_39[0].type=="select-one"){
  490. for(var i=0;i<_39[0].length;i++){
  491. if(_39[0][i].value==_38){
  492. _39[0].selectedIndex=i;
  493. }
  494. }
  495. _39[0].attachEvent("onchange",function(){
  496. return maxOptions.pages.form.profile.editTable.updateItem(key);
  497. });
  498. if(_39[0].name=="profile_birth_month"){
  499. maxOptions.pages.form.profile.editTable.updateBirthDayList();
  500. }
  501. }else{
  502. if(_39[0].type=="radio"){
  503. for(var i=0;i<_39.length;i++){
  504. if(_39[i].value==_38){
  505. _39[i].checked=true;
  506. }
  507. _39[i].attachEvent("onclick",function(){
  508. return maxOptions.pages.form.profile.editTable.updateItem(key);
  509. });
  510. }
  511. }
  512. }
  513. }
  514. };
  515. maxOptions.pages.form.profile.editTable.updateItem=function(key){
  516. var _3c=document.getElementsByName("profile_"+key);
  517. if(!_3c[0]){
  518. return;
  519. }
  520. var _3d="";
  521. if(_3c[0].type=="text"||_3c[0].type=="password"||_3c[0].type=="select-one"){
  522. _3d=_3c[0].value;
  523. }else{
  524. if(_3c[0].type=="radio"){
  525. for(var i=0;i<_3c.length;i++){
  526. if(_3c[i].checked){
  527. _3d=_3c[i].value;
  528. }
  529. }
  530. }
  531. }
  532. var _3f=profileTable.data[profileTable.inEditDataIndex];
  533. _3f[key]=_3d;
  534. };
  535. maxOptions.pages.form.profile.editTable.togglePasswordInput=function(_40){
  536. var obj=$id("profile_password");
  537. if(!obj){
  538. return;
  539. }
  540. if(_40==undefined){
  541. _40=obj.type=="text"?false:true;
  542. }
  543. if(_40&&!maxOptions.pages.form.validatePassword()){
  544. return;
  545. }
  546. var _42=document.createElement("INPUT");
  547. _42.type=_40?"text":"password";
  548. _42.value=obj.value;
  549. _42.id=obj.id;
  550. _42.name=obj.name;
  551. _42.className=obj.className;
  552. _42.style.width=obj.style.width;
  553. obj.replaceNode(_42);
  554. obj=$id("profile_password");
  555. if(_40){
  556. obj.focus();
  557. obj.onchange=function(){
  558. maxOptions.pages.form.profile.editTable.updateItem("password");
  559. };
  560. obj.onblur=function(){
  561. maxOptions.pages.form.profile.editTable.togglePasswordInput(false);
  562. };
  563. }
  564. };
  565. maxOptions.pages.form.savedForm={};
  566. maxOptions.pages.form.savedForm.init=function(){
  567. savedFormTable=maxTable.create("savedFormTable");
  568. savedFormTable.columns=[{title:$lang("form_show_on_menu"),name:"showOnMenu",type:"checkbox",width:54,tagx:" style=\"text-align: center;\"",required:false},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.form.savedForm.buildHTML}];
  569. savedFormTable.showControl=false;
  570. savedFormTable.showEditControl=false;
  571. savedFormTable.allowInsert=false;
  572. savedFormTable.dataType="object";
  573. savedFormTable.data=maxOptions.pages.form.savedForm.loadList();
  574. savedFormTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  575. savedFormTable.style["edit"]="maxTable-edit-no-control";
  576. savedFormTable.controlUI["delete"]=$lang("delete");
  577. savedFormTable.controlUI["save"]=$lang("save");
  578. savedFormTable.controlUI["cancel"]=$lang("cancel");
  579. savedFormTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  580. savedFormTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  581. savedFormTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  582. savedFormTable.event["afterCheckboxClick"]=maxOptions.pages.form.savedForm.toggleOnMenu;
  583. savedFormTable.event["afterDelete"]=maxOptions.pages.form.savedForm.deleteItem;
  584. savedFormTable.event["afterEdit"]=maxOptions.pages.form.savedForm.showDataView;
  585. savedFormTable.event["beforeUpdate"]=maxOptions.pages.form.savedForm.updateItem;
  586. savedFormTable.event["beforeCancel"]=maxOptions.pages.form.savedForm.hideDataView;
  587. maxTable.init(savedFormTable);
  588. maxOptions.pages.form.savedForm.dataView.init();
  589. };
  590. maxOptions.pages.form.savedForm.loadList=function(){
  591. maxConfig.setActiveFile("$form");
  592. var _43=maxConfig.ini.getArray("savedlist",false);
  593. maxConfig.setActiveFile("$main");
  594. var _44=[];
  595. for(var i=0;i<_43.length;i++){
  596. var _46={};
  597. _46.id=_43[i][0];
  598. _46.urlMD5=_43[i][0].substr(0,_43[i][0].indexOf("|"));
  599. _46.title=_43[i][0].substr(_43[i][0].indexOf("|")+1,_43[i][0].length);
  600. _46.url=_43[i][1];
  601. _46.showOnMenu=_43[i][2]?(_43[i][2]=="1"?true:false):false;
  602. if(!_43[i][3]){
  603. _43[i][3]=_46.url;
  604. }
  605. _46.matchURL=_43[i][3];
  606. _44.push(_46);
  607. }
  608. _44.$sort("title");
  609. return _44;
  610. };
  611. maxOptions.pages.form.savedForm.toggleOnMenu=function(_47,_48){
  612. var _49=savedFormTable.data[_47];
  613. var _4a=_49.url+"$,$"+(_49.showOnMenu?"1":"0")+"$,$"+_49.matchURL;
  614. maxConfig.setActiveFile("$form");
  615. maxConfig.ini.setValue("savedlist",_49.id,_4a);
  616. maxOptions.action.applyChanges();
  617. maxConfig.setActiveFile("$main");
  618. };
  619. maxOptions.pages.form.savedForm.updateItem=function(){
  620. var _4b=savedFormTable.inEditResultData;
  621. var obj=$id("saved_title");
  622. if(!obj){
  623. return true;
  624. }
  625. _4b.title=obj.value.$trim();
  626. _4b.id=_4b.urlMD5+"|"+_4b.title;
  627. if(_4b.title==""){
  628. alert($lang("form_blank_title"));
  629. return false;
  630. }
  631. for(var i=0;i<savedFormTable.data.length;i++){
  632. if(_4b.id==savedFormTable.data[i].id&&savedFormTable.inEditDataIndex!=i){
  633. alert($lang("form_duplicate_title"));
  634. return false;
  635. }
  636. }
  637. var obj=$id("saved_match_url");
  638. _4b.matchURL=obj.value.$trim();
  639. if(_4b.matchURL==""){
  640. alert($lang("form_blank_match_url"));
  641. return false;
  642. }
  643. var _4e=savedFormTable.data[savedFormTable.inEditDataIndex];
  644. maxConfig.setActiveFile("$form");
  645. maxConfig.ini.setValue("savedlist",_4b.id,_4b.url+"$,$"+(_4b.showOnMenu?"1":"0")+"$,$"+_4b.matchURL,"form");
  646. maxOptions.pages.form.savedForm.updateItemData(_4e.id);
  647. if(_4b.title!=_4e.title){
  648. var _4f=maxConfig.ini.getArray(_4e.id,false);
  649. maxConfig.ini.setArray(_4b.id,_4f,false);
  650. maxConfig.ini.deleteKey("savedlist",_4e.id);
  651. maxConfig.ini.deleteSection(_4e.id,"form");
  652. }
  653. maxOptions.action.applyChanges();
  654. maxConfig.setActiveFile("$main");
  655. return true;
  656. };
  657. maxOptions.pages.form.savedForm.updateItemData=function(_50){
  658. var _51=dataViewTable.data;
  659. var _52=maxConfig.ini.getArray(_50);
  660. for(var i=0;i<dataViewTable.data.length;i++){
  661. var _54=dataViewTable.data[i];
  662. var _55=_52[i];
  663. var obj=$id("saved_item_"+i);
  664. if(!obj){
  665. continue;
  666. }
  667. _54.value=obj.value.$trim();
  668. var obj=$id("saved_item_"+i+"_sub");
  669. if(obj){
  670. _54.subValue=obj.value.$trim();
  671. }
  672. switch(_54.type){
  673. case "t":
  674. case "c":
  675. case "r":
  676. _55[1]=_54.value;
  677. break;
  678. case "p":
  679. case "a":
  680. _55[1]=_54.value+"$.!.$"+_54.type;
  681. break;
  682. case "s":
  683. _55[1]=_54.value+"$.!.$"+_54.subValue;
  684. break;
  685. case "f":
  686. break;
  687. }
  688. _52[i]=_55;
  689. }
  690. maxConfig.ini.setArray(_50,_52);
  691. };
  692. maxOptions.pages.form.savedForm.deleteItem=function(_57){
  693. maxConfig.setActiveFile("$form");
  694. maxConfig.ini.deleteKey("savedlist",_57.id,"form");
  695. maxConfig.ini.deleteSection(_57.id,"form");
  696. maxOptions.action.applyChanges();
  697. maxConfig.setActiveFile("$main");
  698. };
  699. maxOptions.pages.form.savedForm.buildHTML=function(_58,_59){
  700. var _5a=savedFormTable.data[_58];
  701. var _5b="";
  702. if(savedFormTable.inAction=="edit"||savedFormTable.inAction=="add"){
  703. _5b+="<p><strong>"+$lang("title")+":</strong>"+"   <input type=\"text\" id=\"saved_title\" maxlength=\"255\" class=\"text\" value=\""+_5a.title.$encodeHTML()+"\" style=\"width: 50%\" /></p>";
  704. _5b+="<p><strong>"+$lang("form_original_url")+":</strong>   <a href=\""+_5a.url.$sanitizeURL()+"\" target=\"_blank\">"+_5a.url.$encodeHTML()+"</a></p>";
  705. _5b+="<p><strong>"+$lang("form_match_url")+":</strong>"+"   <input type=\"text\" id=\"saved_match_url\" maxlength=\"255\" class=\"text\" value=\""+_5a.matchURL.$encodeHTML()+"\" style=\"width: 50%\" /> <span class=\"note\">"+$lang("form_match_url_note")+"</span></p>";
  706. _5b+="<div class=\"inner-table-wrapper\">"+"<div id=\"dataViewTable_wrapper\"></div>"+"</div>";
  707. _5b+="<p>"+maxTable.ui.buildEditControls(savedFormTable)+"</p>";
  708. }else{
  709. _5b+=_5a.title.$encodeHTML();
  710. }
  711. return _5b;
  712. };
  713. maxOptions.pages.form.savedForm.showDataView=function(){
  714. var _5c=savedFormTable.data[savedFormTable.inEditDataIndex];
  715. dataViewTable.data=maxOptions.pages.form.savedForm.dataView.loadList(_5c.id);
  716. maxTable.init(dataViewTable);
  717. };
  718. maxOptions.pages.form.savedForm.hideDataView=function(){
  719. var obj=$id("dataViewTable_wrapper");
  720. obj.innerHTML="";
  721. dataViewTable.data=[];
  722. return true;
  723. };
  724. maxOptions.pages.form.savedForm.dataView={};
  725. maxOptions.pages.form.savedForm.dataView.init=function(){
  726. dataViewTable=maxTable.create("dataViewTable");
  727. dataViewTable.dataType="object";
  728. dataViewTable.columns=[{title:$lang("field"),name:"name",type:"custom",customBuilder:maxOptions.pages.form.savedForm.dataView.buildHTML,width:"25%"},{title:$lang("value"),name:"value",type:"custom",customBuilder:maxOptions.pages.form.savedForm.dataView.buildHTML}];
  729. dataViewTable.showEditControl=true;
  730. dataViewTable.allowInsert=false;
  731. dataViewTable.allowEdit=false;
  732. dataViewTable.separatorType="text";
  733. dataViewTable.tableTag="\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"";
  734. dataViewTable.style["table"]="form-table";
  735. dataViewTable.style["separator"]="form-table-section";
  736. dataViewTable.style["separator-hover"]="form-table-section";
  737. };
  738. maxOptions.pages.form.savedForm.dataView.loadList=function(id){
  739. maxConfig.setActiveFile("$form");
  740. var _5f=maxConfig.ini.getArray(id,false,"form");
  741. maxConfig.setActiveFile("$main");
  742. if(_5f.length<1){
  743. return [];
  744. }
  745. var _60=[];
  746. for(var i=0;i<_5f.length;i++){
  747. var _62={};
  748. var _63=_5f[i][0].split(">>");
  749. _62.name=_63[0];
  750. _62.type=_63[1];
  751. if(_63[2]!=undefined){
  752. _62.name+="["+_63[2]+"]";
  753. }
  754. if(_62.name.indexOf("<<")==0){
  755. _62.name=_62.name.replace("<<","")+"<id>";
  756. }
  757. if(_62.name.indexOf("><")==0){
  758. _62.name=_62.name.replace("><",". ");
  759. }
  760. if(_5f[i][0]=="<form>"){
  761. _62.name=$lang("form");
  762. _62.type="f";
  763. }
  764. _62.value=_5f[i][1];
  765. if(_62.value.indexOf("$.!.$")>-1){
  766. var arr=_62.value.split("$.!.$");
  767. _62.value=arr[0];
  768. _62.subValue=arr[1];
  769. if(_62.type=="t"){
  770. _62.type=_62.subValue;
  771. }
  772. }
  773. if(!_62.subValue){
  774. _62.subValue="";
  775. }
  776. _60.push(_62);
  777. }
  778. return _60;
  779. };
  780. maxOptions.pages.form.savedForm.dataView.buildHTML=function(_65,_66){
  781. var _67=dataViewTable.data[_65];
  782. var _68="";
  783. var _69={"p":"password","c":"checkbox","a":"textarea","t":"text","r":"radio","s":"select"};
  784. if(_66==0){
  785. if(_67.type=="f"){
  786. _68+="<strong>"+$lang("form_form")+"</strong>";
  787. }else{
  788. _68+=_67.name.$encodeHTML();
  789. }
  790. }else{
  791. switch(_67.type){
  792. case "f":
  793. _68+=_67.value.$encodeHTML()+" <"+_67.subValue.$encodeHTML()+">";
  794. break;
  795. case "s":
  796. _68+="<input type=\"text\" id=\"saved_item_"+_65+"\" value=\""+_67.value.$encodeHTML()+"\" class=\"text\" style=\"width:30%\" />"+" - <input type=\"text\" id=\"saved_item_"+_65+"_sub\" value=\""+_67.subValue.$encodeHTML()+"\" class=\"text\" style=\"width:30%\" />";
  797. break;
  798. case "p":
  799. _68+="<input type=\"password\" id=\"saved_item_"+_65+"\" value=\""+_67.value.$encodeHTML()+"\" class=\"text\" style=\"width:60%\" />"+"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.form.savedForm.dataView.togglePasswordText("+_65+")\" />"+$lang("form_show_password")+"</a>";
  800. break;
  801. default:
  802. _68+="<input type=\"text\" id=\"saved_item_"+_65+"\" value=\""+_67.value.$encodeHTML()+"\" class=\"text\" style=\"width:80%\" />";
  803. }
  804. if(_67.type!="f"){
  805. _68+="   <span class=\"comment\">["+_69[_67.type]+"]</span>";
  806. }
  807. }
  808. return _68;
  809. };
  810. maxOptions.pages.form.savedForm.dataView.togglePasswordText=function(_6a){
  811. var _6b=false;
  812. var obj=$id("saved_item_"+_6a);
  813. if(!obj){
  814. return;
  815. }
  816. if(obj.type=="password"){
  817. if(!maxOptions.pages.form.validatePassword()){
  818. return;
  819. }
  820. _6b=true;
  821. }else{
  822. _6b=false;
  823. }
  824. var _6d=document.createElement("INPUT");
  825. _6d.type=_6b?"text":"password";
  826. _6d.value=obj.value;
  827. _6d.id=obj.id;
  828. _6d.name=obj.name;
  829. _6d.className=obj.className;
  830. _6d.style.width=obj.style.width;
  831. obj.replaceNode(_6d);
  832. };
  833. maxOptions.pages.floatbutton.init=function(){
  834. maxOptions.pages.floatbutton.checkMain();
  835. var obj=$id("fb_enable");
  836. obj.attachEvent("onclick",maxOptions.pages.floatbutton.checkMain);
  837. };
  838. maxOptions.pages.floatbutton.checkMain=function(){
  839. if($id("fb_enable").checked){
  840. maxConfig.ui.enableItem("fb_show_on_image");
  841. maxConfig.ui.enableItem("fb_show_on_media");
  842. }else{
  843. maxConfig.ui.disableItem("fb_show_on_image");
  844. maxConfig.ui.disableItem("fb_show_on_media");
  845. }
  846. };
  847. maxOptions.pages.download.init=function(){
  848. maxOptions.pages.download.buildDownloaderList();
  849. maxOptions.pages.download.getDefaultSaveFolder();
  850. };
  851. maxOptions.pages.download.getDefaultSaveFolder=function(){
  852. var _6f=maxConfig.ini.getValue("Download","SaveFolder");
  853. if(!_6f){
  854. var v=external.max_getObj(max_security_id,"info");
  855. var _71=v.folderUser+"Downloads";
  856. maxConfig.ini.setValue("Download","SaveFolder",_71);
  857. maxConfig.ui.folder.updateUI("down_save_folder",_71);
  858. maxOptions.action.applyChanges();
  859. }
  860. };
  861. maxOptions.pages.download.buildDownloaderList=function(){
  862. maxConfig.setActiveFile("$download");
  863. var _72=maxConfig.ini.getArray("Downloaders",false);
  864. maxConfig.setActiveFile("$main");
  865. var _73=maxConfig.ini.getValue("Download","Downloader");
  866. if(_73==null){
  867. _73="";
  868. }
  869. var _74=[];
  870. for(var i=0;i<_72.length;i++){
  871. var _76="";
  872. var _77=false;
  873. var _78=_72[i][1];
  874. var _79=external.max_Lang("Downloaders",_78);
  875. if(_79!=""){
  876. _78=_79+" ("+_78+")";
  877. }
  878. if(_72[i][0]!=""){
  879. var obj=external.max_activex(max_security_id,_72[i][0]);
  880. if(!obj){
  881. _77=true;
  882. _76+=" style=\"color:#CCCCCC\"";
  883. _78="- "+_78.$encodeHTML();
  884. }else{
  885. _78="» "+_78.$encodeHTML();
  886. }
  887. delete obj;
  888. }
  889. if(_72[i][0]==_73){
  890. _76+=" selected=\"selected\"";
  891. }
  892. _72[i]="<option value=\""+_72[i][0]+"\""+_76+">"+_78+"</option>";
  893. if(_77){
  894. _74.push(_72.splice(i,1));
  895. i--;
  896. }
  897. }
  898. var _7b="<select size=\"12\" id=\"downloaderList\" onchange=\"maxOptions.pages.download.setDownloader()\">"+_72.join("\n")+_74.join("\n")+"</select>";
  899. $write(_7b,"downloaderList_wrapper");
  900. };
  901. maxOptions.pages.download.setDownloader=function(){
  902. var obj=$id("downloaderList");
  903. var _7d=obj.options[obj.selectedIndex].value;
  904. var _7e=true;
  905. if(_7d!=""){
  906. var obj=external.max_activex(max_security_id,_7d);
  907. if(!obj){
  908. _7e=false;
  909. }
  910. }
  911. if(!_7e){
  912. alert($lang("down_downloader_not_detected"));
  913. }
  914. if(_7e){
  915. maxConfig.ini.setValue("Download","Downloader",_7d);
  916. }
  917. maxOptions.pages.download.buildDownloaderList();
  918. };
  919. maxOptions.pages.key.init=function(){
  920. maxOptions.pages.key.customKey.init();
  921. };
  922. maxOptions.pages.key.destroy=function(){
  923. try{
  924. maxTable.destroy(customKeyTable);
  925. }
  926. catch(e){
  927. }
  928. };
  929. maxOptions.pages.key.customKey={};
  930. maxOptions.pages.key.customKey.init=function(){
  931. customKeyTable=maxTable.create("customKeyTable");
  932. customKeyTable.columns=[{title:$lang("shortcut_key"),name:"shortcut",type:"custom",customBuilder:maxOptions.pages.key.customKey.buildHTML,width:"15%",tagx:"nowrap=\"nowrap\""},{title:$lang("action"),name:"action",type:"custom",customBuilder:maxOptions.pages.key.customKey.buildHTML}];
  933. customKeyTable.showEditControl=false;
  934. customKeyTable.defaultRowData={keyCode:"csa_0",keyName:$lang("none"),action:"",actionID:"0",actionType:"i"};
  935. customKeyTable.dataType="object";
  936. customKeyTable.data=maxOptions.pages.key.customKey.loadList();
  937. customKeyTable.editControl=[{type:"html",value:" | ",hideOnNew:true},{type:"delete",hideOnNew:true},{type:"html",value:" | "},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  938. customKeyTable.style["edit"]="maxTable-edit-no-control";
  939. customKeyTable.controlUI["delete"]=$lang("delete");
  940. customKeyTable.controlUI["save"]=$lang("save");
  941. customKeyTable.controlUI["cancel"]=$lang("cancel");
  942. customKeyTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  943. customKeyTable.content["buildTableControls"]=maxOptions.pages.key.customKey.buildTableControls;
  944. customKeyTable.event["beforeAdd"]=maxOptions.pages.key.customKey.validateKey;
  945. customKeyTable.event["afterAdd"]=maxOptions.pages.key.customKey.saveList;
  946. customKeyTable.event["beforeUpdate"]=maxOptions.pages.key.customKey.validateKey;
  947. customKeyTable.event["afterUpdate"]=maxOptions.pages.key.customKey.saveList;
  948. customKeyTable.event["afterDelete"]=maxOptions.pages.key.customKey.saveList;
  949. maxTable.init(customKeyTable);
  950. };
  951. maxOptions.pages.key.customKey.buildTableControls=function(){
  952. var _7f="";
  953. _7f+="<a href=\"javascript:;\" onclick=\"maxTable.action.addRow(customKeyTable)\">"+$lang("maxtable_new")+"</a>"+" | "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.key.customKey.restoreDefault()\">"+$lang("restore_default")+"</a>";
  954. return _7f;
  955. };
  956. maxOptions.pages.key.customKey.loadList=function(){
  957. var _80=[];
  958. var _81=maxConfig.ini.getArray("ShortcutKeys");
  959. _81.$sort(0,{"compareLength":true});
  960. for(var i=0;i<_81.length;i++){
  961. var _83={};
  962. var _84=maxConfig.ui.key.parseData(_81[i][0]);
  963. _83.keyCode=_84[0];
  964. _83.keyName=_84[1];
  965. _83.actionType=_81[i][1];
  966. _83.actionID=_81[i][2];
  967. _83.action=_81[i][3];
  968. if(_83.actionType=="i"){
  969. _83.action=$lang(_83.actionID,"StringByID");
  970. }
  971. if(_83.actionID=="0"){
  972. _83.action=$lang("none");
  973. }
  974. if(_83.keyCode!="csa_0"&&_83.actionID){
  975. _80.push(_83);
  976. }
  977. }
  978. return _80;
  979. };
  980. maxOptions.pages.key.customKey.saveList=function(){
  981. var _85=[];
  982. for(var i=0;i<customKeyTable.data.length;i++){
  983. if(typeof (customKeyTable.data[i])=="string"){
  984. continue;
  985. }
  986. var _87=[];
  987. _87[0]=customKeyTable.data[i].keyCode+"$:$"+customKeyTable.data[i].keyName;
  988. _87[1]=customKeyTable.data[i].actionType;
  989. _87[2]=customKeyTable.data[i].actionID;
  990. _87[3]=customKeyTable.data[i].actionType=="i"?"":customKeyTable.data[i].action;
  991. _85.push(_87);
  992. }
  993. maxConfig.ini.deleteSection("ShortcutKeys");
  994. maxConfig.ini.setArray("ShortcutKeys",_85);
  995. maxOptions.action.applyChanges();
  996. };
  997. maxOptions.pages.key.customKey.buildHTML=function(_88,_89){
  998. var _8a=customKeyTable.data[_88];
  999. var _8b="";
  1000. if(_89==0){
  1001. _8b+="<img src=\"../_shared/images/key.png\" /> "+_8a.keyName;
  1002. }else{
  1003. if(_8a.actionID=="0"){
  1004. _8b+="<span class=\"item-note\">"+$lang("none")+"</span>";
  1005. }else{
  1006. _8b+=_8a.action.$encodeHTML().replace(/\&\;([a-z])/ig,"<u>$1</u>")+" <span class=\"item-note\">["+_8a.actionID+"]</span>";
  1007. }
  1008. if(customKeyTable.inAction=="edit"||customKeyTable.inAction=="add"){
  1009. _8b+="<p>"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.key.customKey.setKey()\">"+$lang("set_key")+"</a> | "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.key.customKey.setAction()\">"+$lang("set_action")+"</a>"+maxTable.ui.buildEditControls(customKeyTable)+" </p>";
  1010. }
  1011. }
  1012. return _8b;
  1013. };
  1014. maxOptions.pages.key.customKey.validateKey=function(){
  1015. var _8c=customKeyTable.data[customKeyTable.inEditDataIndex];
  1016. if(_8c.keyCode==""||_8c.keyCode=="csa_0"){
  1017. alert($lang("key_blank_key"));
  1018. return false;
  1019. }
  1020. for(var i=0;i<customKeyTable.data.length;i++){
  1021. if(_8c.keyCode==customKeyTable.data[i].keyCode&&customKeyTable.inEditDataIndex!=i){
  1022. alert($lang("key_duplicate_key"));
  1023. return false;
  1024. }
  1025. }
  1026. return true;
  1027. };
  1028. maxOptions.pages.key.customKey.setKey=function(){
  1029. var _8e=external.max_invoke("GetHotKey");
  1030. if(_8e==-1){
  1031. return;
  1032. }
  1033. var _8f=maxConfig.ui.key.parseData(_8e);
  1034. if(_8f[0]!="csa_0"){
  1035. var _90=customKeyTable.data[customKeyTable.inEditDataIndex];
  1036. _90.keyCode=_8f[0];
  1037. _90.keyName=_8f[1];
  1038. maxTable.ui.updateRow(customKeyTable,customKeyTable.inEditDataIndex);
  1039. }
  1040. };
  1041. maxOptions.pages.key.customKey.setAction=function(){
  1042. var _91=external.max_invoke("SelCommand");
  1043. if(!_91){
  1044. return;
  1045. }
  1046. var _92=_91.split("$,$");
  1047. var _93=customKeyTable.data[customKeyTable.inEditDataIndex];
  1048. _93.actionType=_92[0];
  1049. _93.actionID=_92[1];
  1050. _93.action=_92[2];
  1051. maxTable.ui.updateRow(customKeyTable,customKeyTable.inEditDataIndex);
  1052. };
  1053. maxOptions.pages.key.customKey.restoreDefault=function(){
  1054. if(confirm($lang("confirm_restore_default"))){
  1055. external.max_invoke("DefaultConfig","HotKey");
  1056. maxConfig.init();
  1057. }
  1058. };
  1059. maxOptions.pages.mouse.init=function(){
  1060. maxOptions.pages.mouse.gesture.init();
  1061. };
  1062. maxOptions.pages.mouse.destroy=function(){
  1063. try{
  1064. maxTable.destroy(mouseTable);
  1065. }
  1066. catch(e){
  1067. }
  1068. };
  1069. maxOptions.pages.mouse.gesture={};
  1070. maxOptions.pages.mouse.gesture.init=function(){
  1071. mouseTable=maxTable.create("mouseTable");
  1072. mouseTable.columns=[{title:$lang("mou_gesture"),name:"gesture",type:"custom",customBuilder:maxOptions.pages.mouse.gesture.buildGestureHTML,width:"15%",tagx:" nowrap=\"nowrap\""},{title:$lang("action"),name:"action",type:"custom",customBuilder:maxOptions.pages.mouse.gesture.buildActionHTML}];
  1073. mouseTable.separatorType="line";
  1074. mouseTable.allowEditSeparator=false;
  1075. mouseTable.showEditControl=false;
  1076. mouseTable.defaultRowData={gesture:"",action:"",actionID:"0",actionType:"i"};
  1077. mouseTable.dataType="object";
  1078. mouseTable.data=maxOptions.pages.mouse.gesture.loadList();
  1079. mouseTable.editControl=[{type:"html",value:" | ",hideOnNew:true},{type:"delete",hideOnNew:true},{type:"html",value:" | "},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  1080. mouseTable.style["edit"]="maxTable-edit-no-control";
  1081. mouseTable.controlUI["delete"]=$lang("delete");
  1082. mouseTable.controlUI["save"]=$lang("save");
  1083. mouseTable.controlUI["cancel"]=$lang("cancel");
  1084. mouseTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1085. mouseTable.content["buildTableControls"]=maxOptions.pages.mouse.gesture.buildTableControls;
  1086. mouseTable.event["beforeAdd"]=maxOptions.pages.mouse.gesture.validateGesture;
  1087. mouseTable.event["afterAdd"]=maxOptions.pages.mouse.gesture.saveList;
  1088. mouseTable.event["beforeUpdate"]=maxOptions.pages.mouse.gesture.validateGesture;
  1089. mouseTable.event["afterUpdate"]=maxOptions.pages.mouse.gesture.saveList;
  1090. mouseTable.event["beforeDelete"]=maxOptions.pages.mouse.gesture.checkDelete;
  1091. mouseTable.event["afterDelete"]=maxOptions.pages.mouse.gesture.saveList;
  1092. maxTable.init(mouseTable);
  1093. };
  1094. maxOptions.pages.mouse.gesture.buildTableControls=function(){
  1095. var _94="";
  1096. _94+="<a href=\"javascript:;\" onclick=\"maxTable.action.addRow(mouseTable)\">"+$lang("maxtable_new")+"</a>"+" | "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.restoreToDefault()\">"+$lang("restore_default")+"</a>";
  1097. return _94;
  1098. };
  1099. maxOptions.pages.mouse.gesture.loadList=function(){
  1100. var _95=[];
  1101. var _96=["DoubleClickTab","DoubleClickTabBar","DoubleClickPage","MidClickTab","HoldRightClickLeft","HoldLeftClickRight"];
  1102. for(var i=0;i<_96.length;i++){
  1103. var _98={buildIn:true};
  1104. var str=maxConfig.ini.getValue("MouseGestures",_96[i]);
  1105. if(str==""){
  1106. _98.gesture=_96[i];
  1107. _98.actionType="i";
  1108. _98.actionID="0";
  1109. _98.action=$lang("none");
  1110. }else{
  1111. _98.gesture=_96[i];
  1112. var _9a=str.split("$,$");
  1113. _98.actionType=_9a[0];
  1114. _98.actionID=_9a[1];
  1115. _98.action=_9a[2];
  1116. if(_98.actionType=="i"){
  1117. _98.action=$lang(_98.actionID,"StringByID");
  1118. }
  1119. if(_98.actionID=="0"){
  1120. _98.action=$lang("none");
  1121. }
  1122. }
  1123. _95.push(_98);
  1124. }
  1125. _95.push("---");
  1126. var _9b=maxConfig.ini.getArray("MouseGestures");
  1127. _9b.$sort(0);
  1128. for(var i=0;i<_9b.length;i++){
  1129. var _98={};
  1130. if(_9b[i][0].indexOf("Gesture_")==0){
  1131. _98.gesture=_9b[i][0].substring(8,_9b[i][0].length);
  1132. _98.actionType=_9b[i][1];
  1133. _98.actionID=_9b[i][2];
  1134. _98.action=_9b[i][3];
  1135. if(_98.actionType=="i"){
  1136. _98.action=$lang(_98.actionID,"StringByID");
  1137. }
  1138. if(_98.actionID=="0"){
  1139. _98.action=$lang("none");
  1140. }
  1141. }
  1142. if(_98.gesture&&_98.actionID){
  1143. _95.push(_98);
  1144. }
  1145. }
  1146. return _95;
  1147. };
  1148. maxOptions.pages.mouse.gesture.saveList=function(){
  1149. var _9c=[];
  1150. for(var i=0;i<mouseTable.data.length;i++){
  1151. if(typeof (mouseTable.data[i])=="string"){
  1152. continue;
  1153. }
  1154. var _9e=[];
  1155. _9e[0]=mouseTable.data[i].buildIn?mouseTable.data[i].gesture:"Gesture_"+mouseTable.data[i].gesture;
  1156. _9e[1]=mouseTable.data[i].actionType;
  1157. _9e[2]=mouseTable.data[i].actionID;
  1158. _9e[3]=mouseTable.data[i].actionType=="i"?"":mouseTable.data[i].action;
  1159. _9c.push(_9e);
  1160. }
  1161. maxConfig.ini.deleteSection("MouseGestures");
  1162. maxConfig.ini.setArray("MouseGestures",_9c);
  1163. maxOptions.action.applyChanges();
  1164. };
  1165. maxOptions.pages.mouse.gesture.buildGestureHTML=function(_9f,_a0){
  1166. var _a1=mouseTable.data[_9f];
  1167. var _a2="";
  1168. if(_a1.buildIn){
  1169. if(_a1.gesture.indexOf("Double")>-1){
  1170. _a2+="<img src=\"../_shared/images/mouse_left.png\" /> ";
  1171. }else{
  1172. if(_a1.gesture.indexOf("Mid")>-1){
  1173. _a2+="<img src=\"../_shared/images/mouse_mid.png\" /> ";
  1174. }else{
  1175. if(_a1.gesture.indexOf("Hold")>-1){
  1176. _a2+="<img src=\"../_shared/images/mouse_both.png\" /> ";
  1177. }
  1178. }
  1179. }
  1180. _a2+=$lang("mou_"+_a1.gesture.toLowerCase());
  1181. }else{
  1182. if(mouseTable.inAction=="edit"||mouseTable.inAction=="add"){
  1183. _a2+="<table width=\"99%\" class=\"clean-table\" cellpadding=\"0\" cellspacing=\"0\">"+"<tr>"+"<td nowrap=\"nowrap\">";
  1184. }
  1185. _a2+="<img src=\"../_shared/images/mouse_right.png\" /> "+$lang("mou_gesture");
  1186. if(_a1.gesture==""){
  1187. _a2+=" <span class=\"comment\">"+$lang("none")+"</span>";
  1188. }else{
  1189. for(var i=0;i<_a1.gesture.length;i++){
  1190. _a2+=" <img src=\"../_shared/images/direction_"+_a1.gesture.substr(i,1).toLowerCase()+".png\" />";
  1191. }
  1192. }
  1193. if(mouseTable.inAction=="edit"||mouseTable.inAction=="add"){
  1194. _a2+=(_a1.gesture.length>0?" <a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setGesture('B');\">"+$lang("delete")+"</a>":"")+"    "+"</td><td width=\"54\" style=\"text-align: right;\">"+"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"clean-table\">"+"<tr>"+"<td width=\"16\"></td>"+"<td width=\"16\"><a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setGesture('U');\"><img src=\"../_shared/images/btn_up.png\" /></a></td>"+"<td width=\"16\"></td>"+"</tr>"+"<tr>"+"<td><a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setGesture('L');\"><img src=\"../_shared/images/btn_left.png\" /></a></td>"+"<td></td>"+"<td><a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setGesture('R');\"><img src=\"../_shared/images/btn_right.png\" /></a></td>"+"<tr>"+"<td></td>"+"<td width=\"16\"><a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setGesture('D');\"><img src=\"../_shared/images/btn_down.png\" /></a></td>"+"<td></td>"+"</tr>"+"</tr>"+"</table>"+"</td></tr></table>";
  1195. }
  1196. }
  1197. return _a2;
  1198. };
  1199. maxOptions.pages.mouse.gesture.buildActionHTML=function(_a4,_a5){
  1200. var _a6=mouseTable.data[_a4];
  1201. var _a7="";
  1202. if(_a6.actionID=="0"){
  1203. _a7+=" <span class=\"item-note\">"+$lang("none")+"</span>";
  1204. }else{
  1205. _a7+=_a6.action.$encodeHTML().replace(/\&\;([a-z])/ig,"<u>$1</u>")+" <span class=\"item-note\">["+_a6.actionID+"]</span>";
  1206. }
  1207. if(mouseTable.inAction=="edit"||mouseTable.inAction=="add"){
  1208. _a7+="<p>"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setAction()\">"+$lang("set_action")+"</a>"+maxTable.ui.buildEditControls(mouseTable)+" </p>";
  1209. }
  1210. return _a7;
  1211. };
  1212. maxOptions.pages.mouse.gesture.validateGesture=function(){
  1213. var _a8=mouseTable.data[mouseTable.inEditDataIndex];
  1214. if(_a8.gesture==""){
  1215. alert($lang("mou_blank_gesture"));
  1216. return false;
  1217. }
  1218. for(var i=0;i<mouseTable.data.length;i++){
  1219. if(_a8.gesture==mouseTable.data[i].gesture&&mouseTable.inEditDataIndex!=i){
  1220. alert($lang("mou_duplicate_gesture"));
  1221. return false;
  1222. }
  1223. }
  1224. return true;
  1225. };
  1226. maxOptions.pages.mouse.gesture.checkDelete=function(_aa){
  1227. if(_aa.buildIn){
  1228. if(!confirm($lang("maxtable_delete_confirm"))){
  1229. return false;
  1230. }
  1231. _aa.actionType="i";
  1232. _aa.actionID="0";
  1233. _aa.action="";
  1234. maxTable.action.saveEdit(mouseTable);
  1235. maxConfig.ini.setValue("MouseGestures",_aa.gesture,_aa.actionType+"$,$"+_aa.actionID+"$,$"+_aa.action);
  1236. return false;
  1237. }
  1238. return true;
  1239. };
  1240. maxOptions.pages.mouse.gesture.setGesture=function(_ab){
  1241. var _ac=mouseTable.data[mouseTable.inEditDataIndex];
  1242. if(_ab=="B"){
  1243. if(_ac.gesture.length>0){
  1244. _ac.gesture=_ac.gesture.slice(0,-1);
  1245. }
  1246. }else{
  1247. if(_ac.gesture.length>3){
  1248. alert($lang("mou_gesture_too_long"));
  1249. return;
  1250. }
  1251. if(_ac.gesture.substr(_ac.gesture.length-1,1)==_ab){
  1252. alert($lang("mou_no_double_direction"));
  1253. return;
  1254. }
  1255. _ac.gesture+=_ab;
  1256. }
  1257. maxTable.ui.updateRow(mouseTable,mouseTable.inEditDataIndex);
  1258. };
  1259. maxOptions.pages.mouse.gesture.setAction=function(){
  1260. var _ad=external.max_invoke("SelCommand");
  1261. if(!_ad){
  1262. return;
  1263. }
  1264. var _ae=_ad.split("$,$");
  1265. var _af=mouseTable.data[mouseTable.inEditDataIndex];
  1266. _af.actionType=_ae[0];
  1267. _af.actionID=_ae[1];
  1268. _af.action=_ae[2];
  1269. maxTable.ui.updateRow(mouseTable,mouseTable.inEditDataIndex);
  1270. };
  1271. maxOptions.pages.mouse.gesture.restoreToDefault=function(){
  1272. if(confirm($lang("confirm_restore_default"))){
  1273. external.max_invoke("DefaultConfig","Gesture");
  1274. maxConfig.init();
  1275. }
  1276. };
  1277. maxOptions.pages.safety.init=function(){
  1278. maxOptions.pages.safety.patch.init();
  1279. };
  1280. maxOptions.pages.safety.destroy=function(){
  1281. try{
  1282. maxTable.destroy(patchTable);
  1283. }
  1284. catch(e){
  1285. }
  1286. };
  1287. maxOptions.pages.safety.patch={};
  1288. maxOptions.pages.safety.patch.init=function(){
  1289. patchTable=maxTable.create("patchTable");
  1290. patchTable.columns=[{title:" ",name:"enabled",type:"checkbox",width:18},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.safety.patch.buildHTML,readOnly:true}];
  1291. patchTable.dataType="object";
  1292. patchTable.data=maxOptions.pages.safety.patch.loadList();
  1293. patchTable.allowInsert=false;
  1294. patchTable.showEditControl=false;
  1295. patchTable.style["edit"]="";
  1296. patchTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  1297. patchTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  1298. patchTable.event["beforeCheckboxClick"]=maxOptions.pages.safety.patch.confirmToggle;
  1299. patchTable.event["afterCheckboxClick"]=maxOptions.pages.safety.patch.toggleItem;
  1300. maxTable.init(patchTable);
  1301. };
  1302. maxOptions.pages.safety.patch.getFilePath=function(){
  1303. return external.max_invoke("getPath","patch");
  1304. };
  1305. maxOptions.pages.safety.patch.loadList=function(){
  1306. var _b0={"namespace":"","validate":"/m2filter[@version=\"1.0\"]","items":"//group","attributes":{"title":"@name","importance":"@importance","enabled":"@enable","description":"@description"}};
  1307. var _b1=maxXmlListParser.parseFile(maxOptions.pages.safety.patch.getFilePath(),_b0);
  1308. if(_b1==null){
  1309. return [];
  1310. }else{
  1311. for(var i=0;i<_b1.length;i++){
  1312. _b1[i].enabled=_b1[i].enabled=="1"?true:false;
  1313. }
  1314. }
  1315. return _b1;
  1316. };
  1317. maxOptions.pages.safety.patch.buildHTML=function(_b3,_b4){
  1318. var _b5=patchTable.data[_b3];
  1319. var _b6="";
  1320. _b6+="<strong>";
  1321. switch(_b5.importance){
  1322. case "1":
  1323. _b6+="<img src=\"images/defcon_low.png\" />";
  1324. break;
  1325. case "2":
  1326. _b6+="<img src=\"images/defcon_med.png\" />";
  1327. break;
  1328. case "3":
  1329. _b6+="<img src=\"images/defcon_high.png\" />";
  1330. break;
  1331. }
  1332. _b6+="  "+_b5.title.$encodeHTML()+"</strong>";
  1333. if(patchTable.inAction=="edit"&&_b5.description){
  1334. _b6+="<div class=\"item-description\">"+_b5.description+"</div>";
  1335. }
  1336. return _b6;
  1337. };
  1338. maxOptions.pages.safety.patch.confirmToggle=function(_b7,_b8){
  1339. var _b9=patchTable.data[_b7];
  1340. if(_b9.enabled){
  1341. if(!confirm($lang("saf_disable_confirm"))){
  1342. return false;
  1343. }
  1344. }
  1345. return true;
  1346. };
  1347. maxOptions.pages.safety.patch.toggleItem=function(_ba,_bb){
  1348. var _bc=patchTable.data[_ba];
  1349. var _bd={"xml":maxOptions.pages.safety.patch.getFilePath(),"isFile":true,"save":true,"xpath":"//group[@name=\""+_bc.title.replace(/\"/ig,""")+"\"]/@enable","value":_bc.enabled?"1":"0"};
  1350. maxXmlListParser.updateItem(_bd);
  1351. };
  1352. maxOptions.pages.advanced.init=function(){
  1353. maxOptions.pages.advanced.buildUserAgentList();
  1354. maxOptions.pages.advanced.checkIE7();
  1355. maxOptions.pages.advanced.checkVista();
  1356. maxOptions.pages.advanced.checkUserAgent();
  1357. var obj=$id("adv_accelerator");
  1358. obj.attachEvent("onclick",maxOptions.pages.advanced.checkFlashBackForward);
  1359. obj=$id("adv_custom_ua");
  1360. obj.attachEvent("onclick",maxOptions.pages.advanced.checkUserAgent);
  1361. maxOptions.pages.advanced.checkFlashBackForward();
  1362. };
  1363. maxOptions.pages.advanced.checkIE7=function(){
  1364. if(navigator.userAgent.indexOf("MSIE 7")<0){
  1365. maxConfig.ui.disableItem("adv_ie7_zoom");
  1366. }
  1367. };
  1368. maxOptions.pages.advanced.checkVista=function(){
  1369. if(navigator.userAgent.indexOf("Windows NT 6")<0){
  1370. maxConfig.ui.disableItem("adv_vista_glass");
  1371. }
  1372. };
  1373. maxOptions.pages.advanced.checkUserAgent=function(){
  1374. var obj=$id("adv_custom_ua");
  1375. var _c0=$id("adv_useragent");
  1376. var _c1=$id("adv_ua_list");
  1377. if(obj.checked){
  1378. _c0.disabled=false;
  1379. _c1.disabled=false;
  1380. }else{
  1381. _c0.disabled=true;
  1382. _c1.disabled=true;
  1383. }
  1384. };
  1385. maxOptions.pages.advanced.editBoostList=function(){
  1386. maxOptions.action.applyChanges();
  1387. external.max_invoke("MxBoostEditDialog");
  1388. };
  1389. maxOptions.pages.advanced.editSuperMSAList=function(){
  1390. maxOptions.action.applyChanges();
  1391. external.max_invoke("SuperMSASiteDialog");
  1392. };
  1393. maxOptions.pages.advanced.checkFlashBackForward=function(){
  1394. var _c2=$id("adv_accelerator");
  1395. var _c3=$id("adv_flash_back_forward");
  1396. if(_c2.checked){
  1397. _c3.disabled=false;
  1398. }else{
  1399. _c3.disabled=true;
  1400. }
  1401. };
  1402. maxOptions.pages.advanced.uaList=[["Internet Explorer 7.0","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"],["Internet Explorer 6.0","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"],["Firefox 2.0","Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070309 Firefox/2.0.0.3"],["Opera 9.0","Opera/9.20 (Windows NT 5.1; U)"],["Safari 2.0","Mozilla/5.0 (Macintosh; U; PPC Mac OS X) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3"],["Nokia N90","NokiaN90-1/3.0545.5.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1"],["Motorola RAZR V3r","MOT-V3r/08.BD.43R MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1"],["BlackBerry 7100i","BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103"]];
  1403. maxOptions.pages.advanced.buildUserAgentList=function(){
  1404. var _c4="";
  1405. _c4+="<option value=\"\"> ["+$lang("adv_predefined_ua")+"] </option>";
  1406. for(var i=0;i<maxOptions.pages.advanced.uaList.length;i++){
  1407. var _c6=maxOptions.pages.advanced.uaList[i];
  1408. _c4+="<option value=\""+i+"\"> "+_c6[0].$encodeHTML()+" </option>";
  1409. }
  1410. _c4="<select id=\"adv_ua_list\" onchange=\"maxOptions.pages.advanced.setCustomUserAgent()\">"+_c4+"</select>";
  1411. $write(_c4,"adv_ua_list_wrapper");
  1412. };
  1413. maxOptions.pages.advanced.setCustomUserAgent=function(){
  1414. var _c7=$id("adv_useragent");
  1415. var _c8=$id("adv_ua_list");
  1416. var _c9=_c8.selectedIndex-1;
  1417. _c7.value=maxOptions.pages.advanced.uaList[_c9][1];
  1418. _c7.fireEvent("onchange");
  1419. _c8.selectedIndex=0;
  1420. };
  1421. maxOptions.pages.skin.init=function(){
  1422. skinTable=maxTable.create("skinTable");
  1423. skinTable.columns=[{title:" ",name:"enabled",type:"radio",width:18},{title:" ",name:"preview",type:"custom",customBuilder:maxOptions.pages.skin.buildPreviewHTML,width:220},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.skin.buildDescriptionHTML}];
  1424. skinTable.dataType="object";
  1425. skinTable.data=maxConfig.res.load("skin");
  1426. skinTable.separatorType="line";
  1427. skinTable.allowInsert=false;
  1428. skinTable.showEditControl=false;
  1429. skinTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"cancel"}];
  1430. skinTable.controlUI["delete"]=$lang("delete");
  1431. skinTable.controlUI["cancel"]=$lang("cancel");
  1432. skinTable.controlUI["radio"]="<img src=\"../_shared/images/btn_radio.png\" />";
  1433. skinTable.controlUI["radio_checked"]="<img src=\"../_shared/images/btn_radio_checked.png\" />";
  1434. skinTable.style["edit"]="maxTable-edit-no-control";
  1435. skinTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1436. skinTable.event["afterRadioClick"]=maxOptions.pages.skin.setSkin;
  1437. skinTable.event["afterDelete"]=maxOptions.pages.skin.deleteItem;
  1438. maxTable.init(skinTable);
  1439. setTimeout("maxOptions.pages.skin.forceRemoteImage()",500);
  1440. };
  1441. maxOptions.pages.skin.destroy=function(){
  1442. try{
  1443. maxTable.destroy(skinTable);
  1444. }
  1445. catch(e){
  1446. }
  1447. };
  1448. maxOptions.pages.skin.forceRemoteImage=function(){
  1449. var _ca=$id(skinTable.id);
  1450. try{
  1451. for(var i=1;i<_ca.rows.length;i++){
  1452. var _cc=_ca.rows[i].cells[1].firstChild.firstChild;
  1453. if(!_cc.complete||_cc.fileSize<0){
  1454. var src=_cc.src;
  1455. _cc.style.display="none";
  1456. _cc.src=src;
  1457. _cc.style.display="block";
  1458. }
  1459. }
  1460. }
  1461. catch(e){
  1462. }
  1463. };
  1464. maxOptions.pages.skin.buildPreviewHTML=function(_ce,_cf){
  1465. if(skinTable.inAction=="init"){
  1466. var _d0=skinTable.data[_ce];
  1467. var _d1="";
  1468. _d1+="<div class=\"item-preview\" style=\"height: 64px;\">";
  1469. if(_d0.preview){
  1470. _d1+="<img src=\"file:///"+_d0.preview+"\" />";
  1471. }else{
  1472. _d1+=" ";
  1473. }
  1474. _d1+="</div>";
  1475. return _d1;
  1476. }else{
  1477. var _d2=$id(skinTable.id);
  1478. if(skinTable.inAction=="edit"){
  1479. _d2.rows[_ce+1].cells[_cf].firstChild.style.height="220px";
  1480. }else{
  1481. _d2.rows[_ce+1].cells[_cf].firstChild.style.height="64px";
  1482. }
  1483. return null;
  1484. }
  1485. };
  1486. maxOptions.pages.skin.buildDescriptionHTML=function(_d3,_d4){
  1487. var _d5=skinTable.data[_d3];
  1488. var _d6="";
  1489. _d6+="<strong>"+_d5.title.$encodeHTML()+"</strong>";
  1490. _d6+="<br/><span class=\"item-note\">"+$lang("version")+": "+_d5.version.$encodeHTML()+"   "+$lang("author")+": "+_d5.author.$encodeHTML()+"    <"+_d5.path.$encodeHTML()+">"+"</span>";
  1491. if(skinTable.inAction=="edit"){
  1492. if(_d5.description){
  1493. _d6+="<div class=\"item-description\">"+_d5.description+"</div>";
  1494. }
  1495. _d6+="<p>"+"<a href=\"javascript:;\" onclick=\"maxTable.action.radioClick(skinTable, skinTable.inEditRow, 0);\">"+$lang("apply")+"</a> | "+(_d5.supportURL?"<a href=\""+_d5.supportURL+"\" target=\"_blank\">"+$lang("visit_website")+"</a> | ":"")+maxTable.ui.buildEditControls(skinTable)+"</p>";
  1496. }
  1497. _d6+="</div>";
  1498. return _d6;
  1499. };
  1500. maxOptions.pages.skin.setSkin=function(_d7,_d8,_d9){
  1501. var _da=skinTable.data[_d8];
  1502. external.max_doResItem("skin","enable",_da.path);
  1503. maxConfig.ini.setValue("Settings","Skin",_da.path);
  1504. maxOptions.action.applyChanges();
  1505. };
  1506. maxOptions.pages.skin.exportItem=function(){
  1507. var _db=skinTable.data[skinTable.inEditDataIndex];
  1508. external.max_doResItem("skin","export",_db.path);
  1509. };
  1510. maxOptions.pages.skin.deleteItem=function(_dc){
  1511. if(_dc.enabled){
  1512. alert($lang("can_not_delete_in_use"));
  1513. return false;
  1514. }
  1515. var _dd=external.max_doResItem("skin","delete",_dc.path);
  1516. if(!_dd){
  1517. alert($lang("delete_failed"));
  1518. return false;
  1519. }
  1520. return true;
  1521. };
  1522. maxOptions.pages.plugin.init=function(){
  1523. pluginTable=maxTable.create("pluginTable");
  1524. pluginTable.columns=[{title:" ",name:"enabled",type:"checkbox",width:18,required:false},{title:" ",name:"autoStart",type:"checkbox",customUI:{"unchecked":"<img src=\"../_shared/images/btn_autorun.png\" alt=\""+$lang("autostart")+"\" />","checked":"<img src=\"../_shared/images/btn_autorun_checked.png\" alt=\""+$lang("autostart")+"\" />"},width:18,required:false},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.plugin.buildDescriptionHTML,readOnly:true}];
  1525. pluginTable.dataType="object";
  1526. pluginTable.data=maxConfig.res.load("plugin");
  1527. pluginTable.allowInsert=false;
  1528. pluginTable.showEditControl=false;
  1529. pluginTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"cancel"}];
  1530. pluginTable.controlUI["delete"]=$lang("delete");
  1531. pluginTable.controlUI["cancel"]=$lang("cancel");
  1532. pluginTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  1533. pluginTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  1534. pluginTable.style["edit"]="maxTable-edit-no-control";
  1535. pluginTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1536. pluginTable.event["beforeCheckboxClick"]=maxOptions.pages.plugin.beforeToggleItem;
  1537. pluginTable.event["afterCheckboxClick"]=maxOptions.pages.plugin.toggleItem;
  1538. pluginTable.event["afterDelete"]=maxOptions.pages.plugin.deleteItem;
  1539. maxTable.init(pluginTable);
  1540. };
  1541. maxOptions.pages.plugin.destroy=function(){
  1542. try{
  1543. maxTable.destroy(pluginTable);
  1544. }
  1545. catch(e){
  1546. }
  1547. };
  1548. maxOptions.pages.plugin.buildDescriptionHTML=function(_de,_df){
  1549. var _e0=pluginTable.data[_de];
  1550. var _e1="";
  1551. _e1+="<strong>"+_e0.title.$encodeHTML()+"</strong>";
  1552. _e1+="<br/><span class=\"item-note\">"+$lang("version")+": "+_e0.version.$encodeHTML()+"   "+$lang("author")+": "+_e0.author.$encodeHTML()+"   <"+_e0.path.$encodeHTML()+">"+"</span>";
  1553. if(pluginTable.inAction=="edit"){
  1554. if(_e0.description){
  1555. _e1+="<div class=\"item-description\">"+_e0.description+"</div>";
  1556. }
  1557. var _e2=!_e0.enabled?$lang("enable"):$lang("disable");
  1558. _e1+="<p>"+"<a href=\"javascript:;\" onclick=\"maxTable.action.checkBoxClick(pluginTable, pluginTable.inEditRow, 0);\">"+_e2+"</a> | "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.plugin.configItem()\">"+$lang("options")+"</a> | "+(_e0.supportURL?"<a href=\""+_e0.supportURL+"\" target=\"_blank\">"+$lang("visit_website")+"</a> | ":"")+maxTable.ui.buildEditControls(pluginTable)+"</p>";
  1559. }
  1560. return _e1;
  1561. };
  1562. maxOptions.pages.plugin.toggleAllItems=function(_e3){
  1563. var _e4=_e3?"enable":"disable";
  1564. for(var i=0;i<pluginTable.data.length;i++){
  1565. pluginTable.data[i].enabled=_e3;
  1566. external.max_doResItem("plugin",_e4,pluginTable.data[i].path);
  1567. }
  1568. maxTable.init(pluginTable);
  1569. };
  1570. maxOptions.pages.plugin.beforeToggleItem=function(_e6,_e7){
  1571. if(_e7==1){
  1572. var _e8=pluginTable.data[_e6];
  1573. if(!_e8.canAutoStart&&!_e8.autoStart){
  1574. if(!confirm($lang("plugin_force_autostart"))){
  1575. return false;
  1576. }
  1577. }
  1578. }
  1579. return true;
  1580. };
  1581. maxOptions.pages.plugin.toggleItem=function(_e9,_ea){
  1582. var _eb=pluginTable.data[_e9];
  1583. var _ec="";
  1584. if(_ea==0){
  1585. _ec=_eb.enabled?"enable":"disable";
  1586. }else{
  1587. _ec=_eb.autoStart?"enable_autostart":"disable_autostart";
  1588. }
  1589. external.max_doResItem("plugin",_ec,_eb.path);
  1590. };
  1591. maxOptions.pages.plugin.configItem=function(){
  1592. var _ed=pluginTable.data[pluginTable.inEditDataIndex];
  1593. external.max_doResItem("plugin","config",_ed.path);
  1594. };
  1595. maxOptions.pages.plugin.exportItem=function(){
  1596. var _ee=pluginTable.data[pluginTable.inEditDataIndex];
  1597. external.max_doResItem("plugin","export",_ee.path);
  1598. };
  1599. maxOptions.pages.plugin.deleteItem=function(_ef){
  1600. external.max_doResItem("plugin","disable",_ef.path);
  1601. var _f0=external.max_doResItem("plugin","delete",_ef.path);
  1602. if(!_f0){
  1603. alert($lang("delete_failed"));
  1604. return false;
  1605. }
  1606. return true;
  1607. };
  1608. maxOptions.pages.filter.init=function(){
  1609. filterTable=maxTable.create("filterTable");
  1610. filterTable.columns=[{title:" ",name:"enabled",type:"checkbox",width:18},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.filter.buildDescriptionHTML,readOnly:true}];
  1611. filterTable.dataType="object";
  1612. filterTable.data=maxConfig.res.load("filter");
  1613. filterTable.allowInsert=false;
  1614. filterTable.showEditControl=false;
  1615. filterTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"cancel"}];
  1616. filterTable.controlUI["delete"]=$lang("delete");
  1617. filterTable.controlUI["cancel"]=$lang("cancel");
  1618. filterTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  1619. filterTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  1620. filterTable.style["edit"]="maxTable-edit-no-control";
  1621. filterTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1622. filterTable.event["afterCheckboxClick"]=maxOptions.pages.filter.toggleItem;
  1623. filterTable.event["afterDelete"]=maxOptions.pages.filter.deleteItem;
  1624. maxTable.init(filterTable);
  1625. };
  1626. maxOptions.pages.filter.destroy=function(){
  1627. try{
  1628. maxTable.destroy(filterTable);
  1629. }
  1630. catch(e){
  1631. }
  1632. };
  1633. maxOptions.pages.filter.buildDescriptionHTML=function(_f1,_f2){
  1634. var _f3=filterTable.data[_f1];
  1635. var _f4="";
  1636. if(!_f3.parseError){
  1637. _f4+="<strong>"+_f3.title.$encodeHTML()+"</strong>";
  1638. _f4+="<br/><span class=\"item-note\">"+$lang("version")+": "+_f3.version.$encodeHTML()+"   "+$lang("author")+": "+_f3.author.$encodeHTML()+"   <"+_f3.path.$encodeHTML()+">"+"</span>";
  1639. }else{
  1640. _f4+="<strong style=\"color: #CC0000;\"><"+_f3.path.$encodeHTML()+"></strong>";
  1641. _f4+="<br/><span style=\"color: #CC0000;\">"+$lang("parse_error")+"</span>";
  1642. }
  1643. if(filterTable.inAction=="edit"){
  1644. if(_f3.description){
  1645. _f4+="<div class=\"item-description\">"+_f3.description+"</div>";
  1646. }
  1647. var _f5=!_f3.enabled?$lang("enable"):$lang("disable");
  1648. _f4+="<p>"+"<a href=\"javascript:;\" onclick=\"maxTable.action.checkBoxClick(filterTable, filterTable.inEditRow, 0);\">"+_f5+"</a> | "+(_f3.supportURL?"<a href=\""+_f3.supportURL+"\" target=\"_blank\">"+$lang("visit_website")+"</a> | ":"")+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.filter.editItem();\">"+$lang("edit")+"</a> | "+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.filter.exportItem();\">"+$lang("export")+"</a> | "+maxTable.ui.buildEditControls(filterTable)+"</p>";
  1649. }
  1650. return _f4;
  1651. };
  1652. maxOptions.pages.filter.toggleAllItems=function(_f6){
  1653. var _f7=_f6?"enable":"disable";
  1654. for(var i=0;i<filterTable.data.length;i++){
  1655. filterTable.data[i].enabled=_f6;
  1656. external.max_doResItem("filter",_f7,filterTable.data[i].path);
  1657. }
  1658. maxTable.init(filterTable);
  1659. };
  1660. maxOptions.pages.filter.toggleItem=function(_f9,_fa){
  1661. var _fb=filterTable.data[_f9];
  1662. var _fc=_fb.enabled?"enable":"disable";
  1663. external.max_doResItem("filter",_fc,_fb.path);
  1664. };
  1665. maxOptions.pages.filter.addItem=function(){
  1666. var _fd=prompt($lang("input_filename"),"");
  1667. if(_fd==null){
  1668. return;
  1669. }
  1670. if(_fd==""){
  1671. alert($lang("invalid_filename"));
  1672. return;
  1673. }
  1674. if(!external.max_doResItem("filter","new",_fd)){
  1675. alert($lang("invalid_filename"));
  1676. }else{
  1677. maxOptions.pages.filter.init();
  1678. }
  1679. };
  1680. maxOptions.pages.filter.editItem=function(){
  1681. var _fe=filterTable.data[filterTable.inEditDataIndex];
  1682. external.max_doResItem("filter","edit",_fe.path);
  1683. };
  1684. maxOptions.pages.filter.exportItem=function(){
  1685. var _ff=filterTable.data[filterTable.inEditDataIndex];
  1686. external.max_doResItem("filter","export",_ff.path);
  1687. };
  1688. maxOptions.pages.filter.deleteItem=function(_100){
  1689. var _101=external.max_doResItem("filter","delete",_100.path);
  1690. if(!_101){
  1691. alert($lang("delete_failed"));
  1692. return false;
  1693. }
  1694. return true;
  1695. };
  1696.  
  1697.