Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove EIP

  • Loading branch information...
commit 9667225100fbca4ebba012c2aa4f16c8ae5bae93 1 parent c0b1be3
@hunk authored
View
10 Main.php
@@ -133,16 +133,6 @@
}
}
-require_once ('RCCWP_EditnPlace.php');
-require_once ('RCCWP_Options.php');
-
-// Adding javascript for the editnplace only if it is turned on
-$customWritePanelOptions = RCCWP_Options::Get();
-if( isset($customWritePanelOptions['enable-editnplace']) ) {
- add_action('wp_head', array('RCCWP_EditnPlace', 'EditnHeader'));
- add_action('template_redirect',array('RCCWP_EditnPlace','EditnPlaceJavascript'));
-}
-
require_once ('RCCWP_Query.php');
add_action('pre_get_posts', array('RCCWP_Query', 'FilterPrepare'));
add_filter('posts_where', array('RCCWP_Query', 'FilterCustomPostsWhere'));
View
153 RCCWP_Application.php
@@ -56,8 +56,6 @@ function Install(){
$options['prompt-editing-post'] = 0;
$options['assign-to-role'] = 0;
$options['default-custom-write-panel'] = "";
- $options['enable-editnplace'] = 1;
- $options['eip-highlight-color'] = "#FFFFCC";
RCCWP_Options::Update($options);
}
@@ -429,157 +427,6 @@ function CheckInstallation(){
echo "<div id='magic-fields-install-error-message-2' class='error'><p><strong>".__('Magic Fields is not ready yet.', $mf_domain)."</strong> ".__('The following folders must be writable (usually chmod 777 is neccesary):', $mf_domain)."</p><ul>";
echo $dir_list;
echo "</ul></div>";
- }
-
- if (empty($dir_list) && empty($dir_list2)){
- /* the directory exists and is writable
- * we can create the css and js files for the EIP feature
- */
- $EnPCSS = RCCWP_Application::create_EditnPlace_css();
- $EnPJS = RCCWP_Application::create_EditnPlace_js();
- if (!$EnPCSS || !$EnPJS) {
- echo "<div id='magic-fields-install-error-message-2' class='error'><p><strong>".__('There was an error creating the CSS file for edit in place, please check the permissions on the files_mf directory.', $mf_domain)."</strong> "."</p>";
- echo "</div>";
- }
- }
- }
-
- /**
- * This function create the EditInPlace.js file
- *
- * @param bool $created
- * @return bool true if the js file was successful created, false in the otherwise
- */
- function create_EditnPlace_js($create=FALSE) {
- $MF_URI = MF_URI;
- $enp_js[] = "var JS_MF_URI = '$MF_URI';";
- $editnplace_js_file = MF_FILES_PATH.'editnplacepath.js';
- if (!file_exists( $editnplace_js_file ) ) {
- $js_file_created = RCCWP_Application::save_editnplace_file( $editnplace_js_file, '', $enp_js, TRUE );
- } else {
- $js_file_created = RCCWP_Application::save_editnplace_file( $editnplace_js_file, '', $enp_js, $create );
- }
- return $js_file_created;
- }
-
- /**
- * Create The Edit In Place CSS file
- *
- * @return bool true if the css file was successful created
- */
- function create_EditnPlace_css($create=FALSE) {
- include_once('RCCWP_Options.php');
- $eip_highlight_color = RCCWP_Options::Get('eip-highlight-color');
- if(!$eip_highlight_color) $eip_highlight_color = '#FFFFFF';
- $MF_URI = MF_URI;
- $arrow_image_path = MF_URI."images/arrow.gif";
- $editnplace_css = "
-#savingDiv{
- font-size: medium;
- font-weight: bold;
-}
-
-.EIP_title:hover, .EIP_content:hover,
-.EIP_textbox:hover, .EIP_mulittextbox:hover {
- background-color: $eip_highlight_color
-}
-
-.EIPSaveCancel{
- padding: 5px;
- margin-top: -1px;
- z-index: 1000;
- border-color:#CCC;
- border-width:1px;
- border-style:solid;
- background-color:white;
- position:fixed;
- top:0px !important;
- width:100% !important;
- left: 0px !important;
- /*position:absolute;
- padding-top:2px;
- padding-bottom:2px;
- z-index: 1000;*/
-}
-
-.EIPSaveStatus{
- position:absolute;
- font-size: 14px;
- z-index: 1000;
-}
-
-.EIPnicPanelDiv{
- position: absolute;
- background-image: url($arrow_image_path);
- width:154px;
- height:38px;
- z-index: 1000;
- margin-top: -23px;
-}
-
-div.nicEdit-panel{
- background-color: white !important;
- width:140px !important;
-}
-
-div.nicEdit-panelContain{
- background-color: white !important;
- border-bottom: 0px !important;
- border-left: 0px !important;
- border-right: 0px !important;
- width: 92% !important;
- margin-left: 2px !important;
- margin-top: 1px !important;
-}
-
-.nicEdit-selected{
- /*background-color: #FFFFCC !important;*/
- border: thin inset !important;
- padding: 10px;
-}
-.nicEdit-button {
- background-color: white !important;
- border: 0px !important;
-}
-
-.FEIP_textbox {
- background-color: #CCC;
- height: 32px;
- width: 100%;
-}
-"
-;
- $editnplace_css_file = MF_UPLOAD_FILES_DIR.'editnplace.css';
- $css = explode( "\n", $editnplace_css );
- if (!file_exists( $editnplace_css_file ) ) {
- $css_file_created = RCCWP_Application::save_editnplace_file( $editnplace_css_file, 'EditnPlace css', $css, TRUE );
- } else {
- $css_file_created = RCCWP_Application::save_editnplace_file( $editnplace_css_file, 'EditnPlace css', $css, $create );
- }
- return $css_file_created;
- }
-
- /**
- * Save the edit inplace files in the MF_FILES folder
- *
- * @return bool
- */
- function save_editnplace_file( $filename, $comment, $data, $overwrite=FALSE ) {
- if (!file_exists( $filename ) || is_writeable( $filename ) ) {
- if ($overwrite) {
- if ( !$f = @fopen( $filename, 'w' ) )
- return false;
- if ($comment)
- fwrite( $f, "\n/* BEGIN {$comment} */\n" );
- foreach ( $data as $insertline )
- fwrite( $f, "{$insertline}\n" );
- if ($comment)
- fwrite( $f, "/* END {$comment} */\n" );
- fclose( $f );
- }
- return true;
- } else {
- return false;
}
}
View
49 RCCWP_EditnPlace.php
@@ -1,49 +0,0 @@
-<?php
-
-require_once "RCCWP_Constant.php";
-
-class RCCWP_EditnPlace {
- /**
- * This function load all the necessary scripts for the
- * editnplace feature
- */
- function EditnPlaceJavascript(){
- wp_enqueue_script( 'EditnPlace',
- MF_URI.'js/editnplace.js',
- array('jquery')
- );
- wp_enqueue_script( 'nicEdit',
- MF_URI.'js/nicEdit.js'
- );
-
- $editnplaceCSSFile = MF_UPLOAD_FILES_DIR.'editnplace.css';
- $editnplaceJSFile = MF_UPLOAD_FILES_DIR.'editnplacepath.js';
-
-
- //checking if the both files exists
- if(!file_exists($editnplaceCSSFile) || !file_exists($editnplaceJSFile)){
- return false;
- }
-
- wp_register_style('mf_editnplace',MF_FILES_URI.'editnplace.css');
- wp_enqueue_style('mf_editnplace');
- wp_enqueue_script('editnplacepath',MF_FILES_URI.'editnplacepath.js');
- }
-
- /**
- * This function load all the stylesheets for the EIP feature
- */
- function EditnHeader (){
- global $post;
-
- $MF_URI = MF_URI;
- if (current_user_can('edit_posts', $post->ID)){
-
- echo <<<EOD
- <script language="JavaScript" type="text/javascript" >
- var JS_MF_URI = '$MF_URI';
- </script>
-EOD;
- }
- }
-}
View
12 RCCWP_EditnPlaceResponse.php
@@ -1,12 +0,0 @@
-<?php
-require( dirname(__FILE__) . '/../../../wp-config.php' );
-
-// Start saving data
-global $wpdb;
-
-$field_value = urldecode($_POST['field_value']);
-$field_type = $wpdb->escape($_POST['field_type']);
-$meta_id = $wpdb->escape($_POST['meta_id']);
-
-//@todo Sanitize this query
-$wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '{$field_value}' WHERE meta_id = '{$meta_id}'");
View
29 RCCWP_OptionsPage.php
@@ -114,35 +114,6 @@ function Main() {
</table>
-
- <h3><?php _e('Other Options', $mf_domain); ?></h3>
- <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
- <tr valign="top">
- <th scope="row"><?php _e('Edit-n-place', $mf_domain); ?></th>
- <td>
- <label for="enable-editnplace">
- <input name="enable-editnplace" id="enable-editnplace" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState( $customWritePanelOptions['enable-editnplace'] )?> type="checkbox">
- &nbsp; <?php _e('Edit posts instantly from the post page.', $mf_domain); ?></label>
- </td>
- </tr>
- <script type='text/javascript' src='<?php echo MF_URI?>js/sevencolorpicker.js'></script>
- <script type="text/javascript">
- jQuery('document').ready(function(){
- jQuery('#eip-highlight-color').SevenColorPicker();
- });
- </script>
- <tr>
- <th scope="row"><?php _e('EIP highlight color', $mf_domain); ?> </th>
- <td>
- <label for="eip-highlight-color">
- <input name="eip-highlight-color" id="eip-highlight-color" value="<?php echo $customWritePanelOptions['eip-highlight-color']; ?>" >
- &nbsp; <?php _e('Use color to highlight areas EIP', $mf_domain); ?></label>
- </td>
- </tr>
-
- </table>
-
- <br />
<h3><?php _e('Uninstall Magic Fields', $mf_domain); ?></h3>
<table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
<tr valign="top">
View
6 RCCWP_Processor.php
@@ -471,9 +471,7 @@ function Main() {
'hide-visual-editor' => 0,
'prompt-editing-post' => 0,
'assign-to-role' => 0,
- 'default-custom-write-panel' => 0,
- 'enable-editnplace' => 0,
- 'eip-highlight-color' => "#FFFFCC"
+ 'default-custom-write-panel' => 0
);
$save_options = $_POST;
@@ -483,7 +481,7 @@ function Main() {
$save = array_merge($default,$save_options);
RCCWP_Options::Update($save);
- $EnP = RCCWP_Application::create_EditnPlace_css(TRUE);
+
}
}
}
View
16 get-custom.php
@@ -68,22 +68,6 @@ function get ($fieldName, $groupIndex=1, $fieldIndex=1, $readyForEIP=true,$post_
$results = split('&',$results);
$results = $results[0];
}
-
- // Prepare fields for EIP
- include_once('RCCWP_Options.php');
- $enableEditnplace = RCCWP_Options::Get('enable-editnplace');
- if ($readyForEIP && $enableEditnplace == 1 && current_user_can('edit_posts', $post->ID)){
- switch($fieldType){
- case $FIELD_TYPES["textbox"]:
- if(!$results) $results="&nbsp";
- $results = "<div id='mfeip_".$fieldMetaID."' class='EIP_textbox' >".$results."</div>";
- break;
- case $FIELD_TYPES["multiline_textbox"]:
- if(!$results) $results="&nbsp";
- $results = "<div id='mfmueip_".$fieldMetaID."' class='EIP_mulittextbox' >".$results."</div>";
- break;
- }
- }
return $results;
}
View
126 js/editnplace.js
@@ -1,126 +0,0 @@
-/**
- * Edit In place
- *
- */
-mf_content = "";
-mf_type = "";
-mf_meta_id = "";
-mf_panel = "";
-var mf_niceditor;
-
-jQuery(document).ready(function(){
- jQuery('.EIP_textbox').click(add_editor);
- jQuery('.EIP_mulittextbox').click(add_editor);
- jQuery('.mfceip').live('click',cancel_editor);
- jQuery('.mfseip').live('click',save_editor);
-});
-
-save_editor = function(){
-
- if(mf_type =="textbox"){
- //Putting the new content in the mf_Content var
- mf_content = jQuery('#FEIP_textbox_'+mf_meta_id).val();
- }else{
- mf_content = jQuery('#FEIP_mulittextbox_'+mf_meta_id).html();
- }
-
-
- //saving the post
- values = "meta_id=" + escape(encodeURI(mf_meta_id)) +
- "&field_value=" + escape(encodeURI(mf_content )) +
- "&field_type=" + escape(encodeURI(mf_type));
-
- jQuery.ajax({
- type: "POST",
- url: JS_MF_URI + 'RCCWP_EditnPlaceResponse.php',
- data: values,
- success: function(msg){
- cancel_editor();
- }
- });
-}
-
-cancel_editor = function(){
-
- if(mf_type =="textbox"){
- //Remove the text input
- jQuery('#FEIP_textbox_'+mf_meta_id).remove();
-
- //putting the original content in the div
- jQuery('#mfeip_'+mf_meta_id).html(mf_content);
-
- //restoring the onclick event to the field
- jQuery('#mfeip_'+mf_meta_id).bind('click',add_editor);
-
- //removing the "savecancel" bar
- jQuery('#save_cancel_field').remove();
-
- //Done
- }else{
- //removing the editor
- mf_niceditor.removeInstance('FEIP_mulittextbox_'+mf_meta_id);
- //removing the panel
- mf_niceditor.removePanel('panel_'+mf_meta_id);
-
- //removing the EIP content
- jQuery('#FEIP_mulittextbox_'+mf_meta_id).remove();
-
- //restoring the original content in the div
- jQuery('#mfmueip_'+mf_meta_id).html(mf_content);
-
- //restoring the onclick event to the field
- jQuery('#mfmueip_'+mf_meta_id).bind('click',add_editor);
-
- //removing the "savecancel" bar
- jQuery('#save_cancel_field').remove();
- }
-
-}
-
-add_editor = function(){
- //Getting the classes of the div
- element_class = jQuery(this).attr('class');
- element_id = jQuery(this).attr('id');
-
- //Getting the type of field (inputtext or multiline)
- mf_type = element_class.split("_")[1];
-
- //Getting the meta id
- mf_meta_id = element_id.split("_")[1];
-
- //avoid to duplicate the field
- jQuery(this).unbind('click');
-
- // Create save/cancel buttons
- saveCancel = '<div id="save_cancel_field" class="EIPSaveCancel" style="display:block;">'+
- '<div id="savingDiv" style="display:none">saving ...</div>'+
- '<div id="saveButton">'+
- '<input type="button" value="Save" id="mfseip_'+mf_meta_id+'" class="mfseip" /> Or'+
- '<input type="button" value="Cancel" id="mfceip_'+mf_meta_id+'" class="mfceip" />'+
- '</div>'+
- '</div>';
- jQuery(document.body).prepend(saveCancel);
-
- //Getting the original value of the content
- mf_content = jQuery(this).html();
-
-
- jQuery(this).empty();
- jQuery(this).html('');
- if(mf_type == "textbox"){
- //Creating the input field for put the new content
- jQuery(this).html('<input type="text" value="'+mf_content+'" class="FEIP_textbox" id="FEIP_textbox_'+mf_meta_id+'"/>');
- }else{
- //if is multiline
- jQuery(this).html('<div style="background-color: #ccc; padding: 3px; width: 100%;" class="FEIP_mulittextbox" id="FEIP_mulittextbox_'+mf_meta_id+'">'+mf_content+'</div>');
-
- //creating a div for put the pannel
- mf_niceditor = new nicEditor({iconsPath : JS_MF_URI + 'js/nicEditorIcons.gif',buttonList : ['bold','italic','underline','ol','ul','link','unlink']});
- mf_niceditor.addInstance('FEIP_mulittextbox_'+mf_meta_id);
- // Creat nicEditor panel
- mf_panel = "<div id='panel_" + mf_meta_id+"' class='EIPnicPanelDiv'></div>";
- jQuery('#mfmueip_'+mf_meta_id).prepend(mf_panel);
-
- mf_niceditor.setPanel('panel_'+mf_meta_id);
- }
-}
View
1  js/nicEdit.js
@@ -1 +0,0 @@
-var bkExtend=function(){var a=arguments;if(a.length==1){a=[this,a[0]]}for(var b in a[1]){a[0][b]=a[1][b]}return a[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(c){var a=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var b=new this(bkClass);bkExtend(b,c);a.prototype=b;a.extend=this.extend;return a};var bkElement=bkClass.extend({construct:function(b,a){if(typeof(b)=="string"){b=(a||document).createElement(b)}b=$BK(b);return b},appendTo:function(a){a.appendChild(this);return this},appendBefore:function(a){a.parentNode.insertBefore(this,a);return this},addEvent:function(b,a){bkLib.addEvent(this,b,a);return this},setContent:function(a){this.innerHTML=a;return this},pos:function(){var d=curtop=0;var c=obj=this;if(obj.offsetParent){do{d+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var a=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[d+a,curtop+a+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(a){var b=this;do{if(b&&b.nodeName&&b.nodeName.toUpperCase()==a){return b}b=b.parentNode}while(b);return false},hasClass:function(a){return this.className.match(new RegExp("(\\s|^)nicEdit-"+a+"(\\s|$)"))},addClass:function(a){if(!this.hasClass(a)){this.className+=" nicEdit-"+a}return this},removeClass:function(a){if(this.hasClass(a)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+a+"(\\s|$)")," ")}return this},setStyle:function(a){var b=this.style;for(var c in a){switch(c){case"float":b.cssFloat=b.styleFloat=a[c];break;case"opacity":b.opacity=a[c];b.filter="alpha(opacity="+Math.round(a[c]*100)+")";break;case"className":this.className=a[c];break;default:b[c]=a[c]}}return this},getStyle:function(a,c){var b=(!c)?document.defaultView:c;if(this.nodeType==1){return(b&&b.getComputedStyle)?b.getComputedStyle(this,null).getPropertyValue(a):this.currentStyle[bkLib.camelize(a)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(a){for(var b in a){this[b]=a[b]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(c,b,a){(c.addEventListener)?c.addEventListener(b,a,false):c.attachEvent("on"+b,a)},toArray:function(c){var b=c.length,a=new Array(b);while(b--){a[b]=c[b]}return a},noSelect:function(b){if(b.setAttribute&&b.nodeName.toLowerCase()!="input"&&b.nodeName.toLowerCase()!="textarea"){b.setAttribute("unselectable","on")}for(var a=0;a<b.childNodes.length;a++){bkLib.noSelect(b.childNodes[a])}},camelize:function(a){return a.replace(/\-(.)/g,function(b,c){return c.toUpperCase()})},inArray:function(a,b){return(bkLib.search(a,b)!=null)},search:function(a,c){for(var b=0;b<a.length;b++){if(a[b]==c){return b}}return null},cancelEvent:function(a){a=a||window.event;if(a.preventDefault&&a.stopPropagation){a.preventDefault();a.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return}arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(a){this.domLoad.push(a);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(a){if(typeof(a)=="string"){a=document.getElementById(a)}return(a&&!a.appendTo)?bkExtend(a,bkElement.prototype):a}var bkEvent={addEvent:function(a,b){if(b){this.eventList=this.eventList||{};this.eventList[a]=this.eventList[a]||[];this.eventList[a].push(b)}return this},fireEvent:function(){var a=bkLib.toArray(arguments),c=a.shift();if(this.eventList&&this.eventList[c]){for(var b=0;b<this.eventList[c].length;b++){this.eventList[c][b].apply(this,a)}}}};function __(a){return a}Function.prototype.closure=function(){var a=this,b=bkLib.toArray(arguments),c=b.shift();return function(){if(typeof(bkLib)!="undefined"){return a.apply(c,b.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var a=this,c=bkLib.toArray(arguments),b=c.shift();return function(f){f=f||window.event;if(f.target){var d=f.target}else{var d=f.srcElement}return a.apply(b,[f,d].concat(c))}};var nicEditorConfig=bkClass.extend({buttons:{bold:{name:__("Click to Bold"),command:"Bold",tags:["B","STRONG"],css:{"font-weight":"bold"},key:"b"},italic:{name:__("Click to Italic"),command:"Italic",tags:["EM","I"],css:{"font-style":"italic"},key:"i"},underline:{name:__("Click to Underline"),command:"Underline",tags:["U"],css:{"text-decoration":"underline"},key:"u"},left:{name:__("Left Align"),command:"justifyleft",noActive:true},center:{name:__("Center Align"),command:"justifycenter",noActive:true},right:{name:__("Right Align"),command:"justifyright",noActive:true},justify:{name:__("Justify Align"),command:"justifyfull",noActive:true},ol:{name:__("Insert Ordered List"),command:"insertorderedlist",tags:["OL"]},ul:{name:__("Insert Unordered List"),command:"insertunorderedlist",tags:["UL"]},subscript:{name:__("Click to Subscript"),command:"subscript",tags:["SUB"]},superscript:{name:__("Click to Superscript"),command:"superscript",tags:["SUP"]},strikethrough:{name:__("Click to Strike Through"),command:"strikeThrough",css:{"text-decoration":"line-through"}},removeformat:{name:__("Remove Formatting"),command:"removeformat",noActive:true},indent:{name:__("Indent Text"),command:"indent",noActive:true},outdent:{name:__("Remove Indent"),command:"outdent",noActive:true},hr:{name:__("Horizontal Rule"),command:"insertHorizontalRule",noActive:true}},iconsPath:"../nicEditorIcons.gif",buttonList:["save","bold","italic","underline","left","center","right","justify","ol","ul","fontSize","fontFamily","fontFormat","indent","outdent","image","upload","link","unlink","forecolor","bgcolor"],iconList:{bold:1,center:2,hr:3,indent:4,italic:5,justify:6,left:7,ol:8,outdent:9,removeformat:10,right:11,save:12,strikethrough:13,subscript:14,superscript:15,ul:16,underline:17,link:18,unlink:19,close:20}});var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(b,a){this.nicPlugins.push({p:b,o:a})},allTextAreas:function(c){var a=document.getElementsByTagName("textarea");for(var b=0;b<a.length;b++){nicEditors.editors.push(new nicEditor(c).panelInstance(a[b]))}return nicEditors.editors},findEditor:function(c){var b=nicEditors.editors;for(var a=0;a<b.length;a++){if(b[a].instanceById(c)){return b[a].instanceById(c)}}}};var nicEditor=bkClass.extend({construct:function(c){this.options=new nicEditorConfig();bkExtend(this.options,c);this.nicInstances=new Array();this.loadedPlugins=new Array();var a=nicEditors.nicPlugins;for(var b=0;b<a.length;b++){this.loadedPlugins.push(new a[b].p(this,a[b].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(b,c){b=this.checkReplace($BK(b));var a=new bkElement("DIV").setStyle({width:(parseInt(b.getStyle("width"))||b.clientWidth)+"px"}).appendBefore(b);this.setPanel(a);return this.addInstance(b,c)},checkReplace:function(b){var a=nicEditors.findEditor(b);if(a){a.removeInstance(b);a.removePanel()}return b},addInstance:function(b,c){b=this.checkReplace($BK(b));if(b.contentEditable||!!window.opera){var a=new nicEditorInstance(b,c,this)}else{var a=new nicEditorIFrameInstance(b,c,this)}this.nicInstances.push(a);return this},removeInstance:function(c){c=$BK(c);var b=this.nicInstances;for(var a=0;a<b.length;a++){if(b[a].e==c){b[a].remove();this.nicInstances.splice(a,1)}}},removePanel:function(a){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(c){c=$BK(c);var b=this.nicInstances;for(var a=0;a<b.length;a++){if(b[a].e==c){return b[a]}}},setPanel:function(a){this.nicPanel=new nicEditorPanel($BK(a),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(b,a){if(this.selectedInstance){this.selectedInstance.nicCommand(b,a)}},getIcon:function(d,a){var c=this.options.iconList[d];var b=(a.iconFiles)?a.iconFiles[d]:"";return{backgroundImage:"url('"+((c)?this.options.iconsPath:b)+"')",backgroundPosition:((c)?((c-1)*-18):0)+"px 0px"}},selectCheck:function(c,a){var b=false;do{if(a.className&&a.className.indexOf("nicEdit")!=-1){return false}}while(a=a.parentNode);this.fireEvent("blur",this.selectedInstance,a);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(j,d,c){this.ne=c;this.elm=this.e=j;this.options=d||{};newX=parseInt(j.getStyle("width"))||j.clientWidth;newY=parseInt(j.getStyle("height"))||j.clientHeight;this.initialHeight=newY-8;var k=(j.nodeName.toLowerCase()=="textarea");if(k||this.options.hasPanel){var b=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var g={width:newX+"px",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};g[(b)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(g).appendBefore(j);var a=new bkElement("DIV").setStyle({width:(newX-8)+"px",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);j.setStyle({display:"none"});a.innerHTML=j.innerHTML;if(k){a.setContent(j.value);this.copyElm=j;var h=j.parentTag("FORM");if(h){bkLib.addEvent(h,"submit",this.saveContent.closure(this))}}a.setStyle((b)?{height:newY+"px"}:{overflow:"hidden"});this.elm=a}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var a=this.getSel();if(!a){return null}return(a.rangeCount>0)?a.getRangeAt(0):a.createRange()},selRng:function(a,b){if(window.getSelection){b.removeAllRanges();b.addRange(a)}else{a.select()}},selElm:function(){var c=this.getRng();if(c.startContainer){var d=c.startContainer;if(c.cloneContents().childNodes.length==1){for(var b=0;b<d.childNodes.length;b++){var a=d.childNodes[b].ownerDocument.createRange();a.selectNode(d.childNodes[b]);if(c.compareBoundaryPoints(Range.START_TO_START,a)!=1&&c.compareBoundaryPoints(Range.END_TO_END,a)!=-1){return $BK(d.childNodes[b])}}}return $BK(d)}else{return $BK((this.getSel().type=="Control")?c.item(0):c.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(b,a){if(b.ctrlKey){this.ne.fireEvent("key",this,b)}},selected:function(c,a){if(!a){a=this.selElm()}if(!c.ctrlKey){var b=this.ne.selectedInstance;if(b!=this){if(b){this.ne.fireEvent("blur",b,a)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",b,a)}this.ne.fireEvent("selected",b,a);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(a){this.content=a;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(b,a){document.execCommand(b,false,a)}});var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var b=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!b)?b="<br />":b;this.initialContent=b;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var a=["font-size","font-family","font-weight","color"];for(itm in a){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var b=$BK(this.elmFrame.contentWindow.document);b.designMode="on";b.open();var a=this.ne.options.externalCSS;b.write("<html><head>"+((a)?'<link href="'+a+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");b.close();this.frameDoc=b;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(a){this.content=a;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(b,a){this.frameDoc.execCommand(b,false,a);setTimeout(this.heightUpdate.closure(this),100)}});var nicEditorPanel=bkClass.extend({construct:function(f,b,a){this.elm=f;this.options=b;this.ne=a;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(f);var c=this.ne.options;var d=c.buttons;for(button in d){this.addButton(button,c,true)}this.reorder();f.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(b){for(var a=0;a<this.panelButtons.length;a++){if(this.panelButtons[a].name==b){return this.panelButtons[a]}}},reorder:function(){var c=this.buttonList;for(var b=0;b<c.length;b++){var a=this.findButton(c[b]);if(a){this.panelElm.appendChild(a.margin)}}},remove:function(){this.elm.remove()}});var nicEditorButton=bkClass.extend({construct:function(d,a,c,b){this.options=c.buttons[a];this.name=a;this.ne=b;this.elm=d;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(d);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(a,c)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}b.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(a){switch(a){case"hover":var b={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var b={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var b={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(b).addClass("button-"+a)},checkNodes:function(a){var b=a;do{if(this.options.tags&&bkLib.inArray(this.options.tags,b.nodeName)){this.activate();return true}}while(b=b.parentNode&&b.className!="nicEdit");b=$BK(a);while(b.nodeType==3){b=$BK(b.parentNode)}if(this.options.css){for(itm in this.options.css){if(b.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(a,b){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(b)},disable:function(a,b){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(a,b){if(this.options.key&&b.ctrlKey&&String.fromCharCode(b.keyCode||b.charCode).toLowerCase()==this.options.key){this.mouseClick();if(b.preventDefault){b.preventDefault()}}}});var nicPlugin=bkClass.extend({construct:function(b,a){this.options=a;this.ne=b;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(c){var b=this.options.buttons;for(var a in b){c.addButton(a,this.options)}c.reorder()},init:function(){}});
View
BIN  js/nicEditorIcons.gif
Deleted file not rendered
View
14 modules/shortcodes.php
@@ -48,20 +48,6 @@ function mf_shortcodes($atts) {
if($fieldresults)
$shortcode_data = $checked;
}
- // Prepare fields for EIP
- $enableEditnplace = RCCWP_Options::Get('enable-editnplace');
- if ($eip && $enableEditnplace == 1 && current_user_can('edit_posts', $post->ID)){
- switch($fielddata['type']){
- case $FIELD_TYPES["textbox"]:
- if(!$results) $results="&nbsp";
- $shortcode_data = "<div class='".EIP_textbox($fieldMetaID)."' >".$fieldresults."</div>";
- break;
- case $FIELD_TYPES["multiline_textbox"]:
- if(!$results) $results="&nbsp";
- $shortcode_data = "<div class='".EIP_mulittextbox($fieldMetaID)."' >".$shortcode_data."</div>";
- break;
- }
- }
if ($shortcode_data || $fieldduplicatedata) {
if ($label) {
$shortcode_data = $label.$shortcode_data;
Please sign in to comment.
Something went wrong with that request. Please try again.