Issue Details (XML | Word | Printable)

Key: MDL-14731
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Nicolas Connault
Reporter: Bryce Thornton
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Allow YUI files to be loaded from Yahoo directly

Created: 07/May/08 10:40 PM   Updated: 25/Jul/08 07:27 PM
Return to search
Component/s: AJAX
Affects Version/s: 1.9
Fix Version/s: 2.0

File Attachments: 1. File add_external_yui.diff (1 kB)


Database: Any
Participants: Bryce Thornton, Eloy Lafuente (stronk7), Nicolas Connault and Petr Skoda
Security Level: None
Resolved date: 25/Jul/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
I am always looking at ways to speed up our page loads. One easy way to get a bit more speed is to load the YUI library directly from Yahoo's servers. They do allow this and have a page dedicated to doing it here: http://developer.yahoo.com/yui/articles/hosting/

I am attaching a patch that is a simple modification to the ajaxlib.php file. It also relies on a CFG parameter to be set. The default is to load the files from the local filesystem. Only if the CFG variable is set will it load them from Yahoo.

One thing that I would like to change with this is that I had to hardcode the YUI version number. It would be great if that was an easier bit of information to pull dynamically. I thought about parsing the YUI README file to get the version, but felt like that was a bit sloppy.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nicolas Connault committed 5 files to 'Moodle CVS' - 24/Jul/08 09:37 PM
MDL-14731 Improved Bryce's patch and applied. YUI version number is kept in a simple version.php file, to be updated manually when updating the YUI libraries.
ADD lib/yui/Attic/version.php   Rev. 1.1    (+0 -0 lines)
MODIFY lib/ajax/ajaxlib.php   Rev. 1.46    (+17 -4 lines)
MODIFY version.php   Rev. 1.730    (+1 -1 lines)
MODIFY admin/settings/appearance.php   Rev. 1.35    (+2 -1 lines)
MODIFY lang/en_utf8/admin.php   Rev. 1.209    (+2 -0 lines)
Nicolas Connault added a comment - 24/Jul/08 09:37 PM
Improved Bryce's patch and applied. YUI version number is kept in a simple version.php file, to be updated manually when updating the YUI libraries.

Nicolas Connault made changes - 24/Jul/08 09:37 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s 2.0 [ 10122 ]
Status Open [ 1 ] Resolved [ 5 ]
Eloy Lafuente (stronk7) added a comment - 24/Jul/08 11:17 PM
Hi Nico,

aren't there limits (restrictions) about js only being able to connect to server it comes from, or something similar. Or perhaps I'm wrong and that's only java applets.

Anyway, sounds ok for me to provide that ability via CFG parameter. +1 for it.

Ciao


Bryce Thornton added a comment - 24/Jul/08 11:50 PM
Eloy,

You're thinking of the "same origin" policy for Javascript:

http://www.mozilla.org/projects/security/components/same-origin.html

This refers to calling other servers while executing Javascript. All we're doing here is loading the YUI libraries from Yahoo's server. They will function just like we loaded them from our own server.

Thanks,
Bryce


Mitsuhiro Yoshida committed 7 files to 'Lang CVS' - 25/Jul/08 01:11 AM
MDL-14129 Translated new strings for blog and question.
MDL-14731 Translated new strings for admin YUI libraries setting.
MDL-14208 Translated new strings for quiz statistics.
MDL-10107 Translated new strings for role and messaging.
MODIFY ja_utf8/quiz_statistics.php   Rev. 1.11    (+13 -10 lines)
MODIFY ja_utf8/blog.php   Rev. 1.32    (+2 -1 lines)
MODIFY ja_utf8/README   Rev. 1.767    (+1 -1 lines)
MODIFY ja_utf8/question.php   Rev. 1.23    (+10 -1 lines)
MODIFY ja_utf8/message.php   Rev. 1.16    (+11 -1 lines)
MODIFY ja_utf8/admin.php   Rev. 1.280    (+3 -1 lines)
MODIFY ja_utf8/role.php   Rev. 1.68    (+3 -1 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 25/Jul/08 05:45 AM
MDL-14731 we can not rely on internal connection by default
MODIFY admin/settings/appearance.php   Rev. 1.36    (+2 -2 lines)
Petr Skoda added a comment - 25/Jul/08 05:46 AM
this can not be enabled by default, I have changed the default in cvs

Petr Skoda added a comment - 25/Jul/08 05:46 AM
reopening, please add a warning that all users must have internet access

Petr Skoda made changes - 25/Jul/08 05:46 AM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Nicolas Connault committed 1 file to 'Moodle CVS' - 25/Jul/08 05:32 PM
MDL-14731 Added warning suggested by Petr
MODIFY lang/en_utf8/admin.php   Rev. 1.210    (+1 -1 lines)
Nicolas Connault added a comment - 25/Jul/08 05:32 PM
Added warning.

Nicolas Connault made changes - 25/Jul/08 05:32 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Nicolas Connault added a comment - 25/Jul/08 07:27 PM - edited
See this YUI blog article for an interesting approach to loading external JS files:
http://yuiblog.com/blog/2008/07/22/non-blocking-scripts/

Mitsuhiro Yoshida committed 3 files to 'Lang CVS' - 25/Jul/08 11:58 PM
MDL-14731 Updated a translated string for admin.
MDL-15758 Translated new strings for forum.
MODIFY ja_utf8/README   Rev. 1.768    (+1 -1 lines)
MODIFY ja_utf8/forum.php   Rev. 1.70    (+5 -2 lines)
MODIFY ja_utf8/admin.php   Rev. 1.281    (+2 -2 lines)
martignoni committed 1 file to 'Lang CVS' - 26/Jul/08 04:45 AM
MDL-14731 strings added
MODIFY fr_utf8/admin.php   Rev. 1.270    (+3 -1 lines)
martignoni committed 1 file to 'Lang CVS' - 26/Jul/08 04:49 AM
MDL-14731, warning added
MODIFY fr_utf8/admin.php   Rev. 1.271    (+2 -2 lines)