WordPress File Upload - Version 3.2.0

Version Description

  • added option in plugin's settings to relax CSS rules so that plugin inherits theme styling
  • modifications in html and css of editable subfolders feature to look better
  • modifications in html and css of prompt message when a required userdata field is empty
  • PLUGINDIR was replaced by WP_PLUGIN_DIR so that the plugin can work for websites where the contents dir is other than wp-content
  • fixed bug that was not allowing Shortcode Composer to launch when the shortcode was too big
  • fixed bug that was causing front-end file list not to work properly when no instance of the plugin existed in the same page / post
Download this release

Release Info

Developer nickboss
Plugin Icon 128x128 WordPress File Upload
Version 3.2.0
Comparing to
See all releases

Code changes from version 3.1.2 to 3.2.0

css/wordpress_file_upload_style.css CHANGED
@@ -1 +1 @@
1
- table.wfu_overlay_table td,td.file_messageblock_filenumber_td{text-align:center;vertical-align:middle}input[type=text].file_input_textbox{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:#fff;color:#000}input[type=text].file_input_textbox:disabled{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:#fff;color:silver}input[type=text].file_input_textbox_nofile{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:red;color:#000}form.file_input_uploadform{position:relative;width:100px;height:27px;overflow:hidden;margin:0;padding:0}input[type=button].file_input_button{color:#555;border-color:#BBB;border-radius:2px}input[type=button].file_input_button,input[type=button].file_input_button_hover{top:0;position:absolute;width:100px;height:27px;margin:0;padding:0;background-color:#EEE;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px}input[type=button].file_input_button_hover{color:#111;border-color:#333;border-radius:2px}input[type=button].file_input_button:disabled,input[type=button].file_input_button_hover:disabled{position:absolute;top:0;color:silver;border-radius:2px}input[type=button].file_input_button:disabled,input[type=button].file_input_button_hover:disabled,input[type=button].file_input_submit{width:100px;height:27px;margin:0;padding:0;background-color:#EEE;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px}input[type=button].file_input_submit{position:relative;color:#555;border-radius:2px}input[type=button].file_input_submit:focus,input[type=button].file_input_submit:hover{color:#111;border-color:#333;border-radius:2px}input[type=button].file_input_submit:disabled,input[type=button].file_input_submit:focus,input[type=button].file_input_submit:hover{margin:0;padding:0;width:100px;height:27px;position:relative;background-color:#EEE;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px}input[type=button].file_input_submit:disabled{color:silver;border-color:#BBB;border-radius:2px}div.file_div_clean,div.file_item_clean,div.file_space_clean,span.file_item_clean,table.file_table_clean,td.file_td_clean{background:0 0;color:#000}input[type=file].file_input_hidden{font-size:45px;position:absolute;right:0;top:0;margin:0;padding:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}div.file_progress_bar{display:block;position:relative;width:auto;border:1px solid #333;margin:0;padding:4px}div.file_progress_inner{display:block;width:100%;height:6px;margin:0;padding:0;border:1px solid silver;background-color:#fff}span.file_progress_noanimation,span.file_progress_progressive,span.file_progress_shuffle{margin:0;display:block;overflow:hidden;height:6px;padding:0;border-style:none;background-color:#2bc253;position:relative}img.file_progress_imagesafe{width:100%;height:6px}span.file_progress_noanimation{width:0}span.file_progress_progressive{width:auto}span.file_progress_shuffle{width:25%;-webkit-animation:shuffle 1s linear infinite alternate;-moz-animation:shuffle 1s linear infinite alternate;-o-animation:shuffle 1s linear infinite alternate;animation:shuffle 1s linear infinite alternate}span.file_progress_progressive:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:30px 30px;-moz-background-size:30px 30px;background-size:30px 30px;-webkit-animation:lengthen 2s linear infinite;-moz-animation:lengthen 2s linear infinite;-o-animation:lengthen 2s linear infinite;animation:lengthen 2s linear infinite;overflow:hidden}@-webkit-keyframes shuffle{from{left:0}to{left:75%}}@-moz-keyframes shuffle{from{left:0}to{left:75%}}@-o-keyframes shuffle{from{left:0}to{left:75%}}@keyframes shuffle{from{left:0}to{left:75%}}@-webkit-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-moz-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-o-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}span.file_messagebox_inner{display:block;width:340px;margin:0;font-size:small;padding:10px;border-style:solid;border-width:1px;border-color:#D3D3D3;background-color:#F5F5F5;color:#000;line-height:1.2}div.file_div_clean{display:table;position:relative;margin:0;padding:0;border-style:none;line-height:1}div.file_space_clean{display:block;margin:0 0 2px;padding:0;border-style:none}table.file_table_clean{margin:0;padding:0;border:none;border-spacing:0;width:auto}td.file_td_clean{margin:0;padding:0;border:none;border-spacing:0;vertical-align:middle}span.file_item_clean{margin:0;padding:0;border-style:none}div.file_item_clean{margin:0;padding:0;height:25px;border-style:none;position:relative;display:inline-block}div.file_item_clean_inner{margin:0;padding:0;border-style:none;background:0 0;position:absolute;top:3px;left:4px;bottom:3px;right:18px}input[type=text].file_item_clean{border:none;box-shadow:none;padding:0;width:100%;height:100%}input[type=text].file_item_clean:disabled{border:none;box-shadow:none;padding:0;width:100%;height:100%;color:silver}input[type=text].file_item_clean_match{border:none;box-shadow:none;padding:0;width:100%;height:100%;font-weight:700;font-style:italic}input[type=text].file_item_clean_match:disabled{border:none;box-shadow:none;padding:0;width:100%;height:100%;font-weight:700;font-style:italic;color:silver}input[type=text].file_item_clean_empty{border:none;box-shadow:none;padding:0;width:100%;height:100%;color:silver;font-style:italic}input[type=text].file_item_clean_prompt{border:none;box-shadow:none;padding:0;width:100%;height:100%;background:red}select.file_item_clean{margin:0;padding:0;height:25px;border-style:none;background:0 0;color:#000}select.file_item_clean_prompt{margin:0;padding:0;height:25px;border-style:none;background:red;color:#000}select.file_item_clean:disabled{margin:0;padding:0;height:25px;border-style:none;background:0 0;color:silver}select.file_item_clean option,select.file_item_clean_prompt option{background:#fff;color:#000}span.file_title_clean{margin:0;padding:0;border-style:none;background:0 0;color:#000}div.file_userdata_container{margin:0;padding:0;white-space:nowrap}label.file_userdata_label{margin:0;width:40%}input[type=text].file_userdata_message,input[type=text].file_userdata_message_required{width:60%;height:25px;margin:0;padding:0;border:1px solid #BBB;background:0 0;color:#000}input[type=text].file_userdata_message:disabled,input[type=text].file_userdata_message_required:disabled{width:60%;height:25px;margin:0;padding:0;border:1px solid #BBB;background:0 0;color:silver}input[type=text].file_userdata_message_required_empty{width:60%;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:red;color:#000}table.file_messageblock_table{margin:0;padding:0;border:none}td.file_messageblock_header_td{border:1px solid #ddd;margin:0;padding:0}div.file_messageblock_header{margin:0;padding:2px}label.file_messageblock_header_label{font-weight:700;font-size:12px;line-height:1}td.file_messageblock_arrow_td{border:1px solid #ddd;margin:0;padding:0;width:20px;vertical-align:middle}div.file_messageblock_header_arrow_down,div.file_messageblock_header_arrow_up{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;margin:5px 1px 1px 5px;font-size:0;line-height:0}div.file_messageblock_header_arrow_up{border-bottom:5px solid #555}div.file_messageblock_header_arrow_down{border-top:5px solid #555}td.file_messageblock_subheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_subheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_subheader_messagelabel{font-weight:400;font-size:12px;line-height:1}div.file_messageblock_subheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7;overflow:scroll}label.file_messageblock_subheader_debugmessage_label{margin:0;padding:0;background:0 0;border:none;font-weight:700}div.file_messageblock_subheader_debugmessage_container{margin:0 0 0 20px;padding:0;background:0 0;border:none;font-size:10px}label.file_messageblock_subheader_adminmessagelabel{font-weight:400;font-size:12px;font-style:italic;line-height:1}label.file_messageblock_fileheader_label,td.file_messageblock_filenumber_td{font-weight:700;font-size:11px;line-height:1}td.file_messageblock_filenumber_td{width:30px;margin:0;padding:2px;border:1px solid #ddd}td.file_messageblock_fileheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_fileheader{margin:0;padding:2px}td.file_messageblock_filearrow_td{margin:0;padding:0;width:20px;border:1px solid #ddd;vertical-align:middle}div.file_messageblock_file_arrow_down,div.file_messageblock_file_arrow_up{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;margin:5px 1px 1px 6px;font-size:0;line-height:0}div.file_messageblock_file_arrow_up{border-bottom:4px solid #555}div.file_messageblock_file_arrow_down{border-top:4px solid #555}td.file_messageblock_filesubheaderempty_td{width:30px;margin:0;padding:0;border:1px solid #ddd}td.file_messageblock_filesubheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_filesubheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_filesubheader_messagelabel{font-weight:400;font-size:11px;line-height:1}div.file_messageblock_filesubheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7}label.file_messageblock_filesubheader_adminmessagelabel{font-weight:400;font-size:11px;font-style:italic;line-height:1}div.wfu_overlay_editor{width:18px;height:18px;padding:2px;box-shadow:1px 1px 2px #aaa;position:absolute;top:0;left:0;z-index:2;display:none;background-color:#fff;line-height:1}.wfu_browser_container:hover div.wfu_overlay_editor,.wfu_container:hover div.wfu_overlay_editor{display:block}div.wfu_overlay_editor:hover{background-color:#ff0}button.wfu_overlay_editor_button,button.wfu_overlay_editor_button:focus{background:0 0;border:none;margin:0;padding:0;width:100%;height:100%;outline:0}div.wfu_overlay_container{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background-color:rgba(255,255,255,.7);z-index:2;display:none}table.wfu_overlay_table,table.wfu_overlay_table td,table.wfu_overlay_table tr{border:none;margin:0;padding:0;background:0 0;width:100%;height:100%}div.wfu_overlay_container_inner{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background:0 0}div.wfu_overlay_container label{margin-left:4px}
1
+ table.wfu_overlay_table td,td.file_messageblock_filenumber_td{text-align:center;vertical-align:middle}input[type=text].file_input_textbox{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:#fff;color:#000}input[type=text].file_input_textbox:disabled{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:#fff;color:silver}input[type=text].file_input_textbox_nofile{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid #BBB;background-color:red;color:#000}form.file_input_uploadform{position:relative;width:100px;height:27px;overflow:hidden;margin:0;padding:0}input[type=button].file_input_button{color:#555;border-color:#BBB;border-radius:2px}input[type=button].file_input_button,input[type=button].file_input_button_hover{top:0;position:absolute;width:100px;height:27px;margin:0;padding:0;background-color:#EEE;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px}input[type=button].file_input_button_hover{color:#111;border-color:#333;border-radius:2px}input[type=button].file_input_button:disabled,input[type=button].file_input_button_hover:disabled{position:absolute;top:0;color:silver;border-radius:2px}input[type=button].file_input_button:disabled,input[type=button].file_input_button_hover:disabled,input[type=button].file_input_submit{width:100px;height:27px;margin:0;padding:0;background-color:#EEE;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px}input[type=button].file_input_submit{position:relative;color:#555;border-radius:2px}input[type=button].file_input_submit:focus,input[type=button].file_input_submit:hover{color:#111;border-color:#333;border-radius:2px}input[type=button].file_input_submit:disabled,input[type=button].file_input_submit:focus,input[type=button].file_input_submit:hover{margin:0;padding:0;width:100px;height:27px;position:relative;background-color:#EEE;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px}input[type=button].file_input_submit:disabled{color:silver;border-color:#BBB;border-radius:2px}input[type=file].file_input_hidden{font-size:45px;position:absolute;right:0;top:0;margin:0;padding:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}div.file_progress_bar{display:block;position:relative;width:auto;border:1px solid #333;margin:0;padding:4px}div.file_progress_inner{display:block;width:100%;height:6px;margin:0;padding:0;border:1px solid silver;background-color:#fff}span.file_progress_noanimation,span.file_progress_progressive,span.file_progress_shuffle{overflow:hidden;margin:0;display:block;height:6px;padding:0;border-style:none;background-color:#2bc253;position:relative}img.file_progress_imagesafe{width:100%;height:6px}span.file_progress_noanimation{width:0}span.file_progress_progressive{width:auto}span.file_progress_shuffle{width:25%;-webkit-animation:shuffle 1s linear infinite alternate;-moz-animation:shuffle 1s linear infinite alternate;-o-animation:shuffle 1s linear infinite alternate;animation:shuffle 1s linear infinite alternate}span.file_progress_progressive:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:30px 30px;-moz-background-size:30px 30px;background-size:30px 30px;-webkit-animation:lengthen 2s linear infinite;-moz-animation:lengthen 2s linear infinite;-o-animation:lengthen 2s linear infinite;animation:lengthen 2s linear infinite;overflow:hidden}@-webkit-keyframes shuffle{from{left:0}to{left:75%}}@-moz-keyframes shuffle{from{left:0}to{left:75%}}@-o-keyframes shuffle{from{left:0}to{left:75%}}@keyframes shuffle{from{left:0}to{left:75%}}@-webkit-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-moz-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-o-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}span.file_messagebox_inner{display:block;width:340px;margin:0;font-size:small;padding:10px;border-style:solid;border-width:1px;border-color:#D3D3D3;background-color:#F5F5F5;color:#000;line-height:1.2}div.file_div_clean,div.file_space_clean,div.subfolder_container,span.subfolder_label,table.file_table_clean,td.file_td_clean{padding:0;background:0 0}div.file_div_clean{display:table;position:relative;margin:0;border-style:none;color:#000;line-height:1}div.file_space_clean{display:block;margin:0 0 2px;border-style:none;color:#000}table.file_table_clean{margin:0;border:none;border-spacing:0;color:#000;width:auto}td.file_td_clean{margin:0;border:none;border-spacing:0;color:#000;vertical-align:middle}span.subfolder_label{margin:0;border-style:none;color:#000}div.subfolder_container{margin:0;height:25px;border-style:none;color:#000;position:relative;display:inline-block}div.subfolder_autoplus_container{margin:0;padding:0 20px 0 0;border-style:none;background:0 0;display:inline-block;width:100%;height:100%}div.subfolder_autoplus_select_container{position:absolute;width:100%;height:100%;top:0;left:100%;margin:0 0 0 -20px;padding:0;border:none;background:0 0;overflow:hidden}select.subfolder_autoplus_dropdown,select.subfolder_autoplus_dropdown:disabled,select.subfolder_autoplus_dropdown_prompt{padding:0;width:100%;left:-100%;position:absolute;border:none}input[type=text].subfolder_autoplus{width:100%;height:100%;border:none;box-shadow:none;padding:0;margin:0}input[type=text].subfolder_autoplus:disabled{width:100%;height:100%;border:none;box-shadow:none;padding:0;margin:0;color:silver}input[type=text].subfolder_autoplus_match{width:100%;height:100%;border:none;box-shadow:none;padding:0;margin:0;font-weight:700;font-style:italic}input[type=text].subfolder_autoplus_match:disabled{width:100%;height:100%;border:none;box-shadow:none;padding:0;margin:0;font-weight:700;font-style:italic;color:silver}input[type=text].subfolder_autoplus_empty{width:100%;height:100%;border:none;box-shadow:none;padding:0;margin:0;color:silver;font-style:italic}input[type=text].subfolder_autoplus_prompt{width:100%;height:100%;border:none;box-shadow:none;padding:0;margin:0;background:red}select.subfolder_dropdown{margin:0;padding:0;height:25px;border:none;background:0 0;color:#000}select.subfolder_autoplus_dropdown{height:100%;background:0 0;color:#000;margin:0 0 0 20px}select.subfolder_dropdown_prompt{margin:0;padding:0;height:25px;border:none;background:red;color:#000}select.subfolder_autoplus_dropdown_prompt{height:100%;background:red;color:#000;margin:0 0 0 20px}select.subfolder_dropdown:disabled{margin:0;padding:0;height:25px;border:none;background:0 0;color:silver}select.subfolder_autoplus_dropdown:disabled{height:100%;background:0 0;color:silver;margin:0 0 0 20px}select.subfolder_autoplus_dropdown option,select.subfolder_autoplus_dropdown_prompt option,select.subfolder_dropdown option,select.subfolder_dropdown_prompt option{background:#fff;color:#000}span.file_title_clean{margin:0;padding:0;border-style:none;background:0 0;color:#000}div.file_userdata_container{margin:0;padding:0;white-space:nowrap;position:relative}label.file_userdata_label{margin:0;width:40%;display:inline-block}input[type=text].file_userdata_message,input[type=text].file_userdata_message_required{width:60%;height:25px;margin:0;padding:0;border:1px solid #BBB;background:0 0;color:#000}input[type=text].file_userdata_message:disabled,input[type=text].file_userdata_message_required:disabled{width:60%;height:25px;margin:0;padding:0;border:1px solid #BBB;background:0 0;color:silver}input[type=text].file_userdata_message_required_empty{width:60%;height:25px;margin:0;padding:0;border:1px solid #BBB;box-shadow:inset 0 0 2px 2px red;color:#000}input[type=text].file_userdata_message_required_empty::after{content:'not empty'}div.file_userdata_hint:after,div.file_userdata_hint:before{position:absolute;content:'';display:inline-block}div.file_userdata_hint{position:absolute;background:#eee;border:1px solid red;border-radius:6px;padding:6px;margin-left:10px;box-shadow:0 0 2px rgba(0,0,0,.2);z-index:1000000}div.file_userdata_hint:before{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid #eee;border-right-color:red;left:-8px;top:6px}div.file_userdata_hint:after{border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #eee;left:-6px;top:7px}table.file_messageblock_table{margin:0;padding:0;border:none}td.file_messageblock_header_td{border:1px solid #ddd;margin:0;padding:0}div.file_messageblock_header{margin:0;padding:2px}label.file_messageblock_header_label{font-weight:700;font-size:12px;line-height:1}td.file_messageblock_arrow_td{border:1px solid #ddd;margin:0;padding:0;width:20px;vertical-align:middle}div.file_messageblock_header_arrow_down,div.file_messageblock_header_arrow_up{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;margin:5px 1px 1px 5px;font-size:0;line-height:0}div.file_messageblock_header_arrow_up{border-bottom:5px solid #555}div.file_messageblock_header_arrow_down{border-top:5px solid #555}td.file_messageblock_subheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_subheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_subheader_messagelabel{font-weight:400;font-size:12px;line-height:1}div.file_messageblock_subheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7;overflow:scroll}label.file_messageblock_subheader_debugmessage_label{margin:0;padding:0;background:0 0;border:none;font-weight:700}div.file_messageblock_subheader_debugmessage_container{margin:0 0 0 20px;padding:0;background:0 0;border:none;font-size:10px}label.file_messageblock_subheader_adminmessagelabel{font-weight:400;font-size:12px;font-style:italic;line-height:1}label.file_messageblock_fileheader_label,td.file_messageblock_filenumber_td{font-weight:700;font-size:11px;line-height:1}td.file_messageblock_filenumber_td{width:30px;margin:0;padding:2px;border:1px solid #ddd}td.file_messageblock_fileheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_fileheader{margin:0;padding:2px}td.file_messageblock_filearrow_td{margin:0;padding:0;width:20px;border:1px solid #ddd;vertical-align:middle}div.file_messageblock_file_arrow_down,div.file_messageblock_file_arrow_up{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;margin:5px 1px 1px 6px;font-size:0;line-height:0}div.file_messageblock_file_arrow_up{border-bottom:4px solid #555}div.file_messageblock_file_arrow_down{border-top:4px solid #555}td.file_messageblock_filesubheaderempty_td{width:30px;margin:0;padding:0;border:1px solid #ddd}td.file_messageblock_filesubheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_filesubheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_filesubheader_messagelabel{font-weight:400;font-size:11px;line-height:1}div.file_messageblock_filesubheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7}label.file_messageblock_filesubheader_adminmessagelabel{font-weight:400;font-size:11px;font-style:italic;line-height:1}div.wfu_overlay_editor{width:18px;height:18px;padding:2px;box-shadow:1px 1px 2px #aaa;position:absolute;top:0;left:0;z-index:2;display:none;background-color:#fff;line-height:1}.wfu_browser_container:hover div.wfu_overlay_editor,.wfu_container:hover div.wfu_overlay_editor{display:block}div.wfu_overlay_editor:hover{background-color:#ff0}button.wfu_overlay_editor_button,button.wfu_overlay_editor_button:focus{background:0 0;border:none;margin:0;padding:0;width:100%;height:100%;outline:0}div.wfu_overlay_container{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background-color:rgba(255,255,255,.7);z-index:2;display:none}table.wfu_overlay_table,table.wfu_overlay_table td,table.wfu_overlay_table tr{border:none;margin:0;padding:0;background:0 0;width:100%;height:100%}div.wfu_overlay_container_inner{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background:0 0}div.wfu_overlay_container label{margin-left:4px}
css/wordpress_file_upload_style_relaxed.css ADDED
@@ -0,0 +1 @@
 
1
+ table.wfu_overlay_table td,td.file_messageblock_filenumber_td{text-align:center;vertical-align:middle}input[type=text].file_input_textbox,input[type=text].file_input_textbox:disabled,input[type=text].file_input_textbox_nofile{position:relative}form.file_input_uploadform{position:relative;overflow:hidden}input[type=file].file_input_hidden{font-size:45px;position:absolute;right:0;top:0;margin:0;padding:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}div.file_progress_bar{display:block;position:relative;width:auto;border:1px solid #333;margin:0;padding:4px}div.file_progress_inner{display:block;width:100%;height:6px;margin:0;padding:0;border:1px solid silver;background-color:#fff}span.file_progress_noanimation,span.file_progress_progressive,span.file_progress_shuffle{overflow:hidden;margin:0;display:block;height:6px;padding:0;border-style:none;background-color:#2bc253;position:relative}img.file_progress_imagesafe{width:100%;height:6px}span.file_progress_noanimation{width:0}span.file_progress_progressive{width:auto}span.file_progress_shuffle{width:25%;-webkit-animation:shuffle 1s linear infinite alternate;-moz-animation:shuffle 1s linear infinite alternate;-o-animation:shuffle 1s linear infinite alternate;animation:shuffle 1s linear infinite alternate}span.file_progress_progressive:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:30px 30px;-moz-background-size:30px 30px;background-size:30px 30px;-webkit-animation:lengthen 2s linear infinite;-moz-animation:lengthen 2s linear infinite;-o-animation:lengthen 2s linear infinite;animation:lengthen 2s linear infinite;overflow:hidden}@-webkit-keyframes shuffle{from{left:0}to{left:75%}}@-moz-keyframes shuffle{from{left:0}to{left:75%}}@-o-keyframes shuffle{from{left:0}to{left:75%}}@keyframes shuffle{from{left:0}to{left:75%}}@-webkit-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-moz-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-o-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}span.file_messagebox_inner{display:block;width:340px;margin:0;font-size:small;padding:10px;border-style:solid;border-width:1px;border-color:#D3D3D3;background-color:#F5F5F5;line-height:1.2}div.file_div_clean,div.file_space_clean,div.subfolder_autoplus_container,div.subfolder_container{background:0 0;border-style:none}div.file_div_clean{display:table;position:relative;margin:0;padding:0;line-height:1}div.file_space_clean{display:block;margin:0 0 2px;padding:0}table.file_table_clean{margin:0;padding:0;border:none;border-spacing:0;background:0 0;width:auto}td.file_td_clean{margin:0;padding:0;border:none;border-spacing:0;background:0 0;vertical-align:middle}div.subfolder_container{margin:0;padding:0;position:relative;display:inline-block}div.subfolder_autoplus_container{margin:0;padding:0 20px 0 0;display:inline-block;width:100%;height:100%}div.subfolder_autoplus_select_container{position:absolute;width:100%;height:100%;top:0;left:100%;margin:0 0 0 -20px;padding:0;border:none;background:0 0;overflow:hidden}select.subfolder_autoplus_dropdown_prompt,select.subfolder_dropdown_prompt{background:red}select.subfolder_autoplus_dropdown,select.subfolder_autoplus_dropdown:disabled,select.subfolder_autoplus_dropdown_prompt{width:100%;height:100%;left:-100%;position:absolute;margin-left:20px}input[type=text].subfolder_autoplus,input[type=text].subfolder_autoplus:disabled{width:100%}input[type=text].subfolder_autoplus_match,input[type=text].subfolder_autoplus_match:disabled{width:100%;font-weight:700;font-style:italic}input[type=text].subfolder_autoplus_empty{width:100%;font-style:italic}input[type=text].subfolder_autoplus_prompt{width:100%;background:red}select.subfolder_autoplus_dropdown option,select.subfolder_autoplus_dropdown_prompt option,select.subfolder_dropdown option,select.subfolder_dropdown_prompt option{background:#fff}div.file_userdata_container{margin:0;padding:0;white-space:nowrap;position:relative}label.file_userdata_label{width:40%;display:inline-block}input[type=text].file_userdata_message,input[type=text].file_userdata_message:disabled,input[type=text].file_userdata_message_required,input[type=text].file_userdata_message_required:disabled{width:60%}input[type=text].file_userdata_message_required_empty{width:60%;box-shadow:inset 0 0 2px 2px red}input[type=text].file_userdata_message_required_empty::after{content:'not empty'}div.file_userdata_hint:after,div.file_userdata_hint:before{position:absolute;content:'';display:inline-block}div.file_userdata_hint{position:absolute;background:#eee;border:1px solid red;border-radius:6px;padding:6px;margin-left:10px;box-shadow:0 0 2px rgba(0,0,0,.2);z-index:1000000}div.file_userdata_hint:before{border-top:7px solid transparent;border-bottom:7px solid transparent;border-right:7px solid #eee;border-right-color:red;left:-8px;top:6px}div.file_userdata_hint:after{border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid #eee;left:-6px;top:7px}table.file_messageblock_table{margin:0;padding:0;border:none}td.file_messageblock_header_td{border:1px solid #ddd;margin:0;padding:0}div.file_messageblock_header{margin:0;padding:2px}label.file_messageblock_header_label{font-weight:700;font-size:12px;line-height:1}td.file_messageblock_arrow_td{border:1px solid #ddd;margin:0;padding:0;width:20px;vertical-align:middle}div.file_messageblock_header_arrow_down,div.file_messageblock_header_arrow_up{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;margin:5px 1px 1px 5px;font-size:0;line-height:0}div.file_messageblock_header_arrow_up{border-bottom:5px solid #555}div.file_messageblock_header_arrow_down{border-top:5px solid #555}td.file_messageblock_subheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_subheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_subheader_messagelabel{font-weight:400;font-size:12px;line-height:1}div.file_messageblock_subheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7;overflow:scroll}label.file_messageblock_subheader_debugmessage_label{margin:0;padding:0;background:0 0;border:none;font-weight:700}div.file_messageblock_subheader_debugmessage_container{margin:0 0 0 20px;padding:0;background:0 0;border:none;font-size:10px}label.file_messageblock_subheader_adminmessagelabel{font-weight:400;font-size:12px;font-style:italic;line-height:1}label.file_messageblock_fileheader_label,td.file_messageblock_filenumber_td{font-weight:700;font-size:11px;line-height:1}td.file_messageblock_filenumber_td{width:30px;margin:0;padding:2px;border:1px solid #ddd}td.file_messageblock_fileheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_fileheader{margin:0;padding:2px}td.file_messageblock_filearrow_td{margin:0;padding:0;width:20px;border:1px solid #ddd;vertical-align:middle}div.file_messageblock_file_arrow_down,div.file_messageblock_file_arrow_up{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;margin:5px 1px 1px 6px;font-size:0;line-height:0}div.file_messageblock_file_arrow_up{border-bottom:4px solid #555}div.file_messageblock_file_arrow_down{border-top:4px solid #555}td.file_messageblock_filesubheaderempty_td{width:30px;margin:0;padding:0;border:1px solid #ddd}td.file_messageblock_filesubheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_filesubheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_filesubheader_messagelabel{font-weight:400;font-size:11px;line-height:1}div.file_messageblock_filesubheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7}label.file_messageblock_filesubheader_adminmessagelabel{font-weight:400;font-size:11px;font-style:italic;line-height:1}div.wfu_overlay_editor{width:18px;height:18px;padding:2px;box-shadow:1px 1px 2px #aaa;position:absolute;top:0;left:0;z-index:2;display:none;background-color:#fff;line-height:1}.wfu_browser_container:hover div.wfu_overlay_editor,.wfu_container:hover div.wfu_overlay_editor{display:block}div.wfu_overlay_editor:hover{background-color:#ff0}button.wfu_overlay_editor_button,button.wfu_overlay_editor_button:focus{background:0 0;border:none;margin:0;padding:0;width:100%;height:100%;outline:0}div.wfu_overlay_container{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background-color:rgba(255,255,255,.7);z-index:2;display:none}table.wfu_overlay_table,table.wfu_overlay_table td,table.wfu_overlay_table tr{border:none;margin:0;padding:0;background:0 0;width:100%;height:100%}div.wfu_overlay_container_inner{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background:0 0}div.wfu_overlay_container label{margin-left:4px}
css/wordpress_file_upload_style_safe_relaxed.css ADDED
@@ -0,0 +1 @@
 
1
+ input.file_input_textbox,input.file_input_textbox:disabled,input.file_input_textbox_nofile{position:relative}input.file_input_hidden{font-size:45px;position:absolute;right:0;top:0;margin:0;padding:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}input.file_userdata_message,input.file_userdata_message:disabled,input.file_userdata_message_required,input.file_userdata_message_required:disabled{width:60%}input.file_userdata_message_required_empty{width:60%;background-color:red}
js/wordpress_file_upload_functions.js CHANGED
@@ -1,2 +1,2 @@
1
- function wfu_Initialize_Consts(e){if("undefined"==typeof GlobalData.consts){GlobalData.consts=new Object;for(var a=e.split(";"),s=0;s<a.length;s++)const_txt=a[s].split(":"),GlobalData.consts[wfu_plugin_decode_string(const_txt[0])]=wfu_plugin_decode_string(const_txt[1])}}function wfu_plugin_load_action(e){wfu_install_unload_hook();var a=document.getElementById("selectsubdiredit_"+e);a&&"none"!=a.style.display&&wfu_attach_element_handlers(a,new Function("wfu_selectsubdiredit_change("+e+");"))}function wfu_install_unload_hook(){window.onbeforeunload=wfu_unload_hook}function wfu_unload_hook(){return""!=GlobalData.UploadInProgressString&&""!=GlobalData.UploadInProgressString.trim()?GlobalData.consts.wfu_pageexit_prompt:void 0}function wfu_Check_Browser_Capabilities(){if("undefined"==typeof wfu_BrowserCaps){wfu_BrowserCaps=new Object;var e=wfu_GetHttpRequestObject();wfu_BrowserCaps.supportsAJAX=null!=e,wfu_BrowserCaps.supportsUploadProgress=!!(e&&"upload"in e&&"onprogress"in e.upload);var a=null;try{var a=new FormData}catch(s){}wfu_BrowserCaps.supportsHTML5=null!=a;var s=document.createElement("iframe");wfu_BrowserCaps.supportsIFRAME=null!=s,wfu_BrowserCaps.supportsDRAGDROP=window.FileReader?!0:!1,wfu_BrowserCaps.supportsAnimation=wfu_check_animation(),wfu_BrowserCaps.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0}}function wfu_check_animation(){var e=!1,a="animation",s="",t="Webkit Moz O ms Khtml".split(" "),n="",r=document.createElement("DIV");if(r.style.animationName&&(e=!0),e===!1)for(var l=0;l<t.length;l++)if(void 0!==r.style[t[l]+"AnimationName"]){n=t[l],a=n+"Animation",s="-"+n.toLowerCase()+"-",e=!0;break}return e}function wfu_join_strings(e){for(var a=[].slice.call(arguments),s="",t="",n=1;n<a.length;n++)t=""==s||""==a[n]?"":e,s+=t+a[n];return s}function wfu_plugin_decode_string(e){for(var a,s,t=0,n="";t<e.length;)a=parseInt(e.substr(t,2),16),s=128>a?a:224>a?((31&a)<<6)+(63&parseInt(e.substr(t+=2,2),16)):((15&a)<<12)+((63&parseInt(e.substr(t+=2,2),16))<<6)+(63&parseInt(e.substr(t+=2,2),16)),n+=String.fromCharCode(s),t+=2;return n}function wfu_plugin_encode_string(e){var a=0,s="",t="";for(a=0;a<e.length;a++)num=e.charCodeAt(a),num>=2048?num=((16773120&num|917504)<<4)+((4032&num|8192)<<2)+(63&num|128):num>=128&&(num=((65472&num|12288)<<2)+(63&num|128)),t=num.toString(16),(1==t.length||3==t.length||5==t.length)&&(t="0"+t),s+=t;return s}function wfu_randomString(e){for(var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",s=e,t="",n=0;s>n;n++){var r=Math.floor(Math.random()*a.length);t+=a.substring(r,r+1)}return t}function wfu_addEventHandler(e,a,s){e.addEventListener?e.addEventListener(a,s,!1):e.attachEvent?e.attachEvent("on"+a,s):e["on"+a]=s}function wfu_attach_element_handlers(e,a){for(var s=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"],t=0;t<s.length;t++)wfu_addEventHandler(e,s[t],a)}function wfu_GetHttpRequestObject(){var e=null;try{e=new XMLHttpRequest}catch(a){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(s){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}}if(null==e&&window.createRequest)try{xmlhttp=window.createRequest()}catch(a){}return e}function wfu_filedetails_showhide(e,a,s){var t=(document.getElementById("wfu_messageblock_arrow_"+e+"_"+a),document.getElementById("wfu_messageblock_arrow_"+e+"_up_"+a)),n=document.getElementById("wfu_messageblock_arrow_"+e+"_down_"+a),r=document.getElementById("wfu_messageblock_subheader_"+e+"_"+a),l=document.getElementById("wfu_messageblock_header_"+e+"_state_"+a);s?(t.style.display="",n.style.display="none",r.style.display="",l.value=""):(t.style.display="none",n.style.display="",r.style.display="none",l.value="none")}function wfu_get_file_ids(e){for(var a=(document.getElementById("wfu_messageblock_"+e),document.getElementById("wfu_messageblock_subheader_"+e).nextSibling),s="wfu_messageblock_"+e+"_",t=[];null!=a;)1===a.nodeType&&a.id.substr(0,s.length)==s&&t.push(a.id.substr(a.id.lastIndexOf("_")+1)),a=a.nextSibling;return t}function wfu_get_filelist(e,a){a="undefined"!=typeof a?a:!0;var s=document.getElementById("upfile_"+e),t=s.files;return t||(t=s.value?[{name:s.value}]:[]),a&&"undefined"!=typeof s.filearray&&(t=s.filearray),t}function wfu_filedetails_toggle(e,a){var s=(document.getElementById("wfu_messageblock_arrow_"+e+"_"+a),document.getElementById("wfu_messageblock_arrow_"+e+"_up_"+a));wfu_filedetails_showhide(e,a,"none"==s.style.display)}function wfu_headerdetails_showhide(e,a){var s=(document.getElementById("wfu_messageblock_arrow_"+e),document.getElementById("wfu_messageblock_arrow_"+e+"_up")),t=document.getElementById("wfu_messageblock_arrow_"+e+"_down"),n=document.getElementById("wfu_messageblock_subheader_"+e),r=document.getElementById("wfu_messageblock_subheader_"+e+"_message"),l=document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage"),i=document.getElementById("wfu_messageblock_header_"+e+"_state"),o=wfu_get_file_ids(e);if(a){s.style.display="",t.style.display="none",("none"!=r.style.display||"none"!=l.style.display)&&(n.style.display=""),i.value="";for(var _=0;_<o.length;_++)document.getElementById("wfu_messageblock_"+e+"_"+o[_]).style.display="",document.getElementById("wfu_messageblock_subheader_"+e+"_"+o[_]).style.display=document.getElementById("wfu_messageblock_header_"+e+"_state_"+o[_]).value}else{s.style.display="none",t.style.display="",n.style.display="none",i.value="none";for(var _=0;_<o.length;_++)document.getElementById("wfu_messageblock_"+e+"_"+o[_]).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_"+o[_]).style.display="none"}}function wfu_headerdetails_toggle(e){var a=(document.getElementById("wfu_messageblock_arrow_"+e),document.getElementById("wfu_messageblock_arrow_"+e+"_up"));wfu_headerdetails_showhide(e,"none"==a.style.display)}function wfu_selectbutton_changed(e,a){wfu_BrowserCaps.supportsAJAX&&wfu_BrowserCaps.supportsHTML5||(a=0);var s=document.getElementById("upfile_"+e),t=wfu_get_filelist(e,!1);if(1==a){"undefined"==typeof s.filearray&&(s.filearray=Array());for(var n=0;n<t.length;n++)s.filearray.push(t[n])}else"undefined"!=typeof s.filearray&&delete s.filearray;wfu_update_filename_text(e)}function wfu_selectbutton_clicked(e){var a=document.getElementById("wordpress_file_upload_message_"+e);a&&(a.style.display="none"),wfu_reset_message(e),document.getElementById("upfile_"+e).value="";var s=document.getElementById("fileName_"+e);s&&(s.value="",s.className="file_input_textbox")}function wfu_update_uploadbutton_status(e){var a=document.getElementById("upload_"+e);if(a){var s=wfu_get_filelist(e),t=s.length>0;a.disabled=!t}}function wfu_update_filename_text(e){var a=document.getElementById("fileName_"+e);if(a){for(var s=wfu_get_filelist(e),t="",n=0;n<s.length;n++)""!=t&&(t+=", "),t+=s[n].name.replace(/c:\\fakepath\\/i,"");a.value=t}}function wfu_selectsubdir_check(e){var a=document.getElementById("selectsubdir_"+e);if(!a)return!0;var s=document.getElementById("selectsubdiredit_"+e),t="none"!=s.style.display;return t&&a.selectedIndex>0&&(s.value=a.value.replace(/^\s+/,""),s.className="file_item_clean_match",wfu_selectsubdiredit_change(e)),document.getElementById("hiddeninput_"+e).value=t?s.value:a.selectedIndex,!t&&0==a.selectedIndex||t&&(""==s.value||"file_item_clean_empty"==s.className)?(a.className="file_item_clean_prompt",t&&(s.className="file_item_clean_prompt",s.value=""),!1):(a.className="file_item_clean",t&&"file_item_clean_prompt"==s.className&&(s.className="file_item_clean"),a.options[0].style.display="none",!0)}function wfu_selectsubdiredit_enter(e){var a=document.getElementById("selectsubdir_"+e),s=document.getElementById("selectsubdiredit_"+e);"file_item_clean_empty"==s.className&&(s.value=""),a.className="file_item_clean",s.className="file_item_clean"}function wfu_selectsubdiredit_exit(e){var a=document.getElementById("selectsubdiredit_"+e);""==a.value&&(a.value=GlobalData.consts.wfu_subdir_typedir,a.className="file_item_clean_empty")}function wfu_selectsubdiredit_change(e){var a=document.getElementById("selectsubdir_"+e),s=document.getElementById("selectsubdiredit_"+e);if("none"!=s.style.display){if("file_item_clean_empty"==s.className)return a.selectedIndex=0,void(document.getElementById("hiddeninput_"+e).value="");document.getElementById("hiddeninput_"+e).value=s.value;for(var t,n=!1,r=1;r<a.options.length;r++)t=a.options[r].value.replace(/^\s+/,"").toLowerCase(),a.options[r].style.display=s.value.length>=3?t.substr(0,s.value.length)==s.value.toLowerCase()?"block":"none":"block",a.options[r].value.replace(/^\s+/,"")==s.value&&(a.selectedIndex=r,s.className="file_item_clean_match",n=!0);n||(a.selectedIndex=0,s.className="file_item_clean")}}function wfu_selectsubdir_disable_onoff(e,a){var s=document.getElementById("selectsubdir_"+e);if(!s)return!0;var t=document.getElementById("selectsubdiredit_"+e),n="none"!=t.style.display;s.disabled=a,n&&(t.disabled=a)}function wfu_Redirect(e){window.location=e}function wfu_loadStart(){}function wfu_uploadProgress(e,a,s,t){t&&"undefined"==typeof this.xhr&&(console.log("total="+e.total+", loaded="+e.loaded),console.log(e));var n=GlobalData[a].xhrs[s],r=0,l=0,i=document.getElementById("progressbar_"+a+"_animation");if(e.lengthComputable){if(n.sizeloaded=e.loaded,n.size<e.total&&e.total>0){l=e.total-n.size,n.deltasize+=l,n.size+=l;for(var o=0;o<GlobalData[a].xhrs.length;o++)GlobalData[a].xhrs[o].file_id==n.file_id&&(GlobalData[a].xhrs[o].totalsize+=l)}if(i){for(var _=0,d=0,u=[],o=0;o<GlobalData[a].xhrs.length;o++)u[GlobalData[a].xhrs[o].file_id]=0;for(var o=0;o<GlobalData[a].xhrs.length;o++)u[GlobalData[a].xhrs[o].file_id]=Math.max(GlobalData[a].xhrs[o].totalsize,u[GlobalData[a].xhrs[o].file_id]);for(var o=0;o<u.length;o++)"undefined"!=typeof u[o]&&(_+=u[o]);for(var o=0;o<GlobalData[a].xhrs.length;o++)d+=GlobalData[a].xhrs[o].sizeloaded;r=Math.round(100*d/_),i.style.width=r.toString()+"%"}}else i&&(i.style.width="0%")}function wfu_notify_WPFilebase(e,a){var s=wfu_GetHttpRequestObject();if(null==s){var t=document.createElement("iframe");return t.style.display="none",t.src=GlobalData.consts.ajax_url+"?action=wfu_ajax_action_notify_wpfilebase&params_index="+e+"&session_token="+a,void document.body.appendChild(t)}var n=GlobalData.consts.ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_notify_wpfilebase",params[1]=new Array(2),params[1][0]="params_index",params[1][1]=e,params[2]=new Array(2),params[2][0]="session_token",params[2][1]=a;for(var r="",t=0;t<params.length;t++)r+=(t>0?"&":"")+params[t][0]+"="+encodeURI(params[t][1]);s.open("POST",n,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onreadystatechange=function(){},s.send(r)}function wfu_send_email_notification(e,a,s,t,n,r,l,i,o){var _=wfu_GetHttpRequestObject();if(null!=_){var d=GlobalData.consts.ajax_url,u=wfu_get_userdata_count(e);params=new Array(7+u),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_send_email_notification",params[1]=new Array(2),params[1][0]="params_index",params[1][1]=s,params[2]=new Array(2),params[2][0]="session_token",params[2][1]=t,params[3]=new Array(2),params[3][0]="only_filename_list",params[3][1]=n,params[4]=new Array(2),params[4][0]="target_path_list",params[4][1]=r,params[5]=new Array(2),params[5][0]="attachment_list",params[5][1]=l,params[6]=new Array(2),params[6][0]="uniqueuploadid_"+e,params[6][1]=a;for(var m=0;u>m;m++)params[7+m]=new Array(2),params[7+m][0]="userdata_"+m,params[7+m][1]=wfu_plugin_encode_string(document.getElementById("hiddeninput_"+e+"_userdata_"+m).value);for(var c="",m=0;m<params.length;m++)c+=(m>0?"&":"")+params[m][0]+"="+encodeURI(params[m][1]);var f=new Date;_.xhrid=-1,_.shortcode_id=e,_.requesttype="email",_.file_id=0,_.loading=!1,_.aborted=!1,_.unique_id=a,_.debugmode=i,_.is_admin=o,_.params_index=s,_.session_token=t,_.start_time=f.getTime(),_.end_time=_.start_time,_.finish_time=_.start_time+1e3*parseInt(GlobalData.consts.max_time_limit),_.fail_colors=GlobalData.consts.fail_colors,_.error_message_header="",_.error_message_failed=GlobalData.consts.message_failed,_.error_message_cancelled=GlobalData.consts.message_cancelled,_.error_adminmessage_unknown="",_.open("POST",d,!0),_.setRequestHeader("Content-type","application/x-www-form-urlencoded"),_.addEventListener("load",wfu_uploadComplete,!1),_.addEventListener("error",wfu_uploadFailed,!1),_.addEventListener("abort",wfu_uploadCanceled,!1),_.send(c)}}function wfu_format_debug_data(e,a){return output='<label class="file_messageblock_subheader_debugmessage_label">',output+="Debug Data"+a,output+="</label>",output+='<div class="file_messageblock_subheader_debugmessage_container">',output+=e,output+="</div>"}function wfu_uploadComplete(e){var a=new Date,s=this.shortcode_id,t=(this.file_id,!1),n="",r="",l="",i="unknown",o="",_="",d="wfu_fileupload_success:";this.loading=!1,this.end_time=a.getTime();var u=e.target.responseText,m=u,c="error";if(-1!=u&&u.indexOf("force_errorabort_code")>-1&&(c="errorabort",u=u.replace("force_errorabort_code","")),-1!=u){var f=u.indexOf(d);if(f>-1&&("true"==this.debugmode&&(_=u.substr(0,f)),m=u.substr(f+d.length),f=m.indexOf(":"),n=m.substr(0,f),m=m.substr(f+1),f=m.indexOf(":"),l=m.substr(0,f),r=m.substr(f+1)),""!=_){var g="";"fileupload"==this.requesttype?g=" - File: "+this.file_id:"email"==this.requesttype&&(g=" - Email Notification"),_=wfu_format_debug_data(_,g)}if(""!=l){var p=l.split(";");if(1==parseInt(p[2])){var b=p[3].split(",");i=wfu_plugin_decode_string(b[0]),o=b[4]}}}if(""==r||""==l){var y=this.fail_colors.split(","),w=wfu_Initialize_Params();w.general.shortcode_id=s,w.general.unique_id=this.unique_id,w.general.state=7,w.general.files_count="fileupload"==this.requesttype?1:0,w.general.upload_finish_time=this.finish_time,w.general.fail_message=GlobalData.consts.message_unknown,w.general.fail_admin_message=wfu_join_strings("<br />",this.error_adminmessage_unknown,this.requesttype+":"+m),w.general.files_count>0?(w[0]={},w[0].color=y[0],w[0].bgcolor=y[1],w[0].borcolor=y[2],w[0].message_type=c,i=c,w[0].header=this.error_message_header,w[0].message=GlobalData.consts.message_timelimit,w[0].admin_messages="true"==this.is_admin?GlobalData.consts.message_admin_timelimit:""):w.general.admin_messages.other="true"==this.is_admin?GlobalData.consts.message_admin_timelimit:"",w.general.upload_finish_time>0&&a.getTime()<w.general.upload_finish_time&&(w.general.files_count>0?(w[0].message=w.general.fail_message,w[0].admin_messages="true"==this.is_admin?w.general.fail_admin_message:""):w.general.admin_messages.other="true"==this.is_admin?w.general.fail_admin_message:"")}return t=""==r||""==l?wfu_ProcessUploadComplete(s,this.file_id,w,this.unique_id,this.params_index,this.session_token,"",[this.debugmode,_,this.is_admin],this.requesttype,""):wfu_ProcessUploadComplete(s,this.file_id,r,this.unique_id,this.params_index,this.session_token,l,[this.debugmode,_,this.is_admin],this.requesttype,n),t&&(wfu_unlock_upload(e.target.shortcode_id),wfu_hide_simple_progressbar(s),wfu_clear(e.target.shortcode_id)),e.target.return_status?i:void 0}function wfu_ProcessUploadComplete(sid,file_id,upload_params,unique_id,params_index,session_token,safe_output,debug_data,request_type,js_script_enc){if(sid&&!(0>sid)&&null!=upload_params&&""!=upload_params&&""!=unique_id&&("no-ajax"==unique_id||GlobalData[sid])){var do_redirect=!1;if("string"==typeof upload_params){upload_params=wfu_plugin_decode_string(upload_params.replace(/^\s+|\s+$/g,""));var Params=null;try{Params=JSON.parse(upload_params)}catch(e){}if(null==Params){var safe_parts=safe_output.split(";");Params=wfu_Initialize_Params(),Params.general.shortcode_id=sid,Params.general.unique_id=unique_id,Params.general.state=safe_parts[0],4==Params.general.state&&Params.general.state++;var default_colors=safe_parts[1].split(","),filedata="",error_jsonparse_filemessage=GlobalData.consts.jsonparse_filemessage,error_jsonparse_message=GlobalData.consts.jsonparse_message,error_jsonparse_adminmessage=GlobalData.consts.jsonparse_adminmessage;Params.general.files_count=parseInt(safe_parts[2]);for(var i=0;i<Params.general.files_count;i++)Params[i]={},Params[i].color=default_colors[0],Params[i].bgcolor=default_colors[1],Params[i].borcolor=default_colors[2],filedata=safe_parts[i+3].split(","),Params[i].message_type=wfu_plugin_decode_string(filedata[0]),Params[i].header=wfu_plugin_decode_string(filedata[1]),"success"==Params[i].message_type&&(Params[i].header+=error_jsonparse_filemessage,Params[i].message_type="warning"),Params[i].message=wfu_join_strings("<br />",error_jsonparse_message,wfu_plugin_decode_string(filedata[2])),Params[i].admin_messages=wfu_join_strings("<br />",error_jsonparse_adminmessage,wfu_plugin_decode_string(filedata[3]))}}else{if("object"!=typeof upload_params)return;var Params=upload_params}for(i=0;Params[i];)Params[i].message_type&&"error"==Params[i].message_type.substr(0,5)&&(Params[i].message_type=Params[i].message_type.substr(0,5)),i++;var message_table=document.getElementById("wfu_messageblock_"+sid),UploadStates_Ok=!0;if(!UploadStates[sid]&&message_table){var upload_states=document.getElementById("wfu_messageblock_header_"+sid+"_states").value;upload_states=wfu_plugin_decode_string(upload_states.replace(/^\s+|\s+$/g,"")),UploadStates[sid]=null;try{UploadStates[sid]=JSON.parse(upload_states)}catch(e){}null==UploadStates[sid]&&(UploadStates_Ok=!1)}GlobalData[sid]||(GlobalData[sid]=Object());var G=GlobalData[sid];if("no-ajax"==unique_id)G.last=!1,G.unique_id="",G.files_count=Params.general.files_count,0==Params.general.state&&(Params.general.files_count=0),G.files_processed=Params.general.files_count,G.upload_state=UploadStates_Ok?Params.general.state:10,G.message=Params.general.message,G.update_wpfilebase=Params.general.update_wpfilebase,G.redirect_link=Params.general.redirect_link,G.notify_only_filename_list="",G.notify_target_path_list="",G.notify_attachment_list="",G.admin_messages={},G.admin_messages.wpfilebase=Params.general.admin_messages.wpfilebase,G.admin_messages.notify=Params.general.admin_messages.notify,G.admin_messages.redirect=Params.general.admin_messages.redirect,G.admin_messages.debug=debug_data[1],G.admin_messages.other=Params.general.admin_messages.other,G.errors={},G.errors.wpfilebase=Params.general.errors.wpfilebase,G.errors.notify=Params.general.errors.notify,G.errors.redirect=Params.general.errors.redirect,G.current_size=0,G.total_size=0;else{if(""==G.unique_id||G.unique_id!=unique_id||G.unique_id!=Params.general.unique_id)return;if(G.last)return;0==Params.general.files_count&&Params[0]&&"error"==Params[0].message_type&&(Params.general.files_count=1);for(var file_status="",i=0;i<Params.general.files_count;i++)file_status="error"==Params[i].message_type&&0==G.files_processed?"error1":"error"==Params[i].message_type&&G.files_processed>0?"error2":Params[i].message_type,G.upload_state=GlobalData.filestatematch[file_status][G.upload_state];UploadStates_Ok||(G.upload_state=10),G.files_processed+=Params.general.files_count,G.message=wfu_join_strings("<br />",G.message,Params.general.message),""==G.update_wpfilebase&&(G.update_wpfilebase=Params.general.update_wpfilebase),(!request_type||request_type&&"email"!=request_type)&&(G.redirect_link=Params.general.redirect_link),G.notify_only_filename_list=wfu_join_strings(", ",G.notify_only_filename_list,Params.general.notify_only_filename_list),G.notify_target_path_list=wfu_join_strings(", ",G.notify_target_path_list,Params.general.notify_target_path_list),G.notify_attachment_list=wfu_join_strings(",",G.notify_attachment_list,Params.general.notify_attachment_list),G.admin_messages.debug=wfu_join_strings("<br />",G.admin_messages.debug,debug_data[1]),G.admin_messages.other=wfu_join_strings("<br />",G.admin_messages.other,Params.general.admin_messages.other),""==G.admin_messages.wpfilebase&&(G.admin_messages.wpfilebase=Params.general.admin_messages.wpfilebase),""==G.admin_messages.notify&&(G.admin_messages.notify=Params.general.admin_messages.notify),""==G.admin_messages.redirect&&(G.admin_messages.redirect=Params.general.admin_messages.redirect),""==G.errors.wpfilebase&&(G.errors.wpfilebase=Params.general.errors.wpfilebase),""==G.errors.notify&&(G.errors.notify=Params.general.errors.notify),""==G.errors.redirect&&(G.errors.redirect=Params.general.errors.redirect)}G.files_processed==G.files_count&&(G.last=!0,""!=G.update_wpfilebase&&(G.admin_messages.wpfilebase="",wfu_notify_WPFilebase(params_index,session_token)),""!=G.notify_only_filename_list&&(G.admin_messages.notify="",wfu_send_email_notification(sid,unique_id,params_index,session_token,G.notify_only_filename_list,G.notify_target_path_list,G.notify_attachment_list,debug_data[0],debug_data[2]),G.last=!1,G.notify_only_filename_list=""),G.last&&("no-ajax"!=unique_id&&wfu_notify_server_upload_ended(sid,unique_id,params_index,session_token),GlobalData.UploadInProgressString=GlobalData.UploadInProgressString.replace(new RegExp("\\["+unique_id+"\\]","g"),"")),""!=G.errors.redirect&&(G.redirect_link=""),""!=G.redirect_link&&G.last&&""==GlobalData.UploadInProgressString.trim()&&(G.upload_state=11,do_redirect=!0));var nonadmin_message=G.message,admin_message=wfu_join_strings("<br />",G.admin_messages.other,G.admin_messages.wpfilebase,G.admin_messages.notify,G.admin_messages.redirect,G.admin_messages.debug);if(!UploadStates_Ok){var error_jsonparse_headermessage=GlobalData.consts.jsonparse_headermessage,error_jsonparse_headeradminmessage=GlobalData.consts.jsonparse_headeradminmessage;nonadmin_message=wfu_join_strings("<br />",error_jsonparse_headermessage,nonadmin_message),admin_message=wfu_join_strings("<br />",error_jsonparse_headeradminmessage,admin_message)}if(G.last){0==G.files_count?G.upload_state=8:G.upload_state<4&&(G.upload_state+=4);var admin_messages_exist=""!=G.admin_messages.wpfilebase||""!=G.admin_messages.notify||""!=G.admin_messages.redirect||""!=G.admin_messages.other;4==G.upload_state&&""!=admin_message?G.upload_state++:5==G.upload_state&&""==!admin_message&&""==nonadmin_message&&G.upload_state--}if(message_table){var subheader_state=document.getElementById("wfu_messageblock_header_"+sid+"_state"),single_file_shown=1==G.files_count&&""==nonadmin_message&&""==admin_message&&G.last&&!do_redirect;if(single_file_shown)document.getElementById("wfu_messageblock_header_"+sid).style.display="none";else{document.getElementById("wfu_messageblock_header_"+sid).style.display="";var header_container=document.getElementById("wfu_messageblock_header_"+sid+"_container");if(UploadStates_Ok){var suffix="";1!=G.files_count||5!=G.upload_state&&7!=G.upload_state||(suffix="_singlefile"),header_container.innerHTML=UploadStates[sid]["State"+G.upload_state+suffix]}else{header_container.innerHTML="";var safe_container=document.getElementById("wfu_messageblock_header_"+sid+"_safecontainer");header_container.innerHTML=safe_container.innerHTML.replace(/_safe/g,"")}var subheader_show=!1;""!=nonadmin_message?(document.getElementById("wfu_messageblock_subheader_"+sid+"_message").style.display="",document.getElementById("wfu_messageblock_subheader_"+sid+"_messagelabel").innerHTML=nonadmin_message,subheader_show=!0):document.getElementById("wfu_messageblock_subheader_"+sid+"_message").style.display="none",""!=admin_message?(document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessage").style.display="",document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessagelabel").innerHTML=admin_message,subheader_show=!0):document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessage").style.display="none",document.getElementById("wfu_messageblock_subheader_"+sid).style.display=subheader_show?subheader_state.value:"none",subheader_show||G.files_processed>0?(header_container.colSpan=2,document.getElementById("wfu_messageblock_arrow_"+sid).style.display=""):(document.getElementById("wfu_messageblock_arrow_"+sid).style.display="none",header_container.colSpan=3)}for(var next_block=document.getElementById("wfu_messageblock_subheader_"+sid),next_block_id=0,file_block=null,file_template_container=document.getElementById("wfu_messageblock_"+sid+"_filetemplate"),file_contents="",door=document.getElementById("wfu_messageblock_"+sid+"_door"),ii=0,headerspan=1,subheaderspan=2,file_template=wfu_plugin_decode_string(file_template_container.value.replace(/^\s+|\s+$/g,"")),i=0;i<Params.general.files_count;i++){for(ii=i+file_id,file_contents=file_template.replace(/\[file_id\]/g,ii),file_contents=file_contents.replace(/\[filenumber_display\]/g,""),file_contents=file_contents.replace(/\[fileheader_color\]/g,Params[i].color),file_contents=file_contents.replace(/\[fileheader_bgcolor\]/g,Params[i].bgcolor),file_contents=file_contents.replace(/\[fileheader_borcolor\]/g,Params[i].borcolor),file_contents=file_contents.replace(/\[fileheader_message\]/g,Params[i].header),file_contents=file_contents.replace(/\[filesubheadermessage_display\]/g,'style="display:none;"'),file_contents=file_contents.replace(/\[filesubheader_message\]/g,Params[i].message),file_contents=file_contents.replace(/\[filesubheaderadminmessage_display\]/g,'style="display:none;"'),file_contents=file_contents.replace(/\[filesubheader_adminmessage\]/g,Params[i].admin_messages),file_contents="<table><tbody>"+file_contents+"</tbody></table>",door.innerHTML=file_contents,headerspan=1,subheaderspan=2,subheader_show=!1,file_block=document.getElementById("wfu_messageblock_"+sid+"_"+ii),1==G.files_count?(document.getElementById("wfu_messageblock_"+sid+"_filenumber_"+ii).style.display="none",document.getElementById("wfu_messageblock_subheader_"+sid+"_fileempty_"+ii).style.display="none",file_block.style.display=single_file_shown?"":subheader_state.value,headerspan++,subheaderspan++):file_block.style.display=subheader_state.value,""!=Params[i].message&&(document.getElementById("wfu_messageblock_subheader_"+sid+"_message_"+ii).style.display="",subheader_show=!0),""!=Params[i].admin_messages&&(document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessage_"+ii).style.display="",subheader_show=!0),subheader_show||(document.getElementById("wfu_messageblock_arrow_"+sid+"_"+ii).style.display="none",headerspan++),document.getElementById("wfu_messageblock_header_"+sid+"_container_"+ii).colSpan=headerspan,document.getElementById("wfu_messageblock_subheader_"+sid+"_container_"+ii).colSpan=subheaderspan;ii>next_block_id&&(next_block=next_block.nextSibling,null!=next_block);)1===next_block.nodeType&&(next_block_id=next_block.id.substr(next_block.id.lastIndexOf("_")+1));message_table.tBodies[0].insertBefore(file_block,next_block),next_block=file_block.nextSibling,file_block=document.getElementById("wfu_messageblock_subheader_"+sid+"_"+ii),message_table.tBodies[0].insertBefore(file_block,next_block),next_block=file_block,next_block_id=ii}single_file_shown&&(document.getElementById("wfu_messageblock_"+sid+"_1").style.display=""),message_table.style.display="",document.getElementById("wordpress_file_upload_message_"+sid).style.display=""}return js_script_enc&&eval(wfu_plugin_decode_string(js_script_enc)),do_redirect&&wfu_Redirect(G.redirect_link),G.last}}function wfu_uploadFailed(e,a){a&&(console.log("failure report following"),console.log(e));var s=e.target,t={target:{responseText:"",shortcode_id:s.shortcode_id}};wfu_uploadComplete.call(s,t)}function wfu_uploadCanceled(){}function wfu_notify_server_upload_ended(e,a,s,t){var n=wfu_GetHttpRequestObject();if(null!=n){var r=GlobalData.consts.ajax_url;params=new Array(5),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action",params[1]=new Array(2),params[1][0]="uniqueuploadid_"+e,params[1][1]=a,params[2]=new Array(2),params[2][0]="params_index",params[2][1]=s,params[3]=new Array(2),params[3][0]="session_token",params[3][1]=t,params[4]=new Array(2),params[4][0]="upload_finished",params[4][1]=1;for(var l="",i=0;i<params.length;i++)l+=(i>0?"&":"")+params[i][0]+"="+encodeURI(params[i][1]);n.open("POST",r,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onreadystatechange=function(){4==n.readyState&&200==n.status},n.send(l)}}function wfu_Initialize_Params(){var e={};return e.version="full",e.general={},e.general.shortcode_id=0,e.general.unique_id="",e.general.state=0,e.general.files_count=0,e.general.update_wpfilebase="",e.general.redirect_link="",e.general.upload_finish_time=0,e.general.message="",e.general.message_type="",e.general.admin_messages={},e.general.admin_messages.wpfilebase="",e.general.admin_messages.notify="",e.general.admin_messages.redirect="",e.general.admin_messages.other="",e.general.errors={},e.general.errors.wpfilebase="",e.general.errors.notify="",e.general.errors.redirect="",e.general.color="",e.general.bgcolor="",e.general.borcolor="",e.general.notify_only_filename_list="",e.general.notify_target_path_list="",e.general.notify_attachment_list="",e.general.fail_message="",e.general.fail_admin_message="",e}function wfu_redirect_to_classic(e,a,s,t){0!=wfu_filesselected(e)&&wfu_selectsubdir_check(e)&&wfu_check_required_userdata(e,!0)&&wfu_redirect_to_classic_cont(e,a,s,t,[""])}function wfu_redirect_to_classic_cont(e,a,s,t){var n=function(n){if(n.indexOf("wfu_response_success:")>-1){var r=wfu_Initialize_Params();if(r.general.shortcode_id=e,r.general.unique_id="",r.general.files_count=wfu_filesselected(e),wfu_ProcessUploadComplete(e,0,r,"no-ajax","",a,"",["false","","false"]),1==s){var l="";document.getElementById("upfile_"+e).name="uploadedfile_"+e+"_redirected"+l}document.getElementById("adminerrorcodes_"+e).value=t>0?t:"",document.getElementById("upfile_"+e).disabled=!1,document.getElementById("uniqueuploadid_"+e).value=wfu_randomString(10),document.getElementById("uploadform_"+e).submit()}},r="",l=new Date,i=GlobalData.consts.ajax_url+"?action=wfu_ajax_action&sid="+e+"&start_time="+l.getTime()+"&session_token="+a+r;wfu_lock_upload(e);var o=wfu_GetHttpRequestObject();if(null==o){var _=document.createElement("iframe");return _?(_.style.display="none",_.src=i,document.body.appendChild(_),void(_.onload=function(){n(_.contentDocument.body.innerHTML)})):void 0}o.open("GET",i,!0),o.onreadystatechange=function(){4==o.readyState&&200==o.status&&n(o.responseText)},o.send(null)}function wfu_filesselected(e){var a=document.getElementById("fileName_"+e),s=wfu_get_filelist(e);return 0==s.length&&a&&(a.value=GlobalData.consts.nofilemessage,a.className="file_input_textbox_nofile"),s.length}function wfu_check_required_userdata(e,a){for(var s=wfu_get_userdata_count(e),t=!1,n=0;s>n;n++){var r=document.getElementById("hiddeninput_"+e+"_userdata_"+n),l=document.getElementById("userdata_"+e+"_message_"+n),i="file_userdata_message_required";l.className.substr(0,i.length)==i&&""==r.value&&(a&&(l.className=i+"_empty",l.value=GlobalData.consts.userdata_empty),t=!0)}return!t}function wfu_HTML5UploadFile(e,a,s){if(!wfu_BrowserCaps.supportsAJAX)return void wfu_redirect_to_classic(e,s,1,1);if(!wfu_BrowserCaps.supportsHTML5)return void wfu_redirect_to_classic(e,s,1,2);a=wfu_plugin_decode_string(a.replace(/^\s+|\s+$/g,""));var t=null;try{t=JSON.parse(a)}catch(n){}if(null==t)return void wfu_redirect_to_classic(e,s,1,3);var r=wfu_GetHttpRequestObject();if(null!=r){var l=wfu_filesselected(e);if(0!=l){var i=document.getElementById("upload_"+e),o=!i;if(!wfu_selectsubdir_check(e))return void(o&&wfu_clear_files(e));var _=l;return _+=_,wfu_check_required_userdata(e,!0)?void wfu_HTML5UploadFile_cont(e,t,s,[""]):void(o&&wfu_clear_files(e))}}}function wfu_HTML5UploadFile_cont(e,a,s){function t(r,l,i,m){f=!0;var g=wfu_GetHttpRequestObject(),p=wfu_GetHttpRequestObject();if(null!=g&&null!=p){var b=null,y=null;try{var b=new FormData,y=new FormData}catch(w){}if(null!=b&&null!=y){i||b.append("uploadedfile_"+e+_,l),b.append("uploadedfile_"+e+"_index",r),b.append("uploadedfile_"+e+"_name",wfu_plugin_encode_string(o[r].name)),b.append("uploadedfile_"+e+"_size",o[r].size),b.append("action","wfu_ajax_action"),b.append("uniqueuploadid_"+e,u),b.append("params_index",a.params_index),b.append("subdir_sel_index",n),i?b.append("only_check","1"):b.append("only_check","0"),b.append("session_token",s),b.append("unique_id",d);
2
- for(var h=wfu_get_userdata_count(e),v=0;h>v;v++)b.append("hiddeninput_"+e+"_userdata_"+v,document.getElementById("hiddeninput_"+e+"_userdata_"+v).value);var G=GlobalData[e].xhrs.push(g)-1,k=new Date;if(g.xhrid=G,g.shortcode_id=e,g.requesttype="fileupload",g.file_id=r+1,i?(g.size=0,g.totalsize=0,g.loading=!1):(g.size=l.size,g.totalsize=o[r].size,g.loading=!0),g.deltasize=0,g.sizeloaded=0,g.aborted=!1,g.unique_id=u,g.params_index=a.params_index,g.session_token=s,g.debugmode=a.debugmode,g.is_admin=a.is_admin,g.start_time=k.getTime(),g.end_time=g.start_time,g.finish_time=g.start_time+1e3*parseInt(GlobalData.consts.max_time_limit),g.fail_colors=a.fail_colors,g.error_message_header=a.error_header.replace(/%username%/g,"no data"),g.error_message_header=g.error_message_header.replace(/%useremail%/g,"no data"),g.error_message_header=g.error_message_header.replace(/%filename%/g,o[r].name),g.error_message_header=g.error_message_header.replace(/%filepath%/g,o[r].name),g.error_message_failed=GlobalData.consts.message_failed,g.error_message_cancelled=GlobalData.consts.message_cancelled,g.error_adminmessage_unknown=GlobalData.consts.adminmessage_unknown.replace(/%username%/g,"no data"),g.error_adminmessage_unknown=g.error_adminmessage_unknown.replace(/%useremail%/g,"no data"),g.error_adminmessage_unknown=g.error_adminmessage_unknown.replace(/%filename%/g,o[r].name),g.error_adminmessage_unknown=g.error_adminmessage_unknown.replace(/%filepath%/g,o[r].name),m){y.append("action","wfu_ajax_action"),y.append("params_index",a.params_index),y.append("session_token",s),y.append("force_connection_close","1"),p.open("POST",GlobalData.consts.ajax_url,!1);try{p.send(y)}catch(I){}f="success"==p.responseText}if(f)i?(g.addEventListener("load",function(a){a={target:{responseText:a.target.responseText,shortcode_id:e,return_status:!0}};var s=wfu_uploadComplete.call(g,a);f="success"==s||"warning"==s,f&&t(r,l,!1,!1)},!1),g.addEventListener("error",function(){},!1),g.open("POST",GlobalData.consts.ajax_url,!0),g.send(b)):(g.upload.xhr=g,g.upload.dummy=1,g.upload.addEventListener("loadstart",wfu_loadStart,!1),g.upload.addEventListener("progress",new Function("evt","wfu_uploadProgress(evt, "+e+", "+G+", "+a.debugmode+");"),!1),g.addEventListener("load",wfu_uploadComplete,!1),g.addEventListener("error",new Function("evt","wfu_uploadFailed(evt, "+a.debugmode+");"),!1),g.addEventListener("abort",wfu_uploadCanceled,!1),g.open("POST",GlobalData.consts.ajax_url,!0),g.send(b));else{var E={target:{responseText:"",shortcode_id:e}};wfu_uploadComplete.call(g,E)}return c++,f}}}var n=-1,r=document.getElementById("selectsubdir_"+e);if(r){var l=document.getElementById("selectsubdiredit_"+e),i="none"!=l.style.display;n=i?l.value:r.selectedIndex}var o=wfu_get_filelist(e),_="",d=wfu_randomString(10),u=d;GlobalData.UploadInProgressString+="["+u+"]",GlobalData[e]={},GlobalData[e].unique_id=u,GlobalData[e].last=!1,GlobalData[e].files_count=1,GlobalData[e].files_processed=0,GlobalData[e].upload_state=0,GlobalData[e].message="",GlobalData[e].update_wpfilebase="",GlobalData[e].redirect_link="",GlobalData[e].notify_only_filename_list="",GlobalData[e].notify_target_path_list="",GlobalData[e].notify_attachment_list="",GlobalData[e].admin_messages={},GlobalData[e].admin_messages.wpfilebase="",GlobalData[e].admin_messages.notify="",GlobalData[e].admin_messages.redirect="",GlobalData[e].admin_messages.debug="",GlobalData[e].admin_messages.other="",GlobalData[e].errors={},GlobalData[e].errors.wpfilebase="",GlobalData[e].errors.notify="",GlobalData[e].errors.redirect="",GlobalData[e].xhrs=Array(),wfu_show_simple_progressbar(a.shortcode_id,"progressive");var m=wfu_Initialize_Params();m.general.shortcode_id=e,m.general.unique_id=u,wfu_ProcessUploadComplete(e,0,m,u,a.params_index,s,"",["false","","false"]);var c=0,f=!0,g=0;t(g,o[g],!0,!1)}function wfu_get_userdata_count(e){for(var a=0;document.getElementById("userdata_"+e+"_"+a);)a++;return a}function wfu_lock_upload(e){var a=document.getElementById("fileName_"+e);a&&(a.disabled=!0),document.getElementById("input_"+e).disabled=!0,document.getElementById("upfile_"+e).disabled=!0,wfu_selectsubdir_disable_onoff(e,!0);var s=document.getElementById("upload_"+e);s&&(s.disabled=!0);for(var t=wfu_get_userdata_count(e),n=0;t>n;n++)document.getElementById("userdata_"+e+"_message_"+n).disabled=!0}function wfu_unlock_upload(e){var a=document.getElementById("fileName_"+e);a&&(a.disabled=!1),document.getElementById("input_"+e).disabled=!1,document.getElementById("upfile_"+e).disabled=!1,wfu_selectsubdir_disable_onoff(e,!1);var s=document.getElementById("upload_"+e);s&&(s.disabled=!1);for(var t=wfu_get_userdata_count(e),n=0;t>n;n++)document.getElementById("userdata_"+e+"_message_"+n).disabled=!1}function wfu_clear_files(e){document.getElementById("uploadform_"+e).reset();var a=document.getElementById("fileName_"+e);a&&(a.value="",a.className="file_input_textbox")}function wfu_clear(e){wfu_clear_files(e);var a=document.getElementById("selectsubdir_"+e);if(a){var s=document.getElementById("selectsubdiredit_"+e),t="none"!=s.style.display;t?(a.selectedIndex=-1,s.value=""):a.selectedIndex=parseInt(document.getElementById("selectsubdirdefault_"+e).value)}for(var n=wfu_get_userdata_count(e),r=0;n>r;r++)document.getElementById("userdata_"+e+"_message_"+r).value="",document.getElementById("hiddeninput_"+e+"_userdata_"+r).value=""}function wfu_reset_message(e){var a=document.getElementById("wfu_messageblock_"+e);if(a){document.getElementById("wfu_messageblock_header_"+e).style.display="";var s=document.getElementById("wfu_messageblock_header_"+e+"_container");UploadStates[e]&&(s.innerHTML=UploadStates[e].State0),document.getElementById("wfu_messageblock_header_"+e+"_state").value="none",document.getElementById("wfu_messageblock_arrow_"+e).style.display="none",s.colSpan=3,document.getElementById("wfu_messageblock_subheader_"+e+"_messagelabel").innerHTML="",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessagelabel").innerHTML="",document.getElementById("wfu_messageblock_subheader_"+e).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_message").style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage").style.display="none";for(var t=wfu_get_file_ids(e),n=1;n<=t.length;n++)a.tBodies[0].removeChild(document.getElementById("wfu_messageblock_"+e+"_"+n)),a.tBodies[0].removeChild(document.getElementById("wfu_messageblock_subheader_"+e+"_"+n))}}function wfu_show_simple_progressbar(e,a){var s=document.getElementById("progressbar_"+e+"_animation"),t=document.getElementById("progressbar_"+e+"_imagesafe");s&&("progressive"==a?(s.style.width="0%",s.className="file_progress_progressive",t.style.display="none",s.style.display="block"):wfu_BrowserCaps.supportsAnimation?(s.style.width="25%",s.className="file_progress_shuffle",t.style.display="none",s.style.display="block"):(s.style.width="0%",s.className="file_progress_noanimation",s.style.display="none",t.style.display="block"),document.getElementById("wordpress_file_upload_progressbar_"+e).style.display="block")}function wfu_hide_simple_progressbar(e){var a=document.getElementById("progressbar_"+e+"_animation"),s=document.getElementById("progressbar_"+e+"_imagesafe");a&&(document.getElementById("wordpress_file_upload_progressbar_"+e).style.display="none",a.style.width="0%",a.className="file_progress_noanimation",s.style.display="none",a.style.display="block")}function wfu_invoke_shortcode_editor(e,a,s,t){for(var n=document.getElementsByTagName("BUTTON"),r=0,l=null,i=0;i<n.length;i++)n[i].parentNode&&n[i].parentNode.id==t+"_editor_"+e&&(l=n[i],r++);if(0!=r){if(r>1)return void alert(GlobalData.consts.same_pluginid);var o=wfu_GetHttpRequestObject();if(null!=o){l.parentNode.style.display="none",document.getElementById(t+"_overlay_"+e).style.display="block";var _=GlobalData.consts.ajax_url;params=new Array(5),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_edit_shortcode",params[1]=new Array(2),params[1][0]="upload_id",params[1][1]=e,params[2]=new Array(2),params[2][0]="post_id",params[2][1]=a,params[3]=new Array(2),params[3][0]="post_hash",params[3][1]=s,params[4]=new Array(2),params[4][0]="shortcode_tag",params[4][1]=t;for(var d="",i=0;i<params.length;i++)d+=(i>0?"&":"")+params[i][0]+"="+encodeURI(params[i][1]);o.open("POST",_,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.onreadystatechange=function(){if(4==o.readyState&&200==o.status){document.getElementById(t+"_overlay_"+e).style.display="none",l.parentNode.removeAttribute("style");var a="wfu_edit_shortcode:",s=o.responseText.indexOf(a);-1==s&&(s=o.responseText.length);var n=(o.responseText.substr(0,s),o.responseText.substr(s+a.length,o.responseText.length-s-a.length));s=n.indexOf(":");var r=n.substr(0,s);if(txt_value=n.substr(s+1,n.length-s-1),"success"==r){var i=window.open(wfu_plugin_decode_string(txt_value),"_blank");i.plugin_window=window}else"check_page_obsolete"==r&&alert(txt_value)}},o.send(d)}}}GlobalData={},UploadStates={},GlobalData.filestatematch={},GlobalData.filestatematch.success=[0,1,2,2],GlobalData.filestatematch.warning=[1,1,2,2],GlobalData.filestatematch.error1=[3,3,2,3],GlobalData.filestatematch.error2=[2,2,2,3],GlobalData.UploadInProgressString="",wfu_Check_Browser_Capabilities();
1
+ function wfu_Initialize_Consts(e){if("undefined"==typeof GlobalData.consts){GlobalData.consts=new Object;for(var a=e.split(";"),s=0;s<a.length;s++)const_txt=a[s].split(":"),GlobalData.consts[wfu_plugin_decode_string(const_txt[0])]=wfu_plugin_decode_string(const_txt[1])}}function wfu_plugin_load_action(e){wfu_install_unload_hook();var a=document.getElementById("selectsubdiredit_"+e);a&&"none"!=a.style.display&&wfu_attach_element_handlers(a,new Function("wfu_selectsubdiredit_change("+e+");"))}function wfu_install_unload_hook(){window.onbeforeunload=wfu_unload_hook}function wfu_unload_hook(){return""!=GlobalData.UploadInProgressString&&""!=GlobalData.UploadInProgressString.trim()?GlobalData.consts.wfu_pageexit_prompt:void 0}function wfu_Check_Browser_Capabilities(){if("undefined"==typeof wfu_BrowserCaps){wfu_BrowserCaps=new Object;var e=wfu_GetHttpRequestObject();wfu_BrowserCaps.supportsAJAX=null!=e,wfu_BrowserCaps.supportsUploadProgress=!!(e&&"upload"in e&&"onprogress"in e.upload);var a=null;try{var a=new FormData}catch(s){}wfu_BrowserCaps.supportsHTML5=null!=a;var s=document.createElement("iframe");wfu_BrowserCaps.supportsIFRAME=null!=s,wfu_BrowserCaps.supportsDRAGDROP=window.FileReader?!0:!1,wfu_BrowserCaps.supportsAnimation=wfu_check_animation(),wfu_BrowserCaps.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0}}function wfu_check_animation(){var e=!1,a="animation",s="",t="Webkit Moz O ms Khtml".split(" "),n="",l=document.createElement("DIV");if(l.style.animationName&&(e=!0),e===!1)for(var r=0;r<t.length;r++)if(void 0!==l.style[t[r]+"AnimationName"]){n=t[r],a=n+"Animation",s="-"+n.toLowerCase()+"-",e=!0;break}return e}function wfu_join_strings(e){for(var a=[].slice.call(arguments),s="",t="",n=1;n<a.length;n++)t=""==s||""==a[n]?"":e,s+=t+a[n];return s}function wfu_plugin_decode_string(e){for(var a,s,t=0,n="";t<e.length;)a=parseInt(e.substr(t,2),16),s=128>a?a:224>a?((31&a)<<6)+(63&parseInt(e.substr(t+=2,2),16)):((15&a)<<12)+((63&parseInt(e.substr(t+=2,2),16))<<6)+(63&parseInt(e.substr(t+=2,2),16)),n+=String.fromCharCode(s),t+=2;return n}function wfu_plugin_encode_string(e){var a=0,s="",t="";for(a=0;a<e.length;a++)num=e.charCodeAt(a),num>=2048?num=((16773120&num|917504)<<4)+((4032&num|8192)<<2)+(63&num|128):num>=128&&(num=((65472&num|12288)<<2)+(63&num|128)),t=num.toString(16),(1==t.length||3==t.length||5==t.length)&&(t="0"+t),s+=t;return s}function wfu_randomString(e){for(var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",s=e,t="",n=0;s>n;n++){var l=Math.floor(Math.random()*a.length);t+=a.substring(l,l+1)}return t}function wfu_addEventHandler(e,a,s){e.addEventListener?e.addEventListener(a,s,!1):e.attachEvent?e.attachEvent("on"+a,s):e["on"+a]=s}function wfu_attach_element_handlers(e,a){for(var s=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"],t=0;t<s.length;t++)wfu_addEventHandler(e,s[t],a)}function wfu_GetHttpRequestObject(){var e=null;try{e=new XMLHttpRequest}catch(a){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(s){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}}if(null==e&&window.createRequest)try{xmlhttp=window.createRequest()}catch(a){}return e}function wfu_filedetails_showhide(e,a,s){var t=(document.getElementById("wfu_messageblock_arrow_"+e+"_"+a),document.getElementById("wfu_messageblock_arrow_"+e+"_up_"+a)),n=document.getElementById("wfu_messageblock_arrow_"+e+"_down_"+a),l=document.getElementById("wfu_messageblock_subheader_"+e+"_"+a),r=document.getElementById("wfu_messageblock_header_"+e+"_state_"+a);s?(t.style.display="",n.style.display="none",l.style.display="",r.value=""):(t.style.display="none",n.style.display="",l.style.display="none",r.value="none")}function wfu_get_file_ids(e){for(var a=(document.getElementById("wfu_messageblock_"+e),document.getElementById("wfu_messageblock_subheader_"+e).nextSibling),s="wfu_messageblock_"+e+"_",t=[];null!=a;)1===a.nodeType&&a.id.substr(0,s.length)==s&&t.push(a.id.substr(a.id.lastIndexOf("_")+1)),a=a.nextSibling;return t}function wfu_get_filelist(e,a){a="undefined"!=typeof a?a:!0;var s=document.getElementById("upfile_"+e),t=s.files;return t||(t=s.value?[{name:s.value}]:[]),a&&"undefined"!=typeof s.filearray&&(t=s.filearray),t}function wfu_filedetails_toggle(e,a){var s=(document.getElementById("wfu_messageblock_arrow_"+e+"_"+a),document.getElementById("wfu_messageblock_arrow_"+e+"_up_"+a));wfu_filedetails_showhide(e,a,"none"==s.style.display)}function wfu_headerdetails_showhide(e,a){var s=(document.getElementById("wfu_messageblock_arrow_"+e),document.getElementById("wfu_messageblock_arrow_"+e+"_up")),t=document.getElementById("wfu_messageblock_arrow_"+e+"_down"),n=document.getElementById("wfu_messageblock_subheader_"+e),l=document.getElementById("wfu_messageblock_subheader_"+e+"_message"),r=document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage"),i=document.getElementById("wfu_messageblock_header_"+e+"_state"),o=wfu_get_file_ids(e);if(a){s.style.display="",t.style.display="none",("none"!=l.style.display||"none"!=r.style.display)&&(n.style.display=""),i.value="";for(var _=0;_<o.length;_++)document.getElementById("wfu_messageblock_"+e+"_"+o[_]).style.display="",document.getElementById("wfu_messageblock_subheader_"+e+"_"+o[_]).style.display=document.getElementById("wfu_messageblock_header_"+e+"_state_"+o[_]).value}else{s.style.display="none",t.style.display="",n.style.display="none",i.value="none";for(var _=0;_<o.length;_++)document.getElementById("wfu_messageblock_"+e+"_"+o[_]).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_"+o[_]).style.display="none"}}function wfu_headerdetails_toggle(e){var a=(document.getElementById("wfu_messageblock_arrow_"+e),document.getElementById("wfu_messageblock_arrow_"+e+"_up"));wfu_headerdetails_showhide(e,"none"==a.style.display)}function wfu_selectbutton_changed(e,a){wfu_BrowserCaps.supportsAJAX&&wfu_BrowserCaps.supportsHTML5||(a=0);var s=document.getElementById("upfile_"+e),t=wfu_get_filelist(e,!1);if(1==a){"undefined"==typeof s.filearray&&(s.filearray=Array());for(var n=0;n<t.length;n++)s.filearray.push(t[n])}else"undefined"!=typeof s.filearray&&delete s.filearray;wfu_update_filename_text(e)}function wfu_selectbutton_clicked(e){var a=document.getElementById("wordpress_file_upload_message_"+e);a&&(a.style.display="none"),wfu_reset_message(e),document.getElementById("upfile_"+e).value="";var s=document.getElementById("fileName_"+e);s&&(s.value="",s.className="file_input_textbox")}function wfu_update_uploadbutton_status(e){var a=document.getElementById("upload_"+e);if(a){var s=wfu_get_filelist(e),t=s.length>0;a.disabled=!t}}function wfu_update_filename_text(e){var a=document.getElementById("fileName_"+e);if(a){for(var s=wfu_get_filelist(e),t="",n=0;n<s.length;n++)""!=t&&(t+=", "),t+=s[n].name.replace(/c:\\fakepath\\/i,"");a.value=t}}function wfu_selectsubdir_check(e){var a=document.getElementById("selectsubdir_"+e);if(!a)return!0;var s=document.getElementById("selectsubdiredit_"+e),t="none"!=s.style.display;return t&&a.selectedIndex>0&&(s.value=a.value.replace(/^\s+/,""),s.className="file_item_clean_match subfolder_autoplus_match",wfu_selectsubdiredit_change(e)),document.getElementById("hiddeninput_"+e).value=t?s.value:a.selectedIndex,!t&&0==a.selectedIndex||t&&(""==s.value||"file_item_clean_empty subfolder_autoplus_empty"==s.className)?(t?(a.className="subfolder_autoplus_dropdown_prompt",s.value="",GlobalData.FreeChangeHandler=!0,s.className="file_item_clean_prompt subfolder_autoplus_prompt",GlobalData.FreeChangeHandler=!1):a.className="file_item_clean_prompt subfolder_dropdown_prompt",!1):(a.className=t?"subfolder_autoplus_dropdown":"file_item_clean subfolder_dropdown",t&&"file_item_clean_prompt subfolder_autoplus_prompt"==s.className&&(s.className="file_item_clean subfolder_autoplus"),a.options[0].style.display="none",!0)}function wfu_selectsubdiredit_enter(e){var a=document.getElementById("selectsubdir_"+e),s=document.getElementById("selectsubdiredit_"+e);"file_item_clean_empty subfolder_autoplus_empty"==s.className&&(s.value=""),a.className="subfolder_autoplus_dropdown",s.className="file_item_clean subfolder_autoplus"}function wfu_selectsubdiredit_exit(e){var a=document.getElementById("selectsubdiredit_"+e);""==a.value&&(a.value=GlobalData.consts.wfu_subdir_typedir,a.className="file_item_clean_empty subfolder_autoplus_empty")}function wfu_selectsubdiredit_change(e){if(!GlobalData.FreeChangeHandler){var a=document.getElementById("selectsubdir_"+e),s=document.getElementById("selectsubdiredit_"+e);if("none"!=s.style.display){if("file_item_clean_empty subfolder_autoplus_empty"==s.className)return a.selectedIndex=0,void(document.getElementById("hiddeninput_"+e).value="");document.getElementById("hiddeninput_"+e).value=s.value;for(var t,n=!1,l=1;l<a.options.length;l++)t=a.options[l].value.replace(/^\s+/,"").toLowerCase(),a.options[l].style.display=s.value.length>=3?t.substr(0,s.value.length)==s.value.toLowerCase()?"block":"none":"block",a.options[l].value.replace(/^\s+/,"")==s.value&&(a.selectedIndex=l,s.className="file_item_clean_match subfolder_autoplus_match",n=!0);n||(a.selectedIndex=0,s.className="file_item_clean subfolder_autoplus")}}}function wfu_selectsubdir_disable_onoff(e,a){var s=document.getElementById("selectsubdir_"+e);if(!s)return!0;var t=document.getElementById("selectsubdiredit_"+e),n="none"!=t.style.display;s.disabled=a,n&&(t.disabled=a)}function wfu_userdata_focused(e){if("file_userdata_message_required_empty"==e.className){e.className="file_userdata_message_required";var a=document.getElementById(e.id.replace("_message_","_hint_"));a.style.display="none"}}function wfu_Redirect(e){window.location=e}function wfu_loadStart(){}function wfu_uploadProgress(e,a,s,t){t&&"undefined"==typeof this.xhr&&(console.log("total="+e.total+", loaded="+e.loaded),console.log(e));var n=GlobalData[a].xhrs[s],l=0,r=0,i=document.getElementById("progressbar_"+a+"_animation");if(e.lengthComputable){if(n.sizeloaded=e.loaded,n.size<e.total&&e.total>0){r=e.total-n.size,n.deltasize+=r,n.size+=r;for(var o=0;o<GlobalData[a].xhrs.length;o++)GlobalData[a].xhrs[o].file_id==n.file_id&&(GlobalData[a].xhrs[o].totalsize+=r)}if(i){for(var _=0,d=0,u=[],o=0;o<GlobalData[a].xhrs.length;o++)u[GlobalData[a].xhrs[o].file_id]=0;for(var o=0;o<GlobalData[a].xhrs.length;o++)u[GlobalData[a].xhrs[o].file_id]=Math.max(GlobalData[a].xhrs[o].totalsize,u[GlobalData[a].xhrs[o].file_id]);for(var o=0;o<u.length;o++)"undefined"!=typeof u[o]&&(_+=u[o]);for(var o=0;o<GlobalData[a].xhrs.length;o++)d+=GlobalData[a].xhrs[o].sizeloaded;l=Math.round(100*d/_),i.style.width=l.toString()+"%"}}else i&&(i.style.width="0%")}function wfu_notify_WPFilebase(e,a){var s=wfu_GetHttpRequestObject();if(null==s){var t=document.createElement("iframe");return t.style.display="none",t.src=GlobalData.consts.ajax_url+"?action=wfu_ajax_action_notify_wpfilebase&params_index="+e+"&session_token="+a,void document.body.appendChild(t)}var n=GlobalData.consts.ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_notify_wpfilebase",params[1]=new Array(2),params[1][0]="params_index",params[1][1]=e,params[2]=new Array(2),params[2][0]="session_token",params[2][1]=a;for(var l="",t=0;t<params.length;t++)l+=(t>0?"&":"")+params[t][0]+"="+encodeURI(params[t][1]);s.open("POST",n,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onreadystatechange=function(){},s.send(l)}function wfu_send_email_notification(e,a,s,t,n,l,r,i,o){var _=wfu_GetHttpRequestObject();if(null!=_){var d=GlobalData.consts.ajax_url,u=wfu_get_userdata_count(e);params=new Array(7+u),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_send_email_notification",params[1]=new Array(2),params[1][0]="params_index",params[1][1]=s,params[2]=new Array(2),params[2][0]="session_token",params[2][1]=t,params[3]=new Array(2),params[3][0]="only_filename_list",params[3][1]=n,params[4]=new Array(2),params[4][0]="target_path_list",params[4][1]=l,params[5]=new Array(2),params[5][0]="attachment_list",params[5][1]=r,params[6]=new Array(2),params[6][0]="uniqueuploadid_"+e,params[6][1]=a;for(var m=0;u>m;m++)params[7+m]=new Array(2),params[7+m][0]="userdata_"+m,params[7+m][1]=wfu_plugin_encode_string(document.getElementById("hiddeninput_"+e+"_userdata_"+m).value);for(var c="",m=0;m<params.length;m++)c+=(m>0?"&":"")+params[m][0]+"="+encodeURI(params[m][1]);var f=new Date;_.xhrid=-1,_.shortcode_id=e,_.requesttype="email",_.file_id=0,_.loading=!1,_.aborted=!1,_.unique_id=a,_.debugmode=i,_.is_admin=o,_.params_index=s,_.session_token=t,_.start_time=f.getTime(),_.end_time=_.start_time,_.finish_time=_.start_time+1e3*parseInt(GlobalData.consts.max_time_limit),_.fail_colors=GlobalData.consts.fail_colors,_.error_message_header="",_.error_message_failed=GlobalData.consts.message_failed,_.error_message_cancelled=GlobalData.consts.message_cancelled,_.error_adminmessage_unknown="",_.open("POST",d,!0),_.setRequestHeader("Content-type","application/x-www-form-urlencoded"),_.addEventListener("load",wfu_uploadComplete,!1),_.addEventListener("error",wfu_uploadFailed,!1),_.addEventListener("abort",wfu_uploadCanceled,!1),_.send(c)}}function wfu_format_debug_data(e,a){return output='<label class="file_messageblock_subheader_debugmessage_label">',output+="Debug Data"+a,output+="</label>",output+='<div class="file_messageblock_subheader_debugmessage_container">',output+=e,output+="</div>"}function wfu_uploadComplete(e){var a=new Date,s=this.shortcode_id,t=(this.file_id,!1),n="",l="",r="",i="unknown",o="",_="",d="wfu_fileupload_success:";this.loading=!1,this.end_time=a.getTime();var u=e.target.responseText,m=u,c="error";if(-1!=u&&u.indexOf("force_errorabort_code")>-1&&(c="errorabort",u=u.replace("force_errorabort_code","")),-1!=u){var f=u.indexOf(d);if(f>-1&&("true"==this.debugmode&&(_=u.substr(0,f)),m=u.substr(f+d.length),f=m.indexOf(":"),n=m.substr(0,f),m=m.substr(f+1),f=m.indexOf(":"),r=m.substr(0,f),l=m.substr(f+1)),""!=_){var p="";"fileupload"==this.requesttype?p=" - File: "+this.file_id:"email"==this.requesttype&&(p=" - Email Notification"),_=wfu_format_debug_data(_,p)}if(""!=r){var g=r.split(";");if(1==parseInt(g[2])){var b=g[3].split(",");i=wfu_plugin_decode_string(b[0]),o=b[4]}}}if(""==l||""==r){var y=this.fail_colors.split(","),w=wfu_Initialize_Params();w.general.shortcode_id=s,w.general.unique_id=this.unique_id,w.general.state=7,w.general.files_count="fileupload"==this.requesttype?1:0,w.general.upload_finish_time=this.finish_time,w.general.fail_message=GlobalData.consts.message_unknown,w.general.fail_admin_message=wfu_join_strings("<br />",this.error_adminmessage_unknown,this.requesttype+":"+m),w.general.files_count>0?(w[0]={},w[0].color=y[0],w[0].bgcolor=y[1],w[0].borcolor=y[2],w[0].message_type=c,i=c,w[0].header=this.error_message_header,w[0].message=GlobalData.consts.message_timelimit,w[0].admin_messages="true"==this.is_admin?GlobalData.consts.message_admin_timelimit:""):w.general.admin_messages.other="true"==this.is_admin?GlobalData.consts.message_admin_timelimit:"",w.general.upload_finish_time>0&&a.getTime()<w.general.upload_finish_time&&(w.general.files_count>0?(w[0].message=w.general.fail_message,w[0].admin_messages="true"==this.is_admin?w.general.fail_admin_message:""):w.general.admin_messages.other="true"==this.is_admin?w.general.fail_admin_message:"")}return t=""==l||""==r?wfu_ProcessUploadComplete(s,this.file_id,w,this.unique_id,this.params_index,this.session_token,"",[this.debugmode,_,this.is_admin],this.requesttype,""):wfu_ProcessUploadComplete(s,this.file_id,l,this.unique_id,this.params_index,this.session_token,r,[this.debugmode,_,this.is_admin],this.requesttype,n),t&&(wfu_unlock_upload(e.target.shortcode_id),wfu_hide_simple_progressbar(s),wfu_clear(e.target.shortcode_id)),e.target.return_status?i:void 0}function wfu_ProcessUploadComplete(sid,file_id,upload_params,unique_id,params_index,session_token,safe_output,debug_data,request_type,js_script_enc){if(sid&&!(0>sid)&&null!=upload_params&&""!=upload_params&&""!=unique_id&&("no-ajax"==unique_id||GlobalData[sid])){var do_redirect=!1;if("string"==typeof upload_params){upload_params=wfu_plugin_decode_string(upload_params.replace(/^\s+|\s+$/g,""));var Params=null;try{Params=JSON.parse(upload_params)}catch(e){}if(null==Params){var safe_parts=safe_output.split(";");Params=wfu_Initialize_Params(),Params.general.shortcode_id=sid,Params.general.unique_id=unique_id,Params.general.state=safe_parts[0],4==Params.general.state&&Params.general.state++;var default_colors=safe_parts[1].split(","),filedata="",error_jsonparse_filemessage=GlobalData.consts.jsonparse_filemessage,error_jsonparse_message=GlobalData.consts.jsonparse_message,error_jsonparse_adminmessage=GlobalData.consts.jsonparse_adminmessage;Params.general.files_count=parseInt(safe_parts[2]);for(var i=0;i<Params.general.files_count;i++)Params[i]={},Params[i].color=default_colors[0],Params[i].bgcolor=default_colors[1],Params[i].borcolor=default_colors[2],filedata=safe_parts[i+3].split(","),Params[i].message_type=wfu_plugin_decode_string(filedata[0]),Params[i].header=wfu_plugin_decode_string(filedata[1]),"success"==Params[i].message_type&&(Params[i].header+=error_jsonparse_filemessage,Params[i].message_type="warning"),Params[i].message=wfu_join_strings("<br />",error_jsonparse_message,wfu_plugin_decode_string(filedata[2])),Params[i].admin_messages=wfu_join_strings("<br />",error_jsonparse_adminmessage,wfu_plugin_decode_string(filedata[3]))}}else{if("object"!=typeof upload_params)return;var Params=upload_params}for(i=0;Params[i];)Params[i].message_type&&"error"==Params[i].message_type.substr(0,5)&&(Params[i].message_type=Params[i].message_type.substr(0,5)),i++;var message_table=document.getElementById("wfu_messageblock_"+sid),UploadStates_Ok=!0;if(!UploadStates[sid]&&message_table){var upload_states=document.getElementById("wfu_messageblock_header_"+sid+"_states").value;upload_states=wfu_plugin_decode_string(upload_states.replace(/^\s+|\s+$/g,"")),UploadStates[sid]=null;try{UploadStates[sid]=JSON.parse(upload_states)}catch(e){}null==UploadStates[sid]&&(UploadStates_Ok=!1)}GlobalData[sid]||(GlobalData[sid]=Object());var G=GlobalData[sid];if("no-ajax"==unique_id)G.last=!1,G.unique_id="",G.files_count=Params.general.files_count,0==Params.general.state&&(Params.general.files_count=0),G.files_processed=Params.general.files_count,G.upload_state=UploadStates_Ok?Params.general.state:10,G.message=Params.general.message,G.update_wpfilebase=Params.general.update_wpfilebase,G.redirect_link=Params.general.redirect_link,G.notify_only_filename_list="",G.notify_target_path_list="",G.notify_attachment_list="",G.admin_messages={},G.admin_messages.wpfilebase=Params.general.admin_messages.wpfilebase,G.admin_messages.notify=Params.general.admin_messages.notify,G.admin_messages.redirect=Params.general.admin_messages.redirect,G.admin_messages.debug=debug_data[1],G.admin_messages.other=Params.general.admin_messages.other,G.errors={},G.errors.wpfilebase=Params.general.errors.wpfilebase,G.errors.notify=Params.general.errors.notify,G.errors.redirect=Params.general.errors.redirect,G.current_size=0,G.total_size=0;else{if(""==G.unique_id||G.unique_id!=unique_id||G.unique_id!=Params.general.unique_id)return;if(G.last)return;0==Params.general.files_count&&Params[0]&&"error"==Params[0].message_type&&(Params.general.files_count=1);for(var file_status="",i=0;i<Params.general.files_count;i++)file_status="error"==Params[i].message_type&&0==G.files_processed?"error1":"error"==Params[i].message_type&&G.files_processed>0?"error2":Params[i].message_type,G.upload_state=GlobalData.filestatematch[file_status][G.upload_state];UploadStates_Ok||(G.upload_state=10),G.files_processed+=Params.general.files_count,G.message=wfu_join_strings("<br />",G.message,Params.general.message),""==G.update_wpfilebase&&(G.update_wpfilebase=Params.general.update_wpfilebase),(!request_type||request_type&&"email"!=request_type)&&(G.redirect_link=Params.general.redirect_link),G.notify_only_filename_list=wfu_join_strings(", ",G.notify_only_filename_list,Params.general.notify_only_filename_list),G.notify_target_path_list=wfu_join_strings(", ",G.notify_target_path_list,Params.general.notify_target_path_list),G.notify_attachment_list=wfu_join_strings(",",G.notify_attachment_list,Params.general.notify_attachment_list),G.admin_messages.debug=wfu_join_strings("<br />",G.admin_messages.debug,debug_data[1]),G.admin_messages.other=wfu_join_strings("<br />",G.admin_messages.other,Params.general.admin_messages.other),""==G.admin_messages.wpfilebase&&(G.admin_messages.wpfilebase=Params.general.admin_messages.wpfilebase),""==G.admin_messages.notify&&(G.admin_messages.notify=Params.general.admin_messages.notify),""==G.admin_messages.redirect&&(G.admin_messages.redirect=Params.general.admin_messages.redirect),""==G.errors.wpfilebase&&(G.errors.wpfilebase=Params.general.errors.wpfilebase),""==G.errors.notify&&(G.errors.notify=Params.general.errors.notify),""==G.errors.redirect&&(G.errors.redirect=Params.general.errors.redirect)}G.files_processed==G.files_count&&(G.last=!0,""!=G.update_wpfilebase&&(G.admin_messages.wpfilebase="",wfu_notify_WPFilebase(params_index,session_token)),""!=G.notify_only_filename_list&&(G.admin_messages.notify="",wfu_send_email_notification(sid,unique_id,params_index,session_token,G.notify_only_filename_list,G.notify_target_path_list,G.notify_attachment_list,debug_data[0],debug_data[2]),G.last=!1,G.notify_only_filename_list=""),G.last&&("no-ajax"!=unique_id&&wfu_notify_server_upload_ended(sid,unique_id,params_index,session_token),GlobalData.UploadInProgressString=GlobalData.UploadInProgressString.replace(new RegExp("\\["+unique_id+"\\]","g"),"")),""!=G.errors.redirect&&(G.redirect_link=""),""!=G.redirect_link&&G.last&&""==GlobalData.UploadInProgressString.trim()&&(G.upload_state=11,do_redirect=!0));var nonadmin_message=G.message,admin_message=wfu_join_strings("<br />",G.admin_messages.other,G.admin_messages.wpfilebase,G.admin_messages.notify,G.admin_messages.redirect,G.admin_messages.debug);if(!UploadStates_Ok){var error_jsonparse_headermessage=GlobalData.consts.jsonparse_headermessage,error_jsonparse_headeradminmessage=GlobalData.consts.jsonparse_headeradminmessage;nonadmin_message=wfu_join_strings("<br />",error_jsonparse_headermessage,nonadmin_message),admin_message=wfu_join_strings("<br />",error_jsonparse_headeradminmessage,admin_message)}if(G.last){0==G.files_count?G.upload_state=8:G.upload_state<4&&(G.upload_state+=4);var admin_messages_exist=""!=G.admin_messages.wpfilebase||""!=G.admin_messages.notify||""!=G.admin_messages.redirect||""!=G.admin_messages.other;4==G.upload_state&&""!=admin_message?G.upload_state++:5==G.upload_state&&""==!admin_message&&""==nonadmin_message&&G.upload_state--}if(message_table){var subheader_state=document.getElementById("wfu_messageblock_header_"+sid+"_state"),single_file_shown=1==G.files_count&&""==nonadmin_message&&""==admin_message&&G.last&&!do_redirect;if(single_file_shown)document.getElementById("wfu_messageblock_header_"+sid).style.display="none";else{document.getElementById("wfu_messageblock_header_"+sid).style.display="";var header_container=document.getElementById("wfu_messageblock_header_"+sid+"_container");if(UploadStates_Ok){var suffix="";1!=G.files_count||5!=G.upload_state&&7!=G.upload_state||(suffix="_singlefile"),header_container.innerHTML=UploadStates[sid]["State"+G.upload_state+suffix]}else{header_container.innerHTML="";var safe_container=document.getElementById("wfu_messageblock_header_"+sid+"_safecontainer");header_container.innerHTML=safe_container.innerHTML.replace(/_safe/g,"")}var subheader_show=!1;""!=nonadmin_message?(document.getElementById("wfu_messageblock_subheader_"+sid+"_message").style.display="",document.getElementById("wfu_messageblock_subheader_"+sid+"_messagelabel").innerHTML=nonadmin_message,subheader_show=!0):document.getElementById("wfu_messageblock_subheader_"+sid+"_message").style.display="none",""!=admin_message?(document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessage").style.display="",document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessagelabel").innerHTML=admin_message,subheader_show=!0):document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessage").style.display="none",document.getElementById("wfu_messageblock_subheader_"+sid).style.display=subheader_show?subheader_state.value:"none",subheader_show||G.files_processed>0?(header_container.colSpan=2,document.getElementById("wfu_messageblock_arrow_"+sid).style.display=""):(document.getElementById("wfu_messageblock_arrow_"+sid).style.display="none",header_container.colSpan=3)}for(var next_block=document.getElementById("wfu_messageblock_subheader_"+sid),next_block_id=0,file_block=null,file_template_container=document.getElementById("wfu_messageblock_"+sid+"_filetemplate"),file_contents="",door=document.getElementById("wfu_messageblock_"+sid+"_door"),ii=0,headerspan=1,subheaderspan=2,file_template=wfu_plugin_decode_string(file_template_container.value.replace(/^\s+|\s+$/g,"")),i=0;i<Params.general.files_count;i++){for(ii=i+file_id,file_contents=file_template.replace(/\[file_id\]/g,ii),file_contents=file_contents.replace(/\[filenumber_display\]/g,""),file_contents=file_contents.replace(/\[fileheader_color\]/g,Params[i].color),file_contents=file_contents.replace(/\[fileheader_bgcolor\]/g,Params[i].bgcolor),file_contents=file_contents.replace(/\[fileheader_borcolor\]/g,Params[i].borcolor),file_contents=file_contents.replace(/\[fileheader_message\]/g,Params[i].header),file_contents=file_contents.replace(/\[filesubheadermessage_display\]/g,'style="display:none;"'),file_contents=file_contents.replace(/\[filesubheader_message\]/g,Params[i].message),file_contents=file_contents.replace(/\[filesubheaderadminmessage_display\]/g,'style="display:none;"'),file_contents=file_contents.replace(/\[filesubheader_adminmessage\]/g,Params[i].admin_messages),file_contents="<table><tbody>"+file_contents+"</tbody></table>",door.innerHTML=file_contents,headerspan=1,subheaderspan=2,subheader_show=!1,file_block=document.getElementById("wfu_messageblock_"+sid+"_"+ii),1==G.files_count?(document.getElementById("wfu_messageblock_"+sid+"_filenumber_"+ii).style.display="none",document.getElementById("wfu_messageblock_subheader_"+sid+"_fileempty_"+ii).style.display="none",file_block.style.display=single_file_shown?"":subheader_state.value,headerspan++,subheaderspan++):file_block.style.display=subheader_state.value,""!=Params[i].message&&(document.getElementById("wfu_messageblock_subheader_"+sid+"_message_"+ii).style.display="",subheader_show=!0),""!=Params[i].admin_messages&&(document.getElementById("wfu_messageblock_subheader_"+sid+"_adminmessage_"+ii).style.display="",subheader_show=!0),subheader_show||(document.getElementById("wfu_messageblock_arrow_"+sid+"_"+ii).style.display="none",headerspan++),document.getElementById("wfu_messageblock_header_"+sid+"_container_"+ii).colSpan=headerspan,document.getElementById("wfu_messageblock_subheader_"+sid+"_container_"+ii).colSpan=subheaderspan;ii>next_block_id&&(next_block=next_block.nextSibling,null!=next_block);)1===next_block.nodeType&&(next_block_id=next_block.id.substr(next_block.id.lastIndexOf("_")+1));message_table.tBodies[0].insertBefore(file_block,next_block),next_block=file_block.nextSibling,file_block=document.getElementById("wfu_messageblock_subheader_"+sid+"_"+ii),message_table.tBodies[0].insertBefore(file_block,next_block),next_block=file_block,next_block_id=ii}single_file_shown&&(document.getElementById("wfu_messageblock_"+sid+"_1").style.display=""),message_table.style.display="",document.getElementById("wordpress_file_upload_message_"+sid).style.display=""}return js_script_enc&&eval(wfu_plugin_decode_string(js_script_enc)),do_redirect&&wfu_Redirect(G.redirect_link),G.last}}function wfu_uploadFailed(e,a){a&&(console.log("failure report following"),console.log(e));var s=e.target,t={target:{responseText:"",shortcode_id:s.shortcode_id}};wfu_uploadComplete.call(s,t)}function wfu_uploadCanceled(){}function wfu_notify_server_upload_ended(e,a,s,t){var n=wfu_GetHttpRequestObject();if(null!=n){var l=GlobalData.consts.ajax_url;params=new Array(5),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action",params[1]=new Array(2),params[1][0]="uniqueuploadid_"+e,params[1][1]=a,params[2]=new Array(2),params[2][0]="params_index",params[2][1]=s,params[3]=new Array(2),params[3][0]="session_token",params[3][1]=t,params[4]=new Array(2),params[4][0]="upload_finished",params[4][1]=1;for(var r="",i=0;i<params.length;i++)r+=(i>0?"&":"")+params[i][0]+"="+encodeURI(params[i][1]);n.open("POST",l,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onreadystatechange=function(){4==n.readyState&&200==n.status},n.send(r)}}function wfu_Initialize_Params(){var e={};return e.version="full",e.general={},e.general.shortcode_id=0,e.general.unique_id="",e.general.state=0,e.general.files_count=0,e.general.update_wpfilebase="",e.general.redirect_link="",e.general.upload_finish_time=0,e.general.message="",e.general.message_type="",e.general.admin_messages={},e.general.admin_messages.wpfilebase="",e.general.admin_messages.notify="",e.general.admin_messages.redirect="",e.general.admin_messages.other="",e.general.errors={},e.general.errors.wpfilebase="",e.general.errors.notify="",e.general.errors.redirect="",e.general.color="",e.general.bgcolor="",e.general.borcolor="",e.general.notify_only_filename_list="",e.general.notify_target_path_list="",e.general.notify_attachment_list="",e.general.fail_message="",e.general.fail_admin_message="",e}function wfu_redirect_to_classic(e,a,s,t){0!=wfu_filesselected(e)&&wfu_selectsubdir_check(e)&&wfu_check_required_userdata(e,!0)&&wfu_redirect_to_classic_cont(e,a,s,t,[""])}function wfu_redirect_to_classic_cont(e,a,s,t){var n=function(n){if(n.indexOf("wfu_response_success:")>-1){var l=wfu_Initialize_Params();if(l.general.shortcode_id=e,l.general.unique_id="",l.general.files_count=wfu_filesselected(e),wfu_ProcessUploadComplete(e,0,l,"no-ajax","",a,"",["false","","false"]),1==s){var r="";document.getElementById("upfile_"+e).name="uploadedfile_"+e+"_redirected"+r}document.getElementById("adminerrorcodes_"+e).value=t>0?t:"",document.getElementById("upfile_"+e).disabled=!1,document.getElementById("uniqueuploadid_"+e).value=wfu_randomString(10),document.getElementById("uploadform_"+e).submit()}},l="",r=new Date,i=GlobalData.consts.ajax_url+"?action=wfu_ajax_action&sid="+e+"&start_time="+r.getTime()+"&session_token="+a+l;wfu_lock_upload(e);var o=wfu_GetHttpRequestObject();if(null==o){var _=document.createElement("iframe");return _?(_.style.display="none",_.src=i,document.body.appendChild(_),void(_.onload=function(){n(_.contentDocument.body.innerHTML)})):void 0}o.open("GET",i,!0),o.onreadystatechange=function(){4==o.readyState&&200==o.status&&n(o.responseText)},o.send(null)}function wfu_filesselected(e){var a=document.getElementById("fileName_"+e),s=wfu_get_filelist(e);return 0==s.length&&a&&(a.value=GlobalData.consts.nofilemessage,a.className="file_input_textbox_nofile"),s.length}function wfu_check_required_userdata(e,a){for(var s=wfu_get_userdata_count(e),t=!1,n=0;s>n;n++){var l=document.getElementById("hiddeninput_"+e+"_userdata_"+n),r=document.getElementById("userdata_"+e+"_message_"+n),i=document.getElementById("userdata_"+e+"_"+n),o=document.getElementById("userdata_"+e+"_hint_"+n),_="file_userdata_message_required";if(r.className.substr(0,_.length)==_&&""==l.value){if(a){r.className=_+"_empty";var d=i.getBoundingClientRect(),u=r.getBoundingClientRect();o.style.left=parseInt(u.right-d.left)+"px",o.style.top=parseInt(u.top-d.top)+"px",o.innerHTML=GlobalData.consts.userdata_empty,o.style.display="block"}t=!0}}return!t}function wfu_HTML5UploadFile(e,a,s){if(!wfu_BrowserCaps.supportsAJAX)return void wfu_redirect_to_classic(e,s,1,1);if(!wfu_BrowserCaps.supportsHTML5)return void wfu_redirect_to_classic(e,s,1,2);
2
+ a=wfu_plugin_decode_string(a.replace(/^\s+|\s+$/g,""));var t=null;try{t=JSON.parse(a)}catch(n){}if(null==t)return void wfu_redirect_to_classic(e,s,1,3);var l=wfu_GetHttpRequestObject();if(null!=l){var r=wfu_filesselected(e);if(0!=r){var i=document.getElementById("upload_"+e),o=!i;if(!wfu_selectsubdir_check(e))return void(o&&wfu_clear_files(e));var _=r;return _+=_,wfu_check_required_userdata(e,!0)?void wfu_HTML5UploadFile_cont(e,t,s,[""]):void(o&&wfu_clear_files(e))}}}function wfu_HTML5UploadFile_cont(e,a,s){function t(l,r,i,m){f=!0;var p=wfu_GetHttpRequestObject(),g=wfu_GetHttpRequestObject();if(null!=p&&null!=g){var b=null,y=null;try{var b=new FormData,y=new FormData}catch(w){}if(null!=b&&null!=y){i||b.append("uploadedfile_"+e+_,r),b.append("uploadedfile_"+e+"_index",l),b.append("uploadedfile_"+e+"_name",wfu_plugin_encode_string(o[l].name)),b.append("uploadedfile_"+e+"_size",o[l].size),b.append("action","wfu_ajax_action"),b.append("uniqueuploadid_"+e,u),b.append("params_index",a.params_index),b.append("subdir_sel_index",n),i?b.append("only_check","1"):b.append("only_check","0"),b.append("session_token",s),b.append("unique_id",d);for(var h=wfu_get_userdata_count(e),v=0;h>v;v++)b.append("hiddeninput_"+e+"_userdata_"+v,document.getElementById("hiddeninput_"+e+"_userdata_"+v).value);var G=GlobalData[e].xhrs.push(p)-1,k=new Date;if(p.xhrid=G,p.shortcode_id=e,p.requesttype="fileupload",p.file_id=l+1,i?(p.size=0,p.totalsize=0,p.loading=!1):(p.size=r.size,p.totalsize=o[l].size,p.loading=!0),p.deltasize=0,p.sizeloaded=0,p.aborted=!1,p.unique_id=u,p.params_index=a.params_index,p.session_token=s,p.debugmode=a.debugmode,p.is_admin=a.is_admin,p.start_time=k.getTime(),p.end_time=p.start_time,p.finish_time=p.start_time+1e3*parseInt(GlobalData.consts.max_time_limit),p.fail_colors=a.fail_colors,p.error_message_header=a.error_header.replace(/%username%/g,"no data"),p.error_message_header=p.error_message_header.replace(/%useremail%/g,"no data"),p.error_message_header=p.error_message_header.replace(/%filename%/g,o[l].name),p.error_message_header=p.error_message_header.replace(/%filepath%/g,o[l].name),p.error_message_failed=GlobalData.consts.message_failed,p.error_message_cancelled=GlobalData.consts.message_cancelled,p.error_adminmessage_unknown=GlobalData.consts.adminmessage_unknown.replace(/%username%/g,"no data"),p.error_adminmessage_unknown=p.error_adminmessage_unknown.replace(/%useremail%/g,"no data"),p.error_adminmessage_unknown=p.error_adminmessage_unknown.replace(/%filename%/g,o[l].name),p.error_adminmessage_unknown=p.error_adminmessage_unknown.replace(/%filepath%/g,o[l].name),m){y.append("action","wfu_ajax_action"),y.append("params_index",a.params_index),y.append("session_token",s),y.append("force_connection_close","1"),g.open("POST",GlobalData.consts.ajax_url,!1);try{g.send(y)}catch(I){}f="success"==g.responseText}if(f)i?(p.addEventListener("load",function(a){a={target:{responseText:a.target.responseText,shortcode_id:e,return_status:!0}};var s=wfu_uploadComplete.call(p,a);f="success"==s||"warning"==s,f&&t(l,r,!1,!1)},!1),p.addEventListener("error",function(){},!1),p.open("POST",GlobalData.consts.ajax_url,!0),p.send(b)):(p.upload.xhr=p,p.upload.dummy=1,p.upload.addEventListener("loadstart",wfu_loadStart,!1),p.upload.addEventListener("progress",new Function("evt","wfu_uploadProgress(evt, "+e+", "+G+", "+a.debugmode+");"),!1),p.addEventListener("load",wfu_uploadComplete,!1),p.addEventListener("error",new Function("evt","wfu_uploadFailed(evt, "+a.debugmode+");"),!1),p.addEventListener("abort",wfu_uploadCanceled,!1),p.open("POST",GlobalData.consts.ajax_url,!0),p.send(b));else{var B={target:{responseText:"",shortcode_id:e}};wfu_uploadComplete.call(p,B)}return c++,f}}}var n=-1,l=document.getElementById("selectsubdir_"+e);if(l){var r=document.getElementById("selectsubdiredit_"+e),i="none"!=r.style.display;n=i?r.value:l.selectedIndex}var o=wfu_get_filelist(e),_="",d=wfu_randomString(10),u=d;GlobalData.UploadInProgressString+="["+u+"]",GlobalData[e]={},GlobalData[e].unique_id=u,GlobalData[e].last=!1,GlobalData[e].files_count=1,GlobalData[e].files_processed=0,GlobalData[e].upload_state=0,GlobalData[e].message="",GlobalData[e].update_wpfilebase="",GlobalData[e].redirect_link="",GlobalData[e].notify_only_filename_list="",GlobalData[e].notify_target_path_list="",GlobalData[e].notify_attachment_list="",GlobalData[e].admin_messages={},GlobalData[e].admin_messages.wpfilebase="",GlobalData[e].admin_messages.notify="",GlobalData[e].admin_messages.redirect="",GlobalData[e].admin_messages.debug="",GlobalData[e].admin_messages.other="",GlobalData[e].errors={},GlobalData[e].errors.wpfilebase="",GlobalData[e].errors.notify="",GlobalData[e].errors.redirect="",GlobalData[e].xhrs=Array(),wfu_show_simple_progressbar(a.shortcode_id,"progressive");var m=wfu_Initialize_Params();m.general.shortcode_id=e,m.general.unique_id=u,wfu_ProcessUploadComplete(e,0,m,u,a.params_index,s,"",["false","","false"]);var c=0,f=!0,p=0;t(p,o[p],!0,!1)}function wfu_get_userdata_count(e){for(var a=0;document.getElementById("userdata_"+e+"_"+a);)a++;return a}function wfu_lock_upload(e){var a=document.getElementById("fileName_"+e);a&&(a.disabled=!0),document.getElementById("input_"+e).disabled=!0,document.getElementById("upfile_"+e).disabled=!0,wfu_selectsubdir_disable_onoff(e,!0);var s=document.getElementById("upload_"+e);s&&(s.disabled=!0);for(var t=wfu_get_userdata_count(e),n=0;t>n;n++)document.getElementById("userdata_"+e+"_message_"+n).disabled=!0}function wfu_unlock_upload(e){var a=document.getElementById("fileName_"+e);a&&(a.disabled=!1),document.getElementById("input_"+e).disabled=!1,document.getElementById("upfile_"+e).disabled=!1,wfu_selectsubdir_disable_onoff(e,!1);var s=document.getElementById("upload_"+e);s&&(s.disabled=!1);for(var t=wfu_get_userdata_count(e),n=0;t>n;n++)document.getElementById("userdata_"+e+"_message_"+n).disabled=!1}function wfu_clear_files(e){document.getElementById("uploadform_"+e).reset();var a=document.getElementById("fileName_"+e);a&&(a.value="",a.className="file_input_textbox")}function wfu_clear(e){wfu_clear_files(e);var a=document.getElementById("selectsubdir_"+e);if(a){var s=document.getElementById("selectsubdiredit_"+e),t="none"!=s.style.display;t?(a.selectedIndex=-1,s.value=""):a.selectedIndex=parseInt(document.getElementById("selectsubdirdefault_"+e).value)}for(var n=wfu_get_userdata_count(e),l=0;n>l;l++)document.getElementById("userdata_"+e+"_message_"+l).value="",document.getElementById("hiddeninput_"+e+"_userdata_"+l).value=""}function wfu_reset_message(e){var a=document.getElementById("wfu_messageblock_"+e);if(a){document.getElementById("wfu_messageblock_header_"+e).style.display="";var s=document.getElementById("wfu_messageblock_header_"+e+"_container");UploadStates[e]&&(s.innerHTML=UploadStates[e].State0),document.getElementById("wfu_messageblock_header_"+e+"_state").value="none",document.getElementById("wfu_messageblock_arrow_"+e).style.display="none",s.colSpan=3,document.getElementById("wfu_messageblock_subheader_"+e+"_messagelabel").innerHTML="",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessagelabel").innerHTML="",document.getElementById("wfu_messageblock_subheader_"+e).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_message").style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage").style.display="none";for(var t=wfu_get_file_ids(e),n=1;n<=t.length;n++)a.tBodies[0].removeChild(document.getElementById("wfu_messageblock_"+e+"_"+n)),a.tBodies[0].removeChild(document.getElementById("wfu_messageblock_subheader_"+e+"_"+n))}}function wfu_show_simple_progressbar(e,a){var s=document.getElementById("progressbar_"+e+"_animation"),t=document.getElementById("progressbar_"+e+"_imagesafe");s&&("progressive"==a?(s.style.width="0%",s.className="file_progress_progressive",t.style.display="none",s.style.display="block"):wfu_BrowserCaps.supportsAnimation?(s.style.width="25%",s.className="file_progress_shuffle",t.style.display="none",s.style.display="block"):(s.style.width="0%",s.className="file_progress_noanimation",s.style.display="none",t.style.display="block"),document.getElementById("wordpress_file_upload_progressbar_"+e).style.display="block")}function wfu_hide_simple_progressbar(e){var a=document.getElementById("progressbar_"+e+"_animation"),s=document.getElementById("progressbar_"+e+"_imagesafe");a&&(document.getElementById("wordpress_file_upload_progressbar_"+e).style.display="none",a.style.width="0%",a.className="file_progress_noanimation",s.style.display="none",a.style.display="block")}function wfu_invoke_shortcode_editor(e,a,s,t){for(var n=document.getElementsByTagName("BUTTON"),l=0,r=null,i=0;i<n.length;i++)n[i].parentNode&&n[i].parentNode.id==t+"_editor_"+e&&(r=n[i],l++);if(0!=l){if(l>1)return void alert(GlobalData.consts.same_pluginid);var o=wfu_GetHttpRequestObject();if(null!=o){r.parentNode.style.display="none",document.getElementById(t+"_overlay_"+e).style.display="block";var _=GlobalData.consts.ajax_url;params=new Array(5),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_edit_shortcode",params[1]=new Array(2),params[1][0]="upload_id",params[1][1]=e,params[2]=new Array(2),params[2][0]="post_id",params[2][1]=a,params[3]=new Array(2),params[3][0]="post_hash",params[3][1]=s,params[4]=new Array(2),params[4][0]="shortcode_tag",params[4][1]=t;for(var d="",i=0;i<params.length;i++)d+=(i>0?"&":"")+params[i][0]+"="+encodeURI(params[i][1]);o.open("POST",_,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.onreadystatechange=function(){if(4==o.readyState&&200==o.status){document.getElementById(t+"_overlay_"+e).style.display="none",r.parentNode.removeAttribute("style");var a="wfu_edit_shortcode:",s=o.responseText.indexOf(a);-1==s&&(s=o.responseText.length);var n=(o.responseText.substr(0,s),o.responseText.substr(s+a.length,o.responseText.length-s-a.length));s=n.indexOf(":");var l=n.substr(0,s);if(txt_value=n.substr(s+1,n.length-s-1),"success"==l){var i=window.open(wfu_plugin_decode_string(txt_value),"_blank");i.plugin_window=window}else"check_page_obsolete"==l&&alert(txt_value)}},o.send(d)}}}GlobalData={},UploadStates={},GlobalData.filestatematch={},GlobalData.filestatematch.success=[0,1,2,2],GlobalData.filestatematch.warning=[1,1,2,2],GlobalData.filestatematch.error1=[3,3,2,3],GlobalData.filestatematch.error2=[2,2,2,3],GlobalData.UploadInProgressString="",GlobalData.FreeChangeHandler=!1,wfu_Check_Browser_Capabilities();
lib/wfu_admin.php CHANGED
@@ -171,19 +171,19 @@ function wordpress_file_upload_manage_dashboard() {
171
  $_SESSION['wfu_add_shortcode_ticket'] = 'noticket';
172
  }
173
  elseif ( $action == 'edit_shortcode' && $data_enc != "" && $tag != "" ) {
174
- $data = wfu_decode_array_from_string($data_enc);
175
  if ( wfu_check_edit_shortcode($data) ) wfu_shortcode_composer($data, $tag);
176
  else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED);
177
  }
