Git Product home page Git Product logo

Comments (11)

fbennett avatar fbennett commented on August 28, 2024 1

Ah. $().size() is deprecated. Looks like we can just use $().length there.

from ghosthunter.

Windyo avatar Windyo commented on August 28, 2024 1

... I did a typo when committing 7e0f675
I did a hotfix just now but I won't be able to test until this weekend. If you've got free time, try the latest commit, otherwise revert to 0.4.0 until I finish ironing this out.

Sorry about this

from ghosthunter.

Windyo avatar Windyo commented on August 28, 2024

from ghosthunter.

astab avatar astab commented on August 28, 2024

I've tried not setting up the option and leaving the default value, as in the code in my previous comment. And also, tried to set the result_template option like this:

result_template : '<a id="gh-{{ref}}" class="gh-search-item" href="{{link}}"><div class="result-title">{{title}}</div><div class="result-date">{{prettyPubDate}}</div></a>'

from ghosthunter.

astab avatar astab commented on August 28, 2024

Also, forgot to mention that I am using jQuery 3.3.1.

from ghosthunter.

astab avatar astab commented on August 28, 2024

Changing $().size() to $().length fixed this. Thank you, @fbennett !

from ghosthunter.

Windyo avatar Windyo commented on August 28, 2024

Should we update that directly in the source repo then ? if we start requiring specific versions of jQuery things are going to get interesting.

from ghosthunter.

Windyo avatar Windyo commented on August 28, 2024

After checking the docs it's been deprecated since 1.8... changed, issue closed.

from ghosthunter.

gllmhyt avatar gllmhyt commented on August 28, 2024

Even with commit 7e0f675 results are broken on my side:

TypeError: results.length is not a function (jquery.ghosthunter.js:3478:15)

My environment:

  • Ghost 1.21.3
  • jQuery v3.3.1

My index.js:

/* Search with ghostHunter */
$("#search-field").ghostHunter({
    results		: "#search-results",
    includepages 	: true,
    onKeyUp 		: true,
    onPageLoad		: true,
    info_template	: "<p>{{amount}} article(s) trouvé(s)</p>",
    result_template	: "<a id='gh-{{ref}}' class='gh-search-item' href='{{link}}'><p>{{title}}</p></a>"
});

My page-search.hbs:

<section class="article {{post_class}}">
    <form class="search-box">
        <i class="fa fa-search search-icon" aria-hidden="true"></i>
        <input type="search" autocomplete="off" autofocus="on" id="search-field" placeholder="..." />
    </form>
    <div id="search-results"></div>
</section>

from ghosthunter.

gllmhyt avatar gllmhyt commented on August 28, 2024

@Windyo At least with 7a058da it displays results, that's all I need for now, thank you for that quick fix. ;)

from ghosthunter.

Windyo avatar Windyo commented on August 28, 2024

Considering this closed seeing as I use that version also and I haven't seen any issues

from ghosthunter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.