yui

Translate the following jQuery code to YUI 2.x code

谁说胖子不能爱 提交于 2019-12-12 09:19:33
问题 Disclaimer: I have no experience using YUI at all. I was wondering how the following lines of jQuery code would look when written in YUI. Also, since YUI is using a hierarchical dependency system, which .js files need to be included in order for the code to work? 1. Given the ID of an HTML element, apply multiple style rules on the element. $('#foo').css({ color: 'yellow', background: 'black' }); 2. Chaining: given an ID of an HTML element, apply a style rule on it, add a class of bar to it,

Yahoo YUI 2 - Rich Text Editor - can't get setEditorHTML method to work, what's wrong?

六眼飞鱼酱① 提交于 2019-12-12 04:29:13
问题 Today, for the first time, I came across the YUI 2 Rich Text Editor . (http://developer.yahoo.com/yui/editor/) I mainly use Java Server Pages for my websites. I want to be able to set the text in the textarea of the Editor to a previously submitted value. As an example, when a user submits the page, after having entered text in the Editor, that text may be saved in a database for future use. I would then call the value from the database, and set the Editor to display it at that point, so the

How can I get a localized version of a YUI 3 or AlloyUI component?

旧街凉风 提交于 2019-12-12 01:45:18
问题 As an example, how could I render an AlloyUI scheduler which has the days in Japanese rather than English? 回答1: To access a localized version of a YUI 3 component you must use the YUI config object's lang property. When specifying a YUI sandbox, pass it the language code(s) which you want the component(s) to be localized for: YUI({ lang : 'ja-JP' }).use( // your code here... Here is a specific example with the AlloyUI scheduler: YUI({ lang : 'ja-JP' }).use('aui-scheduler', function(Y) { new Y

How to access values from alfresco-global.properties in freemarker and YUI javascript files

时光怂恿深爱的人放手 提交于 2019-12-12 00:08:37
问题 I have numerous custom variables in Alfresco's alfresco-global.properties file that I'd like to use throughout various freemarker ftl files as well as the various YUI files, which will greatly alter the behavior of Share and how it displays information. I have the property values accessible through various javascript calls (for example, getNetworkName() will return the custom app.network.name variable set in the properties), but I am uncertain of how I'd expose these javascript functions to

Using multiple disabledDatesRule in YUI3 calender

自作多情 提交于 2019-12-11 18:17:53
问题 I am loading up a calendar that blocks out dates dynamically, extracting them from a datasource. The problem is, I cannot set multiple disabledDatesRules. It is either one or the other. Which seems kind of silly and not helpful, at all, especially with the way rules are set up. I can't imagine that is the case, so I was wondering if anyone knew how to use multiple disabledDatesRule. For example, var settings = { contentBox: "#calendar", width:'340px', selectionMode: 'multiple', date: new Date

YUI Editor: Getting rid of <html> tags in content

泄露秘密 提交于 2019-12-11 15:56:26
问题 I implemented the YUI rich text editor and I would like to get rid of the <html> , <body> and DOCTYPE tags as soon as I save the content from the editor. I know I could do this afterwards by parsing the HTML, but there must be a better solution. Right now this is saved when I edit a text in the YUI editor: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <body> <p>foo</p> </body> </html> ...but I would like to just save this: <p

How to follow YUI driven animation off screen or center viewport on item?

亡梦爱人 提交于 2019-12-11 11:55:37
问题 I'm using code adapted from the YUI3 documentation example to animate a graphic along a curved path. The full canvas size is intentionally pretty huge - definitely larger than most screens - so the graphic will run out of viewport space pretty quickly and animate off the screen. Instead, I'd like browser viewport to follow or centre on the image so that it stays 'in shot'. Is there a YUI fuelled way of doing this? Or something simpler? 回答1: You could do something like this, basically just

YUI dialog/panel not rendering correctly in IE iframe

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:56:47
问题 I have built a few popups - some using YUI dialog, some using panel. These get rendered correctly in FF, Windows Safari, Chrome. Please refer following screenshots: http://dl.dropbox.com/u/7681433/YUI%20Forum%20Screenhots/WorkingDialog-Firefox.PNG http://dl.dropbox.com/u/7681433/YUI%20Forum%20Screenhots/WorkingPanel-Firefox.PNG However in IE 7, 9 & 10 the dialogs appear in a distorted manner sometimes and appear normally sometimes. See the screenshots below: http://dl.dropbox.com/u/7681433

YUI3 Uploader + Rails rjs

妖精的绣舞 提交于 2019-12-11 07:11:27
问题 I'm trying to use the YUI3 Uploader with a Rails 2.3.12 project. I've got it working up to the point of parsing the response after uploading. The response is an RJS file rendering a partial, to update an element on the page. This RJS works as expected when run via normal non-flash uploads, and it works as expected with the SWFUpload plugin. In Firefox, I get the error: Error: missing } after property list Source File: http://secure.symt.localhost:3000/training_videos/4/edit Line: 0, Column:

Using the YUI Compressor on JavaScript files containing PHP

耗尽温柔 提交于 2019-12-11 06:25:46
问题 I want to use the YUI Compressor on JavaScript files that contain PHP code like for example: <?php $include 'headerDefinitions.js.php'; ?> function hello(name) { alert('Hello ' + name); } hello('<?= $_GET["name"] ?>'); This obviously throws some errors when running through yui compressor like this: java -jar yui-compressor.jar --type js -o target-file.js.php source-file.js.php because the compressor assumes even the PHP part is JavaScript. Is there a way to compress the JavaScript while