178
  elseif ( $action == 'delete_shortcode' && $data_enc != "" ) {
179
- $data = wfu_decode_array_from_string($data_enc);
180
- if ( wfu_check_edit_shortcode($data) ) $echo_str = wfu_delete_shortcode_prompt($data);
181
  else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED);
182
  }
183
  elseif ( $action == 'deleteshortcode' && $data_enc != "" ) {
184
- $data = wfu_decode_array_from_string($data_enc);
185
  if ( wfu_check_edit_shortcode($data) ) {
186
- wfu_delete_shortcode($data);
187
  $echo_str = wfu_manage_mainmenu();
188
  }
189
  else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED);
@@ -463,7 +463,7 @@ function wfu_manage_instances_of_shortcode($tag, $title, $slug, $inc) {
463
  $i = 1;
464
  foreach ( $wfu_shortcodes as $key => $data ) {
465
  $id = $data['post_id'];
466
- $data_enc = wfu_encode_array_to_string($data);
467
  $echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\')){document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\').item(i).style.visibility=\'hidden\';} document.getElementById(\'wfu_shortcode_actions_'.$inc.'_'.$i.'\').style.visibility=\'visible\'" onmouseout="for (i in document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\')){document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\').item(i).style.visibility=\'hidden\';}">';
468
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">';
469
  $echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_shortcode&tag='.$tag.'&data='.$data_enc.'" title="Plugin #'.$i.'">Plugin '.$i.'</a>';
@@ -543,10 +543,10 @@ function wfu_replace_shortcode($data, $new_shortcode) {
543
  return ( wp_update_post( wp_slash($new_post) ) === 0 ? false : true );
544
  }
545
 
546
- function wfu_delete_shortcode_prompt($data) {
547
  $siteurl = site_url();
 
548
  $postid = $data['post_id'];
549
- $data_enc = wfu_encode_array_to_string($data);
550
  $echo_str = "\n".'<div class="wrap">';
551
  $echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
552
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
171
  $_SESSION['wfu_add_shortcode_ticket'] = 'noticket';
172
  }
173
  elseif ( $action == 'edit_shortcode' && $data_enc != "" && $tag != "" ) {
174
+ $data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
175
  if ( wfu_check_edit_shortcode($data) ) wfu_shortcode_composer($data, $tag);
176
  else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED);
177
  }
178
  elseif ( $action == 'delete_shortcode' && $data_enc != "" ) {
179
+ $data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
180
+ if ( wfu_check_edit_shortcode($data) ) $echo_str = wfu_delete_shortcode_prompt($data_enc);
181
  else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED);
182
  }
