how to upgrade a dropdown code in angular-bootstrap from 0.11.2 to 0.13.0? - angular-ui-bootstrap

got a drop down code in angular-bootstrap 0.11.2, now when upgrading to 0.13.0, it can not drop down any more:
1) 0.11.2 sample, it's working:
http://jsfiddle.net/f1etvcnb/2/
About <bclass="caret"></b>
2) 0.13.0 sample, it's not dropping down:
http://jsfiddle.net/f1etvcnb/3/
About <b class="caret"></b>

Looking at the old docs, you need to include the dropdown attribute in the enclosing li element and the dropdown-toggle attribute on the element thats toggling (a in your case). I've updated your jsFiddle to include these changes. On a side note, I would strongly recommend you use one of the newer version of angular bootstrap ui. The 0.13 and 0.11 versions are very old. You get more features and configuration options with the new ones, not to mention the benefits of bug fixes and performance over time.
Updated jsFiddle

Related

Installing Semantic-UI with Rails

I've been using Semantic UI with Rails for a bit of time, and I've always relied on the semantic-ui-sass gem for installation.
Yesterday, I came to the conclusion that the gem hasn't been updated with the newest version of Semantic UI. I can only support this through anecdote, as several predefined UI styles didn't have any effect, such as:
<div class="ui pink message">
and any padded grids, or teal columns. So I decided to download the source and to merely drag and drop and let the asset pipeline do the rest. But then I had some questions, and here I am. So,
1) All the CSS is done with LESS. Doesn't rails use Sass by default? Can I merely drop the folder with all the LESS files, require it in application.css, and it will work? Or is there an intermediary step?
2) There are a couple of themes included in the source. How do I implement them?
3) Is there anything else I need to know, that I haven't realized to ask?
You can user gem 'bower-rails' and use semantic-ui from there.
Drop the sass-rails and use gem 'less-rails'
Require the 'semantic-ui' folder in your application.css and application.js
Regarding the theme, I can figure that out yet.

does scriptaculous still have Javascript hacking vulnerability?

Scriptaculous is listed with the Javascript Hacking vulnerability in the following site:
[http://nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2384]
Does any know if this has been resolved since the article was posted in 2008?
I think the vulnerability of Scriptaculous was due to Prototype js 1.6.
https://security-tracker.debian.org/tracker/CVE-2007-2383
If u want to use scriptaculous without vulnerability u have to replace the prototype js file in the scriptaculos with the latest prototype js version. The latest today I think is 1.7.3

Globalize.js API changes and jQuery UI

I'm trying to play with the examples from jQuery UI, such as this one. I would like to use the globalization functions (for a currency field, for example), but it seems that Globalize.js has gone through a major API change, so that the code used in the UI examples doesn't work with the Globalize version I downloaded. For example, the jQuery UI depends on a Globalize.parseFloat function that doesn't exist in that version.
So apparently jQuery UI uses a legacy version of Globalize.js, but how should I download it? I couldn't find any information on that, neither on the API changes. I could download the JS files that are included by jQuery UI, obviously, but I was hoping for a "more official" solution.
I can confirm that the Globalize 1.0.0-alpha releases are incompatible with the current jQuery UI 1.11.x releases. I have successfully used Globalize 0.1.1 with jQuery UI 1.11.x.
This blog post from jQuery UI indicates that they are "...working on a full rewrite of the datepicker widget. The rewrite will feature a far simpler API that will make customizations a lot easier. The rewrite builds on top of the rewritten Globalize library, which builds on top of CLDR, a comprehensive source for globalization data.". Hopefully, this rewrite will include more than just datepicker!
It's 2016 already, two years later, but jQuery 1.11.x is still current (v1.12 in BETA). And I ran into this same issue for a brown-field project I'm doing. I managed to solve this thanks to the OP's analysis that jQuery UI indeed assumes the legacy Globalize version, and the solution of #wedgef5 to switch back to v0.1.1 of Globalize.
The OP did ask for an official answer. I guess there is none, but current best practice is to use a package manager. I use Bower which downloads the current version (now v1.1) by default. Assuming you did the same, you fix this in Bower as follows:
bower uninstall globalize --save
bower install globalize#0.1.1 --save
If you use a different package manager, something similar applies. After this code similar to this example works :). Your bower.json should be changed:
{
"name": "yourpackage",
...
"dependencies": {
...
"globalize": "0.1.1" // Used to be: "globalize": "^1.1.1"
...
}
...
}
Have you tried going to the releases tab in the globalize github project? You can cross-reference the release dates of globalize and jQueryUI and make your best guess from there.

Share LESS variables/mixins without duplicating between multiple files in Rails

Rails asset pipeline compiles all my LESS files (including Bootstrap variables, mixins, etc.) to one single stylesheet. The problem is the output CSS is getting bigger and bigger and lots of styles are only specific to only one page. I want to load those styles only for that page.
So I make the layout to load application.less and also a page specific stylesheet. I #import all the Boostrap LESS files in application.less. But I also want to use some variables/mixins from Bootstrap in my page specific stylesheet. So I have to #import again the Bootstrap files in my page specific stylesheet, which I already have in application.less. Bootstrap is duplicate now.
What's the best way to go around this problem? I tried to use reference import #import (reference) "bootstrap.less"; but I get Less error: expected ')' got 'r'.
I'm using less (2.4.0, 2.3.2) and less-rails (2.4.2, 2.3.3).
You have done things correctly, but your issue is the version of less you are using.
According to the LESS 2.4.0 release for Ruby, it is running LESS version 1.4.2. However, the (reference) option was not added until LESS version 1.5.0, so it is not implemented yet.
This is almost certainly why it is giving you your error of expected ')' got 'r', as it does not know how to handle the (reference) import option.
Yay! less.rb has been updated to 2.5.0 with support of less 1.6.2 a few hours ago.
https://github.com/cowboyd/less.rb/blob/master/Changelog.md

JQuery UI with Primefaces

I have some old code that uses Primefaces 2.2.1 but I now that I need to upgrade the version to 3.1.1 to use some of the new features, some of my javascript functionality is breaking.
I tracked down the issue and realized that in 2.2.1, the jQuery UI plugin was included out of the box but for some reason it is missing in 3.1.1.
Does anyone know why this happened and how can I get my javascript to function correctly without changing it?
I have fixed the original problem posed by this question by downloading the jQuery UI plugin and including manually.

Resources