home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February / PCWorld_2008-02_cd.bin / komunikace / maxthon / mx_2.0.7.1245.exe / template / Options / maxOptions.config.js < prev    next >
Text File  |  2007-12-26  |  95KB  |  1,788 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"},{type:"html",html:"<div class=\"item indent\">"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.general.setDefaultBrowser(true);\">"+$lang("gen_default_browser")+"</a>"+"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.general.setDefaultBrowser(false);\">"+$lang("gen_un_default_browser")+"</a>"+"</div>"},{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:"none",html:$lang("su_page_none")},{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:"html",html:"<div id=\"downloaderList_wrapper\" class=\"item\"></div>"},{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_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"}]};
  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:"0"},{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_ime_patch",key:"IMEPatch",section:"Advanced",defaultValue:"1",pre:"<div class=\"indent\">",suf:" <span class=\"note\">"+$lang("require_restart")+"</span></div>"},{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_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_site_boost",key:"SiteBoost",section:"Advanced",defaultValue:"1",suf:"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.advanced.editBoostList()\">"+$lang("adv_site_boost_list")+"</a>   <span class=\"note\">"+$lang("require_restart")+"</span>"},{type:"checkbox",id:"adv_site_boost_auto_add",key:"AutoAddSiteBoost",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_ie7_zoom",key:"UseIE7Zoom",section:"Advanced",defaultValue:"1"},{type:"checkbox",id:"adv_popup_as_tab",key:"PopupAsTab",section:"Advanced",defaultValue:"0"},{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(_1){
  24. if(_1){
  25. if(confirm($lang("gen_confirm_default_browser"))){
  26. external.max_invoke("SetDefaultBrowser");
  27. }
  28. }else{
  29. if(confirm($lang("gen_confirm_un_default_browser"))){
  30. external.max_invoke("UnsetDefaultBrowser");
  31. }
  32. }
  33. };
  34. maxOptions.pages.startup.setHomePage=function(_2){
  35. var _3=$id("su_homepage");
  36. if(_3){
  37. _3.value=_2;
  38. _3.fireEvent("onchange");
  39. }else{
  40. alert("No object: su_homepage");
  41. }
  42. };
  43. maxOptions.pages.nav.init=function(){
  44. maxOptions.pages.nav.urlKey.init();
  45. maxOptions.pages.nav.urlAlias.init();
  46. };
  47. maxOptions.pages.nav.destroy=function(){
  48. try{
  49. maxTable.destroy(urlKeyTable);
  50. maxTable.destroy(urlAliasTable);
  51. maxTable.destroy(webServiceTable);
  52. }
  53. catch(e){
  54. }
  55. };
  56. maxOptions.pages.nav.urlKey={};
  57. maxOptions.pages.nav.urlKey.init=function(){
  58. urlKeyTable=maxTable.create("urlKeyTable");
  59. 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}];
  60. urlKeyTable.separatorType="none";
  61. urlKeyTable.defaultRowData=["F1",""];
  62. urlKeyTable.data=maxOptions.pages.nav.urlKey.loadList();
  63. urlKeyTable.editControl=[{type:"delete",hideOnNew:true},{type:"html",value:" | ",hideOnNew:true},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  64. urlKeyTable.controlUI["add"]=$lang("maxtable_new");
  65. urlKeyTable.controlUI["delete"]=$lang("delete");
  66. urlKeyTable.controlUI["save"]=$lang("save");
  67. urlKeyTable.controlUI["cancel"]=$lang("cancel");
  68. urlKeyTable.lang["require"]=$lang("maxtable_require_field");
  69. urlKeyTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  70. urlKeyTable.event["beforeAdd"]=maxOptions.pages.nav.urlKey.validateKey;
  71. urlKeyTable.event["afterAdd"]=maxOptions.pages.nav.urlKey.saveList;
  72. urlKeyTable.event["beforeUpdate"]=maxOptions.pages.nav.urlKey.validateKey;
  73. urlKeyTable.event["afterUpdate"]=maxOptions.pages.nav.urlKey.saveList;
  74. urlKeyTable.event["afterDelete"]=maxOptions.pages.nav.urlKey.saveList;
  75. maxTable.init(urlKeyTable);
  76. };
  77. maxOptions.pages.nav.urlKey.loadList=function(){
  78. var _4=maxConfig.ini.getArray("URLKey");
  79. _4.sort();
  80. for(var i=0;i<_4.length;i++){
  81. _4[i][1]=_4[i][1].replace(/\^\^/g,"\n");
  82. }
  83. return _4;
  84. };
  85. maxOptions.pages.nav.urlKey.saveList=function(){
  86. maxConfig.ini.deleteSection("URLKey");
  87. for(var i=0;i<urlKeyTable.data.length;i++){
  88. var _7=urlKeyTable.data[i][1].replace(/\n/g,"^^");
  89. _7=_7.replace(/\r/g,"");
  90. maxConfig.ini.setValue("URLKey",urlKeyTable.data[i][0],_7);
  91. }
  92. maxOptions.action.applyChanges();
  93. };
  94. maxOptions.pages.nav.urlKey.validateKey=function(){
  95. var _8=urlKeyTable.inEditResultData;
  96. if(_8[0]==""){
  97. alert($lang("key_blank_key"));
  98. return false;
  99. }
  100. for(var i=0;i<urlKeyTable.data.length;i++){
  101. if(_8[0]==urlKeyTable.data[i][0]&&urlKeyTable.inEditDataIndex!=i){
  102. alert($lang("key_duplicate_key"));
  103. return false;
  104. }
  105. }
  106. return true;
  107. };
  108. maxOptions.pages.nav.urlAlias={};
  109. maxOptions.pages.nav.urlAlias.init=function(){
  110. urlAliasTable=maxTable.create("urlAliasTable");
  111. urlAliasTable.columns=[{title:$lang("alias"),type:"text",width:200,required:true},{title:$lang("url"),type:"text",required:true}];
  112. urlAliasTable.separatorType="none";
  113. urlAliasTable.defaultRowData=[$lang("alias"),"http://"];
  114. urlAliasTable.data=maxOptions.pages.nav.urlAlias.loadList();
  115. urlAliasTable.editControl=[{type:"delete",hideOnNew:true},{type:"html",value:" | ",hideOnNew:true},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  116. urlAliasTable.controlUI["add"]=$lang("maxtable_new");
  117. urlAliasTable.controlUI["add_sep"]=$lang("maxtable_new_sep");
  118. urlAliasTable.controlUI["delete"]=$lang("delete");
  119. urlAliasTable.controlUI["save"]=$lang("save");
  120. urlAliasTable.controlUI["cancel"]=$lang("cancel");
  121. urlAliasTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  122. urlAliasTable.lang["require"]=$lang("maxtable_require_field");
  123. urlAliasTable.event["afterAdd"]=maxOptions.pages.nav.urlAlias.saveList;
  124. urlAliasTable.event["afterUpdate"]=maxOptions.pages.nav.urlAlias.saveList;
  125. urlAliasTable.event["afterDelete"]=maxOptions.pages.nav.urlAlias.saveList;
  126. urlAliasTable.event["afterRadioClick"]=maxOptions.pages.nav.urlAlias.saveList;
  127. maxTable.init(urlAliasTable);
  128. };
  129. maxOptions.pages.nav.urlAlias.loadList=function(){
  130. var _a=maxConfig.ini.getArray("URLAlias");
  131. _a.sort();
  132. return _a;
  133. };
  134. maxOptions.pages.nav.urlAlias.saveList=function(){
  135. maxConfig.ini.deleteSection("URLAlias");
  136. maxConfig.ini.setArray("URLAlias",urlAliasTable.data,false);
  137. maxOptions.action.applyChanges();
  138. };
  139. maxOptions.pages.nav.webService={};
  140. maxOptions.pages.nav.webService.init=function(){
  141. webServiceTable=maxTable.create("webServiceTable");
  142. webServiceTable.columns=[{title:$lang("title"),type:"text",width:200,required:true},{title:$lang("url"),type:"text",required:true}];
  143. webServiceTable.separatorType="line";
  144. webServiceTable.defaultRowData=[$lang("title"),"http://"];
  145. webServiceTable.data=maxConfig.ini.getArray("WebServices",true);
  146. webServiceTable.controlUI["add"]=$lang("maxtable_new");
  147. webServiceTable.controlUI["add_sep"]=$lang("maxtable_new_sep");
  148. webServiceTable.controlUI["delete"]=$lang("delete");
  149. webServiceTable.controlUI["save"]=$lang("save");
  150. webServiceTable.controlUI["cancel"]=$lang("cancel");
  151. webServiceTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  152. webServiceTable.lang["require"]=$lang("maxtable_require_field");
  153. webServiceTable.event["afterAdd"]=maxOptions.pages.nav.webService.saveList;
  154. webServiceTable.event["afterUpdate"]=maxOptions.pages.nav.webService.saveList;
  155. webServiceTable.event["afterDelete"]=maxOptions.pages.nav.webService.saveList;
  156. webServiceTable.event["afterRadioClick"]=maxOptions.pages.nav.webService.saveList;
  157. maxTable.init(webServiceTable);
  158. };
  159. maxOptions.pages.nav.webService.saveList=function(){
  160. maxConfig.ini.deleteSection("WebServices");
  161. maxConfig.ini.setArray("WebServices",webServiceTable.data,true);
  162. };
  163. maxOptions.pages.search.init=function(){
  164. maxOptions.pages.search.searchEngine.init();
  165. };
  166. maxOptions.pages.search.destroy=function(){
  167. try{
  168. maxTable.destroy(searchTable);
  169. }
  170. catch(e){
  171. }
  172. };
  173. maxOptions.pages.search.searchEngine={};
  174. maxOptions.pages.search.searchEngine.init=function(){
  175. searchTable=maxTable.create("searchTable");
  176. 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}];
  177. searchTable.separatorType="line";
  178. searchTable.defaultRowData=[false,$lang("title"),"","http://"];
  179. searchTable.data=maxConfig.ini.getArray("SearchEngines",true);
  180. maxOptions.pages.search.searchEngine.attachDefaultColumn();
  181. searchTable.controlUI["add"]=$lang("maxtable_new");
  182. searchTable.controlUI["add_sep"]=$lang("maxtable_new_sep");
  183. searchTable.controlUI["delete"]=$lang("delete");
  184. searchTable.controlUI["save"]=$lang("save");
  185. searchTable.controlUI["cancel"]=$lang("cancel");
  186. searchTable.controlUI["radio"]="<img src=\"../_shared/images/btn_radio.png\" alt=\""+$lang("srch_set_default")+"\" />";
  187. searchTable.controlUI["radio_checked"]="<img src=\"../_shared/images/btn_radio_checked.png\" alt=\""+$lang("srch_set_default")+"\" />";
  188. searchTable.controlUI["move_up"]="<img src=\"../_shared/images/btn_up.png\" />";
  189. searchTable.controlUI["move_down"]="<img src=\"../_shared/images/btn_down.png\" />";
  190. searchTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  191. searchTable.lang["require"]=$lang("maxtable_require_field");
  192. searchTable.event["afterAdd"]=maxOptions.pages.search.searchEngine.saveList;
  193. searchTable.event["afterUpdate"]=maxOptions.pages.search.searchEngine.saveList;
  194. searchTable.event["afterDelete"]=maxOptions.pages.search.searchEngine.saveList;
  195. searchTable.event["afterRadioClick"]=maxOptions.pages.search.searchEngine.saveList;
  196. maxTable.init(searchTable);
  197. };
  198. maxOptions.pages.search.searchEngine.attachDefaultColumn=function(){
  199. if(searchTable.data.length<1){
  200. return;
  201. }
  202. var _b=maxConfig.ini.getValue("Search","Default");
  203. if(_b==""){
  204. _b=searchTable.data[0].join("$,$");
  205. }
  206. for(var i=0;i<searchTable.data.length;i++){
  207. if(typeof (searchTable.data[i])!="string"){
  208. if(_b==searchTable.data[i].join("$,$")){
  209. searchTable.data[i].unshift("-",true);
  210. }else{
  211. searchTable.data[i].unshift("-",false);
  212. }
  213. searchTable.data[i].shift();
  214. }
  215. }
  216. };
  217. maxOptions.pages.search.searchEngine.detachDefaultColumn=function(){
  218. for(var i=0;i<searchTable.data.length;i++){
  219. if(typeof (searchTable.data[i])!="string"){
  220. if(searchTable.data[i][0]==true){
  221. searchTable.data[i].shift();
  222. maxConfig.ini.setValue("Search","Default",searchTable.data[i].join("$,$"));
  223. }else{
  224. searchTable.data[i].shift();
  225. }
  226. }
  227. }
  228. };
  229. maxOptions.pages.search.searchEngine.saveList=function(){
  230. maxOptions.pages.search.searchEngine.detachDefaultColumn();
  231. maxConfig.ini.deleteSection("SearchEngines");
  232. maxConfig.ini.setArray("SearchEngines",searchTable.data,true);
  233. maxOptions.pages.search.searchEngine.attachDefaultColumn();
  234. maxOptions.action.applyChanges();
  235. };
  236. maxOptions.pages.fav.init=function(){
  237. maxOptions.pages.fav.getFavRoot();
  238. };
  239. maxOptions.pages.fav.writeFavRoot=function(_e){
  240. _e=maxConfig.ui.folder.cutString(_e);
  241. $id("fav_bar_root").innerHTML=_e.$encodeHTML();
  242. };
  243. maxOptions.pages.fav.getFavRoot=function(){
  244. var _f=external.max_getObj(max_security_id,"FavManager");
  245. var _10=_f.toolbarRoot;
  246. if(_10==""){
  247. _10="ROOT";
  248. }
  249. maxOptions.pages.fav.writeFavRoot(_10);
  250. };
  251. maxOptions.pages.fav.setFavRoot=function(){
  252. var _11=external.max_invoke("SelFavFolder");
  253. if(_11!=0){
  254. var _12=external.max_getObj(max_security_id,"FavManager");
  255. _12.toolbarRoot=_11;
  256. maxOptions.pages.fav.writeFavRoot(_11);
  257. }
  258. };
  259. maxOptions.pages.form.init=function(){
  260. maxOptions.pages.form.checkIgnoreList();
  261. maxOptions.pages.form.profile.init();
  262. maxOptions.pages.form.profile.showSingleProfile();
  263. maxOptions.pages.form.savedForm.init();
  264. };
  265. maxOptions.pages.form.destroy=function(){
  266. try{
  267. maxTable.destroy(profileTable);
  268. maxTable.destroy(dataViewTable);
  269. maxTable.destroy(savedFormTable);
  270. }
  271. catch(e){
  272. }
  273. };
  274. maxOptions.pages.form.checkIgnoreList=function(){
  275. var obj=$id("btnCleanIgnoreList");
  276. var _14=maxConfig.ini.getArray("FormNotifyIgnore",false);
  277. if(_14.length<1){
  278. obj.style.display="none";
  279. }else{
  280. obj.style.display="inline";
  281. }
  282. };
  283. maxOptions.pages.form.cleanIgnoreList=function(){
  284. maxConfig.ini.deleteSection("FormNotifyIgnore");
  285. maxOptions.action.applyChanges();
  286. };
  287. maxOptions.pages.form.validatePassword=function(){
  288. if(!maxOptions.pages.form.passwordValidated){
  289. maxOptions.pages.form.passwordValidated=external.max_invoke("VerifyPassport");
  290. }
  291. return maxOptions.pages.form.passwordValidated;
  292. };
  293. maxOptions.pages.form.profile={};
  294. maxOptions.pages.form.profile.isNew=false;
  295. maxOptions.pages.form.profile.init=function(){
  296. profileTable=maxTable.create("profileTable");
  297. profileTable.columns=[{title:" ",name:"_default",type:"radio",width:18,required:false},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.form.profile.buildHTML}];
  298. profileTable.showEditControl=false;
  299. profileTable.allowInsert=true;
  300. profileTable.dataType="object";
  301. profileTable.defaultRowData=maxOptions.pages.form.profile.createProfileObject();
  302. profileTable.data=maxOptions.pages.form.profile.loadList();
  303. profileTable.editControl=[{type:"delete",hideOnNew:true},{type:"html",value:" | ",hideOnNew:true},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  304. profileTable.style["edit"]="maxTable-edit-no-control";
  305. profileTable.controlUI["add"]=$lang("maxtable_new");
  306. profileTable.controlUI["save"]=$lang("save");
  307. profileTable.controlUI["delete"]=$lang("delete");
  308. profileTable.controlUI["cancel"]=$lang("cancel");
  309. profileTable.controlUI["radio"]="<img src=\"../_shared/images/btn_radio.png\" />";
  310. profileTable.controlUI["radio_checked"]="<img src=\"../_shared/images/btn_radio_checked.png\" />";
  311. profileTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  312. profileTable.event["afterEdit"]=maxOptions.pages.form.profile.editTable.init;
  313. profileTable.event["beforeAdd"]=maxOptions.pages.form.profile.validateItem;
  314. profileTable.event["afterAdd"]=maxOptions.pages.form.profile.saveList;
  315. profileTable.event["beforeUpdate"]=maxOptions.pages.form.profile.validateItem;
  316. profileTable.event["afterUpdate"]=maxOptions.pages.form.profile.saveList;
  317. profileTable.event["afterDelete"]=maxOptions.pages.form.profile.saveList;
  318. profileTable.event["afterRadioClick"]=maxOptions.pages.form.profile.saveList;
  319. maxTable.init(profileTable);
  320. };
  321. maxOptions.pages.form.profile.createProfileObject=function(){
  322. 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};
  323. };
  324. maxOptions.pages.form.profile.loadList=function(){
  325. maxConfig.setActiveFile("$form");
  326. var _15=maxConfig.ini.getArray("profiles",false);
  327. maxConfig.setActiveFile("$main");
  328. if(_15.length>0){
  329. var _16=false;
  330. for(var i=0;i<_15.length;i++){
  331. _15[i]=maxOptions.pages.form.profile.parseItem(_15[i]);
  332. if(_15[i]._default==true){
  333. if(_16){
  334. _15[i]._default=false;
  335. }
  336. _16=true;
  337. }
  338. }
  339. if(!_16){
  340. _15[0]._default=true;
  341. }
  342. _15.sort(function(_18,_19){
  343. if(_18.title.length<_19.title.length){
  344. return -1;
  345. }
  346. if(_18.title.length>_19.title.length){
  347. return 1;
  348. }
  349. if(_18.title>_19.title){
  350. return -1;
  351. }
  352. if(_18.title==_19.title){
  353. return 0;
  354. }
  355. return 1;
  356. });
  357. }else{
  358. var _1a=maxOptions.pages.form.profile.createProfileObject();
  359. _1a.title=$lang("form_profile_default");
  360. _1a._default=true;
  361. _15.push(_1a);
  362. maxOptions.pages.form.profile.isNew=true;
  363. }
  364. return _15;
  365. };
  366. maxOptions.pages.form.profile.parseItem=function(_1b){
  367. var _1c=maxOptions.pages.form.profile.createProfileObject();
  368. _1c._default=_1b[0].indexOf("*")>-1?true:false;
  369. _1c.title=_1b[0].replace(/\*/g,"");
  370. for(var i=0;i<_1b.length;i++){
  371. var _1e=_1b[i].split("$:$");
  372. if(_1e.length==2){
  373. _1c[_1e[0]]=_1e[1];
  374. }
  375. }
  376. return _1c;
  377. };
  378. maxOptions.pages.form.profile.saveList=function(){
  379. maxConfig.setActiveFile("$form");
  380. maxConfig.ini.deleteSection("profiles");
  381. if(profileTable.data.length==0){
  382. profileTable.data=maxOptions.pages.form.profile.loadList();
  383. maxTable.init(profileTable);
  384. return;
  385. }
  386. for(var i=0;i<profileTable.data.length;i++){
  387. var _20=profileTable.data[i];
  388. var _21=[];
  389. for(var key in _20){
  390. if(key=="_default"||key=="title"){
  391. continue;
  392. }
  393. _21.push(key+"$:$"+_20[key]);
  394. }
  395. _21=_21.join("$,$");
  396. maxConfig.ini.setValue("profiles",_20.title+(_20._default?"*":""),_21);
  397. }
  398. maxOptions.action.applyChanges();
  399. maxConfig.setActiveFile("$main");
  400. };
  401. maxOptions.pages.form.profile.buildHTML=function(_23,_24){
  402. var _25=profileTable.data[_23];
  403. var _26="";
  404. if(profileTable.inAction=="edit"||profileTable.inAction=="add"){
  405. _26+="<div id=\"profile_editTable\"></div>";
  406. }else{
  407. _26+="<strong>"+_25.title.$encodeHTML()+"</strong>"+"<br/><span class=\"item-note\">"+(_25.username+" <"+_25.email+">").$encodeHTML()+"</span>";
  408. }
  409. return _26;
  410. };
  411. maxOptions.pages.form.profile.validateItem=function(){
  412. var _27=profileTable.data[profileTable.inEditDataIndex];
  413. if(_27.title==""){
  414. alert($lang("form_blank_title"));
  415. return false;
  416. }
  417. for(var i=0;i<profileTable.length;i++){
  418. if(profileTable[i].title==_27.title&&i!=profileTable.inEditDataIndex){
  419. alert($lang("form_duplicate_title"));
  420. return false;
  421. }
  422. }
  423. return true;
  424. };
  425. maxOptions.pages.form.profile.showSingleProfile=function(){
  426. if(!maxOptions.pages.form.profile.isNew){
  427. return;
  428. }
  429. var _29=$id(profileTable.id);
  430. if(_29){
  431. _29=_29.rows(1);
  432. }
  433. if(_29){
  434. maxTable.action.editRow(profileTable,_29);
  435. }
  436. };
  437. maxOptions.pages.form.profile.editTable={};
  438. maxOptions.pages.form.profile.editTable.init=function(){
  439. maxOptions.pages.form.profile.editTable.buildHTML();
  440. var _2a=profileTable.data[profileTable.inEditDataIndex];
  441. for(var key in _2a){
  442. maxOptions.pages.form.profile.editTable.bindData(key,_2a[key]);
  443. }
  444. };
  445. maxOptions.pages.form.profile.editTable.buildHTML=function(){
  446. var _2c="";
  447. for(var i=-12;i<13;i++){
  448. _2c+="<option value=\""+i+"\">GMT "+(i==0?"":(i>0?"+"+i:i))+"</option>";
  449. }
  450. var _2e="";
  451. _2e+="<p>"+"<strong>"+$lang("title")+":</strong>"+"   <input type=\"text\" name=\"profile_title\" maxlength=\"255\" class=\"text\" style=\"width: 50%\" />"+"</p>";
  452. _2e+="<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\">"+_2c+"</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>";
  453. _2e+="<br/>"+maxTable.ui.buildEditControls(profileTable)+"<br/>";
  454. var obj=$id("profile_editTable");
  455. if(obj){
  456. obj.innerHTML=_2e+"<br/>";
  457. }
  458. };
  459. maxOptions.pages.form.profile.editTable.updateBirthDayList=function(){
  460. var _30=[31,28,31,30,31,30,31,31,30,31,30,31];
  461. var obj=document.getElementsByName("profile_birth_month");
  462. var _32=parseInt(obj[0].value,10);
  463. if(_32==2){
  464. obj=document.getElementsByName("profile_birth_year");
  465. var _33=parseInt(obj[0].value,10);
  466. if(_33!=NaN){
  467. if((_33%4==0&&_33%100!=0)||(_33%100==0&&(_33/100)%4==0)){
  468. _30[1]=29;
  469. }
  470. }
  471. }
  472. var _34=_30[_32-1];
  473. obj=document.getElementsByName("profile_birth_day");
  474. obj=obj[0];
  475. obj.innerHTML="";
  476. for(var i=1;i<=_34;i++){
  477. var opt=document.createElement("option");
  478. var _37=document.createTextNode(i);
  479. opt.appendChild(_37);
  480. opt.setAttribute("value",i);
  481. obj.appendChild(opt);
  482. }
  483. };
  484. maxOptions.pages.form.profile.editTable.bindData=function(key,_39){
  485. var _3a=document.getElementsByName("profile_"+key);
  486. if(!_3a[0]){
  487. return;
  488. }
  489. if(_3a[0].type=="text"||_3a[0].type=="password"){
  490. _3a[0].value=_39;
  491. _3a[0].attachEvent("onchange",function(){
  492. return maxOptions.pages.form.profile.editTable.updateItem(key);
  493. });
  494. }else{
  495. if(_3a[0].type=="select-one"){
  496. for(var i=0;i<_3a[0].length;i++){
  497. if(_3a[0][i].value==_39){
  498. _3a[0].selectedIndex=i;
  499. }
  500. }
  501. _3a[0].attachEvent("onchange",function(){
  502. return maxOptions.pages.form.profile.editTable.updateItem(key);
  503. });
  504. if(_3a[0].name=="profile_birth_month"){
  505. maxOptions.pages.form.profile.editTable.updateBirthDayList();
  506. }
  507. }else{
  508. if(_3a[0].type=="radio"){
  509. for(var i=0;i<_3a.length;i++){
  510. if(_3a[i].value==_39){
  511. _3a[i].checked=true;
  512. }
  513. _3a[i].attachEvent("onclick",function(){
  514. return maxOptions.pages.form.profile.editTable.updateItem(key);
  515. });
  516. }
  517. }
  518. }
  519. }
  520. };
  521. maxOptions.pages.form.profile.editTable.updateItem=function(key){
  522. var _3d=document.getElementsByName("profile_"+key);
  523. if(!_3d[0]){
  524. return;
  525. }
  526. var _3e="";
  527. if(_3d[0].type=="text"||_3d[0].type=="password"||_3d[0].type=="select-one"){
  528. _3e=_3d[0].value;
  529. }else{
  530. if(_3d[0].type=="radio"){
  531. for(var i=0;i<_3d.length;i++){
  532. if(_3d[i].checked){
  533. _3e=_3d[i].value;
  534. }
  535. }
  536. }
  537. }
  538. var _40=profileTable.data[profileTable.inEditDataIndex];
  539. _40[key]=_3e;
  540. };
  541. maxOptions.pages.form.profile.editTable.togglePasswordInput=function(_41){
  542. var obj=$id("profile_password");
  543. if(!obj){
  544. return;
  545. }
  546. if(_41==undefined){
  547. _41=obj.type=="text"?false:true;
  548. }
  549. if(_41&&!maxOptions.pages.form.validatePassword()){
  550. return;
  551. }
  552. var _43=document.createElement("INPUT");
  553. _43.type=_41?"text":"password";
  554. _43.value=obj.value;
  555. _43.id=obj.id;
  556. _43.name=obj.name;
  557. _43.className=obj.className;
  558. _43.style.width=obj.style.width;
  559. obj.replaceNode(_43);
  560. obj=$id("profile_password");
  561. if(_41){
  562. obj.focus();
  563. obj.onchange=function(){
  564. maxOptions.pages.form.profile.editTable.updateItem("password");
  565. };
  566. obj.onblur=function(){
  567. maxOptions.pages.form.profile.editTable.togglePasswordInput(false);
  568. };
  569. }
  570. };
  571. maxOptions.pages.form.savedForm={};
  572. maxOptions.pages.form.savedForm.init=function(){
  573. savedFormTable=maxTable.create("savedFormTable");
  574. 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}];
  575. savedFormTable.showControl=false;
  576. savedFormTable.showEditControl=false;
  577. savedFormTable.allowInsert=false;
  578. savedFormTable.dataType="object";
  579. savedFormTable.data=maxOptions.pages.form.savedForm.loadList();
  580. savedFormTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  581. savedFormTable.style["edit"]="maxTable-edit-no-control";
  582. savedFormTable.controlUI["delete"]=$lang("delete");
  583. savedFormTable.controlUI["save"]=$lang("save");
  584. savedFormTable.controlUI["cancel"]=$lang("cancel");
  585. savedFormTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  586. savedFormTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  587. savedFormTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  588. savedFormTable.event["afterCheckboxClick"]=maxOptions.pages.form.savedForm.toggleOnMenu;
  589. savedFormTable.event["afterDelete"]=maxOptions.pages.form.savedForm.deleteItem;
  590. savedFormTable.event["afterEdit"]=maxOptions.pages.form.savedForm.showDataView;
  591. savedFormTable.event["beforeUpdate"]=maxOptions.pages.form.savedForm.updateItem;
  592. savedFormTable.event["beforeCancel"]=maxOptions.pages.form.savedForm.hideDataView;
  593. maxTable.init(savedFormTable);
  594. maxOptions.pages.form.savedForm.dataView.init();
  595. };
  596. maxOptions.pages.form.savedForm.loadList=function(){
  597. maxConfig.setActiveFile("$form");
  598. var _44=maxConfig.ini.getArray("savedlist",false);
  599. maxConfig.setActiveFile("$main");
  600. var _45=[];
  601. for(var i=0;i<_44.length;i++){
  602. var _47={};
  603. _47.id=_44[i][0];
  604. _47.urlMD5=_44[i][0].substr(0,_44[i][0].indexOf("|"));
  605. _47.title=_44[i][0].substr(_44[i][0].indexOf("|")+1,_44[i][0].length);
  606. _47.url=_44[i][1];
  607. _47.showOnMenu=_44[i][2]?(_44[i][2]=="1"?true:false):false;
  608. if(!_44[i][3]){
  609. _44[i][3]=_47.url;
  610. }
  611. _47.matchURL=_44[i][3];
  612. _45.push(_47);
  613. }
  614. _45.$sort("title");
  615. return _45;
  616. };
  617. maxOptions.pages.form.savedForm.toggleOnMenu=function(_48,_49){
  618. var _4a=savedFormTable.data[_48];
  619. var _4b=_4a.url+"$,$"+(_4a.showOnMenu?"1":"0")+"$,$"+_4a.matchURL;
  620. maxConfig.setActiveFile("$form");
  621. maxConfig.ini.setValue("savedlist",_4a.id,_4b);
  622. maxOptions.action.applyChanges();
  623. maxConfig.setActiveFile("$main");
  624. };
  625. maxOptions.pages.form.savedForm.updateItem=function(){
  626. var _4c=savedFormTable.inEditResultData;
  627. var obj=$id("saved_title");
  628. if(!obj){
  629. return true;
  630. }
  631. _4c.title=obj.value.$trim();
  632. _4c.id=_4c.urlMD5+"|"+_4c.title;
  633. if(_4c.title==""){
  634. alert($lang("form_blank_title"));
  635. return false;
  636. }
  637. for(var i=0;i<savedFormTable.data.length;i++){
  638. if(_4c.id==savedFormTable.data[i].id&&savedFormTable.inEditDataIndex!=i){
  639. alert($lang("form_duplicate_title"));
  640. return false;
  641. }
  642. }
  643. var obj=$id("saved_url");
  644. _4c.url=obj.value.$trim();
  645. if(_4c.url==""){
  646. alert($lang("form_blank_url"));
  647. return false;
  648. }
  649. var obj=$id("saved_match_url");
  650. _4c.matchURL=obj.value.$trim();
  651. if(_4c.matchURL==""){
  652. alert($lang("form_blank_match_url"));
  653. return false;
  654. }
  655. var _4f=savedFormTable.data[savedFormTable.inEditDataIndex];
  656. maxConfig.setActiveFile("$form");
  657. maxConfig.ini.setValue("savedlist",_4c.id,_4c.url+"$,$"+(_4c.showOnMenu?"1":"0")+"$,$"+_4c.matchURL,"form");
  658. maxOptions.pages.form.savedForm.updateItemData(_4f.id);
  659. if(_4c.title!=_4f.title){
  660. var _50=maxConfig.ini.getArray(_4f.id,false);
  661. maxConfig.ini.setArray(_4c.id,_50,false);
  662. maxConfig.ini.deleteKey("savedlist",_4f.id);
  663. maxConfig.ini.deleteSection(_4f.id,"form");
  664. }
  665. maxOptions.action.applyChanges();
  666. maxConfig.setActiveFile("$main");
  667. return true;
  668. };
  669. maxOptions.pages.form.savedForm.updateItemData=function(_51){
  670. var _52=dataViewTable.data;
  671. var _53=maxConfig.ini.getArray(_51);
  672. for(var i=0;i<dataViewTable.data.length;i++){
  673. var _55=dataViewTable.data[i];
  674. var _56=_53[i];
  675. var obj=$id("saved_item_"+i);
  676. if(!obj){
  677. continue;
  678. }
  679. _55.value=obj.value.$trim();
  680. var obj=$id("saved_item_"+i+"_sub");
  681. if(obj){
  682. _55.subValue=obj.value.$trim();
  683. }
  684. switch(_55.type){
  685. case "t":
  686. case "c":
  687. case "r":
  688. _56[1]=_55.value;
  689. break;
  690. case "p":
  691. case "a":
  692. _56[1]=_55.value+"$.!.$"+_55.type;
  693. break;
  694. case "s":
  695. _56[1]=_55.value+"$.!.$"+_55.subValue;
  696. break;
  697. case "f":
  698. break;
  699. }
  700. _53[i]=_56;
  701. }
  702. maxConfig.ini.setArray(_51,_53);
  703. };
  704. maxOptions.pages.form.savedForm.deleteItem=function(_58){
  705. maxConfig.setActiveFile("$form");
  706. maxConfig.ini.deleteKey("savedlist",_58.id,"form");
  707. maxConfig.ini.deleteSection(_58.id,"form");
  708. maxOptions.action.applyChanges();
  709. maxConfig.setActiveFile("$main");
  710. };
  711. maxOptions.pages.form.savedForm.buildHTML=function(_59,_5a){
  712. var _5b=savedFormTable.data[_59];
  713. var _5c="";
  714. if(savedFormTable.inAction=="edit"||savedFormTable.inAction=="add"){
  715. _5c+="<p><strong>"+$lang("title")+":</strong>"+"   <input type=\"text\" id=\"saved_title\" maxlength=\"255\" class=\"text\" value=\""+_5b.title.$encodeHTML()+"\" style=\"width: 50%\" /></p>";
  716. _5c+="<p><strong>"+$lang("form_original_url")+":</strong>   <input type=\"text\" id=\"saved_url\" maxlength=\"255\" class=\"text\" value=\""+_5b.url.$encodeHTML()+"\" style=\"width: 50%\" />    <a href=\""+_5b.url.$sanitizeURL()+"\" target=\"_blank\"><strong>»</strong></a></p>";
  717. _5c+="<p><strong>"+$lang("form_match_url")+":</strong>"+"   <input type=\"text\" id=\"saved_match_url\" maxlength=\"255\" class=\"text\" value=\""+_5b.matchURL.$encodeHTML()+"\" style=\"width: 50%\" /> <span class=\"note\">"+$lang("form_match_url_note")+"</span></p>";
  718. _5c+="<div class=\"inner-table-wrapper\">"+"<div id=\"dataViewTable_wrapper\"></div>"+"</div>";
  719. _5c+="<p>"+maxTable.ui.buildEditControls(savedFormTable)+"</p>";
  720. }else{
  721. _5c+=_5b.title.$encodeHTML();
  722. }
  723. return _5c;
  724. };
  725. maxOptions.pages.form.savedForm.showDataView=function(){
  726. var _5d=savedFormTable.data[savedFormTable.inEditDataIndex];
  727. dataViewTable.data=maxOptions.pages.form.savedForm.dataView.loadList(_5d.id);
  728. maxTable.init(dataViewTable);
  729. };
  730. maxOptions.pages.form.savedForm.hideDataView=function(){
  731. var obj=$id("dataViewTable_wrapper");
  732. obj.innerHTML="";
  733. dataViewTable.data=[];
  734. return true;
  735. };
  736. maxOptions.pages.form.savedForm.dataView={};
  737. maxOptions.pages.form.savedForm.dataView.init=function(){
  738. dataViewTable=maxTable.create("dataViewTable");
  739. dataViewTable.dataType="object";
  740. 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}];
  741. dataViewTable.showEditControl=true;
  742. dataViewTable.allowInsert=false;
  743. dataViewTable.allowEdit=false;
  744. dataViewTable.separatorType="text";
  745. dataViewTable.tableTag="\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"";
  746. dataViewTable.style["table"]="form-table";
  747. dataViewTable.style["separator"]="form-table-section";
  748. dataViewTable.style["separator-hover"]="form-table-section";
  749. };
  750. maxOptions.pages.form.savedForm.dataView.loadList=function(id){
  751. maxConfig.setActiveFile("$form");
  752. var _60=maxConfig.ini.getArray(id,false,"form");
  753. maxConfig.setActiveFile("$main");
  754. if(_60.length<1){
  755. return [];
  756. }
  757. var _61=[];
  758. for(var i=0;i<_60.length;i++){
  759. var _63={};
  760. var _64=_60[i][0].split(">>");
  761. _63.name=_64[0];
  762. _63.type=_64[1];
  763. if(_64[2]!=undefined){
  764. _63.name+="["+_64[2]+"]";
  765. }
  766. if(_63.name.indexOf("<<")==0){
  767. _63.name=_63.name.replace("<<","")+"<id>";
  768. }
  769. if(_63.name.indexOf("><")==0){
  770. _63.name=_63.name.replace("><",". ");
  771. }
  772. if(_60[i][0]=="<form>"){
  773. _63.name=$lang("form");
  774. _63.type="f";
  775. }
  776. _63.value=_60[i][1];
  777. if(_63.value.indexOf("$.!.$")>-1){
  778. var arr=_63.value.split("$.!.$");
  779. _63.value=arr[0];
  780. _63.subValue=arr[1];
  781. if(_63.type=="t"){
  782. _63.type=_63.subValue;
  783. }
  784. }
  785. if(!_63.subValue){
  786. _63.subValue="";
  787. }
  788. _61.push(_63);
  789. }
  790. return _61;
  791. };
  792. maxOptions.pages.form.savedForm.dataView.buildHTML=function(_66,_67){
  793. var _68=dataViewTable.data[_66];
  794. var _69="";
  795. var _6a={"p":"password","c":"checkbox","a":"textarea","t":"text","r":"radio","s":"select"};
  796. if(_67==0){
  797. if(_68.type=="f"){
  798. _69+="<strong>"+$lang("form_form")+"</strong>";
  799. }else{
  800. _69+=_68.name.$encodeHTML();
  801. }
  802. }else{
  803. switch(_68.type){
  804. case "f":
  805. _69+=_68.value.$encodeHTML()+" <"+_68.subValue.$encodeHTML()+">";
  806. break;
  807. case "s":
  808. _69+="<input type=\"text\" id=\"saved_item_"+_66+"\" value=\""+_68.value.$encodeHTML()+"\" class=\"text\" style=\"width:30%\" />"+" - <input type=\"text\" id=\"saved_item_"+_66+"_sub\" value=\""+_68.subValue.$encodeHTML()+"\" class=\"text\" style=\"width:30%\" />";
  809. break;
  810. case "p":
  811. _69+="<input type=\"password\" id=\"saved_item_"+_66+"\" value=\""+_68.value.$encodeHTML()+"\" class=\"text\" style=\"width:60%\" />"+"   <a href=\"javascript:;\" onclick=\"maxOptions.pages.form.savedForm.dataView.togglePasswordText("+_66+")\" />"+$lang("form_show_password")+"</a>";
  812. break;
  813. default:
  814. _69+="<input type=\"text\" id=\"saved_item_"+_66+"\" value=\""+_68.value.$encodeHTML()+"\" class=\"text\" style=\"width:80%\" />";
  815. }
  816. if(_68.type!="f"){
  817. _69+="   <span class=\"comment\">["+_6a[_68.type]+"]</span>";
  818. }
  819. }
  820. return _69;
  821. };
  822. maxOptions.pages.form.savedForm.dataView.togglePasswordText=function(_6b){
  823. var _6c=false;
  824. var obj=$id("saved_item_"+_6b);
  825. if(!obj){
  826. return;
  827. }
  828. if(obj.type=="password"){
  829. if(!maxOptions.pages.form.validatePassword()){
  830. return;
  831. }
  832. _6c=true;
  833. }else{
  834. _6c=false;
  835. }
  836. var _6e=document.createElement("INPUT");
  837. _6e.type=_6c?"text":"password";
  838. _6e.value=obj.value;
  839. _6e.id=obj.id;
  840. _6e.name=obj.name;
  841. _6e.className=obj.className;
  842. _6e.style.width=obj.style.width;
  843. obj.replaceNode(_6e);
  844. };
  845. maxOptions.pages.floatbutton.init=function(){
  846. maxOptions.pages.floatbutton.checkMain();
  847. var obj=$id("fb_enable");
  848. obj.attachEvent("onclick",maxOptions.pages.floatbutton.checkMain);
  849. maxOptions.pages.floatbutton.checkMain();
  850. };
  851. maxOptions.pages.floatbutton.checkMain=function(){
  852. if($id("fb_enable").checked){
  853. maxConfig.ui.enableItem("fb_show_on_image");
  854. maxConfig.ui.enableItem("fb_show_on_media");
  855. }else{
  856. maxConfig.ui.disableItem("fb_show_on_image");
  857. maxConfig.ui.disableItem("fb_show_on_media");
  858. }
  859. };
  860. maxOptions.pages.download.init=function(){
  861. maxOptions.pages.download.buildDownloaderList();
  862. maxOptions.pages.download.getDefaultSaveFolder();
  863. };
  864. maxOptions.pages.download.getDefaultSaveFolder=function(){
  865. var _70=maxConfig.ini.getValue("Download","SaveFolder");
  866. if(!_70){
  867. var v=external.max_getObj(max_security_id,"info");
  868. var _72=v.folderUser+"Downloads";
  869. maxConfig.ini.setValue("Download","SaveFolder",_72);
  870. maxConfig.ui.folder.updateUI("down_save_folder",_72);
  871. maxOptions.action.applyChanges();
  872. }
  873. };
  874. maxOptions.pages.download.buildDownloaderList=function(){
  875. maxConfig.setActiveFile("$download");
  876. var _73=maxConfig.ini.getArray("Downloaders",false);
  877. maxConfig.setActiveFile("$main");
  878. var _74=maxConfig.ini.getValue("Download","Downloader");
  879. if(_74==null){
  880. _74="";
  881. }
  882. var _75={type:"radio",id:"down_downloaders",key:"Downloader",section:"Download",defaultValue:"-none-",choices:[{value:"-none-",html:"<strong>"+$lang("down_no_downloader")+"</strong>"}]};
  883. var _76="";
  884. for(var i=0;i<_73.length;i++){
  885. var _78={};
  886. _78.value=_73[i][0];
  887. _78.html=_73[i][1];
  888. var _79=external.max_Lang("Downloaders",_78.html);
  889. if(_79!=""){
  890. _78.html=_79+" ("+_78.html+")";
  891. }
  892. _78.html=_78.html.$encodeHTML();
  893. if(_78.value==""){
  894. continue;
  895. }
  896. var obj=external.max_activex(max_security_id,_73[i][0]);
  897. if(!obj){
  898. _76+="<div>"+_78.html+"</div>";
  899. continue;
  900. }else{
  901. delete obj;
  902. _75.choices.push(_78);
  903. }
  904. }
  905. var _7b=maxConfig.ui.radio.build(_75)+"<div class=\"item indent\">"+"<span onmousemove=\"maxOptions.pages.download.toggleFailedList(true)\" onmouseout=\"maxOptions.pages.download.toggleFailedList(false)\">"+"<a href=\"javascript:;\">"+$lang("down_failed_list")+"</a><br/>"+"<div id=\"failedList\" class=\"item failed-downloader-list\" style=\"position:absolute;display:none;\">"+_76+"</span>"+"</div>";
  906. $write(_7b,"downloaderList_wrapper");
  907. };
  908. maxOptions.pages.download.toggleFailedList=function(_7c){
  909. var obj=$id("failedList");
  910. if(_7c){
  911. obj.style.display="block";
  912. }else{
  913. obj.style.display="none";
  914. }
  915. };
  916. maxOptions.pages.download.setDownloader=function(){
  917. var obj=$id("downloaderList");
  918. var _7f=obj.options[obj.selectedIndex].value;
  919. var _80=true;
  920. if(_7f!=""){
  921. var obj=external.max_activex(max_security_id,_7f);
  922. if(!obj){
  923. _80=false;
  924. }
  925. }
  926. if(!_80){
  927. alert($lang("down_downloader_not_detected"));
  928. }
  929. if(_80){
  930. maxConfig.ini.setValue("Download","Downloader",_7f);
  931. }
  932. maxOptions.pages.download.buildDownloaderList();
  933. };
  934. maxOptions.pages.key.init=function(){
  935. maxOptions.pages.key.customKey.init();
  936. };
  937. maxOptions.pages.key.destroy=function(){
  938. try{
  939. maxTable.destroy(customKeyTable);
  940. }
  941. catch(e){
  942. }
  943. };
  944. maxOptions.pages.key.customKey={};
  945. maxOptions.pages.key.customKey.init=function(){
  946. customKeyTable=maxTable.create("customKeyTable");
  947. 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}];
  948. customKeyTable.showEditControl=false;
  949. customKeyTable.defaultRowData={keyCode:"csa_0",keyName:$lang("none"),action:"",actionID:"0",actionType:"i"};
  950. customKeyTable.dataType="object";
  951. customKeyTable.data=maxOptions.pages.key.customKey.loadList();
  952. customKeyTable.editControl=[{type:"html",value:" | ",hideOnNew:true},{type:"delete",hideOnNew:true},{type:"html",value:" | "},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  953. customKeyTable.style["edit"]="maxTable-edit-no-control";
  954. customKeyTable.controlUI["delete"]=$lang("delete");
  955. customKeyTable.controlUI["save"]=$lang("save");
  956. customKeyTable.controlUI["cancel"]=$lang("cancel");
  957. customKeyTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  958. customKeyTable.content["buildTableControls"]=maxOptions.pages.key.customKey.buildTableControls;
  959. customKeyTable.event["beforeAdd"]=maxOptions.pages.key.customKey.validateKey;
  960. customKeyTable.event["afterAdd"]=maxOptions.pages.key.customKey.saveList;
  961. customKeyTable.event["beforeUpdate"]=maxOptions.pages.key.customKey.validateKey;
  962. customKeyTable.event["afterUpdate"]=maxOptions.pages.key.customKey.saveList;
  963. customKeyTable.event["afterDelete"]=maxOptions.pages.key.customKey.saveList;
  964. maxTable.init(customKeyTable);
  965. };
  966. maxOptions.pages.key.customKey.buildTableControls=function(){
  967. var _81="";
  968. _81+="<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>";
  969. return _81;
  970. };
  971. maxOptions.pages.key.customKey.loadList=function(){
  972. var _82=[];
  973. var _83=maxConfig.ini.getArray("ShortcutKeys");
  974. _83.$sort(0,{"compareLength":true});
  975. for(var i=0;i<_83.length;i++){
  976. var _85={};
  977. var _86=maxConfig.ui.key.parseData(_83[i][0]);
  978. _85.keyCode=_86[0];
  979. _85.keyName=_86[1];
  980. _85.actionType=_83[i][1];
  981. _85.actionID=_83[i][2];
  982. _85.action=_83[i][3];
  983. if(_85.actionType=="i"){
  984. _85.action=$lang(_85.actionID,"StringByID");
  985. }
  986. if(_85.actionID=="0"){
  987. _85.action=$lang("none");
  988. }
  989. if(_85.keyCode!="csa_0"&&_85.actionID){
  990. _82.push(_85);
  991. }
  992. }
  993. return _82;
  994. };
  995. maxOptions.pages.key.customKey.saveList=function(){
  996. var _87=[];
  997. for(var i=0;i<customKeyTable.data.length;i++){
  998. if(typeof (customKeyTable.data[i])=="string"){
  999. continue;
  1000. }
  1001. var _89=[];
  1002. _89[0]=customKeyTable.data[i].keyCode+"$:$"+customKeyTable.data[i].keyName;
  1003. _89[1]=customKeyTable.data[i].actionType;
  1004. _89[2]=customKeyTable.data[i].actionID;
  1005. _89[3]=customKeyTable.data[i].actionType=="i"?"":customKeyTable.data[i].action;
  1006. _87.push(_89);
  1007. }
  1008. maxConfig.ini.deleteSection("ShortcutKeys");
  1009. maxConfig.ini.setArray("ShortcutKeys",_87);
  1010. maxOptions.action.applyChanges();
  1011. };
  1012. maxOptions.pages.key.customKey.buildHTML=function(_8a,_8b){
  1013. var _8c=customKeyTable.data[_8a];
  1014. var _8d="";
  1015. if(_8b==0){
  1016. _8d+="<img src=\"../_shared/images/key.png\" /> "+_8c.keyName;
  1017. }else{
  1018. if(_8c.actionID=="0"){
  1019. _8d+="<span class=\"item-note\">"+$lang("none")+"</span>";
  1020. }else{
  1021. _8d+=_8c.action.$encodeHTML().replace(/\&\;([a-z])/ig,"<u>$1</u>")+" <span class=\"item-note\">["+_8c.actionID+"]</span>";
  1022. }
  1023. if(customKeyTable.inAction=="edit"||customKeyTable.inAction=="add"){
  1024. _8d+="<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>";
  1025. }
  1026. }
  1027. return _8d;
  1028. };
  1029. maxOptions.pages.key.customKey.validateKey=function(){
  1030. var _8e=customKeyTable.data[customKeyTable.inEditDataIndex];
  1031. if(_8e.keyCode==""||_8e.keyCode=="csa_0"){
  1032. alert($lang("key_blank_key"));
  1033. return false;
  1034. }
  1035. for(var i=0;i<customKeyTable.data.length;i++){
  1036. if(_8e.keyCode==customKeyTable.data[i].keyCode&&customKeyTable.inEditDataIndex!=i){
  1037. alert($lang("key_duplicate_key"));
  1038. return false;
  1039. }
  1040. }
  1041. return true;
  1042. };
  1043. maxOptions.pages.key.customKey.setKey=function(){
  1044. var _90=external.max_invoke("GetHotKey");
  1045. if(_90==-1){
  1046. return;
  1047. }
  1048. var _91=maxConfig.ui.key.parseData(_90);
  1049. if(_91[0]!="csa_0"){
  1050. var _92=customKeyTable.data[customKeyTable.inEditDataIndex];
  1051. _92.keyCode=_91[0];
  1052. _92.keyName=_91[1];
  1053. maxTable.ui.updateRow(customKeyTable,customKeyTable.inEditDataIndex);
  1054. }
  1055. };
  1056. maxOptions.pages.key.customKey.setAction=function(){
  1057. var _93=external.max_invoke("SelCommand");
  1058. if(!_93){
  1059. return;
  1060. }
  1061. var _94=_93.split("$,$");
  1062. var _95=customKeyTable.data[customKeyTable.inEditDataIndex];
  1063. _95.actionType=_94[0];
  1064. _95.actionID=_94[1];
  1065. _95.action=_94[2];
  1066. maxTable.ui.updateRow(customKeyTable,customKeyTable.inEditDataIndex);
  1067. };
  1068. maxOptions.pages.key.customKey.restoreDefault=function(){
  1069. if(confirm($lang("confirm_restore_default"))){
  1070. external.max_invoke("DefaultConfig","HotKey");
  1071. maxConfig.load();
  1072. }
  1073. };
  1074. maxOptions.pages.mouse.init=function(){
  1075. maxOptions.pages.mouse.gesture.init();
  1076. };
  1077. maxOptions.pages.mouse.destroy=function(){
  1078. try{
  1079. maxTable.destroy(mouseTable);
  1080. }
  1081. catch(e){
  1082. }
  1083. };
  1084. maxOptions.pages.mouse.gesture={};
  1085. maxOptions.pages.mouse.gesture.init=function(){
  1086. mouseTable=maxTable.create("mouseTable");
  1087. 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}];
  1088. mouseTable.separatorType="line";
  1089. mouseTable.allowEditSeparator=false;
  1090. mouseTable.showEditControl=false;
  1091. mouseTable.defaultRowData={gesture:"",action:"",actionID:"0",actionType:"i"};
  1092. mouseTable.dataType="object";
  1093. mouseTable.data=maxOptions.pages.mouse.gesture.loadList();
  1094. mouseTable.editControl=[{type:"html",value:" | ",hideOnNew:true},{type:"delete",hideOnNew:true},{type:"html",value:" | "},{type:"save"},{type:"html",value:" | "},{type:"cancel"}];
  1095. mouseTable.style["edit"]="maxTable-edit-no-control";
  1096. mouseTable.controlUI["delete"]=$lang("delete");
  1097. mouseTable.controlUI["save"]=$lang("save");
  1098. mouseTable.controlUI["cancel"]=$lang("cancel");
  1099. mouseTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1100. mouseTable.content["buildTableControls"]=maxOptions.pages.mouse.gesture.buildTableControls;
  1101. mouseTable.event["beforeAdd"]=maxOptions.pages.mouse.gesture.validateGesture;
  1102. mouseTable.event["afterAdd"]=maxOptions.pages.mouse.gesture.saveList;
  1103. mouseTable.event["beforeUpdate"]=maxOptions.pages.mouse.gesture.validateGesture;
  1104. mouseTable.event["afterUpdate"]=maxOptions.pages.mouse.gesture.saveList;
  1105. mouseTable.event["beforeDelete"]=maxOptions.pages.mouse.gesture.checkDelete;
  1106. mouseTable.event["afterDelete"]=maxOptions.pages.mouse.gesture.saveList;
  1107. maxTable.init(mouseTable);
  1108. };
  1109. maxOptions.pages.mouse.gesture.buildTableControls=function(){
  1110. var _96="";
  1111. _96+="<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>";
  1112. return _96;
  1113. };
  1114. maxOptions.pages.mouse.gesture.loadList=function(){
  1115. var _97=[];
  1116. var _98=["DoubleClickTab","DoubleClickTabBar","DoubleClickPage","MidClickTab","HoldRightClickLeft","HoldLeftClickRight"];
  1117. for(var i=0;i<_98.length;i++){
  1118. var _9a={buildIn:true};
  1119. var str=maxConfig.ini.getValue("MouseGestures",_98[i]);
  1120. if(str==""){
  1121. _9a.gesture=_98[i];
  1122. _9a.actionType="i";
  1123. _9a.actionID="0";
  1124. _9a.action=$lang("none");
  1125. }else{
  1126. _9a.gesture=_98[i];
  1127. var _9c=str.split("$,$");
  1128. _9a.actionType=_9c[0];
  1129. _9a.actionID=_9c[1];
  1130. _9a.action=_9c[2];
  1131. if(_9a.actionType=="i"){
  1132. _9a.action=$lang(_9a.actionID,"StringByID");
  1133. }
  1134. if(_9a.actionID=="0"){
  1135. _9a.action=$lang("none");
  1136. }
  1137. }
  1138. _97.push(_9a);
  1139. }
  1140. _97.push("---");
  1141. var _9d=maxConfig.ini.getArray("MouseGestures");
  1142. _9d.$sort(0);
  1143. for(var i=0;i<_9d.length;i++){
  1144. var _9a={};
  1145. if(_9d[i][0].indexOf("Gesture_")==0){
  1146. _9a.gesture=_9d[i][0].substring(8,_9d[i][0].length);
  1147. _9a.actionType=_9d[i][1];
  1148. _9a.actionID=_9d[i][2];
  1149. _9a.action=_9d[i][3];
  1150. if(_9a.actionType=="i"){
  1151. _9a.action=$lang(_9a.actionID,"StringByID");
  1152. }
  1153. if(_9a.actionID=="0"){
  1154. _9a.action=$lang("none");
  1155. }
  1156. }
  1157. if(_9a.gesture&&_9a.actionID){
  1158. _97.push(_9a);
  1159. }
  1160. }
  1161. return _97;
  1162. };
  1163. maxOptions.pages.mouse.gesture.saveList=function(){
  1164. var _9e=[];
  1165. for(var i=0;i<mouseTable.data.length;i++){
  1166. if(typeof (mouseTable.data[i])=="string"){
  1167. continue;
  1168. }
  1169. var _a0=[];
  1170. _a0[0]=mouseTable.data[i].buildIn?mouseTable.data[i].gesture:"Gesture_"+mouseTable.data[i].gesture;
  1171. _a0[1]=mouseTable.data[i].actionType;
  1172. _a0[2]=mouseTable.data[i].actionID;
  1173. _a0[3]=mouseTable.data[i].actionType=="i"?"":mouseTable.data[i].action;
  1174. _9e.push(_a0);
  1175. }
  1176. maxConfig.ini.deleteSection("MouseGestures");
  1177. maxConfig.ini.setArray("MouseGestures",_9e);
  1178. maxOptions.action.applyChanges();
  1179. };
  1180. maxOptions.pages.mouse.gesture.buildGestureHTML=function(_a1,_a2){
  1181. var _a3=mouseTable.data[_a1];
  1182. var _a4="";
  1183. if(_a3.buildIn){
  1184. if(_a3.gesture.indexOf("Double")>-1){
  1185. _a4+="<img src=\"../_shared/images/mouse_left.png\" /> ";
  1186. }else{
  1187. if(_a3.gesture.indexOf("Mid")>-1){
  1188. _a4+="<img src=\"../_shared/images/mouse_mid.png\" /> ";
  1189. }else{
  1190. if(_a3.gesture.indexOf("Hold")>-1){
  1191. _a4+="<img src=\"../_shared/images/mouse_both.png\" /> ";
  1192. }
  1193. }
  1194. }
  1195. _a4+=$lang("mou_"+_a3.gesture.toLowerCase());
  1196. }else{
  1197. if(mouseTable.inAction=="edit"||mouseTable.inAction=="add"){
  1198. _a4+="<table width=\"99%\" class=\"clean-table\" cellpadding=\"0\" cellspacing=\"0\">"+"<tr>"+"<td nowrap=\"nowrap\">";
  1199. }
  1200. _a4+="<img src=\"../_shared/images/mouse_right.png\" /> "+$lang("mou_gesture");
  1201. if(_a3.gesture==""){
  1202. _a4+=" <span class=\"comment\">"+$lang("none")+"</span>";
  1203. }else{
  1204. for(var i=0;i<_a3.gesture.length;i++){
  1205. _a4+=" <img src=\"../_shared/images/direction_"+_a3.gesture.substr(i,1).toLowerCase()+".png\" />";
  1206. }
  1207. }
  1208. if(mouseTable.inAction=="edit"||mouseTable.inAction=="add"){
  1209. _a4+=(_a3.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>";
  1210. }
  1211. }
  1212. return _a4;
  1213. };
  1214. maxOptions.pages.mouse.gesture.buildActionHTML=function(_a6,_a7){
  1215. var _a8=mouseTable.data[_a6];
  1216. var _a9="";
  1217. if(_a8.actionID=="0"){
  1218. _a9+=" <span class=\"item-note\">"+$lang("none")+"</span>";
  1219. }else{
  1220. _a9+=_a8.action.$encodeHTML().replace(/\&\;([a-z])/ig,"<u>$1</u>")+" <span class=\"item-note\">["+_a8.actionID+"]</span>";
  1221. }
  1222. if(mouseTable.inAction=="edit"||mouseTable.inAction=="add"){
  1223. _a9+="<p>"+"<a href=\"javascript:;\" onclick=\"maxOptions.pages.mouse.gesture.setAction()\">"+$lang("set_action")+"</a>"+maxTable.ui.buildEditControls(mouseTable)+" </p>";
  1224. }
  1225. return _a9;
  1226. };
  1227. maxOptions.pages.mouse.gesture.validateGesture=function(){
  1228. var _aa=mouseTable.data[mouseTable.inEditDataIndex];
  1229. if(_aa.gesture==""){
  1230. alert($lang("mou_blank_gesture"));
  1231. return false;
  1232. }
  1233. for(var i=0;i<mouseTable.data.length;i++){
  1234. if(_aa.gesture==mouseTable.data[i].gesture&&mouseTable.inEditDataIndex!=i){
  1235. alert($lang("mou_duplicate_gesture"));
  1236. return false;
  1237. }
  1238. }
  1239. return true;
  1240. };
  1241. maxOptions.pages.mouse.gesture.checkDelete=function(_ac){
  1242. if(_ac.buildIn){
  1243. if(!confirm($lang("maxtable_delete_confirm"))){
  1244. return false;
  1245. }
  1246. _ac.actionType="i";
  1247. _ac.actionID="0";
  1248. _ac.action="";
  1249. maxTable.action.saveEdit(mouseTable);
  1250. maxConfig.ini.setValue("MouseGestures",_ac.gesture,_ac.actionType+"$,$"+_ac.actionID+"$,$"+_ac.action);
  1251. return false;
  1252. }
  1253. return true;
  1254. };
  1255. maxOptions.pages.mouse.gesture.setGesture=function(_ad){
  1256. var _ae=mouseTable.data[mouseTable.inEditDataIndex];
  1257. if(_ad=="B"){
  1258. if(_ae.gesture.length>0){
  1259. _ae.gesture=_ae.gesture.slice(0,-1);
  1260. }
  1261. }else{
  1262. if(_ae.gesture.length==3){
  1263. alert($lang("mou_gesture_too_long"));
  1264. return;
  1265. }
  1266. if(_ae.gesture.substr(_ae.gesture.length-1,1)==_ad){
  1267. alert($lang("mou_no_double_direction"));
  1268. return;
  1269. }
  1270. _ae.gesture+=_ad;
  1271. }
  1272. maxTable.ui.updateRow(mouseTable,mouseTable.inEditDataIndex);
  1273. };
  1274. maxOptions.pages.mouse.gesture.setAction=function(){
  1275. var _af=external.max_invoke("SelCommand");
  1276. if(!_af){
  1277. return;
  1278. }
  1279. var _b0=_af.split("$,$");
  1280. var _b1=mouseTable.data[mouseTable.inEditDataIndex];
  1281. _b1.actionType=_b0[0];
  1282. _b1.actionID=_b0[1];
  1283. _b1.action=_b0[2];
  1284. maxTable.ui.updateRow(mouseTable,mouseTable.inEditDataIndex);
  1285. };
  1286. maxOptions.pages.mouse.gesture.restoreToDefault=function(){
  1287. if(confirm($lang("confirm_restore_default"))){
  1288. external.max_invoke("DefaultConfig","Gesture");
  1289. maxConfig.load();
  1290. }
  1291. };
  1292. maxOptions.pages.adhunter.init=function(){
  1293. obj=$id("adh_popup_blocker");
  1294. obj.attachEvent("onclick",maxOptions.pages.adhunter.checkPopup);
  1295. obj=$id("adh_content_filter");
  1296. obj.attachEvent("onclick",maxOptions.pages.adhunter.checkContent);
  1297. maxOptions.pages.adhunter.checkPopup();
  1298. maxOptions.pages.adhunter.checkContent();
  1299. };
  1300. maxOptions.pages.adhunter.checkPopup=function(){
  1301. var _b2=$id("adh_popup_blocker");
  1302. if(_b2.checked){
  1303. maxConfig.ui.enableItem("adh_popup_infobar");
  1304. maxConfig.ui.enableItem("adh_popup_sound");
  1305. }else{
  1306. maxConfig.ui.disableItem("adh_popup_infobar");
  1307. maxConfig.ui.disableItem("adh_popup_sound");
  1308. }
  1309. };
  1310. maxOptions.pages.adhunter.checkContent=function(){
  1311. var _b3=$id("adh_content_filter");
  1312. if(_b3.checked){
  1313. maxConfig.ui.enableItem("adh_notify");
  1314. maxConfig.ui.enableItem("adh_replace_obj");
  1315. }else{
  1316. maxConfig.ui.disableItem("adh_notify");
  1317. maxConfig.ui.disableItem("adh_replace_obj");
  1318. }
  1319. };
  1320. maxOptions.pages.safety.init=function(){
  1321. maxOptions.pages.safety.patch.init();
  1322. obj=$id("saf_clean_upon_close");
  1323. obj.attachEvent("onclick",maxOptions.pages.safety.checkClean);
  1324. maxOptions.pages.safety.checkClean();
  1325. };
  1326. maxOptions.pages.safety.checkClean=function(){
  1327. var _b4=$id("saf_clean_upon_close");
  1328. if(_b4.checked){
  1329. maxConfig.ui.enableItem("saf_clean_undo");
  1330. maxConfig.ui.enableItem("saf_clean_history");
  1331. maxConfig.ui.enableItem("saf_clean_address");
  1332. maxConfig.ui.enableItem("saf_clean_search");
  1333. maxConfig.ui.enableItem("saf_clean_rss");
  1334. maxConfig.ui.enableItem("saf_clean_cookies");
  1335. maxConfig.ui.enableItem("saf_clean_cache");
  1336. }else{
  1337. maxConfig.ui.disableItem("saf_clean_undo");
  1338. maxConfig.ui.disableItem("saf_clean_history");
  1339. maxConfig.ui.disableItem("saf_clean_address");
  1340. maxConfig.ui.disableItem("saf_clean_search");
  1341. maxConfig.ui.disableItem("saf_clean_rss");
  1342. maxConfig.ui.disableItem("saf_clean_cookies");
  1343. maxConfig.ui.disableItem("saf_clean_cache");
  1344. }
  1345. };
  1346. maxOptions.pages.safety.destroy=function(){
  1347. try{
  1348. maxTable.destroy(patchTable);
  1349. }
  1350. catch(e){
  1351. }
  1352. };
  1353. maxOptions.pages.safety.patch={};
  1354. maxOptions.pages.safety.patch.init=function(){
  1355. patchTable=maxTable.create("patchTable");
  1356. patchTable.columns=[{title:" ",name:"enabled",type:"checkbox",width:18},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.safety.patch.buildHTML,readOnly:true}];
  1357. patchTable.dataType="object";
  1358. patchTable.data=maxOptions.pages.safety.patch.loadList();
  1359. patchTable.allowInsert=false;
  1360. patchTable.showEditControl=false;
  1361. patchTable.style["edit"]="";
  1362. patchTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  1363. patchTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  1364. patchTable.event["beforeCheckboxClick"]=maxOptions.pages.safety.patch.confirmToggle;
  1365. patchTable.event["afterCheckboxClick"]=maxOptions.pages.safety.patch.toggleItem;
  1366. maxTable.init(patchTable);
  1367. };
  1368. maxOptions.pages.safety.patch.getFilePath=function(){
  1369. return external.max_invoke("getPath","patch");
  1370. };
  1371. maxOptions.pages.safety.patch.loadList=function(){
  1372. var _b5={"namespace":"","validate":"/m2filter[@version=\"1.0\"]","items":"//group","attributes":{"title":"@name","importance":"@importance","enabled":"@enable","description":"@description"}};
  1373. var _b6=maxXmlListParser.parseFile(maxOptions.pages.safety.patch.getFilePath(),_b5);
  1374. if(_b6==null){
  1375. return [];
  1376. }else{
  1377. for(var i=0;i<_b6.length;i++){
  1378. _b6[i].enabled=_b6[i].enabled=="1"?true:false;
  1379. }
  1380. }
  1381. return _b6;
  1382. };
  1383. maxOptions.pages.safety.patch.buildHTML=function(_b8,_b9){
  1384. var _ba=patchTable.data[_b8];
  1385. var _bb="";
  1386. _bb+="<strong>";
  1387. switch(_ba.importance){
  1388. case "1":
  1389. _bb+="<img src=\"images/defcon_low.png\" />";
  1390. break;
  1391. case "2":
  1392. _bb+="<img src=\"images/defcon_med.png\" />";
  1393. break;
  1394. case "3":
  1395. _bb+="<img src=\"images/defcon_high.png\" />";
  1396. break;
  1397. }
  1398. _bb+="  "+_ba.title.$encodeHTML()+"</strong>";
  1399. if(patchTable.inAction=="edit"&&_ba.description){
  1400. _bb+="<div class=\"item-description\">"+_ba.description+"</div>";
  1401. }
  1402. return _bb;
  1403. };
  1404. maxOptions.pages.safety.patch.confirmToggle=function(_bc,_bd){
  1405. var _be=patchTable.data[_bc];
  1406. if(_be.enabled){
  1407. if(!confirm($lang("saf_disable_confirm"))){
  1408. return false;
  1409. }
  1410. }
  1411. return true;
  1412. };
  1413. maxOptions.pages.safety.patch.toggleItem=function(_bf,_c0){
  1414. var _c1=patchTable.data[_bf];
  1415. var _c2={"xml":maxOptions.pages.safety.patch.getFilePath(),"isFile":true,"save":true,"xpath":"//group[@name=\""+_c1.title.replace(/\"/ig,""")+"\"]/@enable","value":_c1.enabled?"1":"0"};
  1416. maxXmlListParser.updateItem(_c2);
  1417. };
  1418. maxOptions.pages.advanced.init=function(){
  1419. maxOptions.pages.advanced.buildUserAgentList();
  1420. maxOptions.pages.advanced.checkIE7();
  1421. maxOptions.pages.advanced.checkVista();
  1422. maxOptions.pages.advanced.checkUserAgent();
  1423. obj=$id("adv_multi_thread");
  1424. obj.attachEvent("onclick",maxOptions.pages.advanced.checkMultiThread);
  1425. var obj=$id("adv_accelerator");
  1426. obj.attachEvent("onclick",maxOptions.pages.advanced.checkFlashBackForward);
  1427. var obj=$id("adv_site_boost");
  1428. obj.attachEvent("onclick",maxOptions.pages.advanced.checkBoost);
  1429. obj=$id("adv_custom_ua");
  1430. obj.attachEvent("onclick",maxOptions.pages.advanced.checkUserAgent);
  1431. maxOptions.pages.advanced.checkMultiThread();
  1432. maxOptions.pages.advanced.checkFlashBackForward();
  1433. maxOptions.pages.advanced.checkBoost();
  1434. maxOptions.pages.advanced.checkUserAgent();
  1435. };
  1436. maxOptions.pages.advanced.checkMultiThread=function(){
  1437. var _c4=$id("adv_multi_thread");
  1438. if(_c4.checked){
  1439. maxConfig.ui.enableItem("adv_ime_patch");
  1440. }else{
  1441. maxConfig.ui.disableItem("adv_ime_patch");
  1442. }
  1443. };
  1444. maxOptions.pages.advanced.checkFlashBackForward=function(){
  1445. var _c5=$id("adv_accelerator");
  1446. if(_c5.checked){
  1447. maxConfig.ui.enableItem("adv_flash_back_forward");
  1448. }else{
  1449. maxConfig.ui.disableItem("adv_flash_back_forward");
  1450. }
  1451. };
  1452. maxOptions.pages.advanced.checkBoost=function(){
  1453. var _c6=$id("adv_site_boost");
  1454. if(_c6.checked){
  1455. maxConfig.ui.enableItem("adv_site_boost_auto_add");
  1456. }else{
  1457. maxConfig.ui.disableItem("adv_site_boost_auto_add");
  1458. }
  1459. };
  1460. maxOptions.pages.advanced.checkIE7=function(){
  1461. if(navigator.userAgent.indexOf("MSIE 7")<0){
  1462. maxConfig.ui.disableItem("adv_ie7_zoom");
  1463. }
  1464. };
  1465. maxOptions.pages.advanced.checkVista=function(){
  1466. if(navigator.userAgent.indexOf("Windows NT 6")<0){
  1467. maxConfig.ui.disableItem("adv_vista_glass");
  1468. }
  1469. };
  1470. maxOptions.pages.advanced.checkUserAgent=function(){
  1471. var obj=$id("adv_custom_ua");
  1472. var _c8=$id("adv_useragent");
  1473. var _c9=$id("adv_ua_list");
  1474. if(obj.checked){
  1475. _c8.disabled=false;
  1476. _c9.disabled=false;
  1477. }else{
  1478. _c8.disabled=true;
  1479. _c9.disabled=true;
  1480. }
  1481. };
  1482. maxOptions.pages.advanced.editBoostList=function(){
  1483. external.max_invoke("MxBoostEditDialog");
  1484. };
  1485. maxOptions.pages.advanced.editSuperMSAList=function(){
  1486. maxOptions.action.applyChanges();
  1487. external.max_invoke("SuperMSASiteDialog");
  1488. };
  1489. 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"]];
  1490. maxOptions.pages.advanced.buildUserAgentList=function(){
  1491. var _ca="";
  1492. _ca+="<option value=\"\"> ["+$lang("adv_predefined_ua")+"] </option>";
  1493. for(var i=0;i<maxOptions.pages.advanced.uaList.length;i++){
  1494. var _cc=maxOptions.pages.advanced.uaList[i];
  1495. _ca+="<option value=\""+i+"\"> "+_cc[0].$encodeHTML()+" </option>";
  1496. }
  1497. _ca="<select id=\"adv_ua_list\" onchange=\"maxOptions.pages.advanced.setCustomUserAgent()\">"+_ca+"</select>";
  1498. $write(_ca,"adv_ua_list_wrapper");
  1499. };
  1500. maxOptions.pages.advanced.setCustomUserAgent=function(){
  1501. var _cd=$id("adv_useragent");
  1502. var _ce=$id("adv_ua_list");
  1503. var _cf=_ce.selectedIndex-1;
  1504. _cd.value=maxOptions.pages.advanced.uaList[_cf][1];
  1505. _cd.fireEvent("onchange");
  1506. _ce.selectedIndex=0;
  1507. };
  1508. maxOptions.pages.skin.init=function(){
  1509. skinTable=maxTable.create("skinTable");
  1510. 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}];
  1511. skinTable.dataType="object";
  1512. skinTable.data=maxConfig.res.load("skin");
  1513. skinTable.separatorType="line";
  1514. skinTable.allowInsert=false;
  1515. skinTable.showEditControl=false;
  1516. skinTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"cancel"}];
  1517. skinTable.controlUI["delete"]=$lang("delete");
  1518. skinTable.controlUI["cancel"]=$lang("cancel");
  1519. skinTable.controlUI["radio"]="<img src=\"../_shared/images/btn_radio.png\" />";
  1520. skinTable.controlUI["radio_checked"]="<img src=\"../_shared/images/btn_radio_checked.png\" />";
  1521. skinTable.style["edit"]="maxTable-edit-no-control";
  1522. skinTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1523. skinTable.event["afterRadioClick"]=maxOptions.pages.skin.setSkin;
  1524. skinTable.event["beforeDelete"]=maxOptions.pages.skin.checkDeleteItem;
  1525. skinTable.event["afterDelete"]=maxOptions.pages.skin.deleteItem;
  1526. maxTable.init(skinTable);
  1527. setTimeout("maxOptions.pages.skin.forceRemoteImage()",500);
  1528. };
  1529. maxOptions.pages.skin.destroy=function(){
  1530. try{
  1531. maxTable.destroy(skinTable);
  1532. }
  1533. catch(e){
  1534. }
  1535. };
  1536. maxOptions.pages.skin.forceRemoteImage=function(){
  1537. var _d0=$id(skinTable.id);
  1538. try{
  1539. for(var i=1;i<_d0.rows.length;i++){
  1540. var _d2=_d0.rows[i].cells[1].firstChild.firstChild;
  1541. if(!_d2.complete||_d2.fileSize<0){
  1542. var src=_d2.src;
  1543. _d2.style.display="none";
  1544. _d2.src=src;
  1545. _d2.style.display="block";
  1546. }
  1547. }
  1548. }
  1549. catch(e){
  1550. }
  1551. };
  1552. maxOptions.pages.skin.buildPreviewHTML=function(_d4,_d5){
  1553. if(skinTable.inAction=="init"){
  1554. var _d6=skinTable.data[_d4];
  1555. var _d7="";
  1556. _d7+="<div class=\"item-preview\" style=\"height: 64px;\">";
  1557. if(_d6.preview){
  1558. _d7+="<img src=\"file:///"+_d6.preview+"\" />";
  1559. }else{
  1560. _d7+=" ";
  1561. }
  1562. _d7+="</div>";
  1563. return _d7;
  1564. }else{
  1565. var _d8=$id(skinTable.id);
  1566. if(skinTable.inAction=="edit"){
  1567. _d8.rows[_d4+1].cells[_d5].firstChild.style.height="220px";
  1568. }else{
  1569. _d8.rows[_d4+1].cells[_d5].firstChild.style.height="64px";
  1570. }
  1571. return null;
  1572. }
  1573. };
  1574. maxOptions.pages.skin.buildDescriptionHTML=function(_d9,_da){
  1575. var _db=skinTable.data[_d9];
  1576. var _dc="";
  1577. _dc+="<strong>"+_db.title.$encodeHTML()+"</strong> <span class=\"item-note\"><"+_db.path.$encodeHTML()+"></span>";
  1578. _dc+="<br/><span class=\"item-note\">"+$lang("version")+": "+_db.version.$encodeHTML()+"<br/>"+$lang("author")+": "+_db.author.$encodeHTML()+"</span>";
  1579. if(skinTable.inAction=="edit"){
  1580. if(_db.description){
  1581. _dc+="<div class=\"item-description\">"+_db.description+"</div>";
  1582. }
  1583. _dc+="<p>"+"<a href=\"javascript:;\" onclick=\"maxTable.action.radioClick(skinTable, skinTable.inEditRow, 0);\">"+$lang("apply")+"</a> | "+(_db.supportURL?"<a href=\""+_db.supportURL+"\" target=\"_blank\">"+$lang("visit_website")+"</a> | ":"")+maxTable.ui.buildEditControls(skinTable)+"</p>";
  1584. }
  1585. _dc+="</div>";
  1586. return _dc;
  1587. };
  1588. maxOptions.pages.skin.setSkin=function(_dd,_de,_df){
  1589. var _e0=skinTable.data[_de];
  1590. external.max_doResItem("skin","enable",_e0.path);
  1591. maxConfig.ini.setValue("Settings","Skin",_e0.path);
  1592. maxOptions.action.applyChanges();
  1593. };
  1594. maxOptions.pages.skin.exportItem=function(){
  1595. var _e1=skinTable.data[skinTable.inEditDataIndex];
  1596. external.max_doResItem("skin","export",_e1.path);
  1597. };
  1598. maxOptions.pages.skin.checkDeleteItem=function(_e2){
  1599. if(_e2.enabled){
  1600. alert($lang("can_not_delete_in_use"));
  1601. return false;
  1602. }
  1603. return true;
  1604. };
  1605. maxOptions.pages.skin.deleteItem=function(_e3){
  1606. var _e4=external.max_doResItem("skin","delete",_e3.path);
  1607. if(!_e4){
  1608. alert($lang("delete_failed"));
  1609. return false;
  1610. }
  1611. return true;
  1612. };
  1613. maxOptions.pages.plugin.init=function(){
  1614. pluginTable=maxTable.create("pluginTable");
  1615. 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}];
  1616. pluginTable.dataType="object";
  1617. pluginTable.data=maxConfig.res.load("plugin");
  1618. pluginTable.allowInsert=false;
  1619. pluginTable.showEditControl=false;
  1620. pluginTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"cancel"}];
  1621. pluginTable.controlUI["delete"]=$lang("delete");
  1622. pluginTable.controlUI["cancel"]=$lang("cancel");
  1623. pluginTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  1624. pluginTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  1625. pluginTable.style["edit"]="maxTable-edit-no-control";
  1626. pluginTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1627. pluginTable.event["beforeCheckboxClick"]=maxOptions.pages.plugin.beforeToggleItem;
  1628. pluginTable.event["afterCheckboxClick"]=maxOptions.pages.plugin.toggleItem;
  1629. pluginTable.event["afterDelete"]=maxOptions.pages.plugin.deleteItem;
  1630. maxTable.init(pluginTable);
  1631. };
  1632. maxOptions.pages.plugin.destroy=function(){
  1633. try{
  1634. maxTable.destroy(pluginTable);
  1635. }
  1636. catch(e){
  1637. }
  1638. };
  1639. maxOptions.pages.plugin.buildDescriptionHTML=function(_e5,_e6){
  1640. var _e7=pluginTable.data[_e5];
  1641. var _e8="";
  1642. _e8+="<strong>"+_e7.title.$encodeHTML()+"</strong>";
  1643. _e8+="<br/><span class=\"item-note\">"+$lang("version")+": "+_e7.version.$encodeHTML()+"   "+$lang("author")+": "+_e7.author.$encodeHTML()+"   <"+_e7.path.$encodeHTML()+">"+"</span>";
  1644. if(pluginTable.inAction=="edit"){
  1645. if(_e7.description){
  1646. _e8+="<div class=\"item-description\">"+_e7.description+"</div>";
  1647. }
  1648. var _e9=!_e7.enabled?$lang("enable"):$lang("disable");
  1649. _e8+="<p>"+"<a href=\"javascript:;\" onclick=\"maxTable.action.checkBoxClick(pluginTable, pluginTable.inEditRow, 0);\">"+_e9+"</a> | "+(_e7.config?"<a href=\"javascript:;\" onclick=\"maxOptions.pages.plugin.configItem()\">"+$lang("options")+"</a> | ":"")+(_e7.supportURL?"<a href=\""+_e7.supportURL+"\" target=\"_blank\">"+$lang("visit_website")+"</a> | ":"")+maxTable.ui.buildEditControls(pluginTable)+"</p>";
  1650. }
  1651. return _e8;
  1652. };
  1653. maxOptions.pages.plugin.toggleAllItems=function(_ea){
  1654. var _eb=_ea?"enable":"disable";
  1655. for(var i=0;i<pluginTable.data.length;i++){
  1656. pluginTable.data[i].enabled=_ea;
  1657. external.max_doResItem("plugin",_eb,pluginTable.data[i].path);
  1658. }
  1659. maxTable.init(pluginTable);
  1660. };
  1661. maxOptions.pages.plugin.beforeToggleItem=function(_ed,_ee){
  1662. if(_ee==1){
  1663. var _ef=pluginTable.data[_ed];
  1664. if(!_ef.canAutoStart&&!_ef.autoStart){
  1665. if(!confirm($lang("plugin_force_autostart"))){
  1666. return false;
  1667. }
  1668. }
  1669. }
  1670. return true;
  1671. };
  1672. maxOptions.pages.plugin.toggleItem=function(_f0,_f1){
  1673. var _f2=pluginTable.data[_f0];
  1674. var _f3="";
  1675. if(_f1==0){
  1676. _f3=_f2.enabled?"enable":"disable";
  1677. }else{
  1678. _f3=_f2.autoStart?"enable_autostart":"disable_autostart";
  1679. }
  1680. external.max_doResItem("plugin",_f3,_f2.path);
  1681. };
  1682. maxOptions.pages.plugin.configItem=function(){
  1683. var _f4=pluginTable.data[pluginTable.inEditDataIndex];
  1684. external.max_doResItem("plugin","config",_f4.path);
  1685. };
  1686. maxOptions.pages.plugin.exportItem=function(){
  1687. var _f5=pluginTable.data[pluginTable.inEditDataIndex];
  1688. external.max_doResItem("plugin","export",_f5.path);
  1689. };
  1690. maxOptions.pages.plugin.deleteItem=function(_f6){
  1691. external.max_doResItem("plugin","disable",_f6.path);
  1692. var _f7=external.max_doResItem("plugin","delete",_f6.path);
  1693. if(!_f7){
  1694. alert($lang("delete_failed"));
  1695. return false;
  1696. }
  1697. return true;
  1698. };
  1699. maxOptions.pages.filter.init=function(){
  1700. filterTable=maxTable.create("filterTable");
  1701. filterTable.columns=[{title:" ",name:"enabled",type:"checkbox",width:18},{title:$lang("description"),name:"description",type:"custom",customBuilder:maxOptions.pages.filter.buildDescriptionHTML,readOnly:true}];
  1702. filterTable.dataType="object";
  1703. filterTable.data=maxConfig.res.load("filter");
  1704. filterTable.allowInsert=false;
  1705. filterTable.showEditControl=false;
  1706. filterTable.editControl=[{type:"delete"},{type:"html",value:" | "},{type:"cancel"}];
  1707. filterTable.controlUI["delete"]=$lang("delete");
  1708. filterTable.controlUI["cancel"]=$lang("cancel");
  1709. filterTable.controlUI["checkbox"]="<img src=\"../_shared/images/btn_check.png\" />";
  1710. filterTable.controlUI["checkbox_checked"]="<img src=\"../_shared/images/btn_check_checked.png\" />";
  1711. filterTable.style["edit"]="maxTable-edit-no-control";
  1712. filterTable.lang["delete_confirm"]=$lang("maxtable_delete_confirm");
  1713. filterTable.event["afterCheckboxClick"]=maxOptions.pages.filter.toggleItem;
  1714. filterTable.event["afterDelete"]=maxOptions.pages.filter.deleteItem;
  1715. maxTable.init(filterTable);
  1716. };
  1717. maxOptions.pages.filter.destroy=function(){
  1718. try{
  1719. maxTable.destroy(filterTable);
  1720. }
  1721. catch(e){
  1722. }
  1723. };
  1724. maxOptions.pages.filter.buildDescriptionHTML=function(_f8,_f9){
  1725. var _fa=filterTable.data[_f8];
  1726. var _fb="";
  1727. if(!_fa.parseError){
  1728. _fb+="<strong>"+_fa.title.$encodeHTML()+"</strong>";
  1729. _fb+="<br/><span class=\"item-note\">"+$lang("version")+": "+_fa.version.$encodeHTML()+"   "+$lang("author")+": "+_fa.author.$encodeHTML()+"   <"+_fa.path.$encodeHTML()+">"+"</span>";
  1730. }else{
  1731. _fb+="<strong style=\"color: #CC0000;\"><"+_fa.path.$encodeHTML()+"></strong>";
  1732. _fb+="<br/><span style=\"color: #CC0000;\">"+$lang("parse_error")+"</span>";
  1733. }
  1734. if(filterTable.inAction=="edit"){
  1735. if(_fa.description){
  1736. _fb+="<div class=\"item-description\">"+_fa.description+"</div>";
  1737. }
  1738. var _fc=!_fa.enabled?$lang("enable"):$lang("disable");
  1739. _fb+="<p>"+"<a href=\"javascript:;\" onclick=\"maxTable.action.checkBoxClick(filterTable, filterTable.inEditRow, 0);\">"+_fc+"</a> | "+(_fa.supportURL?"<a href=\""+_fa.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>";
  1740. }
  1741. return _fb;
  1742. };
  1743. maxOptions.pages.filter.toggleAllItems=function(_fd){
  1744. var _fe=_fd?"enable":"disable";
  1745. for(var i=0;i<filterTable.data.length;i++){
  1746. filterTable.data[i].enabled=_fd;
  1747. external.max_doResItem("filter",_fe,filterTable.data[i].path);
  1748. }
  1749. maxTable.init(filterTable);
  1750. };
  1751. maxOptions.pages.filter.toggleItem=function(_100,_101){
  1752. var item=filterTable.data[_100];
  1753. var _103=item.enabled?"enable":"disable";
  1754. external.max_doResItem("filter",_103,item.path);
  1755. };
  1756. maxOptions.pages.filter.addItem=function(){
  1757. var _104=prompt($lang("input_filename"),"");
  1758. if(_104==null){
  1759. return;
  1760. }
  1761. if(_104==""){
  1762. alert($lang("invalid_filename"));
  1763. return;
  1764. }
  1765. if(!external.max_doResItem("filter","new",_104)){
  1766. alert($lang("invalid_filename"));
  1767. }else{
  1768. maxOptions.pages.filter.init();
  1769. }
  1770. };
  1771. maxOptions.pages.filter.editItem=function(){
  1772. var item=filterTable.data[filterTable.inEditDataIndex];
  1773. external.max_doResItem("filter","edit",item.path);
  1774. };
  1775. maxOptions.pages.filter.exportItem=function(){
  1776. var item=filterTable.data[filterTable.inEditDataIndex];
  1777. external.max_doResItem("filter","export",item.path);
  1778. };
  1779. maxOptions.pages.filter.deleteItem=function(_107){
  1780. var _108=external.max_doResItem("filter","delete",_107.path);
  1781. if(!_108){
  1782. alert($lang("delete_failed"));
  1783. return false;
  1784. }
  1785. return true;
  1786. };
  1787.  
  1788.