HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

jquery move categories

422422 MVP
edited November 2011 in Feedback
Just noticed in dashboard, we cannot drag and drop the categories.

This is for version 2.0.18
The drag cursor appears but doesnt allow us to drag the category.

May I also suggest , when creating a new post. Next to Category ..there is another drop down box, with "your version" so people can immediately tag the version they are using.

There was an error rendering this rich post.

Tagged:

Answers

  • It works in webkit for me.
    They drag and move but I get an error that said it failed (but it didn't)

    There was an error rendering this rich post.

  • 422422 MVP
    edited November 2011
    Yeah but .. checking dashboard source.

    Dashboard has jquery.js

    But when i click on categories in sidebar, and view source, jquery.js isnt there. I think there must be a missing hook on mine

    will try in webkit browser

    There was an error rendering this rich post.

  • There was an error rendering this rich post.

  • mine too... i don't think that's the issue

    I'm using chrome, if that helps try that.

    There was an error rendering this rich post.

  • cheers mate, just gonna try now. Will report back.. but I am positive jquery.js must be loaded for drag and drop to move, as its a jquery ui feature. Not mootools. Weird...

    There was an error rendering this rich post.

  • 422422 MVP
    edited November 2011
    No doesnt work in chrome, ff or ie. Perhaps be good to have a fallback... so drop down box at end of each category in category list ( in admin ) with numerics in to set hierarchy.. should drag and drop not work. Or you are working on a browser that doesnt support it or on a device that doesnt.

    There was an error rendering this rich post.

  • ddumontddumont ✭✭
    edited November 2011
    Hmm not sure why jquery isnt there for you...
    I see it on my dashboard:
    <script src="/js/library/jquery.js?v=2.0.18" type="text/javascript"></script>

    There was an error rendering this rich post.

  • As i said it is on the dashboard, see 5 posts up.
    But it is not on vanilla/settings/managecategories page

    There was an error rendering this rich post.

  • It is definitely on every page. I just confirmed in my site running 2.0.18.
  • 422422 MVP
    edited November 2011
    Hmm. I know we took jquery.js out of the forums portion, because we use our own cdn. Seemingly dashboard references this file too. Which is odd because it in js folder of admin area, is displayed in dashboard code, but not in dashboard sub pages.

    Do you reference jquery differently within admin dashboard sub pages ?

    There was an error rendering this rich post.

  • Without knowing how you did that (and btw, that's the kind of detail you might want to share up front) I don't know how any of us can help you.

    Do you have a plugin to insert the CDN jquery, what plugin?
    Did you just delete the jquery file from your vanilla install?
    Do you have a public link to the forum?

    There was an error rendering this rich post.

  • Hi ,,
    Ours is probably not like other peoples forums. We have wrapped our own headers around the forum, and obviously jquery cdn is loaded from our dynamic header.
    So we deleted jquery.js from js folder.

    But then realised that is the one central location for calling jquery, so plopped it back in. Now we dont wrap our own headers around the dashboard, which means this can load jquery.js the normal way, except it isnt.

    I do have a link to the forum, but we are currently in beta rc3 And it is password protected, so if you would like to look I can email you access rights. But I dont know your email.

    Ste

    There was an error rendering this rich post.

  • Ok we solved it, but still not entirely happy.

    Dashboard and Forum , reference jquery via : forums>applications>vanilla>js folder.

    Without jquery.js in there , dashboard doesnt function or reference jquery.js
    But jquery is already called in forums>applications>dashboard>js

    So basically I wish to STOP vanilla from requesting jquery.js in dashboard and forum , so we can add in our own line ,

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">

    There was an error rendering this rich post.

  • I would do this with a plugin that hooks the Render function.
    Here's a snippet of one of my plugins:
     /**
    * Add our common script, css, and subscribe button module to every page.
    *
    * @param $Sender
    */
    public function Base_Render_Before($Sender) {
    $Sender->AddJsFile($this->GetResource("js-lib".DS."jquery-cookie".DS."jquery.cookie.js", FALSE, FALSE));
    $Sender->AddJsFile($this->GetResource("js-lib".DS."jquery-json".DS."jquery.json-2.3.min.js", FALSE, FALSE));
    }

    There was an error rendering this rich post.

  • ddumontddumont ✭✭
    edited November 2011
    To add an external js file, without adding a ?version param to the url, use:
    $Sender->Head->AddTag('script', array(
    'src' => Asset('https://www.google.com/jsapi', FALSE, FALSE),
    'type' => 'text/javascript'
    ));

    There was an error rendering this rich post.

  • Then in the Render function you'll want to look into all the assets I think. @Lincoln may be able to explain more.

    You'll have to do some trial and error, but you should be able to find the jquery asset somehow at this point and remove it manually.

    There may be a better way, but this should get you far enough to get something working

    There was an error rendering this rich post.

  • Thanks mate, its so complicated to move from hosted js to cdn, i am not sure why Vanilla opt for this, I have been racking my brains as to why they do this. But seemingly it must be for a very good reason.
    Sincerely appreciate your help... incidentally, just downloading your NillaBlog, will have a play with it ;)

    There was an error rendering this rich post.

  • Not sure. I think it would be a fantastic idea to move the core jquery code to use google's CDN. I doubt though that it would solve your case, it looks like you want to host jquery on your own CDN. Though by moving it to support a google CDN, it may be easy to configure the host for it.

    This is open source software though. Roll up your sleeves and contribute a patch. I bet you they'd appreciate it.

    There was an error rendering this rich post.

Sign In or Register to comment.