Yii 1.1: js-styled-alert

replace javascript alert() to html/css stylized
3 followers

Yii JsStyledAlertWidget

Widget replaces javascript alert() function to its own, that you can stylize by html & css

Installation

Just put JsStyledAlertWidget directory to yor extensions dir (/protected/extensions).

If you wont to use themes, just place JsStyledAlertWidget/views to themes/<your_theme>/views/JsStyledAlertWidget

Usage

Just place following code to your layout file somewhere inside "BODY" tag:

<?$this->widget('ext.jsStyledAlert.JsStyledAlertWidget');?>

Stylizing

Edit files in protected/extensions/JsStyledAlertWidget/views/ (or in themes/<your_theme>/views/JsStyledAlertWidget if you use themes):

html: JsStyledAlertWidget.php

css: assets/StyledAlert.css

js: assets/StyledAlert.js

If you wont to use images, put them to assets directory & include in widget view file using $assetPath in SRC attribute:

<IMG SRC='<?=$assetPath>/img/image1.jpg'>

To define backgroud-image in css, use relative paths.

Preserve element id's when you edit html, else you will need to correct js

Requirements

Yii 1.0+ jQuery (included to Yii)

Cnangelog

09.11.2010 fixed some bugs, added including of jquery (if not included in your html)

08.11.2010 initial release

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension