<!DOCTYPE HTML><link type="text/css" rel="stylesheet" href="https://ohanastarbuilding.com/wp-content/plugins/dropzone-master/dist/dropzone.css" media="all"><script defer type="text/javascript" src="https://ohanastarbuilding.com/wp-content/plugins/dropzone-master/dist/dropzone.js"></script><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/listing/';var urlForCreatingPost = 'https://ohanastarbuilding.com/wp-json/wp/v2/listing?_wpnonce=807ad96594';var urlForManagingListing = 'https://ohanastarbuilding.com/wp-json/wp/v2/listing';var urlForUpladingMedia = 'https://ohanastarbuilding.com/wp-json/wp/v2/media?_wpnonce=807ad96594';var urlForUploadingMedia = 'https://ohanastarbuilding.com/wp-json/wp/v2/media?_wpnonce=807ad96594';var get_current_user_id = '0';</script><style>
  #os {
    vertical-align: middle;
    text-align: center;
    background-color: #FAEBD7;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
  }

  /* #submitFormBtn {
    position: relative;
    width: 98%;
    left: 1%;
    right: 1%;
  } */

  #the-dropzone .fa-camera {
    /* margin-left: 38%;
    position: absolute; */
    margin-top: 3%;
  }

  .dz-message {
    font-weight: bold;
    font-size: 1.5rem;
  }

  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">Create a Market Listing</h3>
        <hr />
        <div class="modal-body">
          <div>
            <div>
              <form id="make" action="javascript:void(0);" onsubmit="submitForm(this);return false;" method="get">
                <input type="text" id="title" name="title" placeholder="Title" />
                <br>
                <div id="os">
                  <input id="radio01" type="radio" name="wpcf_status" value="1" checked />
                  <label for="radio01"><span></span>For Sale</label>
                  &nbsp;&nbsp;&nbsp;
                  <input id="radio02" type="radio" name="wpcf_status" value="2" />
                  <label for="radio02"><span></span>Service</label>
                  &nbsp;&nbsp;&nbsp;
                  <input id="radio03" type="radio" name="wpcf_status" value="3" />
                  <label for="radio03"><span></span>Freebie</label>
                  &nbsp;&nbsp;&nbsp;
                  <input id="radio04" type="radio" name="wpcf_status" value="4" />
                  <label id="radioSold" for="radio04"><span></span>Sold</label>
                </div>
                <input type="text" id="tagline" name="tagline" placeholder="Short Description" />
                <br>
                <input type="number" id="price" name="price" placeholder="Asking Price/Rate" class="form-control" />
                <div>
                  <br>
                  <textarea name="content" id="content" rows="4" cols="50" placeholder="Details and description..." style="width:100%;"></textarea>
                </div>
                <br>
                <div>
                  <!--   <textarea type="hidden" id="content1" name="content1" rows="3" cols="50" placeholder="Options..." style="width:100%;"></textarea>
                </div>
                <br>
                <div>
                  <textarea type="hidden" id="content2" name="content2" rows="3" cols="50" placeholder="Extras..." style="width:100%;"></textarea>
                </div> -->
                  <input type="hidden" name="_thumbnail_id" id="_thumbnail_id" value="" />
                  <input type="hidden" name="_views_template" id="_views_template" value="446" />
                  <input type="hidden" name="member" id="member" value="2" />
                  <input type="hidden" name="post_id" id="post_id" value="" />
                  <input type="hidden" name="ullocation" id="ullocation" value="" style="opacity:0;height:1px!important;" />
                </div>
              </form>
              <div id="dropzone">
                <form id="the-dropzone" action="#" onsubmit="return false;" class="dropzone">
                  
                  <div class="dz-message"><i class="fa fa-camera fa-2x"></i><span style="vertical-align:super;"> Add Image</span></div>
                </form>
              </div>
              <div id="feedback" class="text-center"></div>
            </div>
            <style>
              #radio04 {
                visibility: hidden;
                /*margin-left: 50%;*/
              }

              #radioSold {
                visibility: hidden;
              }

              #the-dropzone {
                margin-bottom: 7px;
                width: 100%;
                background: #d3d3d3;
                min-height: 160px;
                -webkit-box-shadow: inset 0px 0px 120px rgba(211, 211, 211, 0.7);
                -khtml-box-shadow: inset 0px 0px 120px rgba(211, 211, 211, 0.7);
                -moz-box-shadow: inset 0px 0px 120px rgba(211, 211, 211, 0.7);
                -ms-box-shadow: inset 0px 0px 120px rgba(211, 211, 211, 0.7);
                -o-box-shadow: inset 0px 0px 120px rgba(211, 211, 211, 0.7);
                -box-shadow: inset 0px 0px 120px rgba(211, 211, 211, 0.7);
                border-radius: 6px;
                border-style: dashed;
              }

              #the-dropzone .dz-default span {
                display: none;
              }

              #the-dropzone .dz-default {
                min-height: 128px;
                background-color: gray;
              }

              #the-dropzone .dz-preview {
                background: transparent;
              }

              .dropzone .dz-message {
                font-weight: 400;
              }

              .dropzone .dz-message .note {
                font-size: 0.8em;
                font-weight: 200;
                display: block;
                margin-top: 1.4rem;
              }

              #feedback,
              #repeat {
                display: none;
                margin: 0 auto;
              }
            </style>
            <!-- <div id="dropzone">
   <form id="the-dropzone" action="#" onsubmit="return false;" class="dropzone">
      <i class="fa fa-camera fa-2x"></i>
      <div class="dz-message"><span>Upload Feature Image</span></div>
   </form>
