Version Description
- added internal filter _wfu_file_upload_output before echoing uploader shortcode html
- added ability to change the order of additional user fields in shortcode visual editor
Download this release
Release Info
Developer | nickboss |
Plugin | WordPress File Upload |
Version | 3.9.6 |
Comparing to | |
See all releases |
Code changes from version 3.9.5 to 3.9.6
- images/down_12.png +0 -0
- images/up_12.png +0 -0
- js/wordpress_file_upload_adminfunctions.js +3 -3
- lib/wfu_admin_composer.php +23 -1
- lib/wfu_constants.php +2 -0
- readme.txt +10 -0
- release_notes.txt +1 -1
- wordpress_file_upload.php +4 -1
images/down_12.png
ADDED
Binary file
|
images/up_12.png
ADDED
Binary file
|
js/wordpress_file_upload_adminfunctions.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
function wfu_admin_activate_tab(e){for(var t,a,l=document.getElementById("wfu_tab_container"),n=0;n<l.childNodes.length;n++)t=l.childNodes[n],1===t.nodeType&&(a=t.id.substr(8),t.className.indexOf("nav-tab-active")>-1&&(t.className="nav-tab",document.getElementById("wfu_container_"+a).style.display="none"));document.getElementById("wfu_tab_"+e).className="nav-tab nav-tab-active",document.getElementById("wfu_container_"+e).style.display="block"}function wfu_admin_onoff_clicked(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_wrapper"),l=document.getElementsByClassName("wfu_shadow_"+e,"div",a),n=document.getElementsByClassName("wfu_shadow_"+e+"_inv","div",a),d="on"==t.className.substr(t.className.length-2);if(d=!d){document.getElementById("wfu_attribute_value_"+e).value="true",t.className="wfu_onoff_container_on";for(var u=0;u<l.length;u++)l[u].style.display="none";for(var u=0;u<n.length;u++)n[u].style.display="block"}else{document.getElementById("wfu_attribute_value_"+e).value="false",t.className="wfu_onoff_container_off";for(var u=0;u<l.length;u++)l[u].style.display="block";for(var u=0;u<n.length;u++)n[u].style.display="none"}wfu_generate_shortcode(),("userdata"==e||"formdata"==e)&&wfu_update_formfield_variables()}function wfu_admin_radio_clicked(e){var t=document.getElementsByName("wfu_radioattribute_"+e),a=document.getElementById("wfu_wrapper"),l=document.getElementsByClassName("wfu_shadow_"+e,"div",a),n=document.getElementsByClassName("wfu_shadow_"+e+"_inv","div",a),d="";for(o=0;o<t.length;o++)t[o].checked&&(d=t[o].value);var u="*"==d.substr(0,1);if(u){d=d.substr(1);for(var o=0;o<l.length;o++)l[o].style.display="none";for(var o=0;o<n.length;o++)n[o].style.display="block"}else{for(var o=0;o<l.length;o++)l[o].style.display="block";for(var o=0;o<n.length;o++)n[o].style.display="none"}document.getElementById("wfu_attribute_value_"+e).value=d,wfu_generate_shortcode()}function wfu_addEventHandler(e,t,a){e.addEventListener?e.addEventListener(t,a,!1):e.attachEvent?e.attachEvent("on"+t,a):e["on"+t]=a}function wfu_attach_separator_dragdrop_events(){for(var e,t=document.getElementById("wfu_placements_container"),a=0;a<t.childNodes.length;a++)e=t.childNodes[a],("wfu_component_separator_hor"==e.className||"wfu_component_separator_ver"==e.className)&&(wfu_addEventHandler(e,"dragenter",wfu_separator_dragenter),wfu_addEventHandler(e,"dragover",wfu_default_dragover),wfu_addEventHandler(e,"dragleave",wfu_separator_dragleave),wfu_addEventHandler(e,"drop",wfu_separator_drop))}function wfu_Attach_Admin_DragDrop_Events(){if(window.FileReader){var e=document.getElementById("wfu_placements_container");if(e){for(var t,a=document.getElementById("wfu_componentlist_container"),l=0;l<e.childNodes.length;l++)t=e.childNodes[l],"wfu_component_box"==t.className&&(wfu_addEventHandler(t,"dragstart",wfu_component_dragstart),wfu_addEventHandler(t,"dragend",wfu_component_dragend));for(var l=0;l<a.childNodes.length;l++)if(t=a.childNodes[l],"wfu_component_box_container"==t.className)for(var n=0;n<t.childNodes.length;n++)"wfu_component_box wfu_inbase"==t.childNodes[n].className&&(wfu_addEventHandler(t.childNodes[n],"dragstart",wfu_component_dragstart),wfu_addEventHandler(t.childNodes[n],"dragend",wfu_component_dragend));t=document.getElementById("wfu_componentlist_dragdrop"),wfu_addEventHandler(t,"dragenter",wfu_componentlist_dragenter),wfu_addEventHandler(t,"dragover",wfu_default_dragover),wfu_addEventHandler(t,"dragleave",wfu_componentlist_dragleave),wfu_addEventHandler(t,"drop",wfu_componentlist_drop),wfu_attach_separator_dragdrop_events()}}}function wfu_componentlist_dragenter(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;var t=document.getElementById("wfu_componentlist_dragdrop");return-1==t.className.indexOf("wfu_componentlist_dragdrop_dragover")&&(t.className+=" wfu_componentlist_dragdrop_dragover"),!1}function wfu_componentlist_dragleave(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;var t=document.getElementById("wfu_componentlist_dragdrop");return t.className=t.className.replace(" wfu_componentlist_dragdrop_dragover",""),!1}function wfu_componentlist_drop(e){e=e||window.event,e.preventDefault&&e.preventDefault();var t=e.dataTransfer.getData("Component");if(!t)return!1;var a=t.split("_"),l=a[0],n=parseInt(a[1]),d=document.getElementById("wfu_component_box_"+l+"_"+n);0==n?(d.className="wfu_component_box wfu_inbase",d.style.display="block",document.getElementById("wfu_component_box_container_"+l).appendChild(d)):d.parentNode.removeChild(d);var u=wfu_admin_recreate_placements_text(null,"");return wfu_admin_recreate_placements_panel(u),document.getElementById("wfu_attribute_value_placements").value=u,wfu_update_multiplacement_attributes(),wfu_generate_shortcode(),!1}function wfu_separator_dragenter(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;if("wfu_component_separator_hor"==e.target.className){var t=document.getElementById("wfu_component_bar_hor");t.style.top=e.target.offsetTop+"px",t.style.display="block"}else if("wfu_component_separator_ver"==e.target.className){var t=document.getElementById("wfu_component_bar_ver");t.style.top=e.target.offsetTop+"px",t.style.left=e.target.offsetLeft+"px",t.style.display="block"}return!1}function wfu_default_dragover(e){return e=e||window.event,e.preventDefault&&e.preventDefault(),!1}function wfu_separator_dragleave(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;if("wfu_component_separator_hor"==e.target.className){var t=document.getElementById("wfu_component_bar_hor");t.style.display="none"}else if("wfu_component_separator_ver"==e.target.className){var t=document.getElementById("wfu_component_bar_ver");t.style.display="none"}return!1}function wfu_separator_drop(e){e=e||window.event,e.preventDefault&&e.preventDefault();var t=e.dataTransfer.getData("Component");if(!t)return!1;var a=t.split("_"),l=a[0],n=parseInt(a[1]),d=document.getElementById("wfu_component_box_"+l+"_"+n);d.style.display="none",d.className="wfu_component_box wfu_inbase",document.getElementById("wfu_component_box_container_"+l).appendChild(d);var u=wfu_admin_recreate_placements_text(e.target,l);return wfu_admin_recreate_placements_panel(u),document.getElementById("wfu_attribute_value_placements").value=u,wfu_update_multiplacement_attributes(),wfu_generate_shortcode(),!1}function wfu_component_dragstart(e){e=e||window.event,e.dataTransfer.setData("Component",e.target.id.replace("wfu_component_box_","")),-1==e.target.className.indexOf("wfu_component_box_dragged")&&(e.target.className+=" wfu_component_box_dragged",DraggedItem=e.target),e.target.style.zIndex=3;var t=document.getElementById("wfu_componentlist_dragdrop");return t.className="wfu_componentlist_dragdrop wfu_componentlist_dragdrop_dragover",t.style.display="block",!1}function wfu_component_dragend(e){e=e||window.event,DraggedItem=null,e.target.style.zIndex=1;var t=document.getElementById("wfu_componentlist_dragdrop");return t.style.display="none",t.className="wfu_componentlist_dragdrop",e.target.className=e.target.className.replace(" wfu_component_box_dragged",""),document.getElementById("wfu_component_bar_ver").style.display="none",document.getElementById("wfu_component_bar_hor").style.display="none",!1}function wfu_admin_recreate_placements_text(e,t){function a(e){""!=d&&(d+=n),d+=e,n=""}for(var l=document.getElementById("wfu_placements_container"),n="",d="",u=0;u<l.childNodes.length;u++)item=l.childNodes[u],"wfu_component_separator_ver"==item.className?(""==n&&(n="+"),item==e&&(a(t),n="+")):"wfu_component_separator_hor"==item.className?(n="/",item==e&&(a(t),n="/")):"wfu_component_box"==item.className&&a(item.id.replace("wfu_component_box_","").replace(/_.*$/,""));return d}function wfu_admin_recreate_placements_panel(e){for(var t,a,l,n,d,u,o,r=document.getElementById("wfu_placements_container"),_="",s=0;s<r.childNodes.length;s++)t=r.childNodes[s],"wfu_component_box"==t.className&&(n=t.id.replace("wfu_component_box_",""),d=n.split("_"),_=d[0],u=parseInt(d[1]),0==u?(t.style.display="inline-block",t.className="wfu_component_box wfu_inbase",document.getElementById("wfu_component_box_container_"+_).appendChild(t)):t.parentNode.removeChild(t));for(var c=document.querySelectorAll("div.wfu_component_box_container"),i={},s=0;s<c.length;s++)_=c[s].id.replace("wfu_component_box_container_",""),i[_]=0,o=document.querySelector("div#"+c[s].id+" div.wfu_component_box_index"),o&&(o.innerHTML="1");r.innerHTML="",a=e.split("/");for(var s=0;s<a.length;s++){t=document.createElement("DIV"),t.className="wfu_component_separator_hor",t.setAttribute("draggable",!0),r.appendChild(t),t=document.createElement("DIV"),t.className="wfu_component_separator_ver",t.setAttribute("draggable",!0),r.appendChild(t),l=a[s].split("+");for(var f=0;f<l.length;f++)t=document.querySelector("div#wfu_component_box_container_"+l[f]+" div.wfu_component_box.wfu_inbase"),t&&(n=t.id.replace("wfu_component_box_",""),d=n.split("_"),_=d[0],u=parseInt(d[1]),0==u?r.appendChild(t):(i[_]++,t.id="wfu_component_box_"+_+"_"+(i[_]+1).toString(),t.style.display="block",o=document.querySelector("div#"+t.id+" div.wfu_component_box_index"),o.innerHTML=(i[_]+1).toString(),t=t.cloneNode(!0),r.appendChild(t),t.id="wfu_component_box_"+_+"_"+i[_].toString(),o=document.querySelector("div#"+t.id+" div.wfu_component_box_index"),o.innerHTML=i[_].toString(),wfu_addEventHandler(t,"dragstart",wfu_component_dragstart),wfu_addEventHandler(t,"dragend",wfu_component_dragend)),t.className="wfu_component_box",t.style.display="inline-block",t=document.createElement("DIV"),t.className="wfu_component_separator_ver",t.setAttribute("draggable",!0),r.appendChild(t))}t=document.createElement("DIV"),t.className="wfu_component_separator_hor",t.setAttribute("draggable",!0),r.appendChild(t),t=document.createElement("DIV"),t.id="wfu_component_bar_hor",t.className="wfu_component_bar_hor",r.appendChild(t),t=document.createElement("DIV"),t.id="wfu_component_bar_ver",t.className="wfu_component_bar_ver",r.appendChild(t),wfu_attach_separator_dragdrop_events()}function wfu_update_multiplacement_attributes(){for(var e=document.querySelectorAll("div.wfu_component_box_container"),t=0;t<e.length;t++){itemname=e[t].id.replace("wfu_component_box_container_","");var a=document.querySelector("div#"+e[t].id+" div.wfu_component_box_index");if(a)for(var l=Math.max(1,parseInt(a.innerHTML)-1),n=document.getElementsByName("wfu_attribute_governor_"+itemname),d=0;d<n.length;d++)wfu_update_multiplacement_attribute(n[d].value,l)}}function wfu_update_multiplacement_attribute(e,t){if("userdatalabel"==e){var a=document.querySelectorAll("div.wfu_formdata_container"),l=a.length;if(1>l)return;for(var n,d,u=a[0],o=2;o<=Math.max(l,t);){if(o>l){var r=e+o.toString();for(n=u.parentNode;null!=n&&"TR"!=n.tagName;)n=n.parentNode;if(null==n||"TR"!=n.tagName)return;d=n.cloneNode(!0),d.id="tr_"+wfu_randomString(4),n.parentNode.appendChild(d);var _=document.querySelector("tr#"+d.id+' label[for="wfu_attribute_'+e+'"]');_.setAttribute("for","wfu_attribute_"+r),_.innerHTML+=" ("+o.toString()+")",_=document.querySelector("tr#"+d.id+" input.wfu_attribute_governor"),_.setAttribute("name","wfu_attribute_governor_independent"),_.value=r,_=document.querySelector("tr#"+d.id+" div.wfu_formdata_container"),_.id+=o.toString();var s=document.getElementById("wfu_attribute_default_"+r);s||(s=document.createElement("INPUT"),s.id="wfu_attribute_default_"+r,s.type="hidden",s.value=document.getElementById("wfu_attribute_default_"+e).value,document.getElementById("wfu_attribute_defaults").appendChild(s));var c=document.getElementById("wfu_attribute_value_"+r);c||(c=document.createElement("INPUT"),c.id="wfu_attribute_value_"+r,c.type="hidden",c.value=s.value,document.getElementById("wfu_attribute_values").appendChild(c)),window["wfu_attribute_"+r+"_formtemplate"]=window["wfu_attribute_"+e+"_formtemplate"],window["wfu_attribute_"+r+"_typeprops"]=window["wfu_attribute_"+e+"_typeprops"],wfu_apply_value(r,"formfields",c.value)}else if(o>t){for(d=a[o-1].parentNode;null!=d&&"TR"!=d.tagName;)d=d.parentNode;if(null==d||"TR"!=d.tagName)return;d.parentNode.removeChild(d),wfu_update_formfield_variables()}o++}}}function wfu_subfolders_input_changed(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_subfolders_path_","");a=a.replace("wfu_subfolders_label_","");var l=document.getElementById("wfu_attribute_"+a);if(!(l.selectedIndex<0)){var n,d,u=document.getElementById("wfu_subfolders_path_"+a),o=document.getElementById("wfu_subfolders_label_"+a),r=document.getElementById("wfu_subfolders_ok_"+a),_="1"==document.getElementById("wfu_subfolders_isnewitem_"+a).value;if(_)n="",d="";else{var s=l.data;t=s[l.selectedIndex],n=t.path,d=t.label}if(u.value==n&&o.value==d)r.disabled=!0,_||wfu_subfolders_update_nav(a);else{r.disabled=!1;for(var c=document.getElementsByName("wfu_subfolder_nav_"+a),i=0;i<c.length;i++)c[i].disabled=!0}}}function wfu_subfolders_auto_changed(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_subfolders_auto_"+e),l=document.getElementById("wfu_subfolders_editable_"+e),n=document.getElementById("wfu_subfolders_manualtext_"+e);if(a.checked){var d=document.getElementById("wfu_attribute_value_"+e).value;"auto"!=d.substr(0,4)&&(n.value=d),l.parentNode.style.display="inline",wfu_apply_value(e,"folderlist","auto"+(l.checked?"+":"")),t.disabled=!0}else t.disabled=!1,l.parentNode.style.display="none",wfu_apply_value(e,"folderlist",n.value)}function wfu_subfolders_up_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=item.index-1;if(!(0>l)){for(var n=-1,d=t.selectedIndex-1;d>=0;){if(a[d].level==item.level&&a[d].index==l){n=d;break}d--}if(-1!=n){var u=0;for(d=t.selectedIndex+1;d<a.length&&a[d].level>item.level;)u++,d++;a[n].index=item.index,item.index=l,t.data=a.slice(0,n).concat(a.slice(t.selectedIndex,t.selectedIndex+1+u)).concat(a.slice(n,t.selectedIndex)).concat(a.slice(t.selectedIndex+1+u));var o=wfu_update_subfolder_list(e);t.selectedIndex=n,wfu_subfolders_update_toolnav(e),item=t,o!==item.oldVal&&(item.oldVal=o,document.getElementById("wfu_attribute_value_"+e).value=o,wfu_generate_shortcode())}}}}function wfu_subfolders_down_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=item.index+1,n=-1;for(curind=t.selectedIndex+1;curind<a.length;){if(a[curind].level==item.level){n=curind;break}if(a[curind].level<item.level)break;curind++}if(-1!=n){var d=0;for(curind=n+1;curind<a.length&&a[curind].level>item.level;)d++,curind++;a[n].index=item.index,item.index=l,t.data=a.slice(0,t.selectedIndex).concat(a.slice(n,n+1+d)).concat(a.slice(t.selectedIndex,n)).concat(a.slice(n+1+d));var u=wfu_update_subfolder_list(e);t.selectedIndex=t.selectedIndex+d+1,wfu_subfolders_update_toolnav(e),item=t,u!==item.oldVal&&(item.oldVal=u,document.getElementById("wfu_attribute_value_"+e).value=u,wfu_generate_shortcode())}}}function wfu_subfolders_left_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;for(item=a[t.selectedIndex],curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)a[curind].level--,curind++;item.level--;var l=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,l!==item.oldVal&&(item.oldVal=l,document.getElementById("wfu_attribute_value_"+e).value=l,wfu_generate_shortcode())}}function wfu_subfolders_right_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;for(item=a[t.selectedIndex],curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)a[curind].level++,curind++;item.level++;var l=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,l!==item.oldVal&&(item.oldVal=l,document.getElementById("wfu_attribute_value_"+e).value=l,wfu_generate_shortcode())}}function wfu_subfolders_def_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;if(item=a[t.selectedIndex],item["default"])item["default"]=!1;else{for(var l=0;l<a.length;l++)a[l]["default"]=!1;item["default"]=!0}var n=wfu_update_subfolder_list(e);wfu_subfolders_update_toolnav(e),item=t,n!==item.oldVal&&(item.oldVal=n,document.getElementById("wfu_attribute_value_"+e).value=n,wfu_generate_shortcode())}}function wfu_subfolders_ok_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=document.getElementById("wfu_subfolders_path_"+e),l=document.getElementById("wfu_subfolders_label_"+e);if(""==a.value||""==l.value)return void alert("Path or label cannot be empty!");var n=t.data,d="1"==document.getElementById("wfu_subfolders_isnewitem_"+e).value;if(d){var u=parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+e).value),o={label:l.value,path:a.value,level:u,"default":!1},r=parseInt(document.getElementById("wfu_subfolders_newitemindex_"+e).value);r>=n.length?n.push(o):n.splice(r,0,o)}else item=n[t.selectedIndex],item.path=a.value,item.label=l.value;var _=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,_!==item.oldVal&&(item.oldVal=_,document.getElementById("wfu_attribute_value_"+e).value=_,wfu_generate_shortcode())}}function wfu_subfolders_del_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=0;for(curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)l++,curind++;if(!(l>0)||confirm("Children items will be deleted as well. Proceed?")){a.splice(t.selectedIndex,1+l);var n=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,n!==item.oldVal&&(item.oldVal=n,document.getElementById("wfu_attribute_value_"+e).value=n,wfu_generate_shortcode())}}}function wfu_subfolders_add_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data,l=t.selectedIndex;item=a[l];var n=t.options,d=document.createElement("option");d.value="",d.innerHTML="",n.add(d,l),t.selectedIndex=l;var u=document.getElementById("wfu_subfolder_tools_"+e),o=document.getElementById("wfu_subfolders_path_"+e),r=document.getElementById("wfu_subfolders_label_"+e),_=document.getElementById("wfu_subfolders_ok_"+e),s=document.getElementById("wfu_subfolders_browse_"+e);u.className="wfu_subfolder_tools_container",r.disabled=!1,_.disabled=!0,document.getElementById("wfu_subfolders_isnewitem_"+e).value="1",document.getElementById("wfu_subfolders_newitemindex_"+e).value=l,document.getElementById("wfu_subfolders_newitemlevel_"+e).value=item.level,document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="",o.disabled=0==item.level,s.disabled=0==item.level,0==item.level?(o.value="{root}",r.value="{upload folder}"):(o.value="",r.value="");for(var c=document.getElementsByName("wfu_subfolder_nav_"+e),i=0;i<c.length;i++)c[i].disabled=!0}}function wfu_subfolders_browse_clicked(e){var t=wfu_GetHttpRequestObject();if(null!=t){var a=null;try{var a=new FormData}catch(l){}if(null!=a){for(var n=document.getElementById("wfu_global_dialog_container"),d=document.getElementById("wfu_subfolders_browser_"+e),u=document.getElementById("wfu_subfolders_browse_"+e),o=document.getElementById("wfu_subfolders_inner_shadow_"+e),r=document.getElementById("wfu_subfolders_browser_msgcont_"+e),_=document.getElementById("wfu_subfolders_browser_msg_"+e),s=document.getElementById("wfu_subfolders_browser_img_"+e),c=document.getElementById("wfu_subfolders_browser_ok_"+e),i=document.getElementById("wfu_subfolders_browser_list_"+e);i.options.length>0;)i.options.remove(0);c.disabled=!0,c.onclick=function(){wfu_folder_browser_cancel_clicked(e)},_.innerHTML="loading folder contents...",s.style.display="inline",r.style.display="block",n.style.display="block",d.style.display="block",d.style.left=u.offsetLeft+u.offsetWidth-d.offsetWidth+"px",d.style.top=u.offsetTop+u.offsetHeight-d.offsetHeight+"px",o.style.display="block",n.onclick=function(){wfu_folder_browser_cancel_clicked(e)};var f=document.getElementById("wfu_attribute_uploadpath").value;"/"==f.substr(f.length-1)&&(f=f.substr(0,f.length-1));var m=wfu_get_relative_path(e).split(","),p=f+m[0];"/"!=p.substr(0)&&(p="/"+p);var w="";2==m.length&&(w=m[1]),a.append("action","wfu_ajax_action_read_subfolders"),a.append("folder1",wfu_plugin_encode_string(p)),a.append("folder2",wfu_plugin_encode_string(w)),t.key=e,t.addEventListener("load",wfu_readfolderComplete,!1),t.addEventListener("error",wfu_readfolderFailed,!1),t.addEventListener("abort",wfu_readfolderCanceled,!1),t.open("POST",AdminParams.wfu_ajax_url),t.send(a)}}}function wfu_readfolderComplete(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msgcont_"+t),l=document.getElementById("wfu_subfolders_browser_msg_"+t),n=document.getElementById("wfu_subfolders_browser_img_"+t),d=document.getElementById("wfu_subfolders_browser_list_"+t),u=document.getElementById("wfu_subfolders_browser_ok_"+t),o=document.getElementById("wfu_subfolders_path_"+t),r=document.getElementById("wfu_subfolders_label_"+t),_=e.target.responseText;if(-1!=_){var s="wfu_read_subfolders:",c=e.target.responseText.indexOf(s);-1==c&&(c=e.target.responseText.length);var i=(e.target.responseText.substr(0,c),e.target.responseText.substr(c+s.length,e.target.responseText.length-c-s.length));c=i.indexOf(":");var f=i.substr(0,c);if(txt_value=i.substr(c+1,i.length-c-1),"success"==f){for(var m,p=wfu_plugin_decode_string(txt_value),w=p.split(","),g=0,v=0;v<w.length;v++)""!=w[v]&&(m=document.createElement("option"),m.value=w[v],m.innerHTML=w[v].replace("*"," "),d.add(m),g++);0==g&&(m=document.createElement("option"),m.value="",m.innerHTML="{empty}",m.disabled=!0,d.add(m)),d.selectedIndex=-1,u.onclick=function(){var e=d.options[d.selectedIndex].value,a=parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+t).value);("*"==e.substr(0,1)||0==a)&&(document.getElementById("wfu_subfolders_newitemlevel_"+t).value=a+1,a>0&&(e=e.substr(1))),o.value=e,r.value=e,wfu_folder_browser_cancel_clicked(t),wfu_subfolders_ok_clicked(t)},a.style.display="none"}else"error"==f?(l.innerHTML=txt_value,n.style.display="none",u.disabled=!1):(l.innerHTML="Unknown error",n.style.display="none",u.disabled=!1)}}function wfu_readfolderFailed(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msg_"+t),l=document.getElementById("wfu_subfolders_browser_img_"+t),n=document.getElementById("wfu_subfolders_browser_ok_"+t);a.innerHTML="Unknown error",l.style.display="none",n.disabled=!1}function wfu_readfolderCanceled(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msg_"+t),l=document.getElementById("wfu_subfolders_browser_img_"+t),n=document.getElementById("wfu_subfolders_browser_ok_"+t);a.innerHTML="Unknown error",l.style.display="none",n.disabled=!1}function wfu_subfolders_browser_list_changed(e){var t=document.getElementById("wfu_subfolders_browser_list_"+e),a=document.getElementById("wfu_subfolders_browser_ok_"+e);a.disabled=t.selectedIndex<0}function wfu_folder_browser_cancel_clicked(e){var t=document.getElementById("wfu_global_dialog_container"),a=document.getElementById("wfu_subfolders_browser_"+e),l=(document.getElementById("wfu_subfolders_browse_"+e),document.getElementById("wfu_subfolders_inner_shadow_"+e));t.onclick=null,l.style.display="none",a.style.display="none",t.style.display="none"}function wfu_get_relative_path(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a,l=t.data,n="1"==document.getElementById("wfu_subfolders_isnewitem_"+e).value;a=n?parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+e).value):l[t.selectedIndex].level;for(var d="/",u=t.selectedIndex-1,o=a;u>=0&&o>1;)l[u].level<o&&(d="/"+l[u].path+d,o=l[u].level),u--;return n&&"1"==document.getElementById("wfu_subfolders_newitemlevel2_"+e).value&&a>0&&t.selectedIndex>0&&(d+=","+l[t.selectedIndex-1].path),d}}function wfu_subfolders_changed(e){wfu_update_subfolder_list(e),wfu_subfolders_update_toolnav(e)}function wfu_subfolders_update_toolnav(e){var t,a,l=document.getElementById("wfu_attribute_"+e),n=document.getElementById("wfu_subfolder_tools_"+e),d=document.getElementById("wfu_subfolders_path_"+e),u=document.getElementById("wfu_subfolders_label_"+e),o=document.getElementById("wfu_subfolders_ok_"+e),r=document.getElementById("wfu_subfolders_browse_"+e),_=document.getElementById("wfu_subfolders_auto_"+e);if(document.getElementById("wfu_subfolders_isnewitem_"+e).value="",document.getElementById("wfu_subfolders_newitemindex_"+e).value="",document.getElementById("wfu_subfolders_newitemlevel_"+e).value="",document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="",null==l.data?(t=wfu_decode_subfolder_list(e),l.data=t):t=l.data,0===l.data.length?(l.className="wfu_select_folders wfu_select_folders_empty",l.options[0].innerHTML=_.checked?"":"press here"):l.className="wfu_select_folders",l.selectedIndex<0)n.className="wfu_subfolder_tools_container wfu_subfolder_tools_disabled",d.disabled=!0,u.disabled=!0,o.disabled=!0,r.disabled=!0,u.value="",d.value="";else if(l.selectedIndex>=l.options.length-1){n.className="wfu_subfolder_tools_container",u.disabled=!1,o.disabled=!0,document.getElementById("wfu_subfolders_isnewitem_"+e).value="1",document.getElementById("wfu_subfolders_newitemindex_"+e).value=t.length;var s;s=0==t.length?0:0==t[t.length-1].level?1:t[t.length-1].level,document.getElementById("wfu_subfolders_newitemlevel_"+e).value=s,document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="1",d.disabled=0==s,r.disabled=!1,0==s?(d.value="{root}",u.value="{upload folder}"):(d.value="",u.value="")}else n.className="wfu_subfolder_tools_container",u.disabled=!1,o.disabled=!0,a=t[l.selectedIndex],d.disabled=0==a.level,r.disabled=0==a.level,u.value=a.label,d.value=a.path;var c=document.getElementsByName("wfu_subfolder_nav_"+e);if(l.selectedIndex<0||l.selectedIndex>=l.options.length-1)for(var i=0;i<c.length;i++)c[i].disabled=!0;else wfu_subfolders_update_nav(e)}function wfu_subfolders_update_nav(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_subfolders_up_"+e),l=document.getElementById("wfu_subfolders_down_"+e),n=document.getElementById("wfu_subfolders_left_"+e),d=document.getElementById("wfu_subfolders_right_"+e),u=document.getElementById("wfu_subfolders_add_"+e),o=document.getElementById("wfu_subfolders_def_"+e),r=document.getElementById("wfu_subfolders_del_"+e),_=t.data,s=_[t.selectedIndex];for(a.disabled=s.index<=0,ind=t.selectedIndex+1,nextind=0;ind<_.length;){if(_[ind].level==s.level){nextind=_[ind].index;break}if(_[ind].level<s.level)break;ind++}l.disabled=0==s.level||0==nextind,n.disabled=0==t.selectedIndex&&s.level<1||t.selectedIndex>0&&s.level<=1,t.selectedIndex>=1?prevlevel=_[t.selectedIndex-1].level:prevlevel=0,d.disabled=s.level-prevlevel>0,u.disabled=0==s.level,o.disabled=!1,o.className="button"+(s["default"]?" wfu_subfolder_nav_pressed":""),r.disabled=!1}function wfu_decode_subfolder(e){var t={label:"",path:"",level:0,"default":!1};e=e.trim();for(var a=0,l=!1;a<e.length&&"*"==e.substr(a,1);)a++;e=e.substr(a,e.length-a),"&"==e.substr(0,1)&&(e=e.substr(1),l=!0),t.level=a,t["default"]=l;var n=e.split("/");return 1==n.length?(t.path=n[0],t.label=n[0]):n.length>1&&(t.path=n[0],t.label=n[1]),0==a&&(t.path="{root}",""==t.label&&(t.label="{upload folder}")),t}function wfu_decode_subfolder_list(e){for(var t,a=document.getElementById("wfu_attribute_"+e).options,l=Array(),n=["root"],d=[0],u=-1,o=0;o<a.length-1;o++){for(l.push(wfu_decode_subfolder(wfu_plugin_decode_string(a[o].value))),n.length>l[o].level?n[l[o].level]=l[o].path:n.push(l[o].path),t="",j=1;j<=l[o].level;j++)t+=n[j]+"/";l[o].fullpath=t,d.length<=l[o].level&&d.push(0),l[o].level>u?l[o].index=0:l[o].index=d[l[o].level]+1,d[l[o].level]=l[o].index,u=l[o].level}return l}function wfu_update_subfolder_list(e){var t=document.getElementById("wfu_attribute_"+e).options,a=document.getElementById("wfu_attribute_"+e),l=a.data;if(null!=l){var n,d,u="";t.length=l.length+1;for(var o=0;o<l.length;o++){for(n="",d="",j=0;j<l[o].level;j++)n+="*",d+=" ";l[o]["default"]?(n+="&",t[o].className="wfu_select_folders_option_default"):t[o].className="",n+=l[o].path+"/"+l[o].label,d+=l[o].label,t[o].value=wfu_plugin_encode_string(n),t[o].innerHTML=d,""!=u&&(u+=","),u+=n}return t[l.length].value="",t[l.length].innerHTML="",u}}function wfu_userdata_edit_field(e,t,a){for(var l,n=0;n<e.childNodes.length;n++)l=e.childNodes[n],"INPUT"==l.tagName?"text"==l.type?(l.value=t,wfu_attach_element_handlers(l,wfu_update_userfield_value)):"checkbox"==l.type&&(l.checked=a):"DIV"==l.tagName&&(l.className="wfu_userdata_action")}function wfu_formdata_edit_field(e,t,a){}function wfu_formdata_type_changed(e){var t=e.split("_"),a=t[0],l="wfu_formfield_"+e,n=(document.getElementById("wfu_attribute_"+a),document.getElementById(l+"_container")),d=window["wfu_attribute_"+a+"_typeprops"][document.getElementById(l+"_type").value],u={type:document.getElementById(l+"_type").value,label:document.getElementById(l+"_label").value,labelposition:document.getElementById(l+"_labelposition").value,required:"show"==d.required.substr(0,4)&&document.getElementById(l+"_required")?document.getElementById(l+"_required").checked:"true"==d.required.substr(5),donotautocomplete:"show"==d.donotautocomplete.substr(0,4)&&document.getElementById(l+"_donotautocomplete")?document.getElementById(l+"_donotautocomplete").checked:"true"==d.donotautocomplete.substr(5),validate:"show"==d.validate.substr(0,4)&&document.getElementById(l+"_validate")?document.getElementById(l+"_validate").checked:"true"==d.validate.substr(5),typehook:"show"==d.typehook.substr(0,4)&&document.getElementById(l+"_typehook")?document.getElementById(l+"_typehook").checked:"true"==d.typehook.substr(5),hintposition:"show"==d.hintposition.substr(0,4)&&document.getElementById(l+"_hintposition")?document.getElementById(l+"_hintposition").value:d.hintposition.substr(5),"default":"show"==d["default"].substr(0,4)&&document.getElementById(l+"_default")?document.getElementById(l+"_default").value:d["default"].substr(5),data:"show"==d.data.substr(0,4)&&document.getElementById(l+"_data")?document.getElementById(l+"_data").value:d.data.substr(5),group:"show"==d.group.substr(0,4)&&document.getElementById(l+"_group")?document.getElementById(l+"_group").value:d.group.substr(5),format:"show"==d.format.substr(0,4)&&document.getElementById(l+"_format")?document.getElementById(l+"_format").value:d.format.substr(5)},o=wfu_formdata_prepare_template(a,u,e);n.innerHTML=o;for(var r=document.querySelectorAll("div#"+l+'_container input[name="wfu_formfield_elements"]'),_=0;_<r.length;_++)wfu_attach_element_handlers(r[_],wfu_update_formfield_value);for(var s=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_action_remove"),_=0;_<s.length;_++)s[_].className="wfu_formdata_action wfu_formdata_action_remove"+(s.length>1?"":" wfu_formdata_action_disabled");wfu_update_formfield_value({target:n})}function wfu_userdata_add_field(e){var t=e.parentNode,a=t.cloneNode(!0);wfu_userdata_edit_field(a,"",!1),t.parentNode.insertBefore(a,t.nextSibling)}function wfu_formdata_add_field(e){var t=e.split("_"),a=t[0],l=(t[1],document.getElementById("wfu_attribute_"+a)),n=document.getElementById("wfu_formfield_"+e+"_container"),d=document.createElement("DIV"),u=a+"_"+wfu_randomString(4);d.id="wfu_formfield_"+u+"_container",d.className="wfu_formdata_line_container",l.insertBefore(d,n.nextSibling);var o={type:"text",label:"",labelposition:"left",required:!1,donotautocomplete:!1,validate:!1,"default":"",data:"",group:"",format:"",hintposition:"right",typehook:!1},r=wfu_formdata_prepare_template(a,o,u);
|
2 |
-
d.innerHTML=r;for(var _=document.querySelectorAll("div#wfu_formfield_"+u+'_container input[name="wfu_formfield_elements"]'),s=0;s<_.length;s++)wfu_attach_element_handlers(_[s],wfu_update_formfield_value);for(var c=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_action_remove"),s=0;s<c.length;s++)c[s].className="wfu_formdata_action wfu_formdata_action_remove"+(c.length>1?"":" wfu_formdata_action_disabled");wfu_update_formfield_value({target:d})}function wfu_formdata_prepare_template(e,t,a){var l=wfu_plugin_decode_string(window["wfu_attribute_"+e+"_formtemplate"]),n=window["wfu_attribute_"+e+"_typeprops"][t.type],d=window["wfu_attribute_"+e+"_typeprops"][0].split(","),u=["required","donotautocomplete","validate","typehook","labelposition","hintposition","default","data","group","format"],o=["none","top","right","bottom","left"],r=["none","inline","top","right","bottom","left"];l=l.replace(/\[\[key\]\]/g,a).replace(/\[\[t\]\]/g,t.type).replace(/\[\[label\]\]/g,t.label).replace(/\[\[s\]\]/g,t.labelposition).replace(/\[\[d\]\]/g,t["default"]).replace(/\[\[l\]\]/g,t.data).replace(/\[\[data_label\]\]/g,n.data_label).replace(/\[\[g\]\]/g,t.group).replace(/\[\[f\]\]/g,t.format).replace(/\[\[p\]\]/g,t.hintposition);for(var _=0;_<u.length;_++)l=l.replace(new RegExp("\\[\\["+u[_]+"_hint\\]\\]","g"),n[u[_]+"_hint"]);for(var _=0;_<d.length;_++)l=l.replace("[[type_"+d[_]+"_selected]]",d[_]==t.type?' selected="selected"':"");for(var _=0;_<o.length;_++)l=l.replace("[[labelposition_"+o[_]+"_selected]]",o[_]==t.labelposition?' selected="selected"':"");for(var _=0;_<r.length;_++)l=l.replace("[[hintposition_"+r[_]+"_selected]]",r[_]==t.hintposition?' selected="selected"':"");return l=l.replace("[[remove_disabled]]",""),l=t.required?l.replace(/\[\[r\-\>\]\]|\[\[\<\-r\]\]/g,""):l.replace(/\[\[r\-\>\]\].*\[\[\<\-r\]\]/g,""),l=t.donotautocomplete?l.replace(/\[\[a\-\>\]\]|\[\[\<\-a\]\]/g,""):l.replace(/\[\[a\-\>\]\].*\[\[\<\-a\]\]/g,""),l=t.validate?l.replace(/\[\[v\-\>\]\]|\[\[\<\-v\]\]/g,""):l.replace(/\[\[v\-\>\]\].*\[\[\<\-v\]\]/g,""),l=t.typehook?l.replace(/\[\[h\-\>\]\]|\[\[\<\-h\]\]/g,""):l.replace(/\[\[h\-\>\]\].*\[\[\<\-h\]\]/g,""),l="show"==n.required.substr(0,4)?l.replace(/\[\[R\-\>\]\]|\[\[\<\-R\]\]/g,""):l.replace(/\[\[R\-\>\]\][^]*\[\[\<\-R\]\]/g,""),l="show"==n.donotautocomplete.substr(0,4)?l.replace(/\[\[A\-\>\]\]|\[\[\<\-A\]\]/g,""):l.replace(/\[\[A\-\>\]\][^]*\[\[\<\-A\]\]/g,""),l="show"==n.validate.substr(0,4)?l.replace(/\[\[V\-\>\]\]|\[\[\<\-V\]\]/g,""):l.replace(/\[\[V\-\>\]\][^]*\[\[\<\-V\]\]/g,""),l="show"==n.hintposition.substr(0,4)?l.replace(/\[\[P\-\>\]\]|\[\[\<\-P\]\]/g,""):l.replace(/\[\[P\-\>\]\][^]*\[\[\<\-P\]\]/g,""),l="show"==n.typehook.substr(0,4)?l.replace(/\[\[H\-\>\]\]|\[\[\<\-H\]\]/g,""):l.replace(/\[\[H\-\>\]\][^]*\[\[\<\-H\]\]/g,""),l="show"==n["default"].substr(0,4)?l.replace(/\[\[D\-\>\]\]|\[\[\<\-D\]\]/g,""):l.replace(/\[\[D\-\>\]\][^]*\[\[\<\-D\]\]/g,""),l="show"==n.data.substr(0,4)?l.replace(/\[\[L\-\>\]\]|\[\[\<\-L\]\]/g,""):l.replace(/\[\[L\-\>\]\][^]*\[\[\<\-L\]\]/g,""),l="show"==n.group.substr(0,4)?l.replace(/\[\[G\-\>\]\]|\[\[\<\-G\]\]/g,""):l.replace(/\[\[G\-\>\]\][^]*\[\[\<\-G\]\]/g,""),l="show"==n.format.substr(0,4)?l.replace(/\[\[F\-\>\]\]|\[\[\<\-F\]\]/g,""):l.replace(/\[\[F\-\>\]\][^]*\[\[\<\-F\]\]/g,"")}function wfu_userdata_remove_field(e){for(var t=e.parentNode,a=t.parentNode,l=null,n=0;n<a.childNodes.length;n++)if(1===a.childNodes[n].nodeType){l=a.childNodes[n];break}if(t!=l){t.parentNode.removeChild(t);for(var n=0;n<l.childNodes.length;n++)if(1===l.childNodes[n].nodeType){wfu_update_userfield_value({target:l.childNodes[n]});break}}}function wfu_formdata_remove_field(e){var t=e.split("_"),a=t[0],l=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_line_container");if(!(l.length<2)){var n=document.getElementById("wfu_attribute_"+a),d=document.getElementById("wfu_formfield_"+e+"_container");n.removeChild(d),d=document.querySelector("div#wfu_attribute_"+a+" .wfu_formdata_line_container");for(var u=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_action_remove"),o=0;o<u.length;o++)u[o].className="wfu_formdata_action wfu_formdata_action_remove"+(u.length>1?"":" wfu_formdata_action_disabled");wfu_update_formfield_value({target:d})}}function wfu_generate_shortcode(){for(var e,t=document.getElementById("wfu_shortcode_tag").value,a=document.getElementById("wfu_attribute_defaults"),l=(document.getElementById("wfu_attribute_values"),""),n="",d="["+t,u="",o=0;o<a.childNodes.length;o++)e=a.childNodes[o],1===e.nodeType&&(l=e.id.replace("wfu_attribute_default_",""),n=document.getElementById("wfu_attribute_value_"+l).value,e.value!=n&&(u+=" "+l+'="'+n+'"'));d+=u+"]",document.getElementById("wfu_shortcode").value=d,ShortcodeString=u.substr(1),document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode").disabled=wfu_plugin_encode_string(d)==document.getElementById("wfu_shortcode_original_enc").value),Autosave&&wfu_schedule_save_shortcode()}function wfu_update_text_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_",""),l=t.value;l=l.replace(/(\r\n|\n|\r)/gm,"%n%"),l=l.replace(/\"/gm,"%dq%"),l=l.replace(/\[/gm,"%brl%"),l=l.replace(/\]/gm,"%brr%"),l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_date_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_",""),l=t.value;l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_stringmatch_textvalue(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.replace("_matchfield","").replace("_matchvalue",""),wfu_update_stringmatch_value(a)}function wfu_update_triplecolor_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.replace("_color",""),a=a.replace("_bgcolor",""),a=a.replace("_borcolor",""),t=document.getElementById("wfu_attribute_"+a+"_color");var l=t.value+","+document.getElementById("wfu_attribute_"+a+"_bgcolor").value+","+document.getElementById("wfu_attribute_"+a+"_borcolor").value;l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_dimension_value(e){e=e||window.event;var t=e.target,a=t.name.replace("wfu_dimension_elements_",""),l=document.getElementsByName(t.name);t=l[0];for(var n="",d="",u=0;u<l.length;u++)d=l[u].id.replace("wfu_attribute_"+a+"_",""),""!=n&&""!=l[u].value&&(n+=", "),""!=l[u].value&&(n+=d+":"+l[u].value);n!==t.oldVal&&(t.oldVal=n,document.getElementById("wfu_attribute_value_"+a).value=n,wfu_generate_shortcode())}function wfu_update_ptext_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.substr(2);var l=document.getElementById("wfu_attribute_s_"+a).value,n=document.getElementById("wfu_attribute_p_"+a).value,d=l+"/"+n;d!==t.oldVal&&(t.oldVal=d,document.getElementById("wfu_attribute_value_"+a).value=d),wfu_generate_shortcode()}function wfu_update_mchecklist_value(e){var t="",a=(document.getElementById("wfu_attribute_"+e),document.getElementById("wfu_attribute_"+e+"_all"));a.checked?(jQuery("#wfu_attribute_"+e+" input").prop("disabled",!0),jQuery("#wfu_attribute_"+e+" input").prop("checked",!0),t="all"):(jQuery("#wfu_attribute_"+e+" input").prop("disabled",!1),jQuery("#wfu_attribute_"+e+" input").each(function(){jQuery(this).prop("checked")&&(t+=","+jQuery(this).next().html())}),t=t.substr(1)),document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_rolelist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_guests"),n=document.getElementById("wfu_attribute_"+e+"_all");if(n.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var d=a.options,u=0;u<d.length;u++)d[u].selected&&(""!=t&&(t+=","),t+=d[u].value)}l.checked&&(""!=t&&(t+=","),t+="guests"),document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_userlist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_current"),n=document.getElementById("wfu_attribute_"+e+"_guests"),d=document.getElementById("wfu_attribute_"+e+"_all");if(l&&l.checked)a.disabled=!0,d.disabled=!0,n.disabled=!0,t="current";else{if(d.disabled=!1,n.disabled=!1,d.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var u=a.options,o=0;o<u.length;o++)u[o].selected&&(""!=t&&(t+=","),t+=u[o].value)}n.checked&&(""!=t&&(t+=","),t+="guests")}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_postlist_value(e){for(var t="",a=Array(),l=Array(),n=document.getElementById("wfu_attribute_"+e+"_postlist").value.split(","),d=0;d<n.length;d++)a.push(document.getElementById("wfu_attribute_"+e+"_"+n[d])),l.push(document.getElementById("wfu_attribute_"+e+"_all_"+n[d]));var u=document.getElementById("wfu_attribute_"+e+"_current");if(u&&u.checked){for(var d=0;d<n.length;d++)a[d].disabled=!0,l[d].disabled=!0;t="current"}else{var o=!0;t="";for(var d=0;d<n.length;d++)if(l[d].disabled=!1,l[d].checked)a[d].disabled=!0,""!=t&&(t+=","),t+="all"+n[d];else{a[d].disabled=!1,o=!1;for(var r=a[d].options,_=0;_<r.length;_++)r[_].selected&&(""!=t&&(t+=","),t+=r[_].value)}o&&(t="all")}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_bloglist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_current"),n=document.getElementById("wfu_attribute_"+e+"_all");if(l&&l.checked)a.disabled=!0,n.disabled=!0,t="current";else if(n.disabled=!1,n.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var d=a.options,u=0;u<d.length;u++)d[u].selected&&(""!=t&&(t+=","),t+=d[u].value)}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_stringmatch_value(e){var t=document.getElementById("wfu_attribute_"+e+"_matchfield").value,a=document.getElementById("wfu_attribute_"+e+"_matchcriterion").value,l=document.getElementById("wfu_attribute_"+e+"_matchvalue").value;t=t.replace(";",""),""==t.trim()?document.getElementById("wfu_attribute_value_"+e).value="":document.getElementById("wfu_attribute_value_"+e).value="field:"+t+";criterion:"+a+";value:"+l,wfu_generate_shortcode()}function wfu_update_userfield_value(e){e=e||window.event;for(var t=e.target,a=t.parentNode,l=a.parentNode,n="",d=!1,u="",o=0;o<l.childNodes.length;o++)if(a=l.childNodes[o],"DIV"===a.tagName){for(var r=0;r<a.childNodes.length;r++)"INPUT"==a.childNodes[r].tagName&&("text"==a.childNodes[r].type?(n=a.childNodes[r].value,0==o&&(t=a.childNodes[r])):"checkbox"==a.childNodes[r].type&&(d=a.childNodes[r].checked));""!=u&&""!=n&&(u+="/"),""!=n&&d&&(u+="*"),""!=n&&(u+=n)}u!==t.oldVal&&(t.oldVal=u,document.getElementById("wfu_attribute_value_userdatalabel").value=u,wfu_generate_shortcode(),wfu_update_formfield_variables())}function wfu_update_formfield_value(e){e=e||window.event;for(var t=e.target,a=t.id.match(/^wfu_formfield_(.*?)_/)[1],l=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_line_container"),n="",d=0;d<l.length;d++){var u="",o=l[d].id.match(/^wfu_formfield_.*?_(.*?)_/)[1],r=a+"_"+o,_=document.getElementById("wfu_formfield_"+r+"_label").value;if(""!=_.trim()){u=_.trim();var s=document.getElementById("wfu_formfield_"+r+"_type").value,c=window["wfu_attribute_"+a+"_typeprops"];u+="|t:"+s,u+="|s:"+document.getElementById("wfu_formfield_"+r+"_labelposition").value,"show"==c[s].required.substr(0,4)&&(u+="|r:"+(document.getElementById("wfu_formfield_"+r+"_required").checked?"1":"0")),"show"==c[s].donotautocomplete.substr(0,4)&&(u+="|a:"+(document.getElementById("wfu_formfield_"+r+"_donotautocomplete").checked?"1":"0")),"show"==c[s].validate.substr(0,4)&&(u+="|v:"+(document.getElementById("wfu_formfield_"+r+"_validate").checked?"1":"0")),"show"==c[s].typehook.substr(0,4)&&(u+="|h:"+(document.getElementById("wfu_formfield_"+r+"_typehook").checked?"1":"0")),"show"==c[s].hintposition.substr(0,4)&&(u+="|p:"+document.getElementById("wfu_formfield_"+r+"_hintposition").value),"show"==c[s]["default"].substr(0,4)&&(u+="|d:"+document.getElementById("wfu_formfield_"+r+"_default").value),"show"==c[s].data.substr(0,4)&&(u+="|l:"+document.getElementById("wfu_formfield_"+r+"_data").value),"show"==c[s].group.substr(0,4)&&(u+="|g:"+document.getElementById("wfu_formfield_"+r+"_group").value),"show"==c[s].format.substr(0,4)&&(u+="|f:"+document.getElementById("wfu_formfield_"+r+"_format").value)}""!=u&&(""!=n&&(n+="/"),n+=u)}n!==t.oldVal&&(t.oldVal=n,document.getElementById("wfu_attribute_value_"+a).value=n,wfu_generate_shortcode(),wfu_update_formfield_variables())}function wfu_update_formfield_variables(){var e=document.getElementById("wfu_attribute_value_userdatalabel");if(e){for(var t=document.getElementById("wfu_wrapper"),a=document.getElementsByClassName("wfu_shadow_userdata","div",t),l=document.getElementsByName("wfu_formfield_select"),n=0;n<l.length;n++)l[n].style.display="none";if(0!=a.length&&"block"!=a[0].style.display){for(var d='<option style="display:none;">%userdataXXX%</option>',u=e.value.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]"),o=2;document.getElementById("wfu_attribute_userdatalabel"+o);){var r=document.getElementById("wfu_attribute_value_userdatalabel"+o).value.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]");u=u.concat(r),o++}var _="",s=0;o=1;for(var n=0;n<u.length;n++)_=u[n],"*"==_[0]&&(_=_.substr(1)),s=_.indexOf("|"),s>-1&&(_=_.substr(0,s)),""!=_.trim()&&(d+='<option value="%userdata'+o+'%">'+o+": "+_.trim()+"</option>",o++);for(var n=0;n<l.length;n++)l[n].innerHTML=d,l[n].style.display="inline-block"}}}function wfu_attach_element_handlers(e,t){for(var a=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"],l=0;l<a.length;l++)wfu_addEventHandler(e,a[l],t)}function wfu_Attach_Admin_Events(e){Autosave=e,wfu_generate_shortcode(),wfu_update_formfield_variables(),wfu_Attach_Admin_DragDrop_Events();for(var t=document.getElementsByName("wfu_text_elements"),a=0;a<t.length;a++)wfu_attach_element_handlers(t[a],wfu_update_text_value);for(var l=document.getElementsByName("wfu_ptext_elements"),a=0;a<l.length;a++)wfu_attach_element_handlers(l[a],wfu_update_ptext_value);for(var n=document.getElementsByName("wfu_stringmatch_elements"),a=0;a<n.length;a++)wfu_attach_element_handlers(n[a],wfu_update_stringmatch_textvalue);for(var d=document.getElementsByName("wfu_triplecolor_elements"),a=0;a<d.length;a++)wfu_attach_element_handlers(d[a],wfu_update_triplecolor_value);for(var u=document.getElementsByName("wfu_dimension_elements_widths"),a=0;a<u.length;a++)wfu_attach_element_handlers(u[a],wfu_update_dimension_value);u=document.getElementsByName("wfu_dimension_elements_heights");for(var a=0;a<u.length;a++)wfu_attach_element_handlers(u[a],wfu_update_dimension_value);for(var o=document.getElementsByName("wfu_userfield_elements"),a=0;a<o.length;a++)wfu_attach_element_handlers(o[a],wfu_update_userfield_value);for(var r=document.getElementsByName("wfu_formfield_elements"),a=0;a<r.length;a++)wfu_attach_element_handlers(r[a],wfu_update_formfield_value);for(var _=document.getElementsByName("wfu_subfolder_tools_input"),a=0;a<_.length;a++)wfu_attach_element_handlers(_[a],wfu_subfolders_input_changed);for(var s=document.getElementsByName("wfu_columnprops_elements"),a=0;a<s.length;a++)wfu_attach_element_handlers(s[a],wfu_columnprops_element_changed);""!=document.getElementById("wfu_shortcode_postid").value&&setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}function wfu_insert_variable(e){var t=e.className.replace("wfu_variable wfu_variable_",""),a=document.getElementById("wfu_attribute_"+t),l=a.selectionStart,n=a.value;a.value=n.substr(0,l)+e.innerHTML+n.substr(l),wfu_update_text_value({target:a})}function wfu_insert_userfield_variable(e){var t=e.className.replace("wfu_variable wfu_variable_",""),a=document.getElementById("wfu_attribute_"+t),l=a.selectionStart,n=a.value;a.value=n.substr(0,l)+e.value+n.substr(l),e.value="%userdataXXX%",wfu_update_text_value({target:a})}function wfu_columns_itemclicked(e,t){var a=e.parentNode;if("SELECT"==a.tagName){for(var l=0;l<a.options.length;l++)a.options[l].selected=a.options[l]==e;wfu_update_column_props(t)}}function wfu_columns_buttonaction(e,t){var a=document.getElementById("wfu_attribute_"+e+"_sourcelist"),l=document.getElementById("wfu_attribute_"+e);if("add"==t){for(var n=0;n<a.options.length;n++)if(a.options[n].selected||"wfu_columns_item_required"==a.options[n].className){for(var d=!1,u=a.options[n].value.replace(/:.*/,""),o=0;o<l.options.length;o++){var r=l.options[o].value.replace(/:.*/,"");if(r==u){d=!0;break}}if(!d){var _=a.options[n].value.match(/(.*?):(.*?)\/(.*)/),s=_[1],c="custom"==s?"+-"+(""==_[2]?"s":_[2]):""!=_[2]?"-+"+_[2]:"",i=_[3];"custom"==s&&(s="custom1");var f=document.createElement("OPTION");f.value=s+":"+c+"/"+a.options[n].innerHTML+"/"+i,f.innerHTML=a.options[n].innerHTML+(""!=i&&i!=a.options[n].innerHTML?" ("+i+")":""),f.className=a.options[n].className,f.onclick=a.options[n].onclick,l.appendChild(f),l.selectedIndex=l.options.length-1}}}else if("del"==t)for(var n=0;n<l.options.length;)l.options[n].selected&&"wfu_columns_item_required"!=l.options[n].className?l.options.remove(n):n++;else if("up"==t||"down"==t){for(var m=-1,n=0;n<l.options.length;n++)l.options[n].selected&&-1==m?m=n:l.options[n].selected&&m>-1&&(l.options[n].selected=!1);"up"==t&&m>0?l.insertBefore(l.options[m],l.options[m-1]):"down"==t&&m<l.options.length-1&&l.insertBefore(l.options[m+1],l.options[m])}wfu_update_column_props(e),wfu_update_columns(e)}function wfu_update_column_props(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_attribute_"+e+"_columnprops_container"),l=document.getElementById("wfu_attribute_"+e+"_columnprops_title"),n=(document.getElementById("wfu_attribute_"+e+"_columnprops_title_label"),document.getElementById("wfu_attribute_"+e+"_columnprops_id")),d=document.getElementById("wfu_attribute_"+e+"_columnprops_id_label"),u=document.getElementById("wfu_attribute_"+e+"_columnprops_sort"),o=document.getElementById("wfu_attribute_"+e+"_columnprops_sort_label"),r=document.getElementById("wfu_attribute_"+e+"_columnprops_sorttype"),_=document.getElementById("wfu_attribute_"+e+"_columnprops_sorttype_label"),s=t.selectedIndex;if(""==r.options[0].value&&r.options.remove(0),-1==s)a.className="wfu_columnprops_container wfu_columnprops_container_disabled",l.value="",l.disabled=!0,n.value="",n.disabled=!0,u.checked=!1,u.disabled=!0,r.selectedIndex=-1,r.disabled=!0;else{var c=t.options[s].value.match(/(.*?):(.*?)\/(.*?)\/(.*)/),i=c[1],f="custom"==i.substr(0,6),m=f?i.substr(6):"",p=""!=c[2],w=p&&"+"==c[2].substr(1,1),g=w&&"+"==c[2].substr(0,1),v=w?c[2].substr(2):"",b=c[4];a.className="wfu_columnprops_container",l.value=b,l.disabled=!1,d.className=f?"":"wfu_columnprops_label_disabled",n.value=m,n.disabled=!f,o.className=p?"":"wfu_columnprops_label_disabled",u.checked=w,u.disabled=!p,_.className=g?"":"wfu_columnprops_label_disabled",r.value=v,r.disabled=!g}}function wfu_columnprops_element_changed(e){e=e||window.event;var t=e.target,a=t.id.match(/^wfu_attribute_(.*?)_columnprops_/)[1],l=document.getElementById("wfu_attribute_"+a),n=document.getElementById("wfu_attribute_"+a+"_columnprops_title"),d=document.getElementById("wfu_attribute_"+a+"_columnprops_id"),u=document.getElementById("wfu_attribute_"+a+"_columnprops_sort"),o=document.getElementById("wfu_attribute_"+a+"_columnprops_sorttype"),r=l.selectedIndex;if(-1!=r){var _=l.options[r].value.match(/(.*?):(.*?)\/(.*?)\/(.*)/),s=_[1],c="custom"==s.substr(0,6)?"custom":s,i="custom"==c,f=i?parseInt(d.value)>=1?d.value:"1":"",m=""!=_[2]?_[2].substr(0,1)+(u.checked?"+":"-")+(""!=o.value?o.value:""!=_[2].substr(2)?_[2].substr(2):"s"):"",p=_[3],w=""!=n.value?n.value:p;l.options[r].value=c+f+":"+m+"/"+p+"/"+w,l.options[r].innerHTML=p+(w!=p?" ("+w+")":""),wfu_update_column_props(a),wfu_update_columns(a)}}function wfu_update_columns(e){for(var t=document.getElementById("wfu_attribute_"+e),a="",l=0;l<t.options.length;l++){var n=t.options[l].value.match(/(.*?):(.*?)\/(.*?)\/(.*)/),d=n[1]+":"+("+"==n[2].substr(1,1)?n[2].substr(2):"")+"/"+n[4];""!=a&&(a+=","),a+=d}document.getElementById("wfu_attribute_value_"+e).value=a,wfu_generate_shortcode()}function wfu_GetHttpRequestObject(){var e=null;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}if(null==e&&window.createRequest)try{xmlhttp=window.createRequest()}catch(t){}return e}function wfu_plugin_encode_string(e){var t,a=0,l="",n="";for(a=0;a<e.length;a++)t=e.charCodeAt(a),t>=2048?t=((16773120&t|917504)<<4)+((4032&t|8192)<<2)+(63&t|128):t>=128&&(t=((65472&t|12288)<<2)+(63&t|128)),n=t.toString(16),(1==n.length||3==n.length||5==n.length)&&(n="0"+n),l+=n;return l}function wfu_plugin_decode_string(e){for(var t,a,l=0,n="";l<e.length;)t=parseInt(e.substr(l,2),16),a=128>t?t:224>t?((31&t)<<6)+(63&parseInt(e.substr(l+=2,2),16)):((15&t)<<12)+((63&parseInt(e.substr(l+=2,2),16))<<6)+(63&parseInt(e.substr(l+=2,2),16)),n+=String.fromCharCode(a),l+=2;return n}function wfu_randomString(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",a=e,l="",n=0;a>n;n++){var d=Math.floor(Math.random()*t.length);l+=t.substring(d,d+1)}return l}function wfu_schedule_save_shortcode(){var e=new Date,t=ShortcodeNextSave-e.getTime();null!=ShortcodeTimeOut&&(clearTimeout(ShortcodeTimeOut),ShortcodeTimeOut=null),0>=t?wfu_save_shortcode():ShortcodeTimeOut=setTimeout(function(){wfu_save_shortcode()},t)}function wfu_check_page_obsolescence(){PageObsolete||PageUpdating||""==document.getElementById("wfu_shortcode_postid").value}function wfu_save_shortcode(){if(!PageObsolete){var e=wfu_GetHttpRequestObject();if(null!=e){PageUpdating=!0,document.getElementById("wfu_update_failed_message").style.display="none";var t=AdminParams.wfu_ajax_url;params=new Array(8),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_save_shortcode",params[1]=new Array(2),params[1][0]="shortcode",params[1][1]=wfu_plugin_encode_string(ShortcodeString),params[2]=new Array(2),params[2][0]="shortcode_original",params[2][1]=document.getElementById("wfu_shortcode_original_enc").value,params[3]=new Array(2),params[3][0]="post_id",params[3][1]=document.getElementById("wfu_shortcode_postid").value,params[4]=new Array(2),params[4][0]="post_hash",params[4][1]=document.getElementById("wfu_shortcode_posthash").value,params[5]=new Array(2),params[5][0]="shortcode_position",params[5][1]=document.getElementById("wfu_shortcode_position").value,params[6]=new Array(2),params[6][0]="shortcode_tag",params[6][1]=document.getElementById("wfu_shortcode_tag").value,params[7]=new Array(2),params[7][0]="widget_id",params[7][1]=document.getElementById("wfu_shortcode_widgetid").value;for(var a="",l=0;l<params.length;l++)a+=(l>0?"&":"")+params[l][0]+"="+encodeURI(params[l][1]);var n=new Date;Autosave?ShortcodeNextSave=n.getTime()+5e3:document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode_wait").style.display="inline"),e.open("POST",t,!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){PageUpdating=!1;var t="wfu_save_shortcode:",a=e.responseText.indexOf(t);-1==a&&(a=e.responseText.length);var l=(e.responseText.substr(0,a),e.responseText.substr(a+t.length,e.responseText.length-a-t.length));a=l.indexOf(":");var d=l.substr(0,a);if(txt_value=l.substr(a+1,l.length-a-1),"success"==d){if(Autosave?(document.getElementById("wfu_save_label").innerHTML="saved",document.getElementById("wfu_save_label").className="wfu_save_label",document.getElementById("wfu_save_label").style.opacity=1,wfu_fadeout_element(300),ShortcodeNextSave=n.getTime()+1e3,null!=ShortcodeTimeOut&&wfu_schedule_save_shortcode()):document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode_wait").style.display="none",document.getElementById("wfu_update_shortcode").disabled=!0,window.plugin_window&&window.plugin_window.location.reload(!0)),""!=document.getElementById("wfu_shortcode_postid").value){var u=document.getElementById("wfu_shortcode_tag").value;document.getElementById("wfu_shortcode_original_enc").value=wfu_plugin_encode_string("["+u+" "+ShortcodeString+"]"),document.getElementById("wfu_shortcode_posthash").value=txt_value,setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}}else Autosave&&(document.getElementById("wfu_save_label").innerHTML="not saved",document.getElementById("wfu_save_label").className="wfu_save_label_fail",document.getElementById("wfu_save_label").style.opacity=1,wfu_fadeout_element(300)),"fail"==d&&("post_modified"==txt_value?(PageObsolete=!0,document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode").disabled=!0),document.getElementById("wfu_update_rejected_message").style.display="block"):document.getElementById("wfu_update_failed_message").style.display="block")}},e.send(a)}}}function wfu_adjust_opacity(e){document.getElementById("wfu_save_label").style.opacity=e}function wfu_fadeout_element(e){for(var t=20,a=0,l=0;t>l;l++)a=1-l/t,setTimeout('wfu_adjust_opacity("'+a.toString()+'")',l*e/t);setTimeout('wfu_adjust_opacity("0.0")',l*e/t)}function wfu_apply_value(e,t,a){if("onoff"==t)document.getElementById("wfu_attribute_"+e).className="wfu_onoff_container_"+("true"!=a?"on":"off"),wfu_admin_onoff_clicked(e);else if("text"==t||"ltext"==t||"integer"==t||"float"==t||"mtext"==t||"color"==t){var l=document.getElementById("wfu_attribute_"+e);if(a=a.replace(/\%n\%/gm,"\n"),a=a.replace(/\%dq\%/gm,'"'),a=a.replace(/\%brl\%/gm,"["),a=a.replace(/\%brr\%/gm,"]"),"color"==t){var n=colourNameToHex(a);n||(n=a),jQuery("#wfu_attribute_"+e).wpColorPicker("color",n)}l.value=a,wfu_update_text_value({target:l})}else if("date"==t){var l=document.getElementById("wfu_attribute_"+e);l.value=a,wfu_update_date_value({target:l})}else if("placements"==t)wfu_admin_recreate_placements_panel(a),document.getElementById("wfu_attribute_value_placements").value=a,wfu_generate_shortcode();else if("radio"==t){for(var d=document.getElementsByName("wfu_radioattribute_"+e),u=0;u<d.length;u++)d[u].checked=d[u].value==a||"*"+d[u].value==a;wfu_admin_radio_clicked(e)}else if("ptext"==t){a=a.replace(/\%n\%/gm,"\n"),a=a.replace(/\%dq\%/gm,'"'),a=a.replace(/\%brl\%/gm,"["),a=a.replace(/\%brr\%/gm,"]");var o=a.split("/"),r=o.length<1?"":o[0],_=o.length<2?r:o[1],s=document.getElementById("wfu_attribute_s_"+e);s.value=r;var c=document.getElementById("wfu_attribute_p_"+e);c.value=_,wfu_update_ptext_value({target:s}),wfu_update_ptext_value({target:c})}else if("mchecklist"==t){if(a=a.toLowerCase(),"all"==a)document.getElementById("wfu_attribute_"+e+"_all").checked=!0;else{document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var i=a.split(","),u=0;u<i.length;u++)i[u]=i[u].trim();jQuery("#wfu_attribute_"+e+" input").each(function(){jQuery(this).prop("checked",i.indexOf(jQuery(this).next().html())>-1)})}wfu_update_mchecklist_value(e)}else if("rolelist"==t){var l=document.getElementById("wfu_attribute_"+e),f=document.getElementById("wfu_attribute_"+e+"_all"),m=f.className.indexOf("wfu_default_administrator")>-1,p=a.split(",");if(p.indexOf("all")>-1){f.checked=!0;for(var u=0;u<l.options.length;u++)l.options[u].selected=m&&"administrator"==l.options[u].value}else{f.checked=!1;for(var u=0;u<p.length;u++)p[u]=p[u].trim();for(var u=0;u<l.options.length;u++)l.options[u].selected=p.indexOf(l.options[u].value)>-1}document.getElementById("wfu_attribute_"+e+"_guests").checked=p.indexOf("guests")>-1,wfu_update_rolelist_value(e)}else if("userlist"==t){var l=document.getElementById("wfu_attribute_"+e),f=document.getElementById("wfu_attribute_"+e+"_all"),w=f.className.indexOf("wfu_default_0")>-1,g=document.getElementById("wfu_attribute_"+e+"_current");if(g&&"current"==a){g.checked=!0,f.checked=!1,document.getElementById("wfu_attribute_"+e+"_guests").checked=!1;for(var u=0;u<l.options.length;u++)l.options[u].selected=w&&1>u}else{g&&(g.checked=!1);var v=a.split(",");if(v.indexOf("all")>-1){f.checked=!0;for(var u=0;u<l.options.length;u++)l.options[u].selected=w&&1>u}else{f.checked=!1;for(var u=0;u<v.length;u++)v[u]=v[u].trim();for(var u=0;u<l.options.length;u++)l.options[u].selected=v.indexOf(l.options[u].value)>-1}document.getElementById("wfu_attribute_"+e+"_guests").checked=v.indexOf("guests")>-1}wfu_update_userlist_value(e)}else if("postlist"==t){for(var b=Array(),f=Array(),h=document.getElementById("wfu_attribute_"+e+"_postlist").value.split(","),u=0;u<h.length;u++)b.push(document.getElementById("wfu_attribute_"+e+"_"+h[u])),f.push(document.getElementById("wfu_attribute_"+e+"_all_"+h[u]));var g=document.getElementById("wfu_attribute_"+e+"_current");if(g&&"current"==a){g.checked=!0;for(var u=0;u<h.length;u++){f[u].checked=!1;for(var y=0;y<b[u].options.length;y++)b[u].options[y].selected=!1}}else{g&&(g.checked=!1);for(var I=a.split(","),u=0;u<h.length;u++){("all"==a||I.indexOf("all"+h[u])>-1)&&(f[u].checked=!0);for(var y=0;y<b[u].options.length;y++)b[u].options[y].selected=I.indexOf(b[u].options[y].value)>-1}}wfu_update_postlist_value(e)}else if("bloglist"==t){var g=document.getElementById("wfu_attribute_"+e+"_current");if(g&&"current"==a){g.checked=!0,document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var l=document.getElementById("wfu_attribute_"+e),u=0;u<l.options.length;u++)l.options[u].selected=!1}else{g&&(g.checked=!1);var E=a.split(",");if("all"==a)document.getElementById("wfu_attribute_"+e+"_all").checked=!0;else{document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var u=0;u<E.length;u++)E[u]=E[u].trim();for(var l=document.getElementById("wfu_attribute_"+e),u=0;u<l.options.length;u++)l.options[u].selected=E.indexOf(l.options[u].value)>-1}}wfu_update_bloglist_value(e)}else if("stringmatch"==t){var B="",k="equal to",x="",N=a.match(/^field:(.*?);\s*criterion:(.*?)\s*;\s*value:(.*)$/);N&&4==N.length&&(B=N[1],k=N[2],x=N[3]),document.getElementById("wfu_attribute_"+e+"_matchfield").value=B,document.getElementById("wfu_attribute_"+e+"_matchcriterion").value=k,document.getElementById("wfu_attribute_"+e+"_matchvalue").value=x,wfu_update_stringmatch_value(e)}else if("columns"==t){var T=document.getElementById("wfu_attribute_"+e+"_sourcelist"),A=document.getElementById("wfu_attribute_"+e);A.innerHTML="";for(var H=a.replace(/(:|\/).*?(,|$)/g,"$2").split(","),u=0;u<T.options.length;u++){var o=T.options[u].value.match(/(.*?):(.*?)\/(.*)/),S=o[1];if("wfu_columns_item_required"==T.options[u].className&&-1==H.indexOf(S)){var q="custom"==S?"+-"+(""==o[2]?"s":o[2]):""!=o[2]?"-+"+o[2]:"",O=o[3];"custom"==S&&(S="custom1");var C=document.createElement("OPTION");C.value=S+":"+q+"/"+T.options[u].innerHTML+"/"+O,C.innerHTML=T.options[u].innerHTML+(""!=O&&O!=T.options[u].innerHTML?" ("+O+")":""),C.className=T.options[u].className,C.onclick=T.options[u].onclick,A.appendChild(C)}}for(var L=a.split(","),u=0;u<L.length;u++){var M=L[u].split("/",2),S=M[0],j="";M.length>1&&(j=M[1]),M=S.split(":",2),S=M[0];for(var D=S.replace(/custom[0-9]+$/,"custom"),P=-1,y=0;y<T.options.length;y++){var V=T.options[y].value.replace(/:.*/,"");if(V==D){P=y;break}}for(var R=!1,y=0;y<A.options.length;y++){var F=A.options[y].value.replace(/:.*/,"");if(F==S){R=!0;break}}if("custom"!=S&&P>-1&&!R){var o=T.options[P].value.match(/(.*?):(.*?)\/(.*)/),U="custom"==D||""!=o[2],q=o[2],Q=T.options[P].innerHTML,O=o[3],G="";G=1==M.length?"custom"==D?"+-s":U?"-+"+q:"":"custom"==D?"+"+(""==M[1]?"-s":"+"+M[1]):U?"-"+(""==M[1]?"-":"+")+q:"",
|
3 |
-
""==j&&(j=O);var C=document.createElement("OPTION");C.value=S+":"+G+"/"+Q+"/"+j,C.innerHTML=Q+(O!=Q?" ("+O+")":""),C.className=T.options[P].className,C.onclick=T.options[u].onclick,A.appendChild(C)}}wfu_update_column_props(e),wfu_update_columns(e)}else if("dimensions"==t){for(var X,W,$,l,z=a.split(","),J=document.getElementsByName("wfu_dimension_elements_"+e),u=0;u<J.length;u++)J[u].value="";for(var u=0;u<z.length;u++)X=z[u].split(":",2),W=X.length<1?"":X[0],$=X.length<2?W:X[1],l=document.getElementById("wfu_attribute_"+e+"_"+W.trim()),l&&(l.value=$.trim());l=J[0],wfu_update_dimension_value({target:l})}else if("userfields"==t){for(var K,Z=a.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]"),Y=Array(),u=0;u<Z.length;u++)K="*"==Z[u].substr(0,1),K&&(Z[u]=Z[u].substr(1)),""!=Z[u]&&Y.push({name:Z[u],required:K});for(var ee=document.getElementById("wfu_attribute_"+e),te=null,ae=Array(),u=0;u<ee.childNodes.length;u++)1===ee.childNodes[u].nodeType&&(null==te?te=ee.childNodes[u]:ae.push(ee.childNodes[u]));for(var u=0;u<ae.length;u++)ee.removeChild(ae[u]);wfu_userdata_edit_field(te,"",!1);for(var le,ne=te,u=0;u<Y.length;u++)0==u?wfu_userdata_edit_field(te,Y[u].name,Y[u].required):(le=ne.cloneNode(!0),wfu_userdata_edit_field(le,Y[u].name,Y[u].required),ee.insertBefore(le,ne.nextSibling),ne=le);for(var l,u=0;u<te.childNodes.length&&(l=te.childNodes[u],"INPUT"!=l.tagName);u++);wfu_update_userfield_value({target:l})}else if("formfields"==t){for(var Y=Array(),de=window["wfu_attribute_"+e+"_typeprops"],ue=de[0].split(","),oe={},u=0;u<ue.length;u++){var re=de[ue[u]],_e={};_e.type=ue[u],_e.label="",_e.labelposition=re.labelposition.substr(5),_e.required="true"==re.required.substr(5),_e.donotautocomplete="true"==re.donotautocomplete.substr(5),_e.validate="true"==re.validate.substr(5),_e.typehook="true"==re.typehook.substr(5),_e.hintposition=re.hintposition.substr(5),_e["default"]=re["default"].substr(5),_e.data=re.data.substr(5),_e.group=re.group.substr(5),_e.format=re.format.substr(5),oe[ue[u]]=_e}for(var Z=a.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]"),u=0;u<Z.length;u++){var se=Z[u].trim(),ce={};for(prop in oe.text)ce[prop]=oe.text[prop];"*"==se.substr(0,1)&&(ce.required=!0,se=se.substr(1));var ie=se.split("|");if(""!=ie[0].trim()){for(var fe=-1,me="",y=0;y<ie.length;y++){var pe=ie[y].replace(/^\s+/gm,""),we=pe.substr(0,2),$=pe.substr(2);if("t:"==we&&y>0&&ue.indexOf($)>-1){me=$,fe=y;break}}if(""!=me){for(prop in oe[me])ce[prop]=oe[me][prop];ie.splice(fe,1)}ce.label=ie[0].trim(),ie.splice(0,1);for(var y=0;y<ie.length;y++){var pe=ie[y].replace(/^\s+/gm,""),we=pe.substr(0,2),$=pe.substr(2);"s:"==we?ce.labelposition=$:"r:"==we?ce.required="1"==$:"a:"==we?ce.donotautocomplete="1"==$:"v:"==we?ce.validate="1"==$:"d:"==we?ce["default"]=$:"l:"==we?ce.data=$:"g:"==we?ce.group=$:"f:"==we?ce.format=$:"p:"==we?ce.hintposition=$:"h:"==we&&(ce.typehook="1"==$)}Y.push(ce)}}0==Y.length&&Y.push(fieldprops_default);for(var ee=document.getElementById("wfu_attribute_"+e),ge=document.querySelectorAll("div#wfu_attribute_"+e+" .wfu_formdata_line_container"),u=1;u<ge.length;u++)ee.removeChild(ge[u]);for(var ve=ge[0],u=0;u<Y.length;u++){var be=e+"_"+wfu_randomString(4),he=wfu_formdata_prepare_template(e,Y[u],be);u>0&&(ve=document.createElement("DIV")),ve.id="wfu_formfield_"+be+"_container",ve.className="wfu_formdata_line_container",u>0&&ee.insertBefore(ve,null),ve.innerHTML=he}for(var ye=document.querySelectorAll("div#wfu_attribute_"+e+' input[name="wfu_formfield_elements"]'),u=0;u<ye.length;u++)wfu_attach_element_handlers(ye[u],wfu_update_formfield_value);for(var Ie=document.querySelectorAll("div#wfu_attribute_"+e+" .wfu_formdata_action_remove"),u=0;u<Ie.length;u++)Ie[u].className="wfu_formdata_action wfu_formdata_action_remove"+(Ie.length>1?"":" wfu_formdata_action_disabled");wfu_update_formfield_value({target:ge[0]})}else if("color-triplet"==t){for(var Ee=a.split(","),u=0;u<Ee.length;u++)Ee[u]=Ee[u].trim();2==Ee.length?Ee=[Ee[0],Ee[1],"#000000"]:1==Ee.length?Ee=[Ee[0],"#FFFFFF","#000000"]:Ee.length<3&&(Ee=["#000000","#FFFFFF","#000000"]);var n=colourNameToHex(Ee[0]);n||(n=Ee[0]),jQuery("#wfu_attribute_"+e+"_color").wpColorPicker("color",n);var l=document.getElementById("wfu_attribute_"+e+"_color");l.value=Ee[0],n=colourNameToHex(Ee[1]),n||(n=Ee[1]),jQuery("#wfu_attribute_"+e+"_bgcolor").wpColorPicker("color",n),document.getElementById("wfu_attribute_"+e+"_bgcolor").value=Ee[1],n=colourNameToHex(Ee[2]),n||(n=Ee[2]),jQuery("#wfu_attribute_"+e+"_borcolor").wpColorPicker("color",n),document.getElementById("wfu_attribute_"+e+"_borcolor").value=Ee[2],wfu_update_triplecolor_value({target:l})}else if("folderlist"==t){for(var i=wfu_parse_folderlist_js(a),Be=document.getElementById("wfu_attribute_"+e).options;Be.length>0;)Be.remove(0);for(var C,ke,xe,Ne,Te,Ae,u=0;u<i.path.length;u++){ke=i.path[u],"/"==ke.substr(ke.length,1)&&(ke=ke.substr(0,ke.length-1)),xe=ke.split("/"),ke=xe[xe.length-1],Te=parseInt(i.level[u]),Ne="",Ae="";for(var y=0;Te>y;y++)Ne+=" ",Ae+="*";Ne+=i.label[u],i["default"][u]&&(Ae+="&"),Ae+=""==ke?"{root}/"+i.label[u]:ke+i.label[u],C=document.createElement("option"),i["default"][u]?C.className="wfu_select_folders_option_default":C.className="",C.value=wfu_plugin_encode_string(Ae),C.innerHTML=Ne,Be.add(C)}C=document.createElement("option"),C.value="",C.innerHTML="",Be.add(C);var He=document.getElementById("wfu_attribute_"+e);He.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),l=He,a!==l.oldVal&&(l.oldVal=a,document.getElementById("wfu_attribute_value_"+e).value=a,wfu_generate_shortcode())}}function wfu_parse_folderlist_js(e){var t=Object();if(t.path=Array(),t.label=Array(),t.level=Array(),t["default"]=Array(),"auto"==e.substr(0,4))return t;var a=e.split(",");if(0==a.length)return t;if(1==a.length&&""==a[0].trim())return t;for(var l,n,d,u,o,r,_,s=["root"],c=0,i=0,f=-1,m=0;m<a.length;m++){for(l=a[m].trim(),n=0,d="",u=!1;n<l.length&&"*"==l.substr(n,1);)n++,d+=" ";if(1>=n-c&&(n>0||0==i)&&(l=l.substr(n,l.length-n),"&"==l.substr(0,1)&&(l=l.substr(1),u=!0),subfolder_items=l.split("/"),subfolder_items.length<2&&subfolder_items.push(""),""!=subfolder_items[1]?(o=subfolder_items[0],r=subfolder_items[1]):(o=l,r=l),""!=o)){u&&-1==f?f=t.path.length:u=!1,0==n&&(i=1),s.length>n?s[n]=o:s.push(o),_="";for(var p=1;n>=p;p++)_+=s[p]+"/";t.path.push(_),t.label.push(r),t.level.push(n),t["default"].push(u),c=n}}return t}function colourNameToHex(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!=typeof t[e.toLowerCase()]?t[e.toLowerCase()]:!1}function wfu_download_file(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_invoker",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="nonce",params[2][1]=a;for(var d="",u=0;u<params.length;u++)d+=(u>0?"&":"")+params[u][0]+"="+encodeURI(params[u][1]);l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var a="wfu_ajax_action_download_file_invoker:",n=l.responseText.indexOf(a);-1==n&&(n=l.responseText.length);var d=(l.responseText.substr(0,n),l.responseText.substr(n+a.length,l.responseText.length-n-a.length));n=d.indexOf(":");var u=d.substr(0,n);if(txt_value=d.substr(n+1,d.length-n-1),"wfu_download_id;"==u.substr(0,16)){var o=u.substr(16),r=document.getElementById("wfu_file_download_container_"+t);r.innerHTML=txt_value,setTimeout("wfu_download_file_monitor('"+e+"', "+t+", '"+o+"')",100)}}},l.send(d)}}function wfu_download_file_monitor(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_monitor",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="id",params[2][1]=a;for(var d="",u=0;u<params.length;u++)d+=(u>0?"&":"")+params[u][0]+"="+encodeURI(params[u][1]);l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var a="wfu_ajax_action_download_file_monitor:",n=l.responseText.indexOf(a);-1==n&&(n=l.responseText.length);var d=(l.responseText.substr(0,n),l.responseText.substr(n+a.length,l.responseText.length-n-a.length));n=d.indexOf(":");var u=d.substr(0,n);if(txt_value=d.substr(n+1,d.length-n-1),"repeat"!=u){var o=document.getElementById("wfu_file_download_container_"+t);o.innerHTML=""}else"repeat"==u&&setTimeout("wfu_download_file_monitor('"+e+"', "+t+", '"+txt_value+"')",100)}},l.send(d)}}function wfu_filedetails_changed(e){for(var t,a,l=document.getElementsByName("wfu_filedetails_userdata"),n=!1,d=!1,u=0;u<l.length;u++)if(t=document.getElementById(l[u].id.replace("wfu_filedetails_userdata_value_","wfu_filedetails_userdata_default_")),a=document.getElementById(l[u].id.replace("wfu_filedetails_userdata_value_","wfu_filedetails_userdata_")),a.value=l[u].value,l[u].value!=t.value){n=!0;break}d=document.getElementById("wfu_filedetails_userid").value!=document.getElementById("wfu_filedetails_userid_default").value,document.getElementById("dp_filedetails_submit_fields").disabled=!n&&!d}function wfu_Attach_FileDetails_Admin_Events(){for(var e=document.getElementsByName("wfu_filedetails_userdata"),t=0;t<e.length;t++)wfu_attach_element_handlers(e[t],wfu_filedetails_changed)}function wfu_update_browserpermission_option(e,t,a){var l=document.getElementById("wfu_fbperm_users"),n=document.getElementById("wfu_fbperm_roles"),d=document.getElementById("wfu_fbperm_"+e+"_"+t+"_view"),u=document.getElementById("wfu_fbperm_"+e+"_"+t+"_dl"),o=document.getElementById("wfu_fbperm_"+e+"_"+t+"_edit"),r=document.getElementById("wfu_fbperm_"+e+"_"+t+"_del");if("role"==e){if("0"==t){u.checked=d.checked&&u.checked,o.checked=d.checked&&o.checked,r.checked=d.checked&&r.checked,u.disabled=!d.checked,o.disabled=!d.checked,r.disabled=!d.checked;for(var _=document.querySelectorAll("tr.wfu_fbperm_role_tr"),s=0;s<_.length;s++){var c=_[s].id.substr(16,_[s].id.length-20);wfu_update_browserpermission_option("role",c,!1)}if(a){var i=(d.checked?"v":"")+(u.checked?"d":"")+(o.checked?"e":"")+(r.checked?"l":"");n.value=n.value.replace(/^0\[\w*\]/,"0["+i+"]")}}else if("administrator"!=t){var f=document.getElementById("wfu_fbperm_role_"+t+"_row"),m=document.getElementById("wfu_fbperm_role_"+t+"_def"),p=document.getElementById("wfu_fbperm_role_0_view"),w=document.getElementById("wfu_fbperm_role_0_dl"),g=document.getElementById("wfu_fbperm_role_0_edit"),v=document.getElementById("wfu_fbperm_role_0_del");if(d.checked=m.checked?p.checked:d.checked,f.style.fontWeight=m.checked?"":"bold",u.checked=m.checked?w.checked:d.checked&&u.checked,o.checked=m.checked?g.checked:d.checked&&o.checked,r.checked=m.checked?v.checked:d.checked&&r.checked,d.disabled=m.checked,u.disabled=m.checked||!d.checked,o.disabled=m.checked||!d.checked,r.disabled=m.checked||!d.checked,a){var i=m.checked?"":"D"+(d.checked?"v":"")+(u.checked?"d":"")+(o.checked?"e":"")+(r.checked?"l":"");n.value=n.value.replace(new RegExp(","+t+"\\[\\w*\\]"),","+t+"["+i+"]")}}for(var b=document.querySelectorAll("tr.wfu_fbperm_user_tr"),s=0;s<b.length;s++){var h=b[s].id.substr(16,b[s].id.length-20);wfu_update_browserpermission_option("user",h,!1)}}else if("user"==e){var y=document.getElementById("wfu_fbperm_user_"+t+"_role");if("0"==t){d.checked=y.checked?!1:d.checked,u.checked=y.checked?!1:d.checked&&u.checked,o.checked=y.checked?!1:d.checked&&o.checked,r.checked=y.checked?!1:d.checked&&r.checked,d.disabled=y.checked,u.disabled=y.checked||!d.checked,o.disabled=y.checked||!d.checked,r.disabled=y.checked||!d.checked,d.indeterminate=y.checked,u.indeterminate=y.checked,o.indeterminate=y.checked,r.indeterminate=y.checked;for(var b=document.querySelectorAll("tr.wfu_fbperm_user_tr"),s=0;s<b.length;s++){var h=b[s].id.substr(16,b[s].id.length-20);wfu_update_browserpermission_option("user",h,!1)}if(a){var i=y.checked?"":"R"+(d.checked?"v":"")+(u.checked?"d":"")+(o.checked?"e":"")+(r.checked?"l":"");l.value=l.value.replace(/^0\[\w*\],?/,""),l.value="0["+i+"]"+(""==l.value?"":","+l.value)}}else{var I=document.getElementById("wfu_fbperm_user_"+t+"_roles").value.split(",");if(1==I.length&&""==I[0]&&(I=Array()),I.indexOf("administrator")<0){var f=document.getElementById("wfu_fbperm_user_"+t+"_row"),m=document.getElementById("wfu_fbperm_user_"+t+"_def"),E=document.getElementById("wfu_fbperm_user_0_role"),p=document.getElementById("wfu_fbperm_user_0_view"),w=document.getElementById("wfu_fbperm_user_0_dl"),g=document.getElementById("wfu_fbperm_user_0_edit"),v=document.getElementById("wfu_fbperm_user_0_del");if(I.length>0)for(var B=!1,k=!1,x=!1,N=!1,s=0;s<I.length;s++)B=B||document.getElementById("wfu_fbperm_role_"+I[s]+"_view").checked,k=B&&(k||document.getElementById("wfu_fbperm_role_"+I[s]+"_dl").checked),x=B&&(x||document.getElementById("wfu_fbperm_role_"+I[s]+"_edit").checked),N=B&&(N||document.getElementById("wfu_fbperm_role_"+I[s]+"_del").checked);else var B=document.getElementById("wfu_fbperm_role_0_view"),k=document.getElementById("wfu_fbperm_role_0_dl"),x=document.getElementById("wfu_fbperm_role_0_edit"),N=document.getElementById("wfu_fbperm_role_0_del");if(f.style.fontWeight=m.checked?"":"bold",y.checked=m.checked?E.checked:y.checked,d.checked=m.checked?E.checked?B:p.checked:y.checked?B:d.checked,u.checked=m.checked?E.checked?k:w.checked:y.checked?k:d.checked&&u.checked,o.checked=m.checked?E.checked?x:g.checked:y.checked?x:d.checked&&o.checked,r.checked=m.checked?E.checked?N:v.checked:y.checked?N:d.checked&&r.checked,y.disabled=m.checked,d.disabled=m.checked||y.checked,u.disabled=m.checked||y.checked||!d.checked,o.disabled=m.checked||y.checked||!d.checked,r.disabled=m.checked||y.checked||!d.checked,a){var i=m.checked?"":"D"+(y.checked?"":"R"+(d.checked?"v":"")+(u.checked?"d":"")+(o.checked?"e":"")+(r.checked?"l":""));l.value=l.value.replace(new RegExp(","+t+"\\[\\w*\\]|"+t+"\\[\\w*\\],|"+t+"\\[\\w*\\]"),""),l.value+=(""==l.value?"":",")+t+"["+i+"]"}}}}}function wfu_goto_historylog_page(e,t){var a=document.getElementById("wfu_historylog_pages"),l=a.selectedIndex+1,n=l;if("next"==t?n=Math.min(l+1,a.options.length):"prev"==t?n=Math.max(l-1,1):"last"==t?n=a.options.length:"first"==t?n=1:"sel"==t&&(l=-1),n!=l){var d=wfu_GetHttpRequestObject();if(null!=d){var u=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_get_historylog_page",params[1]=new Array(2),params[1][0]="token",params[1][1]=e,params[2]=new Array(2),params[2][0]="page",params[2][1]=n;for(var o="",r=0;r<params.length;r++)o+=(r>0?"&":"")+params[r][0]+"="+encodeURI(params[r][1]);document.getElementById("wfu_historylog_overlay").style.display="block",d.open("POST",u,!0),d.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d.onreadystatechange=function(){if(4==d.readyState&&200==d.status){document.getElementById("wfu_historylog_overlay").style.display="none";var e="wfu_historylog_page_success:",t=d.responseText.indexOf(e);-1==t&&(t=d.responseText.length);var l=(d.responseText.substr(0,t),d.responseText.substr(t+e.length,d.responseText.length-t-e.length));if(""!=l){var u=document.getElementById("wfu_historylog_table");u.tBodies[0].innerHTML=wfu_plugin_decode_string(l),a.selectedIndex=n-1,document.getElementById("wfu_historylog_first_disabled").style.display=1==n?"inline":"none",document.getElementById("wfu_historylog_prev_disabled").style.display=1==n?"inline":"none",document.getElementById("wfu_historylog_first").style.display=1==n?"none":"inline",document.getElementById("wfu_historylog_prev").style.display=1==n?"none":"inline",document.getElementById("wfu_historylog_last_disabled").style.display=n==a.options.length?"inline":"none",document.getElementById("wfu_historylog_next_disabled").style.display=n==a.options.length?"inline":"none",document.getElementById("wfu_historylog_last").style.display=n==a.options.length?"none":"inline",document.getElementById("wfu_historylog_next").style.display=n==a.options.length?"none":"inline"}}},d.send(o)}}}function wfu_include_file(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(2),params[0]=new Array(3),params[0][0]="action",params[0][1]="wfu_ajax_action_include_file",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="nonce",params[2][1]=a;for(var d="",u=0;u<params.length;u++)d+=(u>0?"&":"")+params[u][0]+"="+encodeURI(params[u][1]);document.getElementById("wfu_include_file_"+t+"_a").href="javascript: void(0)",document.getElementById("wfu_include_file_"+t+"_img").style.display="inline",l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&(document.getElementById("wfu_include_file_"+t+"_img").style.display="none",200==l.status)){var e="wfu_include_file:",a=l.responseText.indexOf(e);-1==a&&(a=l.responseText.length);var n=(l.responseText.substr(0,a),l.responseText.substr(a+e.length,l.responseText.length-a-e.length));a=n.indexOf(":");var d=n.substr(0,a);txt_value=n.substr(a+1,n.length-a-1),"success"==d?(document.getElementById("wfu_file_flat_"+t).style.display="none",document.getElementById("wfu_file_link_"+t).style.display="inline",document.getElementById("wfu_file_can_be_included_actions_"+t).style.display="none",document.getElementById("wfu_file_is_included_actions_"+t).style.display="block"):document.getElementById("wfu_include_file_"+t+"_a").innerHTML=document.getElementById("wfu_include_file_"+t+"_inpfail").value}},l.send(d)}}function wfu_adminbrowser_select_all_visible_changed(){for(var e=document.getElementById("wfu_select_all_visible").checked,t=document.querySelectorAll(".wfu_selectors"),a=0;a<t.length;a++)t[a].checked=e}function wfu_adminbrowser_selector_changed(e){var t=document.querySelectorAll(".wfu_selectors").length,a=document.querySelectorAll(".wfu_selectors:checked").length,l=document.getElementById("wfu_select_all_visible");l.style.webkitAppearance="",l.style.webkitAppearance="checkbox",l.checked=a>0,l.indeterminate=a>0&&t>a}function wfu_apply_adminbrowser_bulkaction(){var e=document.getElementById("wfu_adminbrowser_bulkactions");if(!(e.selectedIndex<1)){var t=e.options[e.selectedIndex].value,a=document.querySelectorAll(".wfu_selectors:checked");if(0!=a.length){for(var l=[],n=0,d=0,u=0;u<a.length;u++){var o=a[u].className.replace(/.*?wfu_selcode_/,"");if(""!=o){var r=a[u].className.indexOf("wfu_included")>-1;r?n++:d++,"delete"==t&&!r||"include"==t&&r?a[u].checked=!1:l.push(o)}}if("delete"==t&&d>0?alert("Notice! Files that were not uploaded using the plugin cannot be deleted and have been deselected."):"include"==t&&n>0&&alert("Notice! Files already included in the plugin have been deselected."),0!=l.length){var _=document.getElementById("wfu_adminbrowser_action_url").value,s=document.getElementById("wfu_adminbrowser_referer").value;if("delete"==t||"include"==t){var c=document.createElement("FORM");c.method="POST",c.action=_,c.style.display="none";var i=document.createElement("INPUT");i.type="hidden",i.name="action",i.value=t+"_file",c.appendChild(i);var f=document.createElement("INPUT");f.type="hidden",f.name="file",f.value="list:"+l.join(),c.appendChild(f);var m=document.createElement("INPUT");m.type="hidden",m.name="referer",m.value=s,c.appendChild(m),document.body.appendChild(c),c.submit()}}}}}var DraggedItem=null,ShortcodeNextSave=0,ShortcodeTimeOut=null,ShortcodeString="",Autosave=!1,PageObsolete=!1,PageUpdating=!1,CheckObsolescenceTimeOut=5e3;jQuery(document).ready(function(e){e(".wfu_color_field").wpColorPicker({change:function(e,t){e.target.value=t.color.toString(),"wfu_text_elements"==e.target.name?wfu_update_text_value(e):"wfu_triplecolor_elements"==e.target.name&&wfu_update_triplecolor_value(e)}})});
|
1 |
+
function wfu_admin_activate_tab(e){for(var t,a,l=document.getElementById("wfu_tab_container"),n=0;n<l.childNodes.length;n++)t=l.childNodes[n],1===t.nodeType&&(a=t.id.substr(8),t.className.indexOf("nav-tab-active")>-1&&(t.className="nav-tab",document.getElementById("wfu_container_"+a).style.display="none"));document.getElementById("wfu_tab_"+e).className="nav-tab nav-tab-active",document.getElementById("wfu_container_"+e).style.display="block"}function wfu_admin_onoff_clicked(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_wrapper"),l=document.getElementsByClassName("wfu_shadow_"+e,"div",a),n=document.getElementsByClassName("wfu_shadow_"+e+"_inv","div",a),d="on"==t.className.substr(t.className.length-2);if(d=!d){document.getElementById("wfu_attribute_value_"+e).value="true",t.className="wfu_onoff_container_on";for(var u=0;u<l.length;u++)l[u].style.display="none";for(var u=0;u<n.length;u++)n[u].style.display="block"}else{document.getElementById("wfu_attribute_value_"+e).value="false",t.className="wfu_onoff_container_off";for(var u=0;u<l.length;u++)l[u].style.display="block";for(var u=0;u<n.length;u++)n[u].style.display="none"}wfu_generate_shortcode(),("userdata"==e||"formdata"==e)&&wfu_update_formfield_variables()}function wfu_admin_radio_clicked(e){var t=document.getElementsByName("wfu_radioattribute_"+e),a=document.getElementById("wfu_wrapper"),l=document.getElementsByClassName("wfu_shadow_"+e,"div",a),n=document.getElementsByClassName("wfu_shadow_"+e+"_inv","div",a),d="";for(r=0;r<t.length;r++)t[r].checked&&(d=t[r].value);var u="*"==d.substr(0,1);if(u){d=d.substr(1);for(var r=0;r<l.length;r++)l[r].style.display="none";for(var r=0;r<n.length;r++)n[r].style.display="block"}else{for(var r=0;r<l.length;r++)l[r].style.display="block";for(var r=0;r<n.length;r++)n[r].style.display="none"}document.getElementById("wfu_attribute_value_"+e).value=d,wfu_generate_shortcode()}function wfu_addEventHandler(e,t,a){e.addEventListener?e.addEventListener(t,a,!1):e.attachEvent?e.attachEvent("on"+t,a):e["on"+t]=a}function wfu_attach_separator_dragdrop_events(){for(var e,t=document.getElementById("wfu_placements_container"),a=0;a<t.childNodes.length;a++)e=t.childNodes[a],("wfu_component_separator_hor"==e.className||"wfu_component_separator_ver"==e.className)&&(wfu_addEventHandler(e,"dragenter",wfu_separator_dragenter),wfu_addEventHandler(e,"dragover",wfu_default_dragover),wfu_addEventHandler(e,"dragleave",wfu_separator_dragleave),wfu_addEventHandler(e,"drop",wfu_separator_drop))}function wfu_Attach_Admin_DragDrop_Events(){if(window.FileReader){var e=document.getElementById("wfu_placements_container");if(e){for(var t,a=document.getElementById("wfu_componentlist_container"),l=0;l<e.childNodes.length;l++)t=e.childNodes[l],"wfu_component_box"==t.className&&(wfu_addEventHandler(t,"dragstart",wfu_component_dragstart),wfu_addEventHandler(t,"dragend",wfu_component_dragend));for(var l=0;l<a.childNodes.length;l++)if(t=a.childNodes[l],"wfu_component_box_container"==t.className)for(var n=0;n<t.childNodes.length;n++)"wfu_component_box wfu_inbase"==t.childNodes[n].className&&(wfu_addEventHandler(t.childNodes[n],"dragstart",wfu_component_dragstart),wfu_addEventHandler(t.childNodes[n],"dragend",wfu_component_dragend));t=document.getElementById("wfu_componentlist_dragdrop"),wfu_addEventHandler(t,"dragenter",wfu_componentlist_dragenter),wfu_addEventHandler(t,"dragover",wfu_default_dragover),wfu_addEventHandler(t,"dragleave",wfu_componentlist_dragleave),wfu_addEventHandler(t,"drop",wfu_componentlist_drop),wfu_attach_separator_dragdrop_events()}}}function wfu_componentlist_dragenter(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;var t=document.getElementById("wfu_componentlist_dragdrop");return-1==t.className.indexOf("wfu_componentlist_dragdrop_dragover")&&(t.className+=" wfu_componentlist_dragdrop_dragover"),!1}function wfu_componentlist_dragleave(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;var t=document.getElementById("wfu_componentlist_dragdrop");return t.className=t.className.replace(" wfu_componentlist_dragdrop_dragover",""),!1}function wfu_componentlist_drop(e){e=e||window.event,e.preventDefault&&e.preventDefault();var t=e.dataTransfer.getData("Component");if(!t)return!1;var a=t.split("_"),l=a[0],n=parseInt(a[1]),d=document.getElementById("wfu_component_box_"+l+"_"+n);0==n?(d.className="wfu_component_box wfu_inbase",d.style.display="block",document.getElementById("wfu_component_box_container_"+l).appendChild(d)):d.parentNode.removeChild(d);var u=wfu_admin_recreate_placements_text(null,"");return wfu_admin_recreate_placements_panel(u),document.getElementById("wfu_attribute_value_placements").value=u,wfu_update_multiplacement_attributes(),wfu_generate_shortcode(),!1}function wfu_separator_dragenter(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;if("wfu_component_separator_hor"==e.target.className){var t=document.getElementById("wfu_component_bar_hor");t.style.top=e.target.offsetTop+"px",t.style.display="block"}else if("wfu_component_separator_ver"==e.target.className){var t=document.getElementById("wfu_component_bar_ver");t.style.top=e.target.offsetTop+"px",t.style.left=e.target.offsetLeft+"px",t.style.display="block"}return!1}function wfu_default_dragover(e){return e=e||window.event,e.preventDefault&&e.preventDefault(),!1}function wfu_separator_dragleave(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;if("wfu_component_separator_hor"==e.target.className){var t=document.getElementById("wfu_component_bar_hor");t.style.display="none"}else if("wfu_component_separator_ver"==e.target.className){var t=document.getElementById("wfu_component_bar_ver");t.style.display="none"}return!1}function wfu_separator_drop(e){e=e||window.event,e.preventDefault&&e.preventDefault();var t=e.dataTransfer.getData("Component");if(!t)return!1;var a=t.split("_"),l=a[0],n=parseInt(a[1]),d=document.getElementById("wfu_component_box_"+l+"_"+n);d.style.display="none",d.className="wfu_component_box wfu_inbase",document.getElementById("wfu_component_box_container_"+l).appendChild(d);var u=wfu_admin_recreate_placements_text(e.target,l);return wfu_admin_recreate_placements_panel(u),document.getElementById("wfu_attribute_value_placements").value=u,wfu_update_multiplacement_attributes(),wfu_generate_shortcode(),!1}function wfu_component_dragstart(e){e=e||window.event,e.dataTransfer.setData("Component",e.target.id.replace("wfu_component_box_","")),-1==e.target.className.indexOf("wfu_component_box_dragged")&&(e.target.className+=" wfu_component_box_dragged",DraggedItem=e.target),e.target.style.zIndex=3;var t=document.getElementById("wfu_componentlist_dragdrop");return t.className="wfu_componentlist_dragdrop wfu_componentlist_dragdrop_dragover",t.style.display="block",!1}function wfu_component_dragend(e){e=e||window.event,DraggedItem=null,e.target.style.zIndex=1;var t=document.getElementById("wfu_componentlist_dragdrop");return t.style.display="none",t.className="wfu_componentlist_dragdrop",e.target.className=e.target.className.replace(" wfu_component_box_dragged",""),document.getElementById("wfu_component_bar_ver").style.display="none",document.getElementById("wfu_component_bar_hor").style.display="none",!1}function wfu_admin_recreate_placements_text(e,t){function a(e){""!=d&&(d+=n),d+=e,n=""}for(var l=document.getElementById("wfu_placements_container"),n="",d="",u=0;u<l.childNodes.length;u++)item=l.childNodes[u],"wfu_component_separator_ver"==item.className?(""==n&&(n="+"),item==e&&(a(t),n="+")):"wfu_component_separator_hor"==item.className?(n="/",item==e&&(a(t),n="/")):"wfu_component_box"==item.className&&a(item.id.replace("wfu_component_box_","").replace(/_.*$/,""));return d}function wfu_admin_recreate_placements_panel(e){for(var t,a,l,n,d,u,r,o=document.getElementById("wfu_placements_container"),_="",s=0;s<o.childNodes.length;s++)t=o.childNodes[s],"wfu_component_box"==t.className&&(n=t.id.replace("wfu_component_box_",""),d=n.split("_"),_=d[0],u=parseInt(d[1]),0==u?(t.style.display="inline-block",t.className="wfu_component_box wfu_inbase",document.getElementById("wfu_component_box_container_"+_).appendChild(t)):t.parentNode.removeChild(t));for(var i=document.querySelectorAll("div.wfu_component_box_container"),c={},s=0;s<i.length;s++)_=i[s].id.replace("wfu_component_box_container_",""),c[_]=0,r=document.querySelector("div#"+i[s].id+" div.wfu_component_box_index"),r&&(r.innerHTML="1");o.innerHTML="",a=e.split("/");for(var s=0;s<a.length;s++){t=document.createElement("DIV"),t.className="wfu_component_separator_hor",t.setAttribute("draggable",!0),o.appendChild(t),t=document.createElement("DIV"),t.className="wfu_component_separator_ver",t.setAttribute("draggable",!0),o.appendChild(t),l=a[s].split("+");for(var f=0;f<l.length;f++)t=document.querySelector("div#wfu_component_box_container_"+l[f]+" div.wfu_component_box.wfu_inbase"),t&&(n=t.id.replace("wfu_component_box_",""),d=n.split("_"),_=d[0],u=parseInt(d[1]),0==u?o.appendChild(t):(c[_]++,t.id="wfu_component_box_"+_+"_"+(c[_]+1).toString(),t.style.display="block",r=document.querySelector("div#"+t.id+" div.wfu_component_box_index"),r.innerHTML=(c[_]+1).toString(),t=t.cloneNode(!0),o.appendChild(t),t.id="wfu_component_box_"+_+"_"+c[_].toString(),r=document.querySelector("div#"+t.id+" div.wfu_component_box_index"),r.innerHTML=c[_].toString(),wfu_addEventHandler(t,"dragstart",wfu_component_dragstart),wfu_addEventHandler(t,"dragend",wfu_component_dragend)),t.className="wfu_component_box",t.style.display="inline-block",t=document.createElement("DIV"),t.className="wfu_component_separator_ver",t.setAttribute("draggable",!0),o.appendChild(t))}t=document.createElement("DIV"),t.className="wfu_component_separator_hor",t.setAttribute("draggable",!0),o.appendChild(t),t=document.createElement("DIV"),t.id="wfu_component_bar_hor",t.className="wfu_component_bar_hor",o.appendChild(t),t=document.createElement("DIV"),t.id="wfu_component_bar_ver",t.className="wfu_component_bar_ver",o.appendChild(t),wfu_attach_separator_dragdrop_events()}function wfu_update_multiplacement_attributes(){for(var e=document.querySelectorAll("div.wfu_component_box_container"),t=0;t<e.length;t++){itemname=e[t].id.replace("wfu_component_box_container_","");var a=document.querySelector("div#"+e[t].id+" div.wfu_component_box_index");if(a)for(var l=Math.max(1,parseInt(a.innerHTML)-1),n=document.getElementsByName("wfu_attribute_governor_"+itemname),d=0;d<n.length;d++)wfu_update_multiplacement_attribute(n[d].value,l)}}function wfu_update_multiplacement_attribute(e,t){if("userdatalabel"==e){var a=document.querySelectorAll("div.wfu_formdata_container"),l=a.length;if(1>l)return;for(var n,d,u=a[0],r=2;r<=Math.max(l,t);){if(r>l){var o=e+r.toString();for(n=u.parentNode;null!=n&&"TR"!=n.tagName;)n=n.parentNode;if(null==n||"TR"!=n.tagName)return;d=n.cloneNode(!0),d.id="tr_"+wfu_randomString(4),n.parentNode.appendChild(d);var _=document.querySelector("tr#"+d.id+' label[for="wfu_attribute_'+e+'"]');_.setAttribute("for","wfu_attribute_"+o),_.innerHTML+=" ("+r.toString()+")",_=document.querySelector("tr#"+d.id+" input.wfu_attribute_governor"),_.setAttribute("name","wfu_attribute_governor_independent"),_.value=o,_=document.querySelector("tr#"+d.id+" div.wfu_formdata_container"),_.id+=r.toString();var s=document.getElementById("wfu_attribute_default_"+o);s||(s=document.createElement("INPUT"),s.id="wfu_attribute_default_"+o,s.type="hidden",s.value=document.getElementById("wfu_attribute_default_"+e).value,document.getElementById("wfu_attribute_defaults").appendChild(s));var i=document.getElementById("wfu_attribute_value_"+o);i||(i=document.createElement("INPUT"),i.id="wfu_attribute_value_"+o,i.type="hidden",i.value=s.value,document.getElementById("wfu_attribute_values").appendChild(i)),window["wfu_attribute_"+o+"_formtemplate"]=window["wfu_attribute_"+e+"_formtemplate"],window["wfu_attribute_"+o+"_typeprops"]=window["wfu_attribute_"+e+"_typeprops"],wfu_apply_value(o,"formfields",i.value)}else if(r>t){for(d=a[r-1].parentNode;null!=d&&"TR"!=d.tagName;)d=d.parentNode;if(null==d||"TR"!=d.tagName)return;d.parentNode.removeChild(d),wfu_update_formfield_variables()}r++}a=document.querySelectorAll("div.wfu_formdata_container");for(var c=[],r=0;r<a.length;r++)c.push(a[r].id.replace(/^wfu_attribute_/,""));for(var f=document.querySelectorAll(".wfu_formdata_all_attributes"),r=0;r<f.length;r++)f[r].value=c.join(",");wfu_formdata_update_all_updown_buttons(e)}}function wfu_subfolders_input_changed(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_subfolders_path_","");a=a.replace("wfu_subfolders_label_","");var l=document.getElementById("wfu_attribute_"+a);if(!(l.selectedIndex<0)){var n,d,u=document.getElementById("wfu_subfolders_path_"+a),r=document.getElementById("wfu_subfolders_label_"+a),o=document.getElementById("wfu_subfolders_ok_"+a),_="1"==document.getElementById("wfu_subfolders_isnewitem_"+a).value;if(_)n="",d="";else{var s=l.data;t=s[l.selectedIndex],n=t.path,d=t.label}if(u.value==n&&r.value==d)o.disabled=!0,_||wfu_subfolders_update_nav(a);else{o.disabled=!1;for(var i=document.getElementsByName("wfu_subfolder_nav_"+a),c=0;c<i.length;c++)i[c].disabled=!0}}}function wfu_subfolders_auto_changed(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_subfolders_auto_"+e),l=document.getElementById("wfu_subfolders_editable_"+e),n=document.getElementById("wfu_subfolders_manualtext_"+e);if(a.checked){var d=document.getElementById("wfu_attribute_value_"+e).value;"auto"!=d.substr(0,4)&&(n.value=d),l.parentNode.style.display="inline",wfu_apply_value(e,"folderlist","auto"+(l.checked?"+":"")),t.disabled=!0}else t.disabled=!1,l.parentNode.style.display="none",wfu_apply_value(e,"folderlist",n.value)}function wfu_subfolders_up_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=item.index-1;if(!(0>l)){for(var n=-1,d=t.selectedIndex-1;d>=0;){if(a[d].level==item.level&&a[d].index==l){n=d;break}d--}if(-1!=n){var u=0;for(d=t.selectedIndex+1;d<a.length&&a[d].level>item.level;)u++,d++;a[n].index=item.index,item.index=l,t.data=a.slice(0,n).concat(a.slice(t.selectedIndex,t.selectedIndex+1+u)).concat(a.slice(n,t.selectedIndex)).concat(a.slice(t.selectedIndex+1+u));var r=wfu_update_subfolder_list(e);t.selectedIndex=n,wfu_subfolders_update_toolnav(e),item=t,r!==item.oldVal&&(item.oldVal=r,document.getElementById("wfu_attribute_value_"+e).value=r,wfu_generate_shortcode())}}}}function wfu_subfolders_down_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=item.index+1,n=-1;for(curind=t.selectedIndex+1;curind<a.length;){if(a[curind].level==item.level){n=curind;break}if(a[curind].level<item.level)break;curind++}if(-1!=n){var d=0;for(curind=n+1;curind<a.length&&a[curind].level>item.level;)d++,curind++;a[n].index=item.index,item.index=l,t.data=a.slice(0,t.selectedIndex).concat(a.slice(n,n+1+d)).concat(a.slice(t.selectedIndex,n)).concat(a.slice(n+1+d));var u=wfu_update_subfolder_list(e);t.selectedIndex=t.selectedIndex+d+1,wfu_subfolders_update_toolnav(e),item=t,u!==item.oldVal&&(item.oldVal=u,document.getElementById("wfu_attribute_value_"+e).value=u,wfu_generate_shortcode())}}}function wfu_subfolders_left_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;for(item=a[t.selectedIndex],curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)a[curind].level--,curind++;item.level--;var l=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,l!==item.oldVal&&(item.oldVal=l,document.getElementById("wfu_attribute_value_"+e).value=l,wfu_generate_shortcode())}}function wfu_subfolders_right_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;for(item=a[t.selectedIndex],curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)a[curind].level++,curind++;item.level++;var l=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,l!==item.oldVal&&(item.oldVal=l,document.getElementById("wfu_attribute_value_"+e).value=l,wfu_generate_shortcode())}}function wfu_subfolders_def_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;if(item=a[t.selectedIndex],item["default"])item["default"]=!1;else{for(var l=0;l<a.length;l++)a[l]["default"]=!1;item["default"]=!0}var n=wfu_update_subfolder_list(e);wfu_subfolders_update_toolnav(e),item=t,n!==item.oldVal&&(item.oldVal=n,document.getElementById("wfu_attribute_value_"+e).value=n,wfu_generate_shortcode())}}function wfu_subfolders_ok_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=document.getElementById("wfu_subfolders_path_"+e),l=document.getElementById("wfu_subfolders_label_"+e);if(""==a.value||""==l.value)return void alert("Path or label cannot be empty!");var n=t.data,d="1"==document.getElementById("wfu_subfolders_isnewitem_"+e).value;if(d){var u=parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+e).value),r={label:l.value,path:a.value,level:u,"default":!1},o=parseInt(document.getElementById("wfu_subfolders_newitemindex_"+e).value);o>=n.length?n.push(r):n.splice(o,0,r)}else item=n[t.selectedIndex],item.path=a.value,item.label=l.value;var _=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,_!==item.oldVal&&(item.oldVal=_,document.getElementById("wfu_attribute_value_"+e).value=_,wfu_generate_shortcode())}}function wfu_subfolders_del_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=0;for(curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)l++,curind++;if(!(l>0)||confirm("Children items will be deleted as well. Proceed?")){a.splice(t.selectedIndex,1+l);var n=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,n!==item.oldVal&&(item.oldVal=n,document.getElementById("wfu_attribute_value_"+e).value=n,wfu_generate_shortcode())}}}function wfu_subfolders_add_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data,l=t.selectedIndex;item=a[l];var n=t.options,d=document.createElement("option");d.value="",d.innerHTML="",n.add(d,l),t.selectedIndex=l;var u=document.getElementById("wfu_subfolder_tools_"+e),r=document.getElementById("wfu_subfolders_path_"+e),o=document.getElementById("wfu_subfolders_label_"+e),_=document.getElementById("wfu_subfolders_ok_"+e),s=document.getElementById("wfu_subfolders_browse_"+e);u.className="wfu_subfolder_tools_container",o.disabled=!1,_.disabled=!0,document.getElementById("wfu_subfolders_isnewitem_"+e).value="1",document.getElementById("wfu_subfolders_newitemindex_"+e).value=l,document.getElementById("wfu_subfolders_newitemlevel_"+e).value=item.level,document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="",r.disabled=0==item.level,s.disabled=0==item.level,0==item.level?(r.value="{root}",o.value="{upload folder}"):(r.value="",o.value="");for(var i=document.getElementsByName("wfu_subfolder_nav_"+e),c=0;c<i.length;c++)i[c].disabled=!0}}function wfu_subfolders_browse_clicked(e){var t=wfu_GetHttpRequestObject();if(null!=t){var a=null;try{var a=new FormData}catch(l){}if(null!=a){for(var n=document.getElementById("wfu_global_dialog_container"),d=document.getElementById("wfu_subfolders_browser_"+e),u=document.getElementById("wfu_subfolders_browse_"+e),r=document.getElementById("wfu_subfolders_inner_shadow_"+e),o=document.getElementById("wfu_subfolders_browser_msgcont_"+e),_=document.getElementById("wfu_subfolders_browser_msg_"+e),s=document.getElementById("wfu_subfolders_browser_img_"+e),i=document.getElementById("wfu_subfolders_browser_ok_"+e),c=document.getElementById("wfu_subfolders_browser_list_"+e);c.options.length>0;)c.options.remove(0);i.disabled=!0,i.onclick=function(){wfu_folder_browser_cancel_clicked(e)},_.innerHTML="loading folder contents...",s.style.display="inline",o.style.display="block",n.style.display="block",d.style.display="block",d.style.left=u.offsetLeft+u.offsetWidth-d.offsetWidth+"px",d.style.top=u.offsetTop+u.offsetHeight-d.offsetHeight+"px",r.style.display="block",n.onclick=function(){wfu_folder_browser_cancel_clicked(e)};var f=document.getElementById("wfu_attribute_uploadpath").value;"/"==f.substr(f.length-1)&&(f=f.substr(0,f.length-1));var m=wfu_get_relative_path(e).split(","),p=f+m[0];"/"!=p.substr(0)&&(p="/"+p);var w="";2==m.length&&(w=m[1]),a.append("action","wfu_ajax_action_read_subfolders"),a.append("folder1",wfu_plugin_encode_string(p)),a.append("folder2",wfu_plugin_encode_string(w)),t.key=e,t.addEventListener("load",wfu_readfolderComplete,!1),t.addEventListener("error",wfu_readfolderFailed,!1),t.addEventListener("abort",wfu_readfolderCanceled,!1),t.open("POST",AdminParams.wfu_ajax_url),t.send(a)}}}function wfu_readfolderComplete(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msgcont_"+t),l=document.getElementById("wfu_subfolders_browser_msg_"+t),n=document.getElementById("wfu_subfolders_browser_img_"+t),d=document.getElementById("wfu_subfolders_browser_list_"+t),u=document.getElementById("wfu_subfolders_browser_ok_"+t),r=document.getElementById("wfu_subfolders_path_"+t),o=document.getElementById("wfu_subfolders_label_"+t),_=e.target.responseText;if(-1!=_){var s="wfu_read_subfolders:",i=e.target.responseText.indexOf(s);-1==i&&(i=e.target.responseText.length);var c=(e.target.responseText.substr(0,i),e.target.responseText.substr(i+s.length,e.target.responseText.length-i-s.length));i=c.indexOf(":");var f=c.substr(0,i);if(txt_value=c.substr(i+1,c.length-i-1),"success"==f){for(var m,p=wfu_plugin_decode_string(txt_value),w=p.split(","),g=0,v=0;v<w.length;v++)""!=w[v]&&(m=document.createElement("option"),m.value=w[v],m.innerHTML=w[v].replace("*"," "),d.add(m),g++);0==g&&(m=document.createElement("option"),m.value="",m.innerHTML="{empty}",m.disabled=!0,d.add(m)),d.selectedIndex=-1,u.onclick=function(){var e=d.options[d.selectedIndex].value,a=parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+t).value);("*"==e.substr(0,1)||0==a)&&(document.getElementById("wfu_subfolders_newitemlevel_"+t).value=a+1,a>0&&(e=e.substr(1))),r.value=e,o.value=e,wfu_folder_browser_cancel_clicked(t),wfu_subfolders_ok_clicked(t)},a.style.display="none"}else"error"==f?(l.innerHTML=txt_value,n.style.display="none",u.disabled=!1):(l.innerHTML="Unknown error",n.style.display="none",u.disabled=!1)}}function wfu_readfolderFailed(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msg_"+t),l=document.getElementById("wfu_subfolders_browser_img_"+t),n=document.getElementById("wfu_subfolders_browser_ok_"+t);a.innerHTML="Unknown error",l.style.display="none",n.disabled=!1}function wfu_readfolderCanceled(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msg_"+t),l=document.getElementById("wfu_subfolders_browser_img_"+t),n=document.getElementById("wfu_subfolders_browser_ok_"+t);a.innerHTML="Unknown error",l.style.display="none",n.disabled=!1}function wfu_subfolders_browser_list_changed(e){var t=document.getElementById("wfu_subfolders_browser_list_"+e),a=document.getElementById("wfu_subfolders_browser_ok_"+e);a.disabled=t.selectedIndex<0}function wfu_folder_browser_cancel_clicked(e){var t=document.getElementById("wfu_global_dialog_container"),a=document.getElementById("wfu_subfolders_browser_"+e),l=(document.getElementById("wfu_subfolders_browse_"+e),document.getElementById("wfu_subfolders_inner_shadow_"+e));t.onclick=null,l.style.display="none",a.style.display="none",t.style.display="none"}function wfu_get_relative_path(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a,l=t.data,n="1"==document.getElementById("wfu_subfolders_isnewitem_"+e).value;a=n?parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+e).value):l[t.selectedIndex].level;for(var d="/",u=t.selectedIndex-1,r=a;u>=0&&r>1;)l[u].level<r&&(d="/"+l[u].path+d,r=l[u].level),u--;return n&&"1"==document.getElementById("wfu_subfolders_newitemlevel2_"+e).value&&a>0&&t.selectedIndex>0&&(d+=","+l[t.selectedIndex-1].path),d}}function wfu_subfolders_changed(e){wfu_update_subfolder_list(e),wfu_subfolders_update_toolnav(e)}function wfu_subfolders_update_toolnav(e){var t,a,l=document.getElementById("wfu_attribute_"+e),n=document.getElementById("wfu_subfolder_tools_"+e),d=document.getElementById("wfu_subfolders_path_"+e),u=document.getElementById("wfu_subfolders_label_"+e),r=document.getElementById("wfu_subfolders_ok_"+e),o=document.getElementById("wfu_subfolders_browse_"+e),_=document.getElementById("wfu_subfolders_auto_"+e);if(document.getElementById("wfu_subfolders_isnewitem_"+e).value="",document.getElementById("wfu_subfolders_newitemindex_"+e).value="",document.getElementById("wfu_subfolders_newitemlevel_"+e).value="",document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="",null==l.data?(t=wfu_decode_subfolder_list(e),l.data=t):t=l.data,0===l.data.length?(l.className="wfu_select_folders wfu_select_folders_empty",l.options[0].innerHTML=_.checked?"":"press here"):l.className="wfu_select_folders",l.selectedIndex<0)n.className="wfu_subfolder_tools_container wfu_subfolder_tools_disabled",d.disabled=!0,u.disabled=!0,r.disabled=!0,o.disabled=!0,u.value="",d.value="";else if(l.selectedIndex>=l.options.length-1){n.className="wfu_subfolder_tools_container",u.disabled=!1,r.disabled=!0,document.getElementById("wfu_subfolders_isnewitem_"+e).value="1",document.getElementById("wfu_subfolders_newitemindex_"+e).value=t.length;var s;s=0==t.length?0:0==t[t.length-1].level?1:t[t.length-1].level,document.getElementById("wfu_subfolders_newitemlevel_"+e).value=s,document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="1",d.disabled=0==s,o.disabled=!1,0==s?(d.value="{root}",u.value="{upload folder}"):(d.value="",u.value="")}else n.className="wfu_subfolder_tools_container",u.disabled=!1,r.disabled=!0,a=t[l.selectedIndex],d.disabled=0==a.level,o.disabled=0==a.level,u.value=a.label,d.value=a.path;var i=document.getElementsByName("wfu_subfolder_nav_"+e);if(l.selectedIndex<0||l.selectedIndex>=l.options.length-1)for(var c=0;c<i.length;c++)i[c].disabled=!0;else wfu_subfolders_update_nav(e)}function wfu_subfolders_update_nav(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_subfolders_up_"+e),l=document.getElementById("wfu_subfolders_down_"+e),n=document.getElementById("wfu_subfolders_left_"+e),d=document.getElementById("wfu_subfolders_right_"+e),u=document.getElementById("wfu_subfolders_add_"+e),r=document.getElementById("wfu_subfolders_def_"+e),o=document.getElementById("wfu_subfolders_del_"+e),_=t.data,s=_[t.selectedIndex];for(a.disabled=s.index<=0,ind=t.selectedIndex+1,nextind=0;ind<_.length;){if(_[ind].level==s.level){nextind=_[ind].index;break}if(_[ind].level<s.level)break;ind++}l.disabled=0==s.level||0==nextind,n.disabled=0==t.selectedIndex&&s.level<1||t.selectedIndex>0&&s.level<=1,t.selectedIndex>=1?prevlevel=_[t.selectedIndex-1].level:prevlevel=0,d.disabled=s.level-prevlevel>0,u.disabled=0==s.level,r.disabled=!1,r.className="button"+(s["default"]?" wfu_subfolder_nav_pressed":""),o.disabled=!1}function wfu_decode_subfolder(e){var t={label:"",path:"",level:0,"default":!1};e=e.trim();for(var a=0,l=!1;a<e.length&&"*"==e.substr(a,1);)a++;e=e.substr(a,e.length-a),"&"==e.substr(0,1)&&(e=e.substr(1),l=!0),t.level=a,t["default"]=l;var n=e.split("/");return 1==n.length?(t.path=n[0],t.label=n[0]):n.length>1&&(t.path=n[0],t.label=n[1]),0==a&&(t.path="{root}",""==t.label&&(t.label="{upload folder}")),t}function wfu_decode_subfolder_list(e){for(var t,a=document.getElementById("wfu_attribute_"+e).options,l=Array(),n=["root"],d=[0],u=-1,r=0;r<a.length-1;r++){for(l.push(wfu_decode_subfolder(wfu_plugin_decode_string(a[r].value))),n.length>l[r].level?n[l[r].level]=l[r].path:n.push(l[r].path),t="",j=1;j<=l[r].level;j++)t+=n[j]+"/";l[r].fullpath=t,d.length<=l[r].level&&d.push(0),l[r].level>u?l[r].index=0:l[r].index=d[l[r].level]+1,d[l[r].level]=l[r].index,u=l[r].level}return l}function wfu_update_subfolder_list(e){var t=document.getElementById("wfu_attribute_"+e).options,a=document.getElementById("wfu_attribute_"+e),l=a.data;if(null!=l){var n,d,u="";t.length=l.length+1;for(var r=0;r<l.length;r++){for(n="",d="",j=0;j<l[r].level;j++)n+="*",d+=" ";l[r]["default"]?(n+="&",t[r].className="wfu_select_folders_option_default"):t[r].className="",n+=l[r].path+"/"+l[r].label,d+=l[r].label,t[r].value=wfu_plugin_encode_string(n),t[r].innerHTML=d,""!=u&&(u+=","),u+=n}return t[l.length].value="",t[l.length].innerHTML="",u}}function wfu_userdata_edit_field(e,t,a){for(var l,n=0;n<e.childNodes.length;n++)l=e.childNodes[n],"INPUT"==l.tagName?"text"==l.type?(l.value=t,wfu_attach_element_handlers(l,wfu_update_userfield_value)):"checkbox"==l.type&&(l.checked=a):"DIV"==l.tagName&&(l.className="wfu_userdata_action")}function wfu_formdata_edit_field(e,t,a){}function wfu_formdata_get_field_props(e){var t=e.split("_"),a=t[0],l="wfu_formfield_"+e,n=window["wfu_attribute_"+a+"_typeprops"][document.getElementById(l+"_type").value],d={type:document.getElementById(l+"_type").value,label:document.getElementById(l+"_label").value,labelposition:document.getElementById(l+"_labelposition").value,required:"show"==n.required.substr(0,4)&&document.getElementById(l+"_required")?document.getElementById(l+"_required").checked:"true"==n.required.substr(5),donotautocomplete:"show"==n.donotautocomplete.substr(0,4)&&document.getElementById(l+"_donotautocomplete")?document.getElementById(l+"_donotautocomplete").checked:"true"==n.donotautocomplete.substr(5),validate:"show"==n.validate.substr(0,4)&&document.getElementById(l+"_validate")?document.getElementById(l+"_validate").checked:"true"==n.validate.substr(5),typehook:"show"==n.typehook.substr(0,4)&&document.getElementById(l+"_typehook")?document.getElementById(l+"_typehook").checked:"true"==n.typehook.substr(5),hintposition:"show"==n.hintposition.substr(0,4)&&document.getElementById(l+"_hintposition")?document.getElementById(l+"_hintposition").value:n.hintposition.substr(5),"default":"show"==n["default"].substr(0,4)&&document.getElementById(l+"_default")?document.getElementById(l+"_default").value:n["default"].substr(5),data:"show"==n.data.substr(0,4)&&document.getElementById(l+"_data")?document.getElementById(l+"_data").value:n.data.substr(5),group:"show"==n.group.substr(0,4)&&document.getElementById(l+"_group")?document.getElementById(l+"_group").value:n.group.substr(5),format:"show"==n.format.substr(0,4)&&document.getElementById(l+"_format")?document.getElementById(l+"_format").value:n.format.substr(5)};return d}function wfu_formdata_type_changed(e){var t=e.split("_"),a=t[0],l="wfu_formfield_"+e,n=document.getElementById(l+"_container"),d=wfu_formdata_get_field_props(e),u=wfu_formdata_prepare_template(a,d,e);n.innerHTML=u;for(var r=document.querySelectorAll("div#"+l+'_container input[name="wfu_formfield_elements"]'),o=0;o<r.length;o++)wfu_attach_element_handlers(r[o],wfu_update_formfield_value);wfu_formdata_update_buttons(e),wfu_update_formfield_value({target:n})}function wfu_userdata_add_field(e){var t=e.parentNode,a=t.cloneNode(!0);wfu_userdata_edit_field(a,"",!1),t.parentNode.insertBefore(a,t.nextSibling)}function wfu_formdata_add_field(e){var t=e.split("_"),a=t[0],l=(t[1],document.getElementById("wfu_attribute_"+a)),n=document.getElementById("wfu_formfield_"+e+"_container"),d=document.createElement("DIV"),u=a+"_"+wfu_randomString(4);d.id="wfu_formfield_"+u+"_container",d.className="wfu_formdata_line_container",l.insertBefore(d,n.nextSibling);
|
2 |
+
var r={type:"text",label:"",labelposition:"left",required:!1,donotautocomplete:!1,validate:!1,"default":"",data:"",group:"",format:"",hintposition:"right",typehook:!1},o=wfu_formdata_prepare_template(a,r,u);d.innerHTML=o;for(var _=document.querySelectorAll("div#wfu_formfield_"+u+'_container input[name="wfu_formfield_elements"]'),s=0;s<_.length;s++)wfu_attach_element_handlers(_[s],wfu_update_formfield_value);wfu_formdata_update_buttons(e),wfu_formdata_update_buttons(u),wfu_update_formfield_value({target:d})}function wfu_formdata_prepare_template(e,t,a){var l=wfu_plugin_decode_string(window["wfu_attribute_"+e+"_formtemplate"]),n=window["wfu_attribute_"+e+"_typeprops"][t.type],d=window["wfu_attribute_"+e+"_typeprops"][0].split(","),u=["required","donotautocomplete","validate","typehook","labelposition","hintposition","default","data","group","format"],r=["none","top","right","bottom","left"],o=["none","inline","top","right","bottom","left"];l=l.replace(/\[\[key\]\]/g,a).replace(/\[\[t\]\]/g,t.type).replace(/\[\[label\]\]/g,t.label).replace(/\[\[s\]\]/g,t.labelposition).replace(/\[\[d\]\]/g,t["default"]).replace(/\[\[l\]\]/g,t.data).replace(/\[\[data_label\]\]/g,n.data_label).replace(/\[\[g\]\]/g,t.group).replace(/\[\[f\]\]/g,t.format).replace(/\[\[p\]\]/g,t.hintposition);for(var _=0;_<u.length;_++)l=l.replace(new RegExp("\\[\\["+u[_]+"_hint\\]\\]","g"),n[u[_]+"_hint"]);for(var _=0;_<d.length;_++)l=l.replace("[[type_"+d[_]+"_selected]]",d[_]==t.type?' selected="selected"':"");for(var _=0;_<r.length;_++)l=l.replace("[[labelposition_"+r[_]+"_selected]]",r[_]==t.labelposition?' selected="selected"':"");for(var _=0;_<o.length;_++)l=l.replace("[[hintposition_"+o[_]+"_selected]]",o[_]==t.hintposition?' selected="selected"':"");return l=l.replace("[[remove_disabled]]",""),l=l.replace("[[up_disabled]]",""),l=l.replace("[[down_disabled]]",""),l=t.required?l.replace(/\[\[r\-\>\]\]|\[\[\<\-r\]\]/g,""):l.replace(/\[\[r\-\>\]\].*\[\[\<\-r\]\]/g,""),l=t.donotautocomplete?l.replace(/\[\[a\-\>\]\]|\[\[\<\-a\]\]/g,""):l.replace(/\[\[a\-\>\]\].*\[\[\<\-a\]\]/g,""),l=t.validate?l.replace(/\[\[v\-\>\]\]|\[\[\<\-v\]\]/g,""):l.replace(/\[\[v\-\>\]\].*\[\[\<\-v\]\]/g,""),l=t.typehook?l.replace(/\[\[h\-\>\]\]|\[\[\<\-h\]\]/g,""):l.replace(/\[\[h\-\>\]\].*\[\[\<\-h\]\]/g,""),l="show"==n.required.substr(0,4)?l.replace(/\[\[R\-\>\]\]|\[\[\<\-R\]\]/g,""):l.replace(/\[\[R\-\>\]\][^]*\[\[\<\-R\]\]/g,""),l="show"==n.donotautocomplete.substr(0,4)?l.replace(/\[\[A\-\>\]\]|\[\[\<\-A\]\]/g,""):l.replace(/\[\[A\-\>\]\][^]*\[\[\<\-A\]\]/g,""),l="show"==n.validate.substr(0,4)?l.replace(/\[\[V\-\>\]\]|\[\[\<\-V\]\]/g,""):l.replace(/\[\[V\-\>\]\][^]*\[\[\<\-V\]\]/g,""),l="show"==n.hintposition.substr(0,4)?l.replace(/\[\[P\-\>\]\]|\[\[\<\-P\]\]/g,""):l.replace(/\[\[P\-\>\]\][^]*\[\[\<\-P\]\]/g,""),l="show"==n.typehook.substr(0,4)?l.replace(/\[\[H\-\>\]\]|\[\[\<\-H\]\]/g,""):l.replace(/\[\[H\-\>\]\][^]*\[\[\<\-H\]\]/g,""),l="show"==n["default"].substr(0,4)?l.replace(/\[\[D\-\>\]\]|\[\[\<\-D\]\]/g,""):l.replace(/\[\[D\-\>\]\][^]*\[\[\<\-D\]\]/g,""),l="show"==n.data.substr(0,4)?l.replace(/\[\[L\-\>\]\]|\[\[\<\-L\]\]/g,""):l.replace(/\[\[L\-\>\]\][^]*\[\[\<\-L\]\]/g,""),l="show"==n.group.substr(0,4)?l.replace(/\[\[G\-\>\]\]|\[\[\<\-G\]\]/g,""):l.replace(/\[\[G\-\>\]\][^]*\[\[\<\-G\]\]/g,""),l="show"==n.format.substr(0,4)?l.replace(/\[\[F\-\>\]\]|\[\[\<\-F\]\]/g,""):l.replace(/\[\[F\-\>\]\][^]*\[\[\<\-F\]\]/g,"")}function wfu_userdata_remove_field(e){for(var t=e.parentNode,a=t.parentNode,l=null,n=0;n<a.childNodes.length;n++)if(1===a.childNodes[n].nodeType){l=a.childNodes[n];break}if(t!=l){t.parentNode.removeChild(t);for(var n=0;n<l.childNodes.length;n++)if(1===l.childNodes[n].nodeType){wfu_update_userfield_value({target:l.childNodes[n]});break}}}function wfu_formdata_remove_field(e){var t=e.split("_"),a=t[0],l=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_line_container");if(!(l.length<2)){for(var n=document.getElementById("wfu_attribute_"+a),d=document.getElementById("wfu_formfield_"+e+"_container"),u=0,r=0;r<l.length;r++)if(l[r]==d){u=r+1;break}n.removeChild(d),l=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_line_container"),u>l.length&&(u=l.length),d=l[u-1];var o=d.id.replace(/^wfu_formfield_/,"").replace(/_container$/,"");wfu_formdata_update_buttons(o),wfu_update_formfield_value({target:d})}}function wfu_formdata_move_field(e,t){for(var a=e.split("_"),l=a[0],n=document.querySelector("div#wfu_attribute_"+l+" .wfu_formdata_all_attributes").value.split(","),d=n.indexOf(l)+1,u=document.querySelectorAll("div#wfu_attribute_"+l+" .wfu_formdata_line_container"),r=document.getElementById("wfu_attribute_"+l),o=document.getElementById("wfu_formfield_"+e+"_container"),_=0,s=0;s<u.length;s++)if(u[s]==o){_=s+1;break}if(!("up"==t&&1==d&&1==_||"down"==t&&d==n.length&&_==u.length)){var i=wfu_formdata_get_field_props(e),c=l,f=o;if("up"==t)if(_>1)f=u[_-2];else{c=n[d-2];var m=document.querySelectorAll("div#wfu_attribute_"+c+" .wfu_formdata_line_container");f=m[m.length-1]}else if(_<u.length)f=u[_];else{c=n[d];var m=document.querySelectorAll("div#wfu_attribute_"+c+" .wfu_formdata_line_container");f=m[0]}var p=f.id.replace(/^wfu_formfield_/,"").replace(/_container$/,"");if(c==l)"up"==t?r.insertBefore(o,f):r.insertBefore(f,o);else{var w=wfu_formdata_get_field_props(p),g=wfu_formdata_prepare_template(c,i,p);f.innerHTML=g;for(var v=document.querySelectorAll("div#wfu_formfield_"+p+'_container input[name="wfu_formfield_elements"]'),s=0;s<v.length;s++)wfu_attach_element_handlers(v[s],wfu_update_formfield_value);g=wfu_formdata_prepare_template(l,w,e),o.innerHTML=g,v=document.querySelectorAll("div#wfu_formfield_"+e+'_container input[name="wfu_formfield_elements"]');for(var s=0;s<v.length;s++)wfu_attach_element_handlers(v[s],wfu_update_formfield_value)}wfu_formdata_update_buttons(e),wfu_formdata_update_buttons(p),wfu_update_formfield_value({target:o}),c!=l&&wfu_update_formfield_value({target:f})}}function wfu_formdata_update_buttons(e){for(var t=e.split("_"),a=t[0],l=document.querySelector("div#wfu_attribute_"+a+" .wfu_formdata_all_attributes").value.split(","),n=l.indexOf(a)+1,d=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_line_container"),u=document.getElementById("wfu_formfield_"+e+"_container"),r=0,o=0;o<d.length;o++)if(d[o]==u){r=o+1;break}var _=document.querySelector("div#wfu_formfield_"+e+"_container .wfu_formdata_action.wfu_formdata_action_up"),s=document.querySelector("div#wfu_formfield_"+e+"_container .wfu_formdata_action.wfu_formdata_action_down"),i=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_action_remove");_.className="wfu_formdata_action wfu_formdata_action_up"+(1==n&&1==r?" wfu_formdata_action_disabled":""),s.className="wfu_formdata_action wfu_formdata_action_down"+(n==l.length&&r==d.length?" wfu_formdata_action_disabled":"");for(var o=0;o<i.length;o++)i[o].className="wfu_formdata_action wfu_formdata_action_remove"+(i.length>1?"":" wfu_formdata_action_disabled")}function wfu_formdata_update_all_updown_buttons(e){for(var t=document.querySelector("div#wfu_attribute_"+e+" .wfu_formdata_all_attributes").value.split(","),a=0;a<t.length;a++)for(var l=a+1,n=document.querySelectorAll("div#wfu_attribute_"+t[a]+" .wfu_formdata_line_container"),d=0;d<n.length;d++){var u=d+1,r=n[d].id.replace(/^wfu_formfield_/,"").replace(/_container$/,""),o=document.querySelector("div#wfu_formfield_"+r+"_container .wfu_formdata_action.wfu_formdata_action_up"),_=document.querySelector("div#wfu_formfield_"+r+"_container .wfu_formdata_action.wfu_formdata_action_down");o.className="wfu_formdata_action wfu_formdata_action_up"+(1==l&&1==u?" wfu_formdata_action_disabled":""),_.className="wfu_formdata_action wfu_formdata_action_down"+(l==t.length&&u==n.length?" wfu_formdata_action_disabled":"")}}function wfu_generate_shortcode(){for(var e,t=document.getElementById("wfu_shortcode_tag").value,a=document.getElementById("wfu_attribute_defaults"),l=(document.getElementById("wfu_attribute_values"),""),n="",d="["+t,u="",r=0;r<a.childNodes.length;r++)e=a.childNodes[r],1===e.nodeType&&(l=e.id.replace("wfu_attribute_default_",""),n=document.getElementById("wfu_attribute_value_"+l).value,e.value!=n&&(u+=" "+l+'="'+n+'"'));d+=u+"]",document.getElementById("wfu_shortcode").value=d,ShortcodeString=u.substr(1),document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode").disabled=wfu_plugin_encode_string(d)==document.getElementById("wfu_shortcode_original_enc").value),Autosave&&wfu_schedule_save_shortcode()}function wfu_update_text_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_",""),l=t.value;l=l.replace(/(\r\n|\n|\r)/gm,"%n%"),l=l.replace(/\"/gm,"%dq%"),l=l.replace(/\[/gm,"%brl%"),l=l.replace(/\]/gm,"%brr%"),l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_date_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_",""),l=t.value;l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_stringmatch_textvalue(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.replace("_matchfield","").replace("_matchvalue",""),wfu_update_stringmatch_value(a)}function wfu_update_triplecolor_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.replace("_color",""),a=a.replace("_bgcolor",""),a=a.replace("_borcolor",""),t=document.getElementById("wfu_attribute_"+a+"_color");var l=t.value+","+document.getElementById("wfu_attribute_"+a+"_bgcolor").value+","+document.getElementById("wfu_attribute_"+a+"_borcolor").value;l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_dimension_value(e){e=e||window.event;var t=e.target,a=t.name.replace("wfu_dimension_elements_",""),l=document.getElementsByName(t.name);t=l[0];for(var n="",d="",u=0;u<l.length;u++)d=l[u].id.replace("wfu_attribute_"+a+"_",""),""!=n&&""!=l[u].value&&(n+=", "),""!=l[u].value&&(n+=d+":"+l[u].value);n!==t.oldVal&&(t.oldVal=n,document.getElementById("wfu_attribute_value_"+a).value=n,wfu_generate_shortcode())}function wfu_update_ptext_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.substr(2);var l=document.getElementById("wfu_attribute_s_"+a).value,n=document.getElementById("wfu_attribute_p_"+a).value,d=l+"/"+n;d!==t.oldVal&&(t.oldVal=d,document.getElementById("wfu_attribute_value_"+a).value=d),wfu_generate_shortcode()}function wfu_update_mchecklist_value(e){var t="",a=(document.getElementById("wfu_attribute_"+e),document.getElementById("wfu_attribute_"+e+"_all"));a.checked?(jQuery("#wfu_attribute_"+e+" input").prop("disabled",!0),jQuery("#wfu_attribute_"+e+" input").prop("checked",!0),t="all"):(jQuery("#wfu_attribute_"+e+" input").prop("disabled",!1),jQuery("#wfu_attribute_"+e+" input").each(function(){jQuery(this).prop("checked")&&(t+=","+jQuery(this).next().html())}),t=t.substr(1)),document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_rolelist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_guests"),n=document.getElementById("wfu_attribute_"+e+"_all");if(n.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var d=a.options,u=0;u<d.length;u++)d[u].selected&&(""!=t&&(t+=","),t+=d[u].value)}l.checked&&(""!=t&&(t+=","),t+="guests"),document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_userlist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_current"),n=document.getElementById("wfu_attribute_"+e+"_guests"),d=document.getElementById("wfu_attribute_"+e+"_all");if(l&&l.checked)a.disabled=!0,d.disabled=!0,n.disabled=!0,t="current";else{if(d.disabled=!1,n.disabled=!1,d.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var u=a.options,r=0;r<u.length;r++)u[r].selected&&(""!=t&&(t+=","),t+=u[r].value)}n.checked&&(""!=t&&(t+=","),t+="guests")}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_postlist_value(e){for(var t="",a=Array(),l=Array(),n=document.getElementById("wfu_attribute_"+e+"_postlist").value.split(","),d=0;d<n.length;d++)a.push(document.getElementById("wfu_attribute_"+e+"_"+n[d])),l.push(document.getElementById("wfu_attribute_"+e+"_all_"+n[d]));var u=document.getElementById("wfu_attribute_"+e+"_current");if(u&&u.checked){for(var d=0;d<n.length;d++)a[d].disabled=!0,l[d].disabled=!0;t="current"}else{var r=!0;t="";for(var d=0;d<n.length;d++)if(l[d].disabled=!1,l[d].checked)a[d].disabled=!0,""!=t&&(t+=","),t+="all"+n[d];else{a[d].disabled=!1,r=!1;for(var o=a[d].options,_=0;_<o.length;_++)o[_].selected&&(""!=t&&(t+=","),t+=o[_].value)}r&&(t="all")}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_bloglist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_current"),n=document.getElementById("wfu_attribute_"+e+"_all");if(l&&l.checked)a.disabled=!0,n.disabled=!0,t="current";else if(n.disabled=!1,n.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var d=a.options,u=0;u<d.length;u++)d[u].selected&&(""!=t&&(t+=","),t+=d[u].value)}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_stringmatch_value(e){var t=document.getElementById("wfu_attribute_"+e+"_matchfield").value,a=document.getElementById("wfu_attribute_"+e+"_matchcriterion").value,l=document.getElementById("wfu_attribute_"+e+"_matchvalue").value;t=t.replace(";",""),""==t.trim()?document.getElementById("wfu_attribute_value_"+e).value="":document.getElementById("wfu_attribute_value_"+e).value="field:"+t+";criterion:"+a+";value:"+l,wfu_generate_shortcode()}function wfu_update_userfield_value(e){e=e||window.event;for(var t=e.target,a=t.parentNode,l=a.parentNode,n="",d=!1,u="",r=0;r<l.childNodes.length;r++)if(a=l.childNodes[r],"DIV"===a.tagName){for(var o=0;o<a.childNodes.length;o++)"INPUT"==a.childNodes[o].tagName&&("text"==a.childNodes[o].type?(n=a.childNodes[o].value,0==r&&(t=a.childNodes[o])):"checkbox"==a.childNodes[o].type&&(d=a.childNodes[o].checked));""!=u&&""!=n&&(u+="/"),""!=n&&d&&(u+="*"),""!=n&&(u+=n)}u!==t.oldVal&&(t.oldVal=u,document.getElementById("wfu_attribute_value_userdatalabel").value=u,wfu_generate_shortcode(),wfu_update_formfield_variables())}function wfu_update_formfield_value(e){e=e||window.event;for(var t=e.target,a=t.id.match(/^wfu_formfield_(.*?)_/)[1],l=document.querySelectorAll("div#wfu_attribute_"+a+" .wfu_formdata_line_container"),n="",d=0;d<l.length;d++){var u="",r=l[d].id.match(/^wfu_formfield_.*?_(.*?)_/)[1],o=a+"_"+r,_=document.getElementById("wfu_formfield_"+o+"_label").value;if(""!=_.trim()){u=_.trim();var s=document.getElementById("wfu_formfield_"+o+"_type").value,i=window["wfu_attribute_"+a+"_typeprops"];u+="|t:"+s,u+="|s:"+document.getElementById("wfu_formfield_"+o+"_labelposition").value,"show"==i[s].required.substr(0,4)&&(u+="|r:"+(document.getElementById("wfu_formfield_"+o+"_required").checked?"1":"0")),"show"==i[s].donotautocomplete.substr(0,4)&&(u+="|a:"+(document.getElementById("wfu_formfield_"+o+"_donotautocomplete").checked?"1":"0")),"show"==i[s].validate.substr(0,4)&&(u+="|v:"+(document.getElementById("wfu_formfield_"+o+"_validate").checked?"1":"0")),"show"==i[s].typehook.substr(0,4)&&(u+="|h:"+(document.getElementById("wfu_formfield_"+o+"_typehook").checked?"1":"0")),"show"==i[s].hintposition.substr(0,4)&&(u+="|p:"+document.getElementById("wfu_formfield_"+o+"_hintposition").value),"show"==i[s]["default"].substr(0,4)&&(u+="|d:"+document.getElementById("wfu_formfield_"+o+"_default").value),"show"==i[s].data.substr(0,4)&&(u+="|l:"+document.getElementById("wfu_formfield_"+o+"_data").value),"show"==i[s].group.substr(0,4)&&(u+="|g:"+document.getElementById("wfu_formfield_"+o+"_group").value),"show"==i[s].format.substr(0,4)&&(u+="|f:"+document.getElementById("wfu_formfield_"+o+"_format").value)}""!=u&&(""!=n&&(n+="/"),n+=u)}n!==t.oldVal&&(t.oldVal=n,document.getElementById("wfu_attribute_value_"+a).value=n,wfu_generate_shortcode(),wfu_update_formfield_variables())}function wfu_update_formfield_variables(){var e=document.getElementById("wfu_attribute_value_userdatalabel");if(e){for(var t=document.getElementById("wfu_wrapper"),a=document.getElementsByClassName("wfu_shadow_userdata","div",t),l=document.getElementsByName("wfu_formfield_select"),n=0;n<l.length;n++)l[n].style.display="none";if(0!=a.length&&"block"!=a[0].style.display){for(var d='<option style="display:none;">%userdataXXX%</option>',u=e.value.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]"),r=2;document.getElementById("wfu_attribute_userdatalabel"+r);){var o=document.getElementById("wfu_attribute_value_userdatalabel"+r).value.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]");u=u.concat(o),r++}var _="",s=0;r=1;for(var n=0;n<u.length;n++)_=u[n],"*"==_[0]&&(_=_.substr(1)),s=_.indexOf("|"),s>-1&&(_=_.substr(0,s)),""!=_.trim()&&(d+='<option value="%userdata'+r+'%">'+r+": "+_.trim()+"</option>",r++);for(var n=0;n<l.length;n++)l[n].innerHTML=d,l[n].style.display="inline-block"}}}function wfu_attach_element_handlers(e,t){for(var a=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"],l=0;l<a.length;l++)wfu_addEventHandler(e,a[l],t)}function wfu_Attach_Admin_Events(e){Autosave=e,wfu_generate_shortcode(),wfu_update_formfield_variables(),wfu_Attach_Admin_DragDrop_Events();for(var t=document.getElementsByName("wfu_text_elements"),a=0;a<t.length;a++)wfu_attach_element_handlers(t[a],wfu_update_text_value);for(var l=document.getElementsByName("wfu_ptext_elements"),a=0;a<l.length;a++)wfu_attach_element_handlers(l[a],wfu_update_ptext_value);for(var n=document.getElementsByName("wfu_stringmatch_elements"),a=0;a<n.length;a++)wfu_attach_element_handlers(n[a],wfu_update_stringmatch_textvalue);for(var d=document.getElementsByName("wfu_triplecolor_elements"),a=0;a<d.length;a++)wfu_attach_element_handlers(d[a],wfu_update_triplecolor_value);for(var u=document.getElementsByName("wfu_dimension_elements_widths"),a=0;a<u.length;a++)wfu_attach_element_handlers(u[a],wfu_update_dimension_value);u=document.getElementsByName("wfu_dimension_elements_heights");for(var a=0;a<u.length;a++)wfu_attach_element_handlers(u[a],wfu_update_dimension_value);for(var r=document.getElementsByName("wfu_userfield_elements"),a=0;a<r.length;a++)wfu_attach_element_handlers(r[a],wfu_update_userfield_value);for(var o=document.getElementsByName("wfu_formfield_elements"),a=0;a<o.length;a++)wfu_attach_element_handlers(o[a],wfu_update_formfield_value);for(var _=document.getElementsByName("wfu_subfolder_tools_input"),a=0;a<_.length;a++)wfu_attach_element_handlers(_[a],wfu_subfolders_input_changed);for(var s=document.getElementsByName("wfu_columnprops_elements"),a=0;a<s.length;a++)wfu_attach_element_handlers(s[a],wfu_columnprops_element_changed);""!=document.getElementById("wfu_shortcode_postid").value&&setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}function wfu_insert_variable(e){var t=e.className.replace("wfu_variable wfu_variable_",""),a=document.getElementById("wfu_attribute_"+t),l=a.selectionStart,n=a.value;a.value=n.substr(0,l)+e.innerHTML+n.substr(l),wfu_update_text_value({target:a})}function wfu_insert_userfield_variable(e){var t=e.className.replace("wfu_variable wfu_variable_",""),a=document.getElementById("wfu_attribute_"+t),l=a.selectionStart,n=a.value;a.value=n.substr(0,l)+e.value+n.substr(l),e.value="%userdataXXX%",wfu_update_text_value({target:a})}function wfu_columns_itemclicked(e,t){var a=e.parentNode;if("SELECT"==a.tagName){for(var l=0;l<a.options.length;l++)a.options[l].selected=a.options[l]==e;wfu_update_column_props(t)}}function wfu_columns_buttonaction(e,t){var a=document.getElementById("wfu_attribute_"+e+"_sourcelist"),l=document.getElementById("wfu_attribute_"+e);if("add"==t){for(var n=0;n<a.options.length;n++)if(a.options[n].selected||"wfu_columns_item_required"==a.options[n].className){for(var d=!1,u=a.options[n].value.replace(/:.*/,""),r=0;r<l.options.length;r++){var o=l.options[r].value.replace(/:.*/,"");if(o==u){d=!0;break}}if(!d){var _=a.options[n].value.match(/(.*?):(.*?)\/(.*)/),s=_[1],i="custom"==s?"+-"+(""==_[2]?"s":_[2]):""!=_[2]?"-+"+_[2]:"",c=_[3];"custom"==s&&(s="custom1");var f=document.createElement("OPTION");f.value=s+":"+i+"/"+a.options[n].innerHTML+"/"+c,f.innerHTML=a.options[n].innerHTML+(""!=c&&c!=a.options[n].innerHTML?" ("+c+")":""),f.className=a.options[n].className,f.onclick=a.options[n].onclick,l.appendChild(f),l.selectedIndex=l.options.length-1}}}else if("del"==t)for(var n=0;n<l.options.length;)l.options[n].selected&&"wfu_columns_item_required"!=l.options[n].className?l.options.remove(n):n++;else if("up"==t||"down"==t){for(var m=-1,n=0;n<l.options.length;n++)l.options[n].selected&&-1==m?m=n:l.options[n].selected&&m>-1&&(l.options[n].selected=!1);"up"==t&&m>0?l.insertBefore(l.options[m],l.options[m-1]):"down"==t&&m<l.options.length-1&&l.insertBefore(l.options[m+1],l.options[m])}wfu_update_column_props(e),wfu_update_columns(e)}function wfu_update_column_props(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_attribute_"+e+"_columnprops_container"),l=document.getElementById("wfu_attribute_"+e+"_columnprops_title"),n=(document.getElementById("wfu_attribute_"+e+"_columnprops_title_label"),document.getElementById("wfu_attribute_"+e+"_columnprops_id")),d=document.getElementById("wfu_attribute_"+e+"_columnprops_id_label"),u=document.getElementById("wfu_attribute_"+e+"_columnprops_sort"),r=document.getElementById("wfu_attribute_"+e+"_columnprops_sort_label"),o=document.getElementById("wfu_attribute_"+e+"_columnprops_sorttype"),_=document.getElementById("wfu_attribute_"+e+"_columnprops_sorttype_label"),s=t.selectedIndex;if(""==o.options[0].value&&o.options.remove(0),-1==s)a.className="wfu_columnprops_container wfu_columnprops_container_disabled",l.value="",l.disabled=!0,n.value="",n.disabled=!0,u.checked=!1,u.disabled=!0,o.selectedIndex=-1,o.disabled=!0;else{var i=t.options[s].value.match(/(.*?):(.*?)\/(.*?)\/(.*)/),c=i[1],f="custom"==c.substr(0,6),m=f?c.substr(6):"",p=""!=i[2],w=p&&"+"==i[2].substr(1,1),g=w&&"+"==i[2].substr(0,1),v=w?i[2].substr(2):"",b=i[4];a.className="wfu_columnprops_container",l.value=b,l.disabled=!1,d.className=f?"":"wfu_columnprops_label_disabled",n.value=m,n.disabled=!f,r.className=p?"":"wfu_columnprops_label_disabled",u.checked=w,u.disabled=!p,_.className=g?"":"wfu_columnprops_label_disabled",o.value=v,o.disabled=!g}}function wfu_columnprops_element_changed(e){e=e||window.event;var t=e.target,a=t.id.match(/^wfu_attribute_(.*?)_columnprops_/)[1],l=document.getElementById("wfu_attribute_"+a),n=document.getElementById("wfu_attribute_"+a+"_columnprops_title"),d=document.getElementById("wfu_attribute_"+a+"_columnprops_id"),u=document.getElementById("wfu_attribute_"+a+"_columnprops_sort"),r=document.getElementById("wfu_attribute_"+a+"_columnprops_sorttype"),o=l.selectedIndex;if(-1!=o){var _=l.options[o].value.match(/(.*?):(.*?)\/(.*?)\/(.*)/),s=_[1],i="custom"==s.substr(0,6)?"custom":s,c="custom"==i,f=c?parseInt(d.value)>=1?d.value:"1":"",m=""!=_[2]?_[2].substr(0,1)+(u.checked?"+":"-")+(""!=r.value?r.value:""!=_[2].substr(2)?_[2].substr(2):"s"):"",p=_[3],w=""!=n.value?n.value:p;l.options[o].value=i+f+":"+m+"/"+p+"/"+w,l.options[o].innerHTML=p+(w!=p?" ("+w+")":""),wfu_update_column_props(a),wfu_update_columns(a)}}function wfu_update_columns(e){for(var t=document.getElementById("wfu_attribute_"+e),a="",l=0;l<t.options.length;l++){var n=t.options[l].value.match(/(.*?):(.*?)\/(.*?)\/(.*)/),d=n[1]+":"+("+"==n[2].substr(1,1)?n[2].substr(2):"")+"/"+n[4];""!=a&&(a+=","),a+=d}document.getElementById("wfu_attribute_value_"+e).value=a,wfu_generate_shortcode()}function wfu_GetHttpRequestObject(){var e=null;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}if(null==e&&window.createRequest)try{xmlhttp=window.createRequest()}catch(t){}return e}function wfu_plugin_encode_string(e){var t,a=0,l="",n="";for(a=0;a<e.length;a++)t=e.charCodeAt(a),t>=2048?t=((16773120&t|917504)<<4)+((4032&t|8192)<<2)+(63&t|128):t>=128&&(t=((65472&t|12288)<<2)+(63&t|128)),n=t.toString(16),(1==n.length||3==n.length||5==n.length)&&(n="0"+n),l+=n;return l}function wfu_plugin_decode_string(e){for(var t,a,l=0,n="";l<e.length;)t=parseInt(e.substr(l,2),16),a=128>t?t:224>t?((31&t)<<6)+(63&parseInt(e.substr(l+=2,2),16)):((15&t)<<12)+((63&parseInt(e.substr(l+=2,2),16))<<6)+(63&parseInt(e.substr(l+=2,2),16)),n+=String.fromCharCode(a),l+=2;return n}function wfu_randomString(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",a=e,l="",n=0;a>n;n++){var d=Math.floor(Math.random()*t.length);l+=t.substring(d,d+1)}return l}function wfu_schedule_save_shortcode(){var e=new Date,t=ShortcodeNextSave-e.getTime();null!=ShortcodeTimeOut&&(clearTimeout(ShortcodeTimeOut),ShortcodeTimeOut=null),0>=t?wfu_save_shortcode():ShortcodeTimeOut=setTimeout(function(){wfu_save_shortcode()},t)}function wfu_check_page_obsolescence(){PageObsolete||PageUpdating||""==document.getElementById("wfu_shortcode_postid").value}function wfu_save_shortcode(){if(!PageObsolete){var e=wfu_GetHttpRequestObject();if(null!=e){PageUpdating=!0,document.getElementById("wfu_update_failed_message").style.display="none";var t=AdminParams.wfu_ajax_url;params=new Array(8),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_save_shortcode",params[1]=new Array(2),params[1][0]="shortcode",params[1][1]=wfu_plugin_encode_string(ShortcodeString),params[2]=new Array(2),params[2][0]="shortcode_original",params[2][1]=document.getElementById("wfu_shortcode_original_enc").value,params[3]=new Array(2),params[3][0]="post_id",params[3][1]=document.getElementById("wfu_shortcode_postid").value,params[4]=new Array(2),params[4][0]="post_hash",params[4][1]=document.getElementById("wfu_shortcode_posthash").value,params[5]=new Array(2),params[5][0]="shortcode_position",params[5][1]=document.getElementById("wfu_shortcode_position").value,params[6]=new Array(2),params[6][0]="shortcode_tag",params[6][1]=document.getElementById("wfu_shortcode_tag").value,params[7]=new Array(2),params[7][0]="widget_id",params[7][1]=document.getElementById("wfu_shortcode_widgetid").value;for(var a="",l=0;l<params.length;l++)a+=(l>0?"&":"")+params[l][0]+"="+encodeURI(params[l][1]);var n=new Date;Autosave?ShortcodeNextSave=n.getTime()+5e3:document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode_wait").style.display="inline"),e.open("POST",t,!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){PageUpdating=!1;var t="wfu_save_shortcode:",a=e.responseText.indexOf(t);-1==a&&(a=e.responseText.length);var l=(e.responseText.substr(0,a),e.responseText.substr(a+t.length,e.responseText.length-a-t.length));a=l.indexOf(":");var d=l.substr(0,a);if(txt_value=l.substr(a+1,l.length-a-1),"success"==d){if(Autosave?(document.getElementById("wfu_save_label").innerHTML="saved",document.getElementById("wfu_save_label").className="wfu_save_label",document.getElementById("wfu_save_label").style.opacity=1,wfu_fadeout_element(300),ShortcodeNextSave=n.getTime()+1e3,null!=ShortcodeTimeOut&&wfu_schedule_save_shortcode()):document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode_wait").style.display="none",document.getElementById("wfu_update_shortcode").disabled=!0,window.plugin_window&&window.plugin_window.location.reload(!0)),""!=document.getElementById("wfu_shortcode_postid").value){var u=document.getElementById("wfu_shortcode_tag").value;document.getElementById("wfu_shortcode_original_enc").value=wfu_plugin_encode_string("["+u+" "+ShortcodeString+"]"),document.getElementById("wfu_shortcode_posthash").value=txt_value,setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}}else Autosave&&(document.getElementById("wfu_save_label").innerHTML="not saved",document.getElementById("wfu_save_label").className="wfu_save_label_fail",document.getElementById("wfu_save_label").style.opacity=1,wfu_fadeout_element(300)),"fail"==d&&("post_modified"==txt_value?(PageObsolete=!0,document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode").disabled=!0),document.getElementById("wfu_update_rejected_message").style.display="block"):document.getElementById("wfu_update_failed_message").style.display="block")}},e.send(a)}}}function wfu_adjust_opacity(e){document.getElementById("wfu_save_label").style.opacity=e}function wfu_fadeout_element(e){for(var t=20,a=0,l=0;t>l;l++)a=1-l/t,setTimeout('wfu_adjust_opacity("'+a.toString()+'")',l*e/t);setTimeout('wfu_adjust_opacity("0.0")',l*e/t)}function wfu_apply_value(e,t,a){if("onoff"==t)document.getElementById("wfu_attribute_"+e).className="wfu_onoff_container_"+("true"!=a?"on":"off"),wfu_admin_onoff_clicked(e);else if("text"==t||"ltext"==t||"integer"==t||"float"==t||"mtext"==t||"color"==t){var l=document.getElementById("wfu_attribute_"+e);if(a=a.replace(/\%n\%/gm,"\n"),a=a.replace(/\%dq\%/gm,'"'),a=a.replace(/\%brl\%/gm,"["),a=a.replace(/\%brr\%/gm,"]"),"color"==t){var n=colourNameToHex(a);n||(n=a),jQuery("#wfu_attribute_"+e).wpColorPicker("color",n)}l.value=a,wfu_update_text_value({target:l})}else if("date"==t){var l=document.getElementById("wfu_attribute_"+e);l.value=a,wfu_update_date_value({target:l})}else if("placements"==t)wfu_admin_recreate_placements_panel(a),document.getElementById("wfu_attribute_value_placements").value=a,wfu_generate_shortcode();else if("radio"==t){for(var d=document.getElementsByName("wfu_radioattribute_"+e),u=0;u<d.length;u++)d[u].checked=d[u].value==a||"*"+d[u].value==a;wfu_admin_radio_clicked(e)}else if("ptext"==t){a=a.replace(/\%n\%/gm,"\n"),a=a.replace(/\%dq\%/gm,'"'),a=a.replace(/\%brl\%/gm,"["),a=a.replace(/\%brr\%/gm,"]");var r=a.split("/"),o=r.length<1?"":r[0],_=r.length<2?o:r[1],s=document.getElementById("wfu_attribute_s_"+e);s.value=o;var i=document.getElementById("wfu_attribute_p_"+e);i.value=_,wfu_update_ptext_value({target:s}),wfu_update_ptext_value({target:i})}else if("mchecklist"==t){if(a=a.toLowerCase(),"all"==a)document.getElementById("wfu_attribute_"+e+"_all").checked=!0;else{document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var c=a.split(","),u=0;u<c.length;u++)c[u]=c[u].trim();jQuery("#wfu_attribute_"+e+" input").each(function(){jQuery(this).prop("checked",c.indexOf(jQuery(this).next().html())>-1)})}wfu_update_mchecklist_value(e)}else if("rolelist"==t){var l=document.getElementById("wfu_attribute_"+e),f=document.getElementById("wfu_attribute_"+e+"_all"),m=f.className.indexOf("wfu_default_administrator")>-1,p=a.split(",");if(p.indexOf("all")>-1){f.checked=!0;for(var u=0;u<l.options.length;u++)l.options[u].selected=m&&"administrator"==l.options[u].value}else{f.checked=!1;for(var u=0;u<p.length;u++)p[u]=p[u].trim();for(var u=0;u<l.options.length;u++)l.options[u].selected=p.indexOf(l.options[u].value)>-1}document.getElementById("wfu_attribute_"+e+"_guests").checked=p.indexOf("guests")>-1,wfu_update_rolelist_value(e)}else if("userlist"==t){var l=document.getElementById("wfu_attribute_"+e),f=document.getElementById("wfu_attribute_"+e+"_all"),w=f.className.indexOf("wfu_default_0")>-1,g=document.getElementById("wfu_attribute_"+e+"_current");if(g&&"current"==a){g.checked=!0,f.checked=!1,document.getElementById("wfu_attribute_"+e+"_guests").checked=!1;for(var u=0;u<l.options.length;u++)l.options[u].selected=w&&1>u;
|
3 |
+
}else{g&&(g.checked=!1);var v=a.split(",");if(v.indexOf("all")>-1){f.checked=!0;for(var u=0;u<l.options.length;u++)l.options[u].selected=w&&1>u}else{f.checked=!1;for(var u=0;u<v.length;u++)v[u]=v[u].trim();for(var u=0;u<l.options.length;u++)l.options[u].selected=v.indexOf(l.options[u].value)>-1}document.getElementById("wfu_attribute_"+e+"_guests").checked=v.indexOf("guests")>-1}wfu_update_userlist_value(e)}else if("postlist"==t){for(var b=Array(),f=Array(),h=document.getElementById("wfu_attribute_"+e+"_postlist").value.split(","),u=0;u<h.length;u++)b.push(document.getElementById("wfu_attribute_"+e+"_"+h[u])),f.push(document.getElementById("wfu_attribute_"+e+"_all_"+h[u]));var g=document.getElementById("wfu_attribute_"+e+"_current");if(g&&"current"==a){g.checked=!0;for(var u=0;u<h.length;u++){f[u].checked=!1;for(var y=0;y<b[u].options.length;y++)b[u].options[y].selected=!1}}else{g&&(g.checked=!1);for(var I=a.split(","),u=0;u<h.length;u++){("all"==a||I.indexOf("all"+h[u])>-1)&&(f[u].checked=!0);for(var y=0;y<b[u].options.length;y++)b[u].options[y].selected=I.indexOf(b[u].options[y].value)>-1}}wfu_update_postlist_value(e)}else if("bloglist"==t){var g=document.getElementById("wfu_attribute_"+e+"_current");if(g&&"current"==a){g.checked=!0,document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var l=document.getElementById("wfu_attribute_"+e),u=0;u<l.options.length;u++)l.options[u].selected=!1}else{g&&(g.checked=!1);var E=a.split(",");if("all"==a)document.getElementById("wfu_attribute_"+e+"_all").checked=!0;else{document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var u=0;u<E.length;u++)E[u]=E[u].trim();for(var l=document.getElementById("wfu_attribute_"+e),u=0;u<l.options.length;u++)l.options[u].selected=E.indexOf(l.options[u].value)>-1}}wfu_update_bloglist_value(e)}else if("stringmatch"==t){var B="",k="equal to",x="",N=a.match(/^field:(.*?);\s*criterion:(.*?)\s*;\s*value:(.*)$/);N&&4==N.length&&(B=N[1],k=N[2],x=N[3]),document.getElementById("wfu_attribute_"+e+"_matchfield").value=B,document.getElementById("wfu_attribute_"+e+"_matchcriterion").value=k,document.getElementById("wfu_attribute_"+e+"_matchvalue").value=x,wfu_update_stringmatch_value(e)}else if("columns"==t){var T=document.getElementById("wfu_attribute_"+e+"_sourcelist"),A=document.getElementById("wfu_attribute_"+e);A.innerHTML="";for(var S=a.replace(/(:|\/).*?(,|$)/g,"$2").split(","),u=0;u<T.options.length;u++){var r=T.options[u].value.match(/(.*?):(.*?)\/(.*)/),q=r[1];if("wfu_columns_item_required"==T.options[u].className&&-1==S.indexOf(q)){var H="custom"==q?"+-"+(""==r[2]?"s":r[2]):""!=r[2]?"-+"+r[2]:"",O=r[3];"custom"==q&&(q="custom1");var L=document.createElement("OPTION");L.value=q+":"+H+"/"+T.options[u].innerHTML+"/"+O,L.innerHTML=T.options[u].innerHTML+(""!=O&&O!=T.options[u].innerHTML?" ("+O+")":""),L.className=T.options[u].className,L.onclick=T.options[u].onclick,A.appendChild(L)}}for(var C=a.split(","),u=0;u<C.length;u++){var M=C[u].split("/",2),q=M[0],j="";M.length>1&&(j=M[1]),M=q.split(":",2),q=M[0];for(var D=q.replace(/custom[0-9]+$/,"custom"),P=-1,y=0;y<T.options.length;y++){var V=T.options[y].value.replace(/:.*/,"");if(V==D){P=y;break}}for(var R=!1,y=0;y<A.options.length;y++){var F=A.options[y].value.replace(/:.*/,"");if(F==q){R=!0;break}}if("custom"!=q&&P>-1&&!R){var r=T.options[P].value.match(/(.*?):(.*?)\/(.*)/),U="custom"==D||""!=r[2],H=r[2],Q=T.options[P].innerHTML,O=r[3],G="";G=1==M.length?"custom"==D?"+-s":U?"-+"+H:"":"custom"==D?"+"+(""==M[1]?"-s":"+"+M[1]):U?"-"+(""==M[1]?"-":"+")+H:"",""==j&&(j=O);var L=document.createElement("OPTION");L.value=q+":"+G+"/"+Q+"/"+j,L.innerHTML=Q+(O!=Q?" ("+O+")":""),L.className=T.options[P].className,L.onclick=T.options[u].onclick,A.appendChild(L)}}wfu_update_column_props(e),wfu_update_columns(e)}else if("dimensions"==t){for(var X,$,W,l,z=a.split(","),J=document.getElementsByName("wfu_dimension_elements_"+e),u=0;u<J.length;u++)J[u].value="";for(var u=0;u<z.length;u++)X=z[u].split(":",2),$=X.length<1?"":X[0],W=X.length<2?$:X[1],l=document.getElementById("wfu_attribute_"+e+"_"+$.trim()),l&&(l.value=W.trim());l=J[0],wfu_update_dimension_value({target:l})}else if("userfields"==t){for(var K,Z=a.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]"),Y=Array(),u=0;u<Z.length;u++)K="*"==Z[u].substr(0,1),K&&(Z[u]=Z[u].substr(1)),""!=Z[u]&&Y.push({name:Z[u],required:K});for(var ee=document.getElementById("wfu_attribute_"+e),te=null,ae=Array(),u=0;u<ee.childNodes.length;u++)1===ee.childNodes[u].nodeType&&(null==te?te=ee.childNodes[u]:ae.push(ee.childNodes[u]));for(var u=0;u<ae.length;u++)ee.removeChild(ae[u]);wfu_userdata_edit_field(te,"",!1);for(var le,ne=te,u=0;u<Y.length;u++)0==u?wfu_userdata_edit_field(te,Y[u].name,Y[u].required):(le=ne.cloneNode(!0),wfu_userdata_edit_field(le,Y[u].name,Y[u].required),ee.insertBefore(le,ne.nextSibling),ne=le);for(var l,u=0;u<te.childNodes.length&&(l=te.childNodes[u],"INPUT"!=l.tagName);u++);wfu_update_userfield_value({target:l})}else if("formfields"==t){for(var Y=Array(),de=window["wfu_attribute_"+e+"_typeprops"],ue=de[0].split(","),re={},u=0;u<ue.length;u++){var oe=de[ue[u]],_e={};_e.type=ue[u],_e.label="",_e.labelposition=oe.labelposition.substr(5),_e.required="true"==oe.required.substr(5),_e.donotautocomplete="true"==oe.donotautocomplete.substr(5),_e.validate="true"==oe.validate.substr(5),_e.typehook="true"==oe.typehook.substr(5),_e.hintposition=oe.hintposition.substr(5),_e["default"]=oe["default"].substr(5),_e.data=oe.data.substr(5),_e.group=oe.group.substr(5),_e.format=oe.format.substr(5),re[ue[u]]=_e}for(var Z=a.replace(/\//g,"[/]").replace(/\(.*\)/,function(e){return e.replace(/\[\/\]/g,"/")}).split("[/]"),u=0;u<Z.length;u++){var se=Z[u].trim(),ie={};for(prop in re.text)ie[prop]=re.text[prop];"*"==se.substr(0,1)&&(ie.required=!0,se=se.substr(1));var ce=se.split("|");if(""!=ce[0].trim()){for(var fe=-1,me="",y=0;y<ce.length;y++){var pe=ce[y].replace(/^\s+/gm,""),we=pe.substr(0,2),W=pe.substr(2);if("t:"==we&&y>0&&ue.indexOf(W)>-1){me=W,fe=y;break}}if(""!=me){for(prop in re[me])ie[prop]=re[me][prop];ce.splice(fe,1)}ie.label=ce[0].trim(),ce.splice(0,1);for(var y=0;y<ce.length;y++){var pe=ce[y].replace(/^\s+/gm,""),we=pe.substr(0,2),W=pe.substr(2);"s:"==we?ie.labelposition=W:"r:"==we?ie.required="1"==W:"a:"==we?ie.donotautocomplete="1"==W:"v:"==we?ie.validate="1"==W:"d:"==we?ie["default"]=W:"l:"==we?ie.data=W:"g:"==we?ie.group=W:"f:"==we?ie.format=W:"p:"==we?ie.hintposition=W:"h:"==we&&(ie.typehook="1"==W)}Y.push(ie)}}0==Y.length&&Y.push(fieldprops_default);for(var ee=document.getElementById("wfu_attribute_"+e),ge=document.querySelectorAll("div#wfu_attribute_"+e+" .wfu_formdata_line_container"),u=1;u<ge.length;u++)ee.removeChild(ge[u]);for(var ve=ge[0],u=0;u<Y.length;u++){var be=e+"_"+wfu_randomString(4),he=wfu_formdata_prepare_template(e,Y[u],be);u>0&&(ve=document.createElement("DIV")),ve.id="wfu_formfield_"+be+"_container",ve.className="wfu_formdata_line_container",u>0&&ee.insertBefore(ve,null),ve.innerHTML=he,wfu_formdata_update_buttons(be)}for(var ye=document.querySelectorAll("div#wfu_attribute_"+e+' input[name="wfu_formfield_elements"]'),u=0;u<ye.length;u++)wfu_attach_element_handlers(ye[u],wfu_update_formfield_value);wfu_update_formfield_value({target:ge[0]})}else if("color-triplet"==t){for(var Ie=a.split(","),u=0;u<Ie.length;u++)Ie[u]=Ie[u].trim();2==Ie.length?Ie=[Ie[0],Ie[1],"#000000"]:1==Ie.length?Ie=[Ie[0],"#FFFFFF","#000000"]:Ie.length<3&&(Ie=["#000000","#FFFFFF","#000000"]);var n=colourNameToHex(Ie[0]);n||(n=Ie[0]),jQuery("#wfu_attribute_"+e+"_color").wpColorPicker("color",n);var l=document.getElementById("wfu_attribute_"+e+"_color");l.value=Ie[0],n=colourNameToHex(Ie[1]),n||(n=Ie[1]),jQuery("#wfu_attribute_"+e+"_bgcolor").wpColorPicker("color",n),document.getElementById("wfu_attribute_"+e+"_bgcolor").value=Ie[1],n=colourNameToHex(Ie[2]),n||(n=Ie[2]),jQuery("#wfu_attribute_"+e+"_borcolor").wpColorPicker("color",n),document.getElementById("wfu_attribute_"+e+"_borcolor").value=Ie[2],wfu_update_triplecolor_value({target:l})}else if("folderlist"==t){for(var c=wfu_parse_folderlist_js(a),Ee=document.getElementById("wfu_attribute_"+e).options;Ee.length>0;)Ee.remove(0);for(var L,Be,ke,xe,Ne,Te,u=0;u<c.path.length;u++){Be=c.path[u],"/"==Be.substr(Be.length,1)&&(Be=Be.substr(0,Be.length-1)),ke=Be.split("/"),Be=ke[ke.length-1],Ne=parseInt(c.level[u]),xe="",Te="";for(var y=0;Ne>y;y++)xe+=" ",Te+="*";xe+=c.label[u],c["default"][u]&&(Te+="&"),Te+=""==Be?"{root}/"+c.label[u]:Be+c.label[u],L=document.createElement("option"),c["default"][u]?L.className="wfu_select_folders_option_default":L.className="",L.value=wfu_plugin_encode_string(Te),L.innerHTML=xe,Ee.add(L)}L=document.createElement("option"),L.value="",L.innerHTML="",Ee.add(L);var Ae=document.getElementById("wfu_attribute_"+e);Ae.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),l=Ae,a!==l.oldVal&&(l.oldVal=a,document.getElementById("wfu_attribute_value_"+e).value=a,wfu_generate_shortcode())}}function wfu_parse_folderlist_js(e){var t=Object();if(t.path=Array(),t.label=Array(),t.level=Array(),t["default"]=Array(),"auto"==e.substr(0,4))return t;var a=e.split(",");if(0==a.length)return t;if(1==a.length&&""==a[0].trim())return t;for(var l,n,d,u,r,o,_,s=["root"],i=0,c=0,f=-1,m=0;m<a.length;m++){for(l=a[m].trim(),n=0,d="",u=!1;n<l.length&&"*"==l.substr(n,1);)n++,d+=" ";if(1>=n-i&&(n>0||0==c)&&(l=l.substr(n,l.length-n),"&"==l.substr(0,1)&&(l=l.substr(1),u=!0),subfolder_items=l.split("/"),subfolder_items.length<2&&subfolder_items.push(""),""!=subfolder_items[1]?(r=subfolder_items[0],o=subfolder_items[1]):(r=l,o=l),""!=r)){u&&-1==f?f=t.path.length:u=!1,0==n&&(c=1),s.length>n?s[n]=r:s.push(r),_="";for(var p=1;n>=p;p++)_+=s[p]+"/";t.path.push(_),t.label.push(o),t.level.push(n),t["default"].push(u),i=n}}return t}function colourNameToHex(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!=typeof t[e.toLowerCase()]?t[e.toLowerCase()]:!1}function wfu_download_file(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_invoker",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="nonce",params[2][1]=a;for(var d="",u=0;u<params.length;u++)d+=(u>0?"&":"")+params[u][0]+"="+encodeURI(params[u][1]);l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var a="wfu_ajax_action_download_file_invoker:",n=l.responseText.indexOf(a);-1==n&&(n=l.responseText.length);var d=(l.responseText.substr(0,n),l.responseText.substr(n+a.length,l.responseText.length-n-a.length));n=d.indexOf(":");var u=d.substr(0,n);if(txt_value=d.substr(n+1,d.length-n-1),"wfu_download_id;"==u.substr(0,16)){var r=u.substr(16),o=document.getElementById("wfu_file_download_container_"+t);o.innerHTML=txt_value,setTimeout("wfu_download_file_monitor('"+e+"', "+t+", '"+r+"')",100)}}},l.send(d)}}function wfu_download_file_monitor(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_monitor",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="id",params[2][1]=a;for(var d="",u=0;u<params.length;u++)d+=(u>0?"&":"")+params[u][0]+"="+encodeURI(params[u][1]);l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var a="wfu_ajax_action_download_file_monitor:",n=l.responseText.indexOf(a);-1==n&&(n=l.responseText.length);var d=(l.responseText.substr(0,n),l.responseText.substr(n+a.length,l.responseText.length-n-a.length));n=d.indexOf(":");var u=d.substr(0,n);if(txt_value=d.substr(n+1,d.length-n-1),"repeat"!=u){var r=document.getElementById("wfu_file_download_container_"+t);r.innerHTML=""}else"repeat"==u&&setTimeout("wfu_download_file_monitor('"+e+"', "+t+", '"+txt_value+"')",100)}},l.send(d)}}function wfu_filedetails_changed(e){for(var t,a,l=document.getElementsByName("wfu_filedetails_userdata"),n=!1,d=!1,u=0;u<l.length;u++)if(t=document.getElementById(l[u].id.replace("wfu_filedetails_userdata_value_","wfu_filedetails_userdata_default_")),a=document.getElementById(l[u].id.replace("wfu_filedetails_userdata_value_","wfu_filedetails_userdata_")),a.value=l[u].value,l[u].value!=t.value){n=!0;break}d=document.getElementById("wfu_filedetails_userid").value!=document.getElementById("wfu_filedetails_userid_default").value,document.getElementById("dp_filedetails_submit_fields").disabled=!n&&!d}function wfu_Attach_FileDetails_Admin_Events(){for(var e=document.getElementsByName("wfu_filedetails_userdata"),t=0;t<e.length;t++)wfu_attach_element_handlers(e[t],wfu_filedetails_changed)}function wfu_update_browserpermission_option(e,t,a){var l=document.getElementById("wfu_fbperm_users"),n=document.getElementById("wfu_fbperm_roles"),d=document.getElementById("wfu_fbperm_"+e+"_"+t+"_view"),u=document.getElementById("wfu_fbperm_"+e+"_"+t+"_dl"),r=document.getElementById("wfu_fbperm_"+e+"_"+t+"_edit"),o=document.getElementById("wfu_fbperm_"+e+"_"+t+"_del");if("role"==e){if("0"==t){u.checked=d.checked&&u.checked,r.checked=d.checked&&r.checked,o.checked=d.checked&&o.checked,u.disabled=!d.checked,r.disabled=!d.checked,o.disabled=!d.checked;for(var _=document.querySelectorAll("tr.wfu_fbperm_role_tr"),s=0;s<_.length;s++){var i=_[s].id.substr(16,_[s].id.length-20);wfu_update_browserpermission_option("role",i,!1)}if(a){var c=(d.checked?"v":"")+(u.checked?"d":"")+(r.checked?"e":"")+(o.checked?"l":"");n.value=n.value.replace(/^0\[\w*\]/,"0["+c+"]")}}else if("administrator"!=t){var f=document.getElementById("wfu_fbperm_role_"+t+"_row"),m=document.getElementById("wfu_fbperm_role_"+t+"_def"),p=document.getElementById("wfu_fbperm_role_0_view"),w=document.getElementById("wfu_fbperm_role_0_dl"),g=document.getElementById("wfu_fbperm_role_0_edit"),v=document.getElementById("wfu_fbperm_role_0_del");if(d.checked=m.checked?p.checked:d.checked,f.style.fontWeight=m.checked?"":"bold",u.checked=m.checked?w.checked:d.checked&&u.checked,r.checked=m.checked?g.checked:d.checked&&r.checked,o.checked=m.checked?v.checked:d.checked&&o.checked,d.disabled=m.checked,u.disabled=m.checked||!d.checked,r.disabled=m.checked||!d.checked,o.disabled=m.checked||!d.checked,a){var c=m.checked?"":"D"+(d.checked?"v":"")+(u.checked?"d":"")+(r.checked?"e":"")+(o.checked?"l":"");n.value=n.value.replace(new RegExp(","+t+"\\[\\w*\\]"),","+t+"["+c+"]")}}for(var b=document.querySelectorAll("tr.wfu_fbperm_user_tr"),s=0;s<b.length;s++){var h=b[s].id.substr(16,b[s].id.length-20);wfu_update_browserpermission_option("user",h,!1)}}else if("user"==e){var y=document.getElementById("wfu_fbperm_user_"+t+"_role");if("0"==t){d.checked=y.checked?!1:d.checked,u.checked=y.checked?!1:d.checked&&u.checked,r.checked=y.checked?!1:d.checked&&r.checked,o.checked=y.checked?!1:d.checked&&o.checked,d.disabled=y.checked,u.disabled=y.checked||!d.checked,r.disabled=y.checked||!d.checked,o.disabled=y.checked||!d.checked,d.indeterminate=y.checked,u.indeterminate=y.checked,r.indeterminate=y.checked,o.indeterminate=y.checked;for(var b=document.querySelectorAll("tr.wfu_fbperm_user_tr"),s=0;s<b.length;s++){var h=b[s].id.substr(16,b[s].id.length-20);wfu_update_browserpermission_option("user",h,!1)}if(a){var c=y.checked?"":"R"+(d.checked?"v":"")+(u.checked?"d":"")+(r.checked?"e":"")+(o.checked?"l":"");l.value=l.value.replace(/^0\[\w*\],?/,""),l.value="0["+c+"]"+(""==l.value?"":","+l.value)}}else{var I=document.getElementById("wfu_fbperm_user_"+t+"_roles").value.split(",");if(1==I.length&&""==I[0]&&(I=Array()),I.indexOf("administrator")<0){var f=document.getElementById("wfu_fbperm_user_"+t+"_row"),m=document.getElementById("wfu_fbperm_user_"+t+"_def"),E=document.getElementById("wfu_fbperm_user_0_role"),p=document.getElementById("wfu_fbperm_user_0_view"),w=document.getElementById("wfu_fbperm_user_0_dl"),g=document.getElementById("wfu_fbperm_user_0_edit"),v=document.getElementById("wfu_fbperm_user_0_del");if(I.length>0)for(var B=!1,k=!1,x=!1,N=!1,s=0;s<I.length;s++)B=B||document.getElementById("wfu_fbperm_role_"+I[s]+"_view").checked,k=B&&(k||document.getElementById("wfu_fbperm_role_"+I[s]+"_dl").checked),x=B&&(x||document.getElementById("wfu_fbperm_role_"+I[s]+"_edit").checked),N=B&&(N||document.getElementById("wfu_fbperm_role_"+I[s]+"_del").checked);else var B=document.getElementById("wfu_fbperm_role_0_view"),k=document.getElementById("wfu_fbperm_role_0_dl"),x=document.getElementById("wfu_fbperm_role_0_edit"),N=document.getElementById("wfu_fbperm_role_0_del");if(f.style.fontWeight=m.checked?"":"bold",y.checked=m.checked?E.checked:y.checked,d.checked=m.checked?E.checked?B:p.checked:y.checked?B:d.checked,u.checked=m.checked?E.checked?k:w.checked:y.checked?k:d.checked&&u.checked,r.checked=m.checked?E.checked?x:g.checked:y.checked?x:d.checked&&r.checked,o.checked=m.checked?E.checked?N:v.checked:y.checked?N:d.checked&&o.checked,y.disabled=m.checked,d.disabled=m.checked||y.checked,u.disabled=m.checked||y.checked||!d.checked,r.disabled=m.checked||y.checked||!d.checked,o.disabled=m.checked||y.checked||!d.checked,a){var c=m.checked?"":"D"+(y.checked?"":"R"+(d.checked?"v":"")+(u.checked?"d":"")+(r.checked?"e":"")+(o.checked?"l":""));l.value=l.value.replace(new RegExp(","+t+"\\[\\w*\\]|"+t+"\\[\\w*\\],|"+t+"\\[\\w*\\]"),""),l.value+=(""==l.value?"":",")+t+"["+c+"]"}}}}}function wfu_goto_historylog_page(e,t){var a=document.getElementById("wfu_historylog_pages"),l=a.selectedIndex+1,n=l;if("next"==t?n=Math.min(l+1,a.options.length):"prev"==t?n=Math.max(l-1,1):"last"==t?n=a.options.length:"first"==t?n=1:"sel"==t&&(l=-1),n!=l){var d=wfu_GetHttpRequestObject();if(null!=d){var u=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_get_historylog_page",params[1]=new Array(2),params[1][0]="token",params[1][1]=e,params[2]=new Array(2),params[2][0]="page",params[2][1]=n;for(var r="",o=0;o<params.length;o++)r+=(o>0?"&":"")+params[o][0]+"="+encodeURI(params[o][1]);document.getElementById("wfu_historylog_overlay").style.display="block",d.open("POST",u,!0),d.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d.onreadystatechange=function(){if(4==d.readyState&&200==d.status){document.getElementById("wfu_historylog_overlay").style.display="none";var e="wfu_historylog_page_success:",t=d.responseText.indexOf(e);-1==t&&(t=d.responseText.length);var l=(d.responseText.substr(0,t),d.responseText.substr(t+e.length,d.responseText.length-t-e.length));if(""!=l){var u=document.getElementById("wfu_historylog_table");u.tBodies[0].innerHTML=wfu_plugin_decode_string(l),a.selectedIndex=n-1,document.getElementById("wfu_historylog_first_disabled").style.display=1==n?"inline":"none",document.getElementById("wfu_historylog_prev_disabled").style.display=1==n?"inline":"none",document.getElementById("wfu_historylog_first").style.display=1==n?"none":"inline",document.getElementById("wfu_historylog_prev").style.display=1==n?"none":"inline",document.getElementById("wfu_historylog_last_disabled").style.display=n==a.options.length?"inline":"none",document.getElementById("wfu_historylog_next_disabled").style.display=n==a.options.length?"inline":"none",document.getElementById("wfu_historylog_last").style.display=n==a.options.length?"none":"inline",document.getElementById("wfu_historylog_next").style.display=n==a.options.length?"none":"inline"}}},d.send(r)}}}function wfu_include_file(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(2),params[0]=new Array(3),params[0][0]="action",params[0][1]="wfu_ajax_action_include_file",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="nonce",params[2][1]=a;for(var d="",u=0;u<params.length;u++)d+=(u>0?"&":"")+params[u][0]+"="+encodeURI(params[u][1]);document.getElementById("wfu_include_file_"+t+"_a").href="javascript: void(0)",document.getElementById("wfu_include_file_"+t+"_img").style.display="inline",l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&(document.getElementById("wfu_include_file_"+t+"_img").style.display="none",200==l.status)){var e="wfu_include_file:",a=l.responseText.indexOf(e);-1==a&&(a=l.responseText.length);var n=(l.responseText.substr(0,a),l.responseText.substr(a+e.length,l.responseText.length-a-e.length));a=n.indexOf(":");var d=n.substr(0,a);txt_value=n.substr(a+1,n.length-a-1),"success"==d?(document.getElementById("wfu_file_flat_"+t).style.display="none",document.getElementById("wfu_file_link_"+t).style.display="inline",document.getElementById("wfu_file_can_be_included_actions_"+t).style.display="none",document.getElementById("wfu_file_is_included_actions_"+t).style.display="block"):document.getElementById("wfu_include_file_"+t+"_a").innerHTML=document.getElementById("wfu_include_file_"+t+"_inpfail").value}},l.send(d)}}function wfu_adminbrowser_select_all_visible_changed(){for(var e=document.getElementById("wfu_select_all_visible").checked,t=document.querySelectorAll(".wfu_selectors"),a=0;a<t.length;a++)t[a].checked=e}function wfu_adminbrowser_selector_changed(e){var t=document.querySelectorAll(".wfu_selectors").length,a=document.querySelectorAll(".wfu_selectors:checked").length,l=document.getElementById("wfu_select_all_visible");l.style.webkitAppearance="",l.style.webkitAppearance="checkbox",l.checked=a>0,l.indeterminate=a>0&&t>a}function wfu_apply_adminbrowser_bulkaction(){var e=document.getElementById("wfu_adminbrowser_bulkactions");if(!(e.selectedIndex<1)){var t=e.options[e.selectedIndex].value,a=document.querySelectorAll(".wfu_selectors:checked");if(0!=a.length){for(var l=[],n=0,d=0,u=0;u<a.length;u++){var r=a[u].className.replace(/.*?wfu_selcode_/,"");if(""!=r){var o=a[u].className.indexOf("wfu_included")>-1;o?n++:d++,"delete"==t&&!o||"include"==t&&o?a[u].checked=!1:l.push(r)}}if("delete"==t&&d>0?alert("Notice! Files that were not uploaded using the plugin cannot be deleted and have been deselected."):"include"==t&&n>0&&alert("Notice! Files already included in the plugin have been deselected."),0!=l.length){var _=document.getElementById("wfu_adminbrowser_action_url").value,s=document.getElementById("wfu_adminbrowser_referer").value;if("delete"==t||"include"==t){var i=document.createElement("FORM");i.method="POST",i.action=_,i.style.display="none";var c=document.createElement("INPUT");c.type="hidden",c.name="action",c.value=t+"_file",i.appendChild(c);var f=document.createElement("INPUT");f.type="hidden",f.name="file",f.value="list:"+l.join(),i.appendChild(f);var m=document.createElement("INPUT");m.type="hidden",m.name="referer",m.value=s,i.appendChild(m),document.body.appendChild(i),i.submit()}}}}}var DraggedItem=null,ShortcodeNextSave=0,ShortcodeTimeOut=null,ShortcodeString="",Autosave=!1,PageObsolete=!1,PageUpdating=!1,CheckObsolescenceTimeOut=5e3;jQuery(document).ready(function(e){e(".wfu_color_field").wpColorPicker({change:function(e,t){e.target.value=t.color.toString(),"wfu_text_elements"==e.target.name?wfu_update_text_value(e):"wfu_triplecolor_elements"==e.target.name&&wfu_update_triplecolor_value(e)}})});
|
lib/wfu_admin_composer.php
CHANGED
@@ -56,6 +56,9 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
56 |
foreach ( $defs as $key => $def ) {
|
57 |
$attr = $def['attribute'];
|
58 |
$defs[$key]['default'] = $def['value'];
|
|
|
|
|
|
|
59 |
if ( array_key_exists($attr, $shortcode_attrs) ) $defs[$key]['value'] = $shortcode_attrs[$attr];
|
60 |
$subblock_active = false;
|
61 |
//detect if the dependencies of this attribute will be disabled or not
|
@@ -722,6 +725,18 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
722 |
$echo_str .= $dlp."\t\t".'</div>';
|
723 |
}
|
724 |
elseif ( $def['type'] == "formfields" ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
725 |
//get field type definitions
|
726 |
$fielddefs_array = $def['listitems'];
|
727 |
foreach ( $fielddefs_array as $fielddef ) $fielddefs[$fielddef['type']] = $fielddef;
|
@@ -739,7 +754,9 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
739 |
foreach( $fielddefs as $item ) $template .= $dlp."\t\t\t\t\t".'<option value="'.$item['type'].'"[[type_'.$item['type'].'_selected]]>'.$item['type_description'].'</option>';
|
740 |
$template .= $dlp."\t\t\t\t".'</select></td><td>';
|
741 |
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_add" onclick="wfu_formdata_add_field(\'[[key]]\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_ADD.'" ></div>';
|
742 |
-
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_remove[[remove_disabled]]" onclick="wfu_formdata_remove_field(\'[[key]]\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_REMOVE.'" ></div
|
|
|
|
|
743 |
$template .= $dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label">Label</label></td><td><input type="text" id="wfu_formfield_[[key]]_label" name="wfu_formfield_elements" value="[[label]]" /></td><td></td></tr>';
|
744 |
$labelpos_options = "";
|
745 |
foreach ( $labelpositions as $pos ) $labelpos_options .= '<option value="'.$pos.'"[[labelposition_'.$pos.'_selected]]>'.$pos.'</option>';
|
@@ -758,6 +775,7 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
758 |
$template .= $dlp."\t\t\t\t".'</tbody></table>';
|
759 |
//draw html elements
|
760 |
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_formdata_container">';
|
|
|
761 |
$echo_str .= $dlp."\t\t\t".'<div id="wfu_attribute_'.$attr.'_codeadd" style="display:none;">';
|
762 |
//pass template and type props to client javascript variable and then erase the code
|
763 |
$echo_str .= $dlp."\t\t\t\t".'<script type="text/javascript">';
|
@@ -779,6 +797,7 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
779 |
$echo_str .= $dlp."\t\t\t\t\t".'var self = document.getElementById("wfu_attribute_'.$attr.'_codeadd"); self.parentNode.removeChild(self);';
|
780 |
$echo_str .= $dlp."\t\t\t\t".'</script>';
|
781 |
$echo_str .= $dlp."\t\t\t".'</div>';
|
|
|
782 |
foreach ( $fields as $field ) {
|
783 |
$ind = wfu_create_random_string(4);
|
784 |
$key = $attr."_".$ind;
|
@@ -791,6 +810,8 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
791 |
foreach( $labelpositions as $pos ) $from_template = str_replace('[[labelposition_'.$pos.'_selected]]', ( $pos == $field['labelposition'] ? ' selected = "selected"' : '' ), $from_template);
|
792 |
foreach( $hintpositions as $pos ) $from_template = str_replace('[[hintposition_'.$pos.'_selected]]', ( $pos == $field['hintposition'] ? ' selected = "selected"' : '' ), $from_template);
|
793 |
$from_template = str_replace('[[remove_disabled]]', ( count($fields) <= 1 ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
|
|
|
|
794 |
//adjust checkbox field values
|
795 |
$from_template = preg_replace('/\[\[r\-\>\]\]'.( $field['required'] ? '|' : '.*' ).'\[\[\<\-r\]\]/', '', $from_template);
|
796 |
$from_template = preg_replace('/\[\[a\-\>\]\]'.( $field['donotautocomplete'] ? '|' : '.*' ).'\[\[\<\-a\]\]/', '', $from_template);
|
@@ -808,6 +829,7 @@ function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upl
|
|
808 |
$from_template = preg_replace('/\[\[F\-\>\]\]'.( substr($fielddef["format"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-F\]\]/s', '', $from_template);
|
809 |
$echo_str .= $from_template;
|
810 |
$echo_str .= $dlp."\t\t\t".'</div>';
|
|
|
811 |
}
|
812 |
$echo_str .= $dlp."\t\t".'</div>';
|
813 |
}
|
56 |
foreach ( $defs as $key => $def ) {
|
57 |
$attr = $def['attribute'];
|
58 |
$defs[$key]['default'] = $def['value'];
|
59 |
+
//'flat' property keeps the original attribute, because 'attribute'
|
60 |
+
//property will change for defs that their occurrence is higher than 1
|
61 |
+
$defs[$key]['flat'] = $attr;
|
62 |
if ( array_key_exists($attr, $shortcode_attrs) ) $defs[$key]['value'] = $shortcode_attrs[$attr];
|
63 |
$subblock_active = false;
|
64 |
//detect if the dependencies of this attribute will be disabled or not
|
725 |
$echo_str .= $dlp."\t\t".'</div>';
|
726 |
}
|
727 |
elseif ( $def['type'] == "formfields" ) {
|
728 |
+
//find occurrence index of this attribute and total occrrence length
|
729 |
+
$flat = $def['flat'];
|
730 |
+
$attr_occur_index = 0;
|
731 |
+
$attr_occur_length = 0;
|
732 |
+
$all_attributes = array();
|
733 |
+
foreach ( $defs as $def2 ) {
|
734 |
+
if ( $def2['flat'] == $flat ) {
|
735 |
+
$attr_occur_length ++;
|
736 |
+
array_push($all_attributes, $def2['attribute']);
|
737 |
+
if ( $def2['attribute'] == $attr ) $attr_occur_index = $attr_occur_length;
|
738 |
+
}
|
739 |
+
}
|
740 |
//get field type definitions
|
741 |
$fielddefs_array = $def['listitems'];
|
742 |
foreach ( $fielddefs_array as $fielddef ) $fielddefs[$fielddef['type']] = $fielddef;
|
754 |
foreach( $fielddefs as $item ) $template .= $dlp."\t\t\t\t\t".'<option value="'.$item['type'].'"[[type_'.$item['type'].'_selected]]>'.$item['type_description'].'</option>';
|
755 |
$template .= $dlp."\t\t\t\t".'</select></td><td>';
|
756 |
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_add" onclick="wfu_formdata_add_field(\'[[key]]\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_ADD.'" ></div>';
|
757 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_remove[[remove_disabled]]" onclick="wfu_formdata_remove_field(\'[[key]]\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_REMOVE.'" ></div>';
|
758 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_up[[up_disabled]]" onclick="wfu_formdata_move_field(\'[[key]]\', \'up\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_UP.'" ></div>';
|
759 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_down[[down_disabled]]" onclick="wfu_formdata_move_field(\'[[key]]\', \'down\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_DOWN.'" ></div></td></tr>';
|
760 |
$template .= $dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label">Label</label></td><td><input type="text" id="wfu_formfield_[[key]]_label" name="wfu_formfield_elements" value="[[label]]" /></td><td></td></tr>';
|
761 |
$labelpos_options = "";
|
762 |
foreach ( $labelpositions as $pos ) $labelpos_options .= '<option value="'.$pos.'"[[labelposition_'.$pos.'_selected]]>'.$pos.'</option>';
|
775 |
$template .= $dlp."\t\t\t\t".'</tbody></table>';
|
776 |
//draw html elements
|
777 |
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_formdata_container">';
|
778 |
+
$echo_str .= $dlp."\t\t\t".'<input type="hidden" class="wfu_formdata_all_attributes" value="'.implode(",", $all_attributes).'" />';
|
779 |
$echo_str .= $dlp."\t\t\t".'<div id="wfu_attribute_'.$attr.'_codeadd" style="display:none;">';
|
780 |
//pass template and type props to client javascript variable and then erase the code
|
781 |
$echo_str .= $dlp."\t\t\t\t".'<script type="text/javascript">';
|
797 |
$echo_str .= $dlp."\t\t\t\t\t".'var self = document.getElementById("wfu_attribute_'.$attr.'_codeadd"); self.parentNode.removeChild(self);';
|
798 |
$echo_str .= $dlp."\t\t\t\t".'</script>';
|
799 |
$echo_str .= $dlp."\t\t\t".'</div>';
|
800 |
+
$i = 1;
|
801 |
foreach ( $fields as $field ) {
|
802 |
$ind = wfu_create_random_string(4);
|
803 |
$key = $attr."_".$ind;
|
810 |
foreach( $labelpositions as $pos ) $from_template = str_replace('[[labelposition_'.$pos.'_selected]]', ( $pos == $field['labelposition'] ? ' selected = "selected"' : '' ), $from_template);
|
811 |
foreach( $hintpositions as $pos ) $from_template = str_replace('[[hintposition_'.$pos.'_selected]]', ( $pos == $field['hintposition'] ? ' selected = "selected"' : '' ), $from_template);
|
812 |
$from_template = str_replace('[[remove_disabled]]', ( count($fields) <= 1 ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
813 |
+
$from_template = str_replace('[[up_disabled]]', ( ( $attr_occur_index == 1 && $i == 1 ) ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
814 |
+
$from_template = str_replace('[[down_disabled]]', ( ( $attr_occur_index == $attr_occur_length && $i == count($fields) ) ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
815 |
//adjust checkbox field values
|
816 |
$from_template = preg_replace('/\[\[r\-\>\]\]'.( $field['required'] ? '|' : '.*' ).'\[\[\<\-r\]\]/', '', $from_template);
|
817 |
$from_template = preg_replace('/\[\[a\-\>\]\]'.( $field['donotautocomplete'] ? '|' : '.*' ).'\[\[\<\-a\]\]/', '', $from_template);
|
829 |
$from_template = preg_replace('/\[\[F\-\>\]\]'.( substr($fielddef["format"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-F\]\]/s', '', $from_template);
|
830 |
$echo_str .= $from_template;
|
831 |
$echo_str .= $dlp."\t\t\t".'</div>';
|
832 |
+
$i++;
|
833 |
}
|
834 |
$echo_str .= $dlp."\t\t".'</div>';
|
835 |
}
|
lib/wfu_constants.php
CHANGED
@@ -333,6 +333,8 @@ DEFINE("WFU_IMAGE_ADMIN_HELP", $siteurl.WPFILEUPLOAD_DIR.'images/help_16.png');
|
|
333 |
DEFINE("WFU_IMAGE_ADMIN_RESTOREDEFAULT", $siteurl.WPFILEUPLOAD_DIR.'images/restore_16.png');
|
334 |
DEFINE("WFU_IMAGE_ADMIN_USERDATA_ADD", $siteurl.WPFILEUPLOAD_DIR.'images/add_12.png');
|
335 |
DEFINE("WFU_IMAGE_ADMIN_USERDATA_REMOVE", $siteurl.WPFILEUPLOAD_DIR.'images/remove_12.png');
|
|
|
|
|
336 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_BROWSE", $siteurl.WPFILEUPLOAD_DIR.'images/tree_16.gif');
|
337 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_OK", $siteurl.WPFILEUPLOAD_DIR.'images/ok_12.gif');
|
338 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL", $siteurl.WPFILEUPLOAD_DIR.'images/cancel_12.gif');
|
333 |
DEFINE("WFU_IMAGE_ADMIN_RESTOREDEFAULT", $siteurl.WPFILEUPLOAD_DIR.'images/restore_16.png');
|
334 |
DEFINE("WFU_IMAGE_ADMIN_USERDATA_ADD", $siteurl.WPFILEUPLOAD_DIR.'images/add_12.png');
|
335 |
DEFINE("WFU_IMAGE_ADMIN_USERDATA_REMOVE", $siteurl.WPFILEUPLOAD_DIR.'images/remove_12.png');
|
336 |
+
DEFINE("WFU_IMAGE_ADMIN_USERDATA_UP", $siteurl.WPFILEUPLOAD_DIR.'images/up_12.png');
|
337 |
+
DEFINE("WFU_IMAGE_ADMIN_USERDATA_DOWN", $siteurl.WPFILEUPLOAD_DIR.'images/down_12.png');
|
338 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_BROWSE", $siteurl.WPFILEUPLOAD_DIR.'images/tree_16.gif');
|
339 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_OK", $siteurl.WPFILEUPLOAD_DIR.'images/ok_12.gif');
|
340 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL", $siteurl.WPFILEUPLOAD_DIR.'images/cancel_12.gif');
|
readme.txt
CHANGED
@@ -139,6 +139,10 @@ There is an option in plugin's settings in Dashboard to relax the CSS rules, so
|
|
139 |
|
140 |
== Changelog ==
|
141 |
|
|
|
|
|
|
|
|
|
142 |
= 3.9.5 =
|
143 |
* added environment variable 'Upload Progress Mode' that defines how upload progress is calculated
|
144 |
* improved progress bar calculation
|
@@ -635,6 +639,12 @@ Initial version.
|
|
635 |
|
636 |
== Upgrade Notice ==
|
637 |
|
|
|
|
|
|
|
|
|
|
|
|
|
638 |
= 3.9.4 =
|
639 |
Update to introduce some new features and fix some bugs.
|
640 |
|
139 |
|
140 |
== Changelog ==
|
141 |
|
142 |
+
= 3.9.6 =
|
143 |
+
* added internal filter _wfu_file_upload_output before echoing uploader shortcode html
|
144 |
+
* added ability to change the order of additional user fields in shortcode visual editor
|
145 |
+
|
146 |
= 3.9.5 =
|
147 |
* added environment variable 'Upload Progress Mode' that defines how upload progress is calculated
|
148 |
* improved progress bar calculation
|
639 |
|
640 |
== Upgrade Notice ==
|
641 |
|
642 |
+
= 3.9.6 =
|
643 |
+
Update to introduce some new features.
|
644 |
+
|
645 |
+
= 3.9.5 =
|
646 |
+
Update to introduce some new features and fix some minor bugs.
|
647 |
+
|
648 |
= 3.9.4 =
|
649 |
Update to introduce some new features and fix some bugs.
|
650 |
|
release_notes.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<!-- --><span><strong>Latest release notes: </strong>This is a regular release that introduces
|
2 |
|
3 |
For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</span>
|
1 |
+
<!-- --><span><strong>Latest release notes: </strong>This is a regular release that introduces a new feature in the shortcode visual editor after user requests. When editing <strong>additional user fields</strong>, users are able to </span><span style="text-decoration: underline;">change the order</span><span> of the fields by moving them up or down. Some additional improvements are included in the Professional version of the plugin.</span><!-- --><!-- --><br /><br /><span>
|
2 |
|
3 |
For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</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.9.
|
8 |
Author: Nickolas Bossinas
|
9 |
Author URI: http://www.iptanus.com
|
10 |
*/
|
@@ -348,6 +348,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
348 |
if ( !isset($_SESSION['wfu_check_refresh_'.$sid]) || $_SESSION['wfu_check_refresh_'.$sid] != "form button pressed" ) {
|
349 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
350 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
|
|
351 |
return $wordpress_file_upload_output."\n";
|
352 |
}
|
353 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
@@ -363,6 +364,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
363 |
|
364 |
if ( $params['forceclassic'] != "true" ) {
|
365 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
|
|
366 |
return $wordpress_file_upload_output."\n";
|
367 |
}
|
368 |
|
@@ -406,6 +408,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
406 |
}
|
407 |
|
408 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
|
|
409 |
return $wordpress_file_upload_output."\n";
|
410 |
}
|
411 |
|
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.9.6
|
8 |
Author: Nickolas Bossinas
|
9 |
Author URI: http://www.iptanus.com
|
10 |
*/
|
348 |
if ( !isset($_SESSION['wfu_check_refresh_'.$sid]) || $_SESSION['wfu_check_refresh_'.$sid] != "form button pressed" ) {
|
349 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
350 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
351 |
+
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output);
|
352 |
return $wordpress_file_upload_output."\n";
|
353 |
}
|
354 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
364 |
|
365 |
if ( $params['forceclassic'] != "true" ) {
|
366 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
367 |
+
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output);
|
368 |
return $wordpress_file_upload_output."\n";
|
369 |
}
|
370 |
|
408 |
}
|
409 |
|
410 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
411 |
+
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output);
|
412 |
return $wordpress_file_upload_output."\n";
|
413 |
}
|
414 |
|