From d02f90172ef52e60c86e4a20c0b928d1ed95c691 Mon Sep 17 00:00:00 2001 From: Brian Boll Date: Fri, 6 Sep 2013 11:36:36 -0400 Subject: [PATCH 01/27] Adding initial files --- DatabaseReboot.sql | 427 + README.txt | 27 + codeSamples/.svn/all-wcprops | 29 + codeSamples/.svn/entries | 164 + codeSamples/.svn/text-base/test.cpp.svn-base | 17 + codeSamples/.svn/text-base/test2.cpp.svn-base | 32 + .../.svn/text-base/test_py1.py.svn-base | 14 + .../.svn/text-base/test_py2.py.svn-base | 10 + codeSamples/test.cpp | 17 + codeSamples/test2.cpp | 32 + codeSamples/test_py1.py | 14 + codeSamples/test_py2.py | 10 + css/.svn/all-wcprops | 47 + css/.svn/entries | 266 + css/.svn/prop-base/codemirror.css.svn-base | 9 + css/.svn/text-base/acourses.css.svn-base | 62 + css/.svn/text-base/base.css.svn-base | 214 + css/.svn/text-base/codemirror.css.svn-base | 246 + css/.svn/text-base/jquery-ui.css.svn-base | 1175 ++ css/.svn/text-base/layout.css.svn-base | 113 + css/.svn/text-base/main.css.svn-base | 887 + css/.svn/text-base/nav-bar.css.svn-base | 55 + css/acourses.css | 62 + css/base.css | 214 + css/codemirror.css | 246 + css/jquery-ui.css | 1175 ++ css/layout.css | 113 + css/main.css | 887 + css/nav-bar.css | 55 + debugger/interface | Bin 0 -> 9547 bytes debugger/interface.c | 208 + debugger/pipetest | Bin 0 -> 10108 bytes debugger/pipetest.c | 190 + debugger/pipetest.c~ | 179 + debugger/pipetest1.c | 172 + debugger/pipetest2.c | 179 + debugger/webserver2 | Bin 0 -> 8768 bytes debugger/webserver2.c | 162 + files/.svn/all-wcprops | 5 + files/.svn/entries | 28 + files/KLogger.php | 410 + files/compiledDatabaseProgram1.py | 1 + files/compiledDatabaseProgram2.py | 1 + files/compiledDatabaseProgram47.py | 9 + files/compiledDatabaseProgram48.py | 16 + files/compiledDatabaseProgram51.py | 22 + files/finalOutput | Bin 0 -> 6131 bytes files/finalOutput.cpp | 17 + files/finalOutput.py | 10 + files/finalOutput.txt | 4 + files/log5227532da1e3f/log_2013-09-04.txt | 15 + files/log52276f826a44c/log_2013-09-04.txt | 8 + files/log5229d8d5873a4/log_2013-09-06.txt | 32 + files/log5229da1d77a67/log_2013-09-06.txt | 1 + files/log5229e0976c62d/log_2013-09-06.txt | 1 + files/log5229e0de8f959/log_2013-09-06.txt | 1 + files/log5229f35ec7756/log_2013-09-06.txt | 1 + files/test.txt | 17 + images/.svn/all-wcprops | 17 + images/.svn/entries | 96 + images/.svn/prop-base/bg_form.jpg.svn-base | 5 + images/.svn/prop-base/form-bg.png.svn-base | 5 + images/.svn/text-base/bg_form.jpg.svn-base | Bin 0 -> 1263 bytes images/.svn/text-base/form-bg.png.svn-base | Bin 0 -> 1042 bytes images/bg_form.jpg | Bin 0 -> 1263 bytes images/form-bg.png | Bin 0 -> 1042 bytes index.html | 6 + index.php | 47 + instructor/.svn/all-wcprops | 107 + instructor/.svn/entries | 606 + .../.svn/text-base/acourses.php.svn-base | 38 + .../.svn/text-base/addCourse.php.svn-base | 60 + .../.svn/text-base/addStudent.php.svn-base | 55 + .../.svn/text-base/closeCourse.php.svn-base | 65 + .../.svn/text-base/courseAdded.php.svn-base | 44 + .../.svn/text-base/courseadmin.php.svn-base | 13 + .../.svn/text-base/courselog.php.svn-base | 8 + .../text-base/create_assignment.php.svn-base | 91 + .../.svn/text-base/deleteStudent.php.svn-base | 8 + .../text-base/finishedCourses.php.svn-base | 39 + instructor/.svn/text-base/grades.php.svn-base | 64 + .../list_of_assignments.php.svn-base | 117 + .../text-base/list_of_students.php.svn-base | 107 + .../.svn/text-base/reopenCourse.php.svn-base | 68 + .../.svn/text-base/sendNotif.php.svn-base | 104 + .../.svn/text-base/studentAdded.php.svn-base | 31 + .../.svn/text-base/testcourse.php.svn-base | 8 + instructor/.svn/tmp/svn-seGQgt | 0 instructor/acourses.php | 38 + instructor/addCourse.php | 60 + instructor/addStudent.php | 55 + instructor/closeCourse.php | 65 + instructor/courseAdded.php | 44 + instructor/courseadmin.php | 13 + instructor/courselog.php | 8 + instructor/create_assignment.php | 91 + instructor/deleteStudent.php | 8 + instructor/finishedCourses.php | 39 + instructor/grades.php | 64 + instructor/list_of_assignments.php | 117 + instructor/list_of_students.php | 107 + instructor/reopenCourse.php | 68 + instructor/sendNotif.php | 104 + instructor/studentAdded.php | 31 + instructor/testcourse.php | 8 + interface.c | 206 + js/.svn/all-wcprops | 65 + js/.svn/entries | 368 + js/.svn/prop-base/clike.js.svn-base | 9 + js/.svn/prop-base/codemirror.js.svn-base | 9 + js/.svn/prop-base/python.js.svn-base | 9 + .../text-base/animatedcollapse.js.svn-base | 218 + js/.svn/text-base/clike.js.svn-base | 302 + js/.svn/text-base/codemirror.js.svn-base | 5516 ++++++ .../text-base/createAssignment.js.svn-base | 38 + js/.svn/text-base/datepicker.js.svn-base | 6 + js/.svn/text-base/debugger.js.svn-base | 145 + .../text-base/jquery-1.9.1.min.js.svn-base | 5 + js/.svn/text-base/jquery-ui.js.svn-base | 14987 ++++++++++++++++ js/.svn/text-base/myAccount.js.svn-base | 447 + js/.svn/text-base/python.js.svn-base | 340 + js/animatedcollapse.js | 218 + js/clike.js | 302 + js/codemirror.js | 5516 ++++++ js/createAssignment.js | 38 + js/datepicker.js | 6 + js/debugger.js | 145 + js/jquery-1.9.1.min.js | 5 + js/jquery-ui.js | 14987 ++++++++++++++++ js/myAccount.js | 447 + js/python.js | 340 + login.php | 73 + shared_php/.svn/all-wcprops | 83 + shared_php/.svn/entries | 470 + .../.svn/text-base/changePass.php.svn-base | 33 + .../text-base/databaseConnect.php.svn-base | 14 + shared_php/.svn/text-base/footer.php.svn-base | 3 + .../.svn/text-base/forget_pass.php.svn-base | 163 + shared_php/.svn/text-base/header.php.svn-base | 166 + shared_php/.svn/text-base/logout.php.svn-base | 10 + .../.svn/text-base/myAccount.php.svn-base | 20 + .../.svn/text-base/passChanged.php.svn-base | 22 + .../.svn/text-base/practice.php.svn-base | 185 + .../.svn/text-base/saveForm.php.svn-base | 49 + .../.svn/text-base/saveForm_conf.php.svn-base | 63 + .../text-base/session_expired.php.svn-base | 10 + .../.svn/text-base/viewNotif.php.svn-base | 101 + shared_php/.svn/tmp/svn-noIvyc | 0 shared_php/KLogger-master/.gitignore | 4 + shared_php/KLogger-master/README.markdown | 80 + shared_php/KLogger-master/example/example.php | 20 + shared_php/KLogger-master/src/KLogger.php | 410 + shared_php/changePass.php | 33 + shared_php/databaseConnect.php | 16 + shared_php/footer.php | 3 + shared_php/forget_pass.php | 163 + shared_php/header.php | 174 + shared_php/logout.php | 10 + shared_php/myAccount.php | 20 + shared_php/passChanged.php | 22 + shared_php/practice.php | 192 + shared_php/saveForm.php | 49 + shared_php/saveForm_conf.php | 68 + shared_php/session_expired.php | 10 + shared_php/viewNotif.php | 101 + student/.svn/all-wcprops | 29 + student/.svn/entries | 188 + student/.svn/text-base/myCourses.php.svn-base | 43 + student/.svn/text-base/results.php.svn-base | 54 + .../.svn/text-base/submission.php.svn-base | 54 + .../text-base/viewSubmissions.php.svn-base | 66 + student/myCourses.php | 43 + student/results.php | 58 + student/submission.php | 58 + student/viewSubmissions.php | 66 + webserver2.c | 162 + 176 files changed, 59372 insertions(+) create mode 100644 DatabaseReboot.sql create mode 100644 README.txt create mode 100644 codeSamples/.svn/all-wcprops create mode 100644 codeSamples/.svn/entries create mode 100644 codeSamples/.svn/text-base/test.cpp.svn-base create mode 100644 codeSamples/.svn/text-base/test2.cpp.svn-base create mode 100644 codeSamples/.svn/text-base/test_py1.py.svn-base create mode 100644 codeSamples/.svn/text-base/test_py2.py.svn-base create mode 100644 codeSamples/test.cpp create mode 100644 codeSamples/test2.cpp create mode 100644 codeSamples/test_py1.py create mode 100644 codeSamples/test_py2.py create mode 100644 css/.svn/all-wcprops create mode 100644 css/.svn/entries create mode 100644 css/.svn/prop-base/codemirror.css.svn-base create mode 100644 css/.svn/text-base/acourses.css.svn-base create mode 100644 css/.svn/text-base/base.css.svn-base create mode 100644 css/.svn/text-base/codemirror.css.svn-base create mode 100644 css/.svn/text-base/jquery-ui.css.svn-base create mode 100644 css/.svn/text-base/layout.css.svn-base create mode 100644 css/.svn/text-base/main.css.svn-base create mode 100644 css/.svn/text-base/nav-bar.css.svn-base create mode 100644 css/acourses.css create mode 100644 css/base.css create mode 100644 css/codemirror.css create mode 100644 css/jquery-ui.css create mode 100644 css/layout.css create mode 100644 css/main.css create mode 100644 css/nav-bar.css create mode 100755 debugger/interface create mode 100644 debugger/interface.c create mode 100755 debugger/pipetest create mode 100644 debugger/pipetest.c create mode 100644 debugger/pipetest.c~ create mode 100644 debugger/pipetest1.c create mode 100644 debugger/pipetest2.c create mode 100755 debugger/webserver2 create mode 100644 debugger/webserver2.c create mode 100644 files/.svn/all-wcprops create mode 100644 files/.svn/entries create mode 100755 files/KLogger.php create mode 100644 files/compiledDatabaseProgram1.py create mode 100644 files/compiledDatabaseProgram2.py create mode 100644 files/compiledDatabaseProgram47.py create mode 100644 files/compiledDatabaseProgram48.py create mode 100644 files/compiledDatabaseProgram51.py create mode 100755 files/finalOutput create mode 100644 files/finalOutput.cpp create mode 100644 files/finalOutput.py create mode 100644 files/finalOutput.txt create mode 100644 files/log5227532da1e3f/log_2013-09-04.txt create mode 100644 files/log52276f826a44c/log_2013-09-04.txt create mode 100644 files/log5229d8d5873a4/log_2013-09-06.txt create mode 100644 files/log5229da1d77a67/log_2013-09-06.txt create mode 100644 files/log5229e0976c62d/log_2013-09-06.txt create mode 100644 files/log5229e0de8f959/log_2013-09-06.txt create mode 100644 files/log5229f35ec7756/log_2013-09-06.txt create mode 100644 files/test.txt create mode 100644 images/.svn/all-wcprops create mode 100644 images/.svn/entries create mode 100644 images/.svn/prop-base/bg_form.jpg.svn-base create mode 100644 images/.svn/prop-base/form-bg.png.svn-base create mode 100644 images/.svn/text-base/bg_form.jpg.svn-base create mode 100644 images/.svn/text-base/form-bg.png.svn-base create mode 100644 images/bg_form.jpg create mode 100644 images/form-bg.png create mode 100644 index.html create mode 100644 index.php create mode 100644 instructor/.svn/all-wcprops create mode 100644 instructor/.svn/entries create mode 100644 instructor/.svn/text-base/acourses.php.svn-base create mode 100644 instructor/.svn/text-base/addCourse.php.svn-base create mode 100644 instructor/.svn/text-base/addStudent.php.svn-base create mode 100644 instructor/.svn/text-base/closeCourse.php.svn-base create mode 100644 instructor/.svn/text-base/courseAdded.php.svn-base create mode 100644 instructor/.svn/text-base/courseadmin.php.svn-base create mode 100644 instructor/.svn/text-base/courselog.php.svn-base create mode 100644 instructor/.svn/text-base/create_assignment.php.svn-base create mode 100644 instructor/.svn/text-base/deleteStudent.php.svn-base create mode 100644 instructor/.svn/text-base/finishedCourses.php.svn-base create mode 100644 instructor/.svn/text-base/grades.php.svn-base create mode 100644 instructor/.svn/text-base/list_of_assignments.php.svn-base create mode 100644 instructor/.svn/text-base/list_of_students.php.svn-base create mode 100644 instructor/.svn/text-base/reopenCourse.php.svn-base create mode 100644 instructor/.svn/text-base/sendNotif.php.svn-base create mode 100644 instructor/.svn/text-base/studentAdded.php.svn-base create mode 100644 instructor/.svn/text-base/testcourse.php.svn-base create mode 100644 instructor/.svn/tmp/svn-seGQgt create mode 100644 instructor/acourses.php create mode 100644 instructor/addCourse.php create mode 100644 instructor/addStudent.php create mode 100644 instructor/closeCourse.php create mode 100644 instructor/courseAdded.php create mode 100644 instructor/courseadmin.php create mode 100644 instructor/courselog.php create mode 100644 instructor/create_assignment.php create mode 100644 instructor/deleteStudent.php create mode 100644 instructor/finishedCourses.php create mode 100644 instructor/grades.php create mode 100644 instructor/list_of_assignments.php create mode 100644 instructor/list_of_students.php create mode 100644 instructor/reopenCourse.php create mode 100644 instructor/sendNotif.php create mode 100644 instructor/studentAdded.php create mode 100644 instructor/testcourse.php create mode 100644 interface.c create mode 100644 js/.svn/all-wcprops create mode 100644 js/.svn/entries create mode 100644 js/.svn/prop-base/clike.js.svn-base create mode 100644 js/.svn/prop-base/codemirror.js.svn-base create mode 100644 js/.svn/prop-base/python.js.svn-base create mode 100644 js/.svn/text-base/animatedcollapse.js.svn-base create mode 100644 js/.svn/text-base/clike.js.svn-base create mode 100644 js/.svn/text-base/codemirror.js.svn-base create mode 100644 js/.svn/text-base/createAssignment.js.svn-base create mode 100644 js/.svn/text-base/datepicker.js.svn-base create mode 100644 js/.svn/text-base/debugger.js.svn-base create mode 100644 js/.svn/text-base/jquery-1.9.1.min.js.svn-base create mode 100644 js/.svn/text-base/jquery-ui.js.svn-base create mode 100644 js/.svn/text-base/myAccount.js.svn-base create mode 100644 js/.svn/text-base/python.js.svn-base create mode 100644 js/animatedcollapse.js create mode 100644 js/clike.js create mode 100644 js/codemirror.js create mode 100644 js/createAssignment.js create mode 100644 js/datepicker.js create mode 100644 js/debugger.js create mode 100644 js/jquery-1.9.1.min.js create mode 100644 js/jquery-ui.js create mode 100644 js/myAccount.js create mode 100644 js/python.js create mode 100644 login.php create mode 100644 shared_php/.svn/all-wcprops create mode 100644 shared_php/.svn/entries create mode 100644 shared_php/.svn/text-base/changePass.php.svn-base create mode 100644 shared_php/.svn/text-base/databaseConnect.php.svn-base create mode 100644 shared_php/.svn/text-base/footer.php.svn-base create mode 100644 shared_php/.svn/text-base/forget_pass.php.svn-base create mode 100644 shared_php/.svn/text-base/header.php.svn-base create mode 100644 shared_php/.svn/text-base/logout.php.svn-base create mode 100644 shared_php/.svn/text-base/myAccount.php.svn-base create mode 100644 shared_php/.svn/text-base/passChanged.php.svn-base create mode 100644 shared_php/.svn/text-base/practice.php.svn-base create mode 100644 shared_php/.svn/text-base/saveForm.php.svn-base create mode 100644 shared_php/.svn/text-base/saveForm_conf.php.svn-base create mode 100644 shared_php/.svn/text-base/session_expired.php.svn-base create mode 100644 shared_php/.svn/text-base/viewNotif.php.svn-base create mode 100644 shared_php/.svn/tmp/svn-noIvyc create mode 100644 shared_php/KLogger-master/.gitignore create mode 100644 shared_php/KLogger-master/README.markdown create mode 100755 shared_php/KLogger-master/example/example.php create mode 100755 shared_php/KLogger-master/src/KLogger.php create mode 100644 shared_php/changePass.php create mode 100644 shared_php/databaseConnect.php create mode 100644 shared_php/footer.php create mode 100644 shared_php/forget_pass.php create mode 100644 shared_php/header.php create mode 100644 shared_php/logout.php create mode 100644 shared_php/myAccount.php create mode 100644 shared_php/passChanged.php create mode 100644 shared_php/practice.php create mode 100644 shared_php/saveForm.php create mode 100644 shared_php/saveForm_conf.php create mode 100644 shared_php/session_expired.php create mode 100644 shared_php/viewNotif.php create mode 100644 student/.svn/all-wcprops create mode 100644 student/.svn/entries create mode 100644 student/.svn/text-base/myCourses.php.svn-base create mode 100644 student/.svn/text-base/results.php.svn-base create mode 100644 student/.svn/text-base/submission.php.svn-base create mode 100644 student/.svn/text-base/viewSubmissions.php.svn-base create mode 100644 student/myCourses.php create mode 100644 student/results.php create mode 100644 student/submission.php create mode 100644 student/viewSubmissions.php create mode 100644 webserver2.c diff --git a/DatabaseReboot.sql b/DatabaseReboot.sql new file mode 100644 index 0000000..e3bda7e --- /dev/null +++ b/DatabaseReboot.sql @@ -0,0 +1,427 @@ +DROP TABLE IF EXISTS `Grades` ; +DROP TABLE IF EXISTS `Notification` ; +DROP TABLE IF EXISTS `Roster` ; +DROP TABLE IF EXISTS `UnitTest` ; +DROP TABLE IF EXISTS `Submission` ; +DROP TABLE IF EXISTS `Assignment` ; +DROP TABLE IF EXISTS `Practice` ; +DROP TABLE IF EXISTS `Classes` ; +DROP TABLE IF EXISTS `Member` ; +DROP TABLE IF EXISTS `Administrator` ; +DROP TABLE IF EXISTS `Template` ; +DROP TABLE IF EXISTS `Student` ; +DROP TABLE IF EXISTS `Instructor` ; +-- ----------------------------------------------------- +-- Table `Member` +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS `Member` ( + `idMember` INT NOT NULL AUTO_INCREMENT , + `FirstName` VARCHAR(15) NOT NULL , + `LastName` VARCHAR(25) NOT NULL , + `MemberEmail` VARCHAR(45) NOT NULL , + `MemberBanner` VARCHAR(45) NOT NULL , + `MemberPassword` VARCHAR(50) NOT NULL , + `IsInstructor` BINARY NOT NULL , + PRIMARY KEY (`idMember`) , + UNIQUE INDEX `idMember_UNIQUE` (`idMember` ASC) ) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `Classes` +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS `Classes` ( + `idClass` INT NOT NULL AUTO_INCREMENT , + `ClassCRN` INT NOT NULL , + `ClassName` VARCHAR(45) NOT NULL , + `ClassInstructorId` INT NOT NULL , + `ClassStartDate` DATE NULL , + `ClassEndDate` DATE NULL , + `isFinished` BINARY NOT NULL , + PRIMARY KEY (`idClass`) , + UNIQUE INDEX `idClass_UNIQUE` (`idClass` ASC) , + INDEX `ClassMemberId_idx` (`ClassInstructorId` ASC) , + CONSTRAINT `ClassInstructorId` + FOREIGN KEY (`ClassInstructorId` ) + REFERENCES `Member` (`idMember` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `Practice` +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS `Practice` ( + `idPractice` INT NOT NULL AUTO_INCREMENT , + `PracticeName` TEXT NOT NULL , + `PracticeMemberId` INT NOT NULL , + `PracticeAnswer` TEXT NOT NULL , + PRIMARY KEY (`idPractice`) , + UNIQUE INDEX `idPractice_UNIQUE` (`idPractice` ASC) , + INDEX `PracticeMemberId_idx` (`PracticeMemberId` ASC) , + CONSTRAINT `PracticeMemberId` + FOREIGN KEY (`PracticeMemberId` ) + REFERENCES `Member` (`idMember` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + +-- ----------------------------------------------------- +-- Table `Assignment` +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS `Assignment` ( + `idAssignment` INT NOT NULL AUTO_INCREMENT , + `AssignmentName` VARCHAR(45) NOT NULL , + `AssignmentDueDate` DATETIME NULL , + `AssignmentInstructions` TEXT NULL , + `AssignmentCode` TEXT NULL , + `AssignmentClass` INT NOT NULL , + `AssignmentType` BINARY NOT NULL COMMENT 'AssignmentType is 0 for C++ and 1 for Python' , + `AssignmentMaxAttempts` INT NULL , + PRIMARY KEY (`idAssignment`) , + INDEX `ForClass_idx` (`AssignmentClass` ASC) , + UNIQUE INDEX `idAssignment_UNIQUE` (`idAssignment` ASC) , + CONSTRAINT `AssignmentClassId` + FOREIGN KEY (`AssignmentClass` ) + REFERENCES `Classes` (`idClass` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `Submission` +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS `Submission` ( + `idSubmission` INT NOT NULL AUTO_INCREMENT , + `SubmissionMemberId` INT NOT NULL , + `SubmissionAssignmentId` INT NOT NULL , + `SubmissionSuccess` BINARY NULL COMMENT 'Should be 0 for fail, 1 for success, null when created.' , + PRIMARY KEY (`idSubmission`) , + INDEX `AssignmentId_idx` (`SubmissionAssignmentId` ASC) , + UNIQUE INDEX `idSubmission_UNIQUE` (`idSubmission` ASC) , + INDEX `SubmissionMemberId_idx` (`SubmissionMemberId` ASC) , + CONSTRAINT `SubmissionMemberId` + FOREIGN KEY (`SubmissionMemberId` ) + REFERENCES `Member` (`idMember` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `SubmissionAssignmentId` + FOREIGN KEY (`SubmissionAssignmentId` ) + REFERENCES `Assignment` (`idAssignment` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `UnitTest` +-- ----------------------------------------------------- + + +CREATE TABLE IF NOT EXISTS `UnitTest` ( + `idUnitTest` INT NOT NULL AUTO_INCREMENT , + `UnitTestName` VARCHAR(45) NOT NULL , + `UnitTestAssignmentId` INT NOT NULL , + `UnitTestProgram` TEXT NOT NULL , + PRIMARY KEY (`idUnitTest`) , + INDEX `AssociatedAssignment_idx` (`UnitTestAssignmentId` ASC) , + UNIQUE INDEX `idUnitTest_UNIQUE` (`idUnitTest` ASC) , + CONSTRAINT `AssociatedAssignment` + FOREIGN KEY (`UnitTestAssignmentId` ) + REFERENCES `Assignment` (`idAssignment` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `Roster` +-- ----------------------------------------------------- + + +CREATE TABLE IF NOT EXISTS `Roster` ( + `idRoster` INT NOT NULL AUTO_INCREMENT , + `ClassId` INT NOT NULL , + `StudentId` INT NOT NULL , + PRIMARY KEY (`idRoster`) , + INDEX `ClassId_idx` (`ClassId` ASC) , + UNIQUE INDEX `idRoster_UNIQUE` (`idRoster` ASC) , + INDEX `RosterStudentId_idx` (`StudentId` ASC) , + CONSTRAINT `RosterStudentId` + FOREIGN KEY (`StudentId` ) + REFERENCES `Member` (`idMember` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `RosterClassId` + FOREIGN KEY (`ClassId` ) + REFERENCES `Classes` (`idClass` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + +-- ----------------------------------------------------- +-- Table `Notification` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `Notification` ( + `idNotification` INT NOT NULL AUTO_INCREMENT , + `NotificationName` VARCHAR(45) NOT NULL , + `NotificationClassId` INT NOT NULL , + `NotificationText` TEXT NOT NULL , + PRIMARY KEY (`idNotification`) , + INDEX `AssociatedNotificationClass_idx` (`NotificationClassId` ASC) , + UNIQUE INDEX `idNotification_UNIQUE` (`idNotification` ASC) , + CONSTRAINT `AssociatedClasses` + FOREIGN KEY (`NotificationClassId` ) + REFERENCES `Classes` (`idClass` ) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + +-- ----------------------------------------------------- +-- Table `Template` +-- ----------------------------------------------------- + + +CREATE TABLE IF NOT EXISTS `Template` ( + `idTemplate` INT NOT NULL , + `TemplateName` VARCHAR(45) NOT NULL , + `TemplateCode` TEXT NULL , + PRIMARY KEY (`idTemplate`) , + UNIQUE INDEX `idTemplate_UNIQUE` (`idTemplate` ASC) ) +ENGINE = InnoDB; + +-- ----------------------------------------------------- +-- Table `Grades` +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS `Grades` ( + `GradeID` INT NOT NULL AUTO_INCREMENT , + `StudentID` INT NOT NULL , + `AssignmentID` INT NOT NULL , + `NoOfAttempts` INT , + `NoOfSuccesses` INT , + `SuccessInRow` INT , + PRIMARY KEY (`GradeID`) , + UNIQUE INDEX `GradeID_UNIQUE` (`GradeID` ASC) , + CONSTRAINT `StudentID` + FOREIGN KEY (`StudentID`) + REFERENCES `Member` (`idMember`) + ON DELETE NO ACTION + ON UPDATE NO ACTION , + CONSTRAINT `AssignmentID` + FOREIGN KEY (`AssignmentID`) + REFERENCES `Assignment` (`idAssignment`) + ON DELETE NO ACTION + ON UPDATE NO ACTION ) +ENGINE = InnoDB; + + + +INSERT INTO Member VALUES (1, 'Instruct', 'Lastname', 'instructor@email.gov', 812345678, md5('instructorpass'), 1); +INSERT INTO Member VALUES (2, 'Student', 'Last2', 'student@email.gov', 810000001, md5('studentpass'), 0); +INSERT INTO Member VALUES (3, 'Instructor2', 'Last3', 'instructor2@email.gov', 812345679, md5('instructorpass'), 1); +INSERT INTO Member VALUES (4, 'Student2', 'Last4', 'student2@email.gov', 810000002, md5('studentpass'), 0); +INSERT INTO Classes VALUES (1, 1234567, 'Computer Science 1', 0001, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (2, 1234568, 'Computer Science 2', 0002, '2013-10-10', '2014-07-10', 0); +INSERT INTO Roster VALUES (1, 0001, 0002); +INSERT INTO Roster VALUES (2, 0002, 0002); +INSERT INTO Roster VALUES (3, 0001, 0004); +INSERT INTO Roster VALUES (4, 0002, 0004); +INSERT INTO Assignment VALUES (1, 'Practice Test', NULL, 'Print Out Hello World', '//This Is Code', 1, 0, NULL); +INSERT INTO Assignment VALUES (2, 'Sample Test', NULL, 'Print Out Goodbye World', '//This Is Code', 1, 0, 5); +INSERT INTO Submission VALUES (0001, 0001, 0001, 1); +INSERT INTO Template VALUES (0001, 'Hello World', '#include using namespace std;int main (){cout << "Hello World!";return 0;}'); +INSERT INTO UnitTest VALUES (0001, 'Hello Test', 0001, 'TRUE'); +INSERT INTO Practice VALUES (0001, 'Hello World', 0002, '#include using namespace std;int main (){cout << "Hello World!";return 0;}'); +INSERT INTO Notification VALUES (1, 'Testing Notifications', 1, "Hi Class, this is the notes system!"); + +-- ------------------------------------- +-- Member Population +-- ------------------------------------- +INSERT INTO Member VALUES (5, 'Thamer', 'Instructor', 'italrefai@kent.edu', 81000009, md5('studentpass'), 1); +INSERT INTO Member VALUES (6, 'Thamer', 'Student', 'stalrefai@kent.edu', 810000003, md5('studentpass'), 0); +INSERT INTO Member VALUES (7, 'Ovunc', 'Instructor', 'ioasikogl@kent.edu', 8100000010, md5('12345'), 1); +INSERT INTO Member VALUES (8, 'Ovunc', 'Student', 'soasikogl@kent.edu', 810000004, md5('12345'), 0); +INSERT INTO Member VALUES (9, 'Abdul', 'Instructor', 'iaalahai@kent.edu', 810000013, md5('studentpass'), 1); +INSERT INTO Member VALUES (10, 'Abdul', 'Student', 'saalmahai@kent.edu', 810000005, md5('studentpass'), 0); +INSERT INTO Member VALUES (11, 'Rafia', 'Instructor', 'irqureshi@kent.edu', 810000023, md5('rafiaq88'), 1); +INSERT INTO Member VALUES (12, 'Rafia', 'Student', 'srqureshi@kent.edu', 810000006, md5('rafiaq88'), 0); +INSERT INTO Member VALUES (13, 'Cody', 'Instructor', 'ickerstin@kent.edu', 810000033, md5('12345'), 1); +INSERT INTO Member VALUES (14, 'Cody', 'Student', 'sckerstin@kent.edu', 810000007, md5('12345'), 0); +INSERT INTO Member VALUES (15, 'Mich', 'Instructor', 'ipedwards@kent.edu', 810000043, md5('12345'), 1); +INSERT INTO Member VALUES (16, 'Mich', 'Student', 'spedwards@kent.edu', 810000008, md5('12345'), 0); + +-- ------------------------------------- +-- Classes Population (idClass, ClassCRN, ClassName, ClassInstructorId,ClassStartDate,ClassEndDate) +-- ------------------------------------- +INSERT INTO Classes VALUES (3, 1334567, 'Computer Science 11', 0005, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (4, 1534568, 'Computer Science 12', 0005, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (5, 1234567, 'Computer Science 3', 0009, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (6, 1544568, 'Computer Science 4', 0009, '2013-10-10', '2014-07-10', 1); +INSERT INTO Classes VALUES (7, 1224567, 'Computer Science 5', 0007, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (8, 1214568, 'Computer Science 6', 0007, '2013-10-10', '2014-07-10', 1); +INSERT INTO Classes VALUES (9, 1233567, 'Computer Science 7', 0011, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (10, 1277568, 'Computer Science 8', 0011, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (11, 1233537, 'Computer Science 9', 0013, '2013-10-10', '2014-07-10', 1); +INSERT INTO Classes VALUES (12, 1277548, 'Computer Science 10', 0013, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (13, 1377568, 'Intro to Databases', 0005, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (14, 1433537, 'Information Visualization', 0007, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (15, 1477548, 'Capstone Project', 0009, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (16, 1477568, 'Computer Graphics', 0011, '2013-10-10', '2014-07-10', 1); +INSERT INTO Classes VALUES (17, 1333537, 'Algorithms', 0015, '2013-10-10', '2014-07-10', 0); +INSERT INTO Classes VALUES (18, 1377548, 'Networks', 0015, '2013-10-10', '2014-07-10', 0); + +-- ------------------------------------- +-- Roster Population (id,classid,studentid) +-- ------------------------------------- +INSERT INTO Roster VALUES (NULL, 0003, 0006); +INSERT INTO Roster VALUES (NULL, 0003, 0010); +INSERT INTO Roster VALUES (NULL, 0003, 0012); +INSERT INTO Roster VALUES (NULL, 0003, 0014); +INSERT INTO Roster VALUES (NULL, 0003, 0016); + +INSERT INTO Roster VALUES (NULL, 0004, 0008); +INSERT INTO Roster VALUES (NULL, 0004, 0010); +INSERT INTO Roster VALUES (NULL, 0004, 0012); +INSERT INTO Roster VALUES (NULL, 0004, 0014); + +INSERT INTO Roster VALUES (NULL, 0005, 0006); +INSERT INTO Roster VALUES (NULL, 0005, 0008); +INSERT INTO Roster VALUES (NULL, 0005, 0014); + +INSERT INTO Roster VALUES (NULL, 0006, 0006); +INSERT INTO Roster VALUES (NULL, 0006, 0008); +INSERT INTO Roster VALUES (NULL, 0006, 0010); +INSERT INTO Roster VALUES (NULL, 0006, 0014); + +INSERT INTO Roster VALUES (NULL, 0007, 0006); +INSERT INTO Roster VALUES (NULL, 0007, 0008); +INSERT INTO Roster VALUES (NULL, 0007, 0010); +INSERT INTO Roster VALUES (NULL, 0007, 0014); + +INSERT INTO Roster VALUES (NULL, 0008, 0006); +INSERT INTO Roster VALUES (NULL, 0008, 0008); +INSERT INTO Roster VALUES (NULL, 0008, 0012); +INSERT INTO Roster VALUES (NULL, 0008, 0014); + +INSERT INTO Roster VALUES (NULL, 0009, 0008); +INSERT INTO Roster VALUES (NULL, 0009, 0010); +INSERT INTO Roster VALUES (NULL, 0009, 0012); +INSERT INTO Roster VALUES (NULL, 0009, 0014); + +INSERT INTO Roster VALUES (NULL, 0010, 0006); +INSERT INTO Roster VALUES (NULL, 0010, 0010); +INSERT INTO Roster VALUES (NULL, 0010, 0012); +INSERT INTO Roster VALUES (NULL, 0010, 0014); +INSERT INTO Roster VALUES (NULL, 0010, 0016); + +INSERT INTO Roster VALUES (NULL, 0011, 0006); +INSERT INTO Roster VALUES (NULL, 0011, 0008); +INSERT INTO Roster VALUES (NULL, 0011, 0012); +INSERT INTO Roster VALUES (NULL, 0011, 0014); + +INSERT INTO Roster VALUES (NULL, 0012, 0006); +INSERT INTO Roster VALUES (NULL, 0012, 0008); +INSERT INTO Roster VALUES (NULL, 0012, 0010); +INSERT INTO Roster VALUES (NULL, 0012, 0012); + +INSERT INTO Roster VALUES (NULL, 0013, 0006); +INSERT INTO Roster VALUES (NULL, 0013, 0008); +INSERT INTO Roster VALUES (NULL, 0013, 0010); +INSERT INTO Roster VALUES (NULL, 0013, 0012); +INSERT INTO Roster VALUES (NULL, 0010, 0016); + +INSERT INTO Roster VALUES (NULL, 0014, 0006); +INSERT INTO Roster VALUES (NULL, 0014, 0010); +INSERT INTO Roster VALUES (NULL, 0014, 0012); +INSERT INTO Roster VALUES (NULL, 0014, 0014); + +INSERT INTO Roster VALUES (NULL, 0015, 0006); +INSERT INTO Roster VALUES (NULL, 0015, 0008); +INSERT INTO Roster VALUES (NULL, 0015, 0010); +INSERT INTO Roster VALUES (NULL, 0015, 0012); +INSERT INTO Roster VALUES (NULL, 0010, 0016); + +INSERT INTO Roster VALUES (NULL, 0016, 0008); +INSERT INTO Roster VALUES (NULL, 0016, 0010); +INSERT INTO Roster VALUES (NULL, 0016, 0012); +INSERT INTO Roster VALUES (NULL, 0016, 0014); + +INSERT INTO Roster VALUES (NULL, 0017, 0006); +INSERT INTO Roster VALUES (NULL, 0017, 0008); +INSERT INTO Roster VALUES (NULL, 0017, 0012); +INSERT INTO Roster VALUES (NULL, 0017, 0014); + +INSERT INTO Roster VALUES (NULL, 0018, 0006); +INSERT INTO Roster VALUES (NULL, 0018, 0008); +INSERT INTO Roster VALUES (NULL, 0018, 0010); +INSERT INTO Roster VALUES (NULL, 0010, 0016); + + +-- ------------------------------------- +-- Assignment Population(idAssignment,AssignmentName,AssignmentDueDate,AssignmentInstructions,AssignmentCode,AssignmentClass,AssignmentType,AssignmentMaxAttempts) +-- ------------------------------------- +INSERT INTO Assignment VALUES (19, 'Practice Test 1', NULL, 'Print Out Hello World', '//This Is Code', 10, 0, NULL); +INSERT INTO Assignment VALUES (4, 'Sample Test 1', NULL, 'Print Out Goodbye World', '//This Is Code', 3, 0, 5); +INSERT INTO Assignment VALUES (5, 'Practice Test 2', NULL, 'Print Out Hello World', '//This Is Code', 4, 1, NULL); +INSERT INTO Assignment VALUES (6, 'Sample Test 2', NULL, 'Print Out Goodbye World', '//This Is Code', 5, 0, 5); +INSERT INTO Assignment VALUES (7, 'Practice Test 3', NULL, 'Print Out Hello World', '//This Is Code', 6, 1, NULL); +INSERT INTO Assignment VALUES (8, 'Sample Test 3', NULL, 'Print Out Goodbye World', '//This Is Code', 7, 0, 5); +INSERT INTO Assignment VALUES (9, 'Practice Test 4', NULL, 'Print Out Hello World', '//This Is Code', 8, 1, NULL); +INSERT INTO Assignment VALUES (10, 'Sample Test 4', NULL, 'Print Out Goodbye World', '//This Is Code', 9, 0, 5); +INSERT INTO Assignment VALUES (13, 'Practice Test 5', NULL, 'Print Out Hello World', '//This Is Code', 11, 0, NULL); +INSERT INTO Assignment VALUES (14, 'Sample Test 5', NULL, 'Print Out Goodbye World', '//This Is Code', 13, 0, 5); +INSERT INTO Assignment VALUES (15, 'Practice Test 6', NULL, 'Print Out Hello World', '//This Is Code', 14, 1, NULL); +INSERT INTO Assignment VALUES (16, 'Sample Test 6', NULL, 'Print Out Goodbye World', '//This Is Code', 15, 0, 5); +INSERT INTO Assignment VALUES (17, 'Practice Test 7', NULL, 'Print Out Hello World', '//This Is Code', 16, 0, NULL); +INSERT INTO Assignment VALUES (18, 'Sample Test 7', NULL, 'Print Out Goodbye World', '//This Is Code', 17, 1, 5); +INSERT INTO Assignment VALUES (11, 'Practice Test 8', NULL, 'Print Out Hello World', '//This Is Code', 18, 1, NULL); +INSERT INTO Assignment VALUES (12, 'Sample Test 8', NULL, 'Print Out Goodbye World', '//This Is Code', 12, 0, 5); +INSERT INTO Assignment VALUES (20, 'Sample Test 9', NULL, 'Print Out Goodbye World', '//This Is Code', 17, 1, 5); +INSERT INTO Assignment VALUES (21, 'Practice Test 9', NULL, 'Print Out Hello World', '//This Is Code', 18, 1, NULL); + +-- ------------------------------------- +-- Submission Population (idSubmission,SubMemberId,SubAssignmentId,SubSuccess) +-- ------------------------------------- +INSERT INTO Submission VALUES (0002, 0006, 0004, 1); +INSERT INTO Submission VALUES (0003, 0010, 0004, 1); +INSERT INTO Submission VALUES (0004, 0012, 0004, 1); +INSERT INTO Submission VALUES (0005, 0014, 0004, 1); + +INSERT INTO Submission VALUES (0006, 0006, 0019, 1); +INSERT INTO Submission VALUES (0007, 0010, 0019, 1); +INSERT INTO Submission VALUES (0008, 0012, 0019, 1); +INSERT INTO Submission VALUES (0009, 0014, 0019, 1); +INSERT INTO Submission VALUES (0010, 0014, 0019, 1); + +INSERT INTO Submission VALUES (0011, 0006, 0006, 0); +INSERT INTO Submission VALUES (0012, 0006, 0006, 1); +INSERT INTO Submission VALUES (0013, 0008, 0006, 1); +INSERT INTO Submission VALUES (0014, 0014, 0006, 1); + +INSERT INTO Submission VALUES (0015, 0006, 0008, 1); +INSERT INTO Submission VALUES (0016, 0008, 0008, 1); +INSERT INTO Submission VALUES (0017, 0008, 0008, 1); +INSERT INTO Submission VALUES (0018, 0014, 0008, 1); + +INSERT INTO Submission VALUES (0019, 0006, 0013, 1); +INSERT INTO Submission VALUES (0020, 0012, 0013, 1); +INSERT INTO Submission VALUES (0021, 0014, 0013, 1); +INSERT INTO Submission VALUES (0022, 0014, 0013, 1); + +INSERT INTO Submission VALUES (0023, 0006, 0018, 1); +INSERT INTO Submission VALUES (0024, 0008, 0018, 1); +INSERT INTO Submission VALUES (0025, 0012, 0018, 0); +INSERT INTO Submission VALUES (0026, 0014, 0018, 0); + +INSERT INTO Submission VALUES (0027, 0006, 0011, 1); +INSERT INTO Submission VALUES (0028, 0008, 0011, 1); +INSERT INTO Submission VALUES (0029, 0010, 0011, 1); +INSERT INTO Submission VALUES (0030, 0010, 0011, 0); \ No newline at end of file diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..2d9340f --- /dev/null +++ b/README.txt @@ -0,0 +1,27 @@ +Web API URL: +http://classes.cs.kent.edu/courses/cs49901-trac/wiki/CapstoneS2013/WebAPI + +To login to student interface: + username: student@email.gov + password: studentpass + +To login to instructor interface: + username: instructor2@email.gov + password: instructorpass1 + +template for all pages: + + + + + + +22 George Newstudent gnewstud@kent.edu 800000001 Grades +21 Mike Dudebro mike@dudebro.com 123456789 Grades +14 Cody Student sckerstin@kent.edu 810000007 Grades diff --git a/codeSamples/.svn/all-wcprops b/codeSamples/.svn/all-wcprops new file mode 100644 index 0000000..6e45647 --- /dev/null +++ b/codeSamples/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/codeSamples +END +test_py1.py +K 25 +svn:wc:ra_dav:version-url +V 73 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/codeSamples/test_py1.py +END +test.cpp +K 25 +svn:wc:ra_dav:version-url +V 70 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/codeSamples/test.cpp +END +test_py2.py +K 25 +svn:wc:ra_dav:version-url +V 73 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/codeSamples/test_py2.py +END +test2.cpp +K 25 +svn:wc:ra_dav:version-url +V 71 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/codeSamples/test2.cpp +END diff --git a/codeSamples/.svn/entries b/codeSamples/.svn/entries new file mode 100644 index 0000000..58cfbc6 --- /dev/null +++ b/codeSamples/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +2270 +http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/codeSamples +http://classes.cs.kent.edu/courses/cs49901-trac/svn + + + +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + +6b56fd01-43f3-4ec1-838e-340f7da2cd71 + +test_py1.py +file + + + + +2013-05-01T21:08:44.000000Z +0aa0028a05caad2f53fbb69a809d5774 +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +123 + +test.cpp +file + + + + +2013-05-01T21:08:44.000000Z +e16f2a2d985cd6374178ae8bf8d66d08 +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +202 + +test_py2.py +file + + + + +2013-05-01T21:08:44.000000Z +279d55dead5de6cd8c3dd6242acae3b0 +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +100 + +test2.cpp +file + + + + +2013-05-01T21:08:44.000000Z +a145bce53fd2745b847a6287a4f58793 +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +359 + diff --git a/codeSamples/.svn/text-base/test.cpp.svn-base b/codeSamples/.svn/text-base/test.cpp.svn-base new file mode 100644 index 0000000..0a863ae --- /dev/null +++ b/codeSamples/.svn/text-base/test.cpp.svn-base @@ -0,0 +1,17 @@ +// +// +// This is a c++ test file; + + +#include + +using namespace std; +int main() { + int a, b, c; + a = 10; + b = 15; + c = a + b; + cout << "Test " << endl; + cout << "c: " << c << endl; + +} diff --git a/codeSamples/.svn/text-base/test2.cpp.svn-base b/codeSamples/.svn/text-base/test2.cpp.svn-base new file mode 100644 index 0000000..92623e0 --- /dev/null +++ b/codeSamples/.svn/text-base/test2.cpp.svn-base @@ -0,0 +1,32 @@ +// +// +// This is a c++ test file no. 2; +// +// + + + + + + +#include +using namespace std; + +int main() +{ + // this reserves 10 integer elements + int array[10]; + int i; + + // load the array + for(i = 0; i < 10; i++) + array[i] = i; + + // display the array + for(i = 0; i < 10; ++i) + { + cout << array[i] ; + cout << endl; + } + return 0; +} diff --git a/codeSamples/.svn/text-base/test_py1.py.svn-base b/codeSamples/.svn/text-base/test_py1.py.svn-base new file mode 100644 index 0000000..ce91c51 --- /dev/null +++ b/codeSamples/.svn/text-base/test_py1.py.svn-base @@ -0,0 +1,14 @@ +# +# +# +# This is python example 1. + + +def greet(name): + print 'hello', name + + + +greet('John') +greet('Smith') +greet('Sue') diff --git a/codeSamples/.svn/text-base/test_py2.py.svn-base b/codeSamples/.svn/text-base/test_py2.py.svn-base new file mode 100644 index 0000000..e95f85d --- /dev/null +++ b/codeSamples/.svn/text-base/test_py2.py.svn-base @@ -0,0 +1,10 @@ +# +# +# +#This is python example 2. + +x= 10; +y= 25; + +print 'x + y = ', x + y; +print 'x * y = ', x * y; diff --git a/codeSamples/test.cpp b/codeSamples/test.cpp new file mode 100644 index 0000000..0a863ae --- /dev/null +++ b/codeSamples/test.cpp @@ -0,0 +1,17 @@ +// +// +// This is a c++ test file; + + +#include + +using namespace std; +int main() { + int a, b, c; + a = 10; + b = 15; + c = a + b; + cout << "Test " << endl; + cout << "c: " << c << endl; + +} diff --git a/codeSamples/test2.cpp b/codeSamples/test2.cpp new file mode 100644 index 0000000..92623e0 --- /dev/null +++ b/codeSamples/test2.cpp @@ -0,0 +1,32 @@ +// +// +// This is a c++ test file no. 2; +// +// + + + + + + +#include +using namespace std; + +int main() +{ + // this reserves 10 integer elements + int array[10]; + int i; + + // load the array + for(i = 0; i < 10; i++) + array[i] = i; + + // display the array + for(i = 0; i < 10; ++i) + { + cout << array[i] ; + cout << endl; + } + return 0; +} diff --git a/codeSamples/test_py1.py b/codeSamples/test_py1.py new file mode 100644 index 0000000..ce91c51 --- /dev/null +++ b/codeSamples/test_py1.py @@ -0,0 +1,14 @@ +# +# +# +# This is python example 1. + + +def greet(name): + print 'hello', name + + + +greet('John') +greet('Smith') +greet('Sue') diff --git a/codeSamples/test_py2.py b/codeSamples/test_py2.py new file mode 100644 index 0000000..e95f85d --- /dev/null +++ b/codeSamples/test_py2.py @@ -0,0 +1,10 @@ +# +# +# +#This is python example 2. + +x= 10; +y= 25; + +print 'x + y = ', x + y; +print 'x * y = ', x * y; diff --git a/css/.svn/all-wcprops b/css/.svn/all-wcprops new file mode 100644 index 0000000..cefb8fb --- /dev/null +++ b/css/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/courses/cs49901-trac/svn/!svn/ver/2264/S2013/Web/css +END +base.css +K 25 +svn:wc:ra_dav:version-url +V 62 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/css/base.css +END +jquery-ui.css +K 25 +svn:wc:ra_dav:version-url +V 67 +/courses/cs49901-trac/svn/!svn/ver/2053/S2013/Web/css/jquery-ui.css +END +layout.css +K 25 +svn:wc:ra_dav:version-url +V 64 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/css/layout.css +END +acourses.css +K 25 +svn:wc:ra_dav:version-url +V 66 +/courses/cs49901-trac/svn/!svn/ver/1962/S2013/Web/css/acourses.css +END +main.css +K 25 +svn:wc:ra_dav:version-url +V 62 +/courses/cs49901-trac/svn/!svn/ver/2264/S2013/Web/css/main.css +END +codemirror.css +K 25 +svn:wc:ra_dav:version-url +V 68 +/courses/cs49901-trac/svn/!svn/ver/2191/S2013/Web/css/codemirror.css +END +nav-bar.css +K 25 +svn:wc:ra_dav:version-url +V 65 +/courses/cs49901-trac/svn/!svn/ver/2256/S2013/Web/css/nav-bar.css +END diff --git a/css/.svn/entries b/css/.svn/entries new file mode 100644 index 0000000..3f29414 --- /dev/null +++ b/css/.svn/entries @@ -0,0 +1,266 @@ +10 + +dir +2270 +http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/css +http://classes.cs.kent.edu/courses/cs49901-trac/svn + + + +2013-05-01T04:13:40.826966Z +2264 +pedwards + + + + + + + + + + + + + + +6b56fd01-43f3-4ec1-838e-340f7da2cd71 + +base.css +file + + + + +2013-05-01T21:08:44.000000Z +0d257e34495ef61ad81a5d7b6488849c +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +5954 + +jquery-ui.css +file + + + + +2013-05-01T21:08:44.000000Z +582605fb21fe2f3ed9cd066b1ac85e86 +2013-04-03T19:06:42.613570Z +2053 +oasikogl + + + + + + + + + + + + + + + + + + + + + +33083 + +layout.css +file + + + + +2013-05-01T21:08:44.000000Z +f494b640aa945b99383bddb71f89acb5 +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +2428 + +acourses.css +file + + + + +2013-05-01T21:08:44.000000Z +9a89f097fd71ff08dd4edcccc2216b4c +2013-03-13T03:35:23.133531Z +1962 +rqureshi + + + + + + + + + + + + + + + + + + + + + +1072 + +main.css +file + + + + +2013-05-01T21:08:44.000000Z +031f2b8a2e316864fd79cf7c1be04169 +2013-05-01T04:13:40.826966Z +2264 +pedwards + + + + + + + + + + + + + + + + + + + + + +12800 + +codemirror.css +file + + + + +2013-05-01T21:08:44.000000Z +f4a33ff42902214123dae23fcc91647b +2013-04-19T21:58:52.002500Z +2191 +talrefai +has-props + + + + + + + + + + + + + + + + + + + + +5744 + +nav-bar.css +file + + + + +2013-05-01T21:08:44.000000Z +b9a7f2b8d428f4230cfe38cfff752ad5 +2013-04-30T05:29:50.489693Z +2256 +aalmahai + + + + + + + + + + + + + + + + + + + + + +1102 + diff --git a/css/.svn/prop-base/codemirror.css.svn-base b/css/.svn/prop-base/codemirror.css.svn-base new file mode 100644 index 0000000..03b5bfa --- /dev/null +++ b/css/.svn/prop-base/codemirror.css.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 14 +svn:executable +V 1 +* +END diff --git a/css/.svn/text-base/acourses.css.svn-base b/css/.svn/text-base/acourses.css.svn-base new file mode 100644 index 0000000..05e0239 --- /dev/null +++ b/css/.svn/text-base/acourses.css.svn-base @@ -0,0 +1,62 @@ +#navigation {font-size:0.75em; width:150px;} +#navigation ul {margin:0px; padding:0px;} +#navigation li {list-style: none;} + +ul.top-level {background:#666;} +ul.top-level li { + border-bottom: #fff solid; + border-top: #fff solid; + border-width: 1px; +} + +#navigation a { + color: #fff; + cursor: pointer; + display:block; + height:25px; + line-height: 25px; + text-indent: 10px; + text-decoration:none; + width:100%; +} +#navigation a:hover{ + text-decoration:none; +} + +#navigation li:hover { + background: #f90; + position: relative; +} +ul.sub-level { + display: none; +} +li:hover .sub-level { + background: #999; + border: #fff solid; + border-width: 1px; + display: block; + position: absolute; + left: 150px; + top: 0px; +} +ul.sub-level li { + border: none; + float:left; + width:150px; +} + +#myFrame { width:100%; height:500px; border:none;} +#listOfStudent +{ + font-size:0.75em; +} +#listOfStudent thead { + margin:0px; + padding:10px; + padding-left:10px; + background:#666; + color: #fff; +} +#listOfStudent td { + +} \ No newline at end of file diff --git a/css/.svn/text-base/base.css.svn-base b/css/.svn/text-base/base.css.svn-base new file mode 100644 index 0000000..f780515 --- /dev/null +++ b/css/.svn/text-base/base.css.svn-base @@ -0,0 +1,214 @@ + +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; } +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { + display: block; } +body { + line-height: 1; } +ol, ul { + list-style: none; } +blockquote, q { + quotes: none; } +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; } +table { + border-collapse: collapse; + border-spacing: 0; } + + + +body { + background: white; + font: 14px/21px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #444; + -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ + -webkit-text-size-adjust: none; +} + + + +h1, h2, h3, h4, h5, h6 { + color: #181818; + font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; + font-weight: normal; } +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; } +h1 { font-size: 46px; line-height: 50px; margin-bottom: 14px;} +h2 { font-size: 35px; line-height: 40px; margin-bottom: 10px; } +h3 { font-size: 28px; line-height: 34px; margin-bottom: 8px; } +h4 { font-size: 21px; line-height: 30px; margin-bottom: 4px; } +h5 { font-size: 17px; line-height: 24px; } +h6 { font-size: 14px; line-height: 21px; } +.subheader { color: #777; } + +p { margin: 0 0 20px; } +p {color:black;text-align:center;} +p img { margin: 0; } +p.lead { font-size: 21px; line-height: 27px; } + +em { font-style: italic; } +strong { font-weight: bold; color: #333; } +small { font-size: 80%; } + + +blockquote, blockquote p { font-size: 17px; line-height: 24px; color: #777; font-style: italic; } +blockquote { margin: 0 0 20px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; } +blockquote cite { display: block; font-size: 12px; color: #555; } +blockquote cite:before { content: "\2014 \0020"; } +blockquote cite a, blockquote cite a:visited, blockquote cite a:visited { color: #555; } + + + + + +a, a:visited { color: #333; text-decoration: underline; outline: 0; } +a:hover, a:focus { color: #000; } +p a, p a:visited { line-height: inherit; } + + + +ul, ol { margin-bottom: 20px; } +ul { list-style: none outside; } +ol { list-style: decimal; } +ol, ul.square, ul.circle, ul.disc { margin-left: 30px; } +ul.square { list-style: square outside; } +ul.circle { list-style: circle outside; } +ul.disc { list-style: disc outside; } +ul ul, ul ol +ol ol, ol ul { margin: 4px 0 5px 30px; font-size: 90%; } +ul ul li, ul ol li +ol ol li, ol ul li { margin-bottom: 6px; } +li { line-height: 18px; margin-bottom: 12px; } +ul.large li { line-height: 21px; } +li p { line-height: 21px; } + + +img { + max-width: 100%; + height: auto; } + +ul.tabs { + display: block; + margin: 0 0 20px 0; + padding: 0; + border-bottom: solid 1px #ddd; } +ul.tabs li { + display: block; + width: auto; + height: 30px; + padding: 0; + float: left; + margin-bottom: 0; } +ul.tabs li a { + display: block; + text-decoration: none; + width: auto; + height: 29px; + padding: 0px 20px; + line-height: 30px; + border: solid 1px #ddd; + border-width: 1px 0 0 1px; + margin: 0; + background: #f5f5f5; + font-size: 13px; } +ul.tabs li a.active { + background: #fff; + height: 30px; + position: relative; + top: -4px; + padding-top: 4px; + border-right-width: 1px; + margin: 0 -1px 0 0; + color: #111; + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + border-top-left-radius: 2px; + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + border-top-right-radius: 2px; } +ul.tabs li:first-child a { + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + border-top-left-radius: 2px; } +ul.tabs li:last-child a { + border-width: 1px 1px 0 1px; + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + border-top-right-radius: 2px; } + +ul.tabs-content { margin: 0; display: block; } +ul.tabs-content > li { display:none; } +ul.tabs-content > li.active { display: block; } + + +ul.tabs:before, +ul.tabs:after { + content: '\0020'; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; } +ul.tabs:after { + clear: both; } +ul.tabs { + zoom: 1; } + +form { + margin-bottom: 20px; } +fieldset { + margin-bottom: 20px; } +input[type="text"], +input[type="password"], +input[type="email"], +textarea, +select { + border: 1px solid #ccc; + padding: 6px 4px; + outline: none; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + font: 13px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #777; + margin: 0; + width: 210px; + max-width: 100%; + display: block; + margin-bottom: 20px; + background: #fff; } +select { + padding: 0; } +input[type="text"]:focus, +input[type="password"]:focus, +input[type="email"]:focus, +textarea:focus { + border: 1px solid #aaa; + color: #444; + -moz-box-shadow: 0 0 3px rgba(0,0,0,.2); + -webkit-box-shadow: 0 0 3px rgba(0,0,0,.2); + box-shadow: 0 0 3px rgba(0,0,0,.2); } +textarea { + min-height: 60px; } +label { + display: block; + font-weight: bold; + font-size: 13px; } +select { + width: 220px; } +input[type="checkbox"] { + display: inline; } +label span { + font-weight: normal; + font-size: 13px; + color: #444; } + + +.remove-bottom { margin-bottom: 0 !important; } +.add-bottom { margin-bottom: 20px !important; } \ No newline at end of file diff --git a/css/.svn/text-base/codemirror.css.svn-base b/css/.svn/text-base/codemirror.css.svn-base new file mode 100644 index 0000000..4e12615 --- /dev/null +++ b/css/.svn/text-base/codemirror.css.svn-base @@ -0,0 +1,246 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; +} +.CodeMirror-scroll { + /* Set scrolling behaviour here */ + overflow: auto; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; +} + +/* CURSOR */ + +.CodeMirror div.CodeMirror-cursor { + border-left: 1px solid black; + z-index: 3; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { + width: auto; + border: 0; + background: #7e7; + z-index: 1; +} +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} + +.cm-tab { display: inline-block; } + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable {color: black;} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-property {color: black;} +.cm-s-default .cm-operator {color: black;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-error {color: #f00;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} + +.cm-invalidchar {color: #f00;} + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + line-height: 1; + position: relative; + overflow: hidden; + background: white; + color: black; +} + +.CodeMirror-scroll { + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; padding-right: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actuall scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; + z-index: 6; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + height: 100%; + padding-bottom: 30px; + z-index: 3; +} +.CodeMirror-gutter { + height: 100%; + padding-bottom: 30px; + margin-bottom: -32px; + display: inline-block; + /* Hack to make IE7 behave */ + *zoom:1; + *display:inline; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} + +.CodeMirror-lines { + cursor: text; +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto; +} + +.CodeMirror-widget { + display: inline-block; +} + +.CodeMirror-wrap .CodeMirror-scroll { + overflow-x: hidden; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; height: 0px; + overflow: hidden; + visibility: hidden; +} +.CodeMirror-measure pre { position: static; } + +.CodeMirror div.CodeMirror-cursor { + position: absolute; + visibility: hidden; + border-right: none; + width: 0; +} +.CodeMirror-focused div.CodeMirror-cursor { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ +.CodeMirror span { *vertical-align: text-bottom; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursor { + visibility: hidden; + } +} diff --git a/css/.svn/text-base/jquery-ui.css.svn-base b/css/.svn/text-base/jquery-ui.css.svn-base new file mode 100644 index 0000000..a4ced2a --- /dev/null +++ b/css/.svn/text-base/jquery-ui.css.svn-base @@ -0,0 +1,1175 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3; + background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999; + background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #212121; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa; + background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); + border-radius: 8px; +} \ No newline at end of file diff --git a/css/.svn/text-base/layout.css.svn-base b/css/.svn/text-base/layout.css.svn-base new file mode 100644 index 0000000..2cff487 --- /dev/null +++ b/css/.svn/text-base/layout.css.svn-base @@ -0,0 +1,113 @@ +.notice { + width: 100%; + background: #fff; + border-bottom: 4px solid #eaeff3; + color: #e34848; + position: fixed; + top: 0; + font-size: 14px; + font-weight: bold; + height: 45px; + -moz-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3); + -webkit-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3); + box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3); +} + +.notice p.warn { + text-align: center; + line-height: 45px; +} + +.notice a.close { + width: 9px; + height: 9px; + float: right; + background: url(../images/close.png) no-repeat top left; + text-indent: -9999px; + margin-right: 15px; + margin-top: 20px; +} + +.notice a.close:hover { + background: url(../images/close-hover.png) no-repeat top left; +} + +.form-bg { + width: 370px; + height: 248px; + -moz-border-radius:9px; + -webkit-border-radius:9px; + border-radius:9px; + margin: 150px auto 0; + background: url(../images/form-bg.png) top left; + padding: 8px 0 0 8px; +} + +.form-bg form { + width: 360px; + height: 239px; + background: #fff url(../images/bg_form.jpg) repeat-x top left; + -moz-border-radius:4px; + -webkit-border-radius:4px; + border-radius:4px; + -moz-box-shadow:0px 1px 3px 2px rgba(0,0,0,0.1); + -webkit-box-shadow:0px 1px 3px 2px rgba(0,0,0,0.1); + box-shadow:0px 1px 3px 2px rgba(0,0,0,0.1); +} + +.form-bg form h2 { + font-size: 14px; + font-weight: bold; + text-align: center; + color: #555555; + font-family:"HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + text-shadow: 0 1px 0 #fff; + filter: dropshadow(color=#fff, offx=0, offy=1); + line-height: 45px; + margin-bottom: 24px; +} + +input[type="text"], input[type="password"]{ + box-shadow: 0px 0px 0px 4px #f2f5f7; + width: 290px; + height: 33px; + + padding: 0 10px 0 10px; + margin: 0 auto; + color: #aeaeae; + border: 1px solid #bec2c4; +} + +input[type="text"]:focus, input[type="password"]:focus{ + box-shadow: 0px 0px 0px 4px #e0f1fc; + border:1px solid #7dc6dd; +} + +input[type="checkbox"] { + vertical-align: middle; +} + +label { + display: inline; + margin-left: 24px; + vertical-align: middle; +} + +label span { + color: 555555; + font-size: 12px; +} + +p.forgot { + text-align: center; + margin-top: 30px; + color: #fff; + font-size: 12px; + font-weight: bold; + text-shadow: 0 1px 0 rgba(0,0,0,0.3); +} + +p.forgot a { + color: #cbebf6; + text-decoration: none; +} \ No newline at end of file diff --git a/css/.svn/text-base/main.css.svn-base b/css/.svn/text-base/main.css.svn-base new file mode 100644 index 0000000..2b0f527 --- /dev/null +++ b/css/.svn/text-base/main.css.svn-base @@ -0,0 +1,887 @@ +body { + background: whitesmoke; + font: 14px/21px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: black; + -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ + -webkit-text-size-adjust: none; +} + +#courses{ + width: 100%; + font-size: 18px; + font-weight: normal; + height: 45px; +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} +h1{ + font: bold 16px Tahoma; +} +h2{ + font: bold 14px Tahoma; +} +header,bottom, section, footer, aside, nav, table, textarea, ul{ + display:block; +} +#big_wrapper{ + max-width: 1000px; + margin-left: auto; + margin-right: auto; + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; +} +#top_header{ + background: white; + border:2px solid blue; + padding:15px; +} + +#new_div{ + display:-webkit-box; + -webkit-box-orient:horizontal; +} + +#side_code{ + border:2px solid blue; + width:110px; + margin: 05px 0px; + padding: 15px; + background:white; +} + +#main_section{ + background: white; + border:2px solid blue; + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; + margin: 5px; + padding-left: 50px; + padding-top: 10px; +} + + +#txtarea{ + width: 50%; + height: 98%; + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; + border-width: 1px; + border:1px solid blue; + background-color: #F2F2F2; +} + +#b-bottom{ + background: white; + border:2px solid blue; + padding:10px; +} + +/* this is for showing the result */ +#t-table{ + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; + padding-bottom: 5px; + padding-top: 5px; + width: 450px; +} + +#the_footer { + width:100%; + height:50px; + bottom:0; + left:0; + text-align:center; +} + +#form_container +{ + margin:10px 0px; + text-align:left; + width:640px; +} + +.button { + background-color:#3d94f6; + display:inline-block; + color:#ffffff; + font-family:arial; + font-size:15px; + font-weight:bold; + padding:8px 24px; + text-decoration:none; +}.button:hover { + background-color:#1e62d0; +}.button:active { + position:relative; + top:1px; +} +.codebox { + background-color:#D5D5D5; + width:800px; + overflow:auto; +} +form.appnitro +{ + margin:20px 20px 0; + padding:0 0 20px; +} + + +/**** Form Section ****/ +.appnitro +{ + font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif; + font-size:small; +} + +.appnitro li +{ + width:61%; +} + +form ul +{ + font-size:100%; + list-style-type:none; + margin:0; + padding:0; + width:100%; +} + +form li +{ + display:block; + margin:0; + padding:4px 5px 2px 9px; + position:relative; +} + +form li:after +{ + clear:both; + content:"."; + display:block; + height:0; + visibility:hidden; +} + +.buttons:after +{ + clear:both; + content:"."; + display:block; + height:0; + visibility:hidden; +} + +.buttons +{ + clear:both; + display:block; + margin-top:10px; +} + +* html form li +{ + height:1%; +} + +* html .buttons +{ + height:1%; +} + +* html form li div +{ + display:inline-block; +} + +form li div +{ + color:#444; + margin:0 4px 0 0; + padding:0 0 8px; +} + +form li span +{ + color:#444; + float:left; + margin:0 4px 0 0; + padding:0 0 8px; +} + +form li div.left +{ + display:inline; + float:left; + width:48%; +} + +form li div.right +{ + display:inline; + float:right; + width:48%; +} + +form li div.left .medium +{ + width:100%; +} + +form li div.right .medium +{ + width:100%; +} + +.clear +{ + clear:both; +} + +form li div label +{ + clear:both; + color:#444; + display:block; + font-size:9px; + line-height:9px; + margin:0; + padding-top:3px; +} + +form li span label +{ + clear:both; + color:#444; + display:block; + font-size:9px; + line-height:9px; + margin:0; + padding-top:3px; +} + +form li .datepicker +{ + cursor:pointer !important; + float:left; + height:16px; + margin:.1em 5px 0 0; + padding:0; + width:16px; +} + + +form hr +{ + display:none; +} + +form li.section_break +{ + border-top:1px dotted #ccc; + margin-top:9px; + padding-bottom:0; + padding-left:9px; + padding-top:13px; + width:97% !important; +} + +form ul li.first +{ + border-top:none !important; + margin-top:0 !important; + padding-top:0 !important; +} + +form .section_break h3 +{ + font-size:110%; + font-weight:400; + line-height:130%; + margin:0 0 2px; +} + +form .section_break p +{ + font-size:85%; + + margin:0 0 10px; +} + +/**** Buttons ****/ +input.button_text +{ + overflow:visible; + padding:0 7px; + width:auto; +} + +.buttons input +{ + font-size:120%; + margin-right:5px; +} + +/**** Inputs and Labels ****/ +label.description +{ + border:none; + color:#222; + display:block; + font-size:95%; + font-weight:700; + line-height:150%; + padding:0 0 1px; +} + +span.symbol +{ + font-size:115%; + line-height:130%; +} + +input.text +{ + background:#fff url(../../../images/shadow.gif) repeat-x top; + border-bottom:1px solid #ddd; + border-left:1px solid #c3c3c3; + border-right:1px solid #c3c3c3; + border-top:1px solid #7c7c7c; + color:#333; + font-size:100%; + margin:0; + padding:2px 0; +} + +input.file +{ + color:#333; + font-size:100%; + margin:0; + padding:2px 0; +} + +textarea.textarea +{ + border-bottom:1px solid #ddd; + border-left:1px solid #c3c3c3; + border-right:1px solid #c3c3c3; + border-top:1px solid #7c7c7c; + color:#333; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; + font-size:100%; + margin:0; + width:99%; +} + +select.select +{ + color:#333; + font-size:100%; + margin:1px 0; + padding:1px 0 0; + border-bottom:1px solid #ddd; + border-left:1px solid #c3c3c3; + border-right:1px solid #c3c3c3; + border-top:1px solid #7c7c7c; +} + + +input.currency +{ + text-align:right; +} + +input.checkbox +{ + display:block; + height:13px; + line-height:1.4em; + margin:6px 0 0 3px; + width:13px; +} + +input.radio +{ + display:block; + height:13px; + line-height:1.4em; + margin:6px 0 0 3px; + width:13px; +} + +label.choice +{ + color:#444; + display:block; + font-size:100%; + line-height:1.4em; + margin:-1.55em 0 0 25px; + padding:4px 0 5px; + width:90%; +} + +select.select[class] +{ + margin:0; + padding:1px 0; +} + +*:first-child+html select.select[class] +{ + margin:1px 0; +} + +.safari select.select +{ + font-size:120% !important; + margin-bottom:1px; +} + +input.small +{ + width:25%; +} + +select.small +{ + width:25%; +} + +input.medium +{ + width:50%; +} + +select.medium +{ + width:50%; +} + +input.large +{ + width:99%; +} + +select.large +{ + width:100%; +} + +textarea.small +{ + height:5.5em; +} + +textarea.medium +{ + height:10em; +} + +textarea.large +{ + height:20em; +} + +/**** Errors ****/ +#error_message +{ + background:#fff; + border:1px dotted red; + margin-bottom:1em; + padding-left:0; + padding-right:0; + padding-top:4px; + text-align:center; + width:99%; +} + +#error_message_title +{ + color:#DF0000; + font-size:125%; + margin:7px 0 5px; + padding:0; +} + +#error_message_desc +{ + color:#000; + font-size:100%; + margin:0 0 .8em; +} + +#error_message_desc strong +{ + background-color:#FFDFDF; + color:red; + padding:2px 3px; +} + +form li.error +{ + background-color:#FFDFDF !important; + border-bottom:1px solid #EACBCC; + border-right:1px solid #EACBCC; + margin:3px 0; +} + +form li.error label +{ + color:#DF0000 !important; +} + +form p.error +{ + clear:both; + color:red; + font-size:10px; + font-weight:700; + margin:0 0 5px; +} + +form .required +{ + color:red; + float:none; + font-weight:700; +} + +/**** Guidelines and Error Highlight ****/ +form li.highlighted +{ + background-color:#fff7c0; +} + +form .guidelines +{ + background:#f5f5f5; + border:1px solid #e6e6e6; + color:#444; + font-size:80%; + left:100%; + line-height:130%; + margin:0 0 0 8px; + padding:8px 10px 9px; + position:absolute; + top:0; + visibility:hidden; + width:42%; + z-index:1000; +} + +form .guidelines small +{ + font-size:105%; +} + +form li.highlighted .guidelines +{ + visibility:visible; +} + +form li:hover .guidelines +{ + visibility:visible; +} + +.no_guidelines .guidelines +{ + display:none !important; +} + +.no_guidelines form li +{ + width:97%; +} + +.no_guidelines li.section +{ + padding-left:9px; +} + +/*** Success Message ****/ +.form_success +{ + clear: both; + margin: 0; + padding: 90px 0pt 100px; + text-align: center +} + +.form_success h2 { + clear:left; + font-size:160%; + font-weight:normal; + margin:0pt 0pt 3px; +} + +/*** Password ****/ +ul.password{ + margin-top:60px; + margin-bottom: 60px; + text-align: center; +} +.password h2{ + color:#DF0000; + font-weight:bold; + margin:0pt auto 10px; +} + +.password input.text { + font-size:170% !important; + width:380px; + text-align: center; +} +.password label{ + display:block; + font-size:120% !important; + padding-top:10px; + font-weight:bold; +} + +#li_captcha{ + padding-left: 5px; +} + + +#li_captcha span{ + float:none; +} + +/** Embedded Form **/ + +.embed #form_container{ + border: none; +} + +.embed #top, .embed #bottom, .embed h1{ + display: none; +} + +.embed #form_container{ + width: 100%; +} + +.embed #footer{ + text-align: left; + padding-left: 10px; + width: 99%; +} + +.embed #footer.success{ + text-align: center; +} + +.embed form.appnitro +{ + margin:0px 0px 0; + +} + + + +/*** Calendar **********************/ +div.calendar { position: relative; } + +.calendar table { + cursor:pointer; + border:1px solid #ccc; + font-size: 11px; + color: #000; + background: #fff; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; +} + +.calendar .button { + text-align: center; + padding: 2px; +} + +.calendar .nav { + background:#f5f5f5; +} + +.calendar thead .title { + font-weight: bold; + text-align: center; + background: #dedede; + color: #000; + padding: 2px 0 3px 0; +} + +.calendar thead .headrow { + background: #f5f5f5; + color: #444; + font-weight:bold; +} + +.calendar thead .daynames { + background: #fff; + color:#333; + font-weight:bold; +} + +.calendar thead .name { + border-bottom: 1px dotted #ccc; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { + color: #666; +} + +.calendar thead .hilite { + background-color: #444; + color: #fff; + padding: 1px; +} + +.calendar thead .active { + background-color: #d12f19; + color:#fff; + padding: 2px 0px 0px 2px; +} + + +.calendar tbody .day { + width:1.8em; + color: #222; + text-align: right; + padding: 2px 2px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 2px 2px 2px; + border-right: 1px solid #000; + background: #666; +} + +.calendar tbody .rowhilite td { + background: #FFF1AF; +} + +.calendar tbody .rowhilite td.wn { + background: #FFF1AF; +} + +.calendar tbody td.hilite { + padding: 1px 1px 1px 1px; + background:#444 !important; + color:#fff !important; +} + +.calendar tbody td.active { + color:#fff; + background: #529214 !important; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { + font-weight: bold; + border: 1px solid #888; + padding: 1px 1px 1px 1px; + background: #f5f5f5 !important; + color: #222 !important; +} + +.calendar tbody td.weekend { + color: #666; +} + +.calendar tbody td.today { + font-weight: bold; + color: #529214; + background:#D9EFC2; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { + visibility: hidden; +} + +.calendar tbody .emptyrow { + display: none; +} + +.calendar tfoot .footrow { + text-align: center; + background: #556; + color: #fff; +} + +.calendar tfoot .ttip { + background: #222; + color: #fff; + font-size:10px; + border-top: 1px solid #dedede; + padding: 3px; +} + +.calendar tfoot .hilite { + background: #aaf; + border: 1px solid #04f; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { + background: #77c; + padding: 2px 0px 0px 2px; +} + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + border: 1px solid #ccc; + background: #f5f5f5; + color: #222; + font-size: 90%; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #444; + color:#fff; +} + +.calendar .combo .active { + border-top: 1px solid #999; + border-bottom: 1px solid #999; + background: #dedede; + font-weight: bold; +} + diff --git a/css/.svn/text-base/nav-bar.css.svn-base b/css/.svn/text-base/nav-bar.css.svn-base new file mode 100644 index 0000000..3cf301d --- /dev/null +++ b/css/.svn/text-base/nav-bar.css.svn-base @@ -0,0 +1,55 @@ +#menu { + border:none; + border:0px; + margin:0px; + padding:0px; + font: 67.5% "Lucida Sans Unicode", "Bitstream Vera Sans", "Trebuchet Unicode MS", "Lucida Grande", Verdana, Helvetica, sans-serif; + font-size:14px; + font-weight:bold; +} + +#nav { + height:35px; + list-style:none; + margin:0; + padding:0; + float:right; + text-align:center; + } + +#nav li { + display:inline-block; + position:relative; + float:right; + background: #3d94f6; + } + +#nav li a { + display:inline-block; + width:165px; + line-height:35px; + padding:0; + text-decoration:none; + color:#ffffff; + } + +#nav li li {float:left; #1e62d0;} + +#nav li li a {display:block;font-size:12px;} + +#nav li:hover {background:#1e62d0;} + +/*--- Sublist Styles ---*/ +#nav ul { + position:absolute; + padding:0px; + left:0; + display:none; + } + +/*--- Hide Sub Sublists ---*/ +#nav li:hover ul ul {display:none;} + +/*--- Sublevel UL's display and position on hover ---*/ +#nav li:hover ul {display:block;} +#nav li li:hover ul {margin-left:200px; margin-top:-35px; display:block;} \ No newline at end of file diff --git a/css/acourses.css b/css/acourses.css new file mode 100644 index 0000000..05e0239 --- /dev/null +++ b/css/acourses.css @@ -0,0 +1,62 @@ +#navigation {font-size:0.75em; width:150px;} +#navigation ul {margin:0px; padding:0px;} +#navigation li {list-style: none;} + +ul.top-level {background:#666;} +ul.top-level li { + border-bottom: #fff solid; + border-top: #fff solid; + border-width: 1px; +} + +#navigation a { + color: #fff; + cursor: pointer; + display:block; + height:25px; + line-height: 25px; + text-indent: 10px; + text-decoration:none; + width:100%; +} +#navigation a:hover{ + text-decoration:none; +} + +#navigation li:hover { + background: #f90; + position: relative; +} +ul.sub-level { + display: none; +} +li:hover .sub-level { + background: #999; + border: #fff solid; + border-width: 1px; + display: block; + position: absolute; + left: 150px; + top: 0px; +} +ul.sub-level li { + border: none; + float:left; + width:150px; +} + +#myFrame { width:100%; height:500px; border:none;} +#listOfStudent +{ + font-size:0.75em; +} +#listOfStudent thead { + margin:0px; + padding:10px; + padding-left:10px; + background:#666; + color: #fff; +} +#listOfStudent td { + +} \ No newline at end of file diff --git a/css/base.css b/css/base.css new file mode 100644 index 0000000..f780515 --- /dev/null +++ b/css/base.css @@ -0,0 +1,214 @@ + +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; } +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { + display: block; } +body { + line-height: 1; } +ol, ul { + list-style: none; } +blockquote, q { + quotes: none; } +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; } +table { + border-collapse: collapse; + border-spacing: 0; } + + + +body { + background: white; + font: 14px/21px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #444; + -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ + -webkit-text-size-adjust: none; +} + + + +h1, h2, h3, h4, h5, h6 { + color: #181818; + font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif; + font-weight: normal; } +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; } +h1 { font-size: 46px; line-height: 50px; margin-bottom: 14px;} +h2 { font-size: 35px; line-height: 40px; margin-bottom: 10px; } +h3 { font-size: 28px; line-height: 34px; margin-bottom: 8px; } +h4 { font-size: 21px; line-height: 30px; margin-bottom: 4px; } +h5 { font-size: 17px; line-height: 24px; } +h6 { font-size: 14px; line-height: 21px; } +.subheader { color: #777; } + +p { margin: 0 0 20px; } +p {color:black;text-align:center;} +p img { margin: 0; } +p.lead { font-size: 21px; line-height: 27px; } + +em { font-style: italic; } +strong { font-weight: bold; color: #333; } +small { font-size: 80%; } + + +blockquote, blockquote p { font-size: 17px; line-height: 24px; color: #777; font-style: italic; } +blockquote { margin: 0 0 20px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; } +blockquote cite { display: block; font-size: 12px; color: #555; } +blockquote cite:before { content: "\2014 \0020"; } +blockquote cite a, blockquote cite a:visited, blockquote cite a:visited { color: #555; } + + + + + +a, a:visited { color: #333; text-decoration: underline; outline: 0; } +a:hover, a:focus { color: #000; } +p a, p a:visited { line-height: inherit; } + + + +ul, ol { margin-bottom: 20px; } +ul { list-style: none outside; } +ol { list-style: decimal; } +ol, ul.square, ul.circle, ul.disc { margin-left: 30px; } +ul.square { list-style: square outside; } +ul.circle { list-style: circle outside; } +ul.disc { list-style: disc outside; } +ul ul, ul ol +ol ol, ol ul { margin: 4px 0 5px 30px; font-size: 90%; } +ul ul li, ul ol li +ol ol li, ol ul li { margin-bottom: 6px; } +li { line-height: 18px; margin-bottom: 12px; } +ul.large li { line-height: 21px; } +li p { line-height: 21px; } + + +img { + max-width: 100%; + height: auto; } + +ul.tabs { + display: block; + margin: 0 0 20px 0; + padding: 0; + border-bottom: solid 1px #ddd; } +ul.tabs li { + display: block; + width: auto; + height: 30px; + padding: 0; + float: left; + margin-bottom: 0; } +ul.tabs li a { + display: block; + text-decoration: none; + width: auto; + height: 29px; + padding: 0px 20px; + line-height: 30px; + border: solid 1px #ddd; + border-width: 1px 0 0 1px; + margin: 0; + background: #f5f5f5; + font-size: 13px; } +ul.tabs li a.active { + background: #fff; + height: 30px; + position: relative; + top: -4px; + padding-top: 4px; + border-right-width: 1px; + margin: 0 -1px 0 0; + color: #111; + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + border-top-left-radius: 2px; + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + border-top-right-radius: 2px; } +ul.tabs li:first-child a { + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + border-top-left-radius: 2px; } +ul.tabs li:last-child a { + border-width: 1px 1px 0 1px; + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + border-top-right-radius: 2px; } + +ul.tabs-content { margin: 0; display: block; } +ul.tabs-content > li { display:none; } +ul.tabs-content > li.active { display: block; } + + +ul.tabs:before, +ul.tabs:after { + content: '\0020'; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; } +ul.tabs:after { + clear: both; } +ul.tabs { + zoom: 1; } + +form { + margin-bottom: 20px; } +fieldset { + margin-bottom: 20px; } +input[type="text"], +input[type="password"], +input[type="email"], +textarea, +select { + border: 1px solid #ccc; + padding: 6px 4px; + outline: none; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + font: 13px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #777; + margin: 0; + width: 210px; + max-width: 100%; + display: block; + margin-bottom: 20px; + background: #fff; } +select { + padding: 0; } +input[type="text"]:focus, +input[type="password"]:focus, +input[type="email"]:focus, +textarea:focus { + border: 1px solid #aaa; + color: #444; + -moz-box-shadow: 0 0 3px rgba(0,0,0,.2); + -webkit-box-shadow: 0 0 3px rgba(0,0,0,.2); + box-shadow: 0 0 3px rgba(0,0,0,.2); } +textarea { + min-height: 60px; } +label { + display: block; + font-weight: bold; + font-size: 13px; } +select { + width: 220px; } +input[type="checkbox"] { + display: inline; } +label span { + font-weight: normal; + font-size: 13px; + color: #444; } + + +.remove-bottom { margin-bottom: 0 !important; } +.add-bottom { margin-bottom: 20px !important; } \ No newline at end of file diff --git a/css/codemirror.css b/css/codemirror.css new file mode 100644 index 0000000..4e12615 --- /dev/null +++ b/css/codemirror.css @@ -0,0 +1,246 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; +} +.CodeMirror-scroll { + /* Set scrolling behaviour here */ + overflow: auto; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; +} + +/* CURSOR */ + +.CodeMirror div.CodeMirror-cursor { + border-left: 1px solid black; + z-index: 3; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { + width: auto; + border: 0; + background: #7e7; + z-index: 1; +} +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} + +.cm-tab { display: inline-block; } + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable {color: black;} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-property {color: black;} +.cm-s-default .cm-operator {color: black;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-error {color: #f00;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} + +.cm-invalidchar {color: #f00;} + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + line-height: 1; + position: relative; + overflow: hidden; + background: white; + color: black; +} + +.CodeMirror-scroll { + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; padding-right: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actuall scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; + z-index: 6; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + height: 100%; + padding-bottom: 30px; + z-index: 3; +} +.CodeMirror-gutter { + height: 100%; + padding-bottom: 30px; + margin-bottom: -32px; + display: inline-block; + /* Hack to make IE7 behave */ + *zoom:1; + *display:inline; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} + +.CodeMirror-lines { + cursor: text; +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto; +} + +.CodeMirror-widget { + display: inline-block; +} + +.CodeMirror-wrap .CodeMirror-scroll { + overflow-x: hidden; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; height: 0px; + overflow: hidden; + visibility: hidden; +} +.CodeMirror-measure pre { position: static; } + +.CodeMirror div.CodeMirror-cursor { + position: absolute; + visibility: hidden; + border-right: none; + width: 0; +} +.CodeMirror-focused div.CodeMirror-cursor { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ +.CodeMirror span { *vertical-align: text-bottom; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursor { + visibility: hidden; + } +} diff --git a/css/jquery-ui.css b/css/jquery-ui.css new file mode 100644 index 0000000..a4ced2a --- /dev/null +++ b/css/jquery-ui.css @@ -0,0 +1,1175 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3; + background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999; + background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #212121; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa; + background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); + border-radius: 8px; +} \ No newline at end of file diff --git a/css/layout.css b/css/layout.css new file mode 100644 index 0000000..2cff487 --- /dev/null +++ b/css/layout.css @@ -0,0 +1,113 @@ +.notice { + width: 100%; + background: #fff; + border-bottom: 4px solid #eaeff3; + color: #e34848; + position: fixed; + top: 0; + font-size: 14px; + font-weight: bold; + height: 45px; + -moz-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3); + -webkit-box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3); + box-shadow:0px 0px 3px 1px rgba(0,0,0,0.3); +} + +.notice p.warn { + text-align: center; + line-height: 45px; +} + +.notice a.close { + width: 9px; + height: 9px; + float: right; + background: url(../images/close.png) no-repeat top left; + text-indent: -9999px; + margin-right: 15px; + margin-top: 20px; +} + +.notice a.close:hover { + background: url(../images/close-hover.png) no-repeat top left; +} + +.form-bg { + width: 370px; + height: 248px; + -moz-border-radius:9px; + -webkit-border-radius:9px; + border-radius:9px; + margin: 150px auto 0; + background: url(../images/form-bg.png) top left; + padding: 8px 0 0 8px; +} + +.form-bg form { + width: 360px; + height: 239px; + background: #fff url(../images/bg_form.jpg) repeat-x top left; + -moz-border-radius:4px; + -webkit-border-radius:4px; + border-radius:4px; + -moz-box-shadow:0px 1px 3px 2px rgba(0,0,0,0.1); + -webkit-box-shadow:0px 1px 3px 2px rgba(0,0,0,0.1); + box-shadow:0px 1px 3px 2px rgba(0,0,0,0.1); +} + +.form-bg form h2 { + font-size: 14px; + font-weight: bold; + text-align: center; + color: #555555; + font-family:"HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + text-shadow: 0 1px 0 #fff; + filter: dropshadow(color=#fff, offx=0, offy=1); + line-height: 45px; + margin-bottom: 24px; +} + +input[type="text"], input[type="password"]{ + box-shadow: 0px 0px 0px 4px #f2f5f7; + width: 290px; + height: 33px; + + padding: 0 10px 0 10px; + margin: 0 auto; + color: #aeaeae; + border: 1px solid #bec2c4; +} + +input[type="text"]:focus, input[type="password"]:focus{ + box-shadow: 0px 0px 0px 4px #e0f1fc; + border:1px solid #7dc6dd; +} + +input[type="checkbox"] { + vertical-align: middle; +} + +label { + display: inline; + margin-left: 24px; + vertical-align: middle; +} + +label span { + color: 555555; + font-size: 12px; +} + +p.forgot { + text-align: center; + margin-top: 30px; + color: #fff; + font-size: 12px; + font-weight: bold; + text-shadow: 0 1px 0 rgba(0,0,0,0.3); +} + +p.forgot a { + color: #cbebf6; + text-decoration: none; +} \ No newline at end of file diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..2b0f527 --- /dev/null +++ b/css/main.css @@ -0,0 +1,887 @@ +body { + background: whitesmoke; + font: 14px/21px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; + color: black; + -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ + -webkit-text-size-adjust: none; +} + +#courses{ + width: 100%; + font-size: 18px; + font-weight: normal; + height: 45px; +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} +h1{ + font: bold 16px Tahoma; +} +h2{ + font: bold 14px Tahoma; +} +header,bottom, section, footer, aside, nav, table, textarea, ul{ + display:block; +} +#big_wrapper{ + max-width: 1000px; + margin-left: auto; + margin-right: auto; + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; +} +#top_header{ + background: white; + border:2px solid blue; + padding:15px; +} + +#new_div{ + display:-webkit-box; + -webkit-box-orient:horizontal; +} + +#side_code{ + border:2px solid blue; + width:110px; + margin: 05px 0px; + padding: 15px; + background:white; +} + +#main_section{ + background: white; + border:2px solid blue; + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; + margin: 5px; + padding-left: 50px; + padding-top: 10px; +} + + +#txtarea{ + width: 50%; + height: 98%; + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; + border-width: 1px; + border:1px solid blue; + background-color: #F2F2F2; +} + +#b-bottom{ + background: white; + border:2px solid blue; + padding:10px; +} + +/* this is for showing the result */ +#t-table{ + display:-webkit-box; + -webkit-box-orient: vertical; + -webkit-box-flex: 1; + padding-bottom: 5px; + padding-top: 5px; + width: 450px; +} + +#the_footer { + width:100%; + height:50px; + bottom:0; + left:0; + text-align:center; +} + +#form_container +{ + margin:10px 0px; + text-align:left; + width:640px; +} + +.button { + background-color:#3d94f6; + display:inline-block; + color:#ffffff; + font-family:arial; + font-size:15px; + font-weight:bold; + padding:8px 24px; + text-decoration:none; +}.button:hover { + background-color:#1e62d0; +}.button:active { + position:relative; + top:1px; +} +.codebox { + background-color:#D5D5D5; + width:800px; + overflow:auto; +} +form.appnitro +{ + margin:20px 20px 0; + padding:0 0 20px; +} + + +/**** Form Section ****/ +.appnitro +{ + font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif; + font-size:small; +} + +.appnitro li +{ + width:61%; +} + +form ul +{ + font-size:100%; + list-style-type:none; + margin:0; + padding:0; + width:100%; +} + +form li +{ + display:block; + margin:0; + padding:4px 5px 2px 9px; + position:relative; +} + +form li:after +{ + clear:both; + content:"."; + display:block; + height:0; + visibility:hidden; +} + +.buttons:after +{ + clear:both; + content:"."; + display:block; + height:0; + visibility:hidden; +} + +.buttons +{ + clear:both; + display:block; + margin-top:10px; +} + +* html form li +{ + height:1%; +} + +* html .buttons +{ + height:1%; +} + +* html form li div +{ + display:inline-block; +} + +form li div +{ + color:#444; + margin:0 4px 0 0; + padding:0 0 8px; +} + +form li span +{ + color:#444; + float:left; + margin:0 4px 0 0; + padding:0 0 8px; +} + +form li div.left +{ + display:inline; + float:left; + width:48%; +} + +form li div.right +{ + display:inline; + float:right; + width:48%; +} + +form li div.left .medium +{ + width:100%; +} + +form li div.right .medium +{ + width:100%; +} + +.clear +{ + clear:both; +} + +form li div label +{ + clear:both; + color:#444; + display:block; + font-size:9px; + line-height:9px; + margin:0; + padding-top:3px; +} + +form li span label +{ + clear:both; + color:#444; + display:block; + font-size:9px; + line-height:9px; + margin:0; + padding-top:3px; +} + +form li .datepicker +{ + cursor:pointer !important; + float:left; + height:16px; + margin:.1em 5px 0 0; + padding:0; + width:16px; +} + + +form hr +{ + display:none; +} + +form li.section_break +{ + border-top:1px dotted #ccc; + margin-top:9px; + padding-bottom:0; + padding-left:9px; + padding-top:13px; + width:97% !important; +} + +form ul li.first +{ + border-top:none !important; + margin-top:0 !important; + padding-top:0 !important; +} + +form .section_break h3 +{ + font-size:110%; + font-weight:400; + line-height:130%; + margin:0 0 2px; +} + +form .section_break p +{ + font-size:85%; + + margin:0 0 10px; +} + +/**** Buttons ****/ +input.button_text +{ + overflow:visible; + padding:0 7px; + width:auto; +} + +.buttons input +{ + font-size:120%; + margin-right:5px; +} + +/**** Inputs and Labels ****/ +label.description +{ + border:none; + color:#222; + display:block; + font-size:95%; + font-weight:700; + line-height:150%; + padding:0 0 1px; +} + +span.symbol +{ + font-size:115%; + line-height:130%; +} + +input.text +{ + background:#fff url(../../../images/shadow.gif) repeat-x top; + border-bottom:1px solid #ddd; + border-left:1px solid #c3c3c3; + border-right:1px solid #c3c3c3; + border-top:1px solid #7c7c7c; + color:#333; + font-size:100%; + margin:0; + padding:2px 0; +} + +input.file +{ + color:#333; + font-size:100%; + margin:0; + padding:2px 0; +} + +textarea.textarea +{ + border-bottom:1px solid #ddd; + border-left:1px solid #c3c3c3; + border-right:1px solid #c3c3c3; + border-top:1px solid #7c7c7c; + color:#333; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; + font-size:100%; + margin:0; + width:99%; +} + +select.select +{ + color:#333; + font-size:100%; + margin:1px 0; + padding:1px 0 0; + border-bottom:1px solid #ddd; + border-left:1px solid #c3c3c3; + border-right:1px solid #c3c3c3; + border-top:1px solid #7c7c7c; +} + + +input.currency +{ + text-align:right; +} + +input.checkbox +{ + display:block; + height:13px; + line-height:1.4em; + margin:6px 0 0 3px; + width:13px; +} + +input.radio +{ + display:block; + height:13px; + line-height:1.4em; + margin:6px 0 0 3px; + width:13px; +} + +label.choice +{ + color:#444; + display:block; + font-size:100%; + line-height:1.4em; + margin:-1.55em 0 0 25px; + padding:4px 0 5px; + width:90%; +} + +select.select[class] +{ + margin:0; + padding:1px 0; +} + +*:first-child+html select.select[class] +{ + margin:1px 0; +} + +.safari select.select +{ + font-size:120% !important; + margin-bottom:1px; +} + +input.small +{ + width:25%; +} + +select.small +{ + width:25%; +} + +input.medium +{ + width:50%; +} + +select.medium +{ + width:50%; +} + +input.large +{ + width:99%; +} + +select.large +{ + width:100%; +} + +textarea.small +{ + height:5.5em; +} + +textarea.medium +{ + height:10em; +} + +textarea.large +{ + height:20em; +} + +/**** Errors ****/ +#error_message +{ + background:#fff; + border:1px dotted red; + margin-bottom:1em; + padding-left:0; + padding-right:0; + padding-top:4px; + text-align:center; + width:99%; +} + +#error_message_title +{ + color:#DF0000; + font-size:125%; + margin:7px 0 5px; + padding:0; +} + +#error_message_desc +{ + color:#000; + font-size:100%; + margin:0 0 .8em; +} + +#error_message_desc strong +{ + background-color:#FFDFDF; + color:red; + padding:2px 3px; +} + +form li.error +{ + background-color:#FFDFDF !important; + border-bottom:1px solid #EACBCC; + border-right:1px solid #EACBCC; + margin:3px 0; +} + +form li.error label +{ + color:#DF0000 !important; +} + +form p.error +{ + clear:both; + color:red; + font-size:10px; + font-weight:700; + margin:0 0 5px; +} + +form .required +{ + color:red; + float:none; + font-weight:700; +} + +/**** Guidelines and Error Highlight ****/ +form li.highlighted +{ + background-color:#fff7c0; +} + +form .guidelines +{ + background:#f5f5f5; + border:1px solid #e6e6e6; + color:#444; + font-size:80%; + left:100%; + line-height:130%; + margin:0 0 0 8px; + padding:8px 10px 9px; + position:absolute; + top:0; + visibility:hidden; + width:42%; + z-index:1000; +} + +form .guidelines small +{ + font-size:105%; +} + +form li.highlighted .guidelines +{ + visibility:visible; +} + +form li:hover .guidelines +{ + visibility:visible; +} + +.no_guidelines .guidelines +{ + display:none !important; +} + +.no_guidelines form li +{ + width:97%; +} + +.no_guidelines li.section +{ + padding-left:9px; +} + +/*** Success Message ****/ +.form_success +{ + clear: both; + margin: 0; + padding: 90px 0pt 100px; + text-align: center +} + +.form_success h2 { + clear:left; + font-size:160%; + font-weight:normal; + margin:0pt 0pt 3px; +} + +/*** Password ****/ +ul.password{ + margin-top:60px; + margin-bottom: 60px; + text-align: center; +} +.password h2{ + color:#DF0000; + font-weight:bold; + margin:0pt auto 10px; +} + +.password input.text { + font-size:170% !important; + width:380px; + text-align: center; +} +.password label{ + display:block; + font-size:120% !important; + padding-top:10px; + font-weight:bold; +} + +#li_captcha{ + padding-left: 5px; +} + + +#li_captcha span{ + float:none; +} + +/** Embedded Form **/ + +.embed #form_container{ + border: none; +} + +.embed #top, .embed #bottom, .embed h1{ + display: none; +} + +.embed #form_container{ + width: 100%; +} + +.embed #footer{ + text-align: left; + padding-left: 10px; + width: 99%; +} + +.embed #footer.success{ + text-align: center; +} + +.embed form.appnitro +{ + margin:0px 0px 0; + +} + + + +/*** Calendar **********************/ +div.calendar { position: relative; } + +.calendar table { + cursor:pointer; + border:1px solid #ccc; + font-size: 11px; + color: #000; + background: #fff; + font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif; +} + +.calendar .button { + text-align: center; + padding: 2px; +} + +.calendar .nav { + background:#f5f5f5; +} + +.calendar thead .title { + font-weight: bold; + text-align: center; + background: #dedede; + color: #000; + padding: 2px 0 3px 0; +} + +.calendar thead .headrow { + background: #f5f5f5; + color: #444; + font-weight:bold; +} + +.calendar thead .daynames { + background: #fff; + color:#333; + font-weight:bold; +} + +.calendar thead .name { + border-bottom: 1px dotted #ccc; + padding: 2px; + text-align: center; + color: #000; +} + +.calendar thead .weekend { + color: #666; +} + +.calendar thead .hilite { + background-color: #444; + color: #fff; + padding: 1px; +} + +.calendar thead .active { + background-color: #d12f19; + color:#fff; + padding: 2px 0px 0px 2px; +} + + +.calendar tbody .day { + width:1.8em; + color: #222; + text-align: right; + padding: 2px 2px 2px 2px; +} +.calendar tbody .day.othermonth { + font-size: 80%; + color: #bbb; +} +.calendar tbody .day.othermonth.oweekend { + color: #fbb; +} + +.calendar table .wn { + padding: 2px 2px 2px 2px; + border-right: 1px solid #000; + background: #666; +} + +.calendar tbody .rowhilite td { + background: #FFF1AF; +} + +.calendar tbody .rowhilite td.wn { + background: #FFF1AF; +} + +.calendar tbody td.hilite { + padding: 1px 1px 1px 1px; + background:#444 !important; + color:#fff !important; +} + +.calendar tbody td.active { + color:#fff; + background: #529214 !important; + padding: 2px 2px 0px 2px; +} + +.calendar tbody td.selected { + font-weight: bold; + border: 1px solid #888; + padding: 1px 1px 1px 1px; + background: #f5f5f5 !important; + color: #222 !important; +} + +.calendar tbody td.weekend { + color: #666; +} + +.calendar tbody td.today { + font-weight: bold; + color: #529214; + background:#D9EFC2; +} + +.calendar tbody .disabled { color: #999; } + +.calendar tbody .emptycell { + visibility: hidden; +} + +.calendar tbody .emptyrow { + display: none; +} + +.calendar tfoot .footrow { + text-align: center; + background: #556; + color: #fff; +} + +.calendar tfoot .ttip { + background: #222; + color: #fff; + font-size:10px; + border-top: 1px solid #dedede; + padding: 3px; +} + +.calendar tfoot .hilite { + background: #aaf; + border: 1px solid #04f; + color: #000; + padding: 1px; +} + +.calendar tfoot .active { + background: #77c; + padding: 2px 0px 0px 2px; +} + +.calendar .combo { + position: absolute; + display: none; + top: 0px; + left: 0px; + width: 4em; + border: 1px solid #ccc; + background: #f5f5f5; + color: #222; + font-size: 90%; + z-index: 100; +} + +.calendar .combo .label, +.calendar .combo .label-IEfix { + text-align: center; + padding: 1px; +} + +.calendar .combo .label-IEfix { + width: 4em; +} + +.calendar .combo .hilite { + background: #444; + color:#fff; +} + +.calendar .combo .active { + border-top: 1px solid #999; + border-bottom: 1px solid #999; + background: #dedede; + font-weight: bold; +} + diff --git a/css/nav-bar.css b/css/nav-bar.css new file mode 100644 index 0000000..3cf301d --- /dev/null +++ b/css/nav-bar.css @@ -0,0 +1,55 @@ +#menu { + border:none; + border:0px; + margin:0px; + padding:0px; + font: 67.5% "Lucida Sans Unicode", "Bitstream Vera Sans", "Trebuchet Unicode MS", "Lucida Grande", Verdana, Helvetica, sans-serif; + font-size:14px; + font-weight:bold; +} + +#nav { + height:35px; + list-style:none; + margin:0; + padding:0; + float:right; + text-align:center; + } + +#nav li { + display:inline-block; + position:relative; + float:right; + background: #3d94f6; + } + +#nav li a { + display:inline-block; + width:165px; + line-height:35px; + padding:0; + text-decoration:none; + color:#ffffff; + } + +#nav li li {float:left; #1e62d0;} + +#nav li li a {display:block;font-size:12px;} + +#nav li:hover {background:#1e62d0;} + +/*--- Sublist Styles ---*/ +#nav ul { + position:absolute; + padding:0px; + left:0; + display:none; + } + +/*--- Hide Sub Sublists ---*/ +#nav li:hover ul ul {display:none;} + +/*--- Sublevel UL's display and position on hover ---*/ +#nav li:hover ul {display:block;} +#nav li li:hover ul {margin-left:200px; margin-top:-35px; display:block;} \ No newline at end of file diff --git a/debugger/interface b/debugger/interface new file mode 100755 index 0000000000000000000000000000000000000000..587dfef7e5047d133875d72055165a916fe1b76c GIT binary patch literal 9547 zcmb7K4{%(?dEb-H&PCW*HX#^8!ZVe@&Y+Xz%C1d7BO zyLTW{L+qXuTbz{$a2gLG89QL=wr)#PHFbe@Lef#aV``+%muSD8c2Lb`1Q` zP<&ooC#Iu{yykt7L6!~BXd3E*$kpTlH}3}@`6^&$^4K@COl*t1=`%twv%RQQd|CGl zc*tAP;N*NE^^#u&F&pwWc+9T?Gt(~WU|xeZYoMFC4VYQ;I^J>OLojIQiC~Di4m@Vf zzZ-nOk0srILn_(Xkc!u*lIcQEIG+hGR&8OL9NX>dHp{lOlWpc8vu~IzeMA0=pZKvBjSq+SN+=>yYUm=?g;`D9XCOxbqjoEPK-u51@_}KD^$C*{@Cp z3Xf?3%J$#$;k*y8@!^Mkc##kH_;8;O_xtc|KD^6^|J;Ya>BECQ{B0jj`S5Wc-r~dC zeYn+!yL`COhvxym_*gK+xt}d&31OOD-I=tRccMARGzG#a#_(Ax%(d%L8&9UqLf(pt zL?Ttl+rsKeIwGIVCDTqqBr;hmEwah1C9+m7m&u8IvMU`;iEP2igPYqe3TZ^-Zm~O= zN{PIa!+(*pqHz%~WEYFPr^>_IIrSzmKj9MP9|q^g}m(6 z)k<6?encixd+DXChAjJaOM2ZEtmGo0W>>v#Zv5WN6 zLc~dHu#b>lAw-IF2KGKuSmKagDMSw`rf)AP4BkgNTZmp#ES!U+*iR0TVv!G$UM<97 zQtY2cNUss%Dbl$@93{P0h-XLD z-i%?EhhgK^?LQc)ELnz@l?7kIU$&_%phs*L$IhWyWdS{7lQ(uoVtUA?tH*{Vrl)LJ zBF3JRm>#nY;-eDNbM`{wL5b->n-e{@Phxt~UPhdim>#uP67Q0jp0(EycSuYR+a1I! zC8nqCt;CHI)8qCoVnbqj-sXVDY9;0j*jZvBF=xW=As+t-6$>~c_CDfs5_4wkgT!Yf z<_y_`#KRJErtBlc&q>S~vyT!Vm6$VUpCBHTm@{ZUN4!sB&ZK>cI4dz{)E*|@B{65# zewDZb7<3{v{l|U%Zx_#xcWl~V3+xScE&klS#eU_{V5nS#@TI{iiLo&dulsP{ZNunO z6jr>j3s1abF9Ynqumi=HKBy{Q2rNIF|J>k!bCW0z2c9Og@|iwzrQq_jx$^00Y#%^Z z!R85y%uT&K+&53)USBhQPqu z5anloTd9<;K962cy^JyRZ>pOCkq~(l<-?{wSXa(qOvfli@N=~B_UEYn_~0vV0q@v3 z2zpx|Lu*&bn;s>6l6u8zyhlKJlsn5Nfyv^#kkCy&Vv~2UWVNo}fLYpnt`wQkUyDBj9l=uMXZ=-R!zxjJ zAENz{vX;Ie;YC2{iJwV0UW%OM7}}9@60Jan-ZIOizRPvO(Ev*XO}5MJ{^n zxF&{gpY+b57)d?|-sTNkuNTLiH%CZhtVf^A*4DFxZm%fnYKZb?RAA!Ir zLhX$#YM*BKx>5L~>Q#oiKMH#x%Q1Ub$v$d8oj1}`s4G4k3Oq6$f2$s0%>5O*EkC2I zk%4y+avjt25}z_kM$5cFR9>l@6mTT{lXli0~QE_8PS)-qu zdh2@K=z5$=CSlC0XR>;SU)2xMj85QeX?yNLU4L)g3`|+^MM>1^8>4McvVpsV|I$@L zw|I14quPg5dlJ=tI$r3@+dS>lXpeSfLoJXmyT;M$a@mGGva7&!eIf=9*NwA{yDYXL z@^v>D3W|~o&!1q3oMVX0M{65-s7 zDUhYYO4o)jdu+g~&J-J-LJt#TnFXMysv5>YIeR+YtKMgxzgv4_;E*!IYwtsoP1F;FSw*oLEzk&u@ z75aZ0)qTT-8^|h7WzoLA;aR=k!6RV8wNs2_EYrx>-~E_}XZ1dT!T5c102-u4lfIGL z)z?v9Iwbwr?{QbNcL3jnlG0%*gKjSxGEzgnxxNuXuDfRS{sa*WmpzWo%gezS8&wr2 zSP??s9zXvndsnNIBYF~WRJk3)kikGY;O;l2U;i&_`A1;t0QoulfolV7Jh@@qsoHBs zzUEX8{|%*zrvuAB%Kc06ji2JxV9tUP-#60p?B6das$YeXR*?Xqs2u*gWpW0|-m)^FYg(&}=^cil zSR>ElMk2nwai<}V(Q%Qj$6yn2Cv%V0X~+Y%p^odHP*)>XtXLt!;jmZ`M>8~huwHhF z9-DSfX>E09ojry;&Wpfx)n7E=OU6Ju*6^1=cYy8y{XXbHP;P!qfrmDTz}`^cx*5UX zL9CPOQO6vD9FE9Bv|JhLt6DX4TFWbt5V+wJg8f~_D%s}cw-%>;HF%)9s$-<(bjzre zt_9ylz6pKFXFKJQ5c~4XqbcjSL@AHswdm~&%45P)cx(RkN0rPW+|kjNR1xQU(38M8 zmW#8WVu5b~qQPa^*r^7F{A zA-{$EOXT;FYjE#65BUqow<6zxybYQ9Zf|Y9)mVtz!$n4OxH-JkSlrmOxbgQJmlz8- zSaD-b)KT^I&5MKx=l66w(N0h&r>Lz<*chx_R)n!0tZ>V!we?Q4%SB!3Lb$Vlh_A<0 zQJBb%;wCB_-;+jvisD*Ham#|_$~$E+3}Bsf>^Gr8%h`xw8*+782vp0pp^OJv zhI$$Mhur?;dUWL|%bOp@KjpY4PC|~a^jsq#vOlgV-dl2AP>yRT1;DkV6J?q1LuUL_ zj*JY`{SPU6gCm=kveI;-$4cC=$BKFI|aE9e0tgDS!69IzcC=F>d0`D?r#WK%bmqb z*jdQ!)k2_J?jKz_&M{vW_-$lj1M(XsohZXxM%MkEfZT~s=#Opw z6Pfy{cNlUfA-B>1aFgNE{|04$I+iGRi_0S+j~UY``vQ^aEaX1a0F*LJq>KTbda;p= zBL+W*ih5*@fw9Gyr)@ep^M&|lPlfJJ^SzY&5wZFjr@mz=tTc0fQCM}zeMDhuSNny+ zFbs+Ng2J3pwf+_6j-}SQ!ct5=Llx#I)U#D#wSc%j73K~F{siWVR^Javs|7Cvarce& zLRu}ZB$4Zfw3^>Vkho4rtKF{wTn`F!R#e<8%qKhEcM!Jz=U|69OWcRtwPUjysJ{{8_#`zL@ms~-dF@$pOHc^`fcSo=Fbf5SlSPeaTV zR{)=L$1@w_x!N-T&gMcNUPcW27`by`-x^@<-+&UY2j(4Hhl_UtAHe-NzkgD`i|yUS z{`Ua$3XlGz{y*~Y4b(m6!^eTSzbpA!g3nzYzjF}3-}A_`{}JH-f;~q-ssG15{=K4cM#i8$SMVAO2h5`(1y{shTNX2j=&jCTz9RKfrpw zoWnP|SkB2i1>8Es@P)N?)A|i&``V40@I}}(+oqs9T0N|I#_UREI-@C5z80I&LXW^J zZ#HE)Ry@39`5!D6WSGf#4^gvFZ`ScbclRExC$g?hs#(3E<*taS5!LAOq!#%OF15%5 zLn0cpXz=ar>sPh3o9kDv-Wb_rZfaT89--lU$2X(7Ty&3VrQ=g8aCFWFF_DR&^&K%tY3-9|YlfMV{lmJ*A?BG?eQ53Jllxq1-FX zQ@a%v}yciL_blK8ym*tq*nCaMs^zLwH LkB~o#P+s^Sv_L>x literal 0 HcmV?d00001 diff --git a/debugger/interface.c b/debugger/interface.c new file mode 100644 index 0000000..61204f7 --- /dev/null +++ b/debugger/interface.c @@ -0,0 +1,208 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 100 +#define logdir "/home/ruttan/classes/capstone/debugger/" +#define numDbgArgs 5 +#define ArgSize 30 + +pid_t child_pid; +char buf[BUFFSIZE],work_file[MaxPipeName]; +FILE * fdtoFILE; + +void catch_sigpipe(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGPIPE, catch_sigpipe); + fprintf(fdtoFILE,"got a signal\n"); + fflush(fdtoFILE); +} +void catch_sigint(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGINT, catch_sigint); + kill(child_pid,1); + fprintf(fdtoFILE,"got a sigint signal\n"); + fflush(fdtoFILE); + sleep(1); + exit(1); +} + +pid_t launch_debugger(char * argv[],int pipefd[2]){ + int stdio[3]; + pid_t child_pid; + int pipefd0[2],pipefd1[2]; + pipe(pipefd0); + if(pipe(pipefd0) == -1) { + perror("Pipe 0 creation failed"); + exit(1); + } + pipe(pipefd1); + if(pipe(pipefd1) == -1) { + perror("Pipe 1 creation failed"); + exit(1); + } + //create function to setup pipes fork and exec + pipefd[0]=pipefd0[0]; + pipefd[1]=pipefd1[1]; + stdio[0]=dup(STDIN_FILENO); + stdio[1]=dup(STDOUT_FILENO); + stdio[2]=dup(STDERR_FILENO); + dup2(pipefd1[0],STDIN_FILENO); + dup2(pipefd0[1],STDOUT_FILENO); + dup2(pipefd0[1],STDERR_FILENO); + switch (child_pid=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + exit(1); + } + default: + //after fork in parent. + dup2(stdio[0],STDIN_FILENO); + dup2(stdio[1],STDOUT_FILENO); + dup2(stdio[2],STDERR_FILENO); + close(pipefd1[0]); + close(pipefd0[1]); + } + return(child_pid); +} + +void make_args(char * id,char * argv[]){ + argv[0]="/usr/bin/python3"; + argv[1]="-i"; + argv[2]="-m"; + argv[3]=work_file; + argv[4]=0; +} + +int main (int argc, char ** argv) { + int n; + char * nargv[numDbgArgs]; + int fdtoWeb,fdfrmWeb,fdtoDbg,fdfrmDgb,pipefd[2]; + char line[BUFFSIZE],toServer[MaxPipeName],fromServer[MaxPipeName]; + sprintf(buf,"%s%s%s",logdir,"LOG",argv[1]); + unlink(buf); + fdtoFILE=fopen(buf,"w"); + fprintf(fdtoFILE,"testing file output\n"); + sprintf(work_file,"%s%s%s",logdir,"FILE",argv[1]); + unlink(work_file); + + signal(SIGPIPE, catch_sigpipe); + signal(SIGINT, catch_sigint); + if ((argc < 2 )|| (argc >=3)){ + perror("usage: debugger idcode"); + exit(1); + } + //create input pipe from webserver + sprintf(fromServer,"%s%s%s",logdir,"OUT",argv[1]); + unlink(fromServer); + + if (-1 == mkfifo(fromServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + + //create output pipe to webserver + sprintf(toServer,"%s%s%s",logdir,"IN",argv[1]); + unlink(toServer); + + if (-1 == mkfifo(toServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + //create pipes to debugger + + if(pipe(pipefd) == -1) { //perhaps pipe(pipefd,O_NONBLOCK) + perror("Pipe 1 creation failed"); + exit(1); + } + + int i; + char c; + make_args(argv[1],nargv); + child_pid=launch_debugger(nargv,pipefd); + fprintf(fdtoFILE,"child_pid=%d\n",child_pid); + fflush(fdtoFILE); + setpgid(0, 0); + fprintf(fdtoFILE,"---starting---\n"); + fflush(fdtoFILE); + + + while(1){ + line[0]=0; + while (!strstr(line,">>>") && !strstr(line,"...")){ + if ((n=read(pipefd[0],line,BUFFSIZE))){ + if (!n) { + fprintf(fdtoFILE,"pipe fd[0] closed"); + fflush(fdtoFILE); + exit(1); + } + //line[n++]='@'; + line[n]=0; + //if n=BUFFSIZE... + } + fprintf(fdtoFILE,"p-%s",line); + fflush(fdtoFILE); + if (write(fdtoWeb,line,n) != n) { + perror("fdtoWeb write error"); + fprintf(fdtoFILE,"fdtoWeb write error\n"); + fflush(fdtoFILE); + + } + + } + + if ((n=read(fdfrmWeb,line,BUFFSIZE))){ + line[n]=0; + fprintf(fdtoFILE,"%d-%s%s",n,"w-",line); + fflush(fdtoFILE); + if (write(pipefd[1],line,n) != n) { + perror("pipefd[1] write error"); + } + + } + else{ + printf("empty read\n"); + close(fdtoWeb); + close(fdfrmWeb); + n=0; + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + line[0]='\n'; + if (write(pipefd[1],line,1) != 1) { + perror("pipefd[1] write error"); + } + + } + + } + + exit(0); +} + + diff --git a/debugger/pipetest b/debugger/pipetest new file mode 100755 index 0000000000000000000000000000000000000000..6850630d73c36f2c102a15fb30ba1f505a19ecff GIT binary patch literal 10108 zcmcIq4RBP~b-ufcK!AjnA1A~pW-}HowAD)d8avo|vRGKz8;mj7#CH6&+I^B1R=eBX zw?xM_ChjC^o2DdgkSMLeoz}&v+j?p@qcXVNHMmh4$5j)I z@}2wck=}dg&15Fi3wr0C@1Aq+x#!+@-rf7&Q<2yK_C+3-5)KMk9PxP8YSX`17)1RV8E%Yx>T+Q0b3ic3e{{p!lA^S3Q{ z^Z2*^^!g9Xhe@7fIR2=D2}+ErYd(Fvk*HV6qJjEymv#WN;m>&B)PD$n?s7YT+3Y;! zfq%vW-{*lJ_rRa0-E}zPn-J-`Z6TNY?n|b^fx(@M7R!?UWaWj?8h`bR`iexdj4id?1(WE-88;Jus zkw|9?22`kbXl@VXcr%Xd^k9FMLuCEKP3vYzee)*57#m#oL#^=Mzr+Y}H4^g~1 zHJ^09sfNFINvEvQz03D90URgFb+*(i`jz}V;IyW>4A^j$a%9sn8&3BrmmwQ&&!^AZ zaC<%(w&Bz_ms2);dQQ2lhJFPKJ!7_;FEZTJNnUT4EE+VFZC{#P^bBb$kkC)g|I-imMkT|8K<8)Ku-Ym4ZxByYSKTT37l@}Rt7?+}D)9@6 zZguRqEC;R z{;7*H^h5TtCt7;%0TLXzvlbnS;=Qk)#v>kTez4IaS4N0C`>Q~7@QN>b``d-4?uM0H z1txLK7cJHNJ8Vxa`&%hguK7pm>GrqtmtL!R6;&T~_sHw#y1To>4J(gI|D%IepOynlSRMc61E=ygoJl`njPYYJ*F`(xGc-o|~_UQHo;aSwvy<*dh#1pauu;r`}5E zD{q25U-J-k2)R+ZR6hQAYD$^WqNPI@qNUnA1i;V3QV$`Q#-mLnI>kR&?%={4AjTs}iX0Xwc(k_P)G*vg+srEBHLHF#srMF>A} zrG4}b^68J!WOehukc2B2qGe3z9t7cEWW0b{L-xos6GgVQsnaBq08d%8mxfm^RFGP zkqW23NFh1#HDWAJt-jy-CAlk&p6MhJSdsoxmeWHS1E!}s@09eYmtHyD}pRVE>EEHX84 zXlg<6CvFMwlrj<*%aL!Yfm>ttqlfByxQ}F7`Z;9_d%h^8o8FFM{}Fl~~DanuwL2Y{Ei&vgL#*_u5Jyca%Pgp8Yt`QTo@)6aRQ7SK9sYRYGBVQt|{7hv)D;HP3Lb0W%AMIV}KAI`m z)zKy|WbN)kc_U$@4j4(Xlfc$c0=qZb#f7@#sWiiDZ-Cpg#dI>1$(kYB8HSQZSFxwZ z$jfaWtF{yi`4-w0rdzsFnU>r^vp1VrFPi&AF4-kodb52-OTK8D@l4BBqp;u1=34p= zcB9vD?w}|Z;yuP4(}qK-WFnh1M4~s9PU^W-^3GMs1=wF=FPqBrh*br#dS|k0jbKMG zu6Qye_px`7WJb#SRs=q~8KIzua}Xig4f+r$?U{d!)$ttY@8aJ19%vmF%3Gj~pjSbc z;g5>%@m<2#AM~xLn^#M}Md?Qs{e2J9znuiy76qU2x7Sl2RH$tW{@y|R6O?DUJ#fGW z6SDnLz?;y&{N=~({+-k;+n+@HezcF<^?^|#zh1&$D{_Z@rkjA#I95|m0TuTjuX$#! zzDOIK_Z9!iz==8jy^COex*!|L!hoA+oLr#7d$>A_6`k`mS*urkFVZlTUtFKc67BSB zxXzp@49u~3j?*!}#q(Zu1hP~XT0|^Y^d?1_1XQI{?H4%)Bg#>pw|PqLlZuYiXtKum zfZ{nOtx9gbqTD~0gEbx{k2p!5<1(T6R@JW5|KACplejxNspjQnMZcry8Aabv^e2k` zx1!e-T~w<{leZ`uR`f1KcPRRpq8UXGD|%AVmlY*r+uPgk2(89R#+uNE@P_cF(7M*O z>sr^hZVav7Wh6tac0_cl;g$N;!q~ zIghj|hksA$vHvW`bU)fDM={^2@=&Kz2q}HH{|Xk5qe8B-KIg>&rO$bh`*)B3s7s&o z?1)m}yi6=TJKXvwfl*BOxxmkrPFfTw9A}Gjp5+im&pNw)|2&Og(XaGdT>)3qGW|Sz z4zhNAKA#^^j-KX$ORF=_LB)y}T>AVRl)uQ)W_0zO`Mm_~`Ka*vWPKhN z#mCi@bOM4j~+CZ6vd z#)wwv!G;o4f%-J+Vf=C2IIqxtZ?^s?Z$$&jQCFk8e@kliYk<7a|F;=P_`hh#l~)y4VD-Wb4}Db7<)d@1ry zryY{@0Dg6GUa>a@#7%gAIh*_^1m^*#{3iw9-%fnF;QQ8z&%D=h;`BDiS*-h@Uc77D zcasF&UvtFIrq6j+2;Qp;67;`?Tw z!b1w@`>`K5*~z)=c=>-++F2q_x#Isv5??Hy4{E5*l&_=en`Itf0Z#q4s^>0ioJD1} zxc$AfbK^W-l8Q^jOD=zY?t#xmKzy^Tp9bI|?0Vem;b!3Up6?G-+&GUn0auR-*%Mzj zdEoa*yk5}hJ{8WL4=bGaKe7>*xWehYoXU226(Z|l|I14L!G)TXlxG~M9S0tgi1YHI z2mW1Y$0KAG0}uHr5BwGcY6;fKJ1P$HYzO{?C4Qryp98*F%;YPc zuN}aHv&`=!9(MXX@FQg3-yjBD>-MC?mkN5>VlOXBJN1HI=TM=2GnH3J9_wngYhC?7 z%3Ct_>pytlmppKKxCW7b>Xd!9Rj2S)7rq$yZ0q?}5BxR{`*(TB-w%AY_vMC^uNU;5 zi^@3G0hN6czwx=2^RO>){+YJDdKZbjSul$@c~0Oxc>C`AcImN>2X^C)ysmF`aQC#^ znvz+)C!Otzr*(NapvQ~-0zdq7X~Q&<;Z5r|+%Bj=PbK@oZCop?^Mz!wukRrD6WOs< zcC&3)+vg)XbJPvjXL^w*5waILEjEpUN&aq+-FJ6eOuuj2wg)1+_1$fE$0Fo69dzjN zd_I0qH!?{lAkS!pzV!<`+CJaWF6i9CdhtJVmMcFN&@}tof9q2NC#Jp{NEC{?JWXLU zaeR)Tt7C2J0|TdCUwpp-?|KSw%<&0?e$N4Ym(i0d;AE&h9WNA&g8bUSscwC_;Kov> z6R}*PQ)d_M{?x(QoQ@YW@ScyYDH2Wrz2iQNGnvZh#R87wb=?*~ni;3G^+|>kgGwQ* z_r^2HG<|s?*BH;Y{0xHvDvzqj-Y$$FV*C8VX-j?j;RM|ufVf+6NTsGqt`2%(;1sdG fH*sRRAy2sEcOlLe>!T7UCch!E24Q{8;%xpkS?Tqo literal 0 HcmV?d00001 diff --git a/debugger/pipetest.c b/debugger/pipetest.c new file mode 100644 index 0000000..e5ad7ec --- /dev/null +++ b/debugger/pipetest.c @@ -0,0 +1,190 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 50 +#define logdir "/tmp/debugger/" +#define numDbgArgs 5 +#define ArgSize 30 + +pid_t child_pid; +int pipeReadError = 0; + +void catch_sigpipe(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGPIPE, catch_sigpipe); + printf("sigpipe signal received\n"); + fflush(stdout); + pipeReadError=1; + exit(1); +} + +pid_t launch_debugger(char * argv[],int pipefd[2]){ + int stdio[3]; + pid_t child_pid; + int pipefd0[2],pipefd1[2]; + pipe(pipefd0); + if(pipe(pipefd0) == -1) { + perror("Pipe 0 creation failed"); + exit(1); + } + pipe(pipefd1); + if(pipe(pipefd1) == -1) { + perror("Pipe 1 creation failed"); + exit(1); + } + //create function to setup pipes fork and exec + pipefd[0]=pipefd0[0]; + pipefd[1]=pipefd1[1]; + stdio[0]=dup(STDIN_FILENO); + stdio[1]=dup(STDOUT_FILENO); + stdio[2]=dup(STDERR_FILENO); + dup2(pipefd1[0],STDIN_FILENO); + dup2(pipefd0[1],STDOUT_FILENO); + dup2(pipefd0[1],STDERR_FILENO); + switch (child_pid=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + exit(1); + } + default: + //after fork in parent. + dup2(stdio[0],STDIN_FILENO); + dup2(stdio[1],STDOUT_FILENO); + dup2(stdio[2],STDERR_FILENO); + close(pipefd1[0]); + close(pipefd0[1]); + } + return(child_pid); +} + +void make_args(char * id,char * argv[]){ + argv[0]="/usr/local/bin/python3"; + argv[1]="-m"; + argv[2]="pdb"; + argv[3]="/home/ruttan/Desktop/myfile.py"; + argv[4]=0; +} + +int main (int argc, char ** argv) { + int n; + char * nargv[numDbgArgs]; + int fdtoWeb,fdfrmWeb,fdtoDbg,fdfrmDgb,pipefd[2]; + char buf[BUFFSIZE],line[BUFFSIZE],toServer[MaxPipeName],fromServer[MaxPipeName]; + + signal(SIGPIPE, catch_sigpipe); + if ((argc < 2 )|| (argc >=3)){ + perror("usage: debugger idcode"); + exit(1); + } + /* + //create input pipe from webserver + sprintf(fromServer,"%s%s%s",logdir,argv[1],"OUT"); + unlink(fromServer); + + if (-1 == mkfifo(fromServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + + //create output pipe to webserver + sprintf(toServer,"%s%s%s",logdir,argv[1],"IN"); + unlink(toServer); + + if (-1 == mkfifo(toServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + //create pipes to debugger + + if(pipe(pipefd) == -1) { //perhaps pipe(pipefd,O_NONBLOCK) + perror("Pipe 1 creation failed"); + exit(1); + } + + */ + int i; + char c;make_args(argv[1],nargv); + child_pid=launch_debugger(nargv,pipefd); + printf("child_pid=%d\n",child_pid); + fflush(stdout); + + + + // while(1){ + /* + if ((n=read(fdfrmWeb,line,BUFFSIZE))){ + line[n]=0; + n=sprintf(buf,"%d-%s%s",n,"debugger:",line); + if (write(1,buf,n) != n) { + printf("cp: write error on file stdout\n"); + fflush(stdout); + exit(1); + } + if (write(fdtoWeb,buf,n) != n) { + perror("fdtoWeb write error"); + } + + } + else{ + printf("empty read\n"); + close(fdtoWeb); + close(fdfrmWeb); + n=0; + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + } + */ + printf("starting\n"); + fflush(stdout); + while (1){ + line[0]=0; + while (!strstr(line,"(Pdb)")){ + if ((n=read(pipefd[0],line,BUFFSIZE))>0){ + line[n]=0; + printf("%s",line); + } + else break; + } + if (n <= 0){ + printf("debugger read error:%d\n",errno); + printf("n=%d\n",n); + fflush(stdout); + exit(1); + } + i=0; + while ((c=getchar())!='\n'){ + line[i++]=c; + } + line[i]=c; + write(pipefd[1],line,i+1); + } +exit(0); +} + + diff --git a/debugger/pipetest.c~ b/debugger/pipetest.c~ new file mode 100644 index 0000000..33eeb29 --- /dev/null +++ b/debugger/pipetest.c~ @@ -0,0 +1,179 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 50 +#define logdir "/tmp/debugger/" +#define numDbgArgs 5 +#define ArgSize 30 + +pid_t child_pid; + +void catch_sigpipe(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGPIPE, catch_sigpipe); + printf("got a signal\n"); + fflush(stdout); +} + +pid_t launch_debugger(char * argv[],int pipefd[2]){ + int stdio[3]; + pid_t child_pid; + int pipefd0[2],pipefd1[2]; + pipe(pipefd0); + if(pipe(pipefd0) == -1) { + perror("Pipe 0 creation failed"); + exit(1); + } + pipe(pipefd1); + if(pipe(pipefd1) == -1) { + perror("Pipe 1 creation failed"); + exit(1); + } + //create function to setup pipes fork and exec + pipefd[0]=pipefd0[0]; + pipefd[1]=pipefd1[1]; + stdio[0]=dup(STDIN_FILENO); + stdio[1]=dup(STDOUT_FILENO); + stdio[2]=dup(STDERR_FILENO); + dup2(pipefd1[0],STDIN_FILENO); + dup2(pipefd0[1],STDOUT_FILENO); + dup2(pipefd0[1],STDERR_FILENO); + switch (child_pid=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + exit(1); + } + default: + //after fork in parent. + dup2(stdio[0],STDIN_FILENO); + dup2(stdio[1],STDOUT_FILENO); + dup2(stdio[2],STDERR_FILENO); + close(pipefd1[0]); + close(pipefd0[1]); + } + return(child_pid); +} + +void make_args(char * id,char * argv[]){ + argv[0]="/usr/local/bin/python3"; + argv[1]="-i"; + argv[2]="-c"; + argv[3]="\"print('Starting')\""; + argv[4]=0; +} + +int main (int argc, char ** argv) { + int n; + char * nargv[numDbgArgs]; + int fdtoWeb,fdfrmWeb,fdtoDbg,fdfrmDgb,pipefd[2]; + char buf[BUFFSIZE],line[BUFFSIZE],toServer[MaxPipeName],fromServer[MaxPipeName]; + + signal(SIGPIPE, catch_sigpipe); + if ((argc < 2 )|| (argc >=3)){ + perror("usage: debugger idcode"); + exit(1); + } + /* + //create input pipe from webserver + sprintf(fromServer,"%s%s%s",logdir,argv[1],"OUT"); + unlink(fromServer); + + if (-1 == mkfifo(fromServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + + //create output pipe to webserver + sprintf(toServer,"%s%s%s",logdir,argv[1],"IN"); + unlink(toServer); + + if (-1 == mkfifo(toServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + //create pipes to debugger + + if(pipe(pipefd) == -1) { //perhaps pipe(pipefd,O_NONBLOCK) + perror("Pipe 1 creation failed"); + exit(1); + } + + */ + int i; + char c;make_args(argv[1],nargv); + child_pid=launch_debugger(nargv,pipefd); + printf("child_pid=%d\n",child_pid); + fflush(stdout); + + + + // while(1){ + /* + if ((n=read(fdfrmWeb,line,BUFFSIZE))){ + line[n]=0; + n=sprintf(buf,"%d-%s%s",n,"debugger:",line); + if (write(1,buf,n) != n) { + printf("cp: write error on file stdout\n"); + fflush(stdout); + exit(1); + } + if (write(fdtoWeb,buf,n) != n) { + perror("fdtoWeb write error"); + } + + } + else{ + printf("empty read\n"); + close(fdtoWeb); + close(fdfrmWeb); + n=0; + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + } + */ + printf("starting\n"); + fflush(stdout); + while (1){ + line[0]=0; + while (!strstr(line,">>>")){ + if ((n=read(pipefd[0],line,BUFFSIZE))){ + line[n]=0; + } + printf("p-%s",line); + } + i=0; + while ((c=getchar())!='\n'){ + line[i++]=c; + } + line[i]=c; + write(pipefd[1],line,i+1); + } +exit(0); +} + + diff --git a/debugger/pipetest1.c b/debugger/pipetest1.c new file mode 100644 index 0000000..d31a843 --- /dev/null +++ b/debugger/pipetest1.c @@ -0,0 +1,172 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 50 +#define logdir "/tmp/debugger/" +#define numDbgArgs 3 +#define ArgSize 30 + +pid_t child_pid; + +void catch_sigpipe(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGPIPE, catch_sigpipe); + printf("got a si\n"); + fflush(stdout); +} + +pid_t launch_debugger(char * argv[],int pipefd[2]){ + int stdio[3]; + pid_t child_pid; + int pipefd0[2],pipefd1[2]; + pipe(pipefd0); + if(pipe(pipefd0) == -1) { + perror("Pipe 0 creation failed"); + exit(1); + } + pipe(pipefd1); + if(pipe(pipefd1) == -1) { + perror("Pipe 1 creation failed"); + exit(1); + } + //create function to setup pipes fork and exec + pipefd[0]=pipefd0[0]; + pipefd[1]=pipefd1[1]; + stdio[0]=dup(STDIN_FILENO); + stdio[1]=dup(STDOUT_FILENO); + stdio[2]=dup(STDERR_FILENO); + dup2(pipefd1[0],STDIN_FILENO); + dup2(pipefd0[1],STDOUT_FILENO); + dup2(pipefd0[1],STDERR_FILENO); + switch (child_pid=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + exit(1); + } + default: + //after fork in parent. + dup2(stdio[0],STDIN_FILENO); + dup2(stdio[1],STDOUT_FILENO); + dup2(stdio[2],STDERR_FILENO); + close(pipefd1[0]); + close(pipefd0[1]); + } + return(child_pid); +} + +void make_args(char * id,char * argv[]){ + argv[0]="/home/ruttan/Desktop/echo"; + argv[1]=0; +} + +int main (int argc, char ** argv) { + int n; + char * nargv[numDbgArgs]; + int fdtoWeb,fdfrmWeb,fdtoDbg,fdfrmDgb,pipefd[2]; + char buf[BUFFSIZE],line[BUFFSIZE],toServer[MaxPipeName],fromServer[MaxPipeName]; + + signal(SIGPIPE, catch_sigpipe); + if ((argc < 2 )|| (argc >=3)){ + perror("usage: debugger idcode"); + exit(1); + } + /* + //create input pipe from webserver + sprintf(fromServer,"%s%s%s",logdir,argv[1],"OUT"); + unlink(fromServer); + + if (-1 == mkfifo(fromServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + + //create output pipe to webserver + sprintf(toServer,"%s%s%s",logdir,argv[1],"IN"); + unlink(toServer); + + if (-1 == mkfifo(toServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + //create pipes to debugger + + if(pipe(pipefd) == -1) { //perhaps pipe(pipefd,O_NONBLOCK) + perror("Pipe 1 creation failed"); + exit(1); + } + + */ + int i; + char c;make_args(argv[1],nargv); + child_pid=launch_debugger(nargv,pipefd); + printf("child_pid=%d\n",child_pid); + fflush(stdout); + + + + // while(1){ + /* + if ((n=read(fdfrmWeb,line,BUFFSIZE))){ + line[n]=0; + n=sprintf(buf,"%d-%s%s",n,"debugger:",line); + if (write(1,buf,n) != n) { + printf("cp: write error on file stdout\n"); + fflush(stdout); + exit(1); + } + if (write(fdtoWeb,buf,n) != n) { + perror("fdtoWeb write error"); + } + + } + else{ + printf("empty read\n"); + close(fdtoWeb); + close(fdfrmWeb); + n=0; + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + } + */ + while (1){ + + i=0; + while ((c=getchar())!='\n'){ + line[i++]=c; + } + line[i]=c; + write(pipefd[1],line,i+1); + if ((n=read(pipefd[0],line,BUFFSIZE))){ + line[n]=0; + } + printf("%s",line); + fflush(stdout); + } +exit(0); +} + + diff --git a/debugger/pipetest2.c b/debugger/pipetest2.c new file mode 100644 index 0000000..33eeb29 --- /dev/null +++ b/debugger/pipetest2.c @@ -0,0 +1,179 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 50 +#define logdir "/tmp/debugger/" +#define numDbgArgs 5 +#define ArgSize 30 + +pid_t child_pid; + +void catch_sigpipe(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGPIPE, catch_sigpipe); + printf("got a signal\n"); + fflush(stdout); +} + +pid_t launch_debugger(char * argv[],int pipefd[2]){ + int stdio[3]; + pid_t child_pid; + int pipefd0[2],pipefd1[2]; + pipe(pipefd0); + if(pipe(pipefd0) == -1) { + perror("Pipe 0 creation failed"); + exit(1); + } + pipe(pipefd1); + if(pipe(pipefd1) == -1) { + perror("Pipe 1 creation failed"); + exit(1); + } + //create function to setup pipes fork and exec + pipefd[0]=pipefd0[0]; + pipefd[1]=pipefd1[1]; + stdio[0]=dup(STDIN_FILENO); + stdio[1]=dup(STDOUT_FILENO); + stdio[2]=dup(STDERR_FILENO); + dup2(pipefd1[0],STDIN_FILENO); + dup2(pipefd0[1],STDOUT_FILENO); + dup2(pipefd0[1],STDERR_FILENO); + switch (child_pid=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + exit(1); + } + default: + //after fork in parent. + dup2(stdio[0],STDIN_FILENO); + dup2(stdio[1],STDOUT_FILENO); + dup2(stdio[2],STDERR_FILENO); + close(pipefd1[0]); + close(pipefd0[1]); + } + return(child_pid); +} + +void make_args(char * id,char * argv[]){ + argv[0]="/usr/local/bin/python3"; + argv[1]="-i"; + argv[2]="-c"; + argv[3]="\"print('Starting')\""; + argv[4]=0; +} + +int main (int argc, char ** argv) { + int n; + char * nargv[numDbgArgs]; + int fdtoWeb,fdfrmWeb,fdtoDbg,fdfrmDgb,pipefd[2]; + char buf[BUFFSIZE],line[BUFFSIZE],toServer[MaxPipeName],fromServer[MaxPipeName]; + + signal(SIGPIPE, catch_sigpipe); + if ((argc < 2 )|| (argc >=3)){ + perror("usage: debugger idcode"); + exit(1); + } + /* + //create input pipe from webserver + sprintf(fromServer,"%s%s%s",logdir,argv[1],"OUT"); + unlink(fromServer); + + if (-1 == mkfifo(fromServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + + //create output pipe to webserver + sprintf(toServer,"%s%s%s",logdir,argv[1],"IN"); + unlink(toServer); + + if (-1 == mkfifo(toServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + //create pipes to debugger + + if(pipe(pipefd) == -1) { //perhaps pipe(pipefd,O_NONBLOCK) + perror("Pipe 1 creation failed"); + exit(1); + } + + */ + int i; + char c;make_args(argv[1],nargv); + child_pid=launch_debugger(nargv,pipefd); + printf("child_pid=%d\n",child_pid); + fflush(stdout); + + + + // while(1){ + /* + if ((n=read(fdfrmWeb,line,BUFFSIZE))){ + line[n]=0; + n=sprintf(buf,"%d-%s%s",n,"debugger:",line); + if (write(1,buf,n) != n) { + printf("cp: write error on file stdout\n"); + fflush(stdout); + exit(1); + } + if (write(fdtoWeb,buf,n) != n) { + perror("fdtoWeb write error"); + } + + } + else{ + printf("empty read\n"); + close(fdtoWeb); + close(fdfrmWeb); + n=0; + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + } + */ + printf("starting\n"); + fflush(stdout); + while (1){ + line[0]=0; + while (!strstr(line,">>>")){ + if ((n=read(pipefd[0],line,BUFFSIZE))){ + line[n]=0; + } + printf("p-%s",line); + } + i=0; + while ((c=getchar())!='\n'){ + line[i++]=c; + } + line[i]=c; + write(pipefd[1],line,i+1); + } +exit(0); +} + + diff --git a/debugger/webserver2 b/debugger/webserver2 new file mode 100755 index 0000000000000000000000000000000000000000..99e17a932b4a43bf60854146711c9d9f102de443 GIT binary patch literal 8768 zcmb7J4RBP~b-pVt_Qn-RU^k&L#?SF85goG#MNs1(1|bPhtVl8zE-^Nb)$UupEvwy~ z-S=$ap^h{w*(gG`YSRhLj|Uvbp>3KdiQ6(Y^~jL}c!s7VO{boW$0cLjt_t=Lm%2_( z*nZ!=?@CWE$uzyv*>k^p&OP_s-*z{3)^v+jQlwHDw`dD%Fztw9zL3s3DUr7dgJk1x^#Lm^Zv7fVkg@4nuu!KMVJIO@U_U8A;(0?lVdVD)LGtUcc98!L#uIss5QoX(!B@za2yuiQ-S<2>oIFO3HRqe;7-&=ESkzu5 z$HYEP{<}h)ApfWk)8ro$;#KnHLhKlO`@Yh}aGBNHH9S*ZA;kDIS1Ogt=#QO6hIGEb$REnqV`dk)zu^=t{7ve~l|vqfw+=j^n^Y#AFR zi`glO*+RBKd_-cll-)o)DKT5jZX_O(m@Q}DPMnvREog5d-Xk$v(%wegBQaal?jhbJ zF^1#yU)X(a5uhm0AH-5Wq{!eBZ$88 zVO8luXv6EpnKZWyIhDsFhaP(Hbc`9m-j-u2MT#KU6Z#HZ*G>?5sw z^dOW+r=4YVSRnF|Q{gDnDraAtflle-awJ5tFqPkflSj|N*jPAP9tAkn77d@r=N<|e zfuj7gUqay`6ewT{72lv@ILfJ8X8TK<4M<5cNBwO>BI9t9v*&7F!zwtWQ=aKyp0;QMGyKbkm5P^t;!t$kEimKN_D`{7j*Udm z!u#@3XpIxS4m5$R(7j~L>!y|NPpIo^-8X4mAgTbdCxK|L%1t6hnwD{N!(ejV!vZ@^AZ~YJCZ~5fkg?!E%)(>u?0;2p2#Jy?=x67-BaNA&PC%mi| zmxQ>RA24?|smwjh{0@XV^HF3zITC&G7G$3NGyHJ43qyLsM7dy$ zL}`I`pHp_H0pS#xa9YsdjGY__OEbrFCG{A*=IJ1wA zo%f3#0nlE4$T*tlDOy(E(wjp_9-Ve?rs$c4qJ2_SJF*&It5YM<UD3jxcAF2)jIW5!$nvmHs)2s_0(6FF{vMkw)PUzEWk^o!awm!`y;_5B;eyXC z{gvO_qdYkBYq9Jl#wI6rU8$TMujYr~GCr96h)P}Go~#!ol{-=S&td@q%S+>Dba;6vCI$ zNN0`oKt5M2ru#CM!QH;KdUYaKC|C(6o$VKic$Uud&;UcJoZ;l=D}i?S6?v+V8<^Lq zPp(F7?tt@IHpp&P63Y(P2q zCW$;g2yNg);7RbGf^!3S4*Yp=p0^o7k8T&C{gKd(HR14q5YA^vBSoPn&)F?YBBNEC z7cXl00W<_|IfS?ibOYoMfD0{eEiHOH{6uwC&rHk7mQzw2%fGNeo1u%WG8p*X4{AnQ z6H|2lt)=SJj8_PfF}~%#Qgf=pJ$WX=kwn;|;Ruc-;tIBy|8=#JJ2)JU(BC~JoQ=Sz zfN_)&{|drUM&`p2LF_B>UoL@f0!H-z9e6jRGkptnc^ULW(3_xlL03Ub9uG%Wf?}YJpf1pEP!{wU=twTGLHwowAj&1&dWTUYlopnf3!W;fdjV$(t4bm#~_$S8uhpiXg!_- z=qtm7#PVdzcjN|F30`J7X#%o&kG=}C+}cU&}|fWLEC!~SnIukz0DiYJEE1q zwcg8~9{ZRdd)^(-Ej&KGANcfmxE}cpdS`rkJVPIZo-PZbx%iI|XJ4>fc^3`6(_R{w z)T19i1+gB~+le)KCl=kHJz|bYt;e|s) z2l~M=Pv3NKR-$ZQg0`pSe$MrXSiM%Lbw^=UGS?S{l|il}3bS;zUMLL55V$TV%pMhT z{wu5|1n0TJlF4tU!mNe*rYg)YvYMX?bA`ej!aP*CMq6| zxCdC?eu0Nj9`|ItBV$hz+u+ka{b2e0;tl!A9|j)$6YbAZ@f5JXe7;GX#X1LualBZ3 zhY>HZK3s2f`-HHg`U$YEA73fn4&V=fb$f@<-XS=s+tU!sMUBs4_Fe-p?>SgMz9}>X z2Ke>^;RxH6@~;Nu-wxpK`>=sLKMLTtfjNGa z|Fz;GFuxm6h5aSsJ)b`7TkTschz;OL=r>WnYO(l~4}Svqwt)U!0o)b9dw~6KGV;R> z+YBu4^N{QQs6&4o4CH?n_-V8czgujdZwKVB1n@rr8{Yg~T2(8~0rS?EFgMc=N9gKjBKO#`l=*`wJ>J^cy}6~+?B25FzV=?Tw`Fr@ zJ3Z$n-i#Lt@qMP1O)gB3uYba9`&?JcXFFO2_vGq{4QdPD>o#qge_Tu0IB1x8oHV=# zLBEhEa6i^Bc>Xl+F)vYcO?j;F%JiNL{h9;uy%wDBFM5xSewp{`w=ikJqo(e=@IG{1~Hp c{q5^x7%*l&VLG;(-5cv0#5*$Hg;jO_7bU(&%>V!Z literal 0 HcmV?d00001 diff --git a/debugger/webserver2.c b/debugger/webserver2.c new file mode 100644 index 0000000..d8d648f --- /dev/null +++ b/debugger/webserver2.c @@ -0,0 +1,162 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 100 +#define logdir "/home/ruttan/classes/capstone/debugger/" +#define interface "interface" +#define numDbgArgs 5 + +pid_t child_pid; +void catch_sigint(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + printf("got signal sigint\n"); + fflush(stdout); + signal(SIGINT, catch_sigint); + kill(child_pid,SIGINT); + exit(1); +} + +void make_args(char * id,char * argv[]){ + char *prog; + prog=(char *)malloc(MaxPipeName); + sprintf(prog,"%s%s",logdir,interface); + argv[0]=prog; + argv[1]=id; + argv[2]=0; +} + +pid_t launch_interface(char * argv[]){ + int stdio[3]; + pid_t child_pidt; + usleep(10000); + switch (child_pidt=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + printf("exec =%s",argv[0]); + fflush(stdout); + exit(1); + } + //after fork in parent + } + free(argv[0]); + return(child_pidt); +} + +main (int argc,char** argv ) { + int fd,i; + int len,n; + char line[BUFFSIZE]; + char c; + char * nargv[numDbgArgs]; + int fdtoDbg,fdfrmDbg,fileCheckO,fileCheckI,errnoO,errnoI; + struct stat stat_bufO, stat_bufI; + char buf[BUFFSIZE],toDebugger[MaxPipeName],fromDebugger[MaxPipeName]; + if ((argc < 2 )|| (argc >=3)){ + perror("usage: webserver idcode"); + exit(1); + } + signal(SIGINT, catch_sigint); + sprintf(toDebugger,"%s%s%s",logdir,"OUT",argv[1]); + sprintf(fromDebugger,"%s%s%s",logdir,"IN",argv[1]); + fileCheckO=stat(toDebugger,&stat_bufO); + errnoO=errno; + fileCheckI=stat(fromDebugger,&stat_bufI); + errnoI=errno; + + if ((fileCheckO == -1) && (fileCheckI == -1)) { + if ((errnoO==2) && (errnoI==2)){ + printf("NEITHER files exists\n"); + fflush(stdout); + make_args(argv[1],nargv); + child_pid=launch_interface(nargv); + usleep(10000); + } + else{ + printf("errnoI=%s\n",strerror(errnoI)); + printf("errnoO=%s\n",strerror(errnoO)); + fflush(stdout); + exit(0); + } + + } else { + if ((errnoO == 0) && (errnoI == 0) && + S_ISFIFO(stat_bufO.st_mode) && S_ISFIFO(stat_bufI.st_mode)){ + printf("both files are FIFOs\n"); + fflush(stdout); + } + else{ + printf("files exist in impossible state--correcting\n"); + if (!fileCheckO) unlink(toDebugger); + if (!fileCheckI) unlink(fromDebugger); + fflush(stdout); + make_args(argv[1],nargv); + child_pid=launch_interface(nargv); + usleep(10000); + } + } + + + //create output pipe to webserver + + + if ((fdtoDbg = open(toDebugger,O_WRONLY)) == -1) { + perror("cannot open fifo to debugger"); + exit(1); + } + //create input pipe from webserver + if ((fdfrmDbg = open(fromDebugger,O_RDONLY)) == -1) { + perror("cannot open fifo from debugger"); + exit(1); + } + + while(1) { + line[0]=0; + while (!strstr(line,">>>")&& !strstr(line,"...") ){ + if ((n=read(fdfrmDbg,line,BUFFSIZE))){ + line[n]=0; + printf("%d-web:%s",n,line); + fflush(stdout); + } + else{ + printf("null read on fdfrmDbg\n"); + fflush(stdout); + exit(1); + } + } + i=0; + while ((c=getchar())!='\n'){ + line[i++]=c; + } + line[i]=c; + if (strstr(line,"#123")){ + printf("webserver2 exiting\n"); + fflush(stdout); + break; + } + write(fdtoDbg,line,i+1); + } + exit(0); +} + + + + + + + + + diff --git a/files/.svn/all-wcprops b/files/.svn/all-wcprops new file mode 100644 index 0000000..dabd186 --- /dev/null +++ b/files/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 55 +/courses/cs49901-trac/svn/!svn/ver/2264/S2013/Web/files +END diff --git a/files/.svn/entries b/files/.svn/entries new file mode 100644 index 0000000..b0598ae --- /dev/null +++ b/files/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2270 +http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/files +http://classes.cs.kent.edu/courses/cs49901-trac/svn + + + +2013-05-01T04:13:40.826966Z +2264 +pedwards + + + + + + + + + + + + + + +6b56fd01-43f3-4ec1-838e-340f7da2cd71 + diff --git a/files/KLogger.php b/files/KLogger.php new file mode 100755 index 0000000..eaf15f2 --- /dev/null +++ b/files/KLogger.php @@ -0,0 +1,410 @@ +logInfo('Returned a million search results'); //Prints to the log file + * $log->logFatal('Oh dear.'); //Prints to the log file + * $log->logDebug('x = 5'); //Prints nothing due to current severity threshhold + * + * @author Kenny Katzgrau + * @since July 26, 2008 — Last update July 1, 2012 + * @link http://codefury.net + * @version 0.2.0 + */ + +/** + * Class documentation + */ +class KLogger +{ + /** + * Error severity, from low to high. From BSD syslog RFC, secion 4.1.1 + * @link http://www.faqs.org/rfcs/rfc3164.html + */ + const EMERG = 0; // Emergency: system is unusable + const ALERT = 1; // Alert: action must be taken immediately + const CRIT = 2; // Critical: critical conditions + const ERR = 3; // Error: error conditions + const WARN = 4; // Warning: warning conditions + const NOTICE = 5; // Notice: normal but significant condition + const INFO = 6; // Informational: informational messages + const DEBUG = 7; // Debug: debug messages + + //custom logging level + /** + * Log nothing at all + */ + const OFF = 8; + /** + * Alias for CRIT + * @deprecated + */ + const FATAL = 2; + + /** + * Internal status codes + */ + const STATUS_LOG_OPEN = 1; + const STATUS_OPEN_FAILED = 2; + const STATUS_LOG_CLOSED = 3; + + /** + * We need a default argument value in order to add the ability to easily + * print out objects etc. But we can't use NULL, 0, FALSE, etc, because those + * are often the values the developers will test for. So we'll make one up. + */ + const NO_ARGUMENTS = 'KLogger::NO_ARGUMENTS'; + + /** + * Current status of the log file + * @var integer + */ + private $_logStatus = self::STATUS_LOG_CLOSED; + /** + * Holds messages generated by the class + * @var array + */ + private $_messageQueue = array(); + /** + * Path to the log file + * @var string + */ + private $_logFilePath = null; + /** + * Current minimum logging threshold + * @var integer + */ + private $_severityThreshold = self::INFO; + /** + * This holds the file handle for this instance's log file + * @var resource + */ + private $_fileHandle = null; + + /** + * Standard messages produced by the class. Can be modified for il8n + * @var array + */ + private $_messages = array( + //'writefail' => 'The file exists, but could not be opened for writing. Check that appropriate permissions have been set.', + 'writefail' => 'The file could not be written to. Check that appropriate permissions have been set.', + 'opensuccess' => 'The log file was opened successfully.', + 'openfail' => 'The file could not be opened. Check permissions.', + ); + + /** + * Default severity of log messages, if not specified + * @var integer + */ + private static $_defaultSeverity = self::DEBUG; + /** + * Valid PHP date() format string for log timestamps + * @var string + */ + private static $_dateFormat = 'Y-m-d G:i:s'; + /** + * Octal notation for default permissions of the log file + * @var integer + */ + private static $_defaultPermissions = 0777; + /** + * Array of KLogger instances, part of Singleton pattern + * @var array + */ + private static $instances = array(); + + /** + * Partially implements the Singleton pattern. Each $logDirectory gets one + * instance. + * + * @param string $logDirectory File path to the logging directory + * @param integer $severity One of the pre-defined severity constants + * @return KLogger + */ + public static function instance($logDirectory = false, $severity = false) + { + if ($severity === false) { + $severity = self::$_defaultSeverity; + } + + if ($logDirectory === false) { + if (count(self::$instances) > 0) { + return current(self::$instances); + } else { + $logDirectory = dirname(__FILE__); + } + } + + if (in_array($logDirectory, self::$instances)) { + return self::$instances[$logDirectory]; + } + + self::$instances[$logDirectory] = new self($logDirectory, $severity); + + return self::$instances[$logDirectory]; + } + + /** + * Class constructor + * + * @param string $logDirectory File path to the logging directory + * @param integer $severity One of the pre-defined severity constants + * @return void + */ + public function __construct($logDirectory, $severity) + { + $logDirectory = rtrim($logDirectory, '\\/'); + date_default_timezone_set('America/New_York'); + if ($severity === self::OFF) { + return; + } + + $this->_logFilePath = $logDirectory + . DIRECTORY_SEPARATOR + . 'log_' + . date('Y-m-d') + . '.txt'; + + $this->_severityThreshold = $severity; + if (!file_exists($logDirectory)) { + mkdir($logDirectory, self::$_defaultPermissions, true); + } + + if (file_exists($this->_logFilePath) && !is_writable($this->_logFilePath)) { + $this->_logStatus = self::STATUS_OPEN_FAILED; + $this->_messageQueue[] = $this->_messages['writefail']; + return; + } + + if (($this->_fileHandle = fopen($this->_logFilePath, 'a'))) { + $this->_logStatus = self::STATUS_LOG_OPEN; + $this->_messageQueue[] = $this->_messages['opensuccess']; + } else { + $this->_logStatus = self::STATUS_OPEN_FAILED; + $this->_messageQueue[] = $this->_messages['openfail']; + } + } + + /** + * Class destructor + */ + public function __destruct() + { + if ($this->_fileHandle) { + fclose($this->_fileHandle); + } + } + /** + * Writes a $line to the log with a severity level of DEBUG + * + * @param string $line Information to log + * @return void + */ + public function logDebug($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::DEBUG); + } + + /** + * Returns (and removes) the last message from the queue. + * @return string + */ + public function getMessage() + { + return array_pop($this->_messageQueue); + } + + /** + * Returns the entire message queue (leaving it intact) + * @return array + */ + public function getMessages() + { + return $this->_messageQueue; + } + + /** + * Empties the message queue + * @return void + */ + public function clearMessages() + { + $this->_messageQueue = array(); + } + + /** + * Sets the date format used by all instances of KLogger + * + * @param string $dateFormat Valid format string for date() + */ + public static function setDateFormat($dateFormat) + { + self::$_dateFormat = $dateFormat; + } + + /** + * Writes a $line to the log with a severity level of INFO. Any information + * can be used here, or it could be used with E_STRICT errors + * + * @param string $line Information to log + * @return void + */ + public function logInfo($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::INFO, $args); + } + + /** + * Writes a $line to the log with a severity level of NOTICE. Generally + * corresponds to E_STRICT, E_NOTICE, or E_USER_NOTICE errors + * + * @param string $line Information to log + * @return void + */ + public function logNotice($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::NOTICE, $args); + } + + /** + * Writes a $line to the log with a severity level of WARN. Generally + * corresponds to E_WARNING, E_USER_WARNING, E_CORE_WARNING, or + * E_COMPILE_WARNING + * + * @param string $line Information to log + * @return void + */ + public function logWarn($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::WARN, $args); + } + + /** + * Writes a $line to the log with a severity level of ERR. Most likely used + * with E_RECOVERABLE_ERROR + * + * @param string $line Information to log + * @return void + */ + public function logError($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::ERR, $args); + } + + /** + * Writes a $line to the log with a severity level of FATAL. Generally + * corresponds to E_ERROR, E_USER_ERROR, E_CORE_ERROR, or E_COMPILE_ERROR + * + * @param string $line Information to log + * @return void + * @deprecated Use logCrit + */ + public function logFatal($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::FATAL, $args); + } + + /** + * Writes a $line to the log with a severity level of ALERT. + * + * @param string $line Information to log + * @return void + */ + public function logAlert($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::ALERT, $args); + } + + /** + * Writes a $line to the log with a severity level of CRIT. + * + * @param string $line Information to log + * @return void + */ + public function logCrit($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::CRIT, $args); + } + + /** + * Writes a $line to the log with a severity level of EMERG. + * + * @param string $line Information to log + * @return void + */ + public function logEmerg($line, $args = self::NO_ARGUMENTS) + { + $this->log($line, self::EMERG, $args); + } + + /** + * Writes a $line to the log with the given severity + * + * @param string $line Text to add to the log + * @param integer $severity Severity level of log message (use constants) + */ + public function log($line, $severity, $args = self::NO_ARGUMENTS) + { + if ($this->_severityThreshold >= $severity) { + $status = $this->_getTimeLine($severity); + + $line = "$status $line"; + + if($args !== self::NO_ARGUMENTS) { + /* Print the passed object value */ + $line = $line . '; ' . var_export($args, true); + } + + $this->writeFreeFormLine($line . PHP_EOL); + } + } + + /** + * Writes a line to the log without prepending a status or timestamp + * + * @param string $line Line to write to the log + * @return void + */ + public function writeFreeFormLine($line) + { + if ($this->_logStatus == self::STATUS_LOG_OPEN + && $this->_severityThreshold != self::OFF) { + if (fwrite($this->_fileHandle, $line) === false) { + $this->_messageQueue[] = $this->_messages['writefail']; + } + } + } + + private function _getTimeLine($level) + { + $time = date(self::$_dateFormat); + + switch ($level) { + case self::EMERG: + return "$time - EMERG -->"; + case self::ALERT: + return "$time - ALERT -->"; + case self::CRIT: + return "$time - CRIT -->"; + case self::FATAL: # FATAL is an alias of CRIT + return "$time - FATAL -->"; + case self::NOTICE: + return "$time - NOTICE -->"; + case self::INFO: + return "$time - INFO -->"; + case self::WARN: + return "$time - WARN -->"; + case self::DEBUG: + return "$time - DEBUG -->"; + case self::ERR: + return "$time - ERROR -->"; + default: + return "$time - LOG -->"; + } + } +} diff --git a/files/compiledDatabaseProgram1.py b/files/compiledDatabaseProgram1.py new file mode 100644 index 0000000..7f497a2 --- /dev/null +++ b/files/compiledDatabaseProgram1.py @@ -0,0 +1 @@ +//This Is Code \ No newline at end of file diff --git a/files/compiledDatabaseProgram2.py b/files/compiledDatabaseProgram2.py new file mode 100644 index 0000000..7f497a2 --- /dev/null +++ b/files/compiledDatabaseProgram2.py @@ -0,0 +1 @@ +//This Is Code \ No newline at end of file diff --git a/files/compiledDatabaseProgram47.py b/files/compiledDatabaseProgram47.py new file mode 100644 index 0000000..5e15726 --- /dev/null +++ b/files/compiledDatabaseProgram47.py @@ -0,0 +1,9 @@ +import sys +import os +def recursive(a): + if a == 1: + return a+1 + else: + return a + recursive(a-1) + +print (recursive(5)) diff --git a/files/compiledDatabaseProgram48.py b/files/compiledDatabaseProgram48.py new file mode 100644 index 0000000..1c343cf --- /dev/null +++ b/files/compiledDatabaseProgram48.py @@ -0,0 +1,16 @@ +import random +c1 = """ +a=_r0 +b=_r1 +if (a == _r2): +print "0,2" +elif (b==_r2): +print "1,2" +else: +print "neither" +""" +random.seed() +c1=c1.replace("_r0",str(random.randint(1,3))) +c1=c1.replace("_r1",str(random.randint(1,3))) +c1=c1.replace("_r2",str(random.randint(1,3))) +print(c1) diff --git a/files/compiledDatabaseProgram51.py b/files/compiledDatabaseProgram51.py new file mode 100644 index 0000000..d6e444c --- /dev/null +++ b/files/compiledDatabaseProgram51.py @@ -0,0 +1,22 @@ +import random +c1=""" +#include +#include +#include +using namespace std; + +int recursive(int a){ + if (a == 1) + return a+_r0; + else + return a+recursive(a-1); +} + +main(){ + cout << recursive(_r1)<<'\\n'; +} +""" +random.seed() +c1=c1.replace("_r0",str(random.randint(3,8))) +c1=c1.replace("_r1",str(random.randint(5,10))) +print (c1) \ No newline at end of file diff --git a/files/finalOutput b/files/finalOutput new file mode 100755 index 0000000000000000000000000000000000000000..4b4478f15f3ac49155901fe92da7367309a51ba6 GIT binary patch literal 6131 zcmb7Ie{ht=8Qx1SdfEU9(i$L^a~f(WawKq2uxJx<2Sg&l1T6-2z1$tSuUzgj_kBkL zgBCm@Fd=P5=}7HNN7|0f#L#73c5|G*z@sedS)!pu?94jog6wkg-=*}YA^ z9L%)t%=^9j?ECJ!@9w_)KPV2fV%@c<6Il5)^*n6ZPVYV!pTm zMU(~iLIx(KaS7k>b1Ko)VzX7pb z%FDofH-WzI^^wj2lPG5!qz%yDfVN2?V3Lt-zTm`;+$hA61707gRDM6?P`@S_`%9Bn z_tIo+NzzJX`vZ15uuR*AYpQSSH$9;0(ofcz4Px7KKpY#&EB<-mM~!cP=eHMD-v9e2 zo_i+v?yoAwDZ?-*8ypMI;;P%hR2jM}UflTSk^1oO+U6XsY}wVit>Ha{uB z^v@(eG7Ag=!yPDF4rMDU z)3%d|M|xYMTV%L%g^XU$T1Z)wJ^lT%FP^c}sYudtcFCO$>_D&f9l4%pRN6$1ERPoZ z)Y^^?#jKRf+VL2=810Y9h!gL(&;?1oVt;!hR!XdIYhBwSmjxOobB%%JqGjvW=C!So zS*5Ubt6U!70>nyS%#eFQ9#9!p5&4HG<$O1gTh? ze`yE8uR_!p^_@jeV@}J&@}hnoYwiX#%(<<&S%@pZH$pZ+&Y(y6jgWiEVaZ31g-}V3 zbyr0W59W|#e|g~0h0ffVH&0)-?Hhgg^FjWPOHrpE~m<;A@U)APhC;yz&T$<+AQM-TlecmDF`Eggw7PeJP(KKDPESPYhb2Fl~Z z(-QkW6sw!qd-u;_Q)KUXO~ChKF9YnmG=a_UjenQrE_qg;wQn09a=t8bBc2~qSeP?F zsZv~hHj_VD!TKJU@@{)%bZDm-I&lY`f_;?bk9lErV8ogIDhrXh>6EvQWrZ`RN1>A& ztI0j?^JIO4VP9^f{8BY}-gC%Xm;VS(mxp~??fm83SQV;rd&<8F$)Ql47nq@tcdix+ zr+^U>f;Eo=tM;Zfv25Stl^nC|BGfz1dP(YW<3MHKFg6q#p@c@3LTKu9nVKbw{H*3TCg7)s{h}3uruF|?7mSCPNCdbZGP}Sg~HHlFjW}J@w@2M8-=og zf>YP{>0r1DUBWO_vS%0t_)s|V3bk@4J*%%~KFYmWyX{f=$mn2g9hx@tcWfN9k-JiG zX1~VV@X)r2!kNKxlw`+?lcIE8aqeJ`%um3ThY-_T$6SX@p84fpYXZko5q;?XW8lw% z?*)G!{CV(O;Lr&88t^ONZQwN+6b?xUyar`Vp52=}glCWM2DS6fuk?BkdTLSb2l-%2 z1xfQv-$2>g85PmDAQyu2CeSR%*MJKn@1K%ChT_GLH-S&e_e{z6qIe_Zv^6Q;s^vTf znLN9dYaZ>DZkPINP>%sNS+7~w0j2+xU6A$ z!wP?WM?B`=5OH+*lHejC0`{(6C(;e>WHe8hoRz`}-X{X7v=a~DBwOM{dWxtgl?`-f zEnKFomfgG3KOXv5l;<$Jl%j#CWD2V}B1ajCqqx_E8j= zxMj?qKqc-=rd`%2?Eo>(nP;qj0KLbMXS*yj{n(8>t_`Y;Yb6K){W12a$H2{jj2_ok z2!bY*QIG4`=W*+9f#g=2!@qJf2c=#8f5hN|Fjtm*0KY| zL|>VXf{Y&bk|ZWk?UPD6)!!c$^=RTC^bSIg{+nd{djSQsM?LjV1HF(@0ylcckvDp0 zVec&TcxISn^j{Pn>G3i$0X?;G6b%}C@3{1M=kQ{3jEt%#|1R>J z3%0BN?VxwASO%u_XrKEr-KHMzqWSCCqs@<9dfa=*pm!(AOrj1c4>I;@aP6qUCT@J9 zuF3xmdA84XdEu#r9_P{|e=+k3IPIBOqMo~5%1GSvY0IPy(3>y-oH|V8t}qhgvxImV zPThubwn6_GTj<_2dq2S;)9z}(*n`?NiTe=?_20kVcQn>5bAQoT8{|Hsu^t`n7aHr; z$bCU$&M5Yi;+a*hb}YTlwOpyGvrl98LZ68mV^EN|J~ieJB?Q-@#yT>&-ZbV3tj6 zI}Ce#mw6kQzg>W$x@?yC12F$WHNHih2j*`qLxh0&f6Ti*?Y9D(^*)<7l4!=Uoh<(9@H``1wzPN1w${!qd?J#eY3SY- zmnfE&J;`);Bq`OkPDZl*0#~-aWZa3z0xMR3b(x?*TCskjpwKtNShlx!muV-wDWsZN z*U@}mSQ^A;On#~rb%#`~;LaIIwr8EbtP_a#^{JPrwpCJEX>~J|UBO1lXCDU-P%N?V zptKtZk6)2gOvd84IcK8^H&}S!THn^bwz*BpRw=tyXX4Q;F2XzGQ-bz&>pH_*DLy*63e@YGkfDb*HQ(3TB6ywEFHq{`OTDNyHMyUe+)q|T30|o9 z7*%|~irQJJZrR4p|M85sy-y~-C5qMXl6Rf=yHYPo-pZz2X@KX`Mg?z#pZVRdq_t~Z z;v-;*Qt8v)w6QF{Q5AR1d{3>$5O|L#4m;!P&J8h_2+>%(rca} io0?oNgqZA=t5ybj;*RW#N+*#`?Fe-D3-!FHP5&1t70faK literal 0 HcmV?d00001 diff --git a/files/finalOutput.cpp b/files/finalOutput.cpp new file mode 100644 index 0000000..b5be587 --- /dev/null +++ b/files/finalOutput.cpp @@ -0,0 +1,17 @@ + +#include +#include +#include +using namespace std; + +int recursive(int a){ + if (a == 1) + return a+3; + else + return a+recursive(a-1); +} + +main(){ + cout << recursive(5)<<'\n'; +} + diff --git a/files/finalOutput.py b/files/finalOutput.py new file mode 100644 index 0000000..db82bea --- /dev/null +++ b/files/finalOutput.py @@ -0,0 +1,10 @@ + +a=1 +b=2 +if (a == 1): +print "0,2" +elif (b==1): +print "1,2" +else: +print "neither" + diff --git a/files/finalOutput.txt b/files/finalOutput.txt new file mode 100644 index 0000000..f5a1540 --- /dev/null +++ b/files/finalOutput.txt @@ -0,0 +1,4 @@ + File "../files/finalOutput.py", line 5 + print "0,2" + ^ +IndentationError: expected an indented block diff --git a/files/log5227532da1e3f/log_2013-09-04.txt b/files/log5227532da1e3f/log_2013-09-04.txt new file mode 100644 index 0000000..2249274 --- /dev/null +++ b/files/log5227532da1e3f/log_2013-09-04.txt @@ -0,0 +1,15 @@ +2013-09-04 11:35:09 - INFO --> dirname(__FILE__)=; '/var/www/html/Web' +2013-09-04 11:35:44 - INFO --> in submissions +2013-09-04 11:35:44 - INFO --> ../files/compiledDatabaseProgram51.py +2013-09-04 11:43:00 - INFO --> In results.php +2013-09-04 11:43:12 - INFO --> In Practice page; '5227532da1e3f' +2013-09-04 11:43:28 - INFO --> In results.php +2013-09-04 11:43:40 - INFO --> in submissions +2013-09-04 11:43:40 - INFO --> ../files/compiledDatabaseProgram51.py +2013-09-04 11:44:12 - INFO --> In results.php +2013-09-04 11:44:19 - INFO --> In Practice page; '5227532da1e3f' +2013-09-04 11:45:17 - INFO --> In results.php +2013-09-04 11:45:27 - INFO --> in submissions +2013-09-04 11:45:27 - INFO --> ../files/compiledDatabaseProgram51.py +2013-09-04 11:45:41 - INFO --> In results.php +2013-09-04 11:45:45 - INFO --> In Practice page; '5227532da1e3f' diff --git a/files/log52276f826a44c/log_2013-09-04.txt b/files/log52276f826a44c/log_2013-09-04.txt new file mode 100644 index 0000000..b0e4b7f --- /dev/null +++ b/files/log52276f826a44c/log_2013-09-04.txt @@ -0,0 +1,8 @@ +2013-09-04 13:36:02 - INFO --> dirname(__FILE__)=; '/var/www/html/Web' +2013-09-04 13:36:13 - INFO --> in submissions +2013-09-04 13:36:13 - INFO --> ../files/compiledDatabaseProgram51.py +2013-09-04 13:37:23 - INFO --> In results.php +2013-09-04 13:37:35 - INFO --> in submissions +2013-09-04 13:37:35 - INFO --> ../files/compiledDatabaseProgram51.py +2013-09-04 13:38:00 - INFO --> In results.php +2013-09-04 13:38:03 - INFO --> In Practice page; '52276f826a44c' diff --git a/files/log5229d8d5873a4/log_2013-09-06.txt b/files/log5229d8d5873a4/log_2013-09-06.txt new file mode 100644 index 0000000..8903097 --- /dev/null +++ b/files/log5229d8d5873a4/log_2013-09-06.txt @@ -0,0 +1,32 @@ +2013-09-06 9:29:57 - INFO --> dirname(__FILE__)=; '/var/www/html/Web' +2013-09-06 9:30:47 - INFO --> in submissions +2013-09-06 9:30:47 - INFO --> ../files/compiledDatabaseProgram47.py +2013-09-06 9:31:01 - INFO --> In results.php +2013-09-06 9:31:06 - INFO --> in submissions +2013-09-06 9:31:06 - INFO --> ../files/compiledDatabaseProgram47.py +2013-09-06 9:31:10 - INFO --> In results.php +2013-09-06 9:31:12 - INFO --> in submissions +2013-09-06 9:31:12 - INFO --> ../files/compiledDatabaseProgram47.py +2013-09-06 9:31:27 - INFO --> In results.php +2013-09-06 9:31:28 - INFO --> in submissions +2013-09-06 9:31:28 - INFO --> ../files/compiledDatabaseProgram47.py +2013-09-06 9:31:31 - INFO --> in submissions +2013-09-06 9:31:31 - INFO --> ../files/compiledDatabaseProgram48.py +2013-09-06 9:31:35 - INFO --> In results.php +2013-09-06 9:31:55 - INFO --> in submissions +2013-09-06 9:31:55 - INFO --> ../files/compiledDatabaseProgram48.py +2013-09-06 9:32:01 - INFO --> In results.php +2013-09-06 9:32:04 - INFO --> in submissions +2013-09-06 9:32:04 - INFO --> ../files/compiledDatabaseProgram48.py +2013-09-06 9:32:08 - INFO --> In results.php +2013-09-06 9:32:14 - INFO --> in submissions +2013-09-06 9:32:14 - INFO --> ../files/compiledDatabaseProgram48.py +2013-09-06 9:32:17 - INFO --> In results.php +2013-09-06 9:32:26 - INFO --> in submissions +2013-09-06 9:32:26 - INFO --> ../files/compiledDatabaseProgram48.py +2013-09-06 9:32:35 - INFO --> In results.php +2013-09-06 9:32:37 - INFO --> in submissions +2013-09-06 9:32:37 - INFO --> ../files/compiledDatabaseProgram48.py +2013-09-06 9:32:47 - INFO --> In results.php +2013-09-06 9:33:17 - INFO --> in submissions +2013-09-06 9:33:17 - INFO --> ../files/compiledDatabaseProgram51.py diff --git a/files/log5229da1d77a67/log_2013-09-06.txt b/files/log5229da1d77a67/log_2013-09-06.txt new file mode 100644 index 0000000..8672b8c --- /dev/null +++ b/files/log5229da1d77a67/log_2013-09-06.txt @@ -0,0 +1 @@ +2013-09-06 9:35:25 - INFO --> dirname(__FILE__)=; '/var/www/html/Web' diff --git a/files/log5229e0976c62d/log_2013-09-06.txt b/files/log5229e0976c62d/log_2013-09-06.txt new file mode 100644 index 0000000..c665ea2 --- /dev/null +++ b/files/log5229e0976c62d/log_2013-09-06.txt @@ -0,0 +1 @@ +2013-09-06 10:03:03 - INFO --> dirname(__FILE__)=; '/var/www/html/Project1' diff --git a/files/log5229e0de8f959/log_2013-09-06.txt b/files/log5229e0de8f959/log_2013-09-06.txt new file mode 100644 index 0000000..953f0a8 --- /dev/null +++ b/files/log5229e0de8f959/log_2013-09-06.txt @@ -0,0 +1 @@ +2013-09-06 10:04:14 - INFO --> dirname(__FILE__)=; '/var/www/html/Project1' diff --git a/files/log5229f35ec7756/log_2013-09-06.txt b/files/log5229f35ec7756/log_2013-09-06.txt new file mode 100644 index 0000000..b9bfa7d --- /dev/null +++ b/files/log5229f35ec7756/log_2013-09-06.txt @@ -0,0 +1 @@ +2013-09-06 11:23:10 - INFO --> dirname(__FILE__)=; '/var/www/html/Project1' diff --git a/files/test.txt b/files/test.txt new file mode 100644 index 0000000..3aa5867 --- /dev/null +++ b/files/test.txt @@ -0,0 +1,17 @@ + +#include +#include +#include +using namespace std; + +int recursive(int a){ + if (a == 1) + return a+4; + else + return a+recursive(a-1); +} + +main(){ + cout << recursive(5)<<'\n'; +} + diff --git a/images/.svn/all-wcprops b/images/.svn/all-wcprops new file mode 100644 index 0000000..2c8bb5b --- /dev/null +++ b/images/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/courses/cs49901-trac/svn/!svn/ver/2008/S2013/Web/images +END +bg_form.jpg +K 25 +svn:wc:ra_dav:version-url +V 68 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/images/bg_form.jpg +END +form-bg.png +K 25 +svn:wc:ra_dav:version-url +V 68 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/images/form-bg.png +END diff --git a/images/.svn/entries b/images/.svn/entries new file mode 100644 index 0000000..78b7194 --- /dev/null +++ b/images/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2270 +http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/images +http://classes.cs.kent.edu/courses/cs49901-trac/svn + + + +2013-03-20T18:35:24.986127Z +2008 +oasikogl + + + + + + + + + + + + + + +6b56fd01-43f3-4ec1-838e-340f7da2cd71 + +bg_form.jpg +file + + + + +2013-05-01T21:08:44.000000Z +561c1933b8fe69abbac4cf2bb9bf3c26 +2013-03-08T04:08:12.118316Z +1926 +pedwards +has-props + + + + + + + + + + + + + + + + + + + + +1263 + +form-bg.png +file + + + + +2013-05-01T21:08:44.000000Z +d9ec3ed4e1faf95e1353880a790b01b7 +2013-03-08T04:08:12.118316Z +1926 +pedwards +has-props + + + + + + + + + + + + + + + + + + + + +1042 + diff --git a/images/.svn/prop-base/bg_form.jpg.svn-base b/images/.svn/prop-base/bg_form.jpg.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/images/.svn/prop-base/bg_form.jpg.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/images/.svn/prop-base/form-bg.png.svn-base b/images/.svn/prop-base/form-bg.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/images/.svn/prop-base/form-bg.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/images/.svn/text-base/bg_form.jpg.svn-base b/images/.svn/text-base/bg_form.jpg.svn-base new file mode 100644 index 0000000000000000000000000000000000000000..d27f625a5254d6c866dc54e549e01d6e1eb3c49a GIT binary patch literal 1263 zcmbVMJ#5oJ6h6mE8q!c=(n3WmVHqYw;ydTZvDHvHaUwc|mQo2MCfB~UR_hdyA8Zzp5F5Cxvet``qrv08Qk1CNx^d4?E&zf)v~N8udcNp%;ViK_O$jFHeJlm zW8Yc#bWF^T^_@xW{!SDbl4#^v&m@nct*MT_Zecr^QEMEzDHx_9LsW$bi6tlsuu?@x zLQqn~5^5|LQ9@Jgfzdx8OKy{SKI0aRSF*aa^`>uEe%A-L#`~^gKJ+s@O9xVWZ_a7Tc|_ zZ0^BdY9gp80xVW`@~&1J6{+5=O64L%Eu?TgU*msj#*<+9s5yRVmcEK~V6+{yJ~<4A z2is&~JTe;LS1{6TcwlUk5v0No;2KEA2u4FSK z2eJo7GP&I7Xf8K7F)=ZDbRg8w(9r(O{_$*f{KyzHc4TnzubXfiFe!k*VVYtJ888h# zHy^yZ`sU-I$Fb4al{x4R0e9@ly()d>!S*DzefH+%<3FCJ)umf6Pd&VPLt6emd;j)b L>-r-=hwpv@w?I-L literal 0 HcmV?d00001 diff --git a/images/.svn/text-base/form-bg.png.svn-base b/images/.svn/text-base/form-bg.png.svn-base new file mode 100644 index 0000000000000000000000000000000000000000..008af8f6e81a4299a26a86b734fe3f7942b4d705 GIT binary patch literal 1042 zcmbVLO^ee&7!C;HF76L-Ph(bZCYedvrU{Kpnh&>N)}>ppN3+Sajl0RjWV%fYUc7no zrnul=5Cp-42ic<+LA)sldKUZvDmrPK)x)v}2a=h0=6#;``{B;^jkVSFRgUA^senLZ86Ea9vM@EXPz!Xh*QryAx`pTqFBnL!cQe6LMe{RxaQh9 z?c%>~oT{DorYV-XI49#QVD%VmRA837vkjGs%p3hy7O|rE2Q~@DF-~a5HhA_ThEb?P z)PxABHK@w4(L_i?P&3sUa!nVxt_drS)3COq))fcInrvzaIZ$hw$aP%VH7%vB$c+ly zNpk8Z0j}&u%t1LrMhArSRPMW zp9v?!gA+C}85@nyPageXW7Y21X0Q18?cMPT2QG3ite=O!$Ip(3m!E=HM~^k(ig4EY b^<@QeFF$a1KfS+ywVcw9vu!_b-+Ax{0SiAa literal 0 HcmV?d00001 diff --git a/images/bg_form.jpg b/images/bg_form.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d27f625a5254d6c866dc54e549e01d6e1eb3c49a GIT binary patch literal 1263 zcmbVMJ#5oJ6h6mE8q!c=(n3WmVHqYw;ydTZvDHvHaUwc|mQo2MCfB~UR_hdyA8Zzp5F5Cxvet``qrv08Qk1CNx^d4?E&zf)v~N8udcNp%;ViK_O$jFHeJlm zW8Yc#bWF^T^_@xW{!SDbl4#^v&m@nct*MT_Zecr^QEMEzDHx_9LsW$bi6tlsuu?@x zLQqn~5^5|LQ9@Jgfzdx8OKy{SKI0aRSF*aa^`>uEe%A-L#`~^gKJ+s@O9xVWZ_a7Tc|_ zZ0^BdY9gp80xVW`@~&1J6{+5=O64L%Eu?TgU*msj#*<+9s5yRVmcEK~V6+{yJ~<4A z2is&~JTe;LS1{6TcwlUk5v0No;2KEA2u4FSK z2eJo7GP&I7Xf8K7F)=ZDbRg8w(9r(O{_$*f{KyzHc4TnzubXfiFe!k*VVYtJ888h# zHy^yZ`sU-I$Fb4al{x4R0e9@ly()d>!S*DzefH+%<3FCJ)umf6Pd&VPLt6emd;j)b L>-r-=hwpv@w?I-L literal 0 HcmV?d00001 diff --git a/images/form-bg.png b/images/form-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..008af8f6e81a4299a26a86b734fe3f7942b4d705 GIT binary patch literal 1042 zcmbVLO^ee&7!C;HF76L-Ph(bZCYedvrU{Kpnh&>N)}>ppN3+Sajl0RjWV%fYUc7no zrnul=5Cp-42ic<+LA)sldKUZvDmrPK)x)v}2a=h0=6#;``{B;^jkVSFRgUA^senLZ86Ea9vM@EXPz!Xh*QryAx`pTqFBnL!cQe6LMe{RxaQh9 z?c%>~oT{DorYV-XI49#QVD%VmRA837vkjGs%p3hy7O|rE2Q~@DF-~a5HhA_ThEb?P z)PxABHK@w4(L_i?P&3sUa!nVxt_drS)3COq))fcInrvzaIZ$hw$aP%VH7%vB$c+ly zNpk8Z0j}&u%t1LrMhArSRPMW zp9v?!gA+C}85@nyPageXW7Y21X0Q18?cMPT2QG3ite=O!$Ip(3m!E=HM~^k(ig4EY b^<@QeFF$a1KfS+ywVcw9vu!_b-+Ax{0SiAa literal 0 HcmV?d00001 diff --git a/index.html b/index.html new file mode 100644 index 0000000..d2e6475 --- /dev/null +++ b/index.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..e859f62 --- /dev/null +++ b/index.php @@ -0,0 +1,47 @@ + 2592000) { + session_unset(); + session_destroy(); + header("Location:../shared_php/session_expired.php"); + } + } else if (time() - $_SESSION['lastActivity'] > 1800) { + session_unset(); + session_destroy(); + header("Location:../shared_php/session_expired.php"); + } +} else { + $_SESSION['lastActivity'] = time(); // update last activity time stamp +} +?> + + + + + Login Form + + + + + +
+
+

Login

+ +
+ +
+ +
+ + Keep me logged in +
+ Forgot your password? +
+
+
+ + diff --git a/instructor/.svn/all-wcprops b/instructor/.svn/all-wcprops new file mode 100644 index 0000000..97cb66f --- /dev/null +++ b/instructor/.svn/all-wcprops @@ -0,0 +1,107 @@ +K 25 +svn:wc:ra_dav:version-url +V 60 +/courses/cs49901-trac/svn/!svn/ver/2270/S2013/Web/instructor +END +sendNotif.php +K 25 +svn:wc:ra_dav:version-url +V 74 +/courses/cs49901-trac/svn/!svn/ver/2271/S2013/Web/instructor/sendNotif.php +END +create_assignment.php +K 25 +svn:wc:ra_dav:version-url +V 82 +/courses/cs49901-trac/svn/!svn/ver/2231/S2013/Web/instructor/create_assignment.php +END +finishedCourses.php +K 25 +svn:wc:ra_dav:version-url +V 80 +/courses/cs49901-trac/svn/!svn/ver/2261/S2013/Web/instructor/finishedCourses.php +END +addStudent.php +K 25 +svn:wc:ra_dav:version-url +V 75 +/courses/cs49901-trac/svn/!svn/ver/2261/S2013/Web/instructor/addStudent.php +END +testcourse.php +K 25 +svn:wc:ra_dav:version-url +V 75 +/courses/cs49901-trac/svn/!svn/ver/1929/S2013/Web/instructor/testcourse.php +END +courselog.php +K 25 +svn:wc:ra_dav:version-url +V 74 +/courses/cs49901-trac/svn/!svn/ver/1929/S2013/Web/instructor/courselog.php +END +grades.php +K 25 +svn:wc:ra_dav:version-url +V 71 +/courses/cs49901-trac/svn/!svn/ver/2107/S2013/Web/instructor/grades.php +END +studentAdded.php +K 25 +svn:wc:ra_dav:version-url +V 77 +/courses/cs49901-trac/svn/!svn/ver/2252/S2013/Web/instructor/studentAdded.php +END +addCourse.php +K 25 +svn:wc:ra_dav:version-url +V 74 +/courses/cs49901-trac/svn/!svn/ver/2261/S2013/Web/instructor/addCourse.php +END +courseadmin.php +K 25 +svn:wc:ra_dav:version-url +V 76 +/courses/cs49901-trac/svn/!svn/ver/2242/S2013/Web/instructor/courseadmin.php +END +deleteStudent.php +K 25 +svn:wc:ra_dav:version-url +V 78 +/courses/cs49901-trac/svn/!svn/ver/1929/S2013/Web/instructor/deleteStudent.php +END +reopenCourse.php +K 25 +svn:wc:ra_dav:version-url +V 77 +/courses/cs49901-trac/svn/!svn/ver/2247/S2013/Web/instructor/reopenCourse.php +END +list_of_assignments.php +K 25 +svn:wc:ra_dav:version-url +V 84 +/courses/cs49901-trac/svn/!svn/ver/2171/S2013/Web/instructor/list_of_assignments.php +END +courseAdded.php +K 25 +svn:wc:ra_dav:version-url +V 76 +/courses/cs49901-trac/svn/!svn/ver/2127/S2013/Web/instructor/courseAdded.php +END +acourses.php +K 25 +svn:wc:ra_dav:version-url +V 73 +/courses/cs49901-trac/svn/!svn/ver/2261/S2013/Web/instructor/acourses.php +END +closeCourse.php +K 25 +svn:wc:ra_dav:version-url +V 76 +/courses/cs49901-trac/svn/!svn/ver/2261/S2013/Web/instructor/closeCourse.php +END +list_of_students.php +K 25 +svn:wc:ra_dav:version-url +V 81 +/courses/cs49901-trac/svn/!svn/ver/2270/S2013/Web/instructor/list_of_students.php +END diff --git a/instructor/.svn/entries b/instructor/.svn/entries new file mode 100644 index 0000000..c1b307c --- /dev/null +++ b/instructor/.svn/entries @@ -0,0 +1,606 @@ +10 + +dir +2270 +http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/instructor +http://classes.cs.kent.edu/courses/cs49901-trac/svn + + + +2013-05-01T19:33:38.101592Z +2270 +oasikogl + + + + + + + + + + + + + + +6b56fd01-43f3-4ec1-838e-340f7da2cd71 + +sendNotif.php +file +2271 + + + +2013-05-01T21:11:46.000000Z +332051ccdd1ec4c883c92b09c4c2c9fd +2013-05-01T21:13:54.634079Z +2271 +aalmahai + + + + + + + + + + + + + + + + + + + + + +2036 + +create_assignment.php +file + + + + +2013-05-01T21:08:44.000000Z +298dd2045884b031075575406e9ca07f +2013-04-24T23:45:03.671600Z +2231 +pedwards + + + + + + + + + + + + + + + + + + + + + +4119 + +finishedCourses.php +file + + + + +2013-05-01T21:08:44.000000Z +bbf3e734843413e5cf292339f519133c +2013-04-30T07:01:15.828385Z +2261 +aalmahai + + + + + + + + + + + + + + + + + + + + + +1450 + +addStudent.php +file + + + + +2013-05-01T21:08:44.000000Z +d372424c3a037965c835b4b4616c3871 +2013-04-30T07:01:15.828385Z +2261 +aalmahai + + + + + + + + + + + + + + + + + + + + + +1623 + +testcourse.php +file + + + + +2013-05-01T21:08:44.000000Z +edd7ecd3e1c5254af44e1534b8cdcb91 +2013-03-08T04:30:08.885564Z +1929 +pedwards + + + + + + + + + + + + + + + + + + + + + +210 + +courselog.php +file + + + + +2013-05-01T21:08:44.000000Z +829fab913c70b8306d484bfe0b92bbe0 +2013-03-08T04:30:08.885564Z +1929 +pedwards + + + + + + + + + + + + + + + + + + + + + +212 + +grades.php +file + + + + +2013-05-01T21:08:44.000000Z +959a861a0e56efbf53d2fe16d447bff2 +2013-04-09T22:28:40.327793Z +2107 +rqureshi + + + + + + + + + + + + + + + + + + + + + +1808 + +studentAdded.php +file + + + + +2013-05-01T21:08:44.000000Z +d95982ab86c5a55eaed4585d759aad6a +2013-04-26T17:56:47.787723Z +2252 +oasikogl + + + + + + + + + + + + + + + + + + + + + +789 + +addCourse.php +file + + + + +2013-05-01T21:08:44.000000Z +f9ef111d4b36841e1fcf5fcaec59ce08 +2013-04-30T07:01:15.828385Z +2261 +aalmahai + + + + + + + + + + + + + + + + + + + + + +1591 + +courseadmin.php +file + + + + +2013-05-01T21:08:44.000000Z +38c09e7b0d5d3e1f63692ecd02af24a7 +2013-04-26T16:30:36.966510Z +2242 +oasikogl + + + + + + + + + + + + + + + + + + + + + +394 + +deleteStudent.php +file + + + + +2013-05-01T21:08:44.000000Z +f6026d84db3503fa07ba297fd0ec88e3 +2013-03-08T04:30:08.885564Z +1929 +pedwards + + + + + + + + + + + + + + + + + + + + + +211 + +reopenCourse.php +file + + + + +2013-05-01T21:08:44.000000Z +fc9eb9bc6a8789bf7a13f9d1ffa9afd5 +2013-04-26T16:47:30.777343Z +2247 +oasikogl + + + + + + + + + + + + + + + + + + + + + +1938 + +list_of_assignments.php +file + + + + +2013-05-01T21:08:44.000000Z +d786f288ca50af54fed8eff826483a6f +2013-04-17T19:39:21.130518Z +2171 +ckerstin + + + + + + + + + + + + + + + + + + + + + +3691 + +courseAdded.php +file + + + + +2013-05-01T21:08:44.000000Z +bf5500a12a79ec17162ecf0f397a79ea +2013-04-10T19:29:14.642199Z +2127 +oasikogl + + + + + + + + + + + + + + + + + + + + + +1085 + +acourses.php +file + + + + +2013-05-01T21:08:44.000000Z +953d7c2865f08b35df851421a90cd97d +2013-04-30T07:01:15.828385Z +2261 +aalmahai + + + + + + + + + + + + + + + + + + + + + +1484 + +closeCourse.php +file + + + + +2013-05-01T21:08:44.000000Z +f808bad6b924e57d2d36cf1266a5e0af +2013-04-30T07:01:15.828385Z +2261 +aalmahai + + + + + + + + + + + + + + + + + + + + + +1945 + +list_of_students.php +file + + + + +2013-05-01T21:08:44.000000Z +cf6af040048dae5276a21d51973712c2 +2013-05-01T19:33:38.101592Z +2270 +oasikogl + + + + + + + + + + + + + + + + + + + + + +3058 + diff --git a/instructor/.svn/text-base/acourses.php.svn-base b/instructor/.svn/text-base/acourses.php.svn-base new file mode 100644 index 0000000..aca52e9 --- /dev/null +++ b/instructor/.svn/text-base/acourses.php.svn-base @@ -0,0 +1,38 @@ + + +

Current Courses:


+ + + + + +
+ + + +
+ \ No newline at end of file diff --git a/instructor/.svn/text-base/addCourse.php.svn-base b/instructor/.svn/text-base/addCourse.php.svn-base new file mode 100644 index 0000000..ec78e61 --- /dev/null +++ b/instructor/.svn/text-base/addCourse.php.svn-base @@ -0,0 +1,60 @@ + + + + +
+ +

Add a Course(s):


+ +
+
    +
  • + +
    + +
    + +
  • + +
    + +
    +
  • + + +
  • + +
    + +
    + +
  • + +
  • + +
    + +
    + +
  • + +
    +
  • + + +
  • +
    +
+
+
+ diff --git a/instructor/.svn/text-base/addStudent.php.svn-base b/instructor/.svn/text-base/addStudent.php.svn-base new file mode 100644 index 0000000..8f2f536 --- /dev/null +++ b/instructor/.svn/text-base/addStudent.php.svn-base @@ -0,0 +1,55 @@ + + +
+ +
+ + +

Add a Student(s)


+ +
    + +
  • + +
    + +
    + +
    + +
    +
  • + +
  • + +
    + +
    +
  • + +
  • + +
    + +
    +
  • + + +
  • + + +
  • +
+
+
+ \ No newline at end of file diff --git a/instructor/.svn/text-base/closeCourse.php.svn-base b/instructor/.svn/text-base/closeCourse.php.svn-base new file mode 100644 index 0000000..237c99c --- /dev/null +++ b/instructor/.svn/text-base/closeCourse.php.svn-base @@ -0,0 +1,65 @@ + + +

Close a Course(s):


+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
#Class NameCRNStart DateEnd Date
+
+
+ \ No newline at end of file diff --git a/instructor/.svn/text-base/courseAdded.php.svn-base b/instructor/.svn/text-base/courseAdded.php.svn-base new file mode 100644 index 0000000..dee4ac2 --- /dev/null +++ b/instructor/.svn/text-base/courseAdded.php.svn-base @@ -0,0 +1,44 @@ + + + + + diff --git a/instructor/.svn/text-base/courseadmin.php.svn-base b/instructor/.svn/text-base/courseadmin.php.svn-base new file mode 100644 index 0000000..5d59b6a --- /dev/null +++ b/instructor/.svn/text-base/courseadmin.php.svn-base @@ -0,0 +1,13 @@ + Add Course +

Copy Course

+

Close Course

+

Reopen Course

+ "; + + include("../shared_php/footer.php"); +?> diff --git a/instructor/.svn/text-base/courselog.php.svn-base b/instructor/.svn/text-base/courselog.php.svn-base new file mode 100644 index 0000000..1574912 --- /dev/null +++ b/instructor/.svn/text-base/courselog.php.svn-base @@ -0,0 +1,8 @@ +This is where course added, deactivated or deleted

"; + +include("../shared_php/footer.php"); +?> \ No newline at end of file diff --git a/instructor/.svn/text-base/create_assignment.php.svn-base b/instructor/.svn/text-base/create_assignment.php.svn-base new file mode 100644 index 0000000..c6f62c5 --- /dev/null +++ b/instructor/.svn/text-base/create_assignment.php.svn-base @@ -0,0 +1,91 @@ + + + + + + + + Account + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Assignment Name +
Due Date
+ Instructions +
Code
Attempts
Assignment Type
+
+
+ + + diff --git a/instructor/.svn/text-base/deleteStudent.php.svn-base b/instructor/.svn/text-base/deleteStudent.php.svn-base new file mode 100644 index 0000000..b0048d7 --- /dev/null +++ b/instructor/.svn/text-base/deleteStudent.php.svn-base @@ -0,0 +1,8 @@ + diff --git a/instructor/.svn/text-base/finishedCourses.php.svn-base b/instructor/.svn/text-base/finishedCourses.php.svn-base new file mode 100644 index 0000000..6beaaa5 --- /dev/null +++ b/instructor/.svn/text-base/finishedCourses.php.svn-base @@ -0,0 +1,39 @@ + + +

Past Courses:


+ + + + + + +
+ + + +
+ \ No newline at end of file diff --git a/instructor/.svn/text-base/grades.php.svn-base b/instructor/.svn/text-base/grades.php.svn-base new file mode 100644 index 0000000..99b48d7 --- /dev/null +++ b/instructor/.svn/text-base/grades.php.svn-base @@ -0,0 +1,64 @@ + + + + + + + +Account + + + + + + + + + + + +
Student :  
+ + + + + + + + 0) + { + + while ($row = mysql_fetch_assoc($result)) + { + ?> + + + + + + + + + + + +
Assignment Name No of Attempts No of Successes Success in Row
No Student found
+ + diff --git a/instructor/.svn/text-base/list_of_assignments.php.svn-base b/instructor/.svn/text-base/list_of_assignments.php.svn-base new file mode 100644 index 0000000..f82d09f --- /dev/null +++ b/instructor/.svn/text-base/list_of_assignments.php.svn-base @@ -0,0 +1,117 @@ + + + + + + + + +Account + + + + + + + + + + Course :
+ Create New Assignment + + + + + + + + + + + + 0) + { + + while ($row = mysql_fetch_assoc($result)) + { + ?> + + + + + + + + + + + + + + + +
Assignment IDAssignment NameAssignment Due DateAssignment InstructionsAssignment ClassAssignment TypeMaximum AttemptsDownload File
No Assignment found
+ + + + diff --git a/instructor/.svn/text-base/list_of_students.php.svn-base b/instructor/.svn/text-base/list_of_students.php.svn-base new file mode 100644 index 0000000..41c6955 --- /dev/null +++ b/instructor/.svn/text-base/list_of_students.php.svn-base @@ -0,0 +1,107 @@ + + + + + + + +Account + + + + + + + + + + + + + + + + + + +
Course :
New StudentDelete Student
+
+ + +
+ + +
+ + + + + + + + + + 0) + { + + while ($row = mysql_fetch_assoc($result)) + { + ?> + + + + + + + + + + + + + +
Member IDFirst NameLast NameMember EmailMember Banner
+ Grades" + ?> +
No Student found
+ + diff --git a/instructor/.svn/text-base/reopenCourse.php.svn-base b/instructor/.svn/text-base/reopenCourse.php.svn-base new file mode 100644 index 0000000..dc263d2 --- /dev/null +++ b/instructor/.svn/text-base/reopenCourse.php.svn-base @@ -0,0 +1,68 @@ + + +

Reopen Courses

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Class NameCRNStart DateEnd Date
+
+
+ \ No newline at end of file diff --git a/instructor/.svn/text-base/sendNotif.php.svn-base b/instructor/.svn/text-base/sendNotif.php.svn-base new file mode 100644 index 0000000..51e7713 --- /dev/null +++ b/instructor/.svn/text-base/sendNotif.php.svn-base @@ -0,0 +1,104 @@ + +
+
+
+ +

Send Notification


+
+ +
    + +
  • +
    +
    + +
    +
  • +
    + +
  • +
    +
    + " . $row['ClassName'] . ""; + + + + + } + + +$menu=" + + + + "; + echo $menu; + + + ?> + + +
    +
    +
    +
    + +
    +
  • + + +
  • + + + +
  • +
+ + + + +
+ + diff --git a/instructor/.svn/text-base/studentAdded.php.svn-base b/instructor/.svn/text-base/studentAdded.php.svn-base new file mode 100644 index 0000000..d5620b9 --- /dev/null +++ b/instructor/.svn/text-base/studentAdded.php.svn-base @@ -0,0 +1,31 @@ +Input data is failed"); + } + } + + include("../shared_php/footer.php"); +?> diff --git a/instructor/.svn/text-base/testcourse.php.svn-base b/instructor/.svn/text-base/testcourse.php.svn-base new file mode 100644 index 0000000..34b0837 --- /dev/null +++ b/instructor/.svn/text-base/testcourse.php.svn-base @@ -0,0 +1,8 @@ + +

Course that is requested with student names

+ diff --git a/instructor/.svn/tmp/svn-seGQgt b/instructor/.svn/tmp/svn-seGQgt new file mode 100644 index 0000000..e69de29 diff --git a/instructor/acourses.php b/instructor/acourses.php new file mode 100644 index 0000000..aca52e9 --- /dev/null +++ b/instructor/acourses.php @@ -0,0 +1,38 @@ + + +

Current Courses:


+ + + + + +
+ + + +
+ \ No newline at end of file diff --git a/instructor/addCourse.php b/instructor/addCourse.php new file mode 100644 index 0000000..ec78e61 --- /dev/null +++ b/instructor/addCourse.php @@ -0,0 +1,60 @@ + + + + +
+ +

Add a Course(s):


+ +
+
    +
  • + +
    + +
    + +
  • + +
    + +
    +
  • + + +
  • + +
    + +
    + +
  • + +
  • + +
    + +
    + +
  • + +
    +
  • + + +
  • +
    +
+
+
+ diff --git a/instructor/addStudent.php b/instructor/addStudent.php new file mode 100644 index 0000000..8f2f536 --- /dev/null +++ b/instructor/addStudent.php @@ -0,0 +1,55 @@ + + +
+ +
+ + +

Add a Student(s)


+ +
    + +
  • + +
    + +
    + +
    + +
    +
  • + +
  • + +
    + +
    +
  • + +
  • + +
    + +
    +
  • + + +
  • + + +
  • +
+
+
+ \ No newline at end of file diff --git a/instructor/closeCourse.php b/instructor/closeCourse.php new file mode 100644 index 0000000..237c99c --- /dev/null +++ b/instructor/closeCourse.php @@ -0,0 +1,65 @@ + + +

Close a Course(s):


+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
#Class NameCRNStart DateEnd Date
+
+
+ \ No newline at end of file diff --git a/instructor/courseAdded.php b/instructor/courseAdded.php new file mode 100644 index 0000000..dee4ac2 --- /dev/null +++ b/instructor/courseAdded.php @@ -0,0 +1,44 @@ + + + + + diff --git a/instructor/courseadmin.php b/instructor/courseadmin.php new file mode 100644 index 0000000..5d59b6a --- /dev/null +++ b/instructor/courseadmin.php @@ -0,0 +1,13 @@ + Add Course +

Copy Course

+

Close Course

+

Reopen Course

+ "; + + include("../shared_php/footer.php"); +?> diff --git a/instructor/courselog.php b/instructor/courselog.php new file mode 100644 index 0000000..1574912 --- /dev/null +++ b/instructor/courselog.php @@ -0,0 +1,8 @@ +This is where course added, deactivated or deleted

"; + +include("../shared_php/footer.php"); +?> \ No newline at end of file diff --git a/instructor/create_assignment.php b/instructor/create_assignment.php new file mode 100644 index 0000000..c6f62c5 --- /dev/null +++ b/instructor/create_assignment.php @@ -0,0 +1,91 @@ + + + + + + + + Account + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Assignment Name +
Due Date
+ Instructions +
Code
Attempts
Assignment Type
+
+
+ + + diff --git a/instructor/deleteStudent.php b/instructor/deleteStudent.php new file mode 100644 index 0000000..b0048d7 --- /dev/null +++ b/instructor/deleteStudent.php @@ -0,0 +1,8 @@ + diff --git a/instructor/finishedCourses.php b/instructor/finishedCourses.php new file mode 100644 index 0000000..6beaaa5 --- /dev/null +++ b/instructor/finishedCourses.php @@ -0,0 +1,39 @@ + + +

Past Courses:


+ + + + + + +
+ + + +
+ \ No newline at end of file diff --git a/instructor/grades.php b/instructor/grades.php new file mode 100644 index 0000000..99b48d7 --- /dev/null +++ b/instructor/grades.php @@ -0,0 +1,64 @@ + + + + + + + +Account + + + + + + + + + + + +
Student :  
+ + + + + + + + 0) + { + + while ($row = mysql_fetch_assoc($result)) + { + ?> + + + + + + + + + + + +
Assignment Name No of Attempts No of Successes Success in Row
No Student found
+ + diff --git a/instructor/list_of_assignments.php b/instructor/list_of_assignments.php new file mode 100644 index 0000000..f82d09f --- /dev/null +++ b/instructor/list_of_assignments.php @@ -0,0 +1,117 @@ + + + + + + + + +Account + + + + + + + + + + Course :
+ Create New Assignment + + + + + + + + + + + + 0) + { + + while ($row = mysql_fetch_assoc($result)) + { + ?> + + + + + + + + + + + + + + + +
Assignment IDAssignment NameAssignment Due DateAssignment InstructionsAssignment ClassAssignment TypeMaximum AttemptsDownload File
No Assignment found
+ + + + diff --git a/instructor/list_of_students.php b/instructor/list_of_students.php new file mode 100644 index 0000000..41c6955 --- /dev/null +++ b/instructor/list_of_students.php @@ -0,0 +1,107 @@ + + + + + + + +Account + + + + + + + + + + + + + + + + + + +
Course :
New StudentDelete Student
+
+ + +
+ + +
+ + + + + + + + + + 0) + { + + while ($row = mysql_fetch_assoc($result)) + { + ?> + + + + + + + + + + + + + +
Member IDFirst NameLast NameMember EmailMember Banner
+ Grades" + ?> +
No Student found
+ + diff --git a/instructor/reopenCourse.php b/instructor/reopenCourse.php new file mode 100644 index 0000000..dc263d2 --- /dev/null +++ b/instructor/reopenCourse.php @@ -0,0 +1,68 @@ + + +

Reopen Courses

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Class NameCRNStart DateEnd Date
+
+
+ \ No newline at end of file diff --git a/instructor/sendNotif.php b/instructor/sendNotif.php new file mode 100644 index 0000000..51e7713 --- /dev/null +++ b/instructor/sendNotif.php @@ -0,0 +1,104 @@ + +
+
+
+ +

Send Notification


+
+ +
    + +
  • +
    +
    + +
    +
  • +
    + +
  • +
    +
    + " . $row['ClassName'] . ""; + + + + + } + + +$menu=" + + + + "; + echo $menu; + + + ?> + + +
    +
    +
    +
    + +
    +
  • + + +
  • + + + +
  • +
+ + + + +
+ + diff --git a/instructor/studentAdded.php b/instructor/studentAdded.php new file mode 100644 index 0000000..d5620b9 --- /dev/null +++ b/instructor/studentAdded.php @@ -0,0 +1,31 @@ +Input data is failed"); + } + } + + include("../shared_php/footer.php"); +?> diff --git a/instructor/testcourse.php b/instructor/testcourse.php new file mode 100644 index 0000000..34b0837 --- /dev/null +++ b/instructor/testcourse.php @@ -0,0 +1,8 @@ + +

Course that is requested with student names

+ diff --git a/interface.c b/interface.c new file mode 100644 index 0000000..d99d5db --- /dev/null +++ b/interface.c @@ -0,0 +1,206 @@ +#include +#include /* for mkfifo */ +#include /* for open */ +#include /* for open */ +#include /* for open */ +#include /* for write */ +#include +#include +#include +#define BUFFSIZE 8192 +#define MaxPipeName 100 +#define logdir "/home/ruttan/classes/capstone/debugger/" +#define numDbgArgs 5 +#define ArgSize 30 + +pid_t child_pid; +char buf[BUFFSIZE]; +FILE * fdtoFILE; + +void catch_sigpipe(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGPIPE, catch_sigpipe); + fprintf(fdtoFILE,"got a signal\n"); + fflush(fdtoFILE); +} +void catch_sigint(int sig_num) +{ + /* re-set the signal handler again to catch_int, for next time */ + signal(SIGINT, catch_sigint); + kill(child_pid,1); + fprintf(fdtoFILE,"got a sigint signal\n"); + fflush(fdtoFILE); + sleep(1); + exit(1); +} + +pid_t launch_debugger(char * argv[],int pipefd[2]){ + int stdio[3]; + pid_t child_pid; + int pipefd0[2],pipefd1[2]; + pipe(pipefd0); + if(pipe(pipefd0) == -1) { + perror("Pipe 0 creation failed"); + exit(1); + } + pipe(pipefd1); + if(pipe(pipefd1) == -1) { + perror("Pipe 1 creation failed"); + exit(1); + } + //create function to setup pipes fork and exec + pipefd[0]=pipefd0[0]; + pipefd[1]=pipefd1[1]; + stdio[0]=dup(STDIN_FILENO); + stdio[1]=dup(STDOUT_FILENO); + stdio[2]=dup(STDERR_FILENO); + dup2(pipefd1[0],STDIN_FILENO); + dup2(pipefd0[1],STDOUT_FILENO); + dup2(pipefd0[1],STDERR_FILENO); + switch (child_pid=fork()){ + case -1: + perror("Could not fork debugger"); + exit(1); + break; + case 0: + if (execvp(argv[0],argv)==-1){ + perror("exec failed"); + exit(1); + } + default: + //after fork in parent. + dup2(stdio[0],STDIN_FILENO); + dup2(stdio[1],STDOUT_FILENO); + dup2(stdio[2],STDERR_FILENO); + close(pipefd1[0]); + close(pipefd0[1]); + } + return(child_pid); +} + +void make_args(char * id,char * argv[]){ + argv[0]="/usr/bin/python"; //flag needed for python debugger + argv[1]="-i"; + argv[2]="-c"; + argv[3]="\"print 'Starting'\""; + argv[4]=0; +} + +int main (int argc, char ** argv) { + int n; + char * nargv[numDbgArgs]; + int fdtoWeb,fdfrmWeb,fdtoDbg,fdfrmDgb,pipefd[2]; + char line[BUFFSIZE],toServer[MaxPipeName],fromServer[MaxPipeName]; + sprintf(buf,"%s%s%s",logdir,"FILE",argv[1]); + unlink(buf); + fdtoFILE=fopen(buf,"w"); + fprintf(fdtoFILE,"testing file output\n"); + + signal(SIGPIPE, catch_sigpipe); + signal(SIGINT, catch_sigint); + if ((argc < 2 )|| (argc >=3)){ + perror("usage: debugger idcode"); + exit(1); + } + //create input pipe from webserver + sprintf(fromServer,"%s%s%s",logdir,"OUT",argv[1]); + unlink(fromServer); + + if (-1 == mkfifo(fromServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + + //create output pipe to webserver + sprintf(toServer,"%s%s%s",logdir,"IN",argv[1]); + unlink(toServer); + + if (-1 == mkfifo(toServer,S_IRWXU)) { + perror("Error, could not make fifo\n"); + } + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + //create pipes to debugger + + if(pipe(pipefd) == -1) { //perhaps pipe(pipefd,O_NONBLOCK) + perror("Pipe 1 creation failed"); + exit(1); + } + + int i; + char c; + make_args(argv[1],nargv); + child_pid=launch_debugger(nargv,pipefd); + fprintf(fdtoFILE,"child_pid=%d\n",child_pid); + fflush(fdtoFILE); + setpgid(0, 0); + fprintf(fdtoFILE,"---starting---\n"); + fflush(fdtoFILE); + + + while(1){ + line[0]=0; + while (!strstr(line,">>>") && !strstr(line,"...")){ + if ((n=read(pipefd[0],line,BUFFSIZE))){ + if (!n) { + fprintf(fdtoFILE,"pipe fd[0] closed"); + fflush(fdtoFILE); + exit(1); + } + //line[n++]='@'; + line[n]=0; + //if n=BUFFSIZE... + } + fprintf(fdtoFILE,"p-%s",line); + fflush(fdtoFILE); + if (write(fdtoWeb,line,n) != n) { + perror("fdtoWeb write error"); + fprintf(fdtoFILE,"fdtoWeb write error\n"); + fflush(fdtoFILE); + + } + + } + + if ((n=read(fdfrmWeb,line,BUFFSIZE))){ + line[n]=0; + fprintf(fdtoFILE,"%d-%s%s",n,"w-",line); + fflush(fdtoFILE); + if (write(pipefd[1],line,n) != n) { + perror("pipefd[1] write error"); + } + + } + else{ + printf("empty read\n"); + close(fdtoWeb); + close(fdfrmWeb); + n=0; + if ((fdfrmWeb = open(fromServer,O_RDONLY)) == -1) { + perror("cannot open fifo from server"); + exit(1); + } + + if ((fdtoWeb = open(toServer,O_WRONLY)) == -1) { + perror("cannot open fifo to server"); + exit(1); + } + line[0]='\n'; + if (write(pipefd[1],line,1) != 1) { + perror("pipefd[1] write error"); + } + + } + + } + + exit(0); +} + + diff --git a/js/.svn/all-wcprops b/js/.svn/all-wcprops new file mode 100644 index 0000000..8dd6358 --- /dev/null +++ b/js/.svn/all-wcprops @@ -0,0 +1,65 @@ +K 25 +svn:wc:ra_dav:version-url +V 52 +/courses/cs49901-trac/svn/!svn/ver/2241/S2013/Web/js +END +debugger.js +K 25 +svn:wc:ra_dav:version-url +V 64 +/courses/cs49901-trac/svn/!svn/ver/2241/S2013/Web/js/debugger.js +END +animatedcollapse.js +K 25 +svn:wc:ra_dav:version-url +V 72 +/courses/cs49901-trac/svn/!svn/ver/2162/S2013/Web/js/animatedcollapse.js +END +codemirror.js +K 25 +svn:wc:ra_dav:version-url +V 66 +/courses/cs49901-trac/svn/!svn/ver/2191/S2013/Web/js/codemirror.js +END +jquery-1.9.1.min.js +K 25 +svn:wc:ra_dav:version-url +V 72 +/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/js/jquery-1.9.1.min.js +END +clike.js +K 25 +svn:wc:ra_dav:version-url +V 61 +/courses/cs49901-trac/svn/!svn/ver/2191/S2013/Web/js/clike.js +END +jquery-ui.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/courses/cs49901-trac/svn/!svn/ver/2053/S2013/Web/js/jquery-ui.js +END +datepicker.js +K 25 +svn:wc:ra_dav:version-url +V 66 +/courses/cs49901-trac/svn/!svn/ver/2095/S2013/Web/js/datepicker.js +END +createAssignment.js +K 25 +svn:wc:ra_dav:version-url +V 72 +/courses/cs49901-trac/svn/!svn/ver/2231/S2013/Web/js/createAssignment.js +END +python.js +K 25 +svn:wc:ra_dav:version-url +V 62 +/courses/cs49901-trac/svn/!svn/ver/2191/S2013/Web/js/python.js +END +myAccount.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/courses/cs49901-trac/svn/!svn/ver/1975/S2013/Web/js/myAccount.js +END diff --git a/js/.svn/entries b/js/.svn/entries new file mode 100644 index 0000000..8a118a7 --- /dev/null +++ b/js/.svn/entries @@ -0,0 +1,368 @@ +10 + +dir +2270 +http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/js +http://classes.cs.kent.edu/courses/cs49901-trac/svn + + + +2013-04-26T16:22:13.377706Z +2241 +talrefai + + + + + + + + + + + + + + +6b56fd01-43f3-4ec1-838e-340f7da2cd71 + +debugger.js +file + + + + +2013-05-01T21:08:44.000000Z +54376a52ad687aa21ca4a74cb1798ae7 +2013-04-26T16:22:13.377706Z +2241 +talrefai + + + + + + + + + + + + + + + + + + + + + +3330 + +animatedcollapse.js +file + + + + +2013-05-01T21:08:44.000000Z +d6e790c65844a878603e905767bbe538 +2013-04-17T19:03:46.786086Z +2162 +ckerstin + + + + + + + + + + + + + + + + + + + + + +14154 + +codemirror.js +file + + + + +2013-05-01T21:08:44.000000Z +a4e03de19c7251d1a9d135717d1f1698 +2013-04-19T21:58:52.002500Z +2191 +talrefai +has-props + + + + + + + + + + + + + + + + + + + + +214374 + +jquery-1.9.1.min.js +file + + + + +2013-05-01T21:08:44.000000Z +397754ba49e9e0cf4e7c190da78dda05 +2013-03-08T04:08:12.118316Z +1926 +pedwards + + + + + + + + + + + + + + + + + + + + + +92629 + +clike.js +file + + + + +2013-05-01T21:08:44.000000Z +b943a343f18ba25143fc608785dd4eb2 +2013-04-19T21:58:52.002500Z +2191 +talrefai +has-props + + + + + + + + + + + + + + + + + + + + +11397 + +jquery-ui.js +file + + + + +2013-05-01T21:08:44.000000Z +f482386c3a5a5e774e74526881801dc1 +2013-04-03T19:06:42.613570Z +2053 +oasikogl + + + + + + + + + + + + + + + + + + + + + +451107 + +datepicker.js +file + + + + +2013-05-01T21:08:44.000000Z +581b674c21dac543e074d6a91667ab62 +2013-04-05T17:37:32.238546Z +2095 +oasikogl + + + + + + + + + + + + + + + + + + + + + +212 + +createAssignment.js +file + + + + +2013-05-01T21:08:44.000000Z +9304876910ce0fe69cf8b1acf5e6dee0 +2013-04-24T23:45:03.671600Z +2231 +pedwards + + + + + + + + + + + + + + + + + + + + + +1174 + +python.js +file + + + + +2013-05-01T21:08:44.000000Z +ac647898d7daf63bf2c34527ef8a25b6 +2013-04-19T21:58:52.002500Z +2191 +talrefai +has-props + + + + + + + + + + + + + + + + + + + + +12410 + +myAccount.js +file + + + + +2013-05-01T21:08:44.000000Z +9991fadca17128a2edaab727745606f4 +2013-03-15T00:52:40.945046Z +1975 +pedwards + + + + + + + + + + + + + + + + + + + + + +15611 + diff --git a/js/.svn/prop-base/clike.js.svn-base b/js/.svn/prop-base/clike.js.svn-base new file mode 100644 index 0000000..03b5bfa --- /dev/null +++ b/js/.svn/prop-base/clike.js.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 14 +svn:executable +V 1 +* +END diff --git a/js/.svn/prop-base/codemirror.js.svn-base b/js/.svn/prop-base/codemirror.js.svn-base new file mode 100644 index 0000000..03b5bfa --- /dev/null +++ b/js/.svn/prop-base/codemirror.js.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 14 +svn:executable +V 1 +* +END diff --git a/js/.svn/prop-base/python.js.svn-base b/js/.svn/prop-base/python.js.svn-base new file mode 100644 index 0000000..03b5bfa --- /dev/null +++ b/js/.svn/prop-base/python.js.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 14 +svn:executable +V 1 +* +END diff --git a/js/.svn/text-base/animatedcollapse.js.svn-base b/js/.svn/text-base/animatedcollapse.js.svn-base new file mode 100644 index 0000000..fff367a --- /dev/null +++ b/js/.svn/text-base/animatedcollapse.js.svn-base @@ -0,0 +1,218 @@ +//** Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com. +//** May 24th, 08'- Script rewritten and updated to 2.0. +//** June 4th, 08'- Version 2.01: Bug fix to work with jquery 1.2.6 (which changed the way attr() behaves). +//** March 5th, 09'- Version 2.2, which adds the following: +//1) ontoggle($, divobj, state) event that fires each time a DIV is expanded/collapsed, including when the page 1st loads +//2) Ability to expand a DIV via a URL parameter string, ie: index.htm?expanddiv=jason or index.htm?expanddiv=jason,kelly + +//** March 9th, 09'- Version 2.2.1: Optimized ontoggle event handler slightly. +//** July 3rd, 09'- Version 2.4, which adds the following: +//1) You can now insert rel="expand[divid] | collapse[divid] | toggle[divid]" inside arbitrary links to act as DIV togglers +//2) For image toggler links, you can insert the attributes "data-openimage" and "data-closedimage" to update its image based on the DIV state +function LoadListOfStudents(courseID) +{ + document.getElementById("myFrame").src = "../instructor/list_of_students.php?ClassId="+courseID; +} +function LoadListOfAssignments(courseID) +{ + document.getElementById("myFrame").src = "../instructor/list_of_assignments.php?AssignmentClass="+courseID; +} + +var animatedcollapse = { + divholders: {}, //structure: {div.id, div.attrs, div.$divref, div.$togglerimage} + divgroups: {}, //structure: {groupname.count, groupname.lastactivedivid} + lastactiveingroup: {}, //structure: {lastactivediv.id} + preloadimages: [], + show: function(divids) { //public method + if (typeof divids == "object") { + for (var i = 0; i < divids.length; i++) + this.showhide(divids[i], "show"); + } + else + this.showhide(divids, "show") + }, + hide: function(divids) { //public method + if (typeof divids == "object") { + for (var i = 0; i < divids.length; i++) + this.showhide(divids[i], "hide"); + } + else + this.showhide(divids, "hide") + }, + toggle: function(divid) { //public method + if (typeof divid == "object") + divid = divid[0]; + this.showhide(divid, "toggle"); + }, + addDiv: function(divid, attrstring) { //public function + this.divholders[divid] = ({id: divid, $divref: null, attrs: attrstring}); + this.divholders[divid].getAttr = function(name) { //assign getAttr() function to each divholder object + var attr = new RegExp(name + "=([^,]+)", "i"); //get name/value config pair (ie: width=400px,) + return (attr.test(this.attrs) && parseInt(RegExp.$1) != 0) ? RegExp.$1 : null; //return value portion (string), or 0 (false) if none found + }; + this.currentid = divid; //keep track of current div object being manipulated (in the event of chaining) + return this; + }, + showhide: function(divid, action) { + var $divref = this.divholders[divid].$divref; //reference collapsible DIV + if (this.divholders[divid] && $divref.length == 1) { //if DIV exists + var targetgroup = this.divgroups[$divref.attr('groupname')]; //find out which group DIV belongs to (if any) + if ($divref.attr('groupname') && targetgroup.count > 1 && (action == "show" || action == "toggle" && $divref.css('display') == 'none')) { //If current DIV belongs to a group + if (targetgroup.lastactivedivid && targetgroup.lastactivedivid != divid) //if last active DIV is set + this.slideengine(targetgroup.lastactivedivid, 'hide'); //hide last active DIV within group first + this.slideengine(divid, 'show'); + targetgroup.lastactivedivid = divid; //remember last active DIV + } + else { + this.slideengine(divid, action); + } + } + }, + slideengine: function(divid, action) { + var $divref = this.divholders[divid].$divref + var $togglerimage = this.divholders[divid].$togglerimage + if (this.divholders[divid] && $divref.length == 1) { //if this DIV exists + var animateSetting = {height: action} + if ($divref.attr('fade')) + animateSetting.opacity = action + $divref.animate(animateSetting, $divref.attr('speed') ? parseInt($divref.attr('speed')) : 500, function() { + if ($togglerimage) { + $togglerimage.attr('src', ($divref.css('display') == "none") ? $togglerimage.data('srcs').closed : $togglerimage.data('srcs').open) + } + if (animatedcollapse.ontoggle) { + try { + animatedcollapse.ontoggle(jQuery, $divref.get(0), $divref.css('display')) + } + catch (e) { + alert("An error exists inside your \"ontoggle\" function:\n\n" + e + "\n\nAborting execution of function.") + } + } + }) + return false + } + }, + generatemap: function() { + var map = {} + for (var i = 0; i < arguments.length; i++) { + if (arguments[i][1] != null) { //do not generate name/value pair if value is null + map[arguments[i][0]] = arguments[i][1] + } + } + return map + }, + init: function() { + var ac = this + jQuery(document).ready(function($) { + animatedcollapse.ontoggle = animatedcollapse.ontoggle || null + var urlparamopenids = animatedcollapse.urlparamselect() //Get div ids that should be expanded based on the url (['div1','div2',etc]) + var persistopenids = ac.getCookie('acopendivids') //Get list of div ids that should be expanded due to persistence ('div1,div2,etc') + var groupswithpersist = ac.getCookie('acgroupswithpersist') //Get list of group names that have 1 or more divs with "persist" attribute defined + if (persistopenids != null) //if cookie isn't null (is null if first time page loads, and cookie hasnt been set yet) + persistopenids = (persistopenids == 'nada') ? [] : persistopenids.split(',') //if no divs are persisted, set to empty array, else, array of div ids + groupswithpersist = (groupswithpersist == null || groupswithpersist == 'nada') ? [] : groupswithpersist.split(',') //Get list of groups with divs that are persisted + jQuery.each(ac.divholders, function() { //loop through each collapsible DIV object + this.$divref = $('#' + this.id) + if ((this.getAttr('persist') || jQuery.inArray(this.getAttr('group'), groupswithpersist) != -1) && persistopenids != null) { //if this div carries a user "persist" setting, or belong to a group with at least one div that does + var cssdisplay = (jQuery.inArray(this.id, persistopenids) != -1) ? 'block' : 'none' + } + else { + var cssdisplay = this.getAttr('hide') ? 'none' : null + } + if (urlparamopenids[0] == "all" || jQuery.inArray(this.id, urlparamopenids) != -1) { //if url parameter string contains the single array element "all", or this div's ID + cssdisplay = 'block' //set div to "block", overriding any other setting + } + else if (urlparamopenids[0] == "none") { + cssdisplay = 'none' //set div to "none", overriding any other setting + } + this.$divref.css(ac.generatemap(['height', this.getAttr('height')], ['display', cssdisplay])) + this.$divref.attr(ac.generatemap(['groupname', this.getAttr('group')], ['fade', this.getAttr('fade')], ['speed', this.getAttr('speed')])) + if (this.getAttr('group')) { //if this DIV has the "group" attr defined + var targetgroup = ac.divgroups[this.getAttr('group')] || (ac.divgroups[this.getAttr('group')] = {}) //Get settings for this group, or if it no settings exist yet, create blank object to store them in + targetgroup.count = (targetgroup.count || 0) + 1 //count # of DIVs within this group + if (jQuery.inArray(this.id, urlparamopenids) != -1) { //if url parameter string contains this div's ID + targetgroup.lastactivedivid = this.id //remember this DIV as the last "active" DIV (this DIV will be expanded). Overrides other settings + targetgroup.overridepersist = 1 //Indicate to override persisted div that would have been expanded + } + if (!targetgroup.lastactivedivid && this.$divref.css('display') != 'none' || cssdisplay == "block" && typeof targetgroup.overridepersist == "undefined") //if this DIV was open by default or should be open due to persistence + targetgroup.lastactivedivid = this.id //remember this DIV as the last "active" DIV (this DIV will be expanded) + this.$divref.css({display: 'none'}) //hide any DIV that's part of said group for now + } + }) //end divholders.each + jQuery.each(ac.divgroups, function() { //loop through each group + if (this.lastactivedivid && urlparamopenids[0] != "none") //show last "active" DIV within each group (one that should be expanded), unless url param="none" + ac.divholders[this.lastactivedivid].$divref.show() + }) + if (animatedcollapse.ontoggle) { + jQuery.each(ac.divholders, function() { //loop through each collapsible DIV object and fire ontoggle event + animatedcollapse.ontoggle(jQuery, this.$divref.get(0), this.$divref.css('display')) + }) + } + //Parse page for links containing rel attribute + var $allcontrols = $('a[rel]').filter('[rel^="collapse["], [rel^="expand["], [rel^="toggle["]') //get all elements on page with rel="collapse[]", "expand[]" and "toggle[]" + $allcontrols.each(function() { //loop though each control link + this._divids = this.getAttribute('rel').replace(/(^\w+)|(\s+)/g, "").replace(/[\[\]']/g, "") //cache value 'div1,div2,etc' within identifier[div1,div2,etc] + if (this.getElementsByTagName('img').length == 1 && ac.divholders[this._divids]) { //if control is an image link that toggles a single DIV (must be one to one to update status image) + animatedcollapse.preloadimage(this.getAttribute('data-openimage'), this.getAttribute('data-closedimage')) //preload control images (if defined) + $togglerimage = $(this).find('img').eq(0).data('srcs', {open: this.getAttribute('data-openimage'), closed: this.getAttribute('data-closedimage')}) //remember open and closed images' paths + ac.divholders[this._divids].$togglerimage = $(this).find('img').eq(0) //save reference to toggler image (to be updated inside slideengine() + ac.divholders[this._divids].$togglerimage.attr('src', (ac.divholders[this._divids].$divref.css('display') == "none") ? $togglerimage.data('srcs').closed : $togglerimage.data('srcs').open) + } + $(this).click(function() { //assign click behavior to each control link + var relattr = this.getAttribute('rel') + var divids = (this._divids == "") ? [] : this._divids.split(',') //convert 'div1,div2,etc' to array + if (divids.length > 0) { + animatedcollapse[/expand/i.test(relattr) ? 'show' : /collapse/i.test(relattr) ? 'hide' : 'toggle'](divids) //call corresponding public function + return false + } + }) //end control.click + })// end control.each + + $(window).bind('unload', function() { + ac.uninit() + }) + }) //end doc.ready() + }, + uninit: function() { + var opendivids = '', groupswithpersist = '' + jQuery.each(this.divholders, function() { + if (this.$divref.css('display') != 'none') { + opendivids += this.id + ',' //store ids of DIVs that are expanded when page unloads: 'div1,div2,etc' + } + if (this.getAttr('group') && this.getAttr('persist')) + groupswithpersist += this.getAttr('group') + ',' //store groups with which at least one DIV has persistance enabled: 'group1,group2,etc' + }) + opendivids = (opendivids == '') ? 'nada' : opendivids.replace(/,$/, '') + groupswithpersist = (groupswithpersist == '') ? 'nada' : groupswithpersist.replace(/,$/, '') + this.setCookie('acopendivids', opendivids) + this.setCookie('acgroupswithpersist', groupswithpersist) + }, + getCookie: function(Name) { + var re = new RegExp(Name + "=[^;]*", "i"); //construct RE to search for target name/value pair + if (document.cookie.match(re)) //if cookie found + return document.cookie.match(re)[0].split("=")[1] //return its value + return null + }, + setCookie: function(name, value, days) { + if (typeof days != "undefined") { //if set persistent cookie + var expireDate = new Date() + expireDate.setDate(expireDate.getDate() + days) + document.cookie = name + "=" + value + "; path=/; expires=" + expireDate.toGMTString() + } + else //else if this is a session only cookie + document.cookie = name + "=" + value + "; path=/" + }, + urlparamselect: function() { + window.location.search.match(/expanddiv=([\w\-_,]+)/i) //search for expanddiv=divid or divid1,divid2,etc + return (RegExp.$1 != "") ? RegExp.$1.split(",") : [] + }, + preloadimage: function() { + var preloadimages = this.preloadimages + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] && arguments[i].length > 0) { + preloadimages[preloadimages.length] = new Image() + preloadimages[preloadimages.length - 1].src = arguments[i] + } + } + } + +} \ No newline at end of file diff --git a/js/.svn/text-base/clike.js.svn-base b/js/.svn/text-base/clike.js.svn-base new file mode 100644 index 0000000..1b350ae --- /dev/null +++ b/js/.svn/text-base/clike.js.svn-base @@ -0,0 +1,302 @@ +CodeMirror.defineMode("clike", function(config, parserConfig) { + var indentUnit = config.indentUnit, + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + dontAlignCalls = parserConfig.dontAlignCalls, + keywords = parserConfig.keywords || {}, + builtin = parserConfig.builtin || {}, + blockKeywords = parserConfig.blockKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + if (builtin.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "builtin"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); + else if (dontAlignCalls && ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +(function() { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var cKeywords = "auto if break int case long char register continue return default short do sizeof " + + "double static else struct entry switch extern typedef float union for unsigned " + + "goto while enum void const signed volatile"; + + function cppHook(stream, state) { + if (!state.startOfLine) return false; + for (;;) { + if (stream.skipTo("\\")) { + stream.next(); + if (stream.eol()) { + state.tokenize = cppHook; + break; + } + } else { + stream.skipToEnd(); + state.tokenize = null; + break; + } + } + return "meta"; + } + + // C#-style strings where "" escapes a quote. + function tokenAtString(stream, state) { + var next; + while ((next = stream.next()) != null) { + if (next == '"' && !stream.eat('"')) { + state.tokenize = null; + break; + } + } + return "string"; + } + + function mimes(ms, mode) { + for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode); + } + + mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], { + name: "clike", + keywords: words(cKeywords), + blockKeywords: words("case do else for if switch while struct"), + atoms: words("null"), + hooks: {"#": cppHook} + }); + mimes(["text/x-c++src", "text/x-c++hdr"], { + name: "clike", + keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + + "static_cast typeid catch operator template typename class friend private " + + "this using const_cast inline public throw virtual delete mutable protected " + + "wchar_t"), + blockKeywords: words("catch class do else finally for if struct switch try while"), + atoms: words("true false null"), + hooks: {"#": cppHook} + }); + CodeMirror.defineMIME("text/x-java", { + name: "clike", + keywords: words("abstract assert boolean break byte case catch char class const continue default " + + "do double else enum extends final finally float for goto if implements import " + + "instanceof int interface long native new package private protected public " + + "return short static strictfp super switch synchronized this throw throws transient " + + "try void volatile while"), + blockKeywords: words("catch class do else finally for if switch try while"), + atoms: words("true false null"), + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); + CodeMirror.defineMIME("text/x-csharp", { + name: "clike", + keywords: words("abstract as base break case catch checked class const continue" + + " default delegate do else enum event explicit extern finally fixed for" + + " foreach goto if implicit in interface internal is lock namespace new" + + " operator out override params private protected public readonly ref return sealed" + + " sizeof stackalloc static struct switch this throw try typeof unchecked" + + " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + + " global group into join let orderby partial remove select set value var yield"), + blockKeywords: words("catch class do else finally for foreach if struct switch try while"), + builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" + + " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" + + " UInt64 bool byte char decimal double short int long object" + + " sbyte float string ushort uint ulong"), + atoms: words("true false null"), + hooks: { + "@": function(stream, state) { + if (stream.eat('"')) { + state.tokenize = tokenAtString; + return tokenAtString(stream, state); + } + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); + CodeMirror.defineMIME("text/x-scala", { + name: "clike", + keywords: words( + + /* scala */ + "abstract case catch class def do else extends false final finally for forSome if " + + "implicit import lazy match new null object override package private protected return " + + "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + + "<% >: # @ " + + + /* package scala */ + "assert assume require print println printf readLine readBoolean readByte readShort " + + "readChar readInt readLong readFloat readDouble " + + + "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + + "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " + + "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + + "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + + "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " + + + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + + "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" + + + ), + blockKeywords: words("catch class do else finally for forSome if match switch try while"), + atoms: words("true false null"), + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); +}()); diff --git a/js/.svn/text-base/codemirror.js.svn-base b/js/.svn/text-base/codemirror.js.svn-base new file mode 100644 index 0000000..342fb65 --- /dev/null +++ b/js/.svn/text-base/codemirror.js.svn-base @@ -0,0 +1,5516 @@ +// CodeMirror version 3.11 +// +// CodeMirror is the only global var we claim +window.CodeMirror = (function() { + "use strict"; + + // BROWSER SNIFFING + + // Crude, but necessary to handle a number of hard-to-feature-detect + // bugs and behavior differences. + var gecko = /gecko\/\d/i.test(navigator.userAgent); + var ie = /MSIE \d/.test(navigator.userAgent); + var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8); + var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9); + var webkit = /WebKit\//.test(navigator.userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); + var chrome = /Chrome\//.test(navigator.userAgent); + var opera = /Opera\//.test(navigator.userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var khtml = /KHTML\//.test(navigator.userAgent); + var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); + var phantom = /PhantomJS/.test(navigator.userAgent); + + var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); + var mac = ios || /Mac/.test(navigator.platform); + var windows = /windows/i.test(navigator.platform); + + var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/); + if (opera_version) opera_version = Number(opera_version[1]); + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11)); + var captureMiddleClick = gecko || (ie && !ie_lt9); + + // Optimize some code when these features are not used + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + // CONSTRUCTOR + + function CodeMirror(place, options) { + if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); + + this.options = options = options || {}; + // Determine effective options based on given values and defaults. + for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt)) + options[opt] = defaults[opt]; + setGuttersForLineNumbers(options); + + var docStart = typeof options.value == "string" ? 0 : options.value.first; + var display = this.display = makeDisplay(place, docStart); + display.wrapper.CodeMirror = this; + updateGutters(this); + if (options.autofocus && !mobile) focusInput(this); + + this.state = {keyMaps: [], + overlays: [], + modeGen: 0, + overwrite: false, focused: false, + suppressEdits: false, pasteIncoming: false, + draggingText: false, + highlight: new Delayed()}; + + themeChanged(this); + if (options.lineWrapping) + this.display.wrapper.className += " CodeMirror-wrap"; + + var doc = options.value; + if (typeof doc == "string") doc = new Doc(options.value, options.mode); + operation(this, attachDoc)(this, doc); + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie) setTimeout(bind(resetInput, this, true), 20); + + registerEventHandlers(this); + // IE throws unspecified error in certain cases, when + // trying to access activeElement before onload + var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { } + if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20); + else onBlur(this); + + operation(this, function() { + for (var opt in optionHandlers) + if (optionHandlers.propertyIsEnumerable(opt)) + optionHandlers[opt](this, options[opt], Init); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + })(); + } + + // DISPLAY CONSTRUCTOR + + function makeDisplay(place, docStart) { + var d = {}; + + var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none;"); + if (webkit) input.style.width = "1000px"; + else input.setAttribute("wrap", "off"); + // if border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) input.style.border = "1px solid black"; + input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); + + // Wraps and hides input textarea + d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The actual fake scrollbars. + d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar"); + d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar"); + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + // DIVs containing the selection and the actual code + d.lineDiv = elt("div"); + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + // Blinky cursor, and element used to ensure cursor fits at the end of a line + d.cursor = elt("div", "\u00a0", "CodeMirror-cursor"); + // Secondary cursor, shown when on a 'jump' in bi-directional text + d.otherCursor = elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"); + // Used to measure text size + d.measure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor], + null, "position: relative; outline: none"); + // Moved around its parent to cover visible view + d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); + // Set to the height of the text, causes scrolling + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;"); + // Will contain the gutters, if any + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Helper element to properly size the gutter backgrounds + var scrollerInner = elt("div", [d.sizer, d.heightForcer, d.gutters], null, "position: relative; min-height: 100%"); + // Provides scrolling + d.scroller = elt("div", [scrollerInner], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV, + d.scrollbarFiller, d.scroller], "CodeMirror"); + // Work around IE7 z-index bug + if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper); + + // Needed to hide big blue blinking cursor on Mobile Safari + if (ios) input.style.width = "0px"; + if (!webkit) d.scroller.draggable = true; + // Needed to handle Tab key in KHTML + if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px"; + + // Current visible range (may be bigger than the view window). + d.viewOffset = d.lastSizeC = 0; + d.showingFrom = d.showingTo = docStart; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // See readInput and resetInput + d.prevInput = ""; + // Set to true when a non-horizontal-scrolling widget is added. As + // an optimization, widget aligning is skipped when d is false. + d.alignWidgets = false; + // Flag that indicates whether we currently expect input to appear + // (after some event like 'keypress' or 'input') and are polling + // intensively. + d.pollingFast = false; + // Self-resetting timeout for the poller + d.poll = new Delayed(); + // True when a drag from the editor is active + d.draggingText = false; + + d.cachedCharWidth = d.cachedTextHeight = null; + d.measureLineCache = []; + d.measureLineCachePos = 0; + + // Tracks when resetInput has punted to just putting a short + // string instead of the (large) selection. + d.inaccurateSelection = false; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + return d; + } + + // STATE UPDATES + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); + cm.doc.iter(function(line) { + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + }); + cm.doc.frontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) regChange(cm); + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + cm.display.wrapper.className += " CodeMirror-wrap"; + cm.display.sizer.style.minWidth = ""; + } else { + cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", ""); + computeMaxLength(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function(){updateScrollbars(cm.display, cm.doc.height);}, 100); + } + + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function(line) { + if (lineIsHidden(cm.doc, line)) + return 0; + else if (wrapping) + return (Math.ceil(line.text.length / perLine) || 1) * th; + else + return th; + }; + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function(line) { + var estHeight = est(line); + if (estHeight != line.height) updateLineHeight(line, estHeight); + }); + } + + function keyMapChanged(cm) { + var style = keyMap[cm.options.keyMap].style; + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") + + (style ? " cm-keymap-" + style : ""); + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + } + + function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + for (var i = 0; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + } + + function lineLength(doc, line) { + if (line.height == 0) return 0; + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(); + cur = getLine(doc, found.from.line); + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(); + len -= cur.text.length - found.from.ch; + cur = getLine(doc, found.to.line); + len += cur.text.length - found.to.ch; + } + return len; + } + + function computeMaxLength(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(doc, d.maxLine); + d.maxLineChanged = true; + doc.iter(function(line) { + var len = lineLength(doc, line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = false; + for (var i = 0; i < options.gutters.length; ++i) { + if (options.gutters[i] == "CodeMirror-linenumbers") { + if (options.lineNumbers) found = true; + else options.gutters.splice(i--, 1); + } + } + if (!found && options.lineNumbers) + options.gutters.push("CodeMirror-linenumbers"); + } + + // SCROLLBARS + + // Re-synchronize the fake scrollbars with the actual size of the + // content. Optionally force a scrollTop. + function updateScrollbars(d /* display */, docHeight) { + var totalHeight = docHeight + paddingVert(d); + d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px"; + var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight); + var needsH = d.scroller.scrollWidth > d.scroller.clientWidth; + var needsV = scrollHeight > d.scroller.clientHeight; + if (needsV) { + d.scrollbarV.style.display = "block"; + d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0"; + d.scrollbarV.firstChild.style.height = + (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px"; + } else d.scrollbarV.style.display = ""; + if (needsH) { + d.scrollbarH.style.display = "block"; + d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0"; + d.scrollbarH.firstChild.style.width = + (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px"; + } else d.scrollbarH.style.display = ""; + if (needsH && needsV) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px"; + } else d.scrollbarFiller.style.display = ""; + + if (mac_geLion && scrollbarWidth(d.measure) === 0) + d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px"; + } + + function visibleLines(display, doc, viewPort) { + var top = display.scroller.scrollTop, height = display.wrapper.clientHeight; + if (typeof viewPort == "number") top = viewPort; + else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;} + top = Math.floor(top - paddingTop(display)); + var bottom = Math.ceil(top + height); + return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)}; + } + + // LINE NUMBERS + + function alignHorizontally(cm) { + var display = cm.display; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, l = comp + "px"; + for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) { + for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l; + } + if (cm.options.fixedGutter) + display.gutters.style.left = (comp + gutterW) + "px"; + } + + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) return false; + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + return true; + } + return false; + } + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + function compensateForHScroll(display) { + return getRect(display.scroller).left - getRect(display.sizer).left; + } + + // DISPLAY DRAWING + + function updateDisplay(cm, changes, viewPort) { + var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo; + var updated = updateDisplayInner(cm, changes, viewPort); + if (updated) { + signalLater(cm, "update", cm); + if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo) + signalLater(cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo); + } + updateSelection(cm); + updateScrollbars(cm.display, cm.doc.height); + + return updated; + } + + // Uses a set of changes plus the current scroll position to + // determine which DOM updates have to be made, and makes the + // updates. + function updateDisplayInner(cm, changes, viewPort) { + var display = cm.display, doc = cm.doc; + if (!display.wrapper.clientWidth) { + display.showingFrom = display.showingTo = doc.first; + display.viewOffset = 0; + return; + } + + // Compute the new visible window + // If scrollTop is specified, use that to determine which lines + // to render instead of the current scrollbar position. + var visible = visibleLines(display, doc, viewPort); + // Bail out if the visible area is already rendered and nothing changed. + if (changes.length == 0 && + visible.from > display.showingFrom && visible.to < display.showingTo) + return; + + if (maybeUpdateLineNumberWidth(cm)) + changes = [{from: doc.first, to: doc.first + doc.size}]; + var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + "px"; + display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : "0"; + + // Used to determine which lines need their line numbers updated + var positionsChangedFrom = Infinity; + if (cm.options.lineNumbers) + for (var i = 0; i < changes.length; ++i) + if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; } + + var end = doc.first + doc.size; + var from = Math.max(visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, visible.to + cm.options.viewportMargin); + if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom); + if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo); + if (sawCollapsedSpans) { + from = lineNo(visualLine(doc, getLine(doc, from))); + while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to; + } + + // Create a range of theoretically intact lines, and punch holes + // in that using the change info. + var intact = [{from: Math.max(display.showingFrom, doc.first), + to: Math.min(display.showingTo, end)}]; + if (intact[0].from >= intact[0].to) intact = []; + else intact = computeIntact(intact, changes); + // When merged lines are present, we might have to reduce the + // intact ranges because changes in continued fragments of the + // intact lines do require the lines to be redrawn. + if (sawCollapsedSpans) + for (var i = 0; i < intact.length; ++i) { + var range = intact[i], merged; + while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) { + var newTo = merged.find().from.line; + if (newTo > range.from) range.to = newTo; + else { intact.splice(i--, 1); break; } + } + } + + // Clip off the parts that won't be visible + var intactLines = 0; + for (var i = 0; i < intact.length; ++i) { + var range = intact[i]; + if (range.from < from) range.from = from; + if (range.to > to) range.to = to; + if (range.from >= range.to) intact.splice(i--, 1); + else intactLines += range.to - range.from; + } + if (intactLines == to - from && from == display.showingFrom && to == display.showingTo) { + updateViewOffset(cm); + return; + } + intact.sort(function(a, b) {return a.from - b.from;}); + + var focused = document.activeElement; + if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none"; + patchDisplay(cm, from, to, intact, positionsChangedFrom); + display.lineDiv.style.display = ""; + if (document.activeElement != focused && focused.offsetHeight) focused.focus(); + + var different = from != display.showingFrom || to != display.showingTo || + display.lastSizeC != display.wrapper.clientHeight; + // This is just a bogus formula that detects when the editor is + // resized or the font size changes. + if (different) display.lastSizeC = display.wrapper.clientHeight; + display.showingFrom = from; display.showingTo = to; + startWorker(cm, 100); + + var prevBottom = display.lineDiv.offsetTop; + for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) { + if (ie_lt8) { + var bot = node.offsetTop + node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = getRect(node); + height = box.bottom - box.top; + } + var diff = node.lineObj.height - height; + if (height < 2) height = textHeight(display); + if (diff > .001 || diff < -.001) { + updateLineHeight(node.lineObj, height); + var widgets = node.lineObj.widgets; + if (widgets) for (var i = 0; i < widgets.length; ++i) + widgets[i].height = widgets[i].node.offsetHeight; + } + } + updateViewOffset(cm); + + if (visibleLines(display, doc, viewPort).to > to) + updateDisplayInner(cm, [], viewPort); + return true; + } + + function updateViewOffset(cm) { + var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom)); + // Position the mover div to align with the current virtual scroll position + cm.display.mover.style.top = off + "px"; + } + + function computeIntact(intact, changes) { + for (var i = 0, l = changes.length || 0; i < l; ++i) { + var change = changes[i], intact2 = [], diff = change.diff || 0; + for (var j = 0, l2 = intact.length; j < l2; ++j) { + var range = intact[j]; + if (change.to <= range.from && change.diff) { + intact2.push({from: range.from + diff, to: range.to + diff}); + } else if (change.to <= range.from || change.from >= range.to) { + intact2.push(range); + } else { + if (change.from > range.from) + intact2.push({from: range.from, to: change.from}); + if (change.to < range.to) + intact2.push({from: change.to + diff, to: range.to + diff}); + } + } + intact = intact2; + } + return intact; + } + + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft; + width[cm.options.gutters[i]] = n.offsetWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth}; + } + + function patchDisplay(cm, from, to, intact, updateNumbersFrom) { + var dims = getDimensions(cm); + var display = cm.display, lineNumbers = cm.options.lineNumbers; + if (!intact.length && (!webkit || !cm.display.currentWheelTarget)) + removeChildren(display.lineDiv); + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + if (webkit && mac && cm.display.currentWheelTarget == node) { + node.style.display = "none"; + node.lineObj = null; + } else { + node.parentNode.removeChild(node); + } + return next; + } + + var nextIntact = intact.shift(), lineN = from; + cm.doc.iter(from, to, function(line) { + if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift(); + if (lineIsHidden(cm.doc, line)) { + if (line.height != 0) updateLineHeight(line, 0); + if (line.widgets && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) + if (line.widgets[i].showIfHidden) { + var prev = cur.previousSibling; + if (/pre/i.test(prev.nodeName)) { + var wrap = elt("div", null, null, "position: relative"); + prev.parentNode.replaceChild(wrap, prev); + wrap.appendChild(prev); + prev = wrap; + } + var wnode = prev.appendChild(elt("div", [line.widgets[i].node], "CodeMirror-linewidget")); + positionLineWidget(line.widgets[i], wnode, prev, dims); + } + } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) { + // This line is intact. Skip to the actual node. Update its + // line number if needed. + while (cur.lineObj != line) cur = rm(cur); + if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber) + setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN)); + cur = cur.nextSibling; + } else { + // For lines with widgets, make an attempt to find and reuse + // the existing element, so that widgets aren't needlessly + // removed and re-inserted into the dom + if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling) + if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; } + // This line needs to be generated. + var lineNode = buildLineElement(cm, line, lineN, dims, reuse); + if (lineNode != reuse) { + container.insertBefore(lineNode, cur); + } else { + while (cur != reuse) cur = rm(cur); + cur = cur.nextSibling; + } + + lineNode.lineObj = line; + } + ++lineN; + }); + while (cur) cur = rm(cur); + } + + function buildLineElement(cm, line, lineNo, dims, reuse) { + var lineElement = lineContent(cm, line); + var markers = line.gutterMarkers, display = cm.display, wrap; + + if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && !line.widgets) + return lineElement; + + // Lines with gutter elements, widgets or a background class need + // to be wrapped again, and have the extra elements added to the + // wrapper div + + if (reuse) { + reuse.alignable = null; + var isOk = true, widgetsSeen = 0; + for (var n = reuse.firstChild, next; n; n = next) { + next = n.nextSibling; + if (!/\bCodeMirror-linewidget\b/.test(n.className)) { + reuse.removeChild(n); + } else { + for (var i = 0, first = true; i < line.widgets.length; ++i) { + var widget = line.widgets[i], isFirst = false; + if (!widget.above) { isFirst = first; first = false; } + if (widget.node == n.firstChild) { + positionLineWidget(widget, n, reuse, dims); + ++widgetsSeen; + if (isFirst) reuse.insertBefore(lineElement, n); + break; + } + } + if (i == line.widgets.length) { isOk = false; break; } + } + } + if (isOk && widgetsSeen == line.widgets.length) { + wrap = reuse; + reuse.className = line.wrapClass || ""; + } + } + if (!wrap) { + wrap = elt("div", null, line.wrapClass, "position: relative"); + wrap.appendChild(lineElement); + } + // Kludge to make sure the styled element lies behind the selection (by z-index) + if (line.bgClass) + wrap.insertBefore(elt("div", null, line.bgClass + " CodeMirror-linebackground"), wrap.firstChild); + if (cm.options.lineNumbers || markers) { + var gutterWrap = wrap.insertBefore(elt("div", null, null, "position: absolute; left: " + + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"), + wrap.firstChild); + if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap); + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + wrap.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineNo), + "CodeMirror-linenumber CodeMirror-gutter-elt", + "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + + display.lineNumInnerWidth + "px")); + if (markers) + for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + if (ie_lt8) wrap.style.zIndex = 2; + if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + positionLineWidget(widget, node, wrap, dims); + if (widget.above) + wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement); + else + wrap.appendChild(node); + signalLater(widget, "redraw"); + } + return wrap; + } + + function positionLineWidget(widget, node, wrap, dims) { + if (widget.noHScroll) { + (wrap.alignable || (wrap.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } + + // SELECTION / CURSOR + + function updateSelection(cm) { + var display = cm.display; + var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to); + if (collapsed || cm.options.showCursorWhenSelecting) + updateSelectionCursor(cm); + else + display.cursor.style.display = display.otherCursor.style.display = "none"; + if (!collapsed) + updateSelectionRange(cm); + else + display.selectionDiv.style.display = "none"; + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + var headPos = cursorCoords(cm, cm.doc.sel.head, "div"); + var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv); + display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)) + "px"; + display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)) + "px"; + } + + // No selection, plain cursor + function updateSelectionCursor(cm) { + var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div"); + display.cursor.style.left = pos.left + "px"; + display.cursor.style.top = pos.top + "px"; + display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + display.cursor.style.display = ""; + + if (pos.other) { + display.otherCursor.style.display = ""; + display.otherCursor.style.left = pos.other.left + "px"; + display.otherCursor.style.top = pos.other.top + "px"; + display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } else { display.otherCursor.style.display = "none"; } + } + + // Highlight selection + function updateSelectionRange(cm) { + var display = cm.display, doc = cm.doc, sel = cm.doc.sel; + var fragment = document.createDocumentFragment(); + var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display); + + function add(left, top, width, bottom) { + if (top < 0) top = 0; + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + + "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) + + "px; height: " + (bottom - top) + "px")); + } + + function drawForLine(line, fromArg, toArg, retTop) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length, rVal = retTop ? Infinity : -Infinity; + function coords(ch) { + return charCoords(cm, Pos(line, ch), "div", lineObj); + } + + iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { + var leftPos = coords(dir == "rtl" ? to - 1 : from); + var rightPos = coords(dir == "rtl" ? from : to - 1); + var left = leftPos.left, right = rightPos.right; + if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = pl; + if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); + } + if (toArg == null && to == lineLen) right = clientWidth; + if (fromArg == null && from == 0) left = pl; + rVal = retTop ? Math.min(rightPos.top, rVal) : Math.max(rightPos.bottom, rVal); + if (left < pl + 1) left = pl; + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return rVal; + } + + if (sel.from.line == sel.to.line) { + drawForLine(sel.from.line, sel.from.ch, sel.to.ch); + } else { + var fromObj = getLine(doc, sel.from.line); + var cur = fromObj, merged, path = [sel.from.line, sel.from.ch], singleLine; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(); + path.push(found.from.ch, found.to.line, found.to.ch); + if (found.to.line == sel.to.line) { + path.push(sel.to.ch); + singleLine = true; + break; + } + cur = getLine(doc, found.to.line); + } + + // This is a single, merged line + if (singleLine) { + for (var i = 0; i < path.length; i += 3) + drawForLine(path[i], path[i+1], path[i+2]); + } else { + var middleTop, middleBot, toObj = getLine(doc, sel.to.line); + if (sel.from.ch) + // Draw the first line of selection. + middleTop = drawForLine(sel.from.line, sel.from.ch, null, false); + else + // Simply include it in the middle block. + middleTop = heightAtLine(cm, fromObj) - display.viewOffset; + + if (!sel.to.ch) + middleBot = heightAtLine(cm, toObj) - display.viewOffset; + else + middleBot = drawForLine(sel.to.line, collapsedSpanAtStart(toObj) ? null : 0, sel.to.ch, true); + + if (middleTop < middleBot) add(pl, middleTop, null, middleBot); + } + } + + removeChildrenAndAdd(display.selectionDiv, fragment); + display.selectionDiv.style.display = ""; + } + + // Cursor-blinking + function restartBlink(cm) { + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursor.style.visibility = display.otherCursor.style.visibility = ""; + display.blinker = setInterval(function() { + if (!display.cursor.offsetHeight) return; + display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo) + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.frontier < doc.first) doc.frontier = doc.first; + if (doc.frontier >= cm.display.showingTo) return; + var end = +new Date + cm.options.workTime; + var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); + var changed = [], prevChange; + doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) { + if (doc.frontier >= cm.display.showingFrom) { // Visible + var oldStyles = line.styles; + line.styles = highlightLine(cm, line, state); + var ischange = !oldStyles || oldStyles.length != line.styles.length; + for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; + if (ischange) { + if (prevChange && prevChange.end == doc.frontier) prevChange.end++; + else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1}); + } + line.stateAfter = copyState(doc.mode, state); + } else { + processLine(cm, line, state); + line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; + } + ++doc.frontier; + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + if (changed.length) + operation(cm, function() { + for (var i = 0; i < changed.length; ++i) + regChange(this, changed[i].start, changed[i].end); + })(); + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n) { + var minindent, minline, doc = cm.doc; + for (var search = n, lim = n - 100; search > lim; --search) { + if (search <= doc.first) return doc.first; + var line = getLine(doc, search - 1); + if (line.stateAfter) return search; + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + + function getStateBefore(cm, n) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) return true; + var pos = findStartLine(cm, n), state = pos > doc.first && getLine(doc, pos-1).stateAfter; + if (!state) state = startState(doc.mode); + else state = copyState(doc.mode, state); + doc.iter(pos, n, function(line) { + processLine(cm, line, state); + var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo; + line.stateAfter = save ? copyState(doc.mode, state) : null; + ++pos; + }); + return state; + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop;} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} + function paddingLeft(display) { + var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x")); + return e.offsetLeft; + } + + function measureChar(cm, line, ch, data) { + var dir = -1; + data = data || measureLine(cm, line); + + for (var pos = ch;; pos += dir) { + var r = data[pos]; + if (r) break; + if (dir < 0 && pos == 0) dir = 1; + } + return {left: pos < ch ? r.right : r.left, + right: pos > ch ? r.left : r.right, + top: r.top, bottom: r.bottom}; + } + + function findCachedMeasurement(cm, line) { + var cache = cm.display.measureLineCache; + for (var i = 0; i < cache.length; ++i) { + var memo = cache[i]; + if (memo.text == line.text && memo.markedSpans == line.markedSpans && + cm.display.scroller.clientWidth == memo.width && + memo.classes == line.textClass + "|" + line.bgClass + "|" + line.wrapClass) + return memo.measure; + } + } + + function measureLine(cm, line) { + // First look in the cache + var measure = findCachedMeasurement(cm, line); + if (!measure) { + // Failing that, recompute and store result in cache + measure = measureLineInner(cm, line); + var cache = cm.display.measureLineCache; + var memo = {text: line.text, width: cm.display.scroller.clientWidth, + markedSpans: line.markedSpans, measure: measure, + classes: line.textClass + "|" + line.bgClass + "|" + line.wrapClass}; + if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo; + else cache.push(memo); + } + return measure; + } + + function measureLineInner(cm, line) { + var display = cm.display, measure = emptyArray(line.text.length); + var pre = lineContent(cm, line, measure); + + // IE does not cache element positions of inline elements between + // calls to getBoundingClientRect. This makes the loop below, + // which gathers the positions of all the characters on the line, + // do an amount of layout work quadratic to the number of + // characters. When line wrapping is off, we try to improve things + // by first subdividing the line into a bunch of inline blocks, so + // that IE can reuse most of the layout information from caches + // for those blocks. This does interfere with line wrapping, so it + // doesn't work when wrapping is on, but in that case the + // situation is slightly better, since IE does cache line-wrapping + // information and only recomputes per-line. + if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) { + var fragment = document.createDocumentFragment(); + var chunk = 10, n = pre.childNodes.length; + for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) { + var wrap = elt("div", null, null, "display: inline-block"); + for (var j = 0; j < chunk && n; ++j) { + wrap.appendChild(pre.firstChild); + --n; + } + fragment.appendChild(wrap); + } + pre.appendChild(fragment); + } + + removeChildrenAndAdd(display.measure, pre); + + var outer = getRect(display.lineDiv); + var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight; + // Work around an IE7/8 bug where it will sometimes have randomly + // replaced our pre with a clone at this point. + if (ie_lt9 && display.measure.first != pre) + removeChildrenAndAdd(display.measure, pre); + + for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) { + var size = getRect(cur); + var top = Math.max(0, size.top - outer.top), bot = Math.min(size.bottom - outer.top, maxBot); + for (var j = 0; j < vranges.length; j += 2) { + var rtop = vranges[j], rbot = vranges[j+1]; + if (rtop > bot || rbot < top) continue; + if (rtop <= top && rbot >= bot || + top <= rtop && bot >= rbot || + Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) { + vranges[j] = Math.min(top, rtop); + vranges[j+1] = Math.max(bot, rbot); + break; + } + } + if (j == vranges.length) vranges.push(top, bot); + var right = size.right; + if (cur.measureRight) right = getRect(cur.measureRight).left; + data[i] = {left: size.left - outer.left, right: right - outer.left, top: j}; + } + for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) { + var vr = cur.top; + cur.top = vranges[vr]; cur.bottom = vranges[vr+1]; + } + + return data; + } + + function measureLineWidth(cm, line) { + var hasBadSpan = false; + if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) { + var sp = line.markedSpans[i]; + if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true; + } + var cached = !hasBadSpan && findCachedMeasurement(cm, line); + if (cached) return measureChar(cm, line, line.text.length, cached).right; + + var pre = lineContent(cm, line); + var end = pre.appendChild(zeroWidthElement(cm.display.measure)); + removeChildrenAndAdd(cm.display.measure, pre); + return getRect(end).right - getRect(cm.display.lineDiv).left; + } + + function clearCaches(cm) { + cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0; + cm.display.cachedCharWidth = cm.display.cachedTextHeight = null; + cm.display.maxLineChanged = true; + cm.display.lineNumChars = null; + } + + // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page" + function intoCoordSystem(cm, lineObj, rect, context) { + if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; rect.bottom += size; + } + if (context == "line") return rect; + if (!context) context = "local"; + var yOff = heightAtLine(cm, lineObj); + if (context != "local") yOff -= cm.display.viewOffset; + if (context == "page") { + var lOff = getRect(cm.display.lineSpace); + yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop); + var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect; + } + + // Context may be "window", "page", "div", or "local"/null + // Result is in local coords + function fromCoordSystem(cm, coords, context) { + if (context == "div") return coords; + var left = coords.left, top = coords.top; + if (context == "page") { + left -= window.pageXOffset || (document.documentElement || document.body).scrollLeft; + top -= window.pageYOffset || (document.documentElement || document.body).scrollTop; + } + var lineSpaceBox = getRect(cm.display.lineSpace); + left -= lineSpaceBox.left; + top -= lineSpaceBox.top; + if (context == "local" || !context) { + var editorBox = getRect(cm.display.wrapper); + left -= editorBox.left; + top -= editorBox.top; + } + return {left: left, top: top}; + } + + function charCoords(cm, pos, context, lineObj) { + if (!lineObj) lineObj = getLine(cm.doc, pos.line); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch), context); + } + + function cursorCoords(cm, pos, context, lineObj, measurement) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!measurement) measurement = measureLine(cm, lineObj); + function get(ch, right) { + var m = measureChar(cm, lineObj, ch, measurement); + if (right) m.left = m.right; else m.right = m.left; + return intoCoordSystem(cm, lineObj, m, context); + } + var order = getOrder(lineObj), ch = pos.ch; + if (!order) return get(ch); + var main, other, linedir = order[0].level; + for (var i = 0; i < order.length; ++i) { + var part = order[i], rtl = part.level % 2, nb, here; + if (part.from < ch && part.to > ch) return get(ch, rtl); + var left = rtl ? part.to : part.from, right = rtl ? part.from : part.to; + if (left == ch) { + // IE returns bogus offsets and widths for edges where the + // direction flips, but only for the side with the lower + // level. So we try to use the side with the higher level. + if (i && part.level < (nb = order[i-1]).level) here = get(nb.level % 2 ? nb.from : nb.to - 1, true); + else here = get(rtl && part.from != part.to ? ch - 1 : ch); + if (rtl == linedir) main = here; else other = here; + } else if (right == ch) { + var nb = i < order.length - 1 && order[i+1]; + if (!rtl && nb && nb.from == nb.to) continue; + if (nb && part.level < nb.level) here = get(nb.level % 2 ? nb.to - 1 : nb.from); + else here = get(rtl ? ch : ch - 1, true); + if (rtl == linedir) main = here; else other = here; + } + } + if (linedir && !ch) other = get(order[0].to - 1); + if (!main) return other; + if (other) main.other = other; + return main; + } + + function PosMaybeOutside(line, ch, outside) { + var pos = new Pos(line, ch); + if (outside) pos.outside = true; + return pos; + } + + // Coords must be lineSpace-local + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) return PosMaybeOutside(doc.first, 0, true); + var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineNo > last) + return PosMaybeOutside(doc.first + doc.size - 1, getLine(doc, last).text.length, true); + if (x < 0) x = 0; + + for (;;) { + var lineObj = getLine(doc, lineNo); + var found = coordsCharInner(cm, lineObj, lineNo, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(); + if (merged && found.ch >= mergedPos.from.ch) + lineNo = mergedPos.to.line; + else + return found; + } + } + + function coordsCharInner(cm, lineObj, lineNo, x, y) { + var innerOff = y - heightAtLine(cm, lineObj); + var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; + var measurement = measureLine(cm, lineObj); + + function getX(ch) { + var sp = cursorCoords(cm, Pos(lineNo, ch), "line", + lineObj, measurement); + wrongLine = true; + if (innerOff > sp.bottom) return sp.left - adjust; + else if (innerOff < sp.top) return sp.left + adjust; + else wrongLine = false; + return sp.left; + } + + var bidi = getOrder(lineObj), dist = lineObj.text.length; + var from = lineLeft(lineObj), to = lineRight(lineObj); + var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; + + if (x > toX) return PosMaybeOutside(lineNo, to, toOutside); + // Do a binary search between these bounds. + for (;;) { + if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { + var after = x - fromX < toX - x, ch = after ? from : to; + while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch; + var pos = PosMaybeOutside(lineNo, ch, after ? fromOutside : toOutside); + pos.after = after; + return pos; + } + var step = Math.ceil(dist / 2), middle = from + step; + if (bidi) { + middle = from; + for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); + } + var middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist -= step;} + else {from = middle; fromX = middleX; fromOutside = wrongLine; dist = step;} + } + } + + var measureText; + function textHeight(display) { + if (display.cachedTextHeight != null) return display.cachedTextHeight; + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) display.cachedTextHeight = height; + removeChildren(display.measure); + return height || 1; + } + + function charWidth(display) { + if (display.cachedCharWidth != null) return display.cachedCharWidth; + var anchor = elt("span", "x"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var width = anchor.offsetWidth; + if (width > 2) display.cachedCharWidth = width; + return width || 10; + } + + // OPERATIONS + + // Operations are used to wrap changes in such a way that each + // change won't have to update the cursor and display (which would + // be awkward, slow, and error-prone), but instead updates are + // batched and then all combined and executed at once. + + var nextOpId = 0; + function startOperation(cm) { + cm.curOp = { + // An array of ranges of lines that have to be updated. See + // updateDisplay. + changes: [], + updateInput: null, + userSelChange: null, + textChanged: null, + selectionChanged: false, + updateMaxLine: false, + updateScrollPos: false, + id: ++nextOpId + }; + if (!delayedCallbackDepth++) delayedCallbacks = []; + } + + function endOperation(cm) { + var op = cm.curOp, doc = cm.doc, display = cm.display; + cm.curOp = null; + + if (op.updateMaxLine) computeMaxLength(cm); + if (display.maxLineChanged && !cm.options.lineWrapping) { + var width = measureLineWidth(cm, display.maxLine); + display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + "px"; + display.maxLineChanged = false; + var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth); + if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos) + setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true); + } + var newScrollPos, updated; + if (op.updateScrollPos) { + newScrollPos = op.updateScrollPos; + } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible + var coords = cursorCoords(cm, doc.sel.head); + newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom); + } + if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null) { + updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop); + if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop; + } + if (!updated && op.selectionChanged) updateSelection(cm); + if (op.updateScrollPos) { + display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = newScrollPos.scrollTop; + display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft; + alignHorizontally(cm); + } else if (newScrollPos) { + scrollCursorIntoView(cm); + } + if (op.selectionChanged) restartBlink(cm); + + if (cm.state.focused && op.updateInput) + resetInput(cm, op.userSelChange); + + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) for (var i = 0; i < hidden.length; ++i) + if (!hidden[i].lines.length) signal(hidden[i], "hide"); + if (unhidden) for (var i = 0; i < unhidden.length; ++i) + if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); + + var delayed; + if (!--delayedCallbackDepth) { + delayed = delayedCallbacks; + delayedCallbacks = null; + } + if (op.textChanged) + signal(cm, "change", cm, op.textChanged); + if (op.selectionChanged) signal(cm, "cursorActivity", cm); + if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i](); + } + + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm1, f) { + return function() { + var cm = cm1 || this, withOp = !cm.curOp; + if (withOp) startOperation(cm); + try { var result = f.apply(cm, arguments); } + finally { if (withOp) endOperation(cm); } + return result; + }; + } + function docOperation(f) { + return function() { + var withOp = this.cm && !this.cm.curOp, result; + if (withOp) startOperation(this.cm); + try { result = f.apply(this, arguments); } + finally { if (withOp) endOperation(this.cm); } + return result; + }; + } + function runInOp(cm, f) { + var withOp = !cm.curOp, result; + if (withOp) startOperation(cm); + try { result = f(); } + finally { if (withOp) endOperation(cm); } + return result; + } + + function regChange(cm, from, to, lendiff) { + if (from == null) from = cm.doc.first; + if (to == null) to = cm.doc.first + cm.doc.size; + cm.curOp.changes.push({from: from, to: to, diff: lendiff}); + } + + // INPUT HANDLING + + function slowPoll(cm) { + if (cm.display.pollingFast) return; + cm.display.poll.set(cm.options.pollInterval, function() { + readInput(cm); + if (cm.state.focused) slowPoll(cm); + }); + } + + function fastPoll(cm) { + var missed = false; + cm.display.pollingFast = true; + function p() { + var changed = readInput(cm); + if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);} + else {cm.display.pollingFast = false; slowPoll(cm);} + } + cm.display.poll.set(20, p); + } + + // prevInput is a hack to work with IME. If we reset the textarea + // on every change, that breaks IME. So we look for changes + // compared to the previous content instead. (Modern browsers have + // events that indicate IME taking place, but these are not widely + // supported or compatible enough yet to rely on.) + function readInput(cm) { + var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel; + if (!cm.state.focused || hasSelection(input) || isReadOnly(cm)) return false; + var text = input.value; + if (text == prevInput && posEq(sel.from, sel.to)) return false; + // IE enjoys randomly deselecting our input's text when + // re-focusing. If the selection is gone but the cursor is at the + // start of the input, that's probably what happened. + if (ie && text && input.selectionStart === 0) { + resetInput(cm, true); + return false; + } + var withOp = !cm.curOp; + if (withOp) startOperation(cm); + sel.shift = false; + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput[same] == text[same]) ++same; + var from = sel.from, to = sel.to; + if (same < prevInput.length) + from = Pos(from.line, from.ch - (prevInput.length - same)); + else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming) + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + (text.length - same))); + var updateInput = cm.curOp.updateInput; + makeChange(cm.doc, {from: from, to: to, text: splitLines(text.slice(same)), + origin: cm.state.pasteIncoming ? "paste" : "+input"}, "end"); + + cm.curOp.updateInput = updateInput; + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = ""; + else cm.display.prevInput = text; + if (withOp) endOperation(cm); + cm.state.pasteIncoming = false; + return true; + } + + function resetInput(cm, user) { + var minimal, selected, doc = cm.doc; + if (!posEq(doc.sel.from, doc.sel.to)) { + cm.display.prevInput = ""; + minimal = hasCopyEvent && + (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000); + if (minimal) cm.display.input.value = "-"; + else cm.display.input.value = selected || cm.getSelection(); + if (cm.state.focused) selectInput(cm.display.input); + } else if (user) cm.display.prevInput = cm.display.input.value = ""; + cm.display.inaccurateSelection = minimal; + } + + function focusInput(cm) { + if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input)) + cm.display.input.focus(); + } + + function isReadOnly(cm) { + return cm.options.readOnly || cm.doc.cantEdit; + } + + // EVENT HANDLERS + + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + on(d.scroller, "dblclick", operation(cm, e_preventDefault)); + on(d.lineSpace, "selectstart", function(e) { + if (!eventInWidget(d, e)) e_preventDefault(e); + }); + // Gecko browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for Gecko. + if (!captureMiddleClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + + on(d.scroller, "scroll", function() { + if (d.scroller.clientHeight) { + setScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + on(d.scrollbarV, "scroll", function() { + if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop); + }); + on(d.scrollbarH, "scroll", function() { + if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft); + }); + + on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); + on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); + + function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); } + on(d.scrollbarH, "mousedown", reFocus); + on(d.scrollbarV, "mousedown", reFocus); + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + function onResize() { + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = null; + clearCaches(cm); + runInOp(cm, bind(regChange, cm)); + } + on(window, "resize", onResize); + // Above handler holds on to the editor and its data structures. + // Here we poll to unregister it when the editor is no longer in + // the document, so that it can be garbage-collected. + function unregister() { + for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {} + if (p) setTimeout(unregister, 5000); + else off(window, "resize", onResize); + } + setTimeout(unregister, 5000); + + on(d.input, "keyup", operation(cm, function(e) { + if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + if (e.keyCode == 16) cm.doc.sel.shift = false; + })); + on(d.input, "input", bind(fastPoll, cm)); + on(d.input, "keydown", operation(cm, onKeyDown)); + on(d.input, "keypress", operation(cm, onKeyPress)); + on(d.input, "focus", bind(onFocus, cm)); + on(d.input, "blur", bind(onBlur, cm)); + + function drag_(e) { + if (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return; + e_stop(e); + } + if (cm.options.dragDrop) { + on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); + on(d.scroller, "dragenter", drag_); + on(d.scroller, "dragover", drag_); + on(d.scroller, "drop", operation(cm, onDrop)); + } + on(d.scroller, "paste", function(e){ + if (eventInWidget(d, e)) return; + focusInput(cm); + fastPoll(cm); + }); + on(d.input, "paste", function() { + cm.state.pasteIncoming = true; + fastPoll(cm); + }); + + function prepareCopy() { + if (d.inaccurateSelection) { + d.prevInput = ""; + d.inaccurateSelection = false; + d.input.value = cm.getSelection(); + selectInput(d.input); + } + } + on(d.input, "cut", prepareCopy); + on(d.input, "copy", prepareCopy); + + // Needed to handle Tab key in KHTML + if (khtml) on(d.sizer, "mouseup", function() { + if (document.activeElement == d.input) d.input.blur(); + focusInput(cm); + }); + } + + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n) return true; + if (/\bCodeMirror-(?:line)?widget\b/.test(n.className) || + n.parentNode == display.sizer && n != display.mover) return true; + } + } + + function posFromMouse(cm, e, liberal) { + var display = cm.display; + if (!liberal) { + var target = e_target(e); + if (target == display.scrollbarH || target == display.scrollbarH.firstChild || + target == display.scrollbarV || target == display.scrollbarV.firstChild || + target == display.scrollbarFiller) return null; + } + var x, y, space = getRect(display.lineSpace); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX; y = e.clientY; } catch (e) { return null; } + return coordsChar(cm, x - space.left, y - space.top); + } + + var lastClick, lastDoubleClick; + function onMouseDown(e) { + var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel; + sel.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + display.scroller.draggable = false; + setTimeout(function(){display.scroller.draggable = true;}, 100); + } + return; + } + if (clickInGutter(cm, e)) return; + var start = posFromMouse(cm, e); + + switch (e_button(e)) { + case 3: + if (captureMiddleClick) onContextMenu.call(cm, cm, e); + return; + case 2: + if (start) extendSelection(cm.doc, start); + setTimeout(bind(focusInput, cm), 20); + e_preventDefault(e); + return; + } + // For button 1, if it was clicked inside the editor + // (posFromMouse returning non-null), we have to adjust the + // selection. + if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;} + + if (!cm.state.focused) onFocus(cm); + + var now = +new Date, type = "single"; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) { + type = "triple"; + e_preventDefault(e); + setTimeout(bind(focusInput, cm), 20); + selectLine(cm, start.line); + } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) { + type = "double"; + lastDoubleClick = {time: now, pos: start}; + e_preventDefault(e); + var word = findWordAt(getLine(doc, start.line).text, start); + extendSelection(cm.doc, word.from, word.to); + } else { lastClick = {time: now, pos: start}; } + + var last = start; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) && + !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") { + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + extendSelection(cm.doc, start); + focusInput(cm); + } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + cm.state.draggingText = dragEnd; + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + return; + } + e_preventDefault(e); + if (type == "single") extendSelection(cm.doc, clipPos(doc, start)); + + var startstart = sel.from, startend = sel.to; + + function doSelect(cur) { + if (type == "single") { + extendSelection(cm.doc, clipPos(doc, start), cur); + return; + } + + startstart = clipPos(doc, startstart); + startend = clipPos(doc, startend); + if (type == "double") { + var word = findWordAt(getLine(doc, cur.line).text, cur); + if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend); + else extendSelection(cm.doc, startstart, word.to); + } else if (type == "triple") { + if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0))); + else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0))); + } + } + + var editorSize = getRect(display.wrapper); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true); + if (!cur) return; + if (!posEq(cur, last)) { + if (!cm.state.focused) onFocus(cm); + last = cur; + doSelect(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) setTimeout(operation(cm, function() { + if (counter != curCount) return; + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + + function done(e) { + counter = Infinity; + var cur = posFromMouse(cm, e); + if (cur) doSelect(cur); + e_preventDefault(e); + focusInput(cm); + off(document, "mousemove", move); + off(document, "mouseup", up); + } + + var move = operation(cm, function(e) { + if (!ie && !e_button(e)) done(e); + else extend(e); + }); + var up = operation(cm, done); + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + function onDrop(e) { + var cm = this; + if (eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e)))) + return; + e_preventDefault(e); + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || isReadOnly(cm)) return; + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function(file, i) { + var reader = new FileReader; + reader.onload = function() { + text[i] = reader.result; + if (++read == n) { + pos = clipPos(cm.doc, pos); + makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around"); + } + }; + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } else { + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(bind(focusInput, cm), 20); + return; + } + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to; + setSelection(cm.doc, pos, pos); + if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste"); + cm.replaceSelection(text, null, "paste"); + focusInput(cm); + onFocus(cm); + } + } + catch(e){} + } + } + + function clickInGutter(cm, e) { + var display = cm.display; + try { var mX = e.clientX, mY = e.clientY; } + catch(e) { return false; } + + if (mX >= Math.floor(getRect(display.gutters).right)) return false; + e_preventDefault(e); + if (!hasHandler(cm, "gutterClick")) return true; + + var lineBox = getRect(display.lineDiv); + if (mY > lineBox.bottom) return true; + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && getRect(g).right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signalLater(cm, "gutterClick", cm, line, gutter, e); + break; + } + } + return true; + } + + function onDragStart(cm, e) { + if (eventInWidget(cm.display, e)) return; + + var txt = cm.getSelection(); + e.dataTransfer.setData("Text", txt); + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + if (opera) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + if (safari) { + if (cm.display.dragImg) { + img = cm.display.dragImg; + } else { + cm.display.dragImg = img; + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + cm.display.wrapper.appendChild(img); + } + } + e.dataTransfer.setDragImage(img, 0, 0); + if (opera) img.parentNode.removeChild(img); + } + } + + function setScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) return; + cm.doc.scrollTop = val; + if (!gecko) updateDisplay(cm, [], val); + if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; + if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val; + if (gecko) updateDisplay(cm, []); + } + function setScrollLeft(cm, val, isScroller) { + if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; + if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val; + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) wheelPixelsPerUnit = -.53; + else if (gecko) wheelPixelsPerUnit = 15; + else if (chrome) wheelPixelsPerUnit = -.7; + else if (safari) wheelPixelsPerUnit = -1/3; + + function onScrollWheel(cm, e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; + else if (dy == null) dy = e.wheelDelta; + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + for (var cur = e.target; cur != scroll; cur = cur.parentNode) { + if (cur.lineObj) { + cm.display.currentWheelTarget = cur; + break; + } + } + } + + var display = cm.display, scroll = display.scroller; + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !opera && wheelPixelsPerUnit != null) { + if (dy) + setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); + setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); + e_preventDefault(e); + display.wheelStartX = null; // Abort measurement, if in progress + return; + } + + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) top = Math.max(0, top + pixels - 50); + else bot = Math.min(cm.doc.height, bot + pixels + 50); + updateDisplay(cm, [], {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function() { + if (display.wheelStartX == null) return; + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) return; + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; + var doc = cm.doc, prevShift = doc.sel.shift, done = false; + try { + if (isReadOnly(cm)) cm.state.suppressEdits = true; + if (dropShift) doc.sel.shift = false; + done = bound(cm) != Pass; + } finally { + doc.sel.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } + + function allKeyMaps(cm) { + var maps = cm.state.keyMaps.slice(0); + if (cm.options.extraKeys) maps.push(cm.options.extraKeys); + maps.push(cm.options.keyMap); + return maps; + } + + var maybeTransition; + function handleKeyBinding(cm, e) { + // Handle auto keymap transitions + var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto; + clearTimeout(maybeTransition); + if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { + if (getKeyMap(cm.options.keyMap) == startMap) + cm.options.keyMap = (next.call ? next.call(null, cm) : next); + }, 50); + + var name = keyName(e, true), handled = false; + if (!name) return false; + var keymaps = allKeyMaps(cm); + + if (e.shiftKey) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + handled = lookupKey("Shift-" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);}) + || lookupKey(name, keymaps, function(b) { + if (typeof b == "string" && /^go[A-Z]/.test(b)) return doHandleBinding(cm, b); + }); + } else { + handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); }); + } + if (handled == "stop") handled = false; + + if (handled) { + e_preventDefault(e); + restartBlink(cm); + if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; } + } + return handled; + } + + function handleCharBinding(cm, e, ch) { + var handled = lookupKey("'" + ch + "'", allKeyMaps(cm), + function(b) { return doHandleBinding(cm, b, true); }); + if (handled) { + e_preventDefault(e); + restartBlink(cm); + } + return handled; + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + if (!cm.state.focused) onFocus(cm); + if (ie && e.keyCode == 27) { e.returnValue = false; } + if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + var code = e.keyCode; + // IE does strange things with escape. + cm.doc.sel.shift = code == 16 || e.shiftKey; + // First give onKeyEvent option a chance to handle this. + var handled = handleKeyBinding(cm, e); + if (opera) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + cm.replaceSelection(""); + } + } + + function onKeyPress(e) { + var cm = this; + if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; + var keyCode = e.keyCode, charCode = e.charCode; + if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (this.options.electricChars && this.doc.mode.electricChars && + this.options.smartIndent && !isReadOnly(this) && + this.doc.mode.electricChars.indexOf(ch) > -1) + setTimeout(operation(cm, function() {indentLine(cm, cm.doc.sel.to.line, "smart");}), 75); + if (handleCharBinding(cm, e, ch)) return; + fastPoll(cm); + } + + function onFocus(cm) { + if (cm.options.readOnly == "nocursor") return; + if (!cm.state.focused) { + signal(cm, "focus", cm); + cm.state.focused = true; + if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1) + cm.display.wrapper.className += " CodeMirror-focused"; + resetInput(cm, true); + } + slowPoll(cm); + restartBlink(cm); + } + function onBlur(cm) { + if (cm.state.focused) { + signal(cm, "blur", cm); + cm.state.focused = false; + cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-focused", ""); + } + clearInterval(cm.display.blinker); + setTimeout(function() {if (!cm.state.focused) cm.doc.sel.shift = false;}, 150); + } + + var detectingSelectAll; + function onContextMenu(cm, e) { + var display = cm.display, sel = cm.doc.sel; + if (eventInWidget(display, e)) return; + + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || opera) return; // Opera is difficult. + if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) + operation(cm, setSelection)(cm.doc, pos, pos); + + var oldCSS = display.input.style.cssText; + display.inputDiv.style.position = "absolute"; + display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" + + "border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);"; + focusInput(cm); + resetInput(cm, true); + // Adds "Select all" to context menu in FF + if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " "; + + function rehide() { + display.inputDiv.style.position = "relative"; + display.input.style.cssText = oldCSS; + if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos; + slowPoll(cm); + + // Try to detect the user choosing select-all + if (display.input.selectionStart != null && (!ie || ie_lt9)) { + clearTimeout(detectingSelectAll); + var extval = display.input.value = " " + (posEq(sel.from, sel.to) ? "" : display.input.value), i = 0; + display.prevInput = " "; + display.input.selectionStart = 1; display.input.selectionEnd = extval.length; + var poll = function(){ + if (display.prevInput == " " && display.input.selectionStart == 0) + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500); + else resetInput(cm); + }; + detectingSelectAll = setTimeout(poll, 200); + } + } + + if (captureMiddleClick) { + e_stop(e); + var mouseup = function() { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + } + + // UPDATING + + function changeEnd(change) { + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + } + + // Make sure a position will be valid after the given change. + function clipPostChange(doc, change, pos) { + if (!posLess(change.from, pos)) return clipPos(doc, pos); + var diff = (change.text.length - 1) - (change.to.line - change.from.line); + if (pos.line > change.to.line + diff) { + var preLine = pos.line - diff, lastLine = doc.first + doc.size - 1; + if (preLine > lastLine) return Pos(lastLine, getLine(doc, lastLine).text.length); + return clipToLen(pos, getLine(doc, preLine).text.length); + } + if (pos.line == change.to.line + diff) + return clipToLen(pos, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0) + + getLine(doc, change.to.line).text.length - change.to.ch); + var inside = pos.line - change.from.line; + return clipToLen(pos, change.text[inside].length + (inside ? 0 : change.from.ch)); + } + + // Hint can be null|"end"|"start"|"around"|{anchor,head} + function computeSelAfterChange(doc, change, hint) { + if (hint && typeof hint == "object") // Assumed to be {anchor, head} object + return {anchor: clipPostChange(doc, change, hint.anchor), + head: clipPostChange(doc, change, hint.head)}; + + if (hint == "start") return {anchor: change.from, head: change.from}; + + var end = changeEnd(change); + if (hint == "around") return {anchor: change.from, head: end}; + if (hint == "end") return {anchor: end, head: end}; + + // hint is null, leave the selection alone as much as possible + var adjustPos = function(pos) { + if (posLess(pos, change.from)) return pos; + if (!posLess(change.to, pos)) return end; + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) ch += end.ch - change.to.ch; + return Pos(line, ch); + }; + return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)}; + } + + function filterChange(doc, change) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + update: function(from, to, text, origin) { + if (from) this.from = clipPos(doc, from); + if (to) this.to = clipPos(doc, to); + if (text) this.text = text; + if (origin !== undefined) this.origin = origin; + }, + cancel: function() { this.canceled = true; } + }; + signal(doc, "beforeChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); + + if (obj.canceled) return null; + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; + } + + // Replace the range from from to to by the strings in replacement. + // change is a {from, to, text [, origin]} object + function makeChange(doc, change, selUpdate, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, selUpdate, ignoreReadOnly); + if (doc.cm.state.suppressEdits) return; + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change); + if (!change) return; + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 1; --i) + makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: [""]}); + if (split.length) + makeChangeNoReadonly(doc, {from: split[0].from, to: split[0].to, text: change.text}, selUpdate); + } else { + makeChangeNoReadonly(doc, change, selUpdate); + } + } + + function makeChangeNoReadonly(doc, change, selUpdate) { + var selAfter = computeSelAfterChange(doc, change, selUpdate); + addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + function makeChangeFromHistory(doc, type) { + if (doc.cm && doc.cm.state.suppressEdits) return; + + var hist = doc.history; + var event = (type == "undo" ? hist.done : hist.undone).pop(); + if (!event) return; + hist.dirtyCounter += type == "undo" ? -1 : 1; + + var anti = {changes: [], anchorBefore: event.anchorAfter, headBefore: event.headAfter, + anchorAfter: event.anchorBefore, headAfter: event.headBefore}; + (type == "undo" ? hist.undone : hist.done).push(anti); + + for (var i = event.changes.length - 1; i >= 0; --i) { + var change = event.changes[i]; + change.origin = type; + anti.changes.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change, null) + : {anchor: event.anchorBefore, head: event.headBefore}; + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + var rebased = []; + + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + } + } + + function shiftDoc(doc, distance) { + function shiftPos(pos) {return Pos(pos.line + distance, pos.ch);} + doc.first += distance; + if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance); + doc.sel.head = shiftPos(doc.sel.head); doc.sel.anchor = shiftPos(doc.sel.anchor); + doc.sel.from = shiftPos(doc.sel.from); doc.sel.to = shiftPos(doc.sel.to); + } + + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) return; + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) selAfter = computeSelAfterChange(doc, change, null); + if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans, selAfter); + else updateDoc(doc, change, spans, selAfter); + } + + function makeChangeSingleDocInEditor(cm, change, spans, selAfter) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(doc, getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + + updateDoc(doc, change, spans, selAfter, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function(line) { + var len = lineLength(doc, line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + doc.frontier = Math.min(doc.frontier, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + regChange(cm, from.line, to.line + 1, lendiff); + + if (hasHandler(cm, "change")) { + var changeObj = {from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin}; + if (cm.curOp.textChanged) { + for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {} + cur.next = changeObj; + } else cm.curOp.textChanged = changeObj; + } + } + + function replaceRange(doc, code, from, to, origin) { + if (!to) to = from; + if (posLess(to, from)) { var tmp = to; to = from; from = tmp; } + if (typeof code == "string") code = splitLines(code); + makeChange(doc, {from: from, to: to, text: code, origin: origin}, null); + } + + // POSITION OBJECT + + function Pos(line, ch) { + if (!(this instanceof Pos)) return new Pos(line, ch); + this.line = line; this.ch = ch; + } + CodeMirror.Pos = Pos; + + function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} + function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} + function copyPos(x) {return Pos(x.line, x.ch);} + + // SELECTION + + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} + function clipPos(doc, pos) { + if (pos.line < doc.first) return Pos(doc.first, 0); + var last = doc.first + doc.size - 1; + if (pos.line > last) return Pos(last, getLine(doc, last).text.length); + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) return Pos(pos.line, linelen); + else if (ch < 0) return Pos(pos.line, 0); + else return pos; + } + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + + // If shift is held, this will move the selection anchor. Otherwise, + // it'll set the whole selection. + function extendSelection(doc, pos, other, bias) { + if (doc.sel.shift || doc.sel.extend) { + var anchor = doc.sel.anchor; + if (other) { + var posBefore = posLess(pos, anchor); + if (posBefore != posLess(other, anchor)) { + anchor = pos; + pos = other; + } else if (posBefore != posLess(pos, other)) { + pos = other; + } + } + setSelection(doc, anchor, pos, bias); + } else { + setSelection(doc, pos, other || pos, bias); + } + if (doc.cm) doc.cm.curOp.userSelChange = true; + } + + function filterSelectionChange(doc, anchor, head) { + var obj = {anchor: anchor, head: head}; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + obj.anchor = clipPos(doc, obj.anchor); obj.head = clipPos(doc, obj.head); + return obj; + } + + // Update the selection. Last two args are only used by + // updateDoc, since they have to be expressed in the line + // numbers before the update. + function setSelection(doc, anchor, head, bias, checkAtomic) { + if (!checkAtomic && hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) { + var filtered = filterSelectionChange(doc, anchor, head); + head = filtered.head; + anchor = filtered.anchor; + } + + var sel = doc.sel; + sel.goalColumn = null; + // Skip over atomic spans. + if (checkAtomic || !posEq(anchor, sel.anchor)) + anchor = skipAtomic(doc, anchor, bias, checkAtomic != "push"); + if (checkAtomic || !posEq(head, sel.head)) + head = skipAtomic(doc, head, bias, checkAtomic != "push"); + + if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return; + + sel.anchor = anchor; sel.head = head; + var inv = posLess(head, anchor); + sel.from = inv ? head : anchor; + sel.to = inv ? anchor : head; + + if (doc.cm) + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + + signalLater(doc, "cursorActivity", doc); + } + + function reCheckSelection(cm) { + setSelection(cm.doc, cm.doc.sel.from, cm.doc.sel.to, null, "push"); + } + + function skipAtomic(doc, pos, bias, mayClear) { + var flipped = false, curPos = pos; + var dir = bias || 1; + doc.cantEdit = false; + search: for (;;) { + var line = getLine(doc, curPos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} + } + } + if (!m.atomic) continue; + var newPos = m.find()[dir < 0 ? "from" : "to"]; + if (posEq(newPos, curPos)) { + newPos.ch += dir; + if (newPos.ch < 0) { + if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); + else newPos = null; + } else if (newPos.ch > line.text.length) { + if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); + else newPos = null; + } + if (!newPos) { + if (flipped) { + // Driven in a corner -- no valid cursor position found at all + // -- try again *with* clearing, if we didn't already + if (!mayClear) return skipAtomic(doc, pos, bias, true); + // Otherwise, turn off editing until further notice, and return the start of the doc + doc.cantEdit = true; + return Pos(doc.first, 0); + } + flipped = true; newPos = pos; dir = -dir; + } + } + curPos = newPos; + continue search; + } + } + } + return curPos; + } + } + + // SCROLLING + + function scrollCursorIntoView(cm) { + var coords = scrollPosIntoView(cm, cm.doc.sel.head); + if (!cm.state.focused) return; + var display = cm.display, box = getRect(display.sizer), doScroll = null, pTop = paddingTop(cm.display); + if (coords.top + pTop + box.top < 0) doScroll = true; + else if (coords.bottom + pTop + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; + if (doScroll != null && !phantom) { + var hidden = display.cursor.style.display == "none"; + if (hidden) { + display.cursor.style.display = ""; + display.cursor.style.left = coords.left + "px"; + display.cursor.style.top = (coords.top - display.viewOffset) + "px"; + } + display.cursor.scrollIntoView(doScroll); + if (hidden) display.cursor.style.display = "none"; + } + } + + function scrollPosIntoView(cm, pos, margin) { + if (margin == null) margin = 0; + for (;;) { + var changed = false, coords = cursorCoords(cm, pos); + var scrollPos = calculateScrollPos(cm, coords.left, coords.top - margin, coords.left, coords.bottom + margin); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + setScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; + } + if (!changed) return coords; + } + } + + function scrollIntoView(cm, x1, y1, x2, y2) { + var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); + if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); + if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); + } + + function calculateScrollPos(cm, x1, y1, x2, y2) { + var display = cm.display, pt = paddingTop(display); + y1 += pt; y2 += pt; + var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {}; + var docBottom = cm.doc.height + paddingVert(display); + var atTop = y1 < pt + 10, atBottom = y2 + pt > docBottom - 10; + if (y1 < screentop) result.scrollTop = atTop ? 0 : Math.max(0, y1); + else if (y2 > screentop + screen) result.scrollTop = (atBottom ? docBottom : y2) - screen; + + var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft; + x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth; + var gutterw = display.gutters.offsetWidth; + var atLeft = x1 < gutterw + 10; + if (x1 < screenleft + gutterw || atLeft) { + if (atLeft) x1 = 0; + result.scrollLeft = Math.max(0, x1 - 10 - gutterw); + } else if (x2 > screenw + screenleft - 3) { + result.scrollLeft = x2 + 10 - screenw; + } + return result; + } + + function updateScrollPos(cm, left, top) { + cm.curOp.updateScrollPos = {scrollLeft: left, scrollTop: top}; + } + + function addToScrollPos(cm, left, top) { + var pos = cm.curOp.updateScrollPos || (cm.curOp.updateScrollPos = {scrollLeft: cm.doc.scrollLeft, scrollTop: cm.doc.scrollTop}); + var scroll = cm.display.scroller; + pos.scrollTop = Math.max(0, Math.min(scroll.scrollHeight - scroll.clientHeight, pos.scrollTop + top)); + pos.scrollLeft = Math.max(0, Math.min(scroll.scrollWidth - scroll.clientWidth, pos.scrollLeft + left)); + } + + // API UTILITIES + + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc; + if (!how) how = "add"; + if (how == "smart") { + if (!cm.doc.mode.indent) how = "prev"; + else var state = getStateBefore(cm, n); + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (how == "smart") { + indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass) { + if (!aggressive) return; + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); + else indentation = 0; + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + if (pos < indentation) indentString += spaceStr(indentation - pos); + + if (indentString != curSpaceString) + replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + } + + function changeLine(cm, handle, op) { + var no = handle, line = handle, doc = cm.doc; + if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no)) regChange(cm, no, no + 1); + else return null; + return line; + } + + function findPosH(doc, pos, dir, unit, visually) { + var line = pos.line, ch = pos.ch; + var lineObj = getLine(doc, line); + var possible = true; + function findNextLine() { + var l = line + dir; + if (l < doc.first || l >= doc.first + doc.size) return (possible = false); + line = l; + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); + if (next == null) { + if (!boundToLine && findNextLine()) { + if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); + else ch = dir < 0 ? lineObj.text.length : 0; + } else return (possible = false); + } else ch = next; + return true; + } + + if (unit == "char") moveOnce(); + else if (unit == "column") moveOnce(true); + else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) break; + var cur = lineObj.text.charAt(ch) || "\n"; + var type = isWordChar(cur) ? "w" + : !group ? null + : /\s/.test(cur) ? null + : "p"; + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce();} + break; + } + if (type) sawType = type; + if (dir > 0 && !moveOnce(!first)) break; + } + } + var result = skipAtomic(doc, Pos(line, ch), dir, true); + if (!possible) result.hitSide = true; + return result; + } + + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + for (;;) { + var target = coordsChar(cm, x, y); + if (!target.outside) break; + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } + y += dir * 5; + } + return target; + } + + function findWordAt(line, pos) { + var start = pos.ch, end = pos.ch; + if (line) { + if (pos.after === false || end == line.length) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar) ? isWordChar + : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} + : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return {from: Pos(pos.line, start), to: Pos(pos.line, end)}; + } + + function selectLine(cm, line) { + extendSelection(cm.doc, Pos(line, 0), clipPos(cm.doc, Pos(line + 1, 0))); + } + + // PROTOTYPE + + // The publicly visible API. Note that operation(null, f) means + // 'wrap f in an operation, performed on its `this` parameter' + + CodeMirror.prototype = { + focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") return; + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + operation(this, optionHandlers[option])(this, value, old); + }, + + getOption: function(option) {return this.options[option];}, + getDoc: function() {return this.doc;}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](map); + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + if ((typeof map == "string" ? maps[i].name : maps[i]) == map) { + maps.splice(i, 1); + return true; + } + }, + + addOverlay: operation(null, function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) throw new Error("Overlays may not be stateful."); + this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: operation(null, function(spec) { + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + if (overlays[i].modeSpec == spec) { + overlays.splice(i, 1); + this.state.modeGen++; + regChange(this); + return; + } + } + }), + + indentLine: operation(null, function(n, dir, aggressive) { + if (typeof dir != "string") { + if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); + }), + indentSelection: operation(null, function(how) { + var sel = this.doc.sel; + if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how); + var e = sel.to.line - (sel.to.ch ? 0 : 1); + for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how); + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos) { + var doc = this.doc; + pos = clipPos(doc, pos); + var state = getStateBefore(this, pos.line), mode = this.doc.mode; + var line = getLine(doc, pos.line); + var stream = new StringStream(line.text, this.options.tabSize); + while (stream.pos < pos.ch && !stream.eol()) { + stream.start = stream.pos; + var style = mode.token(stream, state); + } + return {start: stream.start, + end: stream.pos, + string: stream.current(), + className: style || null, // Deprecated, use 'type' instead + type: style || null, + state: state}; + }, + + getStateAfter: function(line) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getStateBefore(this, line + 1); + }, + + cursorCoords: function(start, mode) { + var pos, sel = this.doc.sel; + if (start == null) pos = sel.head; + else if (typeof start == "object") pos = clipPos(this.doc, start); + else pos = start ? sel.from : sel.to; + return cursorCoords(this, pos, mode || "page"); + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + + defaultTextHeight: function() { return textHeight(this.display); }, + defaultCharWidth: function() { return charWidth(this.display); }, + + setGutterMarker: operation(null, function(line, gutterID, value) { + return changeLine(this, line, function(line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) line.gutterMarkers = null; + return true; + }); + }), + + clearGutter: operation(null, function(gutterID) { + var cm = this, doc = cm.doc, i = doc.first; + doc.iter(function(line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + line.gutterMarkers[gutterID] = null; + regChange(cm, i, i + 1); + if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; + } + ++i; + }); + }), + + addLineClass: operation(null, function(handle, where, cls) { + return changeLine(this, handle, function(line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (new RegExp("\\b" + cls + "\\b").test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + + removeLineClass: operation(null, function(handle, where, cls) { + return changeLine(this, handle, function(line) { + var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var upd = cur.replace(new RegExp("^" + cls + "\\b\\s*|\\s*\\b" + cls + "\\b"), ""); + if (upd == cur) return false; + line[prop] = upd || null; + } + return true; + }); + }), + + addLineWidget: operation(null, function(handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + + removeLineWidget: function(widget) { widget.clear(); }, + + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.doc, line)) return null; + var n = line; + line = getLine(this.doc, line); + if (!line) return null; + } else { + var n = lineNo(line); + if (n == null) return null; + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets}; + }, + + getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + top = pos.top - node.offsetHeight; + else if (pos.bottom + node.offsetHeight <= vspace) + top = pos.bottom; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = (top + paddingTop(display)) + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; + node.style.left = left + "px"; + } + if (scroll) + scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + triggerOnKeyDown: operation(null, onKeyDown), + + execCommand: function(cmd) {return commands[cmd](this);}, + + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + cur = findPosH(this.doc, cur, dir, unit, visually); + if (cur.hitSide) break; + } + return cur; + }, + + moveH: operation(null, function(dir, unit) { + var sel = this.doc.sel, pos; + if (sel.shift || sel.extend || posEq(sel.from, sel.to)) + pos = findPosH(this.doc, sel.head, dir, unit, this.options.rtlMoveVisually); + else + pos = dir < 0 ? sel.from : sel.to; + extendSelection(this.doc, pos, pos, dir); + }), + + deleteH: operation(null, function(dir, unit) { + var sel = this.doc.sel; + if (!posEq(sel.from, sel.to)) replaceRange(this.doc, "", sel.from, sel.to, "+delete"); + else replaceRange(this.doc, "", sel.from, findPosH(this.doc, sel.head, dir, unit, false), "+delete"); + this.curOp.userSelChange = true; + }), + + findPosV: function(from, amount, unit, goalColumn) { + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + var coords = cursorCoords(this, cur, "div"); + if (x == null) x = coords.left; + else coords.left = x; + cur = findPosV(this, coords, dir, unit); + if (cur.hitSide) break; + } + return cur; + }, + + moveV: operation(null, function(dir, unit) { + var sel = this.doc.sel; + var pos = cursorCoords(this, sel.head, "div"); + if (sel.goalColumn != null) pos.left = sel.goalColumn; + var target = findPosV(this, pos, dir, unit); + + if (unit == "page") addToScrollPos(this, 0, charCoords(this, target, "div").top - pos.top); + extendSelection(this.doc, target, target, dir); + sel.goalColumn = pos.left; + }), + + toggleOverwrite: function() { + if (this.state.overwrite = !this.state.overwrite) + this.display.cursor.className += " CodeMirror-overwrite"; + else + this.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", ""); + }, + hasFocus: function() { return this.state.focused; }, + + scrollTo: operation(null, function(x, y) { + updateScrollPos(this, x, y); + }), + getScrollInfo: function() { + var scroller = this.display.scroller, co = scrollerCutOff; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - co, width: scroller.scrollWidth - co, + clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co}; + }, + + scrollIntoView: function(pos, margin) { + if (typeof pos == "number") pos = Pos(pos, 0); + if (!pos || pos.line != null) { + pos = pos ? clipPos(this.doc, pos) : this.doc.sel.head; + scrollPosIntoView(this, pos, margin); + } else { + scrollIntoView(this, pos.left, pos.top - margin, pos.right, pos.bottom + margin); + } + }, + + setSize: function(width, height) { + function interpret(val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + } + if (width != null) this.display.wrapper.style.width = interpret(width); + if (height != null) this.display.wrapper.style.height = interpret(height); + this.refresh(); + }, + + on: function(type, f) {on(this, type, f);}, + off: function(type, f) {off(this, type, f);}, + + operation: function(f){return runInOp(this, f);}, + + refresh: operation(null, function() { + clearCaches(this); + updateScrollPos(this, this.doc.scrollLeft, this.doc.scrollTop); + regChange(this); + }), + + swapDoc: operation(null, function(doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + updateScrollPos(this, doc.scrollLeft, doc.scrollTop); + return old; + }), + + getInputField: function(){return this.display.input;}, + getWrapperElement: function(){return this.display.wrapper;}, + getScrollerElement: function(){return this.display.scroller;}, + getGutterElement: function(){return this.display.gutters;} + }; + + // OPTION DEFAULTS + + var optionHandlers = CodeMirror.optionHandlers = {}; + + // The default configuration options. + var defaults = CodeMirror.defaults = {}; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) optionHandlers[name] = + notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; + } + + var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function(cm, val) { + cm.setValue(val); + }, true); + option("mode", null, function(cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function(cm) { + loadMode(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("electricChars", true); + option("rtlMoveVisually", !windows); + + option("theme", "default", function(cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", keyMapChanged); + option("extraKeys", null); + + option("onKeyEvent", null); + option("onDragEvent", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function(cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("lineNumbers", false, function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") {onBlur(cm); cm.display.input.blur();} + else if (!val) resetInput(cm, true); + }); + option("dragDrop", true); + + option("cursorBlinkRate", 530); + option("cursorHeight", 1); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true); + option("pollInterval", 100); + option("undoDepth", 40, function(cm, val){cm.doc.history.undoDepth = val;}); + option("viewportMargin", 10, function(cm){cm.refresh();}, true); + + option("tabindex", null, function(cm, val) { + cm.display.input.tabIndex = val || ""; + }); + option("autofocus", null); + + // MODE DEFINITION AND QUERYING + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + if (arguments.length > 2) { + mode.dependencies = []; + for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]); + } + modes[name] = mode; + }; + + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) + spec = mimeModes[spec]; + else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) + return CodeMirror.resolveMode("application/xml"); + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + + CodeMirror.getMode = function(options, spec) { + spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) return CodeMirror.getMode(options, "text/plain"); + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) continue; + if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + return modeObj; + }; + + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + var modeExtensions = CodeMirror.modeExtensions = {}; + CodeMirror.extendMode = function(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + }; + + // EXTENSIONS + + CodeMirror.defineExtension = function(name, func) { + CodeMirror.prototype[name] = func; + }; + + CodeMirror.defineOption = option; + + var initHooks = []; + CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; + + // MODE STATE HANDLING + + // Utility functions for working with state. Exported because modes + // sometimes need to do this. + function copyState(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + } + CodeMirror.copyState = copyState; + + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + } + CodeMirror.startState = startState; + + CodeMirror.innerMode = function(mode, state) { + while (mode.innerMode) { + var info = mode.innerMode(state); + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state}; + }; + + // STANDARD COMMANDS + + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()));}, + killLine: function(cm) { + var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); + if (!sel && cm.getLine(from.line).length == from.ch) + cm.replaceRange("", from, Pos(from.line + 1, 0), "+delete"); + else cm.replaceRange("", from, sel ? to : Pos(from.line), "+delete"); + }, + deleteLine: function(cm) { + var l = cm.getCursor().line; + cm.replaceRange("", Pos(l, 0), Pos(l), "+delete"); + }, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, + goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, + goLineStart: function(cm) { + cm.extendSelection(lineStart(cm, cm.getCursor().line)); + }, + goLineStartSmart: function(cm) { + var cur = cm.getCursor(), start = lineStart(cm, cur.line); + var line = cm.getLineHandle(start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch; + cm.extendSelection(Pos(start.line, inWS ? 0 : firstNonWS)); + } else cm.extendSelection(start); + }, + goLineEnd: function(cm) { + cm.extendSelection(lineEnd(cm, cm.getCursor().line)); + }, + goLineRight: function(cm) { + var top = cm.charCoords(cm.getCursor(), "div").top + 5; + cm.extendSelection(cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")); + }, + goLineLeft: function(cm) { + var top = cm.charCoords(cm.getCursor(), "div").top + 5; + cm.extendSelection(cm.coordsChar({left: 0, top: top}, "div")); + }, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goGroupRight: function(cm) {cm.moveH(1, "group");}, + goGroupLeft: function(cm) {cm.moveH(-1, "group");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharBefore: function(cm) {cm.deleteH(-1, "char");}, + delCharAfter: function(cm) {cm.deleteH(1, "char");}, + delWordBefore: function(cm) {cm.deleteH(-1, "word");}, + delWordAfter: function(cm) {cm.deleteH(1, "word");}, + delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, + delGroupAfter: function(cm) {cm.deleteH(1, "group");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t", "end", "+input");}, + defaultTab: function(cm) { + if (cm.somethingSelected()) cm.indentSelection("add"); + else cm.replaceSelection("\t", "end", "+input"); + }, + transposeChars: function(cm) { + var cur = cm.getCursor(), line = cm.getLine(cur.line); + if (cur.ch > 0 && cur.ch < line.length - 1) + cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), + Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + }, + newlineAndIndent: function(cm) { + operation(cm, function() { + cm.replaceSelection("\n", "end", "+input"); + cm.indentLine(cm.getCursor().line, null, true); + })(); + }, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + // STANDARD KEYMAPS + + var keyMap = CodeMirror.keyMap = {}; + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite" + }; + // Note that the save and find-related commands aren't defined by + // default. Unknown commands are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + fallthrough: "basic" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + }; + + // KEYMAP DISPATCH + + function getKeyMap(val) { + if (typeof val == "string") return keyMap[val]; + else return val; + } + + function lookupKey(name, maps, handle) { + function lookup(map) { + map = getKeyMap(map); + var found = map[name]; + if (found === false) return "stop"; + if (found != null && handle(found)) return true; + if (map.nofallthrough) return "stop"; + + var fallthrough = map.fallthrough; + if (fallthrough == null) return false; + if (Object.prototype.toString.call(fallthrough) != "[object Array]") + return lookup(fallthrough); + for (var i = 0, e = fallthrough.length; i < e; ++i) { + var done = lookup(fallthrough[i]); + if (done) return done; + } + return false; + } + + for (var i = 0; i < maps.length; ++i) { + var done = lookup(maps[i]); + if (done) return done; + } + } + function isModifierKey(event) { + var name = keyNames[event.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + } + function keyName(event, noShift) { + var name = keyNames[event.keyCode]; + if (name == null || event.altGraphKey) return false; + if (event.altKey) name = "Alt-" + name; + if (flipCtrlCmd ? event.metaKey : event.ctrlKey) name = "Ctrl-" + name; + if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = "Cmd-" + name; + if (!noShift && event.shiftKey) name = "Shift-" + name; + return name; + } + CodeMirror.lookupKey = lookupKey; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.keyName = keyName; + + // FROMTEXTAREA + + CodeMirror.fromTextArea = function(textarea, options) { + if (!options) options = {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabindex) + options.tabindex = textarea.tabindex; + if (!options.placeholder && textarea.placeholder) + options.placeholder = textarea.placeholder; + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = document.body; + // doc.activeElement occasionally throws on IE + try { hasFocus = document.activeElement; } catch(e) {} + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form, realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function() { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + textarea.style.display = "none"; + var cm = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + cm.save = save; + cm.getTextArea = function() { return textarea; }; + cm.toTextArea = function() { + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + return cm; + }; + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + // The character stream used by a mode's parser. + function StringStream(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + } + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == 0;}, + peek: function() {return this.string.charAt(this.pos) || undefined;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue; + }, + indentation: function() {return countColumn(this.string, null, this.tabSize);}, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) return null; + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);} + }; + CodeMirror.StringStream = StringStream; + + // TEXTMARKERS + + function TextMarker(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + } + CodeMirror.TextMarker = TextMarker; + + TextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) startOperation(cm); + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.to != null) max = lineNo(line); + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from != null) + min = lineNo(line); + else if (this.collapsed && !lineIsHidden(this.doc, line) && cm) + updateLineHeight(line, textHeight(cm.display)); + } + if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { + var visual = visualLine(cm.doc, this.lines[i]), len = lineLength(cm.doc, visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + + if (min != null && cm) regChange(cm, min, max + 1); + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.collapsed && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) reCheckSelection(cm); + } + if (withOp) endOperation(cm); + signalLater(this, "clear"); + }; + + TextMarker.prototype.find = function() { + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null || span.to != null) { + var found = lineNo(line); + if (span.from != null) from = Pos(found, span.from); + if (span.to != null) to = Pos(found, span.to); + } + } + if (this.type == "bookmark") return from; + return from && {from: from, to: to}; + }; + + TextMarker.prototype.getOptions = function(copyWidget) { + var repl = this.replacedWith; + return {className: this.className, + inclusiveLeft: this.inclusiveLeft, inclusiveRight: this.inclusiveRight, + atomic: this.atomic, + collapsed: this.collapsed, + replacedWith: copyWidget ? repl && repl.cloneNode(true) : repl, + readOnly: this.readOnly, + startStyle: this.startStyle, endStyle: this.endStyle}; + }; + + TextMarker.prototype.attachLine = function(line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function(line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + + function markText(doc, from, to, options, type) { + if (options && options.shared) return markTextShared(doc, from, to, options, type); + if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); + + var marker = new TextMarker(doc, type); + if (type == "range" && !posLess(from, to)) return marker; + if (options) copyObj(options, marker); + if (marker.replacedWith) { + marker.collapsed = true; + marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget"); + } + if (marker.collapsed) sawCollapsedSpans = true; + + var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function(line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.display.maxLine) + updateMaxLine = true; + var span = {from: null, to: null, marker: marker}; + size += line.text.length; + if (curLine == from.line) {span.from = from.ch; size -= from.ch;} + if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;} + if (marker.collapsed) { + if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch); + if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch); + else updateLineHeight(line, 0); + } + addMarkedSpan(line, span); + ++curLine; + }); + if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { + if (lineIsHidden(doc, line)) updateLineHeight(line, 0); + }); + + if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); + + if (marker.readOnly) { + sawReadOnlySpans = true; + if (doc.history.done.length || doc.history.undone.length) + doc.clearHistory(); + } + if (marker.collapsed) { + if (collapsedAtStart != collapsedAtEnd) + throw new Error("Inserting collapsed marker overlapping an existing one"); + marker.size = size; + marker.atomic = true; + } + if (cm) { + if (updateMaxLine) cm.curOp.updateMaxLine = true; + if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed) + regChange(cm, from.line, to.line + 1); + if (marker.atomic) reCheckSelection(cm); + } + return marker; + } + + // SHARED TEXTMARKERS + + function SharedTextMarker(markers, primary) { + this.markers = markers; + this.primary = primary; + for (var i = 0, me = this; i < markers.length; ++i) { + markers[i].parent = this; + on(markers[i], "clear", function(){me.clear();}); + } + } + CodeMirror.SharedTextMarker = SharedTextMarker; + + SharedTextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + this.markers[i].clear(); + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function() { + return this.primary.find(); + }; + SharedTextMarker.prototype.getOptions = function(copyWidget) { + var inner = this.primary.getOptions(copyWidget); + inner.shared = true; + return inner; + }; + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.replacedWith; + linkedDocs(doc, function(doc) { + if (widget) options.replacedWith = widget.cloneNode(true); + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + if (doc.linked[i].isParent) return; + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + + // TEXTMARKER SPANS + + function getMarkedSpanFor(spans, marker) { + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) return span; + } + } + function removeMarkedSpan(spans, span) { + for (var r, i = 0; i < spans.length; ++i) + if (spans[i] != span) (r || (r = [])).push(spans[i]); + return r; + } + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + function markedSpansBefore(old, startCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || marker.type == "bookmark" && span.from == startCh && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push({from: span.from, + to: endsAfter ? null : span.to, + marker: marker}); + } + } + return nw; + } + + function markedSpansAfter(old, endCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || marker.type == "bookmark" && span.from == endCh && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh, + to: span.to == null ? null : span.to - endCh, + marker: marker}); + } + } + return nw; + } + + function stretchSpansOverChange(doc, change) { + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) return null; + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = posEq(change.from, change.to); + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) span.to = startCh; + else if (sameLine) span.to = found.to == null ? null : found.to + offset; + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i = 0; i < last.length; ++i) { + var span = last[i]; + if (span.to != null) span.to += offset; + if (span.from == null) { + var found = getMarkedSpanFor(first, span.marker); + if (!found) { + span.from = offset; + if (sameLine) (first || (first = [])).push(span); + } + } else { + span.from += offset; + if (sameLine) (first || (first = [])).push(span); + } + } + } + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + for (var i = 0; i < first.length; ++i) + if (first[i].to == null) + (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker}); + for (var i = 0; i < gap; ++i) + newMarkers.push(gapMarkers); + newMarkers.push(last); + } + return newMarkers; + } + + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) return stretched; + if (!stretched) return old; + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + if (oldCur[k].marker == span.marker) continue spans; + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function(line) { + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + (markers || (markers = [])).push(mark); + } + }); + if (!markers) return null; + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (posLess(p.to, m.from) || posLess(m.to, p.from)) continue; + var newParts = [j, 1]; + if (posLess(p.from, m.from) || !mk.inclusiveLeft && posEq(p.from, m.from)) + newParts.push({from: p.from, to: m.from}); + if (posLess(m.to, p.to) || !mk.inclusiveRight && posEq(p.to, m.to)) + newParts.push({from: m.to, to: p.to}); + parts.splice.apply(parts, newParts); + j += newParts.length - 1; + } + } + return parts; + } + + function collapsedSpanAt(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if ((sp.from == null || sp.from < ch) && + (sp.to == null || sp.to > ch) && + (!found || found.width < sp.marker.width)) + found = sp.marker; + } + return found; + } + function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); } + function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); } + + function visualLine(doc, line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + line = getLine(doc, merged.find().from.line); + return line; + } + + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if (sp.from == null) return true; + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + return true; + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find().to, endLine = getLine(doc, end.line); + return lineIsHiddenInner(doc, endLine, getMarkedSpanFor(endLine.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) + return true; + for (var sp, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && sp.from == span.to && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) return true; + } + } + + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.detachLine(line); + line.markedSpans = null; + } + + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.attachLine(line); + line.markedSpans = spans; + } + + // LINE WIDGETS + + var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { + for (var opt in options) if (options.hasOwnProperty(opt)) + this[opt] = options[opt]; + this.cm = cm; + this.node = node; + }; + function widgetOperation(f) { + return function() { + var withOp = !this.cm.curOp; + if (withOp) startOperation(this.cm); + try {var result = f.apply(this, arguments);} + finally {if (withOp) endOperation(this.cm);} + return result; + }; + } + LineWidget.prototype.clear = widgetOperation(function() { + var ws = this.line.widgets, no = lineNo(this.line); + if (no == null || !ws) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); + if (!ws.length) this.line.widgets = null; + updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this))); + regChange(this.cm, no, no + 1); + }); + LineWidget.prototype.changed = widgetOperation(function() { + var oldH = this.height; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) return; + updateLineHeight(this.line, this.line.height + diff); + var no = lineNo(this.line); + regChange(this.cm, no, no + 1); + }); + + function widgetHeight(widget) { + if (widget.height != null) return widget.height; + if (!widget.node.parentNode || widget.node.parentNode.nodeType != 1) + removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, "position: relative")); + return widget.height = widget.node.offsetHeight; + } + + function addLineWidget(cm, handle, node, options) { + var widget = new LineWidget(cm, node, options); + if (widget.noHScroll) cm.display.alignWidgets = true; + changeLine(cm, handle, function(line) { + (line.widgets || (line.widgets = [])).push(widget); + widget.line = line; + if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) { + var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) addToScrollPos(cm, 0, widget.height); + } + return true; + }); + return widget; + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + function makeLine(text, markedSpans, estimateHeight) { + var line = {text: text}; + attachMarkedSpans(line, markedSpans); + line.height = estimateHeight ? estimateHeight(line) : 1; + return line; + } + + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + if (line.order != null) line.order = null; + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) updateLineHeight(line, estHeight); + } + + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Run the given mode's parser over a line, update the styles + // array, which contains alternating fragments of text and CSS + // classes. + function runMode(cm, text, mode, state, f) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; + var curText = "", curStyle = null; + var stream = new StringStream(text, cm.options.tabSize); + if (text == "" && mode.blankLine) mode.blankLine(state); + while (!stream.eol()) { + var style = mode.token(stream, state); + if (stream.pos > 5000) { + flattenSpans = false; + // Webkit seems to refuse to render text nodes longer than 57444 characters + stream.pos = Math.min(text.length, stream.start + 50000); + style = null; + } + var substr = stream.current(); + stream.start = stream.pos; + if (!flattenSpans || curStyle != style) { + if (curText) f(curText, curStyle); + curText = substr; curStyle = style; + } else curText = curText + substr; + } + if (curText) f(curText, curStyle); + } + + function highlightLine(cm, line, state) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen]; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, state, function(txt, style) {st.push(txt, style);}); + + // Run overlays, adjust style array. + for (var o = 0; o < cm.state.overlays.length; ++o) { + var overlay = cm.state.overlays[o], i = 1; + runMode(cm, line.text, overlay.mode, true, function(txt, style) { + var start = i, len = txt.length; + // Ensure there's a token end at the current position, and that i points at it + while (len) { + var cur = st[i], len_ = cur.length; + if (len_ <= len) { + len -= len_; + } else { + st.splice(i, 1, cur.slice(0, len), st[i+1], cur.slice(len)); + len = 0; + } + i += 2; + } + if (!style) return; + if (overlay.opaque) { + st.splice(start, i - start, txt, style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = cur ? cur + " " + style : style; + } + } + }); + } + + return st; + } + + function getLineStyles(cm, line) { + if (!line.styles || line.styles[0] != cm.state.modeGen) + line.styles = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + return line.styles; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. + function processLine(cm, line, state) { + var mode = cm.doc.mode; + var stream = new StringStream(line.text, cm.options.tabSize); + if (line.text == "" && mode.blankLine) mode.blankLine(state); + while (!stream.eol() && stream.pos <= 5000) { + mode.token(stream, state); + stream.start = stream.pos; + } + } + + var styleToClassCache = {}; + function styleToClass(style) { + if (!style) return null; + return styleToClassCache[style] || + (styleToClassCache[style] = "cm-" + style.replace(/ +/g, " cm-")); + } + + function lineContent(cm, realLine, measure) { + var merged, line = realLine, lineBefore, sawBefore, simple = true; + while (merged = collapsedSpanAtStart(line)) { + simple = false; + line = getLine(cm.doc, merged.find().from.line); + if (!lineBefore) lineBefore = line; + } + + var builder = {pre: elt("pre"), col: 0, pos: 0, display: !measure, + measure: null, addedOne: false, cm: cm}; + if (line.textClass) builder.pre.className = line.textClass; + + do { + builder.measure = line == realLine && measure; + builder.pos = 0; + builder.addToken = builder.measure ? buildTokenMeasure : buildToken; + if ((ie || webkit) && cm.getOption("lineWrapping")) + builder.addToken = buildTokenSplitSpaces(builder.addToken); + if (measure && sawBefore && line != realLine && !builder.addedOne) { + measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure)); + builder.addedOne = true; + } + var next = insertLineContent(line, builder, getLineStyles(cm, line)); + sawBefore = line == lineBefore; + if (next) { + line = getLine(cm.doc, next.to.line); + simple = false; + } + } while (next); + + if (measure && !builder.addedOne) + measure[0] = builder.pre.appendChild(simple ? elt("span", "\u00a0") : zeroWidthElement(cm.display.measure)); + if (!builder.pre.firstChild && !lineIsHidden(cm.doc, realLine)) + builder.pre.appendChild(document.createTextNode("\u00a0")); + + var order; + // Work around problem with the reported dimensions of single-char + // direction spans on IE (issue #1129). See also the comment in + // cursorCoords. + if (measure && ie && (order = getOrder(line))) { + var l = order.length - 1; + if (order[l].from == order[l].to) --l; + var last = order[l], prev = order[l - 1]; + if (last.from + 1 == last.to && prev && last.level < prev.level) { + var span = measure[builder.pos - 1]; + if (span) span.parentNode.insertBefore(span.measureRight = zeroWidthElement(cm.display.measure), + span.nextSibling); + } + } + + signal(cm, "renderLine", cm, realLine, builder.pre); + return builder.pre; + } + + var tokenSpecialChars = /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g; + function buildToken(builder, text, style, startStyle, endStyle) { + if (!text) return; + if (!tokenSpecialChars.test(text)) { + builder.col += text.length; + var content = document.createTextNode(text); + } else { + var content = document.createDocumentFragment(), pos = 0; + while (true) { + tokenSpecialChars.lastIndex = pos; + var m = tokenSpecialChars.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + content.appendChild(document.createTextNode(text.slice(pos, pos + skipped))); + builder.col += skipped; + } + if (!m) break; + pos += skipped + 1; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + builder.col += tabWidth; + } else { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + m[0].charCodeAt(0).toString(16); + content.appendChild(token); + builder.col += 1; + } + } + } + if (style || startStyle || endStyle || builder.measure) { + var fullStyle = style || ""; + if (startStyle) fullStyle += startStyle; + if (endStyle) fullStyle += endStyle; + return builder.pre.appendChild(elt("span", [content], fullStyle)); + } + builder.pre.appendChild(content); + } + + function buildTokenMeasure(builder, text, style, startStyle, endStyle) { + var wrapping = builder.cm.options.lineWrapping; + for (var i = 0; i < text.length; ++i) { + var ch = text.charAt(i), start = i == 0; + if (ch >= "\ud800" && ch < "\udbff" && i < text.length - 1) { + ch = text.slice(i, i + 2); + ++i; + } else if (i && wrapping && + spanAffectsWrapping.test(text.slice(i - 1, i + 1))) { + builder.pre.appendChild(elt("wbr")); + } + var span = builder.measure[builder.pos] = + buildToken(builder, ch, style, + start && startStyle, i == text.length - 1 && endStyle); + // In IE single-space nodes wrap differently than spaces + // embedded in larger text nodes, except when set to + // white-space: normal (issue #1268). + if (ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) && + i < text.length - 1 && !/\s/.test(text.charAt(i + 1))) + span.style.whiteSpace = "normal"; + builder.pos += ch.length; + } + if (text.length) builder.addedOne = true; + } + + function buildTokenSplitSpaces(inner) { + function split(old) { + var out = " "; + for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; + out += " "; + return out; + } + return function(builder, text, style, startStyle, endStyle) { + return inner(builder, text.replace(/ {3,}/, split), style, startStyle, endStyle); + }; + } + + function buildCollapsedSpan(builder, size, widget) { + if (widget) { + if (!builder.display) widget = widget.cloneNode(true); + builder.pre.appendChild(widget); + if (builder.measure && size) { + builder.measure[builder.pos] = widget; + builder.addedOne = true; + } + } + builder.pos += size; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans; + if (!spans) { + for (var i = 1; i < styles.length; i+=2) + builder.addToken(builder, styles[i], styleToClass(styles[i+1])); + return; + } + + var allText = line.text, len = allText.length; + var pos = 0, i = 1, text = "", style; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = ""; + collapsed = null; nextChange = Infinity; + var foundBookmark = null; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (sp.from <= pos && (sp.to == null || sp.to > pos)) { + if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } + if (m.className) spanStyle += " " + m.className; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; + if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; + if (m.collapsed && (!collapsed || collapsed.marker.width < m.width)) + collapsed = sp; + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + if (m.type == "bookmark" && sp.from == pos && m.replacedWith) + foundBookmark = m.replacedWith; + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos, + collapsed.from != null && collapsed.marker.replacedWith); + if (collapsed.to == null) return collapsed.marker.find(); + } + if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark); + } + if (pos >= len) break; + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : ""); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + spanStartStyle = ""; + } + text = styles[i++]; style = styleToClass(styles[i++]); + } + } + } + + // DOCUMENT DATA STRUCTURE + + function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null;} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // First adjust the line structure + if (from.ch == 0 && to.ch == 0 && lastText == "") { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + for (var i = 0, e = text.length - 1, added = []; i < e; ++i) + added.push(makeLine(text[i], spansFor(i), estimateHeight)); + update(lastLine, lastLine.text, lastSpans); + if (nlines) doc.remove(from.line, nlines); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + for (var added = [], i = 1, e = text.length - 1; i < e; ++i) + added.push(makeLine(text[i], spansFor(i), estimateHeight)); + added.push(makeLine(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + for (var i = 1, e = text.length - 1, added = []; i < e; ++i) + added.push(makeLine(text[i], spansFor(i), estimateHeight)); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1); + doc.insert(from.line + 1, added); + } + + signalLater(doc, "change", doc, change); + setSelection(doc, selAfter.anchor, selAfter.head, null, true); + } + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, e = lines.length, height = 0; i < e; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + removeInner: function(at, n) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + collapse: function(lines) { + lines.splice.apply(lines, [lines.length, 0].concat(this.lines)); + }, + insertInner: function(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this; + }, + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0, e = children.length; i < e; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + removeInner: function(at, n) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + if (this.size - n < 25) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines); + }, + insertInner: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0, e = this.children.length; i < e; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + while (child.lines.length > 50) { + var spilled = child.lines.splice(child.lines.length - 25, 25); + var newleaf = new LeafChunk(spilled); + child.height -= newleaf.height; + this.children.splice(i + 1, 0, newleaf); + newleaf.parent = this; + } + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function(at, n, op) { + for (var i = 0, e = this.children.length; i < e; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + var nextDocId = 0; + var Doc = CodeMirror.Doc = function(text, mode, firstLine) { + if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); + if (firstLine == null) firstLine = 0; + + BranchChunk.call(this, [new LeafChunk([makeLine("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.history = makeHistory(); + this.frontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = {from: start, to: start, head: start, anchor: start, shift: false, extend: false, goalColumn: null}; + this.id = ++nextDocId; + this.modeOption = mode; + + if (typeof text == "string") text = splitLines(text); + updateDoc(this, {from: start, to: start, text: text}, null, {head: start, anchor: start}); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + iter: function(from, to, op) { + if (op) this.iterN(from - this.first, to - from, op); + else this.iterN(this.first, this.first + this.size, from); + }, + + insert: function(at, lines) { + var height = 0; + for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height; + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + setValue: function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: splitLines(code), origin: "setValue"}, + {head: top, anchor: top}, true); + }, + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, + setLine: function(line, text) { + if (isLine(this, line)) + replaceRange(this, text, Pos(line, 0), clipPos(this, Pos(line))); + }, + removeLine: function(line) { + if (isLine(this, line)) + replaceRange(this, "", Pos(line, 0), clipPos(this, Pos(line + 1, 0))); + }, + + getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, + getLineNumber: function(line) {return lineNo(line);}, + + lineCount: function() {return this.size;}, + firstLine: function() {return this.first;}, + lastLine: function() {return this.first + this.size - 1;}, + + clipPos: function(pos) {return clipPos(this, pos);}, + + getCursor: function(start) { + var sel = this.sel, pos; + if (start == null || start == "head") pos = sel.head; + else if (start == "anchor") pos = sel.anchor; + else if (start == "end" || start === false) pos = sel.to; + else pos = sel.from; + return copyPos(pos); + }, + somethingSelected: function() {return !posEq(this.sel.head, this.sel.anchor);}, + + setCursor: docOperation(function(line, ch, extend) { + var pos = clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line); + if (extend) extendSelection(this, pos); + else setSelection(this, pos, pos); + }), + setSelection: docOperation(function(anchor, head) { + setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor)); + }), + extendSelection: docOperation(function(from, to) { + extendSelection(this, clipPos(this, from), to && clipPos(this, to)); + }), + + getSelection: function(lineSep) {return this.getRange(this.sel.from, this.sel.to, lineSep);}, + replaceSelection: function(code, collapse, origin) { + makeChange(this, {from: this.sel.from, to: this.sel.to, text: splitLines(code), origin: origin}, collapse || "around"); + }, + undo: docOperation(function() {makeChangeFromHistory(this, "undo");}), + redo: docOperation(function() {makeChangeFromHistory(this, "redo");}), + + setExtending: function(val) {this.sel.extend = val;}, + + historySize: function() { + var hist = this.history; + return {undo: hist.done.length, redo: hist.undone.length}; + }, + clearHistory: function() {this.history = makeHistory();}, + + markClean: function() { + this.history.dirtyCounter = 0; + this.history.lastOp = this.history.lastOrigin = null; + }, + isClean: function () {return this.history.dirtyCounter == 0;}, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)}; + }, + setHistory: function(histData) { + var hist = this.history = makeHistory(); + hist.done = histData.done.slice(0); + hist.undone = histData.undone.slice(0); + }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + markers.push(span.marker.parent || span.marker); + } + return markers; + }, + getAllMarks: function() { + var markers = []; + this.iter(function(line) { + var sps = line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) + if (sps[i].from != null) markers.push(sps[i].marker); + }); + return markers; + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first; + this.iter(function(line) { + var sz = line.text.length + 1; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) return 0; + this.iter(this.first, coords.line, function (line) { + index += line.text.length + 1; + }); + return index; + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = {from: this.sel.from, to: this.sel.to, head: this.sel.head, anchor: this.sel.anchor, + shift: this.sel.shift, extend: false, goalColumn: this.sel.goalColumn}; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + + linkedDoc: function(options) { + if (!options) options = {}; + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) from = options.from; + if (options.to != null && options.to < to) to = options.to; + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); + if (options.sharedHist) copy.history = this.history; + (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + return copy; + }, + unlinkDoc: function(other) { + if (other instanceof CodeMirror) other = other.doc; + if (this.linked) for (var i = 0; i < this.linked.length; ++i) { + var link = this.linked[i]; + if (link.doc != other) continue; + this.linked.splice(i, 1); + other.unlinkDoc(this); + break; + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); + other.history = makeHistory(); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode;}, + getEditor: function() {return this.cm;} + }); + + Doc.prototype.eachLine = Doc.prototype.iter; + + // The Doc methods that should be available on CodeMirror instances + var dontDelegate = "iter insert remove copy getEditor".split(" "); + for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments);}; + })(Doc.prototype[prop]); + + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) continue; + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) continue; + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + propagate(doc, null, true); + } + + function attachDoc(cm, doc) { + if (doc.cm) throw new Error("This document is already in use."); + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + if (!cm.options.lineWrapping) computeMaxLength(cm); + cm.options.mode = doc.modeOption; + regChange(cm); + } + + // LINE UTILITIES + + function getLine(chunk, n) { + n -= chunk.first; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function(line) { + var text = line.text; + if (n == end.line) text = text.slice(0, end.ch); + if (n == start.line) text = text.slice(start.ch); + out.push(text); + ++n; + }); + return out; + } + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function(line) { out.push(line.text); }); + return out; + } + + function updateLineHeight(line, height) { + var diff = height - line.height; + for (var n = line; n; n = n.parent) n.height += diff; + } + + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i = 0, e = chunk.children.length; i < e; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0, e = chunk.lines.length; i < e; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + + function heightAtLine(cm, lineObj) { + lineObj = visualLine(cm.doc, lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) break; + else h += line.height; + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i = 0; i < p.children.length; ++i) { + var cur = p.children[i]; + if (cur == chunk) break; + else h += cur.height; + } + } + return h; + } + + function getOrder(line) { + var order = line.order; + if (order == null) order = line.order = bidiOrdering(line.text); + return order; + } + + // HISTORY + + function makeHistory() { + return { + // Arrays of history events. Doing something adds an event to + // done and clears undo. Undoing moves events from done to + // undone, redoing moves them in the other direction. + done: [], undone: [], undoDepth: Infinity, + // Used to track when changes can be merged into a single undo + // event + lastTime: 0, lastOp: null, lastOrigin: null, + // Used by the isClean() method + dirtyCounter: 0 + }; + } + + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { + if (line.markedSpans) + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + ++n; + }); + } + + function historyChangeFromChange(doc, change) { + var histChange = {from: change.from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); + return histChange; + } + + function addToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur = lst(hist.done); + + if (cur && + (hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && hist.lastTime > time - 600) || change.origin.charAt(0) == "*"))) { + // Merge this change into the last event + var last = lst(cur.changes); + if (posEq(change.from, change.to) && posEq(change.from, last.to)) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + cur.anchorAfter = selAfter.anchor; cur.headAfter = selAfter.head; + } else { + // Can not be merged, start a new event. + cur = {changes: [historyChangeFromChange(doc, change)], + anchorBefore: doc.sel.anchor, headBefore: doc.sel.head, + anchorAfter: selAfter.anchor, headAfter: selAfter.head}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) + hist.done.shift(); + if (hist.dirtyCounter < 0) + // The user has made a change after undoing past the last clean state. + // We can never get back to a clean state now until markClean() is called. + hist.dirtyCounter = NaN; + else + hist.dirtyCounter++; + } + hist.lastTime = time; + hist.lastOp = opId; + hist.lastOrigin = change.origin; + } + + function removeClearedSpans(spans) { + if (!spans) return null; + for (var i = 0, out; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } + else if (out) out.push(spans[i]); + } + return !out ? spans : out.length ? out : null; + } + + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) return null; + for (var i = 0, nw = []; i < change.text.length; ++i) + nw.push(removeClearedSpans(found[i])); + return nw; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup) { + for (var i = 0, copy = []; i < events.length; ++i) { + var event = events[i], changes = event.changes, newChanges = []; + copy.push({changes: newChanges, anchorBefore: event.anchorBefore, headBefore: event.headBefore, + anchorAfter: event.anchorAfter, headAfter: event.headAfter}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m; + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + return copy; + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSel(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + for (var j = 0; j < sub.changes.length; ++j) { + var cur = sub.changes[j]; + if (!sub.copied) { cur.from = copyPos(cur.from); cur.to = copyPos(cur.to); } + if (to < cur.from.line) { + cur.from.line += diff; + cur.to.line += diff; + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!sub.copied) { + sub.anchorBefore = copyPos(sub.anchorBefore); sub.headBefore = copyPos(sub.headBefore); + sub.anchorAfter = copyPos(sub.anchorAfter); sub.readAfter = copyPos(sub.headAfter); + sub.copied = true; + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } else { + rebaseHistSel(sub.anchorBefore); rebaseHistSel(sub.headBefore); + rebaseHistSel(sub.anchorAfter); rebaseHistSel(sub.headAfter); + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // EVENT OPERATORS + + function stopMethod() {e_stop(this);} + // Ensure an event has a stop method. + function addStop(event) { + if (!event.stop) event.stop = stopMethod; + return event; + } + + function e_preventDefault(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + } + function e_stopPropagation(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + } + function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} + CodeMirror.e_stop = e_stop; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) b = 1; + else if (e.button & 2) b = 3; + else if (e.button & 4) b = 2; + } + if (mac && e.ctrlKey && b == 1) b = 3; + return b; + } + + // EVENT HANDLING + + function on(emitter, type, f) { + if (emitter.addEventListener) + emitter.addEventListener(type, f, false); + else if (emitter.attachEvent) + emitter.attachEvent("on" + type, f); + else { + var map = emitter._handlers || (emitter._handlers = {}); + var arr = map[type] || (map[type] = []); + arr.push(f); + } + } + + function off(emitter, type, f) { + if (emitter.removeEventListener) + emitter.removeEventListener(type, f, false); + else if (emitter.detachEvent) + emitter.detachEvent("on" + type, f); + else { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + for (var i = 0; i < arr.length; ++i) + if (arr[i] == f) { arr.splice(i, 1); break; } + } + } + + function signal(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); + } + + var delayedCallbacks, delayedCallbackDepth = 0; + function signalLater(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2); + if (!delayedCallbacks) { + ++delayedCallbackDepth; + delayedCallbacks = []; + setTimeout(fireDelayed, 0); + } + function bnd(f) {return function(){f.apply(null, args);};}; + for (var i = 0; i < arr.length; ++i) + delayedCallbacks.push(bnd(arr[i])); + } + + function fireDelayed() { + --delayedCallbackDepth; + var delayed = delayedCallbacks; + delayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) delayed[i](); + } + + function hasHandler(emitter, type) { + var arr = emitter._handlers && emitter._handlers[type]; + return arr && arr.length > 0; + } + + CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal; + + // MISC UTILITIES + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerCutOff = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + function Delayed() {this.id = null;} + Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) { + if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); + else ++n; + } + return n; + } + CodeMirror.countColumn = countColumn; + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + spaceStrs.push(lst(spaceStrs) + " "); + return spaceStrs[n]; + } + + function lst(arr) { return arr[arr.length-1]; } + + function selectInput(node) { + if (ios) { // Mobile Safari apparently has a bug where select() is broken. + node.selectionStart = 0; + node.selectionEnd = node.value.length; + } else node.select(); + } + + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } + + function createObj(base, props) { + function Obj() {} + Obj.prototype = base; + var inst = new Obj(); + if (props) copyObj(props, inst); + return inst; + } + + function copyObj(obj, target) { + if (!target) target = {}; + for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop]; + return target; + } + + function emptyArray(size) { + for (var a = [], i = 0; i < size; ++i) a.push(undefined); + return a; + } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args);}; + } + + var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/; + function isWordChar(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + } + + function isEmpty(obj) { + for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; + return true; + } + + var isExtendingChar = /[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/; + + // DOM UTILITIES + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) e.className = className; + if (style) e.style.cssText = style; + if (typeof content == "string") setTextContent(e, content); + else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); + return e; + } + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + e.removeChild(e.firstChild); + return e; + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + + function setTextContent(e, str) { + if (ie_lt9) { + e.innerHTML = ""; + e.appendChild(document.createTextNode(str)); + } else e.textContent = str; + } + + function getRect(node) { + return node.getBoundingClientRect(); + } + CodeMirror.replaceGetRect = function(f) { getRect = f; }; + + // FEATURE DETECTION + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie_lt9) return false; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + // For a reason I have yet to figure out, some browsers disallow + // word wrapping between certain characters *only* if a new inline + // element is started between them. This makes it hard to reliably + // measure the position of things, since that requires inserting an + // extra span. This terribly fragile set of regexps matches the + // character combinations that suffer from this phenomenon on the + // various browsers. + var spanAffectsWrapping = /^$/; // Won't match any two-character string + if (gecko) spanAffectsWrapping = /$'/; + else if (safari && !/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)) spanAffectsWrapping = /\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/; + else if (webkit) spanAffectsWrapping = /[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.]|\?[\w~`@#$%\^&*(_=+{[|><]/; + + var knownScrollbarWidth; + function scrollbarWidth(measure) { + if (knownScrollbarWidth != null) return knownScrollbarWidth; + var test = elt("div", null, null, "width: 50px; height: 50px; overflow-x: scroll"); + removeChildrenAndAdd(measure, test); + if (test.offsetWidth) + knownScrollbarWidth = test.offsetHeight - test.clientHeight; + return knownScrollbarWidth || 0; + } + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8; + } + if (zwspSupported) return elt("span", "\u200b"); + else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) nl = string.length; + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function(string){return string.split(/\r\n?|\n/);}; + CodeMirror.splitLines = splitLines; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + var hasCopyEvent = (function() { + var e = elt("div"); + if ("oncopy" in e) return true; + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == 'function'; + })(); + + // KEY NAMING + + var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 109: "-", 107: "=", 127: "Delete", + 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home", + 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"}; + CodeMirror.keyNames = keyNames; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) return f(from, to, "ltr"); + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + } + } + + function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } + function bidiRight(part) { return part.level % 2 ? part.from : part.to; } + + function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } + function lineRight(line) { + var order = getOrder(line); + if (!order) return line.text.length; + return bidiRight(lst(order)); + } + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(cm.doc, line); + if (visual != line) lineN = lineNo(visual); + var order = getOrder(visual); + var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); + return Pos(lineN, ch); + } + function lineEnd(cm, lineN) { + var merged, line; + while (merged = collapsedSpanAtEnd(line = getLine(cm.doc, lineN))) + lineN = merged.find().to.line; + var order = getOrder(line); + var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); + return Pos(lineN, ch); + } + + // This is somewhat involved. It is needed in order to move + // 'visually' through bi-directional text -- i.e., pressing left + // should make the cursor go left, even when in RTL text. The + // tricky part is the 'jumps', where RTL and LTR text touch each + // other. This often requires the cursor offset to move more than + // one unit, in order to visually move one unit. + function moveVisually(line, start, dir, byUnit) { + var bidi = getOrder(line); + if (!bidi) return moveLogically(line, start, dir, byUnit); + var moveOneUnit = byUnit ? function(pos, dir) { + do pos += dir; + while (pos > 0 && isExtendingChar.test(line.text.charAt(pos))); + return pos; + } : function(pos, dir) { return pos + dir; }; + var linedir = bidi[0].level; + for (var i = 0; i < bidi.length; ++i) { + var part = bidi[i], sticky = part.level % 2 == linedir; + if ((part.from < start && part.to > start) || + (sticky && (part.from == start || part.to == start))) break; + } + var target = moveOneUnit(start, part.level % 2 ? -dir : dir); + + while (target != null) { + if (part.level % 2 == linedir) { + if (target < part.from || target > part.to) { + part = bidi[i += dir]; + target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1)); + } else break; + } else { + if (target == bidiLeft(part)) { + part = bidi[--i]; + target = part && bidiRight(part); + } else if (target == bidiRight(part)) { + part = bidi[++i]; + target = part && bidiLeft(part); + } else break; + } + } + + return target < 0 || target > line.text.length ? null : target; + } + + function moveLogically(line, start, dir, byUnit) { + var target = start + dir; + if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir; + return target < 0 || target > line.text.length ? null : target; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL"; + // Character types for codepoints 0x600 to 0x6ff + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr"; + function charType(code) { + if (code <= 0xff) return lowTypes.charAt(code); + else if (0x590 <= code && code <= 0x5f4) return "R"; + else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600); + else if (0x700 <= code && code <= 0x8ac) return "r"; + else return "L"; + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + // Browsers seem to always treat the boundaries of block elements as being L. + var outerType = "L"; + + return function(str) { + if (!bidiRE.test(str)) return false; + var len = str.length, types = []; + for (var i = 0, type; i < len; ++i) + types.push(type = charType(str.charCodeAt(i))); + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i = 0, prev = outerType; i < len; ++i) { + var type = types[i]; + if (type == "m") types[i] = prev; + else prev = type; + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (type == "1" && cur == "r") types[i] = "n"; + else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i = 1, prev = types[0]; i < len - 1; ++i) { + var type = types[i]; + if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; + else if (type == "," && prev == types[i+1] && + (prev == "1" || prev == "n")) types[i] = prev; + prev = type; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i = 0; i < len; ++i) { + var type = types[i]; + if (type == ",") types[i] = "N"; + else if (type == "%") { + for (var end = i + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i && types[i-1] == "!") || (end < len - 1 && types[end] == "1") ? "1" : "N"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (cur == "L" && type == "1") types[i] = "L"; + else if (isStrong.test(type)) cur = type; + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i = 0; i < len; ++i) { + if (isNeutral.test(types[i])) { + for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} + var before = (i ? types[i-1] : outerType) == "L"; + var after = (end < len - 1 ? types[end] : outerType) == "L"; + var replace = before || after ? "L" : "R"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i = 0; i < len;) { + if (countsAsLeft.test(types[i])) { + var start = i; + for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} + order.push({from: start, to: i, level: 0}); + } else { + var pos = i, at = order.length; + for (++i; i < len && types[i] != "L"; ++i) {} + for (var j = pos; j < i;) { + if (countsAsNum.test(types[j])) { + if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1}); + var nstart = j; + for (++j; j < i && countsAsNum.test(types[j]); ++j) {} + order.splice(at, 0, {from: nstart, to: j, level: 2}); + pos = j; + } else ++j; + } + if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1}); + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift({from: 0, to: m[0].length, level: 0}); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push({from: len - m[0].length, to: len, level: 0}); + } + if (order[0].level != lst(order).level) + order.push({from: len, to: len, level: order[0].level}); + + return order; + }; + })(); + + // THE END + + CodeMirror.version = "3.11"; + + return CodeMirror; +})(); diff --git a/js/.svn/text-base/createAssignment.js.svn-base b/js/.svn/text-base/createAssignment.js.svn-base new file mode 100644 index 0000000..30d4612 --- /dev/null +++ b/js/.svn/text-base/createAssignment.js.svn-base @@ -0,0 +1,38 @@ + +function ValidateForm() +{ + var x = document.forms["create_assignment"]["txtAssignmentName"].value; + if (x == null || x == "") + { + alert("Please enter Assignment Name."); + document.forms["create_assignment"]["txtAssignmentName"].focus(); + return; + } + var x = document.forms["create_assignment"]["txtDueDate"].value; + if (x == null || x == "") + { + alert("Please enter Due Date."); + document.forms["create_assignment"]["txtDueDate"].focus(); + return; + } + var x = document.forms["create_assignment"]["txtInstructions"].value; + if (x == null || x == "") + { + alert("Please enter Instruction."); + document.forms["create_assignment"]["txtInstructions"].focus(); + return; + } + var x = document.forms["create_assignment"]["cmbNoOfAttempts"].value; + if (x == null || x == "0") + { + alert("Please select No of Attempts."); + return; + } + var x = document.forms["create_assignment"]["cmbType"].value; + if (x == null || x == "-1") + { + alert("Please select Assignment Type."); + return; + } + document.forms["create_assignment"].submit(); +} diff --git a/js/.svn/text-base/datepicker.js.svn-base b/js/.svn/text-base/datepicker.js.svn-base new file mode 100644 index 0000000..2537264 --- /dev/null +++ b/js/.svn/text-base/datepicker.js.svn-base @@ -0,0 +1,6 @@ +$(function() { + $( "#datepicker1" ).datepicker(); + $( "#datepicker2" ).datepicker(); + $.datepicker.setDefaults($.datepicker.regional['nl']); + $.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' }); + }); diff --git a/js/.svn/text-base/debugger.js.svn-base b/js/.svn/text-base/debugger.js.svn-base new file mode 100644 index 0000000..a03167f --- /dev/null +++ b/js/.svn/text-base/debugger.js.svn-base @@ -0,0 +1,145 @@ +// Debugger Web API +// Author: ntietz +// Date: April 19 2013 + +var currentline = 1; +var userId = 1; +var debuggerId = 1; +//var hostname = "localhost"; +var hostname = "capstone-s13.cs.kent.edu"; + + + +function failhandler(call, textStatus, errorThrown) +{ + alert("Error: the request failed!"); + alert(JSON.stringify(call)); + alert(textStatus); + alert(errorThrown); + + +} + +function clearHighlightedLines() +{ + for (var i = 0; i < codeEditor.lineCount(); i++) + { + var line = codeEditor.getLineHandle(i); + codeEditor.removeLineClass(line, "background", "capstone-errorline-background"); + codeEditor.removeLineClass(line, "background", "capstone-currentline-background"); + } +} + +function highlightErrorLine(linenumber) +{ + var line = codeEditor.getLineHandle(linenumber-1); + codeEditor.addLineClass(line, "background", "capstone-errorline-background"); +} + +function highlightErrors(data) +{ + clearHighlightedLines(); + outputBox.setValue(Array(data.errors.length).join('\n')); + + for (var i = 0; i < data.errors.length; i++) + { + highlightErrorLine(data.errors[i].linenumber); + // you can also use data.errors[i].errortext to display the text. + outputBox.setLine(i, "Line " + data.errors[i].linenumber + ": " + data.errors[i].errortext); + } +} + +function setCurrentLine(linenumber) +{ + var oldline = codeEditor.getLineHandle(currentline-1); + codeEditor.removeLineClass(oldline, "background", "capstone-currentline-background"); + var line = codeEditor.getLineHandle(linenumber-1); + codeEditor.addLineClass(line, "background", "capstone-currentline-background"); + currentline = linenumber; +} + +function compile() +{ + var content = codeEditor.getValue() + submitCommand("prepare", content, function(data) { + highlightErrors(data); + //getLineNumber(); + }); +} + +function run() +{ + submitCommand("run", "", showresponse); +} + +function giveInput() +{ + var content = inputEditor.getValue(); + submitCommand("giveinput", content, showresponse); +} + +function getStdOut() +{ + submitCommand("getstdout", "", showresponse); +} + +function setBreakpoint() +{ + linenumber = $("#linenumber").val(); + submitCommand("breakpoint", linenumber, showresponse); +} + +function getLineNumber() +{ + submitCommand("linenumber", "", function(data) { + setCurrentLine(data.linenumber); + }); +} + +function stepIn() +{ + submitCommand("stepin", "", getLineNumber); +} + +function stepOver() +{ + submitCommand("stepover", "", getLineNumber); +} + +function stepOut() +{ + submitCommand("stepout", "", getLineNumber); +} + +function killDebugger() +{ + submitCommand("killdebugger", "", showresponse); +} + +function submitCommand(call, data, callback) +{ + $.post("http://" + hostname + ":6789", + { + "call" : call, + "usrid" : userId, + "dbgid" : debuggerId, + "data" : data + }, callback, "json").fail(failhandler); +} + +/* +var codeEditor = CodeMirror.fromTextArea(document.getElementById("source"), { + mode: "text/x-csrc", + lineNumbers: true, + indentUnit: 4, + tabMode: "shift", + matchBrackets:true, +}); +codeEditor.setSize("80em", "20em"); + +var inputEditor = CodeMirror.fromTextArea(document.getElementById("input"), { + smartIndent: false +}); +inputEditor.setSize("80em", "5em"); +*/ + diff --git a/js/.svn/text-base/jquery-1.9.1.min.js.svn-base b/js/.svn/text-base/jquery-1.9.1.min.js.svn-base new file mode 100644 index 0000000..006e953 --- /dev/null +++ b/js/.svn/text-base/jquery-1.9.1.min.js.svn-base @@ -0,0 +1,5 @@ +/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
t
",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; +return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) +}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("