Code Monkey home page Code Monkey logo

nova-url-field's People

Contributors

den1n avatar dependabot[bot] avatar kitbs avatar kwidoo avatar spekulatius avatar tzsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nova-url-field's Issues

Output custom HTML

I may be mistaken, but it does not seem possible to output custom HTML on the index and/or detail page? Since the Url field inherits from the default Text field, I expected things like Text::asHtml() to work. Is there any way prevent the HTML from being escaped?

rel nofollow

Would be great to have a nofollow option.

As a quick attempt, I tried extending the Url class

use Inspheric\Fields\Url as BaseUrl;

class Url extends BaseUrl {
    public function nofollow() {
        return $this->withMeta(['rel' => 'nofollow']);
    }
}

But unfortunately that doesn't seem to work. Maybe the meta tags are restricted?

Output in application not displaying correctly on production server

Hello!

Using this package to display links to download files inside tables. I have it working fine on local, but when I deploy I'm getting some unexpected behavior on the app.

Local:

<a href="https://-----" target="_blank" class="cursor-pointer dim no-underline text-primary flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" role="presentation" class="fill-current mr-2 flex-no-shrink"><path d="M19-----"></path></svg> <span class="block truncate">
            Download
        </span></a>

Production server:

<index-url-field resource-name="files" via-resource="contacts" via-resource-id="14440" field="[object Object]" class="text-left"></index-url-field>

Any ideas on what could be causing this?

Can't use placeholder

I can't use placeholder in url filed. I'm try set using withMeta and work.

->withMeta([
'placeholder' => 'newPlaceholder'
])

Allow disabling url type for input

I am using this package for the display purpose only. When updating the model, it requires a URL. But as you can see in my code, I am using only a part of the URL.

Url::make('Instagram', 'instagram_username')
            ->displayUsing(function ($instagram) {
                return 'https://instagram.com/' . $instagram;
            })
            ->clickable()
            ->hideFromIndex(),

displayUsing support.

This field is great, huge help. I use it extensively. But it doesn't support displayUsing when a field gets shortened.

            Url::make(__('URL'), 'url')
                ->rules('required')
                ->sortable()
                ->displayUsing(function ($title) {
                    return str_limit($title, 25, '...');
                })->clickable()->clickableOnIndex()->onlyOnIndex()
            ,

Some URLs are actually longer, and so they end up looking like "https://www.somedomain.c..." because of displayUsing. They get turned into links, but when clicked, you end up going to "https://www.somedomain.c..." instead of the real URL.

noopener=true and noreferrer=false?

Hi,

In the code, only noopener is true by default.

/**
 * The link tag's rel attribute.
 * @var array
 */
protected $rel = ['noopener' => true];

In the README, it looks like both are true by default:

Url::make('Homepage')
    ->noopener(bool $noopener = true),

Url::make('Homepage')
    ->noreferrer(bool $noreferrer = true),

So, is the README wrong or does the default value have to be true for both?

/**
 * The link tag's rel attribute.
 * @var array
 */
protected $rel = ['noopener' => true, 'noreferrer' => true];

Great field! Thank you.

Nova 4: Row click interferes and opens the resource instead of the URL

Nova Version: ^4.0
URL Field Version: ^2.0

I think they changed the index page row click behavior in Nova 4. Now if you click on any regular fields in the Row it opens the Resource Detail page. Which creates interference for this URL field. I think you need to wrap the field in a div and stop the click event bubbling up to the resource view level.

Styling option like relationship url

It would be nice in some cases to have a styling option so the url looks like e.g. the BelongsTo url on detail pages. So this package could be used to link to specific resources within nova without having a defined relationship and looking like everything else in nova.

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.