From e89dfdbce62ad5be906cb2d822fa0f746cf6afd6 Mon Sep 17 00:00:00 2001
From: Nadav Kavalerchik Nothing much to say, since this is just a test... {$a->user} has completed all badge requirements and has been awarded the badge. View issued badge at {$a->link} This action will perform a check if any of the users have already completed all the requirements for \'{$a}\' badge? Would you like to proceed? This will make your badge visible to users and allow them to start earning it. It is possible that some users already meet this badge\'s criteria and will be issued this badge immediately after you enable it. Once a badge has been issued it will be locked - certain settings including the criteria and expiry settings can no longer be changed. Are you sure you want to enable access to the badge \'{$a}\'? There are no public collections of badges available in your backpack. Only public collections are shown, visit your backpack to create some public collections. ")},u=" "+M.util.get_string("blockquote","atto_title")+" "+M.util.get_string("p","atto_title")+" ")},u=" "+M.util.get_string("blockquote","atto_title")+" "+M.util.get_string("p","atto_title")+" Courses can be created automatically if there are enrolments to a course that doesn\'t yet exist in Moodle If you are using automatic course creation, it is recommended that you remove the following capabilities: moodle/course:changeidnumber, moodle/course:changeshortname, moodle/course:changefullname and moodle/course:changesummary, from the relevant roles to prevent modifications of the four course fields specified above (ID number, shortname, fullname and summary). Select fields to update when synchronization script is running (enrol/ldap/cli/sync.php). When at least one field is selected an update will occur. '.$text.'
';
- public $do_generation = false;
- public $starttime;
- public $original_db;
-
- public function __construct($settings = array(), $generate=false) {
- global $CFG;
-
- $this->starttime = time()+microtime();
-
- $arguments = array(
- array('short'=>'u', 'long'=>'username',
- 'help' => 'Your moodle username', 'type'=>'STRING', 'default' => ''),
- array('short'=>'pw', 'long'=>'password',
- 'help' => 'Your moodle password', 'type'=>'STRING', 'default' => ''),
- array('short'=>'P', 'long' => 'database_prefix',
- 'help' => 'Database prefix to use: tables must already exist or the script will abort!',
- 'type'=>'STRING', 'default' => $CFG->prefix),
- array('short'=>'c', 'long' => 'pre_cleanup', 'help' => 'Delete previously generated data'),
- array('short'=>'C', 'long' => 'post_cleanup',
- 'help' => 'Deletes all generated data at the end of the script (for benchmarking of generation only)'),
- array('short'=>'t', 'long' => 'time_limit',
- 'help' => 'Optional time limit after which to abort the generation, 0 = no limit. Default=0',
- 'type'=>'SECONDS', 'default' => 0),
- array('short'=>'v', 'long' => 'verbose', 'help' => 'Display extra information about the data generation'),
- array('short'=>'q', 'long' => 'quiet', 'help' => 'Inhibits all outputs'),
- array('short'=>'i', 'long' => 'ignore_errors', 'help' => 'Continue script execution when errors occur'),
- array('short'=>'N', 'long' => 'no_data', 'help' => 'Generate nothing (used for cleaning up only)'),
- array('short'=>'T', 'long' => 'tiny',
- 'help' => 'Generates a tiny data set (1 of each course, module, user and section)',
- 'default' => 0),
- array('short'=>'nc', 'long' => 'number_of_courses',
- 'help' => 'The number of courses to generate. Default=1',
- 'type'=>'NUMBER', 'default' => 1),
- array('short'=>'ns', 'long' => 'number_of_students',
- 'help' => 'The number of students to generate. Default=250',
- 'type'=>'NUMBER', 'default' => 250),
- array('short'=>'sc', 'long' => 'students_per_course',
- 'help' => 'The number of students to enrol in each course. Default=20',
- 'type'=>'NUMBER', 'default' => 20),
- array('short'=>'nsec', 'long' => 'number_of_sections',
- 'help' => 'The number of sections to generate in each course. Default=10',
- 'type'=>'NUMBER', 'default' => 10),
- array('short'=>'nmod', 'long' => 'number_of_modules',
- 'help' => 'The number of modules to generate in each section. Default=10',
- 'type'=>'NUMBER', 'default' => 10),
- array('short'=>'mods', 'long' => 'modules_list',
- 'help' => 'The list of modules you want to generate', 'default' => $this->modules_list,
- 'type' => 'mod1,mod2...'),
- array('short'=>'rt', 'long' => 'resource_type',
- 'help' => 'The specific type of resource you want to generate. Defaults to all',
- 'default' => $this->resource_types,
- 'type' => 'SELECT'),
- array('short'=>'at', 'long' => 'assignment_type',
- 'help' => 'The specific type of assignment you want to generate. Defaults to all',
- 'default' => $this->assignment_types,
- 'type' => 'SELECT'),
- array('short'=>'ft', 'long' => 'forum_type',
- 'help' => 'The specific type of forum you want to generate. Defaults to all',
- 'default' => $this->forum_types,
- 'type' => 'SELECT'),
- array('short'=>'gf', 'long' => 'glossary_format',
- 'help' => 'The specific format of glossary you want to generate. Defaults to all',
- 'default' => $this->glossary_formats,
- 'type' => 'SELECT'),
- array('short'=>'ag', 'long' => 'assignment_grades',
- 'help' => 'Generate random grades for each student/assignment tuple', 'default' => true),
- array('short'=>'qg', 'long' => 'quiz_grades',
- 'help' => 'Generate random grades for each student/quiz tuple', 'default' => true),
- array('short'=>'eg', 'long' => 'entries_per_glossary',
- 'help' => 'The number of definitions to generate per glossary. Default=0',
- 'type'=>'NUMBER', 'default' => 1),
- array('short'=>'nq', 'long' => 'questions_per_course',
- 'help' => 'The number of questions to generate per course. Default=20',
- 'type'=>'NUMBER', 'default' => 20),
- array('short'=>'qq', 'long' => 'questions_per_quiz',
- 'help' => 'The number of questions to assign to each quiz. Default=5',
- 'type'=>'NUMBER', 'default' => 5),
- array('short'=>'df', 'long' => 'discussions_per_forum',
- 'help' => 'The number of discussions to generate for each forum. Default=5',
- 'type'=>'NUMBER', 'default' => 5),
- array('short'=>'pd', 'long' => 'posts_per_discussion',
- 'help' => 'The number of posts to generate for each forum discussion. Default=15',
- 'type'=>'NUMBER', 'default' => 15),
- array('short'=>'fd', 'long' => 'fields_per_database',
- 'help' => 'The number of fields to generate for each database. Default=4',
- 'type'=>'NUMBER', 'default' => 4),
- array('short'=>'drs', 'long' => 'database_records_per_student',
- 'help' => 'The number of records to generate for each student/database tuple. Default=1',
- 'type'=>'NUMBER', 'default' => 1),
- array('short'=>'mc', 'long' => 'messages_per_chat',
- 'help' => 'The number of messages to generate for each chat module. Default=10',
- 'type'=>'NUMBER', 'default' => 10),
- );
-
- foreach ($arguments as $args_array) {
- $this->settings[$args_array['long']] = new generator_argument($args_array);
- }
-
- foreach ($settings as $setting => $value) {
- $this->settings[$setting]->value = $value;
- }
-
- if ($generate) {
- $this->generate_data();
- }
- }
-
- public function connect() {
- global $DB, $CFG;
- $this->original_db = $DB;
-
- $class = get_class($DB);
- $DB = new $class();
- $DB->connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $this->get('database_prefix'));
- }
-
- public function dispose() {
- global $DB;
- $DB->dispose();
- $DB = $this->original_db;
- }
-
- public function generate_users() {
- global $DB, $CFG;
-
- /**
- * USER GENERATION
- */
- $this->verbose("Generating ".$this->get('number_of_students')." students...");
- $lastnames = array('SMITH','JOHNSON','WILLIAMS','JONES','BROWN','DAVIS','MILLER','WILSON',
- 'MOORE','TAYLOR','ANDERSON','THOMAS','JACKSON','WHITE','HARRIS','MARTIN','THOMPSON',
- 'GARCIA','MARTINEZ','ROBINSON','CLARK','RODRIGUEZ','LEWIS','LEE','WALKER','HALL',
- 'ALLEN','YOUNG','HERNANDEZ','KING','WRIGHT','LOPEZ','HILL','SCOTT','GREEN','ADAMS',
- 'BAKER','GONZALEZ','NELSON','CARTER','MITCHELL','PEREZ','ROBERTS','TURNER','PHILLIPS',
- 'CAMPBELL','PARKER','EVANS','EDWARDS','COLLINS','STEWART','SANCHEZ','MORRIS','ROGERS',
- 'REED','COOK','MORGAN','BELL','MURPHY','BAILEY','RIVERA','COOPER','RICHARDSON','COX',
- 'HOWARD','WARD','TORRES','PETERSON','GRAY','RAMIREZ','JAMES','WATSON','BROOKS','KELLY',
- 'SANDERS','PRICE','BENNETT','WOOD','BARNES','ROSS','HENDERSON','COLEMAN','JENKINS','PERRY',
- 'POWELL','LONG','PATTERSON','HUGHES','FLORES','WASHINGTON','BUTLER','SIMMONS','FOSTER',
- 'GONZALES','BRYANT','ALEXANDER','RUSSELL','GRIFFIN','DIAZ','HAYES','MYERS','FORD','HAMILTON',
- 'GRAHAM','SULLIVAN','WALLACE','WOODS','COLE','WEST','JORDAN','OWENS','REYNOLDS','FISHER',
- 'ELLIS','HARRISON','GIBSON','MCDONALD','CRUZ','MARSHALL','ORTIZ','GOMEZ','MURRAY','FREEMAN',
- 'WELLS','WEBB','SIMPSON','STEVENS','TUCKER','PORTER','HUNTER','HICKS','CRAWFORD','HENRY',
- 'BOYD','MASON','MORALES','KENNEDY','WARREN','DIXON','RAMOS','REYES','BURNS','GORDON','SHAW',
- 'HOLMES','RICE','ROBERTSON','HUNT','BLACK','DANIELS','PALMER','MILLS','NICHOLS','GRANT',
- 'KNIGHT','FERGUSON','ROSE','STONE','HAWKINS','DUNN','PERKINS','HUDSON','SPENCER','GARDNER',
- 'STEPHENS','PAYNE','PIERCE','BERRY','MATTHEWS','ARNOLD','WAGNER','WILLIS','RAY','WATKINS',
- 'OLSON','CARROLL','DUNCAN','SNYDER','HART','CUNNINGHAM','BRADLEY','LANE','ANDREWS','RUIZ',
- 'HARPER','FOX','RILEY','ARMSTRONG','CARPENTER','WEAVER','GREENE','LAWRENCE','ELLIOTT','CHAVEZ',
- 'SIMS','AUSTIN','PETERS','KELLEY','FRANKLIN','LAWSON','FIELDS','GUTIERREZ','RYAN','SCHMIDT',
- 'CARR','VASQUEZ','CASTILLO','WHEELER','CHAPMAN','OLIVER','MONTGOMERY','RICHARDS','WILLIAMSON',
- 'JOHNSTON','BANKS','MEYER','BISHOP','MCCOY','HOWELL','ALVAREZ','MORRISON','HANSEN','FERNANDEZ',
- 'GARZA','HARVEY','LITTLE','BURTON','STANLEY','NGUYEN','GEORGE','JACOBS','REID','KIM','FULLER',
- 'LYNCH','DEAN','GILBERT','GARRETT','ROMERO','WELCH','LARSON','FRAZIER','BURKE','HANSON','DAY',
- 'MENDOZA','MORENO','BOWMAN','MEDINA','FOWLER');
- $firstnames = array( 'JAMES','JOHN','ROBERT','MARY','MICHAEL','WILLIAM','DAVID','RICHARD',
- 'CHARLES','JOSEPH','THOMAS','PATRICIA','LINDA','CHRISTOPHER','BARBARA','DANIEL','PAUL',
- 'MARK','ELIZABETH','JENNIFER','DONALD','GEORGE','MARIA','KENNETH','SUSAN','STEVEN','EDWARD',
- 'MARGARET','BRIAN','DOROTHY','RONALD','ANTHONY','LISA','KEVIN','NANCY','KAREN','BETTY',
- 'HELEN','JASON','MATTHEW','GARY','TIMOTHY','SANDRA','JOSE','LARRY','JEFFREY','DONNA',
- 'FRANK','CAROL','RUTH','SCOTT','ERIC','STEPHEN','ANDREW','SHARON','MICHELLE','LAURA',
- 'SARAH','KIMBERLY','DEBORAH','JESSICA','RAYMOND','SHIRLEY','CYNTHIA','ANGELA','MELISSA',
- 'BRENDA','AMY','GREGORY','ANNA','JOSHUA','JERRY','REBECCA','VIRGINIA','KATHLEEN','PAMELA',
- 'DENNIS','MARTHA','DEBRA','AMANDA','STEPHANIE','WALTER','PATRICK','CAROLYN','CHRISTINE',
- 'PETER','MARIE','JANET','CATHERINE','HAROLD','FRANCES','DOUGLAS','HENRY','ANN','JOYCE',
- 'DIANE','ALICE','JULIE','CARL','HEATHER');
- $users_count = 0;
- $users = array();
-
- shuffle($lastnames);
- shuffle($firstnames);
-
- $next_user_id = $DB->get_field_sql("SELECT MAX(id) FROM {user}") + 1;
-
- for ($i = 0; $i < $this->get('number_of_students'); $i++) {
-
- $lastname = trim(ucfirst(strtolower($lastnames[rand(0, count($lastnames) - 1)])));
- $firstname = $firstnames[rand(0, count($firstnames) - 1)];
-
- $user = new stdClass();
- $user->firstname = trim(ucfirst(strtolower($firstname)));
- $user->username = strtolower(substr($firstname, 0, 7) . substr($lastname, 0, 7)) . $next_user_id++;
- $user->lastname = $lastname;
- $user->email = $user->username . '@example.com';
- $user->mnethostid = 1;
- $user->city = 'Test City';
- $user->country = 'AU';
- $user->password = md5('password');
- $user->auth = 'manual';
- $user->confirmed = 1;
- $user->lang = $CFG->lang;
- $user->timemodified= time();
-
- $user->id = $DB->insert_record("user", $user);
- $users_count++;
- $users[] = $user->id;
- $next_user_id = $user->id + 1;
- $this->verbose("Inserted $user->firstname $user->lastname into DB "
- ."(username=$user->username, password=password).");
- }
-
- if (!$this->get('quiet')) {
- echo "$users_count users correctly inserted in the database.{$this->eolchar}";
- }
- return $users;
- }
-
- public function generate_data() {
- if (!$this->do_generation) {
- return false;
- }
-
- set_time_limit($this->get('time_limit'));
-
- // Process tiny data set
- $tiny = $this->get('tiny');
- if (!empty($tiny)) {
- $this->verbose("Generating a tiny data set: 1 student in 1 course with 1 module in 1 section...");
- $this->set('number_of_courses',1);
- $this->set('number_of_students',1);
- $this->set('number_of_modules',1);
- $this->set('number_of_sections',1);
- $this->set('assignment_grades',false);
- $this->set('quiz_grades',false);
- $this->set('students_per_course',1);
- $this->set('questions_per_course',1);
- $this->set('questions_per_quiz',1);
- }
-
- if ($this->get('pre_cleanup')) {
- $this->verbose("Deleting previous test data...");
- $this->data_cleanup();
-
- if (!$this->get('quiet')) {
- echo "Previous test data has been deleted.{$this->eolchar}";
- }
- }
-
-
- if (!$this->get('no_data')) {
- $users = $this->generate_users();
- $courses = $this->generate_courses();
- $modules = $this->generate_modules($courses);
- $questions = $this->generate_questions($courses, $modules);
- $course_users = $this->generate_role_assignments($users, $courses);
- $this->generate_forum_posts($course_users, $modules);
- $this->generate_grades($course_users, $courses, $modules);
- $this->generate_module_content($course_users, $courses, $modules);
- }
-
- if ($this->get('post_cleanup')) {
- if (!$this->get('quiet')) {
- echo "Removing generated data..." . $this->eolchar;
- }
- $this->data_cleanup();
- if (!$this->get('quiet')) {
- echo "Generated data has been deleted." . $this->eolchar;
- }
- }
-
- /**
- * FINISHING SCRIPT
- */
- $stoptimer = time()+microtime();
- $timer = round($stoptimer-$this->starttime,4);
- if (!$this->get('quiet')) {
- echo "End of script! ($timer seconds taken){$this->eolchar}";
- }
-
- }
-
- public function generate_courses() {
- global $DB;
-
- $this->verbose("Generating " . $this->get('number_of_courses')." courses...");
- $base_course = new stdClass();
- $next_course_id = $DB->get_field_sql("SELECT MAX(id) FROM {course}") + 1;
-
- $base_course->MAX_FILE_SIZE = '2097152';
- $base_course->category = '1';
- $base_course->summary = 'Blah Blah';
- $base_course->format = 'weeks';
- $base_course->numsections = '10';
- $base_course->startdate = time();
- $base_course->id = '0';
-
- $courses_count = 0;
- $courses = array();
- for ($i = 1; $i <= $this->get('number_of_courses'); $i++) {
- $newcourse = fullclone($base_course);
- $newcourse->fullname = "Test course $next_course_id";
- $newcourse->shortname = "Test $next_course_id";
- $newcourse->idnumber = $next_course_id;
- if (!$course = create_course($newcourse)) {
- $this->verbose("Error inserting a new course in the database!");
- if (!$this->get('ignore_errors')) {
- die();
- }
- } else {
- $courses_count++;
- $next_course_id++;
- $courses[] = $course->id;
- $next_course_id = $course->id + 1;
- $this->verbose("Inserted $course->fullname into DB (idnumber=$course->idnumber).");
- }
- }
-
- if (!$this->get('quiet')) {
- echo "$courses_count test courses correctly inserted into the database.{$this->eolchar}";
- }
- return $courses;
- }
-
- public function generate_modules($courses) {
- global $DB, $CFG;
- // Parse the modules-list variable
-
- $this->verbose("Generating " . $this->get('number_of_sections')." sections with "
- .$this->get('number_of_modules')." modules in each section, for each course...");
-
- list($modules_list_sql, $modules_params) =
- $DB->get_in_or_equal($this->get('modules_list'), SQL_PARAMS_NAMED, 'mod', true);
-
- list($modules_ignored_sql, $ignore_params) =
- $DB->get_in_or_equal($this->modules_to_ignore, SQL_PARAMS_NAMED, 'ignore', false);
-
- $wheresql = "name $modules_list_sql AND name $modules_ignored_sql";
- $modules = $DB->get_records_select('modules', $wheresql, array_merge($modules_params, $ignore_params));
-
- foreach ($modules as $key => $module) {
- $module->count = 0;
-
- // Scorm, lams and hotpot are too complex to set up, remove them
- if (in_array($module->name, $this->modules_to_ignore) ||
- !in_array($module->name, $this->modules_list)) {
- unset($modules[$key]);
- }
- }
-
- // Dirty hack for renumbering the modules array's keys
- $first_module = reset($modules);
- array_shift($modules);
- array_unshift($modules, $first_module);
-
- $modules_array = array();
-
- if (count($courses) > 0) {
- $libraries = array();
- foreach ($courses as $courseid) {
-
- // Text resources
- for ($i = 1; $i <= $this->get('number_of_sections'); $i++) {
- for ($j = 0; $j < $this->get('number_of_modules'); $j++) {
-
- $module = new stdClass();
-
- // If only one module is created, and we also need to add a question to a quiz, create only a quiz
- if ($this->get('number_of_modules') == 1
- && $this->get('questions_per_quiz') > 0
- && !empty($modules[8])) {
- $moduledata = $modules[8];
- } else {
- $moduledata = $modules[array_rand($modules)];
- }
-
- $libfile = "$CFG->dirroot/mod/$moduledata->name/lib.php";
- if (file_exists($libfile)) {
- if (!in_array($libfile, $libraries)) {
- $this->verbose("Including library for $moduledata->name...");
- $libraries[] = $libfile;
- require_once($libfile);
- }
- } else {
- $this->verbose("Could not load lib file for module $moduledata->name!");
- if (!$this->get('ignore_errors')) {
- die();
- }
- }
-
- // Basically 2 types of text fields: description and content
- $description = "This $moduledata->name has been randomly generated by a very useful script, "
- . "for the purpose of testing "
- . "the boundaries of Moodle in various contexts. Moodle should be able to scale to "
- . "any size without "
- . "its speed and ease of use being affected dramatically.";
- $content = 'Very useful content, I am sure you would agree';
-
- $module_type_index = 0;
- $module->introformat = FORMAT_MOODLE;
- $module->messageformat = FORMAT_MOODLE;
-
- // Special module-specific config
- switch ($moduledata->name) {
- case 'assignment':
- $module->intro = $description;
- $module->assignmenttype = $this->get_module_type('assignment');
- $module->timedue = time() + 89487321;
- $module->grade = rand(50,100);
- break;
- case 'chat':
- $module->intro = $description;
- $module->schedule = 1;
- $module->chattime = 60 * 60 * 4;
- break;
- case 'data':
- $module->intro = $description;
- $module->name = 'test';
- break;
- case 'choice':
- $module->intro = $description;
- $module->text = $content;
- $module->option = array('Good choice', 'Bad choice', 'No choice');
- $module->limit = array(1, 5, 0);
- break;
- case 'comments':
- $module->intro = $description;
- $module->comments = $content;
- break;
- case 'feedback':
- $module->intro = $description;
- $module->page_after_submit = $description;
- $module->comments = $content;
- break;
- case 'forum':
- $module->intro = $description;
- $module->type = $this->get_module_type('forum');
- $module->forcesubscribe = rand(0, 1);
- $module->format = 1;
- break;
- case 'glossary':
- $module->intro = $description;
- $module->displayformat = $this->glossary_formats[rand(0, count($this->glossary_formats) - 1)];
- $module->cmidnumber = rand(0,999999);
- break;
- case 'label':
- $module->content = $content;
- $module->intro = $description;
- break;
- case 'lesson':
- $module->lessondefault = 1;
- $module->available = time();
- $module->deadline = time() + 719891987;
- $module->grade = 100;
- break;
- case 'quiz':
- $module->intro = $description;
- $module->feedbacktext = 'blah';
- $module->feedback = 1;
- $module->feedbackboundaries = array(2, 1);
- $module->grade = 10;
- $module->timeopen = time();
- $module->timeclose = time() + 68854;
- $module->shufflequestions = true;
- $module->shuffleanswers = true;
- $module->quizpassword = '';
- break;
- case 'resource':
- $module->type = $this->get_module_type('resource');
- $module->alltext = $content;
- $module->summary = $description;
- $module->windowpopup = rand(0,1);
- $module->display = rand(0,1);
- $module->resizable = rand(0,1);
- $module->scrollbars = rand(0,1);
- $module->directories = rand(0,1);
- $module->location = 'file.txt';
- $module->menubar = rand(0,1);
- $module->toolbar = rand(0,1);
- $module->status = rand(0,1);
- $module->width = rand(200,600);
- $module->height = rand(200,600);
- $module->directories = rand(0,1);
- $module->files = false;
- $module->param_navigationmenu = rand(0,1);
- $module->param_navigationbuttons = rand(0,1);
- $module->reference = 1;
- $module->forcedownload = 1;
- break;
- case 'survey':
- $module->template = rand(1,5);
- $module->intro = $description;
- break;
- case 'wiki':
- $module->intro = $description;
- $module->summary = $description;
- break;
- }
-
- $module->name = ucfirst($moduledata->name) . ' ' . $moduledata->count++;
-
- $module->course = $courseid;
- $module->section = 0;
- $module->module = $moduledata->id;
- $module->modulename = $moduledata->name;
- $module->add = $moduledata->name;
- $module->cmidnumber = '';
- $module->coursemodule = '';
- $add_instance_function = $moduledata->name . '_add_instance';
-
- $module->coursemodule = add_course_module($module);
-
- if (function_exists($add_instance_function)) {
- $this->verbose("Calling module function $add_instance_function");
- $module->instance = $add_instance_function($module, '');
- $DB->set_field('course_modules', 'instance', $module->instance, array('id'=>$module->coursemodule));
- } else {
- $this->verbose("Function $add_instance_function does not exist!");
- if (!$this->get('ignore_errors')) {
- die();
- }
- }
-
- $module->section = course_add_cm_to_section($courseid, $module->coursemodule, $i);
-
- $module->cmidnumber = set_coursemodule_idnumber($module->coursemodule, '');
-
- $this->verbose("A $moduledata->name module was added to section $i (id $module->section) "
- ."of course $courseid.");
-
- $module_instance = $DB->get_field('course_modules', 'instance', array('id' => $module->coursemodule));
- $module_record = $DB->get_record($moduledata->name, array('id' => $module_instance));
- $module_record->instance = $module_instance;
-
- if (empty($modules_array[$moduledata->name])) {
- $modules_array[$moduledata->name] = array();
- }
-
- // TODO Find out why some $module_record end up empty here... (particularly quizzes)
- if (!empty($module_record->instance)) {
- $modules_array[$moduledata->name][] = $module_record;
- }
- }
- }
- }
-
- if (!$this->get('quiet')) {
- echo "Successfully generated " . $this->get('number_of_modules') * $this->get('number_of_sections')
- . " modules in each course!{$this->eolchar}";
- }
-
- return $modules_array;
- }
- return null;
- }
-
- public function generate_questions($courses, $modules) {
- global $DB, $CFG;
-
- if (!is_null($this->get('questions_per_course')) && count($courses) > 0 && is_array($courses)) {
- require_once($CFG->libdir .'/questionlib.php');
- require_once($CFG->dirroot .'/mod/quiz/editlib.php');
- $questions = array();
- $questionsmenu = question_bank::get_creatable_qtypes();
- $questiontypes = array();
- foreach ($questionsmenu as $qtype => $qname) {
- $questiontypes[] = $qtype;
- }
-
- // Add the questions
- foreach ($courses as $courseid) {
- $questions[$courseid] = array();
- for ($i = 0; $i < $this->get('questions_per_course'); $i++) {
- $qtype = $questiontypes[array_rand($questiontypes)];
-
- // Only the following types are supported right now. Hang around for more!
- $supported_types = array('match', 'essay', 'multianswer', 'multichoice', 'shortanswer',
- 'numerical', 'truefalse', 'calculated');
- $qtype = $supported_types[array_rand($supported_types)];
-
- if ($qtype == 'calculated') {
- continue;
- }
- $classname = "question_{$qtype}_qtype";
- if ($qtype == 'multianswer') {
- $classname = "embedded_cloze_qtype";
- }
-
- $question = new $classname();
- $question->qtype = $qtype;
- $questions[$courseid][] = $question->generate_test("question$qtype-$i", $courseid);
- $this->verbose("Generated a question of type $qtype for course id $courseid.");
- }
- }
-
- // Assign questions to quizzes, if such exist
- if (!empty($modules['quiz']) && !empty($questions) && !is_null($this->get('questions_per_quiz'))) {
- $quizzes = $modules['quiz'];
-
- // Cannot assign more questions per quiz than are available, so determine which is the largest
- $questions_per_quiz = max(count($questions), $this->get('questions_per_quiz'));
-
- foreach ($quizzes as $quiz) {
- $questions_added = array();
- for ($i = 0; $i < $questions_per_quiz; $i++) {
-
- // Add a random question to the quiz
- do {
- if (empty($quiz->course)) {
- print_object($quizzes);die();
- }
- $random = rand(0, count($questions[$quiz->course]));
- } while (in_array($random, $questions_added) || !array_key_exists($random, $questions[$quiz->course]));
-
- if (!quiz_add_quiz_question($questions[$quiz->course][$random]->id, $quiz)) {
-
- // Could not add question to quiz!! report error
- if (!$this->get('quiet')) {
- echo "WARNING: Could not add question id $random to quiz id $quiz->id{$this->eolchar}";
- }
- } else {
- $this->verbose("Adding question id $random to quiz id $quiz->id.");
- $questions_added[] = $random;
- }
- }
- }
- }
- return $questions;
- }
- return null;
- }
-
- public function generate_role_assignments($users, $courses) {
- global $CFG, $DB;
- $course_users = array();
-
- if (count($courses) > 0) {
- $this->verbose("Inserting student->course role assignments...");
- $assigned_count = 0;
- $assigned_users = array();
-
- foreach ($courses as $courseid) {
- $course_users[$courseid] = array();
-
- // Select $students_per_course for assignment to course
- shuffle($users);
- $users_to_assign = array_slice($users, 0, $this->get('students_per_course'));
-
- $context = context_course::instance($courseid);
- foreach ($users_to_assign as $random_user) {
- role_assign(5, $random_user, $context->id);
-
- $assigned_count++;
- $course_users[$courseid][] = $random_user;
- if (!isset($assigned_users[$random_user])) {
- $assigned_users[$random_user] = 1;
- } else {
- $assigned_users[$random_user]++;
- }
- $this->verbose("Student $random_user was assigned to course $courseid.");
- }
- }
-
- if (!$this->get('quiet')) {
- echo "$assigned_count user => course role assignments have been correctly performed.{$this->eolchar}";
- }
- return $course_users;
- }
- return null;
- }
-
- public function generate_forum_posts($course_users, $modules) {
- global $CFG, $DB, $USER;
-
- if (in_array('forum', $this->modules_list) &&
- $this->get('discussions_per_forum') &&
- $this->get('posts_per_discussion') &&
- isset($modules['forum'])) {
-
- $discussions_count = 0;
- $posts_count = 0;
-
- foreach ($modules['forum'] as $forum) {
- $forum_users = $course_users[$forum->course];
-
- for ($i = 0; $i < $this->get('discussions_per_forum'); $i++) {
- $mform = new fake_form();
-
- require_once($CFG->dirroot.'/mod/forum/lib.php');
-
- $discussion = new stdClass();
- $discussion->course = $forum->course;
- $discussion->forum = $forum->id;
- $discussion->name = 'Test discussion';
- $discussion->intro = 'This is just a test forum discussion';
- $discussion->assessed = 0;
- $discussion->messageformat = 1;
- $discussion->messagetrust = 0;
- $discussion->mailnow = false;
- $discussion->groupid = -1;
- $discussion->attachments = null;
- $discussion->itemid = 752157083;
-
- $message = '';
- $super_global_user = clone($USER);
- $user_id = $forum_users[array_rand($forum_users)];
- $USER = $DB->get_record('user', array('id' => $user_id));
-
- if ($discussion_id = forum_add_discussion($discussion, $mform, $message)) {
- $discussion = $DB->get_record('forum_discussions', array('id' => $discussion_id));
- $discussions_count++;
-
- // Add posts to this discussion
- $post_ids = array($discussion->firstpost);
-
- for ($j = 0; $j < $this->get('posts_per_discussion'); $j++) {
- $global_user = clone($USER);
- $user_id = $forum_users[array_rand($forum_users)];
- $USER = $DB->get_record('user', array('id' => $user_id));
- $post = new stdClass();
- $post->discussion = $discussion_id;
- $post->subject = 'Re: test discussion';
- $post->message = '
';
- public $mform;
-
- public function setup() {
- global $CFG;
- $this->mform = new generator_form();
-
- if ($data = $this->mform->get_data(false)) {
- $this->do_generation = optional_param('do_generation', false, PARAM_BOOL);
- foreach ($this->settings as $setting) {
- if (isset($data->{$setting->long})) {
- $this->set($setting->long, $data->{$setting->long});
- }
- }
- } else {
- $this->do_generation = false;
- }
- }
-
- public function display() {
- global $OUTPUT, $PAGE;
- $PAGE->set_title("Data generator");
- echo $OUTPUT->header();
- echo $OUTPUT->heading("Data generator: web interface");
- echo $OUTPUT->heading("FOR DEVELOPMENT PURPOSES ONLY. DO NOT USE ON A PRODUCTION SITE!", 3);
- echo $OUTPUT->heading("Your database contents will probably be massacred. You have been warned", 5);
-
- $this->mform->display();
- $this->connect();
- }
-
- public function complete() {
- global $OUTPUT;
- $this->dispose();
- echo $OUTPUT->footer();
- }
-}
-
-class generator_silent extends generator {
-
-}
-
-function generator_generate_data($settings) {
- $generator = new generator($settings);
- $generator->do_generation = true;
- $generator->generate_data();
-}
-
-class fake_form {
- function get_new_filename($string) {
- return false;
- }
-
- function save_stored_file() {
- return true;
- }
-
- function get_data() {
- return array();
- }
-}
-
-class generator_form extends moodleform {
- function definition() {
- global $generator, $CFG; //TODO: sloppy coding style!!
-
- $mform =& $this->_form;
- $mform->addElement('hidden', 'do_generation', 1);
- $mform->setType('do_generation', PARAM_INT);
-
- foreach ($generator->settings as $setting) {
- $type = 'advcheckbox';
- $options = null;
- $htmloptions = null;
-
- $label = ucfirst(str_replace('_', ' ', $setting->long));
- if (!empty($setting->type) && $setting->type == 'mod1,mod2...') {
- $type = 'select';
- $options = $generator->modules_list;
- $htmloptions = array('multiple' => 'multiple');
- } elseif (!empty($setting->type) && $setting->type == 'SELECT') {
- $type = 'select';
- $options = array();
- foreach ($setting->default as $option) {
- $options[$option] = $option;
- }
- $htmloptions = array('multiple' => 'multiple');
- } elseif (!empty($setting->type)) {
- $type = 'text';
- }
-
- if ($setting->long == 'password' || $setting->long == 'username') {
- continue;
- }
-
- $mform->addElement($type, $setting->long, $label, $options, $htmloptions);
-
- if (isset($setting->default)) {
- $mform->setDefault($setting->long, $setting->default);
- }
- }
- $this->add_action_buttons(false, 'Generate data!');
- }
-
- function definition_after_data() {
-
- }
-}
diff --git a/admin/tool/generator/version.php b/admin/tool/generator/version.php
index 3733d984b92..cc8744f3877 100644
--- a/admin/tool/generator/version.php
+++ b/admin/tool/generator/version.php
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2013090200;
+$plugin->version = 2013091200;
$plugin->requires = 2013090200;
$plugin->component = 'tool_generator';
From 82d05bc63fa1cd0ba55c4907784f19a9e56415af Mon Sep 17 00:00:00 2001
From: Adrian Greeve true
+ ');
+ Y.one('#connection-status').removeClass('notconnected').addClass('connecting').setHTML(loading);
+ break;
+ case 'notconnected':
+ var notconnected = M.util.get_string('notconnected', 'badges');;
+ Y.one('#connection-status').removeClass('connecting').addClass('notconnected').setHTML(notconnected);
+ break;
+ default:
+ // Unknown status, do nothing.
+ }
+}
+
+/*
+ * Print an error message at the top of the page.
+ */
+function badges_set_error_message(messagekey, param) {
+ var errortext = M.util.get_string(messagekey, 'badges', param);
+ Y.one('#connection-error').setHTML(errortext);
+}
+
+/*
+ * Handle the assertion generated by the Persona dialog.
+ */
+function badges_handle_assertion(assertion) {
+
+ if (!assertion) {
+ var noassertionstr = M.util.get_string('error:noassertion', 'badges');
+ badges_set_error_message('error:backpackloginfailed', noassertionstr);
+ return;
+ }
+
+ badges_set_connection_progress('connecting');
+
+ Y.io("backpackconnect.php", {
+ method: "POST",
+ data: "assertion="+assertion+"&sesskey="+M.cfg.sesskey,
+ on: {
+ success: function (id, result) {
+ // Reload page to display connected email address.
+ window.location.href = "mybackpack.php";
+ },
+ failure: function (id, result) {
+ try {
+ var parsedResponse = Y.JSON.parse(result.response);
+ } catch (e) {
+ badges_set_connection_progress('notconnected');
+ var badjsonstr = M.util.get_string('error:badjson', 'badges');
+ badges_set_error_message('error:backpackloginfailed', badjsonstr);
+ return;
+ }
+ badges_set_connection_progress('notconnected');
+ badges_set_error_message('error:backpackloginfailed', parsedResponse.reason);
+ return;
+ }
+ }
+ });
+}
+
+/**
+ * Create and bind the persona login button.
+ */
+function badges_init_persona_login_button() {
+ // Create the login button and add to the page via Javascript.
+ var imageurl = M.util.image_url('i/persona_sign_in_black', 'moodle');
+ var imagealt = M.util.get_string('signinwithyouremail', 'badges');
+ var button = Y.Node.create('
');
+ Y.one('#persona-container').append(button);
+
+ // Bind a click event to trigger login when clicked.
+ button.on('click', function() {
+ Y.one('#connection-error').empty();
+ navigator.id.get(badges_handle_assertion);
+ });
+}
diff --git a/badges/backpack_form.php b/badges/backpack_form.php
index dce06305ec1..ad9d427feb1 100644
--- a/badges/backpack_form.php
+++ b/badges/backpack_form.php
@@ -39,28 +39,37 @@ class edit_backpack_form extends moodleform {
* Defines the form
*/
public function definition() {
- global $USER;
+ global $USER, $PAGE, $OUTPUT;
$mform = $this->_form;
+ $mform->addElement('html', html_writer::tag('span', '', array('class' => 'notconnected', 'id' => 'connection-error')));
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
- $mform->addElement('static', 'url', get_string('url'), 'http://backpack.openbadges.org');
- $status = html_writer::tag('span', get_string('notconnected', 'badges'), array('class' => 'notconnected'));
+ $mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
+ $status = html_writer::tag('span', get_string('notconnected', 'badges'),
+ array('class' => 'notconnected', 'id' => 'connection-status'));
$mform->addElement('static', 'status', get_string('status'), $status);
- $mform->addElement('text', 'email', get_string('email'), array('size' => '50'));
- $mform->setDefault('email', $USER->email);
- $mform->setType('email', PARAM_RAW);
- $mform->addRule('email', get_string('required'), 'required', null , 'client');
- $mform->addHelpButton('email', 'backpackemail', 'badges');
+ $nojs = html_writer::tag('noscript', get_string('error:personaneedsjs', 'badges'),
+ array('class' => 'notconnected'));
+ $personadiv = $OUTPUT->container($nojs, null, 'persona-container');
+
+ $mform->addElement('static', 'persona', '', $personadiv);
+ $mform->addHelpButton('persona', 'personaconnection', 'badges');
+
+ $PAGE->requires->js(new moodle_url('https://login.persona.org/include.js'));
+ $PAGE->requires->js('/badges/backpack.js');
+ $PAGE->requires->js_init_call('badges_init_persona_login_button', null, false);
+ $PAGE->requires->strings_for_js(array('error:backpackloginfailed', 'signinwithyouremail',
+ 'error:noassertion', 'error:connectionunknownreason', 'error:badjson', 'connecting',
+ 'notconnected'), 'badges');
$mform->addElement('hidden', 'userid', $USER->id);
$mform->setType('userid', PARAM_INT);
- $mform->addElement('hidden', 'backpackurl', 'http://backpack.openbadges.org');
+ $mform->addElement('hidden', 'backpackurl', BADGE_BACKPACKURL);
$mform->setType('backpackurl', PARAM_URL);
- $this->add_action_buttons(true, get_string('connect', 'badges'));
}
/**
@@ -70,18 +79,14 @@ class edit_backpack_form extends moodleform {
global $DB;
$errors = parent::validation($data, $files);
- if (!validate_email($data['email'])) {
- $errors['email'] = get_string('invalidemail');
- } else {
- $check = new stdClass();
- $check->backpackurl = $data['backpackurl'];
- $check->email = $data['email'];
+ $check = new stdClass();
+ $check->backpackurl = $data['backpackurl'];
+ $check->email = $data['email'];
- $bp = new OpenBadgesBackpackHandler($check);
- $request = $bp->curl_request('user');
- if (isset($request->status) && $request->status == 'missing') {
- $errors['email'] = get_string('error:nosuchuser', 'badges');
- }
+ $bp = new OpenBadgesBackpackHandler($check);
+ $request = $bp->curl_request('user');
+ if (isset($request->status) && $request->status == 'missing') {
+ $errors['email'] = get_string('error:nosuchuser', 'badges');
}
return $errors;
}
@@ -113,7 +118,7 @@ class edit_collections_form extends moodleform {
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
- $mform->addElement('static', 'url', get_string('url'), 'http://backpack.openbadges.org');
+ $mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
$status = html_writer::tag('span', get_string('connected', 'badges'), array('class' => 'connected'));
$mform->addElement('static', 'status', get_string('status'), $status);
diff --git a/badges/backpackconnect.php b/badges/backpackconnect.php
new file mode 100644
index 00000000000..55bc2ecf0c8
--- /dev/null
+++ b/badges/backpackconnect.php
@@ -0,0 +1,136 @@
+.
+
+/**
+ * AJAX script for validating backpack connection.
+ *
+ * @package core
+ * @subpackage badges
+ * @copyright 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @author Simon Coggins
8b*cZdJVrS75VZL`CV4%axaKuU}O#mQCbA+k7z}jd;DgQu&X
J%Q~loCIAfaX*>V`
literal 0
HcmV?d00001
diff --git a/pix/e/insert.svg b/pix/e/insert.svg
new file mode 100644
index 00000000000..fe2b0eebe75
--- /dev/null
+++ b/pix/e/insert.svg
@@ -0,0 +1,16 @@
+
+
+
+]>
+
diff --git a/pix/e/insert_col_after.png b/pix/e/insert_col_after.png
new file mode 100644
index 0000000000000000000000000000000000000000..e29d46dc5c7101ad5cb0e6e25aa5d86c016f3548
GIT binary patch
literal 203
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk?
zp1FzXsX?iUDV2pMQ*D5Xay?xfLn>}1{rUgjo_S-!wKb6vT{9SQfJx7#K_v;=aMa
zz3zo0duC>4k3%VcgHNT(!*-n$ToWEk&*e`QWB6F5!p!Bt#k^plbi)-#jqeH_{(cH#
y3YS%+8Mb_7no!ho>4~dyz~{!qDME})JPZ`9Ef-l|A4Z28JGp{V836IbPc&y9k!gczB4806H{m_ObtyaTkJ!PC{xWt~$(
F696LxN5KF9
literal 0
HcmV?d00001
diff --git a/pix/e/insert_col_before.svg b/pix/e/insert_col_before.svg
new file mode 100644
index 00000000000..7c2ab5a926d
--- /dev/null
+++ b/pix/e/insert_col_before.svg
@@ -0,0 +1,14 @@
+
+
+
+]>
+
diff --git a/pix/e/insert_date.png b/pix/e/insert_date.png
new file mode 100644
index 0000000000000000000000000000000000000000..0f74951f34c1500d3a37d01c4d43e03dfe752806
GIT binary patch
literal 179
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk?
zp1FzXsX?iUDV2pMQ*D5XLOop^Ln>}1&9N+gR?nv3;q9Hwa&dFoS*Fh$8B0tR?3B+i
z6fvA&P-Ej_Jj!O!u!n(#XGziwyIU2EBBwS?ICfO7CDEa0b9
+
+
+]>
+
diff --git a/pix/e/styleprops.png b/pix/e/styleprops.png
new file mode 100644
index 0000000000000000000000000000000000000000..888ead7c9f6f12b31194a69572e7da0125057eca
GIT binary patch
literal 312
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk?
zp1FzXsX?iUDV2pMQ*D5XZh5*mhE&{2`t$$4Ju}alS*F>H6S~@qm@i+tWM&}1;Nvli
zb%IH=0~51g181jfgW7X`(
QOnd>X
zI~c;werRzyATVcEV2~1@^M|ZsvxFKI^BH)B*_>t-s-><_
',document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(u):document.execCommand("insertHTML",!1,u)}},get_form_content:function(t){var n=e.Node.create('"+"
"+M.util.get_string("accessibilityhint","atto_image"));return n.one("#atto_image_urlentrysubmit").on("click",M.atto_image.set_image),n.one("#openimagebrowser").on("click",M.atto_image.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
+YUI.add("moodle-atto_image-button",function(e,t){M.atto_image=M.atto_image||{dialogue:null,selection:null,init:function(t){var n=function(t,n){t.preventDefault(),M.editor_atto.is_active(n)||M.editor_atto.focus(n),M.atto_image.selection=M.editor_atto.get_selection();if(M.atto_image.selection!==!1){var r;M.atto_image.dialogue?r=M.atto_image.dialogue:r=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),r.set("bodyContent",M.atto_image.get_form_content(n)),r.set("headerContent",M.util.get_string("createimage","atto_image")),r.render(),r.centerDialogue(),M.atto_image.dialogue=r;var i=M.editor_atto.get_selection_text(),s=0,o=[];for(s=0;s',document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(u):document.execCommand("insertHTML",!1,u)}},get_form_content:function(t){var n=e.Node.create('"+"
"+M.util.get_string("accessibilityhint","atto_image"));return n.one("#atto_image_urlentrysubmit").on("click",M.atto_image.set_image),n.one("#openimagebrowser").on("click",M.atto_image.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
diff --git a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js
index 2658d79173d..d8c624d88f3 100644
--- a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js
+++ b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js
@@ -87,7 +87,7 @@ M.atto_image = M.atto_image || {
}
};
- M.editor_atto.add_toolbar_button(params.elementid, 'image', params.icon, display_chooser, this);
+ M.editor_atto.add_toolbar_button(params.elementid, 'image', params.icon, params.group, display_chooser, this);
},
open_filepicker : function(e) {
var elementid = this.getAttribute('data-editor');
diff --git a/lib/editor/atto/plugins/image/yui/src/button/js/button.js b/lib/editor/atto/plugins/image/yui/src/button/js/button.js
index ee7989b7ecd..791d2242aea 100644
--- a/lib/editor/atto/plugins/image/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/image/yui/src/button/js/button.js
@@ -85,7 +85,7 @@ M.atto_image = M.atto_image || {
}
};
- M.editor_atto.add_toolbar_button(params.elementid, 'image', params.icon, display_chooser, this);
+ M.editor_atto.add_toolbar_button(params.elementid, 'image', params.icon, params.group, display_chooser, this);
},
open_filepicker : function(e) {
var elementid = this.getAttribute('data-editor');
diff --git a/lib/editor/atto/plugins/indent/lib.php b/lib/editor/atto/plugins/indent/lib.php
index eb31579626d..52c58d2b555 100644
--- a/lib/editor/atto/plugins/indent/lib.php
+++ b/lib/editor/atto/plugins/indent/lib.php
@@ -31,21 +31,21 @@ defined('MOODLE_INTERNAL') || die();
function atto_indent_init_editor($elementid) {
global $PAGE, $OUTPUT;
- $icon = $OUTPUT->pix_icon('indent',
+ $icon = $OUTPUT->pix_icon('e/increase_indent',
get_string('indent', 'atto_indent'),
- 'atto_indent',
+ 'moodle',
array('class'=>'icon'));
$PAGE->requires->yui_module('moodle-atto_indent-button',
'M.atto_indent.init',
- array(array('elementid'=>$elementid, 'icon'=>$icon)),
+ array(array('elementid'=>$elementid, 'icon'=>$icon, 'group'=>'list')),
true);
}
/**
* Return the order this plugin should be displayed in the toolbar
- * @return int
+ * @return int the absolute position within the toolbar
*/
function atto_indent_sort_order() {
return 5;
diff --git a/lib/editor/atto/plugins/indent/pix/indent.png b/lib/editor/atto/plugins/indent/pix/indent.png
deleted file mode 100644
index 227ddd68032358c81eab17339211675440a0a648..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 439
zcmeAS@N?(olHy`uVBq!ia0vp^0w4?`7_vBO{sAebByV?@|Nli+8=eL7I14-?i-EKU
z7`vU!wgWPXJY5_^G|ngg@Mkc%;Ct}&^y=?>>U!M|ZqMIcc5c?r%Fm14E7tt@^76*U
z%Hr^~y9yt_kDrtG
"+M.util.get_string("accessibilityhint","atto_link"));return n.one("#atto_link_urlentrysubmit").on("click",M.atto_link.set_link),n.one("#openlinkbrowser").on("click",M.atto_link.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
+YUI.add("moodle-atto_link-button",function(e,t){M.atto_link=M.atto_link||{dialogue:null,selection:null,init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),M.atto_link.selection=M.editor_atto.get_selection();if(M.atto_link.selection!==!1&&!M.atto_link.selection.collapsed){var n;M.atto_link.dialogue?n=M.atto_link.dialogue:n=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),n.render(),n.set("bodyContent",M.atto_link.get_form_content(t)),n.set("headerContent",M.util.get_string("createlink","atto_link")),M.atto_link.resolve_anchors(),n.show(),M.atto_link.dialogue=n}};M.editor_atto.add_toolbar_button(e.elementid,"link",e.icon,e.group,t,this)},resolve_anchors:function(){var t=M.editor_atto.get_selection_parent_node(),n,r;if(!t)return;n=e.one(t).ancestor("a"),n&&(r=n.getAttribute("href"),r!==""&&(M.atto_link.selection=M.editor_atto.get_selection_from_node(n),e.one("#atto_link_urlentry").set("value",r)))},open_filepicker:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"link",M.atto_link.filepicker_callback)},filepicker_callback:function(e){M.atto_link.dialogue.hide(),e.url!==""&&(M.editor_atto.set_selection(M.atto_link.selection),document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,e.url))},set_link:function(e){e.preventDefault(),M.atto_link.dialogue.hide();var t=e.currentTarget.get("parentNode").one("input"),n=t.get("value");n!==""&&(M.editor_atto.set_selection(M.atto_link.selection),document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,n))},get_form_content:function(t){var n=e.Node.create('"+"
"+M.util.get_string("accessibilityhint","atto_link"));return n.one("#atto_link_urlentrysubmit").on("click",M.atto_link.set_link),n.one("#openlinkbrowser").on("click",M.atto_link.open_filepicker),n}}},"@VERSION@",{requires:["node","escape"]});
diff --git a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button.js b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button.js
index c352f07b7fe..69cc68918ee 100644
--- a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button.js
+++ b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button.js
@@ -56,7 +56,7 @@ M.atto_link = M.atto_link || {
}
};
- M.editor_atto.add_toolbar_button(params.elementid, 'link', params.icon, display_chooser, this);
+ M.editor_atto.add_toolbar_button(params.elementid, 'link', params.icon, params.group, display_chooser, this);
},
resolve_anchors : function() {
// Find the first anchor tag in the selection.
diff --git a/lib/editor/atto/plugins/link/yui/src/button/js/button.js b/lib/editor/atto/plugins/link/yui/src/button/js/button.js
index b719e9a92b5..329e1f7b99e 100644
--- a/lib/editor/atto/plugins/link/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/link/yui/src/button/js/button.js
@@ -54,7 +54,7 @@ M.atto_link = M.atto_link || {
}
};
- M.editor_atto.add_toolbar_button(params.elementid, 'link', params.icon, display_chooser, this);
+ M.editor_atto.add_toolbar_button(params.elementid, 'link', params.icon, params.group, display_chooser, this);
},
resolve_anchors : function() {
// Find the first anchor tag in the selection.
diff --git a/lib/editor/atto/plugins/media/lib.php b/lib/editor/atto/plugins/media/lib.php
index d0a4428191c..c38198b3390 100644
--- a/lib/editor/atto/plugins/media/lib.php
+++ b/lib/editor/atto/plugins/media/lib.php
@@ -29,9 +29,9 @@
function atto_media_init_editor($elementid) {
global $PAGE, $OUTPUT;
- $icon = $OUTPUT->pix_icon('media',
+ $icon = $OUTPUT->pix_icon('e/insert_edit_video',
get_string('media', 'atto_media'),
- 'atto_media',
+ 'moodle',
array('class'=>'icon'));
$PAGE->requires->strings_for_js(array('createmedia',
@@ -42,14 +42,14 @@ function atto_media_init_editor($elementid) {
'atto_media');
$PAGE->requires->yui_module('moodle-atto_media-button',
'M.atto_media.init',
- array(array('elementid'=>$elementid, 'icon'=>$icon)),
+ array(array('elementid'=>$elementid, 'icon'=>$icon, 'group'=>'file')),
true);
}
/**
* Return the order this plugin should be displayed in the toolbar
- * @return int
+ * @return int the absolute position within the toolbar
*/
function atto_media_sort_order() {
return 14;
diff --git a/lib/editor/atto/plugins/media/pix/media.png b/lib/editor/atto/plugins/media/pix/media.png
deleted file mode 100644
index 36b2828d1e878314dbb1c7406a0fc6e4412c9a20..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 489
zcmeAS@N?(olHy`uVBq!ia0vp^0w4?`7_vBO{sAebByV?@|Nli+8=eL7I14-?i-EKU
z7`vU!wgWPjdAc};Xq=yVVK-N^fk?x{J^!VT=qX)Y6m6|~iBD6K<>J8#Nf(y_z9X)J
zrdQXloWAY9
"+M.util.get_string("accessibilityhint","atto_media"));return n.one("#atto_media_urlentrysubmit").on("click",M.atto_media.set_media),n.one("#openmediabrowser").on("click",M.atto_media.open_browser),n}}},"@VERSION@",{requires:["node","escape"]});
+YUI.add("moodle-atto_media-button",function(e,t){M.atto_media=M.atto_media||{dialogue:null,selection:null,init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),M.atto_media.selection=M.editor_atto.get_selection();if(M.atto_media.selection!==!1){var n;M.atto_media.dialogue?n=M.atto_media.dialogue:n=new M.core.dialogue({visible:!1,modal:!0,close:!0,draggable:!0}),n.render(),n.set("bodyContent",M.atto_media.get_form_content(t)),n.set("headerContent",M.util.get_string("createmedia","atto_media")),n.centerDialogue(),n.show(),M.atto_media.dialogue=n}};M.editor_atto.add_toolbar_button(e.elementid,"media",e.icon,e.group,t,this)},open_browser:function(e){var t=this.getAttribute("data-editor");e.preventDefault(),M.editor_atto.show_filepicker(t,"media",M.atto_media.filepicker_callback)},filepicker_callback:function(t){if(t.url!==""){var n=e.one("#atto_media_urlentry");n.set("value",t.url),n=e.one("#atto_media_nameentry"),n.set("value",t.file)}},set_media:function(t){t.preventDefault(),M.atto_media.dialogue.hide();var n=t.currentTarget.get("parentNode").one("#atto_media_urlentry"),r=n.get("value");n=t.currentTarget.get("parentNode").one("#atto_media_nameentry");var i=n.get("value");if(r!==""&&i!==""){M.editor_atto.set_selection(M.atto_media.selection);var s=''+i+"";document.selection&&document.selection.createRange().pasteHTML?document.selection.createRange().pasteHTML(s):document.execCommand("insertHTML",!1,s)}},get_form_content:function(t){var n=e.Node.create('"+"
"+M.util.get_string("accessibilityhint","atto_media"));return n.one("#atto_media_urlentrysubmit").on("click",M.atto_media.set_media),n.one("#openmediabrowser").on("click",M.atto_media.open_browser),n}}},"@VERSION@",{requires:["node","escape"]});
diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js
index 587b48280b1..e4fcc22e3f4 100644
--- a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js
+++ b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js
@@ -54,7 +54,7 @@ M.atto_media = M.atto_media || {
}
};
- M.editor_atto.add_toolbar_button(params.elementid, 'media', params.icon, display_chooser, this);
+ M.editor_atto.add_toolbar_button(params.elementid, 'media', params.icon, params.group, display_chooser, this);
},
open_browser : function(e) {
var elementid = this.getAttribute('data-editor');
diff --git a/lib/editor/atto/plugins/media/yui/src/button/js/button.js b/lib/editor/atto/plugins/media/yui/src/button/js/button.js
index ccbbbb5c292..70fe607198f 100644
--- a/lib/editor/atto/plugins/media/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/media/yui/src/button/js/button.js
@@ -52,7 +52,7 @@ M.atto_media = M.atto_media || {
}
};
- M.editor_atto.add_toolbar_button(params.elementid, 'media', params.icon, display_chooser, this);
+ M.editor_atto.add_toolbar_button(params.elementid, 'media', params.icon, params.group, display_chooser, this);
},
open_browser : function(e) {
var elementid = this.getAttribute('data-editor');
diff --git a/lib/editor/atto/plugins/orderedlist/lib.php b/lib/editor/atto/plugins/orderedlist/lib.php
index 524202c1f2c..0fe7d650b53 100644
--- a/lib/editor/atto/plugins/orderedlist/lib.php
+++ b/lib/editor/atto/plugins/orderedlist/lib.php
@@ -31,21 +31,21 @@ defined('MOODLE_INTERNAL') || die();
function atto_orderedlist_init_editor($elementid) {
global $PAGE, $OUTPUT;
- $icon = $OUTPUT->pix_icon('orderedlist',
+ $icon = $OUTPUT->pix_icon('e/numbered_list',
get_string('orderedlist', 'atto_orderedlist'),
- 'atto_orderedlist',
+ 'moodle',
array('class'=>'icon'));
$PAGE->requires->yui_module('moodle-atto_orderedlist-button',
'M.atto_orderedlist.init',
- array(array('elementid'=>$elementid, 'icon'=>$icon)),
+ array(array('elementid'=>$elementid, 'icon'=>$icon, 'group'=>'list')),
true);
}
/**
* Return the order this plugin should be displayed in the toolbar
- * @return int
+ * @return array groupname followed by the absolute position within the toolbar
*/
function atto_orderedlist_sort_order() {
return 6;
diff --git a/lib/editor/atto/plugins/orderedlist/pix/orderedlist.png b/lib/editor/atto/plugins/orderedlist/pix/orderedlist.png
deleted file mode 100644
index 33fbb6308053088f0166b061104475053b08f284..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 465
zcmeAS@N?(olHy`uVBq!ia0vp^0w4?`7_vBO{sAebByV?@|Nli+8=eL7I14-?i-EKU
z7`vU!wgWPnJY5_^G|n%bV94)aAkg~v|NTI=E30O|&{=uGWyUVkjhzx17EKppTk>~4
zJ$-uj^Mk&DC9*aTV%5(x&llKscE&0tVTL%aptglm>V-HMAB#MTq$o2R$jz*PGWCG=@)`J<1D(O(>FVdQ
I&MBb@06@X6?*IS*
diff --git a/lib/editor/atto/plugins/strike/pix/strike.svg b/lib/editor/atto/plugins/strike/pix/strike.svg
deleted file mode 100644
index 214f25716d8..00000000000
--- a/lib/editor/atto/plugins/strike/pix/strike.svg
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
diff --git a/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-debug.js b/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-debug.js
index 34f2908e848..3807083bb86 100644
--- a/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-debug.js
+++ b/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-debug.js
@@ -32,7 +32,7 @@ M.atto_strike = M.atto_strike || {
document.execCommand('strikeThrough', false, null);
};
- M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, click);
+ M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, params.group, click);
}
};
diff --git a/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-min.js b/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-min.js
index d37fd84168a..873cb8c3c0d 100644
--- a/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-min.js
+++ b/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button-min.js
@@ -1 +1 @@
-YUI.add("moodle-atto_strike-button",function(e,t){M.atto_strike=M.atto_strike||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("strikeThrough",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"strike",e.icon,t)}}},"@VERSION@",{requires:["node"]});
+YUI.add("moodle-atto_strike-button",function(e,t){M.atto_strike=M.atto_strike||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("strikeThrough",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"strike",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
diff --git a/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button.js b/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button.js
index 34f2908e848..3807083bb86 100644
--- a/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button.js
+++ b/lib/editor/atto/plugins/strike/yui/build/moodle-atto_strike-button/moodle-atto_strike-button.js
@@ -32,7 +32,7 @@ M.atto_strike = M.atto_strike || {
document.execCommand('strikeThrough', false, null);
};
- M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, click);
+ M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, params.group, click);
}
};
diff --git a/lib/editor/atto/plugins/strike/yui/src/button/js/button.js b/lib/editor/atto/plugins/strike/yui/src/button/js/button.js
index 06b0629502d..c69ce0d1476 100644
--- a/lib/editor/atto/plugins/strike/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/strike/yui/src/button/js/button.js
@@ -30,6 +30,6 @@ M.atto_strike = M.atto_strike || {
document.execCommand('strikeThrough', false, null);
};
- M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, click);
+ M.editor_atto.add_toolbar_button(params.elementid, 'strike', params.icon, params.group, click);
}
};
diff --git a/lib/editor/atto/plugins/title/lib.php b/lib/editor/atto/plugins/title/lib.php
index 6f40550c7d8..ae81ffd9d18 100644
--- a/lib/editor/atto/plugins/title/lib.php
+++ b/lib/editor/atto/plugins/title/lib.php
@@ -31,9 +31,13 @@ defined('MOODLE_INTERNAL') || die();
function atto_title_init_editor($elementid) {
global $PAGE, $OUTPUT;
- $icon = $OUTPUT->pix_icon('title',
+ $icon = $OUTPUT->pix_icon('e/styleprops',
get_string('title', 'atto_title'),
- 'atto_title',
+ 'moodle',
+ array('class'=>'icon'));
+ $icon .= $OUTPUT->pix_icon('t/expanded',
+ get_string('title', 'atto_title'),
+ 'moodle',
array('class'=>'icon'));
$PAGE->requires->strings_for_js(array('h3',
@@ -44,14 +48,14 @@ function atto_title_init_editor($elementid) {
'p'), 'atto_title');
$PAGE->requires->yui_module('moodle-atto_title-button',
'M.atto_title.init',
- array(array('elementid'=>$elementid, 'icon'=>$icon)),
+ array(array('elementid'=>$elementid, 'icon'=>$icon, 'group'=>'title')),
true);
}
/**
* Return the order this plugin should be displayed in the toolbar
- * @return int
+ * @return int the absolute position within the toolbar
*/
function atto_title_sort_order() {
return 9;
diff --git a/lib/editor/atto/plugins/title/pix/title.png b/lib/editor/atto/plugins/title/pix/title.png
deleted file mode 100644
index 9a587fb14404f64c4c5082c5484abecb26ca9624..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 550
zcmV+>0@?kEP)
")},n=function(e,t){M.atto_title.change_title(e,t,"
")},r=function(e,t){M.atto_title.change_title(e,t,"
")},i=function(e,t){M.atto_title.change_title(e,t,"
")},s=function(e,t){M.atto_title.change_title(e,t,"")},o=function(e,t){M.atto_title.change_title(e,t,"
"+M.util.get_string("h3","atto_title")+"
",a=""+M.util.get_string("h4","atto_title")+"
",f=""+M.util.get_string("h5","atto_title")+"
",l=""+M.util.get_string("pre","atto_title")+"",c="")},n=function(e,t){M.atto_title.change_title(e,t,"
")},r=function(e,t){M.atto_title.change_title(e,t,"
")},i=function(e,t){M.atto_title.change_title(e,t,"
")},s=function(e,t){M.atto_title.change_title(e,t,"")},o=function(e,t){M.atto_title.change_title(e,t,"
"+M.util.get_string("h3","atto_title")+"
",a=""+M.util.get_string("h4","atto_title")+"
",f=""+M.util.get_string("h5","atto_title")+"
",l=""+M.util.get_string("pre","atto_title")+"",c="6$`
diff --git a/lib/editor/atto/plugins/unlink/pix/unlink.svg b/lib/editor/atto/plugins/unlink/pix/unlink.svg
deleted file mode 100644
index 79126bcda80..00000000000
--- a/lib/editor/atto/plugins/unlink/pix/unlink.svg
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
diff --git a/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-debug.js b/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-debug.js
index 365a993c350..89959a891b3 100644
--- a/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-debug.js
+++ b/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-debug.js
@@ -32,7 +32,7 @@ M.atto_unlink = M.atto_unlink || {
document.execCommand('unlink', false, null);
};
- M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, click);
+ M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, params.group, click);
}
};
diff --git a/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-min.js b/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-min.js
index 4f412d02606..c306b0a19ea 100644
--- a/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-min.js
+++ b/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button-min.js
@@ -1 +1 @@
-YUI.add("moodle-atto_unlink-button",function(e,t){M.atto_unlink=M.atto_unlink||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("unlink",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"unlink",e.icon,t)}}},"@VERSION@",{requires:["node"]});
+YUI.add("moodle-atto_unlink-button",function(e,t){M.atto_unlink=M.atto_unlink||{init:function(e){var t=function(e,t){e.preventDefault(),M.editor_atto.is_active(t)||M.editor_atto.focus(t),document.execCommand("unlink",!1,null)};M.editor_atto.add_toolbar_button(e.elementid,"unlink",e.icon,e.group,t)}}},"@VERSION@",{requires:["node"]});
diff --git a/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button.js b/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button.js
index 365a993c350..89959a891b3 100644
--- a/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button.js
+++ b/lib/editor/atto/plugins/unlink/yui/build/moodle-atto_unlink-button/moodle-atto_unlink-button.js
@@ -32,7 +32,7 @@ M.atto_unlink = M.atto_unlink || {
document.execCommand('unlink', false, null);
};
- M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, click);
+ M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, params.group, click);
}
};
diff --git a/lib/editor/atto/plugins/unlink/yui/src/button/js/button.js b/lib/editor/atto/plugins/unlink/yui/src/button/js/button.js
index fd19d81ea2a..73923fba978 100644
--- a/lib/editor/atto/plugins/unlink/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/unlink/yui/src/button/js/button.js
@@ -30,6 +30,6 @@ M.atto_unlink = M.atto_unlink || {
document.execCommand('unlink', false, null);
};
- M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, click);
+ M.editor_atto.add_toolbar_button(params.elementid, 'unlink', params.icon, params.group, click);
}
};
diff --git a/lib/editor/atto/plugins/unorderedlist/lib.php b/lib/editor/atto/plugins/unorderedlist/lib.php
index 6224f905bab..b70903eb262 100644
--- a/lib/editor/atto/plugins/unorderedlist/lib.php
+++ b/lib/editor/atto/plugins/unorderedlist/lib.php
@@ -29,21 +29,21 @@
function atto_unorderedlist_init_editor($elementid) {
global $PAGE, $OUTPUT;
- $icon = $OUTPUT->pix_icon('unorderedlist',
+ $icon = $OUTPUT->pix_icon('e/bullet_list',
get_string('unorderedlist', 'atto_unorderedlist'),
- 'atto_unorderedlist',
+ 'moodle',
array('class'=>'icon'));
$PAGE->requires->yui_module('moodle-atto_unorderedlist-button',
'M.atto_unorderedlist.init',
- array(array('elementid'=>$elementid, 'icon'=>$icon)),
+ array(array('elementid'=>$elementid, 'icon'=>$icon, 'group'=>'list')),
true);
}
/**
* Return the order this plugin should be displayed in the toolbar
- * @return int
+ * @return int the absolute position within the toolbar
*/
function atto_unorderedlist_sort_order() {
return 7;
diff --git a/lib/editor/atto/plugins/unorderedlist/pix/unorderedlist.png b/lib/editor/atto/plugins/unorderedlist/pix/unorderedlist.png
deleted file mode 100644
index 95b9d12d5487fd9d10f45a82c11384e801edbc82..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 441
zcmeAS@N?(olHy`uVBq!ia0vp^0w4?`7_vBO{sAebByV?@|Nli+8=eL7I14-?i-EKU
z7`vU!wgWQKJY5_^G|ngg@MkbMAo2S8{`&slgL|vp``5(Rzr6JDu)@9f_wOHk@IHP=
zlmGm4^XHou|Nf@#@33dFds@@M)6+e|-rOyIb>-61`F4#r
+
+
+
-
\ No newline at end of file
+
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index 543d1b3dd68..7a9547a9ed0 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -2450,5 +2450,63 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013091300.01);
}
+ if ($oldversion < 2013092000.01) {
+
+ // Define table question_statistics to be created.
+ $table = new xmldb_table('question_statistics');
+
+ // Adding fields to table question_statistics.
+ $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+ $table->add_field('hashcode', XMLDB_TYPE_CHAR, '40', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('questionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('slot', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
+ $table->add_field('subquestion', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('s', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
+ $table->add_field('effectiveweight', XMLDB_TYPE_NUMBER, '15, 5', null, null, null, null);
+ $table->add_field('negcovar', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0');
+ $table->add_field('discriminationindex', XMLDB_TYPE_NUMBER, '15, 5', null, null, null, null);
+ $table->add_field('discriminativeefficiency', XMLDB_TYPE_NUMBER, '15, 5', null, null, null, null);
+ $table->add_field('sd', XMLDB_TYPE_NUMBER, '15, 10', null, null, null, null);
+ $table->add_field('facility', XMLDB_TYPE_NUMBER, '15, 10', null, null, null, null);
+ $table->add_field('subquestions', XMLDB_TYPE_TEXT, null, null, null, null, null);
+ $table->add_field('maxmark', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null);
+ $table->add_field('positions', XMLDB_TYPE_TEXT, null, null, null, null, null);
+ $table->add_field('randomguessscore', XMLDB_TYPE_NUMBER, '12, 7', null, null, null, null);
+
+ // Adding keys to table question_statistics.
+ $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+
+ // Conditionally launch create table for question_statistics.
+ if (!$dbman->table_exists($table)) {
+ $dbman->create_table($table);
+ }
+
+ // Define table question_response_analysis to be created.
+ $table = new xmldb_table('question_response_analysis');
+
+ // Adding fields to table question_response_analysis.
+ $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+ $table->add_field('hashcode', XMLDB_TYPE_CHAR, '40', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('questionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('subqid', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null);
+ $table->add_field('aid', XMLDB_TYPE_CHAR, '100', null, null, null, null);
+ $table->add_field('response', XMLDB_TYPE_TEXT, null, null, null, null, null);
+ $table->add_field('rcount', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
+ $table->add_field('credit', XMLDB_TYPE_NUMBER, '15, 5', null, XMLDB_NOTNULL, null, null);
+
+ // Adding keys to table question_response_analysis.
+ $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+
+ // Conditionally launch create table for question_response_analysis.
+ if (!$dbman->table_exists($table)) {
+ $dbman->create_table($table);
+ }
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2013092000.01);
+ }
+
return true;
}
diff --git a/mod/quiz/report/statistics/db/install.xml b/mod/quiz/report/statistics/db/install.xml
index 1a56de2ee7b..853270d3fb8 100644
--- a/mod/quiz/report/statistics/db/install.xml
+++ b/mod/quiz/report/statistics/db/install.xml
@@ -1,5 +1,5 @@
-
-
-
-
-
", $text);
- }
- return $text;
- }
-
- function mdwp_strip_p($t) { return preg_replace('{?p>}i', '', $t); }
-
- function mdwp_hide_tags($text) {
- global $mdwp_hidden_tags, $mdwp_placeholders;
- return str_replace($mdwp_hidden_tags, $mdwp_placeholders, $text);
- }
- function mdwp_show_tags($text) {
- global $mdwp_hidden_tags, $mdwp_placeholders;
- return str_replace($mdwp_placeholders, $mdwp_hidden_tags, $text);
- }
-}
-
-
-### bBlog Plugin Info ###
-
-function identify_modifier_markdown() {
- return array(
- 'name' => 'markdown',
- 'type' => 'modifier',
- 'nicename' => 'PHP Markdown Extra',
- 'description' => 'A text-to-HTML conversion tool for web writers',
- 'authors' => 'Michel Fortin and John Gruber',
- 'licence' => 'GPL',
- 'version' => MARKDOWNEXTRA_VERSION,
- 'help' => 'Markdown syntax allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by John Gruber. More...',
- );
-}
-
-
-### Smarty Modifier Interface ###
-
-function smarty_modifier_markdown($text) {
- return Markdown($text);
-}
-
-
-### Textile Compatibility Mode ###
-
-# Rename this file to "classTextile.php" and it can replace Textile everywhere.
-
-if (strcasecmp(substr(__FILE__, -16), "classTextile.php") == 0) {
- # Try to include PHP SmartyPants. Should be in the same directory.
- @include_once 'smartypants.php';
- # Fake Textile class. It calls Markdown instead.
- class Textile {
- function TextileThis($text, $lite='', $encode='') {
- if ($lite == '' && $encode == '') $text = Markdown($text);
- if (function_exists('SmartyPants')) $text = SmartyPants($text);
- return $text;
- }
- # Fake restricted version: restrictions are not supported for now.
- function TextileRestricted($text, $lite='', $noimage='') {
- return $this->TextileThis($text, $lite);
- }
- # Workaround to ensure compatibility with TextPattern 4.0.3.
- function blockLite($text) { return $text; }
- }
-}
-
+namespace Michelf;
#
# Markdown Parser Class
#
-class Markdown_Parser {
+class Markdown {
+
+ ### Version ###
+
+ const MARKDOWNLIB_VERSION = "1.3";
+
+ ### Simple Function Interface ###
+
+ public static function defaultTransform($text) {
+ #
+ # Initialize the parser and return the result of its transform method.
+ # This will work fine for derived classes too.
+ #
+ # Take parser class on which this function was called.
+ $parser_class = \get_called_class();
+
+ # try to take parser from the static parser list
+ static $parser_list;
+ $parser =& $parser_list[$parser_class];
+
+ # create the parser it not already set
+ if (!$parser)
+ $parser = new $parser_class;
+
+ # Transform text using parser.
+ return $parser->transform($text);
+ }
+
+ ### Configuration Variables ###
+
+ # Change to ">" for HTML output.
+ public $empty_element_suffix = " />";
+ public $tab_width = 4;
+
+ # Change to `true` to disallow markup or entities.
+ public $no_markup = false;
+ public $no_entities = false;
+
+ # Predefined urls and titles for reference links and images.
+ public $predef_urls = array();
+ public $predef_titles = array();
+
+
+ ### Parser Implementation ###
# Regex to match balanced [brackets].
# Needed to insert a maximum bracked depth while converting to PHP.
- var $nested_brackets_depth = 6;
- var $nested_brackets_re;
+ protected $nested_brackets_depth = 6;
+ protected $nested_brackets_re;
- var $nested_url_parenthesis_depth = 4;
- var $nested_url_parenthesis_re;
+ protected $nested_url_parenthesis_depth = 4;
+ protected $nested_url_parenthesis_re;
# Table of hash values for escaped characters:
- var $escape_chars = '\`*_{}[]()>#+-.!';
- var $escape_chars_re;
-
- # Change to ">" for HTML output.
- var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX;
- var $tab_width = MARKDOWN_TAB_WIDTH;
-
- # Change to `true` to disallow markup or entities.
- var $no_markup = false;
- var $no_entities = false;
-
- # Predefined urls and titles for reference links and images.
- var $predef_urls = array();
- var $predef_titles = array();
+ protected $escape_chars = '\`*_{}[]()>#+-.!';
+ protected $escape_chars_re;
- function Markdown_Parser() {
+ public function __construct() {
#
# Constructor function. Initialize appropriate member variables.
#
@@ -264,15 +100,15 @@ class Markdown_Parser {
# Internal hashes used during transformation.
- var $urls = array();
- var $titles = array();
- var $html_hashes = array();
+ protected $urls = array();
+ protected $titles = array();
+ protected $html_hashes = array();
# Status flag to avoid invalid nesting.
- var $in_anchor = false;
+ protected $in_anchor = false;
- function setup() {
+ protected function setup() {
#
# Called before the transformation process starts to setup parser
# states.
@@ -282,10 +118,10 @@ class Markdown_Parser {
$this->titles = $this->predef_titles;
$this->html_hashes = array();
- $in_anchor = false;
+ $this->in_anchor = false;
}
- function teardown() {
+ protected function teardown() {
#
# Called after the transformation process to clear any variable
# which may be taking up memory unnecessarly.
@@ -296,7 +132,7 @@ class Markdown_Parser {
}
- function transform($text) {
+ public function transform($text) {
#
# Main function. Performs some preprocessing on the input text
# and pass it through the document gamut.
@@ -335,7 +171,7 @@ class Markdown_Parser {
return $text . "\n";
}
- var $document_gamut = array(
+ protected $document_gamut = array(
# Strip link definitions, store in hashes.
"stripLinkDefinitions" => 20,
@@ -343,7 +179,7 @@ class Markdown_Parser {
);
- function stripLinkDefinitions($text) {
+ protected function stripLinkDefinitions($text) {
#
# Strips link definitions from text, stores the URLs and titles in
# hash references.
@@ -377,7 +213,7 @@ class Markdown_Parser {
$text);
return $text;
}
- function _stripLinkDefinitions_callback($matches) {
+ protected function _stripLinkDefinitions_callback($matches) {
$link_id = strtolower($matches[1]);
$url = $matches[2] == '' ? $matches[3] : $matches[2];
$this->urls[$link_id] = $url;
@@ -386,7 +222,7 @@ class Markdown_Parser {
}
- function hashHTMLBlocks($text) {
+ protected function hashHTMLBlocks($text) {
if ($this->no_markup) return $text;
$less_than_tab = $this->tab_width - 1;
@@ -406,7 +242,9 @@ class Markdown_Parser {
#
$block_tags_a_re = 'ins|del';
$block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.
- 'script|noscript|form|fieldset|iframe|math';
+ 'script|noscript|form|fieldset|iframe|math|svg|'.
+ 'article|section|nav|aside|hgroup|header|footer|'.
+ 'figure';
# Regular expression for the content of a block tag.
$nested_tags_level = 4;
@@ -523,14 +361,14 @@ class Markdown_Parser {
return $text;
}
- function _hashHTMLBlocks_callback($matches) {
+ protected function _hashHTMLBlocks_callback($matches) {
$text = $matches[1];
$key = $this->hashBlock($text);
return "\n\n$key\n\n";
}
- function hashPart($text, $boundary = 'X') {
+ protected function hashPart($text, $boundary = 'X') {
#
# Called whenever a tag must be hashed when a function insert an atomic
# element in the text stream. Passing $text to through this function gives
@@ -553,7 +391,7 @@ class Markdown_Parser {
}
- function hashBlock($text) {
+ protected function hashBlock($text) {
#
# Shortcut function for hashPart with block-level boundaries.
#
@@ -561,7 +399,7 @@ class Markdown_Parser {
}
- var $block_gamut = array(
+ protected $block_gamut = array(
#
# These are all the transformations that form block-level
# tags like paragraphs, headers, and list items.
@@ -574,7 +412,7 @@ class Markdown_Parser {
"doBlockQuotes" => 60,
);
- function runBlockGamut($text) {
+ protected function runBlockGamut($text) {
#
# Run block gamut tranformations.
#
@@ -588,7 +426,7 @@ class Markdown_Parser {
return $this->runBasicBlockGamut($text);
}
- function runBasicBlockGamut($text) {
+ protected function runBasicBlockGamut($text) {
#
# Run block gamut tranformations, without hashing HTML blocks. This is
# useful when HTML blocks are known to be already hashed, like in the first
@@ -605,7 +443,7 @@ class Markdown_Parser {
}
- function doHorizontalRules($text) {
+ protected function doHorizontalRules($text) {
# Do Horizontal Rules:
return preg_replace(
'{
@@ -623,7 +461,7 @@ class Markdown_Parser {
}
- var $span_gamut = array(
+ protected $span_gamut = array(
#
# These are all the transformations that occur *within* block-level
# tags like paragraphs, headers, and list items.
@@ -647,7 +485,7 @@ class Markdown_Parser {
"doHardBreaks" => 60,
);
- function runSpanGamut($text) {
+ protected function runSpanGamut($text) {
#
# Run span gamut tranformations.
#
@@ -659,17 +497,17 @@ class Markdown_Parser {
}
- function doHardBreaks($text) {
+ protected function doHardBreaks($text) {
# Do hard breaks:
return preg_replace_callback('/ {2,}\n/',
array(&$this, '_doHardBreaks_callback'), $text);
}
- function _doHardBreaks_callback($matches) {
+ protected function _doHardBreaks_callback($matches) {
return $this->hashPart(" tags
@@ -1408,7 +1246,7 @@ class Markdown_Parser {
}
- function encodeAttribute($text) {
+ protected function encodeAttribute($text) {
#
# Encode text for a double-quoted HTML attribute. This function
# is *not* suitable for attributes enclosed in single quotes.
@@ -1419,7 +1257,7 @@ class Markdown_Parser {
}
- function encodeAmpsAndAngles($text) {
+ protected function encodeAmpsAndAngles($text) {
#
# Smart processing for ampersands and angle brackets that need to
# be encoded. Valid character entities are left alone unless the
@@ -1440,7 +1278,7 @@ class Markdown_Parser {
}
- function doAutoLinks($text) {
+ protected function doAutoLinks($text) {
$text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
array(&$this, '_doAutoLinks_url_callback'), $text);
@@ -1467,19 +1305,19 @@ class Markdown_Parser {
return $text;
}
- function _doAutoLinks_url_callback($matches) {
+ protected function _doAutoLinks_url_callback($matches) {
$url = $this->encodeAttribute($matches[1]);
$link = "$url";
return $this->hashPart($link);
}
- function _doAutoLinks_email_callback($matches) {
+ protected function _doAutoLinks_email_callback($matches) {
$address = $matches[1];
$link = $this->encodeEmailAddress($address);
return $this->hashPart($link);
}
- function encodeEmailAddress($addr) {
+ protected function encodeEmailAddress($addr) {
#
# Input: an email address, e.g. "foo@example.com"
#
@@ -1520,7 +1358,7 @@ class Markdown_Parser {
}
- function parseSpan($str) {
+ protected function parseSpan($str) {
#
# Take the string $str and parse it into tokens, hashing embeded HTML,
# escaped characters and handling code spans.
@@ -1539,12 +1377,16 @@ class Markdown_Parser {
|
<\?.*?\?> | <%.*?%> # processing instruction
|
- <[/!$]?[-a-zA-Z0-9:_]+ # regular tags
+ <[!$]?[-a-zA-Z0-9:_]+ # regular tags
(?>
\s
(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*
)?
>
+ |
+ <[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag
+ |
+ [-a-zA-Z0-9:_]+\s*> # closing tag
').'
)
}xs';
@@ -1576,7 +1418,7 @@ class Markdown_Parser {
}
- function handleSpanToken($token, &$str) {
+ protected function handleSpanToken($token, &$str) {
#
# Handle $token provided by parseSpan by determining its nature and
# returning the corresponding value that should replace it.
@@ -1600,7 +1442,7 @@ class Markdown_Parser {
}
- function outdent($text) {
+ protected function outdent($text) {
#
# Remove one level of line-leading tabs or spaces
#
@@ -1610,9 +1452,9 @@ class Markdown_Parser {
# String length function for detab. `_initDetab` will create a function to
# hanlde UTF-8 if the default function does not exist.
- var $utf8_strlen = 'mb_strlen';
+ protected $utf8_strlen = 'mb_strlen';
- function detab($text) {
+ protected function detab($text) {
#
# Replace tabs with the appropriate amount of space.
#
@@ -1625,7 +1467,7 @@ class Markdown_Parser {
return $text;
}
- function _detab_callback($matches) {
+ protected function _detab_callback($matches) {
$line = $matches[0];
$strlen = $this->utf8_strlen; # strlen function for UTF-8.
@@ -1642,7 +1484,7 @@ class Markdown_Parser {
}
return $line;
}
- function _initDetab() {
+ protected function _initDetab() {
#
# Check for the availability of the function in the `utf8_strlen` property
# (initially `mb_strlen`). If the function is not available, create a
@@ -1656,14 +1498,14 @@ class Markdown_Parser {
}
- function unhash($text) {
+ protected function unhash($text) {
#
# Swap back in all the tags hashed by _HashHTMLBlocks.
#
return preg_replace_callback('/(.)\x1A[0-9]+\1/',
array(&$this, '_unhash_callback'), $text);
}
- function _unhash_callback($matches) {
+ protected function _unhash_callback($matches) {
return $this->html_hashes[$matches[0]];
}
@@ -1671,27 +1513,50 @@ class Markdown_Parser {
#
-# Markdown Extra Parser Class
+# Temporary Markdown Extra Parser Implementation Class
+#
+# NOTE: DON'T USE THIS CLASS
+# Currently the implementation of of Extra resides here in this temporary class.
+# This makes it easier to propagate the changes between the three different
+# packaging styles of PHP Markdown. When this issue is resolved, this
+# MarkdownExtra_TmpImpl class here will disappear and \Michelf\MarkdownExtra
+# will contain the code. So please use \Michelf\MarkdownExtra and ignore this
+# one.
#
-class MarkdownExtra_Parser extends Markdown_Parser {
+class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
+
+ ### Configuration Variables ###
# Prefix for footnote ids.
- var $fn_id_prefix = "";
+ public $fn_id_prefix = "";
# Optional title attribute for footnote links and backlinks.
- var $fn_link_title = MARKDOWN_FN_LINK_TITLE;
- var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE;
+ public $fn_link_title = "";
+ public $fn_backlink_title = "";
# Optional class attribute for footnote links and backlinks.
- var $fn_link_class = MARKDOWN_FN_LINK_CLASS;
- var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS;
+ public $fn_link_class = "footnote-ref";
+ public $fn_backlink_class = "footnote-backref";
+
+ # Class name for table cell alignment (%% replaced left/center/right)
+ # For instance: 'go-%%' becomes 'go-left' or 'go-right' or 'go-center'
+ # If empty, the align attribute is used instead of a class name.
+ public $table_align_class_tmpl = '';
+
+ # Optional class prefix for fenced code block.
+ public $code_class_prefix = "";
+ # Class attribute for code blocks goes on the `code` tag;
+ # setting this to true will put attributes on the `pre` tag instead.
+ public $code_attr_on_pre = false;
# Predefined abbreviations.
- var $predef_abbr = array();
+ public $predef_abbr = array();
- function MarkdownExtra_Parser() {
+ ### Parser Implementation ###
+
+ public function __construct() {
#
# Constructor function. Initialize the parser object.
#
@@ -1717,21 +1582,23 @@ class MarkdownExtra_Parser extends Markdown_Parser {
"doAbbreviations" => 70,
);
- parent::Markdown_Parser();
+ parent::__construct();
}
# Extra variables used during extra transformations.
- var $footnotes = array();
- var $footnotes_ordered = array();
- var $abbr_desciptions = array();
- var $abbr_word_re = '';
+ protected $footnotes = array();
+ protected $footnotes_ordered = array();
+ protected $footnotes_ref_count = array();
+ protected $footnotes_numbers = array();
+ protected $abbr_desciptions = array();
+ protected $abbr_word_re = '';
# Give the current footnote number.
- var $footnote_counter = 1;
+ protected $footnote_counter = 1;
- function setup() {
+ protected function setup() {
#
# Setting up Extra-specific variables.
#
@@ -1739,6 +1606,8 @@ class MarkdownExtra_Parser extends Markdown_Parser {
$this->footnotes = array();
$this->footnotes_ordered = array();
+ $this->footnotes_ref_count = array();
+ $this->footnotes_numbers = array();
$this->abbr_desciptions = array();
$this->abbr_word_re = '';
$this->footnote_counter = 1;
@@ -1751,12 +1620,14 @@ class MarkdownExtra_Parser extends Markdown_Parser {
}
}
- function teardown() {
+ protected function teardown() {
#
# Clearing Extra-specific variables.
#
$this->footnotes = array();
$this->footnotes_ordered = array();
+ $this->footnotes_ref_count = array();
+ $this->footnotes_numbers = array();
$this->abbr_desciptions = array();
$this->abbr_word_re = '';
@@ -1764,26 +1635,114 @@ class MarkdownExtra_Parser extends Markdown_Parser {
}
+ ### Extra Attribute Parser ###
+
+ # Expression to use to catch attributes (includes the braces)
+ protected $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}';
+ # Expression to use when parsing in a context when no capture is desired
+ protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){1,}[ ]*\}';
+
+ protected function doExtraAttributes($tag_name, $attr) {
+ #
+ # Parse attributes caught by the $this->id_class_attr_catch_re expression
+ # and return the HTML-formatted list of attributes.
+ #
+ # Currently supported attributes are .class and #id.
+ #
+ if (empty($attr)) return "";
+
+ # Split on components
+ preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches);
+ $elements = $matches[0];
+
+ # handle classes and ids (only first id taken into account)
+ $classes = array();
+ $id = false;
+ foreach ($elements as $element) {
+ if ($element{0} == '.') {
+ $classes[] = substr($element, 1);
+ } else if ($element{0} == '#') {
+ if ($id === false) $id = substr($element, 1);
+ }
+ }
+
+ # compose attributes as string
+ $attr_str = "";
+ if (!empty($id)) {
+ $attr_str .= ' id="'.$id.'"';
+ }
+ if (!empty($classes)) {
+ $attr_str .= ' class="'.implode(" ", $classes).'"';
+ }
+ return $attr_str;
+ }
+
+
+ protected function stripLinkDefinitions($text) {
+ #
+ # Strips link definitions from text, stores the URLs and titles in
+ # hash references.
+ #
+ $less_than_tab = $this->tab_width - 1;
+
+ # Link defs are in the form: ^[id]: url "optional title"
+ $text = preg_replace_callback('{
+ ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1
+ [ ]*
+ \n? # maybe *one* newline
+ [ ]*
+ (?:
+ <(.+?)> # url = $2
+ |
+ (\S+?) # url = $3
+ )
+ [ ]*
+ \n? # maybe one newline
+ [ ]*
+ (?:
+ (?<=\s) # lookbehind for whitespace
+ ["(]
+ (.*?) # title = $4
+ [")]
+ [ ]*
+ )? # title is optional
+ (?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr
+ (?:\n+|\Z)
+ }xm',
+ array(&$this, '_stripLinkDefinitions_callback'),
+ $text);
+ return $text;
+ }
+ protected function _stripLinkDefinitions_callback($matches) {
+ $link_id = strtolower($matches[1]);
+ $url = $matches[2] == '' ? $matches[3] : $matches[2];
+ $this->urls[$link_id] = $url;
+ $this->titles[$link_id] =& $matches[4];
+ $this->ref_attr[$link_id] = $this->doExtraAttributes("", $dummy =& $matches[5]);
+ return ''; # String that will replace the block
+ }
+
+
### HTML Block Parser ###
# Tags that are always treated as block tags:
- var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend';
-
- # Tags treated as block tags only if the opening tag is alone on it's line:
- var $context_block_tags_re = 'script|noscript|math|ins|del';
+ protected $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption';
+
+ # Tags treated as block tags only if the opening tag is alone on its line:
+ protected $context_block_tags_re = 'script|noscript|ins|del|iframe|object|source|track|param|math|svg|canvas|audio|video';
# Tags where markdown="1" default to span mode:
- var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address';
+ protected $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address';
# Tags which must not have their contents modified, no matter where
# they appear:
- var $clean_tags_re = 'script|math';
+ protected $clean_tags_re = 'script|math|svg';
# Tags that do not need to be closed.
- var $auto_close_tags_re = 'hr|img';
+ protected $auto_close_tags_re = 'hr|img|param|source|track';
- function hashHTMLBlocks($text) {
+ protected function hashHTMLBlocks($text) {
#
# Hashify HTML Blocks and "clean tags".
#
@@ -1795,10 +1754,12 @@ class MarkdownExtra_Parser extends Markdown_Parser {
#
# This works by calling _HashHTMLBlocks_InMarkdown, which then calls
# _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1"
- # attribute is found whitin a tag, _HashHTMLBlocks_InHTML calls back
+ # attribute is found within a tag, _HashHTMLBlocks_InHTML calls back
# _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag.
# These two functions are calling each other. It's recursive!
#
+ if ($this->no_markup) return $text;
+
#
# Call the HTML-in-Markdown hasher.
#
@@ -1806,7 +1767,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
return $text;
}
- function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
+ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
$enclosing_tag_re = '', $span = false)
{
#
@@ -1848,7 +1809,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
# Regex to match any tag.
$block_tag_re =
'{
- ( # $2: Capture hole tag.
+ ( # $2: Capture whole tag.
? # Any opening or closing tag.
(?> # Tag name.
'.$this->block_tags_re.' |
@@ -1884,8 +1845,16 @@ class MarkdownExtra_Parser extends Markdown_Parser {
)*
|
# Fenced code block marker
- (?> ^ | \n )
- [ ]{0,'.($indent).'}~~~+[ ]*\n
+ (?<= ^ | \n )
+ [ ]{0,'.($indent+3).'}~{3,}
+ [ ]*
+ (?:
+ \.?[-_:a-zA-Z0-9]+ # standalone class name
+ |
+ '.$this->id_class_attr_nocatch_re.' # extra attributes
+ )?
+ [ ]*
+ \n
' : '' ). ' # End (if not is span).
)
}xs';
@@ -1949,10 +1918,11 @@ class MarkdownExtra_Parser extends Markdown_Parser {
#
# Check for: Fenced code block marker.
#
- else if (preg_match('{^\n?[ ]{0,'.($indent+3).'}~}', $tag)) {
+ else if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~+)}', $tag, $capture)) {
# Fenced code block marker: find matching end marker.
- $tag_re = preg_quote(trim($tag));
- if (preg_match('{^(?>.*\n)+?[ ]{0,'.($indent).'}'.$tag_re.'[ ]*\n}', $text,
+ $fence_indent = strlen($capture[1]); # use captured indent in re
+ $fence_re = $capture[2]; # use captured fence in re
+ if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text,
$matches))
{
# End marker found: pass text unchanged until marker.
@@ -2035,7 +2005,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
return array($parsed, $text);
}
- function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
+ protected function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
#
# Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags.
#
@@ -2066,7 +2036,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
# Regex to match any tag.
$tag_re = '{
- ( # $2: Capture hole tag.
+ ( # $2: Capture whole tag.
? # Any opening or closing tag.
[\w:$]+ # Tag name.
(?:
@@ -2193,7 +2163,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
if (!$span_mode) $parsed .= "\n\n$block_text\n\n";
else $parsed .= "$block_text";
- # Start over a new block.
+ # Start over with a new block.
$block_text = "";
}
else $block_text .= $tag;
@@ -2210,31 +2180,269 @@ class MarkdownExtra_Parser extends Markdown_Parser {
}
- function hashClean($text) {
+ protected function hashClean($text) {
#
- # Called whenever a tag must be hashed when a function insert a "clean" tag
- # in $text, it pass through this function and is automaticaly escaped,
+ # Called whenever a tag must be hashed when a function inserts a "clean" tag
+ # in $text, it passes through this function and is automaticaly escaped,
# blocking invalid nested overlap.
#
return $this->hashPart($text, 'C');
}
- function doHeaders($text) {
+ protected function doAnchors($text) {
#
- # Redefined to add id attribute support.
+ # Turn Markdown link shortcuts into XHTML tags.
+ #
+ if ($this->in_anchor) return $text;
+ $this->in_anchor = true;
+
+ #
+ # First, handle reference-style links: [link text] [id]
+ #
+ $text = preg_replace_callback('{
+ ( # wrap whole match in $1
+ \[
+ ('.$this->nested_brackets_re.') # link text = $2
+ \]
+
+ [ ]? # one optional space
+ (?:\n[ ]*)? # one optional newline followed by spaces
+
+ \[
+ (.*?) # id = $3
+ \]
+ )
+ }xs',
+ array(&$this, '_doAnchors_reference_callback'), $text);
+
+ #
+ # Next, inline-style links: [link text](url "optional title")
+ #
+ $text = preg_replace_callback('{
+ ( # wrap whole match in $1
+ \[
+ ('.$this->nested_brackets_re.') # link text = $2
+ \]
+ \( # literal paren
+ [ \n]*
+ (?:
+ <(.+?)> # href = $3
+ |
+ ('.$this->nested_url_parenthesis_re.') # href = $4
+ )
+ [ \n]*
+ ( # $5
+ ([\'"]) # quote char = $6
+ (.*?) # Title = $7
+ \6 # matching quote
+ [ \n]* # ignore any spaces/tabs between closing quote and )
+ )? # title is optional
+ \)
+ (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
+ )
+ }xs',
+ array(&$this, '_doAnchors_inline_callback'), $text);
+
+ #
+ # Last, handle reference-style shortcuts: [link text]
+ # These must come last in case you've also got [link text][1]
+ # or [link text](/foo)
+ #
+ $text = preg_replace_callback('{
+ ( # wrap whole match in $1
+ \[
+ ([^\[\]]+) # link text = $2; can\'t contain [ or ]
+ \]
+ )
+ }xs',
+ array(&$this, '_doAnchors_reference_callback'), $text);
+
+ $this->in_anchor = false;
+ return $text;
+ }
+ protected function _doAnchors_reference_callback($matches) {
+ $whole_match = $matches[1];
+ $link_text = $matches[2];
+ $link_id =& $matches[3];
+
+ if ($link_id == "") {
+ # for shortcut links like [this][] or [this].
+ $link_id = $link_text;
+ }
+
+ # lower-case and turn embedded newlines into spaces
+ $link_id = strtolower($link_id);
+ $link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
+
+ if (isset($this->urls[$link_id])) {
+ $url = $this->urls[$link_id];
+ $url = $this->encodeAttribute($url);
+
+ $result = "titles[$link_id] ) ) {
+ $title = $this->titles[$link_id];
+ $title = $this->encodeAttribute($title);
+ $result .= " title=\"$title\"";
+ }
+ if (isset($this->ref_attr[$link_id]))
+ $result .= $this->ref_attr[$link_id];
+
+ $link_text = $this->runSpanGamut($link_text);
+ $result .= ">$link_text";
+ $result = $this->hashPart($result);
+ }
+ else {
+ $result = $whole_match;
+ }
+ return $result;
+ }
+ protected function _doAnchors_inline_callback($matches) {
+ $whole_match = $matches[1];
+ $link_text = $this->runSpanGamut($matches[2]);
+ $url = $matches[3] == '' ? $matches[4] : $matches[3];
+ $title =& $matches[7];
+ $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]);
+
+
+ $url = $this->encodeAttribute($url);
+
+ $result = "encodeAttribute($title);
+ $result .= " title=\"$title\"";
+ }
+ $result .= $attr;
+
+ $link_text = $this->runSpanGamut($link_text);
+ $result .= ">$link_text";
+
+ return $this->hashPart($result);
+ }
+
+
+ protected function doImages($text) {
+ #
+ # Turn Markdown image shortcuts into "+s.EditorSelection.CURSOR+" "+s.EditorSelection.CURSOR+"
empty_element_suffix\n");
}
- function doAnchors($text) {
+ protected function doAnchors($text) {
#
# Turn Markdown link shortcuts into XHTML tags.
#
@@ -739,7 +577,7 @@ class Markdown_Parser {
$this->in_anchor = false;
return $text;
}
- function _doAnchors_reference_callback($matches) {
+ protected function _doAnchors_reference_callback($matches) {
$whole_match = $matches[1];
$link_text = $matches[2];
$link_id =& $matches[3];
@@ -773,7 +611,7 @@ class Markdown_Parser {
}
return $result;
}
- function _doAnchors_inline_callback($matches) {
+ protected function _doAnchors_inline_callback($matches) {
$whole_match = $matches[1];
$link_text = $this->runSpanGamut($matches[2]);
$url = $matches[3] == '' ? $matches[4] : $matches[3];
@@ -794,7 +632,7 @@ class Markdown_Parser {
}
- function doImages($text) {
+ protected function doImages($text) {
#
# Turn Markdown image shortcuts into tags.
#
@@ -849,7 +687,7 @@ class Markdown_Parser {
return $text;
}
- function _doImages_reference_callback($matches) {
+ protected function _doImages_reference_callback($matches) {
$whole_match = $matches[1];
$alt_text = $matches[2];
$link_id = strtolower($matches[3]);
@@ -877,7 +715,7 @@ class Markdown_Parser {
return $result;
}
- function _doImages_inline_callback($matches) {
+ protected function _doImages_inline_callback($matches) {
$whole_match = $matches[1];
$alt_text = $matches[2];
$url = $matches[3] == '' ? $matches[4] : $matches[3];
@@ -896,7 +734,7 @@ class Markdown_Parser {
}
- function doHeaders($text) {
+ protected function doHeaders($text) {
# Setext-style headers:
# Header 1
# ========
@@ -926,7 +764,7 @@ class Markdown_Parser {
return $text;
}
- function _doHeaders_callback_setext($matches) {
+ protected function _doHeaders_callback_setext($matches) {
# Terrible hack to check we haven't found an empty list item.
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
return $matches[0];
@@ -935,14 +773,14 @@ class Markdown_Parser {
$block = "
` blocks.
#
@@ -1117,7 +955,7 @@ class Markdown_Parser {
return $text;
}
- function _doCodeBlocks_callback($matches) {
+ protected function _doCodeBlocks_callback($matches) {
$codeblock = $matches[1];
$codeblock = $this->outdent($codeblock);
@@ -1131,7 +969,7 @@ class Markdown_Parser {
}
- function makeCodeSpan($code) {
+ protected function makeCodeSpan($code) {
#
# Create a code span markup for $code. Called from handleSpanToken.
#
@@ -1140,24 +978,24 @@ class Markdown_Parser {
}
- var $em_relist = array(
+ protected $em_relist = array(
'' => '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(? '(?:(? '(?<=\S|^)(? '(?<=\S|^)(?
@@ -1317,7 +1155,7 @@ class Markdown_Parser {
return $text;
}
- function _doBlockQuotes_callback($matches) {
+ protected function _doBlockQuotes_callback($matches) {
$bq = $matches[1];
# trim one level of quoting - trim whitespace-only lines
$bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq);
@@ -1331,14 +1169,14 @@ class Markdown_Parser {
return "\n". $this->hashBlock("\n$bq\n
")."\n\n";
}
- function _doBlockQuotes_callback2($matches) {
+ protected function _doBlockQuotes_callback2($matches) {
$pre = $matches[1];
$pre = preg_replace('/^ /m', '', $pre);
return $pre;
}
- function formParagraphs($text) {
+ protected function formParagraphs($text) {
#
# Params:
# $text - string to process with html tags.
+ #
+ #
+ # First, handle reference-style labeled images: ![alt text][id]
+ #
+ $text = preg_replace_callback('{
+ ( # wrap whole match in $1
+ !\[
+ ('.$this->nested_brackets_re.') # alt text = $2
+ \]
+
+ [ ]? # one optional space
+ (?:\n[ ]*)? # one optional newline followed by spaces
+
+ \[
+ (.*?) # id = $3
+ \]
+
+ )
+ }xs',
+ array(&$this, '_doImages_reference_callback'), $text);
+
+ #
+ # Next, handle inline images: 
+ # Don't forget: encode * and _
+ #
+ $text = preg_replace_callback('{
+ ( # wrap whole match in $1
+ !\[
+ ('.$this->nested_brackets_re.') # alt text = $2
+ \]
+ \s? # One optional whitespace character
+ \( # literal paren
+ [ \n]*
+ (?:
+ <(\S*)> # src url = $3
+ |
+ ('.$this->nested_url_parenthesis_re.') # src url = $4
+ )
+ [ \n]*
+ ( # $5
+ ([\'"]) # quote char = $6
+ (.*?) # title = $7
+ \6 # matching quote
+ [ \n]*
+ )? # title is optional
+ \)
+ (?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
+ )
+ }xs',
+ array(&$this, '_doImages_inline_callback'), $text);
+
+ return $text;
+ }
+ protected function _doImages_reference_callback($matches) {
+ $whole_match = $matches[1];
+ $alt_text = $matches[2];
+ $link_id = strtolower($matches[3]);
+
+ if ($link_id == "") {
+ $link_id = strtolower($alt_text); # for shortcut links like ![this][].
+ }
+
+ $alt_text = $this->encodeAttribute($alt_text);
+ if (isset($this->urls[$link_id])) {
+ $url = $this->encodeAttribute($this->urls[$link_id]);
+ $result = "
titles[$link_id])) {
+ $title = $this->titles[$link_id];
+ $title = $this->encodeAttribute($title);
+ $result .= " title=\"$title\"";
+ }
+ if (isset($this->ref_attr[$link_id]))
+ $result .= $this->ref_attr[$link_id];
+ $result .= $this->empty_element_suffix;
+ $result = $this->hashPart($result);
+ }
+ else {
+ # If there's no such link ID, leave intact:
+ $result = $whole_match;
+ }
+
+ return $result;
+ }
+ protected function _doImages_inline_callback($matches) {
+ $whole_match = $matches[1];
+ $alt_text = $matches[2];
+ $url = $matches[3] == '' ? $matches[4] : $matches[3];
+ $title =& $matches[7];
+ $attr = $this->doExtraAttributes("img", $dummy =& $matches[8]);
+
+ $alt_text = $this->encodeAttribute($alt_text);
+ $url = $this->encodeAttribute($url);
+ $result = "
encodeAttribute($title);
+ $result .= " title=\"$title\""; # $title already quoted
+ }
+ $result .= $attr;
+ $result .= $this->empty_element_suffix;
+
+ return $this->hashPart($result);
+ }
+
+
+ protected function doHeaders($text) {
+ #
+ # Redefined to add id and class attribute support.
#
# Setext-style headers:
# Header 1 {#header1}
# ========
#
- # Header 2 {#header2}
+ # Header 2 {#header2 .class1 .class2}
# --------
#
$text = preg_replace_callback(
'{
(^.+?) # $1: Header text
- (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # $2: Id attribute
+ (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
[ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer
}mx',
array(&$this, '_doHeaders_callback_setext'), $text);
@@ -2242,9 +2450,9 @@ class MarkdownExtra_Parser extends Markdown_Parser {
# atx-style headers:
# # Header 1 {#header1}
# ## Header 2 {#header2}
- # ## Header 2 with closing hashes ## {#header3}
+ # ## Header 2 with closing hashes ## {#header3.class1.class2}
# ...
- # ###### Header 6 {#header2}
+ # ###### Header 6 {.class2}
#
$text = preg_replace_callback('{
^(\#{1,6}) # $1 = string of #\'s
@@ -2252,7 +2460,7 @@ class MarkdownExtra_Parser extends Markdown_Parser {
(.+?) # $2 = Header text
[ ]*
\#* # optional closing #\'s (not counted)
- (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # id attribute
+ (?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
[ ]*
\n+
}xm',
@@ -2260,27 +2468,23 @@ class MarkdownExtra_Parser extends Markdown_Parser {
return $text;
}
- function _doHeaders_attr($attr) {
- if (empty($attr)) return "";
- return " id=\"$attr\"";
- }
- function _doHeaders_callback_setext($matches) {
+ protected function _doHeaders_callback_setext($matches) {
if ($matches[3] == '-' && preg_match('{^- }', $matches[1]))
return $matches[0];
$level = $matches[3]{0} == '=' ? 1 : 2;
- $attr = $this->_doHeaders_attr($id =& $matches[2]);
+ $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]);
$block = "
"}catch(n){return!1}return t.firstChild&&t.firstChild.nodeName==="TBODY"}}),u("innerhtml-div","tr",{test:function(){return d("","tr")}}),u("innerhtml-div","script",{test:function(){return d("","script")}}),a("innerhtml","table")||(p.tbody=function(t,n){var i=r.create(m+t+g,n),s=e.DOM._children(i,"tbody")[0];return i.children.length>1&&s&&!v.test(t)&&s.parentNode.removeChild(s),i}),a("innerhtml-div","script")||(p.script=function(e,t){var n=t.createElement("div");return n.innerHTML="-"+e,n.removeChild(n.firstChild),n},p.link=p.style=p.script),a("innerhtml-div","tr")||(e.mix(p,{option:function(e,t){return r.create('",t)},tr:function(e,t){return r.create(""+e+"",t)},td:function(e,t){return r.create(" "+e+" ",t)},col:function(e,t){return r.create("
',setter:function(t){return t.substr(0,1)==="\n"&&(t=t.substr(1)),t===""&&(t='
'),t===" "&&e.UA.gecko&&(t='
'),this.frame.set("content",t)},getter:function(){return this.frame.get("content")}},dir:{writeOnce:!0,value:"ltr"},linkedcss:{value:"",setter:function(e){return this.frame&&this.frame.set("linkedcss",e),e}},extracss:{value:!1,setter:function(e){return this.frame&&this.frame.set("extracss",e),e}},defaultblock:{value:"p"}}}),e.EditorBase=n},"3.9.1",{requires:["base","frame","node","exec-command","editor-selection"]});
+:t.frameEvent})))},_onFrameKeyPress:function(e){var t=this._currentSelection;t&&t.anchorNode&&(this.fire("nodeChange",{changedNode:t.anchorNode,changedType:"keypress",changedEvent:e.frameEvent}),n.NC_KEYS[e.keyCode]&&this.fire("nodeChange",{changedNode:t.anchorNode,changedType:n.NC_KEYS[e.keyCode]+"-press",changedEvent:e.frameEvent}))},_onFrameKeyUp:function(e){var t=this.frame.getInstance(),r=new t.EditorSelection(e);r&&r.anchorNode&&(this.fire("nodeChange",{changedNode:r.anchorNode,changedType:"keyup",selection:r,changedEvent:e.frameEvent}),n.NC_KEYS[e.keyCode]&&this.fire("nodeChange",{changedNode:r.anchorNode,changedType:n.NC_KEYS[e.keyCode]+"-up",selection:r,changedEvent:e.frameEvent})),this._currentSelectionClear&&(this._currentSelectionClear=this._currentSelection=null)},execCommand:function(e,t){var n=this.frame.execCommand(e,t),r=this.frame.getInstance(),i=new r.EditorSelection,s={},o={changedNode:i.anchorNode,changedType:"execcommand",nodes:n};switch(e){case"forecolor":o.fontColor=t;break;case"backcolor":o.backgroundColor=t;break;case"fontsize":o.fontSize=t;break;case"fontname":o.fontFamily=t}return s[e]=1,o.commands=s,this.fire("nodeChange",o),n},getInstance:function(){return this.frame.getInstance()},render:function(e){return this.frame.set("content",this.get("content")),this.frame.render(e),this},focus:function(e){return this.frame.focus(e),this},show:function(){return this.frame.show(),this},hide:function(){return this.frame.hide(),this},getContent:function(){var e="",t=this.getInstance();return t&&t.EditorSelection&&(e=t.EditorSelection.unfilter()),e=e.replace(/ _yuid="([^>]*)"/g,""),e}},{NORMALIZE_FONTSIZE:function(e){var t=e.getStyle("fontSize"),n=t;switch(t){case"-webkit-xxx-large":t="48px";break;case"xx-large":t="32px";break;case"x-large":t="24px";break;case"large":t="18px";break;case"medium":t="16px";break;case"small":t="13px";break;case"x-small":t="10px"}return n!==t&&e.setStyle("fontSize",t),t},TABKEY:' ',FILTER_RGB:function(e){if(e.toLowerCase().indexOf("rgb")!==-1){var t=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi"),n=e.replace(t,"$1,$2,$3,$4,$5").split(","),r,i,s;n.length===5&&(r=parseInt(n[1],10).toString(16),i=parseInt(n[2],10).toString(16),s=parseInt(n[3],10).toString(16),r=r.length===1?"0"+r:r,i=i.length===1?"0"+i:i,s=s.length===1?"0"+s:s,e="#"+r+i+s)}return e},TAG2CMD:{b:"bold",strong:"bold",i:"italic",em:"italic",u:"underline",sup:"superscript",sub:"subscript",img:"insertimage",a:"createlink",ul:"insertunorderedlist",ol:"insertorderedlist"},NC_KEYS:{8:"backspace",9:"tab",13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",46:"delete"},USE:["node","selector-css3","editor-selection","stylesheet"],NAME:"editorBase",STRINGS:{title:"Rich Text Editor"},ATTRS:{content:{value:'
',setter:function(t){return t.substr(0,1)==="\n"&&(t=t.substr(1)),t===""&&(t='
'),t===" "&&e.UA.gecko&&(t='
'),this.frame.set("content",t)},getter:function(){return this.frame.get("content")}},dir:{writeOnce:!0,value:"ltr"},linkedcss:{value:"",setter:function(e){return this.frame&&this.frame.set("linkedcss",e),e}},extracss:{value:!1,setter:function(e){return this.frame&&this.frame.set("extracss",e),e}},defaultblock:{value:"p"}}}),e.EditorBase=n},"3.12.0",{requires:["base","frame","node","exec-command","editor-selection"]});
diff --git a/lib/yuilib/3.9.1/build/editor-base/editor-base.js b/lib/yuilib/3.12.0/editor-base/editor-base.js
old mode 100644
new mode 100755
similarity index 99%
rename from lib/yuilib/3.9.1/build/editor-base/editor-base.js
rename to lib/yuilib/3.12.0/editor-base/editor-base.js
index bfc13fec5ec..af8c518051b
--- a/lib/yuilib/3.9.1/build/editor-base/editor-base.js
+++ b/lib/yuilib/3.12.0/editor-base/editor-base.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-base', function (Y, NAME) {
@@ -913,4 +919,4 @@ YUI.add('editor-base', function (Y, NAME) {
-}, '3.9.1', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});
+}, '3.12.0', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});
diff --git a/lib/yuilib/3.9.1/build/editor-bidi/editor-bidi-debug.js b/lib/yuilib/3.12.0/editor-bidi/editor-bidi-debug.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/editor-bidi/editor-bidi-debug.js
rename to lib/yuilib/3.12.0/editor-bidi/editor-bidi-debug.js
index 32320b704c1..8ce8e4b7f46
--- a/lib/yuilib/3.9.1/build/editor-bidi/editor-bidi-debug.js
+++ b/lib/yuilib/3.12.0/editor-bidi/editor-bidi-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-bidi', function (Y, NAME) {
@@ -335,4 +341,4 @@ YUI.add('editor-bidi', function (Y, NAME) {
-}, '3.9.1', {"requires": ["editor-base"]});
+}, '3.12.0', {"requires": ["editor-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-bidi/editor-bidi-min.js b/lib/yuilib/3.12.0/editor-bidi/editor-bidi-min.js
old mode 100644
new mode 100755
similarity index 92%
rename from lib/yuilib/3.9.1/build/editor-bidi/editor-bidi-min.js
rename to lib/yuilib/3.12.0/editor-bidi/editor-bidi-min.js
index 6787f5c9a22..4c989506840
--- a/lib/yuilib/3.9.1/build/editor-bidi/editor-bidi-min.js
+++ b/lib/yuilib/3.12.0/editor-bidi/editor-bidi-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("editor-bidi",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="dir",s="BODY",o="nodeChange",u="bidiContextChange",a="style";e.extend(n,e.Base,{lastDirection:null,firstEvent:null,_checkForChange:function(){var e=this.get(r),t=e.getInstance(),i=new t.EditorSelection,s,o;i.isCollapsed?(s=n.blockParent(i.focusNode),s&&(o=s.getStyle("direction"),o!==this.lastDirection&&(e.fire(u,{changedTo:o}),this.lastDirection=o))):(e.fire(u,{changedTo:"select"}),this.lastDirection=null)},_afterNodeChange:function(e){if(this.firstEvent||n.EVENTS[e.changedType])this._checkForChange(),this.firstEvent=!1},_afterMouseUp:function(){this._checkForChange(),this.firstEvent=!1},initializer:function(){var t=this.get(r);this.firstEvent=!0,t.after(o,e.bind(this._afterNodeChange,this)),t.after("dom:mouseup",e.bind(this._afterMouseUp,this))}},{EVENTS:{"backspace-up":!0,"pageup-up":!0,"pagedown-down":!0,"end-up":!0,"home-up":!0,"left-up":!0,"up-up":!0,"right-up":!0,"down-up":!0,"delete-up":!0},BLOCKS:e.EditorSelection.BLOCKS,DIV_WRAPPER:"",blockParent:function(t,r){var i=t,o,u;return i||(i=e.one(s)),i.test(n.BLOCKS)||(i=i.ancestor(n.BLOCKS)),r&&i.test(s)&&(o=e.Node.create(n.DIV_WRAPPER),i.get("children").each(function(e,t){t===0?u=e:o.append(e)}),u.replace(o),o.prepend(u),i=o),i},_NODE_SELECTED:"bidiSelected",addParents:function(e){var t,r,i;tester=function(e){if(!e.getData(n._NODE_SELECTED))return i=!1,!0};for(t=0;t
";e.extend(n,e.Base,{_fixFirstPara:function(){var e=this.get(r),t=e.getInstance(),n,i,a=t.config.doc.body,f=a.innerHTML,l=f.length?!0:!1;f===u&&(f="",l=!1),a.innerHTML="<"+o+">"+f+t.EditorSelection.CURSOR+""+o+">",i=t.one(s),n=new t.EditorSelection,n.selectNode(i,!0,l)},_afterEditorReady:function(){var e=this.get(r),t=e.getInstance(),n;t&&(t.EditorSelection.filterBlocks(),n=t.EditorSelection.DEFAULT_BLOCK_TAG,s=i+" > "+n,o=n)},_afterContentChange:function(){var e=this.get(r),t=e.getInstance();t&&t.EditorSelection&&t.EditorSelection.filterBlocks()},_afterPaste:function(){var t=this.get(r),n=t.getInstance();e.later(50,t,function(){n.EditorSelection.filterBlocks()})},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.after("ready",e.bind(this._afterEditorReady,this)),t.after("contentChange",e.bind(this._afterContentChange,this)),e.Env.webkit&&t.after("dom:paste",e.bind(this._afterPaste,this))}},{NAME:"editorParaBase",NS:"editorParaBase",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorParaBase=n},"3.9.1",{requires:["editor-base"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("editor-para-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s=i+" > p",o="p",u="
";e.extend(n,e.Base,{_fixFirstPara:function(){var e=this.get(r),t=e.getInstance(),n,i,a=t.config.doc.body,f=a.innerHTML,l=f.length?!0:!1;f===u&&(f="",l=!1),a.innerHTML="<"+o+">"+f+t.EditorSelection.CURSOR+""+o+">",i=t.one(s),n=new t.EditorSelection,n.selectNode(i,!0,l)},_afterEditorReady:function(){var e=this.get(r),t=e.getInstance(),n;t&&(t.EditorSelection.filterBlocks(),n=t.EditorSelection.DEFAULT_BLOCK_TAG,s=i+" > "+n,o=n)},_afterContentChange:function(){var e=this.get(r),t=e.getInstance();t&&t.EditorSelection&&t.EditorSelection.filterBlocks()},_afterPaste:function(){var t=this.get(r),n=t.getInstance();e.later(50,t,function(){n.EditorSelection.filterBlocks()})},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.after("ready",e.bind(this._afterEditorReady,this)),t.after("contentChange",e.bind(this._afterContentChange,this)),e.Env.webkit&&t.after("dom:paste",e.bind(this._afterPaste,this))}},{NAME:"editorParaBase",NS:"editorParaBase",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorParaBase=n},"3.12.0",{requires:["editor-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-para-base/editor-para-base.js b/lib/yuilib/3.12.0/editor-para-base/editor-para-base.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/editor-para-base/editor-para-base.js
rename to lib/yuilib/3.12.0/editor-para-base/editor-para-base.js
index 257b561b1ec..fed985cea26
--- a/lib/yuilib/3.9.1/build/editor-para-base/editor-para-base.js
+++ b/lib/yuilib/3.12.0/editor-para-base/editor-para-base.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-para-base', function (Y, NAME) {
@@ -120,4 +126,4 @@ YUI.add('editor-para-base', function (Y, NAME) {
-}, '3.9.1', {"requires": ["editor-base"]});
+}, '3.12.0', {"requires": ["editor-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie-debug.js b/lib/yuilib/3.12.0/editor-para-ie/editor-para-ie-debug.js
old mode 100644
new mode 100755
similarity index 95%
rename from lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie-debug.js
rename to lib/yuilib/3.12.0/editor-para-ie/editor-para-ie-debug.js
index 66879585e37..4b6c98c43e9
--- a/lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie-debug.js
+++ b/lib/yuilib/3.12.0/editor-para-ie/editor-para-ie-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-para-ie', function (Y, NAME) {
@@ -123,4 +129,4 @@ YUI.add('editor-para-ie', function (Y, NAME) {
-}, '3.9.1', {"requires": ["editor-para-base"]});
+}, '3.12.0', {"requires": ["editor-para-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie-min.js b/lib/yuilib/3.12.0/editor-para-ie/editor-para-ie-min.js
old mode 100644
new mode 100755
similarity index 85%
rename from lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie-min.js
rename to lib/yuilib/3.12.0/editor-para-ie/editor-para-ie-min.js
index 2aaab5df236..4943aa59bd6
--- a/lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie-min.js
+++ b/lib/yuilib/3.12.0/editor-para-ie/editor-para-ie-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("editor-para-ie",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="nodeChange",s="p";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(e){var t=this.get(r),n=t.getInstance(),i=n.EditorSelection.DEFAULT_BLOCK_TAG,o,u=":last-child",a,f,l,c,h,p=!1;switch(e.changedType){case"enter-up":a=this._lastPara?this._lastPara:e.changedNode,f=a.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,f&&(f.previous()||f.next())&&f.ancestor(s)&&f.remove(),a.test(i)||(l=a.ancestor(i),l&&(a=l,l=null));if(a.test(i)){o=a.previous();if(o){c=o.one(u);while(!p)c?(h=c.one(u),h?c=h:p=!0):p=!0;c&&t.copyStyles(c,a)}}break;case"enter":e.changedNode.test("br")?e.changedNode.remove():e.changedNode.test("p, span")&&(f=e.changedNode.one("br.yui-cursor"),f&&f.remove())}},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(i,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.9.1",{requires:["editor-para-base"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("editor-para-ie",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="nodeChange",s="p";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(e){var t=this.get(r),n=t.getInstance(),i=n.EditorSelection.DEFAULT_BLOCK_TAG,o,u=":last-child",a,f,l,c,h,p=!1;switch(e.changedType){case"enter-up":a=this._lastPara?this._lastPara:e.changedNode,f=a.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,f&&(f.previous()||f.next())&&f.ancestor(s)&&f.remove(),a.test(i)||(l=a.ancestor(i),l&&(a=l,l=null));if(a.test(i)){o=a.previous();if(o){c=o.one(u);while(!p)c?(h=c.one(u),h?c=h:p=!0):p=!0;c&&t.copyStyles(c,a)}}break;case"enter":e.changedNode.test("br")?e.changedNode.remove():e.changedNode.test("p, span")&&(f=e.changedNode.one("br.yui-cursor"),f&&f.remove())}},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(i,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.12.0",{requires:["editor-para-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie.js b/lib/yuilib/3.12.0/editor-para-ie/editor-para-ie.js
old mode 100644
new mode 100755
similarity index 95%
rename from lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie.js
rename to lib/yuilib/3.12.0/editor-para-ie/editor-para-ie.js
index 66879585e37..4b6c98c43e9
--- a/lib/yuilib/3.9.1/build/editor-para-ie/editor-para-ie.js
+++ b/lib/yuilib/3.12.0/editor-para-ie/editor-para-ie.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-para-ie', function (Y, NAME) {
@@ -123,4 +129,4 @@ YUI.add('editor-para-ie', function (Y, NAME) {
-}, '3.9.1', {"requires": ["editor-para-base"]});
+}, '3.12.0', {"requires": ["editor-para-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-para/editor-para-debug.js b/lib/yuilib/3.12.0/editor-para/editor-para-debug.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/editor-para/editor-para-debug.js
rename to lib/yuilib/3.12.0/editor-para/editor-para-debug.js
index e2f6d971538..09ced3919d8
--- a/lib/yuilib/3.9.1/build/editor-para/editor-para-debug.js
+++ b/lib/yuilib/3.12.0/editor-para/editor-para-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-para', function (Y, NAME) {
@@ -300,4 +306,4 @@ YUI.add('editor-para', function (Y, NAME) {
-}, '3.9.1', {"requires": ["editor-para-base"]});
+}, '3.12.0', {"requires": ["editor-para-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-para/editor-para-min.js b/lib/yuilib/3.12.0/editor-para/editor-para-min.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/editor-para/editor-para-min.js
rename to lib/yuilib/3.12.0/editor-para/editor-para-min.js
index 01e4c46d14a..1a922f1d900
--- a/lib/yuilib/3.9.1/build/editor-para/editor-para-min.js
+++ b/lib/yuilib/3.12.0/editor-para/editor-para-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("editor-para",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s="nodeChange",o="parentNode",u=i+" > p",a="p",f="
",l="firstChild",c="li";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(t){var n=this.get(r),s=n.getInstance(),h,p,d,v,m,g=s.EditorSelection.DEFAULT_BLOCK_TAG,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,H=":last-child",B,j,F,I,q,R=!1,U;switch(t.changedType){case"enter-up":B=this._lastPara?this._lastPara:t.changedNode,j=B.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,j&&(j.previous()||j.next())&&j.ancestor(a)&&j.remove(),B.test(g)||(C=B.ancestor(g),C&&(B=C,C=null));if(B.test(g)){k=B.previous();if(k){I=k.one(H);while(!R)I?(q=I.one(H),q?I=q:R=!0):R=!0;I&&n.copyStyles(I,B)}}break;case"enter":e.UA.webkit&&t.changedEvent.shiftKey&&(n.execCommand("insertbr"),t.changedEvent.preventDefault()),t.changedNode.test("li")&&!e.UA.ie&&(h=s.EditorSelection.getText(t.changedNode),h===""&&(d=t.changedNode.ancestor("ol,ul"),F=d.getAttribute("dir"),F!==""&&(F=' dir = "'+F+'"'),d=t.changedNode.ancestor(s.EditorSelection.BLOCKS),v=s.Node.create("
",l="firstChild",c="li";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(t){var n=this.get(r),s=n.getInstance(),h,p,d,v,m,g=s.EditorSelection.DEFAULT_BLOCK_TAG,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,H=":last-child",B,j,F,I,q,R=!1,U;switch(t.changedType){case"enter-up":B=this._lastPara?this._lastPara:t.changedNode,j=B.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,j&&(j.previous()||j.next())&&j.ancestor(a)&&j.remove(),B.test(g)||(C=B.ancestor(g),C&&(B=C,C=null));if(B.test(g)){k=B.previous();if(k){I=k.one(H);while(!R)I?(q=I.one(H),q?I=q:R=!0):R=!0;I&&n.copyStyles(I,B)}}break;case"enter":e.UA.webkit&&t.changedEvent.shiftKey&&(n.execCommand("insertbr"),t.changedEvent.preventDefault()),t.changedNode.test("li")&&!e.UA.ie&&(h=s.EditorSelection.getText(t.changedNode),h===""&&(d=t.changedNode.ancestor("ol,ul"),F=d.getAttribute("dir"),F!==""&&(F=' dir = "'+F+'"'),d=t.changedNode.ancestor(s.EditorSelection.BLOCKS),v=s.Node.create("
","").replace("
",""),n},e.EditorSelection.DEFAULT_BLOCK_TAG="p",e.EditorSelection.ALL="[style],font[face]",e.EditorSelection.BLOCKS="p,div,ul,ol,table,style",e.EditorSelection.TMP="yui-tmp",e.EditorSelection.DEFAULT_TAG="span",e.EditorSelection.CURID="yui-cursor",e.EditorSelection.CUR_WRAPID="yui-cursor-wrapper",e.EditorSelection.CURSOR='
',e.EditorSelection.hasCursor=function(){var t=e.all("#"+e.EditorSelection.CUR_WRAPID);return t.size()},e.EditorSelection.cleanCursor=function(){var t,n="br.yui-cursor";t=e.all(n),t.size()&&t.each(function(t){var n=t.get("parentNode.parentNode.childNodes"),r;n.size()?t.remove
-():(r=e.EditorSelection.getText(n.item(0)),r!==""&&t.remove())})},e.EditorSelection.prototype={text:null,isCollapsed:null,anchorNode:null,anchorOffset:null,anchorTextNode:null,focusNode:null,focusOffset:null,focusTextNode:null,_selection:null,_wrap:function(t,n){var i=e.Node.create("<"+n+">"+n+">");return i.set(r,t.get(r)),t.set(r,""),t.append(i),e.Node.getDOMNode(i)},_swap:function(t,n){var i=e.Node.create("<"+n+">"+n+">");return i.set(r,t.get(r)),t.replace(i,t),e.Node.getDOMNode(i)},getSelected:function(){e.EditorSelection.filter(),e.config.doc.execCommand("fontname",null,e.EditorSelection.TMP);var t=e.all(e.EditorSelection.ALL),n=[];return t.each(function(r,s){r.getStyle(i)===e.EditorSelection.TMP&&(r.setStyle(i,""),e.EditorSelection.removeFontFamily(r),r.test("body")||n.push(e.Node.getDOMNode(t.item(s))))}),e.all(n)},insertContent:function(e){return this.insertAtCursor(e,this.anchorTextNode,this.anchorOffset,!0)},insertAtCursor:function(t,r,i,s){var o=e.Node.create("<"+e.EditorSelection.DEFAULT_TAG+' class="yui-non">'+e.EditorSelection.DEFAULT_TAG+">"),u,a,f,l,c=this.createRange(),h;r&&r.test("body")&&(h=e.Node.create(""),r.append(h),r=h);if(c.pasteHTML){if(i===0&&r&&!r.previous()&&r.get("nodeType")===3)return r.insert(t,"before"),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(r.previous())),c.collapse(!1),c.select(),r.previous();l=e.Node.create(t);try{c.pasteHTML('')}catch(p){}u=e.one("#rte-insert");if(u)return u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select(),l;e.on("available",function(){u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select()},"#rte-insert")}else i>0?(u=r.get(n),a=e.one(e.config.doc.createTextNode(u.substr(0,i))),f=e.one(e.config.doc.createTextNode(u.substr(i))),r.replace(a,r),l=e.Node.create(t),l.get("nodeType")===11&&(h=e.Node.create(""),h.append(l),l=h),a.insert(l,"after"),f&&(l.insert(o,"after"),o.insert(f,"after"),this.selectNode(o,s))):(r.get("nodeType")===3&&(r=r.get("parentNode")),l=e.Node.create(t),t=r.get("innerHTML").replace(/\n/gi,""),t===""||t==="
"?r.append(l):l.get("parentNode")?r.insert(l,"before"):e.one("body").prepend(l),r.get("firstChild").test("br")&&r.get("firstChild").remove());return l},wrapContent:function(t){t=t?t:e.EditorSelection.DEFAULT_TAG;if(!this.isCollapsed){var n=this.getSelected(),r=[],i,s,o,u;return n.each(function(e,i){var s=e.get("tagName").toLowerCase();s==="font"?r.push(this._swap(n.item(i),t)):r.push(this._wrap(n.item(i),t))},this),i=this.createRange(),o=r[0],s=r[r.length-1],this._selection.removeAllRanges?(i.setStart(r[0],0),i.setEnd(s,s.childNodes.length),this._selection.removeAllRanges(),this._selection.addRange(i)):(i.moveToElementText&&(i.moveToElementText(e.Node.getDOMNode(o)),u=this.createRange(),u.moveToElementText(e.Node.getDOMNode(s)),i.setEndPoint("EndToEnd",u)),i.select()),r=e.all(r),r}return e.all([])},replace:function(t,r){var i=this.createRange(),s,o,u,a;return i.getBookmark?(u=i.getBookmark(),o=this.anchorNode.get("innerHTML").replace(t,r),this.anchorNode.set("innerHTML",o),i.moveToBookmark(u),a=e.one(i.parentElement())):(s=this.anchorTextNode,o=s.get(n),u=o.indexOf(t),o=o.replace(t,""),s.set(n,o),a=this.insertAtCursor(r,s,u,!0)),a},remove:function(){return this._selection&&this._selection.removeAllRanges&&this._selection.removeAllRanges(),this},createRange:function(){return e.config.doc.selection?e.config.doc.selection.createRange():e.config.doc.createRange()},selectNode:function(t,n,r){if(!t)return;r=r||0,t=e.Node.getDOMNode(t);var i=this.createRange();if(i.selectNode){i.selectNode(t),this._selection.removeAllRanges(),this._selection.addRange(i);if(n)try{this._selection.collapse(t,r)}catch(s){this._selection.collapse(t,0)}}else{t.nodeType===3&&(t=t.parentNode);try{i.moveToElementText(t)}catch(o){}n&&i.collapse(r?!1:!0),i.select()}return this},setCursor:function(){return this.removeCursor(!1),this.insertContent(e.EditorSelection.CURSOR)},getCursor:function(){return e.all("#"+e.EditorSelection.CURID)},removeCursor:function(e){var t=this.getCursor();return t&&(e?(t.removeAttribute("id"),t.set("innerHTML",'
')):t.remove()),t},focusCursor:function(e,t){e!==!1&&(e=!0),t!==!1&&(t=!0);var n=this.removeCursor(!0);n&&n.each(function(n){this.selectNode(n,e,t)},this)},toString:function(){return"EditorSelection Object"}},e.Selection=e.EditorSelection},"3.9.1",{requires:["node"]});
+():(r=e.EditorSelection.getText(n.item(0)),r!==""&&t.remove())})},e.EditorSelection.prototype={text:null,isCollapsed:null,anchorNode:null,anchorOffset:null,anchorTextNode:null,focusNode:null,focusOffset:null,focusTextNode:null,_selection:null,_wrap:function(t,n){var i=e.Node.create("<"+n+">"+n+">");return i.set(r,t.get(r)),t.set(r,""),t.append(i),e.Node.getDOMNode(i)},_swap:function(t,n){var i=e.Node.create("<"+n+">"+n+">");return i.set(r,t.get(r)),t.replace(i,t),e.Node.getDOMNode(i)},getSelected:function(){e.EditorSelection.filter(),e.config.doc.execCommand("fontname",null,e.EditorSelection.TMP);var t=e.all(e.EditorSelection.ALL),n=[];return t.each(function(r,s){r.getStyle(i)===e.EditorSelection.TMP&&(r.setStyle(i,""),e.EditorSelection.removeFontFamily(r),r.test("body")||n.push(e.Node.getDOMNode(t.item(s))))}),e.all(n)},insertContent:function(e){return this.insertAtCursor(e,this.anchorTextNode,this.anchorOffset,!0)},insertAtCursor:function(t,r,i,s){var o=e.Node.create("<"+e.EditorSelection.DEFAULT_TAG+' class="yui-non">'+e.EditorSelection.DEFAULT_TAG+">"),u,a,f,l,c=this.createRange(),h;r&&r.test("body")&&(h=e.Node.create(""),r.append(h),r=h);if(c.pasteHTML){if(i===0&&r&&!r.previous()&&r.get("nodeType")===3)return r.insert(t,"before"),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(r.previous())),c.collapse(!1),c.select(),r.previous();l=e.Node.create(t);try{c.pasteHTML('')}catch(p){}u=e.one("#rte-insert");if(u)return u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select(),l;e.on("available",function(){u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select()},"#rte-insert")}else i>0?(u=r.get(n),a=e.one(e.config.doc.createTextNode(u.substr(0,i))),f=e.one(e.config.doc.createTextNode(u.substr(i))),r.replace(a,r),l=e.Node.create(t),l.get("nodeType")===11&&(h=e.Node.create(""),h.append(l),l=h),a.insert(l,"after"),f&&(l.insert(o,"after"),o.insert(f,"after"),this.selectNode(o,s))):(r.get("nodeType")===3&&(r=r.get("parentNode")),l=e.Node.create(t),t=r.get("innerHTML").replace(/\n/gi,""),t===""||t==="
"?r.append(l):l.get("parentNode")?r.insert(l,"before"):e.one("body").prepend(l),r.get("firstChild").test("br")&&r.get("firstChild").remove());return l},wrapContent:function(t){t=t?t:e.EditorSelection.DEFAULT_TAG;if(!this.isCollapsed){var n=this.getSelected(),r=[],i,s,o,u;return n.each(function(e,i){var s=e.get("tagName").toLowerCase();s==="font"?r.push(this._swap(n.item(i),t)):r.push(this._wrap(n.item(i),t))},this),i=this.createRange(),o=r[0],s=r[r.length-1],this._selection.removeAllRanges?(i.setStart(r[0],0),i.setEnd(s,s.childNodes.length),this._selection.removeAllRanges(),this._selection.addRange(i)):(i.moveToElementText&&(i.moveToElementText(e.Node.getDOMNode(o)),u=this.createRange(),u.moveToElementText(e.Node.getDOMNode(s)),i.setEndPoint("EndToEnd",u)),i.select()),r=e.all(r),r}return e.all([])},replace:function(t,r){var i=this.createRange(),s,o,u,a;return i.getBookmark?(u=i.getBookmark(),o=this.anchorNode.get("innerHTML").replace(t,r),this.anchorNode.set("innerHTML",o),i.moveToBookmark(u),a=e.one(i.parentElement())):(s=this.anchorTextNode,o=s.get(n),u=o.indexOf(t),o=o.replace(t,""),s.set(n,o),a=this.insertAtCursor(r,s,u,!0)),a},remove:function(){return this._selection&&this._selection.removeAllRanges&&this._selection.removeAllRanges(),this},createRange:function(){return e.config.doc.selection?e.config.doc.selection.createRange():e.config.doc.createRange()},selectNode:function(t,n,r){if(!t)return;r=r||0,t=e.Node.getDOMNode(t);var i=this.createRange();if(i.selectNode){i.selectNode(t),this._selection.removeAllRanges(),this._selection.addRange(i);if(n)try{this._selection.collapse(t,r)}catch(s){this._selection.collapse(t,0)}}else{t.nodeType===3&&(t=t.parentNode);try{i.moveToElementText(t)}catch(o){}n&&i.collapse(r?!1:!0),i.select()}return this},setCursor:function(){return this.removeCursor(!1),this.insertContent(e.EditorSelection.CURSOR)},getCursor:function(){return e.all("#"+e.EditorSelection.CURID)},removeCursor:function(e){var t=this.getCursor();return t&&(e?(t.removeAttribute("id"),t.set("innerHTML",'
')):t.remove()),t},focusCursor:function(e,t){e!==!1&&(e=!0),t!==!1&&(t=!0);var n=this.removeCursor(!0);n&&n.each(function(n){this.selectNode(n,e,t)},this)},toString:function(){return"EditorSelection Object"}},e.Selection=e.EditorSelection},"3.12.0",{requires:["node"]});
diff --git a/lib/yuilib/3.9.1/build/editor-selection/editor-selection.js b/lib/yuilib/3.12.0/editor-selection/editor-selection.js
old mode 100644
new mode 100755
similarity index 99%
rename from lib/yuilib/3.9.1/build/editor-selection/editor-selection.js
rename to lib/yuilib/3.12.0/editor-selection/editor-selection.js
index 894df22063e..7f127620a67
--- a/lib/yuilib/3.9.1/build/editor-selection/editor-selection.js
+++ b/lib/yuilib/3.12.0/editor-selection/editor-selection.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-selection', function (Y, NAME) {
/**
@@ -962,4 +968,4 @@ YUI.add('editor-selection', function (Y, NAME) {
-}, '3.9.1', {"requires": ["node"]});
+}, '3.12.0', {"requires": ["node"]});
diff --git a/lib/yuilib/3.9.1/build/editor-tab/editor-tab-debug.js b/lib/yuilib/3.12.0/editor-tab/editor-tab-debug.js
old mode 100644
new mode 100755
similarity index 89%
rename from lib/yuilib/3.9.1/build/editor-tab/editor-tab-debug.js
rename to lib/yuilib/3.12.0/editor-tab/editor-tab-debug.js
index 1550065142b..b934780678d
--- a/lib/yuilib/3.9.1/build/editor-tab/editor-tab-debug.js
+++ b/lib/yuilib/3.12.0/editor-tab/editor-tab-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-tab', function (Y, NAME) {
@@ -67,4 +73,4 @@ YUI.add('editor-tab', function (Y, NAME) {
Y.Plugin.EditorTab = EditorTab;
-}, '3.9.1', {"requires": ["editor-base"]});
+}, '3.12.0', {"requires": ["editor-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-tab/editor-tab-min.js b/lib/yuilib/3.12.0/editor-tab/editor-tab-min.js
old mode 100644
new mode 100755
similarity index 72%
rename from lib/yuilib/3.9.1/build/editor-tab/editor-tab-min.js
rename to lib/yuilib/3.12.0/editor-tab/editor-tab-min.js
index 572ec174217..0addd97d7d7
--- a/lib/yuilib/3.9.1/build/editor-tab/editor-tab-min.js
+++ b/lib/yuilib/3.12.0/editor-tab/editor-tab-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("editor-tab",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host";e.extend(n,e.Base,{_onNodeChange:function(e){var t="indent";e.changedType==="tab"&&(e.changedNode.test("li, li *")||(e.changedEvent.halt(),e.preventDefault(),e.changedEvent.shiftKey&&(t="outdent"),this.get(r).execCommand(t,"")))},initializer:function(){this.get(r).on("nodeChange",e.bind(this._onNodeChange,this))}},{NAME:"editorTab",NS:"tab",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorTab=n},"3.9.1",{requires:["editor-base"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("editor-tab",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host";e.extend(n,e.Base,{_onNodeChange:function(e){var t="indent";e.changedType==="tab"&&(e.changedNode.test("li, li *")||(e.changedEvent.halt(),e.preventDefault(),e.changedEvent.shiftKey&&(t="outdent"),this.get(r).execCommand(t,"")))},initializer:function(){this.get(r).on("nodeChange",e.bind(this._onNodeChange,this))}},{NAME:"editorTab",NS:"tab",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorTab=n},"3.12.0",{requires:["editor-base"]});
diff --git a/lib/yuilib/3.9.1/build/editor-tab/editor-tab.js b/lib/yuilib/3.12.0/editor-tab/editor-tab.js
old mode 100644
new mode 100755
similarity index 89%
rename from lib/yuilib/3.9.1/build/editor-tab/editor-tab.js
rename to lib/yuilib/3.12.0/editor-tab/editor-tab.js
index 9adc094a533..2c05aa8bef6
--- a/lib/yuilib/3.9.1/build/editor-tab/editor-tab.js
+++ b/lib/yuilib/3.12.0/editor-tab/editor-tab.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('editor-tab', function (Y, NAME) {
@@ -66,4 +72,4 @@ YUI.add('editor-tab', function (Y, NAME) {
Y.Plugin.EditorTab = EditorTab;
-}, '3.9.1', {"requires": ["editor-base"]});
+}, '3.12.0', {"requires": ["editor-base"]});
diff --git a/lib/yuilib/3.9.1/build/escape/escape-debug.js b/lib/yuilib/3.12.0/escape/escape-debug.js
old mode 100644
new mode 100755
similarity index 93%
rename from lib/yuilib/3.9.1/build/escape/escape-debug.js
rename to lib/yuilib/3.12.0/escape/escape-debug.js
index b25c6b82e7a..1b307f63d29
--- a/lib/yuilib/3.9.1/build/escape/escape-debug.js
+++ b/lib/yuilib/3.12.0/escape/escape-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('escape', function (Y, NAME) {
/**
@@ -90,4 +96,4 @@ Escape.regexp = Escape.regex;
Y.Escape = Escape;
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
diff --git a/lib/yuilib/3.9.1/build/escape/escape-min.js b/lib/yuilib/3.12.0/escape/escape-min.js
old mode 100644
new mode 100755
similarity index 61%
rename from lib/yuilib/3.9.1/build/escape/escape-min.js
rename to lib/yuilib/3.12.0/escape/escape-min.js
index 8240889f151..c41a4bc53ee
--- a/lib/yuilib/3.9.1/build/escape/escape-min.js
+++ b/lib/yuilib/3.12.0/escape/escape-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("escape",function(e,t){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},r={html:function(e){return(e+"").replace(/[&<>"'\/`]/g,r._htmlReplacer)},regex:function(e){return(e+"").replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g,"\\$&")},_htmlReplacer:function(e){return n[e]}};r.regexp=r.regex,e.Escape=r},"3.9.1",{requires:["yui-base"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("escape",function(e,t){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},r={html:function(e){return(e+"").replace(/[&<>"'\/`]/g,r._htmlReplacer)},regex:function(e){return(e+"").replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g,"\\$&")},_htmlReplacer:function(e){return n[e]}};r.regexp=r.regex,e.Escape=r},"3.12.0",{requires:["yui-base"]});
diff --git a/lib/yuilib/3.9.1/build/escape/escape.js b/lib/yuilib/3.12.0/escape/escape.js
old mode 100644
new mode 100755
similarity index 93%
rename from lib/yuilib/3.9.1/build/escape/escape.js
rename to lib/yuilib/3.12.0/escape/escape.js
index b25c6b82e7a..1b307f63d29
--- a/lib/yuilib/3.9.1/build/escape/escape.js
+++ b/lib/yuilib/3.12.0/escape/escape.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('escape', function (Y, NAME) {
/**
@@ -90,4 +96,4 @@ Escape.regexp = Escape.regex;
Y.Escape = Escape;
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
diff --git a/lib/yuilib/3.9.1/build/event-base-ie/event-base-ie-debug.js b/lib/yuilib/3.12.0/event-base-ie/event-base-ie-debug.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/event-base-ie/event-base-ie-debug.js
rename to lib/yuilib/3.12.0/event-base-ie/event-base-ie-debug.js
index 3d6758a6426..724c23dadba
--- a/lib/yuilib/3.9.1/build/event-base-ie/event-base-ie-debug.js
+++ b/lib/yuilib/3.12.0/event-base-ie/event-base-ie-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
(function() {
var stateChangeListener,
@@ -220,7 +226,7 @@ IELazyFacade._lazyProperties = {
var e = this._event,
val = e.pageX,
doc, bodyScroll, docScroll;
-
+
if (val === undefined) {
doc = Y.config.doc;
bodyScroll = doc.body && doc.body.scrollLeft;
@@ -235,7 +241,7 @@ IELazyFacade._lazyProperties = {
var e = this._event,
val = e.pageY,
doc, bodyScroll, docScroll;
-
+
if (val === undefined) {
doc = Y.config.doc;
bodyScroll = doc.body && doc.body.scrollTop;
@@ -296,9 +302,9 @@ if (imp && (!imp.hasFeature('Events', '2.0'))) {
useLazyFacade = false;
}
}
-
+
Y.DOMEventFacade = (useLazyFacade) ? IELazyFacade : IEEventFacade;
}
-}, '3.9.1', {"requires": ["node-base"]});
+}, '3.12.0', {"requires": ["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/event-base-ie/event-base-ie-min.js b/lib/yuilib/3.12.0/event-base-ie/event-base-ie-min.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/event-base-ie/event-base-ie-min.js
rename to lib/yuilib/3.12.0/event-base-ie/event-base-ie-min.js
index 523de258924..6fd8174a5a7
--- a/lib/yuilib/3.9.1/build/event-base-ie/event-base-ie-min.js
+++ b/lib/yuilib/3.12.0/event-base-ie/event-base-ie-min.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
(function(){var e,t=YUI.Env,n=YUI.config,r=n.doc,i=r&&r.documentElement,s="onreadystatechange",o=n.pollInterval||40;i.doScroll&&!t._ieready&&(t._ieready=function(){t._ready()},
/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
-self!==self.top?(e=function(){r.readyState=="complete"&&(t.remove(r,s,e),t.ieready())},t.add(r,s,e)):t._dri=setInterval(function(){try{i.doScroll("left"),clearInterval(t._dri),t._dri=null,t._ieready()}catch(e){}},o))})(),YUI.add("event-base-ie",function(e,t){function n(){e.DOM2EventFacade.apply(this,arguments)}function r(t){var n=e.config.doc.createEventObject(t),i=r.prototype;return n.hasOwnProperty=function(){return!0},n.init=i.init,n.halt=i.halt,n.preventDefault=i.preventDefault,n.stopPropagation=i.stopPropagation,n.stopImmediatePropagation=i.stopImmediatePropagation,e.DOM2EventFacade.apply(n,arguments),n}var i=e.config.doc&&e.config.doc.implementation,s=e.config.lazyEventFacade,o={0:1,4:2,2:3},u={mouseout:"toElement",mouseover:"fromElement"},a=e.DOM2EventFacade.resolve,f={init:function(){n.superclass.init.apply(this,arguments);var t=this._event,r,i,s,u,f,l;this.target=a(t.srcElement),"clientX"in t&&!r&&0!==r&&(r=t.clientX,i=t.clientY,s=e.config.doc,u=s.body,f=s.documentElement,r+=f.scrollLeft||u&&u.scrollLeft||0,i+=f.scrollTop||u&&u.scrollTop||0,this.pageX=r,this.pageY=i),t.type=="mouseout"?l=t.toElement:t.type=="mouseover"&&(l=t.fromElement),this.relatedTarget=a(l||t.relatedTarget),this.which=this.button=t.keyCode||o[t.button]||t.button},stopPropagation:function(){this._event.cancelBubble=!0,this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){this._event.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1}};e.extend(n,e.DOM2EventFacade,f),e.extend(r,e.DOM2EventFacade,f),r.prototype.init=function(){var e=this._event,t=this._wrapper.overrides,n=r._define,i=r._lazyProperties,s;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.keyCode=this.charCode=e.keyCode,this.which=this.button=e.keyCode||o[e.button]||e.button;for(s in i)i.hasOwnProperty(s)&&n(this,s,i[s]);this._touch&&this._touch(e,this._currentTarget,this._wrapper)},r._lazyProperties={target:function(){return a(this._event.srcElement)},relatedTarget:function(){var e=this._event,t=u[e.type]||"relatedTarget";return a(e[t]||e.relatedTarget)},currentTarget:function(){return a(this._currentTarget)},wheelDelta:function(){var e=this._event;if(e.type==="mousewheel"||e.type==="DOMMouseScroll")return e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1)},pageX:function(){var t=this._event,n=t.pageX,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollLeft,s=r.documentElement.scrollLeft,n=t.clientX+(s||i||0)),n},pageY:function(){var t=this._event,n=t.pageY,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollTop,s=r.documentElement.scrollTop,n=t.clientY+(s||i||0)),n}},r._define=function(e,t,n){function r(r){var i=arguments.length?r:n.call(this);return delete e[t],Object.defineProperty(e,t,{value:i,configurable:!0,writable:!0}),i}Object.defineProperty(e,t,{get:r,set:r,configurable:!0})};if(i&&!i.hasFeature("Events","2.0")){if(s)try{Object.defineProperty(e.config.doc.createEventObject(),"z",{})}catch(l){s=!1}e.DOMEventFacade=s?r:n}},"3.9.1",{requires:["node-base"]});
+self!==self.top?(e=function(){r.readyState=="complete"&&(t.remove(r,s,e),t.ieready())},t.add(r,s,e)):t._dri=setInterval(function(){try{i.doScroll("left"),clearInterval(t._dri),t._dri=null,t._ieready()}catch(e){}},o))})(),YUI.add("event-base-ie",function(e,t){function n(){e.DOM2EventFacade.apply(this,arguments)}function r(t){var n=e.config.doc.createEventObject(t),i=r.prototype;return n.hasOwnProperty=function(){return!0},n.init=i.init,n.halt=i.halt,n.preventDefault=i.preventDefault,n.stopPropagation=i.stopPropagation,n.stopImmediatePropagation=i.stopImmediatePropagation,e.DOM2EventFacade.apply(n,arguments),n}var i=e.config.doc&&e.config.doc.implementation,s=e.config.lazyEventFacade,o={0:1,4:2,2:3},u={mouseout:"toElement",mouseover:"fromElement"},a=e.DOM2EventFacade.resolve,f={init:function(){n.superclass.init.apply(this,arguments);var t=this._event,r,i,s,u,f,l;this.target=a(t.srcElement),"clientX"in t&&!r&&0!==r&&(r=t.clientX,i=t.clientY,s=e.config.doc,u=s.body,f=s.documentElement,r+=f.scrollLeft||u&&u.scrollLeft||0,i+=f.scrollTop||u&&u.scrollTop||0,this.pageX=r,this.pageY=i),t.type=="mouseout"?l=t.toElement:t.type=="mouseover"&&(l=t.fromElement),this.relatedTarget=a(l||t.relatedTarget),this.which=this.button=t.keyCode||o[t.button]||t.button},stopPropagation:function(){this._event.cancelBubble=!0,this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){this._event.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1}};e.extend(n,e.DOM2EventFacade,f),e.extend(r,e.DOM2EventFacade,f),r.prototype.init=function(){var e=this._event,t=this._wrapper.overrides,n=r._define,i=r._lazyProperties,s;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.keyCode=this.charCode=e.keyCode,this.which=this.button=e.keyCode||o[e.button]||e.button;for(s in i)i.hasOwnProperty(s)&&n(this,s,i[s]);this._touch&&this._touch(e,this._currentTarget,this._wrapper)},r._lazyProperties={target:function(){return a(this._event.srcElement)},relatedTarget:function(){var e=this._event,t=u[e.type]||"relatedTarget";return a(e[t]||e.relatedTarget)},currentTarget:function(){return a(this._currentTarget)},wheelDelta:function(){var e=this._event;if(e.type==="mousewheel"||e.type==="DOMMouseScroll")return e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1)},pageX:function(){var t=this._event,n=t.pageX,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollLeft,s=r.documentElement.scrollLeft,n=t.clientX+(s||i||0)),n},pageY:function(){var t=this._event,n=t.pageY,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollTop,s=r.documentElement.scrollTop,n=t.clientY+(s||i||0)),n}},r._define=function(e,t,n){function r(r){var i=arguments.length?r:n.call(this);return delete e[t],Object.defineProperty(e,t,{value:i,configurable:!0,writable:!0}),i}Object.defineProperty(e,t,{get:r,set:r,configurable:!0})};if(i&&!i.hasFeature("Events","2.0")){if(s)try{Object.defineProperty(e.config.doc.createEventObject(),"z",{})}catch(l){s=!1}e.DOMEventFacade=s?r:n}},"3.12.0",{requires:["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/event-base-ie/event-base-ie.js b/lib/yuilib/3.12.0/event-base-ie/event-base-ie.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/event-base-ie/event-base-ie.js
rename to lib/yuilib/3.12.0/event-base-ie/event-base-ie.js
index 3d6758a6426..724c23dadba
--- a/lib/yuilib/3.9.1/build/event-base-ie/event-base-ie.js
+++ b/lib/yuilib/3.12.0/event-base-ie/event-base-ie.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
(function() {
var stateChangeListener,
@@ -220,7 +226,7 @@ IELazyFacade._lazyProperties = {
var e = this._event,
val = e.pageX,
doc, bodyScroll, docScroll;
-
+
if (val === undefined) {
doc = Y.config.doc;
bodyScroll = doc.body && doc.body.scrollLeft;
@@ -235,7 +241,7 @@ IELazyFacade._lazyProperties = {
var e = this._event,
val = e.pageY,
doc, bodyScroll, docScroll;
-
+
if (val === undefined) {
doc = Y.config.doc;
bodyScroll = doc.body && doc.body.scrollTop;
@@ -296,9 +302,9 @@ if (imp && (!imp.hasFeature('Events', '2.0'))) {
useLazyFacade = false;
}
}
-
+
Y.DOMEventFacade = (useLazyFacade) ? IELazyFacade : IEEventFacade;
}
-}, '3.9.1', {"requires": ["node-base"]});
+}, '3.12.0', {"requires": ["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/event-base/event-base-debug.js b/lib/yuilib/3.12.0/event-base/event-base-debug.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/event-base/event-base-debug.js
rename to lib/yuilib/3.12.0/event-base/event-base-debug.js
index e7865ea1ef4..f1fe77cc91d
--- a/lib/yuilib/3.9.1/build/event-base/event-base-debug.js
+++ b/lib/yuilib/3.12.0/event-base/event-base-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
(function () {
var GLOBAL_ENV = YUI.Env;
@@ -158,7 +164,7 @@ Y.extend(DOMEventFacade, Object, {
// Webkit and IE9+? duplicate charCode in keyCode.
// Opera never sets charCode, always keyCode (though with the charCode).
// IE6-8 don't set charCode or which.
- // All browsers other than IE6-8 set which=keyCode in keydown, keyup, and
+ // All browsers other than IE6-8 set which=keyCode in keydown, keyup, and
// which=charCode in keypress.
//
// Moral of the story: (e.which || e.keyCode) will always return the
@@ -377,6 +383,7 @@ Y.DOMEventFacade = DOMEventFacade;
* on the current target will not be executed
*/
(function() {
+
/**
* The event utility provides functions to add and remove event listeners,
* event cleansing. It also tries to automatically remove listeners it
@@ -398,8 +405,7 @@ Y.DOMEventFacade = DOMEventFacade;
Y.Env.evt.dom_wrappers = {};
Y.Env.evt.dom_map = {};
-var YDOM = Y.DOM,
- _eventenv = Y.Env.evt,
+var _eventenv = Y.Env.evt,
config = Y.config,
win = config.win,
add = YUI.Env.add,
@@ -422,7 +428,7 @@ var YDOM = Y.DOM,
shouldIterate = function(o) {
try {
// TODO: See if there's a more performant way to return true early on this, for the common case
- return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o));
+ return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !Y.DOM.isWindow(o));
} catch(ex) {
Y.log("collection check failure", "warn", "event");
return false;
@@ -707,6 +713,7 @@ Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL);
cewrapper = Y.publish(key, {
silent: true,
bubbles: false,
+ emitFacade:false,
contextFn: function() {
if (compat) {
return cewrapper.el;
@@ -792,7 +799,7 @@ Y.log(type + " attach call failed, invalid callback", "error", "event");
// oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el);
if (compat) {
- oEl = YDOM.byId(el);
+ oEl = Y.DOM.byId(el);
} else {
oEl = Y.Selector.query(el);
@@ -909,7 +916,7 @@ Y.log(type + " attach call failed, invalid callback", "error", "event");
// el = (compat) ? Y.DOM.byId(el) : Y.all(el);
if (compat) {
- el = YDOM.byId(el);
+ el = Y.DOM.byId(el);
} else {
el = Y.Selector.query(el);
l = el.length;
@@ -983,7 +990,7 @@ Y.log(type + " attach call failed, invalid callback", "error", "event");
* @static
*/
generateId: function(el) {
- return YDOM.generateID(el);
+ return Y.DOM.generateID(el);
},
/**
@@ -1093,7 +1100,7 @@ Y.log(type + " attach call failed, invalid callback", "error", "event");
if (item && !item.checkReady) {
// el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);
- el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true);
+ el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);
if (el) {
// Y.log('avail: ' + el);
@@ -1112,7 +1119,7 @@ Y.log(type + " attach call failed, invalid callback", "error", "event");
if (item && item.checkReady) {
// el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);
- el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true);
+ el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);
if (el) {
// The element is available, but not necessarily ready
@@ -1307,12 +1314,18 @@ if (config.injected || YUI.Env.windowLoaded) {
// Process onAvailable/onContentReady items when when the DOM is ready in IE
if (Y.UA.ie) {
Y.on(EVENT_READY, Event._poll);
-}
-try {
- add(win, "unload", onUnload);
-} catch(e) {
- Y.log("Registering unload listener failed. This is known to happen in Chrome Packaged Apps and Extensions, which don't support unload, and don't provide a way to test for support", "warn", "event-base");
+ // In IE6 and below, detach event handlers when the page is unloaded in
+ // order to try and prevent cross-page memory leaks. This isn't done in
+ // other browsers because a) it's not necessary, and b) it breaks the
+ // back/forward cache.
+ if (Y.UA.ie < 7) {
+ try {
+ add(win, "unload", onUnload);
+ } catch(e) {
+ Y.log("Registering unload listener failed.", "warn", "event-base");
+ }
+ }
}
Event.Custom = Y.CustomEvent;
@@ -1378,4 +1391,4 @@ Y.Env.evt.plugins.contentready = {
};
-}, '3.9.1', {"requires": ["event-custom-base"]});
+}, '3.12.0', {"requires": ["event-custom-base"]});
diff --git a/lib/yuilib/3.12.0/event-base/event-base-min.js b/lib/yuilib/3.12.0/event-base/event-base-min.js
new file mode 100755
index 00000000000..0c0800fc724
--- /dev/null
+++ b/lib/yuilib/3.12.0/event-base/event-base-min.js
@@ -0,0 +1,9 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+(function(){var e=YUI.Env;e._ready||(e._ready=function(){e.DOMReady=!0,e.remove(YUI.config.doc,"DOMContentLoaded",e._ready)},e.add(YUI.config.doc,"DOMContentLoaded",e._ready))})(),YUI.add("event-base",function(e,t){e.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?e.fire("domready"):e.Do.before(function(){e.fire("domready")},YUI.Env,"_ready");var n=e.UA,r={},i={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},s=function(t){if(!t)return t;try{t&&3==t.nodeType&&(t=t.parentNode)}catch(n){return null}return e.one(t)},o=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||r,this.init()};e.extend(o,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,r=e.pageX,o=e.pageY,u,a=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=r,this.pageY=o,u=e.keyCode||e.charCode,n.webkit&&u in i&&(u=i[u]),this.keyCode=u,this.charCode=u,this.which=e.which||e.charCode||u,this.button=this.which,this.target=s(e.target),this.currentTarget=s(a),this.relatedTarget=s(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll")this.wheelDelta=e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1);this._touch&&this._touch(e,a,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),t.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),o.resolve=s,e.DOM2EventFacade=o,e.DOMEventFacade=o,function(){e.Env.evt.dom_wrappers={},e.Env.evt.dom_map={};var t=e.Env.evt,n=e.config,r=n.win,i=YUI.Env.add,s=YUI.Env.remove,o=function(){YUI.Env.windowLoaded=!0,e.Event._load(),s(r,"load",o)},u=function(){e.Event._unload()},a="domready",f="~yui|2|compat~",l=function(t){try{return t&&typeof t!="string"&&e.Lang.isNumber(t.length)&&!t.tagName&&!e.DOM.isWindow(t)}catch(n){return!1}},c=e.CustomEvent.prototype._delete,h=function(t){var n=c.apply(this,arguments);return this.hasSubs()||e.Event._clean(this),n},p=function(){var n=!1,o=0,c=[],d=t.dom_wrappers,v=null,m=t.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){p._interval||(p._interval=setInterval(p._poll,p.POLL_INTERVAL))},onAvailable:function(t,n,r,i,s,u){var a=e.Array(t),f,l;for(f=0;f
*
* @module event-contextmenu
* @requires event
@@ -38,7 +51,7 @@ var Event = Y.Event,
handles.push(Event._attach(["contextmenu", function (e) {
// Any developer listening for the "contextmenu" event is likely
- // going to call preventDefault() to prevent the display of
+ // going to call preventDefault() to prevent the display of
// the browser's context menu. So, you know, save them a step.
e.preventDefault();
@@ -125,7 +138,7 @@ var Event = Y.Event,
// the x & x coords to the center of the event target.
if (menuKey || (isWin && webkit && shiftF10)) {
- eventData[Y.stamp(node)] = {
+ eventData[Y.stamp(node)] = {
clientX: clientX,
clientY: clientY,
pageX: pageX,
@@ -183,4 +196,4 @@ conf.detachDelegate = conf.detach;
Event.define("contextmenu", conf, true);
-}, '3.9.1', {"requires": ["event-synthetic", "dom-screen"]});
+}, '3.12.0', {"requires": ["event-synthetic", "dom-screen"]});
diff --git a/lib/yuilib/3.9.1/build/event-contextmenu/event-contextmenu-min.js b/lib/yuilib/3.12.0/event-contextmenu/event-contextmenu-min.js
old mode 100644
new mode 100755
similarity index 83%
rename from lib/yuilib/3.9.1/build/event-contextmenu/event-contextmenu-min.js
rename to lib/yuilib/3.12.0/event-contextmenu/event-contextmenu-min.js
index a0e7065fce0..5d404324e54
--- a/lib/yuilib/3.9.1/build/event-contextmenu/event-contextmenu-min.js
+++ b/lib/yuilib/3.12.0/event-contextmenu/event-contextmenu-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("event-contextmenu",function(e,t){var n=e.Event,r=e.DOM,i=e.UA,s=e.UA.os,o=i.ie,u=i.gecko,a=i.webkit,f=i.opera,l=s==="windows",c=s==="macintosh",h={},p={on:function(t,i,s,p){var d=[];d.push(n._attach(["contextmenu",function(n){n.preventDefault();var r=e.stamp(t),i=h[r];i&&(n.clientX=i.clientX,n.clientY=i.clientY,n.pageX=i.pageX,n.pageY=i.pageY,delete h[r]),s.fire(n)},t])),d.push(t[p?"delegate":"on"]("keydown",function(n){var i=this.getDOMNode(),p=n.shiftKey,d=n.keyCode,v=p&&d==121,m=l&&d==93,g=n.ctrlKey,y=d===77,b=c&&(a||u)&&g&&p&&n.altKey&&y,w=c&&f&&g&&p&&y,E=0,S=0,x,T,N,C,k,L,A;if(l&&(v||m)||b||w){((o||l&&(u||f))&&v||w)&&n.preventDefault(),k=r.getXY(i),L=k[0],A=k[1],x=r.docScrollX(),T=r.docScrollY(),e.Lang.isUndefined(L)||(E=L+i.offsetWidth/2-x,S=A+i.offsetHeight/2-T),N=E+x,C=S+T;if(m||l&&a&&v)h[e.stamp(t)]={clientX:E,clientY:S,pageX:N,pageY:C};if((o||l&&(u||f))&&v||c)n.clientX=E,n.clientY=S,n.pageX=N,n.pageY=C,s.fire(n)}},p)),i._handles=d},detach:function(t,n,r){e.each(n._handles,function(e){e.detach()})}};p.delegate=p.on,p.detachDelegate=p.detach,n.define("contextmenu",p,!0)},"3.9.1",{requires:["event-synthetic","dom-screen"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-contextmenu",function(e,t){var n=e.Event,r=e.DOM,i=e.UA,s=e.UA.os,o=i.ie,u=i.gecko,a=i.webkit,f=i.opera,l=s==="windows",c=s==="macintosh",h={},p={on:function(t,i,s,p){var d=[];d.push(n._attach(["contextmenu",function(n){n.preventDefault();var r=e.stamp(t),i=h[r];i&&(n.clientX=i.clientX,n.clientY=i.clientY,n.pageX=i.pageX,n.pageY=i.pageY,delete h[r]),s.fire(n)},t])),d.push(t[p?"delegate":"on"]("keydown",function(n){var i=this.getDOMNode(),p=n.shiftKey,d=n.keyCode,v=p&&d==121,m=l&&d==93,g=n.ctrlKey,y=d===77,b=c&&(a||u)&&g&&p&&n.altKey&&y,w=c&&f&&g&&p&&y,E=0,S=0,x,T,N,C,k,L,A;if(l&&(v||m)||b||w){((o||l&&(u||f))&&v||w)&&n.preventDefault(),k=r.getXY(i),L=k[0],A=k[1],x=r.docScrollX(),T=r.docScrollY(),e.Lang.isUndefined(L)||(E=L+i.offsetWidth/2-x,S=A+i.offsetHeight/2-T),N=E+x,C=S+T;if(m||l&&a&&v)h[e.stamp(t)]={clientX:E,clientY:S,pageX:N,pageY:C};if((o||l&&(u||f))&&v||c)n.clientX=E,n.clientY=S,n.pageX=N,n.pageY=C,s.fire(n)}},p)),i._handles=d},detach:function(t,n,r){e.each(n._handles,function(e){e.detach()})}};p.delegate=p.on,p.detachDelegate=p.detach,n.define("contextmenu",p,!0)},"3.12.0",{requires:["event-synthetic","dom-screen"]});
diff --git a/lib/yuilib/3.9.1/build/event-contextmenu/event-contextmenu.js b/lib/yuilib/3.12.0/event-contextmenu/event-contextmenu.js
old mode 100644
new mode 100755
similarity index 87%
rename from lib/yuilib/3.9.1/build/event-contextmenu/event-contextmenu.js
rename to lib/yuilib/3.12.0/event-contextmenu/event-contextmenu.js
index beea562d7e8..ca3784eb8f4
--- a/lib/yuilib/3.9.1/build/event-contextmenu/event-contextmenu.js
+++ b/lib/yuilib/3.12.0/event-contextmenu/event-contextmenu.js
@@ -1,14 +1,27 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('event-contextmenu', function (Y, NAME) {
/**
* Provides extended keyboard support for the "contextmenu" event such that:
*
*
* @module event-contextmenu
* @requires event
@@ -38,7 +51,7 @@ var Event = Y.Event,
handles.push(Event._attach(["contextmenu", function (e) {
// Any developer listening for the "contextmenu" event is likely
- // going to call preventDefault() to prevent the display of
+ // going to call preventDefault() to prevent the display of
// the browser's context menu. So, you know, save them a step.
e.preventDefault();
@@ -125,7 +138,7 @@ var Event = Y.Event,
// the x & x coords to the center of the event target.
if (menuKey || (isWin && webkit && shiftF10)) {
- eventData[Y.stamp(node)] = {
+ eventData[Y.stamp(node)] = {
clientX: clientX,
clientY: clientY,
pageX: pageX,
@@ -183,4 +196,4 @@ conf.detachDelegate = conf.detach;
Event.define("contextmenu", conf, true);
-}, '3.9.1', {"requires": ["event-synthetic", "dom-screen"]});
+}, '3.12.0', {"requires": ["event-synthetic", "dom-screen"]});
diff --git a/lib/yuilib/3.9.1/build/event-custom-base/event-custom-base-debug.js b/lib/yuilib/3.12.0/event-custom-base/event-custom-base-debug.js
old mode 100644
new mode 100755
similarity index 84%
rename from lib/yuilib/3.9.1/build/event-custom-base/event-custom-base-debug.js
rename to lib/yuilib/3.12.0/event-custom-base/event-custom-base-debug.js
index 482db8265ba..4c1e7615054
--- a/lib/yuilib/3.9.1/build/event-custom-base/event-custom-base-debug.js
+++ b/lib/yuilib/3.12.0/event-custom-base/event-custom-base-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('event-custom-base', function (Y, NAME) {
/**
@@ -36,12 +42,12 @@ DO = {
* Cache of objects touched by the utility
* @property objs
* @static
- * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
- * replaces the role of this property, but is considered to be private, and
+ * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
+ * replaces the role of this property, but is considered to be private, and
* is only mentioned to provide a migration path.
- *
- * If you have a use case which warrants migration to the _yuiaop property,
- * please file a ticket to let us know what it's used for and we can see if
+ *
+ * If you have a use case which warrants migration to the _yuiaop property,
+ * please file a ticket to let us know what it's used for and we can see if
* we need to expose hooks for that functionality more formally.
*/
objs: null,
@@ -176,9 +182,6 @@ DO = {
if (handle.detach) {
handle.detach();
}
- },
-
- _unload: function(e, me) {
}
};
@@ -305,10 +308,10 @@ DO.Method.prototype.exec = function () {
if (af.hasOwnProperty(i)) {
newRet = af[i].apply(this.obj, args);
// Stop processing if a Halt object is returned
- if (newRet && newRet.constructor == DO.Halt) {
+ if (newRet && newRet.constructor === DO.Halt) {
return newRet.retVal;
// Check for a new return value
- } else if (newRet && newRet.constructor == DO.AlterReturn) {
+ } else if (newRet && newRet.constructor === DO.AlterReturn) {
ret = newRet.newRetVal;
// Update the static retval state
DO.currentRetVal = ret;
@@ -393,9 +396,6 @@ DO.Error = DO.Halt;
//////////////////////////////////////////////////////////////////////////
-// Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do);
-
-
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
@@ -433,7 +433,7 @@ var YArray = Y.Array,
CONFIGS_HASH = YArray.hash(CONFIGS),
- nativeSlice = Array.prototype.slice,
+ nativeSlice = Array.prototype.slice,
YUI3_SIGNATURE = 9,
YUI_LOG = 'yui:log',
@@ -442,7 +442,7 @@ var YArray = Y.Array,
var p;
for (p in s) {
- if (CONFIGS_HASH[p] && (ov || !(p in r))) {
+ if (CONFIGS_HASH[p] && (ov || !(p in r))) {
r[p] = s[p];
}
}
@@ -456,258 +456,69 @@ var YArray = Y.Array,
*
* @param {String} type The type of event, which is passed to the callback
* when the event fires.
- * @param {object} o configuration object.
+ * @param {object} defaults configuration object.
* @class CustomEvent
* @constructor
*/
-Y.CustomEvent = function(type, o) {
+
+ /**
+ * The type of event, returned to subscribers when the event fires
+ * @property type
+ * @type string
+ */
+
+/**
+ * By default all custom events are logged in the debug build, set silent
+ * to true to disable debug outpu for this event.
+ * @property silent
+ * @type boolean
+ */
+
+Y.CustomEvent = function(type, defaults) {
this._kds = Y.CustomEvent.keepDeprecatedSubs;
- o = o || {};
+ this.id = Y.guid();
- this.id = Y.stamp(this);
-
- /**
- * The type of event, returned to subscribers when the event fires
- * @property type
- * @type string
- */
this.type = type;
+ this.silent = this.logSystem = (type === YUI_LOG);
- /**
- * The context the the event will fire from by default. Defaults to the YUI
- * instance.
- * @property context
- * @type object
- */
- this.context = Y;
-
- /**
- * Monitor when an event is attached or detached.
- *
- * @property monitored
- * @type boolean
- */
- // this.monitored = false;
-
- this.logSystem = (type == YUI_LOG);
-
- /**
- * If 0, this event does not broadcast. If 1, the YUI instance is notified
- * every time this event fires. If 2, the YUI instance and the YUI global
- * (if event is enabled on the global) are notified every time this event
- * fires.
- * @property broadcast
- * @type int
- */
- // this.broadcast = 0;
-
- /**
- * By default all custom events are logged in the debug build, set silent
- * to true to disable debug outpu for this event.
- * @property silent
- * @type boolean
- */
- this.silent = this.logSystem;
-
- /**
- * Specifies whether this event should be queued when the host is actively
- * processing an event. This will effect exectution order of the callbacks
- * for the various events.
- * @property queuable
- * @type boolean
- * @default false
- */
- // this.queuable = false;
-
- /**
- * The subscribers to this event
- * @property subscribers
- * @type Subscriber {}
- * @deprecated
- */
if (this._kds) {
+ /**
+ * The subscribers to this event
+ * @property subscribers
+ * @type Subscriber {}
+ * @deprecated
+ */
+
+ /**
+ * 'After' subscribers
+ * @property afters
+ * @type Subscriber {}
+ * @deprecated
+ */
this.subscribers = {};
- }
-
- /**
- * The subscribers to this event
- * @property _subscribers
- * @type Subscriber []
- * @private
- */
- this._subscribers = [];
-
- /**
- * 'After' subscribers
- * @property afters
- * @type Subscriber {}
- */
- if (this._kds) {
this.afters = {};
}
- /**
- * 'After' subscribers
- * @property _afters
- * @type Subscriber []
- * @private
- */
- this._afters = [];
-
- /**
- * This event has fired if true
- *
- * @property fired
- * @type boolean
- * @default false;
- */
- // this.fired = false;
-
- /**
- * An array containing the arguments the custom event
- * was last fired with.
- * @property firedWith
- * @type Array
- */
- // this.firedWith;
-
- /**
- * This event should only fire one time if true, and if
- * it has fired, any new subscribers should be notified
- * immediately.
- *
- * @property fireOnce
- * @type boolean
- * @default false;
- */
- // this.fireOnce = false;
-
- /**
- * fireOnce listeners will fire syncronously unless async
- * is set to true
- * @property async
- * @type boolean
- * @default false
- */
- //this.async = false;
-
- /**
- * Flag for stopPropagation that is modified during fire()
- * 1 means to stop propagation to bubble targets. 2 means
- * to also stop additional subscribers on this target.
- * @property stopped
- * @type int
- */
- // this.stopped = 0;
-
- /**
- * Flag for preventDefault that is modified during fire().
- * if it is not 0, the default behavior for this event
- * @property prevented
- * @type int
- */
- // this.prevented = 0;
-
- /**
- * Specifies the host for this custom event. This is used
- * to enable event bubbling
- * @property host
- * @type EventTarget
- */
- // this.host = null;
-
- /**
- * The default function to execute after event listeners
- * have fire, but only if the default action was not
- * prevented.
- * @property defaultFn
- * @type Function
- */
- // this.defaultFn = null;
-
- /**
- * The function to execute if a subscriber calls
- * stopPropagation or stopImmediatePropagation
- * @property stoppedFn
- * @type Function
- */
- // this.stoppedFn = null;
-
- /**
- * The function to execute if a subscriber calls
- * preventDefault
- * @property preventedFn
- * @type Function
- */
- // this.preventedFn = null;
-
- /**
- * Specifies whether or not this event's default function
- * can be cancelled by a subscriber by executing preventDefault()
- * on the event facade
- * @property preventable
- * @type boolean
- * @default true
- */
- this.preventable = true;
-
- /**
- * Specifies whether or not a subscriber can stop the event propagation
- * via stopPropagation(), stopImmediatePropagation(), or halt()
- *
- * Events can only bubble if emitFacade is true.
- *
- * @property bubbles
- * @type boolean
- * @default true
- */
- this.bubbles = true;
-
- /**
- * Supports multiple options for listener signatures in order to
- * port YUI 2 apps.
- * @property signature
- * @type int
- * @default 9
- */
- this.signature = YUI3_SIGNATURE;
-
- // this.subCount = 0;
- // this.afterCount = 0;
-
- // this.hasSubscribers = false;
- // this.hasAfters = false;
-
- /**
- * If set to true, the custom event will deliver an EventFacade object
- * that is similar to a DOM event object.
- * @property emitFacade
- * @type boolean
- * @default false
- */
- // this.emitFacade = false;
-
- this.applyConfig(o, true);
-
- // this.log("Creating " + this.type);
-
+ if (defaults) {
+ mixConfigs(this, defaults, true);
+ }
};
/**
* Static flag to enable population of the `subscribers`
* and `afters` properties held on a `CustomEvent` instance.
- *
- * These properties were changed to private properties (`_subscribers` and `_afters`), and
- * converted from objects to arrays for performance reasons.
*
- * Setting this property to true will populate the deprecated `subscribers` and `afters`
+ * These properties were changed to private properties (`_subscribers` and `_afters`), and
+ * converted from objects to arrays for performance reasons.
+ *
+ * Setting this property to true will populate the deprecated `subscribers` and `afters`
* properties for people who may be using them (which is expected to be rare). There will
* be a performance hit, compared to the new array based implementation.
*
* If you are using these deprecated properties for a use case which the public API
- * does not support, please file an enhancement request, and we can provide an alternate
+ * does not support, please file an enhancement request, and we can provide an alternate
* public implementation which doesn't have the performance cost required to maintiain the
* properties as objects.
*
@@ -726,6 +537,169 @@ Y.CustomEvent.prototype = {
constructor: Y.CustomEvent,
+ /**
+ * Monitor when an event is attached or detached.
+ *
+ * @property monitored
+ * @type boolean
+ */
+
+ /**
+ * If 0, this event does not broadcast. If 1, the YUI instance is notified
+ * every time this event fires. If 2, the YUI instance and the YUI global
+ * (if event is enabled on the global) are notified every time this event
+ * fires.
+ * @property broadcast
+ * @type int
+ */
+
+ /**
+ * Specifies whether this event should be queued when the host is actively
+ * processing an event. This will effect exectution order of the callbacks
+ * for the various events.
+ * @property queuable
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * This event has fired if true
+ *
+ * @property fired
+ * @type boolean
+ * @default false;
+ */
+
+ /**
+ * An array containing the arguments the custom event
+ * was last fired with.
+ * @property firedWith
+ * @type Array
+ */
+
+ /**
+ * This event should only fire one time if true, and if
+ * it has fired, any new subscribers should be notified
+ * immediately.
+ *
+ * @property fireOnce
+ * @type boolean
+ * @default false;
+ */
+
+ /**
+ * fireOnce listeners will fire syncronously unless async
+ * is set to true
+ * @property async
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * Flag for stopPropagation that is modified during fire()
+ * 1 means to stop propagation to bubble targets. 2 means
+ * to also stop additional subscribers on this target.
+ * @property stopped
+ * @type int
+ */
+
+ /**
+ * Flag for preventDefault that is modified during fire().
+ * if it is not 0, the default behavior for this event
+ * @property prevented
+ * @type int
+ */
+
+ /**
+ * Specifies the host for this custom event. This is used
+ * to enable event bubbling
+ * @property host
+ * @type EventTarget
+ */
+
+ /**
+ * The default function to execute after event listeners
+ * have fire, but only if the default action was not
+ * prevented.
+ * @property defaultFn
+ * @type Function
+ */
+
+ /**
+ * The function to execute if a subscriber calls
+ * stopPropagation or stopImmediatePropagation
+ * @property stoppedFn
+ * @type Function
+ */
+
+ /**
+ * The function to execute if a subscriber calls
+ * preventDefault
+ * @property preventedFn
+ * @type Function
+ */
+
+ /**
+ * The subscribers to this event
+ * @property _subscribers
+ * @type Subscriber []
+ * @private
+ */
+
+ /**
+ * 'After' subscribers
+ * @property _afters
+ * @type Subscriber []
+ * @private
+ */
+
+ /**
+ * If set to true, the custom event will deliver an EventFacade object
+ * that is similar to a DOM event object.
+ * @property emitFacade
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * Supports multiple options for listener signatures in order to
+ * port YUI 2 apps.
+ * @property signature
+ * @type int
+ * @default 9
+ */
+ signature : YUI3_SIGNATURE,
+
+ /**
+ * The context the the event will fire from by default. Defaults to the YUI
+ * instance.
+ * @property context
+ * @type object
+ */
+ context : Y,
+
+ /**
+ * Specifies whether or not this event's default function
+ * can be cancelled by a subscriber by executing preventDefault()
+ * on the event facade
+ * @property preventable
+ * @type boolean
+ * @default true
+ */
+ preventable : true,
+
+ /**
+ * Specifies whether or not a subscriber can stop the event propagation
+ * via stopPropagation(), stopImmediatePropagation(), or halt()
+ *
+ * Events can only bubble if emitFacade is true.
+ *
+ * @property bubbles
+ * @type boolean
+ * @default true
+ */
+ bubbles : true,
+
/**
* Returns the number of subscribers for this event as the sum of the on()
* subscribers and after() subscribers.
@@ -734,15 +708,35 @@ Y.CustomEvent.prototype = {
* @return Number
*/
hasSubs: function(when) {
- var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;
+ var s = 0,
+ a = 0,
+ subs = this._subscribers,
+ afters = this._afters,
+ sib = this.sibling;
+
+ if (subs) {
+ s = subs.length;
+ }
+
+ if (afters) {
+ a = afters.length;
+ }
if (sib) {
- s += sib._subscribers.length;
- a += sib._afters.length;
+ subs = sib._subscribers;
+ afters = sib._afters;
+
+ if (subs) {
+ s += subs.length;
+ }
+
+ if (afters) {
+ a += afters.length;
+ }
}
if (when) {
- return (when == 'after') ? a : s;
+ return (when === 'after') ? a : s;
}
return (s + a);
@@ -770,12 +764,47 @@ Y.CustomEvent.prototype = {
* @return {Array} first item is the on subscribers, second the after.
*/
getSubs: function() {
- var s = this._subscribers, a = this._afters, sib = this.sibling;
- s = (sib) ? s.concat(sib._subscribers) : s.concat();
- a = (sib) ? a.concat(sib._afters) : a.concat();
+ var sibling = this.sibling,
+ subs = this._subscribers,
+ afters = this._afters,
+ siblingSubs,
+ siblingAfters;
- return [s, a];
+ if (sibling) {
+ siblingSubs = sibling._subscribers;
+ siblingAfters = sibling._afters;
+ }
+
+ if (siblingSubs) {
+ if (subs) {
+ subs = subs.concat(siblingSubs);
+ } else {
+ subs = siblingSubs.concat();
+ }
+ } else {
+ if (subs) {
+ subs = subs.concat();
+ } else {
+ subs = [];
+ }
+ }
+
+ if (siblingAfters) {
+ if (afters) {
+ afters = afters.concat(siblingAfters);
+ } else {
+ afters = siblingAfters.concat();
+ }
+ } else {
+ if (afters) {
+ afters = afters.concat();
+ } else {
+ afters = [];
+ }
+ }
+
+ return [subs, afters];
},
/**
@@ -791,7 +820,7 @@ Y.CustomEvent.prototype = {
/**
* Create the Subscription for subscribing function, context, and bound
- * arguments. If this is a fireOnce event, the subscriber is immediately
+ * arguments. If this is a fireOnce event, the subscriber is immediately
* notified.
*
* @method _on
@@ -806,24 +835,41 @@ Y.CustomEvent.prototype = {
if (!fn) { this.log('Invalid callback for CE: ' + this.type); }
- var s = new Y.Subscriber(fn, context, args, when);
+ var s = new Y.Subscriber(fn, context, args, when),
+ firedWith;
if (this.fireOnce && this.fired) {
+
+ firedWith = this.firedWith;
+
+ // It's a little ugly for this to know about facades,
+ // but given the current breakup, not much choice without
+ // moving a whole lot of stuff around.
+ if (this.emitFacade && this._addFacadeToArgs) {
+ this._addFacadeToArgs(firedWith);
+ }
+
if (this.async) {
- setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);
+ setTimeout(Y.bind(this._notify, this, s, firedWith), 0);
} else {
- this._notify(s, this.firedWith);
+ this._notify(s, firedWith);
}
}
- if (when == AFTER) {
+ if (when === AFTER) {
+ if (!this._afters) {
+ this._afters = [];
+ }
this._afters.push(s);
} else {
+ if (!this._subscribers) {
+ this._subscribers = [];
+ }
this._subscribers.push(s);
}
if (this._kds) {
- if (when == AFTER) {
+ if (when === AFTER) {
this.afters[s.id] = s;
} else {
this.subscribers[s.id] = s;
@@ -845,7 +891,7 @@ Y.CustomEvent.prototype = {
var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
return this._on(fn, context, a, true);
},
-
+
/**
* Listen for this event
* @method on
@@ -895,25 +941,29 @@ Y.CustomEvent.prototype = {
if (fn && fn.detach) {
return fn.detach();
}
-
+
var i, s,
found = 0,
subs = this._subscribers,
afters = this._afters;
- for (i = subs.length; i >= 0; i--) {
- s = subs[i];
- if (s && (!fn || fn === s.fn)) {
- this._delete(s, subs, i);
- found++;
+ if (subs) {
+ for (i = subs.length; i >= 0; i--) {
+ s = subs[i];
+ if (s && (!fn || fn === s.fn)) {
+ this._delete(s, subs, i);
+ found++;
+ }
}
}
- for (i = afters.length; i >= 0; i--) {
- s = afters[i];
- if (s && (!fn || fn === s.fn)) {
- this._delete(s, afters, i);
- found++;
+ if (afters) {
+ for (i = afters.length; i >= 0; i--) {
+ s = afters[i];
+ if (s && (!fn || fn === s.fn)) {
+ this._delete(s, afters, i);
+ found++;
+ }
}
}
@@ -984,13 +1034,34 @@ Y.CustomEvent.prototype = {
*
*/
fire: function() {
+
+ // push is the fastest way to go from arguments to arrays
+ // for most browsers currently
+ // http://jsperf.com/push-vs-concat-vs-slice/2
+
+ var args = [];
+ args.push.apply(args, arguments);
+
+ return this._fire(args);
+ },
+
+ /**
+ * Private internal implementation for `fire`, which is can be used directly by
+ * `EventTarget` and other event module classes which have already converted from
+ * an `arguments` list to an array, to avoid the repeated overhead.
+ *
+ * @method _fire
+ * @private
+ * @param {Array} args The array of arguments passed to be passed to handlers.
+ * @return {boolean} false if one of the subscribers returned false, true otherwise.
+ */
+ _fire: function(args) {
+
if (this.fireOnce && this.fired) {
this.log('fireOnce event: ' + this.type + ' already fired');
return true;
} else {
- var args = nativeSlice.call(arguments, 0);
-
// this doesn't happen if the event isn't published
// this.host._monitor('fire', this.type, args);
@@ -1024,7 +1095,9 @@ Y.CustomEvent.prototype = {
this._procSubs(subs[0], args);
this._procSubs(subs[1], args);
}
- this._broadcast(args);
+ if (this.broadcast) {
+ this._broadcast(args);
+ }
return this.stopped ? false : true;
},
@@ -1056,7 +1129,7 @@ Y.CustomEvent.prototype = {
if (false === this._notify(s, args, ef)) {
this.stopped = 2;
}
- if (this.stopped == 2) {
+ if (this.stopped === 2) {
return false;
}
}
@@ -1083,7 +1156,7 @@ Y.CustomEvent.prototype = {
Y.fire.apply(Y, a);
}
- if (this.broadcast == 2) {
+ if (this.broadcast === 2) {
Y.Global.fire.apply(Y.Global, a);
}
}
@@ -1122,12 +1195,15 @@ Y.CustomEvent.prototype = {
var when = s._when;
if (!subs) {
- subs = (when === AFTER) ? this._afters : this._subscribers;
- i = YArray.indexOf(subs, s, 0);
+ subs = (when === AFTER) ? this._afters : this._subscribers;
}
- if (s && subs[i] === s) {
- subs.splice(i, 1);
+ if (subs) {
+ i = YArray.indexOf(subs, s, 0);
+
+ if (s && subs[i] === s) {
+ subs.splice(i, 1);
+ }
}
if (this._kds) {
@@ -1181,7 +1257,7 @@ Y.Subscriber = function(fn, context, args, when) {
* @property id
* @type String
*/
- this.id = Y.stamp(this);
+ this.id = Y.guid();
/**
* Additional arguments to propagate to the subscriber
@@ -1285,12 +1361,12 @@ Y.Subscriber.prototype = {
*/
contains: function(fn, context) {
if (context) {
- return ((this.fn == fn) && this.context == context);
+ return ((this.fn === fn) && this.context === context);
} else {
- return (this.fn == fn);
+ return (this.fn === fn);
}
},
-
+
valueOf : function() {
return this.id;
}
@@ -1409,14 +1485,14 @@ var L = Y.Lang,
* @method _getType
* @private
*/
- _getType = Y.cached(function(type, pre) {
+ _getType = function(type, pre) {
- if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) {
+ if (!pre || !type || type.indexOf(PREFIX_DELIMITER) > -1) {
return type;
}
return pre + PREFIX_DELIMITER + type;
- }),
+ },
/**
* Returns an array with the detach key (if provided),
@@ -1438,7 +1514,6 @@ var L = Y.Lang,
if (i > -1) {
after = true;
t = t.substr(AFTER_PREFIX.length);
- // Y.log(t);
}
i = t.indexOf(CATEGORY_DELIMITER);
@@ -1446,7 +1521,7 @@ var L = Y.Lang,
if (i > -1) {
detachcategory = t.substr(0, (i));
t = t.substr(i+1);
- if (t == '*') {
+ if (t === '*') {
t = null;
}
}
@@ -1457,40 +1532,38 @@ var L = Y.Lang,
ET = function(opts) {
- // Y.log('EventTarget constructor executed: ' + this._yuid);
+ var etState = this._yuievt,
+ etConfig;
- var o = (L.isObject(opts)) ? opts : {};
+ if (!etState) {
+ etState = this._yuievt = {
+ events: {}, // PERF: Not much point instantiating lazily. We're bound to have events
+ targets: null, // PERF: Instantiate lazily, if user actually adds target,
+ config: {
+ host: this,
+ context: this
+ },
+ chain: Y.config.chain
+ };
+ }
- this._yuievt = this._yuievt || {
+ etConfig = etState.config;
- id: Y.guid(),
+ if (opts) {
+ mixConfigs(etConfig, opts, true);
- events: {},
-
- targets: {},
-
- config: o,
-
- chain: ('chain' in o) ? o.chain : Y.config.chain,
-
- bubbling: false,
-
- defaults: {
- context: o.context || this,
- host: this,
- emitFacade: o.emitFacade,
- fireOnce: o.fireOnce,
- queuable: o.queuable,
- monitored: o.monitored,
- broadcast: o.broadcast,
- defaultTargetOnly: o.defaultTargetOnly,
- bubbles: ('bubbles' in o) ? o.bubbles : true
+ if (opts.chain !== undefined) {
+ etState.chain = opts.chain;
}
- };
+
+ if (opts.prefix) {
+ etConfig.prefix = opts.prefix;
+ }
+ }
};
-
ET.prototype = {
+
constructor: ET,
/**
@@ -1688,6 +1761,11 @@ ET.prototype = {
if (!handle) {
ce = yuievt.events[type] || this.publish(type);
handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);
+
+ // TODO: More robust regex, accounting for category
+ if (type.indexOf("*:") !== -1) {
+ this._hasSiblings = true;
+ }
}
if (detachcategory) {
@@ -1727,8 +1805,11 @@ ET.prototype = {
* @return {EventTarget} the host
*/
detach: function(type, fn, context) {
- var evts = this._yuievt.events, i,
- Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));
+
+ var evts = this._yuievt.events,
+ i,
+ Node = Y.Node,
+ isNode = Node && (Y.instanceOf(this, Node));
// detachAll disabled on the Y instance.
if (!type && (this !== Y)) {
@@ -1921,53 +2002,102 @@ Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'de
*
*/
publish: function(type, opts) {
- var events, ce, ret, defaults,
- edata = this._yuievt,
- pre = edata.config.prefix;
- if (L.isObject(type)) {
+ var ret,
+ etState = this._yuievt,
+ etConfig = etState.config,
+ pre = etConfig.prefix;
+
+ if (typeof type === "string") {
+ if (pre) {
+ type = _getType(type, pre);
+ }
+ ret = this._publish(type, etConfig, opts);
+ } else {
ret = {};
+
Y.each(type, function(v, k) {
- ret[k] = this.publish(k, v || opts);
+ if (pre) {
+ k = _getType(k, pre);
+ }
+ ret[k] = this._publish(k, etConfig, v || opts);
}, this);
- return ret;
}
- type = (pre) ? _getType(type, pre) : type;
+ return ret;
+ },
- events = edata.events;
- ce = events[type];
+ /**
+ * Returns the fully qualified type, given a short type string.
+ * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix.
+ *
+ * NOTE: This method, unlike _getType, does no checking of the value passed in, and
+ * is designed to be used with the low level _publish() method, for critical path
+ * implementations which need to fast-track publish for performance reasons.
+ *
+ * @method _getFullType
+ * @private
+ * @param {String} type The short type to prefix
+ * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in
+ */
+ _getFullType : function(type) {
- this._monitor('publish', type, {
- args: arguments
- });
+ var pre = this._yuievt.config.prefix;
- if (ce) {
- // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event');
- if (opts) {
- ce.applyConfig(opts, true);
- }
+ if (pre) {
+ return pre + PREFIX_DELIMITER + type;
} else {
- // TODO: Lazy publish goes here.
- defaults = edata.defaults;
+ return type;
+ }
+ },
- // apply defaults
- ce = new Y.CustomEvent(type, defaults);
- if (opts) {
- ce.applyConfig(opts, true);
- }
+ /**
+ * The low level event publish implementation. It expects all the massaging to have been done
+ * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast
+ * path publish, which can be used by critical code paths to improve performance.
+ *
+ * @method _publish
+ * @private
+ * @param {String} fullType The prefixed type of the event to publish.
+ * @param {Object} etOpts The EventTarget specific configuration to mix into the published event.
+ * @param {Object} ceOpts The publish specific configuration to mix into the published event.
+ * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will
+ * be the default `CustomEvent` instance, and can be configured independently.
+ */
+ _publish : function(fullType, etOpts, ceOpts) {
- events[type] = ce;
+ var ce,
+ etState = this._yuievt,
+ etConfig = etState.config,
+ host = etConfig.host,
+ context = etConfig.context,
+ events = etState.events;
+
+ ce = events[fullType];
+
+ // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight.
+ if ((etConfig.monitored && !ce) || (ce && ce.monitored)) {
+ this._monitor('publish', fullType, {
+ args: arguments
+ });
}
- // make sure we turn the broadcast flag off if this
- // event was published as a result of bubbling
- // if (opts instanceof Y.CustomEvent) {
- // events[type].broadcast = false;
- // }
+ if (!ce) {
+ // Publish event
+ ce = events[fullType] = new Y.CustomEvent(fullType, etOpts);
- return events[type];
+ if (!etOpts) {
+ ce.host = host;
+ ce.context = context;
+ }
+ }
+
+ if (ceOpts) {
+ mixConfigs(ce, ceOpts, true);
+ }
+
+ return ce;
},
/**
@@ -2007,23 +2137,23 @@ Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'de
}
},
- /**
+ /**
* Fire a custom event by name. The callback functions will be executed
* from the context specified when the event was created, and with the
* following parameters.
*
- * If the custom event object hasn't been created, then the event hasn't
- * been published and it has no subscribers. For performance sake, we
- * immediate exit in this case. This means the event won't bubble, so
- * if the intention is that a bubble target be notified, the event must
- * be published on this object first.
- *
* The first argument is the event type, and any additional arguments are
* passed to the listeners as parameters. If the first of these is an
* object literal, and the event is configured to emit an event facade,
* that object is mixed into the event facade and the facade is provided
* in place of the original object.
*
+ * If the custom event object hasn't been created, then the event hasn't
+ * been published and it has no subscribers. For performance sake, we
+ * immediate exit in this case. This means the event won't bubble, so
+ * if the intention is that a bubble target be notified, the event must
+ * be published on this object first.
+ *
* @method fire
* @param type {String|Object} The type of the event, or an object that contains
* a 'type' property.
@@ -2032,30 +2162,63 @@ Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'de
* configured to emit an event facade, the event facade will replace that
* parameter after the properties the object literal contains are copied to
* the event facade.
- * @return {EventTarget} the event host
+ * @return {Boolean} True if the whole lifecycle of the event went through,
+ * false if at any point the event propagation was halted.
*/
fire: function(type) {
- var typeIncluded = L.isString(type),
- t = (typeIncluded) ? type : (type && type.type),
+ var typeIncluded = (typeof type === "string"),
+ argCount = arguments.length,
+ t = type,
yuievt = this._yuievt,
- pre = yuievt.config.prefix,
- ce, ret,
+ etConfig = yuievt.config,
+ pre = etConfig.prefix,
+ ret,
+ ce,
ce2,
- args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;
+ args;
- t = (pre) ? _getType(t, pre) : t;
+ if (typeIncluded && argCount <= 3) {
- ce = this.getEvent(t, true);
- ce2 = this.getSibling(t, ce);
+ // PERF: Try to avoid slice/iteration for the common signatures
- if (ce2 && !ce) {
- ce = this.publish(t);
+ // Most common
+ if (argCount === 2) {
+ args = [arguments[1]]; // fire("foo", {})
+ } else if (argCount === 3) {
+ args = [arguments[1], arguments[2]]; // fire("foo", {}, opts)
+ } else {
+ args = []; // fire("foo")
+ }
+
+ } else {
+ args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0));
}
- this._monitor('fire', (ce || t), {
- args: args
- });
+ if (!typeIncluded) {
+ t = (type && type.type);
+ }
+
+ if (pre) {
+ t = _getType(t, pre);
+ }
+
+ ce = yuievt.events[t];
+
+ if (this._hasSiblings) {
+ ce2 = this.getSibling(t, ce);
+
+ if (ce2 && !ce) {
+ ce = this.publish(t);
+ }
+ }
+
+ // PERF: trying to avoid function call, since this is a critical path
+ if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
+ this._monitor('fire', (ce || t), {
+ args: args
+ });
+ }
// this event has not been published or subscribed to
if (!ce) {
@@ -2066,8 +2229,12 @@ Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'de
// otherwise there is nothing to be done
ret = true;
} else {
- ce.sibling = ce2;
- ret = ce.fire.apply(ce, args);
+
+ if (ce2) {
+ ce.sibling = ce2;
+ }
+
+ ret = ce._fire(args);
}
return (yuievt.chain) ? this : ret;
@@ -2075,17 +2242,15 @@ Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'de
getSibling: function(type, ce) {
var ce2;
+
// delegate to *:type events if there are subscribers
if (type.indexOf(PREFIX_DELIMITER) > -1) {
type = _wildType(type);
- // console.log(type);
ce2 = this.getEvent(type, true);
if (ce2) {
- // console.log("GOT ONE: " + type);
ce2.applyConfig(ce);
ce2.bubbles = false;
ce2.broadcast = 0;
- // ret = ce2.fire.apply(ce2, a);
}
}
@@ -2102,6 +2267,7 @@ Y.log('EventTarget unsubscribeAll() is deprecated, use detachAll()', 'warn', 'de
*/
getEvent: function(type, prefixed) {
var pre, e;
+
if (!prefixed) {
pre = this._yuievt.config.prefix;
type = (pre) ? _getType(type, pre) : type;
@@ -2200,7 +2366,9 @@ Y.Global = YUI.Env.globalEvents;
treating that method as an event
-For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.
+For custom event subscriptions, pass the custom event name as the first argument
+and callback as the second. The `this` object in the callback will be `Y` unless
+an override is passed as the third argument.
Y.on('io:complete', function () {
Y.MyApp.updateStatus('Transaction complete');
@@ -2226,7 +2394,7 @@ selector or other identifier.
`defaultFn` can prevent the default behavior with `e.preventDefault()` from the
event object passed as the first parameter to the subscription callback.
-To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
+To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
`Y.Do.before(...)`.
NOTE: The formal parameter list below is for events, not for function
@@ -2311,4 +2479,4 @@ for that signature.
**/
-}, '3.9.1', {"requires": ["oop"]});
+}, '3.12.0', {"requires": ["oop"]});
diff --git a/lib/yuilib/3.12.0/event-custom-base/event-custom-base-min.js b/lib/yuilib/3.12.0/event-custom-base/event-custom-base-min.js
new file mode 100755
index 00000000000..42f83ee5814
--- /dev/null
+++ b/lib/yuilib/3.12.0/event-custom-base/event-custom-base-min.js
@@ -0,0 +1,10 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-custom-base",function(e,t){e.Env.evt={handles:{},plugins:{}};var n=0,r=1,i={objs:null,before:function(t,r,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(n,o,r,i)},after:function(t,n,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(r,o,n,i)},_inject:function(t,n,r,i){var s=e.stamp(r),o,u;return r._yuiaop||(r._yuiaop={}),o=r._yuiaop,o[i]||(o[i]=new e.Do.Method(r,i),r[i]=function(){return o[i].exec.apply(o[i],arguments)}),u=s+e.stamp(n)+i,o[i].register(u,n,t),new e.EventHandle(o[i],u)},detach:function(e){e.detach&&e.detach()}};e.Do=i,i.Method=function(e,t){this.obj=e,this.methodName=t,this.method=e[t],this.before={},this.after={}},i.Method.prototype.register=function(e,t,n){n?this.after[e]=t:this.before[e]=t},i.Method.prototype._delete=function(e){delete this.before[e],delete this.after[e]},i.Method.prototype.exec=function(){var t=e.Array(arguments,0,!0),n,r,s,o=this.before,u=this.after,a=!1;for(n in o)if(o.hasOwnProperty(n)){r=o[n].apply(this.obj,t);if(r)switch(r.constructor){case i.Halt:return r.retVal;case i.AlterArgs:t=r.newArgs;break;case i.Prevent:a=!0;break;default:}}a||(r=this.method.apply(this.obj,t)),i.originalRetVal=r,i.currentRetVal=r;for(n in u)if(u.hasOwnProperty(n)){s=u[n].apply(this.obj,t);if(s&&s.constructor===i.Halt)return s.retVal;s&&s.constructor===i.AlterReturn&&(r=s.newRetVal,i.currentRetVal=r)}return r},i.AlterArgs=function(e,t){this.msg=e,this.newArgs=t},i.AlterReturn=function(e,t){this.msg=e,this.newRetVal=t},i.Halt=function(e,t){this.msg=e,this.retVal=t},i.Prevent=function(e){this.msg=e},i.Error=i.Halt;var s=e.Array,o="after",u=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],a=s.hash(u),f=Array.prototype.slice,l=9,c="yui:log",h=function(e,t,n){var r;for(r in t)a[r]&&(n||!(r in e))&&(e[r]=t[r]);return e};e.CustomEvent=function(t,n){this._kds=e.CustomEvent.keepDeprecatedSubs,this.id=e.guid(),this.type=t,this.silent=this.logSystem=t===c,this._kds&&(this.subscribers={},this.afters={}),n&&h(this,n,!0)},e.CustomEvent.keepDeprecatedSubs=!1,e.CustomEvent.mixConfigs=h,e.CustomEvent.prototype={constructor:e.CustomEvent,signature:l,context:e,preventable:!0,bubbles:!0,hasSubs:function(e){var t=0,n=0,r=this._subscribers,i=this._afters,s=this.sibling;return r&&(t=r.length),i&&(n=i.length),s&&(r=s._subscribers,i=s._afters,r&&(t+=r.length),i&&(n+=i.length)),e?e==="after"?n:t:t+n},monitor:function(e){this.monitored=!0;var t=this.id+"|"+this.type+"_"+e,n=f.call(arguments,0);return n[0]=t,this.host.on.apply(this.host,n)},getSubs:function(){var e=this.sibling,t=this._subscribers,n=this._afters,r,i;return e&&(r=e._subscribers,i=e._afters),r?t?t=t.concat(r):t=r.concat():t?t=t.concat():t=[],i?n?n=n.concat(i):n=i.concat():n?n=n.concat():n=[],[t,n]},applyConfig:function(e,t){h(this,e,t)},_on:function(t,n,r,i){var s=new e.Subscriber(t,n,r,i),u;return this.fireOnce&&this.fired&&(u=this.firedWith,this.emitFacade&&this._addFacadeToArgs&&this._addFacadeToArgs(u),this.async?setTimeout(e.bind(this._notify,this,s,u),0):this._notify(s,u)),i===o?(this._afters||(this._afters=[]),this._afters.push(s)):(this._subscribers||(this._subscribers=[]),this._subscribers.push(s)),this._kds&&(i===o?this.afters[s.id]=s:this.subscribers[s.id]=s),new e.EventHandle(this,s)},subscribe:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,!0)},on:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this.monitored&&this.host&&this.host._monitor("attach",this,{args:arguments}),this._on(e,t,n,!0)},after:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,o)},detach:function(e,t){if(e&&e.detach)return e.detach();var n,r,i=0,s=this._subscribers,o=this._afters;if(s)for(n=s.length;n>=0;n--)r=s[n],r&&(!e||e===r.fn)&&(this._delete(r,s,n),i++);if(o)for(n=o.length;n>=0;n--)r=o[n],r&&(!e||e===r.fn)&&(this._delete(r,o,n),i++);return i},unsubscribe:function(){return this.detach.apply(this,arguments)},_notify:function(e,t,n){var r;return r=e.notify(t,this),!1===r||this.stopped>1?!1:!0},log:function(e,t){},fire:function(){var e=[];return e.push.apply(e,arguments),this._fire(e)},_fire:function(e){return this.fireOnce&&this.fired?!0:(this.fired=!0,this.fireOnce&&(this.firedWith=e),this.emitFacade?this.fireComplex(e):this.fireSimple(e))},fireSimple:function(e){this.stopped=0,this.prevented=0;if(this.hasSubs()){var t=this.getSubs();this._procSubs(t[0],e),this._procSubs(t[1],e)}return this.broadcast&&this._broadcast(e),this.stopped?!1:!0},fireComplex:function(e){return e[0]=e[0]||{},this.fireSimple(e)},_procSubs:function(e,t,n){var r,i,s;for(i=0,s=e.length;i-1?e:t+d+e},w=e.cached(function(e,t){var n=e,r,i,s;return p.isString(n)?(s=n.indexOf(m),s>-1&&(i=!0,n=n.substr(m.length)),s=n.indexOf(v),s>-1&&(r=n.substr(0,s),n=n.substr(s+1),n==="*"&&(n=null)),[r,t?b(n,t):n,i,n]):n}),E=function(t){var n=this._yuievt,r;n||(n=this._yuievt={events:{},targets:null,config:{host:this,context:this},chain:e.config.chain}),r=n.config,t&&(h(r,t,!0),t.chain!==undefined&&(n.chain=t.chain),t.prefix&&(r.prefix=t.prefix))};E.prototype={constructor:E,once:function(){var e=this.on.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},onceAfter:function(){var e=this.after.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},parseType:function(e,t){return w(e,t||this._yuievt.config.prefix)},on:function(t,n,r){var i=this._yuievt,s=w(t,i.config.prefix),o,u,a,l,c,h,d,v=e.Env.evt.handles,g,y,b,E=e.Node,S,x,T;this._monitor("attach",s[1],{args:arguments,category:s[0],after:s[2]});if(p.isObject(t))return p.isFunction(t)?e.Do.before.apply(e.Do,arguments):(o=n,u=r,a=f.call(arguments,0),l=[],p.isArray(t)&&(T=!0),g=t._after,delete t._after,e.each(t,function(e,t){p.isObject(e)&&(o=e.fn||(p.isFunction(e)?e:o),u=e.context||u);var n=g?m:"";a[0]=n+(T?e:t),a[1]=o,a[2]=u,l.push(this.on.apply(this,a))},this),i.chain?this:new e.EventHandle(l));h=s[0],g=s[2],b=s[3];if(E&&e.instanceOf(this,E)&&b in E.DOM_EVENTS)return a=f.call(arguments,0),a.splice(2,0,E.getDOMNode(this)),e.on.apply(e,a);t=s[1];if(e.instanceOf(this,YUI)){y=e.Env.evt.plugins[t],a=f.call(arguments,0),a[0]=b,E&&(S=a[2],e.instanceOf(S,e.NodeList)?S=e.NodeList.getDOMNodes(S):e.instanceOf(S,E)&&(S=E.getDOMNode(S)),x=b in E.DOM_EVENTS,x&&(a[2]=S));if(y)d=y.on.apply(e,a);else if(!t||x)d=e.Event._attach(a)}return d||(c=i.events[t]||this.publish(t),d=c._on(n,r,arguments.length>3?f.call(arguments,3):null,g?"after":!0),t.indexOf("*:")!==-1&&(this._hasSiblings=!0)),h&&(v[h]=v[h]||{},v[h][t]=v[h][t]||[],v[h][t].push(d)),i.chain?this:d},subscribe:function(){return this.on.apply(this,arguments)},detach:function(t,n,r){var i=this._yuievt.events,s,o=e.Node,u=o&&e.instanceOf(this,o);if(!t&&this!==e){for(s in i)i.hasOwnProperty(s)&&i[s].detach(n,r);return u&&e.Event.purgeElement(o.getDOMNode(this)),this}var a=w(t,this._yuievt.config.prefix),l=p.isArray(a)?a[0]:null,c=a?a[3]:null,h,d=e.Env.evt.handles,v,m,g,y,b=function(e,t,n){var r=e[t],i,s;if(r)for(s=r.length-1;s>=0;--s)i=r[s].evt,(i.host===n||i.el===n)&&r[s].detach()};if(l){m=d[l],t=a[1],v=u?e.Node.getDOMNode(this):this;if(m){if(t)b(m,t,v);else for(s in m)m.hasOwnProperty(s)&&b(m,s,v);return this}}else{if(p.isObject(t)&&t.detach)return t.detach(),this;if(u&&(!c||c in o.DOM_EVENTS))return g=f.call(arguments,0),g[2]=o.getDOMNode(this),e.detach.apply(e,g),this}h=e.Env.evt.plugins[c];if(e.instanceOf(this,YUI)){g=f.call(arguments,0);if(h&&h.detach)return h.detach.apply(e,g),this;if(!t||!h&&o&&t in o.DOM_EVENTS)return g[0]=t,e.Event.detach.apply(e.Event,g),this}return y=i[a[1]],y&&y.detach(n,r),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(e){return this.detach(e)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(t,n){var r,i=this._yuievt,s=i.config,o=s.prefix;return typeof t=="string"?(o&&(t=b(t,o)),r=this._publish(t,s,n)):(r={},e.each(t,function(e,t){o&&(t=b(t,o)),r[t]=this._publish(t,s,e||n)},this)),r},_getFullType:function(e){var t=this._yuievt.config.prefix;return t?t+d+e:e},_publish:function(t,n,r){var i,s=this._yuievt,o=s.config,u=o.host,a=o.context,f=s.events;return i=f[t],(o.monitored&&!i||i&&i.monitored)&&this._monitor("publish",t,{args:arguments}),i||(i=f[t]=new e.CustomEvent(t,n),n||(i.host=u,i.context=a)),r&&h(i,r,!0),i},_monitor:function(e,t,n){var r,i,s;if(t){typeof t=="string"?(s=t,i=this.getEvent(t,!0)):(i=t,s=t.type);if(this._yuievt.config.monitored&&(!i||i.monitored)||i&&i.monitored)r=s+"_"+e,n.monitored=e,this.fire.call(this,r,n)}},fire:function(e){var t=typeof e=="string",n=arguments.length,r=e,i=this._yuievt,s=i.config,o=s.prefix,u,a,l,c;t&&n<=3?n===2?c=[arguments[1]]:n===3?c=[arguments[1],arguments[2]]:c=[]:c=f.call(arguments,t?1:0),t||(r=e&&e.type),o&&(r=b(r,o)),a=i.events[r],this._hasSiblings&&(l=this.getSibling(r,a),l&&!a&&(a=this.publish(r))),(s.monitored&&(!a||a.monitored)||a&&a.monitored)&&this._monitor("fire",a||r,{args:c});if(!a){if(i.hasTargets)return this.bubble({type:r},c,this);u=!0}else l&&(a.sibling=l),u=a._fire(c);return i.chain?this:u},getSibling:function(e,t){var n;return e.indexOf(d)>-1&&(e=y(e),n=this.getEvent(e,!0),n&&(n.applyConfig(t),n.bubbles=!1,n.broadcast=0)),n},getEvent:function(e,t){var n,r;return t||(n=this._yuievt.config.prefix,e=n?b(e,n):e),r=this._yuievt.events,r[e]||null},after:function(t,n){var r=f.call(arguments,0);switch(p.type(t)){case"function":return e.Do.after.apply(e.Do,arguments);case"array":case"object":r[0]._after=!0;break;default:r[0]=m+t}return this.on.apply(this,r)},before:function(){return this.on.apply
+(this,arguments)}},e.EventTarget=E,e.mix(e,E.prototype),E.call(e,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new E,e.Global=YUI.Env.globalEvents},"3.12.0",{requires:["oop"]});
diff --git a/lib/yuilib/3.9.1/build/event-custom-base/event-custom-base.js b/lib/yuilib/3.12.0/event-custom-base/event-custom-base.js
old mode 100644
new mode 100755
similarity index 84%
rename from lib/yuilib/3.9.1/build/event-custom-base/event-custom-base.js
rename to lib/yuilib/3.12.0/event-custom-base/event-custom-base.js
index cebb1484487..3f5b9b63b0c
--- a/lib/yuilib/3.9.1/build/event-custom-base/event-custom-base.js
+++ b/lib/yuilib/3.12.0/event-custom-base/event-custom-base.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('event-custom-base', function (Y, NAME) {
/**
@@ -36,12 +42,12 @@ DO = {
* Cache of objects touched by the utility
* @property objs
* @static
- * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
- * replaces the role of this property, but is considered to be private, and
+ * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
+ * replaces the role of this property, but is considered to be private, and
* is only mentioned to provide a migration path.
- *
- * If you have a use case which warrants migration to the _yuiaop property,
- * please file a ticket to let us know what it's used for and we can see if
+ *
+ * If you have a use case which warrants migration to the _yuiaop property,
+ * please file a ticket to let us know what it's used for and we can see if
* we need to expose hooks for that functionality more formally.
*/
objs: null,
@@ -175,9 +181,6 @@ DO = {
if (handle.detach) {
handle.detach();
}
- },
-
- _unload: function(e, me) {
}
};
@@ -303,10 +306,10 @@ DO.Method.prototype.exec = function () {
if (af.hasOwnProperty(i)) {
newRet = af[i].apply(this.obj, args);
// Stop processing if a Halt object is returned
- if (newRet && newRet.constructor == DO.Halt) {
+ if (newRet && newRet.constructor === DO.Halt) {
return newRet.retVal;
// Check for a new return value
- } else if (newRet && newRet.constructor == DO.AlterReturn) {
+ } else if (newRet && newRet.constructor === DO.AlterReturn) {
ret = newRet.newRetVal;
// Update the static retval state
DO.currentRetVal = ret;
@@ -391,9 +394,6 @@ DO.Error = DO.Halt;
//////////////////////////////////////////////////////////////////////////
-// Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do);
-
-
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
@@ -431,7 +431,7 @@ var YArray = Y.Array,
CONFIGS_HASH = YArray.hash(CONFIGS),
- nativeSlice = Array.prototype.slice,
+ nativeSlice = Array.prototype.slice,
YUI3_SIGNATURE = 9,
YUI_LOG = 'yui:log',
@@ -440,7 +440,7 @@ var YArray = Y.Array,
var p;
for (p in s) {
- if (CONFIGS_HASH[p] && (ov || !(p in r))) {
+ if (CONFIGS_HASH[p] && (ov || !(p in r))) {
r[p] = s[p];
}
}
@@ -454,257 +454,69 @@ var YArray = Y.Array,
*
* @param {String} type The type of event, which is passed to the callback
* when the event fires.
- * @param {object} o configuration object.
+ * @param {object} defaults configuration object.
* @class CustomEvent
* @constructor
*/
-Y.CustomEvent = function(type, o) {
+
+ /**
+ * The type of event, returned to subscribers when the event fires
+ * @property type
+ * @type string
+ */
+
+/**
+ * By default all custom events are logged in the debug build, set silent
+ * to true to disable debug outpu for this event.
+ * @property silent
+ * @type boolean
+ */
+
+Y.CustomEvent = function(type, defaults) {
this._kds = Y.CustomEvent.keepDeprecatedSubs;
- o = o || {};
+ this.id = Y.guid();
- this.id = Y.stamp(this);
-
- /**
- * The type of event, returned to subscribers when the event fires
- * @property type
- * @type string
- */
this.type = type;
+ this.silent = this.logSystem = (type === YUI_LOG);
- /**
- * The context the the event will fire from by default. Defaults to the YUI
- * instance.
- * @property context
- * @type object
- */
- this.context = Y;
-
- /**
- * Monitor when an event is attached or detached.
- *
- * @property monitored
- * @type boolean
- */
- // this.monitored = false;
-
- this.logSystem = (type == YUI_LOG);
-
- /**
- * If 0, this event does not broadcast. If 1, the YUI instance is notified
- * every time this event fires. If 2, the YUI instance and the YUI global
- * (if event is enabled on the global) are notified every time this event
- * fires.
- * @property broadcast
- * @type int
- */
- // this.broadcast = 0;
-
- /**
- * By default all custom events are logged in the debug build, set silent
- * to true to disable debug outpu for this event.
- * @property silent
- * @type boolean
- */
- this.silent = this.logSystem;
-
- /**
- * Specifies whether this event should be queued when the host is actively
- * processing an event. This will effect exectution order of the callbacks
- * for the various events.
- * @property queuable
- * @type boolean
- * @default false
- */
- // this.queuable = false;
-
- /**
- * The subscribers to this event
- * @property subscribers
- * @type Subscriber {}
- * @deprecated
- */
if (this._kds) {
+ /**
+ * The subscribers to this event
+ * @property subscribers
+ * @type Subscriber {}
+ * @deprecated
+ */
+
+ /**
+ * 'After' subscribers
+ * @property afters
+ * @type Subscriber {}
+ * @deprecated
+ */
this.subscribers = {};
- }
-
- /**
- * The subscribers to this event
- * @property _subscribers
- * @type Subscriber []
- * @private
- */
- this._subscribers = [];
-
- /**
- * 'After' subscribers
- * @property afters
- * @type Subscriber {}
- */
- if (this._kds) {
this.afters = {};
}
- /**
- * 'After' subscribers
- * @property _afters
- * @type Subscriber []
- * @private
- */
- this._afters = [];
-
- /**
- * This event has fired if true
- *
- * @property fired
- * @type boolean
- * @default false;
- */
- // this.fired = false;
-
- /**
- * An array containing the arguments the custom event
- * was last fired with.
- * @property firedWith
- * @type Array
- */
- // this.firedWith;
-
- /**
- * This event should only fire one time if true, and if
- * it has fired, any new subscribers should be notified
- * immediately.
- *
- * @property fireOnce
- * @type boolean
- * @default false;
- */
- // this.fireOnce = false;
-
- /**
- * fireOnce listeners will fire syncronously unless async
- * is set to true
- * @property async
- * @type boolean
- * @default false
- */
- //this.async = false;
-
- /**
- * Flag for stopPropagation that is modified during fire()
- * 1 means to stop propagation to bubble targets. 2 means
- * to also stop additional subscribers on this target.
- * @property stopped
- * @type int
- */
- // this.stopped = 0;
-
- /**
- * Flag for preventDefault that is modified during fire().
- * if it is not 0, the default behavior for this event
- * @property prevented
- * @type int
- */
- // this.prevented = 0;
-
- /**
- * Specifies the host for this custom event. This is used
- * to enable event bubbling
- * @property host
- * @type EventTarget
- */
- // this.host = null;
-
- /**
- * The default function to execute after event listeners
- * have fire, but only if the default action was not
- * prevented.
- * @property defaultFn
- * @type Function
- */
- // this.defaultFn = null;
-
- /**
- * The function to execute if a subscriber calls
- * stopPropagation or stopImmediatePropagation
- * @property stoppedFn
- * @type Function
- */
- // this.stoppedFn = null;
-
- /**
- * The function to execute if a subscriber calls
- * preventDefault
- * @property preventedFn
- * @type Function
- */
- // this.preventedFn = null;
-
- /**
- * Specifies whether or not this event's default function
- * can be cancelled by a subscriber by executing preventDefault()
- * on the event facade
- * @property preventable
- * @type boolean
- * @default true
- */
- this.preventable = true;
-
- /**
- * Specifies whether or not a subscriber can stop the event propagation
- * via stopPropagation(), stopImmediatePropagation(), or halt()
- *
- * Events can only bubble if emitFacade is true.
- *
- * @property bubbles
- * @type boolean
- * @default true
- */
- this.bubbles = true;
-
- /**
- * Supports multiple options for listener signatures in order to
- * port YUI 2 apps.
- * @property signature
- * @type int
- * @default 9
- */
- this.signature = YUI3_SIGNATURE;
-
- // this.subCount = 0;
- // this.afterCount = 0;
-
- // this.hasSubscribers = false;
- // this.hasAfters = false;
-
- /**
- * If set to true, the custom event will deliver an EventFacade object
- * that is similar to a DOM event object.
- * @property emitFacade
- * @type boolean
- * @default false
- */
- // this.emitFacade = false;
-
- this.applyConfig(o, true);
-
-
+ if (defaults) {
+ mixConfigs(this, defaults, true);
+ }
};
/**
* Static flag to enable population of the `subscribers`
* and `afters` properties held on a `CustomEvent` instance.
- *
- * These properties were changed to private properties (`_subscribers` and `_afters`), and
- * converted from objects to arrays for performance reasons.
*
- * Setting this property to true will populate the deprecated `subscribers` and `afters`
+ * These properties were changed to private properties (`_subscribers` and `_afters`), and
+ * converted from objects to arrays for performance reasons.
+ *
+ * Setting this property to true will populate the deprecated `subscribers` and `afters`
* properties for people who may be using them (which is expected to be rare). There will
* be a performance hit, compared to the new array based implementation.
*
* If you are using these deprecated properties for a use case which the public API
- * does not support, please file an enhancement request, and we can provide an alternate
+ * does not support, please file an enhancement request, and we can provide an alternate
* public implementation which doesn't have the performance cost required to maintiain the
* properties as objects.
*
@@ -723,6 +535,169 @@ Y.CustomEvent.prototype = {
constructor: Y.CustomEvent,
+ /**
+ * Monitor when an event is attached or detached.
+ *
+ * @property monitored
+ * @type boolean
+ */
+
+ /**
+ * If 0, this event does not broadcast. If 1, the YUI instance is notified
+ * every time this event fires. If 2, the YUI instance and the YUI global
+ * (if event is enabled on the global) are notified every time this event
+ * fires.
+ * @property broadcast
+ * @type int
+ */
+
+ /**
+ * Specifies whether this event should be queued when the host is actively
+ * processing an event. This will effect exectution order of the callbacks
+ * for the various events.
+ * @property queuable
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * This event has fired if true
+ *
+ * @property fired
+ * @type boolean
+ * @default false;
+ */
+
+ /**
+ * An array containing the arguments the custom event
+ * was last fired with.
+ * @property firedWith
+ * @type Array
+ */
+
+ /**
+ * This event should only fire one time if true, and if
+ * it has fired, any new subscribers should be notified
+ * immediately.
+ *
+ * @property fireOnce
+ * @type boolean
+ * @default false;
+ */
+
+ /**
+ * fireOnce listeners will fire syncronously unless async
+ * is set to true
+ * @property async
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * Flag for stopPropagation that is modified during fire()
+ * 1 means to stop propagation to bubble targets. 2 means
+ * to also stop additional subscribers on this target.
+ * @property stopped
+ * @type int
+ */
+
+ /**
+ * Flag for preventDefault that is modified during fire().
+ * if it is not 0, the default behavior for this event
+ * @property prevented
+ * @type int
+ */
+
+ /**
+ * Specifies the host for this custom event. This is used
+ * to enable event bubbling
+ * @property host
+ * @type EventTarget
+ */
+
+ /**
+ * The default function to execute after event listeners
+ * have fire, but only if the default action was not
+ * prevented.
+ * @property defaultFn
+ * @type Function
+ */
+
+ /**
+ * The function to execute if a subscriber calls
+ * stopPropagation or stopImmediatePropagation
+ * @property stoppedFn
+ * @type Function
+ */
+
+ /**
+ * The function to execute if a subscriber calls
+ * preventDefault
+ * @property preventedFn
+ * @type Function
+ */
+
+ /**
+ * The subscribers to this event
+ * @property _subscribers
+ * @type Subscriber []
+ * @private
+ */
+
+ /**
+ * 'After' subscribers
+ * @property _afters
+ * @type Subscriber []
+ * @private
+ */
+
+ /**
+ * If set to true, the custom event will deliver an EventFacade object
+ * that is similar to a DOM event object.
+ * @property emitFacade
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * Supports multiple options for listener signatures in order to
+ * port YUI 2 apps.
+ * @property signature
+ * @type int
+ * @default 9
+ */
+ signature : YUI3_SIGNATURE,
+
+ /**
+ * The context the the event will fire from by default. Defaults to the YUI
+ * instance.
+ * @property context
+ * @type object
+ */
+ context : Y,
+
+ /**
+ * Specifies whether or not this event's default function
+ * can be cancelled by a subscriber by executing preventDefault()
+ * on the event facade
+ * @property preventable
+ * @type boolean
+ * @default true
+ */
+ preventable : true,
+
+ /**
+ * Specifies whether or not a subscriber can stop the event propagation
+ * via stopPropagation(), stopImmediatePropagation(), or halt()
+ *
+ * Events can only bubble if emitFacade is true.
+ *
+ * @property bubbles
+ * @type boolean
+ * @default true
+ */
+ bubbles : true,
+
/**
* Returns the number of subscribers for this event as the sum of the on()
* subscribers and after() subscribers.
@@ -731,15 +706,35 @@ Y.CustomEvent.prototype = {
* @return Number
*/
hasSubs: function(when) {
- var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;
+ var s = 0,
+ a = 0,
+ subs = this._subscribers,
+ afters = this._afters,
+ sib = this.sibling;
+
+ if (subs) {
+ s = subs.length;
+ }
+
+ if (afters) {
+ a = afters.length;
+ }
if (sib) {
- s += sib._subscribers.length;
- a += sib._afters.length;
+ subs = sib._subscribers;
+ afters = sib._afters;
+
+ if (subs) {
+ s += subs.length;
+ }
+
+ if (afters) {
+ a += afters.length;
+ }
}
if (when) {
- return (when == 'after') ? a : s;
+ return (when === 'after') ? a : s;
}
return (s + a);
@@ -767,12 +762,47 @@ Y.CustomEvent.prototype = {
* @return {Array} first item is the on subscribers, second the after.
*/
getSubs: function() {
- var s = this._subscribers, a = this._afters, sib = this.sibling;
- s = (sib) ? s.concat(sib._subscribers) : s.concat();
- a = (sib) ? a.concat(sib._afters) : a.concat();
+ var sibling = this.sibling,
+ subs = this._subscribers,
+ afters = this._afters,
+ siblingSubs,
+ siblingAfters;
- return [s, a];
+ if (sibling) {
+ siblingSubs = sibling._subscribers;
+ siblingAfters = sibling._afters;
+ }
+
+ if (siblingSubs) {
+ if (subs) {
+ subs = subs.concat(siblingSubs);
+ } else {
+ subs = siblingSubs.concat();
+ }
+ } else {
+ if (subs) {
+ subs = subs.concat();
+ } else {
+ subs = [];
+ }
+ }
+
+ if (siblingAfters) {
+ if (afters) {
+ afters = afters.concat(siblingAfters);
+ } else {
+ afters = siblingAfters.concat();
+ }
+ } else {
+ if (afters) {
+ afters = afters.concat();
+ } else {
+ afters = [];
+ }
+ }
+
+ return [subs, afters];
},
/**
@@ -788,7 +818,7 @@ Y.CustomEvent.prototype = {
/**
* Create the Subscription for subscribing function, context, and bound
- * arguments. If this is a fireOnce event, the subscriber is immediately
+ * arguments. If this is a fireOnce event, the subscriber is immediately
* notified.
*
* @method _on
@@ -802,24 +832,41 @@ Y.CustomEvent.prototype = {
_on: function(fn, context, args, when) {
- var s = new Y.Subscriber(fn, context, args, when);
+ var s = new Y.Subscriber(fn, context, args, when),
+ firedWith;
if (this.fireOnce && this.fired) {
+
+ firedWith = this.firedWith;
+
+ // It's a little ugly for this to know about facades,
+ // but given the current breakup, not much choice without
+ // moving a whole lot of stuff around.
+ if (this.emitFacade && this._addFacadeToArgs) {
+ this._addFacadeToArgs(firedWith);
+ }
+
if (this.async) {
- setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);
+ setTimeout(Y.bind(this._notify, this, s, firedWith), 0);
} else {
- this._notify(s, this.firedWith);
+ this._notify(s, firedWith);
}
}
- if (when == AFTER) {
+ if (when === AFTER) {
+ if (!this._afters) {
+ this._afters = [];
+ }
this._afters.push(s);
} else {
+ if (!this._subscribers) {
+ this._subscribers = [];
+ }
this._subscribers.push(s);
}
if (this._kds) {
- if (when == AFTER) {
+ if (when === AFTER) {
this.afters[s.id] = s;
} else {
this.subscribers[s.id] = s;
@@ -840,7 +887,7 @@ Y.CustomEvent.prototype = {
var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
return this._on(fn, context, a, true);
},
-
+
/**
* Listen for this event
* @method on
@@ -890,25 +937,29 @@ Y.CustomEvent.prototype = {
if (fn && fn.detach) {
return fn.detach();
}
-
+
var i, s,
found = 0,
subs = this._subscribers,
afters = this._afters;
- for (i = subs.length; i >= 0; i--) {
- s = subs[i];
- if (s && (!fn || fn === s.fn)) {
- this._delete(s, subs, i);
- found++;
+ if (subs) {
+ for (i = subs.length; i >= 0; i--) {
+ s = subs[i];
+ if (s && (!fn || fn === s.fn)) {
+ this._delete(s, subs, i);
+ found++;
+ }
}
}
- for (i = afters.length; i >= 0; i--) {
- s = afters[i];
- if (s && (!fn || fn === s.fn)) {
- this._delete(s, afters, i);
- found++;
+ if (afters) {
+ for (i = afters.length; i >= 0; i--) {
+ s = afters[i];
+ if (s && (!fn || fn === s.fn)) {
+ this._delete(s, afters, i);
+ found++;
+ }
}
}
@@ -976,12 +1027,33 @@ Y.CustomEvent.prototype = {
*
*/
fire: function() {
+
+ // push is the fastest way to go from arguments to arrays
+ // for most browsers currently
+ // http://jsperf.com/push-vs-concat-vs-slice/2
+
+ var args = [];
+ args.push.apply(args, arguments);
+
+ return this._fire(args);
+ },
+
+ /**
+ * Private internal implementation for `fire`, which is can be used directly by
+ * `EventTarget` and other event module classes which have already converted from
+ * an `arguments` list to an array, to avoid the repeated overhead.
+ *
+ * @method _fire
+ * @private
+ * @param {Array} args The array of arguments passed to be passed to handlers.
+ * @return {boolean} false if one of the subscribers returned false, true otherwise.
+ */
+ _fire: function(args) {
+
if (this.fireOnce && this.fired) {
return true;
} else {
- var args = nativeSlice.call(arguments, 0);
-
// this doesn't happen if the event isn't published
// this.host._monitor('fire', this.type, args);
@@ -1015,7 +1087,9 @@ Y.CustomEvent.prototype = {
this._procSubs(subs[0], args);
this._procSubs(subs[1], args);
}
- this._broadcast(args);
+ if (this.broadcast) {
+ this._broadcast(args);
+ }
return this.stopped ? false : true;
},
@@ -1046,7 +1120,7 @@ Y.CustomEvent.prototype = {
if (false === this._notify(s, args, ef)) {
this.stopped = 2;
}
- if (this.stopped == 2) {
+ if (this.stopped === 2) {
return false;
}
}
@@ -1073,7 +1147,7 @@ Y.CustomEvent.prototype = {
Y.fire.apply(Y, a);
}
- if (this.broadcast == 2) {
+ if (this.broadcast === 2) {
Y.Global.fire.apply(Y.Global, a);
}
}
@@ -1112,12 +1186,15 @@ Y.CustomEvent.prototype = {
var when = s._when;
if (!subs) {
- subs = (when === AFTER) ? this._afters : this._subscribers;
- i = YArray.indexOf(subs, s, 0);
+ subs = (when === AFTER) ? this._afters : this._subscribers;
}
- if (s && subs[i] === s) {
- subs.splice(i, 1);
+ if (subs) {
+ i = YArray.indexOf(subs, s, 0);
+
+ if (s && subs[i] === s) {
+ subs.splice(i, 1);
+ }
}
if (this._kds) {
@@ -1171,7 +1248,7 @@ Y.Subscriber = function(fn, context, args, when) {
* @property id
* @type String
*/
- this.id = Y.stamp(this);
+ this.id = Y.guid();
/**
* Additional arguments to propagate to the subscriber
@@ -1275,12 +1352,12 @@ Y.Subscriber.prototype = {
*/
contains: function(fn, context) {
if (context) {
- return ((this.fn == fn) && this.context == context);
+ return ((this.fn === fn) && this.context === context);
} else {
- return (this.fn == fn);
+ return (this.fn === fn);
}
},
-
+
valueOf : function() {
return this.id;
}
@@ -1398,14 +1475,14 @@ var L = Y.Lang,
* @method _getType
* @private
*/
- _getType = Y.cached(function(type, pre) {
+ _getType = function(type, pre) {
- if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) {
+ if (!pre || !type || type.indexOf(PREFIX_DELIMITER) > -1) {
return type;
}
return pre + PREFIX_DELIMITER + type;
- }),
+ },
/**
* Returns an array with the detach key (if provided),
@@ -1434,7 +1511,7 @@ var L = Y.Lang,
if (i > -1) {
detachcategory = t.substr(0, (i));
t = t.substr(i+1);
- if (t == '*') {
+ if (t === '*') {
t = null;
}
}
@@ -1445,39 +1522,38 @@ var L = Y.Lang,
ET = function(opts) {
+ var etState = this._yuievt,
+ etConfig;
- var o = (L.isObject(opts)) ? opts : {};
+ if (!etState) {
+ etState = this._yuievt = {
+ events: {}, // PERF: Not much point instantiating lazily. We're bound to have events
+ targets: null, // PERF: Instantiate lazily, if user actually adds target,
+ config: {
+ host: this,
+ context: this
+ },
+ chain: Y.config.chain
+ };
+ }
- this._yuievt = this._yuievt || {
+ etConfig = etState.config;
- id: Y.guid(),
+ if (opts) {
+ mixConfigs(etConfig, opts, true);
- events: {},
-
- targets: {},
-
- config: o,
-
- chain: ('chain' in o) ? o.chain : Y.config.chain,
-
- bubbling: false,
-
- defaults: {
- context: o.context || this,
- host: this,
- emitFacade: o.emitFacade,
- fireOnce: o.fireOnce,
- queuable: o.queuable,
- monitored: o.monitored,
- broadcast: o.broadcast,
- defaultTargetOnly: o.defaultTargetOnly,
- bubbles: ('bubbles' in o) ? o.bubbles : true
+ if (opts.chain !== undefined) {
+ etState.chain = opts.chain;
}
- };
+
+ if (opts.prefix) {
+ etConfig.prefix = opts.prefix;
+ }
+ }
};
-
ET.prototype = {
+
constructor: ET,
/**
@@ -1673,6 +1749,11 @@ ET.prototype = {
if (!handle) {
ce = yuievt.events[type] || this.publish(type);
handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);
+
+ // TODO: More robust regex, accounting for category
+ if (type.indexOf("*:") !== -1) {
+ this._hasSiblings = true;
+ }
}
if (detachcategory) {
@@ -1711,8 +1792,11 @@ ET.prototype = {
* @return {EventTarget} the host
*/
detach: function(type, fn, context) {
- var evts = this._yuievt.events, i,
- Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));
+
+ var evts = this._yuievt.events,
+ i,
+ Node = Y.Node,
+ isNode = Node && (Y.instanceOf(this, Node));
// detachAll disabled on the Y instance.
if (!type && (this !== Y)) {
@@ -1903,53 +1987,102 @@ ET.prototype = {
*
*/
publish: function(type, opts) {
- var events, ce, ret, defaults,
- edata = this._yuievt,
- pre = edata.config.prefix;
- if (L.isObject(type)) {
+ var ret,
+ etState = this._yuievt,
+ etConfig = etState.config,
+ pre = etConfig.prefix;
+
+ if (typeof type === "string") {
+ if (pre) {
+ type = _getType(type, pre);
+ }
+ ret = this._publish(type, etConfig, opts);
+ } else {
ret = {};
+
Y.each(type, function(v, k) {
- ret[k] = this.publish(k, v || opts);
+ if (pre) {
+ k = _getType(k, pre);
+ }
+ ret[k] = this._publish(k, etConfig, v || opts);
}, this);
- return ret;
}
- type = (pre) ? _getType(type, pre) : type;
+ return ret;
+ },
- events = edata.events;
- ce = events[type];
+ /**
+ * Returns the fully qualified type, given a short type string.
+ * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix.
+ *
+ * NOTE: This method, unlike _getType, does no checking of the value passed in, and
+ * is designed to be used with the low level _publish() method, for critical path
+ * implementations which need to fast-track publish for performance reasons.
+ *
+ * @method _getFullType
+ * @private
+ * @param {String} type The short type to prefix
+ * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in
+ */
+ _getFullType : function(type) {
- this._monitor('publish', type, {
- args: arguments
- });
+ var pre = this._yuievt.config.prefix;
- if (ce) {
- // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event');
- if (opts) {
- ce.applyConfig(opts, true);
- }
+ if (pre) {
+ return pre + PREFIX_DELIMITER + type;
} else {
- // TODO: Lazy publish goes here.
- defaults = edata.defaults;
+ return type;
+ }
+ },
- // apply defaults
- ce = new Y.CustomEvent(type, defaults);
- if (opts) {
- ce.applyConfig(opts, true);
- }
+ /**
+ * The low level event publish implementation. It expects all the massaging to have been done
+ * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast
+ * path publish, which can be used by critical code paths to improve performance.
+ *
+ * @method _publish
+ * @private
+ * @param {String} fullType The prefixed type of the event to publish.
+ * @param {Object} etOpts The EventTarget specific configuration to mix into the published event.
+ * @param {Object} ceOpts The publish specific configuration to mix into the published event.
+ * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will
+ * be the default `CustomEvent` instance, and can be configured independently.
+ */
+ _publish : function(fullType, etOpts, ceOpts) {
- events[type] = ce;
+ var ce,
+ etState = this._yuievt,
+ etConfig = etState.config,
+ host = etConfig.host,
+ context = etConfig.context,
+ events = etState.events;
+
+ ce = events[fullType];
+
+ // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight.
+ if ((etConfig.monitored && !ce) || (ce && ce.monitored)) {
+ this._monitor('publish', fullType, {
+ args: arguments
+ });
}
- // make sure we turn the broadcast flag off if this
- // event was published as a result of bubbling
- // if (opts instanceof Y.CustomEvent) {
- // events[type].broadcast = false;
- // }
+ if (!ce) {
+ // Publish event
+ ce = events[fullType] = new Y.CustomEvent(fullType, etOpts);
- return events[type];
+ if (!etOpts) {
+ ce.host = host;
+ ce.context = context;
+ }
+ }
+
+ if (ceOpts) {
+ mixConfigs(ce, ceOpts, true);
+ }
+
+ return ce;
},
/**
@@ -1989,23 +2122,23 @@ ET.prototype = {
}
},
- /**
+ /**
* Fire a custom event by name. The callback functions will be executed
* from the context specified when the event was created, and with the
* following parameters.
*
- * If the custom event object hasn't been created, then the event hasn't
- * been published and it has no subscribers. For performance sake, we
- * immediate exit in this case. This means the event won't bubble, so
- * if the intention is that a bubble target be notified, the event must
- * be published on this object first.
- *
* The first argument is the event type, and any additional arguments are
* passed to the listeners as parameters. If the first of these is an
* object literal, and the event is configured to emit an event facade,
* that object is mixed into the event facade and the facade is provided
* in place of the original object.
*
+ * If the custom event object hasn't been created, then the event hasn't
+ * been published and it has no subscribers. For performance sake, we
+ * immediate exit in this case. This means the event won't bubble, so
+ * if the intention is that a bubble target be notified, the event must
+ * be published on this object first.
+ *
* @method fire
* @param type {String|Object} The type of the event, or an object that contains
* a 'type' property.
@@ -2014,30 +2147,63 @@ ET.prototype = {
* configured to emit an event facade, the event facade will replace that
* parameter after the properties the object literal contains are copied to
* the event facade.
- * @return {EventTarget} the event host
+ * @return {Boolean} True if the whole lifecycle of the event went through,
+ * false if at any point the event propagation was halted.
*/
fire: function(type) {
- var typeIncluded = L.isString(type),
- t = (typeIncluded) ? type : (type && type.type),
+ var typeIncluded = (typeof type === "string"),
+ argCount = arguments.length,
+ t = type,
yuievt = this._yuievt,
- pre = yuievt.config.prefix,
- ce, ret,
+ etConfig = yuievt.config,
+ pre = etConfig.prefix,
+ ret,
+ ce,
ce2,
- args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;
+ args;
- t = (pre) ? _getType(t, pre) : t;
+ if (typeIncluded && argCount <= 3) {
- ce = this.getEvent(t, true);
- ce2 = this.getSibling(t, ce);
+ // PERF: Try to avoid slice/iteration for the common signatures
- if (ce2 && !ce) {
- ce = this.publish(t);
+ // Most common
+ if (argCount === 2) {
+ args = [arguments[1]]; // fire("foo", {})
+ } else if (argCount === 3) {
+ args = [arguments[1], arguments[2]]; // fire("foo", {}, opts)
+ } else {
+ args = []; // fire("foo")
+ }
+
+ } else {
+ args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0));
}
- this._monitor('fire', (ce || t), {
- args: args
- });
+ if (!typeIncluded) {
+ t = (type && type.type);
+ }
+
+ if (pre) {
+ t = _getType(t, pre);
+ }
+
+ ce = yuievt.events[t];
+
+ if (this._hasSiblings) {
+ ce2 = this.getSibling(t, ce);
+
+ if (ce2 && !ce) {
+ ce = this.publish(t);
+ }
+ }
+
+ // PERF: trying to avoid function call, since this is a critical path
+ if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
+ this._monitor('fire', (ce || t), {
+ args: args
+ });
+ }
// this event has not been published or subscribed to
if (!ce) {
@@ -2048,8 +2214,12 @@ ET.prototype = {
// otherwise there is nothing to be done
ret = true;
} else {
- ce.sibling = ce2;
- ret = ce.fire.apply(ce, args);
+
+ if (ce2) {
+ ce.sibling = ce2;
+ }
+
+ ret = ce._fire(args);
}
return (yuievt.chain) ? this : ret;
@@ -2057,17 +2227,15 @@ ET.prototype = {
getSibling: function(type, ce) {
var ce2;
+
// delegate to *:type events if there are subscribers
if (type.indexOf(PREFIX_DELIMITER) > -1) {
type = _wildType(type);
- // console.log(type);
ce2 = this.getEvent(type, true);
if (ce2) {
- // console.log("GOT ONE: " + type);
ce2.applyConfig(ce);
ce2.bubbles = false;
ce2.broadcast = 0;
- // ret = ce2.fire.apply(ce2, a);
}
}
@@ -2084,6 +2252,7 @@ ET.prototype = {
*/
getEvent: function(type, prefixed) {
var pre, e;
+
if (!prefixed) {
pre = this._yuievt.config.prefix;
type = (pre) ? _getType(type, pre) : type;
@@ -2182,7 +2351,9 @@ Y.Global = YUI.Env.globalEvents;
treating that method as an event
-For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.
+For custom event subscriptions, pass the custom event name as the first argument
+and callback as the second. The `this` object in the callback will be `Y` unless
+an override is passed as the third argument.
Y.on('io:complete', function () {
Y.MyApp.updateStatus('Transaction complete');
@@ -2208,7 +2379,7 @@ selector or other identifier.
`defaultFn` can prevent the default behavior with `e.preventDefault()` from the
event object passed as the first parameter to the subscription callback.
-To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
+To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
`Y.Do.before(...)`.
NOTE: The formal parameter list below is for events, not for function
@@ -2293,4 +2464,4 @@ for that signature.
**/
-}, '3.9.1', {"requires": ["oop"]});
+}, '3.12.0', {"requires": ["oop"]});
diff --git a/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex-debug.js b/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex-debug.js
new file mode 100755
index 00000000000..bf2cefd4e8b
--- /dev/null
+++ b/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex-debug.js
@@ -0,0 +1,674 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('event-custom-complex', function (Y, NAME) {
+
+
+/**
+ * Adds event facades, preventable default behavior, and bubbling.
+ * events.
+ * @module event-custom
+ * @submodule event-custom-complex
+ */
+
+var FACADE,
+ FACADE_KEYS,
+ YObject = Y.Object,
+ key,
+ EMPTY = {},
+ CEProto = Y.CustomEvent.prototype,
+ ETProto = Y.EventTarget.prototype,
+
+ mixFacadeProps = function(facade, payload) {
+ var p;
+
+ for (p in payload) {
+ if (!(FACADE_KEYS.hasOwnProperty(p))) {
+ facade[p] = payload[p];
+ }
+ }
+ };
+
+/**
+ * Wraps and protects a custom event for use when emitFacade is set to true.
+ * Requires the event-custom-complex module
+ * @class EventFacade
+ * @param e {Event} the custom event
+ * @param currentTarget {HTMLElement} the element the listener was attached to
+ */
+
+Y.EventFacade = function(e, currentTarget) {
+
+ if (!e) {
+ e = EMPTY;
+ }
+
+ this._event = e;
+
+ /**
+ * The arguments passed to fire
+ * @property details
+ * @type Array
+ */
+ this.details = e.details;
+
+ /**
+ * The event type, this can be overridden by the fire() payload
+ * @property type
+ * @type string
+ */
+ this.type = e.type;
+
+ /**
+ * The real event type
+ * @property _type
+ * @type string
+ * @private
+ */
+ this._type = e.type;
+
+ //////////////////////////////////////////////////////
+
+ /**
+ * Node reference for the targeted eventtarget
+ * @property target
+ * @type Node
+ */
+ this.target = e.target;
+
+ /**
+ * Node reference for the element that the listener was attached to.
+ * @property currentTarget
+ * @type Node
+ */
+ this.currentTarget = currentTarget;
+
+ /**
+ * Node reference to the relatedTarget
+ * @property relatedTarget
+ * @type Node
+ */
+ this.relatedTarget = e.relatedTarget;
+
+};
+
+Y.mix(Y.EventFacade.prototype, {
+
+ /**
+ * Stops the propagation to the next bubble target
+ * @method stopPropagation
+ */
+ stopPropagation: function() {
+ this._event.stopPropagation();
+ this.stopped = 1;
+ },
+
+ /**
+ * Stops the propagation to the next bubble target and
+ * prevents any additional listeners from being exectued
+ * on the current target.
+ * @method stopImmediatePropagation
+ */
+ stopImmediatePropagation: function() {
+ this._event.stopImmediatePropagation();
+ this.stopped = 2;
+ },
+
+ /**
+ * Prevents the event's default behavior
+ * @method preventDefault
+ */
+ preventDefault: function() {
+ this._event.preventDefault();
+ this.prevented = 1;
+ },
+
+ /**
+ * Stops the event propagation and prevents the default
+ * event behavior.
+ * @method halt
+ * @param immediate {boolean} if true additional listeners
+ * on the current target will not be executed
+ */
+ halt: function(immediate) {
+ this._event.halt(immediate);
+ this.prevented = 1;
+ this.stopped = (immediate) ? 2 : 1;
+ }
+
+});
+
+CEProto.fireComplex = function(args) {
+
+ var es,
+ ef,
+ q,
+ queue,
+ ce,
+ ret = true,
+ events,
+ subs,
+ ons,
+ afters,
+ afterQueue,
+ postponed,
+ prevented,
+ preventedFn,
+ defaultFn,
+ self = this,
+ host = self.host || self,
+ next,
+ oldbubble,
+ stack = self.stack,
+ yuievt = host._yuievt,
+ hasPotentialSubscribers;
+
+ if (stack) {
+
+ // queue this event if the current item in the queue bubbles
+ if (self.queuable && self.type !== stack.next.type) {
+ self.log('queue ' + self.type);
+
+ if (!stack.queue) {
+ stack.queue = [];
+ }
+ stack.queue.push([self, args]);
+
+ return true;
+ }
+ }
+
+ hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast;
+
+ self.target = self.target || host;
+ self.currentTarget = host;
+
+ self.details = args.concat();
+
+ if (hasPotentialSubscribers) {
+
+ es = stack || {
+
+ id: self.id, // id of the first event in the stack
+ next: self,
+ silent: self.silent,
+ stopped: 0,
+ prevented: 0,
+ bubbling: null,
+ type: self.type,
+ // defaultFnQueue: new Y.Queue(),
+ defaultTargetOnly: self.defaultTargetOnly
+
+ };
+
+ subs = self.getSubs();
+ ons = subs[0];
+ afters = subs[1];
+
+ self.stopped = (self.type !== es.type) ? 0 : es.stopped;
+ self.prevented = (self.type !== es.type) ? 0 : es.prevented;
+
+ if (self.stoppedFn) {
+ // PERF TODO: Can we replace with callback, like preventedFn. Look into history
+ events = new Y.EventTarget({
+ fireOnce: true,
+ context: host
+ });
+ self.events = events;
+ events.on('stopped', self.stoppedFn);
+ }
+
+ // self.log("Firing " + self + ", " + "args: " + args);
+ self.log("Firing " + self.type);
+
+ self._facade = null; // kill facade to eliminate stale properties
+
+ ef = self._createFacade(args);
+
+ if (ons) {
+ self._procSubs(ons, args, ef);
+ }
+
+ // bubble if this is hosted in an event target and propagation has not been stopped
+ if (self.bubbles && host.bubble && !self.stopped) {
+ oldbubble = es.bubbling;
+
+ es.bubbling = self.type;
+
+ if (es.type !== self.type) {
+ es.stopped = 0;
+ es.prevented = 0;
+ }
+
+ ret = host.bubble(self, args, null, es);
+
+ self.stopped = Math.max(self.stopped, es.stopped);
+ self.prevented = Math.max(self.prevented, es.prevented);
+
+ es.bubbling = oldbubble;
+ }
+
+ prevented = self.prevented;
+
+ if (prevented) {
+ preventedFn = self.preventedFn;
+ if (preventedFn) {
+ preventedFn.apply(host, args);
+ }
+ } else {
+ defaultFn = self.defaultFn;
+
+ if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) {
+ defaultFn.apply(host, args);
+ }
+ }
+
+ // broadcast listeners are fired as discreet events on the
+ // YUI instance and potentially the YUI global.
+ if (self.broadcast) {
+ self._broadcast(args);
+ }
+
+ if (afters && !self.prevented && self.stopped < 2) {
+
+ // Queue the after
+ afterQueue = es.afterQueue;
+
+ if (es.id === self.id || self.type !== yuievt.bubbling) {
+
+ self._procSubs(afters, args, ef);
+
+ if (afterQueue) {
+ while ((next = afterQueue.last())) {
+ next();
+ }
+ }
+ } else {
+ postponed = afters;
+
+ if (es.execDefaultCnt) {
+ postponed = Y.merge(postponed);
+
+ Y.each(postponed, function(s) {
+ s.postponed = true;
+ });
+ }
+
+ if (!afterQueue) {
+ es.afterQueue = new Y.Queue();
+ }
+
+ es.afterQueue.add(function() {
+ self._procSubs(postponed, args, ef);
+ });
+ }
+
+ }
+
+ self.target = null;
+
+ if (es.id === self.id) {
+
+ queue = es.queue;
+
+ if (queue) {
+ while (queue.length) {
+ q = queue.pop();
+ ce = q[0];
+ // set up stack to allow the next item to be processed
+ es.next = ce;
+ ce._fire(q[1]);
+ }
+ }
+
+ self.stack = null;
+ }
+
+ ret = !(self.stopped);
+
+ if (self.type !== yuievt.bubbling) {
+ es.stopped = 0;
+ es.prevented = 0;
+ self.stopped = 0;
+ self.prevented = 0;
+ }
+
+ } else {
+ defaultFn = self.defaultFn;
+
+ if(defaultFn) {
+ ef = self._createFacade(args);
+
+ if ((!self.defaultTargetOnly) || (host === ef.target)) {
+ defaultFn.apply(host, args);
+ }
+ }
+ }
+
+ // Kill the cached facade to free up memory.
+ // Otherwise we have the facade from the last fire, sitting around forever.
+ self._facade = null;
+
+ return ret;
+};
+
+/**
+ * @method _hasPotentialSubscribers
+ * @for CustomEvent
+ * @private
+ * @return {boolean} Whether the event has potential subscribers or not
+ */
+CEProto._hasPotentialSubscribers = function() {
+ return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast;
+};
+
+/**
+ * Internal utility method to create a new facade instance and
+ * insert it into the fire argument list, accounting for any payload
+ * merging which needs to happen.
+ *
+ * This used to be called `_getFacade`, but the name seemed inappropriate
+ * when it was used without a need for the return value.
+ *
+ * @method _createFacade
+ * @private
+ * @param fireArgs {Array} The arguments passed to "fire", which need to be
+ * shifted (and potentially merged) when the facade is added.
+ * @return {EventFacade} The event facade created.
+ */
+
+// TODO: Remove (private) _getFacade alias, once synthetic.js is updated.
+CEProto._createFacade = CEProto._getFacade = function(fireArgs) {
+
+ var userArgs = this.details,
+ firstArg = userArgs && userArgs[0],
+ firstArgIsObj = (firstArg && (typeof firstArg === "object")),
+ ef = this._facade;
+
+ if (!ef) {
+ ef = new Y.EventFacade(this, this.currentTarget);
+ }
+
+ if (firstArgIsObj) {
+ // protect the event facade properties
+ mixFacadeProps(ef, firstArg);
+
+ // Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376
+ if (firstArg.type) {
+ ef.type = firstArg.type;
+ }
+
+ if (fireArgs) {
+ fireArgs[0] = ef;
+ }
+ } else {
+ if (fireArgs) {
+ fireArgs.unshift(ef);
+ }
+ }
+
+ // update the details field with the arguments
+ ef.details = this.details;
+
+ // use the original target when the event bubbled to this target
+ ef.target = this.originalTarget || this.target;
+
+ ef.currentTarget = this.currentTarget;
+ ef.stopped = 0;
+ ef.prevented = 0;
+
+ this._facade = ef;
+
+ return this._facade;
+};
+
+/**
+ * Utility method to manipulate the args array passed in, to add the event facade,
+ * if it's not already the first arg.
+ *
+ * @method _addFacadeToArgs
+ * @private
+ * @param {Array} The arguments to manipulate
+ */
+CEProto._addFacadeToArgs = function(args) {
+ var e = args[0];
+
+ // Trying not to use instanceof, just to avoid potential cross Y edge case issues.
+ if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) {
+ this._createFacade(args);
+ }
+};
+
+/**
+ * Stop propagation to bubble targets
+ * @for CustomEvent
+ * @method stopPropagation
+ */
+CEProto.stopPropagation = function() {
+ this.stopped = 1;
+ if (this.stack) {
+ this.stack.stopped = 1;
+ }
+ if (this.events) {
+ this.events.fire('stopped', this);
+ }
+};
+
+/**
+ * Stops propagation to bubble targets, and prevents any remaining
+ * subscribers on the current target from executing.
+ * @method stopImmediatePropagation
+ */
+CEProto.stopImmediatePropagation = function() {
+ this.stopped = 2;
+ if (this.stack) {
+ this.stack.stopped = 2;
+ }
+ if (this.events) {
+ this.events.fire('stopped', this);
+ }
+};
+
+/**
+ * Prevents the execution of this event's defaultFn
+ * @method preventDefault
+ */
+CEProto.preventDefault = function() {
+ if (this.preventable) {
+ this.prevented = 1;
+ if (this.stack) {
+ this.stack.prevented = 1;
+ }
+ }
+};
+
+/**
+ * Stops the event propagation and prevents the default
+ * event behavior.
+ * @method halt
+ * @param immediate {boolean} if true additional listeners
+ * on the current target will not be executed
+ */
+CEProto.halt = function(immediate) {
+ if (immediate) {
+ this.stopImmediatePropagation();
+ } else {
+ this.stopPropagation();
+ }
+ this.preventDefault();
+};
+
+/**
+ * Registers another EventTarget as a bubble target. Bubble order
+ * is determined by the order registered. Multiple targets can
+ * be specified.
+ *
+ * Events can only bubble if emitFacade is true.
+ *
+ * Included in the event-custom-complex submodule.
+ *
+ * @method addTarget
+ * @param o {EventTarget} the target to add
+ * @for EventTarget
+ */
+ETProto.addTarget = function(o) {
+ var etState = this._yuievt;
+
+ if (!etState.targets) {
+ etState.targets = {};
+ }
+
+ etState.targets[Y.stamp(o)] = o;
+ etState.hasTargets = true;
+};
+
+/**
+ * Returns an array of bubble targets for this object.
+ * @method getTargets
+ * @return EventTarget[]
+ */
+ETProto.getTargets = function() {
+ var targets = this._yuievt.targets;
+ return targets ? YObject.values(targets) : [];
+};
+
+/**
+ * Removes a bubble target
+ * @method removeTarget
+ * @param o {EventTarget} the target to remove
+ * @for EventTarget
+ */
+ETProto.removeTarget = function(o) {
+ var targets = this._yuievt.targets;
+
+ if (targets) {
+ delete targets[Y.stamp(o, true)];
+
+ if (YObject.size(targets) === 0) {
+ this._yuievt.hasTargets = false;
+ }
+ }
+};
+
+/**
+ * Propagate an event. Requires the event-custom-complex module.
+ * @method bubble
+ * @param evt {CustomEvent} the custom event to propagate
+ * @return {boolean} the aggregated return value from Event.Custom.fire
+ * @for EventTarget
+ */
+ETProto.bubble = function(evt, args, target, es) {
+
+ var targs = this._yuievt.targets,
+ ret = true,
+ t,
+ ce,
+ i,
+ bc,
+ ce2,
+ type = evt && evt.type,
+ originalTarget = target || (evt && evt.target) || this,
+ oldbubble;
+
+ if (!evt || ((!evt.stopped) && targs)) {
+
+ for (i in targs) {
+ if (targs.hasOwnProperty(i)) {
+
+ t = targs[i];
+
+ ce = t._yuievt.events[type];
+
+ if (t._hasSiblings) {
+ ce2 = t.getSibling(type, ce);
+ }
+
+ if (ce2 && !ce) {
+ ce = t.publish(type);
+ }
+
+ oldbubble = t._yuievt.bubbling;
+ t._yuievt.bubbling = type;
+
+ // if this event was not published on the bubble target,
+ // continue propagating the event.
+ if (!ce) {
+ if (t._yuievt.hasTargets) {
+ t.bubble(evt, args, originalTarget, es);
+ }
+ } else {
+
+ if (ce2) {
+ ce.sibling = ce2;
+ }
+
+ // set the original target to that the target payload on the facade is correct.
+ ce.target = originalTarget;
+ ce.originalTarget = originalTarget;
+ ce.currentTarget = t;
+ bc = ce.broadcast;
+ ce.broadcast = false;
+
+ // default publish may not have emitFacade true -- that
+ // shouldn't be what the implementer meant to do
+ ce.emitFacade = true;
+
+ ce.stack = es;
+
+ // TODO: See what's getting in the way of changing this to use
+ // the more performant ce._fire(args || evt.details || []).
+
+ // Something in Widget Parent/Child tests is not happy if we
+ // change it - maybe evt.details related?
+ ret = ret && ce.fire.apply(ce, args || evt.details || []);
+
+ ce.broadcast = bc;
+ ce.originalTarget = null;
+
+ // stopPropagation() was called
+ if (ce.stopped) {
+ break;
+ }
+ }
+
+ t._yuievt.bubbling = oldbubble;
+ }
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * @method _hasPotentialSubscribers
+ * @for EventTarget
+ * @private
+ * @param {String} fullType The fully prefixed type name
+ * @return {boolean} Whether the event has potential subscribers or not
+ */
+ETProto._hasPotentialSubscribers = function(fullType) {
+
+ var etState = this._yuievt,
+ e = etState.events[fullType];
+
+ if (e) {
+ return e.hasSubs() || etState.hasTargets || e.broadcast;
+ } else {
+ return false;
+ }
+};
+
+FACADE = new Y.EventFacade();
+FACADE_KEYS = {};
+
+// Flatten whitelist
+for (key in FACADE) {
+ FACADE_KEYS[key] = true;
+}
+
+
+}, '3.12.0', {"requires": ["event-custom-base"]});
diff --git a/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex-min.js b/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex-min.js
new file mode 100755
index 00000000000..8e5d6ad166c
--- /dev/null
+++ b/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex-min.js
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-custom-complex",function(e,t){var n,r,i=e.Object,s,o={},u=e.CustomEvent.prototype,a=e.EventTarget.prototype,f=function(e,t){var n;for(n in t)r.hasOwnProperty(n)||(e[n]=t[n])};e.EventFacade=function(e,t){e||(e=o),this._event=e,this.details=e.details,this.type=e.type,this._type=e.type,this.target=e.target,this.currentTarget=t,this.relatedTarget=e.relatedTarget},e.mix(e.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(e){this._event.halt(e),this.prevented=1,this.stopped=e?2:1}}),u.fireComplex=function(t){var n,r,i,s,o,u=!0,a,f,l,c,h,p,d,v,m,g=this,y=g.host||g,b,w,E=g.stack,S=y._yuievt,x;if(E&&g.queuable&&g.type!==E.next.type)return E.queue||(E.queue=[]),E.queue.push([g,t]),!0;x=g.hasSubs()||S.hasTargets||g.broadcast,g.target=g.target||y,g.currentTarget=y,g.details=t.concat();if(x){n=E||{id:g.id,next:g,silent:g.silent,stopped:0,prevented:0,bubbling:null,type:g.type,defaultTargetOnly:g.defaultTargetOnly},f=g.getSubs(),l=f[0],c=f[1],g.stopped=g.type!==n.type?0:n.stopped,g.prevented=g.type!==n.type?0:n.prevented,g.stoppedFn&&(a=new e.EventTarget({fireOnce:!0,context:y}),g.events=a,a.on("stopped",g.stoppedFn)),g._facade=null,r=g._createFacade(t),l&&g._procSubs(l,t,r),g.bubbles&&y.bubble&&!g.stopped&&(w=n.bubbling,n.bubbling=g.type,n.type!==g.type&&(n.stopped=0,n.prevented=0),u=y.bubble(g,t,null,n),g.stopped=Math.max(g.stopped,n.stopped),g.prevented=Math.max(g.prevented,n.prevented),n.bubbling=w),d=g.prevented,d?(v=g.preventedFn,v&&v.apply(y,t)):(m=g.defaultFn,m&&(!g.defaultTargetOnly&&!n.defaultTargetOnly||y===r.target)&&m.apply(y,t)),g.broadcast&&g._broadcast(t);if(c&&!g.prevented&&g.stopped<2){h=n.afterQueue;if(n.id===g.id||g.type!==S.bubbling){g._procSubs(c,t,r);if(h)while(b=h.last())b()}else p=c,n.execDefaultCnt&&(p=e.merge(p),e.each(p,function(e){e.postponed=!0})),h||(n.afterQueue=new e.Queue),n.afterQueue.add(function(){g._procSubs(p,t,r)})}g.target=null;if(n.id===g.id){s=n.queue;if(s)while(s.length)i=s.pop(),o=i[0],n.next=o,o._fire(i[1]);g.stack=null}u=!g.stopped,g.type!==S.bubbling&&(n.stopped=0,n.prevented=0,g.stopped=0,g.prevented=0)}else m=g.defaultFn,m&&(r=g._createFacade(t),(!g.defaultTargetOnly||y===r.target)&&m.apply(y,t));return g._facade=null,u},u._hasPotentialSubscribers=function(){return this.hasSubs()||this.host._yuievt.hasTargets||this.broadcast},u._createFacade=u._getFacade=function(t){var n=this.details,r=n&&n[0],i=r&&typeof r=="object",s=this._facade;return s||(s=new e.EventFacade(this,this.currentTarget)),i?(f(s,r),r.type&&(s.type=r.type),t&&(t[0]=s)):t&&t.unshift(s),s.details=this.details,s.target=this.originalTarget||this.target,s.currentTarget=this.currentTarget,s.stopped=0,s.prevented=0,this._facade=s,this._facade},u._addFacadeToArgs=function(e){var t=e[0];t&&t.halt&&t.stopImmediatePropagation&&t.stopPropagation&&t._event||this._createFacade(e)},u.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},u.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},u.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},u.halt=function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},a.addTarget=function(t){var n=this._yuievt;n.targets||(n.targets={}),n.targets[e.stamp(t)]=t,n.hasTargets=!0},a.getTargets=function(){var e=this._yuievt.targets;return e?i.values(e):[]},a.removeTarget=function(t){var n=this._yuievt.targets;n&&(delete n[e.stamp(t,!0)],i.size(n)===0&&(this._yuievt.hasTargets=!1))},a.bubble=function(e,t,n,r){var i=this._yuievt.targets,s=!0,o,u,a,f,l,c=e&&e.type,h=n||e&&e.target||this,p;if(!e||!e.stopped&&i)for(a in i)if(i.hasOwnProperty(a)){o=i[a],u=o._yuievt.events[c],o._hasSiblings&&(l=o.getSibling(c,u)),l&&!u&&(u=o.publish(c)),p=o._yuievt.bubbling,o._yuievt.bubbling=c;if(!u)o._yuievt.hasTargets&&o.bubble(e,t,h,r);else{l&&(u.sibling=l),u.target=h,u.originalTarget=h,u.currentTarget=o,f=u.broadcast,u.broadcast=!1,u.emitFacade=!0,u.stack=r,s=s&&u.fire.apply(u,t||e.details||[]),u.broadcast=f,u.originalTarget=null;if(u.stopped)break}o._yuievt.bubbling=p}return s},a._hasPotentialSubscribers=function(e){var t=this._yuievt,n=t.events[e];return n?n.hasSubs()||t.hasTargets||n.broadcast:!1},n=new e.EventFacade,r={};for(s in n)r[s]=!0},"3.12.0",{requires:["event-custom-base"]});
diff --git a/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex.js b/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex.js
new file mode 100755
index 00000000000..783c3b1db6e
--- /dev/null
+++ b/lib/yuilib/3.12.0/event-custom-complex/event-custom-complex.js
@@ -0,0 +1,671 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('event-custom-complex', function (Y, NAME) {
+
+
+/**
+ * Adds event facades, preventable default behavior, and bubbling.
+ * events.
+ * @module event-custom
+ * @submodule event-custom-complex
+ */
+
+var FACADE,
+ FACADE_KEYS,
+ YObject = Y.Object,
+ key,
+ EMPTY = {},
+ CEProto = Y.CustomEvent.prototype,
+ ETProto = Y.EventTarget.prototype,
+
+ mixFacadeProps = function(facade, payload) {
+ var p;
+
+ for (p in payload) {
+ if (!(FACADE_KEYS.hasOwnProperty(p))) {
+ facade[p] = payload[p];
+ }
+ }
+ };
+
+/**
+ * Wraps and protects a custom event for use when emitFacade is set to true.
+ * Requires the event-custom-complex module
+ * @class EventFacade
+ * @param e {Event} the custom event
+ * @param currentTarget {HTMLElement} the element the listener was attached to
+ */
+
+Y.EventFacade = function(e, currentTarget) {
+
+ if (!e) {
+ e = EMPTY;
+ }
+
+ this._event = e;
+
+ /**
+ * The arguments passed to fire
+ * @property details
+ * @type Array
+ */
+ this.details = e.details;
+
+ /**
+ * The event type, this can be overridden by the fire() payload
+ * @property type
+ * @type string
+ */
+ this.type = e.type;
+
+ /**
+ * The real event type
+ * @property _type
+ * @type string
+ * @private
+ */
+ this._type = e.type;
+
+ //////////////////////////////////////////////////////
+
+ /**
+ * Node reference for the targeted eventtarget
+ * @property target
+ * @type Node
+ */
+ this.target = e.target;
+
+ /**
+ * Node reference for the element that the listener was attached to.
+ * @property currentTarget
+ * @type Node
+ */
+ this.currentTarget = currentTarget;
+
+ /**
+ * Node reference to the relatedTarget
+ * @property relatedTarget
+ * @type Node
+ */
+ this.relatedTarget = e.relatedTarget;
+
+};
+
+Y.mix(Y.EventFacade.prototype, {
+
+ /**
+ * Stops the propagation to the next bubble target
+ * @method stopPropagation
+ */
+ stopPropagation: function() {
+ this._event.stopPropagation();
+ this.stopped = 1;
+ },
+
+ /**
+ * Stops the propagation to the next bubble target and
+ * prevents any additional listeners from being exectued
+ * on the current target.
+ * @method stopImmediatePropagation
+ */
+ stopImmediatePropagation: function() {
+ this._event.stopImmediatePropagation();
+ this.stopped = 2;
+ },
+
+ /**
+ * Prevents the event's default behavior
+ * @method preventDefault
+ */
+ preventDefault: function() {
+ this._event.preventDefault();
+ this.prevented = 1;
+ },
+
+ /**
+ * Stops the event propagation and prevents the default
+ * event behavior.
+ * @method halt
+ * @param immediate {boolean} if true additional listeners
+ * on the current target will not be executed
+ */
+ halt: function(immediate) {
+ this._event.halt(immediate);
+ this.prevented = 1;
+ this.stopped = (immediate) ? 2 : 1;
+ }
+
+});
+
+CEProto.fireComplex = function(args) {
+
+ var es,
+ ef,
+ q,
+ queue,
+ ce,
+ ret = true,
+ events,
+ subs,
+ ons,
+ afters,
+ afterQueue,
+ postponed,
+ prevented,
+ preventedFn,
+ defaultFn,
+ self = this,
+ host = self.host || self,
+ next,
+ oldbubble,
+ stack = self.stack,
+ yuievt = host._yuievt,
+ hasPotentialSubscribers;
+
+ if (stack) {
+
+ // queue this event if the current item in the queue bubbles
+ if (self.queuable && self.type !== stack.next.type) {
+
+ if (!stack.queue) {
+ stack.queue = [];
+ }
+ stack.queue.push([self, args]);
+
+ return true;
+ }
+ }
+
+ hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast;
+
+ self.target = self.target || host;
+ self.currentTarget = host;
+
+ self.details = args.concat();
+
+ if (hasPotentialSubscribers) {
+
+ es = stack || {
+
+ id: self.id, // id of the first event in the stack
+ next: self,
+ silent: self.silent,
+ stopped: 0,
+ prevented: 0,
+ bubbling: null,
+ type: self.type,
+ // defaultFnQueue: new Y.Queue(),
+ defaultTargetOnly: self.defaultTargetOnly
+
+ };
+
+ subs = self.getSubs();
+ ons = subs[0];
+ afters = subs[1];
+
+ self.stopped = (self.type !== es.type) ? 0 : es.stopped;
+ self.prevented = (self.type !== es.type) ? 0 : es.prevented;
+
+ if (self.stoppedFn) {
+ // PERF TODO: Can we replace with callback, like preventedFn. Look into history
+ events = new Y.EventTarget({
+ fireOnce: true,
+ context: host
+ });
+ self.events = events;
+ events.on('stopped', self.stoppedFn);
+ }
+
+
+ self._facade = null; // kill facade to eliminate stale properties
+
+ ef = self._createFacade(args);
+
+ if (ons) {
+ self._procSubs(ons, args, ef);
+ }
+
+ // bubble if this is hosted in an event target and propagation has not been stopped
+ if (self.bubbles && host.bubble && !self.stopped) {
+ oldbubble = es.bubbling;
+
+ es.bubbling = self.type;
+
+ if (es.type !== self.type) {
+ es.stopped = 0;
+ es.prevented = 0;
+ }
+
+ ret = host.bubble(self, args, null, es);
+
+ self.stopped = Math.max(self.stopped, es.stopped);
+ self.prevented = Math.max(self.prevented, es.prevented);
+
+ es.bubbling = oldbubble;
+ }
+
+ prevented = self.prevented;
+
+ if (prevented) {
+ preventedFn = self.preventedFn;
+ if (preventedFn) {
+ preventedFn.apply(host, args);
+ }
+ } else {
+ defaultFn = self.defaultFn;
+
+ if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) {
+ defaultFn.apply(host, args);
+ }
+ }
+
+ // broadcast listeners are fired as discreet events on the
+ // YUI instance and potentially the YUI global.
+ if (self.broadcast) {
+ self._broadcast(args);
+ }
+
+ if (afters && !self.prevented && self.stopped < 2) {
+
+ // Queue the after
+ afterQueue = es.afterQueue;
+
+ if (es.id === self.id || self.type !== yuievt.bubbling) {
+
+ self._procSubs(afters, args, ef);
+
+ if (afterQueue) {
+ while ((next = afterQueue.last())) {
+ next();
+ }
+ }
+ } else {
+ postponed = afters;
+
+ if (es.execDefaultCnt) {
+ postponed = Y.merge(postponed);
+
+ Y.each(postponed, function(s) {
+ s.postponed = true;
+ });
+ }
+
+ if (!afterQueue) {
+ es.afterQueue = new Y.Queue();
+ }
+
+ es.afterQueue.add(function() {
+ self._procSubs(postponed, args, ef);
+ });
+ }
+
+ }
+
+ self.target = null;
+
+ if (es.id === self.id) {
+
+ queue = es.queue;
+
+ if (queue) {
+ while (queue.length) {
+ q = queue.pop();
+ ce = q[0];
+ // set up stack to allow the next item to be processed
+ es.next = ce;
+ ce._fire(q[1]);
+ }
+ }
+
+ self.stack = null;
+ }
+
+ ret = !(self.stopped);
+
+ if (self.type !== yuievt.bubbling) {
+ es.stopped = 0;
+ es.prevented = 0;
+ self.stopped = 0;
+ self.prevented = 0;
+ }
+
+ } else {
+ defaultFn = self.defaultFn;
+
+ if(defaultFn) {
+ ef = self._createFacade(args);
+
+ if ((!self.defaultTargetOnly) || (host === ef.target)) {
+ defaultFn.apply(host, args);
+ }
+ }
+ }
+
+ // Kill the cached facade to free up memory.
+ // Otherwise we have the facade from the last fire, sitting around forever.
+ self._facade = null;
+
+ return ret;
+};
+
+/**
+ * @method _hasPotentialSubscribers
+ * @for CustomEvent
+ * @private
+ * @return {boolean} Whether the event has potential subscribers or not
+ */
+CEProto._hasPotentialSubscribers = function() {
+ return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast;
+};
+
+/**
+ * Internal utility method to create a new facade instance and
+ * insert it into the fire argument list, accounting for any payload
+ * merging which needs to happen.
+ *
+ * This used to be called `_getFacade`, but the name seemed inappropriate
+ * when it was used without a need for the return value.
+ *
+ * @method _createFacade
+ * @private
+ * @param fireArgs {Array} The arguments passed to "fire", which need to be
+ * shifted (and potentially merged) when the facade is added.
+ * @return {EventFacade} The event facade created.
+ */
+
+// TODO: Remove (private) _getFacade alias, once synthetic.js is updated.
+CEProto._createFacade = CEProto._getFacade = function(fireArgs) {
+
+ var userArgs = this.details,
+ firstArg = userArgs && userArgs[0],
+ firstArgIsObj = (firstArg && (typeof firstArg === "object")),
+ ef = this._facade;
+
+ if (!ef) {
+ ef = new Y.EventFacade(this, this.currentTarget);
+ }
+
+ if (firstArgIsObj) {
+ // protect the event facade properties
+ mixFacadeProps(ef, firstArg);
+
+ // Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376
+ if (firstArg.type) {
+ ef.type = firstArg.type;
+ }
+
+ if (fireArgs) {
+ fireArgs[0] = ef;
+ }
+ } else {
+ if (fireArgs) {
+ fireArgs.unshift(ef);
+ }
+ }
+
+ // update the details field with the arguments
+ ef.details = this.details;
+
+ // use the original target when the event bubbled to this target
+ ef.target = this.originalTarget || this.target;
+
+ ef.currentTarget = this.currentTarget;
+ ef.stopped = 0;
+ ef.prevented = 0;
+
+ this._facade = ef;
+
+ return this._facade;
+};
+
+/**
+ * Utility method to manipulate the args array passed in, to add the event facade,
+ * if it's not already the first arg.
+ *
+ * @method _addFacadeToArgs
+ * @private
+ * @param {Array} The arguments to manipulate
+ */
+CEProto._addFacadeToArgs = function(args) {
+ var e = args[0];
+
+ // Trying not to use instanceof, just to avoid potential cross Y edge case issues.
+ if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) {
+ this._createFacade(args);
+ }
+};
+
+/**
+ * Stop propagation to bubble targets
+ * @for CustomEvent
+ * @method stopPropagation
+ */
+CEProto.stopPropagation = function() {
+ this.stopped = 1;
+ if (this.stack) {
+ this.stack.stopped = 1;
+ }
+ if (this.events) {
+ this.events.fire('stopped', this);
+ }
+};
+
+/**
+ * Stops propagation to bubble targets, and prevents any remaining
+ * subscribers on the current target from executing.
+ * @method stopImmediatePropagation
+ */
+CEProto.stopImmediatePropagation = function() {
+ this.stopped = 2;
+ if (this.stack) {
+ this.stack.stopped = 2;
+ }
+ if (this.events) {
+ this.events.fire('stopped', this);
+ }
+};
+
+/**
+ * Prevents the execution of this event's defaultFn
+ * @method preventDefault
+ */
+CEProto.preventDefault = function() {
+ if (this.preventable) {
+ this.prevented = 1;
+ if (this.stack) {
+ this.stack.prevented = 1;
+ }
+ }
+};
+
+/**
+ * Stops the event propagation and prevents the default
+ * event behavior.
+ * @method halt
+ * @param immediate {boolean} if true additional listeners
+ * on the current target will not be executed
+ */
+CEProto.halt = function(immediate) {
+ if (immediate) {
+ this.stopImmediatePropagation();
+ } else {
+ this.stopPropagation();
+ }
+ this.preventDefault();
+};
+
+/**
+ * Registers another EventTarget as a bubble target. Bubble order
+ * is determined by the order registered. Multiple targets can
+ * be specified.
+ *
+ * Events can only bubble if emitFacade is true.
+ *
+ * Included in the event-custom-complex submodule.
+ *
+ * @method addTarget
+ * @param o {EventTarget} the target to add
+ * @for EventTarget
+ */
+ETProto.addTarget = function(o) {
+ var etState = this._yuievt;
+
+ if (!etState.targets) {
+ etState.targets = {};
+ }
+
+ etState.targets[Y.stamp(o)] = o;
+ etState.hasTargets = true;
+};
+
+/**
+ * Returns an array of bubble targets for this object.
+ * @method getTargets
+ * @return EventTarget[]
+ */
+ETProto.getTargets = function() {
+ var targets = this._yuievt.targets;
+ return targets ? YObject.values(targets) : [];
+};
+
+/**
+ * Removes a bubble target
+ * @method removeTarget
+ * @param o {EventTarget} the target to remove
+ * @for EventTarget
+ */
+ETProto.removeTarget = function(o) {
+ var targets = this._yuievt.targets;
+
+ if (targets) {
+ delete targets[Y.stamp(o, true)];
+
+ if (YObject.size(targets) === 0) {
+ this._yuievt.hasTargets = false;
+ }
+ }
+};
+
+/**
+ * Propagate an event. Requires the event-custom-complex module.
+ * @method bubble
+ * @param evt {CustomEvent} the custom event to propagate
+ * @return {boolean} the aggregated return value from Event.Custom.fire
+ * @for EventTarget
+ */
+ETProto.bubble = function(evt, args, target, es) {
+
+ var targs = this._yuievt.targets,
+ ret = true,
+ t,
+ ce,
+ i,
+ bc,
+ ce2,
+ type = evt && evt.type,
+ originalTarget = target || (evt && evt.target) || this,
+ oldbubble;
+
+ if (!evt || ((!evt.stopped) && targs)) {
+
+ for (i in targs) {
+ if (targs.hasOwnProperty(i)) {
+
+ t = targs[i];
+
+ ce = t._yuievt.events[type];
+
+ if (t._hasSiblings) {
+ ce2 = t.getSibling(type, ce);
+ }
+
+ if (ce2 && !ce) {
+ ce = t.publish(type);
+ }
+
+ oldbubble = t._yuievt.bubbling;
+ t._yuievt.bubbling = type;
+
+ // if this event was not published on the bubble target,
+ // continue propagating the event.
+ if (!ce) {
+ if (t._yuievt.hasTargets) {
+ t.bubble(evt, args, originalTarget, es);
+ }
+ } else {
+
+ if (ce2) {
+ ce.sibling = ce2;
+ }
+
+ // set the original target to that the target payload on the facade is correct.
+ ce.target = originalTarget;
+ ce.originalTarget = originalTarget;
+ ce.currentTarget = t;
+ bc = ce.broadcast;
+ ce.broadcast = false;
+
+ // default publish may not have emitFacade true -- that
+ // shouldn't be what the implementer meant to do
+ ce.emitFacade = true;
+
+ ce.stack = es;
+
+ // TODO: See what's getting in the way of changing this to use
+ // the more performant ce._fire(args || evt.details || []).
+
+ // Something in Widget Parent/Child tests is not happy if we
+ // change it - maybe evt.details related?
+ ret = ret && ce.fire.apply(ce, args || evt.details || []);
+
+ ce.broadcast = bc;
+ ce.originalTarget = null;
+
+ // stopPropagation() was called
+ if (ce.stopped) {
+ break;
+ }
+ }
+
+ t._yuievt.bubbling = oldbubble;
+ }
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * @method _hasPotentialSubscribers
+ * @for EventTarget
+ * @private
+ * @param {String} fullType The fully prefixed type name
+ * @return {boolean} Whether the event has potential subscribers or not
+ */
+ETProto._hasPotentialSubscribers = function(fullType) {
+
+ var etState = this._yuievt,
+ e = etState.events[fullType];
+
+ if (e) {
+ return e.hasSubs() || etState.hasTargets || e.broadcast;
+ } else {
+ return false;
+ }
+};
+
+FACADE = new Y.EventFacade();
+FACADE_KEYS = {};
+
+// Flatten whitelist
+for (key in FACADE) {
+ FACADE_KEYS[key] = true;
+}
+
+
+}, '3.12.0', {"requires": ["event-custom-base"]});
diff --git a/lib/yuilib/3.9.1/build/event-delegate/event-delegate-debug.js b/lib/yuilib/3.12.0/event-delegate/event-delegate-debug.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/event-delegate/event-delegate-debug.js
rename to lib/yuilib/3.12.0/event-delegate/event-delegate-debug.js
index edd9485b612..08215a75c8d
--- a/lib/yuilib/3.9.1/build/event-delegate/event-delegate-debug.js
+++ b/lib/yuilib/3.12.0/event-delegate/event-delegate-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('event-delegate', function (Y, NAME) {
/**
@@ -346,4 +352,4 @@ delegate._applyFilter = function (filter, args, ce) {
Y.delegate = Y.Event.delegate = delegate;
-}, '3.9.1', {"requires": ["node-base"]});
+}, '3.12.0', {"requires": ["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/event-delegate/event-delegate-min.js b/lib/yuilib/3.12.0/event-delegate/event-delegate-min.js
old mode 100644
new mode 100755
similarity index 89%
rename from lib/yuilib/3.9.1/build/event-delegate/event-delegate-min.js
rename to lib/yuilib/3.12.0/event-delegate/event-delegate-min.js
index 06b0d2a23c2..c0d112a2dcb
--- a/lib/yuilib/3.9.1/build/event-delegate/event-delegate-min.js
+++ b/lib/yuilib/3.12.0/event-delegate/event-delegate-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("event-delegate",function(e,t){function f(t,r,u,l){var c=n(arguments,0,!0),h=i(u)?u:null,p,d,v,m,g,y,b,w,E;if(s(t)){w=[];if(o(t))for(y=0,b=t.length;y1&&(g=p.shift(),c[0]=t=p.shift()),d=e.Node.DOM_EVENTS[t],s(d)&&d.delegate&&(E=d.delegate.apply(d,arguments));if(!E){if(!t||!r||!u||!l)return;v=h?e.Selector.query(h,null,!0):u,!v&&i(u)&&(E=e.on("available",function(){e.mix(E,e.delegate.apply(e,c),!0)},u)),!E&&v&&(c.splice(2,2,v),E=e.Event._attach(c,{facade:!1}),E.sub.filter=l,E.sub._notify=f.notifySub)}return E&&g&&(m=a[g]||(a[g]={}),m=m[t]||(m[t]=[]),m.push(E)),E}var n=e.Array,r=e.Lang,i=r.isString,s=r.isObject,o=r.isArray,u=e.Selector.test,a=e.Env.evt.handles;f.notifySub=function(t,r,i){r=r.slice(),this.args&&r.push.apply(r,this.args);var s=f._applyFilter(this.filter,r,i),o,u,a,l;if(s){s=n(s),o=r[0]=new e.DOMEventFacade(r[0],i.el,i),o.container=e.one(i.el);for(u=0,a=s.length;u1&&(g=p.shift(),c[0]=t=p.shift()),d=e.Node.DOM_EVENTS[t],s(d)&&d.delegate&&(E=d.delegate.apply(d,arguments));if(!E){if(!t||!r||!u||!l)return;v=h?e.Selector.query(h,null,!0):u,!v&&i(u)&&(E=e.on("available",function(){e.mix(E,e.delegate.apply(e,c),!0)},u)),!E&&v&&(c.splice(2,2,v),E=e.Event._attach(c,{facade:!1}),E.sub.filter=l,E.sub._notify=f.notifySub)}return E&&g&&(m=a[g]||(a[g]={}),m=m[t]||(m[t]=[]),m.push(E)),E}var n=e.Array,r=e.Lang,i=r.isString,s=r.isObject,o=r.isArray,u=e.Selector.test,a=e.Env.evt.handles;f.notifySub=function(t,r,i){r=r.slice(),this.args&&r.push.apply(r,this.args);var s=f._applyFilter(this.filter,r,i),o,u,a,l;if(s){s=n(s),o=r[0]=new e.DOMEventFacade(r[0],i.el,i),o.container=e.one(i.el);for(u=0,a=s.length;u3?e.merge(t.splice(3,1)[0]):{};return a in n||(n[a]=this.MIN_VELOCITY),f in n||(n[f]=this.MIN_DISTANCE),l in n||(n[l]=this.PREVENT_DEFAULT),n},_onStart:function(t,n,i,a){var f=!0,l,h,m,g=i._extra.preventDefault,y=t;t.touches&&(f=t.touches.length===1,t=t.touches[0]),f&&(g&&(!g.call||g(t))&&y.preventDefault(),t.flick={time:(new Date).getTime()},i[c]=t,l=i[p],m=n.get(v)===9?n:n.get(u),l||(l=m.on(r[s],e.bind(this._onEnd,this),null,n,i,a),i[p]=l),i[d]=m.once(r[o],e.bind(this._onMove,this),null,n,i,a))},_onMove:function(e,t,n,r){var i=n[c];i&&i.flick&&(i.flick.time=(new Date).getTime())},_onEnd:function(e,t,n,r){var i=(new Date).getTime(),s=n[c],o=!!s,u=e,h,p,v,m,g,y,b,w,E=n[d];E&&(E.detach(),delete n[d]),o&&(e.changedTouches&&(e.changedTouches.length===1&&e.touches.length===0?u=e.changedTouches[0]:o=!1),o&&(m=n._extra,v=m[l],v&&(!v.call||v(e))&&e.preventDefault(),h=s.flick.time,i=(new Date).getTime(),p=i-h,g=[u.pageX-s.pageX,u.pageY-s.pageY],m.axis?w=m.axis:w=Math.abs(g[0])>=Math.abs(g[1])?"x":"y",y=g[w==="x"?0:1],b=p!==0?y/p:0,isFinite(b)&&Math.abs(y)>=m[f]&&Math.abs(b)>=m[a]&&(e.type="flick",e.flick={time:p,distance:y,velocity:b,axis:w,start:s},r.fire(e)),n[c]=null))},MIN_VELOCITY:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1})},"3.9.1",{requires:["node-base","event-touch","event-synthetic"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("event-flick",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="end",o="move",u="ownerDocument",a="minVelocity",f="minDistance",l="preventDefault",c="_fs",h="_fsh",p="_feh",d="_fmh",v="nodeType";e.Event.define("flick",{on:function(e,t,n){var s=e.on(r[i],this._onStart,this,e,t,n);t[h]=s},detach:function(e,t,n){var r=t[h],i=t[p];r&&(r.detach(),t[h]=null),i&&(i.detach(),t[p]=null)},processArgs:function(t){var n=t.length>3?e.merge(t.splice(3,1)[0]):{};return a in n||(n[a]=this.MIN_VELOCITY),f in n||(n[f]=this.MIN_DISTANCE),l in n||(n[l]=this.PREVENT_DEFAULT),n},_onStart:function(t,n,i,a){var f=!0,l,h,m,g=i._extra.preventDefault,y=t;t.touches&&(f=t.touches.length===1,t=t.touches[0]),f&&(g&&(!g.call||g(t))&&y.preventDefault(),t.flick={time:(new Date).getTime()},i[c]=t,l=i[p],m=n.get(v)===9?n:n.get(u),l||(l=m.on(r[s],e.bind(this._onEnd,this),null,n,i,a),i[p]=l),i[d]=m.once(r[o],e.bind(this._onMove,this),null,n,i,a))},_onMove:function(e,t,n,r){var i=n[c];i&&i.flick&&(i.flick.time=(new Date).getTime())},_onEnd:function(e,t,n,r){var i=(new Date).getTime(),s=n[c],o=!!s,u=e,h,p,v,m,g,y,b,w,E=n[d];E&&(E.detach(),delete n[d]),o&&(e.changedTouches&&(e.changedTouches.length===1&&e.touches.length===0?u=e.changedTouches[0]:o=!1),o&&(m=n._extra,v=m[l],v&&(!v.call||v(e))&&e.preventDefault(),h=s.flick.time,i=(new Date).getTime(),p=i-h,g=[u.pageX-s.pageX,u.pageY-s.pageY],m.axis?w=m.axis:w=Math.abs(g[0])>=Math.abs(g[1])?"x":"y",y=g[w==="x"?0:1],b=p!==0?y/p:0,isFinite(b)&&Math.abs(y)>=m[f]&&Math.abs(b)>=m[a]&&(e.type="flick",e.flick={time:p,distance:y,velocity:b,axis:w,start:s},r.fire(e)),n[c]=null))},MIN_VELOCITY:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1})},"3.12.0",{requires:["node-base","event-touch","event-synthetic"]});
diff --git a/lib/yuilib/3.9.1/build/event-flick/event-flick.js b/lib/yuilib/3.12.0/event-flick/event-flick.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/event-flick/event-flick.js
rename to lib/yuilib/3.12.0/event-flick/event-flick.js
index b871f0c27c6..8e3be79a274
--- a/lib/yuilib/3.9.1/build/event-flick/event-flick.js
+++ b/lib/yuilib/3.12.0/event-flick/event-flick.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('event-flick', function (Y, NAME) {
/**
@@ -269,4 +275,4 @@ Y.Event.define('flick', {
});
-}, '3.9.1', {"requires": ["node-base", "event-touch", "event-synthetic"]});
+}, '3.12.0', {"requires": ["node-base", "event-touch", "event-synthetic"]});
diff --git a/lib/yuilib/3.9.1/build/event-focus/event-focus-debug.js b/lib/yuilib/3.12.0/event-focus/event-focus-debug.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/event-focus/event-focus-debug.js
rename to lib/yuilib/3.12.0/event-focus/event-focus-debug.js
index 645119db843..580db4706e6
--- a/lib/yuilib/3.9.1/build/event-focus/event-focus-debug.js
+++ b/lib/yuilib/3.12.0/event-focus/event-focus-debug.js
@@ -1,9 +1,15 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('event-focus', function (Y, NAME) {
/**
* Adds bubbling and delegation support to DOM events focus and blur.
- *
+ *
* @module event
* @submodule event-focus
*/
@@ -69,7 +75,7 @@ function define(type, proxy, directEvent) {
yuid = Y.stamp(currentTarget._node),
defer = (useActivate || target !== currentTarget),
directSub;
-
+
notifier.currentTarget = (delegate) ? target : currentTarget;
notifier.container = (delegate) ? currentTarget : null;
@@ -196,7 +202,7 @@ function define(type, proxy, directEvent) {
break;
}
}
-
+
delete notifiers[yuid];
count--;
}
@@ -271,4 +277,4 @@ if (useActivate) {
}
-}, '3.9.1', {"requires": ["event-synthetic"]});
+}, '3.12.0', {"requires": ["event-synthetic"]});
diff --git a/lib/yuilib/3.9.1/build/event-focus/event-focus-min.js b/lib/yuilib/3.12.0/event-focus/event-focus-min.js
old mode 100644
new mode 100755
similarity index 89%
rename from lib/yuilib/3.9.1/build/event-focus/event-focus-min.js
rename to lib/yuilib/3.12.0/event-focus/event-focus-min.js
index 7c303126748..f6a218e7c74
--- a/lib/yuilib/3.9.1/build/event-focus/event-focus-min.js
+++ b/lib/yuilib/3.12.0/event-focus/event-focus-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("event-focus",function(e,t){function u(t,r,u){var a="_"+t+"Notifiers";e.Event.define(t,{_useActivate:o,_attach:function(i,s,o){return e.DOM.isWindow(i)?n._attach([t,function(e){s.fire(e)},i]):n._attach([r,this._proxy,i,this,s,o],{capture:!0})},_proxy:function(t,r,i){var s=t.target,f=t.currentTarget,l=s.getData(a),c=e.stamp(f._node),h=o||s!==f,p;r.currentTarget=i?s:f,r.container=i?f:null,l?h=!0:(l={},s.setData(a,l),h&&(p=n._attach([u,this._notify,s._node]).sub,p.once=!0)),l[c]||(l[c]=[]),l[c].push(r),h||this._notify(t)},_notify:function(t,n){var r=t.currentTarget,i=r.getData(a),o=r.ancestors(),u=r.get("ownerDocument"),f=[],l=i?e.Object.keys(i).length:0,c,h,p,d,v,m,g,y,b,w;r.clearData(a),o.push(r),u&&o.unshift(u),o._nodes.reverse(),l&&(m=l,o.some(function(t){var n=e.stamp(t),r=i[n],s,o;if(r){l--;for(s=0,o=r.length;s
[{type}:]{code}[,{code}]*Y.delegate("key", preventSubmit, "#forms", "enter", "input[type=text]");Y.one("doc").on("key", viNav, "j,k,l,;");Add a key listener. The listener will only be notified if the * keystroke detected meets the supplied specification. The * specification is a string that is defined as:
- * + * *[{type}:]{code}[,{code}]*Y.delegate("key", preventSubmit, "#forms", "enter", "input[type=text]");Y.one("doc").on("key", viNav, "j,k,l,;");"+e+"
":e+="0)if(o.isString&&r[n])s=!0;else if(o.isObject(n))for(i in r)if(r.hasOwnProperty(i)&&n[i]){s=!0;break}s&&t._redraw()},_x:0,_y:0,getXY:function(){var t=e.one(this._node),n;return t&&(n=t.getXY()),n},initializer:function(){var e=this.get("render"),t=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._gradients={},this._node=v.createElement("div"),this._node.style.position="absolute",this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=t,this._contentNode=this._createGraphics(),this._contentNode.style.visibility=t,this._contentNode.setAttribute("id",this.get("id")),this._node.appendChild(this._contentNode),e&&this.render(e)},render:function(t){var n=e.one(t),r=this.get("width")||parseInt(n.getComputedStyle("width"),10),i=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||e.one(v.body),n.append(this._node),this.parentNode=n,this.set("width",r),this.set("height",i),this},destroy:function(){this.removeAllShapes(),this._contentNode&&(this._removeChildren(this._contentNode),this._contentNode.parentNode&&this._contentNode.parentNode.removeChild(this._contentNode),this._contentNode=null),this._node&&(this._removeChildren(this._node),e.one(this._node).remove(!0),this._node=null)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n},_appendShape:function(e){var t=e.node,n=this._frag||this._contentNode;this.get("autoDraw")?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){return e instanceof f||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof f&&(e._destroy(),delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw(),e},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t]._destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes()},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._contentNode&&(this._contentNode.style.visibility=r),this._node&&(this._node.style.visibility=r)},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.SVGCircle,rect:e.SVGRect,path:e.SVGPath,ellipse:e.SVGEllipse,pieslice:e.SVGPieSlice},getShapeById:function(e){var t=this._shapes[e];return t},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=v.createDocumentFragment()),this._frag},_redraw:function(){var t=this.get("autoSize"),n=this.get("preserveAspectRatio"),r=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,i=r.left,s=r.right,o=r.top,u=r.bottom,a=s-i,f=u-o,l,c,h,p,d;t?t==="sizeContentToGraphic"?(d=e.one(this._node),l=parseFloat(d.getComputedStyle("width")),c=parseFloat(d.getComputedStyle("height")),h=p=0,this._contentNode.setAttribute("preserveAspectRatio",n)):(l=a,c=f,h=i,p=o,this._state.width=a,this._state.height=f,this._node&&(this._node.style.width=a+"px"
+,this._node.style.height=f+"px")):(l=a,c=f,h=i,p=o),this._contentNode&&(this._contentNode.style.left=h+"px",this._contentNode.style.top=p+"px",this._contentNode.setAttribute("width",l),this._contentNode.setAttribute("height",c),this._contentNode.style.width=l+"px",this._contentNode.style.height=c+"px",this._contentNode.setAttribute("viewBox",""+i+" "+o+" "+a+" "+f+"")),this._frag&&(this._contentNode&&this._contentNode.appendChild(this._frag),this._frag=null)},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left 360&&(r=360),this._currentX=e,this._currentY=t,n*=-65535,r*=65536,n=Math.round(n),r=Math.round(r),this.moveTo(e,t),this._addToPath(" ae "+this._round(e)+", "+this._round(t)+", "+this._round(i)+" "+this._round(i)+", "+n+", "+r),this._trackSize(s,s),this},lineTo:function(){return this._lineTo.apply(this,[e.Array(arguments),!1]),this},relativeLineTo:function(){return this._lineTo.apply(this,[e.Array(arguments),!0]),this},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=t?" r ":" l ",a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;if(typeof n=="string"||typeof n=="number"){i=e.length-1;for(r=0;rthis._right&&(this._right=e),e Base class for creating shapes. Base class for creating shapes. Provides Y.QueryString.parse method for converting Query Strings to an object.
+ * This is a simpler implementation than the full querystring-parse. Because some things may require basic query string escaping functionality,
* this module provides the bare minimum functionality (decoding a hash of simple values),
* without the additional support for arrays, objects, and so on. Provides Y.QueryString.stringify method for converting objects to Query Strings.
- * This is a simpler implementation than the full querystring-stringify. Provides Y.QueryString.parse method for converting Query Strings to an object.
+ * This is a simpler implementation than the full querystring-parse. Because some things may require basic query string escaping functionality,
* this module provides the bare minimum functionality (decoding a hash of simple values),
* without the additional support for arrays, objects, and so on. p,w=h>d,E=h =0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h -1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"3.9.1",{requires:["selector-native","selector-css2"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("selector-css3",function(e,t){e.Selector._reNth=/^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/,e.Selector._getNth=function(t,n,r,i){e.Selector._reNth.test(n);var s=parseInt(RegExp.$1,10),o=RegExp.$2,u=RegExp.$3,a=parseInt(RegExp.$4,10)||0,f=[],l=e.DOM._children(t.parentNode,r),c;u?(s=2,c="+",o="n",a=u==="odd"?1:0):isNaN(s)&&(s=o?1:0);if(s===0)return i&&(a=l.length-a+1),l[a-1]===t?!0:!1;s<0&&(i=!!i,s=Math.abs(s));if(!i){for(var h=a-1,p=l.length;h =0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h -1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"3.12.0",{requires:["selector-native","selector-css2"]});
diff --git a/lib/yuilib/3.9.1/build/selector-css3/selector-css3.js b/lib/yuilib/3.12.0/selector-css3/selector-css3.js
old mode 100644
new mode 100755
similarity index 95%
rename from lib/yuilib/3.9.1/build/selector-css3/selector-css3.js
rename to lib/yuilib/3.12.0/selector-css3/selector-css3.js
index 9c16acdcaa3..376180c195a
--- a/lib/yuilib/3.9.1/build/selector-css3/selector-css3.js
+++ b/lib/yuilib/3.12.0/selector-css3/selector-css3.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('selector-css3', function (Y, NAME) {
/**
@@ -150,4 +156,4 @@ Y.Selector.combinators['~'] = {
};
-}, '3.9.1', {"requires": ["selector-native", "selector-css2"]});
+}, '3.12.0', {"requires": ["selector-native", "selector-css2"]});
diff --git a/lib/yuilib/3.9.1/build/selector-native/selector-native-debug.js b/lib/yuilib/3.12.0/selector-native/selector-native-debug.js
old mode 100644
new mode 100755
similarity index 96%
rename from lib/yuilib/3.9.1/build/selector-native/selector-native-debug.js
rename to lib/yuilib/3.12.0/selector-native/selector-native-debug.js
index 05a26dbaa3c..73ed2b58815
--- a/lib/yuilib/3.9.1/build/selector-native/selector-native-debug.js
+++ b/lib/yuilib/3.12.0/selector-native/selector-native-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('selector-native', function (Y, NAME) {
(function(Y) {
@@ -240,8 +246,11 @@ var Selector = {
},
_nativeQuery: function(selector, root, one) {
- if (Y.UA.webkit && selector.indexOf(':checked') > -1 &&
- (Y.Selector.pseudos && Y.Selector.pseudos.checked)) { // webkit (chrome, safari) fails to pick up "selected" with "checked"
+ if (
+ (Y.UA.webkit || Y.UA.opera) && // webkit (chrome, safari) and Opera
+ selector.indexOf(':checked') > -1 && // fail to pick up "selected" with ":checked"
+ (Y.Selector.pseudos && Y.Selector.pseudos.checked)
+ ) {
return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query
}
try {
@@ -373,4 +382,4 @@ Y.mix(Y.Selector, Selector, true);
})(Y);
-}, '3.9.1', {"requires": ["dom-base"]});
+}, '3.12.0', {"requires": ["dom-base"]});
diff --git a/lib/yuilib/3.9.1/build/selector-native/selector-native-min.js b/lib/yuilib/3.12.0/selector-native/selector-native-min.js
old mode 100644
new mode 100755
similarity index 62%
rename from lib/yuilib/3.9.1/build/selector-native/selector-native-min.js
rename to lib/yuilib/3.12.0/selector-native/selector-native-min.js
index bfc91420ed5..655a764f89d
--- a/lib/yuilib/3.9.1/build/selector-native/selector-native-min.js
+++ b/lib/yuilib/3.12.0/selector-native/selector-native-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("selector-native",function(e,t){(function(e){e.namespace("Selector");var t="compareDocumentPosition",n="ownerDocument",r={_types:{esc:{token:"\ue000",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"\ue001",re:/(\[[^\]]*\])/g},pseudo:{token:"\ue002",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(e){return e&&(e=e.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")),e},_compare:"sourceIndex"in e.config.doc.documentElement?function(e,t){var n=e.sourceIndex,r=t.sourceIndex;return n===r?0:n>r?1:-1}:e.config.doc.documentElement[t]?function(e,n){return e[t](n)&4?-1:1}:function(e,t){var r,i,s;return e&&t&&(r=e[n].createRange(),r.setStart(e,0),i=t[n].createRange(),i.setStart(t,0),s=r.compareBoundaryPoints(1,i)),s},_sort:function(t){return t&&(t=e.Array(t,0,!0),t.sort&&t.sort(r._compare)),t},_deDupe:function(e){var t=[],n,r;for(n=0;r=e[n++];)r._found||(t[t.length]=r,r._found=!0);for(n=0;r=t[n++];)r._found=null,r.removeAttribute("_found");return t},query:function(t,n,i,s){n=n||e.config.doc;var o=[],u=e.Selector.useNative&&e.config.doc.querySelector&&!s,a=[[t,n]],f,l,c,h=u?e.Selector._nativeQuery:e.Selector._bruteQuery;if(t&&h){!s&&(!u||n.tagName)&&(a=r._splitQueries(t,n));for(c=0;f=a[c++];)l=h(f[0],f[1],i),i||(l=e.Array(l,0,!0)),l&&(o=o.concat(l));a.length>1&&(o=r._sort(r._deDupe(o)))}return i?o[0]||null:o},_replaceSelector:function(t){var n=e.Selector._parse("esc",t),i,s;return t=e.Selector._replace("esc",t),s=e.Selector._parse("pseudo",t),t=r._replace("pseudo",t),i=e.Selector._parse("attr",t),t=e.Selector._replace("attr",t),{esc:n,attrs:i,pseudos:s,selector:t}},_restoreSelector:function(t){var n=t.selector;return n=e.Selector._restore("attr",n,t.attrs),n=e.Selector._restore("pseudo",n,t.pseudos),n=e.Selector._restore("esc",n,t.esc),n},_replaceCommas:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t&&(t=t.replace(/,/g,"\ue007"),n.selector=t,t=e.Selector._restoreSelector(n)),t},_splitQueries:function(t,n){t.indexOf(",")>-1&&(t=e.Selector._replaceCommas(t));var r=t.split("\ue007"),i=[],s="",o,u,a;if(n){n.nodeType===1&&(o=e.Selector._escapeId(e.DOM.getId(n)),o||(o=e.guid(),e.DOM.setId(n,o)),s='[id="'+o+'"] ');for(u=0,a=r.length;u-1&&e.Selector.pseudos&&e.Selector.pseudos.checked)return e.Selector.query(t,n,r,!0);try{return n["querySelector"+(r?"":"All")](t)}catch(i){return e.Selector.query(t,n,r,!0)}},filter:function(t,n){var r=[],i,s;if(t&&n)for(i=0;s=t[i++];)e.Selector.test(s,n)&&(r[r.length]=s);return r},test:function(t,r,i){var s=!1,o=!1,u,a,f,l,c,h,p,d,v;if(t&&t.tagName)if(typeof r=="function")s=r.call(t,t);else{u=r.split(","),!i&&!e.DOM.inDoc(t)&&(a=t.parentNode,a?i=a:(c=t[n].createDocumentFragment(),c.appendChild(t),i=c,o=!0)),i=i||t[n],h=e.Selector._escapeId(e.DOM.getId(t)),h||(h=e.guid(),e.DOM.setId(t,h));for(p=0;v=u[p++];){v+='[id="'+h+'"]',l=e.Selector.query(v,i);for(d=0;f=l[d++];)if(f===t){s=!0;break}if(s)break}o&&c.removeChild(t)}return s},ancestor:function(t,n,r){return e.DOM.ancestor(t,function(t){return e.Selector.test(t,n)},r)},_parse:function(t,n){return n.match(e.Selector._types[t].re)},_replace:function(t,n){var r=e.Selector._types[t];return n.replace(r.re,r.token)},_restore:function(t,n,r){if(r){var i=e.Selector._types[t].token,s,o;for(s=0,o=r.length;s 2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?i.concat(e.Array(arguments,0,!0)):arguments;return s.apply(r||s,o)}},e.rbind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?e.Array(arguments,0,!0).concat(i):arguments;return s.apply(r||s,o)}}},"@VERSION@",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name
+:"json-parse-shim",test:function(e){function i(e,t){return e==="ok"?!0:t}var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONParse!==!1&&!!n;if(r)try{r=n.parse('{"ok":false}',i).ok}catch(s){r=!1}return!r},trigger:"json-parse"}),r("load","15",{name:"json-stringify-shim",test:function(e){var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONStringify!==!1&&!!n;if(r)try{r="0"===n.stringify(0)}catch(i){r=!1}return!r},trigger:"json-stringify"}),r("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","17",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","18",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","20",{name:"yql-jsonp",test:function(e){return!e.UA.nodejs&&!e.UA.winjs},trigger:"yql",when:"after"}),r("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"@VERSION@",{requires:["yui-base"]}),YUI.add("dom-core",function(e,t){var n="nodeType",r="ownerDocument",i="documentElement",s="defaultView",o="parentWindow",u="tagName",a="parentNode",f="previousSibling",l="nextSibling",c="contains",h="compareDocumentPosition",p=[],d=function(){var t=e.config.doc.createElement("div"),n=t.appendChild(e.config.doc.createTextNode("")),r=!1;try{r=t.contains(n)}catch(i){}return r}(),v={byId:function(e,t){return v.allById(e,t)[0]||null},getId:function(e){var t;return e.id&&!e.id.tagName&&!e.id.item?t=e.id:e.attributes&&e.attributes.id&&(t=e.attributes.id.value),t},setId:function(e,t){e.setAttribute?e.setAttribute("id",t):e.id=t},ancestor:function(e,t,n,r){var i=null;return n&&(i=!t||t(e)?e:null),i||v.elementByAxis(e,a,t,null,r)},ancestors:function(e,t,n,r){var i=e,s=[];while(i=v.ancestor(i,t,n,r)){n=!1;if(i){s.unshift(i);if(r&&r(i))return s}}return s},elementByAxis:function(e,t,n,r,i){while(e&&(e=e[t])){if((r||e[u])&&(!n||n(e)))return e;if(i&&i(e))return null}return null},contains:function(e,t){var r=!1;if(!t||!e||!t[n]||!e[n])r=!1;else if(e[c]&&(t[n]===1||d))r=e[c](t);else if(e[h]){if(e===t||!!(e[h](t)&16))r=!0}else r=v._bruteContains(e,t);return r},inDoc:function(e,t){var n=!1,s;return e&&e.nodeType&&(t||(t=e[r]),s=t[i],s&&s.contains&&e.tagName?n=s.contains(e):n=v.contains(s,e)),n},allById:function(t,n){n=n||e.config.doc;var r=[],i=[],s,o;if(n.querySelectorAll)i=n.querySelectorAll('[id="'+t+'"]');else if(n.all){r=n.all(t);if(r){r.nodeName&&(r.id===t?(i.push(r),r=p):r=[r]);if(r.length)for(s=0;o=r[s++];)(o.id===t||o.attributes&&o.attributes.id&&o.attributes.id.value===t)&&i.push(o)}}else i=[v._getDoc(n).getElementById(t)];return i},isWindow:function(e){return!!(e&&e.scrollTo&&e.document)},_removeChildNodes:function(e){while(e.firstChild)e.removeChild(e.firstChild)},siblings:function(e,t){var n=[],r=e;while(r=r[f])r[u]&&(!t||t(r))&&n.unshift(r);r=e;while(r=r[l])r[u]&&(!t||t(r))&&n.push(r);return n},_bruteContains:function(e,t){while(t){if(e===t)return!0;t=t.parentNode}return!1},_getRegExp:function(e,t){return t=t||"",v._regexCache=v._regexCache||{},v._regexCache[e+t]||(v._regexCache[e+t]=new RegExp(e,t)),v._regexCache[e+t]},_getDoc:function(t){var i=e.config.doc;return t&&(i=t[n]===9?t:t[r]||t.document||e.config.doc),i},_getWin:function(t){var n=v._getDoc(t);return n[s]||n[o]||e.config.win},_batch:function(e,t,n,r,i,s){t=typeof t=="string"?v[t]:t;var o,u=0,a,f;if(t&&e)while(a=e[u++])o=o=t.call(v,a,n,r,i,s),typeof o!="undefined"&&(f||(f=[]),f.push(o));return typeof f!="undefined"?f:e},generateID:function(t){var n=t.id;return n||(n=e.stamp(t),t.id=n),n}};e.DOM=v},"@VERSION@",{requires:["oop","features"]}),YUI.add("dom-base",function(e,t){var n=e.config.doc.documentElement,r=e.DOM,i="tagName",s="ownerDocument",o="",u=e.Features.add,a=e.Features.test;e.mix(r,{getText:n.textContent!==undefined?function(e){var t="";return e&&(t=e.textContent),t||""}:function(e){var t="";return e&&(t=e.innerText||e.nodeValue),t||""},setText:n.textContent!==undefined?function(e,t){e&&(e.textContent=t)}:function(e,t){"innerText"in e?e.innerText=t:"nodeValue"in e&&(e.nodeValue=t)},CUSTOM_ATTRIBUTES:n.hasAttribute?{htmlFor:"for",className:"class"}:{"for":"htmlFor","class":"className"},setAttribute:function(e,t,n,i){e&&t&&e.setAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,e.setAttribute(t,n,i))},getAttribute:function(e,t,n){n=n!==undefined?n:2;var i="";return e&&t&&e.getAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,i=e.getAttribute(t,n),i===null&&(i="")),i},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(e){var t="",n;return e&&e[i]&&(n=r.VALUE_GETTERS[e[i].toLowerCase()],n?t=n(e):t=e.value),t===o&&(t=o),typeof t=="string"?t:""},setValue:function(e,t){var n;e&&e[i]&&(n=r.VALUE_SETTERS[e[i].toLowerCase()],n?n(e,t):e.value=t)},creators:{}}),u("value-set","select",{test:function(){var t=e.config.doc.createElement("select");return t.innerHTML="",t.value="2",t.value&&t.value==="2"}}),a("value-set","select")||(r.VALUE_SETTERS.select=function(e,t){for(var n=0,i=e.getElementsByTagName("option"),s;s=i[n++];)if(r.getValue(s)===t){s.selected=!0;break}}),e.mix(r.VALUE_GETTERS,{button:function(e){return e.attributes&&e.attributes.value?e.attributes.value.value:""}}),e.mix(r.VALUE_SETTERS,{button:function(e,t){var n=e.attributes.value;n||(n=e[s].createAttribute("value"),e.setAttributeNode(n)),n.value=t}}),e.mix(r.VALUE_GETTERS,{option:function(e){var t=e.attributes;return t.value&&t.value.specified?e.value:e.text},select:function(e){var t=e.value,n=e.options;return n&&n.length&&(e.multiple||e.selectedIndex>-1&&(t=r.getValue(n[e.selectedIndex]))),t}});var f,l,c;e.mix(e.DOM
+,{hasClass:function(t,n){var r=e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)");return r.test(t.className)},addClass:function(t,n){e.DOM.hasClass(t,n)||(t.className=e.Lang.trim([t.className,n].join(" ")))},removeClass:function(t,n){n&&l(t,n)&&(t.className=e.Lang.trim(t.className.replace(e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)")," ")),l(t,n)&&c(t,n))},replaceClass:function(e,t,n){c(e,t),f(e,n)},toggleClass:function(e,t,n){var r=n!==undefined?n:!l(e,t);r?f(e,t):c(e,t)}}),l=e.DOM.hasClass,c=e.DOM.removeClass,f=e.DOM.addClass;var h=/<([a-z]+)/i,r=e.DOM,u=e.Features.add,a=e.Features.test,p={},d=function(t,n){var r=e.config.doc.createElement("div"),i=!0;r.innerHTML=t;if(!r.firstChild||r.firstChild.tagName!==n.toUpperCase())i=!1;return i},v=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s* =0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h -1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"@VERSION@",{requires:["selector-native","selector-css2"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:2,warn:4,error:8};n.log=function(e,t,o,u){var a,f,l,c,h,p,d=n,v=d.config,m=d.fire?d:YUI.Env.globalEvents;return v.debug&&(o=o||"",typeof o!="undefined"&&(f=v.logExclude,l=v.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1,d.config.logLevel=d.config.logLevel||"debug",p=s[d.config.logLevel.toLowerCase()],t in s&&s[t] ",u=function(e,t){var u,a,f=[],l=n.type(e);if(!n.isObject(e))return e+"";if(l=="date")return e;if(e.nodeType&&e.tagName)return e.tagName+"#"+e.id;if(e.document&&e.navigator)return"window";if(e.location&&e.body)return"document";if(l=="function")return i;t=n.isNumber(t)?t:3;if(l=="array"){f.push("[");for(u=0,a=e.length;u0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s);f.length>1&&f.pop(),f.push("]")}else if(l=="regexp")f.push(e.toString());else{f.push("{");for(u in e)if(e.hasOwnProperty(u))try{f.push(u+o),n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s)}catch(c){f.push("Error: "+c.message)}f.length>1&&f.pop(),f.push("}")}return f.join("")};e.dump=u,n.dump=u},"@VERSION@",{requires:["yui-base"]}),YUI.add("transition-timer",function(e,t){var n=e.Transition;e.mix(n.prototype,{_start:function(){n.useNative?this._runNative():this._runTimer()},_runTimer:function(){var t=this;t._initAttrs(),n._running[e.stamp(t)]=t,t._startTime=new Date,n._startTimer()},_endTimer:function(){var t=this;delete n._running[e.stamp(t)],t._startTime=null},_runFrame:function(){var e=new Date-this._startTime;this._runAttrs(e)},_runAttrs:function(t){var r=this,i=r._node,s=r._config,o=e.stamp(i),u=n._nodeAttrs[o],a=n.behaviors,f=!1,l=!1,c,h,p,d,v,m,g,y,b;for(h in u)if((p=u[h])&&p.transition===r){g=p.duration,m=p.delay,v=(t-m)/1e3,y=t,c={type:"propertyEnd",propertyName:h,config:s,elapsedTime:v},d=b in a&&"set"in a[b]?a[b].set:n.DEFAULT_SETTER,f=y>=g,y>g&&(y=g);if(!m||t>=m)d(r,h,p.from,p.to,y-m,g-m,p.easing,p.unit),f&&(delete u[h],r._count--,s[h]&&s[h].on&&s[h].on.end&&s[h].on.end.call(e.one(i),c),!l&&r._count<=0&&(l=!0,r._end(v),r._endTimer()))}},_initAttrs:function(){var t=this,r=n.behaviors,i=e.stamp(t._node),s=n._nodeAttrs[i],o,u,a,f,l,c,h,p,d,v,m;for(c in s)(o=s[c])&&o.transition===t&&(u=o.duration*1e3,a=o.delay*1e3,f=o.easing,l=o.value,c in t._node.style||c in e.DOM.CUSTOM_STYLES?(v=c in r&&"get"in r[c]?r[c].get(t,c):n.DEFAULT_GETTER(t,c),p=n.RE_UNITS.exec(v),h=n.RE_UNITS.exec(l),v=p?p[1]:v,m=h?h[1]:l,d=h?h[2]:p?p[2]:"",!d&&n.RE_DEFAULT_UNIT.test(c)&&(d=n.DEFAULT_UNIT),typeof f=="string"&&(f.indexOf("cubic-bezier")>-1?f=f.substring(13,f.length-1).split(","):n.easings[f]&&(f=n.easings[f])),o.from=Number(v),o.to=Number(m),o.unit=d,o.easing=f,o.duration=u+a,o.delay=a):(delete s[c],t._count--))},destroy:function(){this.detachAll(),this._node=null}},!0),e.mix(e.Transition,{_runtimeAttrs:{},RE_DEFAULT_UNIT:/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,DEFAULT_UNIT:"px",intervalTime:20,behaviors:{left:{get:function(t,n){return e.DOM._getAttrOffset(t._node,n)}}},DEFAULT_SETTER:function(t,r,i,s,o,u,a,f){i=Number(i),s=Number(s);var l=t._node,c=n.cubicBezier(a,o/u);c=i+c[0]*(s-i);if(l){if(r in l.style||r in e.DOM.CUSTOM_STYLES)f=f||"",e.DOM.setStyle(l,r,c+f)}else t._end()},DEFAULT_GETTER:function(t,n){var r=t._node,i="";if(n in r.style||n in e.DOM.CUSTOM_STYLES)i=e.DOM.getComputedStyle(r,n);return i},_startTimer:function(){n._timer||(n._timer=setInterval(n._runFrame,n.intervalTime))},_stopTimer:function(){clearInterval(n._timer),n._timer=null},_runFrame:function(){var e=!0,t;for(t in n._running)n._running[t]._runFrame&&(e=!1,n
+._running[t]._runFrame());e&&n._stopTimer()},cubicBezier:function(e,t){var n=0,r=0,i=e[0],s=e[1],o=e[2],u=e[3],a=1,f=0,l=a-3*o+3*i-n,c=3*o-6*i+3*n,h=3*i-3*n,p=n,d=f-3*u+3*s-r,v=3*u-6*s+3*r,m=3*s-3*r,g=r,y=((l*t+c)*t+h)*t+p,b=((d*t+v)*t+m)*t+g;return[y,b]},easings:{ease:[.25,0,1,.25],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},_running:{},_timer:null,RE_UNITS:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/},!0),n.behaviors.top=n.behaviors.bottom=n.behaviors.right=n.behaviors.left,e.Transition=n},"@VERSION@",{requires:["transition"]}),YUI.add("yui",function(e,t){},"@VERSION@",{use:["yui","oop","dom","event-custom-base","event-base","pluginhost","node","event-delegate","io-base","json-parse","transition","selector-css3","dom-style-ie","querystring-stringify-simple"]});var Y=YUI().use("*");
diff --git a/lib/yuilib/3.9.1/build/simpleyui/simpleyui.js b/lib/yuilib/3.12.0/simpleyui/simpleyui.js
old mode 100644
new mode 100755
similarity index 93%
rename from lib/yuilib/3.9.1/build/simpleyui/simpleyui.js
rename to lib/yuilib/3.12.0/simpleyui/simpleyui.js
index d92d286ea37..4df14f54345
--- a/lib/yuilib/3.9.1/build/simpleyui/simpleyui.js
+++ b/lib/yuilib/3.12.0/simpleyui/simpleyui.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
/**
The YUI module contains the components required for building the YUI seed file.
This includes the script loading mechanism, a simple queue, and the core
@@ -157,7 +163,7 @@ available.
(function() {
var proto, prop,
- VERSION = '3.9.1',
+ VERSION = '3.12.0',
PERIOD = '.',
BASE = 'http://yui.yahooapis.com/',
/*
@@ -1501,6 +1507,7 @@ with any configuration info required for the module.
YUI._getLoadHook = null;
}
+ YUI.Env[VERSION] = {};
}());
@@ -1636,6 +1643,22 @@ supported native console. This function is executed with the YUI instance as its
@since 3.1.0
**/
+/**
+The minimum log level to log messages for. Log levels are defined
+incrementally. Messages greater than or equal to the level specified will
+be shown. All others will be discarded. The order of log levels in
+increasing priority is:
+
+ debug
+ info
+ warn
+ error
+
+@property {String} logLevel
+@default 'debug'
+@since 3.10.0
+**/
+
/**
Callback to execute when `Y.error()` is called. It receives the error message
and a JavaScript error object if one was provided.
@@ -1721,8 +1744,8 @@ relying on ES5 functionality, even when ES5 functionality is available.
/**
Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)
-@property delayUntil
-@type String|Object
+
+@property {Object|String} delayUntil
@since 3.6.0
@example
@@ -1746,8 +1769,6 @@ Or you can delay until a node is available (with `available` or `contentready`):
// available in the DOM.
});
-@property {Object|String} delayUntil
-@since 3.6.0
**/
YUI.add('yui-base', function (Y, NAME) {
@@ -1788,9 +1809,15 @@ TYPES = {
'[object Error]' : 'error'
},
-SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
-TRIMREGEX = /^\s+|\s+$/g,
-NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i;
+SUBREGEX = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
+
+WHITESPACE = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF",
+WHITESPACE_CLASS = "[\x09-\x0D\x20\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+",
+TRIM_LEFT_REGEX = new RegExp("^" + WHITESPACE_CLASS),
+TRIM_RIGHT_REGEX = new RegExp(WHITESPACE_CLASS + "$"),
+TRIMREGEX = new RegExp(TRIM_LEFT_REGEX.source + "|" + TRIM_RIGHT_REGEX.source, "g"),
+
+NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i;
// -- Protected Methods --------------------------------------------------------
@@ -2014,7 +2041,7 @@ L.sub = function(s, o) {
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
-L.trim = STRING_PROTO.trim ? function(s) {
+L.trim = L._isNative(STRING_PROTO.trim) && !WHITESPACE.trim() ? function(s) {
return s && s.trim ? s.trim() : s;
} : function (s) {
try {
@@ -2031,10 +2058,10 @@ L.trim = STRING_PROTO.trim ? function(s) {
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
-L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
+L.trimLeft = L._isNative(STRING_PROTO.trimLeft) && !WHITESPACE.trimLeft() ? function (s) {
return s.trimLeft();
} : function (s) {
- return s.replace(/^\s+/, '');
+ return s.replace(TRIM_LEFT_REGEX, '');
};
/**
@@ -2044,10 +2071,10 @@ L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
* @param s {string} the string to trim.
* @return {string} the trimmed string.
*/
-L.trimRight = STRING_PROTO.trimRight ? function (s) {
+L.trimRight = L._isNative(STRING_PROTO.trimRight) && !WHITESPACE.trimRight() ? function (s) {
return s.trimRight();
} : function (s) {
- return s.replace(/\s+$/, '');
+ return s.replace(TRIM_RIGHT_REGEX, '');
};
/**
@@ -2149,16 +2176,34 @@ Dedupes an array of strings, returning an array that's guaranteed to contain
only one copy of a given string.
This method differs from `Array.unique()` in that it's optimized for use only
-with strings, whereas `unique` may be used with other types (but is slower).
-Using `dedupe()` with non-string values may result in unexpected behavior.
+with arrays consisting entirely of strings or entirely of numbers, whereas
+`unique` may be used with other value types (but is slower).
+
+Using `dedupe()` with values other than strings or numbers, or with arrays
+containing a mix of strings and numbers, may result in unexpected behavior.
@method dedupe
-@param {String[]} array Array of strings to dedupe.
-@return {Array} Deduped copy of _array_.
+@param {String[]|Number[]} array Array of strings or numbers to dedupe.
+@return {Array} Copy of _array_ containing no duplicate values.
@static
@since 3.4.0
**/
-YArray.dedupe = function (array) {
+YArray.dedupe = Lang._isNative(Object.create) ? function (array) {
+ var hash = Object.create(null),
+ results = [],
+ i, item, len;
+
+ for (i = 0, len = array.length; i < len; ++i) {
+ item = array[i];
+
+ if (!hash[item]) {
+ hash[item] = 1;
+ results.push(item);
+ }
+ }
+
+ return results;
+} : function (array) {
var hash = {},
results = [],
i, item, len;
@@ -2800,7 +2845,7 @@ hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
/**
* `true` if this browser incorrectly considers the `prototype` property of
- * functions to be enumerable. Currently known to affect Opera 11.50.
+ * functions to be enumerable. Currently known to affect Opera 11.50 and Android 2.3.x.
*
* @property _hasProtoEnumBug
* @type Boolean
@@ -2844,7 +2889,9 @@ O.hasKey = owns;
* as the order in which they were defined.
*
* This method is an alias for the native ES5 `Object.keys()` method if
- * available.
+ * available and non-buggy. The Opera 11.50 and Android 2.3.x versions of
+ * `Object.keys()` have an inconsistency as they consider `prototype` to be
+ * enumerable, so a non-native shim is used to rectify the difference.
*
* @example
*
@@ -2856,7 +2903,7 @@ O.hasKey = owns;
* @return {String[]} Array of keys.
* @static
*/
-O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {
+O.keys = Lang._isNative(Object.keys) && !hasProtoEnumBug ? Object.keys : function (obj) {
if (!Lang.isObject(obj)) {
throw new TypeError('Object.keys called on a non-object');
}
@@ -3463,17 +3510,25 @@ YUI.Env.parseUA = function(subUA) {
}
}
- m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);
- if (m && m[1] && m[2]) {
- o.chrome = numberify(m[2]); // Chrome
- o.safari = 0; //Reset safari back to 0
- if (m[1] === 'CrMo') {
- o.mobile = 'chrome';
- }
+ m = ua.match(/OPR\/(\d+\.\d+)/);
+
+ if (m && m[1]) {
+ // Opera 15+ with Blink (pretends to be both Chrome and Safari)
+ o.opera = numberify(m[1]);
} else {
- m = ua.match(/AdobeAIR\/([^\s]*)/);
- if (m) {
- o.air = m[0]; // Adobe AIR 1.0 or better
+ m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);
+
+ if (m && m[1] && m[2]) {
+ o.chrome = numberify(m[2]); // Chrome
+ o.safari = 0; //Reset safari back to 0
+ if (m[1] === 'CrMo') {
+ o.mobile = 'chrome';
+ }
+ } else {
+ m = ua.match(/AdobeAIR\/([^\s]*)/);
+ if (m) {
+ o.air = m[0]; // Adobe AIR 1.0 or better
+ }
}
}
}
@@ -3503,16 +3558,21 @@ YUI.Env.parseUA = function(subUA) {
o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
}
} else { // not opera or webkit
- m = ua.match(/MSIE\s([^;]*)/);
- if (m && m[1]) {
- o.ie = numberify(m[1]);
+ m = ua.match(/MSIE ([^;]*)|Trident.*; rv:([0-9.]+)/);
+
+ if (m && (m[1] || m[2])) {
+ o.ie = numberify(m[1] || m[2]);
} else { // not opera, webkit, or ie
m = ua.match(/Gecko\/([^\s]*)/);
+
if (m) {
o.gecko = 1; // Gecko detected, look for revision
m = ua.match(/rv:([^\s\)]*)/);
if (m && m[1]) {
o.gecko = numberify(m[1]);
+ if (/Mobile|Tablet/.test(ua)) {
+ o.mobile = "ffos";
+ }
}
}
}
@@ -3643,7 +3703,7 @@ YUI.Env.aliases = {
};
-}, '3.9.1', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
+}, '3.12.0', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
YUI.add('get', function (Y, NAME) {
/*jslint boss:true, expr:true, laxbreak: true */
@@ -4917,7 +4977,7 @@ Transaction.prototype = {
};
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('features', function (Y, NAME) {
var feature_tests = {};
@@ -5325,7 +5385,7 @@ add('load', '22', {
"when": "after"
});
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('intl-base', function (Y, NAME) {
/**
@@ -5413,7 +5473,7 @@ Y.mix(Y.namespace('Intl'), {
});
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('yui-log', function (Y, NAME) {
/**
@@ -5429,9 +5489,9 @@ var INSTANCE = Y,
LOGEVENT = 'yui:log',
UNDEFINED = 'undefined',
LEVELS = { debug: 1,
- info: 1,
- warn: 1,
- error: 1 };
+ info: 2,
+ warn: 4,
+ error: 8 };
/**
* If the 'debug' config is true, a 'yui:log' event will be
@@ -5453,7 +5513,7 @@ var INSTANCE = Y,
* @return {YUI} YUI instance.
*/
INSTANCE.log = function(msg, cat, src, silent) {
- var bail, excl, incl, m, f,
+ var bail, excl, incl, m, f, minlevel,
Y = INSTANCE,
c = Y.config,
publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
@@ -5472,6 +5532,15 @@ INSTANCE.log = function(msg, cat, src, silent) {
} else if (excl && (src in excl)) {
bail = excl[src];
}
+
+ // Determine the current minlevel as defined in configuration
+ Y.config.logLevel = Y.config.logLevel || 'debug';
+ minlevel = LEVELS[Y.config.logLevel.toLowerCase()];
+
+ if (cat in LEVELS && LEVELS[cat] < minlevel) {
+ // Skip this message if the we don't meet the defined minlevel
+ bail = 1;
+ }
}
if (!bail) {
if (c.useBrowserConsole) {
@@ -5524,7 +5593,7 @@ INSTANCE.message = function() {
};
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('yui-later', function (Y, NAME) {
/**
@@ -5602,8 +5671,8 @@ Y.Lang.later = Y.later;
-}, '3.9.1', {"requires": ["yui-base"]});
-YUI.add('yui', function (Y, NAME) {}, '3.9.1', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
+}, '3.12.0', {"requires": ["yui-base"]});
+YUI.add('yui', function (Y, NAME) {}, '3.12.0', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
YUI.add('oop', function (Y, NAME) {
/**
@@ -5839,56 +5908,66 @@ Y.some = function(o, f, c, proto) {
};
/**
- * Deep object/array copy. Function clones are actually
- * wrappers around the original function.
- * Array-like objects are treated as arrays.
- * Primitives are returned untouched. Optionally, a
- * function can be provided to handle other data types,
- * filter keys, validate values, etc.
- *
- * NOTE: Cloning a non-trivial object is a reasonably heavy operation, due to
- * the need to recurrsively iterate down non-primitive properties. Clone
- * should be used only when a deep clone down to leaf level properties
- * is explicitly required.
- *
- * In many cases (for example, when trying to isolate objects used as
- * hashes for configuration properties), a shallow copy, using Y.merge is
- * normally sufficient. If more than one level of isolation is required,
- * Y.merge can be used selectively at each level which needs to be
- * isolated from the original without going all the way to leaf properties.
- *
- * @method clone
- * @param {object} o what to clone.
- * @param {boolean} safe if true, objects will not have prototype
- * items from the source. If false, they will. In this case, the
- * original is initially protected, but the clone is not completely
- * immune from changes to the source object prototype. Also, cloned
- * prototype items that are deleted from the clone will result
- * in the value of the source prototype being exposed. If operating
- * on a non-safe clone, items should be nulled out rather than deleted.
- * @param {function} f optional function to apply to each item in a
- * collection; it will be executed prior to applying the value to
- * the new object. Return false to prevent the copy.
- * @param {object} c optional execution context for f.
- * @param {object} owner Owner object passed when clone is iterating
- * an object. Used to set up context for cloned functions.
- * @param {object} cloned hash of previously cloned objects to avoid
- * multiple clones.
- * @return {Array|Object} the cloned object.
- */
+Deep object/array copy. Function clones are actually wrappers around the
+original function. Array-like objects are treated as arrays. Primitives are
+returned untouched. Optionally, a function can be provided to handle other data
+types, filter keys, validate values, etc.
+
+**Note:** Cloning a non-trivial object is a reasonably heavy operation, due to
+the need to recursively iterate down non-primitive properties. Clone should be
+used only when a deep clone down to leaf level properties is explicitly
+required. This method will also
+
+In many cases (for example, when trying to isolate objects used as hashes for
+configuration properties), a shallow copy, using `Y.merge()` is normally
+sufficient. If more than one level of isolation is required, `Y.merge()` can be
+used selectively at each level which needs to be isolated from the original
+without going all the way to leaf properties.
+
+@method clone
+@param {object} o what to clone.
+@param {boolean} safe if true, objects will not have prototype items from the
+ source. If false, they will. In this case, the original is initially
+ protected, but the clone is not completely immune from changes to the source
+ object prototype. Also, cloned prototype items that are deleted from the
+ clone will result in the value of the source prototype being exposed. If
+ operating on a non-safe clone, items should be nulled out rather than
+ deleted.
+@param {function} f optional function to apply to each item in a collection; it
+ will be executed prior to applying the value to the new object.
+ Return false to prevent the copy.
+@param {object} c optional execution context for f.
+@param {object} owner Owner object passed when clone is iterating an object.
+ Used to set up context for cloned functions.
+@param {object} cloned hash of previously cloned objects to avoid multiple
+ clones.
+@return {Array|Object} the cloned object.
+**/
Y.clone = function(o, safe, f, c, owner, cloned) {
+ var o2, marked, stamp;
+
+ // Does not attempt to clone:
+ //
+ // * Non-typeof-object values, "primitive" values don't need cloning.
+ //
+ // * YUI instances, cloning complex object like YUI instances is not
+ // advised, this is like cloning the world.
+ //
+ // * DOM nodes (#2528250), common host objects like DOM nodes cannot be
+ // "subclassed" in Firefox and old versions of IE. Trying to use
+ // `Object.create()` or `Y.extend()` on a DOM node will throw an error in
+ // these browsers.
+ //
+ // Instad, the passed-in `o` will be return as-is when it matches one of the
+ // above criteria.
+ if (!L.isObject(o) ||
+ Y.instanceOf(o, YUI) ||
+ (o.addEventListener || o.attachEvent)) {
- if (!L.isObject(o)) {
return o;
}
- // @todo cloning YUI instances doesn't currently work
- if (Y.instanceOf(o, YUI)) {
- return o;
- }
-
- var o2, marked = cloned || {}, stamp,
- yeach = Y.each;
+ marked = cloned || {};
switch (L.type(o)) {
case 'date':
@@ -5919,23 +5998,20 @@ Y.clone = function(o, safe, f, c, owner, cloned) {
marked[stamp] = o;
}
- // #2528250 don't try to clone element properties
- if (!o.addEventListener && !o.attachEvent) {
- yeach(o, function(v, k) {
-if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {
- if (k !== CLONE_MARKER) {
- if (k == 'prototype') {
- // skip the prototype
- // } else if (o[k] === o) {
- // this[k] = this;
- } else {
- this[k] =
- Y.clone(v, safe, f, c, owner || o, marked);
- }
+ Y.each(o, function(v, k) {
+ if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {
+ if (k !== CLONE_MARKER) {
+ if (k == 'prototype') {
+ // skip the prototype
+ // } else if (o[k] === o) {
+ // this[k] = this;
+ } else {
+ this[k] =
+ Y.clone(v, safe, f, c, owner || o, marked);
}
}
- }, o2);
- }
+ }
+ }, o2);
if (!cloned) {
Y.Object.each(marked, function(v, k) {
@@ -5953,7 +6029,6 @@ if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {
return o2;
};
-
/**
* Returns a function that will execute the supplied function in the
* supplied object's context, optionally adding any additional
@@ -6004,7 +6079,7 @@ Y.rbind = function(f, c) {
};
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('features', function (Y, NAME) {
var feature_tests = {};
@@ -6412,7 +6487,7 @@ add('load', '22', {
"when": "after"
});
-}, '3.9.1', {"requires": ["yui-base"]});
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('dom-core', function (Y, NAME) {
var NODE_TYPE = 'nodeType',
@@ -6801,7 +6876,7 @@ Y_DOM = {
Y.DOM = Y_DOM;
-}, '3.9.1', {"requires": ["oop", "features"]});
+}, '3.12.0', {"requires": ["oop", "features"]});
YUI.add('dom-base', function (Y, NAME) {
/**
@@ -7485,7 +7560,499 @@ Y.mix(Y.DOM, {
});
-}, '3.9.1', {"requires": ["dom-core"]});
+}, '3.12.0', {"requires": ["dom-core"]});
+YUI.add('color-base', function (Y, NAME) {
+
+/**
+Color provides static methods for color conversion.
+
+ Y.Color.toRGB('f00'); // rgb(255, 0, 0)
+
+ Y.Color.toHex('rgb(255, 255, 0)'); // #ffff00
+
+@module color
+@submodule color-base
+@class Color
+@since 3.8.0
+**/
+
+var REGEX_HEX = /^#?([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})(\ufffe)?/,
+ REGEX_HEX3 = /^#?([\da-fA-F]{1})([\da-fA-F]{1})([\da-fA-F]{1})(\ufffe)?/,
+ REGEX_RGB = /rgba?\(([\d]{1,3}), ?([\d]{1,3}), ?([\d]{1,3}),? ?([.\d]*)?\)/,
+ TYPES = { 'HEX': 'hex', 'RGB': 'rgb', 'RGBA': 'rgba' },
+ CONVERTS = { 'hex': 'toHex', 'rgb': 'toRGB', 'rgba': 'toRGBA' };
+
+
+Y.Color = {
+ /**
+ @static
+ @property KEYWORDS
+ @type Object
+ @since 3.8.0
+ **/
+ KEYWORDS: {
+ 'black': '000', 'silver': 'c0c0c0', 'gray': '808080', 'white': 'fff',
+ 'maroon': '800000', 'red': 'f00', 'purple': '800080', 'fuchsia': 'f0f',
+ 'green': '008000', 'lime': '0f0', 'olive': '808000', 'yellow': 'ff0',
+ 'navy': '000080', 'blue': '00f', 'teal': '008080', 'aqua': '0ff'
+ },
+
+ /**
+ NOTE: `(\ufffe)?` is added to the Regular Expression to carve out a
+ place for the alpha channel that is returned from toArray
+ without compromising any usage of the Regular Expression
+
+ @static
+ @property REGEX_HEX
+ @type RegExp
+ @default /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})(\ufffe)?/
+ @since 3.8.0
+ **/
+ REGEX_HEX: REGEX_HEX,
+
+ /**
+ NOTE: `(\ufffe)?` is added to the Regular Expression to carve out a
+ place for the alpha channel that is returned from toArray
+ without compromising any usage of the Regular Expression
+
+ @static
+ @property REGEX_HEX3
+ @type RegExp
+ @default /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})(\ufffe)?/
+ @since 3.8.0
+ **/
+ REGEX_HEX3: REGEX_HEX3,
+
+ /**
+ @static
+ @property REGEX_RGB
+ @type RegExp
+ @default /rgba?\(([0-9]{1,3}), ?([0-9]{1,3}), ?([0-9]{1,3}),? ?([.0-9]{1,3})?\)/
+ @since 3.8.0
+ **/
+ REGEX_RGB: REGEX_RGB,
+
+ re_RGB: REGEX_RGB,
+
+ re_hex: REGEX_HEX,
+
+ re_hex3: REGEX_HEX3,
+
+ /**
+ @static
+ @property STR_HEX
+ @type String
+ @default #{*}{*}{*}
+ @since 3.8.0
+ **/
+ STR_HEX: '#{*}{*}{*}',
+
+ /**
+ @static
+ @property STR_RGB
+ @type String
+ @default rgb({*}, {*}, {*})
+ @since 3.8.0
+ **/
+ STR_RGB: 'rgb({*}, {*}, {*})',
+
+ /**
+ @static
+ @property STR_RGBA
+ @type String
+ @default rgba({*}, {*}, {*}, {*})
+ @since 3.8.0
+ **/
+ STR_RGBA: 'rgba({*}, {*}, {*}, {*})',
+
+ /**
+ @static
+ @property TYPES
+ @type Object
+ @default {'rgb':'rgb', 'rgba':'rgba'}
+ @since 3.8.0
+ **/
+ TYPES: TYPES,
+
+ /**
+ @static
+ @property CONVERTS
+ @type Object
+ @default {}
+ @since 3.8.0
+ **/
+ CONVERTS: CONVERTS,
+
+ /**
+ Converts the provided string to the provided type.
+ You can use the `Y.Color.TYPES` to get a valid `to` type.
+ If the color cannot be converted, the original color will be returned.
+
+ @public
+ @method convert
+ @param {String} str
+ @param {String} to
+ @return {String}
+ @since 3.8.0
+ **/
+ convert: function (str, to) {
+ var convert = Y.Color.CONVERTS[to.toLowerCase()],
+ clr = str;
+
+ if (convert && Y.Color[convert]) {
+ clr = Y.Color[convert](str);
+ }
+
+ return clr;
+ },
+
+ /**
+ Converts provided color value to a hex value string
+
+ @public
+ @method toHex
+ @param {String} str Hex or RGB value string
+ @return {String} returns array of values or CSS string if options.css is true
+ @since 3.8.0
+ **/
+ toHex: function (str) {
+ var clr = Y.Color._convertTo(str, 'hex'),
+ isTransparent = clr.toLowerCase() === 'transparent';
+
+ if (clr.charAt(0) !== '#' && !isTransparent) {
+ clr = '#' + clr;
+ }
+
+ return isTransparent ? clr.toLowerCase() : clr.toUpperCase();
+ },
+
+ /**
+ Converts provided color value to an RGB value string
+ @public
+ @method toRGB
+ @param {String} str Hex or RGB value string
+ @return {String}
+ @since 3.8.0
+ **/
+ toRGB: function (str) {
+ var clr = Y.Color._convertTo(str, 'rgb');
+ return clr.toLowerCase();
+ },
+
+ /**
+ Converts provided color value to an RGB value string
+ @public
+ @method toRGBA
+ @param {String} str Hex or RGB value string
+ @return {String}
+ @since 3.8.0
+ **/
+ toRGBA: function (str) {
+ var clr = Y.Color._convertTo(str, 'rgba' );
+ return clr.toLowerCase();
+ },
+
+ /**
+ Converts the provided color string to an array of values where the
+ last value is the alpha value. Will return an empty array if
+ the provided string is not able to be parsed.
+
+ NOTE: `(\ufffe)?` is added to `HEX` and `HEX3` Regular Expressions to
+ carve out a place for the alpha channel that is returned from
+ toArray without compromising any usage of the Regular Expression
+
+ Y.Color.toArray('fff'); // ['ff', 'ff', 'ff', 1]
+ Y.Color.toArray('rgb(0, 0, 0)'); // ['0', '0', '0', 1]
+ Y.Color.toArray('rgba(0, 0, 0, 0)'); // ['0', '0', '0', 1]
+
+
+
+ @public
+ @method toArray
+ @param {String} str
+ @return {Array}
+ @since 3.8.0
+ **/
+ toArray: function(str) {
+ // parse with regex and return "matches" array
+ var type = Y.Color.findType(str).toUpperCase(),
+ regex,
+ arr,
+ length,
+ lastItem;
+
+ if (type === 'HEX' && str.length < 5) {
+ type = 'HEX3';
+ }
+
+ if (type.charAt(type.length - 1) === 'A') {
+ type = type.slice(0, -1);
+ }
+
+ regex = Y.Color['REGEX_' + type];
+
+ if (regex) {
+ arr = regex.exec(str) || [];
+ length = arr.length;
+
+ if (length) {
+
+ arr.shift();
+ length--;
+
+ if (type === 'HEX3') {
+ arr[0] += arr[0];
+ arr[1] += arr[1];
+ arr[2] += arr[2];
+ }
+
+ lastItem = arr[length - 1];
+ if (!lastItem) {
+ arr[length - 1] = 1;
+ }
+ }
+ }
+
+ return arr;
+
+ },
+
+ /**
+ Converts the array of values to a string based on the provided template.
+ @public
+ @method fromArray
+ @param {Array} arr
+ @param {String} template
+ @return {String}
+ @since 3.8.0
+ **/
+ fromArray: function(arr, template) {
+ arr = arr.concat();
+
+ if (typeof template === 'undefined') {
+ return arr.join(', ');
+ }
+
+ var replace = '{*}';
+
+ template = Y.Color['STR_' + template.toUpperCase()];
+
+ if (arr.length === 3 && template.match(/\{\*\}/g).length === 4) {
+ arr.push(1);
+ }
+
+ while ( template.indexOf(replace) >= 0 && arr.length > 0) {
+ template = template.replace(replace, arr.shift());
+ }
+
+ return template;
+ },
+
+ /**
+ Finds the value type based on the str value provided.
+ @public
+ @method findType
+ @param {String} str
+ @return {String}
+ @since 3.8.0
+ **/
+ findType: function (str) {
+ if (Y.Color.KEYWORDS[str]) {
+ return 'keyword';
+ }
+
+ var index = str.indexOf('('),
+ key;
+
+ if (index > 0) {
+ key = str.substr(0, index);
+ }
+
+ if (key && Y.Color.TYPES[key.toUpperCase()]) {
+ return Y.Color.TYPES[key.toUpperCase()];
+ }
+
+ return 'hex';
+
+ }, // return 'keyword', 'hex', 'rgb'
+
+ /**
+ Retrives the alpha channel from the provided string. If no alpha
+ channel is present, `1` will be returned.
+ @protected
+ @method _getAlpha
+ @param {String} clr
+ @return {Number}
+ @since 3.8.0
+ **/
+ _getAlpha: function (clr) {
+ var alpha,
+ arr = Y.Color.toArray(clr);
+
+ if (arr.length > 3) {
+ alpha = arr.pop();
+ }
+
+ return +alpha || 1;
+ },
+
+ /**
+ Returns the hex value string if found in the KEYWORDS object
+ @protected
+ @method _keywordToHex
+ @param {String} clr
+ @return {String}
+ @since 3.8.0
+ **/
+ _keywordToHex: function (clr) {
+ var keyword = Y.Color.KEYWORDS[clr];
+
+ if (keyword) {
+ return keyword;
+ }
+ },
+
+ /**
+ Converts the provided color string to the value type provided as `to`
+ @protected
+ @method _convertTo
+ @param {String} clr
+ @param {String} to
+ @return {String}
+ @since 3.8.0
+ **/
+ _convertTo: function(clr, to) {
+
+ if (clr === 'transparent') {
+ return clr;
+ }
+
+ var from = Y.Color.findType(clr),
+ originalTo = to,
+ needsAlpha,
+ alpha,
+ method,
+ ucTo;
+
+ if (from === 'keyword') {
+ clr = Y.Color._keywordToHex(clr);
+ from = 'hex';
+ }
+
+ if (from === 'hex' && clr.length < 5) {
+ if (clr.charAt(0) === '#') {
+ clr = clr.substr(1);
+ }
+
+ clr = '#' + clr.charAt(0) + clr.charAt(0) +
+ clr.charAt(1) + clr.charAt(1) +
+ clr.charAt(2) + clr.charAt(2);
+ }
+
+ if (from === to) {
+ return clr;
+ }
+
+ if (from.charAt(from.length - 1) === 'a') {
+ from = from.slice(0, -1);
+ }
+
+ needsAlpha = (to.charAt(to.length - 1) === 'a');
+ if (needsAlpha) {
+ to = to.slice(0, -1);
+ alpha = Y.Color._getAlpha(clr);
+ }
+
+ ucTo = to.charAt(0).toUpperCase() + to.substr(1).toLowerCase();
+ method = Y.Color['_' + from + 'To' + ucTo ];
+
+ // check to see if need conversion to rgb first
+ // check to see if there is a direct conversion method
+ // convertions are: hex <-> rgb <-> hsl
+ if (!method) {
+ if (from !== 'rgb' && to !== 'rgb') {
+ clr = Y.Color['_' + from + 'ToRgb'](clr);
+ from = 'rgb';
+ method = Y.Color['_' + from + 'To' + ucTo ];
+ }
+ }
+
+ if (method) {
+ clr = ((method)(clr, needsAlpha));
+ }
+
+ // process clr from arrays to strings after conversions if alpha is needed
+ if (needsAlpha) {
+ if (!Y.Lang.isArray(clr)) {
+ clr = Y.Color.toArray(clr);
+ }
+ clr.push(alpha);
+ clr = Y.Color.fromArray(clr, originalTo.toUpperCase());
+ }
+
+ return clr;
+ },
+
+ /**
+ Processes the hex string into r, g, b values. Will return values as
+ an array, or as an rgb string.
+ @protected
+ @method _hexToRgb
+ @param {String} str
+ @param {Boolean} [toArray]
+ @return {String|Array}
+ @since 3.8.0
+ **/
+ _hexToRgb: function (str, toArray) {
+ var r, g, b;
+
+ /*jshint bitwise:false*/
+ if (str.charAt(0) === '#') {
+ str = str.substr(1);
+ }
+
+ str = parseInt(str, 16);
+
+ r = str >> 16;
+ g = str >> 8 & 0xFF;
+ b = str & 0xFF;
+
+ if (toArray) {
+ return [r, g, b];
+ }
+
+ return 'rgb(' + r + ', ' + g + ', ' + b + ')';
+ },
+
+ /**
+ Processes the rgb string into r, g, b values. Will return values as
+ an array, or as a hex string.
+ @protected
+ @method _rgbToHex
+ @param {String} str
+ @param {Boolean} [toArray]
+ @return {String|Array}
+ @since 3.8.0
+ **/
+ _rgbToHex: function (str) {
+ /*jshint bitwise:false*/
+ var rgb = Y.Color.toArray(str),
+ hex = rgb[2] | (rgb[1] << 8) | (rgb[0] << 16);
+
+ hex = (+hex).toString(16);
+
+ while (hex.length < 6) {
+ hex = '0' + hex;
+ }
+
+ return '#' + hex;
+ }
+
+};
+
+
+
+}, '3.12.0', {"requires": ["yui-base"]});
YUI.add('dom-style', function (Y, NAME) {
(function(Y) {
@@ -7749,83 +8316,9 @@ Y_DOM.CUSTOM_STYLES.transformOrigin = {
})(Y);
-(function(Y) {
-var PARSE_INT = parseInt,
- RE = RegExp;
-
-Y.Color = {
- KEYWORDS: {
- black: '000',
- silver: 'c0c0c0',
- gray: '808080',
- white: 'fff',
- maroon: '800000',
- red: 'f00',
- purple: '800080',
- fuchsia: 'f0f',
- green: '008000',
- lime: '0f0',
- olive: '808000',
- yellow: 'ff0',
- navy: '000080',
- blue: '00f',
- teal: '008080',
- aqua: '0ff'
- },
-
- re_RGB: /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
- re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
- re_hex3: /([0-9A-F])/gi,
-
- toRGB: function(val) {
- if (!Y.Color.re_RGB.test(val)) {
- val = Y.Color.toHex(val);
- }
-
- if(Y.Color.re_hex.exec(val)) {
- val = 'rgb(' + [
- PARSE_INT(RE.$1, 16),
- PARSE_INT(RE.$2, 16),
- PARSE_INT(RE.$3, 16)
- ].join(', ') + ')';
- }
- return val;
- },
-
- toHex: function(val) {
- val = Y.Color.KEYWORDS[val] || val;
- if (Y.Color.re_RGB.exec(val)) {
- val = [
- Number(RE.$1).toString(16),
- Number(RE.$2).toString(16),
- Number(RE.$3).toString(16)
- ];
-
- for (var i = 0; i < val.length; i++) {
- if (val[i].length < 2) {
- val[i] = '0' + val[i];
- }
- }
-
- val = val.join('');
- }
-
- if (val.length < 6) {
- val = val.replace(Y.Color.re_hex3, '$1$1');
- }
-
- if (val !== 'transparent' && val.indexOf('#') < 0) {
- val = '#' + val;
- }
-
- return val.toUpperCase();
- }
-};
-})(Y);
-
-}, '3.9.1', {"requires": ["dom-base"]});
+}, '3.12.0', {"requires": ["dom-base", "color-base"]});
YUI.add('dom-style-ie', function (Y, NAME) {
(function(Y) {
@@ -8128,7 +8621,7 @@ if (!testFeature('style', 'computedStyle')) {
})(Y);
-}, '3.9.1', {"requires": ["dom-style"]});
+}, '3.12.0', {"requires": ["dom-style"]});
YUI.add('dom-screen', function (Y, NAME) {
(function(Y) {
@@ -8733,7 +9226,7 @@ Y.mix(DOM, {
})(Y);
-}, '3.9.1', {"requires": ["dom-base", "dom-style"]});
+}, '3.12.0', {"requires": ["dom-base", "dom-style"]});
YUI.add('selector-native', function (Y, NAME) {
(function(Y) {
@@ -8974,8 +9467,11 @@ var Selector = {
},
_nativeQuery: function(selector, root, one) {
- if (Y.UA.webkit && selector.indexOf(':checked') > -1 &&
- (Y.Selector.pseudos && Y.Selector.pseudos.checked)) { // webkit (chrome, safari) fails to pick up "selected" with "checked"
+ if (
+ (Y.UA.webkit || Y.UA.opera) && // webkit (chrome, safari) and Opera
+ selector.indexOf(':checked') > -1 && // fail to pick up "selected" with ":checked"
+ (Y.Selector.pseudos && Y.Selector.pseudos.checked)
+ ) {
return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query
}
try {
@@ -9103,12 +9599,12 @@ Y.mix(Y.Selector, Selector, true);
})(Y);
-}, '3.9.1', {"requires": ["dom-base"]});
+}, '3.12.0', {"requires": ["dom-base"]});
YUI.add('selector', function (Y, NAME) {
-}, '3.9.1', {"requires": ["selector-native"]});
+}, '3.12.0', {"requires": ["selector-native"]});
YUI.add('event-custom-base', function (Y, NAME) {
/**
@@ -9146,12 +9642,12 @@ DO = {
* Cache of objects touched by the utility
* @property objs
* @static
- * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
- * replaces the role of this property, but is considered to be private, and
+ * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
+ * replaces the role of this property, but is considered to be private, and
* is only mentioned to provide a migration path.
- *
- * If you have a use case which warrants migration to the _yuiaop property,
- * please file a ticket to let us know what it's used for and we can see if
+ *
+ * If you have a use case which warrants migration to the _yuiaop property,
+ * please file a ticket to let us know what it's used for and we can see if
* we need to expose hooks for that functionality more formally.
*/
objs: null,
@@ -9285,9 +9781,6 @@ DO = {
if (handle.detach) {
handle.detach();
}
- },
-
- _unload: function(e, me) {
}
};
@@ -9413,10 +9906,10 @@ DO.Method.prototype.exec = function () {
if (af.hasOwnProperty(i)) {
newRet = af[i].apply(this.obj, args);
// Stop processing if a Halt object is returned
- if (newRet && newRet.constructor == DO.Halt) {
+ if (newRet && newRet.constructor === DO.Halt) {
return newRet.retVal;
// Check for a new return value
- } else if (newRet && newRet.constructor == DO.AlterReturn) {
+ } else if (newRet && newRet.constructor === DO.AlterReturn) {
ret = newRet.newRetVal;
// Update the static retval state
DO.currentRetVal = ret;
@@ -9501,9 +9994,6 @@ DO.Error = DO.Halt;
//////////////////////////////////////////////////////////////////////////
-// Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do);
-
-
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
@@ -9541,7 +10031,7 @@ var YArray = Y.Array,
CONFIGS_HASH = YArray.hash(CONFIGS),
- nativeSlice = Array.prototype.slice,
+ nativeSlice = Array.prototype.slice,
YUI3_SIGNATURE = 9,
YUI_LOG = 'yui:log',
@@ -9550,7 +10040,7 @@ var YArray = Y.Array,
var p;
for (p in s) {
- if (CONFIGS_HASH[p] && (ov || !(p in r))) {
+ if (CONFIGS_HASH[p] && (ov || !(p in r))) {
r[p] = s[p];
}
}
@@ -9564,258 +10054,69 @@ var YArray = Y.Array,
*
* @param {String} type The type of event, which is passed to the callback
* when the event fires.
- * @param {object} o configuration object.
+ * @param {object} defaults configuration object.
* @class CustomEvent
* @constructor
*/
-Y.CustomEvent = function(type, o) {
+
+ /**
+ * The type of event, returned to subscribers when the event fires
+ * @property type
+ * @type string
+ */
+
+/**
+ * By default all custom events are logged in the debug build, set silent
+ * to true to disable debug outpu for this event.
+ * @property silent
+ * @type boolean
+ */
+
+Y.CustomEvent = function(type, defaults) {
this._kds = Y.CustomEvent.keepDeprecatedSubs;
- o = o || {};
+ this.id = Y.guid();
- this.id = Y.stamp(this);
-
- /**
- * The type of event, returned to subscribers when the event fires
- * @property type
- * @type string
- */
this.type = type;
+ this.silent = this.logSystem = (type === YUI_LOG);
- /**
- * The context the the event will fire from by default. Defaults to the YUI
- * instance.
- * @property context
- * @type object
- */
- this.context = Y;
-
- /**
- * Monitor when an event is attached or detached.
- *
- * @property monitored
- * @type boolean
- */
- // this.monitored = false;
-
- this.logSystem = (type == YUI_LOG);
-
- /**
- * If 0, this event does not broadcast. If 1, the YUI instance is notified
- * every time this event fires. If 2, the YUI instance and the YUI global
- * (if event is enabled on the global) are notified every time this event
- * fires.
- * @property broadcast
- * @type int
- */
- // this.broadcast = 0;
-
- /**
- * By default all custom events are logged in the debug build, set silent
- * to true to disable debug outpu for this event.
- * @property silent
- * @type boolean
- */
- this.silent = this.logSystem;
-
- /**
- * Specifies whether this event should be queued when the host is actively
- * processing an event. This will effect exectution order of the callbacks
- * for the various events.
- * @property queuable
- * @type boolean
- * @default false
- */
- // this.queuable = false;
-
- /**
- * The subscribers to this event
- * @property subscribers
- * @type Subscriber {}
- * @deprecated
- */
if (this._kds) {
+ /**
+ * The subscribers to this event
+ * @property subscribers
+ * @type Subscriber {}
+ * @deprecated
+ */
+
+ /**
+ * 'After' subscribers
+ * @property afters
+ * @type Subscriber {}
+ * @deprecated
+ */
this.subscribers = {};
- }
-
- /**
- * The subscribers to this event
- * @property _subscribers
- * @type Subscriber []
- * @private
- */
- this._subscribers = [];
-
- /**
- * 'After' subscribers
- * @property afters
- * @type Subscriber {}
- */
- if (this._kds) {
this.afters = {};
}
- /**
- * 'After' subscribers
- * @property _afters
- * @type Subscriber []
- * @private
- */
- this._afters = [];
-
- /**
- * This event has fired if true
- *
- * @property fired
- * @type boolean
- * @default false;
- */
- // this.fired = false;
-
- /**
- * An array containing the arguments the custom event
- * was last fired with.
- * @property firedWith
- * @type Array
- */
- // this.firedWith;
-
- /**
- * This event should only fire one time if true, and if
- * it has fired, any new subscribers should be notified
- * immediately.
- *
- * @property fireOnce
- * @type boolean
- * @default false;
- */
- // this.fireOnce = false;
-
- /**
- * fireOnce listeners will fire syncronously unless async
- * is set to true
- * @property async
- * @type boolean
- * @default false
- */
- //this.async = false;
-
- /**
- * Flag for stopPropagation that is modified during fire()
- * 1 means to stop propagation to bubble targets. 2 means
- * to also stop additional subscribers on this target.
- * @property stopped
- * @type int
- */
- // this.stopped = 0;
-
- /**
- * Flag for preventDefault that is modified during fire().
- * if it is not 0, the default behavior for this event
- * @property prevented
- * @type int
- */
- // this.prevented = 0;
-
- /**
- * Specifies the host for this custom event. This is used
- * to enable event bubbling
- * @property host
- * @type EventTarget
- */
- // this.host = null;
-
- /**
- * The default function to execute after event listeners
- * have fire, but only if the default action was not
- * prevented.
- * @property defaultFn
- * @type Function
- */
- // this.defaultFn = null;
-
- /**
- * The function to execute if a subscriber calls
- * stopPropagation or stopImmediatePropagation
- * @property stoppedFn
- * @type Function
- */
- // this.stoppedFn = null;
-
- /**
- * The function to execute if a subscriber calls
- * preventDefault
- * @property preventedFn
- * @type Function
- */
- // this.preventedFn = null;
-
- /**
- * Specifies whether or not this event's default function
- * can be cancelled by a subscriber by executing preventDefault()
- * on the event facade
- * @property preventable
- * @type boolean
- * @default true
- */
- this.preventable = true;
-
- /**
- * Specifies whether or not a subscriber can stop the event propagation
- * via stopPropagation(), stopImmediatePropagation(), or halt()
- *
- * Events can only bubble if emitFacade is true.
- *
- * @property bubbles
- * @type boolean
- * @default true
- */
- this.bubbles = true;
-
- /**
- * Supports multiple options for listener signatures in order to
- * port YUI 2 apps.
- * @property signature
- * @type int
- * @default 9
- */
- this.signature = YUI3_SIGNATURE;
-
- // this.subCount = 0;
- // this.afterCount = 0;
-
- // this.hasSubscribers = false;
- // this.hasAfters = false;
-
- /**
- * If set to true, the custom event will deliver an EventFacade object
- * that is similar to a DOM event object.
- * @property emitFacade
- * @type boolean
- * @default false
- */
- // this.emitFacade = false;
-
- this.applyConfig(o, true);
-
- // this.log("Creating " + this.type);
-
+ if (defaults) {
+ mixConfigs(this, defaults, true);
+ }
};
/**
* Static flag to enable population of the `subscribers`
* and `afters` properties held on a `CustomEvent` instance.
- *
- * These properties were changed to private properties (`_subscribers` and `_afters`), and
- * converted from objects to arrays for performance reasons.
*
- * Setting this property to true will populate the deprecated `subscribers` and `afters`
+ * These properties were changed to private properties (`_subscribers` and `_afters`), and
+ * converted from objects to arrays for performance reasons.
+ *
+ * Setting this property to true will populate the deprecated `subscribers` and `afters`
* properties for people who may be using them (which is expected to be rare). There will
* be a performance hit, compared to the new array based implementation.
*
* If you are using these deprecated properties for a use case which the public API
- * does not support, please file an enhancement request, and we can provide an alternate
+ * does not support, please file an enhancement request, and we can provide an alternate
* public implementation which doesn't have the performance cost required to maintiain the
* properties as objects.
*
@@ -9834,6 +10135,169 @@ Y.CustomEvent.prototype = {
constructor: Y.CustomEvent,
+ /**
+ * Monitor when an event is attached or detached.
+ *
+ * @property monitored
+ * @type boolean
+ */
+
+ /**
+ * If 0, this event does not broadcast. If 1, the YUI instance is notified
+ * every time this event fires. If 2, the YUI instance and the YUI global
+ * (if event is enabled on the global) are notified every time this event
+ * fires.
+ * @property broadcast
+ * @type int
+ */
+
+ /**
+ * Specifies whether this event should be queued when the host is actively
+ * processing an event. This will effect exectution order of the callbacks
+ * for the various events.
+ * @property queuable
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * This event has fired if true
+ *
+ * @property fired
+ * @type boolean
+ * @default false;
+ */
+
+ /**
+ * An array containing the arguments the custom event
+ * was last fired with.
+ * @property firedWith
+ * @type Array
+ */
+
+ /**
+ * This event should only fire one time if true, and if
+ * it has fired, any new subscribers should be notified
+ * immediately.
+ *
+ * @property fireOnce
+ * @type boolean
+ * @default false;
+ */
+
+ /**
+ * fireOnce listeners will fire syncronously unless async
+ * is set to true
+ * @property async
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * Flag for stopPropagation that is modified during fire()
+ * 1 means to stop propagation to bubble targets. 2 means
+ * to also stop additional subscribers on this target.
+ * @property stopped
+ * @type int
+ */
+
+ /**
+ * Flag for preventDefault that is modified during fire().
+ * if it is not 0, the default behavior for this event
+ * @property prevented
+ * @type int
+ */
+
+ /**
+ * Specifies the host for this custom event. This is used
+ * to enable event bubbling
+ * @property host
+ * @type EventTarget
+ */
+
+ /**
+ * The default function to execute after event listeners
+ * have fire, but only if the default action was not
+ * prevented.
+ * @property defaultFn
+ * @type Function
+ */
+
+ /**
+ * The function to execute if a subscriber calls
+ * stopPropagation or stopImmediatePropagation
+ * @property stoppedFn
+ * @type Function
+ */
+
+ /**
+ * The function to execute if a subscriber calls
+ * preventDefault
+ * @property preventedFn
+ * @type Function
+ */
+
+ /**
+ * The subscribers to this event
+ * @property _subscribers
+ * @type Subscriber []
+ * @private
+ */
+
+ /**
+ * 'After' subscribers
+ * @property _afters
+ * @type Subscriber []
+ * @private
+ */
+
+ /**
+ * If set to true, the custom event will deliver an EventFacade object
+ * that is similar to a DOM event object.
+ * @property emitFacade
+ * @type boolean
+ * @default false
+ */
+
+ /**
+ * Supports multiple options for listener signatures in order to
+ * port YUI 2 apps.
+ * @property signature
+ * @type int
+ * @default 9
+ */
+ signature : YUI3_SIGNATURE,
+
+ /**
+ * The context the the event will fire from by default. Defaults to the YUI
+ * instance.
+ * @property context
+ * @type object
+ */
+ context : Y,
+
+ /**
+ * Specifies whether or not this event's default function
+ * can be cancelled by a subscriber by executing preventDefault()
+ * on the event facade
+ * @property preventable
+ * @type boolean
+ * @default true
+ */
+ preventable : true,
+
+ /**
+ * Specifies whether or not a subscriber can stop the event propagation
+ * via stopPropagation(), stopImmediatePropagation(), or halt()
+ *
+ * Events can only bubble if emitFacade is true.
+ *
+ * @property bubbles
+ * @type boolean
+ * @default true
+ */
+ bubbles : true,
+
/**
* Returns the number of subscribers for this event as the sum of the on()
* subscribers and after() subscribers.
@@ -9842,15 +10306,35 @@ Y.CustomEvent.prototype = {
* @return Number
*/
hasSubs: function(when) {
- var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;
+ var s = 0,
+ a = 0,
+ subs = this._subscribers,
+ afters = this._afters,
+ sib = this.sibling;
+
+ if (subs) {
+ s = subs.length;
+ }
+
+ if (afters) {
+ a = afters.length;
+ }
if (sib) {
- s += sib._subscribers.length;
- a += sib._afters.length;
+ subs = sib._subscribers;
+ afters = sib._afters;
+
+ if (subs) {
+ s += subs.length;
+ }
+
+ if (afters) {
+ a += afters.length;
+ }
}
if (when) {
- return (when == 'after') ? a : s;
+ return (when === 'after') ? a : s;
}
return (s + a);
@@ -9878,12 +10362,47 @@ Y.CustomEvent.prototype = {
* @return {Array} first item is the on subscribers, second the after.
*/
getSubs: function() {
- var s = this._subscribers, a = this._afters, sib = this.sibling;
- s = (sib) ? s.concat(sib._subscribers) : s.concat();
- a = (sib) ? a.concat(sib._afters) : a.concat();
+ var sibling = this.sibling,
+ subs = this._subscribers,
+ afters = this._afters,
+ siblingSubs,
+ siblingAfters;
- return [s, a];
+ if (sibling) {
+ siblingSubs = sibling._subscribers;
+ siblingAfters = sibling._afters;
+ }
+
+ if (siblingSubs) {
+ if (subs) {
+ subs = subs.concat(siblingSubs);
+ } else {
+ subs = siblingSubs.concat();
+ }
+ } else {
+ if (subs) {
+ subs = subs.concat();
+ } else {
+ subs = [];
+ }
+ }
+
+ if (siblingAfters) {
+ if (afters) {
+ afters = afters.concat(siblingAfters);
+ } else {
+ afters = siblingAfters.concat();
+ }
+ } else {
+ if (afters) {
+ afters = afters.concat();
+ } else {
+ afters = [];
+ }
+ }
+
+ return [subs, afters];
},
/**
@@ -9899,7 +10418,7 @@ Y.CustomEvent.prototype = {
/**
* Create the Subscription for subscribing function, context, and bound
- * arguments. If this is a fireOnce event, the subscriber is immediately
+ * arguments. If this is a fireOnce event, the subscriber is immediately
* notified.
*
* @method _on
@@ -9914,24 +10433,41 @@ Y.CustomEvent.prototype = {
if (!fn) { this.log('Invalid callback for CE: ' + this.type); }
- var s = new Y.Subscriber(fn, context, args, when);
+ var s = new Y.Subscriber(fn, context, args, when),
+ firedWith;
if (this.fireOnce && this.fired) {
+
+ firedWith = this.firedWith;
+
+ // It's a little ugly for this to know about facades,
+ // but given the current breakup, not much choice without
+ // moving a whole lot of stuff around.
+ if (this.emitFacade && this._addFacadeToArgs) {
+ this._addFacadeToArgs(firedWith);
+ }
+
if (this.async) {
- setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);
+ setTimeout(Y.bind(this._notify, this, s, firedWith), 0);
} else {
- this._notify(s, this.firedWith);
+ this._notify(s, firedWith);
}
}
- if (when == AFTER) {
+ if (when === AFTER) {
+ if (!this._afters) {
+ this._afters = [];
+ }
this._afters.push(s);
} else {
+ if (!this._subscribers) {
+ this._subscribers = [];
+ }
this._subscribers.push(s);
}
if (this._kds) {
- if (when == AFTER) {
+ if (when === AFTER) {
this.afters[s.id] = s;
} else {
this.subscribers[s.id] = s;
@@ -9952,7 +10488,7 @@ Y.CustomEvent.prototype = {
var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
return this._on(fn, context, a, true);
},
-
+
/**
* Listen for this event
* @method on
@@ -10002,25 +10538,29 @@ Y.CustomEvent.prototype = {
if (fn && fn.detach) {
return fn.detach();
}
-
+
var i, s,
found = 0,
subs = this._subscribers,
afters = this._afters;
- for (i = subs.length; i >= 0; i--) {
- s = subs[i];
- if (s && (!fn || fn === s.fn)) {
- this._delete(s, subs, i);
- found++;
+ if (subs) {
+ for (i = subs.length; i >= 0; i--) {
+ s = subs[i];
+ if (s && (!fn || fn === s.fn)) {
+ this._delete(s, subs, i);
+ found++;
+ }
}
}
- for (i = afters.length; i >= 0; i--) {
- s = afters[i];
- if (s && (!fn || fn === s.fn)) {
- this._delete(s, afters, i);
- found++;
+ if (afters) {
+ for (i = afters.length; i >= 0; i--) {
+ s = afters[i];
+ if (s && (!fn || fn === s.fn)) {
+ this._delete(s, afters, i);
+ found++;
+ }
}
}
@@ -10090,13 +10630,34 @@ Y.CustomEvent.prototype = {
*
*/
fire: function() {
+
+ // push is the fastest way to go from arguments to arrays
+ // for most browsers currently
+ // http://jsperf.com/push-vs-concat-vs-slice/2
+
+ var args = [];
+ args.push.apply(args, arguments);
+
+ return this._fire(args);
+ },
+
+ /**
+ * Private internal implementation for `fire`, which is can be used directly by
+ * `EventTarget` and other event module classes which have already converted from
+ * an `arguments` list to an array, to avoid the repeated overhead.
+ *
+ * @method _fire
+ * @private
+ * @param {Array} args The array of arguments passed to be passed to handlers.
+ * @return {boolean} false if one of the subscribers returned false, true otherwise.
+ */
+ _fire: function(args) {
+
if (this.fireOnce && this.fired) {
this.log('fireOnce event: ' + this.type + ' already fired');
return true;
} else {
- var args = nativeSlice.call(arguments, 0);
-
// this doesn't happen if the event isn't published
// this.host._monitor('fire', this.type, args);
@@ -10130,7 +10691,9 @@ Y.CustomEvent.prototype = {
this._procSubs(subs[0], args);
this._procSubs(subs[1], args);
}
- this._broadcast(args);
+ if (this.broadcast) {
+ this._broadcast(args);
+ }
return this.stopped ? false : true;
},
@@ -10162,7 +10725,7 @@ Y.CustomEvent.prototype = {
if (false === this._notify(s, args, ef)) {
this.stopped = 2;
}
- if (this.stopped == 2) {
+ if (this.stopped === 2) {
return false;
}
}
@@ -10189,7 +10752,7 @@ Y.CustomEvent.prototype = {
Y.fire.apply(Y, a);
}
- if (this.broadcast == 2) {
+ if (this.broadcast === 2) {
Y.Global.fire.apply(Y.Global, a);
}
}
@@ -10228,12 +10791,15 @@ Y.CustomEvent.prototype = {
var when = s._when;
if (!subs) {
- subs = (when === AFTER) ? this._afters : this._subscribers;
- i = YArray.indexOf(subs, s, 0);
+ subs = (when === AFTER) ? this._afters : this._subscribers;
}
- if (s && subs[i] === s) {
- subs.splice(i, 1);
+ if (subs) {
+ i = YArray.indexOf(subs, s, 0);
+
+ if (s && subs[i] === s) {
+ subs.splice(i, 1);
+ }
}
if (this._kds) {
@@ -10287,7 +10853,7 @@ Y.Subscriber = function(fn, context, args, when) {
* @property id
* @type String
*/
- this.id = Y.stamp(this);
+ this.id = Y.guid();
/**
* Additional arguments to propagate to the subscriber
@@ -10391,12 +10957,12 @@ Y.Subscriber.prototype = {
*/
contains: function(fn, context) {
if (context) {
- return ((this.fn == fn) && this.context == context);
+ return ((this.fn === fn) && this.context === context);
} else {
- return (this.fn == fn);
+ return (this.fn === fn);
}
},
-
+
valueOf : function() {
return this.id;
}
@@ -10514,14 +11080,14 @@ var L = Y.Lang,
* @method _getType
* @private
*/
- _getType = Y.cached(function(type, pre) {
+ _getType = function(type, pre) {
- if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) {
+ if (!pre || !type || type.indexOf(PREFIX_DELIMITER) > -1) {
return type;
}
return pre + PREFIX_DELIMITER + type;
- }),
+ },
/**
* Returns an array with the detach key (if provided),
@@ -10550,7 +11116,7 @@ var L = Y.Lang,
if (i > -1) {
detachcategory = t.substr(0, (i));
t = t.substr(i+1);
- if (t == '*') {
+ if (t === '*') {
t = null;
}
}
@@ -10561,39 +11127,38 @@ var L = Y.Lang,
ET = function(opts) {
+ var etState = this._yuievt,
+ etConfig;
- var o = (L.isObject(opts)) ? opts : {};
+ if (!etState) {
+ etState = this._yuievt = {
+ events: {}, // PERF: Not much point instantiating lazily. We're bound to have events
+ targets: null, // PERF: Instantiate lazily, if user actually adds target,
+ config: {
+ host: this,
+ context: this
+ },
+ chain: Y.config.chain
+ };
+ }
- this._yuievt = this._yuievt || {
+ etConfig = etState.config;
- id: Y.guid(),
+ if (opts) {
+ mixConfigs(etConfig, opts, true);
- events: {},
-
- targets: {},
-
- config: o,
-
- chain: ('chain' in o) ? o.chain : Y.config.chain,
-
- bubbling: false,
-
- defaults: {
- context: o.context || this,
- host: this,
- emitFacade: o.emitFacade,
- fireOnce: o.fireOnce,
- queuable: o.queuable,
- monitored: o.monitored,
- broadcast: o.broadcast,
- defaultTargetOnly: o.defaultTargetOnly,
- bubbles: ('bubbles' in o) ? o.bubbles : true
+ if (opts.chain !== undefined) {
+ etState.chain = opts.chain;
}
- };
+
+ if (opts.prefix) {
+ etConfig.prefix = opts.prefix;
+ }
+ }
};
-
ET.prototype = {
+
constructor: ET,
/**
@@ -10789,6 +11354,11 @@ ET.prototype = {
if (!handle) {
ce = yuievt.events[type] || this.publish(type);
handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);
+
+ // TODO: More robust regex, accounting for category
+ if (type.indexOf("*:") !== -1) {
+ this._hasSiblings = true;
+ }
}
if (detachcategory) {
@@ -10827,8 +11397,11 @@ ET.prototype = {
* @return {EventTarget} the host
*/
detach: function(type, fn, context) {
- var evts = this._yuievt.events, i,
- Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));
+
+ var evts = this._yuievt.events,
+ i,
+ Node = Y.Node,
+ isNode = Node && (Y.instanceOf(this, Node));
// detachAll disabled on the Y instance.
if (!type && (this !== Y)) {
@@ -11019,53 +11592,102 @@ ET.prototype = {
*
*/
publish: function(type, opts) {
- var events, ce, ret, defaults,
- edata = this._yuievt,
- pre = edata.config.prefix;
- if (L.isObject(type)) {
+ var ret,
+ etState = this._yuievt,
+ etConfig = etState.config,
+ pre = etConfig.prefix;
+
+ if (typeof type === "string") {
+ if (pre) {
+ type = _getType(type, pre);
+ }
+ ret = this._publish(type, etConfig, opts);
+ } else {
ret = {};
+
Y.each(type, function(v, k) {
- ret[k] = this.publish(k, v || opts);
+ if (pre) {
+ k = _getType(k, pre);
+ }
+ ret[k] = this._publish(k, etConfig, v || opts);
}, this);
- return ret;
}
- type = (pre) ? _getType(type, pre) : type;
+ return ret;
+ },
- events = edata.events;
- ce = events[type];
+ /**
+ * Returns the fully qualified type, given a short type string.
+ * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix.
+ *
+ * NOTE: This method, unlike _getType, does no checking of the value passed in, and
+ * is designed to be used with the low level _publish() method, for critical path
+ * implementations which need to fast-track publish for performance reasons.
+ *
+ * @method _getFullType
+ * @private
+ * @param {String} type The short type to prefix
+ * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in
+ */
+ _getFullType : function(type) {
- this._monitor('publish', type, {
- args: arguments
- });
+ var pre = this._yuievt.config.prefix;
- if (ce) {
- // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event');
- if (opts) {
- ce.applyConfig(opts, true);
- }
+ if (pre) {
+ return pre + PREFIX_DELIMITER + type;
} else {
- // TODO: Lazy publish goes here.
- defaults = edata.defaults;
+ return type;
+ }
+ },
- // apply defaults
- ce = new Y.CustomEvent(type, defaults);
- if (opts) {
- ce.applyConfig(opts, true);
- }
+ /**
+ * The low level event publish implementation. It expects all the massaging to have been done
+ * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast
+ * path publish, which can be used by critical code paths to improve performance.
+ *
+ * @method _publish
+ * @private
+ * @param {String} fullType The prefixed type of the event to publish.
+ * @param {Object} etOpts The EventTarget specific configuration to mix into the published event.
+ * @param {Object} ceOpts The publish specific configuration to mix into the published event.
+ * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will
+ * be the default `CustomEvent` instance, and can be configured independently.
+ */
+ _publish : function(fullType, etOpts, ceOpts) {
- events[type] = ce;
+ var ce,
+ etState = this._yuievt,
+ etConfig = etState.config,
+ host = etConfig.host,
+ context = etConfig.context,
+ events = etState.events;
+
+ ce = events[fullType];
+
+ // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight.
+ if ((etConfig.monitored && !ce) || (ce && ce.monitored)) {
+ this._monitor('publish', fullType, {
+ args: arguments
+ });
}
- // make sure we turn the broadcast flag off if this
- // event was published as a result of bubbling
- // if (opts instanceof Y.CustomEvent) {
- // events[type].broadcast = false;
- // }
+ if (!ce) {
+ // Publish event
+ ce = events[fullType] = new Y.CustomEvent(fullType, etOpts);
- return events[type];
+ if (!etOpts) {
+ ce.host = host;
+ ce.context = context;
+ }
+ }
+
+ if (ceOpts) {
+ mixConfigs(ce, ceOpts, true);
+ }
+
+ return ce;
},
/**
@@ -11105,23 +11727,23 @@ ET.prototype = {
}
},
- /**
+ /**
* Fire a custom event by name. The callback functions will be executed
* from the context specified when the event was created, and with the
* following parameters.
*
- * If the custom event object hasn't been created, then the event hasn't
- * been published and it has no subscribers. For performance sake, we
- * immediate exit in this case. This means the event won't bubble, so
- * if the intention is that a bubble target be notified, the event must
- * be published on this object first.
- *
* The first argument is the event type, and any additional arguments are
* passed to the listeners as parameters. If the first of these is an
* object literal, and the event is configured to emit an event facade,
* that object is mixed into the event facade and the facade is provided
* in place of the original object.
*
+ * If the custom event object hasn't been created, then the event hasn't
+ * been published and it has no subscribers. For performance sake, we
+ * immediate exit in this case. This means the event won't bubble, so
+ * if the intention is that a bubble target be notified, the event must
+ * be published on this object first.
+ *
* @method fire
* @param type {String|Object} The type of the event, or an object that contains
* a 'type' property.
@@ -11130,30 +11752,63 @@ ET.prototype = {
* configured to emit an event facade, the event facade will replace that
* parameter after the properties the object literal contains are copied to
* the event facade.
- * @return {EventTarget} the event host
+ * @return {Boolean} True if the whole lifecycle of the event went through,
+ * false if at any point the event propagation was halted.
*/
fire: function(type) {
- var typeIncluded = L.isString(type),
- t = (typeIncluded) ? type : (type && type.type),
+ var typeIncluded = (typeof type === "string"),
+ argCount = arguments.length,
+ t = type,
yuievt = this._yuievt,
- pre = yuievt.config.prefix,
- ce, ret,
+ etConfig = yuievt.config,
+ pre = etConfig.prefix,
+ ret,
+ ce,
ce2,
- args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;
+ args;
- t = (pre) ? _getType(t, pre) : t;
+ if (typeIncluded && argCount <= 3) {
- ce = this.getEvent(t, true);
- ce2 = this.getSibling(t, ce);
+ // PERF: Try to avoid slice/iteration for the common signatures
- if (ce2 && !ce) {
- ce = this.publish(t);
+ // Most common
+ if (argCount === 2) {
+ args = [arguments[1]]; // fire("foo", {})
+ } else if (argCount === 3) {
+ args = [arguments[1], arguments[2]]; // fire("foo", {}, opts)
+ } else {
+ args = []; // fire("foo")
+ }
+
+ } else {
+ args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0));
}
- this._monitor('fire', (ce || t), {
- args: args
- });
+ if (!typeIncluded) {
+ t = (type && type.type);
+ }
+
+ if (pre) {
+ t = _getType(t, pre);
+ }
+
+ ce = yuievt.events[t];
+
+ if (this._hasSiblings) {
+ ce2 = this.getSibling(t, ce);
+
+ if (ce2 && !ce) {
+ ce = this.publish(t);
+ }
+ }
+
+ // PERF: trying to avoid function call, since this is a critical path
+ if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
+ this._monitor('fire', (ce || t), {
+ args: args
+ });
+ }
// this event has not been published or subscribed to
if (!ce) {
@@ -11164,8 +11819,12 @@ ET.prototype = {
// otherwise there is nothing to be done
ret = true;
} else {
- ce.sibling = ce2;
- ret = ce.fire.apply(ce, args);
+
+ if (ce2) {
+ ce.sibling = ce2;
+ }
+
+ ret = ce._fire(args);
}
return (yuievt.chain) ? this : ret;
@@ -11173,17 +11832,15 @@ ET.prototype = {
getSibling: function(type, ce) {
var ce2;
+
// delegate to *:type events if there are subscribers
if (type.indexOf(PREFIX_DELIMITER) > -1) {
type = _wildType(type);
- // console.log(type);
ce2 = this.getEvent(type, true);
if (ce2) {
- // console.log("GOT ONE: " + type);
ce2.applyConfig(ce);
ce2.bubbles = false;
ce2.broadcast = 0;
- // ret = ce2.fire.apply(ce2, a);
}
}
@@ -11200,6 +11857,7 @@ ET.prototype = {
*/
getEvent: function(type, prefixed) {
var pre, e;
+
if (!prefixed) {
pre = this._yuievt.config.prefix;
type = (pre) ? _getType(type, pre) : type;
@@ -11298,7 +11956,9 @@ Y.Global = YUI.Env.globalEvents;
treating that method as an event
-For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.
+For custom event subscriptions, pass the custom event name as the first argument
+and callback as the second. The `this` object in the callback will be `Y` unless
+an override is passed as the third argument.
Y.on('io:complete', function () {
Y.MyApp.updateStatus('Transaction complete');
@@ -11324,7 +11984,7 @@ selector or other identifier.
`defaultFn` can prevent the default behavior with `e.preventDefault()` from the
event object passed as the first parameter to the subscription callback.
-To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
+To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
`Y.Do.before(...)`.
NOTE: The formal parameter list below is for events, not for function
@@ -11409,7 +12069,7 @@ for that signature.
**/
-}, '3.9.1', {"requires": ["oop"]});
+}, '3.12.0', {"requires": ["oop"]});
YUI.add('event-custom-complex', function (Y, NAME) {
@@ -11422,10 +12082,11 @@ YUI.add('event-custom-complex', function (Y, NAME) {
var FACADE,
FACADE_KEYS,
+ YObject = Y.Object,
key,
EMPTY = {},
CEProto = Y.CustomEvent.prototype,
- ETProto = Y.EventTarget.prototype,
+ ETProto = Y.EventTarget.prototype,
mixFacadeProps = function(facade, payload) {
var p;
@@ -11447,7 +12108,9 @@ var FACADE,
Y.EventFacade = function(e, currentTarget) {
- e = e || EMPTY;
+ if (!e) {
+ e = EMPTY;
+ }
this._event = e;
@@ -11546,151 +12209,209 @@ Y.mix(Y.EventFacade.prototype, {
CEProto.fireComplex = function(args) {
- var es, ef, q, queue, ce, ret, events, subs, postponed,
- self = this, host = self.host || self, next, oldbubble;
+ var es,
+ ef,
+ q,
+ queue,
+ ce,
+ ret = true,
+ events,
+ subs,
+ ons,
+ afters,
+ afterQueue,
+ postponed,
+ prevented,
+ preventedFn,
+ defaultFn,
+ self = this,
+ host = self.host || self,
+ next,
+ oldbubble,
+ stack = self.stack,
+ yuievt = host._yuievt,
+ hasPotentialSubscribers;
+
+ if (stack) {
- if (self.stack) {
// queue this event if the current item in the queue bubbles
- if (self.queuable && self.type != self.stack.next.type) {
+ if (self.queuable && self.type !== stack.next.type) {
self.log('queue ' + self.type);
- self.stack.queue.push([self, args]);
+
+ if (!stack.queue) {
+ stack.queue = [];
+ }
+ stack.queue.push([self, args]);
+
return true;
}
}
- es = self.stack || {
- // id of the first event in the stack
- id: self.id,
- next: self,
- silent: self.silent,
- stopped: 0,
- prevented: 0,
- bubbling: null,
- type: self.type,
- // defaultFnQueue: new Y.Queue(),
- afterQueue: new Y.Queue(),
- defaultTargetOnly: self.defaultTargetOnly,
- queue: []
- };
-
- subs = self.getSubs();
-
- self.stopped = (self.type !== es.type) ? 0 : es.stopped;
- self.prevented = (self.type !== es.type) ? 0 : es.prevented;
+ hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast;
self.target = self.target || host;
-
- if (self.stoppedFn) {
- events = new Y.EventTarget({
- fireOnce: true,
- context: host
- });
-
- self.events = events;
-
- events.on('stopped', self.stoppedFn);
- }
-
self.currentTarget = host;
- self.details = args.slice(); // original arguments in the details
+ self.details = args.concat();
- // self.log("Firing " + self + ", " + "args: " + args);
- self.log("Firing " + self.type);
+ if (hasPotentialSubscribers) {
- self._facade = null; // kill facade to eliminate stale properties
+ es = stack || {
- ef = self._getFacade(args);
+ id: self.id, // id of the first event in the stack
+ next: self,
+ silent: self.silent,
+ stopped: 0,
+ prevented: 0,
+ bubbling: null,
+ type: self.type,
+ // defaultFnQueue: new Y.Queue(),
+ defaultTargetOnly: self.defaultTargetOnly
- if (Y.Lang.isObject(args[0])) {
- args[0] = ef;
- } else {
- args.unshift(ef);
- }
+ };
- if (subs[0]) {
- self._procSubs(subs[0], args, ef);
- }
+ subs = self.getSubs();
+ ons = subs[0];
+ afters = subs[1];
- // bubble if this is hosted in an event target and propagation has not been stopped
- if (self.bubbles && host.bubble && !self.stopped) {
+ self.stopped = (self.type !== es.type) ? 0 : es.stopped;
+ self.prevented = (self.type !== es.type) ? 0 : es.prevented;
- oldbubble = es.bubbling;
-
- es.bubbling = self.type;
-
- if (es.type != self.type) {
- es.stopped = 0;
- es.prevented = 0;
+ if (self.stoppedFn) {
+ // PERF TODO: Can we replace with callback, like preventedFn. Look into history
+ events = new Y.EventTarget({
+ fireOnce: true,
+ context: host
+ });
+ self.events = events;
+ events.on('stopped', self.stoppedFn);
}
- ret = host.bubble(self, args, null, es);
+ // self.log("Firing " + self + ", " + "args: " + args);
+ self.log("Firing " + self.type);
- self.stopped = Math.max(self.stopped, es.stopped);
- self.prevented = Math.max(self.prevented, es.prevented);
+ self._facade = null; // kill facade to eliminate stale properties
- es.bubbling = oldbubble;
- }
+ ef = self._createFacade(args);
- if (self.prevented) {
- if (self.preventedFn) {
- self.preventedFn.apply(host, args);
+ if (ons) {
+ self._procSubs(ons, args, ef);
}
- } else if (self.defaultFn &&
- ((!self.defaultTargetOnly && !es.defaultTargetOnly) ||
- host === ef.target)) {
- self.defaultFn.apply(host, args);
- }
- // broadcast listeners are fired as discreet events on the
- // YUI instance and potentially the YUI global.
- self._broadcast(args);
+ // bubble if this is hosted in an event target and propagation has not been stopped
+ if (self.bubbles && host.bubble && !self.stopped) {
+ oldbubble = es.bubbling;
- // Queue the after
- if (subs[1] && !self.prevented && self.stopped < 2) {
- if (es.id === self.id || self.type != host._yuievt.bubbling) {
- self._procSubs(subs[1], args, ef);
- while ((next = es.afterQueue.last())) {
- next();
+ es.bubbling = self.type;
+
+ if (es.type !== self.type) {
+ es.stopped = 0;
+ es.prevented = 0;
+ }
+
+ ret = host.bubble(self, args, null, es);
+
+ self.stopped = Math.max(self.stopped, es.stopped);
+ self.prevented = Math.max(self.prevented, es.prevented);
+
+ es.bubbling = oldbubble;
+ }
+
+ prevented = self.prevented;
+
+ if (prevented) {
+ preventedFn = self.preventedFn;
+ if (preventedFn) {
+ preventedFn.apply(host, args);
}
} else {
- postponed = subs[1];
- if (es.execDefaultCnt) {
- postponed = Y.merge(postponed);
- Y.each(postponed, function(s) {
- s.postponed = true;
+ defaultFn = self.defaultFn;
+
+ if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) {
+ defaultFn.apply(host, args);
+ }
+ }
+
+ // broadcast listeners are fired as discreet events on the
+ // YUI instance and potentially the YUI global.
+ if (self.broadcast) {
+ self._broadcast(args);
+ }
+
+ if (afters && !self.prevented && self.stopped < 2) {
+
+ // Queue the after
+ afterQueue = es.afterQueue;
+
+ if (es.id === self.id || self.type !== yuievt.bubbling) {
+
+ self._procSubs(afters, args, ef);
+
+ if (afterQueue) {
+ while ((next = afterQueue.last())) {
+ next();
+ }
+ }
+ } else {
+ postponed = afters;
+
+ if (es.execDefaultCnt) {
+ postponed = Y.merge(postponed);
+
+ Y.each(postponed, function(s) {
+ s.postponed = true;
+ });
+ }
+
+ if (!afterQueue) {
+ es.afterQueue = new Y.Queue();
+ }
+
+ es.afterQueue.add(function() {
+ self._procSubs(postponed, args, ef);
});
}
- es.afterQueue.add(function() {
- self._procSubs(postponed, args, ef);
- });
- }
- }
-
- self.target = null;
-
- if (es.id === self.id) {
- queue = es.queue;
-
- while (queue.length) {
- q = queue.pop();
- ce = q[0];
- // set up stack to allow the next item to be processed
- es.next = ce;
- ce.fire.apply(ce, q[1]);
}
- self.stack = null;
- }
+ self.target = null;
- ret = !(self.stopped);
+ if (es.id === self.id) {
- if (self.type != host._yuievt.bubbling) {
- es.stopped = 0;
- es.prevented = 0;
- self.stopped = 0;
- self.prevented = 0;
+ queue = es.queue;
+
+ if (queue) {
+ while (queue.length) {
+ q = queue.pop();
+ ce = q[0];
+ // set up stack to allow the next item to be processed
+ es.next = ce;
+ ce._fire(q[1]);
+ }
+ }
+
+ self.stack = null;
+ }
+
+ ret = !(self.stopped);
+
+ if (self.type !== yuievt.bubbling) {
+ es.stopped = 0;
+ es.prevented = 0;
+ self.stopped = 0;
+ self.prevented = 0;
+ }
+
+ } else {
+ defaultFn = self.defaultFn;
+
+ if(defaultFn) {
+ ef = self._createFacade(args);
+
+ if ((!self.defaultTargetOnly) || (host === ef.target)) {
+ defaultFn.apply(host, args);
+ }
+ }
}
// Kill the cached facade to free up memory.
@@ -11700,31 +12421,62 @@ CEProto.fireComplex = function(args) {
return ret;
};
-CEProto._getFacade = function() {
+/**
+ * @method _hasPotentialSubscribers
+ * @for CustomEvent
+ * @private
+ * @return {boolean} Whether the event has potential subscribers or not
+ */
+CEProto._hasPotentialSubscribers = function() {
+ return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast;
+};
- var ef = this._facade, o,
- args = this.details;
+/**
+ * Internal utility method to create a new facade instance and
+ * insert it into the fire argument list, accounting for any payload
+ * merging which needs to happen.
+ *
+ * This used to be called `_getFacade`, but the name seemed inappropriate
+ * when it was used without a need for the return value.
+ *
+ * @method _createFacade
+ * @private
+ * @param fireArgs {Array} The arguments passed to "fire", which need to be
+ * shifted (and potentially merged) when the facade is added.
+ * @return {EventFacade} The event facade created.
+ */
+
+// TODO: Remove (private) _getFacade alias, once synthetic.js is updated.
+CEProto._createFacade = CEProto._getFacade = function(fireArgs) {
+
+ var userArgs = this.details,
+ firstArg = userArgs && userArgs[0],
+ firstArgIsObj = (firstArg && (typeof firstArg === "object")),
+ ef = this._facade;
if (!ef) {
ef = new Y.EventFacade(this, this.currentTarget);
}
- // if the first argument is an object literal, apply the
- // properties to the event facade
- o = args && args[0];
-
- if (Y.Lang.isObject(o, true)) {
-
+ if (firstArgIsObj) {
// protect the event facade properties
- mixFacadeProps(ef, o);
+ mixFacadeProps(ef, firstArg);
- // Allow the event type to be faked
- // http://yuilibrary.com/projects/yui3/ticket/2528376
- ef.type = o.type || ef.type;
+ // Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376
+ if (firstArg.type) {
+ ef.type = firstArg.type;
+ }
+
+ if (fireArgs) {
+ fireArgs[0] = ef;
+ }
+ } else {
+ if (fireArgs) {
+ fireArgs.unshift(ef);
+ }
}
// update the details field with the arguments
- // ef.type = this.type;
ef.details = this.details;
// use the original target when the event bubbled to this target
@@ -11739,6 +12491,23 @@ CEProto._getFacade = function() {
return this._facade;
};
+/**
+ * Utility method to manipulate the args array passed in, to add the event facade,
+ * if it's not already the first arg.
+ *
+ * @method _addFacadeToArgs
+ * @private
+ * @param {Array} The arguments to manipulate
+ */
+CEProto._addFacadeToArgs = function(args) {
+ var e = args[0];
+
+ // Trying not to use instanceof, just to avoid potential cross Y edge case issues.
+ if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) {
+ this._createFacade(args);
+ }
+};
+
/**
* Stop propagation to bubble targets
* @for CustomEvent
@@ -11812,8 +12581,14 @@ CEProto.halt = function(immediate) {
* @for EventTarget
*/
ETProto.addTarget = function(o) {
- this._yuievt.targets[Y.stamp(o)] = o;
- this._yuievt.hasTargets = true;
+ var etState = this._yuievt;
+
+ if (!etState.targets) {
+ etState.targets = {};
+ }
+
+ etState.targets[Y.stamp(o)] = o;
+ etState.hasTargets = true;
};
/**
@@ -11822,7 +12597,8 @@ ETProto.addTarget = function(o) {
* @return EventTarget[]
*/
ETProto.getTargets = function() {
- return Y.Object.values(this._yuievt.targets);
+ var targets = this._yuievt.targets;
+ return targets ? YObject.values(targets) : [];
};
/**
@@ -11832,7 +12608,15 @@ ETProto.getTargets = function() {
* @for EventTarget
*/
ETProto.removeTarget = function(o) {
- delete this._yuievt.targets[Y.stamp(o)];
+ var targets = this._yuievt.targets;
+
+ if (targets) {
+ delete targets[Y.stamp(o, true)];
+
+ if (YObject.size(targets) === 0) {
+ this._yuievt.hasTargets = false;
+ }
+ }
};
/**
@@ -11844,8 +12628,14 @@ ETProto.removeTarget = function(o) {
*/
ETProto.bubble = function(evt, args, target, es) {
- var targs = this._yuievt.targets, ret = true,
- t, type = evt && evt.type, ce, i, bc, ce2,
+ var targs = this._yuievt.targets,
+ ret = true,
+ t,
+ ce,
+ i,
+ bc,
+ ce2,
+ type = evt && evt.type,
originalTarget = target || (evt && evt.target) || this,
oldbubble;
@@ -11853,9 +12643,14 @@ ETProto.bubble = function(evt, args, target, es) {
for (i in targs) {
if (targs.hasOwnProperty(i)) {
+
t = targs[i];
- ce = t.getEvent(type, true);
- ce2 = t.getSibling(type, ce);
+
+ ce = t._yuievt.events[type];
+
+ if (t._hasSiblings) {
+ ce2 = t.getSibling(type, ce);
+ }
if (ce2 && !ce) {
ce = t.publish(type);
@@ -11872,10 +12667,11 @@ ETProto.bubble = function(evt, args, target, es) {
}
} else {
- ce.sibling = ce2;
+ if (ce2) {
+ ce.sibling = ce2;
+ }
- // set the original target to that the target payload on the
- // facade is correct.
+ // set the original target to that the target payload on the facade is correct.
ce.target = originalTarget;
ce.originalTarget = originalTarget;
ce.currentTarget = t;
@@ -11888,7 +12684,13 @@ ETProto.bubble = function(evt, args, target, es) {
ce.stack = es;
+ // TODO: See what's getting in the way of changing this to use
+ // the more performant ce._fire(args || evt.details || []).
+
+ // Something in Widget Parent/Child tests is not happy if we
+ // change it - maybe evt.details related?
ret = ret && ce.fire.apply(ce, args || evt.details || []);
+
ce.broadcast = bc;
ce.originalTarget = null;
@@ -11906,6 +12708,25 @@ ETProto.bubble = function(evt, args, target, es) {
return ret;
};
+/**
+ * @method _hasPotentialSubscribers
+ * @for EventTarget
+ * @private
+ * @param {String} fullType The fully prefixed type name
+ * @return {boolean} Whether the event has potential subscribers or not
+ */
+ETProto._hasPotentialSubscribers = function(fullType) {
+
+ var etState = this._yuievt,
+ e = etState.events[fullType];
+
+ if (e) {
+ return e.hasSubs() || etState.hasTargets || e.broadcast;
+ } else {
+ return false;
+ }
+};
+
FACADE = new Y.EventFacade();
FACADE_KEYS = {};
@@ -11914,7 +12735,8 @@ for (key in FACADE) {
FACADE_KEYS[key] = true;
}
-}, '3.9.1', {"requires": ["event-custom-base"]});
+
+}, '3.12.0', {"requires": ["event-custom-base"]});
YUI.add('node-core', function (Y, NAME) {
/**
@@ -12124,7 +12946,7 @@ Y_Node.addMethod = function(name, fn, context) {
}
args.unshift(node._node);
- ret = fn.apply(node, args);
+ ret = fn.apply(context || node, args);
if (ret) { // scrub truthy
ret = Y_Node.scrubVal(ret, node);
@@ -12552,10 +13374,15 @@ Y.mix(Y_Node.prototype, {
* @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
*/
all: function(selector) {
- var nodelist = Y.all(Y.Selector.query(selector, this._node));
- nodelist._query = selector;
- nodelist._queryRoot = this._node;
- return nodelist;
+ var nodelist;
+
+ if (this._node) {
+ nodelist = Y.all(Y.Selector.query(selector, this._node));
+ nodelist._query = selector;
+ nodelist._queryRoot = this._node;
+ }
+
+ return nodelist || Y.all([]);
},
// TODO: allow fn test
@@ -13214,7 +14041,7 @@ var Y_NodeList = Y.NodeList,
/** Removes the last from the NodeList and returns it.
* @for NodeList
* @method pop
- * @return {Node} The last item in the NodeList.
+ * @return {Node | null} The last item in the NodeList, or null if the list is empty.
*/
'pop': 0,
/** Adds the given Node(s) to the end of the NodeList.
@@ -13226,7 +14053,7 @@ var Y_NodeList = Y.NodeList,
/** Removes the first item from the NodeList and returns it.
* @for NodeList
* @method shift
- * @return {Node} The first item in the NodeList.
+ * @return {Node | null} The first item in the NodeList, or null if the NodeList is empty.
*/
'shift': 0,
/** Returns a new NodeList comprising the Nodes in the given range.
@@ -13512,7 +14339,7 @@ Y.NodeList.importMethod(Y.Node.prototype, [
]);
-}, '3.9.1', {"requires": ["dom-core", "selector"]});
+}, '3.12.0', {"requires": ["dom-core", "selector"]});
YUI.add('node-base', function (Y, NAME) {
/**
@@ -13776,8 +14603,17 @@ Y.mix(Y_Node.prototype, {
* @deprecated Use getHTML
* @return {String} The current content
*/
- getContent: function(content) {
- return this.get('innerHTML');
+ getContent: function() {
+ var node = this;
+
+ if (node._node.nodeType === 11) { // 11 === Node.DOCUMENT_FRAGMENT_NODE
+ // "this", when it is a document fragment, must be cloned because
+ // the nodes contained in the fragment actually disappear once
+ // the fragment is appended anywhere
+ node = node.create(" 4h=y&WOxJEkR5;Xf-aBIMn@;e=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,c,h=this,p=t,d={};n=n?e.Object(n):{},s=h._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,c=n.data,e.Lang.isObject(c)&&!c.nodeType&&!s.upload&&e.QueryString&&e.QueryString.stringify&&(n.data=c=e.QueryString.stringify(c));if(n.form){if(n.form.upload)return h.upload(s,t,n);c=h._serialize(n.form,c)}c||(c="");if(c)switch(o){case"GET":case"HEAD":case"DELETE":p=h._concat(p,c),c="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return h.xdr(p,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){h._rS(s,n)});try{s.c.open(o,p,!f,n.username||null,n.password||null),h._setHeaders(s.c,n.headers||{}),h.start(s,n),n.xdr&&n.xdr.credentials&&l&&(s.c.withCredentials=!0),s.c.send(c);if(f){for(u=0,a=r.length;u=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,c,h=this,p=t,d={};n=n?e.Object(n):{},s=h._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,c=n.data,e.Lang.isObject(c)&&!c.nodeType&&!s.upload&&e.QueryString&&e.QueryString.stringify&&(n.data=c=e.QueryString.stringify(c));if(n.form){if(n.form.upload)return h.upload(s,t,n);c=h._serialize(n.form,c)}c||(c="");if(c)switch(o){case"GET":case"HEAD":case"DELETE":p=h._concat(p,c),c="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return h.xdr(p,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){h._rS(s,n)});try{s.c.open(o,p,!f,n.username||null,n.password||null),h._setHeaders(s.c,n.headers||{}),h.start(s,n),n.xdr&&n.xdr.credentials&&l&&(s.c.withCredentials=!0),s.c.send(c);if(f){for(u=0,a=r.length;udataType
* t?1:0},_detachList:function(e){var t=i.indexOf(e.lists,this);t>-1&&(e.lists.splice(t,1),e.removeTarget(this))},_findIndex:function(e){var t=this._items,n=t.length,r=0,i,s,o;if(!this.comparator||!n)return n;o=this.comparator(e);while(rt?1:0},_detachList:function(e){var t=i.indexOf(e.lists,this);t>-1&&(e.lists.splice(t,1),e.removeTarget(this))},_findIndex:function(e){var t=this._items,n=t.length,r=0,i,s,o;if(!this.comparator||!n)return n;o=this.comparator(e);while(r1?this._data[e]=t:this._data=e,this},clearData:function(e){return"_data"in this&&(typeof e!="undefined"?delete this._data[e]:delete this._data),
+this}}),e.mix(e.NodeList.prototype,{getData:function(e){var t=arguments.length?[e]:[];return this._invoke("getData",t,!0)},setData:function(e,t){var n=arguments.length>1?[e,t]:[e];return this._invoke("setData",n)},clearData:function(e){var t=arguments.length?[e]:[];return this._invoke("clearData",[e])}})},"3.12.0",{requires:["event-base","node-core","dom-base","dom-style"]});
diff --git a/lib/yuilib/3.9.1/build/node-base/node-base.js b/lib/yuilib/3.12.0/node-base/node-base.js
old mode 100644
new mode 100755
similarity index 95%
rename from lib/yuilib/3.9.1/build/node-base/node-base.js
rename to lib/yuilib/3.12.0/node-base/node-base.js
index b3f49b44489..48b0d65e3ab
--- a/lib/yuilib/3.9.1/build/node-base/node-base.js
+++ b/lib/yuilib/3.12.0/node-base/node-base.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-base', function (Y, NAME) {
/**
@@ -262,8 +268,17 @@ Y.mix(Y_Node.prototype, {
* @deprecated Use getHTML
* @return {String} The current content
*/
- getContent: function(content) {
- return this.get('innerHTML');
+ getContent: function() {
+ var node = this;
+
+ if (node._node.nodeType === 11) { // 11 === Node.DOCUMENT_FRAGMENT_NODE
+ // "this", when it is a document fragment, must be cloned because
+ // the nodes contained in the fragment actually disappear once
+ // the fragment is appended anywhere
+ node = node.create("").append(node.cloneNode(true));
+ }
+
+ return node.get("innerHTML");
}
});
@@ -801,18 +816,23 @@ Y.mix(Y_Node.prototype, {
/**
* The implementation for showing nodes.
- * Default is to toggle the style.display property.
+ * Default is to remove the hidden attribute and reset the CSS style.display property.
* @method _show
* @protected
* @chainable
*/
_show: function() {
+ this.removeAttribute('hidden');
+
+ // For back-compat we need to leave this in for browsers that
+ // do not visually hide a node via the hidden attribute
+ // and for users that check visibility based on style display.
this.setStyle('display', '');
},
_isHidden: function() {
- return Y.DOM.getStyle(this._node, 'display') === 'none';
+ return this.hasAttribute('hidden') || Y.DOM.getComputedStyle(this._node, 'display') === 'none';
},
/**
@@ -871,12 +891,17 @@ Y.mix(Y_Node.prototype, {
/**
* The implementation for hiding nodes.
- * Default is to toggle the style.display property.
+ * Default is to set the hidden attribute to true and set the CSS style.display to 'none'.
* @method _hide
* @protected
* @chainable
*/
_hide: function() {
+ this.setAttribute('hidden', '');
+
+ // For back-compat we need to leave this in for browsers that
+ // do not visually hide a node via the hidden attribute
+ // and for users that check visibility based on style display.
this.setStyle('display', 'none');
}
});
@@ -1155,4 +1180,4 @@ Y.mix(Y.NodeList.prototype, {
});
-}, '3.9.1', {"requires": ["event-base", "node-core", "dom-base"]});
+}, '3.12.0', {"requires": ["event-base", "node-core", "dom-base", "dom-style"]});
diff --git a/lib/yuilib/3.9.1/build/node-core/node-core-debug.js b/lib/yuilib/3.12.0/node-core/node-core-debug.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/node-core/node-core-debug.js
rename to lib/yuilib/3.12.0/node-core/node-core-debug.js
index b1a2b1a1e5e..869451a864b
--- a/lib/yuilib/3.9.1/build/node-core/node-core-debug.js
+++ b/lib/yuilib/3.12.0/node-core/node-core-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-core', function (Y, NAME) {
/**
@@ -208,7 +214,7 @@ Y_Node.addMethod = function(name, fn, context) {
}
args.unshift(node._node);
- ret = fn.apply(node, args);
+ ret = fn.apply(context || node, args);
if (ret) { // scrub truthy
ret = Y_Node.scrubVal(ret, node);
@@ -637,10 +643,15 @@ Y.mix(Y_Node.prototype, {
* @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
*/
all: function(selector) {
- var nodelist = Y.all(Y.Selector.query(selector, this._node));
- nodelist._query = selector;
- nodelist._queryRoot = this._node;
- return nodelist;
+ var nodelist;
+
+ if (this._node) {
+ nodelist = Y.all(Y.Selector.query(selector, this._node));
+ nodelist._query = selector;
+ nodelist._queryRoot = this._node;
+ }
+
+ return nodelist || Y.all([]);
},
// TODO: allow fn test
@@ -1600,4 +1611,4 @@ Y.NodeList.importMethod(Y.Node.prototype, [
]);
-}, '3.9.1', {"requires": ["dom-core", "selector"]});
+}, '3.12.0', {"requires": ["dom-core", "selector"]});
diff --git a/lib/yuilib/3.12.0/node-core/node-core-min.js b/lib/yuilib/3.12.0/node-core/node-core-min.js
new file mode 100755
index 00000000000..a1829796853
--- /dev/null
+++ b/lib/yuilib/3.12.0/node-core/node-core-min.js
@@ -0,0 +1,9 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("node-core",function(e,t){var n=".",r="nodeName",i="nodeType",s="ownerDocument",o="tagName",u="_yuid",a={},f=Array.prototype.slice,l=e.DOM,c=function(t){if(!this.getDOMNode)return new c(t);if(typeof t=="string"){t=c._fromString(t);if(!t)return null}var n=t.nodeType!==9?t.uniqueID:t[u];n&&c._instances[n]&&c._instances[n]._node!==t&&(t[u]=null),n=n||e.stamp(t),n||(n=e.guid()),this[u]=n,this._node=t,this._stateProxy=t,this._initPlugins&&this._initPlugins()},h=function(t){var n=null;return t&&(n=typeof t=="string"?function(n){return e.Selector.test(n,t)}:function(n){return t(e.one(n))}),n};c.ATTRS={},c.DOM_EVENTS={},c._fromString=function(t){return t&&(t.indexOf("doc")===0?t=e.config.doc:t.indexOf("win")===0?t=e.config.win:t=e.Selector.query(t,null,!0)),t||null},c.NAME="node",c.re_aria=/^(?:role$|aria-)/,c.SHOW_TRANSITION="fadeIn",c.HIDE_TRANSITION="fadeOut",c._instances={},c.getDOMNode=function(e){return e?e.nodeType?e:e._node||null:null},c.scrubVal=function(t,n){if(t){if(typeof t=="object"||typeof t=="function")if(i in t||l.isWindow(t))t=e.one(t);else if(t.item&&!t._nodes||t[0]&&t[0][i])t=e.all(t)}else typeof t=="undefined"?t=n:t===null&&(t=null);return t},c.addMethod=function(e,t,n){e&&t&&typeof t=="function"&&(c.prototype[e]=function(){var e=f.call(arguments),r=this,i;return e[0]&&e[0]._node&&(e[0]=e[0]._node),e[1]&&e[1]._node&&(e[1]=e[1]._node),e.unshift(r._node),i=t.apply(n||r,e),i&&(i=c.scrubVal(i,r)),typeof i!="undefined"||(i=r),i})},c.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,c.addMethod(r,t[n],t)):e.Array.each(n,function(e){c.importMethod(t,e)})},c.one=function(t){var n=null,r,i;if(t){if(typeof t=="string"){t=c._fromString(t);if(!t)return null}else if(t.getDOMNode)return t;if(t.nodeType||e.DOM.isWindow(t)){i=t.uniqueID&&t.nodeType!==9?t.uniqueID:t._yuid,n=c._instances[i],r=n?n._node:null;if(!n||r&&t!==r)n=new c(t),t.nodeType!=11&&(c._instances[n[u]]=n)}}return n},c.DEFAULT_SETTER=function(t,r){var i=this._stateProxy,s;return t.indexOf(n)>-1?(s=t,t=t.split(n),e.Object.setValue(i,t,r)):typeof i[t]!="undefined"&&(i[t]=r),r},c.DEFAULT_GETTER=function(t){var r=this._stateProxy,i;return t.indexOf&&t.indexOf(n)>-1?i=e.Object.getValue(r,t.split(n)):typeof r[t]!="undefined"&&(i=r[t]),i},e.mix(c.prototype,{DATA_PREFIX:"data-",toString:function(){var e=this[u]+": not bound to a node",t=this._node,n,i,s;return t&&(n=t.attributes,i=n&&n.id?t.getAttribute("id"):null,s=n&&n.className?t.getAttribute("className"):null,e=t[r],i&&(e+="#"+i),s&&(e+="."+s.replace(" ",".")),e+=" "+this[u]),e},get:function(e){var t;return this._getAttr?t=this._getAttr(e):t=this._get(e),t?t=c.scrubVal(t,this):t===null&&(t=null),t},_get:function(e){var t=c.ATTRS[e],n;return t&&t.getter?n=t.getter.call(this):c.re_aria.test(e)?n=this._node.getAttribute(e,2):n=c.DEFAULT_GETTER.apply(this,arguments),n},set:function(e,t){var n=c.ATTRS[e];return this._setAttr?this._setAttr.apply(this,arguments):n&&n.setter?n.setter.call(this,t,e):c.re_aria.test(e)?this._node.setAttribute(e,t):c.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(t){return this._setAttrs?this._setAttrs(t):e.Object.each(t,function(e,t){this.set(t,e)},this),this},getAttrs:function(t){var n={};return this._getAttrs?this._getAttrs(t):e.Array.each(t,function(e,t){n[e]=this.get(e)},this),n},compareTo:function(e){var t=this._node;return e&&e._node&&(e=e._node),t===e},inDoc:function(e){var t=this._node;e=e?e._node||e:t[s];if(e.documentElement)return l.contains(e.documentElement,t)},getById:function(t){var n=this._node,r=l.byId(t,n[s]);return r&&l.contains(n,r)?r=e.one(r):r=null,r},ancestor:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.one(l.ancestor(this._node,h(t),n,h(r)))},ancestors:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.all(l.ancestors(this._node,h(t),n,h(r)))},previous:function(t,n){return e.one(l.elementByAxis(this._node,"previousSibling",h(t),n))},next:function(t,n){return e.one(l.elementByAxis(this._node,"nextSibling",h(t),n))},siblings:function(t){return e.all(l.siblings(this._node,h(t)))},one:function(t){return e.one(e.Selector.query(t,this._node,!0))},all:function(t){var n;return this._node&&(n=e.all(e.Selector.query(t,this._node)),n._query=t,n._queryRoot=this._node),n||e.all([])},test:function(t){return e.Selector.test(this._node,t)},remove:function(e){var t=this._node;return t&&t.parentNode&&t.parentNode.removeChild(t),e&&this.destroy(),this},replace:function(e){var t=this._node;return typeof e=="string"&&(e=c.create(e)),t.parentNode.replaceChild(c.getDOMNode(e),t),this},replaceChild:function(t,n){return typeof t=="string"&&(t=l.create(t)),e.one(this._node.replaceChild(c.getDOMNode(t),c.getDOMNode(n)))},destroy:function(t){var n=e.config.doc.uniqueID?"uniqueID":"_yuid",r;this.purge(),this.unplug&&this.unplug(),this.clearData(),t&&e.NodeList.each(this.all("*"),function(t){r=c._instances[t[n]],r?r.destroy():e.Event.purgeElement(t)}),this._node=null,this._stateProxy=null,delete c._instances[this._yuid]},invoke:function(e,t,n,r,i,s){var o=this._node,u;return t&&t._node&&(t=t._node),n&&n._node&&(n=n._node),u=o[e](t,n,r,i,s),c.scrubVal(u,this)},swap:e.config.doc.documentElement.swapNode?function(e){this._node.swapNode(c.getDOMNode(e))}:function(e){e=c.getDOMNode(e);var t=this._node,n=e.parentNode,r=e.nextSibling;return r===t?n.insertBefore(t,e):e===t.nextSibling?n.insertBefore(e,t):(t.parentNode.replaceChild(e,t),l.addHTML(n,t,r)),this},hasMethod:function(e){var t=this._node;return!(!(t&&e in t&&typeof t[e]!="unknown")||typeof t[e]!="function"&&String(t[e]).indexOf("function")!==1)},isFragment:function(){return this.get("nodeType")===11},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),e.Node=c,e.one=c.one;var p=function(t){var n=[];t&&(typeof t=="string"?(this._query=t,t=e.Selector.query(t)):t.nodeType||l.isWindow(t)?t=[t]:t._node?t=[t._node]:t[0]&&t[0]._node?
+(e.Array.each(t,function(e){e._node&&n.push(e._node)}),t=n):t=e.Array(t,0,!0)),this._nodes=t||[]};p.NAME="NodeList",p.getDOMNodes=function(e){return e&&e._nodes?e._nodes:e},p.each=function(t,n,r){var i=t._nodes;i&&i.length&&e.Array.each(i,n,r||t)},p.addMethod=function(t,n,r){t&&n&&(p.prototype[t]=function(){var t=[],i=arguments;return e.Array.each(this._nodes,function(s){var o=s.uniqueID&&s.nodeType!==9?"uniqueID":"_yuid",u=e.Node._instances[s[o]],a,f;u||(u=p._getTempNode(s)),a=r||u,f=n.apply(a,i),f!==undefined&&f!==u&&(t[t.length]=f)}),t.length?t:this})},p.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,p.addMethod(n,t[n])):e.Array.each(n,function(e){p.importMethod(t,e)})},p._getTempNode=function(t){var n=p._tempNode;return n||(n=e.Node.create(""),p._tempNode=n),n._node=t,n._stateProxy=t,n},e.mix(p.prototype,{_invoke:function(e,t,n){var r=n?[]:this;return this.each(function(i){var s=i[e].apply(i,t);n&&r.push(s)}),r},item:function(t){return e.one((this._nodes||[])[t])},each:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){return i=e.one(i),t.call(n||i,i,s,r)}),r},batch:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){var o=e.Node._instances[i[u]];return o||(o=p._getTempNode(i)),t.call(n||o,o,s,r)}),r},some:function(t,n){var r=this;return e.Array.some(this._nodes,function(i,s){return i=e.one(i),n=n||i,t.call(n,i,s,r)})},toFrag:function(){return e.one(e.DOM._nl2frag(this._nodes))},indexOf:function(t){return e.Array.indexOf(this._nodes,e.Node.getDOMNode(t))},filter:function(t){return e.all(e.Selector.filter(this._nodes,t))},modulus:function(t,n){n=n||0;var r=[];return p.each(this,function(e,i){i%t===n&&r.push(e)}),e.all(r)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var t,n=this._nodes,r=this._query,i=this._queryRoot;return r&&(i||n&&n[0]&&n[0].ownerDocument&&(i=n[0].ownerDocument),this._nodes=e.Selector.query(r,i)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e="",t=this[u]+": not bound to any nodes",n=this._nodes,i;return n&&n[0]&&(i=n[0],e+=i[r],i.id&&(e+="#"+i.id),i.className&&(e+="."+i.className.replace(" ",".")),n.length>1&&(e+="...["+n.length+" items]")),e||t},getDOMNodes:function(){return this._nodes}},!0),p.importMethod(e.Node.prototype,["destroy","empty","remove","set"]),p.prototype.get=function(t){var n=[],r=this._nodes,i=!1,s=p._getTempNode,o,u;return r[0]&&(o=e.Node._instances[r[0]._yuid]||s(r[0]),u=o._get(t),u&&u.nodeType&&(i=!0)),e.Array.each(r,function(r){o=e.Node._instances[r._yuid],o||(o=s(r)),u=o._get(t),i||(u=e.Node.scrubVal(u,o)),n.push(u)}),i?e.all(n):n},e.NodeList=p,e.all=function(e){return new p(e)},e.Node.all=e.all;var d=e.NodeList,v=Array.prototype,m={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};e.Object.each(m,function(t,n){d.prototype[n]=function(){var r=[],i=0,s,o;while(typeof (s=arguments[i++])!="undefined")r.push(s._node||s._nodes||s);return o=v[n].apply(this._nodes,r),t?o=e.all(o):o=e.Node.scrubVal(o),o}}),e.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(t){e.Node.prototype[t]=function(e,n,r){var i=this.invoke(t,e,n,r);return i}}),e.Node.prototype.removeAttribute=function(e){var t=this._node;return t&&t.removeAttribute(e,0),this},e.Node.importMethod(e.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),e.NodeList.importMethod(e.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"3.12.0",{requires:["dom-core","selector"]});
diff --git a/lib/yuilib/3.9.1/build/node-core/node-core.js b/lib/yuilib/3.12.0/node-core/node-core.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/node-core/node-core.js
rename to lib/yuilib/3.12.0/node-core/node-core.js
index c78d36547e4..1db2f9e1dec
--- a/lib/yuilib/3.9.1/build/node-core/node-core.js
+++ b/lib/yuilib/3.12.0/node-core/node-core.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-core', function (Y, NAME) {
/**
@@ -208,7 +214,7 @@ Y_Node.addMethod = function(name, fn, context) {
}
args.unshift(node._node);
- ret = fn.apply(node, args);
+ ret = fn.apply(context || node, args);
if (ret) { // scrub truthy
ret = Y_Node.scrubVal(ret, node);
@@ -636,10 +642,15 @@ Y.mix(Y_Node.prototype, {
* @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
*/
all: function(selector) {
- var nodelist = Y.all(Y.Selector.query(selector, this._node));
- nodelist._query = selector;
- nodelist._queryRoot = this._node;
- return nodelist;
+ var nodelist;
+
+ if (this._node) {
+ nodelist = Y.all(Y.Selector.query(selector, this._node));
+ nodelist._query = selector;
+ nodelist._queryRoot = this._node;
+ }
+
+ return nodelist || Y.all([]);
},
// TODO: allow fn test
@@ -1596,4 +1607,4 @@ Y.NodeList.importMethod(Y.Node.prototype, [
]);
-}, '3.9.1', {"requires": ["dom-core", "selector"]});
+}, '3.12.0', {"requires": ["dom-core", "selector"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-delegate/node-event-delegate-debug.js b/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate-debug.js
old mode 100644
new mode 100755
similarity index 92%
rename from lib/yuilib/3.9.1/build/node-event-delegate/node-event-delegate-debug.js
rename to lib/yuilib/3.12.0/node-event-delegate/node-event-delegate-debug.js
index b35cc839ef7..75642e3728f
--- a/lib/yuilib/3.9.1/build/node-event-delegate/node-event-delegate-debug.js
+++ b/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-event-delegate', function (Y, NAME) {
/**
@@ -52,4 +58,4 @@ Y.Node.prototype.delegate = function(type) {
};
-}, '3.9.1', {"requires": ["node-base", "event-delegate"]});
+}, '3.12.0', {"requires": ["node-base", "event-delegate"]});
diff --git a/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate-min.js b/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate-min.js
new file mode 100755
index 00000000000..03fca3c7fae
--- /dev/null
+++ b/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate-min.js
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("node-event-delegate",function(e,t){e.Node.prototype.delegate=function(t){var n=e.Array(arguments,0,!0),r=e.Lang.isObject(t)&&!e.Lang.isArray(t)?1:2;return n.splice(r,0,this._node),e.delegate.apply(e,n)}},"3.12.0",{requires:["node-base","event-delegate"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-delegate/node-event-delegate.js b/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate.js
old mode 100644
new mode 100755
similarity index 92%
rename from lib/yuilib/3.9.1/build/node-event-delegate/node-event-delegate.js
rename to lib/yuilib/3.12.0/node-event-delegate/node-event-delegate.js
index b35cc839ef7..75642e3728f
--- a/lib/yuilib/3.9.1/build/node-event-delegate/node-event-delegate.js
+++ b/lib/yuilib/3.12.0/node-event-delegate/node-event-delegate.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-event-delegate', function (Y, NAME) {
/**
@@ -52,4 +58,4 @@ Y.Node.prototype.delegate = function(type) {
};
-}, '3.9.1', {"requires": ["node-base", "event-delegate"]});
+}, '3.12.0', {"requires": ["node-base", "event-delegate"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-html5/node-event-html5-debug.js b/lib/yuilib/3.12.0/node-event-html5/node-event-html5-debug.js
old mode 100644
new mode 100755
similarity index 81%
rename from lib/yuilib/3.9.1/build/node-event-html5/node-event-html5-debug.js
rename to lib/yuilib/3.12.0/node-event-html5/node-event-html5-debug.js
index 0f3b5c4ee9b..da4f2c50f3d
--- a/lib/yuilib/3.9.1/build/node-event-html5/node-event-html5-debug.js
+++ b/lib/yuilib/3.12.0/node-event-html5/node-event-html5-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-event-html5', function (Y, NAME) {
/**
@@ -50,4 +56,4 @@ Y.mix(Y.Node.DOM_EVENTS, {
});
-}, '3.9.1', {"requires": ["node-base"]});
+}, '3.12.0', {"requires": ["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-html5/node-event-html5-min.js b/lib/yuilib/3.12.0/node-event-html5/node-event-html5-min.js
old mode 100644
new mode 100755
similarity index 65%
rename from lib/yuilib/3.9.1/build/node-event-html5/node-event-html5-min.js
rename to lib/yuilib/3.12.0/node-event-html5/node-event-html5-min.js
index 80f8a3ae25a..97e6572636b
--- a/lib/yuilib/3.9.1/build/node-event-html5/node-event-html5-min.js
+++ b/lib/yuilib/3.12.0/node-event-html5/node-event-html5-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("node-event-html5",function(e,t){e.mix(e.Node.DOM_EVENTS,{DOMActivate:1,DOMContentLoaded:1,afterprint:1,beforeprint:1,canplay:1,canplaythrough:1,durationchange:1,emptied:1,ended:1,formchange:1,forminput:1,hashchange:1,input:1,invalid:1,loadedmetadata:1,loadeddata:1,loadstart:1,offline:1,online:1,pagehide:1,pageshow:1,pause:1,play:1,playing:1,popstate:1,progress:1,ratechange:1,readystatechange:1,redo:1,seeking:1,seeked:1,show:1,stalled:1,suspend:1,timeupdate:1,undo:1,volumechange:1,waiting:1})},"3.9.1",{requires:["node-base"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("node-event-html5",function(e,t){e.mix(e.Node.DOM_EVENTS,{DOMActivate:1,DOMContentLoaded:1,afterprint:1,beforeprint:1,canplay:1,canplaythrough:1,durationchange:1,emptied:1,ended:1,formchange:1,forminput:1,hashchange:1,input:1,invalid:1,loadedmetadata:1,loadeddata:1,loadstart:1,offline:1,online:1,pagehide:1,pageshow:1,pause:1,play:1,playing:1,popstate:1,progress:1,ratechange:1,readystatechange:1,redo:1,seeking:1,seeked:1,show:1,stalled:1,suspend:1,timeupdate:1,undo:1,volumechange:1,waiting:1})},"3.12.0",{requires:["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-html5/node-event-html5.js b/lib/yuilib/3.12.0/node-event-html5/node-event-html5.js
old mode 100644
new mode 100755
similarity index 81%
rename from lib/yuilib/3.9.1/build/node-event-html5/node-event-html5.js
rename to lib/yuilib/3.12.0/node-event-html5/node-event-html5.js
index 0f3b5c4ee9b..da4f2c50f3d
--- a/lib/yuilib/3.9.1/build/node-event-html5/node-event-html5.js
+++ b/lib/yuilib/3.12.0/node-event-html5/node-event-html5.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-event-html5', function (Y, NAME) {
/**
@@ -50,4 +56,4 @@ Y.mix(Y.Node.DOM_EVENTS, {
});
-}, '3.9.1', {"requires": ["node-base"]});
+}, '3.12.0', {"requires": ["node-base"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-simulate/node-event-simulate-debug.js b/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate-debug.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/node-event-simulate/node-event-simulate-debug.js
rename to lib/yuilib/3.12.0/node-event-simulate/node-event-simulate-debug.js
index e082856b48f..f772a3f66c3
--- a/lib/yuilib/3.9.1/build/node-event-simulate/node-event-simulate-debug.js
+++ b/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-event-simulate', function (Y, NAME) {
/**
@@ -187,4 +193,4 @@ Y.Node.prototype.simulateGesture = function (name, options, cb) {
};
-}, '3.9.1', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
+}, '3.12.0', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
diff --git a/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate-min.js b/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate-min.js
new file mode 100755
index 00000000000..1254d740cee
--- /dev/null
+++ b/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate-min.js
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("node-event-simulate",function(e,t){e.Node.prototype.simulate=function(t,n){e.Event.simulate(e.Node.getDOMNode(this),t,n)},e.Node.prototype.simulateGesture=function(t,n,r){e.Event.simulateGesture(this,t,n,r)}},"3.12.0",{requires:["node-base","event-simulate","gesture-simulate"]});
diff --git a/lib/yuilib/3.9.1/build/node-event-simulate/node-event-simulate.js b/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/node-event-simulate/node-event-simulate.js
rename to lib/yuilib/3.12.0/node-event-simulate/node-event-simulate.js
index e082856b48f..f772a3f66c3
--- a/lib/yuilib/3.9.1/build/node-event-simulate/node-event-simulate.js
+++ b/lib/yuilib/3.12.0/node-event-simulate/node-event-simulate.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-event-simulate', function (Y, NAME) {
/**
@@ -187,4 +193,4 @@ Y.Node.prototype.simulateGesture = function (name, options, cb) {
};
-}, '3.9.1', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
+}, '3.12.0', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
diff --git a/lib/yuilib/3.12.0/node-flick/assets/node-flick-core.css b/lib/yuilib/3.12.0/node-flick/assets/node-flick-core.css
new file mode 100755
index 00000000000..c152cda6d2d
--- /dev/null
+++ b/lib/yuilib/3.12.0/node-flick/assets/node-flick-core.css
@@ -0,0 +1,15 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+.yui3-flick {
+ position:relative;
+ overflow:hidden;
+}
+
+.yui3-flick-content {
+ position:relative;
+}
diff --git a/lib/yuilib/3.12.0/node-flick/assets/skins/sam/node-flick-skin.css b/lib/yuilib/3.12.0/node-flick/assets/skins/sam/node-flick-skin.css
new file mode 100755
index 00000000000..5c4f12289ae
--- /dev/null
+++ b/lib/yuilib/3.12.0/node-flick/assets/skins/sam/node-flick-skin.css
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+/* empty */
diff --git a/lib/yuilib/3.12.0/node-flick/assets/skins/sam/node-flick.css b/lib/yuilib/3.12.0/node-flick/assets/skins/sam/node-flick.css
new file mode 100755
index 00000000000..9afa3bbe203
--- /dev/null
+++ b/lib/yuilib/3.12.0/node-flick/assets/skins/sam/node-flick.css
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+.yui3-flick{position:relative;overflow:hidden}.yui3-flick-content{position:relative}#yui3-css-stamp.skin-sam-node-flick{display:none}
diff --git a/lib/yuilib/3.9.1/build/node-flick/node-flick-debug.js b/lib/yuilib/3.12.0/node-flick/node-flick-debug.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/node-flick/node-flick-debug.js
rename to lib/yuilib/3.12.0/node-flick/node-flick-debug.js
index 85dc4902fba..26f86b8871e
--- a/lib/yuilib/3.9.1/build/node-flick/node-flick-debug.js
+++ b/lib/yuilib/3.12.0/node-flick/node-flick-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('node-flick', function (Y, NAME) {
/**
@@ -522,4 +528,4 @@ YUI.add('node-flick', function (Y, NAME) {
Y.Plugin.Flick = Flick;
-}, '3.9.1', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});
+}, '3.12.0', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});
diff --git a/lib/yuilib/3.9.1/build/node-flick/node-flick-min.js b/lib/yuilib/3.12.0/node-flick/node-flick-min.js
old mode 100644
new mode 100755
similarity index 91%
rename from lib/yuilib/3.9.1/build/node-flick/node-flick-min.js
rename to lib/yuilib/3.12.0/node-flick/node-flick-min.js
index d2d092ac371..6653a092532
--- a/lib/yuilib/3.9.1/build/node-flick/node-flick-min.js
+++ b/lib/yuilib/3.12.0/node-flick/node-flick-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("node-flick",function(e,t){function b(e){b.superclass.constructor.apply(this,arguments)}var n="host",r="parentNode",i="boundingBox",s="offsetHeight",o="offsetWidth",u="scrollHeight",a="scrollWidth",f="bounce",l="minDistance",c="minVelocity",h="bounceDistance",p="deceleration",d="step",v="duration",m="easing",g="flick",y=e.ClassNameManager.getClassName;b.ATTRS={deceleration:{value:.98},bounce:{value:.7},bounceDistance:{value:150},minVelocity:{value:0},minDistance:{value:10},boundingBox:{valueFn:function(){return this.get(n).get(r)}},step:{value:10},duration:{value:null},easing:{value:null}},b.NAME="pluginFlick",b.NS="flick",e.extend(b,e.Plugin.Base,{initializer:function(t){this._node=this.get(n),this._renderClasses(),this.setBounds(),this._node.on(g,e.bind(this._onFlick,this),{minDistance:this.get(l),minVelocity:this.get(c)})},setBounds:function(){var e=this.get(i),t=this._node,n=e.get(s),r=e.get(o),f=t.get(u),l=t.get(a);f>n&&(this._maxY=f-n,this._minY=0,this._scrollY=!0),l>r&&(this._maxX=l-r,this._minX=0,this._scrollX=!0),this._x=this._y=0,t.set("top",this._y+"px"),t.set("left",this._x+"px")},_renderClasses:function(){this.get(i).addClass(b.CLASS_NAMES.box),this._node.addClass(b.CLASS_NAMES.content)},_onFlick:function(e){this._v=e.flick.velocity,this._flick=!0,this._flickAnim()},_flickAnim:function(){var t=this._y,n=this._x,r=this._maxY,i=this._minY,s=this._maxX,o=this._minX,u=this._v,a=this.get(d),l=this.get(p),c=this.get(f);this._v=u*l,this._snapToEdge=!1,this._scrollX&&(n-=u*a),this._scrollY&&(t-=u*a),Math.abs(u).toFixed(4)<=b.VELOCITY_THRESHOLD?(this._flick=!1,this._killTimer(!this._exceededYBoundary&&!this._exceededXBoundary),this._scrollX&&(n
+
+ @module paginator
+ @main paginator
+ @class Paginator
+ @constructor
+ @since 3.11.0
+ */
+
+Y.Paginator = Y.mix(
+ Y.Base.create('pagiantor', Y.Base, [Y.Paginator.Core]),
+ Y.Paginator
+);
+
+}, '3.12.0', {"requires": ["paginator-core"]});
diff --git a/lib/yuilib/3.12.0/paginator/paginator-min.js b/lib/yuilib/3.12.0/paginator/paginator-min.js
new file mode 100755
index 00000000000..8adb407d152
--- /dev/null
+++ b/lib/yuilib/3.12.0/paginator/paginator-min.js
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("paginator",function(e,t){e.Paginator=e.mix(e.Base.create("pagiantor",e.Base,[e.Paginator.Core]),e.Paginator)},"3.12.0",{requires:["paginator-core"]});
diff --git a/lib/yuilib/3.12.0/paginator/paginator.js b/lib/yuilib/3.12.0/paginator/paginator.js
new file mode 100755
index 00000000000..aebd6fe09a6
--- /dev/null
+++ b/lib/yuilib/3.12.0/paginator/paginator.js
@@ -0,0 +1,81 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('paginator', function (Y, NAME) {
+
+/**
+ The Paginator utility allows you to display an item or a group of items
+ depending on the number of items you wish to display at one time.
+
+ Paginator's primary functionality is contained in `paginator-core` and is mixed
+ into `paginator` to allow `paginator` to have extra functionality added to it
+ while leaving the core functionality untouched. This allows `paginator-core` to
+ remain available for use later on or used in isolation if it is the only piece
+ you need.
+
+ Due to the vast number of interfaces a paginator could possibly consist of,
+ `Paginator` does not contain any ready to use UIs. However, `Paginator` is
+ ready to be used in any Based-based, module such as a Widget, by extending your
+ desired class and mixing in `Paginator`. This is displayed in the following
+ example:
+
+
+ YUI().use('paginator-url', 'widget', function (Y){
+ var MyPaginator = Y.Base.create('my-paginator', Y.Widget, [Y.Paginator], {
+
+ renderUI: function () {
+ var numbers = '',
+ i, numberOfPages = this.get('totalPages');
+
+ for (i = 1; i <= numberOfPages; i++) {
+ // use paginator-url's formatUrl method
+ numbers += '<a href="' + this.formatUrl(i) + '">' + i + '</a>';
+ }
+
+ this.get('boundingBox').append(numbers);
+ },
+
+ bindUI: function () {
+ this.get('boundingBox').delegate('click', function (e) {
+ // let's not go to the page, just update internally
+ e.preventDefault();
+ this.set('page', parseInt(e.currentTarget.getContent(), 10));
+ }, 'a', this);
+
+ this.after('pageChange', function (e) {
+ // mark the link selected when it's the page being displayed
+ var bb = this.get('boundingBox'),
+ activeClass = 'selected';
+
+ bb.all('a').removeClass(activeClass).item(e.newVal).addClass(activeClass);
+ });
+ }
+
+ });
+
+ var myPg = new MyPaginator({
+ totalItems: 100,
+ pageUrl: '?pg={page}'
+ });
+
+ myPg.render();
+ });
+
+
+ @module paginator
+ @main paginator
+ @class Paginator
+ @constructor
+ @since 3.11.0
+ */
+
+Y.Paginator = Y.mix(
+ Y.Base.create('pagiantor', Y.Base, [Y.Paginator.Core]),
+ Y.Paginator
+);
+
+}, '3.12.0', {"requires": ["paginator-core"]});
diff --git a/lib/yuilib/3.9.1/build/panel/assets/panel-core.css b/lib/yuilib/3.12.0/panel/assets/panel-core.css
old mode 100644
new mode 100755
similarity index 75%
rename from lib/yuilib/3.9.1/build/panel/assets/panel-core.css
rename to lib/yuilib/3.12.0/panel/assets/panel-core.css
index 284e1e6b633..108e8d35e03
--- a/lib/yuilib/3.9.1/build/panel/assets/panel-core.css
+++ b/lib/yuilib/3.12.0/panel/assets/panel-core.css
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
.yui3-panel {
position: absolute;
}
diff --git a/lib/yuilib/3.9.1/build/panel/assets/skins/night/panel-skin.css b/lib/yuilib/3.12.0/panel/assets/skins/night/panel-skin.css
old mode 100644
new mode 100755
similarity index 96%
rename from lib/yuilib/3.9.1/build/panel/assets/skins/night/panel-skin.css
rename to lib/yuilib/3.12.0/panel/assets/skins/night/panel-skin.css
index 92a46b48c16..2f571bb5a8f
--- a/lib/yuilib/3.9.1/build/panel/assets/skins/night/panel-skin.css
+++ b/lib/yuilib/3.12.0/panel/assets/skins/night/panel-skin.css
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
.yui3-skin-night .yui3-panel {
color: #FFFFFF;
font-family: HelveticaNeue, arial, helvetica, clean, sans-serif;
diff --git a/lib/yuilib/3.12.0/panel/assets/skins/night/panel.css b/lib/yuilib/3.12.0/panel/assets/skins/night/panel.css
new file mode 100755
index 00000000000..f460b5b7cd3
--- /dev/null
+++ b/lib/yuilib/3.12.0/panel/assets/skins/night/panel.css
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+.yui3-panel{position:absolute}.yui3-panel-hidden{visibility:hidden}.yui3-widget-tmp-forcesize .yui3-panel-content{overflow:hidden!important}.yui3-panel .yui3-widget-hd{position:relative}.yui3-panel .yui3-widget-hd .yui3-widget-buttons{position:absolute;top:0;right:0}.yui3-panel .yui3-widget-ft .yui3-widget-buttons{display:inline-block;*display:inline;zoom:1}.yui3-skin-night .yui3-panel{color:#fff;font-family:HelveticaNeue,arial,helvetica,clean,sans-serif}.yui3-skin-night .yui3-panel-content{background:#6d6e6e;-webkit-box-shadow:0 0 20px #000;-moz-box-shadow:0 0 20px #000;box-shadow:0 0 20px #000;border:1px solid black;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.yui3-skin-night .yui3-panel .yui3-widget-hd{padding:11px 57px 11px 22px;min-height:17px;_height:17px;-webkit-border-top-left-radius:7px;-webkit-border-top-right-radius:7px;-moz-border-radius-topleft:7px;-moz-border-radius-topright:7px;border-top-left-radius:7px;border-top-right-radius:7px;font-weight:bold;color:white;background-color:#555658;background:-moz-linear-gradient(0% 100% 90deg,#343536 0,#555658 96%,#3e3f41 100%);background:-webkit-gradient(linear,left bottom,left top,from(#343536),color-stop(0.96,#555658),to(#3e3f41))}.yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-widget-buttons{padding:11px}.yui3-skin-night .yui3-panel .yui3-widget-bd{padding:11px 22px 17px}.yui3-skin-night .yui3-panel .yui3-widget-ft{background-color:#575858;border-top:1px solid #494a4a;padding:6px 16px 8px;text-align:center;-webkit-border-bottom-right-radius:7px;-webkit-border-bottom-left-radius:7px;-moz-border-radius-bottomright:7px;-moz-border-radius-bottomleft:7px;border-bottom-right-radius:7px;border-bottom-left-radius:7px}.yui3-skin-night .yui3-panel .yui3-widget-ft .yui3-widget-buttons{bottom:0;position:relative;right:auto;width:100%;text-align:center;padding-bottom:0;margin-left:-5px;margin-right:-5px}.yui3-skin-night .yui3-panel .yui3-widget-ft .yui3-button{margin:5px}.yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-button-close{background:transparent;filter:none;border:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;width:22px;height:17px;padding:0;overflow:hidden;vertical-align:top;*font-size:0;*line-height:0;*letter-spacing:-1000px;*color:#86a5ec;*background:url(sprite_icons.png) no-repeat center 3px}.yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-button-close:hover{background-color:#333}.yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-button-close:before{content:url(sprite_icons.png);display:inline-block;text-align:center;font-size:0;line-height:0;width:22px;margin:3px 0 0 1px}.yui3-skin-night .yui3-panel-hidden .yui3-widget-hd .yui3-button-close{display:none}#yui3-css-stamp.skin-night-panel{display:none}
diff --git a/lib/yuilib/3.12.0/panel/assets/skins/night/sprite_icons.png b/lib/yuilib/3.12.0/panel/assets/skins/night/sprite_icons.png
new file mode 100755
index 0000000000000000000000000000000000000000..34fd6cdc6443c083be6e5c9191d2e302e2b6f74a
GIT binary patch
literal 176
zcmeAS@N?(olHy`uVBq!ia0vp@K%BzC3?#G8dEEh0JOMr-u0T38Ji
+ YUI().use('paginator-url', 'widget', function (Y){
+ var MyPaginator = Y.Base.create('my-paginator', Y.Widget, [Y.Paginator], {
+
+ renderUI: function () {
+ var numbers = '',
+ i, numberOfPages = this.get('totalPages');
+
+ for (i = 1; i <= numberOfPages; i++) {
+ // use paginator-url's formatUrl method
+ numbers += '<a href="' + this.formatUrl(i) + '">' + i + '</a>';
+ }
+
+ this.get('boundingBox').append(numbers);
+ },
+
+ bindUI: function () {
+ this.get('boundingBox').delegate('click', function (e) {
+ // let's not go to the page, just update internally
+ e.preventDefault();
+ this.set('page', parseInt(e.currentTarget.getContent(), 10));
+ }, 'a', this);
+
+ this.after('pageChange', function (e) {
+ // mark the link selected when it's the page being displayed
+ var bb = this.get('boundingBox'),
+ activeClass = 'selected';
+
+ bb.all('a').removeClass(activeClass).item(e.newVal).addClass(activeClass);
+ });
+ }
+
+ });
+
+ var myPg = new MyPaginator({
+ totalItems: 100,
+ pageUrl: '?pg={page}'
+ });
+
+ myPg.render();
+ });
+ s?e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&e.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),e.moveTo(r,i)},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:!0,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10}}},e.augment(r,e.Attribute),e.Lines=r},"3.9.1");
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("series-line-util",function(e,t){function r(){}var n=e.Lang;r.prototype={_lineDefaults:null,_getGraphic:function(){var e=this.get("graphic")||this.get("graph").get("graphic");return this._lineGraphic||(this._lineGraphic=e.addShape({type:"path"})),this._lineGraphic.clear(),this._lineGraphic},_toggleVisible:function(e){this._lineGraphic&&this._lineGraphic.set("visible",e)},drawLines:function(){if(this.get("xcoords").length<1)return;var e=n.isNumber,t,r,i=this.get("direction"),s,o,u,a=!0,f,l,c,h,p,d=this.get("styles").line,v=d.lineType,m=d.color||this._getDefaultColor(this.get("graphOrder"),"line"),g=d.alpha,y=d.dashLength,b=d.gapSpace,w=d.connectDiscontinuousPoints,E=d.discontinuousType,S=d.discontinuousDashLength,x=d.discontinuousGapSpace,T=this._getGraphic();this._stacked?(t=this.get("stackedXCoords"),r=this.get("stackedYCoords")):(t=this.get("xcoords"),r=this.get("ycoords")),s=i==="vertical"?r.length:t.length,T.set("stroke",{weight:d.weight,color:m,opacity:g});for(p=0;ps?e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&e.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),e.moveTo(r,i)},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:!0,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10}}},e.augment(r,e.Attribute),e.Lines=r},"3.12.0");
diff --git a/lib/yuilib/3.9.1/build/series-line-util/series-line-util.js b/lib/yuilib/3.12.0/series-line-util/series-line-util.js
old mode 100644
new mode 100755
similarity index 98%
rename from lib/yuilib/3.9.1/build/series-line-util/series-line-util.js
rename to lib/yuilib/3.12.0/series-line-util/series-line-util.js
index 9e7be79343f..3eacf4004cc
--- a/lib/yuilib/3.9.1/build/series-line-util/series-line-util.js
+++ b/lib/yuilib/3.12.0/series-line-util/series-line-util.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-line-util', function (Y, NAME) {
/**
@@ -285,4 +291,4 @@ Y.augment(Lines, Y.Attribute);
Y.Lines = Lines;
-}, '3.9.1');
+}, '3.12.0');
diff --git a/lib/yuilib/3.9.1/build/series-line/series-line-debug.js b/lib/yuilib/3.12.0/series-line/series-line-debug.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/series-line/series-line-debug.js
rename to lib/yuilib/3.12.0/series-line/series-line-debug.js
index 9479d2472f6..0cf3b4ccec0
--- a/lib/yuilib/3.9.1/build/series-line/series-line-debug.js
+++ b/lib/yuilib/3.12.0/series-line/series-line-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-line', function (Y, NAME) {
/**
@@ -111,4 +117,4 @@ Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {
-}, '3.9.1', {"requires": ["series-cartesian", "series-line-util"]});
+}, '3.12.0', {"requires": ["series-cartesian", "series-line-util"]});
diff --git a/lib/yuilib/3.9.1/build/series-line/series-line-min.js b/lib/yuilib/3.12.0/series-line/series-line-min.js
old mode 100644
new mode 100755
similarity index 61%
rename from lib/yuilib/3.9.1/build/series-line/series-line-min.js
rename to lib/yuilib/3.12.0/series-line/series-line-min.js
index f0c826d3f3f..c7c01bc2d32
--- a/lib/yuilib/3.9.1/build/series-line/series-line-min.js
+++ b/lib/yuilib/3.12.0/series-line/series-line-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("series-line",function(e,t){e.LineSeries=e.Base.create("lineSeries",e.CartesianSeries,[e.Lines],{drawSeries:function(){this.drawLines()},_setStyles:function(t){return t.line||(t={line:t}),e.LineSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},e.LineSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"line"}}})},"3.9.1",{requires:["series-cartesian","series-line-util"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("series-line",function(e,t){e.LineSeries=e.Base.create("lineSeries",e.CartesianSeries,[e.Lines],{drawSeries:function(){this.drawLines()},_setStyles:function(t){return t.line||(t={line:t}),e.LineSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},e.LineSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"line"}}})},"3.12.0",{requires:["series-cartesian","series-line-util"]});
diff --git a/lib/yuilib/3.9.1/build/series-line/series-line.js b/lib/yuilib/3.12.0/series-line/series-line.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/series-line/series-line.js
rename to lib/yuilib/3.12.0/series-line/series-line.js
index 9479d2472f6..0cf3b4ccec0
--- a/lib/yuilib/3.9.1/build/series-line/series-line.js
+++ b/lib/yuilib/3.12.0/series-line/series-line.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-line', function (Y, NAME) {
/**
@@ -111,4 +117,4 @@ Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {
-}, '3.9.1', {"requires": ["series-cartesian", "series-line-util"]});
+}, '3.12.0', {"requires": ["series-cartesian", "series-line-util"]});
diff --git a/lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked-debug.js b/lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked-debug.js
old mode 100644
new mode 100755
similarity index 85%
rename from lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked-debug.js
rename to lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked-debug.js
index 24cef7be069..15bfde6bb03
--- a/lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked-debug.js
+++ b/lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-marker-stacked', function (Y, NAME) {
/**
@@ -48,4 +54,4 @@ Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.
-}, '3.9.1', {"requires": ["series-stacked", "series-marker"]});
+}, '3.12.0', {"requires": ["series-stacked", "series-marker"]});
diff --git a/lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked-min.js b/lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked-min.js
old mode 100644
new mode 100755
similarity index 51%
rename from lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked-min.js
rename to lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked-min.js
index 35060a3c5f8..62c76073912
--- a/lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked-min.js
+++ b/lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("series-marker-stacked",function(e,t){e.StackedMarkerSeries=e.Base.create("stackedMarkerSeries",e.MarkerSeries,[e.StackingUtil],{setAreaData:function(){e.StackedMarkerSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedMarker"}}})},"3.9.1",{requires:["series-stacked","series-marker"]});
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("series-marker-stacked",function(e,t){e.StackedMarkerSeries=e.Base.create("stackedMarkerSeries",e.MarkerSeries,[e.StackingUtil],{setAreaData:function(){e.StackedMarkerSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedMarker"}}})},"3.12.0",{requires:["series-stacked","series-marker"]});
diff --git a/lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked.js b/lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked.js
old mode 100644
new mode 100755
similarity index 85%
rename from lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked.js
rename to lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked.js
index 24cef7be069..15bfde6bb03
--- a/lib/yuilib/3.9.1/build/series-marker-stacked/series-marker-stacked.js
+++ b/lib/yuilib/3.12.0/series-marker-stacked/series-marker-stacked.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-marker-stacked', function (Y, NAME) {
/**
@@ -48,4 +54,4 @@ Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.
-}, '3.9.1', {"requires": ["series-stacked", "series-marker"]});
+}, '3.12.0', {"requires": ["series-stacked", "series-marker"]});
diff --git a/lib/yuilib/3.9.1/build/series-marker/series-marker-debug.js b/lib/yuilib/3.12.0/series-marker/series-marker-debug.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/series-marker/series-marker-debug.js
rename to lib/yuilib/3.12.0/series-marker/series-marker-debug.js
index 59f9a1fbcd7..fbae2500687
--- a/lib/yuilib/3.9.1/build/series-marker/series-marker-debug.js
+++ b/lib/yuilib/3.12.0/series-marker/series-marker-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-marker', function (Y, NAME) {
/**
@@ -87,4 +93,4 @@ Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {
-}, '3.9.1', {"requires": ["series-cartesian", "series-plot-util"]});
+}, '3.12.0', {"requires": ["series-cartesian", "series-plot-util"]});
diff --git a/lib/yuilib/3.12.0/series-marker/series-marker-min.js b/lib/yuilib/3.12.0/series-marker/series-marker-min.js
new file mode 100755
index 00000000000..50ec979de03
--- /dev/null
+++ b/lib/yuilib/3.12.0/series-marker/series-marker-min.js
@@ -0,0 +1,8 @@
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("series-marker",function(e,t){e.MarkerSeries=e.Base.create("markerSeries",e.CartesianSeries,[e.Plots],{_setStyles:function(t){return t.marker||(t={marker:t}),t=this._parseMarkerStyles(t),e.MarkerSeries.superclass._mergeStyles.apply(this,[t,this._getDefaultStyles()])}},{ATTRS:{type:{value:"marker"}}})},"3.12.0",{requires:["series-cartesian","series-plot-util"]});
diff --git a/lib/yuilib/3.9.1/build/series-marker/series-marker.js b/lib/yuilib/3.12.0/series-marker/series-marker.js
old mode 100644
new mode 100755
similarity index 94%
rename from lib/yuilib/3.9.1/build/series-marker/series-marker.js
rename to lib/yuilib/3.12.0/series-marker/series-marker.js
index 59f9a1fbcd7..fbae2500687
--- a/lib/yuilib/3.9.1/build/series-marker/series-marker.js
+++ b/lib/yuilib/3.12.0/series-marker/series-marker.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-marker', function (Y, NAME) {
/**
@@ -87,4 +93,4 @@ Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {
-}, '3.9.1', {"requires": ["series-cartesian", "series-plot-util"]});
+}, '3.12.0', {"requires": ["series-cartesian", "series-plot-util"]});
diff --git a/lib/yuilib/3.9.1/build/series-ohlc/series-ohlc-debug.js b/lib/yuilib/3.12.0/series-ohlc/series-ohlc-debug.js
old mode 100644
new mode 100755
similarity index 97%
rename from lib/yuilib/3.9.1/build/series-ohlc/series-ohlc-debug.js
rename to lib/yuilib/3.12.0/series-ohlc/series-ohlc-debug.js
index 58ba80854ac..f22a5025ad0
--- a/lib/yuilib/3.9.1/build/series-ohlc/series-ohlc-debug.js
+++ b/lib/yuilib/3.12.0/series-ohlc/series-ohlc-debug.js
@@ -1,4 +1,10 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
+/*
+YUI 3.12.0 (build 8655935)
+Copyright 2013 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
YUI.add('series-ohlc', function (Y, NAME) {
/**
@@ -232,4 +238,4 @@ Y.extend(OHLCSeries, Y.RangeSeries, {
Y.OHLCSeries = OHLCSeries;
-}, '3.9.1', {"requires": ["series-range"]});
+}, '3.12.0', {"requires": ["series-range"]});
diff --git a/lib/yuilib/3.9.1/build/series-ohlc/series-ohlc-min.js b/lib/yuilib/3.12.0/series-ohlc/series-ohlc-min.js
old mode 100644
new mode 100755
similarity index 82%
rename from lib/yuilib/3.9.1/build/series-ohlc/series-ohlc-min.js
rename to lib/yuilib/3.12.0/series-ohlc/series-ohlc-min.js
index 58a90640bb7..e1b87dfcec2
--- a/lib/yuilib/3.9.1/build/series-ohlc/series-ohlc-min.js
+++ b/lib/yuilib/3.12.0/series-ohlc/series-ohlc-min.js
@@ -1,2 +1,8 @@
-/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
-YUI.add("series-ohlc",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}n.NAME="ohlcSeries",n.ATTRS={type:{value:"ohlc"},graphic:{lazyAdd:!1,setter:function(e){return this.get("rendered")||this.set("rendered",!0),this.set("upmarker",e.addShape({type:"path"})),this.set("downmarker",e.addShape({type:"path"})),e}},upmarker:{},downmarker:{}},e.extend(n,e.RangeSeries,{_drawMarkers:function(e,t,n,r,s,o,u,a,f){var l=this.get("upmarker"),c=this.get("downmarker"),h,p,d,v,m,g,y=f.padding.left,b,w;l.set(f.upmarker),c.set(f.downmarker),l.clear(),c.clear();for(i=0;i0&&p0&&p=0){for(i=0;u!==w&&i=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s"}catch(n){return!1}return t.firstChild&&t.firstChild.nodeName==="TBODY"}}),u("innerhtml-div","tr",{test:function(){return d("","tr")}}),u("innerhtml-div","script",{test:function(){return d("","script")}}),a("innerhtml","table")||(p.tbody=function(t,n){var i=r.create(m+t+g,n),s=e.DOM._children(i,"tbody")[0];return i.children.length>1&&s&&!v.test(t)&&s.parentNode.removeChild(s),i}),a("innerhtml-div","script")||(p.script=function(e,t){var n=t.createElement("div");return n.innerHTML="-"+e,n.removeChild(n.firstChild),n},p.link=p.style=p.script),a("innerhtml-div","tr")||(e.mix(p,{option:function(e,t){return r.create('",t)},tr:function(e,t){return r.create(""+e+"",t)},td:function(e,t){return r.create(" "+e+" ",t)},col:function(e,t){return r.create("-1?e:t+d+e},w=e.cached(function(e,t){var n=e,r,i,s;return p.isString(n)?(s=n.indexOf(m),s>-1&&(i=!0,n=n.substr(m.length)),s=n.indexOf(v),s>-1&&(r=n.substr(0,s),n=n.substr(s+1),n==="*"&&(n=null)),[r,t?b(n,t):n,i,n]):n}),E=function(t){var n=this._yuievt,r;n||(n=this._yuievt={events:{},targets:null,config:{host:this,context:this},chain:e.config.chain}),r=n.config,t&&(h(r,t,!0),t.chain!==undefined&&(n.chain=t.chain),t.prefix&&(r.prefix=t.prefix))};E.prototype={constructor:E,once:function(){var e=this.on.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},onceAfter:function(){var e=this.after.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},parseType:function(e,t){return w(e,t||this._yuievt.config.prefix)},on:function(t,n,r){var i=this._yuievt,s=w(t,i.config.prefix),o,u,a,l,c,h,d,v=e.Env.evt.handles,g,y,b,E=e.Node,S,x,T;this._monitor("attach",s[1],{args:arguments,category:s[0],after:s[2]});if(p.isObject(t))return p.isFunction(t)?e.Do.before.apply(e.Do,arguments):(o=n,u=r,a=f.call(arguments,0),l=[],p.isArray(t)&&(T=!0),g=t._after,delete t._after,e.each(t,function(e,t){p.isObject(e)&&(o=e.fn||(p.isFunction(e)?e:o),
+u=e.context||u);var n=g?m:"";a[0]=n+(T?e:t),a[1]=o,a[2]=u,l.push(this.on.apply(this,a))},this),i.chain?this:new e.EventHandle(l));h=s[0],g=s[2],b=s[3];if(E&&e.instanceOf(this,E)&&b in E.DOM_EVENTS)return a=f.call(arguments,0),a.splice(2,0,E.getDOMNode(this)),e.on.apply(e,a);t=s[1];if(e.instanceOf(this,YUI)){y=e.Env.evt.plugins[t],a=f.call(arguments,0),a[0]=b,E&&(S=a[2],e.instanceOf(S,e.NodeList)?S=e.NodeList.getDOMNodes(S):e.instanceOf(S,E)&&(S=E.getDOMNode(S)),x=b in E.DOM_EVENTS,x&&(a[2]=S));if(y)d=y.on.apply(e,a);else if(!t||x)d=e.Event._attach(a)}return d||(c=i.events[t]||this.publish(t),d=c._on(n,r,arguments.length>3?f.call(arguments,3):null,g?"after":!0),t.indexOf("*:")!==-1&&(this._hasSiblings=!0)),h&&(v[h]=v[h]||{},v[h][t]=v[h][t]||[],v[h][t].push(d)),i.chain?this:d},subscribe:function(){return this.on.apply(this,arguments)},detach:function(t,n,r){var i=this._yuievt.events,s,o=e.Node,u=o&&e.instanceOf(this,o);if(!t&&this!==e){for(s in i)i.hasOwnProperty(s)&&i[s].detach(n,r);return u&&e.Event.purgeElement(o.getDOMNode(this)),this}var a=w(t,this._yuievt.config.prefix),l=p.isArray(a)?a[0]:null,c=a?a[3]:null,h,d=e.Env.evt.handles,v,m,g,y,b=function(e,t,n){var r=e[t],i,s;if(r)for(s=r.length-1;s>=0;--s)i=r[s].evt,(i.host===n||i.el===n)&&r[s].detach()};if(l){m=d[l],t=a[1],v=u?e.Node.getDOMNode(this):this;if(m){if(t)b(m,t,v);else for(s in m)m.hasOwnProperty(s)&&b(m,s,v);return this}}else{if(p.isObject(t)&&t.detach)return t.detach(),this;if(u&&(!c||c in o.DOM_EVENTS))return g=f.call(arguments,0),g[2]=o.getDOMNode(this),e.detach.apply(e,g),this}h=e.Env.evt.plugins[c];if(e.instanceOf(this,YUI)){g=f.call(arguments,0);if(h&&h.detach)return h.detach.apply(e,g),this;if(!t||!h&&o&&t in o.DOM_EVENTS)return g[0]=t,e.Event.detach.apply(e.Event,g),this}return y=i[a[1]],y&&y.detach(n,r),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(e){return this.detach(e)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(t,n){var r,i=this._yuievt,s=i.config,o=s.prefix;return typeof t=="string"?(o&&(t=b(t,o)),r=this._publish(t,s,n)):(r={},e.each(t,function(e,t){o&&(t=b(t,o)),r[t]=this._publish(t,s,e||n)},this)),r},_getFullType:function(e){var t=this._yuievt.config.prefix;return t?t+d+e:e},_publish:function(t,n,r){var i,s=this._yuievt,o=s.config,u=o.host,a=o.context,f=s.events;return i=f[t],(o.monitored&&!i||i&&i.monitored)&&this._monitor("publish",t,{args:arguments}),i||(i=f[t]=new e.CustomEvent(t,n),n||(i.host=u,i.context=a)),r&&h(i,r,!0),i},_monitor:function(e,t,n){var r,i,s;if(t){typeof t=="string"?(s=t,i=this.getEvent(t,!0)):(i=t,s=t.type);if(this._yuievt.config.monitored&&(!i||i.monitored)||i&&i.monitored)r=s+"_"+e,n.monitored=e,this.fire.call(this,r,n)}},fire:function(e){var t=typeof e=="string",n=arguments.length,r=e,i=this._yuievt,s=i.config,o=s.prefix,u,a,l,c;t&&n<=3?n===2?c=[arguments[1]]:n===3?c=[arguments[1],arguments[2]]:c=[]:c=f.call(arguments,t?1:0),t||(r=e&&e.type),o&&(r=b(r,o)),a=i.events[r],this._hasSiblings&&(l=this.getSibling(r,a),l&&!a&&(a=this.publish(r))),(s.monitored&&(!a||a.monitored)||a&&a.monitored)&&this._monitor("fire",a||r,{args:c});if(!a){if(i.hasTargets)return this.bubble({type:r},c,this);u=!0}else l&&(a.sibling=l),u=a._fire(c);return i.chain?this:u},getSibling:function(e,t){var n;return e.indexOf(d)>-1&&(e=y(e),n=this.getEvent(e,!0),n&&(n.applyConfig(t),n.bubbles=!1,n.broadcast=0)),n},getEvent:function(e,t){var n,r;return t||(n=this._yuievt.config.prefix,e=n?b(e,n):e),r=this._yuievt.events,r[e]||null},after:function(t,n){var r=f.call(arguments,0);switch(p.type(t)){case"function":return e.Do.after.apply(e.Do,arguments);case"array":case"object":r[0]._after=!0;break;default:r[0]=m+t}return this.on.apply(this,r)},before:function(){return this.on.apply(this,arguments)}},e.EventTarget=E,e.mix(e,E.prototype),E.call(e,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new E,e.Global=YUI.Env.globalEvents},"@VERSION@",{requires:["oop"]}),YUI.add("event-custom-complex",function(e,t){var n,r,i=e.Object,s,o={},u=e.CustomEvent.prototype,a=e.EventTarget.prototype,f=function(e,t){var n;for(n in t)r.hasOwnProperty(n)||(e[n]=t[n])};e.EventFacade=function(e,t){e||(e=o),this._event=e,this.details=e.details,this.type=e.type,this._type=e.type,this.target=e.target,this.currentTarget=t,this.relatedTarget=e.relatedTarget},e.mix(e.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(e){this._event.halt(e),this.prevented=1,this.stopped=e?2:1}}),u.fireComplex=function(t){var n,r,i,s,o,u=!0,a,f,l,c,h,p,d,v,m,g=this,y=g.host||g,b,w,E=g.stack,S=y._yuievt,x;if(E&&g.queuable&&g.type!==E.next.type)return g.log("queue "+g.type),E.queue||(E.queue=[]),E.queue.push([g,t]),!0;x=g.hasSubs()||S.hasTargets||g.broadcast,g.target=g.target||y,g.currentTarget=y,g.details=t.concat();if(x){n=E||{id:g.id,next:g,silent:g.silent,stopped:0,prevented:0,bubbling:null,type:g.type,defaultTargetOnly:g.defaultTargetOnly},f=g.getSubs(),l=f[0],c=f[1],g.stopped=g.type!==n.type?0:n.stopped,g.prevented=g.type!==n.type?0:n.prevented,g.stoppedFn&&(a=new e.EventTarget({fireOnce:!0,context:y}),g.events=a,a.on("stopped",g.stoppedFn)),g.log("Firing "+g.type),g._facade=null,r=g._createFacade(t),l&&g._procSubs(l,t,r),g.bubbles&&y.bubble&&!g.stopped&&(w=n.bubbling,n.bubbling=g.type,n.type!==g.type&&(n.stopped=0,n.prevented=0),u=y.bubble(g,t,null,n),g.stopped=Math.max(g.stopped,n.stopped),g.prevented=Math.max(g.prevented,n.prevented),n.bubbling=w),d=g.prevented,d?(v=g.preventedFn,v&&v.apply(y,t)):(m=g.defaultFn,m&&(!g.defaultTargetOnly&&!n.defaultTargetOnly||y===r.target)&&m.apply(y,t)),g.broadcast&&g._broadcast(t);if(c&&!g.prevented&&g.stopped<2){h=n.afterQueue;if(n.id===g.id||g.type!==S.bubbling){g._procSubs(c,t,r);if(h)while(b=h.last())b()}else p=c,n
+.execDefaultCnt&&(p=e.merge(p),e.each(p,function(e){e.postponed=!0})),h||(n.afterQueue=new e.Queue),n.afterQueue.add(function(){g._procSubs(p,t,r)})}g.target=null;if(n.id===g.id){s=n.queue;if(s)while(s.length)i=s.pop(),o=i[0],n.next=o,o._fire(i[1]);g.stack=null}u=!g.stopped,g.type!==S.bubbling&&(n.stopped=0,n.prevented=0,g.stopped=0,g.prevented=0)}else m=g.defaultFn,m&&(r=g._createFacade(t),(!g.defaultTargetOnly||y===r.target)&&m.apply(y,t));return g._facade=null,u},u._hasPotentialSubscribers=function(){return this.hasSubs()||this.host._yuievt.hasTargets||this.broadcast},u._createFacade=u._getFacade=function(t){var n=this.details,r=n&&n[0],i=r&&typeof r=="object",s=this._facade;return s||(s=new e.EventFacade(this,this.currentTarget)),i?(f(s,r),r.type&&(s.type=r.type),t&&(t[0]=s)):t&&t.unshift(s),s.details=this.details,s.target=this.originalTarget||this.target,s.currentTarget=this.currentTarget,s.stopped=0,s.prevented=0,this._facade=s,this._facade},u._addFacadeToArgs=function(e){var t=e[0];t&&t.halt&&t.stopImmediatePropagation&&t.stopPropagation&&t._event||this._createFacade(e)},u.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},u.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},u.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},u.halt=function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},a.addTarget=function(t){var n=this._yuievt;n.targets||(n.targets={}),n.targets[e.stamp(t)]=t,n.hasTargets=!0},a.getTargets=function(){var e=this._yuievt.targets;return e?i.values(e):[]},a.removeTarget=function(t){var n=this._yuievt.targets;n&&(delete n[e.stamp(t,!0)],i.size(n)===0&&(this._yuievt.hasTargets=!1))},a.bubble=function(e,t,n,r){var i=this._yuievt.targets,s=!0,o,u,a,f,l,c=e&&e.type,h=n||e&&e.target||this,p;if(!e||!e.stopped&&i)for(a in i)if(i.hasOwnProperty(a)){o=i[a],u=o._yuievt.events[c],o._hasSiblings&&(l=o.getSibling(c,u)),l&&!u&&(u=o.publish(c)),p=o._yuievt.bubbling,o._yuievt.bubbling=c;if(!u)o._yuievt.hasTargets&&o.bubble(e,t,h,r);else{l&&(u.sibling=l),u.target=h,u.originalTarget=h,u.currentTarget=o,f=u.broadcast,u.broadcast=!1,u.emitFacade=!0,u.stack=r,s=s&&u.fire.apply(u,t||e.details||[]),u.broadcast=f,u.originalTarget=null;if(u.stopped)break}o._yuievt.bubbling=p}return s},a._hasPotentialSubscribers=function(e){var t=this._yuievt,n=t.events[e];return n?n.hasSubs()||t.hasTargets||n.broadcast:!1},n=new e.EventFacade,r={};for(s in n)r[s]=!0},"@VERSION@",{requires:["event-custom-base"]}),YUI.add("node-core",function(e,t){var n=".",r="nodeName",i="nodeType",s="ownerDocument",o="tagName",u="_yuid",a={},f=Array.prototype.slice,l=e.DOM,c=function(t){if(!this.getDOMNode)return new c(t);if(typeof t=="string"){t=c._fromString(t);if(!t)return null}var n=t.nodeType!==9?t.uniqueID:t[u];n&&c._instances[n]&&c._instances[n]._node!==t&&(t[u]=null),n=n||e.stamp(t),n||(n=e.guid()),this[u]=n,this._node=t,this._stateProxy=t,this._initPlugins&&this._initPlugins()},h=function(t){var n=null;return t&&(n=typeof t=="string"?function(n){return e.Selector.test(n,t)}:function(n){return t(e.one(n))}),n};c.ATTRS={},c.DOM_EVENTS={},c._fromString=function(t){return t&&(t.indexOf("doc")===0?t=e.config.doc:t.indexOf("win")===0?t=e.config.win:t=e.Selector.query(t,null,!0)),t||null},c.NAME="node",c.re_aria=/^(?:role$|aria-)/,c.SHOW_TRANSITION="fadeIn",c.HIDE_TRANSITION="fadeOut",c._instances={},c.getDOMNode=function(e){return e?e.nodeType?e:e._node||null:null},c.scrubVal=function(t,n){if(t){if(typeof t=="object"||typeof t=="function")if(i in t||l.isWindow(t))t=e.one(t);else if(t.item&&!t._nodes||t[0]&&t[0][i])t=e.all(t)}else typeof t=="undefined"?t=n:t===null&&(t=null);return t},c.addMethod=function(e,t,n){e&&t&&typeof t=="function"&&(c.prototype[e]=function(){var e=f.call(arguments),r=this,i;return e[0]&&e[0]._node&&(e[0]=e[0]._node),e[1]&&e[1]._node&&(e[1]=e[1]._node),e.unshift(r._node),i=t.apply(n||r,e),i&&(i=c.scrubVal(i,r)),typeof i!="undefined"||(i=r),i})},c.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,c.addMethod(r,t[n],t)):e.Array.each(n,function(e){c.importMethod(t,e)})},c.one=function(t){var n=null,r,i;if(t){if(typeof t=="string"){t=c._fromString(t);if(!t)return null}else if(t.getDOMNode)return t;if(t.nodeType||e.DOM.isWindow(t)){i=t.uniqueID&&t.nodeType!==9?t.uniqueID:t._yuid,n=c._instances[i],r=n?n._node:null;if(!n||r&&t!==r)n=new c(t),t.nodeType!=11&&(c._instances[n[u]]=n)}}return n},c.DEFAULT_SETTER=function(t,r){var i=this._stateProxy,s;return t.indexOf(n)>-1?(s=t,t=t.split(n),e.Object.setValue(i,t,r)):typeof i[t]!="undefined"&&(i[t]=r),r},c.DEFAULT_GETTER=function(t){var r=this._stateProxy,i;return t.indexOf&&t.indexOf(n)>-1?i=e.Object.getValue(r,t.split(n)):typeof r[t]!="undefined"&&(i=r[t]),i},e.mix(c.prototype,{DATA_PREFIX:"data-",toString:function(){var e=this[u]+": not bound to a node",t=this._node,n,i,s;return t&&(n=t.attributes,i=n&&n.id?t.getAttribute("id"):null,s=n&&n.className?t.getAttribute("className"):null,e=t[r],i&&(e+="#"+i),s&&(e+="."+s.replace(" ",".")),e+=" "+this[u]),e},get:function(e){var t;return this._getAttr?t=this._getAttr(e):t=this._get(e),t?t=c.scrubVal(t,this):t===null&&(t=null),t},_get:function(e){var t=c.ATTRS[e],n;return t&&t.getter?n=t.getter.call(this):c.re_aria.test(e)?n=this._node.getAttribute(e,2):n=c.DEFAULT_GETTER.apply(this,arguments),n},set:function(e,t){var n=c.ATTRS[e];return this._setAttr?this._setAttr.apply(this,arguments):n&&n.setter?n.setter.call(this,t,e):c.re_aria.test(e)?this._node.setAttribute(e,t):c.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(t){return this._setAttrs?this._setAttrs(t):e.Object.each(t,function(e,t){this.set(t,e)},this),this},getAttrs:function(t){var n={};return this._getAttrs?this._getAttrs(t):e.Array.each(t,function(e,t){n[e]=this.get(e)},this),n},compareTo:function(e){var t=
+this._node;return e&&e._node&&(e=e._node),t===e},inDoc:function(e){var t=this._node;e=e?e._node||e:t[s];if(e.documentElement)return l.contains(e.documentElement,t)},getById:function(t){var n=this._node,r=l.byId(t,n[s]);return r&&l.contains(n,r)?r=e.one(r):r=null,r},ancestor:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.one(l.ancestor(this._node,h(t),n,h(r)))},ancestors:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.all(l.ancestors(this._node,h(t),n,h(r)))},previous:function(t,n){return e.one(l.elementByAxis(this._node,"previousSibling",h(t),n))},next:function(t,n){return e.one(l.elementByAxis(this._node,"nextSibling",h(t),n))},siblings:function(t){return e.all(l.siblings(this._node,h(t)))},one:function(t){return e.one(e.Selector.query(t,this._node,!0))},all:function(t){var n;return this._node&&(n=e.all(e.Selector.query(t,this._node)),n._query=t,n._queryRoot=this._node),n||e.all([])},test:function(t){return e.Selector.test(this._node,t)},remove:function(e){var t=this._node;return t&&t.parentNode&&t.parentNode.removeChild(t),e&&this.destroy(),this},replace:function(e){var t=this._node;return typeof e=="string"&&(e=c.create(e)),t.parentNode.replaceChild(c.getDOMNode(e),t),this},replaceChild:function(t,n){return typeof t=="string"&&(t=l.create(t)),e.one(this._node.replaceChild(c.getDOMNode(t),c.getDOMNode(n)))},destroy:function(t){var n=e.config.doc.uniqueID?"uniqueID":"_yuid",r;this.purge(),this.unplug&&this.unplug(),this.clearData(),t&&e.NodeList.each(this.all("*"),function(t){r=c._instances[t[n]],r?r.destroy():e.Event.purgeElement(t)}),this._node=null,this._stateProxy=null,delete c._instances[this._yuid]},invoke:function(e,t,n,r,i,s){var o=this._node,u;return t&&t._node&&(t=t._node),n&&n._node&&(n=n._node),u=o[e](t,n,r,i,s),c.scrubVal(u,this)},swap:e.config.doc.documentElement.swapNode?function(e){this._node.swapNode(c.getDOMNode(e))}:function(e){e=c.getDOMNode(e);var t=this._node,n=e.parentNode,r=e.nextSibling;return r===t?n.insertBefore(t,e):e===t.nextSibling?n.insertBefore(e,t):(t.parentNode.replaceChild(e,t),l.addHTML(n,t,r)),this},hasMethod:function(e){var t=this._node;return!(!(t&&e in t&&typeof t[e]!="unknown")||typeof t[e]!="function"&&String(t[e]).indexOf("function")!==1)},isFragment:function(){return this.get("nodeType")===11},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),e.Node=c,e.one=c.one;var p=function(t){var n=[];t&&(typeof t=="string"?(this._query=t,t=e.Selector.query(t)):t.nodeType||l.isWindow(t)?t=[t]:t._node?t=[t._node]:t[0]&&t[0]._node?(e.Array.each(t,function(e){e._node&&n.push(e._node)}),t=n):t=e.Array(t,0,!0)),this._nodes=t||[]};p.NAME="NodeList",p.getDOMNodes=function(e){return e&&e._nodes?e._nodes:e},p.each=function(t,n,r){var i=t._nodes;i&&i.length&&e.Array.each(i,n,r||t)},p.addMethod=function(t,n,r){t&&n&&(p.prototype[t]=function(){var t=[],i=arguments;return e.Array.each(this._nodes,function(s){var o=s.uniqueID&&s.nodeType!==9?"uniqueID":"_yuid",u=e.Node._instances[s[o]],a,f;u||(u=p._getTempNode(s)),a=r||u,f=n.apply(a,i),f!==undefined&&f!==u&&(t[t.length]=f)}),t.length?t:this})},p.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,p.addMethod(n,t[n])):e.Array.each(n,function(e){p.importMethod(t,e)})},p._getTempNode=function(t){var n=p._tempNode;return n||(n=e.Node.create(""),p._tempNode=n),n._node=t,n._stateProxy=t,n},e.mix(p.prototype,{_invoke:function(e,t,n){var r=n?[]:this;return this.each(function(i){var s=i[e].apply(i,t);n&&r.push(s)}),r},item:function(t){return e.one((this._nodes||[])[t])},each:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){return i=e.one(i),t.call(n||i,i,s,r)}),r},batch:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){var o=e.Node._instances[i[u]];return o||(o=p._getTempNode(i)),t.call(n||o,o,s,r)}),r},some:function(t,n){var r=this;return e.Array.some(this._nodes,function(i,s){return i=e.one(i),n=n||i,t.call(n,i,s,r)})},toFrag:function(){return e.one(e.DOM._nl2frag(this._nodes))},indexOf:function(t){return e.Array.indexOf(this._nodes,e.Node.getDOMNode(t))},filter:function(t){return e.all(e.Selector.filter(this._nodes,t))},modulus:function(t,n){n=n||0;var r=[];return p.each(this,function(e,i){i%t===n&&r.push(e)}),e.all(r)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var t,n=this._nodes,r=this._query,i=this._queryRoot;return r&&(i||n&&n[0]&&n[0].ownerDocument&&(i=n[0].ownerDocument),this._nodes=e.Selector.query(r,i)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e="",t=this[u]+": not bound to any nodes",n=this._nodes,i;return n&&n[0]&&(i=n[0],e+=i[r],i.id&&(e+="#"+i.id),i.className&&(e+="."+i.className.replace(" ",".")),n.length>1&&(e+="...["+n.length+" items]")),e||t},getDOMNodes:function(){return this._nodes}},!0),p.importMethod(e.Node.prototype,["destroy","empty","remove","set"]),p.prototype.get=function(t){var n=[],r=this._nodes,i=!1,s=p._getTempNode,o,u;return r[0]&&(o=e.Node._instances[r[0]._yuid]||s(r[0]),u=o._get(t),u&&u.nodeType&&(i=!0)),e.Array.each(r,function(r){o=e.Node._instances[r._yuid],o||(o=s(r)),u=o._get(t),i||(u=e.Node.scrubVal(u,o)),n.push(u)}),i?e.all(n):n},e.NodeList=p,e.all=function(e){return new p(e)},e.Node.all=e.all;var d=e.NodeList,v=Array.prototype,m={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};e.Object.each(m,function(t,n){d.prototype[n]=function(){var r=[],i=0,s,o;while(typeof (s=arguments[i++])!="undefined")r.push(s._node||s._nodes||s);return o=v[n].apply(this._nodes,r),t?o=e.all(o):o=e.Node.scrubVal(o),o}}),e.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(t){e.Node.prototype[t]=function(
+e,n,r){var i=this.invoke(t,e,n,r);return i}}),e.Node.prototype.removeAttribute=function(e){var t=this._node;return t&&t.removeAttribute(e,0),this},e.Node.importMethod(e.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),e.NodeList.importMethod(e.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"@VERSION@",{requires:["dom-core","selector"]}),YUI.add("node-base",function(e,t){var n=["hasClass","addClass","removeClass","replaceClass","toggleClass"];e.Node.importMethod(e.DOM,n),e.NodeList.importMethod(e.Node.prototype,n);var r=e.Node,i=e.DOM;r.create=function(t,n){return n&&n._node&&(n=n._node),e.one(i.create(t,n))},e.mix(r.prototype,{create:r.create,insert:function(e,t){return this._insert(e,t),this},_insert:function(e,t){var n=this._node,r=null;return typeof t=="number"?t=this._node.childNodes[t]:t&&t._node&&(t=t._node),e&&typeof e!="string"&&(e=e._node||e._nodes||e),r=i.addHTML(n,e,t),r},prepend:function(e){return this.insert(e,0)},append:function(e){return this.insert(e,null)},appendChild:function(e){return r.scrubVal(this._insert(e))},insertBefore:function(t,n){return e.Node.scrubVal(this._insert(t,n))},appendTo:function(t){return e.one(t).append(this),this},setContent:function(e){return this._insert(e,"replace"),this},getContent:function(){var e=this;return e._node.nodeType===11&&(e=e.create("").append(e.cloneNode(!0))),e.get("innerHTML")}}),e.Node.prototype.setHTML=e.Node.prototype.setContent,e.Node.prototype.getHTML=e.Node.prototype.getContent,e.NodeList.importMethod(e.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent","setHTML","getHTML"]);var r=e.Node,i=e.DOM;r.ATTRS={text:{getter:function(){return i.getText(this._node)},setter:function(e){return i.setText(this._node,e),e}},"for":{getter:function(){return i.getAttribute(this._node,"for")},setter:function(e){return i.setAttribute(this._node,"for",e),e}},options:{getter:function(){return this._node.getElementsByTagName("option")}},children:{getter:function(){var t=this._node,n=t.children,r,i,s;if(!n){r=t.childNodes,n=[];for(i=0,s=r.length;i1?this._data[e]=t:this._data=e,this},clearData:function(e){return"_data"in this&&(typeof e!="undefined"?delete this._data[e]:delete this._data),this}}),e.mix(e.NodeList.prototype,{getData:function(e){var t=arguments.length?[e]:[];return this._invoke("getData",t,!0)},setData:function(e,t){var n=arguments.length>1?[e,t]:[e];return this._invoke("setData",n)},clearData:function(e){var t=arguments.length?[e]:[];return this._invoke("clearData",[e])}})},"@VERSION@",{requires:["event-base","node-core","dom-base","dom-style"]}),function(){var e=YUI.Env;e._ready||(e._ready=function(){e.DOMReady=!0,e.remove(YUI.config.doc,"DOMContentLoaded",e._ready)},e.add(YUI.config.doc,"DOMContentLoaded",e._ready))}(),YUI.add("event-base",function(e,t){e.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?e.fire("domready"):e.Do.before(function(){e.fire("domready")},YUI.Env,"_ready");var n=e.UA,r={},i={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},s=function(t){if(!t)return t;try{t&&3==t.nodeType&&(t=t.parentNode)}catch(n){return null}return e.one(t)},o=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||r,this.init()};e.extend(o,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,r=e.pageX,o=e.pageY,u,a=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=r,this.pageY=o,u=e.keyCode||e.charCode,n.webkit&&u in i&&(u=i[u]),this.keyCode=u,this.charCode=u,this.which=e.which||e.charCode||u,this.button=this.which,this.target=s(e.target),this.currentTarget=s(a),this.relatedTarget=s(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll")this.wheelDelta=e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1);this._touch&&this._touch(e,a,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),t.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),o.resolve=s,e.DOM2EventFacade=o,e.DOMEventFacade=o,function(){e.Env.evt.dom_wrappers={},e.Env.evt.dom_map={};var t=e.Env.evt,n=e.config,r=n.win,i=YUI.Env.add,s=YUI.Env.remove,o=function(){YUI.Env.windowLoaded=!0,e.Event._load(),s(r,"load",o)},u=function(){e.Event._unload()},a="domready",f="~yui|2|compat~",l=function(t){try{return t&&typeof t!="string"&&e.Lang.isNumber(t.length)&&!t.tagName&&!e.DOM.isWindow(t)}catch(n){return!1}},c=e.CustomEvent.prototype._delete,h=function(t){var n=c.apply(this,arguments);return this.hasSubs()||e.Event._clean(this),n},p=function(){var n=!1,o=0,c=[],d=t.dom_wrappers,v=null,m=t.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){p._interval||(p._interval=setInterval(p._poll,p.POLL_INTERVAL))},onAvailable:function(t,n,r,i,s,u){var a=e.Array(t),f,l;for(f=0;fCc{uWw*rU}$J)WMpJ)Y;0m;Vrpt?
zW@ct?Zf;>=VQFb;Wo2b;ZEa&?V{2<`XJ=<`Z|~sX;OOY+