Changeset 1282019
- Timestamp:
- 11/08/2015 02:08:43 PM (10 years ago)
- Location:
- wa-fronted/trunk
- Files:
-
- 9 edited
-
CHANGELOG.html (modified) (1 diff)
-
CHANGELOG.md (modified) (1 diff)
-
README.html (modified) (2 diffs)
-
README.md (modified) (2 diffs)
-
extensions/acf/acf.js (modified) (2 diffs)
-
extensions/acf/acf.min.js (modified) (1 diff)
-
extensions/acf/acf.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
wa-fronted.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wa-fronted/trunk/CHANGELOG.html
r1281311 r1282019 1 1 <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> 2 7 <h2 id="1-3-6">1.3.6</h2> 3 8 <ul> -
wa-fronted/trunk/CHANGELOG.md
r1281557 r1282019 1 1 CHANGELOG 2 2 ========= 3 ## 1.3.7 4 * Removed class requirement on auto config 5 * Added full ACF support 6 3 7 ## 1.3.6 4 8 * Added option `init_on_load` to set Fronted loading behavior -
wa-fronted/trunk/README.html
r1281311 r1282019 39 39 <li>[x] Choice-based fields with dropdown-select</li> 40 40 <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><article class="hentry"><h1 class="entry-title"></h1><div class="entry-content"></entry-content></article></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> 42 42 <li>[x] Check/Set post locks</li> 43 43 </ul> … … 58 58 <li>[ ] Ability to update widget contents</li> 59 59 <li>[ ] Extended WooCommerce support</li> 60 <li>[ ] More ACF fields support</li>61 60 <li>[ ] Mirror style of current WP admin theme</li> 62 61 <li>[ ] Ability to create child-categories</li> -
wa-fronted/trunk/README.md
r1281557 r1282019 45 45 * [x] Choice-based fields with dropdown-select 46 46 * [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` 48 48 * [x] Check/Set post locks 49 49 … … 60 60 * [ ] Ability to update widget contents 61 61 * [ ] Extended WooCommerce support 62 * [ ] More ACF fields support63 62 * [ ] Mirror style of current WP admin theme 64 63 * [ ] Ability to create child-categories -
wa-fronted/trunk/extensions/acf/acf.js
r1281557 r1282019 63 63 content_pos = editor_contents.position(); 64 64 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>'); 66 66 67 67 var edit_button = $('#' + field_object.key), … … 241 241 242 242 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); 245 251 246 252 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);1 var 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 201 201 } 202 202 }else{ 203 if( $field_object['field_object']['type'] == ''){203 if(!$field_object || $field_object['field_object']['type'] == ''){ 204 204 trigger_error('ACF field key "' . $field_type . '" not found', E_USER_ERROR); 205 205 }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; 207 209 } 208 210 } -
wa-fronted/trunk/readme.txt
r1281557 r1282019 4 4 Requires at least: 4.0 5 5 Tested up to: 4.3.1 6 Stable tag: 1.3. 66 Stable tag: 1.3.7 7 7 License: GPLv2 8 8 License URI: https://github.com/jesperbjerke/wa-fronted/blob/master/LICENSE.md … … 51 51 * [x] Choice-based fields with dropdown-select 52 52 * [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` 54 54 * [x] Check/Set post locks 55 55 -
wa-fronted/trunk/wa-fronted.php
r1281557 r1282019 4 4 Plugin URI: http://github.com/jesperbjerke/wa-fronted 5 5 Description: Edit content directly from fronted in the contents actual place 6 Version: 1.3. 66 Version: 1.3.7 7 7 Tags: frontend, editor, edit, medium 8 8 Requires at least: 4.0 9 9 Tested up to: 4.3.1 10 Stable tag: 1.3. 610 Stable tag: 1.3.7 11 11 Text Domain: wa-fronted 12 12 Domain Path: /languages … … 276 276 case 'post_title': 277 277 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; 279 282 }, 999, 2); 280 283 break; 281 284 case 'post_content': 282 285 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; 284 290 }, 999 ); 285 291 break; 286 292 case 'post_thumbnail': 287 293 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; 289 298 }, 999, 3 ); 290 299 break; … … 292 301 293 302 $configured_options[] = array( 294 'container' => ' .hentry#' . $field_id,303 'container' => '#' . $field_id, 295 304 'field_type' => $field_type 296 305 );
Note: See TracChangeset
for help on using the changeset viewer.