</div> -->
            <!-- <div id="feedback" class="text-center"></div> -->
            <!--<hr />
    <p>
      <small><em>Drag and drop your image above. Can also be click-uploaded, even from your smartphone.
       ( max 5mb .jpg images for the time being only, please )</em></small>
    </p>-->
          </div>
        </div>
        <div style="clear:both;"></div>
        <button name="submitFormBtn" id="submitFormBtn" type="button" style="position:absolute;" class="btn btn-primary wide active">Submit</button>
        <button name="submitFormRedoBtn" id="submitFormRedoBtn" style="display:none;" onsubmit="Dropzone.processQueue();return false;" type="button class="btn btn-primary wide active">Upload Image!</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><!-- ./end modal body -->
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
  //Dropzone options for handling the selected/dropped image
  document.addEventListener("DOMContentLoaded", function(event) {
    Dropzone.options.theDropzone = {
      autoQueue: true,
      autoProcessQueue: true,
      maxFiles: 1,
      parallelUploads: 1,
      timeout: 180000,
      uploadMultiple: false,
      maxFilesize: 5,
      acceptedFiles: 'image/*',
      dictFileTooBig: 'Maximum file size permitted is 5MB',
      accept: function(file, done) {
        // console.log("added to client browser user interface");
        document.getElementById("submitFormBtn").innerText = "Uploading image... Please wait.";
        done();
      },
      init: function() {
        this.on("maxfilesexceeded", function(file) {
          alert("Only the most recent image will be used. You can add more images later.");
        });
        this.on("complete", function(file) {
          if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
            document.getElementById("submitFormBtn").disabled = true;
            axios({
                url: urlForUploadingMedia,
                method: 'POST',
                headers: {
                  'Content-Disposition': 'attachment; filename=' + rs(file.name),
                  'Content-Type': 'image/*'
                },
                data: file
              })
              .then(res => {
                console.log("transfer up");
                // console.log(res.data);
                //update the form with information from the wp Post about the image uploaded to the media library
                document.getElementById("_thumbnail_id").value = res.data.id;
                document.getElementById("ullocation").value = res.data.source_url;
                document.getElementById("submitFormRedoBtn").style.display = "none";
                document.getElementById("submitFormBtn").innerText = "Submit!";
                document.getElementById("submitFormBtn").disabled = false;
              })
              .catch(err => {
                document.getElementById("submitFormBtn").innerText = "Image not uploaded. Post Without Image or Reload Page to Try Again.";
                document.getElementById("submitFormBtn").disabled = false;
                document.getElementById("submitFormRedoBtn").style.display = "none";
                console.log("transfer failed");
                console.log(err);
              });
          }
        });
        this.on("success", function(file, response) {
          // console.log("success", file);
        });
      }
    };
  });

  function submitForm(form, imgID = null) {
    var owner = "";
    // console.log(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": "listing",  "title": { "rendered": "0' + randdigits + '" }, "content": { "rendered": "_", "protected": false }, "template": "", "tags": [], "toolset_meta": { "common": { "preview": { "type": "textfield", "raw": "\/wp-content\/themes\/ohana_2019\/images\/mt\/_\/12.jpg" }, "_thumbnail_id": { "type": "textfield", "raw":"' + document.getElementById("_thumbnail_id").value + '" },"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": "' + get_current_user_id + '" } } }, "simplefavorites_count": "1", "wpcf_views": "0", "wpcf_owner": "' + get_current_user_id + '", "ullocation": "/", "wpcf_date1": "1594601592", "wpcf-preview": "/wp-content/uploads/2019/04/lostfound_puppy-1110x624.jpg", "_views_template": "888", "_thumbnail_id": "' + document.getElementById("_thumbnail_id").value + '", "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, "ullocation", form[i]);
      }
      if (i === form.length - 1) {
        //below is for IMAGESMANAGER -  not for PETS or SHARE
        if (document.getElementById('h3Title').innerText === "Image Update" || document.getElementById('h3Title').innerText === "Image Delete") { //this will add images that are in the User Interface
          var wpcfImages = document.querySelectorAll('img.img-responsive.wpcf');
          for (const meta in wpcfImages) {
            if (wpcfImages[meta].alt !== undefined) {
              dataPHP += ',"' + wpcfImages[meta].alt + '":"' + wpcfImages[meta].id.toString().substr(5, 100) + '"';
            }
          }
        }
        dataPHP += "}";
        // console.log(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;
        usabledataPHP.member = get_current_user_id;
        // console.log(usabledataPHP);

        if(document.getElementById('content_ifr')){
          usabledataPHP.toolset_meta.common.content = document.getElementById('content_ifr').contentWindow.document.body.innerHTML;
        } else {
          usabledataPHP.toolset_meta.common.content = post_content;
        }

        // usabledataPHP.toolset_meta.common.content = usabledataPHP.content;
        usabledataPHP.toolset_meta.common._views_template = usabledataPHP._views_template
        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;
        /*     var timestamp = new Date(document.getElementById("when").value).getTime();
        usabledataPHP.toolset_meta.common.wpcf_date1 = (timestamp / 1000).toString();*/
        if(typeof owner !== "undefined" && owner !== "") {
          usabledataPHP.toolset_meta.common.wpcf_owner = owner;
          usabledataPHP.toolset_meta.common.owner.raw = owner;
        } else {
          usabledataPHP.toolset_meta.common.wpcf_owner = get_current_user_id;
          usabledataPHP.toolset_meta.common.owner.raw = get_current_user_id;
        } 

        usabledataPHP.toolset_meta.common._thumbnail_id = usabledataPHP._thumbnail_id;
        usabledataPHP.toolset_meta.common.go_bit = "go_bit";
        usabledataPHP.toolset_meta.common._dd_layouts_settings = "";
        usabledataPHP.toolset_meta.common.price = usabledataPHP.price;
        usabledataPHP.toolset_meta.common.content1 = usabledataPHP.content1;
        usabledataPHP.toolset_meta.common.content2 = usabledataPHP.content2;
        usabledataPHP.toolset_meta.common.tagline = usabledataPHP.tagline;
        // usabledataPHP.toolset_meta.common.wpcf_status = (document.getElementById("radio01").checked) ? 1 : 2;
        console.log("html_marketlisting.php",usabledataPHP.toolset_meta.common.wpcf_status);
        if (document.getElementById("radio01").checked) {
          usabledataPHP.toolset_meta.common.wpcf_status = 8;
          usabledataPHP.categories = 8;
        } else if (document.getElementById("radio02").checked) {
          usabledataPHP.categories = 10;
          usabledataPHP.toolset_meta.common.wpcf_status = 10;
        } else if (document.getElementById("radio03").checked) {
          usabledataPHP.categories = 34;
          usabledataPHP.toolset_meta.common.wpcf_status = 34;
        } else if (document.getElementById("radio04").checked) {
          usabledataPHP.categories = 9;
          usabledataPHP.toolset_meta.common.wpcf_status = 9;
        }
        console.log("html_marketlisting.php",usabledataPHP.toolset_meta.common.wpcf_status);
        usabledataPHP.toolset_meta.common.ullocation = usabledataPHP.ullocation;
        (usabledataPHP.wpcf_img0) ? usabledataPHP.toolset_meta.common.wpcf_img0 = usabledataPHP.wpcf_img0: null;
        (usabledataPHP.wpcf_img1) ? usabledataPHP.toolset_meta.common.wpcf_img1 = usabledataPHP.wpcf_img1: null;
        (usabledataPHP.wpcf_img2) ? usabledataPHP.toolset_meta.common.wpcf_img2 = usabledataPHP.wpcf_img2: null;
        (usabledataPHP.wpcf_img3) ? usabledataPHP.toolset_meta.common.wpcf_img3 = usabledataPHP.wpcf_img3: null;
        (usabledataPHP.wpcf_img4) ? usabledataPHP.toolset_meta.common.wpcf_img4 = usabledataPHP.wpcf_img4: null;
        (usabledataPHP.wpcf_img5) ? usabledataPHP.toolset_meta.common.wpcf_img5 = usabledataPHP.wpcf_img5: null;
        (usabledataPHP.wpcf_img6) ? usabledataPHP.toolset_meta.common.wpcf_img6 = usabledataPHP.wpcf_img6: null;
        (usabledataPHP.wpcf_img7) ? usabledataPHP.toolset_meta.common.wpcf_img7 = usabledataPHP.wpcf_img7: null;
        (usabledataPHP.wpcf_img8) ? usabledataPHP.toolset_meta.common.wpcf_img8 = usabledataPHP.wpcf_img8: null;
        (usabledataPHP.wpcf_img9) ? usabledataPHP.toolset_meta.common.wpcf_img9 = usabledataPHP.wpcf_img9: null;
        (usabledataPHP.wpcf_img10) ? usabledataPHP.toolset_meta.common.wpcf_img10 = usabledataPHP.wpcf_img10: null;
        (usabledataPHP.wpcf_img11) ? usabledataPHP.toolset_meta.common.wpcf_img11 = usabledataPHP.wpcf_img11: null;
        (usabledataPHP.wpcf_img12) ? usabledataPHP.toolset_meta.common.wpcf_img12 = usabledataPHP.wpcf_img12: null;
        usabledataPHP.content = JSON.stringify(usabledataPHP.toolset_meta.common);
        // usabledataPHP.meta = {
        //   custom_meta_key: 'something'
        // };
        //create a Post with the merged data
        var urlForPost = urlForCreatingPost;
        if (document.getElementById('h3Title').innerText === "Edit Listing" || 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);
            $('#creator').modal('hide'); //hide the modal
            if (document.getElementById('h3Title').innerText === "Image Update") {
              Dropzone.forElement('#the-dropzone1').removeAllFiles(true);
              return "finished updating Form insert image";
            } else if (document.getElementById('h3Title').innerText === "Image Delete") {
              // document.getElementById("idOwlNumParent" + imgID).parentNode.removeChild(document.getElementById("idOwlNumParent" + imgID));
              return "finished updating Form Image Delete";
            } else if (document.getElementById('h3Title').innerText === "Edit Listing") {
              setTimeout(function() {
                window.location.reload(); //after 750 milliseconds, reload the webpage
              }, 750)
            } else {
              setTimeout(function() {
                window.location = server_name + "/market"; //after 750 milliseconds, reload the webpage
              }, 750)
            }
          },
          error: function(errorThrown) {
            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);
          },
        });
      }
    }
  }
  //show the Creator, by default it is hidden so it doesn't glitch the user interface upon page load
  document.addEventListener('DOMContentLoaded', function() {
    document.getElementById("creator").style.visibility = "visible";
    document.getElementById("submitFormBtn").addEventListener("click", function(a) {
      submitForm(document.getElementById("make"));document.getElementById("submitFormBtn").disabled = true;
    });
    document.getElementById("submitFormRedoBtn").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/listing/juicer%20from%20phone/</loc><lastmod>2020-07-19T02:37:36-07:00</lastmod></url><url><loc>https://ohanastarbuilding.com/listing/motorcycle/</loc><lastmod>2020-09-02T00:37:42-07:00</lastmod></url></urlset>
