  <!DOCTYPE HTML><script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/5.5.1/tinymce.min.js" integrity="sha512-rCSG4Ab3y6N79xYzoaCqt9gMHR0T9US5O5iBuB25LtIQ1Hsv3jKjREwEMeud8q7KRgPtxhmJesa1c9pl6upZvg==" crossorigin="anonymous"></script><script>var server_name = 'https://ohanastarbuilding.com';var thewpnonce = '807ad96594';var wprestapi_url = 'https://ohanastarbuilding.com/wp-json/wp/v2';var urlForupdatingPost = 'https://ohanastarbuilding.com/wp-json/wp/v2/share/';var urlForCreatingPost = 'https://ohanastarbuilding.com/wp-json/wp/v2/share?_wpnonce=807ad96594';var urlForManagingListing = 'https://ohanastarbuilding.com/wp-json/wp/v2/share';var urlForUpladingMedia = 'https://ohanastarbuilding.com/wp-json/wp/v2/media?_wpnonce=807ad96594';var get_current_user_id = '0';</script>  <style>
    /* #submitFormBtn {
      position: relative;
      width: 100%;
    } */

    #os {
      text-align: center;
      background-color: #FAEBD7;
      width: 100%;
      vertical-align: middle;
      padding: 10px;
      margin-bottom: 20px;
    }

    i.fa.fa-info-circle.px-1.text-secondary {
      color: #007bff !important;
    }
  </style>
  <!-- this section is the HTML form used in the modal that pops up to submit the post -->
  <div id="creator" style="visibility:hidden;" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        </div>
        <div class="modal-body">
          <h3 id="h3Title"><i class="fas fa-sm"></i> Create an Ohana Share Item</h3>
          <form id="make" action="javascript:void(0);" onsubmit="submitForm(this);return false;" method="get">
            <hr />
            <br>
            <div>
              <input type="text" name="title" id="title" placeholder="Title" />
            </div>
            <br>
            <div id="os">
              <input id="radio01" type="radio" name="wpcf_status" value="12" checked />
              <label for="radio01"><span></span>Offered</label>
              &nbsp;&nbsp;&nbsp;
              <input id="radio02" type="radio" name="wpcf_status" value="11" />
              <label for="radio02"><span></span>Seeking</label>
            </div>
            <div>
              <textarea name="tagline" rows="1" cols="50" id="tagline" placeholder="Short Description" style="width:100%;"></textarea>
            </div>
            <br>
            <div>
              <textarea name="content" rows="4" cols="50" id="content" placeholder="Details and description..." style="width:100%;"></textarea>
            </div>
            <input type="hidden" name="member" value="" />
            <br>
            <br>
            <input type="hidden" name="_views_template" id="_views_template" value="388" />
            <input type="hidden" name="member" id="member" value="2" />
            <input type="hidden" name="post_id" id="post_id" value="" />
          </form>
        </div><!-- ./end modal body -->
        <div style="clear:both;"></div>
        <button id="submitFormBtn" type="button" class="btn btn-primary wide active">Submit</button>
        <div class="modal-footer">
          <button type="button" class="btn btn-outline-secondary btn-sm" data-dismiss="modal"><i class="fas fa-times"></i> Close</button>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
  <script>
    function submitForm(form) {
      var owner = "";
      // console.log(owner,form);
      //"categories": [13] - LOST     :: Table: gsq_terms
      //"categories": [15] - RESOLVED
      //this Javascript code takes the form data and merges it with a default data object which is all sent into a wp record in the database for this item
      const randdigits = Math.random(3).toString();
      let dataPHP = '{ "status": "publish", "type": "share",  "title": { "rendered": "0' + randdigits + '" }, "content": { "rendered": "_", "protected": false }, "template": "", "categories": "", "tags": [], "toolset_meta": { "common": { "preview": { "type": "textfield", "raw": "\/wp-content\/themes\/ohana_2019\/images\/mt\/_\/12.jpg" }, "id": { "type": "textfield", "raw": "" }, "date1": { "type": "textfield", "raw": "1554601592" }, "date2": { "type": "textfield", "raw": "" }, "link": { "type": "textfield", "raw": "" }, "label": { "type": "textfield", "raw": "" }, "mp4": { "type": "textfield", "raw": "" }, "img1": { "type": "textfield", "raw": "" }, "img2": { "type": "textfield", "raw": "" }, "img3": { "type": "textfield", "raw": "" }, "text1": { "type": "textarea", "raw": " " }, "text2": { "type": "textarea", "raw": "" }, "text3": { "type": "textarea", "raw": "" }, "text4": { "type": "textarea", "raw": "" }, "text5": { "type": "textarea", "raw": "" }, "views": { "type": "textfield", "raw": "91" }, "file": { "type": "textfield", "raw": "" }, "location": { "type": "textfield", "raw": " " }, "address": { "type": "textfield", "raw": "" }, "website": { "type": "textfield", "raw": "" }, "twitter": { "type": "textfield", "raw": "" }, "tweeter": { "type": "textfield", "raw": "" }, "facebook": { "type": "textfield", "raw": "" }, "instagram": { "type": "textfield", "raw": "" }, "video": { "type": "textfield", "raw": "" }, "youtube": { "type": "textfield", "raw": "" }, "email": { "type": "textfield", "raw": "" }, "phone": { "type": "textfield", "raw": "" }, "rsvps": { "type": "textarea", "raw": "" }, "attribution": { "type": "textfield", "raw": "" }, "owner": { "type": "textfield", "raw": "" }, "status": { "type": "textfield", "raw": "" } } }, "simplefavorites_count": "1", "wpcf_views": "0", "wpcf_owner": "' + get_current_user_id + '", "wpcf_date1": "1594601592", "wpcf-preview": "/wp-content/uploads/2019/04/lostfound_puppy-1110x624.jpg", "_views_template": "888", "wpcf-text1": " ",  "wpcf_location": " ", "_private_layout_original_content": "    ", "dfiFeatured": [""], "_wpv_contains_gutenberg_views": "", "_wp_old_date": "" , "_links": { "self": [{ "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/lost-found\/237" }], "collection": [{ "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/lost-found" }], "about": [{ "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/types\/lost-found" }], "wp:featuredmedia": [{ "embeddable": true, "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/media\/308" }], "wp:attachment": [{ "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/media?parent=237" }], "wp:term": [{ "taxonomy": "category", "embeddable": true, "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/categories?post=237" }, { "taxonomy": "post_tag", "embeddable": true, "href": "https:\/\/7950ohana.com\/wp-json\/wp\/v2\/tags?post=237" }], "curies": [{ "name": "wp", "href": "https:\/\/api.w.org\/{rel}", "templated": true }] } ';
      for (var i = 0; i < form.length; i++) {
        if (form[i].name) {
          dataPHP += ',"' + form[i].name + '":"' + encodeURIComponent(form[i].value) + '"';
          // console.log(i, form[i].name, form.length, dataPHP);
        } else {
          // console.log(i, form.length, dataPHP);
        }
        if (i === form.length - 1) {
          dataPHP += "}";
          let usabledataPHP = JSON.parse(dataPHP);
          delete usabledataPHP._links;
          delete usabledataPHP.tags;
          delete usabledataPHP.dfiFeatured;
          delete usabledataPHP.simplefavorites_count;
          delete usabledataPHP.template;
          delete usabledataPHP._relevanssi_noindex_reason;
          delete usabledataPHP._wp_desired_post_slug;
          delete usabledataPHP._wp_trash_meta_time;
          delete usabledataPHP._wp_trash_meta_status;
          delete usabledataPHP['simplefavorites-count'];
          delete usabledataPHP._yoast_wpseo_primary_category;
          delete usabledataPHP._dd_layouts_settings;
          delete usabledataPHP._oembed_time_c59258e8b78e73e8818185564dd55dc8;
          delete usabledataPHP._oembed_c59258e8b78e73e8818185564dd55dc8;
          delete usabledataPHP.generated_slug;
          delete usabledataPHP.permalink_template;
          delete usabledataPHP.yoast_head;
          delete usabledataPHP._private_layout_original_content;
          delete usabledataPHP._wp_old_date;
          delete usabledataPHP._wpv_contains_gutenberg_views;
          delete usabledataPHP._mailnonce;
          delete usabledataPHP._wpnonce;
          console.log(usabledataPHP);
          //usabledataPHP.toolset_meta.common.wpcf_text1 = usabledataPHP.wpcf_text1;
          /*     var timestamp = new Date(document.getElementById("when").value).getTime();
                  usabledataPHP.toolset_meta.common.wpcf_date1 = (timestamp / 1000).toString();
          */


          usabledataPHP.toolset_meta.common.content = document.getElementById('content_ifr').contentWindow.document.body.innerHTML;
        //usabledataPHP.toolset_meta.common.content = usabledataPHP.content;
          usabledataPHP.toolset_meta.common._views_template = usabledataPHP._views_template;
          usabledataPHP.toolset_meta.common.tagline = usabledataPHP.tagline;
          usabledataPHP.toolset_meta.common.wpcf_status = (document.getElementById("radio01").checked) ? 12 : 11;
          usabledataPHP.categories = (document.getElementById("radio01").checked) ? 12 : 11;

          usabledataPHP.toolset_meta.common._wpv_contains_gutenberg_views = "";
          usabledataPHP.toolset_meta.common._wp_page_template = "0";
          usabledataPHP.toolset_meta.common.simplefavorites_count = "0";
          usabledataPHP.toolset_meta.common.wpcf_views = "0";
          usabledataPHP.toolset_meta.common.wpcf_location = usabledataPHP.where;
          (typeof owner !== "undefined" && owner !== "") ? usabledataPHP.toolset_meta.common.wpcf_owner = owner: usabledataPHP.toolset_meta.common.wpcf_owner = get_current_user_id;
          usabledataPHP.toolset_meta.common.go_bit = "go_bit";
          usabledataPHP.toolset_meta.common._dd_layouts_settings = "";
          usabledataPHP.content = JSON.stringify(usabledataPHP.toolset_meta.common);


          //create a Post with the merged data
          var urlForPost = urlForCreatingPost;
          if (document.getElementById('h3Title').innerText === "Edit Share" || document.getElementById('h3Title').innerText === "Image Update" || document.getElementById('h3Title').innerText === "Image Delete") {
            urlForPost = urlForupdatingPost + usabledataPHP.post_id + "?_wpnonce=" + thewpnonce;
            usabledataPHP.toolset_meta.common.go_bit = "revise_bit";
          }
          console.log("urlForPost", urlForPost);
          $.ajax({
            method: 'POST',
            url: urlForPost,
            data: usabledataPHP,
            dataType: 'json',
            success: function(response) {
              console.log(response, document.getElementById('h3Title').innerText);
              setTimeout(function() {
                window.location = server_name + "/ohana-share"; //after 750 milliseconds, reload the webpage
              }, 750);
            },
            error: function(errorThrown) {
              //THIS NEEDS TO BE REVIEWED AGAIN LATER.. TODAY IS JUNE 26, 2020

              var rT = errorThrown.responseText;
              rT = rT.replace(/\n/ig, '');
              console.log("\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\rrT", rT);
              // setTimeout(function() {
              //   window.location = server_name + "/ohana-share"; //after 750 milliseconds, reload the webpage
              // }, 750);
            },
          });
        }
      }
    }
    //show the Creator, by default it is hidden so it doesn't glitch the user interface upon page load
    document.addEventListener('DOMContentLoaded', function() {
      if(document.getElementById("status_icon_holder")){
        status = document.getElementById("status_icon_holder").innerText;
      }
      document.getElementById("creator").style.visibility = "visible";
      document.getElementById("submitFormBtn").addEventListener("click", function(a) {
        submitForm(document.getElementById("make"));document.getElementById("submitFormBtn").disabled = true;
      });
    }, false);
  </script><?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://ohanastarbuilding.com/wp-sitemap.xsl" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://ohanastarbuilding.com/share/will%20lend%20a%20cordless%20drill/</loc><lastmod>2020-07-20T18:08:54-07:00</lastmod></url><url><loc>https://ohanastarbuilding.com/share/alimony%20payments/</loc><lastmod>2020-09-02T00:34:33-07:00</lastmod></url></urlset>
