Plugin Directory

Changeset 1282019


Ignore:
Timestamp:
11/08/2015 02:08:43 PM (10 years ago)
Author:
jesperb
Message:

Bump to 1.3.7

Location:
wa-fronted/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wa-fronted/trunk/CHANGELOG.html

    r1281311 r1282019  
    11<h1 id="changelog">CHANGELOG</h1>
     2<h2 id="1-3-7">1.3.7</h2>
     3<ul>
     4<li>Removed class requirement on auto config</li>
     5<li>Added full ACF support</li>
     6</ul>
    27<h2 id="1-3-6">1.3.6</h2>
    38<ul>
  • wa-fronted/trunk/CHANGELOG.md

    r1281557 r1282019  
    11CHANGELOG
    22=========
     3## 1.3.7
     4* Removed class requirement on auto config
     5* Added full ACF support
     6
    37## 1.3.6
    48* Added option `init_on_load` to set Fronted loading behavior
  • wa-fronted/trunk/README.html

    r1281311 r1282019  
    3939<li>[x] Choice-based fields with dropdown-select</li>
    4040<li>[x] CTRL + click on link in editor to open in new tab/window</li>
    41 <li>[x] Automatic config of <code>post_content</code>, <code>post_title</code> and <code>post_thumbnail</code> if no settings are set <strong>requires editable contents to be in a wrapping container with class <code>hentry</code> like <code>&lt;article class=&quot;hentry&quot;&gt;&lt;h1 class=&quot;entry-title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;entry-content&quot;&gt;&lt;/entry-content&gt;&lt;/article&gt;</code></strong>, can be turned off by setting <code>auto_configure</code> to <code>false</code></li>
     41<li>[x] Automatic config of <code>post_content</code>, <code>post_title</code> and <code>post_thumbnail</code> if no settings are set, can be turned off by setting <code>auto_configure</code> to <code>false</code></li>
    4242<li>[x] Check/Set post locks</li>
    4343</ul>
     
    5858<li>[ ] Ability to update widget contents</li>
    5959<li>[ ] Extended WooCommerce support</li>
    60 <li>[ ] More ACF fields support</li>
    6160<li>[ ] Mirror style of current WP admin theme</li>
    6261<li>[ ] Ability to create child-categories</li>
  • wa-fronted/trunk/README.md

    r1281557 r1282019  
    4545* [x] Choice-based fields with dropdown-select
    4646* [x] CTRL + click on link in editor to open in new tab/window
    47 * [x] Automatic config of `post_content`, `post_title` and `post_thumbnail` if no settings are set __requires editable contents to be in a wrapping container with class `hentry` like `<article class="hentry"><h1 class="entry-title"></h1><div class="entry-content"></entry-content></article>`__, can be turned off by setting `auto_configure` to `false`
     47* [x] Automatic config of `post_content`, `post_title` and `post_thumbnail` if no settings are set, can be turned off by setting `auto_configure` to `false`
    4848* [x] Check/Set post locks
    4949
     
    6060* [ ] Ability to update widget contents
    6161* [ ] Extended WooCommerce support
    62 * [ ] More ACF fields support
    6362* [ ] Mirror style of current WP admin theme
    6463* [ ] Ability to create child-categories
  • wa-fronted/trunk/extensions/acf/acf.js

    r1281557 r1282019  
    6363                    content_pos     = editor_contents.position();
    6464
    65                 $('body').prepend('<button id="' + field_object.key + '" title="Edit ' + field_object.type + '" class="edit-acf-field" style="left: ' + (content_pos.left + ((content_width / 2) - 13)) + 'px;"><i class="fa fa-edit"></i></button>');
     65                $('body').prepend('<button id="' + field_object.key + '" title="Edit ' + field_object.type + '" class="edit-acf-field" style="left: ' + (content_pos.left + ((content_width / 2) - 13)) + 'px;"><i class="dashicons dashicons-edit"></i></button>');
    6666               
    6767                var edit_button = $('#' + field_object.key),
     
    241241
    242242                if(!wa_fronted.specific_output_to(this_editor, this_options, response.value.ID, output_content)){
    243                     this_editor.html(output_content);
    244                 }
     243                    if(this_options.hasOwnProperty('reload_contents') && this_options.reload_contents){
     244                        this_editor.load(document.URL +  ' ' + this_options.container);
     245                    }else{
     246                        this_editor.html(output_content);
     247                    }
     248                }
     249
     250                wa_fronted.do_action('acf_refresh_contents', this_editor, this_options);
    245251
    246252                self.hide_acf_form();
  • wa-fronted/trunk/extensions/acf/acf.min.js

    r1278914 r1282019  
    1 var wa_fronted_acf;!function(e){wa_fronted.add_action("on_bind",function(){e("#acf-dialog #close-acf-dialog").click(function(e){e.preventDefault(),e.stopPropagation(),wa_fronted_acf.hide_acf_form()}),wa_fronted.add_filter("revision_content",wa_fronted_acf.switch_revision_content),wa_fronted.add_filter("revision_db_value ",wa_fronted_acf.switch_revision_db_value),"undefined"!=typeof acf&&acf.add_action("submit",function(t){for(var n=t.serializeArray(),a={action:"wa_save_acf_form"},i=0;i<n.length;i++)a[n[i].name]=n[i].value;e.post(global_vars.ajax_url,a).done(function(e){wa_fronted_acf.refresh_acf_field(wa_fronted_acf.data.acf_temp.field_key,wa_fronted_acf.data.acf_temp.post_id,wa_fronted.data.current_editor_options,wa_fronted.data.current_editor)})})}),wa_fronted.add_action("on_setup_editor",function(t,n,a){wa_fronted_acf.get_acf_field_object(n.field_type,function(a){if(!a.hasOwnProperty("error")){switch(a.type){case"file":case"image":null!==a.value&&t.attr("data-db-value",a.value.ID)}var i=t.children(),o=0!==i.length?e(i[0]):t,r=o.width(),s=o.position();e("body").prepend('<button id="'+a.key+'" title="Edit '+a.type+'" class="edit-acf-field" style="left: '+(s.left+(r/2-13))+'px;"><i class="fa fa-edit"></i></button>');var u,l=e("#"+a.key),d=function(){u=setTimeout(function(){l.removeClass("show")},500)};t.hover(function(){clearTimeout(u);var e=o.position();l.css({top:e.top+"px"}).addClass("show")},d),l.hover(function(){clearTimeout(u)},d).click(function(e){e.preventDefault(),e.stopPropagation(),wa_fronted_acf.show_acf_form(a.key,n.post_id,n,t)})}})}),wa_fronted_acf={data:{acf_temp:{field_key:!1,post_id:!1}},get_acf_field_object:function(t,n){e.post(global_vars.ajax_url,{action:"wa_get_acf_field_object",field_key:t},function(e){n(e)})},get_acf_field_contents:function(t,n,a){e.post(global_vars.ajax_url,{action:"wa_get_acf_field_contents",field_key:t,post_id:n},function(e){a(e)})},get_acf_form:function(t,n,a){e.post(global_vars.ajax_url,{action:"wa_get_acf_form",field_key:t,post_id:n,redirect:window.location.pathname},function(e){a(e)})},show_acf_form:function(t,n,a,i){var o=this;o.data.acf_temp.field_key=t,o.data.acf_temp.post_id=n,wa_fronted.data.current_editor_options=a,wa_fronted.data.current_editor=i,o.get_acf_form(t,n,function(t){e("#acf-dialog #acf-dialog-inner").html(t.output),e("#acf-dialog #acf-dialog-inner form").submit(function(e){e.preventDefault()}),e("#acf-dialog").fadeIn().addClass("active")})},hide_acf_form:function(){e("#acf-dialog").fadeOut().removeClass("active")},refresh_acf_field:function(e,t,n,a){var i=this;i.get_acf_field_contents(e,t,function(e){var t="";if(n.hasOwnProperty("output")){var o=n.output.split(".");t=e.value;for(var r=0;r<o.length;r++)t=t[o[r]]}else t=e.value;wa_fronted.specific_output_to(a,n,e.value.ID,t)||a.html(t),i.hide_acf_form()})},switch_revision_content:function(e,t,n){if(0!==n.acf_fields.length&&"object"==typeof n.acf_fields&&n.acf_fields.hasOwnProperty(t.options.field_name)){if(t.options.hasOwnProperty("output")){var a=t.options.output.split(".");output_content=n.acf_fields[t.options.field_name].value;for(var i=0;i<a.length;i++)output_content=output_content[a[i]]}else output_content=n.acf_fields[t.options.field_name].value;return output_content}return e},switch_revision_db_value:function(e,t,n){return 0!==n.acf_fields.length&&"object"==typeof n.acf_fields&&n.acf_fields.hasOwnProperty(t.options.field_name)?n.acf_fields[t.options.field_name].value.ID:e}}}(jQuery);
     1var wa_fronted_acf;!function(t){wa_fronted.add_action("on_bind",function(){t("#acf-dialog #close-acf-dialog").click(function(t){t.preventDefault(),t.stopPropagation(),wa_fronted_acf.hide_acf_form()}),wa_fronted.add_filter("revision_content",wa_fronted_acf.switch_revision_content),wa_fronted.add_filter("revision_db_value ",wa_fronted_acf.switch_revision_db_value),"undefined"!=typeof acf&&acf.add_action("submit",function(e){for(var a=e.serializeArray(),o={action:"wa_save_acf_form"},n=0;n<a.length;n++)o[a[n].name]=a[n].value;t.post(global_vars.ajax_url,o).done(function(t){wa_fronted_acf.refresh_acf_field(wa_fronted_acf.data.acf_temp.field_key,wa_fronted_acf.data.acf_temp.post_id,wa_fronted.data.current_editor_options,wa_fronted.data.current_editor)})})}),wa_fronted.add_action("on_setup_editor",function(e,a,o){wa_fronted_acf.get_acf_field_object(a.field_type,function(o){if(!o.hasOwnProperty("error")){switch(o.type){case"file":case"image":null!==o.value&&e.attr("data-db-value",o.value.ID)}var n=e.children(),i=0!==n.length?t(n[0]):e,r=i.width(),f=i.position();t("body").prepend('<button id="'+o.key+'" title="Edit '+o.type+'" class="edit-acf-field" style="left: '+(f.left+(r/2-13))+'px;"><i class="dashicons dashicons-edit"></i></button>');var c,d=t("#"+o.key),s=function(){c=setTimeout(function(){d.removeClass("show")},500)};e.hover(function(){clearTimeout(c);var t=i.position();d.css({top:t.top+"px"}).addClass("show")},s),d.hover(function(){clearTimeout(c)},s).click(function(t){t.preventDefault(),t.stopPropagation(),wa_fronted_acf.show_acf_form(o.key,a.post_id,a,e)})}})}),wa_fronted_acf={data:{acf_temp:{field_key:!1,post_id:!1}},get_acf_field_object:function(e,a){t.post(global_vars.ajax_url,{action:"wa_get_acf_field_object",field_key:e},function(t){a(t)})},get_acf_field_contents:function(e,a,o){t.post(global_vars.ajax_url,{action:"wa_get_acf_field_contents",field_key:e,post_id:a},function(t){o(t)})},get_acf_form:function(e,a,o){t.post(global_vars.ajax_url,{action:"wa_get_acf_form",field_key:e,post_id:a,redirect:window.location.pathname},function(t){o(t)})},show_acf_form:function(e,a,o,n){var i=this;i.data.acf_temp.field_key=e,i.data.acf_temp.post_id=a,wa_fronted.data.current_editor_options=o,wa_fronted.data.current_editor=n,i.get_acf_form(e,a,function(e){t("#acf-dialog #acf-dialog-inner").html(e.output),t("#acf-dialog #acf-dialog-inner form").submit(function(t){t.preventDefault()}),t("#acf-dialog").fadeIn().addClass("active")})},hide_acf_form:function(){t("#acf-dialog").fadeOut().removeClass("active")},refresh_acf_field:function(t,e,a,o){var n=this;n.get_acf_field_contents(t,e,function(t){var e="";if(a.hasOwnProperty("output")){var i=a.output.split(".");e=t.value;for(var r=0;r<i.length;r++)e=e[i[r]]}else e=t.value;wa_fronted.specific_output_to(o,a,t.value.ID,e)||(a.hasOwnProperty("reload_contents")&&a.reload_contents?o.load(document.URL+" "+a.container):o.html(e)),wa_fronted.do_action("acf_refresh_contents",o,a),n.hide_acf_form()})},switch_revision_content:function(t,e,a){if(0!==a.acf_fields.length&&"object"==typeof a.acf_fields&&a.acf_fields.hasOwnProperty(e.options.field_name)){if(e.options.hasOwnProperty("output")){var o=e.options.output.split(".");output_content=a.acf_fields[e.options.field_name].value;for(var n=0;n<o.length;n++)output_content=output_content[o[n]]}else output_content=a.acf_fields[e.options.field_name].value;return output_content}return t},switch_revision_db_value:function(t,e,a){return 0!==a.acf_fields.length&&"object"==typeof a.acf_fields&&a.acf_fields.hasOwnProperty(e.options.field_name)?a.acf_fields[e.options.field_name].value.ID:t}}}(jQuery);
  • wa-fronted/trunk/extensions/acf/acf.php

    r1281557 r1282019  
    201201                }
    202202            }else{
    203                 if($field_object['field_object']['type'] == ''){
     203                if(!$field_object || $field_object['field_object']['type'] == ''){
    204204                    trigger_error('ACF field key "' . $field_type . '" not found', E_USER_ERROR);
    205205                }else{
    206                     trigger_error('ACF field type "' . $field_object['field_object']['type'] . '" is not yet supported', E_USER_ERROR);
     206                    $compiled_options['native']          = false;
     207                    $compiled_options['toolbar']         = false;
     208                    $compiled_options['reload_contents'] = true;
    207209                }
    208210            }
  • wa-fronted/trunk/readme.txt

    r1281557 r1282019  
    44Requires at least: 4.0
    55Tested up to: 4.3.1
    6 Stable tag: 1.3.6
     6Stable tag: 1.3.7
    77License: GPLv2
    88License URI: https://github.com/jesperbjerke/wa-fronted/blob/master/LICENSE.md
     
    5151* [x] Choice-based fields with dropdown-select
    5252* [x] CTRL + click on link in editor to open in new tab/window
    53 * [x] Automatic config of `post_content`, `post_title` and `post_thumbnail` if no settings are set __requires editable contents to be in a wrapping container with class `hentry` like `<article class="hentry"><h1 class="entry-title"></h1><div class="entry-content"></entry-content></article>`__, can be turned off by setting `auto_configure` to `false`
     53* [x] Automatic config of `post_content`, `post_title` and `post_thumbnail` if no settings are set, can be turned off by setting `auto_configure` to `false`
    5454* [x] Check/Set post locks
    5555
  • wa-fronted/trunk/wa-fronted.php

    r1281557 r1282019  
    44    Plugin URI: http://github.com/jesperbjerke/wa-fronted
    55    Description: Edit content directly from fronted in the contents actual place
    6     Version: 1.3.6
     6    Version: 1.3.7
    77    Tags: frontend, editor, edit, medium
    88    Requires at least: 4.0
    99    Tested up to: 4.3.1
    10     Stable tag: 1.3.6
     10    Stable tag: 1.3.7
    1111    Text Domain: wa-fronted
    1212    Domain Path: /languages
     
    276276                    case 'post_title':
    277277                        add_filter( 'the_title', function( $title, $id = null){
    278                             return '<span id="wa-auto-post_title">' . $title . '</span>';
     278                            if(in_the_loop()){
     279                                $title = '<span id="wa-auto-post_title">' . $title . '</span>';
     280                            }
     281                            return $title;
    279282                        }, 999, 2);
    280283                        break;
    281284                    case 'post_content':
    282285                        add_filter( 'the_content', function( $content ){
    283                             return '<div id="wa-auto-post_content">' . $content . '</div>';
     286                            if(in_the_loop()){
     287                                $content = '<div id="wa-auto-post_content">' . $content . '</div>';
     288                            }
     289                            return $content;
    284290                        }, 999 );
    285291                        break;
    286292                    case 'post_thumbnail':
    287293                        add_filter( 'post_thumbnail_html', function( $html, $post_id, $post_image_id ){
    288                             return '<div id="wa-auto-post_thumbnail">' . $html . '</div>';
     294                            if(in_the_loop()){
     295                                $html = '<div id="wa-auto-post_thumbnail">' . $html . '</div>';
     296                            }
     297                            return $html;
    289298                        }, 999, 3 );
    290299                        break;
     
    292301
    293302                $configured_options[] = array(
    294                     'container'  => '.hentry #' . $field_id,
     303                    'container'  => '#' . $field_id,
    295304                    'field_type' => $field_type
    296305                );
Note: See TracChangeset for help on using the changeset viewer.