183
  elseif ( $action == 'deleteshortcode' && $data_enc != "" ) {
184
+ $data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
185
  if ( wfu_check_edit_shortcode($data) ) {
186
+ if ( wfu_delete_shortcode($data) ) wfu_clear_shortcode_data_from_safe($data_enc);
187
  $echo_str = wfu_manage_mainmenu();
188
  }
189
  else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED);
463
  $i = 1;
464
  foreach ( $wfu_shortcodes as $key => $data ) {
465
  $id = $data['post_id'];
466
+ $data_enc = wfu_safe_store_shortcode_data(wfu_encode_array_to_string($data));
467
  $echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\')){document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\').item(i).style.visibility=\'hidden\';} document.getElementById(\'wfu_shortcode_actions_'.$inc.'_'.$i.'\').style.visibility=\'visible\'" onmouseout="for (i in document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\')){document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\').item(i).style.visibility=\'hidden\';}">';
468
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">';
469
  $echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_shortcode&tag='.$tag.'&data='.$data_enc.'" title="Plugin #'.$i.'">Plugin '.$i.'</a>';
543
  return ( wp_update_post( wp_slash($new_post) ) === 0 ? false : true );
544
  }
545
 
546
+ function wfu_delete_shortcode_prompt($data_enc) {
547
  $siteurl = site_url();
548
+ $data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
549
  $postid = $data['post_id'];
 
550
  $echo_str = "\n".'<div class="wrap">';
551
  $echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
552
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
lib/wfu_admin_settings.php CHANGED
@@ -50,6 +50,15 @@ function wfu_manage_settings($message = '') {
50
  $echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['postmethod'] == 'fopen' || $plugin_options['postmethod'] == '' ? 'Using fopen' : ( $plugin_options['postmethod'] == 'curl' ? 'Using cURL' : 'Using Sockets' ) ).'</strong></p>';
51
  $echo_str .= "\n\t\t\t\t\t\t".'</td>';
52
  $echo_str .= "\n\t\t\t\t\t".'</tr>';
 
 
 
 
 
 
 
 
 
53
  $echo_str .= "\n\t\t\t\t".'</tbody>';
54
  $echo_str .= "\n\t\t\t".'</table>';
55
  $echo_str .= "\n\t\t\t".'<p class="submit">';
@@ -70,6 +79,7 @@ function wfu_update_settings() {
70
 
71
  // $enabled = ( isset($_POST['wfu_enabled']) ? ( $_POST['wfu_enabled'] == "on" ? 1 : 0 ) : 0 );
72
  $hashfiles = ( isset($_POST['wfu_hashfiles']) ? ( $_POST['wfu_hashfiles'] == "on" ? 1 : 0 ) : 0 );
 
73
  if ( isset($_POST['wfu_basedir']) && isset($_POST['wfu_postmethod']) && isset($_POST['submit']) ) {
74
  if ( $_POST['submit'] == "Update" ) {
75
  $new_plugin_options['version'] = '1.0';
@@ -77,6 +87,7 @@ function wfu_update_settings() {
77
  $new_plugin_options['hashfiles'] = $hashfiles;
78
  $new_plugin_options['basedir'] = $_POST['wfu_basedir'];
79
  $new_plugin_options['postmethod'] = $_POST['wfu_postmethod'];
 
80
  $encoded_options = wfu_encode_plugin_options($new_plugin_options);
81
  update_option( "wordpress_file_upload_options", $encoded_options );
82
  if ( $new_plugin_options['hashfiles'] == '1' && $plugin_options['hashfiles'] != '1' )
@@ -87,4 +98,5 @@ function wfu_update_settings() {
87
  return true;
88
  }
89
 
 
90
  ?>
50
  $echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['postmethod'] == 'fopen' || $plugin_options['postmethod'] == '' ? 'Using fopen' : ( $plugin_options['postmethod'] == 'curl' ? 'Using cURL' : 'Using Sockets' ) ).'</strong></p>';
51
  $echo_str .= "\n\t\t\t\t\t\t".'</td>';
52
  $echo_str .= "\n\t\t\t\t\t".'</tr>';
53
+ $echo_str .= "\n\t\t\t\t\t".'<tr class="form-field">';
54
+ $echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
55
+ $echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_relaxcss">Relax CSS Rules</label>';
56
+ $echo_str .= "\n\t\t\t\t\t\t".'</th>';
57
+ $echo_str .= "\n\t\t\t\t\t\t".'<td>';
58
+ $echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_relaxcss" id="wfu_relaxcss" type="checkbox"'.($plugin_options['relaxcss'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled then the textboxes and the buttons of the plugin will inherit the theme\'s styling';
59
+ $echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['relaxcss'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
60
+ $echo_str .= "\n\t\t\t\t\t\t".'</td>';
61
+ $echo_str .= "\n\t\t\t\t\t".'</tr>';
62
  $echo_str .= "\n\t\t\t\t".'</tbody>';
63
  $echo_str .= "\n\t\t\t".'</table>';
64
  $echo_str .= "\n\t\t\t".'<p class="submit">';
79
 
80
  // $enabled = ( isset($_POST['wfu_enabled']) ? ( $_POST['wfu_enabled'] == "on" ? 1 : 0 ) : 0 );
81
  $hashfiles = ( isset($_POST['wfu_hashfiles']) ? ( $_POST['wfu_hashfiles'] == "on" ? 1 : 0 ) : 0 );
82
+ $relaxcss = ( isset($_POST['wfu_relaxcss']) ? ( $_POST['wfu_relaxcss'] == "on" ? 1 : 0 ) : 0 );
83
  if ( isset($_POST['wfu_basedir']) && isset($_POST['wfu_postmethod']) && isset($_POST['submit']) ) {
84
  if ( $_POST['submit'] == "Update" ) {
85
  $new_plugin_options['version'] = '1.0';
87
  $new_plugin_options['hashfiles'] = $hashfiles;
88
  $new_plugin_options['basedir'] = $_POST['wfu_basedir'];
89
  $new_plugin_options['postmethod'] = $_POST['wfu_postmethod'];
90
+ $new_plugin_options['relaxcss'] = $relaxcss;
91
  $encoded_options = wfu_encode_plugin_options($new_plugin_options);
92
  update_option( "wordpress_file_upload_options", $encoded_options );
93
  if ( $new_plugin_options['hashfiles'] == '1' && $plugin_options['hashfiles'] != '1' )
98
  return true;
99
  }
100
 
101
+
102
  ?>
lib/wfu_ajaxactions.php CHANGED
@@ -231,7 +231,7 @@ function wfu_ajax_action_edit_shortcode() {
231
  }
232
  }
233
  if ( $validkey == -1 ) die();
234
- $data_enc = wfu_encode_array_to_string($wfu_shortcodes[$validkey]);
235
  $url = site_url().'/wp-admin/options-general.php?page=wordpress_file_upload&tag='.$shortcode_tag.'&action=edit_shortcode&data='.$data_enc;
236
  die("wfu_edit_shortcode:success:".wfu_plugin_encode_string($url));
237
  }
231
  }
232
  }
233
  if ( $validkey == -1 ) die();
234
+ $data_enc = wfu_safe_store_shortcode_data(wfu_encode_array_to_string($wfu_shortcodes[$validkey]));
235
  $url = site_url().'/wp-admin/options-general.php?page=wordpress_file_upload&tag='.$shortcode_tag.'&action=edit_shortcode&data='.$data_enc;
236
  die("wfu_edit_shortcode:success:".wfu_plugin_encode_string($url));
237
  }
lib/wfu_blocks.php CHANGED
@@ -2,6 +2,10 @@
2
 
3
  /* Prepare information about directory or selection of target subdirectory */
4
  function wfu_prepare_subfolders_block($params, $widths, $heights) {
 
 
 
 
5
  $sid = $params["uploadid"];
6
  $selectsubdir = 'selectsubdir_'.$sid;
7
  $editbox = 'selectsubdiredit_'.$sid;
@@ -20,7 +24,7 @@ function wfu_prepare_subfolders_block($params, $widths, $heights) {
20
  $styles4 = "";
21
  if ( $widths["subfolders_select"] != "" ) $styles4 .= 'width: '.$widths["subfolders_select"].'; ';
22
  if ( $heights["subfolders_select"] != "" ) $styles4 .= 'height: '.$heights["subfolders_select"].'; ';
23
- $styles3 = ' style="'.$styles3.$styles4.'"';
24
  if ( $styles4 != "" ) $styles4 = ' style="'.$styles4.'"';
25
  $subfolder_paths = array ( );
26
  $linebr = "";
@@ -32,15 +36,17 @@ function wfu_prepare_subfolders_block($params, $widths, $heights) {
32
  $i = 1;
33
  if ( $params["showtargetfolder"] == "true" ) {
34
  $upload_directory = wfu_upload_plugin_directory($params["uploadpath"]);
35
- $subfolders_item["line".$i++] = '<span'.$styles1.'>'.$params["targetfolderlabel"].': <strong>'.$upload_directory.'</strong></span>'.$linebr;
36
  }
37
  if ( $params["askforsubfolders"] == "true" ) {
38
- $subfolders_item["line".$i++] = '<span class="file_item_clean"'.$styles2.'>'.$params["subfolderlabel"].' </span>';
39
- $subfolders_item["line".$i++] = '<div class="file_item_clean"'.$styles4.'>';
40
- $subfolders_item["line".$i++] = '<div class="file_item_clean_inner"'.( substr($params["subfoldertree"], 0, 5) == "auto+" ? '' : ' style="display:none;"' ).'>';
41
- $subfolders_item["line".$i++] = '<input type="text" id="'.$editbox.'" class="file_item_clean_empty" value="'.WFU_SUBDIR_TYPEDIR.'"'.( substr($params["subfoldertree"], 0, 5) == "auto+" ? '' : ' style="display:none;"' ).' onchange="wfu_selectsubdiredit_change('.$sid.');" onfocus="wfu_selectsubdiredit_enter('.$sid.');" onblur="wfu_selectsubdiredit_exit('.$sid.');" />';
 
42
  $subfolders_item["line".$i++] = '</div>';
43
- $subfolders_item["line".$i++] = '<select class="file_item_clean"'.$styles3.' id="'.$selectsubdir.'" onchange="wfu_selectsubdir_check('.$sid.');">';
 
44
  if ( $params["testmode"] == "true" ) {
45
  $subfolders_item["line".$i++] = "\t".'<option>'.WFU_NOTIFY_TESTMODE.'</option>';
46
  }
@@ -70,6 +76,7 @@ function wfu_prepare_subfolders_block($params, $widths, $heights) {
70
  if ( $default != -1 ) $subfolders_item["line".$zeroind] = "\t".'<option style="display:none;">'.WFU_SUBDIR_SELECTDIR.'</option>';
71
  }
72
  $subfolders_item["line".$i++] = '</select>';
 
73
  $subfolders_item["line".$i++] = '</div>';
74
  $subfolders_item["line".$i++] = '<input id="'.$defaultvalue.'" type="hidden" value="'.$default.'" />';
75
  }
@@ -236,7 +243,8 @@ function wfu_prepare_userdata_block($params, $widths, $heights) {
236
  if ( $params["testmode"] == "true" )
237
  $userdata_item["line".$i++] = "\t".'<input type="text" id="'.$userdata.'_message_'.$userdata_key.'" class="'.$userdata_item_class.'" value="Test message" readonly="readonly"'.$styles3.' />';
238
  else
239
- $userdata_item["line".$i++] = "\t".'<input type="text" id="'.$userdata.'_message_'.$userdata_key.'" class="'.$userdata_item_class.'" value=""'.$styles3.' onchange="javascript: document.getElementById(\''.$hiddeninput.'_userdata_'.$userdata_key.'\').value = this.value;" onfocus="javascript: if (this.className == \'file_userdata_message_required_empty\') {this.value = \'\'; this.className = \'file_userdata_message_required\';}" />';
 
240
  $userdata_item["line".$i++] = '</div>';
241
  }
242
 
2
 
3
  /* Prepare information about directory or selection of target subdirectory */
4
  function wfu_prepare_subfolders_block($params, $widths, $heights) {
5
+ $plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
6
+ $relaxcss = false;
7
+ if ( isset($plugin_options['relaxcss']) ) $relaxcss = ( $plugin_options['relaxcss'] == "1" );
8
+
9
  $sid = $params["uploadid"];
10
  $selectsubdir = 'selectsubdir_'.$sid;
11
  $editbox = 'selectsubdiredit_'.$sid;
24
  $styles4 = "";
25
  if ( $widths["subfolders_select"] != "" ) $styles4 .= 'width: '.$widths["subfolders_select"].'; ';
26
  if ( $heights["subfolders_select"] != "" ) $styles4 .= 'height: '.$heights["subfolders_select"].'; ';
27
+ $styles3 = ' style="'.( $relaxcss ? '' : $styles3 ).$styles4.'"';
28
  if ( $styles4 != "" ) $styles4 = ' style="'.$styles4.'"';
29
  $subfolder_paths = array ( );
30
  $linebr = "";
36
  $i = 1;
37
  if ( $params["showtargetfolder"] == "true" ) {
38
  $upload_directory = wfu_upload_plugin_directory($params["uploadpath"]);
39
+ $subfolders_item["line".$i++] = '<span class="subfolder_dir"'.$styles1.'>'.$params["targetfolderlabel"].': <strong>'.$upload_directory.'</strong></span>'.$linebr;
40
  }
41
  if ( $params["askforsubfolders"] == "true" ) {
42
+ $subfolders_item["line".$i++] = '<span class="file_item_clean subfolder_label"'.$styles2.'>'.$params["subfolderlabel"].' </span>';
43
+ $subfolders_item["line".$i++] = '<div class="file_item_clean subfolder_container"'.$styles4.'>';
44
+ $autoplus = ( substr($params["subfoldertree"], 0, 5) == "auto+" );
45
+ $subfolders_item["line".$i++] = '<div class="file_item_clean_inner subfolder_autoplus_container"'.( $autoplus ? '' : ' style="display:none;"' ).'>';
46
+ $subfolders_item["line".$i++] = '<input type="text" id="'.$editbox.'" class="file_item_clean_empty subfolder_autoplus_empty" value="'.WFU_SUBDIR_TYPEDIR.'"'.( $autoplus ? '' : ' style="display:none;"' ).' onchange="wfu_selectsubdiredit_change('.$sid.');" onfocus="wfu_selectsubdiredit_enter('.$sid.');" onblur="wfu_selectsubdiredit_exit('.$sid.');" />';
47
  $subfolders_item["line".$i++] = '</div>';
48
+ if ( $autoplus ) $subfolders_item["line".$i++] = '<div class="subfolder_autoplus_select_container">';
49
+ $subfolders_item["line".$i++] = '<select class="'.( $autoplus ? 'subfolder_autoplus_dropdown' : 'file_item_clean subfolder_dropdown' ).'"'.$styles3.' id="'.$selectsubdir.'" onchange="wfu_selectsubdir_check('.$sid.');">';
50
  if ( $params["testmode"] == "true" ) {
51
  $subfolders_item["line".$i++] = "\t".'<option>'.WFU_NOTIFY_TESTMODE.'</option>';
52
  }
76
  if ( $default != -1 ) $subfolders_item["line".$zeroind] = "\t".'<option style="display:none;">'.WFU_SUBDIR_SELECTDIR.'</option>';
77
  }
78
  $subfolders_item["line".$i++] = '</select>';
79
+ if ( $autoplus ) $subfolders_item["line".$i++] = '</div>';
80
  $subfolders_item["line".$i++] = '</div>';
81
  $subfolders_item["line".$i++] = '<input id="'.$defaultvalue.'" type="hidden" value="'.$default.'" />';
82
  }
243
  if ( $params["testmode"] == "true" )
244
  $userdata_item["line".$i++] = "\t".'<input type="text" id="'.$userdata.'_message_'.$userdata_key.'" class="'.$userdata_item_class.'" value="Test message" readonly="readonly"'.$styles3.' />';
245
  else
246
+ $userdata_item["line".$i++] = "\t".'<input type="text" id="'.$userdata.'_message_'.$userdata_key.'" class="'.$userdata_item_class.'" value=""'.$styles3.' onchange="javascript: document.getElementById(\''.$hiddeninput.'_userdata_'.$userdata_key.'\').value = this.value;" onfocus="wfu_userdata_focused(this);" />';
247
+ $userdata_item["line".$i++] = "\t".'<div id="'.$userdata.'_hint_'.$userdata_key.'" class="file_userdata_hint" style="display:none;">empty</div>';
248
  $userdata_item["line".$i++] = '</div>';
249
  }
250
 
lib/wfu_functions.php CHANGED
@@ -253,6 +253,7 @@ function wfu_encode_plugin_options($plugin_options) {
253
  $encoded_options .= 'hashfiles='.$plugin_options['hashfiles'].';';
254
  $encoded_options .= 'basedir='.wfu_plugin_encode_string($plugin_options['basedir']).';';
255
  $encoded_options .= 'postmethod='.$plugin_options['postmethod'].';';
 
256
  $encoded_options .= 'captcha_sitekey='.wfu_plugin_encode_string($plugin_options['captcha_sitekey']).';';
257
  $encoded_options .= 'captcha_secretkey='.wfu_plugin_encode_string($plugin_options['captcha_secretkey']).';';
258
  $encoded_options .= 'browser_permissions='.wfu_encode_array_to_string($plugin_options['browser_permissions']);
@@ -471,7 +472,7 @@ function wfu_parse_folderlist($subfoldertree) {
471
  }
472
  //split item in folder path and folder name
473
  $subfolder_items = explode('/', $subfolder);
474
- if ( $subfolder_items[1] != "" ) {
475
  $subfolder_dir = $subfolder_items[0];
476
  $subfolder_label = $subfolder_items[1];
477
  }
@@ -1162,6 +1163,30 @@ function wfu_get_params_fields_from_index($params_index) {
1162
  return $fields;
1163
  }
1164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1165
  function wfu_decode_dimensions($dimensions_str) {
1166
  $components = wfu_component_definitions();
1167
  $dimensions = array();
253
  $encoded_options .= 'hashfiles='.$plugin_options['hashfiles'].';';
254
  $encoded_options .= 'basedir='.wfu_plugin_encode_string($plugin_options['basedir']).';';
255
  $encoded_options .= 'postmethod='.$plugin_options['postmethod'].';';
256
+ $encoded_options .= 'relaxcss='.$plugin_options['relaxcss'].';';
257
  $encoded_options .= 'captcha_sitekey='.wfu_plugin_encode_string($plugin_options['captcha_sitekey']).';';
258
  $encoded_options .= 'captcha_secretkey='.wfu_plugin_encode_string($plugin_options['captcha_secretkey']).';';
259
  $encoded_options .= 'browser_permissions='.wfu_encode_array_to_string($plugin_options['browser_permissions']);
472
  }
473
  //split item in folder path and folder name
474
  $subfolder_items = explode('/', $subfolder);
475
+ if ( count($subfolder_items) > 1 && $subfolder_items[1] != "" ) {
476
  $subfolder_dir = $subfolder_items[0];
477
  $subfolder_label = $subfolder_items[1];
478
  }
1163
  return $fields;
1164
  }
1165
 
1166
+ function wfu_safe_store_shortcode_data($data) {
1167
+ $code = wfu_create_random_string(16);
1168
+ $_SESSION['wfu_shortcode_data_safe_storage'][$code] = $data;
1169
+ return $code;
1170
+ }
1171
+
1172
+ function wfu_get_shortcode_data_from_safe($code) {
1173
+ //sanitize $code
1174
+ $code = wfu_sanitize_code($code);
1175
+ if ( $code == "" ) return '';
1176
+ //return shortcode data from session variable, if exists
1177
+ if ( !isset($_SESSION['wfu_shortcode_data_safe_storage'][$code]) ) return '';
1178
+ return $_SESSION['wfu_shortcode_data_safe_storage'][$code];
1179
+ }
1180
+
1181
+ function wfu_clear_shortcode_data_from_safe($code) {
1182
+ //sanitize $code
1183
+ $code = wfu_sanitize_code($code);
1184
+ if ( $code == "" ) return;
1185
+ //clear shortcode data from session variable, if exists
1186
+ if ( !isset($_SESSION['wfu_shortcode_data_safe_storage'][$code]) ) return;
1187
+ unset($_SESSION['wfu_shortcode_data_safe_storage'][$code]);
1188
+ }
1189
+
1190
  function wfu_decode_dimensions($dimensions_str) {
1191
  $components = wfu_component_definitions();
1192
  $dimensions = array();
readme.txt CHANGED
@@ -113,6 +113,10 @@ The plugin is designed not to expose website sensitive information. It has been
113
 
114
  In the free version the upload will fail. However in the Pro version the upload will resume and will continue until the file is fully uploaded. This is especially useful when uploading very large files.
115
 
 
 
 
 
116
  == Screenshots ==
117
 
118
  1. A screenshot of the plugin in its most simple form.
@@ -125,6 +129,14 @@ In the free version the upload will fail. However in the Pro version the upload
125
 
126
  == Changelog ==
127
 
 
 
 
 
 
 
 
 
128
  = 3.1.2 =
129
  * important bug detected and fixed that was stripping slashes from post or page content when updating the shortcode using the shortcode composer
130
 
113
 
114
  In the free version the upload will fail. However in the Pro version the upload will resume and will continue until the file is fully uploaded. This is especially useful when uploading very large files.
115
 
116
+ = The plugin does not look nice with my theme. What can I do? =
117
+
118
+ There is an option in plugin's settings in Dashboard to relax the CSS rules, so that buttons and text boxes inherit the theme's styles. If additional styling is required, this can be done using CSS. The Professional version of the plugin allows CSS rules to be embed in the shortcode.
119
+
120
  == Screenshots ==
121
 
122
  1. A screenshot of the plugin in its most simple form.
129
 
130
  == Changelog ==
131
 
132
+ = 3.2.0 =
133
+ * added option in plugin's settings to relax CSS rules so that plugin inherits theme styling
134
+ * modifications in html and css of editable subfolders feature to look better
135
+ * modifications in html and css of prompt message when a required userdata field is empty
136
+ * PLUGINDIR was replaced by WP_PLUGIN_DIR so that the plugin can work for websites where the contents dir is other than wp-content
137
+ * fixed bug that was not allowing Shortcode Composer to launch when the shortcode was too big
138
+ * fixed bug that was causing front-end file list not to work properly when no instance of the plugin existed in the same page / post
139
+
140
  = 3.1.2 =
141
  * important bug detected and fixed that was stripping slashes from post or page content when updating the shortcode using the shortcode composer
142
 
release_notes.txt CHANGED
@@ -1 +1 @@
1
- <span><strong>Latest release notes: </strong>This release contains an important fix to a problem that was causing stripping of slashes in post or page content when using the Shortcode Composer to edit the plugin.<br /><br /><strong>Significant Version 3.1.0 release notes: </strong><!-- -->Version 3.1.0 of Wordpress File Upload Professional introduced a long waiting feature, which is <strong>a front-end list of uploaded files</strong>. Either logged users or guests can view the files they have uploaded from a page or post in a table layout. For details about this feature, please check the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">page</a><span>.<!-- --><!-- --></span>
1
+ <span><strong>Latest release notes: </strong>This is an important release as it incorporates a very significant feature, <strong>relaxation of CSS rules</strong>. By default, the plugin's buttons and textboxes are styled to look the same in all themes. However, there are many users that want them to inherit the styles (colors, fonts, sizes) of the theme they are using. An option has been added in plugin's settings in Dashboard to relax the CSS rules. If enabled, then minimum styling will be applied on buttons and textboxes of the plugin, so that they inherit theme's styles. For more information please check this </span><a href="http://www.iptanus.com/improve-styling-of-wordpress-file-upload-plugin/">article</a><span>.</span><br />Moreover, this release introduces some changes in the html code of <strong>editable subfolders</strong> feature so that it looks better and also some changes in <strong>user fields</strong> so that a hint next to a required field is shown when the field has empty value.</span>
wordpress_file_upload.php CHANGED
@@ -4,7 +4,7 @@ if( !session_id() ) { session_start(); }
4
  /*
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
- Version: 3.1.2
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */
@@ -39,8 +39,8 @@ $uri = $_SERVER['REQUEST_URI'];
39
  if ( strpos($uri, 'wp-login.php') !== false ) return;
40
 
41
  DEFINE("WPFILEUPLOAD_PLUGINFILE", __FILE__);
42
- DEFINE("WPFILEUPLOAD_DIR", '/'.PLUGINDIR .'/'.dirname(plugin_basename (__FILE__)).'/');
43
- DEFINE("ABSWPFILEUPLOAD_DIR", ABSPATH.WPFILEUPLOAD_DIR);
44
  $_SESSION['wfu_ABSPATH'] = ABSPATH;
45
  add_shortcode("wordpress_file_upload", "wordpress_file_upload_handler");
46
  load_plugin_textdomain('wordpress-file-upload', false, dirname(plugin_basename (__FILE__)).'/languages');
@@ -70,9 +70,18 @@ add_action('wp_ajax_wfu_ajax_action_edit_shortcode', 'wfu_ajax_action_edit_short
70
  wfu_include_lib();
71
 
72
  function wfu_enqueue_frontpage_scripts() {
73
- // wp_enqueue_style('wordpress-file-upload-reset', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_reset.css',false,'1.0','all');
74
- wp_enqueue_style('wordpress-file-upload-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_style.css',false,'1.0','all');
75
- wp_enqueue_style('wordpress-file-upload-style-safe', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_style_safe.css',false,'1.0','all');
 
 
 
 
 
 
 
 
 
76
  wp_enqueue_script('json_class', WPFILEUPLOAD_DIR.'js/json2.js');
77
  wp_enqueue_script('wordpress_file_upload_script', WPFILEUPLOAD_DIR.'js/wordpress_file_upload_functions.js');
78
  }
4
  /*
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
+ Version: 3.2.0
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */
39
  if ( strpos($uri, 'wp-login.php') !== false ) return;
40
 
41
  DEFINE("WPFILEUPLOAD_PLUGINFILE", __FILE__);
42
+ DEFINE("WPFILEUPLOAD_DIR", '/'.substr(WP_PLUGIN_DIR, strlen(ABSPATH)) .'/'.dirname(plugin_basename (__FILE__)).'/');
43
+ DEFINE("ABSWPFILEUPLOAD_DIR", ( substr(ABSPATH, -1) == "/" ? substr(ABSPATH, 0, -1) : ABSPATH ).WPFILEUPLOAD_DIR);
44
  $_SESSION['wfu_ABSPATH'] = ABSPATH;
45
  add_shortcode("wordpress_file_upload", "wordpress_file_upload_handler");
46
  load_plugin_textdomain('wordpress-file-upload', false, dirname(plugin_basename (__FILE__)).'/languages');
70
  wfu_include_lib();
71
 
72
  function wfu_enqueue_frontpage_scripts() {
73
+ $plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
74
+ $relaxcss = false;
75
+ if ( isset($plugin_options['relaxcss']) ) $relaxcss = ( $plugin_options['relaxcss'] == '1' );
76
+
77
+ if ( $relaxcss ) {
78
+ wp_enqueue_style('wordpress-file-upload-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_style_relaxed.css',false,'1.0','all');
79
+ wp_enqueue_style('wordpress-file-upload-style-safe', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_style_safe_relaxed.css',false,'1.0','all');
80
+ }
81
+ else {
82
+ wp_enqueue_style('wordpress-file-upload-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_style.css',false,'1.0','all');
83
+ wp_enqueue_style('wordpress-file-upload-style-safe', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_style_safe.css',false,'1.0','all');
84
+ }
85
  wp_enqueue_script('json_class', WPFILEUPLOAD_DIR.'js/json2.js');
86
  wp_enqueue_script('wordpress_file_upload_script', WPFILEUPLOAD_DIR.'js/wordpress_file_upload_functions.js');
87
  }