[ 9 posts ]

Gabe Moothart

YUI Contributor

  • Offline
  • Profile

YUI 2in3 with custom base directory

Post Posted: Thu May 27, 2010 9:59 am
+0-
I am hosting YUI3 myself, because a large portion of my site is behind SSL and I need to avoid the ie mixed-content warning.

I would like to use YUI3's 2in3 feature to bring in YUI2 modules, but I need to override the YUI2 root directory so that it looks on my servers instead of going to Yahoo's. Is there a config setting for this?

Thanks,
Gabe

Adam Moore

YUI Contributor

  • Username: adam
  • Joined: Wed Sep 03, 2008 11:16 am
  • Posts: 356
  • GitHub: apm
  • Gists: apm
  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Thu May 27, 2010 10:31 am
+0-
http://github.com/yui/2in3

Gabe Moothart

YUI Contributor

  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Thu Jun 03, 2010 2:04 pm
+0-
Adam,
Thanks for the link. The instructions seem to be a little incomplete, though?

I cannot get this to work:
Code:
base: '/2in3/',
, I have to specify the full path like this:
Code:
base: '/2in3/2.8.0/build/',


Also, non-css resources are still retrieved from yahooapis. For example If I load the datatable with a sorted filed, a request is issued to:
http://yui.yahooapis.com/2.8.0r4/build/ ... row-up.png

This appears to be hard-coded in the css. Would relative paths work?

Adam Moore

YUI Contributor

  • Username: adam
  • Joined: Wed Sep 03, 2008 11:16 am
  • Posts: 356
  • GitHub: apm
  • Gists: apm
  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Thu Jun 03, 2010 2:22 pm
+0-
The asset path is hard coded in the files so that the combo service Yahoo! CDN works -- I need to address this for the files that are checked into the repo. In the meantime, you will have to modify those files yourself to serve the images from your local machine.

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Wed Jun 09, 2010 11:57 pm
+0-
Is it possible using YUI 2in3 2.8.1 and not 2.8.0r4 without hosting local files?
I thought the default in YUI 2in3 approach was the latest YUI2 release.

Is YUI2 Wrapper Utility (gallery-yui2) the alternative?

At the moment my code is the following:

YUI().use('node-base', 'get', 'async-queue',
'yui2-connection',
'yui2-utilities',
'yui2-datasource',
'yui2-autocomplete',
'yui2-container',
'yui2-menu',
'yui2-button',
'yui2-calendar',
'yui2-json',
'yui2-swf',
'yui2-charts',
'yui2-cookie',
'yui2-datatable',
'yui2-slider',
'yui2-tabview',
function (Y) {

YAHOO = Y.YUI2;
...


Thanks in advance,
Alberto

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 493
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Thu Jun 10, 2010 8:57 am
+0-
Hello Alberto,

Just change your code to use an specific version of 2in3:

Code:
YUI({
   '2in3': '2.8.1'
}).use('node-base', 'get', 'async-queue', function(Y) {
   // enjoy
});


Best Regards,
Caridy

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Fri Jun 11, 2010 5:58 am
+0-
Adding '2in3' in the configuration object I get the following error:

YAHOO is undefined
http://localhost:8081/dev/proplus/ConPA/ConPA.js
Line 30

Code:
YUI({
    '2in3': '2.8.1'
}).use('node-base', 'get', 'async-queue',
    'yui2-connection',
    'yui2-utilities',
    'yui2-datasource',
    'yui2-autocomplete',
    'yui2-container',
    'yui2-menu',
    'yui2-button',
    'yui2-calendar',
    'yui2-json',
    'yui2-swf',
    'yui2-charts',
    'yui2-cookie',
    'yui2-datatable',
    'yui2-slider',
    'yui2-tabview',
        function (Y) {

    YAHOO = Y.YUI2;

    YAHOO.widget.Chart.SWFURL = // LINE 30
        "http://yui.yahooapis.com/2.8.1/build/charts/assets/charts.swf";
...

Regards,
Alberto

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 493
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Fri Jun 11, 2010 7:40 am
+0-
Ops, my bad, I got confused. Here is the correct definition:

Code:
YUI({
     'yui2': '2.8.1',
     '2in3': '3'
}).use('node-base', 'get', 'async-queue',
    'yui2-connection',
    'yui2-utilities',
    'yui2-datasource',
    'yui2-autocomplete',
    'yui2-container',
    'yui2-menu',
    'yui2-button',
    'yui2-calendar',
    'yui2-json',
    'yui2-swf',
    'yui2-charts',
    'yui2-cookie',
    'yui2-datatable',
    'yui2-slider',
    'yui2-tabview',
        function (Y) {

    YAHOO = Y.YUI2;

    YAHOO.widget.Chart.SWFURL = // LINE 30
        "http://yui.yahooapis.com/2.8.1/build/charts/assets/charts.swf";
...


'2in3' is the release version of that particular project. Latest for today is 3. 'yui2' is the version that should be loaded from within the current '2in3' project.

I created an example for you:
http://caridy.github.com/examples/blog/ ... ndbox.html

Best Regards,
Caridy


Last edited by caridy on Fri Jun 11, 2010 9:22 am, edited 1 time in total.

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: YUI 2in3 with custom base directory

Post Posted: Fri Jun 11, 2010 8:15 am
+0-
Thanks.

Now it works nice.

P.S.: your link is the following: http://caridy.github.com/examples/blog/ ... ndbox.html

:)
Regards,
Alberto
  [ 9 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum