code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
*/
/**
* @fileOverview Defines the {@link CKFinder.lang} object, for the English
* language. This is the base file for all translations.
*/
/**
* Constains the dictionary of language entries.
* @namespace
*/
CKFinder.lang['he'] =
{
appTitle : 'CKFinder',
// Common messages and labels.
common :
{
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, לא נגיש</span>',
confirmCancel : 'חקל ממאפיינים שונו. ברצונך לסגור חלון?',
ok : 'אישור',
cancel : 'ביטול',
confirmationTitle : 'אישור',
messageTitle : 'מידע',
inputTitle : 'שאלה',
undo : 'לבטל',
redo : 'לעשות שוב',
skip : 'דלג',
skipAll : 'דלג הכל',
makeDecision : 'איזו פעולה לבצע?',
rememberDecision: 'זכור החלטתי'
},
dir : 'rtl',
HelpLang : 'en',
LangCode : 'he',
// Date Format
// d : Day
// dd : Day (padding zero)
// m : Month
// mm : Month (padding zero)
// yy : Year (two digits)
// yyyy : Year (four digits)
// h : Hour (12 hour clock)
// hh : Hour (12 hour clock, padding zero)
// H : Hour (24 hour clock)
// HH : Hour (24 hour clock, padding zero)
// M : Minute
// MM : Minute (padding zero)
// a : Firt char of AM/PM
// aa : AM/PM
DateTime : 'm/d/yyyy h:MM aa',
DateAmPm : ['AM', 'PM'],
// Folders
FoldersTitle : 'תיקיות',
FolderLoading : 'טוען...',
FolderNew : 'הקלד שם חדש לתיקיה: ',
FolderRename : 'הקלד שם חדש לתיקיה: ',
FolderDelete : 'האם ברצונך למחוק תיקיה "%1" ?',
FolderRenaming : ' (משנה שם...)',
FolderDeleting : ' (מוחק...)',
// Files
FileRename : 'הקלש שם חדש לקובץ: ',
FileRenameExt : 'האם ברוצונך לשנות טיפוס של הקובץ',
FileRenaming : 'משנה שם...',
FileDelete : 'האם ברצונך למחוק קובץ "%1"?',
FilesLoading : 'טוען...',
FilesEmpty : 'תיקיה ריקה',
FilesMoved : 'קובץ %1 הוזז ל- %2:%3',
FilesCopied : 'קובץ %1 הועתק ל- %2:%3',
// Basket
BasketFolder : 'סל',
BasketClear : 'נקה סל',
BasketRemove : 'הורד מסל',
BasketOpenFolder : 'פתח תיקיית אב',
BasketTruncateConfirm : 'האם ברוצונך למחוק את כל הקבצים מסל?',
BasketRemoveConfirm : 'האם ברוצונך למחוק את קובץ "%1" מסל?',
BasketEmpty : 'אין קבצים בסל, גרור ושחרר משהוא.',
BasketCopyFilesHere : 'העתק קבצים מסל',
BasketMoveFilesHere : 'הזז קבצים מסל',
BasketPasteErrorOther : 'קובץ %s שגיאה: %e',
BasketPasteMoveSuccess : 'קבצים הבאים הוזזו: %s',
BasketPasteCopySuccess : 'קבצים הבאים הועתקו: %s',
// Toolbar Buttons (some used elsewhere)
Upload : 'העלאה',
UploadTip : 'לעלות קובץ חדש',
Refresh : 'רענון',
Settings : 'הגדרות',
Help : 'עזרה',
HelpTip : 'עזרה',
// Context Menus
Select : 'בחר',
SelectThumbnail : 'בחר תמונה קטנה',
View : 'צפה',
Download : 'הורד',
NewSubFolder : 'תת-תיקיה חדשה',
Rename : 'שנה שם',
Delete : 'מחק',
CopyDragDrop : 'העתק קבצים לכאן',
MoveDragDrop : 'הזז קבצים לכאן',
// Dialogs
RenameDlgTitle : 'שנה שם',
NewNameDlgTitle : 'שם חדש',
FileExistsDlgTitle : 'קובץ כבר קיים',
SysErrorDlgTitle : 'שגיעת מערכת',
FileOverwrite : 'החלף',
FileAutorename : 'אוטומטית לשנות שם',
// Generic
OkBtn : 'אישור',
CancelBtn : 'ביטול',
CloseBtn : 'סגור',
// Upload Panel
UploadTitle : 'העלאת קובץ חדש',
UploadSelectLbl : 'בחר קובץ להעלאה',
UploadProgressLbl : '(העלאה בתהליך, אנא המתן...)',
UploadBtn : 'לעלות קובץ',
UploadBtnCancel : 'ביטול',
UploadNoFileMsg : 'נא לבחור קובץ מהמחשב שלך',
UploadNoFolder : 'נא לבחור תיקיה לפני העלאה.',
UploadNoPerms : 'העלאת קובץ אסורה.',
UploadUnknError : 'שגיעה בשליחת קובץ.',
UploadExtIncorrect : 'סוג קובץ זה לא מאושר בתיקיה זאת.',
// Settings Panel
SetTitle : 'הגדרות',
SetView : 'צפה:',
SetViewThumb : 'תמונות קטנות',
SetViewList : 'רשימה',
SetDisplay : 'תצוגה:',
SetDisplayName : 'שם קובץ',
SetDisplayDate : 'תאריך',
SetDisplaySize : 'גודל קובץ',
SetSort : 'מיון:',
SetSortName : 'לפי שם',
SetSortDate : 'לפי תאריך',
SetSortSize : 'לפי גודל',
// Status Bar
FilesCountEmpty : '<תיקיה ריקה>',
FilesCountOne : 'קובץ 1',
FilesCountMany : '%1 קבצים',
// Size and Speed
Kb : '%1 kB',
KbPerSecond : '%1 kB/s',
// Connector Error Messages.
ErrorUnknown : 'בקשה נכשלה. שגיאה. (Error %1)',
Errors :
{
10 : 'Invalid command.',
11 : 'The resource type was not specified in the request.',
12 : 'The requested resource type is not valid.',
102 : 'Invalid file or folder name.',
103 : 'It was not possible to complete the request due to authorization restrictions.',
104 : 'It was not possible to complete the request due to file system permission restrictions.',
105 : 'Invalid file extension.',
109 : 'Invalid request.',
110 : 'Unknown error.',
115 : 'A file or folder with the same name already exists.',
116 : 'Folder not found. Please refresh and try again.',
117 : 'File not found. Please refresh the files list and try again.',
118 : 'Source and target paths are equal.',
201 : 'A file with the same name is already available. The uploaded file has been renamed to "%1"',
202 : 'Invalid file',
203 : 'Invalid file. The file size is too big.',
204 : 'The uploaded file is corrupt.',
205 : 'No temporary folder is available for upload in the server.',
206 : 'Upload cancelled for security reasons. The file contains HTML like data.',
207 : 'The uploaded file has been renamed to "%1"',
300 : 'Moving file(s) failed.',
301 : 'Copying file(s) failed.',
500 : 'The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.',
501 : 'The thumbnails support is disabled.'
},
// Other Error Messages.
ErrorMsg :
{
FileEmpty : 'שם קובץ לא יכול להיות ריק',
FileExists : 'קובץ %s already exists',
FolderEmpty : 'שם תיקיה לא יכול להיות ריק',
FileInvChar : 'שם הקובץ לא יכול לכלול תווים הבאים: \n\\ / : * ? " < > |',
FolderInvChar : 'שם התיקיה לא יכול לכלול תווים הבאים: \n\\ / : * ? " < > |',
PopupBlockView : 'בלתי אפשרי לפתוח קובץ בחלון חדש. נא לבדוק הגדרות דפדפן ולבטל כל החוסמים חלונות קופצות.'
},
// Imageresize plugin
Imageresize :
{
dialogTitle : 'שנה גודל %s',
sizeTooBig : 'לא יכול לקבוע גובה ורוחב של תמונה יותר גדול מדודל מקורי (%size).',
resizeSuccess : 'גודל שונה שהצלחה.',
thumbnailNew : 'ליצור תמונה קטנה)טומבנייל(',
thumbnailSmall : 'קטן (%s)',
thumbnailMedium : 'בינוני (%s)',
thumbnailLarge : 'גדול (%s)',
newSize : 'קבע גודל חדש',
width : 'רוחב',
height : 'גובה',
invalidHeight : 'גובה לא חוקי.',
invalidWidth : 'רוחב לא חוקי.',
invalidName : 'שם קובץ לא חוקי.',
newImage : 'ליצור תמונה חדשה',
noExtensionChange : 'לא ניתן לשנות סוג קובץ.',
imageSmall : 'מקור תמונה קטן מדי',
contextMenuName : 'שנה גודל'
},
// Fileeditor plugin
Fileeditor :
{
save : 'שמור',
fileOpenError : 'לא מצליח לפתוח קובץ.',
fileSaveSuccess : 'קובץ משמר בהצלחה.',
contextMenuName : 'עריכה',
loadingFile : 'טוען קובץ, אנא המתן...'
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/lang/he.js | JavaScript | gpl3 | 8,869 |
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
*/
/**
* @fileOverview Defines the {@link CKFinder.lang} object, for the Slovenian
* language. This is the base file for all translations.
*/
/**
* Constains the dictionary of language entries.
* @namespace
*/
CKFinder.lang['sl'] =
{
appTitle : 'CKFinder',
// Common messages and labels.
common :
{
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, nedostopen</span>',
confirmCancel : 'Nekatere opcije so bile spremenjene. Ali res želite zapreti pogovorno okno?',
ok : 'Potrdi',
cancel : 'Prekliči',
confirmationTitle : 'Potrditev',
messageTitle : 'Informacija',
inputTitle : 'Vprašanje',
undo : 'Razveljavi',
redo : 'Obnovi',
skip : 'Preskoči',
skipAll : 'Preskoči vse',
makeDecision : 'Katera aktivnost naj se izvede?',
rememberDecision: 'Zapomni si mojo izbiro'
},
dir : 'ltr', // MISSING
HelpLang : 'en',
LangCode : 'sl',
// Date Format
// d : Day
// dd : Day (padding zero)
// m : Month
// mm : Month (padding zero)
// yy : Year (two digits)
// yyyy : Year (four digits)
// h : Hour (12 hour clock)
// hh : Hour (12 hour clock, padding zero)
// H : Hour (24 hour clock)
// HH : Hour (24 hour clock, padding zero)
// M : Minute
// MM : Minute (padding zero)
// a : Firt char of AM/PM
// aa : AM/PM
DateTime : 'd.m.yyyy H:MM',
DateAmPm : ['AM', 'PM'],
// Folders
FoldersTitle : 'Mape',
FolderLoading : 'Nalagam...',
FolderNew : 'Vnesite ime za novo mapo: ',
FolderRename : 'Vnesite ime nove mape: ',
FolderDelete : 'Ali ste prepričani, da želite zbrisati mapo "%1"?',
FolderRenaming : ' (Preimenujem...)',
FolderDeleting : ' (Brišem...)',
// Files
FileRename : 'Vnesite novo ime datoteke: ',
FileRenameExt : 'Ali ste prepričani, da želite spremeniti končnico datoteke? Možno je, da potem datoteka ne bo uporabna.',
FileRenaming : 'Preimenujem...',
FileDelete : 'Ali ste prepričani, da želite izbrisati datoteko "%1"?',
FilesLoading : 'Nalagam...',
FilesEmpty : 'Prazna mapa',
FilesMoved : 'Datoteka %1 je bila premaknjena v %2:%3',
FilesCopied : 'Datoteka %1 je bila kopirana v %2:%3',
// Basket
BasketFolder : 'Koš',
BasketClear : 'Izprazni koš',
BasketRemove : 'Odstrani iz koša',
BasketOpenFolder : 'Odpri izvorno mapo',
BasketTruncateConfirm : 'Ali res želite odstraniti vse datoteke iz koša?',
BasketRemoveConfirm : 'Ali res želite odstraniti datoteko "%1" iz koša?',
BasketEmpty : 'V košu ni datotek. Lahko jih povlečete in spustite.',
BasketCopyFilesHere : 'Kopiraj datoteke iz koša',
BasketMoveFilesHere : 'Premakni datoteke iz koša',
BasketPasteErrorOther : 'Napaka z datoteko %s: %e',
BasketPasteMoveSuccess : 'Seznam premaknjenih datotek: %s',
BasketPasteCopySuccess : 'Seznam kopiranih datotek: %s',
// Toolbar Buttons (some used elsewhere)
Upload : 'Naloži na strežnik',
UploadTip : 'Naloži novo datoteko na strežnik',
Refresh : 'Osveži',
Settings : 'Nastavitve',
Help : 'Pomoč',
HelpTip : 'Pomoč',
// Context Menus
Select : 'Izberi',
SelectThumbnail : 'Izberi malo sličico (predogled)',
View : 'Predogled',
Download : 'Prenesi na svoj računalnik',
NewSubFolder : 'Nova podmapa',
Rename : 'Preimenuj',
Delete : 'Zbriši',
CopyDragDrop : 'Kopiraj datoteko',
MoveDragDrop : 'Premakni datoteko',
// Dialogs
RenameDlgTitle : 'Preimenuj',
NewNameDlgTitle : 'Novo ime',
FileExistsDlgTitle : 'Datoteka že obstaja',
SysErrorDlgTitle : 'Sistemska napaka',
FileOverwrite : 'Prepiši',
FileAutorename : 'Avtomatsko preimenuj',
// Generic
OkBtn : 'Potrdi',
CancelBtn : 'Prekliči',
CloseBtn : 'Zapri',
// Upload Panel
UploadTitle : 'Naloži novo datoteko na strežnik',
UploadSelectLbl : 'Izberi datoteko za prenos na strežnik',
UploadProgressLbl : '(Prenos na strežnik poteka, prosimo počakajte...)',
UploadBtn : 'Prenesi izbrano datoteko na strežnik',
UploadBtnCancel : 'Prekliči',
UploadNoFileMsg : 'Prosimo izberite datoteko iz svojega računalnika za prenos na strežnik',
UploadNoFolder : 'Izberite mapo v katero se bo naložilo datoteko!',
UploadNoPerms : 'Nalaganje datotek ni dovoljeno.',
UploadUnknError : 'Napaka pri pošiljanju datoteke.',
UploadExtIncorrect : 'V tej mapi ta vrsta datoteke ni dovoljena.',
// Settings Panel
SetTitle : 'Nastavitve',
SetView : 'Pogled:',
SetViewThumb : 'majhne sličice',
SetViewList : 'seznam',
SetDisplay : 'Prikaz:',
SetDisplayName : 'ime datoteke',
SetDisplayDate : 'datum',
SetDisplaySize : 'velikost datoteke',
SetSort : 'Razvrščanje:',
SetSortName : 'po imenu datoteke',
SetSortDate : 'po datumu',
SetSortSize : 'po velikosti',
// Status Bar
FilesCountEmpty : '<Prazna mapa>',
FilesCountOne : '1 datoteka',
FilesCountMany : '%1 datotek(e)',
// Size and Speed
Kb : '%1 kB',
KbPerSecond : '%1 kB/sek',
// Connector Error Messages.
ErrorUnknown : 'Prišlo je do napake. (Napaka %1)',
Errors :
{
10 : 'Napačen ukaz.',
11 : 'V poizvedbi ni bil jasen tip (resource type).',
12 : 'Tip datoteke ni primeren.',
102 : 'Napačno ime mape ali datoteke.',
103 : 'Vašega ukaza se ne da izvesti zaradi težav z avtorizacijo.',
104 : 'Vašega ukaza se ne da izvesti zaradi težav z nastavitvami pravic v datotečnem sistemu.',
105 : 'Napačna končnica datoteke.',
109 : 'Napačna zahteva.',
110 : 'Neznana napaka.',
115 : 'Datoteka ali mapa s tem imenom že obstaja.',
116 : 'Mapa ni najdena. Prosimo osvežite okno in poskusite znova.',
117 : 'Datoteka ni najdena. Prosimo osvežite seznam datotek in poskusite znova.',
118 : 'Začetna in končna pot je ista.',
201 : 'Datoteka z istim imenom že obstaja. Naložena datoteka je bila preimenovana v "%1"',
202 : 'Neprimerna datoteka.',
203 : 'Datoteka je prevelika in zasede preveč prostora.',
204 : 'Naložena datoteka je okvarjena.',
205 : 'Na strežniku ni na voljo začasna mapa za prenos datotek.',
206 : 'Nalaganje je bilo prekinjeno zaradi varnostnih razlogov. Datoteka vsebuje podatke, ki spominjajo na HTML kodo.',
207 : 'Naložena datoteka je bila preimenovana v "%1"',
300 : 'Premikanje datotek(e) ni uspelo.',
301 : 'Kopiranje datotek(e) ni uspelo.',
500 : 'Brskalnik je onemogočen zaradi varnostnih razlogov. Prosimo kontaktirajte upravljalca spletnih strani.',
501 : 'Ni podpore za majhne sličice (predogled).'
},
// Other Error Messages.
ErrorMsg :
{
FileEmpty : 'Ime datoteke ne more biti prazno',
FileExists : 'Datoteka %s že obstaja',
FolderEmpty : 'Mapa ne more biti prazna',
FileInvChar : 'Ime datoteke ne sme vsebovati naslednjih znakov: \n\\ / : * ? " < > |',
FolderInvChar : 'Ime mape ne sme vsebovati naslednjih znakov: \n\\ / : * ? " < > |',
PopupBlockView : 'Datoteke ni možno odpreti v novem oknu. Prosimo nastavite svoj brskalnik tako, da bo dopuščal odpiranje oken (popups) oz. izklopite filtre za blokado odpiranja oken.'
},
// Imageresize plugin
Imageresize :
{
dialogTitle : 'Spremeni velikost slike %s',
sizeTooBig : 'Širina ali višina slike ne moreta biti večji kot je originalna velikost (%size).',
resizeSuccess : 'Velikost slike je bila uspešno spremenjena.',
thumbnailNew : 'Kreiraj novo majhno sličico',
thumbnailSmall : 'majhna (%s)',
thumbnailMedium : 'srednja (%s)',
thumbnailLarge : 'velika (%s)',
newSize : 'Določite novo velikost',
width : 'Širina',
height : 'Višina',
invalidHeight : 'Nepravilna višina.',
invalidWidth : 'Nepravilna širina.',
invalidName : 'Nepravilno ime datoteke.',
newImage : 'Kreiraj novo sliko',
noExtensionChange : 'Končnica datoteke se ne more spremeniti.',
imageSmall : 'Izvorna slika je premajhna',
contextMenuName : 'Spremeni velikost'
},
// Fileeditor plugin
Fileeditor :
{
save : 'Shrani',
fileOpenError : 'Datoteke ni mogoče odpreti.',
fileSaveSuccess : 'Datoteka je bila shranjena.',
contextMenuName : 'Uredi',
loadingFile : 'Nalaganje datoteke, prosimo počakajte ...'
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/lang/sl.js | JavaScript | gpl3 | 8,735 |
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
*/
/**
* @fileOverview
*/
/**
* Constains the dictionary of language entries.
* @namespace
*/
CKFinder.lang['cs'] =
{
appTitle : 'CKFinder', // MISSING
// Common messages and labels.
common :
{
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING
confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING
ok : 'OK', // MISSING
cancel : 'Cancel', // MISSING
confirmationTitle : 'Confirmation', // MISSING
messageTitle : 'Information', // MISSING
inputTitle : 'Question', // MISSING
undo : 'Undo', // MISSING
redo : 'Redo', // MISSING
skip : 'Skip', // MISSING
skipAll : 'Skip all', // MISSING
makeDecision : 'What action should be taken?', // MISSING
rememberDecision: 'Remember my decision' // MISSING
},
dir : 'ltr', // MISSING
HelpLang : 'en',
LangCode : 'cs',
// Date Format
// d : Day
// dd : Day (padding zero)
// m : Month
// mm : Month (padding zero)
// yy : Year (two digits)
// yyyy : Year (four digits)
// h : Hour (12 hour clock)
// hh : Hour (12 hour clock, padding zero)
// H : Hour (24 hour clock)
// HH : Hour (24 hour clock, padding zero)
// M : Minute
// MM : Minute (padding zero)
// a : Firt char of AM/PM
// aa : AM/PM
DateTime : 'm/d/yyyy h:MM aa',
DateAmPm : ['AM', 'PM'],
// Folders
FoldersTitle : 'Složky',
FolderLoading : 'Načítání...',
FolderNew : 'Zadejte jméno nové složky: ',
FolderRename : 'Zadejte nové jméno složky: ',
FolderDelete : 'Opravdu chcete smazat složku "%1" ?',
FolderRenaming : ' (Přejmenovávám...)',
FolderDeleting : ' (Mažu...)',
// Files
FileRename : 'Zadejte jméno novéhho souboru: ',
FileRenameExt : 'Opravdu chcete změnit příponu souboru, může se stát nečitelným',
FileRenaming : 'Přejmenovávám...',
FileDelete : 'Opravdu chcete smazat soubor "%1"?',
FilesLoading : 'Loading...', // MISSING
FilesEmpty : 'Empty folder', // MISSING
FilesMoved : 'File %1 moved into %2:%3', // MISSING
FilesCopied : 'File %1 copied into %2:%3', // MISSING
// Basket
BasketFolder : 'Basket', // MISSING
BasketClear : 'Clear Basket', // MISSING
BasketRemove : 'Remove from basket', // MISSING
BasketOpenFolder : 'Open parent folder', // MISSING
BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING
BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING
BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING
BasketCopyFilesHere : 'Copy Files from Basket', // MISSING
BasketMoveFilesHere : 'Move Files from Basket', // MISSING
BasketPasteErrorOther : 'File %s error: %e', // MISSING
BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING
BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING
// Toolbar Buttons (some used elsewhere)
Upload : 'Nahrát',
UploadTip : 'Nahrát nový soubor',
Refresh : 'Načíst znova',
Settings : 'Nastavení',
Help : 'Pomoc',
HelpTip : 'Pomoc',
// Context Menus
Select : 'Vybrat',
SelectThumbnail : 'Vybrat náhled',
View : 'Zobrazit',
Download : 'Uložit jako',
NewSubFolder : 'Nová podsložka',
Rename : 'Přejmenovat',
Delete : 'Smazat',
CopyDragDrop : 'Copy file here', // MISSING
MoveDragDrop : 'Move file here', // MISSING
// Dialogs
RenameDlgTitle : 'Rename', // MISSING
NewNameDlgTitle : 'New name', // MISSING
FileExistsDlgTitle : 'File already exists', // MISSING
SysErrorDlgTitle : 'System error', // MISSING
FileOverwrite : 'Overwrite', // MISSING
FileAutorename : 'Auto-rename', // MISSING
// Generic
OkBtn : 'OK',
CancelBtn : 'Zrušit',
CloseBtn : 'Zavřít',
// Upload Panel
UploadTitle : 'Nahrát nový soubor',
UploadSelectLbl : 'Zvolit soubor k nahrání',
UploadProgressLbl : '(Nahrávám, čekejte...)',
UploadBtn : 'Nahrát zvolený soubor',
UploadBtnCancel : 'Cancel', // MISSING
UploadNoFileMsg : 'Vyberte prosím soubor',
UploadNoFolder : 'Please select folder before uploading.', // MISSING
UploadNoPerms : 'File upload not allowed.', // MISSING
UploadUnknError : 'Error sending the file.', // MISSING
UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING
// Settings Panel
SetTitle : 'Nastavení',
SetView : 'Zobrazení:',
SetViewThumb : 'Náhledy',
SetViewList : 'Seznam',
SetDisplay : 'Informace:',
SetDisplayName : 'Název',
SetDisplayDate : 'Datum',
SetDisplaySize : 'Velikost',
SetSort : 'Seřazení:',
SetSortName : 'Podle jména',
SetSortDate : 'Podle data',
SetSortSize : 'Podle velikosti',
// Status Bar
FilesCountEmpty : '<Prázdná složka>',
FilesCountOne : '1 soubor',
FilesCountMany : '%1 soubor',
// Size and Speed
Kb : '%1 kB',
KbPerSecond : '%1 kB/s',
// Connector Error Messages.
ErrorUnknown : 'Nebylo možno dokončit příkaz. (Error %1)',
Errors :
{
10 : 'Neplatný příkaz.',
11 : 'Požadovaný typ prostředku nebyl specifikován v dotazu.',
12 : 'Požadovaný typ prostředku není validní.',
102 : 'Šatné jméno souboru, nebo složky.',
103 : 'Nebylo možné dokončit příkaz kvůli autorizačním omezením.',
104 : 'Nebylo možné dokončit příkaz kvůli omezeným přístupovým právům k souborům.',
105 : 'Špatná přípona souboru.',
109 : 'Neplatný příkaz.',
110 : 'Neznámá chyba.',
115 : 'Již existuje soubor nebo složka se stejným jménem.',
116 : 'Složka nenalezena, prosím obnovte stránku.',
117 : 'Soubor nenalezen, prosím obnovte stránku.',
118 : 'Source and target paths are equal.', // MISSING
201 : 'Již existoval soubor se stejným jménem, nahraný soubor byl přejmenován na "%1"',
202 : 'Špatný soubor',
203 : 'Špatný soubor. Příliš velký.',
204 : 'Nahraný soubor je poškozen.',
205 : 'Na serveru není dostupná dočasná složka.',
206 : 'Nahrávání zrušeno z bezpečnostních důvodů. Soubor obsahuje data podobná HTML.',
207 : 'Nahraný soubor byl přejmenován na "%1"',
300 : 'Moving file(s) failed.', // MISSING
301 : 'Copying file(s) failed.', // MISSING
500 : 'Nahrávání zrušeno z bezpečnostních důvodů. Zdělte to prosím administrátorovi a zkontrolujte nastavení CKFinderu.',
501 : 'Podpora náhledů je vypnuta.'
},
// Other Error Messages.
ErrorMsg :
{
FileEmpty : 'Název souboru nemůže být prázdný',
FileExists : 'File %s already exists', // MISSING
FolderEmpty : 'Název složky nemůže být prázdný',
FileInvChar : 'Název souboru nesmí obsahovat následující znaky: \n\\ / : * ? " < > |',
FolderInvChar : 'Název složky nesmí obsahovat následující znaky: \n\\ / : * ? " < > |',
PopupBlockView : 'Nebylo možné otevřít soubor do nového okna. Prosím nastavte si prohlížeč aby neblokoval vyskakovací okna.'
},
// Imageresize plugin
Imageresize :
{
dialogTitle : 'Resize %s', // MISSING
sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING
resizeSuccess : 'Image resized successfully.', // MISSING
thumbnailNew : 'Create new thumbnail', // MISSING
thumbnailSmall : 'Small (%s)', // MISSING
thumbnailMedium : 'Medium (%s)', // MISSING
thumbnailLarge : 'Large (%s)', // MISSING
newSize : 'Set new size', // MISSING
width : 'Width', // MISSING
height : 'Height', // MISSING
invalidHeight : 'Invalid height.', // MISSING
invalidWidth : 'Invalid width.', // MISSING
invalidName : 'Invalid file name.', // MISSING
newImage : 'Create new image', // MISSING
noExtensionChange : 'The file extension cannot be changed.', // MISSING
imageSmall : 'Source image is too small', // MISSING
contextMenuName : 'Resize' // MISSING
},
// Fileeditor plugin
Fileeditor :
{
save : 'Save', // MISSING
fileOpenError : 'Unable to open file.', // MISSING
fileSaveSuccess : 'File saved successfully.', // MISSING
contextMenuName : 'Edit', // MISSING
loadingFile : 'Loading file, please wait...' // MISSING
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/lang/cs.js | JavaScript | gpl3 | 8,857 |
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
*/
/**
* @fileOverview Defines the {@link CKFinder.lang} object, for the Latin American Spanish
* language. This is the base file for all translations.
*/
/**
* Constains the dictionary of language entries.
* @namespace
*/
CKFinder.lang['es-mx'] =
{
appTitle : 'CKFinder',
// Common messages and labels.
common :
{
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, no disponible</span>',
confirmCancel : 'Algunas opciones se han cambiado\r\n¿Está seguro de querer cerrar el diálogo?',
ok : 'Aceptar',
cancel : 'Cancelar',
confirmationTitle : 'Confirmación',
messageTitle : 'Información',
inputTitle : 'Pregunta',
undo : 'Deshacer',
redo : 'Rehacer',
skip : 'Omitir',
skipAll : 'Omitir todos',
makeDecision : '¿Qué acción debe realizarse?',
rememberDecision: 'Recordar mi decisión'
},
dir : 'ltr',
HelpLang : 'es-mx',
LangCode : 'es-mx',
// Date Format
// d : Day
// dd : Day (padding zero)
// m : Month
// mm : Month (padding zero)
// yy : Year (two digits)
// yyyy : Year (four digits)
// h : Hour (12 hour clock)
// hh : Hour (12 hour clock, padding zero)
// H : Hour (24 hour clock)
// HH : Hour (24 hour clock, padding zero)
// M : Minute
// MM : Minute (padding zero)
// a : Firt char of AM/PM
// aa : AM/PM
DateTime : 'dd/mm/yyyy H:MM',
DateAmPm : ['AM', 'PM'],
// Folders
FoldersTitle : 'Carpetas',
FolderLoading : 'Cargando...',
FolderNew : 'Por favor, escriba el nombre para la nueva carpeta: ',
FolderRename : 'Por favor, escriba el nuevo nombre para la carpeta: ',
FolderDelete : '¿Está seguro de que quiere borrar la carpeta "%1"?',
FolderRenaming : ' (Renombrando...)',
FolderDeleting : ' (Borrando...)',
// Files
FileRename : 'Por favor, escriba el nuevo nombre del archivo: ',
FileRenameExt : '¿Está seguro de querer cambiar la extensión del archivo? El archivo puede dejar de ser usable',
FileRenaming : 'Renombrando...',
FileDelete : '¿Está seguro de que quiere borrar el archivo "%1"?',
FilesLoading : 'Cargando...',
FilesEmpty : 'Carpeta vacía',
FilesMoved : 'Archivo %1 movido a %2:%3',
FilesCopied : 'Archivo %1 copiado a %2:%3',
// Basket
BasketFolder : 'Cesta',
BasketClear : 'Vaciar cesta',
BasketRemove : 'Quitar de la cesta',
BasketOpenFolder : 'Abrir carpeta padre',
BasketTruncateConfirm : '¿Está seguro de querer quitar todos los archivos de la cesta?',
BasketRemoveConfirm : '¿Está seguro de querer quitar el archivo "%1" de la cesta?',
BasketEmpty : 'No hay archivos en la cesta, arrastra y suelta algunos.',
BasketCopyFilesHere : 'Copiar archivos de la cesta',
BasketMoveFilesHere : 'Mover archivos de la cesta',
BasketPasteErrorOther : 'Fichero %s error: %e',
BasketPasteMoveSuccess : 'Los siguientes ficheros han sido movidos: %s',
BasketPasteCopySuccess : 'Los siguientes ficheros han sido copiados: %s',
// Toolbar Buttons (some used elsewhere)
Upload : 'Añadir',
UploadTip : 'Añadir nuevo archivo',
Refresh : 'Actualizar',
Settings : 'Configuración',
Help : 'Ayuda',
HelpTip : 'Ayuda',
// Context Menus
Select : 'Seleccionar',
SelectThumbnail : 'Seleccionar el icono',
View : 'Ver',
Download : 'Descargar',
NewSubFolder : 'Nueva Subcarpeta',
Rename : 'Renombrar',
Delete : 'Borrar',
CopyDragDrop : 'Copiar archivo aquí',
MoveDragDrop : 'Mover archivo aquí',
// Dialogs
RenameDlgTitle : 'Renombrar',
NewNameDlgTitle : 'Nuevo nombre',
FileExistsDlgTitle : 'Archivo existente',
SysErrorDlgTitle : 'Error de sistema',
FileOverwrite : 'Sobreescribir',
FileAutorename : 'Auto-renombrar',
// Generic
OkBtn : 'Aceptar',
CancelBtn : 'Cancelar',
CloseBtn : 'Cerrar',
// Upload Panel
UploadTitle : 'Añadir nuevo archivo',
UploadSelectLbl : 'Elija el archivo a subir',
UploadProgressLbl : '(Subida en progreso, por favor espere...)',
UploadBtn : 'Subir el archivo elegido',
UploadBtnCancel : 'Cancelar',
UploadNoFileMsg : 'Por favor, elija un archivo de su computadora',
UploadNoFolder : 'Por favor, escoja la carpeta antes de iniciar la subida.',
UploadNoPerms : 'No puede subir archivos.',
UploadUnknError : 'Error enviando el archivo.',
UploadExtIncorrect : 'La extensión del archivo no está permitida en esta carpeta.',
// Settings Panel
SetTitle : 'Configuración',
SetView : 'Vista:',
SetViewThumb : 'Iconos',
SetViewList : 'Lista',
SetDisplay : 'Mostrar:',
SetDisplayName : 'Nombre de archivo',
SetDisplayDate : 'Fecha',
SetDisplaySize : 'Tamaño del archivo',
SetSort : 'Ordenar:',
SetSortName : 'por Nombre',
SetSortDate : 'por Fecha',
SetSortSize : 'por Tamaño',
// Status Bar
FilesCountEmpty : '<Carpeta vacía>',
FilesCountOne : '1 archivo',
FilesCountMany : '%1 archivos',
// Size and Speed
Kb : '%1 kB',
KbPerSecond : '%1 kB/s',
// Connector Error Messages.
ErrorUnknown : 'No ha sido posible completar la solicitud. (Error %1)',
Errors :
{
10 : 'Comando incorrecto.',
11 : 'El tipo de recurso no ha sido especificado en la solicitud.',
12 : 'El tipo de recurso solicitado no es válido.',
102 : 'Nombre de archivo o carpeta no válido.',
103 : 'No se ha podido completar la solicitud debido a las restricciones de autorización.',
104 : 'No ha sido posible completar la solicitud debido a restricciones en el sistema de archivos.',
105 : 'La extensión del archivo no es válida.',
109 : 'Petición inválida.',
110 : 'Error desconocido.',
115 : 'Ya existe un archivo o carpeta con ese nombre.',
116 : 'No se ha encontrado la carpeta. Por favor, actualice y pruebe de nuevo.',
117 : 'No se ha encontrado el archivo. Por favor, actualice la lista de archivos y pruebe de nuevo.',
118 : 'Las rutas origen y destino son iguales.',
201 : 'Ya existía un archivo con ese nombre. El archivo subido ha sido renombrado como "%1"',
202 : 'Archivo inválido',
203 : 'Archivo inválido. El tamaño es demasiado grande.',
204 : 'El archivo subido está corrupto.',
205 : 'La carpeta temporal no está disponible en el servidor para las subidas.',
206 : 'La subida se ha cancelado por razones de seguridad. El archivo contenía código HTML.',
207 : 'El archivo subido ha sido renombrado como "%1"',
300 : 'Ha fallado el mover el(los) archivo(s).',
301 : 'Ha fallado el copiar el(los) archivo(s).',
500 : 'El navegador de archivos está deshabilitado por razones de seguridad. Por favor, contacte con el administrador de su sistema y compruebe el archivo de configuración de CKFinder.',
501 : 'El soporte para iconos está deshabilitado.'
},
// Other Error Messages.
ErrorMsg :
{
FileEmpty : 'El nombre del archivo no puede estar vacío',
FileExists : 'El archivo %s ya existe',
FolderEmpty : 'El nombre de la carpeta no puede estar vacío',
FileInvChar : 'El nombre del archivo no puede contener ninguno de los caracteres siguientes: \n\\ / : * ? " < > |',
FolderInvChar : 'El nombre de la carpeta no puede contener ninguno de los caracteres siguientes: \n\\ / : * ? " < > |',
PopupBlockView : 'No ha sido posible abrir el archivo en una nueva ventana. Por favor, configure su navegador y desactive todos los bloqueadores de ventanas para esta página.'
},
// Imageresize plugin
Imageresize :
{
dialogTitle : 'Redimensionar %s',
sizeTooBig : 'No se puede poner la altura o anchura de la imagen mayor que las dimensiones originales (%size).',
resizeSuccess : 'Imagen redimensionada correctamente.',
thumbnailNew : 'Crear nueva minuatura',
thumbnailSmall : 'Pequeña (%s)',
thumbnailMedium : 'Mediana (%s)',
thumbnailLarge : 'Grande (%s)',
newSize : 'Establecer nuevo tamaño',
width : 'Ancho',
height : 'Alto',
invalidHeight : 'Altura inválida.',
invalidWidth : 'Anchura inválida.',
invalidName : 'Nombre no válido.',
newImage : 'Crear nueva imagen',
noExtensionChange : 'La extensión no se puede cambiar.',
imageSmall : 'La imagen original es demasiado pequeña',
contextMenuName : 'Redimensionar'
},
// Fileeditor plugin
Fileeditor :
{
save : 'Guardar',
fileOpenError : 'No se puede abrir el archivo.',
fileSaveSuccess : 'Archivo guardado correctamente.',
contextMenuName : 'Editar',
loadingFile : 'Cargando archivo, por favor espere...'
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/lang/es-mx.js | JavaScript | gpl3 | 9,038 |
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
*/
/**
* @fileOverview Defines the {@link CKFinder.lang} object, for the Portuguese (Brazilian)
* language. This is the base file for all translations.
*/
/**
* Constains the dictionary of language entries.
* @namespace
*/
CKFinder.lang['pt-br'] =
{
appTitle : 'CKFinder',
// Common messages and labels.
common :
{
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING
confirmCancel : 'Algumas opções foram modificadas. Deseja fechar a janela realmente?',
ok : 'OK',
cancel : 'Cancelar',
confirmationTitle : 'Confirmação',
messageTitle : 'Informação',
inputTitle : 'Pergunta',
undo : 'Desfazer',
redo : 'Refazer',
skip : 'Skip', // MISSING
skipAll : 'Skip all', // MISSING
makeDecision : 'What action should be taken?', // MISSING
rememberDecision: 'Remember my decision' // MISSING
},
dir : 'ltr',
HelpLang : 'en',
LangCode : 'pt-br',
// Date Format
// d : Day
// dd : Day (padding zero)
// m : Month
// mm : Month (padding zero)
// yy : Year (two digits)
// yyyy : Year (four digits)
// h : Hour (12 hour clock)
// hh : Hour (12 hour clock, padding zero)
// H : Hour (24 hour clock)
// HH : Hour (24 hour clock, padding zero)
// M : Minute
// MM : Minute (padding zero)
// a : Firt char of AM/PM
// aa : AM/PM
DateTime : 'dd/mm/yyyy HH:MM',
DateAmPm : ['AM', 'PM'],
// Folders
FoldersTitle : 'Pastas',
FolderLoading : 'Carregando...',
FolderNew : 'Favor informar o nome da nova pasta: ',
FolderRename : 'Favor informar o nome da nova pasta: ',
FolderDelete : 'Você tem certeza que deseja apagar a pasta "%1"?',
FolderRenaming : ' (Renomeando...)',
FolderDeleting : ' (Apagando...)',
// Files
FileRename : 'Favor informar o nome do novo arquivo: ',
FileRenameExt : 'Você tem certeza que deseja alterar a extensão do arquivo? O arquivo pode ser danificado',
FileRenaming : 'Renomeando...',
FileDelete : 'Você tem certeza que deseja apagar o arquivo "%1"?',
FilesLoading : 'Carregando...',
FilesEmpty : 'Pasta vazia',
FilesMoved : 'Arquivo %1 movido para %2:%3',
FilesCopied : 'Arquivo %1 copiado em %2:%3',
// Basket
BasketFolder : 'Cesta',
BasketClear : 'Limpa Cesta',
BasketRemove : 'Remove da cesta',
BasketOpenFolder : 'Abre a pasta original',
BasketTruncateConfirm : 'Remover todos os arquivas da cesta?',
BasketRemoveConfirm : 'Remover o arquivo "%1" da cesta?',
BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING
BasketCopyFilesHere : 'Copia Arquivos da Cesta',
BasketMoveFilesHere : 'Move os Arquivos da Cesta',
BasketPasteErrorOther : 'File %s error: %e', // MISSING
BasketPasteMoveSuccess : 'Os seguintes arquivos foram movidos: %s',
BasketPasteCopySuccess : 'Os sequintes arquivos foram copiados: %s',
// Toolbar Buttons (some used elsewhere)
Upload : 'Enviar arquivo',
UploadTip : 'Enviar novo arquivo',
Refresh : 'Atualizar',
Settings : 'Configurações',
Help : 'Ajuda',
HelpTip : 'Ajuda',
// Context Menus
Select : 'Selecionar',
SelectThumbnail : 'Selecionar miniatura',
View : 'Visualizar',
Download : 'Download',
NewSubFolder : 'Nova sub-pasta',
Rename : 'Renomear',
Delete : 'Apagar',
CopyDragDrop : 'Copia arquivo aqui',
MoveDragDrop : 'Move arquivo aqui',
// Dialogs
RenameDlgTitle : 'Renomeia',
NewNameDlgTitle : 'Novo nome',
FileExistsDlgTitle : 'O arquivo já existe',
SysErrorDlgTitle : 'System error', // MISSING
FileOverwrite : 'Sobrescrever',
FileAutorename : 'Renomeia automaticamente',
// Generic
OkBtn : 'OK',
CancelBtn : 'Cancelar',
CloseBtn : 'Fechar',
// Upload Panel
UploadTitle : 'Enviar novo arquivo',
UploadSelectLbl : 'Selecione o arquivo para enviar',
UploadProgressLbl : '(Enviado arquivo, favor aguardar...)',
UploadBtn : 'Enviar arquivo selecionado',
UploadBtnCancel : 'Cancelar',
UploadNoFileMsg : 'Favor selecionar o arquivo no seu computador',
UploadNoFolder : 'Favor selecionar a pasta antes the enviar o arquivo.',
UploadNoPerms : 'Não é permitido o envio de arquivos.',
UploadUnknError : 'Erro no envio do arquivo.',
UploadExtIncorrect : 'A extensão deste arquivo não é permitida nesat pasta.',
// Settings Panel
SetTitle : 'Configurações',
SetView : 'Visualizar:',
SetViewThumb : 'Miniaturas',
SetViewList : 'Lista',
SetDisplay : 'Exibir:',
SetDisplayName : 'Arquivo',
SetDisplayDate : 'Data',
SetDisplaySize : 'Tamanho',
SetSort : 'Ordenar:',
SetSortName : 'por Nome do arquivo',
SetSortDate : 'por Data',
SetSortSize : 'por Tamanho',
// Status Bar
FilesCountEmpty : '<Pasta vazia>',
FilesCountOne : '1 arquivo',
FilesCountMany : '%1 arquivos',
// Size and Speed
Kb : '%1 kB',
KbPerSecond : '%1 kB/s',
// Connector Error Messages.
ErrorUnknown : 'Não foi possível completer o seu pedido. (Erro %1)',
Errors :
{
10 : 'Comando inválido.',
11 : 'O tipo de recurso não foi especificado na solicitação.',
12 : 'O recurso solicitado não é válido.',
102 : 'Nome do arquivo ou pasta inválido.',
103 : 'Não foi possível completar a solicitação por restrições de acesso.',
104 : 'Não foi possível completar a solicitação por restrições de acesso do sistema de arquivos.',
105 : 'Extensão de arquivo inválida.',
109 : 'Solicitação inválida.',
110 : 'Erro desconhecido.',
115 : 'Uma arquivo ou pasta já existe com esse nome.',
116 : 'Pasta não encontrada. Atualize e tente novamente.',
117 : 'Arquivo não encontrado. Atualize a lista de arquivos e tente novamente.',
118 : 'Source and target paths are equal.', // MISSING
201 : 'Um arquivo com o mesmo nome já está disponível. O arquivo enviado foi renomeado para "%1"',
202 : 'Arquivo inválido',
203 : 'Arquivo inválido. O tamanho é muito grande.',
204 : 'O arquivo enviado está corrompido.',
205 : 'Nenhuma pasta temporária para envio está disponível no servidor.',
206 : 'Transmissão cancelada por razões de segurança. O arquivo contem dados HTML.',
207 : 'O arquivo enviado foi renomeado para "%1"',
300 : 'Não foi possível mover o(s) arquivo(s).',
301 : 'Não foi possível copiar o(s) arquivos(s).',
500 : 'A navegação de arquivos está desativada por razões de segurança. Contacte o administrador do sistema.',
501 : 'O suporte a miniaturas está desabilitado.'
},
// Other Error Messages.
ErrorMsg :
{
FileEmpty : 'O nome do arquivo não pode ser vazio',
FileExists : 'O nome %s já é em uso',
FolderEmpty : 'O nome da pasta não pode ser vazio',
FileInvChar : 'O nome do arquivo não pode conter nenhum desses caracteres: \n\\ / : * ? " < > |',
FolderInvChar : 'O nome da pasta não pode conter nenhum desses caracteres: \n\\ / : * ? " < > |',
PopupBlockView : 'Não foi possível abrir o arquivo em outra janela. Configure seu navegador e desabilite o bloqueio a popups para esse site.'
},
// Imageresize plugin
Imageresize :
{
dialogTitle : 'Redimensionar %s',
sizeTooBig : 'Não possível usar dimensões maiores do que as originais (%size).',
resizeSuccess : 'Imagem redimensionada corretamente.',
thumbnailNew : 'Cria nova anteprima',
thumbnailSmall : 'Pequeno (%s)',
thumbnailMedium : 'Médio (%s)',
thumbnailLarge : 'Grande (%s)',
newSize : 'Novas dimensões',
width : 'Largura',
height : 'Altura',
invalidHeight : 'Altura incorreta.',
invalidWidth : 'Largura incorreta.',
invalidName : 'O nome do arquivo não é válido.',
newImage : 'Cria nova imagem',
noExtensionChange : 'A extensão do arquivo não pode ser modificada.',
imageSmall : 'A imagem original é muito pequena',
contextMenuName : 'Redimensionar'
},
// Fileeditor plugin
Fileeditor :
{
save : 'Salva',
fileOpenError : 'Não é possível abrir o arquivo.',
fileSaveSuccess : 'Arquivo salvado corretamente.',
contextMenuName : 'Modificar',
loadingFile : 'Carregando arquivo. Por favor aguarde...'
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/lang/pt-br.js | JavaScript | gpl3 | 8,717 |
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
*/
/**
* @fileOverview
*/
/**
* Constains the dictionary of language entries.
* @namespace
*/
CKFinder.lang['nn'] =
{
appTitle : 'CKFinder', // MISSING
// Common messages and labels.
common :
{
// Put the voice-only part of the label in the span.
unavailable : '%1<span class="cke_accessibility">, unavailable</span>', // MISSING
confirmCancel : 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING
ok : 'OK', // MISSING
cancel : 'Cancel', // MISSING
confirmationTitle : 'Confirmation', // MISSING
messageTitle : 'Information', // MISSING
inputTitle : 'Question', // MISSING
undo : 'Undo', // MISSING
redo : 'Redo', // MISSING
skip : 'Skip', // MISSING
skipAll : 'Skip all', // MISSING
makeDecision : 'What action should be taken?', // MISSING
rememberDecision: 'Remember my decision' // MISSING
},
dir : 'ltr', // MISSING
HelpLang : 'en',
LangCode : 'no',
// Date Format
// d : Day
// dd : Day (padding zero)
// m : Month
// mm : Month (padding zero)
// yy : Year (two digits)
// yyyy : Year (four digits)
// h : Hour (12 hour clock)
// hh : Hour (12 hour clock, padding zero)
// H : Hour (24 hour clock)
// HH : Hour (24 hour clock, padding zero)
// M : Minute
// MM : Minute (padding zero)
// a : Firt char of AM/PM
// aa : AM/PM
DateTime : 'dd/mm/yyyy HH:MM',
DateAmPm : ['AM', 'PM'],
// Folders
FoldersTitle : 'Mapper',
FolderLoading : 'Laster...',
FolderNew : 'Skriv inn det nye mappenavnet: ',
FolderRename : 'Skriv inn det nye mappenavnet: ',
FolderDelete : 'Er du sikker på at du vil slette mappen "%1"?',
FolderRenaming : ' (Endrer mappenavn...)',
FolderDeleting : ' (Sletter...)',
// Files
FileRename : 'Skriv inn det nye filnavnet: ',
FileRenameExt : 'Er du sikker på at du vil endre filtypen? Filen kan bli ubrukelig',
FileRenaming : 'Endrer filnavn...',
FileDelete : 'Er du sikker på at du vil slette denne filen "%1"?',
FilesLoading : 'Loading...', // MISSING
FilesEmpty : 'Empty folder', // MISSING
FilesMoved : 'File %1 moved into %2:%3', // MISSING
FilesCopied : 'File %1 copied into %2:%3', // MISSING
// Basket
BasketFolder : 'Basket', // MISSING
BasketClear : 'Clear Basket', // MISSING
BasketRemove : 'Remove from basket', // MISSING
BasketOpenFolder : 'Open parent folder', // MISSING
BasketTruncateConfirm : 'Do you really want to remove all files from the basket?', // MISSING
BasketRemoveConfirm : 'Do you really want to remove the file "%1" from the basket?', // MISSING
BasketEmpty : 'No files in the basket, drag\'n\'drop some.', // MISSING
BasketCopyFilesHere : 'Copy Files from Basket', // MISSING
BasketMoveFilesHere : 'Move Files from Basket', // MISSING
BasketPasteErrorOther : 'File %s error: %e', // MISSING
BasketPasteMoveSuccess : 'The following files were moved: %s', // MISSING
BasketPasteCopySuccess : 'The following files were copied: %s', // MISSING
// Toolbar Buttons (some used elsewhere)
Upload : 'Last opp',
UploadTip : 'Last opp en ny fil',
Refresh : 'Oppdater',
Settings : 'Innstillinger',
Help : 'Hjelp',
HelpTip : 'Hjelp finnes kun på engelsk',
// Context Menus
Select : 'Velg',
SelectThumbnail : 'Velg Miniatyr',
View : 'Vis fullversjon',
Download : 'Last ned',
NewSubFolder : 'Ny Undermappe',
Rename : 'Endre navn',
Delete : 'Slett',
CopyDragDrop : 'Copy file here', // MISSING
MoveDragDrop : 'Move file here', // MISSING
// Dialogs
RenameDlgTitle : 'Rename', // MISSING
NewNameDlgTitle : 'New name', // MISSING
FileExistsDlgTitle : 'File already exists', // MISSING
SysErrorDlgTitle : 'System error', // MISSING
FileOverwrite : 'Overwrite', // MISSING
FileAutorename : 'Auto-rename', // MISSING
// Generic
OkBtn : 'OK',
CancelBtn : 'Avbryt',
CloseBtn : 'Lukk',
// Upload Panel
UploadTitle : 'Last opp ny fil',
UploadSelectLbl : 'Velg filen du vil laste opp',
UploadProgressLbl : '(Laster opp filen, vennligst vent...)',
UploadBtn : 'Last opp valgt fil',
UploadBtnCancel : 'Cancel', // MISSING
UploadNoFileMsg : 'Du må velge en fil fra din datamaskin',
UploadNoFolder : 'Please select folder before uploading.', // MISSING
UploadNoPerms : 'File upload not allowed.', // MISSING
UploadUnknError : 'Error sending the file.', // MISSING
UploadExtIncorrect : 'File extension not allowed in this folder.', // MISSING
// Settings Panel
SetTitle : 'Innstillinger',
SetView : 'Filvisning:',
SetViewThumb : 'Miniatyrbilder',
SetViewList : 'Liste',
SetDisplay : 'Vis:',
SetDisplayName : 'Filnavn',
SetDisplayDate : 'Dato',
SetDisplaySize : 'Filstørrelse',
SetSort : 'Sorter etter:',
SetSortName : 'Filnavn',
SetSortDate : 'Dato',
SetSortSize : 'Størrelse',
// Status Bar
FilesCountEmpty : '<Tom Mappe>',
FilesCountOne : '1 fil',
FilesCountMany : '%1 filer',
// Size and Speed
Kb : '%1 kB',
KbPerSecond : '%1 kB/s',
// Connector Error Messages.
ErrorUnknown : 'Det var ikke mulig å utføre forespørselen. (Feil %1)',
Errors :
{
10 : 'Ugyldig kommando.',
11 : 'Ressurstypen ble ikke spesifisert i forepørselen.',
12 : 'Ugyldig ressurstype.',
102 : 'Ugyldig fil- eller mappenavn.',
103 : 'Kunne ikke utføre forespørselen pga manglende autorisasjon.',
104 : 'Kunne ikke utføre forespørselen pga manglende tilgang til filsystemet.',
105 : 'Ugyldig filtype.',
109 : 'Ugyldig forespørsel.',
110 : 'Ukjent feil.',
115 : 'Det finnes allerede en fil eller mappe med dette navnet.',
116 : 'Kunne ikke finne mappen. Oppdater vinduet og prøv igjen.',
117 : 'Kunne ikke finne filen. Oppdater vinduet og prøv igjen.',
118 : 'Source and target paths are equal.', // MISSING
201 : 'Det fantes allerede en fil med dette navnet. Den opplastede filens navn har blitt endret til "%1"',
202 : 'Ugyldig fil',
203 : 'Ugyldig fil. Filen er for stor.',
204 : 'Den opplastede filen er korrupt.',
205 : 'Det finnes ingen midlertidig mappe for filopplastinger.',
206 : 'Opplastingen ble avbrutt av sikkerhetshensyn. Filen inneholder HTML-aktig data.',
207 : 'Den opplastede filens navn har blitt endret til "%1"',
300 : 'Moving file(s) failed.', // MISSING
301 : 'Copying file(s) failed.', // MISSING
500 : 'Filvelgeren ikke tilgjengelig av sikkerhetshensyn. Kontakt systemansvarlig og be han sjekke CKFinder\'s konfigurasjonsfil.',
501 : 'Funksjon for minityrbilder er skrudd av.'
},
// Other Error Messages.
ErrorMsg :
{
FileEmpty : 'Filnavnet kan ikke være tomt',
FileExists : 'File %s already exists', // MISSING
FolderEmpty : 'Mappenavnet kan ikke være tomt',
FileInvChar : 'Filnavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |',
FolderInvChar : 'Mappenavnet kan ikke inneholde følgende tegn: \n\\ / : * ? " < > |',
PopupBlockView : 'Du må skru av popup-blockeren for å se bildet i nytt vindu.'
},
// Imageresize plugin
Imageresize :
{
dialogTitle : 'Resize %s', // MISSING
sizeTooBig : 'Cannot set image height or width to a value bigger than the original size (%size).', // MISSING
resizeSuccess : 'Image resized successfully.', // MISSING
thumbnailNew : 'Create new thumbnail', // MISSING
thumbnailSmall : 'Small (%s)', // MISSING
thumbnailMedium : 'Medium (%s)', // MISSING
thumbnailLarge : 'Large (%s)', // MISSING
newSize : 'Set new size', // MISSING
width : 'Width', // MISSING
height : 'Height', // MISSING
invalidHeight : 'Invalid height.', // MISSING
invalidWidth : 'Invalid width.', // MISSING
invalidName : 'Invalid file name.', // MISSING
newImage : 'Create new image', // MISSING
noExtensionChange : 'The file extension cannot be changed.', // MISSING
imageSmall : 'Source image is too small', // MISSING
contextMenuName : 'Resize' // MISSING
},
// Fileeditor plugin
Fileeditor :
{
save : 'Save', // MISSING
fileOpenError : 'Unable to open file.', // MISSING
fileSaveSuccess : 'File saved successfully.', // MISSING
contextMenuName : 'Edit', // MISSING
loadingFile : 'Loading file, please wait...' // MISSING
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/lang/nn.js | JavaScript | gpl3 | 8,789 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckfinder.com/license
*/
CKFinder.customConfig = function (config) {
// Define changes to default configuration here. For example:
// config.skin = 'v1';
config.language = 'zh-cn';
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/config.js | JavaScript | gpl3 | 330 |
<?php
class Watermark
{
function onAfterFileUpload($currentFolder, $uploadedFile, $sFilePath)
{
global $config;
$watermarkSettings = $config['Plugin_Watermark'];
$this->createWatermark($sFilePath, $watermarkSettings['source'], $watermarkSettings['marginRight'],
$watermarkSettings['marginBottom'], $watermarkSettings['quality'], $watermarkSettings['transparency']);
return true;
}
function createWatermark($sourceFile, $watermarkFile, $marginLeft = 5, $marginBottom = 5, $quality = 90, $transparency = 100)
{
if (!file_exists($watermarkFile)) {
$watermarkFile = dirname(__FILE__) . "/" . $watermarkFile;
}
if (!file_exists($watermarkFile)) {
return false;
}
$watermarkImageAttr = @getimagesize($watermarkFile);
$sourceImageAttr = @getimagesize($sourceFile);
if ($sourceImageAttr === false || $watermarkImageAttr === false) {
return false;
}
switch ($watermarkImageAttr['mime'])
{
case 'image/gif':
{
if (@imagetypes() & IMG_GIF) {
$oWatermarkImage = @imagecreatefromgif($watermarkFile);
} else {
$ermsg = 'GIF images are not supported';
}
}
break;
case 'image/jpeg':
{
if (@imagetypes() & IMG_JPG) {
$oWatermarkImage = @imagecreatefromjpeg($watermarkFile) ;
} else {
$ermsg = 'JPEG images are not supported';
}
}
break;
case 'image/png':
{
if (@imagetypes() & IMG_PNG) {
$oWatermarkImage = @imagecreatefrompng($watermarkFile) ;
} else {
$ermsg = 'PNG images are not supported';
}
}
break;
case 'image/wbmp':
{
if (@imagetypes() & IMG_WBMP) {
$oWatermarkImage = @imagecreatefromwbmp($watermarkFile);
} else {
$ermsg = 'WBMP images are not supported';
}
}
break;
default:
$ermsg = $watermarkImageAttr['mime'].' images are not supported';
break;
}
switch ($sourceImageAttr['mime'])
{
case 'image/gif':
{
if (@imagetypes() & IMG_GIF) {
$oImage = @imagecreatefromgif($sourceFile);
} else {
$ermsg = 'GIF images are not supported';
}
}
break;
case 'image/jpeg':
{
if (@imagetypes() & IMG_JPG) {
$oImage = @imagecreatefromjpeg($sourceFile) ;
} else {
$ermsg = 'JPEG images are not supported';
}
}
break;
case 'image/png':
{
if (@imagetypes() & IMG_PNG) {
$oImage = @imagecreatefrompng($sourceFile) ;
} else {
$ermsg = 'PNG images are not supported';
}
}
break;
case 'image/wbmp':
{
if (@imagetypes() & IMG_WBMP) {
$oImage = @imagecreatefromwbmp($sourceFile);
} else {
$ermsg = 'WBMP images are not supported';
}
}
break;
default:
$ermsg = $sourceImageAttr['mime'].' images are not supported';
break;
}
if (isset($ermsg) || false === $oImage || false === $oWatermarkImage) {
return false;
}
$watermark_width = $watermarkImageAttr[0];
$watermark_height = $watermarkImageAttr[1];
$dest_x = $sourceImageAttr[0] - $watermark_width - $marginLeft;
$dest_y = $sourceImageAttr[1] - $watermark_height - $marginBottom;
if ( $sourceImageAttr['mime'] == 'image/png')
{
if(function_exists('imagesavealpha') && function_exists('imagecolorallocatealpha') )
{
$bg = imagecolorallocatealpha($oImage, 255, 255, 255, 127); // (PHP 4 >= 4.3.2, PHP 5)
imagefill($oImage, 0, 0 , $bg);
imagealphablending($oImage, false);
imagesavealpha($oImage, true); // (PHP 4 >= 4.3.2, PHP 5)
}
}
if ($watermarkImageAttr['mime'] == 'image/png') {
imagecopy($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height);
}
else {
imagecopymerge($oImage, $oWatermarkImage, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $transparency);
}
switch ($sourceImageAttr['mime'])
{
case 'image/gif':
imagegif($oImage, $sourceFile);
break;
case 'image/jpeg':
imagejpeg($oImage, $sourceFile, $quality);
break;
case 'image/png':
imagepng($oImage, $sourceFile);
break;
case 'image/wbmp':
imagewbmp($oImage, $sourceFile);
break;
}
imageDestroy($oImage);
imageDestroy($oWatermarkImage);
}
}
$watermark = new Watermark();
$config['Hooks']['AfterFileUpload'][] = array($watermark, 'onAfterFileUpload');
if (empty($config['Plugin_Watermark']))
{
$config['Plugin_Watermark'] = array(
"source" => "logo.gif",
"marginRight" => 5,
"marginBottom" => 5,
"quality" => 90,
"transparency" => 80,
);
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/watermark/plugin.php | PHP | gpl3 | 6,314 |
CKFinder.addPlugin( 'imageresize', {
connectorInitialized : function( api, xml ) {
var node = xml.selectSingleNode( 'Connector/PluginsInfo/imageresize/@smallThumb' );
if ( node )
CKFinder.config.imageresize_thumbSmall = node.value;
node = xml.selectSingleNode( 'Connector/PluginsInfo/imageresize/@mediumThumb' );
if ( node )
CKFinder.config.imageresize_thumbMedium = node.value;
node = xml.selectSingleNode( 'Connector/PluginsInfo/imageresize/@largeThumb' );
if ( node )
CKFinder.config.imageresize_thumbLarge = node.value;
},
uiReady : function( api ) {
var regexExt = /^(.*)\.([^\.]+)$/,
regexFileName = /^(.*?)(?:_\d+x\d+)?\.([^\.]+)$/,
regexGetSize = /^\s*(\d+)(px)?\s*$/i,
regexGetSizeOrEmpty = /(^\s*(\d+)(px)?\s*$)|^$/i,
imageDimension = { width : 0, height : 0 },
file,
doc;
var updateFileName = function( dialog )
{
var width = dialog.getValueOf( 'tab1', 'width' ) || 0,
height = dialog.getValueOf( 'tab1', 'height' ) || 0,
e = dialog.getContentElement('tab1', 'createNewBox');
if ( width && height )
{
var matches = file.name.match( regexFileName );
dialog.setValueOf( 'tab1', 'fileName', matches[1] + "_" + width + "x" + height + "." + matches[2]);
e.getElement().show();
}
else
e.getElement().hide();
};
var onSizeChange = function()
{
var value = this.getValue(), // This = input element.
dialog = this.getDialog(),
maxWidth = api.config.imagesMaxWidth,
maxHeight = api.config.imagesMaxHeight,
aMatch = value.match( regexGetSize ),
width = imageDimension.width,
height = imageDimension.height;
if ( aMatch )
value = aMatch[1];
if ( !api.config.imageresize_allowEnlarging )
{
if ( width && width < maxWidth )
maxWidth = width;
if ( height && height < maxHeight )
maxHeight = height;
}
if ( maxHeight > 0 && this.id == 'height' && value > maxHeight )
{
value = maxHeight;
dialog.setValueOf( 'tab1', 'height', value );
}
if ( maxWidth > 0 && this.id == 'width' && value > maxWidth )
{
value = maxWidth;
dialog.setValueOf( 'tab1', 'width', value );
}
// Only if ratio is locked
if ( dialog.lockRatio && width && height )
{
if ( this.id == 'height' )
{
if ( value && value != '0' )
value = Math.round( width * ( value / height ) );
if ( !isNaN( value ) )
{
// newWidth > maxWidth
if ( maxWidth > 0 && value > maxWidth )
{
value = maxWidth;
newHeight = Math.round( height * ( value / width ) );
dialog.setValueOf( 'tab1', 'height', newHeight );
}
dialog.setValueOf( 'tab1', 'width', value );
}
}
else //this.id = txtWidth.
{
if ( value && value != '0' )
value = Math.round( height * ( value / width ) );
if ( !isNaN( value ) )
{
// newHeight > maxHeight
if ( maxHeight > 0 && value > maxHeight )
{
value = maxHeight;
newWidth = Math.round( width * ( value / height ) );
dialog.setValueOf( 'tab1', 'width', newWidth );
}
dialog.setValueOf( 'tab1', 'height', value );
}
}
}
updateFileName( dialog );
};
var resetSize = function( dialog )
{
if ( imageDimension.width && imageDimension.height )
{
dialog.setValueOf( 'tab1', 'width', imageDimension.width );
dialog.setValueOf( 'tab1', 'height', imageDimension.height );
updateFileName( dialog );
}
};
var switchLockRatio = function( dialog, value )
{
var doc = dialog.getElement().getDocument(),
ratioButton = doc.getById( 'btnLockSizes' );
if ( imageDimension.width && imageDimension.height )
{
if ( value == 'check' ) // Check image ratio and original image ratio.
{
var width = dialog.getValueOf( 'tab1', 'width' ),
height = dialog.getValueOf( 'tab1', 'height' ),
originalRatio = imageDimension.width * 1000 / imageDimension.height,
thisRatio = width * 1000 / height;
dialog.lockRatio = false; // Default: unlock ratio
if ( !width && !height )
dialog.lockRatio = true; // If someone didn't start typing, lock ratio.
else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) )
{
if ( Math.round( originalRatio ) == Math.round( thisRatio ) )
dialog.lockRatio = true;
}
}
else if ( value != undefined )
dialog.lockRatio = value;
else
dialog.lockRatio = !dialog.lockRatio;
}
else if ( value != 'check' ) // I can't lock ratio if ratio is unknown.
dialog.lockRatio = false;
if ( dialog.lockRatio )
ratioButton.removeClass( 'ckf_btn_unlocked' );
else
ratioButton.addClass( 'ckf_btn_unlocked' );
return dialog.lockRatio;
};
CKFinder.dialog.add( 'resizeDialog', function( api )
{
return {
title : api.lang.Imageresize.dialogTitle.replace( '%s', api.getSelectedFile().name ),
// TODO resizable : CKFINDER.DIALOG_RESIZE_BOTH
minWidth : 390,
minHeight : 230,
onShow : function() {
var dialog = this,
thumbSmall = CKFinder.config.imageresize_thumbSmall,
thumbMedium = CKFinder.config.imageresize_thumbMedium,
thumbLarge = CKFinder.config.imageresize_thumbLarge;
doc = dialog.getElement().getDocument();
file = api.getSelectedFile();
this.setTitle( api.lang.Imageresize.dialogTitle.replace( '%s', file.name ) );
var previewImg = doc.getById('previewImage');
var sizeSpan = doc.getById('imageSize');
previewImg.setAttribute('src', file.getThumbnailUrl( true ));
var updateImgDimension = function( width, height ) {
if ( !width || !height )
{
sizeSpan.setText( '' );
return;
}
imageDimension.width = width;
imageDimension.height = height;
sizeSpan.setText( width + " x " + height + " px" );
CKFinder.tools.setTimeout( function(){ switchLockRatio( dialog, 'check' ); }, 0, dialog );
};
api.connector.sendCommand( "ImageResizeInfo", {
fileName : file.name
},
function( xml ) {
if ( xml.checkError() )
return;
var width = xml.selectSingleNode( 'Connector/ImageInfo/@width' ),
height = xml.selectSingleNode( 'Connector/ImageInfo/@height' );
if ( width && height )
{
width = parseInt( width.value, 10 );
height = parseInt( height.value, 10 );
updateImgDimension( width, height );
var checkThumbs = function( id, size ) {
if ( !size )
return;
var reThumb = /^(\d+)x(\d+)$/;
result = reThumb.exec( size );
var el = dialog.getContentElement( 'tab1', id );
if ( 0 + result[1] > width && 0 + result[2] > height )
{
el.disable();
el.getElement().setAttribute('title', api.lang.Imageresize.imageSmall).addClass('cke_disabled');
}
else
{
el.enable();
el.getElement().setAttribute('title', '').removeClass('cke_disabled');
}
};
checkThumbs('smallThumb', thumbSmall );
checkThumbs('mediumThumb', thumbMedium );
checkThumbs('largeThumb', thumbLarge );
}
},
file.folder.type,
file.folder
);
if ( !thumbSmall )
dialog.getContentElement('tab1', 'smallThumb').getElement().hide();
if ( !thumbMedium )
dialog.getContentElement('tab1', 'mediumThumb').getElement().hide();
if ( !thumbLarge )
dialog.getContentElement('tab1', 'largeThumb').getElement().hide();
if ( !thumbSmall && !thumbMedium && !thumbLarge )
dialog.getContentElement('tab1', 'thumbsLabel').getElement().hide();
dialog.setValueOf( 'tab1', 'fileName', file.name );
dialog.getContentElement('tab1', 'width').focus();
dialog.getContentElement('tab1', 'fileName').setValue('');
dialog.getContentElement('tab1', 'createNewBox').getElement().hide();
updateImgDimension( 0,0 );
},
onOk : function() {
var dialog = this,
width = dialog.getValueOf( 'tab1', 'width' ),
height = dialog.getValueOf( 'tab1', 'height' ),
small = dialog.getValueOf( 'tab1', 'smallThumb' ),
medium = dialog.getValueOf( 'tab1', 'mediumThumb' ),
large = dialog.getValueOf( 'tab1', 'largeThumb' ),
fileName = dialog.getValueOf( 'tab1', 'fileName' ),
createNew = dialog.getValueOf( 'tab1', 'createNew' );
if ( width && !height )
{
api.openMsgDialog( '', api.lang.Imageresize.invalidHeight );
return false;
}
else if ( !width && height )
{
api.openMsgDialog( '', api.lang.Imageresize.invalidWidth );
return false;
}
if ( !api.config.imageresize_allowEnlarging && ( parseInt( width, 10 ) > imageDimension.width || parseInt( height, 10 ) > imageDimension.height ) )
{
var str = api.lang.Imageresize.sizeTooBig;
api.openMsgDialog( '', str.replace( "%size", imageDimension.width + "x" + imageDimension.height ) );
return false;
}
if ( ( width && height ) || small || medium || large )
{
if ( !createNew )
fileName = file.name;
api.connector.sendCommandPost( "ImageResize", null, {
width : width,
height : height,
fileName : file.name,
newFileName : fileName,
overwrite : createNew ? 0 : 1,
small : small ? 1 : 0,
medium : medium ? 1 : 0,
large : large ? 1 : 0
},
function( xml ) {
if ( xml.checkError() )
return;
api.openMsgDialog( '', api.lang.Imageresize.resizeSuccess );
api.refreshOpenedFolder();
},
file.folder.type,
file.folder
);
}
return undefined;
},
contents : [
{
id : 'tab1',
label : '',
title : '',
expand : true,
padding : 0,
elements :
[
{
type : 'hbox',
widths : [ '180px', '280px' ],
children:
[
{
type : 'vbox',
children:
[
{
type : 'html',
html : '' +
'<style type="text/css">' +
'a.ckf_btn_reset' +
'{' +
'float: right;' +
'background-position: 0 -32px;' +
'background-image: url("' + CKFinder.getPluginPath('imageresize') + 'images/mini.gif");' +
'width: 16px;' +
'height: 16px;' +
'background-repeat: no-repeat;' +
'border: 1px none;' +
'font-size: 1px;' +
'}' +
'a.ckf_btn_locked,' +
'a.ckf_btn_unlocked' +
'{' +
'float: left;' +
'background-position: 0 0;' +
'background-image: url("' + CKFinder.getPluginPath('imageresize') + 'images/mini.gif");' +
'width: 16px;' +
'height: 16px;' +
'background-repeat: no-repeat;' +
'border: none 1px;' +
'font-size: 1px;' +
'}' +
'a.ckf_btn_unlocked' +
'{' +
'background-position: 0 -16px;' +
'background-image: url("' + CKFinder.getPluginPath('imageresize') + '/images/mini.gif");' +
'}' +
'.ckf_btn_over' +
'{' +
'border: outset 1px;' +
'cursor: pointer;' +
'cursor: hand;' +
'}' +
'</style>' +
'<div style="height:100px;padding:7px">' +
'<img id="previewImage" src="" style="margin-bottom:4px;" /><br />' +
'<span style="font-size:9px;" id="imageSize"></span>' +
'</div>'
},
{
type : 'html',
id : 'thumbsLabel',
html : '<strong>' + api.lang.Imageresize.thumbnailNew + '</strong>'
},
{
type : 'checkbox',
id : 'smallThumb',
checked : false,
label : api.lang.Imageresize.thumbnailSmall.replace( '%s', CKFinder.config.imageresize_thumbSmall )
},
{
type : 'checkbox',
id : 'mediumThumb',
checked : false,
label : api.lang.Imageresize.thumbnailMedium.replace( '%s', CKFinder.config.imageresize_thumbMedium )
},
{
type : 'checkbox',
id : 'largeThumb',
checked : false,
label : api.lang.Imageresize.thumbnailLarge.replace( '%s', CKFinder.config.imageresize_thumbLarge )
}
]
},
{
type : 'vbox',
children :
[
{
type : 'html',
html : '<strong>' + api.lang.Imageresize.newSize + '</strong>'
},
{
type : 'hbox',
widths : [ '80%', '20%' ],
children:
[
{
type : 'vbox',
children:
[
{
type : 'text',
labelLayout : 'horizontal',
label : api.lang.Imageresize.width,
onKeyUp : onSizeChange,
validate: function()
{
var value = this.getValue();
if ( value )
{
var aMatch = value.match( regexGetSize );
if ( !aMatch || parseInt( aMatch[1], 10 ) < 1 )
{
api.openMsgDialog( '', api.lang.Imageresize.invalidWidth );
return false;
}
}
return true;
},
id : 'width'
},
{
type : 'text',
labelLayout : 'horizontal',
label : api.lang.Imageresize.height,
onKeyUp : onSizeChange,
validate: function()
{
var value = this.getValue();
if ( value )
{
var aMatch = value.match( regexGetSize );
if ( !aMatch || parseInt( aMatch[1], 10 ) < 1 )
{
api.openMsgDialog( '', api.lang.Imageresize.invalidHeight );
return false;
}
}
return true;
},
id : 'height'
}
]
},
{
type : 'html',
onLoad : function()
{
var doc = this.getElement().getDocument(),
dialog = this.getDialog();
// Activate Reset button
var resetButton = doc.getById( 'btnResetSize' ),
ratioButton = doc.getById( 'btnLockSizes' );
if ( resetButton )
{
resetButton.on( 'click', function(evt)
{
resetSize( this );
evt.data.preventDefault();
}, dialog );
resetButton.on( 'mouseover', function()
{
this.addClass( 'ckf_btn_over' );
}, resetButton );
resetButton.on( 'mouseout', function()
{
this.removeClass( 'ckf_btn_over' );
}, resetButton );
}
// Activate (Un)LockRatio button
if ( ratioButton )
{
ratioButton.on( 'click', function(evt)
{
var locked = switchLockRatio( this ),
width = this.getValueOf( 'tab1', 'width' );
if ( imageDimension.width && width )
{
var height = imageDimension.height / imageDimension.width * width;
if ( !isNaN( height ) )
{
this.setValueOf( 'tab1', 'height', Math.round( height ) );
updateFileName( dialog );
}
}
evt.data.preventDefault();
}, dialog );
ratioButton.on( 'mouseover', function()
{
this.addClass( 'ckf_btn_over' );
}, ratioButton );
ratioButton.on( 'mouseout', function()
{
this.removeClass( 'ckf_btn_over' );
}, ratioButton );
}
},
html : '<div style="margin-top:4px">'+
'<a href="javascript:void(0)" tabindex="-1" title="Lock ration" class="ckf_btn_locked ckf_btn_unlocked" id="btnLockSizes"></a>' +
'<a href="javascript:void(0)" tabindex="-1" title="Reset size" class="ckf_btn_reset" id="btnResetSize"></a>'+
'</div>'
}
]
},
{
type : 'vbox',
id : 'createNewBox',
hidden : true,
children:
[
{
type : 'checkbox',
checked : true,
id : 'createNew',
label : api.lang.Imageresize.newImage,
'default' : true,
onChange : function() {
var dialog = this.getDialog();
var filenameInput = dialog.getContentElement('tab1', 'fileName');
if ( filenameInput ) {
if (!this.getValue())
filenameInput.getElement().hide();
else
filenameInput.getElement().show();
}
}
},
{
type : 'text',
label : '',
validate : function() {
var dialog = this.getDialog(),
createNew = dialog.getContentElement('tab1', 'createNew'),
value = this.getValue(),
matches = value.match( regexExt );
if ( createNew && dialog.getValueOf( 'tab1', 'width' ) && dialog.getValueOf( 'tab1', 'height' ) )
{
if ( !value || !matches ) {
api.openMsgDialog( '', api.lang.Imageresize.invalidName );
return false;
}
if ( file.ext != matches[2] ) {
api.openMsgDialog( '', api.lang.Imageresize.noExtensionChange );
return false;
}
}
return true;
},
id : 'fileName'
}
]
}
]
}
]
}
]
}
],
// TODO http://dev.fckeditor.net/ticket/4750
buttons : [ CKFinder.dialog.okButton, CKFinder.dialog.cancelButton ]
};
} );
api.addFileContextMenuOption( { label : api.lang.Imageresize.contextMenuName, command : "resizeImage" } , function( api, file )
{
api.openDialog( 'resizeDialog' );
},
function ( file )
{
// Disable for files other than images.
if ( !file.isImage() || !api.getSelectedFolder().type )
return false;
if ( file.folder.acl.fileDelete && file.folder.acl.fileUpload )
return true;
else
return -1;
});
}
} );
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/imageresize/plugin.js | JavaScript | gpl3 | 19,335 |
<?php
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
* CKFinder extension: resize image according to a given size
*/
if (!defined('IN_CKFINDER')) exit;
/**
* Include base XML command handler
*/
require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php";
class CKFinder_Connector_CommandHandler_ImageResize extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
{
/**
* @access private
*/
function getConfig()
{
$config = array();
if (isset($GLOBALS['config']['plugin_imageresize'])) {
$config = $GLOBALS['config']['plugin_imageresize'];
}
if (!isset($config['smallThumb'])) {
$config['smallThumb'] = "90x90";
}
if (!isset($config['mediumThumb'])) {
$config['mediumThumb'] = "120x120";
}
if (!isset($config['largeThumb'])) {
$config['largeThumb'] = "180x180";
}
return $config;
}
/**
* handle request and build XML
* @access protected
*
*/
function buildXml()
{
if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
$this->checkConnector();
$this->checkRequest();
//resizing to 1x1 is almost equal to deleting a file, that's why FILE_DELETE permissions are required
if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE) || !$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_UPLOAD)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
}
$_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
if (!isset($_POST["fileName"])) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
}
$fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]);
if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
if (!$resourceTypeInfo->checkExtension($fileName, false)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
$filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
if (!file_exists($filePath) || !is_file($filePath)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
}
$newWidth = trim($_POST['width']);
$newHeight = trim($_POST['height']);
$quality = 80;
$resizeOriginal = !empty($_POST['width']) && !empty($_POST['height']);
if ($resizeOriginal) {
if (!preg_match("/^\d+$/", $newWidth) || !preg_match("/^\d+$/", $newHeight) || !preg_match("/^\d+$/", $newWidth)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
if (!isset($_POST["newFileName"])) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
}
$newFileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["newFileName"]);
if (!$resourceTypeInfo->checkExtension($newFileName)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION);
}
if (!CKFinder_Connector_Utils_FileSystem::checkFileName($newFileName) || $resourceTypeInfo->checkIsHiddenFile($newFileName)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
}
$newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $newFileName);
if (!is_writable(dirname($newFilePath))) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
}
if ($_POST['overwrite'] != "1" && file_exists($newFilePath)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST);
}
$_imagesConfig = $_config->getImagesConfig();
$maxWidth = $_imagesConfig->getMaxWidth();
$maxHeight = $_imagesConfig->getMaxHeight();
// Shouldn't happen as the JavaScript validation should not allow this.
if ( ( $maxWidth > 0 && $newWidth > $maxWidth ) || ( $maxHeight > 0 && $newHeight > $maxHeight ) ) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
}
require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/Thumbnail.php";
if ($resizeOriginal) {
$result = CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $newWidth, $newHeight, $quality, false) ;
if (!$result) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
}
}
$config = $this->getConfig();
$nameWithoutExt = preg_replace("/^(.+)\_\d+x\d+$/", "$1", CKFinder_Connector_Utils_FileSystem::getFileNameWithoutExtension($fileName));
$extension = CKFinder_Connector_Utils_FileSystem::getExtension($fileName);
foreach (array('small', 'medium', 'large') as $size) {
if (!empty($_POST[$size]) && $_POST[$size] == '1') {
$thumbName = $nameWithoutExt."_".$size.".".$extension;
$newFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $thumbName);
if (!empty($config[$size.'Thumb'])) {
if (preg_match("/^(\d+)x(\d+)$/", $config[$size.'Thumb'], $matches)) {
CKFinder_Connector_CommandHandler_Thumbnail::createThumb($filePath, $newFilePath, $matches[1], $matches[2], $quality, true) ;
}
}
}
}
}
/**
* @access public
*/
function onInitCommand( &$connectorNode )
{
// "@" protects against E_STRICT (Only variables should be assigned by reference)
@$pluginsInfo = &$connectorNode->getChild("PluginsInfo");
$imageresize = new CKFinder_Connector_Utils_XmlNode("imageresize");
$pluginsInfo->addChild($imageresize);
$config = $this->getConfig();
foreach (array('small', 'medium', 'large') as $size) {
if (!empty($config[$size.'Thumb'])) {
$imageresize->addAttribute($size.'Thumb', $config[$size.'Thumb']);
}
}
return true ;
}
/**
* @access public
*/
function onBeforeExecuteCommand( &$command )
{
if ( $command == 'ImageResize' )
{
$this->sendResponse();
return false;
}
return true ;
}
}
class CKFinder_Connector_CommandHandler_ImageResizeInfo extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
{
/**
* handle request and build XML
* @access protected
*
*/
function buildXml()
{
$this->checkConnector();
$this->checkRequest();
if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_VIEW)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
}
$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
if (!isset($_GET["fileName"])) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
}
$fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_GET["fileName"]);
if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
if (!$resourceTypeInfo->checkExtension($fileName, false)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
$filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
if (!file_exists($filePath) || !is_file($filePath)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
}
list($width, $height) = getimagesize($filePath);
$oNode = new Ckfinder_Connector_Utils_XmlNode("ImageInfo");
$oNode->addAttribute("width", $width);
$oNode->addAttribute("height", $height);
$this->_connectorNode->addChild($oNode);
}
/**
* @access public
*/
function onBeforeExecuteCommand( &$command )
{
if ( $command == 'ImageResizeInfo' )
{
$this->sendResponse();
return false;
}
return true ;
}
}
if (function_exists('imagecreate')) {
$CommandHandler_ImageResize = new CKFinder_Connector_CommandHandler_ImageResize();
$CommandHandler_ImageResizeInfo = new CKFinder_Connector_CommandHandler_ImageResizeInfo();
$config['Hooks']['BeforeExecuteCommand'][] = array($CommandHandler_ImageResize, "onBeforeExecuteCommand");
$config['Hooks']['BeforeExecuteCommand'][] = array($CommandHandler_ImageResizeInfo, "onBeforeExecuteCommand");
$config['Hooks']['InitCommand'][] = array($CommandHandler_ImageResize, "onInitCommand");
$config['Plugins'][] = 'imageresize';
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/imageresize/plugin.php | PHP | gpl3 | 10,328 |
/* Demonstration of embedding CodeMirror in a bigger application. The
* interface defined here is a mess of prompts and confirms, and
* should probably not be used in a real project.
*/
function MirrorFrame(place, options) {
this.home = document.createElement("div");
if (place.appendChild)
place.appendChild(this.home);
else
place(this.home);
var self = this;
function makeButton(name, action) {
var button = document.createElement("input");
button.type = "button";
button.value = name;
self.home.appendChild(button);
button.onclick = function(){self[action].call(self);};
}
makeButton("Search", "search");
makeButton("Replace", "replace");
makeButton("Current line", "line");
makeButton("Jump to line", "jump");
makeButton("Insert constructor", "macro");
makeButton("Indent all", "reindent");
this.mirror = new CodeMirror(this.home, options);
}
MirrorFrame.prototype = {
search: function() {
var text = prompt("Enter search term:", "");
if (!text) return;
var first = true;
do {
var cursor = this.mirror.getSearchCursor(text, first);
first = false;
while (cursor.findNext()) {
cursor.select();
if (!confirm("Search again?"))
return;
}
} while (confirm("End of document reached. Start over?"));
},
replace: function() {
// This is a replace-all, but it is possible to implement a
// prompting replace.
var from = prompt("Enter search string:", ""), to;
if (from) to = prompt("What should it be replaced with?", "");
if (to == null) return;
var cursor = this.mirror.getSearchCursor(from, false);
while (cursor.findNext())
cursor.replace(to);
},
jump: function() {
var line = prompt("Jump to line:", "");
if (line && !isNaN(Number(line)))
this.mirror.jumpToLine(Number(line));
},
line: function() {
alert("The cursor is currently at line " + this.mirror.currentLine());
this.mirror.focus();
},
macro: function() {
var name = prompt("Name your constructor:", "");
if (name)
this.mirror.replaceSelection("function " + name + "() {\n \n}\n\n" + name + ".prototype = {\n \n};\n");
},
reindent: function() {
this.mirror.reindent();
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/mirrorframe.js | JavaScript | gpl3 | 2,354 |
var HTMLMixedParser = Editor.Parser = (function() {
// tags that trigger seperate parsers
var triggers = {
"script": "JSParser",
"style": "CSSParser"
};
function checkDependencies() {
var parsers = ['XMLParser'];
for (var p in triggers) parsers.push(triggers[p]);
for (var i in parsers) {
if (!window[parsers[i]]) throw new Error(parsers[i] + " parser must be loaded for HTML mixed mode to work.");
}
XMLParser.configure({useHTMLKludges: true});
}
function parseMixed(stream) {
checkDependencies();
var htmlParser = XMLParser.make(stream), localParser = null, inTag = false;
var iter = {next: top, copy: copy};
function top() {
var token = htmlParser.next();
if (token.content == "<")
inTag = true;
else if (token.style == "xml-tagname" && inTag === true)
inTag = token.content.toLowerCase();
else if (token.content == ">") {
if (triggers[inTag]) {
var parser = window[triggers[inTag]];
iter.next = local(parser, "</" + inTag);
}
inTag = false;
}
return token;
}
function local(parser, tag) {
var baseIndent = htmlParser.indentation();
localParser = parser.make(stream, baseIndent + indentUnit);
return function() {
if (stream.lookAhead(tag, false, false, true)) {
localParser = null;
iter.next = top;
return top();
}
var token = localParser.next();
var lt = token.value.lastIndexOf("<"), sz = Math.min(token.value.length - lt, tag.length);
if (lt != -1 && token.value.slice(lt, lt + sz).toLowerCase() == tag.slice(0, sz) &&
stream.lookAhead(tag.slice(sz), false, false, true)) {
stream.push(token.value.slice(lt));
token.value = token.value.slice(0, lt);
}
if (token.indentation) {
var oldIndent = token.indentation;
token.indentation = function(chars) {
if (chars == "</")
return baseIndent;
else
return oldIndent(chars);
};
}
return token;
};
}
function copy() {
var _html = htmlParser.copy(), _local = localParser && localParser.copy(),
_next = iter.next, _inTag = inTag;
return function(_stream) {
stream = _stream;
htmlParser = _html(_stream);
localParser = _local && _local(_stream);
iter.next = _next;
inTag = _inTag;
return iter;
};
}
return iter;
}
return {
make: parseMixed,
electricChars: "{}/:",
configure: function(obj) {
if (obj.triggers) triggers = obj.triggers;
}
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/parsehtmlmixed.js | JavaScript | gpl3 | 2,823 |
/* Simple parser for CSS */
var CSSParser = Editor.Parser = (function() {
var tokenizeCSS = (function() {
function normal(source, setState) {
var ch = source.next();
if (ch == "@") {
source.nextWhileMatches(/\w/);
return "css-at";
}
else if (ch == "/" && source.equals("*")) {
setState(inCComment);
return null;
}
else if (ch == "<" && source.equals("!")) {
setState(inSGMLComment);
return null;
}
else if (ch == "=") {
return "css-compare";
}
else if (source.equals("=") && (ch == "~" || ch == "|")) {
source.next();
return "css-compare";
}
else if (ch == "\"" || ch == "'") {
setState(inString(ch));
return null;
}
else if (ch == "#") {
source.nextWhileMatches(/\w/);
return "css-hash";
}
else if (ch == "!") {
source.nextWhileMatches(/[ \t]/);
source.nextWhileMatches(/\w/);
return "css-important";
}
else if (/\d/.test(ch)) {
source.nextWhileMatches(/[\w.%]/);
return "css-unit";
}
else if (/[,.+>*\/]/.test(ch)) {
return "css-select-op";
}
else if (/[;{}:\[\]]/.test(ch)) {
return "css-punctuation";
}
else {
source.nextWhileMatches(/[\w\\\-_]/);
return "css-identifier";
}
}
function inCComment(source, setState) {
var maybeEnd = false;
while (!source.endOfLine()) {
var ch = source.next();
if (maybeEnd && ch == "/") {
setState(normal);
break;
}
maybeEnd = (ch == "*");
}
return "css-comment";
}
function inSGMLComment(source, setState) {
var dashes = 0;
while (!source.endOfLine()) {
var ch = source.next();
if (dashes >= 2 && ch == ">") {
setState(normal);
break;
}
dashes = (ch == "-") ? dashes + 1 : 0;
}
return "css-comment";
}
function inString(quote) {
return function(source, setState) {
var escaped = false;
while (!source.endOfLine()) {
var ch = source.next();
if (ch == quote && !escaped)
break;
escaped = !escaped && ch == "\\";
}
if (!escaped)
setState(normal);
return "css-string";
};
}
return function(source, startState) {
return tokenizer(source, startState || normal);
};
})();
function indentCSS(inBraces, inRule, base) {
return function(nextChars) {
if (!inBraces || /^\}/.test(nextChars)) return base;
else if (inRule) return base + indentUnit * 2;
else return base + indentUnit;
};
}
// This is a very simplistic parser -- since CSS does not really
// nest, it works acceptably well, but some nicer colouroing could
// be provided with a more complicated parser.
function parseCSS(source, basecolumn) {
basecolumn = basecolumn || 0;
var tokens = tokenizeCSS(source);
var inBraces = false, inRule = false, inDecl = false;;
var iter = {
next: function() {
var token = tokens.next(), style = token.style, content = token.content;
if (style == "css-hash")
style = token.style = inRule ? "css-colorcode" : "css-identifier";
if (style == "css-identifier") {
if (inRule) token.style = "css-value";
else if (!inBraces && !inDecl) token.style = "css-selector";
}
if (content == "\n")
token.indentation = indentCSS(inBraces, inRule, basecolumn);
if (content == "{" && inDecl == "@media")
inDecl = false;
else if (content == "{")
inBraces = true;
else if (content == "}")
inBraces = inRule = inDecl = false;
else if (content == ";")
inRule = inDecl = false;
else if (inBraces && style != "css-comment" && style != "whitespace")
inRule = true;
else if (!inBraces && style == "css-at")
inDecl = content;
return token;
},
copy: function() {
var _inBraces = inBraces, _inRule = inRule, _tokenState = tokens.state;
return function(source) {
tokens = tokenizeCSS(source, _tokenState);
inBraces = _inBraces;
inRule = _inRule;
return iter;
};
}
};
return iter;
}
return {make: parseCSS, electricChars: "}"};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/parsecss.js | JavaScript | gpl3 | 4,685 |
/* Functionality for finding, storing, and restoring selections
*
* This does not provide a generic API, just the minimal functionality
* required by the CodeMirror system.
*/
// Namespace object.
var select = {};
(function() {
select.ie_selection = document.selection && document.selection.createRangeCollection;
// Find the 'top-level' (defined as 'a direct child of the node
// passed as the top argument') node that the given node is
// contained in. Return null if the given node is not inside the top
// node.
function topLevelNodeAt(node, top) {
while (node && node.parentNode != top)
node = node.parentNode;
return node;
}
// Find the top-level node that contains the node before this one.
function topLevelNodeBefore(node, top) {
while (!node.previousSibling && node.parentNode != top)
node = node.parentNode;
return topLevelNodeAt(node.previousSibling, top);
}
var fourSpaces = "\u00a0\u00a0\u00a0\u00a0";
select.scrollToNode = function(node, cursor) {
if (!node) return;
var element = node, body = document.body,
html = document.documentElement,
atEnd = !element.nextSibling || !element.nextSibling.nextSibling
|| !element.nextSibling.nextSibling.nextSibling;
// In Opera (and recent Webkit versions), BR elements *always*
// have a offsetTop property of zero.
var compensateHack = 0;
while (element && !element.offsetTop) {
compensateHack++;
element = element.previousSibling;
}
// atEnd is another kludge for these browsers -- if the cursor is
// at the end of the document, and the node doesn't have an
// offset, just scroll to the end.
if (compensateHack == 0) atEnd = false;
// WebKit has a bad habit of (sometimes) happily returning bogus
// offsets when the document has just been changed. This seems to
// always be 5/5, so we don't use those.
if (webkit && element && element.offsetTop == 5 && element.offsetLeft == 5)
return;
var y = compensateHack * (element ? element.offsetHeight : 0), x = 0,
width = (node ? node.offsetWidth : 0), pos = element;
while (pos && pos.offsetParent) {
y += pos.offsetTop;
// Don't count X offset for <br> nodes
if (!isBR(pos))
x += pos.offsetLeft;
pos = pos.offsetParent;
}
var scroll_x = body.scrollLeft || html.scrollLeft || 0,
scroll_y = body.scrollTop || html.scrollTop || 0,
scroll = false, screen_width = window.innerWidth || html.clientWidth || 0;
if (cursor || width < screen_width) {
if (cursor) {
var off = select.offsetInNode(node), size = nodeText(node).length;
if (size) x += width * (off / size);
}
var screen_x = x - scroll_x;
if (screen_x < 0 || screen_x > screen_width) {
scroll_x = x;
scroll = true;
}
}
var screen_y = y - scroll_y;
if (screen_y < 0 || atEnd || screen_y > (window.innerHeight || html.clientHeight || 0) - 50) {
scroll_y = atEnd ? 1e6 : y;
scroll = true;
}
if (scroll) window.scrollTo(scroll_x, scroll_y);
};
select.scrollToCursor = function(container) {
select.scrollToNode(select.selectionTopNode(container, true) || container.firstChild, true);
};
// Used to prevent restoring a selection when we do not need to.
var currentSelection = null;
select.snapshotChanged = function() {
if (currentSelection) currentSelection.changed = true;
};
// Find the 'leaf' node (BR or text) after the given one.
function baseNodeAfter(node) {
var next = node.nextSibling;
if (next) {
while (next.firstChild) next = next.firstChild;
if (next.nodeType == 3 || isBR(next)) return next;
else return baseNodeAfter(next);
}
else {
var parent = node.parentNode;
while (parent && !parent.nextSibling) parent = parent.parentNode;
return parent && baseNodeAfter(parent);
}
}
// This is called by the code in editor.js whenever it is replacing
// a text node. The function sees whether the given oldNode is part
// of the current selection, and updates this selection if it is.
// Because nodes are often only partially replaced, the length of
// the part that gets replaced has to be taken into account -- the
// selection might stay in the oldNode if the newNode is smaller
// than the selection's offset. The offset argument is needed in
// case the selection does move to the new object, and the given
// length is not the whole length of the new node (part of it might
// have been used to replace another node).
select.snapshotReplaceNode = function(from, to, length, offset) {
if (!currentSelection) return;
function replace(point) {
if (from == point.node) {
currentSelection.changed = true;
if (length && point.offset > length) {
point.offset -= length;
}
else {
point.node = to;
point.offset += (offset || 0);
}
}
else if (select.ie_selection && point.offset == 0 && point.node == baseNodeAfter(from)) {
currentSelection.changed = true;
}
}
replace(currentSelection.start);
replace(currentSelection.end);
};
select.snapshotMove = function(from, to, distance, relative, ifAtStart) {
if (!currentSelection) return;
function move(point) {
if (from == point.node && (!ifAtStart || point.offset == 0)) {
currentSelection.changed = true;
point.node = to;
if (relative) point.offset = Math.max(0, point.offset + distance);
else point.offset = distance;
}
}
move(currentSelection.start);
move(currentSelection.end);
};
// Most functions are defined in two ways, one for the IE selection
// model, one for the W3C one.
if (select.ie_selection) {
function selRange() {
var sel = document.selection;
return sel && (sel.createRange || sel.createTextRange)();
}
function selectionNode(start) {
var range = selRange();
range.collapse(start);
function nodeAfter(node) {
var found = null;
while (!found && node) {
found = node.nextSibling;
node = node.parentNode;
}
return nodeAtStartOf(found);
}
function nodeAtStartOf(node) {
while (node && node.firstChild) node = node.firstChild;
return {node: node, offset: 0};
}
var containing = range.parentElement();
if (!isAncestor(document.body, containing)) return null;
if (!containing.firstChild) return nodeAtStartOf(containing);
var working = range.duplicate();
working.moveToElementText(containing);
working.collapse(true);
for (var cur = containing.firstChild; cur; cur = cur.nextSibling) {
if (cur.nodeType == 3) {
var size = cur.nodeValue.length;
working.move("character", size);
}
else {
working.moveToElementText(cur);
working.collapse(false);
}
var dir = range.compareEndPoints("StartToStart", working);
if (dir == 0) return nodeAfter(cur);
if (dir == 1) continue;
if (cur.nodeType != 3) return nodeAtStartOf(cur);
working.setEndPoint("StartToEnd", range);
return {node: cur, offset: size - working.text.length};
}
return nodeAfter(containing);
}
select.markSelection = function() {
currentSelection = null;
var sel = document.selection;
if (!sel) return;
var start = selectionNode(true),
end = selectionNode(false);
if (!start || !end) return;
currentSelection = {start: start, end: end, changed: false};
};
select.selectMarked = function() {
if (!currentSelection || !currentSelection.changed) return;
function makeRange(point) {
var range = document.body.createTextRange(),
node = point.node;
if (!node) {
range.moveToElementText(document.body);
range.collapse(false);
}
else if (node.nodeType == 3) {
range.moveToElementText(node.parentNode);
var offset = point.offset;
while (node.previousSibling) {
node = node.previousSibling;
offset += (node.innerText || "").length;
}
range.move("character", offset);
}
else {
range.moveToElementText(node);
range.collapse(true);
}
return range;
}
var start = makeRange(currentSelection.start), end = makeRange(currentSelection.end);
start.setEndPoint("StartToEnd", end);
start.select();
};
select.offsetInNode = function(node) {
var range = selRange();
if (!range) return 0;
var range2 = range.duplicate();
try {range2.moveToElementText(node);} catch(e){return 0;}
range.setEndPoint("StartToStart", range2);
return range.text.length;
};
// Get the top-level node that one end of the cursor is inside or
// after. Note that this returns false for 'no cursor', and null
// for 'start of document'.
select.selectionTopNode = function(container, start) {
var range = selRange();
if (!range) return false;
var range2 = range.duplicate();
range.collapse(start);
var around = range.parentElement();
if (around && isAncestor(container, around)) {
// Only use this node if the selection is not at its start.
range2.moveToElementText(around);
if (range.compareEndPoints("StartToStart", range2) == 1)
return topLevelNodeAt(around, container);
}
// Move the start of a range to the start of a node,
// compensating for the fact that you can't call
// moveToElementText with text nodes.
function moveToNodeStart(range, node) {
if (node.nodeType == 3) {
var count = 0, cur = node.previousSibling;
while (cur && cur.nodeType == 3) {
count += cur.nodeValue.length;
cur = cur.previousSibling;
}
if (cur) {
try{range.moveToElementText(cur);}
catch(e){return false;}
range.collapse(false);
}
else range.moveToElementText(node.parentNode);
if (count) range.move("character", count);
}
else {
try{range.moveToElementText(node);}
catch(e){return false;}
}
return true;
}
// Do a binary search through the container object, comparing
// the start of each node to the selection
var start = 0, end = container.childNodes.length - 1;
while (start < end) {
var middle = Math.ceil((end + start) / 2), node = container.childNodes[middle];
if (!node) return false; // Don't ask. IE6 manages this sometimes.
if (!moveToNodeStart(range2, node)) return false;
if (range.compareEndPoints("StartToStart", range2) == 1)
start = middle;
else
end = middle - 1;
}
if (start == 0) {
var test1 = selRange(), test2 = test1.duplicate();
try {
test2.moveToElementText(container);
} catch(exception) {
return null;
}
if (test1.compareEndPoints("StartToStart", test2) == 0)
return null;
}
return container.childNodes[start] || null;
};
// Place the cursor after this.start. This is only useful when
// manually moving the cursor instead of restoring it to its old
// position.
select.focusAfterNode = function(node, container) {
var range = document.body.createTextRange();
range.moveToElementText(node || container);
range.collapse(!node);
range.select();
};
select.somethingSelected = function() {
var range = selRange();
return range && (range.text != "");
};
function insertAtCursor(html) {
var range = selRange();
if (range) {
range.pasteHTML(html);
range.collapse(false);
range.select();
}
}
// Used to normalize the effect of the enter key, since browsers
// do widely different things when pressing enter in designMode.
select.insertNewlineAtCursor = function() {
insertAtCursor("<br>");
};
select.insertTabAtCursor = function() {
insertAtCursor(fourSpaces);
};
// Get the BR node at the start of the line on which the cursor
// currently is, and the offset into the line. Returns null as
// node if cursor is on first line.
select.cursorPos = function(container, start) {
var range = selRange();
if (!range) return null;
var topNode = select.selectionTopNode(container, start);
while (topNode && !isBR(topNode))
topNode = topNode.previousSibling;
var range2 = range.duplicate();
range.collapse(start);
if (topNode) {
range2.moveToElementText(topNode);
range2.collapse(false);
}
else {
// When nothing is selected, we can get all kinds of funky errors here.
try { range2.moveToElementText(container); }
catch (e) { return null; }
range2.collapse(true);
}
range.setEndPoint("StartToStart", range2);
return {node: topNode, offset: range.text.length};
};
select.setCursorPos = function(container, from, to) {
function rangeAt(pos) {
var range = document.body.createTextRange();
if (!pos.node) {
range.moveToElementText(container);
range.collapse(true);
}
else {
range.moveToElementText(pos.node);
range.collapse(false);
}
range.move("character", pos.offset);
return range;
}
var range = rangeAt(from);
if (to && to != from)
range.setEndPoint("EndToEnd", rangeAt(to));
range.select();
}
// Some hacks for storing and re-storing the selection when the editor loses and regains focus.
select.getBookmark = function (container) {
var from = select.cursorPos(container, true), to = select.cursorPos(container, false);
if (from && to) return {from: from, to: to};
};
// Restore a stored selection.
select.setBookmark = function(container, mark) {
if (!mark) return;
select.setCursorPos(container, mark.from, mark.to);
};
}
// W3C model
else {
// Find the node right at the cursor, not one of its
// ancestors with a suitable offset. This goes down the DOM tree
// until a 'leaf' is reached (or is it *up* the DOM tree?).
function innerNode(node, offset) {
while (node.nodeType != 3 && !isBR(node)) {
var newNode = node.childNodes[offset] || node.nextSibling;
offset = 0;
while (!newNode && node.parentNode) {
node = node.parentNode;
newNode = node.nextSibling;
}
node = newNode;
if (!newNode) break;
}
return {node: node, offset: offset};
}
// Store start and end nodes, and offsets within these, and refer
// back to the selection object from those nodes, so that this
// object can be updated when the nodes are replaced before the
// selection is restored.
select.markSelection = function () {
var selection = window.getSelection();
if (!selection || selection.rangeCount == 0)
return (currentSelection = null);
var range = selection.getRangeAt(0);
currentSelection = {
start: innerNode(range.startContainer, range.startOffset),
end: innerNode(range.endContainer, range.endOffset),
changed: false
};
};
select.selectMarked = function () {
var cs = currentSelection;
// on webkit-based browsers, it is apparently possible that the
// selection gets reset even when a node that is not one of the
// endpoints get messed with. the most common situation where
// this occurs is when a selection is deleted or overwitten. we
// check for that here.
function focusIssue() {
if (cs.start.node == cs.end.node && cs.start.offset == cs.end.offset) {
var selection = window.getSelection();
if (!selection || selection.rangeCount == 0) return true;
var range = selection.getRangeAt(0), point = innerNode(range.startContainer, range.startOffset);
return cs.start.node != point.node || cs.start.offset != point.offset;
}
}
if (!cs || !(cs.changed || (webkit && focusIssue()))) return;
var range = document.createRange();
function setPoint(point, which) {
if (point.node) {
// Some magic to generalize the setting of the start and end
// of a range.
if (point.offset == 0)
range["set" + which + "Before"](point.node);
else
range["set" + which](point.node, point.offset);
}
else {
range.setStartAfter(document.body.lastChild || document.body);
}
}
setPoint(cs.end, "End");
setPoint(cs.start, "Start");
selectRange(range);
};
// Helper for selecting a range object.
function selectRange(range) {
var selection = window.getSelection();
if (!selection) return;
selection.removeAllRanges();
selection.addRange(range);
}
function selectionRange() {
var selection = window.getSelection();
if (!selection || selection.rangeCount == 0)
return false;
else
return selection.getRangeAt(0);
}
// Finding the top-level node at the cursor in the W3C is, as you
// can see, quite an involved process.
select.selectionTopNode = function(container, start) {
var range = selectionRange();
if (!range) return false;
var node = start ? range.startContainer : range.endContainer;
var offset = start ? range.startOffset : range.endOffset;
// Work around (yet another) bug in Opera's selection model.
if (window.opera && !start && range.endContainer == container && range.endOffset == range.startOffset + 1 &&
container.childNodes[range.startOffset] && isBR(container.childNodes[range.startOffset]))
offset--;
// For text nodes, we look at the node itself if the cursor is
// inside, or at the node before it if the cursor is at the
// start.
if (node.nodeType == 3){
if (offset > 0)
return topLevelNodeAt(node, container);
else
return topLevelNodeBefore(node, container);
}
// Occasionally, browsers will return the HTML node as
// selection. If the offset is 0, we take the start of the frame
// ('after null'), otherwise, we take the last node.
else if (node.nodeName.toUpperCase() == "HTML") {
return (offset == 1 ? null : container.lastChild);
}
// If the given node is our 'container', we just look up the
// correct node by using the offset.
else if (node == container) {
return (offset == 0) ? null : node.childNodes[offset - 1];
}
// In any other case, we have a regular node. If the cursor is
// at the end of the node, we use the node itself, if it is at
// the start, we use the node before it, and in any other
// case, we look up the child before the cursor and use that.
else {
if (offset == node.childNodes.length)
return topLevelNodeAt(node, container);
else if (offset == 0)
return topLevelNodeBefore(node, container);
else
return topLevelNodeAt(node.childNodes[offset - 1], container);
}
};
select.focusAfterNode = function(node, container) {
var range = document.createRange();
range.setStartBefore(container.firstChild || container);
// In Opera, setting the end of a range at the end of a line
// (before a BR) will cause the cursor to appear on the next
// line, so we set the end inside of the start node when
// possible.
if (node && !node.firstChild)
range.setEndAfter(node);
else if (node)
range.setEnd(node, node.childNodes.length);
else
range.setEndBefore(container.firstChild || container);
range.collapse(false);
selectRange(range);
};
select.somethingSelected = function() {
var range = selectionRange();
return range && !range.collapsed;
};
select.offsetInNode = function(node) {
var range = selectionRange();
if (!range) return 0;
range = range.cloneRange();
range.setStartBefore(node);
return range.toString().length;
};
select.insertNodeAtCursor = function(node) {
var range = selectionRange();
if (!range) return;
range.deleteContents();
range.insertNode(node);
webkitLastLineHack(document.body);
// work around weirdness where Opera will magically insert a new
// BR node when a BR node inside a span is moved around. makes
// sure the BR ends up outside of spans.
if (window.opera && isBR(node) && isSpan(node.parentNode)) {
var next = node.nextSibling, p = node.parentNode, outer = p.parentNode;
outer.insertBefore(node, p.nextSibling);
var textAfter = "";
for (; next && next.nodeType == 3; next = next.nextSibling) {
textAfter += next.nodeValue;
removeElement(next);
}
outer.insertBefore(makePartSpan(textAfter, document), node.nextSibling);
}
range = document.createRange();
range.selectNode(node);
range.collapse(false);
selectRange(range);
}
select.insertNewlineAtCursor = function() {
select.insertNodeAtCursor(document.createElement("BR"));
};
select.insertTabAtCursor = function() {
select.insertNodeAtCursor(document.createTextNode(fourSpaces));
};
select.cursorPos = function(container, start) {
var range = selectionRange();
if (!range) return;
var topNode = select.selectionTopNode(container, start);
while (topNode && !isBR(topNode))
topNode = topNode.previousSibling;
range = range.cloneRange();
range.collapse(start);
if (topNode)
range.setStartAfter(topNode);
else
range.setStartBefore(container);
var text = range.toString();
return {node: topNode, offset: text.length};
};
select.setCursorPos = function(container, from, to) {
var range = document.createRange();
function setPoint(node, offset, side) {
if (offset == 0 && node && !node.nextSibling) {
range["set" + side + "After"](node);
return true;
}
if (!node)
node = container.firstChild;
else
node = node.nextSibling;
if (!node) return;
if (offset == 0) {
range["set" + side + "Before"](node);
return true;
}
var backlog = []
function decompose(node) {
if (node.nodeType == 3)
backlog.push(node);
else
forEach(node.childNodes, decompose);
}
while (true) {
while (node && !backlog.length) {
decompose(node);
node = node.nextSibling;
}
var cur = backlog.shift();
if (!cur) return false;
var length = cur.nodeValue.length;
if (length >= offset) {
range["set" + side](cur, offset);
return true;
}
offset -= length;
}
}
to = to || from;
if (setPoint(to.node, to.offset, "End") && setPoint(from.node, from.offset, "Start"))
selectRange(range);
};
}
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/select.js | JavaScript | gpl3 | 24,516 |
/* A few useful utility functions. */
// Capture a method on an object.
function method(obj, name) {
return function() {obj[name].apply(obj, arguments);};
}
// The value used to signal the end of a sequence in iterators.
var StopIteration = {toString: function() {return "StopIteration"}};
// Apply a function to each element in a sequence.
function forEach(iter, f) {
if (iter.next) {
try {while (true) f(iter.next());}
catch (e) {if (e != StopIteration) throw e;}
}
else {
for (var i = 0; i < iter.length; i++)
f(iter[i]);
}
}
// Map a function over a sequence, producing an array of results.
function map(iter, f) {
var accum = [];
forEach(iter, function(val) {accum.push(f(val));});
return accum;
}
// Create a predicate function that tests a string againsts a given
// regular expression. No longer used but might be used by 3rd party
// parsers.
function matcher(regexp){
return function(value){return regexp.test(value);};
}
// Test whether a DOM node has a certain CSS class.
function hasClass(element, className) {
var classes = element.className;
return classes && new RegExp("(^| )" + className + "($| )").test(classes);
}
function removeClass(element, className) {
element.className = element.className.replace(new RegExp(" " + className + "\\b", "g"), "");
return element;
}
// Insert a DOM node after another node.
function insertAfter(newNode, oldNode) {
var parent = oldNode.parentNode;
parent.insertBefore(newNode, oldNode.nextSibling);
return newNode;
}
function removeElement(node) {
if (node.parentNode)
node.parentNode.removeChild(node);
}
function clearElement(node) {
while (node.firstChild)
node.removeChild(node.firstChild);
}
// Check whether a node is contained in another one.
function isAncestor(node, child) {
while (child = child.parentNode) {
if (node == child)
return true;
}
return false;
}
// The non-breaking space character.
var nbsp = "\u00a0";
var matching = {"{": "}", "[": "]", "(": ")",
"}": "{", "]": "[", ")": "("};
// Standardize a few unportable event properties.
function normalizeEvent(event) {
if (!event.stopPropagation) {
event.stopPropagation = function() {this.cancelBubble = true;};
event.preventDefault = function() {this.returnValue = false;};
}
if (!event.stop) {
event.stop = function() {
this.stopPropagation();
this.preventDefault();
};
}
if (event.type == "keypress") {
event.code = (event.charCode == null) ? event.keyCode : event.charCode;
event.character = String.fromCharCode(event.code);
}
return event;
}
// Portably register event handlers.
function addEventHandler(node, type, handler, removeFunc) {
function wrapHandler(event) {
handler(normalizeEvent(event || window.event));
}
if (typeof node.addEventListener == "function") {
node.addEventListener(type, wrapHandler, false);
if (removeFunc) return function() {node.removeEventListener(type, wrapHandler, false);};
}
else {
node.attachEvent("on" + type, wrapHandler);
if (removeFunc) return function() {node.detachEvent("on" + type, wrapHandler);};
}
}
function nodeText(node) {
return node.textContent || node.innerText || node.nodeValue || "";
}
function nodeTop(node) {
var top = 0;
while (node.offsetParent) {
top += node.offsetTop;
node = node.offsetParent;
}
return top;
}
function isBR(node) {
var nn = node.nodeName;
return nn == "BR" || nn == "br";
}
function isSpan(node) {
var nn = node.nodeName;
return nn == "SPAN" || nn == "span";
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/util.js | JavaScript | gpl3 | 3,724 |
var SparqlParser = Editor.Parser = (function() {
function wordRegexp(words) {
return new RegExp("^(?:" + words.join("|") + ")$", "i");
}
var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri",
"isblank", "isliteral", "union", "a"]);
var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe",
"ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional",
"graph", "by", "asc", "desc"]);
var operatorChars = /[*+\-<>=&|]/;
var tokenizeSparql = (function() {
function normal(source, setState) {
var ch = source.next();
if (ch == "$" || ch == "?") {
source.nextWhileMatches(/[\w\d]/);
return "sp-var";
}
else if (ch == "<" && !source.matches(/[\s\u00a0=]/)) {
source.nextWhileMatches(/[^\s\u00a0>]/);
if (source.equals(">")) source.next();
return "sp-uri";
}
else if (ch == "\"" || ch == "'") {
setState(inLiteral(ch));
return null;
}
else if (/[{}\(\),\.;\[\]]/.test(ch)) {
return "sp-punc";
}
else if (ch == "#") {
while (!source.endOfLine()) source.next();
return "sp-comment";
}
else if (operatorChars.test(ch)) {
source.nextWhileMatches(operatorChars);
return "sp-operator";
}
else if (ch == ":") {
source.nextWhileMatches(/[\w\d\._\-]/);
return "sp-prefixed";
}
else {
source.nextWhileMatches(/[_\w\d]/);
if (source.equals(":")) {
source.next();
source.nextWhileMatches(/[\w\d_\-]/);
return "sp-prefixed";
}
var word = source.get(), type;
if (ops.test(word))
type = "sp-operator";
else if (keywords.test(word))
type = "sp-keyword";
else
type = "sp-word";
return {style: type, content: word};
}
}
function inLiteral(quote) {
return function(source, setState) {
var escaped = false;
while (!source.endOfLine()) {
var ch = source.next();
if (ch == quote && !escaped) {
setState(normal);
break;
}
escaped = !escaped && ch == "\\";
}
return "sp-literal";
};
}
return function(source, startState) {
return tokenizer(source, startState || normal);
};
})();
function indentSparql(context) {
return function(nextChars) {
var firstChar = nextChars && nextChars.charAt(0);
if (/[\]\}]/.test(firstChar))
while (context && context.type == "pattern") context = context.prev;
var closing = context && firstChar == matching[context.type];
if (!context)
return 0;
else if (context.type == "pattern")
return context.col;
else if (context.align)
return context.col - (closing ? context.width : 0);
else
return context.indent + (closing ? 0 : indentUnit);
}
}
function parseSparql(source) {
var tokens = tokenizeSparql(source);
var context = null, indent = 0, col = 0;
function pushContext(type, width) {
context = {prev: context, indent: indent, col: col, type: type, width: width};
}
function popContext() {
context = context.prev;
}
var iter = {
next: function() {
var token = tokens.next(), type = token.style, content = token.content, width = token.value.length;
if (content == "\n") {
token.indentation = indentSparql(context);
indent = col = 0;
if (context && context.align == null) context.align = false;
}
else if (type == "whitespace" && col == 0) {
indent = width;
}
else if (type != "sp-comment" && context && context.align == null) {
context.align = true;
}
if (content != "\n") col += width;
if (/[\[\{\(]/.test(content)) {
pushContext(content, width);
}
else if (/[\]\}\)]/.test(content)) {
while (context && context.type == "pattern")
popContext();
if (context && content == matching[context.type])
popContext();
}
else if (content == "." && context && context.type == "pattern") {
popContext();
}
else if ((type == "sp-word" || type == "sp-prefixed" || type == "sp-uri" || type == "sp-var" || type == "sp-literal") &&
context && /[\{\[]/.test(context.type)) {
pushContext("pattern", width);
}
return token;
},
copy: function() {
var _context = context, _indent = indent, _col = col, _tokenState = tokens.state;
return function(source) {
tokens = tokenizeSparql(source, _tokenState);
context = _context;
indent = _indent;
col = _col;
return iter;
};
}
};
return iter;
}
return {make: parseSparql, electricChars: "}]"};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/parsesparql.js | JavaScript | gpl3 | 5,312 |
/* This file defines an XML parser, with a few kludges to make it
* useable for HTML. autoSelfClosers defines a set of tag names that
* are expected to not have a closing tag, and doNotIndent specifies
* the tags inside of which no indentation should happen (see Config
* object). These can be disabled by passing the editor an object like
* {useHTMLKludges: false} as parserConfig option.
*/
var XMLParser = Editor.Parser = (function() {
var Kludges = {
autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true,
"meta": true, "col": true, "frame": true, "base": true, "area": true},
doNotIndent: {"pre": true, "!cdata": true}
};
var NoKludges = {autoSelfClosers: {}, doNotIndent: {"!cdata": true}};
var UseKludges = Kludges;
var alignCDATA = false;
// Simple stateful tokenizer for XML documents. Returns a
// MochiKit-style iterator, with a state property that contains a
// function encapsulating the current state. See tokenize.js.
var tokenizeXML = (function() {
function inText(source, setState) {
var ch = source.next();
if (ch == "<") {
if (source.equals("!")) {
source.next();
if (source.equals("[")) {
if (source.lookAhead("[CDATA[", true)) {
setState(inBlock("xml-cdata", "]]>"));
return null;
}
else {
return "xml-text";
}
}
else if (source.lookAhead("--", true)) {
setState(inBlock("xml-comment", "-->"));
return null;
}
else if (source.lookAhead("DOCTYPE", true)) {
source.nextWhileMatches(/[\w\._\-]/);
setState(inBlock("xml-doctype", ">"));
return "xml-doctype";
}
else {
return "xml-text";
}
}
else if (source.equals("?")) {
source.next();
source.nextWhileMatches(/[\w\._\-]/);
setState(inBlock("xml-processing", "?>"));
return "xml-processing";
}
else {
if (source.equals("/")) source.next();
setState(inTag);
return "xml-punctuation";
}
}
else if (ch == "&") {
while (!source.endOfLine()) {
if (source.next() == ";")
break;
}
return "xml-entity";
}
else {
source.nextWhileMatches(/[^&<\n]/);
return "xml-text";
}
}
function inTag(source, setState) {
var ch = source.next();
if (ch == ">") {
setState(inText);
return "xml-punctuation";
}
else if (/[?\/]/.test(ch) && source.equals(">")) {
source.next();
setState(inText);
return "xml-punctuation";
}
else if (ch == "=") {
return "xml-punctuation";
}
else if (/[\'\"]/.test(ch)) {
setState(inAttribute(ch));
return null;
}
else {
source.nextWhileMatches(/[^\s\u00a0=<>\"\'\/?]/);
return "xml-name";
}
}
function inAttribute(quote) {
return function(source, setState) {
while (!source.endOfLine()) {
if (source.next() == quote) {
setState(inTag);
break;
}
}
return "xml-attribute";
};
}
function inBlock(style, terminator) {
return function(source, setState) {
while (!source.endOfLine()) {
if (source.lookAhead(terminator, true)) {
setState(inText);
break;
}
source.next();
}
return style;
};
}
return function(source, startState) {
return tokenizer(source, startState || inText);
};
})();
// The parser. The structure of this function largely follows that of
// parseJavaScript in parsejavascript.js (there is actually a bit more
// shared code than I'd like), but it is quite a bit simpler.
function parseXML(source) {
var tokens = tokenizeXML(source), token;
var cc = [base];
var tokenNr = 0, indented = 0;
var currentTag = null, context = null;
var consume;
function push(fs) {
for (var i = fs.length - 1; i >= 0; i--)
cc.push(fs[i]);
}
function cont() {
push(arguments);
consume = true;
}
function pass() {
push(arguments);
consume = false;
}
function markErr() {
token.style += " xml-error";
}
function expect(text) {
return function(style, content) {
if (content == text) cont();
else {markErr(); cont(arguments.callee);}
};
}
function pushContext(tagname, startOfLine) {
var noIndent = UseKludges.doNotIndent.hasOwnProperty(tagname) || (context && context.noIndent);
context = {prev: context, name: tagname, indent: indented, startOfLine: startOfLine, noIndent: noIndent};
}
function popContext() {
context = context.prev;
}
function computeIndentation(baseContext) {
return function(nextChars, current) {
var context = baseContext;
if (context && context.noIndent)
return current;
if (alignCDATA && /<!\[CDATA\[/.test(nextChars))
return 0;
if (context && /^<\//.test(nextChars))
context = context.prev;
while (context && !context.startOfLine)
context = context.prev;
if (context)
return context.indent + indentUnit;
else
return 0;
};
}
function base() {
return pass(element, base);
}
var harmlessTokens = {"xml-text": true, "xml-entity": true, "xml-comment": true, "xml-processing": true, "xml-doctype": true};
function element(style, content) {
if (content == "<") cont(tagname, attributes, endtag(tokenNr == 1));
else if (content == "</") cont(closetagname, expect(">"));
else if (style == "xml-cdata") {
if (!context || context.name != "!cdata") pushContext("!cdata");
if (/\]\]>$/.test(content)) popContext();
cont();
}
else if (harmlessTokens.hasOwnProperty(style)) cont();
else {markErr(); cont();}
}
function tagname(style, content) {
if (style == "xml-name") {
currentTag = content.toLowerCase();
token.style = "xml-tagname";
cont();
}
else {
currentTag = null;
pass();
}
}
function closetagname(style, content) {
if (style == "xml-name") {
token.style = "xml-tagname";
if (context && content.toLowerCase() == context.name) popContext();
else markErr();
}
cont();
}
function endtag(startOfLine) {
return function(style, content) {
if (content == "/>" || (content == ">" && UseKludges.autoSelfClosers.hasOwnProperty(currentTag))) cont();
else if (content == ">") {pushContext(currentTag, startOfLine); cont();}
else {markErr(); cont(arguments.callee);}
};
}
function attributes(style) {
if (style == "xml-name") {token.style = "xml-attname"; cont(attribute, attributes);}
else pass();
}
function attribute(style, content) {
if (content == "=") cont(value);
else if (content == ">" || content == "/>") pass(endtag);
else pass();
}
function value(style) {
if (style == "xml-attribute") cont(value);
else pass();
}
return {
indentation: function() {return indented;},
next: function(){
token = tokens.next();
if (token.style == "whitespace" && tokenNr == 0)
indented = token.value.length;
else
tokenNr++;
if (token.content == "\n") {
indented = tokenNr = 0;
token.indentation = computeIndentation(context);
}
if (token.style == "whitespace" || token.type == "xml-comment")
return token;
while(true){
consume = false;
cc.pop()(token.style, token.content);
if (consume) return token;
}
},
copy: function(){
var _cc = cc.concat([]), _tokenState = tokens.state, _context = context;
var parser = this;
return function(input){
cc = _cc.concat([]);
tokenNr = indented = 0;
context = _context;
tokens = tokenizeXML(input, _tokenState);
return parser;
};
}
};
}
return {
make: parseXML,
electricChars: "/",
configure: function(config) {
if (config.useHTMLKludges != null)
UseKludges = config.useHTMLKludges ? Kludges : NoKludges;
if (config.alignCDATA)
alignCDATA = config.alignCDATA;
}
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/parsexml.js | JavaScript | gpl3 | 9,039 |
/* Tokenizer for JavaScript code */
var tokenizeJavaScript = (function() {
// Advance the stream until the given character (not preceded by a
// backslash) is encountered, or the end of the line is reached.
function nextUntilUnescaped(source, end) {
var escaped = false;
while (!source.endOfLine()) {
var next = source.next();
if (next == end && !escaped)
return false;
escaped = !escaped && next == "\\";
}
return escaped;
}
// A map of JavaScript's keywords. The a/b/c keyword distinction is
// very rough, but it gives the parser enough information to parse
// correct code correctly (we don't care that much how we parse
// incorrect code). The style information included in these objects
// is used by the highlighter to pick the correct CSS style for a
// token.
var keywords = function(){
function result(type, style){
return {type: type, style: "js-" + style};
}
// keywords that take a parenthised expression, and then a
// statement (if)
var keywordA = result("keyword a", "keyword");
// keywords that take just a statement (else)
var keywordB = result("keyword b", "keyword");
// keywords that optionally take an expression, and form a
// statement (return)
var keywordC = result("keyword c", "keyword");
var operator = result("operator", "keyword");
var atom = result("atom", "atom");
return {
"if": keywordA, "while": keywordA, "with": keywordA,
"else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB,
"return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "delete": keywordC, "throw": keywordC,
"in": operator, "typeof": operator, "instanceof": operator,
"var": result("var", "keyword"), "function": result("function", "keyword"), "catch": result("catch", "keyword"),
"for": result("for", "keyword"), "switch": result("switch", "keyword"),
"case": result("case", "keyword"), "default": result("default", "keyword"),
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
};
}();
// Some helper regexps
var isOperatorChar = /[+\-*&%=<>!?|]/;
var isHexDigit = /[0-9A-Fa-f]/;
var isWordChar = /[\w\$_]/;
// Wrapper around jsToken that helps maintain parser state (whether
// we are inside of a multi-line comment and whether the next token
// could be a regular expression).
function jsTokenState(inside, regexp) {
return function(source, setState) {
var newInside = inside;
var type = jsToken(inside, regexp, source, function(c) {newInside = c;});
var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/);
if (newRegexp != regexp || newInside != inside)
setState(jsTokenState(newInside, newRegexp));
return type;
};
}
// The token reader, intended to be used by the tokenizer from
// tokenize.js (through jsTokenState). Advances the source stream
// over a token, and returns an object containing the type and style
// of that token.
function jsToken(inside, regexp, source, setInside) {
function readHexNumber(){
source.next(); // skip the 'x'
source.nextWhileMatches(isHexDigit);
return {type: "number", style: "js-atom"};
}
function readNumber() {
source.nextWhileMatches(/[0-9]/);
if (source.equals(".")){
source.next();
source.nextWhileMatches(/[0-9]/);
}
if (source.equals("e") || source.equals("E")){
source.next();
if (source.equals("-"))
source.next();
source.nextWhileMatches(/[0-9]/);
}
return {type: "number", style: "js-atom"};
}
// Read a word, look it up in keywords. If not found, it is a
// variable, otherwise it is a keyword of the type found.
function readWord() {
source.nextWhileMatches(isWordChar);
var word = source.get();
var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
return known ? {type: known.type, style: known.style, content: word} :
{type: "variable", style: "js-variable", content: word};
}
function readRegexp() {
nextUntilUnescaped(source, "/");
source.nextWhileMatches(/[gimy]/); // 'y' is "sticky" option in Mozilla
return {type: "regexp", style: "js-string"};
}
// Mutli-line comments are tricky. We want to return the newlines
// embedded in them as regular newline tokens, and then continue
// returning a comment token for every line of the comment. So
// some state has to be saved (inside) to indicate whether we are
// inside a /* */ sequence.
function readMultilineComment(start){
var newInside = "/*";
var maybeEnd = (start == "*");
while (true) {
if (source.endOfLine())
break;
var next = source.next();
if (next == "/" && maybeEnd){
newInside = null;
break;
}
maybeEnd = (next == "*");
}
setInside(newInside);
return {type: "comment", style: "js-comment"};
}
function readOperator() {
source.nextWhileMatches(isOperatorChar);
return {type: "operator", style: "js-operator"};
}
function readString(quote) {
var endBackSlash = nextUntilUnescaped(source, quote);
setInside(endBackSlash ? quote : null);
return {type: "string", style: "js-string"};
}
// Fetch the next token. Dispatches on first character in the
// stream, or first two characters when the first is a slash.
if (inside == "\"" || inside == "'")
return readString(inside);
var ch = source.next();
if (inside == "/*")
return readMultilineComment(ch);
else if (ch == "\"" || ch == "'")
return readString(ch);
// with punctuation, the type of the token is the symbol itself
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
return {type: ch, style: "js-punctuation"};
else if (ch == "0" && (source.equals("x") || source.equals("X")))
return readHexNumber();
else if (/[0-9]/.test(ch))
return readNumber();
else if (ch == "/"){
if (source.equals("*"))
{ source.next(); return readMultilineComment(ch); }
else if (source.equals("/"))
{ nextUntilUnescaped(source, null); return {type: "comment", style: "js-comment"};}
else if (regexp)
return readRegexp();
else
return readOperator();
}
else if (isOperatorChar.test(ch))
return readOperator();
else
return readWord();
}
// The external interface to the tokenizer.
return function(source, startState) {
return tokenizer(source, startState || jsTokenState(false, true));
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/tokenizejavascript.js | JavaScript | gpl3 | 6,985 |
// A framework for simple tokenizers. Takes care of newlines and
// white-space, and of getting the text from the source stream into
// the token object. A state is a function of two arguments -- a
// string stream and a setState function. The second can be used to
// change the tokenizer's state, and can be ignored for stateless
// tokenizers. This function should advance the stream over a token
// and return a string or object containing information about the next
// token, or null to pass and have the (new) state be called to finish
// the token. When a string is given, it is wrapped in a {style, type}
// object. In the resulting object, the characters consumed are stored
// under the content property. Any whitespace following them is also
// automatically consumed, and added to the value property. (Thus,
// content is the actual meaningful part of the token, while value
// contains all the text it spans.)
function tokenizer(source, state) {
// Newlines are always a separate token.
function isWhiteSpace(ch) {
// The messy regexp is because IE's regexp matcher is of the
// opinion that non-breaking spaces are no whitespace.
return ch != "\n" && /^[\s\u00a0]*$/.test(ch);
}
var tokenizer = {
state: state,
take: function(type) {
if (typeof(type) == "string")
type = {style: type, type: type};
type.content = (type.content || "") + source.get();
if (!/\n$/.test(type.content))
source.nextWhile(isWhiteSpace);
type.value = type.content + source.get();
return type;
},
next: function () {
if (!source.more()) throw StopIteration;
var type;
if (source.equals("\n")) {
source.next();
return this.take("whitespace");
}
if (source.applies(isWhiteSpace))
type = "whitespace";
else
while (!type)
type = this.state(source, function(s) {tokenizer.state = s;});
return this.take(type);
}
};
return tokenizer;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/tokenize.js | JavaScript | gpl3 | 2,060 |
/* CodeMirror main module (http://codemirror.net/)
*
* Implements the CodeMirror constructor and prototype, which take care
* of initializing the editor frame, and providing the outside interface.
*/
// The CodeMirrorConfig object is used to specify a default
// configuration. If you specify such an object before loading this
// file, the values you put into it will override the defaults given
// below. You can also assign to it after loading.
var CodeMirrorConfig = window.CodeMirrorConfig || {};
var CodeMirror = (function(){
function setDefaults(object, defaults) {
for (var option in defaults) {
if (!object.hasOwnProperty(option))
object[option] = defaults[option];
}
}
function forEach(array, action) {
for (var i = 0; i < array.length; i++)
action(array[i]);
}
function createHTMLElement(el) {
if (document.createElementNS && document.documentElement.namespaceURI !== null)
return document.createElementNS("http://www.w3.org/1999/xhtml", el)
else
return document.createElement(el)
}
// These default options can be overridden by passing a set of
// options to a specific CodeMirror constructor. See manual.html for
// their meaning.
setDefaults(CodeMirrorConfig, {
stylesheet: [],
path: "",
parserfile: [],
basefiles: ["util.js", "stringstream.js", "select.js", "undo.js", "editor.js", "tokenize.js"],
iframeClass: null,
passDelay: 200,
passTime: 50,
lineNumberDelay: 200,
lineNumberTime: 50,
continuousScanning: false,
saveFunction: null,
onLoad: null,
onChange: null,
undoDepth: 50,
undoDelay: 800,
disableSpellcheck: true,
textWrapping: true,
readOnly: false,
width: "",
height: "300px",
minHeight: 100,
autoMatchParens: false,
markParen: null,
unmarkParen: null,
parserConfig: null,
tabMode: "indent", // or "spaces", "default", "shift"
enterMode: "indent", // or "keep", "flat"
electricChars: true,
reindentOnLoad: false,
activeTokens: null,
onCursorActivity: null,
lineNumbers: false,
firstLineNumber: 1,
onLineNumberClick: null,
indentUnit: 2,
domain: null,
noScriptCaching: false,
incrementalLoading: false
});
function addLineNumberDiv(container, firstNum) {
var nums = createHTMLElement("div"),
scroller = createHTMLElement("div");
nums.style.position = "absolute";
nums.style.height = "100%";
if (nums.style.setExpression) {
try {nums.style.setExpression("height", "this.previousSibling.offsetHeight + 'px'");}
catch(e) {} // Seems to throw 'Not Implemented' on some IE8 versions
}
nums.style.top = "0px";
nums.style.left = "0px";
nums.style.overflow = "hidden";
container.appendChild(nums);
scroller.className = "CodeMirror-line-numbers";
nums.appendChild(scroller);
scroller.innerHTML = "<div>" + firstNum + "</div>";
return nums;
}
function frameHTML(options) {
if (typeof options.parserfile == "string")
options.parserfile = [options.parserfile];
if (typeof options.basefiles == "string")
options.basefiles = [options.basefiles];
if (typeof options.stylesheet == "string")
options.stylesheet = [options.stylesheet];
var html = ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head>"];
// Hack to work around a bunch of IE8-specific problems.
html.push("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/>");
var queryStr = options.noScriptCaching ? "?nocache=" + new Date().getTime().toString(16) : "";
forEach(options.stylesheet, function(file) {
html.push("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + file + queryStr + "\"/>");
});
forEach(options.basefiles.concat(options.parserfile), function(file) {
if (!/^https?:/.test(file)) file = options.path + file;
html.push("<script type=\"text/javascript\" src=\"" + file + queryStr + "\"><" + "/script>");
});
html.push("</head><body style=\"border-width: 0;\" class=\"editbox\" spellcheck=\"" +
(options.disableSpellcheck ? "false" : "true") + "\"></body></html>");
return html.join("");
}
var internetExplorer = document.selection && window.ActiveXObject && /MSIE/.test(navigator.userAgent);
function CodeMirror(place, options) {
// Use passed options, if any, to override defaults.
this.options = options = options || {};
setDefaults(options, CodeMirrorConfig);
// Backward compatibility for deprecated options.
if (options.dumbTabs) options.tabMode = "spaces";
else if (options.normalTab) options.tabMode = "default";
if (options.cursorActivity) options.onCursorActivity = options.cursorActivity;
var frame = this.frame = createHTMLElement("iframe");
if (options.iframeClass) frame.className = options.iframeClass;
frame.frameBorder = 0;
frame.style.border = "0";
frame.style.width = '100%';
frame.style.height = '100%';
// display: block occasionally suppresses some Firefox bugs, so we
// always add it, redundant as it sounds.
frame.style.display = "block";
var div = this.wrapping = createHTMLElement("div");
div.style.position = "relative";
div.className = "CodeMirror-wrapping";
div.style.width = options.width;
div.style.height = (options.height == "dynamic") ? options.minHeight + "px" : options.height;
// This is used by Editor.reroutePasteEvent
var teHack = this.textareaHack = createHTMLElement("textarea");
div.appendChild(teHack);
teHack.style.position = "absolute";
teHack.style.left = "-10000px";
teHack.style.width = "10px";
teHack.tabIndex = 100000;
// Link back to this object, so that the editor can fetch options
// and add a reference to itself.
frame.CodeMirror = this;
if (options.domain && internetExplorer) {
this.html = frameHTML(options);
frame.src = "javascript:(function(){document.open();" +
(options.domain ? "document.domain=\"" + options.domain + "\";" : "") +
"document.write(window.frameElement.CodeMirror.html);document.close();})()";
}
else {
frame.src = "javascript:;";
}
if (place.appendChild) place.appendChild(div);
else place(div);
div.appendChild(frame);
if (options.lineNumbers) this.lineNumbers = addLineNumberDiv(div, options.firstLineNumber);
this.win = frame.contentWindow;
if (!options.domain || !internetExplorer) {
this.win.document.open();
this.win.document.write(frameHTML(options));
this.win.document.close();
}
}
CodeMirror.prototype = {
init: function() {
// Deprecated, but still supported.
if (this.options.initCallback) this.options.initCallback(this);
if (this.options.onLoad) this.options.onLoad(this);
if (this.options.lineNumbers) this.activateLineNumbers();
if (this.options.reindentOnLoad) this.reindent();
if (this.options.height == "dynamic") this.setDynamicHeight();
},
getCode: function() {return this.editor.getCode();},
setCode: function(code) {this.editor.importCode(code);},
selection: function() {this.focusIfIE(); return this.editor.selectedText();},
reindent: function() {this.editor.reindent();},
reindentSelection: function() {this.focusIfIE(); this.editor.reindentSelection(null);},
focusIfIE: function() {
// in IE, a lot of selection-related functionality only works when the frame is focused
if (this.win.select.ie_selection && document.activeElement != this.frame)
this.focus();
},
focus: function() {
this.win.focus();
if (this.editor.selectionSnapshot) // IE hack
this.win.select.setBookmark(this.win.document.body, this.editor.selectionSnapshot);
},
replaceSelection: function(text) {
this.focus();
this.editor.replaceSelection(text);
return true;
},
replaceChars: function(text, start, end) {
this.editor.replaceChars(text, start, end);
},
getSearchCursor: function(string, fromCursor, caseFold) {
return this.editor.getSearchCursor(string, fromCursor, caseFold);
},
undo: function() {this.editor.history.undo();},
redo: function() {this.editor.history.redo();},
historySize: function() {return this.editor.history.historySize();},
clearHistory: function() {this.editor.history.clear();},
grabKeys: function(callback, filter) {this.editor.grabKeys(callback, filter);},
ungrabKeys: function() {this.editor.ungrabKeys();},
setParser: function(name, parserConfig) {this.editor.setParser(name, parserConfig);},
setSpellcheck: function(on) {this.win.document.body.spellcheck = on;},
setStylesheet: function(names) {
if (typeof names === "string") names = [names];
var activeStylesheets = {};
var matchedNames = {};
var links = this.win.document.getElementsByTagName("link");
// Create hashes of active stylesheets and matched names.
// This is O(n^2) but n is expected to be very small.
for (var x = 0, link; link = links[x]; x++) {
if (link.rel.indexOf("stylesheet") !== -1) {
for (var y = 0; y < names.length; y++) {
var name = names[y];
if (link.href.substring(link.href.length - name.length) === name) {
activeStylesheets[link.href] = true;
matchedNames[name] = true;
}
}
}
}
// Activate the selected stylesheets and disable the rest.
for (var x = 0, link; link = links[x]; x++) {
if (link.rel.indexOf("stylesheet") !== -1) {
link.disabled = !(link.href in activeStylesheets);
}
}
// Create any new stylesheets.
for (var y = 0; y < names.length; y++) {
var name = names[y];
if (!(name in matchedNames)) {
var link = this.win.document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = name;
this.win.document.getElementsByTagName('head')[0].appendChild(link);
}
}
},
setTextWrapping: function(on) {
if (on == this.options.textWrapping) return;
this.win.document.body.style.whiteSpace = on ? "" : "nowrap";
this.options.textWrapping = on;
if (this.lineNumbers) {
this.setLineNumbers(false);
this.setLineNumbers(true);
}
},
setIndentUnit: function(unit) {this.win.indentUnit = unit;},
setUndoDepth: function(depth) {this.editor.history.maxDepth = depth;},
setTabMode: function(mode) {this.options.tabMode = mode;},
setEnterMode: function(mode) {this.options.enterMode = mode;},
setLineNumbers: function(on) {
if (on && !this.lineNumbers) {
this.lineNumbers = addLineNumberDiv(this.wrapping,this.options.firstLineNumber);
this.activateLineNumbers();
}
else if (!on && this.lineNumbers) {
this.wrapping.removeChild(this.lineNumbers);
this.wrapping.style.paddingLeft = "";
this.lineNumbers = null;
}
},
cursorPosition: function(start) {this.focusIfIE(); return this.editor.cursorPosition(start);},
firstLine: function() {return this.editor.firstLine();},
lastLine: function() {return this.editor.lastLine();},
nextLine: function(line) {return this.editor.nextLine(line);},
prevLine: function(line) {return this.editor.prevLine(line);},
lineContent: function(line) {return this.editor.lineContent(line);},
setLineContent: function(line, content) {this.editor.setLineContent(line, content);},
removeLine: function(line){this.editor.removeLine(line);},
insertIntoLine: function(line, position, content) {this.editor.insertIntoLine(line, position, content);},
selectLines: function(startLine, startOffset, endLine, endOffset) {
this.win.focus();
this.editor.selectLines(startLine, startOffset, endLine, endOffset);
},
nthLine: function(n) {
var line = this.firstLine();
for (; n > 1 && line !== false; n--)
line = this.nextLine(line);
return line;
},
lineNumber: function(line) {
var num = 0;
while (line !== false) {
num++;
line = this.prevLine(line);
}
return num;
},
jumpToLine: function(line) {
if (typeof line == "number") line = this.nthLine(line);
this.selectLines(line, 0);
this.win.focus();
},
currentLine: function() { // Deprecated, but still there for backward compatibility
return this.lineNumber(this.cursorLine());
},
cursorLine: function() {
return this.cursorPosition().line;
},
cursorCoords: function(start) {return this.editor.cursorCoords(start);},
activateLineNumbers: function() {
var frame = this.frame, win = frame.contentWindow, doc = win.document, body = doc.body,
nums = this.lineNumbers, scroller = nums.firstChild, self = this;
var barWidth = null;
nums.onclick = function(e) {
var handler = self.options.onLineNumberClick;
if (handler) {
var div = (e || window.event).target || (e || window.event).srcElement;
var num = div == nums ? NaN : Number(div.innerHTML);
if (!isNaN(num)) handler(num, div);
}
};
function sizeBar() {
if (frame.offsetWidth == 0) return;
for (var root = frame; root.parentNode; root = root.parentNode){}
if (!nums.parentNode || root != document || !win.Editor) {
// Clear event handlers (their nodes might already be collected, so try/catch)
try{clear();}catch(e){}
clearInterval(sizeInterval);
return;
}
if (nums.offsetWidth != barWidth) {
barWidth = nums.offsetWidth;
frame.parentNode.style.paddingLeft = barWidth + "px";
}
}
function doScroll() {
nums.scrollTop = body.scrollTop || doc.documentElement.scrollTop || 0;
}
// Cleanup function, registered by nonWrapping and wrapping.
var clear = function(){};
sizeBar();
var sizeInterval = setInterval(sizeBar, 500);
function ensureEnoughLineNumbers(fill) {
var lineHeight = scroller.firstChild.offsetHeight;
if (lineHeight == 0) return;
var targetHeight = 50 + Math.max(body.offsetHeight, Math.max(frame.offsetHeight, body.scrollHeight || 0)),
lastNumber = Math.ceil(targetHeight / lineHeight);
for (var i = scroller.childNodes.length; i <= lastNumber; i++) {
var div = createHTMLElement("div");
div.appendChild(document.createTextNode(fill ? String(i + self.options.firstLineNumber) : "\u00a0"));
scroller.appendChild(div);
}
}
function nonWrapping() {
function update() {
ensureEnoughLineNumbers(true);
doScroll();
}
self.updateNumbers = update;
var onScroll = win.addEventHandler(win, "scroll", doScroll, true),
onResize = win.addEventHandler(win, "resize", update, true);
clear = function(){
onScroll(); onResize();
if (self.updateNumbers == update) self.updateNumbers = null;
};
update();
}
function wrapping() {
var node, lineNum, next, pos, changes = [], styleNums = self.options.styleNumbers;
function setNum(n, node) {
// Does not typically happen (but can, if you mess with the
// document during the numbering)
if (!lineNum) lineNum = scroller.appendChild(createHTMLElement("div"));
if (styleNums) styleNums(lineNum, node, n);
// Changes are accumulated, so that the document layout
// doesn't have to be recomputed during the pass
changes.push(lineNum); changes.push(n);
pos = lineNum.offsetHeight + lineNum.offsetTop;
lineNum = lineNum.nextSibling;
}
function commitChanges() {
for (var i = 0; i < changes.length; i += 2)
changes[i].innerHTML = changes[i + 1];
changes = [];
}
function work() {
if (!scroller.parentNode || scroller.parentNode != self.lineNumbers) return;
var endTime = new Date().getTime() + self.options.lineNumberTime;
while (node) {
setNum(next++, node.previousSibling);
for (; node && !win.isBR(node); node = node.nextSibling) {
var bott = node.offsetTop + node.offsetHeight;
while (scroller.offsetHeight && bott - 3 > pos) {
var oldPos = pos;
setNum(" ");
if (pos <= oldPos) break;
}
}
if (node) node = node.nextSibling;
if (new Date().getTime() > endTime) {
commitChanges();
pending = setTimeout(work, self.options.lineNumberDelay);
return;
}
}
while (lineNum) setNum(next++);
commitChanges();
doScroll();
}
function start(firstTime) {
doScroll();
ensureEnoughLineNumbers(firstTime);
node = body.firstChild;
lineNum = scroller.firstChild;
pos = 0;
next = self.options.firstLineNumber;
work();
}
start(true);
var pending = null;
function update() {
if (pending) clearTimeout(pending);
if (self.editor.allClean()) start();
else pending = setTimeout(update, 200);
}
self.updateNumbers = update;
var onScroll = win.addEventHandler(win, "scroll", doScroll, true),
onResize = win.addEventHandler(win, "resize", update, true);
clear = function(){
if (pending) clearTimeout(pending);
if (self.updateNumbers == update) self.updateNumbers = null;
onScroll();
onResize();
};
}
(this.options.textWrapping || this.options.styleNumbers ? wrapping : nonWrapping)();
},
setDynamicHeight: function() {
var self = this, activity = self.options.onCursorActivity, win = self.win, body = win.document.body,
lineHeight = null, timeout = null, vmargin = 2 * self.frame.offsetTop;
body.style.overflowY = "hidden";
win.document.documentElement.style.overflowY = "hidden";
this.frame.scrolling = "no";
function updateHeight() {
var trailingLines = 0, node = body.lastChild, computedHeight;
while (node && win.isBR(node)) {
if (!node.hackBR) trailingLines++;
node = node.previousSibling;
}
if (node) {
lineHeight = node.offsetHeight;
computedHeight = node.offsetTop + (1 + trailingLines) * lineHeight;
}
else if (lineHeight) {
computedHeight = trailingLines * lineHeight;
}
if (computedHeight)
self.wrapping.style.height = Math.max(vmargin + computedHeight, self.options.minHeight) + "px";
}
setTimeout(updateHeight, 300);
self.options.onCursorActivity = function(x) {
if (activity) activity(x);
clearTimeout(timeout);
timeout = setTimeout(updateHeight, 100);
};
}
};
CodeMirror.InvalidLineHandle = {toString: function(){return "CodeMirror.InvalidLineHandle";}};
CodeMirror.replace = function(element) {
if (typeof element == "string")
element = document.getElementById(element);
return function(newElement) {
element.parentNode.replaceChild(newElement, element);
};
};
CodeMirror.fromTextArea = function(area, options) {
if (typeof area == "string")
area = document.getElementById(area);
options = options || {};
if (area.style.width && options.width == null)
options.width = area.style.width;
if (area.style.height && options.height == null)
options.height = area.style.height;
if (options.content == null) options.content = area.value;
function updateField() {
area.value = mirror.getCode();
}
if (area.form) {
if (typeof area.form.addEventListener == "function")
area.form.addEventListener("submit", updateField, false);
else
area.form.attachEvent("onsubmit", updateField);
var realSubmit = area.form.submit;
function wrapSubmit() {
updateField();
// Can't use realSubmit.apply because IE6 is too stupid
area.form.submit = realSubmit;
area.form.submit();
area.form.submit = wrapSubmit;
}
area.form.submit = wrapSubmit;
}
function insert(frame) {
if (area.nextSibling)
area.parentNode.insertBefore(frame, area.nextSibling);
else
area.parentNode.appendChild(frame);
}
area.style.display = "none";
var mirror = new CodeMirror(insert, options);
mirror.save = updateField;
mirror.toTextArea = function() {
updateField();
area.parentNode.removeChild(mirror.wrapping);
area.style.display = "";
if (area.form) {
area.form.submit = realSubmit;
if (typeof area.form.removeEventListener == "function")
area.form.removeEventListener("submit", updateField, false);
else
area.form.detachEvent("onsubmit", updateField);
}
};
return mirror;
};
CodeMirror.isProbablySupported = function() {
// This is rather awful, but can be useful.
var match;
if (window.opera)
return Number(window.opera.version()) >= 9.52;
else if (/Apple Computer, Inc/.test(navigator.vendor) && (match = navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./)))
return Number(match[1]) >= 3;
else if (document.selection && window.ActiveXObject && (match = navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/)))
return Number(match[1]) >= 6;
else if (match = navigator.userAgent.match(/gecko\/(\d{8})/i))
return Number(match[1]) >= 20050901;
else if (match = navigator.userAgent.match(/AppleWebKit\/(\d+)/))
return Number(match[1]) >= 525;
else
return null;
};
return CodeMirror;
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/codemirror.js | JavaScript | gpl3 | 22,836 |
// Minimal framing needed to use CodeMirror-style parsers to highlight
// code. Load this along with tokenize.js, stringstream.js, and your
// parser. Then call highlightText, passing a string as the first
// argument, and as the second argument either a callback function
// that will be called with an array of SPAN nodes for every line in
// the code, or a DOM node to which to append these spans, and
// optionally (not needed if you only loaded one parser) a parser
// object.
// Stuff from util.js that the parsers are using.
var StopIteration = {toString: function() {return "StopIteration"}};
var Editor = {};
var indentUnit = 2;
(function(){
function normaliseString(string) {
var tab = "";
for (var i = 0; i < indentUnit; i++) tab += " ";
string = string.replace(/\t/g, tab).replace(/\u00a0/g, " ").replace(/\r\n?/g, "\n");
var pos = 0, parts = [], lines = string.split("\n");
for (var line = 0; line < lines.length; line++) {
if (line != 0) parts.push("\n");
parts.push(lines[line]);
}
return {
next: function() {
if (pos < parts.length) return parts[pos++];
else throw StopIteration;
}
};
}
window.highlightText = function(string, callback, parser) {
parser = (parser || Editor.Parser).make(stringStream(normaliseString(string)));
var line = [];
if (callback.nodeType == 1) {
var node = callback;
callback = function(line) {
for (var i = 0; i < line.length; i++)
node.appendChild(line[i]);
node.appendChild(document.createElement("br"));
};
}
try {
while (true) {
var token = parser.next();
if (token.value == "\n") {
callback(line);
line = [];
}
else {
var span = document.createElement("span");
span.className = token.style;
span.appendChild(document.createTextNode(token.value));
line.push(span);
}
}
}
catch (e) {
if (e != StopIteration) throw e;
}
if (line.length) callback(line);
}
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/highlight.js | JavaScript | gpl3 | 2,162 |
/* The Editor object manages the content of the editable frame. It
* catches events, colours nodes, and indents lines. This file also
* holds some functions for transforming arbitrary DOM structures into
* plain sequences of <span> and <br> elements
*/
var internetExplorer = document.selection && window.ActiveXObject && /MSIE/.test(navigator.userAgent);
var webkit = /AppleWebKit/.test(navigator.userAgent);
var safari = /Apple Computer, Inc/.test(navigator.vendor);
var gecko = navigator.userAgent.match(/gecko\/(\d{8})/i);
if (gecko) gecko = Number(gecko[1]);
var mac = /Mac/.test(navigator.platform);
// TODO this is related to the backspace-at-end-of-line bug. Remove
// this if Opera gets their act together, make the version check more
// broad if they don't.
var brokenOpera = window.opera && /Version\/10.[56]/.test(navigator.userAgent);
// TODO remove this once WebKit 533 becomes less common.
var slowWebkit = /AppleWebKit\/533/.test(navigator.userAgent);
// Make sure a string does not contain two consecutive 'collapseable'
// whitespace characters.
function makeWhiteSpace(n) {
var buffer = [], nb = true;
for (; n > 0; n--) {
buffer.push((nb || n == 1) ? nbsp : " ");
nb ^= true;
}
return buffer.join("");
}
// Create a set of white-space characters that will not be collapsed
// by the browser, but will not break text-wrapping either.
function fixSpaces(string) {
if (string.charAt(0) == " ") string = nbsp + string.slice(1);
return string.replace(/\t/g, function() {return makeWhiteSpace(indentUnit);})
.replace(/[ \u00a0]{2,}/g, function(s) {return makeWhiteSpace(s.length);});
}
function cleanText(text) {
return text.replace(/\u00a0/g, " ").replace(/\u200b/g, "");
}
// Create a SPAN node with the expected properties for document part
// spans.
function makePartSpan(value) {
var text = value;
if (value.nodeType == 3) text = value.nodeValue;
else value = document.createTextNode(text);
var span = document.createElement("span");
span.isPart = true;
span.appendChild(value);
span.currentText = text;
return span;
}
function alwaysZero() {return 0;}
// On webkit, when the last BR of the document does not have text
// behind it, the cursor can not be put on the line after it. This
// makes pressing enter at the end of the document occasionally do
// nothing (or at least seem to do nothing). To work around it, this
// function makes sure the document ends with a span containing a
// zero-width space character. The traverseDOM iterator filters such
// character out again, so that the parsers won't see them. This
// function is called from a few strategic places to make sure the
// zwsp is restored after the highlighting process eats it.
var webkitLastLineHack = webkit ?
function(container) {
var last = container.lastChild;
if (!last || !last.hackBR) {
var br = document.createElement("br");
br.hackBR = true;
container.appendChild(br);
}
} : function() {};
function asEditorLines(string) {
var tab = makeWhiteSpace(indentUnit);
return map(string.replace(/\t/g, tab).replace(/\u00a0/g, " ").replace(/\r\n?/g, "\n").split("\n"), fixSpaces);
}
var Editor = (function(){
// The HTML elements whose content should be suffixed by a newline
// when converting them to flat text.
var newlineElements = {"P": true, "DIV": true, "LI": true};
// Helper function for traverseDOM. Flattens an arbitrary DOM node
// into an array of textnodes and <br> tags.
function simplifyDOM(root, atEnd) {
var result = [];
var leaving = true;
function simplifyNode(node, top) {
if (node.nodeType == 3) {
var text = node.nodeValue = fixSpaces(node.nodeValue.replace(/[\r\u200b]/g, "").replace(/\n/g, " "));
if (text.length) leaving = false;
result.push(node);
}
else if (isBR(node) && node.childNodes.length == 0) {
leaving = true;
result.push(node);
}
else {
for (var n = node.firstChild; n; n = n.nextSibling) simplifyNode(n);
if (!leaving && newlineElements.hasOwnProperty(node.nodeName.toUpperCase())) {
leaving = true;
if (!atEnd || !top)
result.push(document.createElement("br"));
}
}
}
simplifyNode(root, true);
return result;
}
// Creates a MochiKit-style iterator that goes over a series of DOM
// nodes. The values it yields are strings, the textual content of
// the nodes. It makes sure that all nodes up to and including the
// one whose text is being yielded have been 'normalized' to be just
// <span> and <br> elements.
function traverseDOM(start){
var nodeQueue = [];
// Create a function that can be used to insert nodes after the
// one given as argument.
function pointAt(node){
var parent = node.parentNode;
var next = node.nextSibling;
return function(newnode) {
parent.insertBefore(newnode, next);
};
}
var point = null;
// This an Opera-specific hack -- always insert an empty span
// between two BRs, because Opera's cursor code gets terribly
// confused when the cursor is between two BRs.
var afterBR = true;
// Insert a normalized node at the current point. If it is a text
// node, wrap it in a <span>, and give that span a currentText
// property -- this is used to cache the nodeValue, because
// directly accessing nodeValue is horribly slow on some browsers.
// The dirty property is used by the highlighter to determine
// which parts of the document have to be re-highlighted.
function insertPart(part){
var text = "\n";
if (part.nodeType == 3) {
select.snapshotChanged();
part = makePartSpan(part);
text = part.currentText;
afterBR = false;
}
else {
if (afterBR && window.opera)
point(makePartSpan(""));
afterBR = true;
}
part.dirty = true;
nodeQueue.push(part);
point(part);
return text;
}
// Extract the text and newlines from a DOM node, insert them into
// the document, and return the textual content. Used to replace
// non-normalized nodes.
function writeNode(node, end) {
var simplified = simplifyDOM(node, end);
for (var i = 0; i < simplified.length; i++)
simplified[i] = insertPart(simplified[i]);
return simplified.join("");
}
// Check whether a node is a normalized <span> element.
function partNode(node){
if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
var text = node.firstChild.nodeValue;
node.dirty = node.dirty || text != node.currentText;
node.currentText = text;
return !/[\n\t\r]/.test(node.currentText);
}
return false;
}
// Advance to next node, return string for current node.
function next() {
if (!start) throw StopIteration;
var node = start;
start = node.nextSibling;
if (partNode(node)){
nodeQueue.push(node);
afterBR = false;
return node.currentText;
}
else if (isBR(node)) {
if (afterBR && window.opera)
node.parentNode.insertBefore(makePartSpan(""), node);
nodeQueue.push(node);
afterBR = true;
return "\n";
}
else {
var end = !node.nextSibling;
point = pointAt(node);
removeElement(node);
return writeNode(node, end);
}
}
// MochiKit iterators are objects with a next function that
// returns the next value or throws StopIteration when there are
// no more values.
return {next: next, nodes: nodeQueue};
}
// Determine the text size of a processed node.
function nodeSize(node) {
return isBR(node) ? 1 : node.currentText.length;
}
// Search backwards through the top-level nodes until the next BR or
// the start of the frame.
function startOfLine(node) {
while (node && !isBR(node)) node = node.previousSibling;
return node;
}
function endOfLine(node, container) {
if (!node) node = container.firstChild;
else if (isBR(node)) node = node.nextSibling;
while (node && !isBR(node)) node = node.nextSibling;
return node;
}
function time() {return new Date().getTime();}
// Client interface for searching the content of the editor. Create
// these by calling CodeMirror.getSearchCursor. To use, call
// findNext on the resulting object -- this returns a boolean
// indicating whether anything was found, and can be called again to
// skip to the next find. Use the select and replace methods to
// actually do something with the found locations.
function SearchCursor(editor, pattern, from, caseFold) {
this.editor = editor;
this.history = editor.history;
this.history.commit();
this.valid = !!pattern;
this.atOccurrence = false;
if (caseFold == undefined) caseFold = typeof pattern == "string" && pattern == pattern.toLowerCase();
function getText(node){
var line = cleanText(editor.history.textAfter(node));
return (caseFold ? line.toLowerCase() : line);
}
var topPos = {node: null, offset: 0}, self = this;
if (from && typeof from == "object" && typeof from.character == "number") {
editor.checkLine(from.line);
var pos = {node: from.line, offset: from.character};
this.pos = {from: pos, to: pos};
}
else if (from) {
this.pos = {from: select.cursorPos(editor.container, true) || topPos,
to: select.cursorPos(editor.container, false) || topPos};
}
else {
this.pos = {from: topPos, to: topPos};
}
if (typeof pattern != "string") { // Regexp match
this.matches = function(reverse, node, offset) {
if (reverse) {
var line = getText(node).slice(0, offset), match = line.match(pattern), start = 0;
while (match) {
var ind = line.indexOf(match[0]);
start += ind;
line = line.slice(ind + 1);
var newmatch = line.match(pattern);
if (newmatch) match = newmatch;
else break;
}
}
else {
var line = getText(node).slice(offset), match = line.match(pattern),
start = match && offset + line.indexOf(match[0]);
}
if (match) {
self.currentMatch = match;
return {from: {node: node, offset: start},
to: {node: node, offset: start + match[0].length}};
}
};
return;
}
if (caseFold) pattern = pattern.toLowerCase();
// Create a matcher function based on the kind of string we have.
var target = pattern.split("\n");
this.matches = (target.length == 1) ?
// For one-line strings, searching can be done simply by calling
// indexOf or lastIndexOf on the current line.
function(reverse, node, offset) {
var line = getText(node), len = pattern.length, match;
if (reverse ? (offset >= len && (match = line.lastIndexOf(pattern, offset - len)) != -1)
: (match = line.indexOf(pattern, offset)) != -1)
return {from: {node: node, offset: match},
to: {node: node, offset: match + len}};
} :
// Multi-line strings require internal iteration over lines, and
// some clunky checks to make sure the first match ends at the
// end of the line and the last match starts at the start.
function(reverse, node, offset) {
var idx = (reverse ? target.length - 1 : 0), match = target[idx], line = getText(node);
var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
if (reverse ? offsetA >= offset || offsetA != match.length
: offsetA <= offset || offsetA != line.length - match.length)
return;
var pos = node;
while (true) {
if (reverse && !pos) return;
pos = (reverse ? this.history.nodeBefore(pos) : this.history.nodeAfter(pos) );
if (!reverse && !pos) return;
line = getText(pos);
match = target[reverse ? --idx : ++idx];
if (idx > 0 && idx < target.length - 1) {
if (line != match) return;
else continue;
}
var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
return;
return {from: {node: reverse ? pos : node, offset: reverse ? offsetB : offsetA},
to: {node: reverse ? node : pos, offset: reverse ? offsetA : offsetB}};
}
};
}
SearchCursor.prototype = {
findNext: function() {return this.find(false);},
findPrevious: function() {return this.find(true);},
find: function(reverse) {
if (!this.valid) return false;
var self = this, pos = reverse ? this.pos.from : this.pos.to,
node = pos.node, offset = pos.offset;
// Reset the cursor if the current line is no longer in the DOM tree.
if (node && !node.parentNode) {
node = null; offset = 0;
}
function savePosAndFail() {
var pos = {node: node, offset: offset};
self.pos = {from: pos, to: pos};
self.atOccurrence = false;
return false;
}
while (true) {
if (this.pos = this.matches(reverse, node, offset)) {
this.atOccurrence = true;
return true;
}
if (reverse) {
if (!node) return savePosAndFail();
node = this.history.nodeBefore(node);
offset = this.history.textAfter(node).length;
}
else {
var next = this.history.nodeAfter(node);
if (!next) {
offset = this.history.textAfter(node).length;
return savePosAndFail();
}
node = next;
offset = 0;
}
}
},
select: function() {
if (this.atOccurrence) {
select.setCursorPos(this.editor.container, this.pos.from, this.pos.to);
select.scrollToCursor(this.editor.container);
}
},
replace: function(string) {
if (this.atOccurrence) {
var fragments = this.currentMatch;
if (fragments)
string = string.replace(/\\(\d)/, function(m, i){return fragments[i];});
var end = this.editor.replaceRange(this.pos.from, this.pos.to, string);
this.pos.to = end;
this.atOccurrence = false;
}
},
position: function() {
if (this.atOccurrence)
return {line: this.pos.from.node, character: this.pos.from.offset};
}
};
// The Editor object is the main inside-the-iframe interface.
function Editor(options) {
this.options = options;
window.indentUnit = options.indentUnit;
var container = this.container = document.body;
this.history = new UndoHistory(container, options.undoDepth, options.undoDelay, this);
var self = this;
if (!Editor.Parser)
throw "No parser loaded.";
if (options.parserConfig && Editor.Parser.configure)
Editor.Parser.configure(options.parserConfig);
if (!options.readOnly && !internetExplorer)
select.setCursorPos(container, {node: null, offset: 0});
this.dirty = [];
this.importCode(options.content || "");
this.history.onChange = options.onChange;
if (!options.readOnly) {
if (options.continuousScanning !== false) {
this.scanner = this.documentScanner(options.passTime);
this.delayScanning();
}
function setEditable() {
// Use contentEditable instead of designMode on IE, since designMode frames
// can not run any scripts. It would be nice if we could use contentEditable
// everywhere, but it is significantly flakier than designMode on every
// single non-IE browser.
if (document.body.contentEditable != undefined && internetExplorer)
document.body.contentEditable = "true";
else
document.designMode = "on";
// Work around issue where you have to click on the actual
// body of the document to focus it in IE, making focusing
// hard when the document is small.
if (internetExplorer && options.height != "dynamic")
document.body.style.minHeight = (
window.frameElement.clientHeight - 2 * document.body.offsetTop - 5) + "px";
document.documentElement.style.borderWidth = "0";
if (!options.textWrapping)
container.style.whiteSpace = "nowrap";
}
// If setting the frame editable fails, try again when the user
// focus it (happens when the frame is not visible on
// initialisation, in Firefox).
try {
setEditable();
}
catch(e) {
var focusEvent = addEventHandler(document, "focus", function() {
focusEvent();
setEditable();
}, true);
}
addEventHandler(document, "keydown", method(this, "keyDown"));
addEventHandler(document, "keypress", method(this, "keyPress"));
addEventHandler(document, "keyup", method(this, "keyUp"));
function cursorActivity() {self.cursorActivity(false);}
addEventHandler(internetExplorer ? document.body : window, "mouseup", cursorActivity);
addEventHandler(document.body, "cut", cursorActivity);
// workaround for a gecko bug [?] where going forward and then
// back again breaks designmode (no more cursor)
if (gecko)
addEventHandler(window, "pagehide", function(){self.unloaded = true;});
addEventHandler(document.body, "paste", function(event) {
cursorActivity();
var text = null;
try {
var clipboardData = event.clipboardData || window.clipboardData;
if (clipboardData) text = clipboardData.getData('Text');
}
catch(e) {}
if (text !== null) {
event.stop();
self.replaceSelection(text);
select.scrollToCursor(self.container);
}
});
if (this.options.autoMatchParens)
addEventHandler(document.body, "click", method(this, "scheduleParenHighlight"));
}
else if (!options.textWrapping) {
container.style.whiteSpace = "nowrap";
}
}
function isSafeKey(code) {
return (code >= 16 && code <= 18) || // shift, control, alt
(code >= 33 && code <= 40); // arrows, home, end
}
Editor.prototype = {
// Import a piece of code into the editor.
importCode: function(code) {
var lines = asEditorLines(code), chunk = 1000;
if (!this.options.incrementalLoading || lines.length < chunk) {
this.history.push(null, null, lines);
this.history.reset();
}
else {
var cur = 0, self = this;
function addChunk() {
var chunklines = lines.slice(cur, cur + chunk);
chunklines.push("");
self.history.push(self.history.nodeBefore(null), null, chunklines);
self.history.reset();
cur += chunk;
if (cur < lines.length)
parent.setTimeout(addChunk, 1000);
}
addChunk();
}
},
// Extract the code from the editor.
getCode: function() {
if (!this.container.firstChild)
return "";
var accum = [];
select.markSelection();
forEach(traverseDOM(this.container.firstChild), method(accum, "push"));
select.selectMarked();
// On webkit, don't count last (empty) line if the webkitLastLineHack BR is present
if (webkit && this.container.lastChild.hackBR)
accum.pop();
webkitLastLineHack(this.container);
return cleanText(accum.join(""));
},
checkLine: function(node) {
if (node === false || !(node == null || node.parentNode == this.container || node.hackBR))
throw parent.CodeMirror.InvalidLineHandle;
},
cursorPosition: function(start) {
if (start == null) start = true;
var pos = select.cursorPos(this.container, start);
if (pos) return {line: pos.node, character: pos.offset};
else return {line: null, character: 0};
},
firstLine: function() {
return null;
},
lastLine: function() {
var last = this.container.lastChild;
if (last) last = startOfLine(last);
if (last && last.hackBR) last = startOfLine(last.previousSibling);
return last;
},
nextLine: function(line) {
this.checkLine(line);
var end = endOfLine(line, this.container);
if (!end || end.hackBR) return false;
else return end;
},
prevLine: function(line) {
this.checkLine(line);
if (line == null) return false;
return startOfLine(line.previousSibling);
},
visibleLineCount: function() {
var line = this.container.firstChild;
while (line && isBR(line)) line = line.nextSibling; // BR heights are unreliable
if (!line) return false;
var innerHeight = (window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight);
return Math.floor(innerHeight / line.offsetHeight);
},
selectLines: function(startLine, startOffset, endLine, endOffset) {
this.checkLine(startLine);
var start = {node: startLine, offset: startOffset}, end = null;
if (endOffset !== undefined) {
this.checkLine(endLine);
end = {node: endLine, offset: endOffset};
}
select.setCursorPos(this.container, start, end);
select.scrollToCursor(this.container);
},
lineContent: function(line) {
var accum = [];
for (line = line ? line.nextSibling : this.container.firstChild;
line && !isBR(line); line = line.nextSibling)
accum.push(nodeText(line));
return cleanText(accum.join(""));
},
setLineContent: function(line, content) {
this.history.commit();
this.replaceRange({node: line, offset: 0},
{node: line, offset: this.history.textAfter(line).length},
content);
this.addDirtyNode(line);
this.scheduleHighlight();
},
removeLine: function(line) {
var node = line ? line.nextSibling : this.container.firstChild;
while (node) {
var next = node.nextSibling;
removeElement(node);
if (isBR(node)) break;
node = next;
}
this.addDirtyNode(line);
this.scheduleHighlight();
},
insertIntoLine: function(line, position, content) {
var before = null;
if (position == "end") {
before = endOfLine(line, this.container);
}
else {
for (var cur = line ? line.nextSibling : this.container.firstChild; cur; cur = cur.nextSibling) {
if (position == 0) {
before = cur;
break;
}
var text = nodeText(cur);
if (text.length > position) {
before = cur.nextSibling;
content = text.slice(0, position) + content + text.slice(position);
removeElement(cur);
break;
}
position -= text.length;
}
}
var lines = asEditorLines(content);
for (var i = 0; i < lines.length; i++) {
if (i > 0) this.container.insertBefore(document.createElement("BR"), before);
this.container.insertBefore(makePartSpan(lines[i]), before);
}
this.addDirtyNode(line);
this.scheduleHighlight();
},
// Retrieve the selected text.
selectedText: function() {
var h = this.history;
h.commit();
var start = select.cursorPos(this.container, true),
end = select.cursorPos(this.container, false);
if (!start || !end) return "";
if (start.node == end.node)
return h.textAfter(start.node).slice(start.offset, end.offset);
var text = [h.textAfter(start.node).slice(start.offset)];
for (var pos = h.nodeAfter(start.node); pos != end.node; pos = h.nodeAfter(pos))
text.push(h.textAfter(pos));
text.push(h.textAfter(end.node).slice(0, end.offset));
return cleanText(text.join("\n"));
},
// Replace the selection with another piece of text.
replaceSelection: function(text) {
this.history.commit();
var start = select.cursorPos(this.container, true),
end = select.cursorPos(this.container, false);
if (!start || !end) return;
end = this.replaceRange(start, end, text);
select.setCursorPos(this.container, end);
webkitLastLineHack(this.container);
},
cursorCoords: function(start, internal) {
var sel = select.cursorPos(this.container, start);
if (!sel) return null;
var off = sel.offset, node = sel.node, self = this;
function measureFromNode(node, xOffset) {
var y = -(document.body.scrollTop || document.documentElement.scrollTop || 0),
x = -(document.body.scrollLeft || document.documentElement.scrollLeft || 0) + xOffset;
forEach([node, internal ? null : window.frameElement], function(n) {
while (n) {x += n.offsetLeft; y += n.offsetTop;n = n.offsetParent;}
});
return {x: x, y: y, yBot: y + node.offsetHeight};
}
function withTempNode(text, f) {
var node = document.createElement("SPAN");
node.appendChild(document.createTextNode(text));
try {return f(node);}
finally {if (node.parentNode) node.parentNode.removeChild(node);}
}
while (off) {
node = node ? node.nextSibling : this.container.firstChild;
var txt = nodeText(node);
if (off < txt.length)
return withTempNode(txt.substr(0, off), function(tmp) {
tmp.style.position = "absolute"; tmp.style.visibility = "hidden";
tmp.className = node.className;
self.container.appendChild(tmp);
return measureFromNode(node, tmp.offsetWidth);
});
off -= txt.length;
}
if (node && isSpan(node))
return measureFromNode(node, node.offsetWidth);
else if (node && node.nextSibling && isSpan(node.nextSibling))
return measureFromNode(node.nextSibling, 0);
else
return withTempNode("\u200b", function(tmp) {
if (node) node.parentNode.insertBefore(tmp, node.nextSibling);
else self.container.insertBefore(tmp, self.container.firstChild);
return measureFromNode(tmp, 0);
});
},
reroutePasteEvent: function() {
if (this.capturingPaste || window.opera || (gecko && gecko >= 20101026)) return;
this.capturingPaste = true;
var te = window.frameElement.CodeMirror.textareaHack;
var coords = this.cursorCoords(true, true);
te.style.top = coords.y + "px";
if (internetExplorer) {
var snapshot = select.getBookmark(this.container);
if (snapshot) this.selectionSnapshot = snapshot;
}
parent.focus();
te.value = "";
te.focus();
var self = this;
parent.setTimeout(function() {
self.capturingPaste = false;
window.focus();
if (self.selectionSnapshot) // IE hack
window.select.setBookmark(self.container, self.selectionSnapshot);
var text = te.value;
if (text) {
self.replaceSelection(text);
select.scrollToCursor(self.container);
}
}, 10);
},
replaceRange: function(from, to, text) {
var lines = asEditorLines(text);
lines[0] = this.history.textAfter(from.node).slice(0, from.offset) + lines[0];
var lastLine = lines[lines.length - 1];
lines[lines.length - 1] = lastLine + this.history.textAfter(to.node).slice(to.offset);
var end = this.history.nodeAfter(to.node);
this.history.push(from.node, end, lines);
return {node: this.history.nodeBefore(end),
offset: lastLine.length};
},
getSearchCursor: function(string, fromCursor, caseFold) {
return new SearchCursor(this, string, fromCursor, caseFold);
},
// Re-indent the whole buffer
reindent: function() {
if (this.container.firstChild)
this.indentRegion(null, this.container.lastChild);
},
reindentSelection: function(direction) {
if (!select.somethingSelected()) {
this.indentAtCursor(direction);
}
else {
var start = select.selectionTopNode(this.container, true),
end = select.selectionTopNode(this.container, false);
if (start === false || end === false) return;
this.indentRegion(start, end, direction);
}
},
grabKeys: function(eventHandler, filter) {
this.frozen = eventHandler;
this.keyFilter = filter;
},
ungrabKeys: function() {
this.frozen = "leave";
},
setParser: function(name, parserConfig) {
Editor.Parser = window[name];
parserConfig = parserConfig || this.options.parserConfig;
if (parserConfig && Editor.Parser.configure)
Editor.Parser.configure(parserConfig);
if (this.container.firstChild) {
forEach(this.container.childNodes, function(n) {
if (n.nodeType != 3) n.dirty = true;
});
this.addDirtyNode(this.firstChild);
this.scheduleHighlight();
}
},
// Intercept enter and tab, and assign their new functions.
keyDown: function(event) {
if (this.frozen == "leave") {this.frozen = null; this.keyFilter = null;}
if (this.frozen && (!this.keyFilter || this.keyFilter(event.keyCode, event))) {
event.stop();
this.frozen(event);
return;
}
var code = event.keyCode;
// Don't scan when the user is typing.
this.delayScanning();
// Schedule a paren-highlight event, if configured.
if (this.options.autoMatchParens)
this.scheduleParenHighlight();
// The various checks for !altKey are there because AltGr sets both
// ctrlKey and altKey to true, and should not be recognised as
// Control.
if (code == 13) { // enter
if (event.ctrlKey && !event.altKey) {
this.reparseBuffer();
}
else {
select.insertNewlineAtCursor();
var mode = this.options.enterMode;
if (mode != "flat") this.indentAtCursor(mode == "keep" ? "keep" : undefined);
select.scrollToCursor(this.container);
}
event.stop();
}
else if (code == 9 && this.options.tabMode != "default" && !event.ctrlKey) { // tab
this.handleTab(!event.shiftKey);
event.stop();
}
else if (code == 32 && event.shiftKey && this.options.tabMode == "default") { // space
this.handleTab(true);
event.stop();
}
else if (code == 36 && !event.shiftKey && !event.ctrlKey) { // home
if (this.home()) event.stop();
}
else if (code == 35 && !event.shiftKey && !event.ctrlKey) { // end
if (this.end()) event.stop();
}
// Only in Firefox is the default behavior for PgUp/PgDn correct.
else if (code == 33 && !event.shiftKey && !event.ctrlKey && !gecko) { // PgUp
if (this.pageUp()) event.stop();
}
else if (code == 34 && !event.shiftKey && !event.ctrlKey && !gecko) { // PgDn
if (this.pageDown()) event.stop();
}
else if ((code == 219 || code == 221) && event.ctrlKey && !event.altKey) { // [, ]
this.highlightParens(event.shiftKey, true);
event.stop();
}
else if (event.metaKey && !event.shiftKey && (code == 37 || code == 39)) { // Meta-left/right
var cursor = select.selectionTopNode(this.container);
if (cursor === false || !this.container.firstChild) return;
if (code == 37) select.focusAfterNode(startOfLine(cursor), this.container);
else {
var end = endOfLine(cursor, this.container);
select.focusAfterNode(end ? end.previousSibling : this.container.lastChild, this.container);
}
event.stop();
}
else if ((event.ctrlKey || event.metaKey) && !event.altKey) {
if ((event.shiftKey && code == 90) || code == 89) { // shift-Z, Y
select.scrollToNode(this.history.redo());
event.stop();
}
else if (code == 90 || (safari && code == 8)) { // Z, backspace
select.scrollToNode(this.history.undo());
event.stop();
}
else if (code == 83 && this.options.saveFunction) { // S
this.options.saveFunction();
event.stop();
}
else if (code == 86 && !mac) { // V
this.reroutePasteEvent();
}
}
},
// Check for characters that should re-indent the current line,
// and prevent Opera from handling enter and tab anyway.
keyPress: function(event) {
var electric = this.options.electricChars && Editor.Parser.electricChars, self = this;
// Hack for Opera, and Firefox on OS X, in which stopping a
// keydown event does not prevent the associated keypress event
// from happening, so we have to cancel enter and tab again
// here.
if ((this.frozen && (!this.keyFilter || this.keyFilter(event.keyCode || event.code, event))) ||
event.code == 13 || (event.code == 9 && this.options.tabMode != "default") ||
(event.code == 32 && event.shiftKey && this.options.tabMode == "default"))
event.stop();
else if (mac && (event.ctrlKey || event.metaKey) && event.character == "v") {
this.reroutePasteEvent();
}
else if (electric && electric.indexOf(event.character) != -1)
parent.setTimeout(function(){self.indentAtCursor(null);}, 0);
// Work around a bug where pressing backspace at the end of a
// line, or delete at the start, often causes the cursor to jump
// to the start of the line in Opera 10.60.
else if (brokenOpera) {
if (event.code == 8) { // backspace
var sel = select.selectionTopNode(this.container), self = this,
next = sel ? sel.nextSibling : this.container.firstChild;
if (sel !== false && next && isBR(next))
parent.setTimeout(function(){
if (select.selectionTopNode(self.container) == next)
select.focusAfterNode(next.previousSibling, self.container);
}, 20);
}
else if (event.code == 46) { // delete
var sel = select.selectionTopNode(this.container), self = this;
if (sel && isBR(sel)) {
parent.setTimeout(function(){
if (select.selectionTopNode(self.container) != sel)
select.focusAfterNode(sel, self.container);
}, 20);
}
}
}
// In 533.* WebKit versions, when the document is big, typing
// something at the end of a line causes the browser to do some
// kind of stupid heavy operation, creating delays of several
// seconds before the typed characters appear. This very crude
// hack inserts a temporary zero-width space after the cursor to
// make it not be at the end of the line.
else if (slowWebkit) {
var sel = select.selectionTopNode(this.container),
next = sel ? sel.nextSibling : this.container.firstChild;
// Doesn't work on empty lines, for some reason those always
// trigger the delay.
if (sel && next && isBR(next) && !isBR(sel)) {
var cheat = document.createTextNode("\u200b");
this.container.insertBefore(cheat, next);
parent.setTimeout(function() {
if (cheat.nodeValue == "\u200b") removeElement(cheat);
else cheat.nodeValue = cheat.nodeValue.replace("\u200b", "");
}, 20);
}
}
// Magic incantation that works abound a webkit bug when you
// can't type on a blank line following a line that's wider than
// the window.
if (webkit && !this.options.textWrapping)
setTimeout(function () {
var node = select.selectionTopNode(self.container, true);
if (node && node.nodeType == 3 && node.previousSibling && isBR(node.previousSibling)
&& node.nextSibling && isBR(node.nextSibling))
node.parentNode.replaceChild(document.createElement("BR"), node.previousSibling);
}, 50);
},
// Mark the node at the cursor dirty when a non-safe key is
// released.
keyUp: function(event) {
this.cursorActivity(isSafeKey(event.keyCode));
},
// Indent the line following a given <br>, or null for the first
// line. If given a <br> element, this must have been highlighted
// so that it has an indentation method. Returns the whitespace
// element that has been modified or created (if any).
indentLineAfter: function(start, direction) {
function whiteSpaceAfter(node) {
var ws = node ? node.nextSibling : self.container.firstChild;
if (!ws || !hasClass(ws, "whitespace")) return null;
return ws;
}
// whiteSpace is the whitespace span at the start of the line,
// or null if there is no such node.
var self = this, whiteSpace = whiteSpaceAfter(start);
var newIndent = 0, curIndent = whiteSpace ? whiteSpace.currentText.length : 0;
var firstText = whiteSpace ? whiteSpace.nextSibling : (start ? start.nextSibling : this.container.firstChild);
if (direction == "keep") {
if (start) {
var prevWS = whiteSpaceAfter(startOfLine(start.previousSibling))
if (prevWS) newIndent = prevWS.currentText.length;
}
}
else {
// Sometimes the start of the line can influence the correct
// indentation, so we retrieve it.
var nextChars = (start && firstText && firstText.currentText) ? firstText.currentText : "";
// Ask the lexical context for the correct indentation, and
// compute how much this differs from the current indentation.
if (direction != null && this.options.tabMode == "shift")
newIndent = direction ? curIndent + indentUnit : Math.max(0, curIndent - indentUnit)
else if (start)
newIndent = start.indentation(nextChars, curIndent, direction, firstText);
else if (Editor.Parser.firstIndentation)
newIndent = Editor.Parser.firstIndentation(nextChars, curIndent, direction, firstText);
}
var indentDiff = newIndent - curIndent;
// If there is too much, this is just a matter of shrinking a span.
if (indentDiff < 0) {
if (newIndent == 0) {
if (firstText) select.snapshotMove(whiteSpace.firstChild, firstText.firstChild || firstText, 0);
removeElement(whiteSpace);
whiteSpace = null;
}
else {
select.snapshotMove(whiteSpace.firstChild, whiteSpace.firstChild, indentDiff, true);
whiteSpace.currentText = makeWhiteSpace(newIndent);
whiteSpace.firstChild.nodeValue = whiteSpace.currentText;
}
}
// Not enough...
else if (indentDiff > 0) {
// If there is whitespace, we grow it.
if (whiteSpace) {
whiteSpace.currentText = makeWhiteSpace(newIndent);
whiteSpace.firstChild.nodeValue = whiteSpace.currentText;
select.snapshotMove(whiteSpace.firstChild, whiteSpace.firstChild, indentDiff, true);
}
// Otherwise, we have to add a new whitespace node.
else {
whiteSpace = makePartSpan(makeWhiteSpace(newIndent));
whiteSpace.className = "whitespace";
if (start) insertAfter(whiteSpace, start);
else this.container.insertBefore(whiteSpace, this.container.firstChild);
select.snapshotMove(firstText && (firstText.firstChild || firstText),
whiteSpace.firstChild, newIndent, false, true);
}
}
// Make sure cursor ends up after the whitespace
else if (whiteSpace) {
select.snapshotMove(whiteSpace.firstChild, whiteSpace.firstChild, newIndent, false);
}
if (indentDiff != 0) this.addDirtyNode(start);
},
// Re-highlight the selected part of the document.
highlightAtCursor: function() {
var pos = select.selectionTopNode(this.container, true);
var to = select.selectionTopNode(this.container, false);
if (pos === false || to === false) return false;
select.markSelection();
if (this.highlight(pos, endOfLine(to, this.container), true, 20) === false)
return false;
select.selectMarked();
return true;
},
// When tab is pressed with text selected, the whole selection is
// re-indented, when nothing is selected, the line with the cursor
// is re-indented.
handleTab: function(direction) {
if (this.options.tabMode == "spaces")
select.insertTabAtCursor();
else
this.reindentSelection(direction);
},
// Custom home behaviour that doesn't land the cursor in front of
// leading whitespace unless pressed twice.
home: function() {
var cur = select.selectionTopNode(this.container, true), start = cur;
if (cur === false || !(!cur || cur.isPart || isBR(cur)) || !this.container.firstChild)
return false;
while (cur && !isBR(cur)) cur = cur.previousSibling;
var next = cur ? cur.nextSibling : this.container.firstChild;
if (next && next != start && next.isPart && hasClass(next, "whitespace"))
select.focusAfterNode(next, this.container);
else
select.focusAfterNode(cur, this.container);
select.scrollToCursor(this.container);
return true;
},
// Some browsers (Opera) don't manage to handle the end key
// properly in the face of vertical scrolling.
end: function() {
var cur = select.selectionTopNode(this.container, true);
if (cur === false) return false;
cur = endOfLine(cur, this.container);
if (!cur) return false;
select.focusAfterNode(cur.previousSibling, this.container);
select.scrollToCursor(this.container);
return true;
},
pageUp: function() {
var line = this.cursorPosition().line, scrollAmount = this.visibleLineCount();
if (line === false || scrollAmount === false) return false;
// Try to keep one line on the screen.
scrollAmount -= 2;
for (var i = 0; i < scrollAmount; i++) {
line = this.prevLine(line);
if (line === false) break;
}
if (i == 0) return false; // Already at first line
select.setCursorPos(this.container, {node: line, offset: 0});
select.scrollToCursor(this.container);
return true;
},
pageDown: function() {
var line = this.cursorPosition().line, scrollAmount = this.visibleLineCount();
if (line === false || scrollAmount === false) return false;
// Try to move to the last line of the current page.
scrollAmount -= 2;
for (var i = 0; i < scrollAmount; i++) {
var nextLine = this.nextLine(line);
if (nextLine === false) break;
line = nextLine;
}
if (i == 0) return false; // Already at last line
select.setCursorPos(this.container, {node: line, offset: 0});
select.scrollToCursor(this.container);
return true;
},
// Delay (or initiate) the next paren highlight event.
scheduleParenHighlight: function() {
if (this.parenEvent) parent.clearTimeout(this.parenEvent);
var self = this;
this.parenEvent = parent.setTimeout(function(){self.highlightParens();}, 300);
},
// Take the token before the cursor. If it contains a character in
// '()[]{}', search for the matching paren/brace/bracket, and
// highlight them in green for a moment, or red if no proper match
// was found.
highlightParens: function(jump, fromKey) {
var self = this, mark = this.options.markParen;
if (typeof mark == "string") mark = [mark, mark];
// give the relevant nodes a colour.
function highlight(node, ok) {
if (!node) return;
if (!mark) {
node.style.fontWeight = "bold";
node.style.color = ok ? "#8F8" : "#F88";
}
else if (mark.call) mark(node, ok);
else node.className += " " + mark[ok ? 0 : 1];
}
function unhighlight(node) {
if (!node) return;
if (mark && !mark.call)
removeClass(removeClass(node, mark[0]), mark[1]);
else if (self.options.unmarkParen)
self.options.unmarkParen(node);
else {
node.style.fontWeight = "";
node.style.color = "";
}
}
if (!fromKey && self.highlighted) {
unhighlight(self.highlighted[0]);
unhighlight(self.highlighted[1]);
}
if (!window || !window.parent || !window.select) return;
// Clear the event property.
if (this.parenEvent) parent.clearTimeout(this.parenEvent);
this.parenEvent = null;
// Extract a 'paren' from a piece of text.
function paren(node) {
if (node.currentText) {
var match = node.currentText.match(/^[\s\u00a0]*([\(\)\[\]{}])[\s\u00a0]*$/);
return match && match[1];
}
}
// Determine the direction a paren is facing.
function forward(ch) {
return /[\(\[\{]/.test(ch);
}
var ch, cursor = select.selectionTopNode(this.container, true);
if (!cursor || !this.highlightAtCursor()) return;
cursor = select.selectionTopNode(this.container, true);
if (!(cursor && ((ch = paren(cursor)) || (cursor = cursor.nextSibling) && (ch = paren(cursor)))))
return;
// We only look for tokens with the same className.
var className = cursor.className, dir = forward(ch), match = matching[ch];
// Since parts of the document might not have been properly
// highlighted, and it is hard to know in advance which part we
// have to scan, we just try, and when we find dirty nodes we
// abort, parse them, and re-try.
function tryFindMatch() {
var stack = [], ch, ok = true;
for (var runner = cursor; runner; runner = dir ? runner.nextSibling : runner.previousSibling) {
if (runner.className == className && isSpan(runner) && (ch = paren(runner))) {
if (forward(ch) == dir)
stack.push(ch);
else if (!stack.length)
ok = false;
else if (stack.pop() != matching[ch])
ok = false;
if (!stack.length) break;
}
else if (runner.dirty || !isSpan(runner) && !isBR(runner)) {
return {node: runner, status: "dirty"};
}
}
return {node: runner, status: runner && ok};
}
while (true) {
var found = tryFindMatch();
if (found.status == "dirty") {
this.highlight(found.node, endOfLine(found.node));
// Needed because in some corner cases a highlight does not
// reach a node.
found.node.dirty = false;
continue;
}
else {
highlight(cursor, found.status);
highlight(found.node, found.status);
if (fromKey)
parent.setTimeout(function() {unhighlight(cursor); unhighlight(found.node);}, 500);
else
self.highlighted = [cursor, found.node];
if (jump && found.node)
select.focusAfterNode(found.node.previousSibling, this.container);
break;
}
}
},
// Adjust the amount of whitespace at the start of the line that
// the cursor is on so that it is indented properly.
indentAtCursor: function(direction) {
if (!this.container.firstChild) return;
// The line has to have up-to-date lexical information, so we
// highlight it first.
if (!this.highlightAtCursor()) return;
var cursor = select.selectionTopNode(this.container, false);
// If we couldn't determine the place of the cursor,
// there's nothing to indent.
if (cursor === false)
return;
select.markSelection();
this.indentLineAfter(startOfLine(cursor), direction);
select.selectMarked();
},
// Indent all lines whose start falls inside of the current
// selection.
indentRegion: function(start, end, direction) {
var current = (start = startOfLine(start)), before = start && startOfLine(start.previousSibling);
if (!isBR(end)) end = endOfLine(end, this.container);
this.addDirtyNode(start);
do {
var next = endOfLine(current, this.container);
if (current) this.highlight(before, next, true);
this.indentLineAfter(current, direction);
before = current;
current = next;
} while (current != end);
select.setCursorPos(this.container, {node: start, offset: 0}, {node: end, offset: 0});
},
// Find the node that the cursor is in, mark it as dirty, and make
// sure a highlight pass is scheduled.
cursorActivity: function(safe) {
// pagehide event hack above
if (this.unloaded) {
window.document.designMode = "off";
window.document.designMode = "on";
this.unloaded = false;
}
if (internetExplorer) {
this.container.createTextRange().execCommand("unlink");
clearTimeout(this.saveSelectionSnapshot);
var self = this;
this.saveSelectionSnapshot = setTimeout(function() {
var snapshot = select.getBookmark(self.container);
if (snapshot) self.selectionSnapshot = snapshot;
}, 200);
}
var activity = this.options.onCursorActivity;
if (!safe || activity) {
var cursor = select.selectionTopNode(this.container, false);
if (cursor === false || !this.container.firstChild) return;
cursor = cursor || this.container.firstChild;
if (activity) activity(cursor);
if (!safe) {
this.scheduleHighlight();
this.addDirtyNode(cursor);
}
}
},
reparseBuffer: function() {
forEach(this.container.childNodes, function(node) {node.dirty = true;});
if (this.container.firstChild)
this.addDirtyNode(this.container.firstChild);
},
// Add a node to the set of dirty nodes, if it isn't already in
// there.
addDirtyNode: function(node) {
node = node || this.container.firstChild;
if (!node) return;
for (var i = 0; i < this.dirty.length; i++)
if (this.dirty[i] == node) return;
if (node.nodeType != 3)
node.dirty = true;
this.dirty.push(node);
},
allClean: function() {
return !this.dirty.length;
},
// Cause a highlight pass to happen in options.passDelay
// milliseconds. Clear the existing timeout, if one exists. This
// way, the passes do not happen while the user is typing, and
// should as unobtrusive as possible.
scheduleHighlight: function() {
// Timeouts are routed through the parent window, because on
// some browsers designMode windows do not fire timeouts.
var self = this;
parent.clearTimeout(this.highlightTimeout);
this.highlightTimeout = parent.setTimeout(function(){self.highlightDirty();}, this.options.passDelay);
},
// Fetch one dirty node, and remove it from the dirty set.
getDirtyNode: function() {
while (this.dirty.length > 0) {
var found = this.dirty.pop();
// IE8 sometimes throws an unexplainable 'invalid argument'
// exception for found.parentNode
try {
// If the node has been coloured in the meantime, or is no
// longer in the document, it should not be returned.
while (found && found.parentNode != this.container)
found = found.parentNode;
if (found && (found.dirty || found.nodeType == 3))
return found;
} catch (e) {}
}
return null;
},
// Pick dirty nodes, and highlight them, until options.passTime
// milliseconds have gone by. The highlight method will continue
// to next lines as long as it finds dirty nodes. It returns
// information about the place where it stopped. If there are
// dirty nodes left after this function has spent all its lines,
// it shedules another highlight to finish the job.
highlightDirty: function(force) {
// Prevent FF from raising an error when it is firing timeouts
// on a page that's no longer loaded.
if (!window || !window.parent || !window.select) return false;
if (!this.options.readOnly) select.markSelection();
var start, endTime = force ? null : time() + this.options.passTime;
while ((time() < endTime || force) && (start = this.getDirtyNode())) {
var result = this.highlight(start, endTime);
if (result && result.node && result.dirty)
this.addDirtyNode(result.node.nextSibling);
}
if (!this.options.readOnly) select.selectMarked();
if (start) this.scheduleHighlight();
return this.dirty.length == 0;
},
// Creates a function that, when called through a timeout, will
// continuously re-parse the document.
documentScanner: function(passTime) {
var self = this, pos = null;
return function() {
// FF timeout weirdness workaround.
if (!window || !window.parent || !window.select) return;
// If the current node is no longer in the document... oh
// well, we start over.
if (pos && pos.parentNode != self.container)
pos = null;
select.markSelection();
var result = self.highlight(pos, time() + passTime, true);
select.selectMarked();
var newPos = result ? (result.node && result.node.nextSibling) : null;
pos = (pos == newPos) ? null : newPos;
self.delayScanning();
};
},
// Starts the continuous scanning process for this document after
// a given interval.
delayScanning: function() {
if (this.scanner) {
parent.clearTimeout(this.documentScan);
this.documentScan = parent.setTimeout(this.scanner, this.options.continuousScanning);
}
},
// The function that does the actual highlighting/colouring (with
// help from the parser and the DOM normalizer). Its interface is
// rather overcomplicated, because it is used in different
// situations: ensuring that a certain line is highlighted, or
// highlighting up to X milliseconds starting from a certain
// point. The 'from' argument gives the node at which it should
// start. If this is null, it will start at the beginning of the
// document. When a timestamp is given with the 'target' argument,
// it will stop highlighting at that time. If this argument holds
// a DOM node, it will highlight until it reaches that node. If at
// any time it comes across two 'clean' lines (no dirty nodes), it
// will stop, except when 'cleanLines' is true. maxBacktrack is
// the maximum number of lines to backtrack to find an existing
// parser instance. This is used to give up in situations where a
// highlight would take too long and freeze the browser interface.
highlight: function(from, target, cleanLines, maxBacktrack){
var container = this.container, self = this, active = this.options.activeTokens;
var endTime = (typeof target == "number" ? target : null);
if (!container.firstChild)
return false;
// Backtrack to the first node before from that has a partial
// parse stored.
while (from && (!from.parserFromHere || from.dirty)) {
if (maxBacktrack != null && isBR(from) && (--maxBacktrack) < 0)
return false;
from = from.previousSibling;
}
// If we are at the end of the document, do nothing.
if (from && !from.nextSibling)
return false;
// Check whether a part (<span> node) and the corresponding token
// match.
function correctPart(token, part){
return !part.reduced && part.currentText == token.value && part.className == token.style;
}
// Shorten the text associated with a part by chopping off
// characters from the front. Note that only the currentText
// property gets changed. For efficiency reasons, we leave the
// nodeValue alone -- we set the reduced flag to indicate that
// this part must be replaced.
function shortenPart(part, minus){
part.currentText = part.currentText.substring(minus);
part.reduced = true;
}
// Create a part corresponding to a given token.
function tokenPart(token){
var part = makePartSpan(token.value);
part.className = token.style;
return part;
}
function maybeTouch(node) {
if (node) {
var old = node.oldNextSibling;
if (lineDirty || old === undefined || node.nextSibling != old)
self.history.touch(node);
node.oldNextSibling = node.nextSibling;
}
else {
var old = self.container.oldFirstChild;
if (lineDirty || old === undefined || self.container.firstChild != old)
self.history.touch(null);
self.container.oldFirstChild = self.container.firstChild;
}
}
// Get the token stream. If from is null, we start with a new
// parser from the start of the frame, otherwise a partial parse
// is resumed.
var traversal = traverseDOM(from ? from.nextSibling : container.firstChild),
stream = stringStream(traversal),
parsed = from ? from.parserFromHere(stream) : Editor.Parser.make(stream);
function surroundedByBRs(node) {
return (node.previousSibling == null || isBR(node.previousSibling)) &&
(node.nextSibling == null || isBR(node.nextSibling));
}
// parts is an interface to make it possible to 'delay' fetching
// the next DOM node until we are completely done with the one
// before it. This is necessary because often the next node is
// not yet available when we want to proceed past the current
// one.
var parts = {
current: null,
// Fetch current node.
get: function(){
if (!this.current)
this.current = traversal.nodes.shift();
return this.current;
},
// Advance to the next part (do not fetch it yet).
next: function(){
this.current = null;
},
// Remove the current part from the DOM tree, and move to the
// next.
remove: function(){
container.removeChild(this.get());
this.current = null;
},
// Advance to the next part that is not empty, discarding empty
// parts.
getNonEmpty: function(){
var part = this.get();
// Allow empty nodes when they are alone on a line, needed
// for the FF cursor bug workaround (see select.js,
// insertNewlineAtCursor).
while (part && isSpan(part) && part.currentText == "") {
// Leave empty nodes that are alone on a line alone in
// Opera, since that browsers doesn't deal well with
// having 2 BRs in a row.
if (window.opera && surroundedByBRs(part)) {
this.next();
part = this.get();
}
else {
var old = part;
this.remove();
part = this.get();
// Adjust selection information, if any. See select.js for details.
select.snapshotMove(old.firstChild, part && (part.firstChild || part), 0);
}
}
return part;
}
};
var lineDirty = false, prevLineDirty = true, lineNodes = 0;
// This forEach loops over the tokens from the parsed stream, and
// at the same time uses the parts object to proceed through the
// corresponding DOM nodes.
forEach(parsed, function(token){
var part = parts.getNonEmpty();
if (token.value == "\n"){
// The idea of the two streams actually staying synchronized
// is such a long shot that we explicitly check.
if (!isBR(part))
throw "Parser out of sync. Expected BR.";
if (part.dirty || !part.indentation) lineDirty = true;
maybeTouch(from);
from = part;
// Every <br> gets a copy of the parser state and a lexical
// context assigned to it. The first is used to be able to
// later resume parsing from this point, the second is used
// for indentation.
part.parserFromHere = parsed.copy();
part.indentation = token.indentation || alwaysZero;
part.dirty = false;
// If the target argument wasn't an integer, go at least
// until that node.
if (endTime == null && part == target) throw StopIteration;
// A clean line with more than one node means we are done.
// Throwing a StopIteration is the way to break out of a
// MochiKit forEach loop.
if ((endTime != null && time() >= endTime) || (!lineDirty && !prevLineDirty && lineNodes > 1 && !cleanLines))
throw StopIteration;
prevLineDirty = lineDirty; lineDirty = false; lineNodes = 0;
parts.next();
}
else {
if (!isSpan(part))
throw "Parser out of sync. Expected SPAN.";
if (part.dirty)
lineDirty = true;
lineNodes++;
// If the part matches the token, we can leave it alone.
if (correctPart(token, part)){
if (active && part.dirty) active(part, token, self);
part.dirty = false;
parts.next();
}
// Otherwise, we have to fix it.
else {
lineDirty = true;
// Insert the correct part.
var newPart = tokenPart(token);
container.insertBefore(newPart, part);
if (active) active(newPart, token, self);
var tokensize = token.value.length;
var offset = 0;
// Eat up parts until the text for this token has been
// removed, adjusting the stored selection info (see
// select.js) in the process.
while (tokensize > 0) {
part = parts.get();
var partsize = part.currentText.length;
select.snapshotReplaceNode(part.firstChild, newPart.firstChild, tokensize, offset);
if (partsize > tokensize){
shortenPart(part, tokensize);
tokensize = 0;
}
else {
tokensize -= partsize;
offset += partsize;
parts.remove();
}
}
}
}
});
maybeTouch(from);
webkitLastLineHack(this.container);
// The function returns some status information that is used by
// hightlightDirty to determine whether and where it has to
// continue.
return {node: parts.getNonEmpty(),
dirty: lineDirty};
}
};
return Editor;
})();
addEventHandler(window, "load", function() {
var CodeMirror = window.frameElement.CodeMirror;
var e = CodeMirror.editor = new Editor(CodeMirror.options);
parent.setTimeout(method(CodeMirror, "init"), 0);
});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/editor.js | JavaScript | gpl3 | 65,322 |
/* String streams are the things fed to parsers (which can feed them
* to a tokenizer if they want). They provide peek and next methods
* for looking at the current character (next 'consumes' this
* character, peek does not), and a get method for retrieving all the
* text that was consumed since the last time get was called.
*
* An easy mistake to make is to let a StopIteration exception finish
* the token stream while there are still characters pending in the
* string stream (hitting the end of the buffer while parsing a
* token). To make it easier to detect such errors, the stringstreams
* throw an exception when this happens.
*/
// Make a stringstream stream out of an iterator that returns strings.
// This is applied to the result of traverseDOM (see codemirror.js),
// and the resulting stream is fed to the parser.
var stringStream = function(source){
// String that's currently being iterated over.
var current = "";
// Position in that string.
var pos = 0;
// Accumulator for strings that have been iterated over but not
// get()-ed yet.
var accum = "";
// Make sure there are more characters ready, or throw
// StopIteration.
function ensureChars() {
while (pos == current.length) {
accum += current;
current = ""; // In case source.next() throws
pos = 0;
try {current = source.next();}
catch (e) {
if (e != StopIteration) throw e;
else return false;
}
}
return true;
}
return {
// peek: -> character
// Return the next character in the stream.
peek: function() {
if (!ensureChars()) return null;
return current.charAt(pos);
},
// next: -> character
// Get the next character, throw StopIteration if at end, check
// for unused content.
next: function() {
if (!ensureChars()) {
if (accum.length > 0)
throw "End of stringstream reached without emptying buffer ('" + accum + "').";
else
throw StopIteration;
}
return current.charAt(pos++);
},
// get(): -> string
// Return the characters iterated over since the last call to
// .get().
get: function() {
var temp = accum;
accum = "";
if (pos > 0){
temp += current.slice(0, pos);
current = current.slice(pos);
pos = 0;
}
return temp;
},
// Push a string back into the stream.
push: function(str) {
current = current.slice(0, pos) + str + current.slice(pos);
},
lookAhead: function(str, consume, skipSpaces, caseInsensitive) {
function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
str = cased(str);
var found = false;
var _accum = accum, _pos = pos;
if (skipSpaces) this.nextWhileMatches(/[\s\u00a0]/);
while (true) {
var end = pos + str.length, left = current.length - pos;
if (end <= current.length) {
found = str == cased(current.slice(pos, end));
pos = end;
break;
}
else if (str.slice(0, left) == cased(current.slice(pos))) {
accum += current; current = "";
try {current = source.next();}
catch (e) {if (e != StopIteration) throw e; break;}
pos = 0;
str = str.slice(left);
}
else {
break;
}
}
if (!(found && consume)) {
current = accum.slice(_accum.length) + current;
pos = _pos;
accum = _accum;
}
return found;
},
// Wont't match past end of line.
lookAheadRegex: function(regex, consume) {
if (regex.source.charAt(0) != "^")
throw new Error("Regexps passed to lookAheadRegex must start with ^");
// Fetch the rest of the line
while (current.indexOf("\n", pos) == -1) {
try {current += source.next();}
catch (e) {if (e != StopIteration) throw e; break;}
}
var matched = current.slice(pos).match(regex);
if (matched && consume) pos += matched[0].length;
return matched;
},
// Utils built on top of the above
// more: -> boolean
// Produce true if the stream isn't empty.
more: function() {
return this.peek() !== null;
},
applies: function(test) {
var next = this.peek();
return (next !== null && test(next));
},
nextWhile: function(test) {
var next;
while ((next = this.peek()) !== null && test(next))
this.next();
},
matches: function(re) {
var next = this.peek();
return (next !== null && re.test(next));
},
nextWhileMatches: function(re) {
var next;
while ((next = this.peek()) !== null && re.test(next))
this.next();
},
equals: function(ch) {
return ch === this.peek();
},
endOfLine: function() {
var next = this.peek();
return next == null || next == "\n";
}
};
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/stringstream.js | JavaScript | gpl3 | 5,095 |
/**
* Storage and control for undo information within a CodeMirror
* editor. 'Why on earth is such a complicated mess required for
* that?', I hear you ask. The goal, in implementing this, was to make
* the complexity of storing and reverting undo information depend
* only on the size of the edited or restored content, not on the size
* of the whole document. This makes it necessary to use a kind of
* 'diff' system, which, when applied to a DOM tree, causes some
* complexity and hackery.
*
* In short, the editor 'touches' BR elements as it parses them, and
* the UndoHistory stores these. When nothing is touched in commitDelay
* milliseconds, the changes are committed: It goes over all touched
* nodes, throws out the ones that did not change since last commit or
* are no longer in the document, and assembles the rest into zero or
* more 'chains' -- arrays of adjacent lines. Links back to these
* chains are added to the BR nodes, while the chain that previously
* spanned these nodes is added to the undo history. Undoing a change
* means taking such a chain off the undo history, restoring its
* content (text is saved per line) and linking it back into the
* document.
*/
// A history object needs to know about the DOM container holding the
// document, the maximum amount of undo levels it should store, the
// delay (of no input) after which it commits a set of changes, and,
// unfortunately, the 'parent' window -- a window that is not in
// designMode, and on which setTimeout works in every browser.
function UndoHistory(container, maxDepth, commitDelay, editor) {
this.container = container;
this.maxDepth = maxDepth; this.commitDelay = commitDelay;
this.editor = editor;
// This line object represents the initial, empty editor.
var initial = {text: "", from: null, to: null};
// As the borders between lines are represented by BR elements, the
// start of the first line and the end of the last one are
// represented by null. Since you can not store any properties
// (links to line objects) in null, these properties are used in
// those cases.
this.first = initial; this.last = initial;
// Similarly, a 'historyTouched' property is added to the BR in
// front of lines that have already been touched, and 'firstTouched'
// is used for the first line.
this.firstTouched = false;
// History is the set of committed changes, touched is the set of
// nodes touched since the last commit.
this.history = []; this.redoHistory = []; this.touched = []; this.lostundo = 0;
}
UndoHistory.prototype = {
// Schedule a commit (if no other touches come in for commitDelay
// milliseconds).
scheduleCommit: function() {
var self = this;
parent.clearTimeout(this.commitTimeout);
this.commitTimeout = parent.setTimeout(function(){self.tryCommit();}, this.commitDelay);
},
// Mark a node as touched. Null is a valid argument.
touch: function(node) {
this.setTouched(node);
this.scheduleCommit();
},
// Undo the last change.
undo: function() {
// Make sure pending changes have been committed.
this.commit();
if (this.history.length) {
// Take the top diff from the history, apply it, and store its
// shadow in the redo history.
var item = this.history.pop();
this.redoHistory.push(this.updateTo(item, "applyChain"));
this.notifyEnvironment();
return this.chainNode(item);
}
},
// Redo the last undone change.
redo: function() {
this.commit();
if (this.redoHistory.length) {
// The inverse of undo, basically.
var item = this.redoHistory.pop();
this.addUndoLevel(this.updateTo(item, "applyChain"));
this.notifyEnvironment();
return this.chainNode(item);
}
},
clear: function() {
this.history = [];
this.redoHistory = [];
this.lostundo = 0;
},
// Ask for the size of the un/redo histories.
historySize: function() {
return {undo: this.history.length, redo: this.redoHistory.length, lostundo: this.lostundo};
},
// Push a changeset into the document.
push: function(from, to, lines) {
var chain = [];
for (var i = 0; i < lines.length; i++) {
var end = (i == lines.length - 1) ? to : document.createElement("br");
chain.push({from: from, to: end, text: cleanText(lines[i])});
from = end;
}
this.pushChains([chain], from == null && to == null);
this.notifyEnvironment();
},
pushChains: function(chains, doNotHighlight) {
this.commit(doNotHighlight);
this.addUndoLevel(this.updateTo(chains, "applyChain"));
this.redoHistory = [];
},
// Retrieve a DOM node from a chain (for scrolling to it after undo/redo).
chainNode: function(chains) {
for (var i = 0; i < chains.length; i++) {
var start = chains[i][0], node = start && (start.from || start.to);
if (node) return node;
}
},
// Clear the undo history, make the current document the start
// position.
reset: function() {
this.history = []; this.redoHistory = []; this.lostundo = 0;
},
textAfter: function(br) {
return this.after(br).text;
},
nodeAfter: function(br) {
return this.after(br).to;
},
nodeBefore: function(br) {
return this.before(br).from;
},
// Commit unless there are pending dirty nodes.
tryCommit: function() {
if (!window || !window.parent || !window.UndoHistory) return; // Stop when frame has been unloaded
if (this.editor.highlightDirty()) this.commit(true);
else this.scheduleCommit();
},
// Check whether the touched nodes hold any changes, if so, commit
// them.
commit: function(doNotHighlight) {
parent.clearTimeout(this.commitTimeout);
// Make sure there are no pending dirty nodes.
if (!doNotHighlight) this.editor.highlightDirty(true);
// Build set of chains.
var chains = this.touchedChains(), self = this;
if (chains.length) {
this.addUndoLevel(this.updateTo(chains, "linkChain"));
this.redoHistory = [];
this.notifyEnvironment();
}
},
// [ end of public interface ]
// Update the document with a given set of chains, return its
// shadow. updateFunc should be "applyChain" or "linkChain". In the
// second case, the chains are taken to correspond the the current
// document, and only the state of the line data is updated. In the
// first case, the content of the chains is also pushed iinto the
// document.
updateTo: function(chains, updateFunc) {
var shadows = [], dirty = [];
for (var i = 0; i < chains.length; i++) {
shadows.push(this.shadowChain(chains[i]));
dirty.push(this[updateFunc](chains[i]));
}
if (updateFunc == "applyChain")
this.notifyDirty(dirty);
return shadows;
},
// Notify the editor that some nodes have changed.
notifyDirty: function(nodes) {
forEach(nodes, method(this.editor, "addDirtyNode"))
this.editor.scheduleHighlight();
},
notifyEnvironment: function() {
if (this.onChange) this.onChange(this.editor);
// Used by the line-wrapping line-numbering code.
if (window.frameElement && window.frameElement.CodeMirror.updateNumbers)
window.frameElement.CodeMirror.updateNumbers();
},
// Link a chain into the DOM nodes (or the first/last links for null
// nodes).
linkChain: function(chain) {
for (var i = 0; i < chain.length; i++) {
var line = chain[i];
if (line.from) line.from.historyAfter = line;
else this.first = line;
if (line.to) line.to.historyBefore = line;
else this.last = line;
}
},
// Get the line object after/before a given node.
after: function(node) {
return node ? node.historyAfter : this.first;
},
before: function(node) {
return node ? node.historyBefore : this.last;
},
// Mark a node as touched if it has not already been marked.
setTouched: function(node) {
if (node) {
if (!node.historyTouched) {
this.touched.push(node);
node.historyTouched = true;
}
}
else {
this.firstTouched = true;
}
},
// Store a new set of undo info, throw away info if there is more of
// it than allowed.
addUndoLevel: function(diffs) {
this.history.push(diffs);
if (this.history.length > this.maxDepth) {
this.history.shift();
lostundo += 1;
}
},
// Build chains from a set of touched nodes.
touchedChains: function() {
var self = this;
// The temp system is a crummy hack to speed up determining
// whether a (currently touched) node has a line object associated
// with it. nullTemp is used to store the object for the first
// line, other nodes get it stored in their historyTemp property.
var nullTemp = null;
function temp(node) {return node ? node.historyTemp : nullTemp;}
function setTemp(node, line) {
if (node) node.historyTemp = line;
else nullTemp = line;
}
function buildLine(node) {
var text = [];
for (var cur = node ? node.nextSibling : self.container.firstChild;
cur && (!isBR(cur) || cur.hackBR); cur = cur.nextSibling)
if (!cur.hackBR && cur.currentText) text.push(cur.currentText);
return {from: node, to: cur, text: cleanText(text.join(""))};
}
// Filter out unchanged lines and nodes that are no longer in the
// document. Build up line objects for remaining nodes.
var lines = [];
if (self.firstTouched) self.touched.push(null);
forEach(self.touched, function(node) {
if (node && (node.parentNode != self.container || node.hackBR)) return;
if (node) node.historyTouched = false;
else self.firstTouched = false;
var line = buildLine(node), shadow = self.after(node);
if (!shadow || shadow.text != line.text || shadow.to != line.to) {
lines.push(line);
setTemp(node, line);
}
});
// Get the BR element after/before the given node.
function nextBR(node, dir) {
var link = dir + "Sibling", search = node[link];
while (search && !isBR(search))
search = search[link];
return search;
}
// Assemble line objects into chains by scanning the DOM tree
// around them.
var chains = []; self.touched = [];
forEach(lines, function(line) {
// Note that this makes the loop skip line objects that have
// been pulled into chains by lines before them.
if (!temp(line.from)) return;
var chain = [], curNode = line.from, safe = true;
// Put any line objects (referred to by temp info) before this
// one on the front of the array.
while (true) {
var curLine = temp(curNode);
if (!curLine) {
if (safe) break;
else curLine = buildLine(curNode);
}
chain.unshift(curLine);
setTemp(curNode, null);
if (!curNode) break;
safe = self.after(curNode);
curNode = nextBR(curNode, "previous");
}
curNode = line.to; safe = self.before(line.from);
// Add lines after this one at end of array.
while (true) {
if (!curNode) break;
var curLine = temp(curNode);
if (!curLine) {
if (safe) break;
else curLine = buildLine(curNode);
}
chain.push(curLine);
setTemp(curNode, null);
safe = self.before(curNode);
curNode = nextBR(curNode, "next");
}
chains.push(chain);
});
return chains;
},
// Find the 'shadow' of a given chain by following the links in the
// DOM nodes at its start and end.
shadowChain: function(chain) {
var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to;
while (true) {
shadows.push(next);
var nextNode = next.to;
if (!nextNode || nextNode == end)
break;
else
next = nextNode.historyAfter || this.before(end);
// (The this.before(end) is a hack -- FF sometimes removes
// properties from BR nodes, in which case the best we can hope
// for is to not break.)
}
return shadows;
},
// Update the DOM tree to contain the lines specified in a given
// chain, link this chain into the DOM nodes.
applyChain: function(chain) {
// Some attempt is made to prevent the cursor from jumping
// randomly when an undo or redo happens. It still behaves a bit
// strange sometimes.
var cursor = select.cursorPos(this.container, false), self = this;
// Remove all nodes in the DOM tree between from and to (null for
// start/end of container).
function removeRange(from, to) {
var pos = from ? from.nextSibling : self.container.firstChild;
while (pos != to) {
var temp = pos.nextSibling;
removeElement(pos);
pos = temp;
}
}
var start = chain[0].from, end = chain[chain.length - 1].to;
// Clear the space where this change has to be made.
removeRange(start, end);
// Insert the content specified by the chain into the DOM tree.
for (var i = 0; i < chain.length; i++) {
var line = chain[i];
// The start and end of the space are already correct, but BR
// tags inside it have to be put back.
if (i > 0)
self.container.insertBefore(line.from, end);
// Add the text.
var node = makePartSpan(fixSpaces(line.text));
self.container.insertBefore(node, end);
// See if the cursor was on this line. Put it back, adjusting
// for changed line length, if it was.
if (cursor && cursor.node == line.from) {
var cursordiff = 0;
var prev = this.after(line.from);
if (prev && i == chain.length - 1) {
// Only adjust if the cursor is after the unchanged part of
// the line.
for (var match = 0; match < cursor.offset &&
line.text.charAt(match) == prev.text.charAt(match); match++){}
if (cursor.offset > match)
cursordiff = line.text.length - prev.text.length;
}
select.setCursorPos(this.container, {node: line.from, offset: Math.max(0, cursor.offset + cursordiff)});
}
// Cursor was in removed line, this is last new line.
else if (cursor && (i == chain.length - 1) && cursor.node && cursor.node.parentNode != this.container) {
select.setCursorPos(this.container, {node: line.from, offset: line.text.length});
}
}
// Anchor the chain in the DOM tree.
this.linkChain(chain);
return start;
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/undo.js | JavaScript | gpl3 | 14,916 |
/* Parse function for JavaScript. Makes use of the tokenizer from
* tokenizejavascript.js. Note that your parsers do not have to be
* this complicated -- if you don't want to recognize local variables,
* in many languages it is enough to just look for braces, semicolons,
* parentheses, etc, and know when you are inside a string or comment.
*
* See manual.html for more info about the parser interface.
*/
var JSParser = Editor.Parser = (function() {
// Token types that can be considered to be atoms.
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
// Setting that can be used to have JSON data indent properly.
var json = false;
// Constructor for the lexical context objects.
function JSLexical(indented, column, type, align, prev, info) {
// indentation at start of this line
this.indented = indented;
// column at which this scope was opened
this.column = column;
// type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(')
this.type = type;
// '[', '{', or '(' blocks that have any text after their opening
// character are said to be 'aligned' -- any lines below are
// indented all the way to the opening character.
if (align != null)
this.align = align;
// Parent scope, if any.
this.prev = prev;
this.info = info;
}
// My favourite JavaScript indentation rules.
function indentJS(lexical) {
return function(firstChars) {
var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
var closing = firstChar == type;
if (type == "vardef")
return lexical.indented + 4;
else if (type == "form" && firstChar == "{")
return lexical.indented;
else if (type == "stat" || type == "form")
return lexical.indented + indentUnit;
else if (lexical.info == "switch" && !closing)
return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
else if (lexical.align)
return lexical.column - (closing ? 1 : 0);
else
return lexical.indented + (closing ? 0 : indentUnit);
};
}
// The parser-iterator-producing function itself.
function parseJS(input, basecolumn) {
// Wrap the input in a token stream
var tokens = tokenizeJavaScript(input);
// The parser state. cc is a stack of actions that have to be
// performed to finish the current statement. For example we might
// know that we still need to find a closing parenthesis and a
// semicolon. Actions at the end of the stack go first. It is
// initialized with an infinitely looping action that consumes
// whole statements.
var cc = [json ? expressions : statements];
// Context contains information about the current local scope, the
// variables defined in that, and the scopes above it.
var context = null;
// The lexical scope, used mostly for indentation.
var lexical = new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false);
// Current column, and the indentation at the start of the current
// line. Used to create lexical scope objects.
var column = 0;
var indented = 0;
// Variables which are used by the mark, cont, and pass functions
// below to communicate with the driver loop in the 'next'
// function.
var consume, marked;
// The iterator object.
var parser = {next: next, copy: copy};
function next(){
// Start by performing any 'lexical' actions (adjusting the
// lexical variable), or the operations below will be working
// with the wrong lexical state.
while(cc[cc.length - 1].lex)
cc.pop()();
// Fetch a token.
var token = tokens.next();
// Adjust column and indented.
if (token.type == "whitespace" && column == 0)
indented = token.value.length;
column += token.value.length;
if (token.content == "\n"){
indented = column = 0;
// If the lexical scope's align property is still undefined at
// the end of the line, it is an un-aligned scope.
if (!("align" in lexical))
lexical.align = false;
// Newline tokens get an indentation function associated with
// them.
token.indentation = indentJS(lexical);
}
// No more processing for meaningless tokens.
if (token.type == "whitespace" || token.type == "comment")
return token;
// When a meaningful token is found and the lexical scope's
// align is undefined, it is an aligned scope.
if (!("align" in lexical))
lexical.align = true;
// Execute actions until one 'consumes' the token and we can
// return it.
while(true) {
consume = marked = false;
// Take and execute the topmost action.
cc.pop()(token.type, token.content);
if (consume){
// Marked is used to change the style of the current token.
if (marked)
token.style = marked;
// Here we differentiate between local and global variables.
else if (token.type == "variable" && inScope(token.content))
token.style = "js-localvariable";
return token;
}
}
}
// This makes a copy of the parser state. It stores all the
// stateful variables in a closure, and returns a function that
// will restore them when called with a new input stream. Note
// that the cc array has to be copied, because it is contantly
// being modified. Lexical objects are not mutated, and context
// objects are not mutated in a harmful way, so they can be shared
// between runs of the parser.
function copy(){
var _context = context, _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
return function copyParser(input){
context = _context;
lexical = _lexical;
cc = _cc.concat([]); // copies the array
column = indented = 0;
tokens = tokenizeJavaScript(input, _tokenState);
return parser;
};
}
// Helper function for pushing a number of actions onto the cc
// stack in reverse order.
function push(fs){
for (var i = fs.length - 1; i >= 0; i--)
cc.push(fs[i]);
}
// cont and pass are used by the action functions to add other
// actions to the stack. cont will cause the current token to be
// consumed, pass will leave it for the next action.
function cont(){
push(arguments);
consume = true;
}
function pass(){
push(arguments);
consume = false;
}
// Used to change the style of the current token.
function mark(style){
marked = style;
}
// Push a new scope. Will automatically link the current scope.
function pushcontext(){
context = {prev: context, vars: {"this": true, "arguments": true}};
}
// Pop off the current scope.
function popcontext(){
context = context.prev;
}
// Register a variable in the current scope.
function register(varname){
if (context){
mark("js-variabledef");
context.vars[varname] = true;
}
}
// Check whether a variable is defined in the current scope.
function inScope(varname){
var cursor = context;
while (cursor) {
if (cursor.vars[varname])
return true;
cursor = cursor.prev;
}
return false;
}
// Push a new lexical context of the given type.
function pushlex(type, info) {
var result = function(){
lexical = new JSLexical(indented, column, type, null, lexical, info)
};
result.lex = true;
return result;
}
// Pop off the current lexical context.
function poplex(){
if (lexical.type == ")")
indented = lexical.indented;
lexical = lexical.prev;
}
poplex.lex = true;
// The 'lex' flag on these actions is used by the 'next' function
// to know they can (and have to) be ran before moving on to the
// next token.
// Creates an action that discards tokens until it finds one of
// the given type.
function expect(wanted){
return function expecting(type){
if (type == wanted) cont();
else if (wanted == ";") pass();
else cont(arguments.callee);
};
}
// Looks for a statement, and then calls itself.
function statements(type){
return pass(statement, statements);
}
function expressions(type){
return pass(expression, expressions);
}
// Dispatches various types of statements based on the type of the
// current token.
function statement(type){
if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex);
else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex);
else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
else if (type == "{") cont(pushlex("}"), block, poplex);
else if (type == ";") cont();
else if (type == "function") cont(functiondef);
else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
else if (type == "variable") cont(pushlex("stat"), maybelabel);
else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex);
else if (type == "case") cont(expression, expect(":"));
else if (type == "default") cont(expect(":"));
else if (type == "catch") cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext);
else pass(pushlex("stat"), expression, expect(";"), poplex);
}
// Dispatch expression types.
function expression(type){
if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
else if (type == "function") cont(functiondef);
else if (type == "keyword c") cont(expression);
else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
else if (type == "operator") cont(expression);
else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
else cont();
}
// Called for places where operators, function calls, or
// subscripts are valid. Will skip on to the next action if none
// is found.
function maybeoperator(type, value){
if (type == "operator" && /\+\+|--/.test(value)) cont(maybeoperator);
else if (type == "operator") cont(expression);
else if (type == ";") pass();
else if (type == "(") cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
else if (type == ".") cont(property, maybeoperator);
else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
}
// When a statement starts with a variable name, it might be a
// label. If no colon follows, it's a regular statement.
function maybelabel(type){
if (type == ":") cont(poplex, statement);
else pass(maybeoperator, expect(";"), poplex);
}
// Property names need to have their style adjusted -- the
// tokenizer thinks they are variables.
function property(type){
if (type == "variable") {mark("js-property"); cont();}
}
// This parses a property and its value in an object literal.
function objprop(type){
if (type == "variable") mark("js-property");
if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
}
// Parses a comma-separated list of the things that are recognized
// by the 'what' argument.
function commasep(what, end){
function proceed(type) {
if (type == ",") cont(what, proceed);
else if (type == end) cont();
else cont(expect(end));
}
return function commaSeparated(type) {
if (type == end) cont();
else pass(what, proceed);
};
}
// Look for statements until a closing brace is found.
function block(type){
if (type == "}") cont();
else pass(statement, block);
}
// Variable definitions are split into two actions -- 1 looks for
// a name or the end of the definition, 2 looks for an '=' sign or
// a comma.
function vardef1(type, value){
if (type == "variable"){register(value); cont(vardef2);}
else cont();
}
function vardef2(type, value){
if (value == "=") cont(expression, vardef2);
else if (type == ",") cont(vardef1);
}
// For loops.
function forspec1(type){
if (type == "var") cont(vardef1, forspec2);
else if (type == ";") pass(forspec2);
else if (type == "variable") cont(formaybein);
else pass(forspec2);
}
function formaybein(type, value){
if (value == "in") cont(expression);
else cont(maybeoperator, forspec2);
}
function forspec2(type, value){
if (type == ";") cont(forspec3);
else if (value == "in") cont(expression);
else cont(expression, expect(";"), forspec3);
}
function forspec3(type) {
if (type == ")") pass();
else cont(expression);
}
// A function definition creates a new context, and the variables
// in its argument list have to be added to this context.
function functiondef(type, value){
if (type == "variable"){register(value); cont(functiondef);}
else if (type == "(") cont(pushcontext, commasep(funarg, ")"), statement, popcontext);
}
function funarg(type, value){
if (type == "variable"){register(value); cont();}
}
return parser;
}
return {
make: parseJS,
electricChars: "{}:",
configure: function(obj) {
if (obj.json != null) json = obj.json;
}
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/parsejavascript.js | JavaScript | gpl3 | 14,294 |
var DummyParser = Editor.Parser = (function() {
function tokenizeDummy(source) {
while (!source.endOfLine()) source.next();
return "text";
}
function parseDummy(source) {
function indentTo(n) {return function() {return n;}}
source = tokenizer(source, tokenizeDummy);
var space = 0;
var iter = {
next: function() {
var tok = source.next();
if (tok.type == "whitespace") {
if (tok.value == "\n") tok.indentation = indentTo(space);
else space = tok.value.length;
}
return tok;
},
copy: function() {
var _space = space;
return function(_source) {
space = _space;
source = tokenizer(_source, tokenizeDummy);
return iter;
};
}
};
return iter;
}
return {make: parseDummy};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/js/parsedummy.js | JavaScript | gpl3 | 880 |
/* Tokenizer for CSharp code */
var tokenizeCSharp = (function() {
// Advance the stream until the given character (not preceded by a
// backslash) is encountered, or the end of the line is reached.
function nextUntilUnescaped(source, end) {
var escaped = false;
var next;
while (!source.endOfLine()) {
var next = source.next();
if (next == end && !escaped)
return false;
escaped = !escaped && next == "\\";
}
return escaped;
}
// A map of JavaScript's keywords. The a/b/c keyword distinction is
// very rough, but it gives the parser enough information to parse
// correct code correctly (we don't care that much how we parse
// incorrect code). The style information included in these objects
// is used by the highlighter to pick the correct CSS style for a
// token.
var keywords = function(){
function result(type, style){
return {type: type, style: "csharp-" + style};
}
// keywords that take a parenthised expression, and then a
// statement (if)
var keywordA = result("keyword a", "keyword");
// keywords that take just a statement (else)
var keywordB = result("keyword b", "keyword");
// keywords that optionally take an expression, and form a
// statement (return)
var keywordC = result("keyword c", "keyword");
var operator = result("operator", "keyword");
var atom = result("atom", "atom");
// just a keyword with no indentation implications
var keywordD = result("keyword d", "keyword");
return {
"if": keywordA, "while": keywordA, "with": keywordA,
"else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB,
"return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "delete": keywordC, "throw": keywordC,
"in": operator, "typeof": operator, "instanceof": operator,
"var": result("var", "keyword"), "function": result("function", "keyword"), "catch": result("catch", "keyword"),
"for": result("for", "keyword"), "switch": result("switch", "keyword"),
"case": result("case", "keyword"), "default": result("default", "keyword"),
"true": atom, "false": atom, "null": atom,
"class": result("class", "keyword"), "namespace": result("class", "keyword"),
"public": keywordD, "private": keywordD, "protected": keywordD, "internal": keywordD,
"extern": keywordD, "override": keywordD, "virtual": keywordD, "abstract": keywordD,
"static": keywordD, "out": keywordD, "ref": keywordD, "const": keywordD,
"foreach": result("for", "keyword"), "using": keywordC,
"int": keywordD, "double": keywordD, "long": keywordD, "bool": keywordD, "char": keywordD,
"void": keywordD, "string": keywordD, "byte": keywordD, "sbyte": keywordD, "decimal": keywordD,
"float": keywordD, "uint": keywordD, "ulong": keywordD, "object": keywordD,
"short": keywordD, "ushort": keywordD,
"get": keywordD, "set": keywordD, "value": keywordD
};
}();
// Some helper regexps
var isOperatorChar = /[+\-*&%=<>!?|]/;
var isHexDigit = /[0-9A-Fa-f]/;
var isWordChar = /[\w\$_]/;
// Wrapper around jsToken that helps maintain parser state (whether
// we are inside of a multi-line comment and whether the next token
// could be a regular expression).
function jsTokenState(inside, regexp) {
return function(source, setState) {
var newInside = inside;
var type = jsToken(inside, regexp, source, function(c) {newInside = c;});
var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/);
if (newRegexp != regexp || newInside != inside)
setState(jsTokenState(newInside, newRegexp));
return type;
};
}
// The token reader, inteded to be used by the tokenizer from
// tokenize.js (through jsTokenState). Advances the source stream
// over a token, and returns an object containing the type and style
// of that token.
function jsToken(inside, regexp, source, setInside) {
function readHexNumber(){
source.next(); // skip the 'x'
source.nextWhileMatches(isHexDigit);
return {type: "number", style: "csharp-atom"};
}
function readNumber() {
source.nextWhileMatches(/[0-9]/);
if (source.equals(".")){
source.next();
source.nextWhileMatches(/[0-9]/);
}
if (source.equals("e") || source.equals("E")){
source.next();
if (source.equals("-"))
source.next();
source.nextWhileMatches(/[0-9]/);
}
return {type: "number", style: "csharp-atom"};
}
// Read a word, look it up in keywords. If not found, it is a
// variable, otherwise it is a keyword of the type found.
function readWord() {
source.nextWhileMatches(isWordChar);
var word = source.get();
var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
return known ? {type: known.type, style: known.style, content: word} :
{type: "variable", style: "csharp-variable", content: word};
}
function readRegexp() {
nextUntilUnescaped(source, "/");
source.nextWhileMatches(/[gi]/);
return {type: "regexp", style: "csharp-string"};
}
// Mutli-line comments are tricky. We want to return the newlines
// embedded in them as regular newline tokens, and then continue
// returning a comment token for every line of the comment. So
// some state has to be saved (inside) to indicate whether we are
// inside a /* */ sequence.
function readMultilineComment(start){
var newInside = "/*";
var maybeEnd = (start == "*");
while (true) {
if (source.endOfLine())
break;
var next = source.next();
if (next == "/" && maybeEnd){
newInside = null;
break;
}
maybeEnd = (next == "*");
}
setInside(newInside);
return {type: "comment", style: "csharp-comment"};
}
function readOperator() {
source.nextWhileMatches(isOperatorChar);
return {type: "operator", style: "csharp-operator"};
}
function readString(quote) {
var endBackSlash = nextUntilUnescaped(source, quote);
setInside(endBackSlash ? quote : null);
return {type: "string", style: "csharp-string"};
}
// Fetch the next token. Dispatches on first character in the
// stream, or first two characters when the first is a slash.
if (inside == "\"" || inside == "'")
return readString(inside);
var ch = source.next();
if (inside == "/*")
return readMultilineComment(ch);
else if (ch == "\"" || ch == "'")
return readString(ch);
// with punctuation, the type of the token is the symbol itself
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
return {type: ch, style: "csharp-punctuation"};
else if (ch == "0" && (source.equals("x") || source.equals("X")))
return readHexNumber();
else if (/[0-9]/.test(ch))
return readNumber();
else if (ch == "/"){
if (source.equals("*"))
{ source.next(); return readMultilineComment(ch); }
else if (source.equals("/"))
{ nextUntilUnescaped(source, null); return {type: "comment", style: "csharp-comment"};}
else if (regexp)
return readRegexp();
else
return readOperator();
}
else if (ch == "#") { // treat c# regions like comments
nextUntilUnescaped(source, null); return {type: "comment", style: "csharp-comment"};
}
else if (isOperatorChar.test(ch))
return readOperator();
else
return readWord();
}
// The external interface to the tokenizer.
return function(source, startState) {
return tokenizer(source, startState || jsTokenState(false, true));
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/csharp/js/tokenizecsharp.js | JavaScript | gpl3 | 8,028 |
/* Parse function for JavaScript. Makes use of the tokenizer from
* tokenizecsharp.js. Note that your parsers do not have to be
* this complicated -- if you don't want to recognize local variables,
* in many languages it is enough to just look for braces, semicolons,
* parentheses, etc, and know when you are inside a string or comment.
*
* See manual.html for more info about the parser interface.
*/
var JSParser = Editor.Parser = (function() {
// Token types that can be considered to be atoms.
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
// Setting that can be used to have JSON data indent properly.
var json = false;
// Constructor for the lexical context objects.
function CSharpLexical(indented, column, type, align, prev, info) {
// indentation at start of this line
this.indented = indented;
// column at which this scope was opened
this.column = column;
// type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(')
this.type = type;
// '[', '{', or '(' blocks that have any text after their opening
// character are said to be 'aligned' -- any lines below are
// indented all the way to the opening character.
if (align != null)
this.align = align;
// Parent scope, if any.
this.prev = prev;
this.info = info;
}
// CSharp indentation rules.
function indentCSharp(lexical) {
return function(firstChars) {
var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
var closing = firstChar == type;
if (type == "vardef")
return lexical.indented + 4;
else if (type == "form" && firstChar == "{")
return lexical.indented;
else if (type == "stat" || type == "form")
return lexical.indented + indentUnit;
else if (lexical.info == "switch" && !closing)
return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
else if (lexical.align)
return lexical.column - (closing ? 1 : 0);
else
return lexical.indented + (closing ? 0 : indentUnit);
};
}
// The parser-iterator-producing function itself.
function parseCSharp(input, basecolumn) {
// Wrap the input in a token stream
var tokens = tokenizeCSharp(input);
// The parser state. cc is a stack of actions that have to be
// performed to finish the current statement. For example we might
// know that we still need to find a closing parenthesis and a
// semicolon. Actions at the end of the stack go first. It is
// initialized with an infinitely looping action that consumes
// whole statements.
var cc = [statements];
// The lexical scope, used mostly for indentation.
var lexical = new CSharpLexical((basecolumn || 0) - indentUnit, 0, "block", false);
// Current column, and the indentation at the start of the current
// line. Used to create lexical scope objects.
var column = 0;
var indented = 0;
// Variables which are used by the mark, cont, and pass functions
// below to communicate with the driver loop in the 'next'
// function.
var consume, marked;
// The iterator object.
var parser = {next: next, copy: copy};
function next(){
// Start by performing any 'lexical' actions (adjusting the
// lexical variable), or the operations below will be working
// with the wrong lexical state.
while(cc[cc.length - 1].lex)
cc.pop()();
// Fetch a token.
var token = tokens.next();
// Adjust column and indented.
if (token.type == "whitespace" && column == 0)
indented = token.value.length;
column += token.value.length;
if (token.content == "\n"){
indented = column = 0;
// If the lexical scope's align property is still undefined at
// the end of the line, it is an un-aligned scope.
if (!("align" in lexical))
lexical.align = false;
// Newline tokens get an indentation function associated with
// them.
token.indentation = indentCSharp(lexical);
}
// No more processing for meaningless tokens.
if (token.type == "whitespace" || token.type == "comment")
return token;
// When a meaningful token is found and the lexical scope's
// align is undefined, it is an aligned scope.
if (!("align" in lexical))
lexical.align = true;
// Execute actions until one 'consumes' the token and we can
// return it.
while(true) {
consume = marked = false;
// Take and execute the topmost action.
cc.pop()(token.type, token.content);
if (consume){
// Marked is used to change the style of the current token.
if (marked)
token.style = marked;
return token;
}
}
}
// This makes a copy of the parser state. It stores all the
// stateful variables in a closure, and returns a function that
// will restore them when called with a new input stream. Note
// that the cc array has to be copied, because it is contantly
// being modified. Lexical objects are not mutated, and context
// objects are not mutated in a harmful way, so they can be shared
// between runs of the parser.
function copy(){
var _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
return function copyParser(input){
lexical = _lexical;
cc = _cc.concat([]); // copies the array
column = indented = 0;
tokens = tokenizeCSharp(input, _tokenState);
return parser;
};
}
// Helper function for pushing a number of actions onto the cc
// stack in reverse order.
function push(fs){
for (var i = fs.length - 1; i >= 0; i--)
cc.push(fs[i]);
}
// cont and pass are used by the action functions to add other
// actions to the stack. cont will cause the current token to be
// consumed, pass will leave it for the next action.
function cont(){
push(arguments);
consume = true;
}
function pass(){
push(arguments);
consume = false;
}
// Used to change the style of the current token.
function mark(style){
marked = style;
}
// Push a new lexical context of the given type.
function pushlex(type, info) {
var result = function(){
lexical = new CSharpLexical(indented, column, type, null, lexical, info)
};
result.lex = true;
return result;
}
// Pop off the current lexical context.
function poplex(){
lexical = lexical.prev;
}
poplex.lex = true;
// The 'lex' flag on these actions is used by the 'next' function
// to know they can (and have to) be ran before moving on to the
// next token.
// Creates an action that discards tokens until it finds one of
// the given type.
function expect(wanted){
return function expecting(type){
if (type == wanted) cont();
else cont(arguments.callee);
};
}
// Looks for a statement, and then calls itself.
function statements(type){
return pass(statement, statements);
}
// Dispatches various types of statements based on the type of the
// current token.
function statement(type){
if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex);
else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex);
else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
else if (type == "{" && json) cont(pushlex("}"), commasep(objprop, "}"), poplex);
else if (type == "{") cont(pushlex("}"), block, poplex);
else if (type == "function") cont(functiondef);
else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
else if (type == "variable") cont(pushlex("stat"), maybelabel);
else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex);
else if (type == "case") cont(expression, expect(":"));
else if (type == "default") cont(expect(":"));
else if (type == "catch") cont(pushlex("form"), expect("("), funarg, expect(")"), statement, poplex);
else if (type == "class") cont(classdef);
else if (type == "keyword d") cont(statement);
else pass(pushlex("stat"), expression, expect(";"), poplex);
}
// Dispatch expression types.
function expression(type){
if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
else if (type == "function") cont(functiondef);
else if (type == "keyword c") cont(expression);
else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
else if (type == "operator") cont(expression);
else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
}
// Called for places where operators, function calls, or
// subscripts are valid. Will skip on to the next action if none
// is found.
function maybeoperator(type){
if (type == "operator") cont(expression);
else if (type == "(") cont(pushlex(")"), expression, commasep(expression, ")"), poplex, maybeoperator);
else if (type == ".") cont(property, maybeoperator);
else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
}
// When a statement starts with a variable name, it might be a
// label. If no colon follows, it's a regular statement.
function maybelabel(type){
if (type == ":") cont(poplex, statement);
else if (type == "(") cont(commasep(funarg, ")"), poplex, statement); // method definition
else if (type == "{") cont(poplex, pushlex("}"), block, poplex); // property definition
else pass(maybeoperator, expect(";"), poplex);
}
// Property names need to have their style adjusted -- the
// tokenizer thinks they are variables.
function property(type){
if (type == "variable") {mark("csharp-property"); cont();}
}
// This parses a property and its value in an object literal.
function objprop(type){
if (type == "variable") mark("csharp-property");
if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
}
// Parses a comma-separated list of the things that are recognized
// by the 'what' argument.
function commasep(what, end){
function proceed(type) {
if (type == ",") cont(what, proceed);
else if (type == end) cont();
else cont(expect(end));
};
return function commaSeparated(type) {
if (type == end) cont();
else pass(what, proceed);
};
}
// Look for statements until a closing brace is found.
function block(type){
if (type == "}") cont();
else pass(statement, block);
}
// Variable definitions are split into two actions -- 1 looks for
// a name or the end of the definition, 2 looks for an '=' sign or
// a comma.
function vardef1(type, value){
if (type == "variable"){cont(vardef2);}
else cont();
}
function vardef2(type, value){
if (value == "=") cont(expression, vardef2);
else if (type == ",") cont(vardef1);
}
// For loops.
function forspec1(type){
if (type == "var") cont(vardef1, forspec2);
else if (type == "keyword d") cont(vardef1, forspec2);
else if (type == ";") pass(forspec2);
else if (type == "variable") cont(formaybein);
else pass(forspec2);
}
function formaybein(type, value){
if (value == "in") cont(expression);
else cont(maybeoperator, forspec2);
}
function forspec2(type, value){
if (type == ";") cont(forspec3);
else if (value == "in") cont(expression);
else cont(expression, expect(";"), forspec3);
}
function forspec3(type) {
if (type == ")") pass();
else cont(expression);
}
// A function definition creates a new context, and the variables
// in its argument list have to be added to this context.
function functiondef(type, value){
if (type == "variable") cont(functiondef);
else if (type == "(") cont(commasep(funarg, ")"), statement);
}
function funarg(type, value){
if (type == "variable"){cont();}
}
function classdef(type) {
if (type == "variable") cont(classdef, statement);
else if (type == ":") cont(classdef, statement);
}
return parser;
}
return {
make: parseCSharp,
electricChars: "{}:",
configure: function(obj) {
if (obj.json != null) json = obj.json;
}
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/csharp/js/parsecsharp.js | JavaScript | gpl3 | 13,271 |
html {
cursor: text;
}
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
pre.code, .editbox {
color: #666666;
}
.editbox p {
margin: 0;
}
span.csharp-punctuation {
color: green;
}
span.csharp-operator {
color: purple;
}
span.csharp-keyword {
color: blue;
}
span.csharp-atom {
color: brown;
}
span.csharp-variable {
color: black;
}
span.csharp-variabledef {
color: #0000FF;
}
span.csharp-localvariable {
color: #004499;
}
span.csharp-property {
color: black;
}
span.csharp-comment {
color: green;
}
span.csharp-string {
color: red;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/csharp/css/csharpcolors.css | CSS | gpl3 | 685 |
/*
Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
The copyrights embodied in the content of this file are licensed by
Yahoo! Inc. under the BSD (revised) open source license
@author Dan Vlad Dascalescu <dandv@yahoo-inc.com>
Parse function for PHP. Makes use of the tokenizer from tokenizephp.js.
Based on parsejavascript.js by Marijn Haverbeke.
Features:
+ special "deprecated" style for PHP4 keywords like 'var'
+ support for PHP 5.3 keywords: 'namespace', 'use'
+ 911 predefined constants, 1301 predefined functions, 105 predeclared classes
from a typical PHP installation in a LAMP environment
+ new feature: syntax error flagging, thus enabling strict parsing of:
+ function definitions with explicitly or implicitly typed arguments and default values
+ modifiers (public, static etc.) applied to method and member definitions
+ foreach(array_expression as $key [=> $value]) loops
+ differentiation between single-quoted strings and double-quoted interpolating strings
*/
// add the Array.indexOf method for JS engines that don't support it (e.g. IE)
// code from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array/IndexOf
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length;
var from = Number(arguments[1]) || 0;
from = (from < 0)
? Math.ceil(from)
: Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this &&
this[from] === elt)
return from;
}
return -1;
};
}
var PHPParser = Editor.Parser = (function() {
// Token types that can be considered to be atoms, part of operator expressions
var atomicTypes = {
"atom": true, "number": true, "variable": true, "string": true
};
// Constructor for the lexical context objects.
function PHPLexical(indented, column, type, align, prev, info) {
// indentation at start of this line
this.indented = indented;
// column at which this scope was opened
this.column = column;
// type of scope ('stat' (statement), 'form' (special form), '[', '{', or '(')
this.type = type;
// '[', '{', or '(' blocks that have any text after their opening
// character are said to be 'aligned' -- any lines below are
// indented all the way to the opening character.
if (align != null)
this.align = align;
// Parent scope, if any.
this.prev = prev;
this.info = info;
}
// PHP indentation rules
function indentPHP(lexical) {
return function(firstChars) {
var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
var closing = firstChar == type;
if (type == "form" && firstChar == "{")
return lexical.indented;
else if (type == "stat" || type == "form")
return lexical.indented + indentUnit;
else if (lexical.info == "switch" && !closing)
return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
else if (lexical.align)
return lexical.column - (closing ? 1 : 0);
else
return lexical.indented + (closing ? 0 : indentUnit);
};
}
// The parser-iterator-producing function itself.
function parsePHP(input, basecolumn) {
// Wrap the input in a token stream
var tokens = tokenizePHP(input);
// The parser state. cc is a stack of actions that have to be
// performed to finish the current statement. For example we might
// know that we still need to find a closing parenthesis and a
// semicolon. Actions at the end of the stack go first. It is
// initialized with an infinitely looping action that consumes
// whole statements.
var cc = [statements];
// The lexical scope, used mostly for indentation.
var lexical = new PHPLexical((basecolumn || 0) - indentUnit, 0, "block", false);
// Current column, and the indentation at the start of the current
// line. Used to create lexical scope objects.
var column = 0;
var indented = 0;
// Variables which are used by the mark, cont, and pass functions
// below to communicate with the driver loop in the 'next' function.
var consume, marked;
// The iterator object.
var parser = {next: next, copy: copy};
// parsing is accomplished by calling next() repeatedly
function next(){
// Start by performing any 'lexical' actions (adjusting the
// lexical variable), or the operations below will be working
// with the wrong lexical state.
while(cc[cc.length - 1].lex)
cc.pop()();
// Fetch the next token.
var token = tokens.next();
// Adjust column and indented.
if (token.type == "whitespace" && column == 0)
indented = token.value.length;
column += token.value.length;
if (token.content == "\n"){
indented = column = 0;
// If the lexical scope's align property is still undefined at
// the end of the line, it is an un-aligned scope.
if (!("align" in lexical))
lexical.align = false;
// Newline tokens get an indentation function associated with
// them.
token.indentation = indentPHP(lexical);
}
// No more processing for meaningless tokens.
if (token.type == "whitespace" || token.type == "comment"
|| token.type == "string_not_terminated" )
return token;
// When a meaningful token is found and the lexical scope's
// align is undefined, it is an aligned scope.
if (!("align" in lexical))
lexical.align = true;
// Execute actions until one 'consumes' the token and we can
// return it. 'marked' is used to change the style of the current token.
while(true) {
consume = marked = false;
// Take and execute the topmost action.
var action = cc.pop();
action(token);
if (consume){
if (marked)
token.style = marked;
// Here we differentiate between local and global variables.
return token;
}
}
return 1; // Firebug workaround for http://code.google.com/p/fbug/issues/detail?id=1239#c1
}
// This makes a copy of the parser state. It stores all the
// stateful variables in a closure, and returns a function that
// will restore them when called with a new input stream. Note
// that the cc array has to be copied, because it is contantly
// being modified. Lexical objects are not mutated, so they can
// be shared between runs of the parser.
function copy(){
var _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
return function copyParser(input){
lexical = _lexical;
cc = _cc.concat([]); // copies the array
column = indented = 0;
tokens = tokenizePHP(input, _tokenState);
return parser;
};
}
// Helper function for pushing a number of actions onto the cc
// stack in reverse order.
function push(fs){
for (var i = fs.length - 1; i >= 0; i--)
cc.push(fs[i]);
}
// cont and pass are used by the action functions to add other
// actions to the stack. cont will cause the current token to be
// consumed, pass will leave it for the next action.
function cont(){
push(arguments);
consume = true;
}
function pass(){
push(arguments);
consume = false;
}
// Used to change the style of the current token.
function mark(style){
marked = style;
}
// Add a lyer of style to the current token, for example syntax-error
function mark_add(style){
marked = marked + ' ' + style;
}
// Push a new lexical context of the given type.
function pushlex(type, info) {
var result = function pushlexing() {
lexical = new PHPLexical(indented, column, type, null, lexical, info)
};
result.lex = true;
return result;
}
// Pop off the current lexical context.
function poplex(){
if (lexical.prev)
lexical = lexical.prev;
}
poplex.lex = true;
// The 'lex' flag on these actions is used by the 'next' function
// to know they can (and have to) be ran before moving on to the
// next token.
// Creates an action that discards tokens until it finds one of
// the given type. This will ignore (and recover from) syntax errors.
function expect(wanted){
return function expecting(token){
if (token.type == wanted) cont(); // consume the token
else {
cont(arguments.callee); // continue expecting() - call itself
}
};
}
// Require a specific token type, or one of the tokens passed in the 'wanted' array
// Used to detect blatant syntax errors. 'execute' is used to pass extra code
// to be executed if the token is matched. For example, a '(' match could
// 'execute' a cont( compasep(funcarg), require(")") )
function require(wanted, execute){
return function requiring(token){
var ok;
var type = token.type;
if (typeof(wanted) == "string")
ok = (type == wanted) -1;
else
ok = wanted.indexOf(type);
if (ok >= 0) {
if (execute && typeof(execute[ok]) == "function") pass(execute[ok]);
else cont();
}
else {
if (!marked) mark(token.style);
mark_add("syntax-error");
cont(arguments.callee);
}
};
}
// Looks for a statement, and then calls itself.
function statements(token){
return pass(statement, statements);
}
// Dispatches various types of statements based on the type of the current token.
function statement(token){
var type = token.type;
if (type == "keyword a") cont(pushlex("form"), expression, altsyntax, statement, poplex);
else if (type == "keyword b") cont(pushlex("form"), altsyntax, statement, poplex);
else if (type == "{") cont(pushlex("}"), block, poplex);
else if (type == "function") funcdef();
// technically, "class implode {...}" is correct, but we'll flag that as an error because it overrides a predefined function
else if (type == "class") classdef();
else if (type == "foreach") cont(pushlex("form"), require("("), pushlex(")"), expression, require("as"), require("variable"), /* => $value */ expect(")"), altsyntax, poplex, statement, poplex);
else if (type == "for") cont(pushlex("form"), require("("), pushlex(")"), expression, require(";"), expression, require(";"), expression, require(")"), altsyntax, poplex, statement, poplex);
// public final function foo(), protected static $bar;
else if (type == "modifier") cont(require(["modifier", "variable", "function", "abstract"],
[null, commasep(require("variable")), funcdef, absfun]));
else if (type == "abstract") abs();
else if (type == "switch") cont(pushlex("form"), require("("), expression, require(")"), pushlex("}", "switch"), require([":", "{"]), block, poplex, poplex);
else if (type == "case") cont(expression, require(":"));
else if (type == "default") cont(require(":"));
else if (type == "catch") cont(pushlex("form"), require("("), require("t_string"), require("variable"), require(")"), statement, poplex);
else if (type == "const") cont(require("t_string")); // 'const static x=5' is a syntax error
// technically, "namespace implode {...}" is correct, but we'll flag that as an error because it overrides a predefined function
else if (type == "namespace") cont(namespacedef, require(";"));
// $variables may be followed by operators, () for variable function calls, or [] subscripts
else pass(pushlex("stat"), expression, require(";"), poplex);
}
// Dispatch expression types.
function expression(token){
var type = token.type;
if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
else if (type == "<<<") cont(require("string"), maybeoperator); // heredoc/nowdoc
else if (type == "t_string") cont(maybe_double_colon, maybeoperator);
else if (type == "keyword c" || type == "operator") cont(expression);
// lambda
else if (type == "function") lambdadef();
// function call or parenthesized expression: $a = ($b + 1) * 2;
else if (type == "(") cont(pushlex(")"), commasep(expression), require(")"), poplex, maybeoperator);
}
// Called for places where operators, function calls, or subscripts are
// valid. Will skip on to the next action if none is found.
function maybeoperator(token){
var type = token.type;
if (type == "operator") {
if (token.content == "?") cont(expression, require(":"), expression); // ternary operator
else cont(expression);
}
else if (type == "(") cont(pushlex(")"), expression, commasep(expression), require(")"), poplex, maybeoperator /* $varfunc() + 3 */);
else if (type == "[") cont(pushlex("]"), expression, require("]"), maybeoperator /* for multidimensional arrays, or $func[$i]() */, poplex);
}
// A regular use of the double colon to specify a class, as in self::func() or myclass::$var;
// Differs from `namespace` or `use` in that only one class can be the parent; chains (A::B::$var) are a syntax error.
function maybe_double_colon(token) {
if (token.type == "t_double_colon")
// A::$var, A::func(), A::const
cont(require(["t_string", "variable"]), maybeoperator);
else {
// a t_string wasn't followed by ::, such as in a function call: foo()
pass(expression)
}
}
// the declaration or definition of a function
function funcdef() {
cont(require("t_string"), require("("), pushlex(")"), commasep(funcarg), require(")"), poplex, block);
}
// the declaration or definition of a lambda
function lambdadef() {
cont(require("("), pushlex(")"), commasep(funcarg), require(")"), maybe_lambda_use, poplex, require("{"), pushlex("}"), block, poplex);
}
// optional lambda 'use' statement
function maybe_lambda_use(token) {
if(token.type == "namespace") {
cont(require('('), commasep(funcarg), require(')'));
}
else {
pass(expression);
}
}
// the definition of a class
function classdef() {
cont(require("t_string"), expect("{"), pushlex("}"), block, poplex);
}
// either funcdef if the current token is "function", or the keyword "function" + funcdef
function absfun(token) {
if(token.type == "function") funcdef();
else cont(require(["function"], [funcdef]));
}
// the abstract class or function (with optional modifier)
function abs(token) {
cont(require(["modifier", "function", "class"], [absfun, funcdef, classdef]));
}
// Parses a comma-separated list of the things that are recognized
// by the 'what' argument.
function commasep(what){
function proceed(token) {
if (token.type == ",") cont(what, proceed);
}
return function commaSeparated() {
pass(what, proceed);
};
}
// Look for statements until a closing brace is found.
function block(token) {
if (token.type == "}") cont();
else pass(statement, block);
}
function empty_parens_if_array(token) {
if(token.content == "array")
cont(require("("), require(")"));
}
function maybedefaultparameter(token){
if (token.content == "=") cont(require(["t_string", "string", "number", "atom"], [empty_parens_if_array, null, null]));
}
function var_or_reference(token) {
if(token.type == "variable") cont(maybedefaultparameter);
else if(token.content == "&") cont(require("variable"), maybedefaultparameter);
}
// support for default arguments: http://us.php.net/manual/en/functions.arguments.php#functions.arguments.default
function funcarg(token){
// function foo(myclass $obj) {...} or function foo(myclass &objref) {...}
if (token.type == "t_string") cont(var_or_reference);
// function foo($var) {...} or function foo(&$ref) {...}
else var_or_reference(token);
}
// A namespace definition or use
function maybe_double_colon_def(token) {
if (token.type == "t_double_colon")
cont(namespacedef);
}
function namespacedef(token) {
pass(require("t_string"), maybe_double_colon_def);
}
function altsyntax(token){
if(token.content==':')
cont(altsyntaxBlock,poplex);
}
function altsyntaxBlock(token){
if (token.type == "altsyntaxend") cont(require(';'));
else pass(statement, altsyntaxBlock);
}
return parser;
}
return {make: parsePHP, electricChars: "{}:"};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/php/js/parsephp.js | JavaScript | gpl3 | 17,353 |
/*
Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
The copyrights embodied in the content of this file are licensed by
Yahoo! Inc. under the BSD (revised) open source license
@author Dan Vlad Dascalescu <dandv@yahoo-inc.com>
Based on parsehtmlmixed.js by Marijn Haverbeke.
*/
var PHPHTMLMixedParser = Editor.Parser = (function() {
var processingInstructions = ["<?php"];
if (!(PHPParser && CSSParser && JSParser && XMLParser))
throw new Error("PHP, CSS, JS, and XML parsers must be loaded for PHP+HTML mixed mode to work.");
XMLParser.configure({useHTMLKludges: true});
function parseMixed(stream) {
var htmlParser = XMLParser.make(stream), localParser = null,
inTag = false, lastAtt = null, phpParserState = null;
var iter = {next: top, copy: copy};
function top() {
var token = htmlParser.next();
if (token.content == "<")
inTag = true;
else if (token.style == "xml-tagname" && inTag === true)
inTag = token.content.toLowerCase();
else if (token.style == "xml-attname")
lastAtt = token.content;
else if (token.type == "xml-processing") {
// see if this opens a PHP block
for (var i = 0; i < processingInstructions.length; i++)
if (processingInstructions[i] == token.content) {
iter.next = local(PHPParser, "?>");
break;
}
}
else if (token.style == "xml-attribute" && token.content == "\"php\"" && inTag == "script" && lastAtt == "language")
inTag = "script/php";
// "xml-processing" tokens are ignored, because they should be handled by a specific local parser
else if (token.content == ">") {
if (inTag == "script/php")
iter.next = local(PHPParser, "</script>");
else if (inTag == "script")
iter.next = local(JSParser, "</script");
else if (inTag == "style")
iter.next = local(CSSParser, "</style");
lastAtt = null;
inTag = false;
}
return token;
}
function local(parser, tag) {
var baseIndent = htmlParser.indentation();
if (parser == PHPParser && phpParserState)
localParser = phpParserState(stream);
else
localParser = parser.make(stream, baseIndent + indentUnit);
return function() {
if (stream.lookAhead(tag, false, false, true)) {
if (parser == PHPParser) phpParserState = localParser.copy();
localParser = null;
iter.next = top;
return top(); // pass the ending tag to the enclosing parser
}
var token = localParser.next();
var lt = token.value.lastIndexOf("<"), sz = Math.min(token.value.length - lt, tag.length);
if (lt != -1 && token.value.slice(lt, lt + sz).toLowerCase() == tag.slice(0, sz) &&
stream.lookAhead(tag.slice(sz), false, false, true)) {
stream.push(token.value.slice(lt));
token.value = token.value.slice(0, lt);
}
if (token.indentation) {
var oldIndent = token.indentation;
token.indentation = function(chars) {
if (chars == "</")
return baseIndent;
else
return oldIndent(chars);
}
}
return token;
};
}
function copy() {
var _html = htmlParser.copy(), _local = localParser && localParser.copy(),
_next = iter.next, _inTag = inTag, _lastAtt = lastAtt, _php = phpParserState;
return function(_stream) {
stream = _stream;
htmlParser = _html(_stream);
localParser = _local && _local(_stream);
phpParserState = _php;
iter.next = _next;
inTag = _inTag;
lastAtt = _lastAtt;
return iter;
};
}
return iter;
}
return {
make: parseMixed,
electricChars: "{}/:",
configure: function(conf) {
if (conf.opening != null) processingInstructions = conf.opening;
}
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/php/js/parsephphtmlmixed.js | JavaScript | gpl3 | 4,100 |
/*
Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
The copyrights embodied in the content of this file are licensed by
Yahoo! Inc. under the BSD (revised) open source license
@author Vlad Dan Dascalescu <dandv@yahoo-inc.com>
Tokenizer for PHP code
References:
+ http://php.net/manual/en/reserved.php
+ http://php.net/tokens
+ get_defined_constants(), get_defined_functions(), get_declared_classes()
executed on a realistic (not vanilla) PHP installation with typical LAMP modules.
Specifically, the PHP bundled with the Uniform Web Server (www.uniformserver.com).
*/
// add the forEach method for JS engines that don't support it (e.g. IE)
// code from https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference:Objects:Array:forEach
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function(fun /*, thisp*/)
{
var len = this.length;
if (typeof fun != "function")
throw new TypeError();
var thisp = arguments[1];
for (var i = 0; i < len; i++)
{
if (i in this)
fun.call(thisp, this[i], i, this);
}
};
}
var tokenizePHP = (function() {
/* A map of PHP's reserved words (keywords, predefined classes, functions and
constants. Each token has a type ('keyword', 'operator' etc.) and a style.
The style corresponds to the CSS span class in phpcolors.css.
Keywords can be of three types:
a - takes an expression and forms a statement - e.g. if
b - takes just a statement - e.g. else
c - takes an optinoal expression, but no statement - e.g. return
This distinction gives the parser enough information to parse
correct code correctly (we don't care that much how we parse
incorrect code).
Reference: http://us.php.net/manual/en/reserved.php
*/
var keywords = function(){
function token(type, style){
return {type: type, style: style};
}
var result = {};
// for each(var element in ["...", "..."]) can pick up elements added to
// Array.prototype, so we'll use the loop structure below. See also
// http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each...in
// keywords that take an expression and form a statement
["if", "elseif", "while", "declare"].forEach(function(element, index, array) {
result[element] = token("keyword a", "php-keyword");
});
// keywords that take just a statement
["do", "else", "try" ].forEach(function(element, index, array) {
result[element] = token("keyword b", "php-keyword");
});
// keywords that take an optional expression, but no statement
["return", "break", "continue", // the expression is optional
"new", "clone", "throw" // the expression is mandatory
].forEach(function(element, index, array) {
result[element] = token("keyword c", "php-keyword");
});
["__CLASS__", "__DIR__", "__FILE__", "__FUNCTION__", "__METHOD__", "__NAMESPACE__"].forEach(function(element, index, array) {
result[element] = token("atom", "php-compile-time-constant");
});
["true", "false", "null"].forEach(function(element, index, array) {
result[element] = token("atom", "php-atom");
});
["and", "or", "xor", "instanceof"].forEach(function(element, index, array) {
result[element] = token("operator", "php-keyword php-operator");
});
["class", "interface"].forEach(function(element, index, array) {
result[element] = token("class", "php-keyword");
});
["namespace", "use", "extends", "implements"].forEach(function(element, index, array) {
result[element] = token("namespace", "php-keyword");
});
// reserved "language constructs"... http://php.net/manual/en/reserved.php
[ "die", "echo", "empty", "exit", "eval", "include", "include_once", "isset",
"list", "require", "require_once", "return", "print", "unset",
"array" // a keyword rather, but mandates a parenthesized parameter list
].forEach(function(element, index, array) {
result[element] = token("t_string", "php-reserved-language-construct");
});
result["switch"] = token("switch", "php-keyword");
result["case"] = token("case", "php-keyword");
result["default"] = token("default", "php-keyword");
result["catch"] = token("catch", "php-keyword");
result["function"] = token("function", "php-keyword");
// http://php.net/manual/en/control-structures.alternative-syntax.php must be followed by a ':'
["endif", "endwhile", "endfor", "endforeach", "endswitch", "enddeclare"].forEach(function(element, index, array) {
result[element] = token("altsyntaxend", "php-keyword");
});
result["const"] = token("const", "php-keyword");
["final", "private", "protected", "public", "global", "static"].forEach(function(element, index, array) {
result[element] = token("modifier", "php-keyword");
});
result["var"] = token("modifier", "php-keyword deprecated");
result["abstract"] = token("abstract", "php-keyword");
result["foreach"] = token("foreach", "php-keyword");
result["as"] = token("as", "php-keyword");
result["for"] = token("for", "php-keyword");
// PHP built-in functions - output of get_defined_functions()["internal"]
[ "zend_version", "func_num_args", "func_get_arg", "func_get_args", "strlen",
"strcmp", "strncmp", "strcasecmp", "strncasecmp", "each", "error_reporting",
"define", "defined", "get_class", "get_parent_class", "method_exists",
"property_exists", "class_exists", "interface_exists", "function_exists",
"get_included_files", "get_required_files", "is_subclass_of", "is_a",
"get_class_vars", "get_object_vars", "get_class_methods", "trigger_error",
"user_error", "set_error_handler", "restore_error_handler",
"set_exception_handler", "restore_exception_handler", "get_declared_classes",
"get_declared_interfaces", "get_defined_functions", "get_defined_vars",
"create_function", "get_resource_type", "get_loaded_extensions",
"extension_loaded", "get_extension_funcs", "get_defined_constants",
"debug_backtrace", "debug_print_backtrace", "bcadd", "bcsub", "bcmul", "bcdiv",
"bcmod", "bcpow", "bcsqrt", "bcscale", "bccomp", "bcpowmod", "jdtogregorian",
"gregoriantojd", "jdtojulian", "juliantojd", "jdtojewish", "jewishtojd",
"jdtofrench", "frenchtojd", "jddayofweek", "jdmonthname", "easter_date",
"easter_days", "unixtojd", "jdtounix", "cal_to_jd", "cal_from_jd",
"cal_days_in_month", "cal_info", "variant_set", "variant_add", "variant_cat",
"variant_sub", "variant_mul", "variant_and", "variant_div", "variant_eqv",
"variant_idiv", "variant_imp", "variant_mod", "variant_or", "variant_pow",
"variant_xor", "variant_abs", "variant_fix", "variant_int", "variant_neg",
"variant_not", "variant_round", "variant_cmp", "variant_date_to_timestamp",
"variant_date_from_timestamp", "variant_get_type", "variant_set_type",
"variant_cast", "com_create_guid", "com_event_sink", "com_print_typeinfo",
"com_message_pump", "com_load_typelib", "com_get_active_object", "ctype_alnum",
"ctype_alpha", "ctype_cntrl", "ctype_digit", "ctype_lower", "ctype_graph",
"ctype_print", "ctype_punct", "ctype_space", "ctype_upper", "ctype_xdigit",
"strtotime", "date", "idate", "gmdate", "mktime", "gmmktime", "checkdate",
"strftime", "gmstrftime", "time", "localtime", "getdate", "date_create",
"date_parse", "date_format", "date_modify", "date_timezone_get",
"date_timezone_set", "date_offset_get", "date_time_set", "date_date_set",
"date_isodate_set", "timezone_open", "timezone_name_get",
"timezone_name_from_abbr", "timezone_offset_get", "timezone_transitions_get",
"timezone_identifiers_list", "timezone_abbreviations_list",
"date_default_timezone_set", "date_default_timezone_get", "date_sunrise",
"date_sunset", "date_sun_info", "filter_input", "filter_var",
"filter_input_array", "filter_var_array", "filter_list", "filter_has_var",
"filter_id", "ftp_connect", "ftp_login", "ftp_pwd", "ftp_cdup", "ftp_chdir",
"ftp_exec", "ftp_raw", "ftp_mkdir", "ftp_rmdir", "ftp_chmod", "ftp_alloc",
"ftp_nlist", "ftp_rawlist", "ftp_systype", "ftp_pasv", "ftp_get", "ftp_fget",
"ftp_put", "ftp_fput", "ftp_size", "ftp_mdtm", "ftp_rename", "ftp_delete",
"ftp_site", "ftp_close", "ftp_set_option", "ftp_get_option", "ftp_nb_fget",
"ftp_nb_get", "ftp_nb_continue", "ftp_nb_put", "ftp_nb_fput", "ftp_quit",
"hash", "hash_file", "hash_hmac", "hash_hmac_file", "hash_init", "hash_update",
"hash_update_stream", "hash_update_file", "hash_final", "hash_algos", "iconv",
"ob_iconv_handler", "iconv_get_encoding", "iconv_set_encoding", "iconv_strlen",
"iconv_substr", "iconv_strpos", "iconv_strrpos", "iconv_mime_encode",
"iconv_mime_decode", "iconv_mime_decode_headers", "json_encode", "json_decode",
"odbc_autocommit", "odbc_binmode", "odbc_close", "odbc_close_all",
"odbc_columns", "odbc_commit", "odbc_connect", "odbc_cursor",
"odbc_data_source", "odbc_execute", "odbc_error", "odbc_errormsg", "odbc_exec",
"odbc_fetch_array", "odbc_fetch_object", "odbc_fetch_row", "odbc_fetch_into",
"odbc_field_len", "odbc_field_scale", "odbc_field_name", "odbc_field_type",
"odbc_field_num", "odbc_free_result", "odbc_gettypeinfo", "odbc_longreadlen",
"odbc_next_result", "odbc_num_fields", "odbc_num_rows", "odbc_pconnect",
"odbc_prepare", "odbc_result", "odbc_result_all", "odbc_rollback",
"odbc_setoption", "odbc_specialcolumns", "odbc_statistics", "odbc_tables",
"odbc_primarykeys", "odbc_columnprivileges", "odbc_tableprivileges",
"odbc_foreignkeys", "odbc_procedures", "odbc_procedurecolumns", "odbc_do",
"odbc_field_precision", "preg_match", "preg_match_all", "preg_replace",
"preg_replace_callback", "preg_split", "preg_quote", "preg_grep",
"preg_last_error", "session_name", "session_module_name", "session_save_path",
"session_id", "session_regenerate_id", "session_decode", "session_register",
"session_unregister", "session_is_registered", "session_encode",
"session_start", "session_destroy", "session_unset",
"session_set_save_handler", "session_cache_limiter", "session_cache_expire",
"session_set_cookie_params", "session_get_cookie_params",
"session_write_close", "session_commit", "spl_classes", "spl_autoload",
"spl_autoload_extensions", "spl_autoload_register", "spl_autoload_unregister",
"spl_autoload_functions", "spl_autoload_call", "class_parents",
"class_implements", "spl_object_hash", "iterator_to_array", "iterator_count",
"iterator_apply", "constant", "bin2hex", "sleep", "usleep", "flush",
"wordwrap", "htmlspecialchars", "htmlentities", "html_entity_decode",
"htmlspecialchars_decode", "get_html_translation_table", "sha1", "sha1_file",
"md5", "md5_file", "crc32", "iptcparse", "iptcembed", "getimagesize",
"image_type_to_mime_type", "image_type_to_extension", "phpinfo", "phpversion",
"phpcredits", "php_logo_guid", "php_real_logo_guid", "php_egg_logo_guid",
"zend_logo_guid", "php_sapi_name", "php_uname", "php_ini_scanned_files",
"strnatcmp", "strnatcasecmp", "substr_count", "strspn", "strcspn", "strtok",
"strtoupper", "strtolower", "strpos", "stripos", "strrpos", "strripos",
"strrev", "hebrev", "hebrevc", "nl2br", "basename", "dirname", "pathinfo",
"stripslashes", "stripcslashes", "strstr", "stristr", "strrchr", "str_shuffle",
"str_word_count", "str_split", "strpbrk", "substr_compare", "strcoll",
"substr", "substr_replace", "quotemeta", "ucfirst", "ucwords", "strtr",
"addslashes", "addcslashes", "rtrim", "str_replace", "str_ireplace",
"str_repeat", "count_chars", "chunk_split", "trim", "ltrim", "strip_tags",
"similar_text", "explode", "implode", "setlocale", "localeconv", "soundex",
"levenshtein", "chr", "ord", "parse_str", "str_pad", "chop", "strchr",
"sprintf", "printf", "vprintf", "vsprintf", "fprintf", "vfprintf", "sscanf",
"fscanf", "parse_url", "urlencode", "urldecode", "rawurlencode",
"rawurldecode", "http_build_query", "unlink", "exec", "system",
"escapeshellcmd", "escapeshellarg", "passthru", "shell_exec", "proc_open",
"proc_close", "proc_terminate", "proc_get_status", "rand", "srand",
"getrandmax", "mt_rand", "mt_srand", "mt_getrandmax", "getservbyname",
"getservbyport", "getprotobyname", "getprotobynumber", "getmyuid", "getmygid",
"getmypid", "getmyinode", "getlastmod", "base64_decode", "base64_encode",
"convert_uuencode", "convert_uudecode", "abs", "ceil", "floor", "round", "sin",
"cos", "tan", "asin", "acos", "atan", "atan2", "sinh", "cosh", "tanh", "pi",
"is_finite", "is_nan", "is_infinite", "pow", "exp", "log", "log10", "sqrt",
"hypot", "deg2rad", "rad2deg", "bindec", "hexdec", "octdec", "decbin",
"decoct", "dechex", "base_convert", "number_format", "fmod", "ip2long",
"long2ip", "getenv", "putenv", "microtime", "gettimeofday", "uniqid",
"quoted_printable_decode", "convert_cyr_string", "get_current_user",
"set_time_limit", "get_cfg_var", "magic_quotes_runtime",
"set_magic_quotes_runtime", "get_magic_quotes_gpc", "get_magic_quotes_runtime",
"import_request_variables", "error_log", "error_get_last", "call_user_func",
"call_user_func_array", "call_user_method", "call_user_method_array",
"serialize", "unserialize", "var_dump", "var_export", "debug_zval_dump",
"print_r", "memory_get_usage", "memory_get_peak_usage",
"register_shutdown_function", "register_tick_function",
"unregister_tick_function", "highlight_file", "show_source",
"highlight_string", "php_strip_whitespace", "ini_get", "ini_get_all",
"ini_set", "ini_alter", "ini_restore", "get_include_path", "set_include_path",
"restore_include_path", "setcookie", "setrawcookie", "header", "headers_sent",
"headers_list", "connection_aborted", "connection_status", "ignore_user_abort",
"parse_ini_file", "is_uploaded_file", "move_uploaded_file", "gethostbyaddr",
"gethostbyname", "gethostbynamel", "intval", "floatval", "doubleval", "strval",
"gettype", "settype", "is_null", "is_resource", "is_bool", "is_long",
"is_float", "is_int", "is_integer", "is_double", "is_real", "is_numeric",
"is_string", "is_array", "is_object", "is_scalar", "is_callable", "ereg",
"ereg_replace", "eregi", "eregi_replace", "split", "spliti", "join",
"sql_regcase", "dl", "pclose", "popen", "readfile", "rewind", "rmdir", "umask",
"fclose", "feof", "fgetc", "fgets", "fgetss", "fread", "fopen", "fpassthru",
"ftruncate", "fstat", "fseek", "ftell", "fflush", "fwrite", "fputs", "mkdir",
"rename", "copy", "tempnam", "tmpfile", "file", "file_get_contents",
"file_put_contents", "stream_select", "stream_context_create",
"stream_context_set_params", "stream_context_set_option",
"stream_context_get_options", "stream_context_get_default",
"stream_filter_prepend", "stream_filter_append", "stream_filter_remove",
"stream_socket_client", "stream_socket_server", "stream_socket_accept",
"stream_socket_get_name", "stream_socket_recvfrom", "stream_socket_sendto",
"stream_socket_enable_crypto", "stream_socket_shutdown",
"stream_copy_to_stream", "stream_get_contents", "fgetcsv", "fputcsv", "flock",
"get_meta_tags", "stream_set_write_buffer", "set_file_buffer",
"set_socket_blocking", "stream_set_blocking", "socket_set_blocking",
"stream_get_meta_data", "stream_get_line", "stream_wrapper_register",
"stream_register_wrapper", "stream_wrapper_unregister",
"stream_wrapper_restore", "stream_get_wrappers", "stream_get_transports",
"get_headers", "stream_set_timeout", "socket_set_timeout", "socket_get_status",
"realpath", "fsockopen", "pfsockopen", "pack", "unpack", "get_browser",
"crypt", "opendir", "closedir", "chdir", "getcwd", "rewinddir", "readdir",
"dir", "scandir", "glob", "fileatime", "filectime", "filegroup", "fileinode",
"filemtime", "fileowner", "fileperms", "filesize", "filetype", "file_exists",
"is_writable", "is_writeable", "is_readable", "is_executable", "is_file",
"is_dir", "is_link", "stat", "lstat", "chown", "chgrp", "chmod", "touch",
"clearstatcache", "disk_total_space", "disk_free_space", "diskfreespace",
"mail", "ezmlm_hash", "openlog", "syslog", "closelog",
"define_syslog_variables", "lcg_value", "metaphone", "ob_start", "ob_flush",
"ob_clean", "ob_end_flush", "ob_end_clean", "ob_get_flush", "ob_get_clean",
"ob_get_length", "ob_get_level", "ob_get_status", "ob_get_contents",
"ob_implicit_flush", "ob_list_handlers", "ksort", "krsort", "natsort",
"natcasesort", "asort", "arsort", "sort", "rsort", "usort", "uasort", "uksort",
"shuffle", "array_walk", "array_walk_recursive", "count", "end", "prev",
"next", "reset", "current", "key", "min", "max", "in_array", "array_search",
"extract", "compact", "array_fill", "array_fill_keys", "range",
"array_multisort", "array_push", "array_pop", "array_shift", "array_unshift",
"array_splice", "array_slice", "array_merge", "array_merge_recursive",
"array_keys", "array_values", "array_count_values", "array_reverse",
"array_reduce", "array_pad", "array_flip", "array_change_key_case",
"array_rand", "array_unique", "array_intersect", "array_intersect_key",
"array_intersect_ukey", "array_uintersect", "array_intersect_assoc",
"array_uintersect_assoc", "array_intersect_uassoc", "array_uintersect_uassoc",
"array_diff", "array_diff_key", "array_diff_ukey", "array_udiff",
"array_diff_assoc", "array_udiff_assoc", "array_diff_uassoc",
"array_udiff_uassoc", "array_sum", "array_product", "array_filter",
"array_map", "array_chunk", "array_combine", "array_key_exists", "pos",
"sizeof", "key_exists", "assert", "assert_options", "version_compare",
"str_rot13", "stream_get_filters", "stream_filter_register",
"stream_bucket_make_writeable", "stream_bucket_prepend",
"stream_bucket_append", "stream_bucket_new", "output_add_rewrite_var",
"output_reset_rewrite_vars", "sys_get_temp_dir", "token_get_all", "token_name",
"readgzfile", "gzrewind", "gzclose", "gzeof", "gzgetc", "gzgets", "gzgetss",
"gzread", "gzopen", "gzpassthru", "gzseek", "gztell", "gzwrite", "gzputs",
"gzfile", "gzcompress", "gzuncompress", "gzdeflate", "gzinflate", "gzencode",
"ob_gzhandler", "zlib_get_coding_type", "libxml_set_streams_context",
"libxml_use_internal_errors", "libxml_get_last_error", "libxml_clear_errors",
"libxml_get_errors", "dom_import_simplexml", "simplexml_load_file",
"simplexml_load_string", "simplexml_import_dom", "wddx_serialize_value",
"wddx_serialize_vars", "wddx_packet_start", "wddx_packet_end", "wddx_add_vars",
"wddx_deserialize", "xml_parser_create", "xml_parser_create_ns",
"xml_set_object", "xml_set_element_handler", "xml_set_character_data_handler",
"xml_set_processing_instruction_handler", "xml_set_default_handler",
"xml_set_unparsed_entity_decl_handler", "xml_set_notation_decl_handler",
"xml_set_external_entity_ref_handler", "xml_set_start_namespace_decl_handler",
"xml_set_end_namespace_decl_handler", "xml_parse", "xml_parse_into_struct",
"xml_get_error_code", "xml_error_string", "xml_get_current_line_number",
"xml_get_current_column_number", "xml_get_current_byte_index",
"xml_parser_free", "xml_parser_set_option", "xml_parser_get_option",
"utf8_encode", "utf8_decode", "xmlwriter_open_uri", "xmlwriter_open_memory",
"xmlwriter_set_indent", "xmlwriter_set_indent_string",
"xmlwriter_start_comment", "xmlwriter_end_comment",
"xmlwriter_start_attribute", "xmlwriter_end_attribute",
"xmlwriter_write_attribute", "xmlwriter_start_attribute_ns",
"xmlwriter_write_attribute_ns", "xmlwriter_start_element",
"xmlwriter_end_element", "xmlwriter_full_end_element",
"xmlwriter_start_element_ns", "xmlwriter_write_element",
"xmlwriter_write_element_ns", "xmlwriter_start_pi", "xmlwriter_end_pi",
"xmlwriter_write_pi", "xmlwriter_start_cdata", "xmlwriter_end_cdata",
"xmlwriter_write_cdata", "xmlwriter_text", "xmlwriter_write_raw",
"xmlwriter_start_document", "xmlwriter_end_document",
"xmlwriter_write_comment", "xmlwriter_start_dtd", "xmlwriter_end_dtd",
"xmlwriter_write_dtd", "xmlwriter_start_dtd_element",
"xmlwriter_end_dtd_element", "xmlwriter_write_dtd_element",
"xmlwriter_start_dtd_attlist", "xmlwriter_end_dtd_attlist",
"xmlwriter_write_dtd_attlist", "xmlwriter_start_dtd_entity",
"xmlwriter_end_dtd_entity", "xmlwriter_write_dtd_entity",
"xmlwriter_output_memory", "xmlwriter_flush", "gd_info", "imagearc",
"imageellipse", "imagechar", "imagecharup", "imagecolorat",
"imagecolorallocate", "imagepalettecopy", "imagecreatefromstring",
"imagecolorclosest", "imagecolordeallocate", "imagecolorresolve",
"imagecolorexact", "imagecolorset", "imagecolortransparent",
"imagecolorstotal", "imagecolorsforindex", "imagecopy", "imagecopymerge",
"imagecopymergegray", "imagecopyresized", "imagecreate",
"imagecreatetruecolor", "imageistruecolor", "imagetruecolortopalette",
"imagesetthickness", "imagefilledarc", "imagefilledellipse",
"imagealphablending", "imagesavealpha", "imagecolorallocatealpha",
"imagecolorresolvealpha", "imagecolorclosestalpha", "imagecolorexactalpha",
"imagecopyresampled", "imagegrabwindow", "imagegrabscreen", "imagerotate",
"imageantialias", "imagesettile", "imagesetbrush", "imagesetstyle",
"imagecreatefrompng", "imagecreatefromgif", "imagecreatefromjpeg",
"imagecreatefromwbmp", "imagecreatefromxbm", "imagecreatefromgd",
"imagecreatefromgd2", "imagecreatefromgd2part", "imagepng", "imagegif",
"imagejpeg", "imagewbmp", "imagegd", "imagegd2", "imagedestroy",
"imagegammacorrect", "imagefill", "imagefilledpolygon", "imagefilledrectangle",
"imagefilltoborder", "imagefontwidth", "imagefontheight", "imageinterlace",
"imageline", "imageloadfont", "imagepolygon", "imagerectangle",
"imagesetpixel", "imagestring", "imagestringup", "imagesx", "imagesy",
"imagedashedline", "imagettfbbox", "imagettftext", "imageftbbox",
"imagefttext", "imagepsloadfont", "imagepsfreefont", "imagepsencodefont",
"imagepsextendfont", "imagepsslantfont", "imagepstext", "imagepsbbox",
"imagetypes", "jpeg2wbmp", "png2wbmp", "image2wbmp", "imagelayereffect",
"imagecolormatch", "imagexbm", "imagefilter", "imageconvolution",
"mb_convert_case", "mb_strtoupper", "mb_strtolower", "mb_language",
"mb_internal_encoding", "mb_http_input", "mb_http_output", "mb_detect_order",
"mb_substitute_character", "mb_parse_str", "mb_output_handler",
"mb_preferred_mime_name", "mb_strlen", "mb_strpos", "mb_strrpos", "mb_stripos",
"mb_strripos", "mb_strstr", "mb_strrchr", "mb_stristr", "mb_strrichr",
"mb_substr_count", "mb_substr", "mb_strcut", "mb_strwidth", "mb_strimwidth",
"mb_convert_encoding", "mb_detect_encoding", "mb_list_encodings",
"mb_convert_kana", "mb_encode_mimeheader", "mb_decode_mimeheader",
"mb_convert_variables", "mb_encode_numericentity", "mb_decode_numericentity",
"mb_send_mail", "mb_get_info", "mb_check_encoding", "mb_regex_encoding",
"mb_regex_set_options", "mb_ereg", "mb_eregi", "mb_ereg_replace",
"mb_eregi_replace", "mb_split", "mb_ereg_match", "mb_ereg_search",
"mb_ereg_search_pos", "mb_ereg_search_regs", "mb_ereg_search_init",
"mb_ereg_search_getregs", "mb_ereg_search_getpos", "mb_ereg_search_setpos",
"mbregex_encoding", "mbereg", "mberegi", "mbereg_replace", "mberegi_replace",
"mbsplit", "mbereg_match", "mbereg_search", "mbereg_search_pos",
"mbereg_search_regs", "mbereg_search_init", "mbereg_search_getregs",
"mbereg_search_getpos", "mbereg_search_setpos", "mysql_connect",
"mysql_pconnect", "mysql_close", "mysql_select_db", "mysql_query",
"mysql_unbuffered_query", "mysql_db_query", "mysql_list_dbs",
"mysql_list_tables", "mysql_list_fields", "mysql_list_processes",
"mysql_error", "mysql_errno", "mysql_affected_rows", "mysql_insert_id",
"mysql_result", "mysql_num_rows", "mysql_num_fields", "mysql_fetch_row",
"mysql_fetch_array", "mysql_fetch_assoc", "mysql_fetch_object",
"mysql_data_seek", "mysql_fetch_lengths", "mysql_fetch_field",
"mysql_field_seek", "mysql_free_result", "mysql_field_name",
"mysql_field_table", "mysql_field_len", "mysql_field_type",
"mysql_field_flags", "mysql_escape_string", "mysql_real_escape_string",
"mysql_stat", "mysql_thread_id", "mysql_client_encoding", "mysql_ping",
"mysql_get_client_info", "mysql_get_host_info", "mysql_get_proto_info",
"mysql_get_server_info", "mysql_info", "mysql_set_charset", "mysql",
"mysql_fieldname", "mysql_fieldtable", "mysql_fieldlen", "mysql_fieldtype",
"mysql_fieldflags", "mysql_selectdb", "mysql_freeresult", "mysql_numfields",
"mysql_numrows", "mysql_listdbs", "mysql_listtables", "mysql_listfields",
"mysql_db_name", "mysql_dbname", "mysql_tablename", "mysql_table_name",
"mysqli_affected_rows", "mysqli_autocommit", "mysqli_change_user",
"mysqli_character_set_name", "mysqli_close", "mysqli_commit", "mysqli_connect",
"mysqli_connect_errno", "mysqli_connect_error", "mysqli_data_seek",
"mysqli_debug", "mysqli_disable_reads_from_master", "mysqli_disable_rpl_parse",
"mysqli_dump_debug_info", "mysqli_enable_reads_from_master",
"mysqli_enable_rpl_parse", "mysqli_embedded_server_end",
"mysqli_embedded_server_start", "mysqli_errno", "mysqli_error",
"mysqli_stmt_execute", "mysqli_execute", "mysqli_fetch_field",
"mysqli_fetch_fields", "mysqli_fetch_field_direct", "mysqli_fetch_lengths",
"mysqli_fetch_array", "mysqli_fetch_assoc", "mysqli_fetch_object",
"mysqli_fetch_row", "mysqli_field_count", "mysqli_field_seek",
"mysqli_field_tell", "mysqli_free_result", "mysqli_get_charset",
"mysqli_get_client_info", "mysqli_get_client_version", "mysqli_get_host_info",
"mysqli_get_proto_info", "mysqli_get_server_info", "mysqli_get_server_version",
"mysqli_get_warnings", "mysqli_init", "mysqli_info", "mysqli_insert_id",
"mysqli_kill", "mysqli_set_local_infile_default",
"mysqli_set_local_infile_handler", "mysqli_master_query",
"mysqli_more_results", "mysqli_multi_query", "mysqli_next_result",
"mysqli_num_fields", "mysqli_num_rows", "mysqli_options", "mysqli_ping",
"mysqli_prepare", "mysqli_report", "mysqli_query", "mysqli_real_connect",
"mysqli_real_escape_string", "mysqli_real_query", "mysqli_rollback",
"mysqli_rpl_parse_enabled", "mysqli_rpl_probe", "mysqli_rpl_query_type",
"mysqli_select_db", "mysqli_set_charset", "mysqli_stmt_attr_get",
"mysqli_stmt_attr_set", "mysqli_stmt_field_count", "mysqli_stmt_init",
"mysqli_stmt_prepare", "mysqli_stmt_result_metadata",
"mysqli_stmt_send_long_data", "mysqli_stmt_bind_param",
"mysqli_stmt_bind_result", "mysqli_stmt_fetch", "mysqli_stmt_free_result",
"mysqli_stmt_get_warnings", "mysqli_stmt_insert_id", "mysqli_stmt_reset",
"mysqli_stmt_param_count", "mysqli_send_query", "mysqli_slave_query",
"mysqli_sqlstate", "mysqli_ssl_set", "mysqli_stat",
"mysqli_stmt_affected_rows", "mysqli_stmt_close", "mysqli_stmt_data_seek",
"mysqli_stmt_errno", "mysqli_stmt_error", "mysqli_stmt_num_rows",
"mysqli_stmt_sqlstate", "mysqli_store_result", "mysqli_stmt_store_result",
"mysqli_thread_id", "mysqli_thread_safe", "mysqli_use_result",
"mysqli_warning_count", "mysqli_bind_param", "mysqli_bind_result",
"mysqli_client_encoding", "mysqli_escape_string", "mysqli_fetch",
"mysqli_param_count", "mysqli_get_metadata", "mysqli_send_long_data",
"mysqli_set_opt", "pdo_drivers", "socket_select", "socket_create",
"socket_create_listen", "socket_accept", "socket_set_nonblock",
"socket_set_block", "socket_listen", "socket_close", "socket_write",
"socket_read", "socket_getsockname", "socket_getpeername", "socket_connect",
"socket_strerror", "socket_bind", "socket_recv", "socket_send",
"socket_recvfrom", "socket_sendto", "socket_get_option", "socket_set_option",
"socket_shutdown", "socket_last_error", "socket_clear_error", "socket_getopt",
"socket_setopt", "eaccelerator_put", "eaccelerator_get", "eaccelerator_rm",
"eaccelerator_gc", "eaccelerator_lock", "eaccelerator_unlock",
"eaccelerator_caching", "eaccelerator_optimizer", "eaccelerator_clear",
"eaccelerator_clean", "eaccelerator_info", "eaccelerator_purge",
"eaccelerator_cached_scripts", "eaccelerator_removed_scripts",
"eaccelerator_list_keys", "eaccelerator_encode", "eaccelerator_load",
"_eaccelerator_loader_file", "_eaccelerator_loader_line",
"eaccelerator_set_session_handlers", "_eaccelerator_output_handler",
"eaccelerator_cache_page", "eaccelerator_rm_page", "eaccelerator_cache_output",
"eaccelerator_cache_result", "xdebug_get_stack_depth",
"xdebug_get_function_stack", "xdebug_print_function_stack",
"xdebug_get_declared_vars", "xdebug_call_class", "xdebug_call_function",
"xdebug_call_file", "xdebug_call_line", "xdebug_var_dump", "xdebug_debug_zval",
"xdebug_debug_zval_stdout", "xdebug_enable", "xdebug_disable",
"xdebug_is_enabled", "xdebug_break", "xdebug_start_trace", "xdebug_stop_trace",
"xdebug_get_tracefile_name", "xdebug_get_profiler_filename",
"xdebug_dump_aggr_profiling_data", "xdebug_clear_aggr_profiling_data",
"xdebug_memory_usage", "xdebug_peak_memory_usage", "xdebug_time_index",
"xdebug_start_error_collection", "xdebug_stop_error_collection",
"xdebug_get_collected_errors", "xdebug_start_code_coverage",
"xdebug_stop_code_coverage", "xdebug_get_code_coverage",
"xdebug_get_function_count", "xdebug_dump_superglobals",
"_", /* alias for gettext()*/
"get_called_class","class_alias","gc_collect_cycles","gc_enabled","gc_enable",
"gc_disable","date_create_from_format","date_parse_from_format",
"date_get_last_errors","date_add","date_sub","date_diff","date_timestamp_set",
"date_timestamp_get","timezone_location_get","timezone_version_get",
"date_interval_create_from_date_string","date_interval_format",
"libxml_disable_entity_loader","openssl_pkey_free","openssl_pkey_new",
"openssl_pkey_export","openssl_pkey_export_to_file","openssl_pkey_get_private",
"openssl_pkey_get_public","openssl_pkey_get_details","openssl_free_key",
"openssl_get_privatekey","openssl_get_publickey","openssl_x509_read",
"openssl_x509_free","openssl_x509_parse","openssl_x509_checkpurpose",
"openssl_x509_check_private_key","openssl_x509_export","openssl_x509_export_to_file",
"openssl_pkcs12_export","openssl_pkcs12_export_to_file","openssl_pkcs12_read",
"openssl_csr_new","openssl_csr_export","openssl_csr_export_to_file",
"openssl_csr_sign","openssl_csr_get_subject","openssl_csr_get_public_key",
"openssl_digest","openssl_encrypt","openssl_decrypt","openssl_cipher_iv_length",
"openssl_sign","openssl_verify","openssl_seal","openssl_open","openssl_pkcs7_verify",
"openssl_pkcs7_decrypt","openssl_pkcs7_sign","openssl_pkcs7_encrypt",
"openssl_private_encrypt","openssl_private_decrypt","openssl_public_encrypt",
"openssl_public_decrypt","openssl_get_md_methods","openssl_get_cipher_methods",
"openssl_dh_compute_key","openssl_random_pseudo_bytes","openssl_error_string",
"preg_filter","bzopen","bzread","bzwrite","bzflush","bzclose","bzerrno",
"bzerrstr","bzerror","bzcompress","bzdecompress","curl_init","curl_copy_handle",
"curl_version","curl_setopt","curl_setopt_array","curl_exec","curl_getinfo",
"curl_error","curl_errno","curl_close","curl_multi_init","curl_multi_add_handle",
"curl_multi_remove_handle","curl_multi_select","curl_multi_exec","curl_multi_getcontent",
"curl_multi_info_read","curl_multi_close","exif_read_data","read_exif_data",
"exif_tagname","exif_thumbnail","exif_imagetype","ftp_ssl_connect",
"imagecolorclosesthwb","imagecreatefromxpm","textdomain","gettext","dgettext",
"dcgettext","bindtextdomain","ngettext","dngettext","dcngettext",
"bind_textdomain_codeset","hash_copy","imap_open","imap_reopen","imap_close",
"imap_num_msg","imap_num_recent","imap_headers","imap_headerinfo",
"imap_rfc822_parse_headers","imap_rfc822_write_address","imap_rfc822_parse_adrlist",
"imap_body","imap_bodystruct","imap_fetchbody","imap_savebody","imap_fetchheader",
"imap_fetchstructure","imap_gc","imap_expunge","imap_delete","imap_undelete",
"imap_check","imap_listscan","imap_mail_copy","imap_mail_move","imap_mail_compose",
"imap_createmailbox","imap_renamemailbox","imap_deletemailbox","imap_subscribe",
"imap_unsubscribe","imap_append","imap_ping","imap_base64","imap_qprint","imap_8bit",
"imap_binary","imap_utf8","imap_status","imap_mailboxmsginfo","imap_setflag_full",
"imap_clearflag_full","imap_sort","imap_uid","imap_msgno","imap_list","imap_lsub",
"imap_fetch_overview","imap_alerts","imap_errors","imap_last_error","imap_search",
"imap_utf7_decode","imap_utf7_encode","imap_mime_header_decode","imap_thread",
"imap_timeout","imap_get_quota","imap_get_quotaroot","imap_set_quota","imap_setacl",
"imap_getacl","imap_mail","imap_header","imap_listmailbox","imap_getmailboxes",
"imap_scanmailbox","imap_listsubscribed","imap_getsubscribed","imap_fetchtext",
"imap_scan","imap_create","imap_rename","json_last_error","mb_encoding_aliases",
"mcrypt_ecb","mcrypt_cbc","mcrypt_cfb","mcrypt_ofb","mcrypt_get_key_size",
"mcrypt_get_block_size","mcrypt_get_cipher_name","mcrypt_create_iv","mcrypt_list_algorithms",
"mcrypt_list_modes","mcrypt_get_iv_size","mcrypt_encrypt","mcrypt_decrypt",
"mcrypt_module_open","mcrypt_generic_init","mcrypt_generic","mdecrypt_generic",
"mcrypt_generic_end","mcrypt_generic_deinit","mcrypt_enc_self_test",
"mcrypt_enc_is_block_algorithm_mode","mcrypt_enc_is_block_algorithm",
"mcrypt_enc_is_block_mode","mcrypt_enc_get_block_size","mcrypt_enc_get_key_size",
"mcrypt_enc_get_supported_key_sizes","mcrypt_enc_get_iv_size",
"mcrypt_enc_get_algorithms_name","mcrypt_enc_get_modes_name","mcrypt_module_self_test",
"mcrypt_module_is_block_algorithm_mode","mcrypt_module_is_block_algorithm",
"mcrypt_module_is_block_mode","mcrypt_module_get_algo_block_size",
"mcrypt_module_get_algo_key_size","mcrypt_module_get_supported_key_sizes",
"mcrypt_module_close","mysqli_refresh","posix_kill","posix_getpid","posix_getppid",
"posix_getuid","posix_setuid","posix_geteuid","posix_seteuid","posix_getgid",
"posix_setgid","posix_getegid","posix_setegid","posix_getgroups","posix_getlogin",
"posix_getpgrp","posix_setsid","posix_setpgid","posix_getpgid","posix_getsid",
"posix_uname","posix_times","posix_ctermid","posix_ttyname","posix_isatty",
"posix_getcwd","posix_mkfifo","posix_mknod","posix_access","posix_getgrnam",
"posix_getgrgid","posix_getpwnam","posix_getpwuid","posix_getrlimit",
"posix_get_last_error","posix_errno","posix_strerror","posix_initgroups",
"pspell_new","pspell_new_personal","pspell_new_config","pspell_check",
"pspell_suggest","pspell_store_replacement","pspell_add_to_personal",
"pspell_add_to_session","pspell_clear_session","pspell_save_wordlist",
"pspell_config_create","pspell_config_runtogether","pspell_config_mode",
"pspell_config_ignore","pspell_config_personal","pspell_config_dict_dir",
"pspell_config_data_dir","pspell_config_repl","pspell_config_save_repl",
"snmpget","snmpgetnext","snmpwalk","snmprealwalk","snmpwalkoid",
"snmp_get_quick_print","snmp_set_quick_print","snmp_set_enum_print",
"snmp_set_oid_output_format","snmp_set_oid_numeric_print","snmpset",
"snmp2_get","snmp2_getnext","snmp2_walk","snmp2_real_walk","snmp2_set",
"snmp3_get","snmp3_getnext","snmp3_walk","snmp3_real_walk","snmp3_set",
"snmp_set_valueretrieval","snmp_get_valueretrieval","snmp_read_mib",
"use_soap_error_handler","is_soap_fault","socket_create_pair","time_nanosleep",
"time_sleep_until","strptime","php_ini_loaded_file","money_format","lcfirst",
"nl_langinfo","str_getcsv","readlink","linkinfo","symlink","link","proc_nice",
"atanh","asinh","acosh","expm1","log1p","inet_ntop","inet_pton","getopt",
"sys_getloadavg","getrusage","quoted_printable_encode","forward_static_call",
"forward_static_call_array","header_remove","parse_ini_string","gethostname",
"dns_check_record","checkdnsrr","dns_get_mx","getmxrr","dns_get_record",
"stream_context_get_params","stream_context_set_default","stream_socket_pair",
"stream_supports_lock","stream_set_read_buffer","stream_resolve_include_path",
"stream_is_local","fnmatch","chroot","lchown","lchgrp","realpath_cache_size",
"realpath_cache_get","array_replace","array_replace_recursive","ftok","xmlrpc_encode",
"xmlrpc_decode","xmlrpc_decode_request","xmlrpc_encode_request","xmlrpc_get_type",
"xmlrpc_set_type","xmlrpc_is_fault","xmlrpc_server_create","xmlrpc_server_destroy",
"xmlrpc_server_register_method","xmlrpc_server_call_method",
"xmlrpc_parse_method_descriptions","xmlrpc_server_add_introspection_data",
"xmlrpc_server_register_introspection_callback","zip_open","zip_close",
"zip_read","zip_entry_open","zip_entry_close","zip_entry_read","zip_entry_filesize",
"zip_entry_name","zip_entry_compressedsize","zip_entry_compressionmethod",
"svn_checkout","svn_cat","svn_ls","svn_log","svn_auth_set_parameter",
"svn_auth_get_parameter","svn_client_version","svn_config_ensure","svn_diff",
"svn_cleanup","svn_revert","svn_resolved","svn_commit","svn_lock","svn_unlock",
"svn_add","svn_status","svn_update","svn_import","svn_info","svn_export",
"svn_copy","svn_switch","svn_blame","svn_delete","svn_mkdir","svn_move",
"svn_proplist","svn_propget","svn_repos_create","svn_repos_recover",
"svn_repos_hotcopy","svn_repos_open","svn_repos_fs",
"svn_repos_fs_begin_txn_for_commit","svn_repos_fs_commit_txn",
"svn_fs_revision_root","svn_fs_check_path","svn_fs_revision_prop",
"svn_fs_dir_entries","svn_fs_node_created_rev","svn_fs_youngest_rev",
"svn_fs_file_contents","svn_fs_file_length","svn_fs_txn_root","svn_fs_make_file",
"svn_fs_make_dir","svn_fs_apply_text","svn_fs_copy","svn_fs_delete",
"svn_fs_begin_txn2","svn_fs_is_dir","svn_fs_is_file","svn_fs_node_prop",
"svn_fs_change_node_prop","svn_fs_contents_changed","svn_fs_props_changed",
"svn_fs_abort_txn","sqlite_open","sqlite_popen","sqlite_close","sqlite_query",
"sqlite_exec","sqlite_array_query","sqlite_single_query","sqlite_fetch_array",
"sqlite_fetch_object","sqlite_fetch_single","sqlite_fetch_string",
"sqlite_fetch_all","sqlite_current","sqlite_column","sqlite_libversion",
"sqlite_libencoding","sqlite_changes","sqlite_last_insert_rowid",
"sqlite_num_rows","sqlite_num_fields","sqlite_field_name","sqlite_seek",
"sqlite_rewind","sqlite_next","sqlite_prev","sqlite_valid","sqlite_has_more",
"sqlite_has_prev","sqlite_escape_string","sqlite_busy_timeout","sqlite_last_error",
"sqlite_error_string","sqlite_unbuffered_query","sqlite_create_aggregate",
"sqlite_create_function","sqlite_factory","sqlite_udf_encode_binary",
"sqlite_udf_decode_binary","sqlite_fetch_column_types"
].forEach(function(element, index, array) {
result[element] = token("t_string", "php-predefined-function");
});
// output of get_defined_constants(). Differs significantly from http://php.net/manual/en/reserved.constants.php
[ "E_ERROR", "E_RECOVERABLE_ERROR", "E_WARNING", "E_PARSE", "E_NOTICE",
"E_STRICT", "E_CORE_ERROR", "E_CORE_WARNING", "E_COMPILE_ERROR",
"E_COMPILE_WARNING", "E_USER_ERROR", "E_USER_WARNING", "E_USER_NOTICE",
"E_ALL", "TRUE", "FALSE", "NULL", "ZEND_THREAD_SAFE", "PHP_VERSION", "PHP_OS",
"PHP_SAPI", "DEFAULT_INCLUDE_PATH", "PEAR_INSTALL_DIR", "PEAR_EXTENSION_DIR",
"PHP_EXTENSION_DIR", "PHP_PREFIX", "PHP_BINDIR", "PHP_LIBDIR", "PHP_DATADIR",
"PHP_SYSCONFDIR", "PHP_LOCALSTATEDIR", "PHP_CONFIG_FILE_PATH",
"PHP_CONFIG_FILE_SCAN_DIR", "PHP_SHLIB_SUFFIX", "PHP_EOL", "PHP_EOL",
"PHP_INT_MAX", "PHP_INT_SIZE", "PHP_OUTPUT_HANDLER_START",
"PHP_OUTPUT_HANDLER_CONT", "PHP_OUTPUT_HANDLER_END", "UPLOAD_ERR_OK",
"UPLOAD_ERR_INI_SIZE", "UPLOAD_ERR_FORM_SIZE", "UPLOAD_ERR_PARTIAL",
"UPLOAD_ERR_NO_FILE", "UPLOAD_ERR_NO_TMP_DIR", "UPLOAD_ERR_CANT_WRITE",
"UPLOAD_ERR_EXTENSION", "CAL_GREGORIAN", "CAL_JULIAN", "CAL_JEWISH",
"CAL_FRENCH", "CAL_NUM_CALS", "CAL_DOW_DAYNO", "CAL_DOW_SHORT", "CAL_DOW_LONG",
"CAL_MONTH_GREGORIAN_SHORT", "CAL_MONTH_GREGORIAN_LONG",
"CAL_MONTH_JULIAN_SHORT", "CAL_MONTH_JULIAN_LONG", "CAL_MONTH_JEWISH",
"CAL_MONTH_FRENCH", "CAL_EASTER_DEFAULT", "CAL_EASTER_ROMAN",
"CAL_EASTER_ALWAYS_GREGORIAN", "CAL_EASTER_ALWAYS_JULIAN",
"CAL_JEWISH_ADD_ALAFIM_GERESH", "CAL_JEWISH_ADD_ALAFIM",
"CAL_JEWISH_ADD_GERESHAYIM", "CLSCTX_INPROC_SERVER", "CLSCTX_INPROC_HANDLER",
"CLSCTX_LOCAL_SERVER", "CLSCTX_REMOTE_SERVER", "CLSCTX_SERVER", "CLSCTX_ALL",
"VT_NULL", "VT_EMPTY", "VT_UI1", "VT_I1", "VT_UI2", "VT_I2", "VT_UI4", "VT_I4",
"VT_R4", "VT_R8", "VT_BOOL", "VT_ERROR", "VT_CY", "VT_DATE", "VT_BSTR",
"VT_DECIMAL", "VT_UNKNOWN", "VT_DISPATCH", "VT_VARIANT", "VT_INT", "VT_UINT",
"VT_ARRAY", "VT_BYREF", "CP_ACP", "CP_MACCP", "CP_OEMCP", "CP_UTF7", "CP_UTF8",
"CP_SYMBOL", "CP_THREAD_ACP", "VARCMP_LT", "VARCMP_EQ", "VARCMP_GT",
"VARCMP_NULL", "NORM_IGNORECASE", "NORM_IGNORENONSPACE", "NORM_IGNORESYMBOLS",
"NORM_IGNOREWIDTH", "NORM_IGNOREKANATYPE", "DISP_E_DIVBYZERO",
"DISP_E_OVERFLOW", "DISP_E_BADINDEX", "MK_E_UNAVAILABLE", "INPUT_POST",
"INPUT_GET", "INPUT_COOKIE", "INPUT_ENV", "INPUT_SERVER", "INPUT_SESSION",
"INPUT_REQUEST", "FILTER_FLAG_NONE", "FILTER_REQUIRE_SCALAR",
"FILTER_REQUIRE_ARRAY", "FILTER_FORCE_ARRAY", "FILTER_NULL_ON_FAILURE",
"FILTER_VALIDATE_INT", "FILTER_VALIDATE_BOOLEAN", "FILTER_VALIDATE_FLOAT",
"FILTER_VALIDATE_REGEXP", "FILTER_VALIDATE_URL", "FILTER_VALIDATE_EMAIL",
"FILTER_VALIDATE_IP", "FILTER_DEFAULT", "FILTER_UNSAFE_RAW",
"FILTER_SANITIZE_STRING", "FILTER_SANITIZE_STRIPPED",
"FILTER_SANITIZE_ENCODED", "FILTER_SANITIZE_SPECIAL_CHARS",
"FILTER_SANITIZE_EMAIL", "FILTER_SANITIZE_URL", "FILTER_SANITIZE_NUMBER_INT",
"FILTER_SANITIZE_NUMBER_FLOAT", "FILTER_SANITIZE_MAGIC_QUOTES",
"FILTER_CALLBACK", "FILTER_FLAG_ALLOW_OCTAL", "FILTER_FLAG_ALLOW_HEX",
"FILTER_FLAG_STRIP_LOW", "FILTER_FLAG_STRIP_HIGH", "FILTER_FLAG_ENCODE_LOW",
"FILTER_FLAG_ENCODE_HIGH", "FILTER_FLAG_ENCODE_AMP",
"FILTER_FLAG_NO_ENCODE_QUOTES", "FILTER_FLAG_EMPTY_STRING_NULL",
"FILTER_FLAG_ALLOW_FRACTION", "FILTER_FLAG_ALLOW_THOUSAND",
"FILTER_FLAG_ALLOW_SCIENTIFIC", "FILTER_FLAG_SCHEME_REQUIRED",
"FILTER_FLAG_HOST_REQUIRED", "FILTER_FLAG_PATH_REQUIRED",
"FILTER_FLAG_QUERY_REQUIRED", "FILTER_FLAG_IPV4", "FILTER_FLAG_IPV6",
"FILTER_FLAG_NO_RES_RANGE", "FILTER_FLAG_NO_PRIV_RANGE", "FTP_ASCII",
"FTP_TEXT", "FTP_BINARY", "FTP_IMAGE", "FTP_AUTORESUME", "FTP_TIMEOUT_SEC",
"FTP_AUTOSEEK", "FTP_FAILED", "FTP_FINISHED", "FTP_MOREDATA", "HASH_HMAC",
"ICONV_IMPL", "ICONV_VERSION", "ICONV_MIME_DECODE_STRICT",
"ICONV_MIME_DECODE_CONTINUE_ON_ERROR", "ODBC_TYPE", "ODBC_BINMODE_PASSTHRU",
"ODBC_BINMODE_RETURN", "ODBC_BINMODE_CONVERT", "SQL_ODBC_CURSORS",
"SQL_CUR_USE_DRIVER", "SQL_CUR_USE_IF_NEEDED", "SQL_CUR_USE_ODBC",
"SQL_CONCURRENCY", "SQL_CONCUR_READ_ONLY", "SQL_CONCUR_LOCK",
"SQL_CONCUR_ROWVER", "SQL_CONCUR_VALUES", "SQL_CURSOR_TYPE",
"SQL_CURSOR_FORWARD_ONLY", "SQL_CURSOR_KEYSET_DRIVEN", "SQL_CURSOR_DYNAMIC",
"SQL_CURSOR_STATIC", "SQL_KEYSET_SIZE", "SQL_FETCH_FIRST", "SQL_FETCH_NEXT",
"SQL_CHAR", "SQL_VARCHAR", "SQL_LONGVARCHAR", "SQL_DECIMAL", "SQL_NUMERIC",
"SQL_BIT", "SQL_TINYINT", "SQL_SMALLINT", "SQL_INTEGER", "SQL_BIGINT",
"SQL_REAL", "SQL_FLOAT", "SQL_DOUBLE", "SQL_BINARY", "SQL_VARBINARY",
"SQL_LONGVARBINARY", "SQL_DATE", "SQL_TIME", "SQL_TIMESTAMP",
"PREG_PATTERN_ORDER", "PREG_SET_ORDER", "PREG_OFFSET_CAPTURE",
"PREG_SPLIT_NO_EMPTY", "PREG_SPLIT_DELIM_CAPTURE", "PREG_SPLIT_OFFSET_CAPTURE",
"PREG_GREP_INVERT", "PREG_NO_ERROR", "PREG_INTERNAL_ERROR",
"PREG_BACKTRACK_LIMIT_ERROR", "PREG_RECURSION_LIMIT_ERROR",
"PREG_BAD_UTF8_ERROR", "DATE_ATOM", "DATE_COOKIE", "DATE_ISO8601",
"DATE_RFC822", "DATE_RFC850", "DATE_RFC1036", "DATE_RFC1123", "DATE_RFC2822",
"DATE_RFC3339", "DATE_RSS", "DATE_W3C", "SUNFUNCS_RET_TIMESTAMP",
"SUNFUNCS_RET_STRING", "SUNFUNCS_RET_DOUBLE", "LIBXML_VERSION",
"LIBXML_DOTTED_VERSION", "LIBXML_NOENT", "LIBXML_DTDLOAD", "LIBXML_DTDATTR",
"LIBXML_DTDVALID", "LIBXML_NOERROR", "LIBXML_NOWARNING", "LIBXML_NOBLANKS",
"LIBXML_XINCLUDE", "LIBXML_NSCLEAN", "LIBXML_NOCDATA", "LIBXML_NONET",
"LIBXML_COMPACT", "LIBXML_NOXMLDECL", "LIBXML_NOEMPTYTAG", "LIBXML_ERR_NONE",
"LIBXML_ERR_WARNING", "LIBXML_ERR_ERROR", "LIBXML_ERR_FATAL",
"CONNECTION_ABORTED", "CONNECTION_NORMAL", "CONNECTION_TIMEOUT", "INI_USER",
"INI_PERDIR", "INI_SYSTEM", "INI_ALL", "PHP_URL_SCHEME", "PHP_URL_HOST",
"PHP_URL_PORT", "PHP_URL_USER", "PHP_URL_PASS", "PHP_URL_PATH",
"PHP_URL_QUERY", "PHP_URL_FRAGMENT", "M_E", "M_LOG2E", "M_LOG10E", "M_LN2",
"M_LN10", "M_PI", "M_PI_2", "M_PI_4", "M_1_PI", "M_2_PI", "M_SQRTPI",
"M_2_SQRTPI", "M_LNPI", "M_EULER", "M_SQRT2", "M_SQRT1_2", "M_SQRT3", "INF",
"NAN", "INFO_GENERAL", "INFO_CREDITS", "INFO_CONFIGURATION", "INFO_MODULES",
"INFO_ENVIRONMENT", "INFO_VARIABLES", "INFO_LICENSE", "INFO_ALL",
"CREDITS_GROUP", "CREDITS_GENERAL", "CREDITS_SAPI", "CREDITS_MODULES",
"CREDITS_DOCS", "CREDITS_FULLPAGE", "CREDITS_QA", "CREDITS_ALL",
"HTML_SPECIALCHARS", "HTML_ENTITIES", "ENT_COMPAT", "ENT_QUOTES",
"ENT_NOQUOTES", "STR_PAD_LEFT", "STR_PAD_RIGHT", "STR_PAD_BOTH",
"PATHINFO_DIRNAME", "PATHINFO_BASENAME", "PATHINFO_EXTENSION",
"PATHINFO_FILENAME", "CHAR_MAX", "LC_CTYPE", "LC_NUMERIC", "LC_TIME",
"LC_COLLATE", "LC_MONETARY", "LC_ALL", "SEEK_SET", "SEEK_CUR", "SEEK_END",
"LOCK_SH", "LOCK_EX", "LOCK_UN", "LOCK_NB", "STREAM_NOTIFY_CONNECT",
"STREAM_NOTIFY_AUTH_REQUIRED", "STREAM_NOTIFY_AUTH_RESULT",
"STREAM_NOTIFY_MIME_TYPE_IS", "STREAM_NOTIFY_FILE_SIZE_IS",
"STREAM_NOTIFY_REDIRECTED", "STREAM_NOTIFY_PROGRESS", "STREAM_NOTIFY_FAILURE",
"STREAM_NOTIFY_COMPLETED", "STREAM_NOTIFY_RESOLVE",
"STREAM_NOTIFY_SEVERITY_INFO", "STREAM_NOTIFY_SEVERITY_WARN",
"STREAM_NOTIFY_SEVERITY_ERR", "STREAM_FILTER_READ", "STREAM_FILTER_WRITE",
"STREAM_FILTER_ALL", "STREAM_CLIENT_PERSISTENT", "STREAM_CLIENT_ASYNC_CONNECT",
"STREAM_CLIENT_CONNECT", "STREAM_CRYPTO_METHOD_SSLv2_CLIENT",
"STREAM_CRYPTO_METHOD_SSLv3_CLIENT", "STREAM_CRYPTO_METHOD_SSLv23_CLIENT",
"STREAM_CRYPTO_METHOD_TLS_CLIENT", "STREAM_CRYPTO_METHOD_SSLv2_SERVER",
"STREAM_CRYPTO_METHOD_SSLv3_SERVER", "STREAM_CRYPTO_METHOD_SSLv23_SERVER",
"STREAM_CRYPTO_METHOD_TLS_SERVER", "STREAM_SHUT_RD", "STREAM_SHUT_WR",
"STREAM_SHUT_RDWR", "STREAM_PF_INET", "STREAM_PF_INET6", "STREAM_PF_UNIX",
"STREAM_IPPROTO_IP", "STREAM_IPPROTO_TCP", "STREAM_IPPROTO_UDP",
"STREAM_IPPROTO_ICMP", "STREAM_IPPROTO_RAW", "STREAM_SOCK_STREAM",
"STREAM_SOCK_DGRAM", "STREAM_SOCK_RAW", "STREAM_SOCK_SEQPACKET",
"STREAM_SOCK_RDM", "STREAM_PEEK", "STREAM_OOB", "STREAM_SERVER_BIND",
"STREAM_SERVER_LISTEN", "FILE_USE_INCLUDE_PATH", "FILE_IGNORE_NEW_LINES",
"FILE_SKIP_EMPTY_LINES", "FILE_APPEND", "FILE_NO_DEFAULT_CONTEXT",
"PSFS_PASS_ON", "PSFS_FEED_ME", "PSFS_ERR_FATAL", "PSFS_FLAG_NORMAL",
"PSFS_FLAG_FLUSH_INC", "PSFS_FLAG_FLUSH_CLOSE", "CRYPT_SALT_LENGTH",
"CRYPT_STD_DES", "CRYPT_EXT_DES", "CRYPT_MD5", "CRYPT_BLOWFISH",
"DIRECTORY_SEPARATOR", "PATH_SEPARATOR", "GLOB_BRACE", "GLOB_MARK",
"GLOB_NOSORT", "GLOB_NOCHECK", "GLOB_NOESCAPE", "GLOB_ERR", "GLOB_ONLYDIR",
"LOG_EMERG", "LOG_ALERT", "LOG_CRIT", "LOG_ERR", "LOG_WARNING", "LOG_NOTICE",
"LOG_INFO", "LOG_DEBUG", "LOG_KERN", "LOG_USER", "LOG_MAIL", "LOG_DAEMON",
"LOG_AUTH", "LOG_SYSLOG", "LOG_LPR", "LOG_NEWS", "LOG_UUCP", "LOG_CRON",
"LOG_AUTHPRIV", "LOG_PID", "LOG_CONS", "LOG_ODELAY", "LOG_NDELAY",
"LOG_NOWAIT", "LOG_PERROR", "EXTR_OVERWRITE", "EXTR_SKIP", "EXTR_PREFIX_SAME",
"EXTR_PREFIX_ALL", "EXTR_PREFIX_INVALID", "EXTR_PREFIX_IF_EXISTS",
"EXTR_IF_EXISTS", "EXTR_REFS", "SORT_ASC", "SORT_DESC", "SORT_REGULAR",
"SORT_NUMERIC", "SORT_STRING", "SORT_LOCALE_STRING", "CASE_LOWER",
"CASE_UPPER", "COUNT_NORMAL", "COUNT_RECURSIVE", "ASSERT_ACTIVE",
"ASSERT_CALLBACK", "ASSERT_BAIL", "ASSERT_WARNING", "ASSERT_QUIET_EVAL",
"STREAM_USE_PATH", "STREAM_IGNORE_URL", "STREAM_ENFORCE_SAFE_MODE",
"STREAM_REPORT_ERRORS", "STREAM_MUST_SEEK", "STREAM_URL_STAT_LINK",
"STREAM_URL_STAT_QUIET", "STREAM_MKDIR_RECURSIVE", "IMAGETYPE_GIF",
"IMAGETYPE_JPEG", "IMAGETYPE_PNG", "IMAGETYPE_SWF", "IMAGETYPE_PSD",
"IMAGETYPE_BMP", "IMAGETYPE_TIFF_II", "IMAGETYPE_TIFF_MM", "IMAGETYPE_JPC",
"IMAGETYPE_JP2", "IMAGETYPE_JPX", "IMAGETYPE_JB2", "IMAGETYPE_SWC",
"IMAGETYPE_IFF", "IMAGETYPE_WBMP", "IMAGETYPE_JPEG2000", "IMAGETYPE_XBM",
"T_INCLUDE", "T_INCLUDE_ONCE", "T_EVAL", "T_REQUIRE", "T_REQUIRE_ONCE",
"T_LOGICAL_OR", "T_LOGICAL_XOR", "T_LOGICAL_AND", "T_PRINT", "T_PLUS_EQUAL",
"T_MINUS_EQUAL", "T_MUL_EQUAL", "T_DIV_EQUAL", "T_CONCAT_EQUAL", "T_MOD_EQUAL",
"T_AND_EQUAL", "T_OR_EQUAL", "T_XOR_EQUAL", "T_SL_EQUAL", "T_SR_EQUAL",
"T_BOOLEAN_OR", "T_BOOLEAN_AND", "T_IS_EQUAL", "T_IS_NOT_EQUAL",
"T_IS_IDENTICAL", "T_IS_NOT_IDENTICAL", "T_IS_SMALLER_OR_EQUAL",
"T_IS_GREATER_OR_EQUAL", "T_SL", "T_SR", "T_INC", "T_DEC", "T_INT_CAST",
"T_DOUBLE_CAST", "T_STRING_CAST", "T_ARRAY_CAST", "T_OBJECT_CAST",
"T_BOOL_CAST", "T_UNSET_CAST", "T_NEW", "T_EXIT", "T_IF", "T_ELSEIF", "T_ELSE",
"T_ENDIF", "T_LNUMBER", "T_DNUMBER", "T_STRING", "T_STRING_VARNAME",
"T_VARIABLE", "T_NUM_STRING", "T_INLINE_HTML", "T_CHARACTER",
"T_BAD_CHARACTER", "T_ENCAPSED_AND_WHITESPACE", "T_CONSTANT_ENCAPSED_STRING",
"T_ECHO", "T_DO", "T_WHILE", "T_ENDWHILE", "T_FOR", "T_ENDFOR", "T_FOREACH",
"T_ENDFOREACH", "T_DECLARE", "T_ENDDECLARE", "T_AS", "T_SWITCH", "T_ENDSWITCH",
"T_CASE", "T_DEFAULT", "T_BREAK", "T_CONTINUE", "T_FUNCTION", "T_CONST",
"T_RETURN", "T_USE", "T_GLOBAL", "T_STATIC", "T_VAR", "T_UNSET", "T_ISSET",
"T_EMPTY", "T_CLASS", "T_EXTENDS", "T_INTERFACE", "T_IMPLEMENTS",
"T_OBJECT_OPERATOR", "T_DOUBLE_ARROW", "T_LIST", "T_ARRAY", "T_CLASS_C",
"T_FUNC_C", "T_METHOD_C", "T_LINE", "T_FILE", "T_COMMENT", "T_DOC_COMMENT",
"T_OPEN_TAG", "T_OPEN_TAG_WITH_ECHO", "T_CLOSE_TAG", "T_WHITESPACE",
"T_START_HEREDOC", "T_END_HEREDOC", "T_DOLLAR_OPEN_CURLY_BRACES",
"T_CURLY_OPEN", "T_PAAMAYIM_NEKUDOTAYIM", "T_DOUBLE_COLON", "T_ABSTRACT",
"T_CATCH", "T_FINAL", "T_INSTANCEOF", "T_PRIVATE", "T_PROTECTED", "T_PUBLIC",
"T_THROW", "T_TRY", "T_CLONE", "T_HALT_COMPILER", "FORCE_GZIP",
"FORCE_DEFLATE", "XML_ELEMENT_NODE", "XML_ATTRIBUTE_NODE", "XML_TEXT_NODE",
"XML_CDATA_SECTION_NODE", "XML_ENTITY_REF_NODE", "XML_ENTITY_NODE",
"XML_PI_NODE", "XML_COMMENT_NODE", "XML_DOCUMENT_NODE",
"XML_DOCUMENT_TYPE_NODE", "XML_DOCUMENT_FRAG_NODE", "XML_NOTATION_NODE",
"XML_HTML_DOCUMENT_NODE", "XML_DTD_NODE", "XML_ELEMENT_DECL_NODE",
"XML_ATTRIBUTE_DECL_NODE", "XML_ENTITY_DECL_NODE", "XML_NAMESPACE_DECL_NODE",
"XML_LOCAL_NAMESPACE", "XML_ATTRIBUTE_CDATA", "XML_ATTRIBUTE_ID",
"XML_ATTRIBUTE_IDREF", "XML_ATTRIBUTE_IDREFS", "XML_ATTRIBUTE_ENTITY",
"XML_ATTRIBUTE_NMTOKEN", "XML_ATTRIBUTE_NMTOKENS", "XML_ATTRIBUTE_ENUMERATION",
"XML_ATTRIBUTE_NOTATION", "DOM_PHP_ERR", "DOM_INDEX_SIZE_ERR",
"DOMSTRING_SIZE_ERR", "DOM_HIERARCHY_REQUEST_ERR", "DOM_WRONG_DOCUMENT_ERR",
"DOM_INVALID_CHARACTER_ERR", "DOM_NO_DATA_ALLOWED_ERR",
"DOM_NO_MODIFICATION_ALLOWED_ERR", "DOM_NOT_FOUND_ERR",
"DOM_NOT_SUPPORTED_ERR", "DOM_INUSE_ATTRIBUTE_ERR", "DOM_INVALID_STATE_ERR",
"DOM_SYNTAX_ERR", "DOM_INVALID_MODIFICATION_ERR", "DOM_NAMESPACE_ERR",
"DOM_INVALID_ACCESS_ERR", "DOM_VALIDATION_ERR", "XML_ERROR_NONE",
"XML_ERROR_NO_MEMORY", "XML_ERROR_SYNTAX", "XML_ERROR_NO_ELEMENTS",
"XML_ERROR_INVALID_TOKEN", "XML_ERROR_UNCLOSED_TOKEN",
"XML_ERROR_PARTIAL_CHAR", "XML_ERROR_TAG_MISMATCH",
"XML_ERROR_DUPLICATE_ATTRIBUTE", "XML_ERROR_JUNK_AFTER_DOC_ELEMENT",
"XML_ERROR_PARAM_ENTITY_REF", "XML_ERROR_UNDEFINED_ENTITY",
"XML_ERROR_RECURSIVE_ENTITY_REF", "XML_ERROR_ASYNC_ENTITY",
"XML_ERROR_BAD_CHAR_REF", "XML_ERROR_BINARY_ENTITY_REF",
"XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF", "XML_ERROR_MISPLACED_XML_PI",
"XML_ERROR_UNKNOWN_ENCODING", "XML_ERROR_INCORRECT_ENCODING",
"XML_ERROR_UNCLOSED_CDATA_SECTION", "XML_ERROR_EXTERNAL_ENTITY_HANDLING",
"XML_OPTION_CASE_FOLDING", "XML_OPTION_TARGET_ENCODING",
"XML_OPTION_SKIP_TAGSTART", "XML_OPTION_SKIP_WHITE", "XML_SAX_IMPL", "IMG_GIF",
"IMG_JPG", "IMG_JPEG", "IMG_PNG", "IMG_WBMP", "IMG_XPM", "IMG_COLOR_TILED",
"IMG_COLOR_STYLED", "IMG_COLOR_BRUSHED", "IMG_COLOR_STYLEDBRUSHED",
"IMG_COLOR_TRANSPARENT", "IMG_ARC_ROUNDED", "IMG_ARC_PIE", "IMG_ARC_CHORD",
"IMG_ARC_NOFILL", "IMG_ARC_EDGED", "IMG_GD2_RAW", "IMG_GD2_COMPRESSED",
"IMG_EFFECT_REPLACE", "IMG_EFFECT_ALPHABLEND", "IMG_EFFECT_NORMAL",
"IMG_EFFECT_OVERLAY", "GD_BUNDLED", "IMG_FILTER_NEGATE",
"IMG_FILTER_GRAYSCALE", "IMG_FILTER_BRIGHTNESS", "IMG_FILTER_CONTRAST",
"IMG_FILTER_COLORIZE", "IMG_FILTER_EDGEDETECT", "IMG_FILTER_GAUSSIAN_BLUR",
"IMG_FILTER_SELECTIVE_BLUR", "IMG_FILTER_EMBOSS", "IMG_FILTER_MEAN_REMOVAL",
"IMG_FILTER_SMOOTH", "PNG_NO_FILTER", "PNG_FILTER_NONE", "PNG_FILTER_SUB",
"PNG_FILTER_UP", "PNG_FILTER_AVG", "PNG_FILTER_PAETH", "PNG_ALL_FILTERS",
"MB_OVERLOAD_MAIL", "MB_OVERLOAD_STRING", "MB_OVERLOAD_REGEX", "MB_CASE_UPPER",
"MB_CASE_LOWER", "MB_CASE_TITLE", "MYSQL_ASSOC", "MYSQL_NUM", "MYSQL_BOTH",
"MYSQL_CLIENT_COMPRESS", "MYSQL_CLIENT_SSL", "MYSQL_CLIENT_INTERACTIVE",
"MYSQL_CLIENT_IGNORE_SPACE", "MYSQLI_READ_DEFAULT_GROUP",
"MYSQLI_READ_DEFAULT_FILE", "MYSQLI_OPT_CONNECT_TIMEOUT",
"MYSQLI_OPT_LOCAL_INFILE", "MYSQLI_INIT_COMMAND", "MYSQLI_CLIENT_SSL",
"MYSQLI_CLIENT_COMPRESS", "MYSQLI_CLIENT_INTERACTIVE",
"MYSQLI_CLIENT_IGNORE_SPACE", "MYSQLI_CLIENT_NO_SCHEMA",
"MYSQLI_CLIENT_FOUND_ROWS", "MYSQLI_STORE_RESULT", "MYSQLI_USE_RESULT",
"MYSQLI_ASSOC", "MYSQLI_NUM", "MYSQLI_BOTH",
"MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", "MYSQLI_STMT_ATTR_CURSOR_TYPE",
"MYSQLI_CURSOR_TYPE_NO_CURSOR", "MYSQLI_CURSOR_TYPE_READ_ONLY",
"MYSQLI_CURSOR_TYPE_FOR_UPDATE", "MYSQLI_CURSOR_TYPE_SCROLLABLE",
"MYSQLI_STMT_ATTR_PREFETCH_ROWS", "MYSQLI_NOT_NULL_FLAG",
"MYSQLI_PRI_KEY_FLAG", "MYSQLI_UNIQUE_KEY_FLAG", "MYSQLI_MULTIPLE_KEY_FLAG",
"MYSQLI_BLOB_FLAG", "MYSQLI_UNSIGNED_FLAG", "MYSQLI_ZEROFILL_FLAG",
"MYSQLI_AUTO_INCREMENT_FLAG", "MYSQLI_TIMESTAMP_FLAG", "MYSQLI_SET_FLAG",
"MYSQLI_NUM_FLAG", "MYSQLI_PART_KEY_FLAG", "MYSQLI_GROUP_FLAG",
"MYSQLI_TYPE_DECIMAL", "MYSQLI_TYPE_TINY", "MYSQLI_TYPE_SHORT",
"MYSQLI_TYPE_LONG", "MYSQLI_TYPE_FLOAT", "MYSQLI_TYPE_DOUBLE",
"MYSQLI_TYPE_NULL", "MYSQLI_TYPE_TIMESTAMP", "MYSQLI_TYPE_LONGLONG",
"MYSQLI_TYPE_INT24", "MYSQLI_TYPE_DATE", "MYSQLI_TYPE_TIME",
"MYSQLI_TYPE_DATETIME", "MYSQLI_TYPE_YEAR", "MYSQLI_TYPE_NEWDATE",
"MYSQLI_TYPE_ENUM", "MYSQLI_TYPE_SET", "MYSQLI_TYPE_TINY_BLOB",
"MYSQLI_TYPE_MEDIUM_BLOB", "MYSQLI_TYPE_LONG_BLOB", "MYSQLI_TYPE_BLOB",
"MYSQLI_TYPE_VAR_STRING", "MYSQLI_TYPE_STRING", "MYSQLI_TYPE_CHAR",
"MYSQLI_TYPE_INTERVAL", "MYSQLI_TYPE_GEOMETRY", "MYSQLI_TYPE_NEWDECIMAL",
"MYSQLI_TYPE_BIT", "MYSQLI_RPL_MASTER", "MYSQLI_RPL_SLAVE", "MYSQLI_RPL_ADMIN",
"MYSQLI_NO_DATA", "MYSQLI_DATA_TRUNCATED", "MYSQLI_REPORT_INDEX",
"MYSQLI_REPORT_ERROR", "MYSQLI_REPORT_STRICT", "MYSQLI_REPORT_ALL",
"MYSQLI_REPORT_OFF", "AF_UNIX", "AF_INET", "AF_INET6", "SOCK_STREAM",
"SOCK_DGRAM", "SOCK_RAW", "SOCK_SEQPACKET", "SOCK_RDM", "MSG_OOB",
"MSG_WAITALL", "MSG_PEEK", "MSG_DONTROUTE", "SO_DEBUG", "SO_REUSEADDR",
"SO_KEEPALIVE", "SO_DONTROUTE", "SO_LINGER", "SO_BROADCAST", "SO_OOBINLINE",
"SO_SNDBUF", "SO_RCVBUF", "SO_SNDLOWAT", "SO_RCVLOWAT", "SO_SNDTIMEO",
"SO_RCVTIMEO", "SO_TYPE", "SO_ERROR", "SOL_SOCKET", "SOMAXCONN",
"PHP_NORMAL_READ", "PHP_BINARY_READ", "SOCKET_EINTR", "SOCKET_EBADF",
"SOCKET_EACCES", "SOCKET_EFAULT", "SOCKET_EINVAL", "SOCKET_EMFILE",
"SOCKET_EWOULDBLOCK", "SOCKET_EINPROGRESS", "SOCKET_EALREADY",
"SOCKET_ENOTSOCK", "SOCKET_EDESTADDRREQ", "SOCKET_EMSGSIZE",
"SOCKET_EPROTOTYPE", "SOCKET_ENOPROTOOPT", "SOCKET_EPROTONOSUPPORT",
"SOCKET_ESOCKTNOSUPPORT", "SOCKET_EOPNOTSUPP", "SOCKET_EPFNOSUPPORT",
"SOCKET_EAFNOSUPPORT", "SOCKET_EADDRINUSE", "SOCKET_EADDRNOTAVAIL",
"SOCKET_ENETDOWN", "SOCKET_ENETUNREACH", "SOCKET_ENETRESET",
"SOCKET_ECONNABORTED", "SOCKET_ECONNRESET", "SOCKET_ENOBUFS", "SOCKET_EISCONN",
"SOCKET_ENOTCONN", "SOCKET_ESHUTDOWN", "SOCKET_ETOOMANYREFS",
"SOCKET_ETIMEDOUT", "SOCKET_ECONNREFUSED", "SOCKET_ELOOP",
"SOCKET_ENAMETOOLONG", "SOCKET_EHOSTDOWN", "SOCKET_EHOSTUNREACH",
"SOCKET_ENOTEMPTY", "SOCKET_EPROCLIM", "SOCKET_EUSERS", "SOCKET_EDQUOT",
"SOCKET_ESTALE", "SOCKET_EREMOTE", "SOCKET_EDISCON", "SOCKET_SYSNOTREADY",
"SOCKET_VERNOTSUPPORTED", "SOCKET_NOTINITIALISED", "SOCKET_HOST_NOT_FOUND",
"SOCKET_TRY_AGAIN", "SOCKET_NO_RECOVERY", "SOCKET_NO_DATA",
"SOCKET_NO_ADDRESS", "SOL_TCP", "SOL_UDP", "EACCELERATOR_VERSION",
"EACCELERATOR_SHM_AND_DISK", "EACCELERATOR_SHM", "EACCELERATOR_SHM_ONLY",
"EACCELERATOR_DISK_ONLY", "EACCELERATOR_NONE", "XDEBUG_TRACE_APPEND",
"XDEBUG_TRACE_COMPUTERIZED", "XDEBUG_TRACE_HTML", "XDEBUG_CC_UNUSED",
"XDEBUG_CC_DEAD_CODE", "STDIN", "STDOUT", "STDERR", "DNS_HINFO",
"DNS_PTR", "SQLITE_EMPTY", "SVN_SHOW_UPDATES", "SVN_NO_IGNORE", "MSG_EOF",
"DNS_MX", "GD_EXTRA_VERSION", "PHP_VERSION_ID", "SQLITE_OK",
"LIBXML_LOADED_VERSION", "RADIXCHAR", "OPENSSL_VERSION_TEXT", "OPENSSL_VERSION_NUMBER",
"PCRE_VERSION", "CURLOPT_FILE", "CURLOPT_INFILE", "CURLOPT_URL", "CURLOPT_PROXY",
"CURLE_FUNCTION_NOT_FOUND", "SOCKET_ENOMSG", "CURLOPT_HTTPHEADER", "SOCKET_EIDRM",
"CURLOPT_PROGRESSFUNCTION", "SOCKET_ECHRNG", "SOCKET_EL2NSYNC", "SOCKET_EL3HLT",
"SOCKET_EL3RST", "SOCKET_ELNRNG", "SOCKET_ENOCSI", "SOCKET_EL2HLT", "SOCKET_EBADE",
"SOCKET_EXFULL", "CURLOPT_USERPWD", "CURLOPT_PROXYUSERPWD", "CURLOPT_RANGE",
"CURLOPT_TIMEOUT_MS", "CURLOPT_POSTFIELDS", "CURLOPT_REFERER", "CURLOPT_USERAGENT",
"CURLOPT_FTPPORT", "SOCKET_ERESTART", "SQLITE_CONSTRAINT", "SQLITE_MISMATCH",
"SQLITE_MISUSE", "CURLOPT_COOKIE", "CURLE_SSL_CERTPROBLEM", "CURLOPT_SSLCERT",
"CURLOPT_KEYPASSWD", "CURLOPT_WRITEHEADER", "CURLOPT_SSL_VERIFYHOST",
"CURLOPT_COOKIEFILE", "CURLE_HTTP_RANGE_ERROR", "CURLE_HTTP_POST_ERROR",
"CURLOPT_CUSTOMREQUEST", "CURLOPT_STDERR", "SOCKET_EBADR", "CURLOPT_RETURNTRANSFER",
"CURLOPT_QUOTE", "CURLOPT_POSTQUOTE", "CURLOPT_INTERFACE", "CURLOPT_KRB4LEVEL",
"SOCKET_ENODATA", "SOCKET_ESRMNT", "CURLOPT_WRITEFUNCTION", "CURLOPT_READFUNCTION",
"CURLOPT_HEADERFUNCTION", "SOCKET_EADV", "SOCKET_EPROTO", "SOCKET_EMULTIHOP",
"SOCKET_EBADMSG", "CURLOPT_FORBID_REUSE", "CURLOPT_RANDOM_FILE", "CURLOPT_EGDSOCKET",
"SOCKET_EREMCHG", "CURLOPT_CONNECTTIMEOUT_MS", "CURLOPT_CAINFO", "CURLOPT_CAPATH",
"CURLOPT_COOKIEJAR", "CURLOPT_SSL_CIPHER_LIST", "CURLOPT_BINARYTRANSFER",
"SQLITE_DONE", "CURLOPT_HTTP_VERSION", "CURLOPT_SSLKEY", "CURLOPT_SSLKEYTYPE",
"CURLOPT_SSLENGINE", "CURLOPT_SSLCERTTYPE", "CURLE_OUT_OF_MEMORY", "CURLOPT_ENCODING",
"CURLE_SSL_CIPHER", "SOCKET_EREMOTEIO", "CURLOPT_HTTP200ALIASES", "CURLAUTH_ANY",
"CURLAUTH_ANYSAFE", "CURLOPT_PRIVATE", "CURLINFO_EFFECTIVE_URL", "CURLINFO_HTTP_CODE",
"CURLINFO_HEADER_SIZE", "CURLINFO_REQUEST_SIZE", "CURLINFO_TOTAL_TIME",
"CURLINFO_NAMELOOKUP_TIME", "CURLINFO_CONNECT_TIME", "CURLINFO_PRETRANSFER_TIME",
"CURLINFO_SIZE_UPLOAD", "CURLINFO_SIZE_DOWNLOAD", "CURLINFO_SPEED_DOWNLOAD",
"CURLINFO_SPEED_UPLOAD", "CURLINFO_FILETIME", "CURLINFO_SSL_VERIFYRESULT",
"CURLINFO_CONTENT_LENGTH_DOWNLOAD", "CURLINFO_CONTENT_LENGTH_UPLOAD",
"CURLINFO_STARTTRANSFER_TIME", "CURLINFO_CONTENT_TYPE", "CURLINFO_REDIRECT_TIME",
"CURLINFO_REDIRECT_COUNT", "CURLINFO_PRIVATE", "CURLINFO_CERTINFO",
"SQLITE_PROTOCOL", "SQLITE_SCHEMA", "SQLITE_TOOBIG", "SQLITE_NOLFS",
"SQLITE_AUTH", "SQLITE_FORMAT", "SOCKET_ENOTTY", "SQLITE_NOTADB",
"SOCKET_ENOSPC", "SOCKET_ESPIPE", "SOCKET_EROFS", "SOCKET_EMLINK", "GD_RELEASE_VERSION",
"SOCKET_ENOLCK", "SOCKET_ENOSYS", "SOCKET_EUNATCH", "SOCKET_ENOANO", "SOCKET_EBADRQC",
"SOCKET_EBADSLT", "SOCKET_ENOSTR", "SOCKET_ETIME", "SOCKET_ENOSR", "SVN_REVISION_HEAD",
"XSD_ENTITY", "XSD_NOTATION", "CURLOPT_CERTINFO", "CURLOPT_POSTREDIR", "CURLOPT_SSH_AUTH_TYPES",
"CURLOPT_SSH_PUBLIC_KEYFILE", "CURLOPT_SSH_PRIVATE_KEYFILE", "CURLOPT_SSH_HOST_PUBLIC_KEY_MD5",
"CURLE_SSH", "CURLOPT_REDIR_PROTOCOLS", "CURLOPT_PROTOCOLS", "XSD_NONNEGATIVEINTEGER",
"XSD_BYTE","DNS_SRV","DNS_A6", "DNS_NAPTR", "DNS_AAAA", "FILTER_SANITIZE_FULL_SPECIAL_CHARS",
"ABDAY_1", "SVN_REVISION_UNSPECIFIED", "SVN_REVISION_BASE", "SVN_REVISION_COMMITTED",
"SVN_REVISION_PREV", "GD_VERSION", "MCRYPT_TRIPLEDES", "MCRYPT_ARCFOUR_IV", "MCRYPT_ARCFOUR",
"MCRYPT_BLOWFISH", "MCRYPT_BLOWFISH_COMPAT", "MCRYPT_CAST_128", "MCRYPT_CAST_256",
"MCRYPT_ENIGNA", "MCRYPT_DES", "MCRYPT_GOST", "MCRYPT_LOKI97", "MCRYPT_PANAMA",
"MCRYPT_RC2", "MCRYPT_RIJNDAEL_128", "MCRYPT_RIJNDAEL_192", "MCRYPT_RIJNDAEL_256",
"MCRYPT_SAFER64", "MCRYPT_SAFER128","MCRYPT_SAFERPLUS", "MCRYPT_SERPENT", "MCRYPT_THREEWAY",
"MCRYPT_TWOFISH", "MCRYPT_WAKE", "MCRYPT_XTEA", "MCRYPT_IDEA", "MCRYPT_MARS",
"MCRYPT_RC6", "MCRYPT_SKIPJACK", "MCRYPT_MODE_CBC", "MCRYPT_MODE_CFB", "MCRYPT_MODE_ECB",
"MCRYPT_MODE_NOFB", "MCRYPT_MODE_OFB", "MCRYPT_MODE_STREAM", "CL_EXPUNGE",
"SQLITE_ROW", "POSIX_S_IFBLK", "POSIX_S_IFSOCK", "XSD_IDREF", "ABDAY_2",
"ABDAY_3", "ABDAY_4", "ABDAY_5", "ABDAY_6", "ABDAY_7", "DAY_1", "DAY_2",
"DAY_3", "DAY_4", "DAY_5", "DAY_6", "DAY_7", "ABMON_1", "ABMON_2", "ABMON_3",
"ABMON_4", "ABMON_5", "ABMON_6", "ABMON_7","ABMON_8", "ABMON_9", "ABMON_10",
"ABMON_11", "ABMON_12", "MON_1", "MON_2", "MON_3", "MON_4", "MON_5", "MON_6",
"MON_7", "MON_8", "MON_9", "MON_10", "MON_11", "MON_12", "AM_STR", "PM_STR",
"D_T_FMT", "D_FMT", "T_FMT", "T_FMT_AMPM", "ERA", "ERA_D_T_FMT", "ERA_D_FMT",
"ERA_T_FMT", "ALT_DIGITS", "CRNCYSTR", "THOUSEP", "YESEXPR", "NOEXPR",
"SOCKET_ENOMEDIUM", "GLOB_AVAILABLE_FLAGS", "XSD_SHORT", "XSD_NMTOKENS",
"LOG_LOCAL3", "LOG_LOCAL4", "LOG_LOCAL5", "LOG_LOCAL6", "LOG_LOCAL7",
"DNS_ANY", "DNS_ALL", "SOCKET_ENOLINK", "SOCKET_ECOMM", "SOAP_FUNCTIONS_ALL",
"UNKNOWN_TYPE", "XSD_BASE64BINARY", "XSD_ANYURI", "XSD_QNAME", "SOCKET_EISNAM",
"SOCKET_EMEDIUMTYPE", "XSD_NCNAME", "XSD_ID", "XSD_ENTITIES", "XSD_INTEGER",
"XSD_NONPOSITIVEINTEGER", "XSD_NEGATIVEINTEGER", "XSD_LONG", "XSD_INT",
"XSD_UNSIGNEDLONG", "XSD_UNSIGNEDINT", "XSD_UNSIGNEDSHORT", "XSD_UNSIGNEDBYTE",
"XSD_POSITIVEINTEGER", "XSD_ANYTYPE", "XSD_ANYXML", "APACHE_MAP", "XSD_1999_TIMEINSTANT",
"XSD_NAMESPACE", "XSD_1999_NAMESPACE", "SOCKET_ENOTUNIQ", "SOCKET_EBADFD",
"SOCKET_ESTRPIPE", "T_GOTO", "T_NAMESPACE", "T_NS_C", "T_DIR", "T_NS_SEPARATOR",
"LIBXSLT_VERSION","LIBEXSLT_DOTTED_VERSION", "LIBEXSLT_VERSION", "SVN_AUTH_PARAM_DEFAULT_USERNAME",
"SVN_AUTH_PARAM_DEFAULT_PASSWORD", "SVN_AUTH_PARAM_NON_INTERACTIVE",
"SVN_AUTH_PARAM_DONT_STORE_PASSWORDS", "SVN_AUTH_PARAM_NO_AUTH_CACHE",
"SVN_AUTH_PARAM_SSL_SERVER_FAILURES", "SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO",
"SVN_AUTH_PARAM_CONFIG", "SVN_AUTH_PARAM_SERVER_GROUP",
"SVN_AUTH_PARAM_CONFIG_DIR", "PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS",
"SVN_FS_CONFIG_FS_TYPE", "SVN_FS_TYPE_BDB", "SVN_FS_TYPE_FSFS", "SVN_PROP_REVISION_DATE",
"SVN_PROP_REVISION_ORIG_DATE", "SVN_PROP_REVISION_AUTHOR", "SVN_PROP_REVISION_LOG"
].forEach(function(element, index, array) {
result[element] = token("atom", "php-predefined-constant");
});
// PHP declared classes - output of get_declared_classes(). Differs from http://php.net/manual/en/reserved.classes.php
[ "stdClass", "Exception", "ErrorException", "COMPersistHelper", "com_exception",
"com_safearray_proxy", "variant", "com", "dotnet", "ReflectionException",
"Reflection", "ReflectionFunctionAbstract", "ReflectionFunction",
"ReflectionParameter", "ReflectionMethod", "ReflectionClass",
"ReflectionObject", "ReflectionProperty", "ReflectionExtension", "DateTime",
"DateTimeZone", "LibXMLError", "__PHP_Incomplete_Class", "php_user_filter",
"Directory", "SimpleXMLElement", "DOMException", "DOMStringList",
"DOMNameList", "DOMImplementationList", "DOMImplementationSource",
"DOMImplementation", "DOMNode", "DOMNameSpaceNode", "DOMDocumentFragment",
"DOMDocument", "DOMNodeList", "DOMNamedNodeMap", "DOMCharacterData", "DOMAttr",
"DOMElement", "DOMText", "DOMComment", "DOMTypeinfo", "DOMUserDataHandler",
"DOMDomError", "DOMErrorHandler", "DOMLocator", "DOMConfiguration",
"DOMCdataSection", "DOMDocumentType", "DOMNotation", "DOMEntity",
"DOMEntityReference", "DOMProcessingInstruction", "DOMStringExtend",
"DOMXPath", "RecursiveIteratorIterator", "IteratorIterator", "FilterIterator",
"RecursiveFilterIterator", "ParentIterator", "LimitIterator",
"CachingIterator", "RecursiveCachingIterator", "NoRewindIterator",
"AppendIterator", "InfiniteIterator", "RegexIterator",
"RecursiveRegexIterator", "EmptyIterator", "ArrayObject", "ArrayIterator",
"RecursiveArrayIterator", "SplFileInfo", "DirectoryIterator",
"RecursiveDirectoryIterator", "SplFileObject", "SplTempFileObject",
"SimpleXMLIterator", "LogicException", "BadFunctionCallException",
"BadMethodCallException", "DomainException", "InvalidArgumentException",
"LengthException", "OutOfRangeException", "RuntimeException",
"OutOfBoundsException", "OverflowException", "RangeException",
"UnderflowException", "UnexpectedValueException", "SplObjectStorage",
"XMLReader", "XMLWriter", "mysqli_sql_exception", "mysqli_driver", "mysqli",
"mysqli_warning", "mysqli_result", "mysqli_stmt", "PDOException", "PDO",
"PDOStatement", "PDORow","Closure", "DateInterval", "DatePeriod", "FilesystemIterator",
"GlobIterator", "MultipleIterator", "RecursiveTreeIterator", "SoapClient",
"SoapFault", "SoapHeader", "SoapParam", "SoapServer", "SoapVar", "SplDoublyLinkedList",
"SplFixedArray", "SplHeap", "SplMaxHeap", "SplMinHeap", "SplPriorityQueue",
"SplQueue", "SplStack", "SQLite3", "SQLite3Result", "SQLite3Stmt", "SQLiteDatabase",
"SQLiteException", "SQLiteResult", "SQLiteUnbuffered", "Svn", "SvnNode", "SvnWc",
"SvnWcSchedule", "XSLTProcessor", "ZipArchive",
].forEach(function(element, index, array) {
result[element] = token("t_string", "php-predefined-class");
});
return result;
}();
// Helper regexps
var isOperatorChar = /[+*&%\/=<>!?.|^@-]/;
var isHexDigit = /[0-9A-Fa-f]/;
var isWordChar = /[\w\$_\\]/;
// Wrapper around phpToken that helps maintain parser state (whether
// we are inside of a multi-line comment)
function phpTokenState(inside) {
return function(source, setState) {
var newInside = inside;
var type = phpToken(inside, source, function(c) {newInside = c;});
if (newInside != inside)
setState(phpTokenState(newInside));
return type;
};
}
// The token reader, inteded to be used by the tokenizer from
// tokenize.js (through phpTokenState). Advances the source stream
// over a token, and returns an object containing the type and style
// of that token.
function phpToken(inside, source, setInside) {
function readHexNumber(){
source.next(); // skip the 'x'
source.nextWhileMatches(isHexDigit);
return {type: "number", style: "php-atom"};
}
function readNumber() {
source.nextWhileMatches(/[0-9]/);
if (source.equals(".")){
source.next();
source.nextWhileMatches(/[0-9]/);
}
if (source.equals("e") || source.equals("E")){
source.next();
if (source.equals("-"))
source.next();
source.nextWhileMatches(/[0-9]/);
}
return {type: "number", style: "php-atom"};
}
// Read a word and look it up in the keywords array. If found, it's a
// keyword of that type; otherwise it's a PHP T_STRING.
function readWord() {
source.nextWhileMatches(isWordChar);
var word = source.get();
var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
// since we called get(), tokenize::take won't get() anything. Thus, we must set token.content
return known ? {type: known.type, style: known.style, content: word} :
{type: "t_string", style: "php-t_string", content: word};
}
function readVariable() {
source.nextWhileMatches(isWordChar);
var word = source.get();
// in PHP, '$this' is a reserved word, but 'this' isn't. You can have function this() {...}
if (word == "$this")
return {type: "variable", style: "php-keyword", content: word};
else
return {type: "variable", style: "php-variable", content: word};
}
// Advance the stream until the given character (not preceded by a
// backslash) is encountered, or the end of the line is reached.
function nextUntilUnescaped(source, end) {
var escaped = false;
while(!source.endOfLine()){
var next = source.next();
if (next == end && !escaped)
return false;
escaped = next == "\\" && !escaped;
}
return escaped;
}
function readSingleLineComment() {
// read until the end of the line or until ?>, which terminates single-line comments
// `<?php echo 1; // comment ?> foo` will display "1 foo"
while(!source.lookAhead("?>") && !source.endOfLine())
source.next();
return {type: "comment", style: "php-comment"};
}
/* For multi-line comments, we want to return a comment token for
every line of the comment, but we also want to return the newlines
in them as regular newline tokens. We therefore need to save a
state variable ("inside") to indicate whether we are inside a
multi-line comment.
*/
function readMultilineComment(start){
var newInside = "/*";
var maybeEnd = (start == "*");
while (true) {
if (source.endOfLine())
break;
var next = source.next();
if (next == "/" && maybeEnd){
newInside = null;
break;
}
maybeEnd = (next == "*");
}
setInside(newInside);
return {type: "comment", style: "php-comment"};
}
// similar to readMultilineComment and nextUntilUnescaped
// unlike comments, strings are not stopped by ?>
function readMultilineString(start){
var newInside = start;
var escaped = false;
while (true) {
if (source.endOfLine())
break;
var next = source.next();
if (next == start && !escaped){
newInside = null; // we're outside of the string now
break;
}
escaped = (next == "\\" && !escaped);
}
setInside(newInside);
return {
type: newInside == null? "string" : "string_not_terminated",
style: (start == "'"? "php-string-single-quoted" : "php-string-double-quoted")
};
}
// http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
// See also 'nowdoc' on the page. Heredocs are not interrupted by the '?>' token.
function readHeredoc(identifier){
var token = {};
if (identifier == "<<<") {
// on our first invocation after reading the <<<, we must determine the closing identifier
if (source.equals("'")) {
// nowdoc
source.nextWhileMatches(isWordChar);
identifier = "'" + source.get() + "'";
source.next(); // consume the closing "'"
} else if (source.matches(/[A-Za-z_]/)) {
// heredoc
source.nextWhileMatches(isWordChar);
identifier = source.get();
} else {
// syntax error
setInside(null);
return { type: "error", style: "syntax-error" };
}
setInside(identifier);
token.type = "string_not_terminated";
token.style = identifier.charAt(0) == "'"? "php-string-single-quoted" : "php-string-double-quoted";
token.content = identifier;
} else {
token.style = identifier.charAt(0) == "'"? "php-string-single-quoted" : "php-string-double-quoted";
// consume a line of heredoc and check if it equals the closing identifier plus an optional semicolon
if (source.lookAhead(identifier, true) && (source.lookAhead(";\n") || source.endOfLine())) {
// the closing identifier can only appear at the beginning of the line
// note that even whitespace after the ";" is forbidden by the PHP heredoc syntax
token.type = "string";
token.content = source.get(); // don't get the ";" if there is one
setInside(null);
} else {
token.type = "string_not_terminated";
source.nextWhileMatches(/[^\n]/);
token.content = source.get();
}
}
return token;
}
function readOperator() {
source.nextWhileMatches(isOperatorChar);
return {type: "operator", style: "php-operator"};
}
function readStringSingleQuoted() {
var endBackSlash = nextUntilUnescaped(source, "'", false);
setInside(endBackSlash ? "'" : null);
return {type: "string", style: "php-string-single-quoted"};
}
function readStringDoubleQuoted() {
var endBackSlash = nextUntilUnescaped(source, "\"", false);
setInside(endBackSlash ? "\"": null);
return {type: "string", style: "php-string-double-quoted"};
}
// Fetch the next token. Dispatches on first character in the
// stream, or first two characters when the first is a slash.
switch (inside) {
case null:
case false: break;
case "'":
case "\"": return readMultilineString(inside);
case "/*": return readMultilineComment(source.next());
default: return readHeredoc(inside);
}
var ch = source.next();
if (ch == "'" || ch == "\"")
return readMultilineString(ch);
else if (ch == "#")
return readSingleLineComment();
else if (ch == "$")
return readVariable();
else if (ch == ":" && source.equals(":")) {
source.next();
// the T_DOUBLE_COLON can only follow a T_STRING (class name)
return {type: "t_double_colon", style: "php-operator"};
}
// with punctuation, the type of the token is the symbol itself
else if (/[\[\]{}\(\),;:]/.test(ch)) {
return {type: ch, style: "php-punctuation"};
}
else if (ch == "0" && (source.equals("x") || source.equals("X")))
return readHexNumber();
else if (/[0-9]/.test(ch))
return readNumber();
else if (ch == "/") {
if (source.equals("*"))
{ source.next(); return readMultilineComment(ch); }
else if (source.equals("/"))
return readSingleLineComment();
else
return readOperator();
}
else if (ch == "<") {
if (source.lookAhead("<<", true)) {
setInside("<<<");
return {type: "<<<", style: "php-punctuation"};
}
else
return readOperator();
}
else if (isOperatorChar.test(ch))
return readOperator();
else
return readWord();
}
// The external interface to the tokenizer.
return function(source, startState) {
return tokenizer(source, startState || phpTokenState(false, true));
};
})();
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/php/js/tokenizephp.js | JavaScript | gpl3 | 79,265 |
/*
Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
The copyrights embodied in the content of this file are licensed by
Yahoo! Inc. under the BSD (revised) open source license
@author Dan Vlad Dascalescu <dandv@yahoo-inc.com>
*/
html {
cursor: text;
}
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
}
/*We should define specific styles for every element of the syntax.
the setting below will cause some annoying color to show through if we missed
defining a style for a token. This is also the "color" of the whitespace and
of the cursor.
*/
pre.code, .editbox {
color: red;
}
.editbox p {
margin: 0;
}
span.php-punctuation {
color: blue;
}
span.php-keyword {
color: #770088;
font-weight: bold;
}
span.php-operator {
color: blue;
}
/* __FILE__ etc.; http://php.net/manual/en/reserved.php */
span.php-compile-time-constant {
color: #776088;
font-weight: bold;
}
/* output of get_defined_constants(). Differs from http://php.net/manual/en/reserved.constants.php */
span.php-predefined-constant {
color: darkgreen;
font-weight: bold;
}
/* PHP reserved "language constructs"... echo() etc.; http://php.net/manual/en/reserved.php */
span.php-reserved-language-construct {
color: green;
font-weight: bold;
}
/* PHP built-in functions: glob(), chr() etc.; output of get_defined_functions()["internal"] */
span.php-predefined-function {
color: green;
}
/* PHP predefined classes: PDO, Exception etc.; output of get_declared_classes() and different from http://php.net/manual/en/reserved.classes.php */
span.php-predefined-class {
color: green;
}
span.php-atom {
color: #228811;
}
/* class, interface, namespace or function names, but not $variables */
span.php-t_string {
color: black;
}
span.php-variable {
color: black;
font-weight: bold;
}
span.js-localvariable {
color: #004499;
}
span.php-comment {
color: #AA7700;
font-stretch: condensed;
/* font-style: italic; This causes line height to slightly change, getting line numbers out of sync */
}
span.php-string-single-quoted {
color: #AA2222;
}
/* double quoted strings allow interpolation */
span.php-string-double-quoted {
color: #AA2222;
font-weight: bold;
}
span.syntax-error {
background-color: red;
}
span.deprecated {
font-size: smaller;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/contrib/php/css/phpcolors.css | CSS | gpl3 | 2,439 |
html {
cursor: text;
}
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
pre.code, .editbox {
color: #666666;
}
.editbox p {
margin: 0;
}
span.js-punctuation {
color: #666666;
}
span.js-operator {
color: #666666;
}
span.js-keyword {
color: #770088;
}
span.js-atom {
color: #228811;
}
span.js-variable {
color: black;
}
span.js-variabledef {
color: #0000FF;
}
span.js-localvariable {
color: #004499;
}
span.js-property {
color: black;
}
span.js-comment {
color: #AA7700;
}
span.js-string {
color: #AA2222;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/css/jscolors.css | CSS | gpl3 | 659 |
html {
cursor: text;
}
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
.editbox p {
margin: 0;
}
span.xml-tagname {
color: #A0B;
}
span.xml-attribute {
color: #281;
}
span.xml-punctuation {
color: black;
}
span.xml-attname {
color: #00F;
}
span.xml-comment {
color: #A70;
}
span.xml-cdata {
color: #48A;
}
span.xml-processing {
color: #999;
}
span.xml-entity {
color: #A22;
}
span.xml-error {
color: #F00 !important;
}
span.xml-text {
color: black;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/css/xmlcolors.css | CSS | gpl3 | 597 |
html {
cursor: text;
}
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
pre.code, .editbox {
color: #666;
}
.editbox p {
margin: 0;
}
span.css-at {
color: #708;
}
span.css-unit {
color: #281;
}
span.css-value {
color: #708;
}
span.css-identifier {
color: black;
}
span.css-selector {
color: #11B;
}
span.css-important {
color: #00F;
}
span.css-colorcode {
color: #299;
}
span.css-comment {
color: #A70;
}
span.css-string {
color: #A22;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/css/csscolors.css | CSS | gpl3 | 584 |
html {
cursor: text;
}
.editbox {
margin: .4em;
padding: 0;
font-family: monospace;
font-size: 10pt;
color: black;
}
.editbox p {
margin: 0;
}
span.sp-keyword {
color: #708;
}
span.sp-prefixed {
color: #5d1;
}
span.sp-var {
color: #00c;
}
span.sp-comment {
color: #a70;
}
span.sp-literal {
color: #a22;
}
span.sp-uri {
color: #292;
}
span.sp-operator {
color: #088;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/css/sparqlcolors.css | CSS | gpl3 | 448 |
function waitForStyles() {
for (var i = 0; i < document.styleSheets.length; i++)
if (/googleapis/.test(document.styleSheets[i].href))
return document.body.className += " droid";
setTimeout(waitForStyles, 100);
}
setTimeout(function() {
if (/AppleWebKit/.test(navigator.userAgent) && /iP[oa]d|iPhone/.test(navigator.userAgent)) return;
var link = document.createElement("LINK");
link.type = "text/css";
link.rel = "stylesheet";
link.href = "http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold";
document.documentElement.getElementsByTagName("HEAD")[0].appendChild(link);
waitForStyles();
}, 20);
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/css/font.js | JavaScript | gpl3 | 655 |
body {
font-family: Arial, sans-serif;
line-height: 1.5;
max-width: 64.3em;
margin: 3em auto;
padding: 0 1em;
}
body.droid {
font-family: Droid Sans, Arial, sans-serif;
}
h1 {
letter-spacing: -3px;
font-size: 3.23em;
font-weight: bold;
margin: 0;
}
h2 {
font-size: 1.23em;
font-weight: bold;
margin: .5em 0;
letter-spacing: -1px;
}
h3 {
font-size: 1em;
font-weight: bold;
margin: .4em 0;
}
pre {
font-family: Courier New, monospaced;
background-color: #eee;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
padding: 1em;
}
pre.code {
margin: 0 1em;
}
.grey {
font-size: 2em;
padding: .5em 1em;
line-height: 1.2em;
margin-top: .5em;
position: relative;
}
img.logo {
position: absolute;
right: -25px;
bottom: 4px;
}
a:link, a:visited, .quasilink {
color: #df0019;
cursor: pointer;
text-decoration: none;
}
a:hover, .quasilink:hover {
color: #800004;
}
h1 a:link, h1 a:visited, h1 a:hover {
color: black;
}
ul {
margin: 0;
padding-left: 1.2em;
}
a.download {
color: white;
background-color: #df0019;
width: 100%;
display: block;
text-align: center;
font-size: 1.23em;
font-weight: bold;
text-decoration: none;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
padding: .5em 0;
margin-bottom: 1em;
}
a.download:hover {
background-color: #bb0010;
}
.rel {
margin-bottom: 0;
}
.rel-note {
color: #777;
font-size: .9em;
margin-top: .1em;
}
.logo-braces {
color: #df0019;
position: relative;
top: -4px;
}
.blk {
float: left;
}
.left {
width: 37em;
padding-right: 6.53em;
padding-bottom: 1em;
}
.left1 {
width: 15.24em;
padding-right: 6.45em;
}
.left2 {
width: 15.24em;
}
.right {
width: 20.68em;
}
.leftbig {
width: 42.44em;
padding-right: 6.53em;
}
.rightsmall {
width: 15.24em;
}
.clear:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clear { display: inline-block; }
/* start commented backslash hack \*/
* html .clear { height: 1%; }
.clear { display: block; }
/* close commented backslash hack */
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/codemirror/css/docs.css | CSS | gpl3 | 2,328 |
CKFinder.addPlugin( 'fileeditor', function( api ) {
var regexExt = /^(.*)\.([^\.]+)$/,
regexTextExt = /^(txt|css|html|htm|js|asp|cfm|cfc|ascx|php|inc|xml|xslt|xsl)$/i,
regexCodeMirrorExt = /^(css|html|htm|js|xml|xsl|php)$/i,
codemirror,
file,
fileLoaded = false,
doc;
var codemirrorPath = CKFinder.getPluginPath('fileeditor') + 'codemirror/';
var codeMirrorParsers = {
css : 'parsecss.js',
js : [ 'tokenizejavascript.js', 'parsejavascript.js' ],
xml : 'parsexml.js',
php : ['parsexml.js', 'parsecss.js', 'tokenizejavascript.js', 'parsejavascript.js', '../contrib/php/js/tokenizephp.js', '../contrib/php/js/parsephp.js', '../contrib/php/js/parsephphtmlmixed.js']
};
var codeMirrorCss = {
css : codemirrorPath + 'css/csscolors.css',
js : codemirrorPath + 'css/jscolors.css',
xml : codemirrorPath + 'css/xmlcolors.css',
php : [ codemirrorPath + 'css/xmlcolors.css', codemirrorPath + 'css/jscolors.css', codemirrorPath + 'css/csscolors.css', codemirrorPath + 'contrib/php/css/phpcolors.css' ]
};
codeMirrorCss.xsl = codeMirrorCss.xml;
codeMirrorCss.htm = codeMirrorCss.xml;
codeMirrorCss.html = codeMirrorCss.xml;
codeMirrorParsers.xsl = codeMirrorParsers.xml;
codeMirrorParsers.htm = codeMirrorParsers.xml;
codeMirrorParsers.html = codeMirrorParsers.xml;
var isTextFile = function( file )
{
return regexTextExt.test( file.ext );
};
CKFinder.dialog.add( 'fileEditor', function( api )
{
var height, width;
var saveButton = (function()
{
return {
id : 'save',
label : api.lang.Fileeditor.save,
type : 'button',
onClick : function ( evt ) {
if ( !fileLoaded )
return true;
var dialog = evt.data.dialog;
var content = codemirror ? codemirror.getCode() : doc.getById( 'fileContent' ).getValue();
api.connector.sendCommandPost( "SaveFile", null, {
content : content,
fileName : file.name
},
function( xml ) {
if ( xml.checkError() )
return false;
api.openMsgDialog( '', api.lang.Fileeditor.fileSaveSuccess );
dialog.hide();
return undefined;
},
file.folder.type,
file.folder
);
return false;
}
};
})();
if ( api.inPopup )
{
width = api.document.documentElement.offsetWidth;
height = api.document.documentElement.offsetHeight;
}
else
{
var parentWindow = ( api.document.parentWindow || api.document.defaultView ).parent;
width = parentWindow.innerWidth ? parentWindow.innerWidth : parentWindow.document.documentElement.clientWidth;
height = parentWindow.innerHeight ? parentWindow.innerHeight : parentWindow.document.documentElement.clientHeight;
}
return {
title : api.getSelectedFile().name,
// TODO CKFINDER.DIALOG_RESIZE_BOTH
// resizable : CKFINDER.DIALOG_RESIZE_BOTH,
minWidth : parseInt( width, 10 ) * 0.6,
minHeight : parseInt( height, 10 ) * 0.7,
onHide : function() {
if ( fileLoaded )
{
var fileContent = doc.getById( 'fileContent' );
if ( fileContent )
fileContent.remove();
}
},
onShow : function() {
var dialog = this;
var cssWidth = parseInt( width, 10 ) * 0.6 - 10;
var cssHeight = parseInt( height, 10 ) * 0.7 - 20;
doc = dialog.getElement().getDocument();
var win = doc.getWindow();
doc.getById( 'fileArea' ).setHtml( '<div class="ckfinder_loader_32" style="margin: 100px auto 0 auto;text-align:center;"><p style="height:' + cssHeight + 'px;width:' + cssWidth + 'px;">' + api.lang.Fileeditor.loadingFile + '</p></div>' );
file = api.getSelectedFile();
var enableCodeMirror = regexCodeMirrorExt.test( file.ext );
this.setTitle( file.name );
if ( enableCodeMirror && win.$.CodeMirror === undefined )
{
var head= doc.$.getElementsByTagName( 'head' )[0];
var script= doc.$.createElement( 'script' );
script.type= 'text/javascript';
script.src = CKFinder.getPluginPath( 'fileeditor' ) + 'codemirror/js/codemirror.js';
head.appendChild( script );
}
// If CKFinder is runninng under a different domain than baseUrl, then the following call will fail:
// CKFinder.ajax.load( file.getUrl() + '?t=' + (new Date().getTime()), function( data )...
var url = api.connector.composeUrl( 'DownloadFile', { FileName : file.name, format : 'text', t : new Date().getTime() },
file.folder.type, file.folder );
CKFinder.ajax.load( url, function( data )
{
if ( data === null || ( file.size > 0 && data === '' ) )
{
api.openMsgDialog( '', api.lang.Fileeditor.fileOpenError );
dialog.hide();
return;
}
else
fileLoaded = true;
var fileArea = doc.getById( 'fileArea' );
fileArea.setStyle('height', '100%');
fileArea.setHtml( '<textarea id="fileContent" style="height:' + cssHeight + 'px; width:' + cssWidth + 'px"></textarea>' );
doc.getById( 'fileContent' ).setText( data );
codemirror = null;
if ( enableCodeMirror && win.$.CodeMirror !== undefined )
{
codemirror = win.$.CodeMirror.fromTextArea( doc.getById( 'fileContent').$,
{
height : cssHeight + 'px',
parserfile : codeMirrorParsers[ file.ext.toLowerCase() ],
stylesheet : codeMirrorCss[ file.ext.toLowerCase() ],
path : codemirrorPath + "js/"
}
);
// TODO get rid of ugly buttons and provide something better
var undoB = doc.createElement( "button", { attributes: { "label" : api.lang.common.undo } } );
undoB.on( 'click', function()
{
codemirror.undo();
});
undoB.setHtml( api.lang.common.undo );
undoB.appendTo( doc.getById( 'fileArea' ) );
var redoB = doc.createElement( 'button', { attributes: { "label" : api.lang.common.redo } } );
redoB.on('click', function()
{
codemirror.redo();
});
redoB.setHtml( api.lang.common.redo );
redoB.appendTo( doc.getById( 'fileArea' ) );
}
});
},
contents : [
{
id : 'tab1',
label : '',
title : '',
expand : true,
padding : 0,
elements :
[
{
type : 'html',
id : 'htmlLoader',
html : '' +
'<style type="text/css">' +
'.CodeMirror-wrapping {background:white;}' +
'</style>' +
'<div id="fileArea"></div>'
}
]
}
],
// TODO http://dev.fckeditor.net/ticket/4750
buttons : [ saveButton, CKFinder.dialog.cancelButton ]
};
} );
api.addFileContextMenuOption( { label : api.lang.Fileeditor.contextMenuName, command : "fileEditor" } , function( api, file )
{
api.openDialog( 'fileEditor' );
},
function ( file )
{
var maxSize = 1024;
if ( typeof (CKFinder.config.fileeditorMaxSize) != 'undefined' )
maxSize = CKFinder.config.fileeditorMaxSize;
// Disable for images, binary files, large files etc.
if ( isTextFile( file ) && file.size <= maxSize )
{
if ( file.folder.acl.fileDelete )
return true;
else
return -1;
}
return false;
});
} );
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/plugin.js | JavaScript | gpl3 | 7,324 |
<?php
/*
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
*
* CKFinder extension: prodives command that saves edited file.
*/
if (!defined('IN_CKFINDER')) exit;
/**
* Include base XML command handler
*/
require_once CKFINDER_CONNECTOR_LIB_DIR . "/CommandHandler/XmlCommandHandlerBase.php";
class CKFinder_Connector_CommandHandler_FileEditor extends CKFinder_Connector_CommandHandler_XmlCommandHandlerBase
{
/**
* handle request and build XML
* @access protected
*/
function buildXml()
{
if (empty($_POST['CKFinderCommand']) || $_POST['CKFinderCommand'] != 'true') {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
$this->checkConnector();
$this->checkRequest();
// Saving empty file is equal to deleting a file, that's why FILE_DELETE permissions are required
if (!$this->_currentFolder->checkAcl(CKFINDER_CONNECTOR_ACL_FILE_DELETE)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED);
}
if (!isset($_POST["fileName"])) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_NAME);
}
if (!isset($_POST["content"])) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
$fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($_POST["fileName"]);
$resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
if (!$resourceTypeInfo->checkExtension($fileName)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_EXTENSION);
}
if (!CKFinder_Connector_Utils_FileSystem::checkFileName($fileName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST);
}
$filePath = CKFinder_Connector_Utils_FileSystem::combinePaths($this->_currentFolder->getServerPath(), $fileName);
if (!file_exists($filePath) || !is_file($filePath)) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
}
if (!is_writable(dirname($filePath))) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
}
$fp = @fopen($filePath, 'wb');
if ($fp === false || !flock($fp, LOCK_EX)) {
$result = false;
}
else {
$result = fwrite($fp, $_POST["content"]);
flock($fp, LOCK_UN);
fclose($fp);
}
if ($result === false) {
$this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED);
}
}
/**
* @access public
*/
function onBeforeExecuteCommand( &$command )
{
if ( $command == 'SaveFile' )
{
$this->sendResponse();
return false;
}
return true ;
}
}
$CommandHandler_FileEditor = new CKFinder_Connector_CommandHandler_FileEditor();
$config['Hooks']['BeforeExecuteCommand'][] = array($CommandHandler_FileEditor, "onBeforeExecuteCommand");
$config['Plugins'][] = 'fileeditor';
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/fileeditor/plugin.php | PHP | gpl3 | 3,660 |
/**
* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*
* CKFinder 2.x - sample "dummy" plugin.
*
* To enable it, add the following line to config.js:
* config.extraPlugins = 'dummy';
*/
/**
* See http://docs.cksource.com/ckfinder_2.x_api/symbols/CKFinder.html#.addPlugin
*/
CKFinder.addPlugin( 'dummy', {
lang : [ 'en', 'pl' ],
appReady : function( api ) {
CKFinder.dialog.add( 'dummydialog', function( api )
{
// CKFinder.dialog.definition
var dialogDefinition =
{
title : api.lang.dummy.title,
minWidth : 390,
minHeight : 230,
onOk : function() {
// "this" is now a CKFinder.dialog object.
var value = this.getValueOf( 'tab1', 'textareaId' );
if ( !value ) {
api.openMsgDialog( '', api.lang.dummy.typeText );
return false;
}
else {
alert( "You have entered: " + value );
}
},
contents : [
{
id : 'tab1',
label : '',
title : '',
expand : true,
padding : 0,
elements :
[
{
type : 'html',
html : '<h3>' + api.lang.dummy.typeText + '</h3>'
},
{
type : 'textarea',
id : 'textareaId',
rows : 10,
cols : 40
}
]
}
],
buttons : [ CKFinder.dialog.cancelButton, CKFinder.dialog.okButton ]
};
return dialogDefinition;
} );
api.addFileContextMenuOption( { label : api.lang.dummy.menuItem, command : "dummycommand" } , function( api, file )
{
api.openDialog('dummydialog');
});
}
});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/dummy/plugin.js | JavaScript | gpl3 | 1,751 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKFinder.setPluginLang( 'dummy', 'pl',
{
dummy :
{
title : 'Testowe okienko',
menuItem : 'Otwórz okienko dummy',
typeText : 'Podaj jakiś tekst.'
}
});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/dummy/lang/pl.js | JavaScript | gpl3 | 341 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKFinder.setPluginLang( 'dummy', 'en',
{
dummy :
{
title : 'Dummy dialog',
menuItem : 'Open dummy dialog',
typeText : 'Please type some text.'
}
});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckfinder/plugins/dummy/lang/en.js | JavaScript | gpl3 | 321 |
<?php
include_once('common.inc.php');
func_register(array(
'tweet' => array(
'callback' => 'deal_tweet',
'security' => 'true',
),
));
function tweet_post()
{
$args = func_get_args();
$cate = $args[2];
$content = format_str($_POST['text'], false);
if(!$cate or !$content)
die("Invalid argument!");
include_once('sinaoauth.inc.php');
$c = new WeiboClient(SINA_AKEY, SINA_SKEY, $GLOBALS['user']['sinakey']['oauth_token'], $GLOBALS['user']['sinakey']['oauth_token_secret']);
if($_FILES['upload']['tmp_name'])
$msg = $c -> upload($content, $_FILES['upload']['tmp_name']);
else
$msg = $c -> update($content);
if ($msg === false || $msg === null){
echo "Error occured";
return false;
}
if (isset($msg['error_code']) && isset($msg['error'])){
echo ('Error_code: '.$msg['error_code'].'; Error: '.$msg['error'] );
return false;
}
include_once("uuid.inc.php");
$v4uuid = str_replace("-", "", UUID::v4());
connect_db();
$add = "INSERT INTO pending_tweets (
site_id, tweet_id, user_site_id, content, post_datetime,
type, tweet_site_id,
post_screenname, profile_image_url, source)
VALUES (1, '$v4uuid', '".$msg['user']['id']."', '$content', '".date("Y-m-d H:i:s" ,strtotime($msg["created_at"]))."',
$cate, '".$msg['id']."', '".$msg["user"]["name"]."', '".$msg["user"]["profile_image_url"]."', '".$msg["source"]."')";
if($msg['thumbnail_pic'])
$add = "INSERT INTO pending_tweets (
site_id, tweet_id, user_site_id, content, post_datetime,
type, tweet_site_id,
post_screenname, profile_image_url, source, thumbnail)
VALUES (1, '$v4uuid', '".$msg['user']['id']."', '$content', '".date("Y-m-d H:i:s" ,strtotime($msg["created_at"]))."',
$cate, '".$msg['id']."', '".$msg["user"]["name"]."', '".$msg["user"]["profile_image_url"]."', '".$msg["source"]."', '".$msg['thumbnail_pic']."')";
$added = mysql_query($add) or die("Could not add entry!");
echo "0";
}
function tweet_delete()
{
include_once('login.php');
include_once('sinaoauth.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT tweets.* FROM tweets, (SELECT user_id, user_site_id, site_id FROM accountbindings) AS ac WHERE tweets.user_site_id = ac.user_site_id AND ac.user_id='$id' AND ac.site_id = tweets.site_id AND tweets.tweet_id='$key' AND tweets.deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row or user_is_admin())
{
if($row)
{
$c = new WeiboClient(SINA_AKEY, SINA_SKEY, $GLOBALS['user']['sinakey']['oauth_token'], $GLOBALS['user']['sinakey']['oauth_token_secret']);
$msg = $c -> destroy($row['tweet_site_id']);
}
$view = "UPDATE tweets SET deleted='1' WHERE tweet_id='$key'";
$list = mysql_query($view) or die("Delete error!");
}
else
{
print $key;
die(": Non-exist Error!");
}
}
function deal_tweet($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'tweet_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/tweet.inc.php | PHP | gpl3 | 3,645 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta name="keywords" content="免费发布微博招聘、求职信息,免费定制微职位、微简历" />
<meta name="google-site-verification" content="u38PD1jd9z3R0dAL6Syq-FDaxSZ_qzL6mrxhp-yEhw4" />
<title>歪伯乐微招聘 - 微博招聘、求职、简历信息、一站聚合、定制</title>
<link rel="icon" href="favicon_big.png" sizes="48x48">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="css/share.css" rel="stylesheet" type="text/css" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<link href="css/popupBox.css" rel="stylesheet" type="text/css">
<script src="script/jquery-1.5.1.js" type="text/javascript"></script>
<script src="script/jquery.cookie.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="script/share.js" type="text/javascript"></script>
<script src="script/Copy of default.js" type="text/javascript"></script>
<script src="script/DMshare.js" type="text/javascript"></script>
</head>
<body>
<div id="header">
<div class="left" id="links">
<a class="left first" href="/">歪伯乐招聘网</a> <a class="left" href="http://t.sina.com.cn/2020566725">
歪伯乐招聘官方微博</a> <a class="left logined">我的微博</a>
</div>
<div class="right" id="infos">
<a class="left selected logined" id="name" href="/"></a><a class="left orange logined"
href="/manager" id="manager-center">管理中心</a> <a class="left jobs" id="jobs-publish-quick">
发布求职信息</a><a class="left recruitment" id="recruitment-publish-quick">发布招聘信息</a><a
class="left admin" href="/admin">管理员入口</a> <a class="left logined" href="logout/">退出</a>
<a class="left logouted" id="sina-login" href="login/"></a>
</div>
</div>
<div id="logo-search">
<a id="logo" class="left" href="/">测试版</a>
<div id="search-bar" class="left">
<a class="left" id="sort" onclick="ShowSorts()">全部分类▼</a>
<input class="left" id="search-text" type="text" value="职位关键字,如:北京 产品经理 阿里巴巴" />
<a class="left" id="search-button"></a>
</div>
</div>
<div id="company" class="inner">
<span class="left company-name">热门企业:</span>
<div class="left" id="companies">
<div id="companies-inner">
<a class="company-name first" onclick="HotCompany(this)">新浪</a><a class="company-name"
onclick="HotCompany(this)">腾讯</a><a class="company-name" onclick="HotCompany(this)">百度</a><a
class="company-name" onclick="HotCompany(this)">淘宝</a><a class="company-name" onclick="HotCompany(this)">搜狐</a><a
class="company-name" onclick="HotCompany(this)">创新工场</a><a class="company-name" onclick="HotCompany(this)">凡客</a><a
class="company-name" onclick="HotCompany(this)">海辉软件</a><a class="company-name" onclick="HotCompany(this)">奇艺</a><a
class="company-name" onclick="HotCompany(this)">联想</a><a class="company-name" onclick="HotCompany(this)">华为</a><a
class="company-name" onclick="HotCompany(this)">街旁</a><a class="company-name" onclick="HotCompany(this)">中兴</a><a
class="company-name" onclick="HotCompany(this)">Tom</a><a class="company-name" onclick="HotCompany(this)">网龙</a><a
class="company-name" onclick="HotCompany(this)">网易</a><a class="company-name" onclick="HotCompany(this)">戴尔</a><a
class="company-name" onclick="HotCompany(this)">人民网</a><a class="company-name" onclick="HotCompany(this)">米聊</a><a
class="company-name" onclick="HotCompany(this)">金山</a></div>
</div>
<div class="left" id="company-control">
<a class="left company-control" id="company-control-left">◀</a> <a class="left company-control"
id="company-control-right">▶</a>
</div>
</div>
<div id="content" class="inner">
<div id="left" class="left">
<div id="blank">
</div>
<div class="left-title first logined">
<span class="left-title-text left" id="concern-title">我的关注</span> <a class="right left-title-pic"
id="concern-pic"></a>
</div>
<div id="concern" class="logined">
</div>
<div class="left-title logined">
<span class="left left-title-text">搜索历史</span> <a class="right left-title-pic" id="history-pic"
onmouseover="HistoryPicMouseOver(this)" onmouseout="HistoryPicMouseOut(this)"
onclick="HistoryPicClick()"></a>
</div>
<div id="history" class="logined">
</div>
<div id="hot">
</div>
</div>
<div id="right" class="left">
<div id="radio">
</div>
<div id="microblogs">
<div id="search-result-outer">
<div id="search-result">
<div class="left">
</div>
<a id="search-result-rss" class="right"></a><a id="search-result-concern" class="right search-result-concern"
onmouseover="SearchConcernMouseOver(this)" onmouseout="SearchConcernMouseOut(this)"
onmousedown="SearchConcernMouseDown(this)" onclick="SearchConcernClick()"></a>
</div>
</div>
<div id="fresh-outer">
<div id="fresh">
</div>
</div>
<div id="fresh-blogs" style="display: none; border-bottom: 1px #dedede solid">
</div>
<div id="blogs">
</div>
<div id="flower" style="text-align: center; display: none;">
<img src="images/loading.gif" alt="" />正在加载中...
</div>
<div id="pages">
</div>
</div>
</div>
</div>
<div id="footer" class="inner">
<div id="footerlinks">
<a href="/help">网站帮助</a> | <a href="/feedback">意见反馈</a> | <a>联系我们</a></div>
<div id="copyright">
CopyRight © 2011-2012 <a>歪伯乐招聘网</a> Co. All Right Reserved. 鄂ICP证100111号<br />
Powered by:GNG</div>
</div>
<div id="sorts" class="absolute">
<div id="sorts-tag">
<a id="sorts-name" class="left" onclick="HideSorts()">全部分类▼</a>
</div>
<div id="sorts-content">
</div>
</div>
<div id="popBox_apply0" class="popBox popBoxwd1 absolute" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
职位申请</h4>
</div>
<div class="popboxicon btn_close">
<a class="left" style="height: 100%; width: 100%;" onclick="$('#popBox_apply0').hide();">
</a>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_err">
</div>
<div class="font_tip">
还没完善简历?</div>
</div>
<div class="line2">
<div class="font_tip2">
提示:完整的简历会加大您录取的概率哟!</div>
</div>
<div class="line3">
<a class="popboxicon btn_goresume"></a>
</div>
</div>
</div>
<div id="popBox_apply1" class="popBox popBoxwd2 absolute" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
职位申请</h4>
</div>
<div class="popboxicon btn_close">
<a class="left" style="height: 100%; width: 100%;" onclick="$('#popBox_apply1').hide();">
</a>
</div>
</div>
<div class="popBox_main">
<div class="line0">
<span class="font_tip2 fl" id="at-name">@赶集网</span><span class="fr">还可输入<span class="font_tip3"
id="remain-number">115</span>个字</span>
</div>
<div id="text_apply" class="line1">
<textarea rows="4" id="resumeinput" onkeydown="UpdateResumeText(this)" onkeyup="UpdateResumeText(this)"></textarea></div>
<div class="line3">
<div class="add_resume">
<input type="radio" name="def_resume" checked="checked" />
<a href="" target="_blank" class="font_tip2 udl" id="default-resume">默认简历</a> <span>
(<span class="font_tip2">*</span>系统将自动为您附上您的简历)</span>
</div>
<div id="btn_publish" class="popboxicon btn_publish">
<a class="left" style="height: 100%; width: 100%;" onclick="SentResume()"></a>
</div>
</div>
</div>
</div>
<div id="popBox_publishok" class="popBox popBoxwd1" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
信息发布提示</h4>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_tip">
</div>
<div class="font_tip">
信息发布成功!</div>
</div>
<div class="line2">
<div class="font_tip2" style="line-height: 18px;">
信息已同步到新浪微博,本信息将在稍后显示<br>
在本网站中,请不要重复发布。</div>
</div>
<div class="line3">
<a class="popboxicon btn_ikown" onclick="$('#popBox_publishok').hide();">好的,我知道了</a></div>
</div>
</div>
<div id="cover">
</div>
<div id="role-choose" class="absolute role-jobs">
<a id="role-jobs" class="absolute"></a><a id="role-recruitment" class="absolute">
</a><a id="role-confirm" class="absolute"></a>
</div>
<div id="jobs-publish" class="absolute">
<div id="jobs-publish-title">
<span class="left">发布求职信息</span> <a class="right"></a>
</div>
<div id="jobs-publish-content">
<div id="jobs-publish-remain">
还可输入136个字</div>
<div id="jobs-publish-text">
<textarea>#求职#</textarea>
</div>
<div id="jobs-publish-tags-hot">
</div>
<div id="jobs-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="recruitment-publish" class="absolute">
<div id="recruitment-publish-title">
<span class="left">发布招聘信息</span> <a class="right"></a>
</div>
<div id="recruitment-publish-content">
<div id="recruitment-publish-remain">
还可输入136个字</div>
<div id="recruitment-publish-text">
<textarea>#招聘#</textarea>
</div>
<div id="recruitment-publish-tags-hot">
</div>
<div id="recruitment-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="backTop" class="absolute">
<a>▲回到顶部</a>
</div>
<div id="manager-tips" class="absolute">
<a class="right" onclick="CloseMTips()"></a>
</div>
<div id="concern-tips" class="absolute">
<a class="right" onclick="CloseCTips()"></a>
</div>
<div id="apply-tips" class="absolute">
<a class="right" onclick="CloseATips()"></a>
</div>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/Copy of default.html | HTML | gpl3 | 13,240 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>管理中心 - 歪伯乐微招聘 - 微博招聘、求职、简历信息,一站聚合、管理、定制</title>
<link rel="icon" href="favicon_big.png" sizes="48x48">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="css/themes/base/jquery.ui.all.css" rel="Stylesheet" type="text/css" />
<link href="css/share.css" rel="stylesheet" type="text/css" />
<link href="css/manager.css" rel="stylesheet" type="text/css" />
<script src="script/jquery-1.5.1.js" type="text/javascript"></script>
<script src="ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="ckfinder/ckfinder.js" type="text/javascript"></script>
<script src="script/jquery.query-2.1.7.js" type="text/javascript"></script>
<script src="script/jquery.cookie.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.resizable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.dialog.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.datepicker.js" type="text/javascript"></script>
<script src="script/ui/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<script src="script/share.js" type="text/javascript"></script>
<script src="script/DMshare.js" type="text/javascript"></script>
<script src="script/manager.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20911105-2']);
_gaq.push(['_setDomainName', '.ybole.com']);
_gaq.push(['_trackPageview']);
$(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
});
</script>
</head>
<body>
<div id="delete-dialog" title="提示">
<p>
确定删除这条信息吗?</p>
</div>
<div id="header">
<div class="left" id="links">
<a class="left" href="/">歪伯乐招聘网</a> <a class="left" href="http://t.sina.com.cn/2020566725">
歪伯乐招聘官方微博</a> <a class="left last">我的微博</a>
</div>
<div class="right" id="infos">
<a class="left logined" id="name" href="/"></a><a class="left selected orange logined"
href="/manager">管理中心</a> <a class="left jobs" id="jobs-publish-quick">发布求职信息</a><a
class="left recruitment" id="recruitment-publish-quick">发布招聘信息</a><a class="left admin"
href="/admin">管理员入口</a> <a class="left logined" href="logout/">退出</a>
<a class="left logouted" id="sina-login" href="login/"></a>
</div>
</div>
<div id="logo-search">
<a id="logo" class="left" href="/">测试版</a>
<div id="search-bar" class="left">
<a class="left sort" id="sort">全部分类</a><a class="left sort" id="sort-triangle">▼</a>
<input class="left" id="search-text" type="text" value="职位关键字,如:北京 产品经理 阿里巴巴" />
<a class="left" id="search-button"></a>
</div>
</div>
<div id="company" class="inner">
<div class="clear">
</div>
<span class="left company-name">热门企业:</span>
<div class="left" id="companies">
<div id="companies-inner">
<a class="company-name">新浪</a><a class="company-name">腾讯</a><a class="company-name">百度</a><a
class="company-name">淘宝</a><a class="company-name">搜狐</a><a class="company-name">创新工场</a><a
class="company-name">凡客</a><a class="company-name">海辉软件</a><a class="company-name">奇艺</a><a
class="company-name">联想</a><a class="company-name">华为</a><a class="company-name">街旁</a><a
class="company-name">中兴</a><a class="company-name">Tom</a><a class="company-name">网龙</a><a
class="company-name">网易</a><a class="company-name">戴尔</a><a class="company-name">人民网</a><a
class="company-name">米聊</a><a class="company-name last">金山</a></div>
</div>
<div class="left" id="company-control">
<a class="left company-control" id="company-control-left">◀</a> <a class="left company-control"
id="company-control-right">▶</a>
</div>
</div>
<div id="manager-title" class="inner">
<span class="left manager-title">管理中心</span> <span class="left manager-title-tag recruitment">
我是招聘者</span> <span class="left manager-title-tag jobs">我是求职者</span>
</div>
<div id="manager-content" class="inner">
<div id="content-left" class="left">
<div id="manager-control">
<a class="manager-control left jobs manager-control-choose" onclick="ShowNormal(0)">
我发布的信息</a> <a class="manager-control left jobs" onclick="ShowApply(0)">申请记录</a>
<a class="manager-control left jobs" onclick="ShowFavourite(0)">职位收藏</a> <a class="manager-control left jobs"
onclick="ShowProfile()" id="myprofile">个人简历</a> <a class="manager-control left recruitment manager-control-choose"
onclick="ShowNormal(0)">我发布的信息</a><a class="manager-control left recruitment" onclick="ShowApplys(0)">收到的职位申请</a><a
class="manager-control left recruitment" onclick="ShowFavourite(0)">职位收藏</a>
</div>
<a id="jobs-publish-button" class="publish-button jobs left"></a><a id="recruitment-publish-button"
class="publish-button recruitment left"></a>
</div>
<div id="content-middle" class="left">
<div id="blogs">
<div id="content-middle-delete">
<span id="blogs-count" class="left"></span>
<!--<a class="right">删除全部</a>-->
</div>
<div id="blogsinner">
</div>
<div id="pages">
</div>
</div>
<div id="profile">
<div id="profile-title">
<span class="left" id="title">编辑个人简历</span><span class="right" id="lasttime">最后更新:2011年3月18日</span></div>
<div class="profile-detail-title">
<span class="left">个人信息</span><!--<a class="right">修 改</a>-->
</div>
<div class="profile-content" id="info-content">
<div id="info-content-left" class="left">
<span class="info-content-title left">姓名:</span>
<input class="info-content-words left" type="text" title="姓名" value="姓名" id="u-name" />
<span class="info-content-title left">性别:</span>
<div class="left" style="height: 30px; line-height: 30px; width: 170px; padding-left: 30px">
<input type="radio" title="性别" value="男" name="dsex" checked="checked" />男
<input type="radio" title="性别" value="女" name="dsex" style="margin-left: 10px;" />女</div>
<span class="info-content-title left">出生日期:</span>
<input class="info-content-words left" type="text" title="" value="1980-01-01" id="birthday" />
<span class="info-content-title left">现居地:</span>
<input class="info-content-words left" type="text" title="现居地" value="现居地" id="n-positon" />
<span class="info-content-title left">户口地:</span>
<input class="info-content-words left" type="text" title="户口地" value="户口地" id="o-positon" />
<span class="info-content-title left">手机:</span>
<input class="info-content-words left" type="text" title="手机" value="手机" id="m-phone" />
<span class="info-content-title left">邮件:</span>
<input class="info-content-words left" type="text" title="邮件" value="邮件" id="email" />
</div>
<div id="info-content-right" class="left">
<div id="info-pic">
<img id="headpic" alt="" height="94" width="94" src="images/Thumb.gif" />
<!--<div>
<a>更改头像</a></div>-->
</div>
<div id="info-pic-control">
<input type="checkbox" />在简历中显示</div>
</div>
</div>
<div>
<textarea id="profile-detail"></textarea>
</div>
<!--<div class="profile-detail-title">
<span class="left">教育经历</span> <a class="right">添 加</a>
</div>
<div class="profile-content" id="education-info">
<div class="education-item education-header">
<span class="school left">毕业学校</span> <span class="time left">就读时间</span> <span class="education left">
学历</span> <span class="major left">专业</span>
</div>
<div class="education-item education-item-over">
<span class="school left">华中科技大学</span> <span class="time left">2007-09到2011-06</span>
<span class="education left">本科</span> <span class="major left">计算机</span>
</div>
</div>
<div class="profile-detail-title">
<span class="left">语言能力</span> <a class="right">添 加</a> <a
class="right">隐 藏</a>
</div>
<div class="profile-detail-title">
<a class="right">添 加</a> <a class="right">隐 藏</a>
</div>
<div class="profile-detail-title">
<a class="right">添 加</a> <a class="right">隐 藏</a>
</div>-->
</div>
</div>
<div id="content-right" class="left">
<div id="ads">
<!--<div id="right-title">
推广企业</div>
<div class="ad-title">
<a>某某互联网公司</a></div>
<div class="ad-content">
北京,招聘产品经理,待遇从优</div>
<div class="ad-address">
<a>http://sinaurl.cn/YLKd</a></div>
<div class="ad-title">
<a>某某互联网公司</a></div>
<div class="ad-content">
北京,招聘产品经理,待遇从优</div>
<div class="ad-address">
<a>http://sinaurl.cn/YLKd</a></div>
<div class="ad-title">
<a>某某互联网公司</a></div>
<div class="ad-content">
北京,招聘产品经理,待遇从优</div>
<div class="ad-address">
<a>http://sinaurl.cn/YLKd</a></div>-->
</div>
<div id="profile-control">
<a id="profile-preview" class="left"></a><a id="profile-save" class="left"></a>
</div>
</div>
</div>
<div class="clear">
</div>
<div id="footer" class="inner">
<div id="footerlinks">
<a href="/help">网站帮助</a> | <a href="/feedback">意见反馈</a> | <a>联系我们</a></div>
<div id="copyright">
CopyRight © 2011-2012 <a>歪伯乐招聘网</a> Co. All Right Reserved. 鄂ICP证100111号<br />
Powered by:GNG</div>
</div>
<div id="sorts" class="absolute">
<div id="sorts-tag">
<a id="sorts-name" class="left">全部分类</a><a id="sorts-triangle" class="left">▼</a>
</div>
<div id="sorts-content">
</div>
</div>
<div id="cover">
</div>
<div id="jobs-publish" class="absolute">
<div id="jobs-publish-title">
<span class="left">发布求职信息</span> <a class="right"></a>
</div>
<div id="jobs-publish-content">
<div id="jobs-publish-remain">
还可输入136个字</div>
<div id="jobs-publish-text">
<textarea>#求职#</textarea>
</div>
<div id="jobs-publish-tags-hot">
</div>
<div id="jobs-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="recruitment-publish" class="absolute">
<div id="recruitment-publish-title">
<span class="left">发布招聘信息</span> <a class="right"></a>
</div>
<div id="recruitment-publish-content">
<div id="recruitment-publish-remain">
还可输入136个字</div>
<div id="recruitment-publish-text">
<textarea>#招聘#</textarea>
</div>
<div id="recruitment-publish-tags-hot">
</div>
<div id="recruitment-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="published-info" title="发布成功">
<p>
信息发布成功!本信息已同步发布到新浪微博。</p>
<p>
您发布的信息将在一段时间之后显示在网站中,请不要重复发布。</p>
</div>
<div id="profile-info" title="保存成功">
<p>
简历保存成功!</p>
</div>
<form id="ResumeForm" action="resume/preview" method="post" target="_blank">
<input type="hidden" name="name" id="h-name" />
<input type="hidden" name="sex" id="h-sex" checked="false" />
<input type="hidden" name="date_birth" id="date_birth" />
<input type="hidden" name="live_in_now" id="live_in_now" />
<input type="hidden" name="live_in" id="live_in" />
<input type="hidden" name="cellphone" id="cellphone"/>
<input type="hidden" name="email" id="h-email" />
<input type="hidden" name="content" id="h-content" />
</form>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/Copy of manager.html | HTML | gpl3 | 16,236 |
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/resume.html | HTML | gpl3 | 3 |
function AfterLogin() {
$.ajax({
type: 'POST',
url: 'user/info/',
success: function (msg) {
msg = $.trim(msg);
var username = msg.split(',')[0];
var type = msg.split(',')[1];
$("#name").html(username);
$("#my-microbloging").attr("href", "http://weibo.com/n/" + encodeURIComponent(username));
$("#name").attr("href", "profile/" + encodeURIComponent(username));
if (type == 1) {
$(".jobs").show();
}
else if (type == 2) {
$(".recruitment").show();
}
else if (type == 99) {
$(".recruitment").show();
$(".admin").show();
}
}
});
}
$(function () {
$("div#feedback-info").dialog({
autoOpen: false,
buttons: {
"确定": function () {
$(this).dialog("close");
}
}
});
$("div#inner-content a").click(function () {
question: $("#question").val("");
description: $("#description").val("");
email: $("#email").val("");
$("div#feedback-info").dialog("open");
$.ajax({
type: 'POST',
url: 'feedback/post',
data: {
question: $("#question").val(),
description: $("#description").val(),
email: $("#email").val()
},
success: function (msg) {
}
});
});
}); | 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/help_feedback.js | JavaScript | gpl3 | 1,589 |
var MR = false;
var ML = false;
var position = 0;
var length = 0;
$(function () {
SetCompany();
});
var appyId = "";
var theItem;
function SentResume() {
$(theItem).hide();
$(theItem).next().show();
$("#popBox_apply1").hide();
$.ajax({
type: 'GET',
url: 'apply_sent/add/' + appyId,
success: function (msg) {
}
});
}
function JobApply(item, id, name) {
var userid;
appyId = id;
theItem = item;
$.ajax({
type: 'GET',
url: 'resume/current',
success: function (msg) {
userid = $.trim(msg);
$.ajax({
type: 'GET',
url: 'resume/show/' + userid,
success: function (resume) {
if (resume.indexOf("<html") != -1) {
$("#default-resume").attr("href", "resume/show/" + userid);
$("#at-name").html("@" + name);
$("#popBox_apply1").show();
}
else {
$("#popBox_apply0").show();
}
}
});
}
});
}
function JobUnApply(item, id) {
$.ajax({
type: 'GET',
url: 'apply_sent/delete/' + id,
success: function (msg) {
$(item).hide();
$(item).prev().show();
}
});
}
function UpdateResumeText(e) {
if (115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) {
$("#remain-number").html((115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2)));
}
else {
$("#remain-number").html((Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2 - 115)));
}
}
function CompanyMR() {
if (position + 840 < length) {
$("#companies-inner").animate({ "left": "-=2" }, 10, "linear", function () {
position += 2;
if (MR) {
CompanyMR();
}
});
}
}
function CompanyML() {
if (position > 0) {
$("#companies-inner").animate({ "left": "+=2" }, 10, "linear", function () {
position -= 2;
if (ML) {
CompanyML();
}
});
}
}
function SetCompany() {
$("#company-control-right").animate({ opacity: 0.4 }, 0);
$("#company-control-left").animate({ opacity: 0.4 }, 0);
$("#company-control-right").mouseover(function () {
if (!MR) {
MR = true;
CompanyMR();
}
$(this).stop().animate({ opacity: 1 }, 0);
});
$("#company-control-right").mouseout(function () {
if (MR) {
MR = false;
}
$(this).stop().animate({ opacity: 0.4 }, 0);
});
$("#company-control-left").mouseover(function () {
if (!ML) {
ML = true;
CompanyML();
}
$(this).stop().animate({ opacity: 1 }, 0);
});
$("#company-control-left").mouseout(function () {
if (ML) {
ML = false;
}
$(this).stop().animate({ opacity: 0.4 }, 0);
});
length = $("a.company-name:last").position().left + $("a.company-name:last").outerWidth("ture");
}
function SetTheSorts() {
$("div#sorts").position({
of: $("a#sort"),
my: "left top",
at: "left top",
offset: "-5 -10",
collision: "none none"
});
$("div#sorts").css("top", "78px");
$.ajax({
type: "POST",
url: 'cate',
success: function (msg) {
$("#sorts-content").html(msg);
$(".sorts-item").mouseover(function () { $(this).addClass("sorts-item-over") });
$(".sorts-item").mouseout(function () { $(this).removeClass("sorts-item-over") });
$(".sorts-item a").click(function () {
$("a#sorts-name").html($(this).html());
$("a#sort").html($(this).html());
$("#sorts").fadeOut(200);
cate = $(this).attr("id");
});
}
});
$("#sorts-name").click(function () { $("#sorts").fadeOut(200) });
$("#sorts-triangle").click(function () { $("#sorts").fadeOut(200) });
$("#sort-triangle").click(function () { $("#sorts").fadeIn(200) });
$("#sort").click(function () { $("#sorts").fadeIn(200) });
$("body").click(function (e) {
if (e.pageX >= $("#sorts").offset().left && e.pageX <= $("#sorts").offset().left + $("#sorts").width() && e.pageY >= $("#sorts").offset().top && e.pageY <= $("#sorts").offset().top + $("#sorts").height()) {
}
else {
$("#sorts").fadeOut(200);
}
});
}
function SetSorts() {
$.ajax({
type: 'GET',
url: 'cate',
success: function (msg) {
$("#sorts-content").html(msg);
$(".sorts-item").mouseover(function () { $(this).addClass("sorts-item-over") });
$(".sorts-item").mouseout(function () { $(this).removeClass("sorts-item-over") });
$(".sorts-item a").click(function () {
$("a#sorts-name").html($(this).html());
$("a#sort").html($(this).html() + "▼");
$("a#sort").attr("name", $(this).attr("id"));
$("a#sort").attr("title", $(this).html());
$("#sorts").fadeOut(200);
cate = $(this).attr("id");
});
}
});
$("div#sorts").position({
of: $("a#sort"),
my: "left top",
at: "left top",
offset: "-5 -10",
collision: "none none"
});
$("#sorts-name").click(function () { $("#sorts").fadeOut(200) });
$("#sorts-triangle").click(function () { $("#sorts").fadeOut(200) });
$("#sort-triangle").click(function () { $("#sorts").fadeIn(200) });
$("#sort").click(function () { $("#sorts").fadeIn(200) });
$("body").click(function (e) {
if (e.pageX >= $("#sorts").offset().left && e.pageX <= $("#sorts").offset().left + $("#sorts").width() && e.pageY >= $("#sorts").offset().top && e.pageY <= $("#sorts").offset().top + $("#sorts").height()) {
}
else {
$("#sorts").fadeOut(200);
}
});
}
function ShowSorts() {
$("div#sorts").show();
} | 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/DMshare.js | JavaScript | gpl3 | 6,437 |
//Init - default.js
currentsearch = 0;
function guidGenerator() {
var S4 = function () {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}
function ShowMiddlePic(url) {
$("#LPic").html('<img style="margin-top:9px;margin-left:9px;" src="images/loading.gif" alt="" />');
loagflag = false;
var obj = new Image();
obj.src = url;
var $window = jQuery(window);
var temp = ($window.width() - 50) / 2;
var controlx = temp >= 0 ? temp : 0;
temp = ($window.height() - 50) / 2;
var controly = $window.scrollTop() + (temp >= 0 ? temp : 0);
$("#LPic").css({ left: controlx + 'px', top: controly + 'px', height: '50px', width: '50px' });
CoverResize();
$("div#cover").fadeIn(200);
$("#LPic").fadeIn(200);
$("div#cover").click(function () { HidePic(); });
$("body").keyup(function (e) {
if (e.which == 27) {
HidePic();
}
});
$("body").css("overflow", "hidden");
obj.onload = function () {
temp = ($window.width() - obj.width) / 2;
controlx = temp >= 0 ? temp : 0;
temp = ($window.height() - obj.height) / 2;
controly = $window.scrollTop() + (temp >= 0 ? temp : 0);
$("#LPic").css({ left: controlx + 'px', top: controly + 'px', height: obj.height + 'px', width: obj.width + 'px' });
if (!loagflag) {
$("#LPic").html('<a target="_blank" href="' + url.replace("bmiddle", "large") + '"><img src="' + url + '" alt="" /></a>');
}
}
}
var loagflag = false;
function HidePic() {
loagflag = true;
$("div#cover").unbind("click");
$("body").unbind("keyup");
$("body").css("overflow", "auto");
$("div#cover").fadeOut(200);
$("#LPic").fadeOut(200);
$("#LPic").html("");
}
$(function () {
$("#LPic").draggable();
$("#history-pic").animate({ opacity: 0.6 }, 0);
SetHot();
SetSorts();
InitBoxes();
$.ajax({
type: 'GET',
url: 'count/show',
success: function (msg) {
$("div#radio").html("本周新增职位" + $.trim(msg).split(',')[0] + "个,今日新增职位" + $.trim(msg).split(',')[1] + "个");
}
});
$("#search-text").keypress(function (e) {
if (e.which == 13) {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") {
SearchContent(false, $("#search-text").val(), $("#sort").attr("name"), 0);
}
}
});
$("#search-text").keydown(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
//if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) {
// $(this).val($(this).val().replace("#", "").replace("&", "").replace("?", ""));
//}
});
$("#search-text").keyup(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
//if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) {
// $(this).val($(this).val().replace("#", "").replace("&", "").replace("?", ""));
//}
});
$("a#search-button").click(function () {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") {
SearchContent(false, $("#search-text").val(), $("#sort").attr("name"), 0);
}
});
$("div#backTop").click(function () {
$("html, body").animate({ scrollTop: 0 }, 1000);
});
$("div#backTop").animate({ opacity: 0.6 }, 0);
$("div#backTop").mouseover(function () {
$("div#backTop").stop().animate({ opacity: 1 }, 200);
});
$("div#backTop").mouseout(function () {
$("div#backTop").stop().animate({ opacity: 0.6 }, 200);
});
setTimeout(function () { GetNewerBlogs(); }, 60000);
SetRolePicker();
if ($.cookie("athere") == null) {
$.cookie("athere", "here", { path: '/' });
setTimeout(function () {
$("#radio").slideUp(200);
}, 30000);
}
else {
$("#radio").hide();
}
$("a.btn_goresume").click(function () {
document.location = "manager?type=profile";
});
if($.query.get("errormsg") != ""){
showError(decodeURI($.query.get("errormsg")));
}
if ($.query.get("search") != "") {
var text = $.trim($.query.get("search"));
var cate = $.trim($.query.get("cat"));
SetCate(cate);
if (text != "职位关键字,如:北京 产品经理 阿里巴巴" && text != "") {
SearchContent(false, text, cate, 0);
}
}
else {
SearchContent(true, "all", 0, 0);
}
var $window = jQuery(window);
var temp = ($window.scrollLeft() + $window.width() - 962) / 2;
var controlx = 944 + (temp >= 0 ? temp : 0);
var controly = $window.scrollTop() + $window.height() - 100;
$("div#backTop").css({ left: controlx + 'px', top: controly + 'px' });
$("div#backTop").css("position", "fixed");
// if (!($.browser.msie && $.browser.version == "6.0")) {
// $("div#backTop").position({
// of: $("div#microblogs"),
// my: "left top",
// at: "right top",
// offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
// collision: "none none"
// });
// $("div#backTop").css("position", "absolute");
// }
$(window).resize(function () {
var $window = jQuery(window);
var temp = ($window.scrollLeft() + $window.width() - 962) / 2;
var controlx = 944 + (temp >= 0 ? temp : 0);
var controly = $window.height() - 100;
$("div#backTop").css({ left: controlx + 'px', top: controly + 'px' });
});
});
//End of Init
function CloseMTips() {
$("#manager-tips").fadeOut(200);
}
function CloseCTips() {
$("#concern-tips").fadeOut(200);
}
function CloseATips() {
$("#apply-tips").fadeOut(200);
}
//After User Login - default.js
function AfterLogin() {
$.ajax({
type: 'POST',
url: '/user/info/',
success: function (msg) {
msg = $.trim(msg);
var username = msg.split(',')[0];
var type = msg.split(',')[1];
$("#name").html(username);
$("#my-microbloging").attr("href", "http://weibo.com/n/" + encodeURIComponent(username));
$("#name").attr("href", "profile/" + encodeURIComponent(username));
if (type == -1) {
CoverResize();
$("div#cover").show();
$("div#role-choose").show();
}
else if (type == 1) {
$(".jobs").show();
}
else if (type == 2) {
$(".recruitment").show();
}
else if (type == 99) {
$(".recruitment").show();
$(".admin").show();
}
}
});
RefreshConcern();
RefreshHistory();
}
//End of After User Login
//Concern Event - default.js
function ConcernMouseOver(item) {
$(item).addClass("concern-item-over");
}
function ConcernMouseOut(item) {
$(item).removeClass("concern-item-over");
}
function ConcernDeleteClick(id, content, item) {
$.ajax({
type: 'GET',
url: 'follow/delete/' + id,
success: function (msg) {
$(item).parent().hide();
if (searchContent == content) {
concernFlag = false;
$("#search-result-concern").attr("class", "right search-result-concern");
}
}
});
}
function ConcernContentClick(cate, content) {
SetCate(cate);
SearchContent(false, content, cate, 0);
}
function RefreshConcern() {
$("#concern").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("#concern").height() - 32) / 2) + 'px;margin-bottom:' + (($("#concern").height() - 32) / 2) + 'px;" />');
$.ajax({
type: 'GET',
url: 'follow/show',
success: function (msg) {
if (msg == null || msg == "") {
$("#concern").html("尚未有关注项?试试搜索,有新发现哟!");
$("#concern").css("color", "#878787");
$("#concern").css("text-align", "center");
} else {
$("#concern").html(msg);
}
}
});
}
//End of Concern Event
function SetCate(cate) {
switch (cate) {
case "0":
$("#sort").html("全部分类▼");
$("#sorts-name").html("全部分类");
$("a#sort").attr("title", "全部分类");
break;
case "1":
$("#sort").html("互联网▼");
$("#sorts-name").html("互联网");
$("a#sort").attr("title", "互联网");
break;
case "2":
$("#sort").html("移动互联网▼");
$("#sorts-name").html("移动互联网");
$("a#sort").attr("title", "移动互联网");
break;
case "3":
$("#sort").html("网络游戏▼");
$("#sorts-name").html("网络游戏");
$("a#sort").attr("title", "网络游戏");
break;
case "4":
$("#sort").html("电子商务▼");
$("#sorts-name").html("电子商务");
$("a#sort").attr("title", "电子商务");
break;
case "5":
$("#sort").html("软件·电信▼");
$("#sorts-name").html("软件·电信");
$("a#sort").attr("title", "软件·电信");
break;
case "6":
$("#sort").html("新媒体▼");
$("#sorts-name").html("新媒体");
$("a#sort").attr("title", "新媒体");
break;
case "7":
$("#sort").html("投资·银行▼");
$("#sorts-name").html("投资·银行");
$("a#sort").attr("title", "投资·银行");
break;
case "8":
$("#sort").html("其他▼");
$("#sorts-name").html("其他");
$("a#sort").attr("title", "其他");
break;
}
}
//History Event - default.js
function HistoryMouseOver(item) {
$(item).addClass("history-item-over");
}
function HistoryMouseOut(item) {
$(item).removeClass("history-item-over");
}
function HistoryPicMouseOver(item) {
$(item).animate({ opacity: 1 }, 0);
}
function HistoryPicMouseOut(item) {
$(item).animate({ opacity: 0.6 }, 0);
}
function HistoryPicClick() {
$.ajax({
type: 'GET',
url: 'history/deleteall',
success: function (msg) {
$("#history").html("");
}
});
}
function HistoryClick(cate, content) {
SetCate(cate);
SearchContent(false, content, cate, 0);
}
function RefreshHistory() {
$("#history").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("#history").height() - 32) / 2) + 'px;margin-bottom:' + (($("#history").height() - 32) / 2) + 'px;" />');
$.ajax({
type: 'GET',
url: 'history/show/5',
success: function (msg) {
$("#history").html(msg);
}
});
}
//End of History Event
//Hot Event - default.js
function SetHot() {
$.ajax({
type: 'GET',
url: 'hot/tag',
success: function (msg) {
$("#hot").html(msg);
}
});
}
function HotClick(content) {
SetCate(0);
SearchContent(false, content, 0, 0);
}
//End of Hot Event
//Search Event - default.js
var concernFlag = true;
var searchContent = "";
var cateContent = 0;
var page = 0;
function SearchConcernMouseOver(item) {
if (!concernFlag) {
$(item).attr("class", "right search-result-concern-over");
}
}
function SearchConcernMouseOut(item) {
if (!concernFlag) {
$(item).attr("class", "right search-result-concern");
}
}
function SearchConcernMouseDown(item) {
if (!concernFlag) {
$(item).attr("class", "right search-result-concern-click");
}
}
function SearchConcernClick() {
if (!concernFlag) {
$.ajax({
type: 'POST',
url: 'follow/add/' + cateContent,
data: { search: encodeURIComponent(searchContent) },
success: function (msg) {
$("#search-result-concern").attr("class", "right search-result-concern-have");
concernFlag = true;
RefreshConcern();
}
});
}
}
function SearchContent(noresult, content, cate, pagenum, callback) {
$("div#pages").hide();
var thissearch;
thissearch = guidGenerator();
currentsearch = thissearch;
if (!noresult && pagenum == 0) {
content = $.trim(content);
content = $('<div/>').text(content).html();
var result = "";
for (s in content.split(' ')) {
if (content.split(' ')[s] != "") {
result += '#<a class="keyword">' + content.split(' ')[s] + '</a>#';
}
}
$("div#search-result div.left").html("正在搜索" + result + "...");
$("#search-result-outer").show();
}
if (pagenum == 0) {
firstTime = true;
}
else {
firstTime = false;
}
$(window).unbind("scroll");
$("#fresh-blogs").hide();
$("#blogs").html('<img src="images/loading.gif" style="margin-left:275px;margin-top:100px;margin-bottom:100px;" />');
$.ajax({
type: 'POST',
url: 'search/show/' + cate,
data: { search: encodeURIComponent(content), page: pagenum },
success: function (msg) {
if (currentsearch != thissearch) return;
var c;
var f;
if (pagenum == 0) {
tt = msg.split(',');
c = tt[0];
countpage = Math.floor(c);
f = tt[1];
var str = "";
for (s in tt) {
if (s == 2) {
str += tt[s];
}
else if (s >= 2) {
str += ',' + tt[s];
}
}
msg = str;
}
searchContent = content;
cateContent = cate;
$("#blogs").html(msg);
if (pagenum == 0) {
nowFirst = $(".microblog-item:first").attr("id");
}
if (callback != null) { callback(); }
RefreshHistory();
page = pagenum / 5;
$("html, body").scrollTop(0);
prevLess = false;
nextLess = false;
var allPage;
if (countpage % 50 == 0) {
allPage = Math.floor(countpage / 50);
}
else {
allPage = Math.floor(countpage / 50) + 1;
}
if (allPage > 1) {
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (pagenum - 5) + ')">上一页</a>';
}
for (i = 0; i < allPage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>';
}
}
if (i == allPage - 1 && i - page > 2) {
str += '<a class="page-number left" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (i * 5) + ')">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allPage - 1) {
str += '<a class="page-control left" id="nextPage" onclick="SearchContent(' + noresult + ',\'' + content + '\',' + cate + ',' + (pagenum + 5) + ')">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
} else {
$("div#pages").html("");
}
$("div#pages").show();
if (!noresult && pagenum == 0) {
content = $.trim(content);
content = $('<div/>').text(content).html();
var result = "";
if ($("a#sort").attr("title") != "全部分类") {
result = $("a#sort").attr("title") + "中:";
}
for (s in content.split(' ')) {
if (content.split(' ')[s] != "") {
result += '#<a class="keyword">' + content.split(' ')[s] + '</a>#';
}
}
result += "的搜索结果,共有" + countpage + "条结果";
$("div#search-result div.left").html(result);
if (f == '0') {
concernFlag = false;
$("#search-result-concern").attr("class", "right search-result-concern");
}
else {
concernFlag = true;
$("#search-result-concern").attr("class", "right search-result-concern-have");
}
$("#search-result-outer").show();
$("a#search-result-rss").attr("href", 'http://www.ybole.com/search/rss/' + cate + '/' + searchContent);
}
// if (!($.browser.msie && $.browser.version == "6.0")) {
// if ($("div#backTop").css("position") != "fixed") {
// $("div#backTop").position({
// of: $("div#microblogs"),
// my: "left top",
// at: "right top",
// offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
// collision: "none none"
// });
// $("div#backTop").css("position", "absolute");
// }
// }
page = pagenum;
count = 0;
$(window).scroll(function () {
DocumenScroll();
});
}
});
}
//End of Search Event
//Other Event
function InitBoxes() {
$("#popBox_apply1").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#popBox_apply1").css("position", "fixed");
$("#popBox_apply0").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#popBox_apply0").css("position", "fixed");
}
function JobLike(item, id) {
$.ajax({
type: 'GET',
url: 'like/add/' + id,
success: function (msg) {
$(item).hide();
$(item).next().show();
}
});
}
function JobUnLike(item, id) {
$.ajax({
type: 'GET',
url: 'like/delete/' + id,
success: function (msg) {
$(item).hide();
$(item).prev().show();
}
});
}
function HotCompany(item) {
SetCate(0);
SearchContent(false, $(item).html(), 0, 0);
}
function HideSorts() {
$("div#sorts").hide();
}
function SetRolePicker() {
$("div#role-choose").position({
of: $("body"),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("a#role-jobs").position({
of: $("div#role-choose"),
my: "left top",
at: "left top",
offset: "48 54",
collision: "none none"
});
$("a#role-recruitment").position({
of: $("div#role-choose"),
my: "left top",
at: "left top",
offset: "328 54",
collision: "none none"
});
$("a#role-confirm").position({
of: $("div#role-choose"),
my: "left top",
at: "left top",
offset: "190 276",
collision: "none none"
});
$("a#role-jobs").click(function () {
$("div#role-choose").removeClass("role-recruitment");
$("div#role-choose").addClass("role-jobs");
rolekind = "jobs";
});
$("a#role-recruitment").click(function () {
$("div#role-choose").removeClass("role-jobs");
$("div#role-choose").addClass("role-recruitment");
rolekind = "recruitment";
});
$("a#role-confirm").click(function () {
if (rolekind == "jobs") {
$(".logined").show();
$(".jobs").show();
$.ajax({
type: 'POST',
url: 'user/set_role/1',
success: function (msg) {
$("body").css("overflow", "auto");
SearchContent(true, "all", 0, 0, function () {
$("#manager-tips").position({
of: $("#manager-center"),
my: "center top",
at: "center bottom",
offset: "0 0",
collision: "none none"
});
$("#concern-tips").position({
of: $("#concern-title"),
my: "left center",
at: "right center",
offset: "0 0",
collision: "none none"
});
$("#apply-tips").position({
of: $(".apply:first"),
my: "center bottom",
at: "center top",
offset: "0 0",
collision: "none none"
});
$("#manager-tips").show();
$("#concern-tips").show();
$("#apply-tips").show();
});
}
});
}
else if (rolekind == "recruitment") {
$(".logined").show();
$(".recruitment").show();
$.ajax({
type: 'POST',
url: 'user/set_role/2',
success: function (msg) {
$("body").css("overflow", "auto");
$("#manager-tips").position({
of: $("#manager-center"),
my: "center top",
at: "center bottom",
offset: "0 0",
collision: "none none"
});
$("#concern-tips").position({
of: $("#concern-title"),
my: "left center",
at: "right center",
offset: "0 0",
collision: "none none"
});
$("#manager-tips").show();
$("#concern-tips").show();
}
});
}
$("div#cover").hide();
$("div#role-choose").hide();
});
}
var count = 0;
var scrollflag = false;
var countpage = 100;
function DocumenScroll() {
// if ($.browser.msie && $.browser.version == "6.0") {
// //$("div#backTop").attr("position","absolute");
// $("div#backTop").position({
// of: $("div#microblogs"),
// my: "left top",
// at: "right top",
// offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
// collision: "none none"
// });
// }
// if (!($.browser.msie && $.browser.version == "6.0")) {
// if ($("div#backTop").css("position") != "fixed") {
// $("div#backTop").position({
// of: $("div#microblogs"),
// my: "left top",
// at: "right top",
// offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
// collision: "none none"
// });
// $("div#backTop").css("position", "fixed");
// }
// }
if ($(window).scrollTop() != 0) {
$("div#backTop").fadeIn(200);
}
else {
$("div#backTop").fadeOut(200);
}
if (($(window).scrollTop() + $(window).height()) >= $(document).height() - 200 && count < 4 && !scrollflag && countpage >= 10) {
$(window).unbind("scroll");
count++;
page++;
$("#flower").fadeIn(200);
$("#pages").hide();
$.ajax({
type: 'POST',
url: 'search/show/' + cateContent,
data: { search: encodeURIComponent(searchContent), page: page }, //, time: '-' + $(".microblog-item:last").attr("id")
//url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/-' + $(".microblog-item:last").attr("id"),
success: function (msg) {
if (msg == "" || msg.split('"microblog-item"').length < 11) {
scrollflag = true;
}
$("#flower").fadeOut(200);
$("#pages").show();
$("div#blogs").html($("div#blogs").html() + msg);
// if (!($.browser.msie && $.browser.version == "6.0")) {
// $("div#backTop").position({
// of: $("div#microblogs"),
// my: "left top",
// at: "right top",
// offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
// collision: "none none"
// });
// $("div#backTop").css("position", "fixed");
// }
/*
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(text),
success: function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
//SetSearch(msg, text, thissearch);
nowFirst = $(".microblog-item:first").attr("id");
}
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
//SetSearch(msg, text, thissearch);
});
});
$("a.like").unbind("click");
$("a.unlike").unbind("click");
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
StartSearch('like/add/' + id,
function () {
item.hide();
item.next("a.unlike").show();
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind && rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
*/
$(window).scroll(function () {
DocumenScroll();
});
}
});
}
}
var nowFirst;
var firstTime = true;
var isFreshed = false;
var preContent = "";
function GetNewerBlogs() {
if (firstTime) {
nowFirst = "";
nowFirst = $(".microblog-item:first").attr("id");
firstTime = false;
}
if (nowFirst != "") {
preContent = searchContent;
$.ajax({
type: 'POST',
url: 'search/show/' + cateContent,
data: { search: encodeURIComponent(searchContent), time: nowFirst },
//url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/' + nowFirst,
success: function (msg) {
if (preContent == searchContent) {
if (msg != "") {
$.ajax({
type: 'POST',
url: 'count/',
success: function (msg) {
$("div#radio").html("本周新增职位" + msg.split(',')[0] + "个,今日新增职位" + msg.split(',')[1] + "个");
}
});
if (!isFreshed) {
$("div#blogs").html($("div#fresh-blogs").html() + $("div#blogs").html());
$("div#fresh-blogs").hide();
isFreshed = true;
/*
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
SetSearch(msg, text, thissearch);
nowFirst = $(".microblog-item:first").attr("id");
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.like").unbind("click");
$("a.unlike").unbind("click");
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/add/' + id,
success: function () {
item.hide();
item.next("a.unlike").show();
}
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
*/
}
if (msg.split("id=").length - 1 <= 0)
return;
$("div#fresh-blogs").html(msg);
$("div#fresh").html('有' + (msg.split("id=").length - 1) + '条更新,点击查看');
$("div#fresh-outer").slideDown(300, null, function () {
$("div#fresh-outer").animate({ opacity: 1 }, 200);
});
$("div#fresh").click(function () {
isFreshed = false;
$("div#fresh-blogs").slideDown(500, null, function () {
$("div#fresh-blogs").animate({ opacity: 1 }, 200);
});
nowFirst = $(".microblog-item:first").attr("id");
$("div#fresh-outer").animate({ opacity: 0 }, 0, null, function () {
$("div#fresh-outer").slideUp(300);
});
/*
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
SetSearch(msg, text, thissearch);
nowFirst = $(".microblog-item:first").attr("id");
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.like").unbind("click");
$("a.unlike").unbind("click");
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/add/' + id,
success: function () {
item.hide();
item.next("a.unlike").show();
}
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
*/
});
}
}
}
});
}
setTimeout(function () { GetNewerBlogs(); }, 60000);
}
//End of Other Event
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/default.js | JavaScript | gpl3 | 42,728 |
var currentsearch = 0;
var issearch = false;
var SearchResult = "all";
var count = 0;
var page = 0;
var prevLess = false;
var nextLess = false;
var nowFirst = "";
var isFreshed = false;
var isTurn = false;
var name = "";
var item;
var id;
var haveResume = false;
function CloseMTips() {
$("#manager-tips").fadeOut(200);
}
function CloseCTips() {
$("#concern-tips").fadeOut(200);
}
function CloseATips() {
$("#apply-tips").fadeOut(200);
}
function guidGenerator() {
var S4 = function () {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}
function ApplyJob() {
$.ajax({
type: "POST",
url: 'apply/add/' + id,
data: { text: $("#msgBox_resume .content textarea").val() },
success: function (msg) {
if (msg != "") {
alert(msg);
}
item.hide();
item.next("a.unapply").show();
}
});
HideResume();
}
function ShowNoresume() {
$("div#cover").fadeIn(200);
$("div#msgBox_noresume").fadeIn(200);
}
function HideNoresume() {
$("div#cover").fadeOut(200);
$("div#msgBox_noresume").fadeOut(200);
}
function ShowResume() {
$(".info span:first").html("@" + item.parent().prev(".microblog-item-blog").children(".microblog-item-blog-name").html());
$("div#cover").fadeIn(200);
$("div#msgBox_resume").fadeIn(200);
}
function HideResume() {
$("div#cover").fadeOut(200);
$("div#msgBox_resume").fadeOut(200);
}
function UpdateApply(e) {
if (115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) {
$(".info span:last").html("还可输入" + (115 - Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字");
}
else {
$(".info span:last").html("已超出" + (Math.ceil($(e).val().replace(/[^\x00-\xff]/g, "**").length / 2 - 115)) + "个字");
}
}
$(function () {
$("div#msgBox_noresume").position({
of: $(window),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("div#msgBox_resume").position({
of: $(window),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("div#msgBox_noresume").css("position", "fixed");
$("div#msgBox_resume").css("position", "fixed");
$.ajax({
type: 'POST',
url: 'resume/current',
success: function (msg) {
$.ajax({
type: 'POST',
url: 'resume/show/' + msg,
success: function (e) {
if (e.indexOf('<html') != -1) {
haveResume = true;
$("#msgBox_resume .content a:first").attr("href", "resume/show/" + msg);
}
else {
haveResume = false;
}
}
})
}
});
if ($.cookie("athere") == null) {
$.cookie("athere", "here", { path: '/' });
setTimeout(function () {
$("#radio").slideUp(200);
}, 30000);
}
else {
$("#radio").hide();
}
$("a.company-name").click(function () {
var text = $.trim($(this).html());
StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("#concern-pic").animate({ opacity: 0.6 }, 0);
$("#concern-pic").mouseover(function () {
$(this).animate({ opacity: 1 }, 200);
});
$("#concern-pic").mouseout(function () {
$(this).animate({ opacity: 0.6 }, 200);
});
$("#history-pic").animate({ opacity: 0.6 }, 0);
$("#history-pic").mouseover(function () {
$(this).stop().animate({ opacity: 1 }, 200);
});
$("#history-pic").mouseout(function () {
$(this).stop().animate({ opacity: 0.6 }, 200);
});
$("a#history-pic").click(function () {
$.ajax({
type: 'POST',
url: 'history/deleteall',
success: function (msg) {
$.ajax({
type: 'GET',
url: 'history/show/5',
success: function (msg) {
$(".history-item").animate({ opacity: 0 }, 200, function () {
$(this).slideUp(100, null, function () {
$("#history").html(msg);
SetHistory();
});
});
}
});
}
});
});
SetRolePicker();
GetNewerCount();
$("#error-info").dialog({
autoOpen: false,
draggable: false,
resizable: false,
modal: true,
buttons: {
"确定": function () {
$(this).dialog("close");
}
}
});
if ($.query.get("errormsg") == "") {
if ($.query.get("search") != "") {
var text = $.trim($.query.get("search"));
var cat = $.trim($.query.get("cat"));
StartSearch('search/' + encodeURIComponent(text) + '/' + cat, function (msg, thissearch) {
page = 0;
cate = cat;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
setTimeout(function () { GetNewerBlogs(); }, 60000);
$("div#backTop").position({
of: $("div#microblogs"),
my: "left top",
at: "right top",
offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
collision: "none none"
});
$("div#backTop").css("position", "fixed");
});
}
else {
$.ajax({
type: 'GET',
url: 'search/all/0',
success: function (msg) {
isTurn = false;
SetAllSearch(msg);
$("div#backTop").position({
of: $("div#microblogs"),
my: "left top",
at: "right top",
offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
collision: "none none"
});
$("div#backTop").css("position", "fixed");
setTimeout(function () { GetNewerBlogs(); }, 60000);
}
});
}
}
else {
$("#errormsg").html(decodeURI($.query.get("errormsg")));
$("#error-info").dialog("open");
$.ajax({
type: 'GET',
url: 'search/all/0',
success: function (msg) {
isTurn = false;
SetAllSearch(msg);
$("div#backTop").position({
of: $("div#microblogs"),
my: "left top",
at: "right top",
offset: "0 " + ($(window).scrollTop() + $(window).height() - $("div#microblogs").offset().top - 100),
collision: "none none"
});
$("div#backTop").css("position", "fixed");
setTimeout(function () { GetNewerBlogs(); }, 60000);
}
});
}
$.ajax({
type: 'POST',
url: 'hot/',
success: function (msg) {
$("div#hot").html(msg);
$("a.hot-content-item").click(function () {
var text = $(this).html().split('(')[0];
StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
}
});
$("div#backTop").click(function () {
$("html, body").animate({ scrollTop: 0 }, 1000);
});
$("div#backTop").animate({ opacity: 0.6 }, 0);
$("div#backTop").mouseover(function () {
$("div#backTop").stop().animate({ opacity: 1 }, 200);
});
$("div#backTop").mouseout(function () {
$("div#backTop").stop().animate({ opacity: 0.6 }, 200);
});
$("#search-text").keypress(function (e) {
if (e.which == 13) {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") {
StartSearch('search/' + encodeURIComponent($.trim($("#search-text").val())) + '/' + cate, function (msg, thissearch) {
isTurn = false;
SetSearch(msg, $("#search-text").val(), thissearch);
});
}
}
});
$("#search-text").keydown(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) {
$(this).val($(this).val().replace("#", "").replace("&", "").replace("?", ""));
}
});
$("#search-text").keyup(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
if ($(this).val().indexOf("#") > -1 || $(this).val().indexOf("&") > -1 || $(this).val().indexOf("?") > -1) {
$(this).val($(this).val().replace("#", "").replace("&", "").replace("?", ""));
}
});
$("a#search-button").click(function () {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴" && $("#search-text").val() != "") {
StartSearch('search/' + encodeURIComponent($.trim($("#search-text").val())) + '/' + cate, function (msg, thissearch) {
isTurn = false;
SetSearch(msg, $("#search-text").val(), thissearch);
});
}
});
});
function SetAllSearch(msg) {
scrollflag = false;
$("div#fresh-outer").animate({ opacity: 0 }, 0);
$("div#fresh-outer").hide();
$("div#fresh-blogs").animate({ opacity: 0 }, 0);
$("div#fresh-blogs").hide();
$("div#pages").fadeOut(50);
$("div#blogs").animate({ opacity: 0 }, 200, null, function () {
$("div#blogs").slideUp(100, null, function () {
$("div#blogs").html('<img src="images/loading.gif" style="margin-left:280px;" />');
$("div#blogs").slideDown(100, null, function () {
$("div#blogs").animate({ opacity: 1 }, 200, null, function () {
$("div#blogs").animate({ opacity: 0 }, 200, null, function () {
$("div#blogs").slideUp(100, null, function () {
$("div#blogs").html(msg);
$("div#blogs").slideDown(100, null, function () {
$("div#blogs").animate({ opacity: 1 }, 200);
$(window).unbind("scroll");
$(window).scroll(function () {
DocumenScroll();
});
count = 0;
});
$.ajax({
type: "POST",
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/count',
success: function (msg) {
$(window).scrollTop(0);
prevLess = false;
nextLess = false;
var allPage;
if (msg % 50 == 0) {
allPage = Math.floor(msg / 50);
}
else {
allPage = Math.floor(msg / 50) + 1;
}
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allPage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allPage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allPage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5),
success: function (msg) {
isTurn = true;
SetAllSearch(msg);
}
});
});
$("a#prevPage").click(function () {
page--;
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5),
success: function (msg) {
isTurn = true;
SetAllSearch(msg);
}
});
});
$("a#nextPage").click(function () {
page++;
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5),
success: function (msg) {
isTurn = true;
SetAllSearch(msg);
}
});
});
}
});
if (!isTurn) {
nowFirst = $(".microblog-item:first").attr("id");
}
$("a.tag").click(function () {
var text = $(this).attr("title");
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(text),
success: function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
}
});
});
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/add/' + id,
success: function () {
item.hide();
item.next("a.unlike").show();
}
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
});
});
});
});
});
});
}
function GetNewerCount() {
$.ajax({
type: 'POST',
url: 'count/',
success: function (msg) {
if (!issearch) {
$("div#radio").html("本周新增职位" + $.trim(msg).split(',')[0] + "个,今日新增职位" + $.trim(msg).split(',')[1] + "个");
setTimeout(function () { GetNewerCount(); }, 1200000);
}
}
});
}
function SetResult(msg) {
msg = $.trim(msg);
SearchResult = msg
var str = $("a#sort").html() + "中:";
for (s in msg.split(' ')) {
if (msg.split(' ')[s] != "") {
str += '#<a class="keyword">' + msg.split(' ')[s] + '</a>#';
}
}
str += "的搜索结果";
$("div#search-result div.left").html(str);
$.ajax({
type: 'POST',
url: 'follow/exist/' + encodeURIComponent(msg),
success: function (e) {
if (e[0] == '0') {
$("a#search-result-concern").attr("class", "right search-result-concern");
$("a#search-result-concern").click(function () {
$.ajax({
type: 'POST',
url: 'follow/add/' + encodeURIComponent(SearchResult),
success: function () {
$("a#search-result-concern").attr("class", "right search-result-concern-have");
$("a#search-result-concern").unbind("mouseover");
$("a#search-result-concern").unbind("mousedown");
$("a#search-result-concern").unbind("mouseout");
$("a#search-result-concern").unbind("click");
$("div#concern").animate({ opacity: 0 }, 200, null, function () {
$("div#concern").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("div#concern").height() - 32) / 2) + 'px;margin-bottom:' + (($("div#concern").height() - 32) / 2) + 'px;" />');
$("div#concern").animate({ opacity: 1 }, 200, null, function () {
$.ajax({
type: 'POST',
url: 'follow/show',
success: function (msg) {
$("div#concern").animate({ opacity: 0 }, 200, null, function () {
$("#concern").html(msg);
if (msg == "") {
$("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>");
}
SetConcern();
$("div#concern").animate({ opacity: 1 }, 200);
});
}
});
});
});
}
});
});
}
else {
$("a#search-result-concern").attr("class", "right search-result-concern-have");
$("a#search-result-concern").unbind("mouseover");
$("a#search-result-concern").unbind("mousedown");
$("a#search-result-concern").unbind("mouseout");
}
}
});
$("a#search-result-rss").attr("href", 'rss/' + encodeURIComponent(msg));
}
function SetRolePicker() {
$("div#role-choose").position({
of: $("body"),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("a#role-jobs").position({
of: $("div#role-choose"),
my: "left top",
at: "left top",
offset: "48 54",
collision: "none none"
});
$("a#role-recruitment").position({
of: $("div#role-choose"),
my: "left top",
at: "left top",
offset: "328 54",
collision: "none none"
});
$("a#role-confirm").position({
of: $("div#role-choose"),
my: "left top",
at: "left top",
offset: "190 276",
collision: "none none"
});
$("a#role-jobs").click(function () {
$("div#role-choose").removeClass("role-recruitment");
$("div#role-choose").addClass("role-jobs");
rolekind = "jobs";
});
$("a#role-recruitment").click(function () {
$("div#role-choose").removeClass("role-jobs");
$("div#role-choose").addClass("role-recruitment");
rolekind = "recruitment";
});
$("a#role-confirm").click(function () {
if (rolekind == "jobs") {
$(".logined").fadeIn(300);
$(".recruitment").hide();
$(".admin").hide();
$.ajax({
type: 'POST',
url: 'role/set/1',
success: function (msg) {
$("#manager-tips").position({
of: $("#manager-center"),
my: "center top",
at: "center bottom",
offset: "0 0",
collision: "none none"
});
$("#concern-tips").position({
of: $("#concern-title"),
my: "left center",
at: "right center",
offset: "0 0",
collision: "none none"
});
$("#apply-tips").position({
of: $(".apply:first"),
my: "center bottom",
at: "center top",
offset: "0 0",
collision: "none none"
});
$("#manager-tips").fadeIn(200);
$("#concern-tips").fadeIn(200);
$("#apply-tips").fadeIn(200);
}
});
}
else if (rolekind == "recruitment") {
$(".logined").fadeIn(300);
$(".jobs").hide();
$(".admin").hide();
$.ajax({
type: 'POST',
url: 'role/set/2',
success: function (msg) {
$("#manager-tips").position({
of: $("#manager-center"),
my: "center top",
at: "center bottom",
offset: "0 0",
collision: "none none"
});
$("#concern-tips").position({
of: $("#concern-title"),
my: "left center",
at: "right center",
offset: "0 0",
collision: "none none"
});
$("#manager-tips").fadeIn(200);
$("#concern-tips").fadeIn(200);
}
});
}
$("div#cover").fadeOut(200);
$("div#role-choose").fadeOut(200);
});
}
function SetConcern() {
$(".concern-item").mouseover(function () {
$(this).addClass("concern-item-over");
});
$(".concern-item").mouseout(function () {
$(this).removeClass("concern-item-over");
});
$(".concern-item-delete").click(function () {
var item = $(this);
$.ajax({
type: 'POST',
url: 'follow/delete/' + $(this).attr("id"),
success: function () {
var text = item.next(".concern-item-content").children(".concern-item-content-info").html();
if (text == SearchResult) {
$("a#search-result-concern").attr("class", "right search-result-concern");
$("a#search-result-concern").mouseover(function () {
$(this).attr("class", "right search-result-concern-over");
});
$("a#search-result-concern").mousedown(function () {
$(this).attr("class", "right search-result-concern-click");
});
$("a#search-result-concern").mouseout(function () {
$(this).attr("class", "right search-result-concern");
});
$("a#search-result-concern").click(function () {
$.ajax({
type: 'POST',
url: 'follow/add/' + encodeURIComponent(SearchResult),
success: function () {
$("a#search-result-concern").attr("class", "right search-result-concern-have");
$("a#search-result-concern").unbind("mouseover");
$("a#search-result-concern").unbind("mousedown");
$("a#search-result-concern").unbind("mouseout");
$("a#search-result-concern").unbind("click");
$("div#concern").animate({ opacity: 0 }, 200, null, function () {
$("div#concern").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("div#concern").height() - 32) / 2) + 'px;margin-bottom:' + (($("div#concern").height() - 32) / 2) + 'px;" />');
$("div#concern").animate({ opacity: 1 }, 200, null, function () {
$.ajax({
type: 'POST',
url: 'follow/show',
success: function (msg) {
$("div#concern").animate({ opacity: 0 }, 200, null, function () {
$("#concern").html(msg);
if (msg == "") {
$("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>");
}
SetConcern();
$("div#concern").animate({ opacity: 1 }, 200);
});
}
});
});
});
}
});
});
}
}
});
$(this).parent().animate({ opacity: 0 }, 200, function () {
$(this).slideUp(100, null, function () {
$.ajax({
type: 'POST',
url: 'follow/show',
success: function (msg) {
if (msg == "") {
$("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>");
}
}
});
});
});
});
$(".concern-item-content").click(function () {
var text = $(this).children(".concern-item-content-info").html();
$(this).children(".concern-item-content-number").fadeOut(200, function () { $(this).parent().removeClass("concern-item-content-new"); });
StartSearch('search/' + encodeURIComponent(text), function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
}
var countpage = 100;
function StartSearch(url, func) {
var thissearch;
currentsearch = guidGenerator();
thissearch = currentsearch;
$("div#fresh-outer").animate({ opacity: 0 }, 0);
$("div#fresh-outer").hide();
$("div#fresh-blogs").animate({ opacity: 0 }, 0);
$("div#fresh-blogs").hide();
$("div#pages").fadeOut(50);
$("div#blogs").animate({ opacity: 0 }, 200, null, function () {
$("div#blogs").slideUp(100, null, function () {
$("div#blogs").html('<img src="images/loading.gif" style="margin-left:280px;" />');
$("div#blogs").slideDown(100, null, function () {
if (currentsearch != thissearch) return;
$("div#blogs").animate({ opacity: 1 }, 200, null, function () {
if (currentsearch != thissearch) return;
});
});
});
});
$.ajax({
type: "GET",
url: url,
success: function (msg) {
func(msg, thissearch);
}
}
);
}
function SetSearch(msg, e, thissearch) {
scrollflag = false;
SearchResult = e;
if (currentsearch != thissearch) return;
$("div#blogs").animate({ opacity: 0 }, 200, null, function () {
if (currentsearch != thissearch) return;
$("div#blogs").slideUp(100, null, function () {
if (currentsearch != thissearch) return;
$("div#blogs").html(msg);
$("div#blogs").slideDown(100, null, function () {
if (currentsearch != thissearch) return;
$("div#blogs").animate({ opacity: 1 }, 200);
$(window).unbind("scroll");
$(window).scroll(function () {
DocumenScroll();
});
count = 0;
});
$.ajax({
type: "POST",
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/count',
success: function (msg) {
if (currentsearch != thissearch) return;
$(window).scrollTop(0);
$("div#search-result div.left").html($("div#search-result div.left").html() + ",共有" + msg + "条结果");
var allPage;
if (msg % 50 == 0) {
allPage = Math.floor(msg / 50);
}
else {
allPage = Math.floor(msg / 50) + 1;
}
countpage = Math.floor(msg);
if (allPage > 1) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allPage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allPage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allPage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
StartSearch('search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5),
function (msg, thissearch) {
isTurn = true;
SetSearch(msg, SearchResult, thissearch);
});
});
$("a#prevPage").click(function () {
page--;
StartSearch('search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5),
function (msg, thissearch) {
isTurn = true;
SetSearch(msg, SearchResult, thissearch);
});
});
$("a#nextPage").click(function () {
page++;
StartSearch('search/' + encodeURIComponent(SearchResult) + '/' + cate + '/page/' + (page * 5),
function (msg, thissearch) {
isTurn = true;
SetSearch(msg, SearchResult, thissearch);
});
});
}
}
});
if (!isTurn) {
nowFirst = $(".microblog-item:first").attr("id");
}
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
if (logined) {
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/add/' + id,
success: function () {
item.hide();
item.next("a.unlike").show();
}
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
}
});
});
$("div#search-result-outer").slideDown(200);
if (logined) {
$("a#search-result-concern").mouseover(function () {
$(this).attr("class", "right search-result-concern-over");
});
$("a#search-result-concern").mousedown(function () {
$(this).attr("class", "right search-result-concern-click");
});
$("a#search-result-concern").mouseout(function () {
$(this).attr("class", "right search-result-concern");
});
$("div#history").animate({ opacity: 0 }, 200, null, function () {
$("div#history").html('<img src="images/loading.gif" style="margin-left:134px;margin-top:' + (($("div#history").height() - 32) / 2) + 'px;margin-bottom:' + (($("div#history").height() - 32) / 2) + 'px;" />');
$("div#history").animate({ opacity: 1 }, 200, null, function () {
$.ajax({
type: 'GET',
url: 'history/show/5',
success: function (msg) {
$("div#history").animate({ opacity: 0 }, 200, null, function () {
$("div#history").html(msg);
SetHistory();
$("div#history").animate({ opacity: 1 }, 200);
});
}
});
});
});
}
SetResult(e);
if (!logined) {
$("a#search-result-concern").hide();
}
else {
$("a#search-result-concern").show();
}
}
function GetOlderBlogs() {
}
function SetHistory() {
$(".history-item").mouseover(function () { $(this).addClass("history-item-over"); });
$(".history-item").mouseout(function () { $(this).removeClass("history-item-over"); });
$(".history-item").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
cate = 0;
page = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
}
var scrollflag = false;
function DocumenScroll() {
if ($(window).scrollTop() != 0) {
$("div#backTop").fadeIn(200)
}
else {
$("div#backTop").fadeOut(200);
}
if (($(window).scrollTop() + $(window).height()) >= $(document).height() - 200 && count < 4 && !scrollflag && countpage >= 10) {
$(window).unbind("scroll");
count++;
$("#flower").fadeIn(200);
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/-' + $(".microblog-item:last").attr("id"),
success: function (msg) {
if (msg == "" || msg.split('"microblog-item"').length < 11) {
scrollflag = true;
}
$("#flower").fadeOut(200);
$("div#blogs").html($("div#blogs").html() + msg);
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(text),
success: function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
SetSearch(msg, text, thissearch);
nowFirst = $(".microblog-item:first").attr("id");
}
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.like").unbind("click");
$("a.unlike").unbind("click");
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
StartSearch('like/add/' + id,
function () {
item.hide();
item.next("a.unlike").show();
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
$(window).scroll(function () {
DocumenScroll();
});
}
});
}
}
function GetNewerBlogs() {
$.ajax({
type: 'GET',
url: 'search/' + encodeURIComponent(SearchResult) + '/' + cate + '/' + nowFirst,
success: function (msg) {
if (msg != "") {
$.ajax({
type: 'POST',
url: 'count/',
success: function (msg) {
if (!issearch) {
$("div#radio").html("本周新增职位" + msg.split(',')[0] + "个,今日新增职位" + msg.split(',')[1] + "个");
}
}
});
if (!isFreshed) {
$("div#blogs").html($("div#fresh-blogs").html() + $("div#blogs").html());
$("div#fresh-blogs").hide();
isFreshed = true;
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
SetSearch(msg, text, thissearch);
nowFirst = $(".microblog-item:first").attr("id");
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.like").unbind("click");
$("a.unlike").unbind("click");
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/add/' + id,
success: function () {
item.hide();
item.next("a.unlike").show();
}
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
}
$("div#fresh-blogs").html(msg);
$("div#fresh").html('有' + (msg.split("id=").length - 1) + '条更新,点击查看');
$("div#fresh-outer").slideDown(300, null, function () {
$("div#fresh-outer").animate({ opacity: 1 }, 200);
});
$("div#fresh").click(function () {
isFreshed = false;
$("div#fresh-blogs").slideDown(500, null, function () {
$("div#fresh-blogs").animate({ opacity: 1 }, 200);
});
nowFirst = $(".microblog-item:first").attr("id");
$("div#fresh-outer").animate({ opacity: 0 }, 0, null, function () {
$("div#fresh-outer").slideUp(300);
});
$("a.microblog-item-relate").unbind("click");
$("a.microblog-item-relate").click(function () {
var text = $(this).html();
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
SetSearch(msg, text, thissearch);
nowFirst = $(".microblog-item:first").attr("id");
});
});
$("a.tag").unbind("click");
$("a.tag").click(function () {
var text = $(this).attr("title");
StartSearch('search/' + encodeURIComponent(text),
function (msg, thissearch) {
page = 0;
cate = 0;
$("#sort").html($("a#" + cate).html());
$("#sorts-name").html($("a#" + cate).html());
isTurn = false;
SetSearch(msg, text, thissearch);
});
});
$("a.like").unbind("click");
$("a.unlike").unbind("click");
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("a.like").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/add/' + id,
success: function () {
item.hide();
item.next("a.unlike").show();
}
});
});
$("a.unlike").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'like/delete/' + id,
success: function () {
item.hide();
item.prev("a.like").show();
}
});
});
$("a.apply").click(function () {
item = $(this);
id = $(this).parent().parent().parent().attr("name");
if (haveResume) {
ShowResume();
}
else {
ShowNoresume();
}
});
if (rolekind != "jobs") {
$("a.apply").hide();
}
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("name");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
});
}
}
});
setTimeout(function () { GetNewerBlogs(); }, 60000);
}
function AfterLogin() {
$.ajax({
type: 'POST',
url: 'info/',
success: function (msg) {
$("a#name").html(msg.split(',')[0]);
name = msg.split(',')[0];
$("div#links a:last").attr("href", "profile/" + msg.split(',')[0]);
var type = msg.split(',')[1];
if (type == -1) {
$("div#cover").fadeIn(200);
$("div#role-choose").fadeIn(200);
}
else if (type == 1) {
$(".logined").fadeIn(300);
$(".recruitment").hide();
$(".admin").hide();
rolekind = "jobs";
}
else if (type == 2) {
$(".logined").fadeIn(300);
$(".jobs").hide();
$(".admin").hide();
rolekind = "recruitment";
}
else if (type == 0) {
$(".logined").fadeIn(300);
$(".jobs").hide();
rolekind = "admin";
}
$("#concern").html('<img src="images/loading.gif" style="margin-left:134px;" />');
$.ajax({
type: 'POST',
url: 'follow/show',
success: function (msg) {
$("#concern").animate({ opacity: 0 }, 200, null, function () {
$("#concern").slideUp(100, null, function () {
$("#concern").html(msg);
if (msg == "") {
$("#concern").html("<div style=\"text-align:center;\">您还未添加关注</div>");
}
SetConcern();
$("#concern").slideDown(100, null, function () {
$("#concern").animate({ opacity: 1 }, 200);
});
});
});
}
});
$("#history").html('<img src="images/loading.gif" style="margin-left:134px;" />');
$.ajax({
type: 'GET',
url: 'history/show/5',
success: function (msg) {
$("#history").animate({ opacity: 0 }, 200, null, function () {
$("#history").slideUp(100, null, function () {
$("#history").html(msg);
SetHistory();
$("#history").slideDown(100, null, function () {
$("#history").animate({ opacity: 1 }, 200);
});
});
});
}
});
}
});
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/Copy of default.js | JavaScript | gpl3 | 65,409 |
var logined = true;
var rolekind = "jobs";
var auth = "";
var length = 0;
var position = 0;
var cate = 0;
$(function () {
$("a#logo").mouseover(function () {
$(this).html("回首页");
});
$("a#logo").mouseout(function () {
$(this).html("测试版");
});
Init();
CoverResize();
SetPublish();
});
function SetPublish() {
$("div#published-info").dialog({
autoOpen: false,
draggable: false,
resizable: false,
buttons: {
"好的,我知道了": function () {
$(this).dialog("close");
}
}
});
$("div#jobs-publish").position({
of: $("body"),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("div#recruitment-publish").position({
of: $("body"),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("div#jobs-publish-title a").click(function () { HideJobsPublish(); });
$("div#recruitment-publish-title a").click(function () { HideRecruitmentPublish(); });
$("div#jobs-publish-confirm a").click(function () {
$.ajax({
type: 'POST',
url: 'post/1',
data: { text: $("div#jobs-publish-text textarea").val() },
success: function (msg) {
if ($.trim(msg) != "0") {
alert(msg);
}
HideJobsPublish();
$("div#published-info").dialog("open");
}
});
});
$("div#recruitment-publish-confirm a").click(function () {
$.ajax({
type: 'POST',
url: 'post/2',
data: { text: $("div#recruitment-publish-text textarea").val() },
success: function (msg) {
if ($.trim(msg) != "0") {
alert(msg);
}
HideRecruitmentPublish();
$("div#published-info").dialog("open");
}
});
});
//Jobs Hot Tags
$.ajax({
type: 'POST',
url: 'hot/1',
success: function (msg) {
$("div#jobs-publish-tags-hot").html(msg);
$("a.jobs-publish-tags-hot-item").click(function () {
$("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val() + " " + $(this).attr("title"));
UpdateJobsText();
});
}
});
//Recruitment Hot Tags
$.ajax({
type: 'POST',
url: 'hot/2',
success: function (msg) {
$("div#recruitment-publish-tags-hot").html(msg);
$("a.recruitment-publish-tags-hot-item").click(function () {
$("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val() + " " + $(this).attr("title"));
UpdateRecruitmentText();
});
}
});
$("div#jobs-publish-text textarea").keydown(function () {
UpdateJobsText();
});
$("div#recruitment-publish-text textarea").keydown(function () {
UpdateRecruitmentText();
});
$("div#jobs-publish-text textarea").keyup(function () {
UpdateJobsText();
});
$("div#recruitment-publish-text textarea").keyup(function () {
UpdateRecruitmentText();
});
$("a#jobs-publish-quick").click(function () { ShowJobsPublish(); });
$("a#recruitment-publish-quick").click(function () { ShowRecruitmentPublish(); });
UpdateJobsText();
UpdateRecruitmentText();
}
function UpdateJobsText() {
if (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) {
$("div#jobs-publish-remain").html("还可输入" + (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字");
}
else {
$("div#jobs-publish-remain").html("已超出" + (Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字");
}
}
function UpdateRecruitmentText() {
if (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) {
$("div#recruitment-publish-remain").html("还可输入" + (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字");
}
else {
$("div#recruitment-publish-remain").html("已超出" + (Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字");
}
}
function ShowJobsPublish() {
$("div#cover").fadeIn(200);
$("div#jobs-publish").fadeIn(200);
$("div#jobs-publish-text textarea").focus();
}
function HideJobsPublish() {
$("div#cover").fadeOut(200);
$("div#jobs-publish").fadeOut(200);
}
function ShowRecruitmentPublish() {
$("div#cover").fadeIn(200);
$("div#recruitment-publish").fadeIn(200);
$("div#recruitment-publish-text textarea").focus();
}
function HideRecruitmentPublish() {
$("div#cover").fadeOut(200);
$("div#recruitment-publish").fadeOut(200);
}
function Init() {
auth = $.cookie("USER_AUTH");
if (auth == null) {
logined = false;
}
else {
logined = true;
}
if (logined) {
AfterLogin();
}
else {
$(".logouted").fadeIn(300);
}
$("input#search-text").focusin(function () {
$("#sorts").fadeOut(200);
$(this).css("color", "#000000");
if ($(this).val() == "职位关键字,如:北京 产品经理 阿里巴巴") {
$(this).val("");
}
});
$("input#search-text").focusout(function () {
$(this).css("color", "#adadad");
if ($(this).val() == "") {
$(this).val("职位关键字,如:北京 产品经理 阿里巴巴");
}
});
}
function CoverResize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight) {
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else {
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) {
if (document.documentElement.clientWidth) {
windowWidth = document.documentElement.clientWidth;
} else {
windowWidth = self.innerWidth;
}
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) {
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
if (yScroll < windowHeight) {
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
if (xScroll < windowWidth) {
pageWidth = xScroll;
} else {
pageWidth = windowWidth;
}
$("div#cover").css("height", "5000px");
$("div#cover").css("width", pageWidth + "px");
$("div#cover").animate({ opacity: 0.4 }, 0);
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/Copy of share.js | JavaScript | gpl3 | 7,691 |
var deleteitem;
var deleteid;
var deleteurl;
var page = 0;
var allpage = 0;
var type = "";
$(function () {
$("a#logo").mouseover(function () {
$(this).html("回首页");
});
$("a#logo").mouseout(function () {
$(this).html("测试版");
});
ShowNormal(0);
$("a.manager-control").click(function () {
$("a.manager-control").removeClass("manager-control-choose");
$(this).addClass("manager-control-choose");
});
$(".logined").show();
$("#delete-dialog").dialog({
autoOpen: false,
draggable: false,
resizable: false,
width: 180,
buttons: {
"确定": function () {
$(this).dialog("close");
var flag = false;
$("div#pages").fadeOut(50);
if (allpage > 1) {
flag = true;
}
$.ajax({
type: "POST",
url: deleteurl + deleteid,
success: function (msg) {
msg = $.trim(msg);
if (msg == "" || msg == "0") {
deleteitem.animate({ opacity: 0 }, 300, null, function () {
deleteitem.slideUp(200, null, function () {
if (type == "feedback") {
if (flag) {
$.ajax({
type: 'POST',
url: 'feedback/show/' + page,
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
$(".item-blog-title").unbind("click");
$(".item-blog-title").click(function () {
var item = $(this).parent().next(".item-blog-content");
if (item.hasClass("close")) {
item.slideDown(200);
item.removeClass("close");
}
else {
item.slideUp(200);
item.addClass("close");
}
});
}
});
}
UpdateFeedback();
}
else if (type == "tweet") {
if (flag) {
$.ajax({
type: 'POST',
url: 'search/0',
data: { page: page, admin: 1 },
success: function (msg) {
var str = '<div class="microblog-item newer" style="display:none;"';
str += msg.split('<div class="microblog-item"')[10];
$("div.microblog-item:last").after(str);
$(".newer:last").slideDown(200);
}
});
}
UpdateNormal();
}
});
});
}
else {
alert(msg);
}
}
});
},
"取消": function () {
$(this).dialog("close");
}
}
});
});
function ShowNormal(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'search/show/0/',
data: { admin: 1, page: e },
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
//$("a.delete").click(function () {
// deleteitem = $(this).parent().parent().parent();
// deleteid = deleteitem.attr("name");
// deleteurl = 'tweet/delete/';
// type = "tweet";
// $("#delete-dialog").dialog("open");
//});
UpdateNormal();
}
});
}
function DeleteTweet(id, d) {
deleteitem = $(d).parent().parent().parent();
deleteid = id;
deleteurl = 'tweet/delete/';
type = "tweet";
$("#delete-dialog").dialog("open");
}
function UpdateNormal() {
$.ajax({
type: "POST",
url: 'search/count/0/',
success: function (msg) {
msg = $.trim(msg);
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowNormal(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowNormal(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowNormal(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowFeedback(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'feedback/show/' + e,
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'feedback/delete/';
type = "feedback";
$("#delete-dialog").dialog("open");
});
$(".item-blog-title").click(function () {
var item = $(this).parent().next(".item-blog-content");
if (item.hasClass("close")) {
item.slideDown(200);
item.removeClass("close");
}
else {
item.slideUp(200);
item.addClass("close");
}
});
UpdateFeedback();
}
});
}
function UpdateFeedback() {
$.ajax({
type: "POST",
url: 'feedback/show/count',
success: function (msg) {
msg = $.trim(msg);
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowFeedback(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowFeedback(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowFeedback(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowHot() {
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/admin.js | JavaScript | gpl3 | 12,607 |
var allpage;
var page;
$(function () {
$("#confirmBox_ok").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#confirmBox_ok").css("position", "fixed");
$("#confirmBox_del").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#confirmBox_del").css("position", "fixed");
$.ajax({
type: 'POST',
url: 'avatar/',
success: function (msg) {
$("#headpic").attr("src", msg);
}
});
$("a.manager-control").click(function () {
$("a.manager-control").removeClass("manager-control-choose");
$(this).addClass("manager-control-choose");
});
$("a#jobs-publish-button").click(function () {
ShowJobsPublish();
});
$("a#recruitment-publish-button").click(function () {
ShowRecruitmentPublish();
});
$("input.info-content-words").focusin(function () {
$(this).addClass("info-content-words-focus");
if ($(this).val() == $(this).attr("title")) {
$(this).val("");
}
});
$("input.info-content-words").focusout(function () {
$(this).removeClass("info-content-words-focus");
if ($(this).val() == "") {
$(this).val($(this).attr("title"));
}
});
$("#search-text").keydown(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
});
$("#search-text").keyup(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
});
$("#search-text").keypress(function (e) {
if (e.which == 13) {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") {
location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + $("#sort").attr("name");
}
}
});
$("a#search-button").click(function () {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") {
location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + $("#sort").attr("name");
}
});
$("a.company-name").click(function () {
var text = $(this).html();
location = "/?search=" + encodeURIComponent(text) + "&cat=0";
});
$("#birthday").datepicker({
changeMonth: true,
changeYear: true
});
editor = CKEDITOR.replace('profile-detail', {
uiColor: '#d1e9f1',
language: 'zh-cn',
toolbar: [['NewPage', 'Save', 'Preview', '-', 'Templates'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], ['Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], '/', ['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor']],
resize_enabled: false,
filebrowserBrowseUrl: 'ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: 'ckfinder/ckfinder.html?Type=Images',
filebrowserImageUploadUrl: 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'
});
CKFinder.setupCKEditor(editor, "ckfinder/");
var sort = $.query.get("type");
if (sort == "profile") {
ShowProfile();
$("a.manager-control").removeClass("manager-control-choose");
$("#myprofile").addClass("manager-control-choose");
}
else {
ShowNormal(0);
}
$("a#profile-save").click(function () {
var show = 0;
if ($("#info-pic-control input").attr("checked")) {
show = 1;
}
else {
show = 0;
}
$.ajax({
type: 'POST',
url: 'resume/update',
data: {
name: $("#u-name").val(),
sex: $("input[name='dsex']:checked=\"checked\"").val(),
date_birth: $("#birthday").val(),
live_in_now: $("#n-positon").val(),
live_in: $("#o-positon").val(),
cellphone: $("#m-phone").val(),
email: $("#email").val(),
show_avatar: show,
content: editor.document.getBody().getHtml()
},
success: function (msg) {
$('#confirmBox_ok').show();
}
});
});
$("a#profile-preview").click(function () {
$("#h-name").val($("#u-name").val());
$("#h-sex").val($("input[name='dsex']:checked").val());
$("#date_birth").val($("#birthday").val());
$("#live_in_now").val($("#n-positon").val());
$("#live_in").val($("#o-positon").val());
$("#cellphone").val($("#m-phone").val());
$("#h-email").val($("#email").val());
$("#h-content").val(editor.document.getBody().getHtml());
if ($("#info-pic-control input").attr("checked")) {
$("#h-avatar").val(1);
}
else {
$("#h-avatar").val(0);
}
$("#ResumeForm").submit();
});
$("div.item").live("mouseover", function () {
if ($(this).hasClass("item-noclose")) {
$(this).addClass("item-over-noclose");
}
else {
$(this).addClass("item-over");
}
});
$("div.item").live("mouseout", function () {
if ($(this).hasClass("item-noclose")) {
$(this).removeClass("item-over-noclose");
}
else {
$(this).removeClass("item-over");
}
});
SetSorts();
$("#popBox_apply1").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#popBox_apply1").css("position", "fixed");
$("#popBox_apply0").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#popBox_apply0").css("position", "fixed");
});
function Delete() {
var flag = false;
$("div#pages").fadeOut(50);
if (allpage > 1) {
flag = true;
}
$.ajax({
type: "POST",
url: deleteurl + deleteid,
success: function () {
deleteitem.animate({ opacity: 0 }, 300, null, function () {
deleteitem.slideUp(200, null, function () {
if (type == "apply") {
if (flag) {
$.ajax({
type: 'POST',
url: 'apply_sent/show/',
data: { page: page },
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
$("div.item-delete a").unbind("click");
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'apply_sent/delete/';
type = "apply";
$('#confirmBox_del').show();
});
}
});
}
UpdateApply();
}
else if (type == "like") {
if (flag) {
$.ajax({
type: 'POST',
url: 'like/show/',
data: { page: page },
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
$("a.delete").unbind("click");
$("div.item-delete a").unbind("click");
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$('#confirmBox_del').show();
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$('#confirmBox_del').show();
});
}
});
}
UpdateFavourite();
}
else if (type == "tweet") {
if (flag) {
$.ajax({
type: 'POST',
url: 'user/show/',
data: { page: page },
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
$("a.delete").unbind("click");
$("div.item-delete a").unbind("click");
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
type = "tweet";
$('#confirmBox_del').show();
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
$('#confirmBox_del').show();
});
}
});
}
UpdateTweet();
}
});
});
$("#confirmBox_del").hide();
}
});
}
function AfterLogin() {
$.ajax({
type: 'POST',
url: '/user/info/',
success: function (msg) {
msg = $.trim(msg);
var username = msg.split(',')[0];
var type = msg.split(',')[1];
$("#name").html(username);
$("#my-microbloging").attr("href", "http://weibo.com/n/" + encodeURIComponent(username));
$("#name").attr("href", "profile/" + encodeURIComponent(username));
if (type == 1) {
$(".jobs").show();
}
else if (type == 2) {
$(".recruitment").show();
}
else if (type == 99) {
$(".recruitment").show();
$(".admin").show();
}
}
});
}
function ShowProfile() {
$("div#profile").show();
$("div#blogs").hide();
$("div#profile-control").show();
$("div#ads").hide();
$.ajax({
type: 'GET',
url: 'resume/show',
success: function (msg) {
if ($.trim(msg).indexOf('|') != -1) {
$("#u-name").val(msg.split('|')[0]);
$("input[name='dsex']").each(function () {
if ($(this).val() == msg.split('|')[1]) {
$(this).attr("checked", "checked");
}
});
$("#birthday").val(msg.split('|')[2]);
$("#n-positon").val(msg.split('|')[3]);
$("#o-positon").val(msg.split('|')[4]);
$("#m-phone").val(msg.split('|')[5]);
$("#email").val(msg.split('|')[6]);
if (msg.split('|')[7] == 0) {
$("#info-pic-control input").removeAttr("checked");
}
else {
$("#info-pic-control input").attr("checked", "checked");
}
var str = "";
for (s in msg.split('|')) {
if (s == 8) {
str += msg.split('|')[s];
}
else if (s >= 8) {
str += '|' + msg.split('|')[s];
}
}
editor.setData(str);
}
}
});
}
function SetContent(id, datas, item, count) {
var current = datas.attr("name");
$.ajax({
type: 'POST',
url: 'apply_received/show_tweet/' + id,
data: { page: current },
success: function (msg) {
item.html(msg);
$("a.item-applys-read").each(function () {
$(this).attr("href", "resume/show/" + $(this).parent().attr("id"));
$(this).attr("target", "_blank");
$(this).click(function () {
$(this).prev("span.item-applys-time:first").html($(this).prev("span.item-applys-time:first").html() + "(已阅)");
});
});
var allpage = 0;
if (count % 10 == 0) {
allpage = Math.floor(count / 10);
}
else {
allpage = Math.floor(count / 10) + 1;
}
item.next(".item-page").html('');
if (allpage > 1) {
if (current != allpage - 1) {
item.next(".item-page").html('<a class="right">下一页</a>');
item.next(".item-page").children("a:first").click(function () {
datas.attr("name", current + 1);
SetContent(id, datas, item, count);
});
}
if (current != 0) {
item.next(".item-page").html(item.next(".item-page").html() + '<a class="right">上一页</a>');
item.next(".item-page").children("a:last").click(function () {
datas.attr("name", current - 1);
SetContent(id, datas, item, count);
});
}
}
item.slideDown(200);
item.next(".item-page").slideDown(200);
item.removeClass("close");
}
});
}
function UpdateApplys() {
$.ajax({
type: "POST",
url: 'apply_received/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowApplys(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowApplys(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowApplys(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowApplys(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'apply_received/show/',
data: { page: page },
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
$("a.applys").click(function () {
var datas = $(this);
var count = $(this).attr("id");
$(this).attr("name", "0");
var id = $(this).parent().parent().parent().attr("id");
var item = $(this).parent().next(".item-applys");
if (item.hasClass("close")) {
SetContent(id, datas, item, count);
}
else {
item.slideUp(200);
item.next(".item-page").slideUp(200);
item.addClass("close");
}
});
UpdateApplys();
}
});
}
function ShowApply(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'apply_sent/show/',
data: { page: page },
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'apply_sent/delete/';
type = "apply";
$('#confirmBox_del').show();
});
$(".job-closed").animate({ opacity: 0.4 }, 0);
UpdateApply();
}
});
}
function UpdateApply() {
$.ajax({
type: "POST",
url: 'apply_sent/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowApply(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowApply(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowApply(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowFavourite(e) {
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'like/show/',
data: { page: e },
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$('#confirmBox_del').show();
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$('#confirmBox_del').show();
});
UpdateFavourite();
}
});
}
function UpdateFavourite() {
$.ajax({
type: "POST",
url: 'like/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowFavourite(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowFavourite(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowFavourite(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowNormal(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'user/show',
data: { page: page },
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
type = "tweet";
$('#confirmBox_del').show();
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
$('#confirmBox_del').show();
});
UpdateTweet();
}
});
}
function UpdateTweet() {
$.ajax({
type: "POST",
url: 'user/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowNormal(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowNormal(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowNormal(page);
$(window).scrollTop(0);
});
}
}
});
} | 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/manager.js | JavaScript | gpl3 | 32,185 |
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
}; | 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/jquery.cookie.js | JavaScript | gpl3 | 4,246 |
/**
* jQuery.query - Query String Modification and Creation for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/8/13
*
* @author Blair Mitchelmore
* @version 2.1.7
*
**/
new function(settings) {
// Various Settings
var $separator = settings.separator || '&';
var $spaces = settings.spaces === false ? false : true;
var $suffix = settings.suffix === false ? '' : '[]';
var $prefix = settings.prefix === false ? false : true;
var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";
var $numbers = settings.numbers === false ? false : true;
jQuery.query = new function() {
var is = function(o, t) {
return o != undefined && o !== null && (!!t ? o.constructor == t : true);
};
var parse = function(path) {
var m, rx = /\[([^[]*)\]/g, match = /^([^[]+)(\[.*\])?$/.exec(path), base = match[1], tokens = [];
while (m = rx.exec(match[2])) tokens.push(m[1]);
return [base, tokens];
};
var set = function(target, tokens, value) {
var o, token = tokens.shift();
if (typeof target != 'object') target = null;
if (token === "") {
if (!target) target = [];
if (is(target, Array)) {
target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
} else if (is(target, Object)) {
var i = 0;
while (target[i++] != null);
target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);
} else {
target = [];
target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
}
} else if (token && token.match(/^\s*[0-9]+\s*$/)) {
var index = parseInt(token, 10);
if (!target) target = [];
target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
} else if (token) {
var index = token.replace(/^\s*|\s*$/g, "");
if (!target) target = {};
if (is(target, Array)) {
var temp = {};
for (var i = 0; i < target.length; ++i) {
temp[i] = target[i];
}
target = temp;
}
target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
} else {
return value;
}
return target;
};
var queryObject = function(a) {
var self = this;
self.keys = {};
if (a.queryObject) {
jQuery.each(a.get(), function(key, val) {
self.SET(key, val);
});
} else {
jQuery.each(arguments, function() {
var q = "" + this;
q = q.replace(/^[?#]/,''); // remove any leading ? || #
q = q.replace(/[;&]$/,''); // remove any trailing & || ;
if ($spaces) q = q.replace(/[+]/g,' '); // replace +'s with spaces
jQuery.each(q.split(/[&;]/), function(){
var key = decodeURIComponent(this.split('=')[0] || "");
var val = decodeURIComponent(this.split('=')[1] || "");
if (!key) return;
if ($numbers) {
if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) // simple float regex
val = parseFloat(val);
else if (/^[+-]?[0-9]+$/.test(val)) // simple int regex
val = parseInt(val, 10);
}
val = (!val && val !== 0) ? true : val;
if (val !== false && val !== true && typeof val != 'number')
val = val;
self.SET(key, val);
});
});
}
return self;
};
queryObject.prototype = {
queryObject: true,
has: function(key, type) {
var value = this.get(key);
return is(value, type);
},
GET: function(key) {
if (!is(key)) return this.keys;
var parsed = parse(key), base = parsed[0], tokens = parsed[1];
var target = this.keys[base];
while (target != null && tokens.length != 0) {
target = target[tokens.shift()];
}
return typeof target == 'number' ? target : target || "";
},
get: function(key) {
var target = this.GET(key);
if (is(target, Object))
return jQuery.extend(true, {}, target);
else if (is(target, Array))
return target.slice(0);
return target;
},
SET: function(key, val) {
var value = !is(val) ? null : val;
var parsed = parse(key), base = parsed[0], tokens = parsed[1];
var target = this.keys[base];
this.keys[base] = set(target, tokens.slice(0), value);
return this;
},
set: function(key, val) {
return this.copy().SET(key, val);
},
REMOVE: function(key) {
return this.SET(key, null).COMPACT();
},
remove: function(key) {
return this.copy().REMOVE(key);
},
EMPTY: function() {
var self = this;
jQuery.each(self.keys, function(key, value) {
delete self.keys[key];
});
return self;
},
load: function(url) {
var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");
var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");
return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);
},
empty: function() {
return this.copy().EMPTY();
},
copy: function() {
return new queryObject(this);
},
COMPACT: function() {
function build(orig) {
var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig;
if (typeof orig == 'object') {
function add(o, key, value) {
if (is(o, Array))
o.push(value);
else
o[key] = value;
}
jQuery.each(orig, function(key, value) {
if (!is(value)) return true;
add(obj, key, build(value));
});
}
return obj;
}
this.keys = build(this.keys);
return this;
},
compact: function() {
return this.copy().COMPACT();
},
toString: function() {
var i = 0, queryString = [], chunks = [], self = this;
var encode = function(str) {
str = str + "";
if ($spaces) str = str.replace(/ /g, "+");
return encodeURIComponent(str);
};
var addFields = function(arr, key, value) {
if (!is(value) || value === false) return;
var o = [encode(key)];
if (value !== true) {
o.push("=");
o.push(encode(value));
}
arr.push(o.join(""));
};
var build = function(obj, base) {
var newKey = function(key) {
return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join("");
};
jQuery.each(obj, function(key, value) {
if (typeof value == 'object')
build(value, newKey(key));
else
addFields(chunks, newKey(key), value);
});
};
build(this.keys);
if (chunks.length > 0) queryString.push($hash);
queryString.push(chunks.join($separator));
return queryString.join("");
}
};
return new queryObject(location.search, location.hash);
};
}(jQuery.query || {}); // Pass in jQuery.query as settings object
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/jquery.query-2.1.7.js | JavaScript | gpl3 | 7,844 |
var deleteitem;
var deleteid;
var deleteurl;
var page = 0;
var allpage = 0;
var type = "";
var editor;
$(function () {
$.ajax({
type: 'POST',
url: 'avatar/',
success: function (msg) {
$("#headpic").attr("src", msg);
}
});
$("div#profile-info").dialog({
autoOpen: false,
draggable: false,
resizable: false,
buttons: {
"确定": function () {
$(this).dialog("close");
}
}
});
// $("div#content-middle-delete a").animate({ opacity: 0.6 }, 0);
// $("div#content-middle-delete a").mouseover(function () {
// $(this).stop().animate({ opacity: 1 }, 200);
// });
// $("div#content-middle-delete a").mouseout(function () {
// $(this).stop().animate({ opacity: 0.6 }, 200);
// });
$("a.manager-control").click(function () {
$("a.manager-control").removeClass("manager-control-choose");
$(this).addClass("manager-control-choose");
});
$("a#jobs-publish-button").click(function () {
ShowJobsPublish();
});
$("a#recruitment-publish-button").click(function () {
ShowRecruitmentPublish();
});
$("input.info-content-words").focusin(function () {
$(this).addClass("info-content-words-focus");
if ($(this).val() == $(this).attr("title")) {
$(this).val("");
}
});
$("input.info-content-words").focusout(function () {
$(this).removeClass("info-content-words-focus");
if ($(this).val() == "") {
$(this).val($(this).attr("title"));
}
});
$("#search-text").keydown(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
});
$("#search-text").keyup(function () {
if ($(this).val().length > 32) {
$(this).val($(this).val().substring(0, 32));
}
});
$("#search-text").keypress(function (e) {
if (e.which == 13) {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") {
location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + cate;
}
}
});
$("a#search-button").click(function () {
if ($("#search-text").val() != "职位关键字,如:北京 产品经理 阿里巴巴") {
location = "/?search=" + encodeURIComponent($("#search-text").val()) + "&cat=" + cate;
}
});
$("a.company-name").click(function () {
var text = $(this).html();
location = "/?search=" + encodeURIComponent(text) + "&cat=0";
});
$("#birthday").datepicker({
changeMonth: true,
changeYear: true
});
editor = CKEDITOR.replace('profile-detail', {
uiColor: '#d1e9f1',
language: 'zh-cn',
toolbar: [['NewPage', 'Save', 'Preview', '-', 'Templates'], ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'], ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink', 'Anchor'], ['Image', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak'], '/', ['Styles', 'Format', 'Font', 'FontSize'], ['TextColor', 'BGColor']],
resize_enabled: false,
filebrowserBrowseUrl: 'ckfinder/ckfinder.html',
filebrowserImageBrowseUrl: 'ckfinder/ckfinder.html?Type=Images',
filebrowserImageUploadUrl: 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'
});
CKFinder.setupCKEditor(editor, "ckfinder/");
// $("div#info-pic a").click(function () {
// var finder = new CKFinder();
// finder.basePath = 'ckfinder/';
// finder.selectActionFunction = SetFileField;
// finder.popup();
// });
$("a#profile-save").click(function () {
$.ajax({
type: 'POST',
url: 'resume/add',
data: {
name: $("#u-name").val(),
sex: $("input[name='dsex']:checked=\"checked\"").val(),
date_birth: $("#birthday").val(),
live_in_now: $("#n-positon").val(),
live_in: $("#o-positon").val(),
cellphone: $("#m-phone").val(),
email: $("#email").val(),
content: editor.document.getBody().getHtml()
},
success: function (msg) {
$("div#profile-info").dialog("open");
}
});
});
$("a#profile-preview").click(function () {
// $.ajax({
// type: 'POST',
// url: 'resume/preview',
// data: {
// name: $("#u-name").val(),
// sex: $("input[name='sex']:checked").val(),
// date_birth: $("#birthday").val(),
// live_in_now: $("#n-positon").val(),
// live_in: $("#o-positon").val(),
// cellphone: $("#m-phone").val(),
// email: $("#email").val(),
// content: editor.document.getBody().getHtml()
// },
// success: function (msg) {
// var obj = window.open("/resume");
// obj.document.write(msg);
// }
// });
$("#h-name").val($("#u-name").val());
$("#h-sex").val($("input[name='dsex']:checked").val());
$("#date_birth").val($("#birthday").val());
$("#live_in_now").val($("#n-positon").val());
$("#live_in").val($("#o-positon").val());
$("#cellphone").val($("#m-phone").val());
$("#h-email").val($("#email").val());
$("#h-content").val(editor.document.getBody().getHtml());
alert($("input[name='dsex']:checked").title);
$("#ResumeForm").submit();
});
$("a.applys").click(function () {
var item = $(this).parent().next(".item-applys");
if (item.hasClass("close")) {
item.slideDown(200);
item.removeClass("close");
}
else {
item.slideUp(200);
item.addClass("close");
}
});
// added 20110415
$("a.apply").live("click", function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("id");
$.ajax({
type: "POST",
url: 'apply/add/' + id,
success: function () {
item.hide();
item.next("a.unapply").show();
}
});
});
$("a.unapply").live("click", function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("id");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
$("div.item").live("mouseover", function () {
$(this).addClass("item-over");
});
$("div.item").live("mouseout", function () {
$(this).removeClass("item-over");
});
$("#delete-dialog").dialog({
autoOpen: false,
draggable: false,
resizable: false,
width: 180,
buttons: {
"确定": function () {
$(this).dialog("close");
var flag = false;
$("div#pages").fadeOut(50);
if (allpage > 1) {
flag = true;
}
$.ajax({
type: "POST",
url: deleteurl + deleteid,
success: function () {
deleteitem.animate({ opacity: 0 }, 300, null, function () {
deleteitem.slideUp(200, null, function () {
if (type == "apply") {
if (flag) {
$.ajax({
type: 'POST',
url: 'apply/show/' + page,
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
/*
$("div.item").unbind("mouseover");
$("div.item").unbind("mouseout");
*/
$("div.item-delete a").unbind("click");
/*
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
*/
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'apply/delete/';
type = "apply";
$("#delete-dialog").dialog("open");
});
}
});
}
UpdateApply();
}
else if (type == "like") {
if (flag) {
$.ajax({
type: 'POST',
url: 'like/show/' + page,
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
/*
$("a.apply").unbind("click");
$("a.unapply").unbind("click");
$("div.item").unbind("mouseover");
$("div.item").unbind("mouseout");
*/
$("a.delete").unbind("click");
$("div.item-delete a").unbind("click");
/*
$("a.apply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("id");
$.ajax({
type: "POST",
url: 'apply/add/' + id,
success: function () {
item.hide();
item.next("a.unapply").show();
}
});
});
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("id");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
*/
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$("#delete-dialog").dialog("open");
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$("#delete-dialog").dialog("open");
});
}
});
}
UpdateFavourite();
}
else if (type == "tweet") {
if (flag) {
$.ajax({
type: 'POST',
url: 'user/current/0/' + page,
success: function (msg) {
var str = '<div class="item newer" style="display:none;"';
str += msg.split('<div class="item"')[10];
$("div.item:last").after(str);
$(".newer:last").slideDown(200);
/*
$("div.item").unbind("mouseover");
$("div.item").unbind("mouseout");
*/
$("a.delete").unbind("click");
$("div.item-delete a").unbind("click");
/*
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
*/
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
type = "tweet";
$("#delete-dialog").dialog("open");
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
$("#delete-dialog").dialog("open");
});
}
});
}
UpdateTweet();
}
});
});
}
});
},
"取消": function () {
$(this).dialog("close");
}
}
});
var sort = $.query.get("type");
if (sort == "profile") {
ShowProfile();
$("a.manager-control").removeClass("manager-control-choose");
$("#myprofile").addClass("manager-control-choose");
}
else {
ShowNormal(0);
}
});
function ShowProfile() {
$("div#profile").show();
$("div#blogs").hide();
$("div#profile-control").show();
$("div#ads").hide();
$.ajax({
type: 'GET',
url: 'resume/show',
success: function (msg) {
if ($.trim(msg).indexOf('|') != -1) {
$("#u-name").val(msg.split('|')[0]);
$("input[name='dsex']").val(msg.split('|')[1]);
$("#birthday").val(msg.split('|')[2]);
$("#n-positon").val(msg.split('|')[3]);
$("#o-positon").val(msg.split('|')[4]);
$("#m-phone").val(msg.split('|')[5]);
$("#email").val(msg.split('|')[6]);
var str = "";
for (s in msg.split('|')) {
if (s == 7) {
str += msg.split('|')[s];
}
else if (s >= 7) {
str += '|' + msg.split('|')[s];
}
}
editor.setData(str);
}
}
});
}
function SetContent(id, datas, item, count) {
var current = datas.attr("name");
$.ajax({
type: 'POST',
url: 'received/apply/' + id + "/" + current,
success: function (msg) {
item.html(msg);
$("a.item-applys-read").each(function () {
$(this).attr("href", "resume/show/" + $(this).parent().attr("id"));
$(this).attr("target", "_blank");
});
var allpage = 0;
if (count % 10 == 0) {
allpage = Math.floor(count / 10);
}
else {
allpage = Math.floor(count / 10) + 1;
}
item.next(".item-page").html('');
if (allpage > 1) {
if (current != allpage - 1) {
item.next(".item-page").html('<a class="right">下一页</a>');
item.next(".item-page").children("a:first").click(function () {
datas.attr("name", current + 1);
SetContent(id, datas, item, count);
});
}
if (current != 0) {
item.next(".item-page").html(item.next(".item-page").html() + '<a class="right">上一页</a>');
item.next(".item-page").children("a:last").click(function () {
datas.attr("name", current - 1);
SetContent(id, datas, item, count);
});
}
}
item.slideDown(200);
item.next(".item-page").slideUp(200);
item.removeClass("close");
}
});
}
function UpdateApplys() {
$.ajax({
type: "POST",
url: 'received/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowApplys(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowApplys(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowApplys(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowApplys(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'received/' + e,
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
$("a.applys").click(function () {
var datas = $(this);
var count = $(this).attr("id");
$(this).attr("name", "0");
var id = $(this).parent().parent().parent().attr("id");
var item = $(this).parent().next(".item-applys");
if (item.hasClass("close")) {
SetContent(id, datas, item, count);
}
else {
item.slideUp(200);
item.next(".item-page").slideUp(200);
item.addClass("close");
}
});
UpdateApplys();
// $("div.item").mouseover(function () {
// $(this).addClass("item-over");
// });
// $("div.item").mouseout(function () {
// $(this).removeClass("item-over");
// });
// $("div.item-delete a").click(function () {
// deleteitem = $(this).parent().parent();
// deleteid = deleteitem.attr("id");
// deleteurl = 'apply/delete/';
// type = "apply";
// $("#delete-dialog").dialog("open");
// });
// UpdateApply();
}
});
}
function ShowApply(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'apply/show/' + e,
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
/*
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
*/
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'apply/delete/';
type = "apply";
$("#delete-dialog").dialog("open");
});
$(".job-closed").animate({ opacity: 0.4 }, 0);
UpdateApply();
}
});
}
function UpdateApply() {
$.ajax({
type: "POST",
url: 'apply/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowApply(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowApply(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowApply(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowFavourite(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'like/show/' + e,
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
/*
$("a.apply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("id");
$.ajax({
type: "POST",
url: 'apply/add/' + id,
success: function () {
item.hide();
item.next("a.unapply").show();
}
});
});
$("a.unapply").click(function () {
var item = $(this);
var id = $(this).parent().parent().parent().attr("id");
$.ajax({
type: "POST",
url: 'apply/delete/' + id,
success: function () {
item.hide();
item.prev("a.apply").show();
}
});
});
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
*/
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$("#delete-dialog").dialog("open");
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'like/delete/';
type = "like";
$("#delete-dialog").dialog("open");
});
UpdateFavourite();
}
});
}
function UpdateFavourite() {
$.ajax({
type: "POST",
url: 'like/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowFavourite(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowFavourite(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowFavourite(page);
$(window).scrollTop(0);
});
}
}
});
}
function ShowNormal(e) {
page = e;
$("div#profile").hide();
$("div#blogs").show();
$("div#profile-control").hide();
$("div#ads").show();
$.ajax({
type: 'POST',
url: 'user/current/0/' + e,
success: function (msg) {
$("div#pages").fadeOut(50);
$("div#blogsinner").html(msg);
/*
$("div.item").mouseover(function () {
$(this).addClass("item-over");
});
$("div.item").mouseout(function () {
$(this).removeClass("item-over");
});
*/
$("a.delete").click(function () {
deleteitem = $(this).parent().parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
type = "tweet";
$("#delete-dialog").dialog("open");
});
$("div.item-delete a").click(function () {
deleteitem = $(this).parent().parent();
deleteid = deleteitem.attr("id");
deleteurl = 'tweet/delete/';
$("#delete-dialog").dialog("open");
});
UpdateTweet();
}
});
}
function UpdateTweet() {
$.ajax({
type: "POST",
url: 'user/current/0/count',
success: function (msg) {
msg = $.trim(msg);
$("span#blogs-count").html("共有" + msg + "条记录");
if (msg % 10 == 0) {
allpage = Math.floor(msg / 10);
}
else {
allpage = Math.floor(msg / 10) + 1;
}
if (allpage > 0) {
prevLess = false;
nextLess = false;
var str = '<div id="pages-inner" class="right">';
if (page != 0) {
str += '<a class="page-control left" id="prevPage">上一页</a>';
}
for (i = 0; i < allpage; i++) {
if (!prevLess && i - page < -2) {
if (i == 0) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
else {
prevLess = true;
str += '<span class="left">...</span>';
}
}
if (Math.abs(i - page) <= 2) {
if (i == page) {
str += '<a class="page-number page-number-current left">' + (i + 1) + '</a>';
}
else {
str += '<a class="page-number left">' + (i + 1) + '</a>';
}
}
if (i == allpage - 1 && i - page > 2) {
str += '<a class="page-number left">' + (i + 1) + '</a>';
nextLess = true;
}
if (!nextLess && i - page > 2) {
nextLess = true;
str += '<span class="left">...</span>';
}
}
if (page != allpage - 1) {
str += '<a class="page-control left" id="nextPage">下一页</a>';
}
str += '</div>';
$("div#pages").html(str);
$("div#pages").fadeIn(200);
$("a.page-number").click(function () {
page = $(this).html() - 1;
ShowNormal(page);
$(window).scrollTop(0);
});
$("a#prevPage").click(function () {
page--;
ShowNormal(page);
$(window).scrollTop(0);
});
$("a#nextPage").click(function () {
page++;
ShowNormal(page);
$(window).scrollTop(0);
});
}
}
});
}
function AfterLogin() {
$.ajax({
type: 'POST',
url: 'info/',
success: function (msg) {
$(".logined").fadeIn(300);
$("a#name").html(msg.split(',')[0]);
$("div#links a:last").attr("href", "profile/" + msg.split(',')[0]);
var type = msg.split(',')[1];
if (type == 1) {
$(".jobs").fadeIn(300);
$(".recruitment").hide();
$(".admin").hide();
}
else if (type == 2) {
$(".recruitment").fadeIn(300);
$(".jobs").hide();
$(".admin").hide();
}
else if (type == 0) {
$(".admin").show();
$(".jobs").hide();
$(".recruitment").show();
}
}
});
}
function SetFileField(fileUrl) {
$("div#info-pic img").attr("src", fileUrl);
} | 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/Copy of manager.js | JavaScript | gpl3 | 40,812 |
//User Login - share.js
var logined = false;
var rolekind = "";
function showError(msg){
$("#errormsg").html(msg);
$("#error-info").dialog("open");
}
$(function () {
$("#error-info").dialog({
autoOpen: false,
draggable: false,
resizable: false,
modal: true,
buttons: {
"确定": function () {
$(this).dialog("close");
}
}
});
$("#logo").mouseover(function () {
$(this).html("回首页");
});
$("#logo").mouseout(function () {
$(this).html("测试版");
});
InitUser();
SetPublish();
$("input#search-text").focusin(function () {
$("#sorts").fadeOut(200);
$(this).css("color", "#000000");
if ($(this).val() == "职位关键字,如:北京 产品经理 阿里巴巴") {
$(this).val("");
}
});
$("input#search-text").focusout(function () {
$(this).css("color", "#adadad");
if ($(this).val() == "") {
$(this).val("职位关键字,如:北京 产品经理 阿里巴巴");
}
});
});
function InitUser() {
auth = $.cookie("USER_AUTH");
if (auth == null) {
logined = false;
}
else {
logined = true;
}
if (logined) {
$(".logined").show();
AfterLogin();
}
else {
$(".logouted").show();
}
}
//End of User Login
function CoverResize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight) {
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
} else {
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if (self.innerHeight) {
if (document.documentElement.clientWidth) {
windowWidth = document.documentElement.clientWidth;
} else {
windowWidth = self.innerWidth;
}
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
} else if (document.body) {
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
if (yScroll < windowHeight) {
pageHeight = windowHeight;
} else {
pageHeight = yScroll;
}
if (xScroll < windowWidth) {
pageWidth = xScroll;
} else {
pageWidth = windowWidth;
}
$("body").css("overflow", "hidden");
$("div#cover").css("height", pageHeight + "px");
$("div#cover").css("width", pageWidth + "px");
$("div#cover").animate({ opacity: 0.4 }, 0);
}
function SetPublish() {
$("#popBox_publishok").position({
of: $("html"),
my: "center top",
at: "center top",
offset: "0 200",
collision: "none none"
});
$("#popBox_publishok").css("position", "fixed");
$("div#jobs-publish").position({
of: $("body"),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("div#recruitment-publish").position({
of: $("body"),
my: "center top",
at: "center top",
offset: "0 130",
collision: "none none"
});
$("div#jobs-publish-title a").click(function () { HideJobsPublish(); });
$("div#recruitment-publish-title a").click(function () { HideRecruitmentPublish(); });
$("div#jobs-publish-confirm a").click(function () {
$.ajax({
type: 'POST',
url: 'tweet/post/1',
data: { text: $("div#jobs-publish-text textarea").val() },
success: function (msg) {
if ($.trim(msg) != "0" && $.trim(msg) != "") {
showError(msg);
}
HideJobsPublish();
$("#popBox_publishok").show();
}
});
});
$("div#recruitment-publish-confirm a").click(function () {
$("#RecruitmentForm").submit();
HideRecruitmentPublish();
var $window = jQuery(window);
var temp = ($window.width() - 50) / 2;
var controlx = temp >= 0 ? temp : 0;
temp = ($window.height() - 50) / 2;
var controly = $window.scrollTop() + (temp >= 0 ? temp : 0);
$("#LFlower").html('<img style="margin-top:9px;margin-left:9px;" src="images/loading.gif" alt="" />');
$("#LFlower").css({ left: controlx + 'px', top: controly + 'px', height: '50px', width: '50px' });
$("#LFlower").fadeIn(200);
$("div#cover").fadeIn(200);
$("#hf").load(function(){
if ($.trim($("#hf").contents().find("body").html()) != "0" && $.trim($("#hf").contents().find("body").html()) != "") {
showError($.trim($("#hf").contents().find("body").html()));
//alert(msg);
}else{
$("#LFlower").fadeOut(200);
$("div#cover").fadeOut(200);
$("#popBox_publishok").show();
}
});
});
//Jobs Hot Tags
$.ajax({
type: 'POST',
url: 'hot/tag/1',
success: function (msg) {
$("div#jobs-publish-tags-hot").html(msg);
$("a.jobs-publish-tags-hot-item").click(function () {
$("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val() + " " + $(this).attr("title"));
UpdateJobsText();
$("div#jobs-publish-text textarea").focus();
$("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val());
});
}
});
//Recruitment Hot Tags
$.ajax({
type: 'POST',
url: 'hot/tag/2',
success: function (msg) {
$("div#recruitment-publish-tags-hot").html(msg);
$("a.recruitment-publish-tags-hot-item").click(function () {
$("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val() + " " + $(this).attr("title"));
UpdateRecruitmentText();
$("div#recruitment-publish-text textarea").focus();
$("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val());
});
}
});
$("div#jobs-publish-text textarea").keydown(function () {
UpdateJobsText();
});
$("div#recruitment-publish-text textarea").keydown(function () {
UpdateRecruitmentText();
});
$("div#jobs-publish-text textarea").keyup(function () {
UpdateJobsText();
});
$("div#recruitment-publish-text textarea").keyup(function () {
UpdateRecruitmentText();
});
$("a#jobs-publish-quick").click(function () { ShowJobsPublish(); });
$("a#recruitment-publish-quick").click(function () { ShowRecruitmentPublish(); });
UpdateJobsText();
UpdateRecruitmentText();
}
function UpdateJobsText() {
if (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) {
$("div#jobs-publish-remain").html("还可输入" + (140 - Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字");
}
else {
$("div#jobs-publish-remain").html("已超出" + (Math.ceil($("div#jobs-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字");
}
}
function UpdateRecruitmentText() {
if (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2) >= 0) {
$("div#recruitment-publish-remain").html("还可输入" + (140 - Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2)) + "个字");
}
else {
$("div#recruitment-publish-remain").html("已超出" + (Math.ceil($("div#recruitment-publish-text textarea").val().replace(/[^\x00-\xff]/g, "**").length / 2 - 140)) + "个字");
}
}
function ShowJobsPublish() {
CoverResize();
$("div#cover").fadeIn(200);
$("body").css("overflow", "hidden");
$("div#jobs-publish").fadeIn(200);
$("div#jobs-publish-text textarea").focus();
$("div#jobs-publish-text textarea").val($("div#jobs-publish-text textarea").val());
// $("div#jobs-publish-text textarea").val("??");
}
function HideJobsPublish() {
$("div#cover").fadeOut(200);
$("body").css("overflow", "auto");
$("div#jobs-publish").fadeOut(200);
}
function ShowRecruitmentPublish() {
CoverResize();
$("div#cover").fadeIn(200);
$("body").css("overflow", "hidden");
$("div#recruitment-publish").fadeIn(200);
$("div#recruitment-publish-text textarea").focus();
$("div#recruitment-publish-text textarea").val($("div#recruitment-publish-text textarea").val());
}
function HideRecruitmentPublish() {
$("div#cover").fadeOut(200);
$("body").css("overflow", "auto");
$("div#recruitment-publish").fadeOut(200);
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/script/share.js | JavaScript | gpl3 | 9,507 |
<?php
session_start();
include_once('common.inc.php');
include_once('theme.inc.php');
include_once('login.inc.php');
include_once('search.inc.php');
include_once('follow.inc.php');
include_once('like.inc.php');
include_once('hot.inc.php');
include_once('user.inc.php');
include_once('tweet.inc.php');
include_once('resume.inc.php');
include_once('apply_sent.inc.php');
include_once('apply_received.inc.php');
include_once('avatar.inc.php');
include_once('feedback.inc.php');
include_once('count.inc.php');
func_register(array(
'' => array(
'callback' => 'home_page',
),
'home' => array(
'callback' => 'home_page',
),
'manager' => array(
'callback' => 'manager_page',
'security' => 'true',
),
'feedback' => array(
'callback' => 'feedback_page',
),
'help' => array(
'callback' => 'help_page',
),
'admin' => array(
'callback' => 'admin_page',
'admin' => 'true',
),
));
function home_page()
{
theme('template', 'default.html');
#header("Location: ".BASE_URL."default.html");
#$content = theme('result', get_newest_result(10));
#theme('search', '首页', $content);
#echo "502: Service Unavailable";
}
function manager_page()
{
theme('template', 'manager.html');
}
function feedback_page($query)
{
$key = (string) $query[1];
if(!$key)
theme('template', 'feedback.html');
else
{
$function = 'feedback_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
}
function help_page()
{
theme('template', 'help.html');
}
function admin_page()
{
theme('template', 'admin.html');
}
func_execute_active_handler();
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/index.php | PHP | gpl3 | 1,722 |
<?php
include_once('common.inc.php');
func_register(array(
'count' => array(
'callback' => 'count_show',
),
));
function count_show()
{
$counts = get_counts();
$r = $counts['tweets_thisweek'].','.$counts['tweets_today'];
echo $r;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/count.inc.php | PHP | gpl3 | 262 |
<?php
include_once('common.inc.php');
func_register(array(
'follow' => array(
'callback' => 'deal_following',
'security' => 'true',
),
));
function get_followings($num)
{
include_once('login.inc.php');
$id = get_current_user_id();
connect_db();
$view = "SELECT * FROM followings WHERE user_id='$id' AND deleted=0 ORDER BY add_time DESC";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
{
$result[$i++] = $row;
if($i == $num)
break;
}
return $result;
}
function following_show()
{
$args = func_get_args();
$key = intval($args[2]);
$content = '';
$follows = get_followings($key);
foreach($follows as $f)
$content .= '<div class="concern-item concern-item-normal" onmouseover="ConcernMouseOver(this)"
onmouseout="ConcernMouseOut(this)">
<a class="concern-item-delete left" onclick="ConcernDeleteClick(\''.$f['following_id'].'\',\''.$f['search'].'\',this)"></a>
<div class="left concern-item-content" onclick="ConcernContentClick(\''.$f['cat_id'].'\',\''.$f['search'].'\')">
<a class="left concern-item-content-info">'.$f['search'].'</a> <a class="right concern-item-content-number">
</a>
</div>
</div>';
echo $content;
}
function following_delete()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM followings WHERE user_id='$id' AND following_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$view = "UPDATE followings SET deleted='1' WHERE user_id='$id' AND following_id='$key'";
$list = mysql_query($view) or die("Delete error!");
}
else
{
print $key;
die(": Non-exist Error!");
}
}
function following_exist()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$cat = $args[2];
$key = get_post('search');
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM followings WHERE cat_id='$cat' AND user_id='$id' AND search='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
echo "1";
else
echo "0";
}
function following_add()
{
include_once('login.php');
$id = get_current_user_id();
$args = func_get_args();
$cat = $args[2];
$key = get_post('search');
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT COUNT(*) FROM followings WHERE user_id='$id' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row[0] >= 20)
{
die('Too many followings!');
}
$view = "SELECT * FROM followings WHERE cat_id='$cat' AND user_id='$id' AND search='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
following_delete("", "", $row['following_id']);
}
include_once("uuid.inc.php");
$v4uuid = str_replace("-", "", UUID::v4());
$current_datetime = date('Y-m-d H:i:s');
$view = "INSERT INTO followings(following_id, search, user_id, deleted, add_time, cat_id) VALUES ('$v4uuid', '$key', '$id', '0', '$current_datetime', '$cat')";
$list = mysql_query($view) or die("Insert error!");
}
function deal_following($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'following_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/follow.inc.php | PHP | gpl3 | 3,908 |
<?php
/*
* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/*! \mainpage CKEditor - PHP server side intergation
* \section intro_sec CKEditor
* Visit <a href="http://ckeditor.com">CKEditor web site</a> to find more information about the editor.
* \section install_sec Installation
* \subsection step1 Include ckeditor.php in your PHP web site.
* @code
* <?php
* include("ckeditor/ckeditor.php");
* ?>
* @endcode
* \subsection step2 Create CKEditor class instance and use one of available methods to insert CKEditor.
* @code
* <?php
* $CKEditor = new CKEditor();
* echo $CKEditor->textarea("field1", "<p>Initial value.</p>");
* ?>
* @endcode
*/
if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) )
include_once( 'ckeditor_php4.php' ) ;
else
include_once( 'ckeditor_php5.php' ) ;
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/ckeditor.php | PHP | gpl3 | 962 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
body
{
/* Font */
font-family: Arial, Verdana, sans-serif;
font-size: 12px;
/* Text color */
color: #222;
/* Remove the background color to make it transparent */
background-color: #fff;
}
/* preserved spaces for rtl list item bullets. (#6249)*/
ol,ul,dl
{
padding-right:40px;
}
html
{
/* #3658: [IE6] Editor document has horizontal scrollbar on long lines
To prevent this misbehavior, we show the scrollbar always */
_overflow-y: scroll;
/* #6341: The text cursor must be set on the editor area. */
cursor: text;
/* #6632: Avoid having "text" shape of cursor in IE7 scrollbars.*/
*cursor:auto;
}
img:-moz-broken
{
-moz-force-broken-image-icon : 1;
width : 24px;
height : 24px;
}
img, input, textarea
{
cursor: default;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/contents.css | CSS | gpl3 | 940 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
// Compressed version of core/ckeditor_base.js. See original for instructions.
/*jsl:ignore*/
if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.5.2',revision:'6450',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
/*jsl:end*/
// Uncomment the following line to have a new timestamp generated for each
// request, having clear cache load of the editor code.
// CKEDITOR.timestamp = ( new Date() ).valueOf();
if ( CKEDITOR.loader )
CKEDITOR.loader.load( 'core/ckeditor' );
else
{
// Set the script name to be loaded by the loader.
CKEDITOR._autoLoad = 'core/ckeditor';
// Include the loader script.
document.write(
'<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/ckeditor_source.js | JavaScript | gpl3 | 1,608 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
== BEGIN TEXT ONLY VERSION ==
Software License Agreement
==========================
CKEditor - The text editor for Internet - http://ckeditor.com
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.org/licenses/gpl.html
(See Appendix A)
- GNU Lesser General Public License Version 2.1 or later (the "LGPL")
http://www.gnu.org/licenses/lgpl.html
(See Appendix B)
- Mozilla Public License Version 1.1 or later (the "MPL")
http://www.mozilla.org/MPL/MPL-1.1.html
(See Appendix C)
You are not required to, but if you want to explicitly declare the
license you have chosen to be bound to when using, reproducing,
modifying and distributing this software, just include a text file
titled "legal.txt" in your version of this software, indicating your
license choice. In any case, your choice will not restrict any
recipient of your version of this software to use, reproduce, modify
and distribute this software under any of the above licenses.
Sources of Intellectual Property Included in CKEditor
=====================================================
Where not otherwise indicated, all CKEditor content is authored by
CKSource engineers and consists of CKSource-owned intellectual
property. In some specific instances, CKEditor will incorporate work
done by developers outside of CKSource with their express permission.
YUI Test: At _source/tests/yuitest.js can be found part of the source
code of YUI, which is licensed under the terms of the BSD License
(http://developer.yahoo.com/yui/license.txt). YUI is Copyright (C)
2008, Yahoo! Inc.
Trademarks
==========
CKEditor is a trademark of CKSource - Frederico Knabben. All other brand
and product names are trademarks, registered trademarks or service
marks of their respective holders.
Appendix A: The GPL License
===========================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software-to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix B: The LGPL License
============================
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software-to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages-typically libraries-of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix C: The MPL License
===========================
MOZILLA PUBLIC LICENSE
Version 1.1
===============
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is ______________________________________.
The Initial Developer of the Original Code is ________________________.
Portions created by ______________________ are Copyright (C) ______
_______________________. All Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the terms
of the _____ license (the "[___] License"), in which case the
provisions of [______] License are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the [____] License and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the [___] License. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the [___] License."
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
== END TEXT ONLY VERSION ==
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>License - CKEditor</title>
</head>
<body>
<h1>
Software License Agreement
</h1>
<p>
<strong>CKEditor™</strong> - The text editor for Internet™ - <a href="http://ckeditor.com">
http://ckeditor.com</a><br />
Copyright © 2003-2011, <a href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
</p>
<p>
Licensed under the terms of any of the following licenses at your choice:
</p>
<ul>
<li><a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> Version
2 or later (the "GPL");</li>
<li><a href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a>
Version 2.1 or later (the "LGPL");</li>
<li><a href="http://www.mozilla.org/MPL/MPL-1.1.html">Mozilla Public License</a> Version
1.1 or later (the "MPL").</li>
</ul>
<p>
You are not required to, but if you want to explicitly declare the license you have
chosen to be bound to when using, reproducing, modifying and distributing this software,
just include a text file titled "LEGAL" in your version of this software, indicating
your license choice. In any case, your choice will not restrict any recipient of
your version of this software to use, reproduce, modify and distribute this software
under any of the above licenses.
</p>
<h2>
Sources of Intellectual Property Included in CKEditor
</h2>
<p>
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers
and consists of CKSource-owned intellectual property. In some specific instances,
CKEditor will incorporate work done by developers outside of CKSource with their
express permission.
</p>
<p>
<a href="http://developer.yahoo.com/yui/yuitest/">YUI Test</a>: At _source/tests/yuitest.js
can be found part of the source code of YUI, which is licensed under the terms of
the <a href="http://developer.yahoo.com/yui/license.txt">BSD License</a>. YUI is
Copyright © 2008, Yahoo! Inc.
</p>
<h2>
Trademarks
</h2>
<p>
CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product
names are trademarks, registered trademarks or service marks of their respective
holders.
</p>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/LICENSE.html | HTML | gpl3 | 71,136 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Installation Guide - CKEditor</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
h3
{
border-bottom: 1px solid #AAAAAA;
}
pre
{
background-color: #F9F9F9;
border: 1px dashed #2F6FAB;
padding: 1em;
line-height: 1.1em;
}
#footer hr
{
margin: 10px 0 15px 0;
height: 1px;
border: solid 1px gray;
border-bottom: none;
}
#footer p
{
margin: 0 10px 10px 10px;
float: left;
}
#footer #copy
{
float: right;
}
</style>
</head>
<body>
<h1>
CKEditor Installation Guide</h1>
<h3>
What's CKEditor?</h3>
<p>
CKEditor is a text editor to be used inside web pages. It's not a replacement
for desktop text editors like Word or OpenOffice, but a component to be used as
part of web applications and web sites.</p>
<h3>
Installation</h3>
<p>
Installing CKEditor is an easy task. Just follow these simple steps:</p>
<ol>
<li><strong>Download</strong> the latest version of the editor from our web site: <a
href="http://ckeditor.com">http://ckeditor.com</a>. You should have already completed
this step, but be sure you have the very latest version.</li>
<li><strong>Extract</strong> (decompress) the downloaded file into the root of your
web site.</li>
</ol>
<p>
<strong>Note:</strong> CKEditor is by default installed in the "ckeditor"
folder. You can place the files in whichever you want though.</p>
<h3>
Checking Your Installation
</h3>
<p>
The editor comes with a few sample pages that can be used to verify that installation
proceeded properly. Take a look at the <a href="_samples">_samples</a> directory.</p>
<p>
To test your installation, just call the following page at your web site:</p>
<pre>
http://<your site>/<CKEditor installation path>/_samples/index.html
For example:
http://www.example.com/ckeditor/_samples/index.html</pre>
<h3>
Documentation</h3>
<p>
The full editor documentation is available online at the following address:<br />
<a href="http://docs.cksource.com/ckeditor">http://docs.cksource.com/ckeditor</a></p>
<div id="footer">
<hr />
<p>
CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003-2011, <a href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/INSTALL.html | HTML | gpl3 | 2,859 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function (config) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.font_names = '宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;' + config.font_names;
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/config.js | JavaScript | gpl3 | 511 |
<%
'
' Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
' For licensing, see LICENSE.html or http://ckeditor.com/license
' Shared variable for all instances ("static")
dim CKEDITOR_initComplete
dim CKEDITOR_returnedEvents
''
' \brief CKEditor class that can be used to create editor
' instances in ASP pages on server side.
' @see http://ckeditor.com
'
' Sample usage:
' @code
' editor = new CKEditor
' editor.editor "editor1", "<p>Initial value.</p>", empty, empty
' @endcode
Class CKEditor
''
' The version of %CKEditor.
private version
''
' A constant string unique for each release of %CKEditor.
private mTimeStamp
''
' URL to the %CKEditor installation directory (absolute or relative to document root).
' If not set, CKEditor will try to guess it's path.
'
' Example usage:
' @code
' editor.basePath = "/ckeditor/"
' @endcode
Public basePath
''
' A boolean variable indicating whether CKEditor has been initialized.
' Set it to true only if you have already included
' <script> tag loading ckeditor.js in your website.
Public initialized
''
' Boolean variable indicating whether created code should be printed out or returned by a function.
'
' Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function.
' @code
' editor = new CKEditor
' editor.returnOutput = true
' code = editor.editor("editor1", "<p>Initial value.</p>", empty, empty)
' response.write "<p>Editor 1:</p>"
' response.write code
' @endcode
Public returnOutput
''
' A Dictionary with textarea attributes.
'
' When %CKEditor is created with the editor() method, a HTML <textarea> element is created,
' it will be displayed to anyone with JavaScript disabled or with incompatible browser.
public textareaAttributes
''
' A string indicating the creation date of %CKEditor.
' Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
public timestamp
''
' A dictionary that holds the instance configuration.
private oInstanceConfig
''
' A dictionary that holds the configuration for all the instances.
private oAllInstancesConfig
''
' A dictionary that holds event listeners for the instance.
private oInstanceEvents
''
' A dictionary that holds event listeners for all the instances.
private oAllInstancesEvents
''
' A Dictionary that holds global event listeners (CKEDITOR object)
private oGlobalEvents
Private Sub Class_Initialize()
version = "3.5.2"
timeStamp = "B1GG4Z6"
mTimeStamp = "B1GG4Z6"
Set oInstanceConfig = CreateObject("Scripting.Dictionary")
Set oAllInstancesConfig = CreateObject("Scripting.Dictionary")
Set oInstanceEvents = CreateObject("Scripting.Dictionary")
Set oAllInstancesEvents = CreateObject("Scripting.Dictionary")
Set oGlobalEvents = CreateObject("Scripting.Dictionary")
Set textareaAttributes = CreateObject("Scripting.Dictionary")
textareaAttributes.Add "rows", 8
textareaAttributes.Add "cols", 60
End Sub
''
' Creates a %CKEditor instance.
' In incompatible browsers %CKEditor will downgrade to plain HTML <textarea> element.
'
' @param name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element).
' @param value (string) Initial value.
'
' Example usage:
' @code
' set editor = New CKEditor
' editor.editor "field1", "<p>Initial value.</p>"
' @endcode
'
' Advanced example:
' @code
' set editor = new CKEditor
' set config = CreateObject("Scripting.Dictionary")
' config.Add "toolbar", Array( _
' Array( "Source", "-", "Bold", "Italic", "Underline", "Strike" ), _
' Array( "Image", "Link", "Unlink", "Anchor" ) _
' )
' set events = CreateObject("Scripting.Dictionary")
' events.Add "instanceReady", "function (evt) { alert('Loaded second editor: ' + evt.editor.name );}"
' editor.editor "field1", "<p>Initial value.</p>", config, events
' @endcode
'
public function editor(name, value)
dim attr, out, js, customConfig, extraConfig
dim attribute
attr = ""
for each attribute in textareaAttributes
attr = attr & " " & attribute & "=""" & replace( textareaAttributes( attribute ), """", """ ) & """"
next
out = "<textarea name=""" & name & """" & attr & ">" & Server.HtmlEncode(value) & "</textarea>" & vbcrlf
if not(initialized) then
out = out & init()
end if
set customConfig = configSettings()
js = returnGlobalEvents()
extraConfig = (new JSON)( empty, customConfig, false )
if extraConfig<>"" then extraConfig = ", " & extraConfig
js = js & "CKEDITOR.replace('" & name & "'" & extraConfig & ");"
out = out & script(js)
if not(returnOutput) then
response.write out
out = ""
end if
editor = out
oInstanceConfig.RemoveAll
oInstanceEvents.RemoveAll
end function
''
' Replaces a <textarea> with a %CKEditor instance.
'
' @param id (string) The id or name of textarea element.
'
' Example 1: adding %CKEditor to <textarea name="article"></textarea> element:
' @code
' set editor = New CKEditor
' editor.replace "article"
' @endcode
'
public function replaceInstance(id)
dim out, js, customConfig, extraConfig
out = ""
if not(initialized) then
out = out & init()
end if
set customConfig = configSettings()
js = returnGlobalEvents()
extraConfig = (new JSON)( empty, customConfig, false )
if extraConfig<>"" then extraConfig = ", " & extraConfig
js = js & "CKEDITOR.replace('" & id & "'" & extraConfig & ");"
out = out & script(js)
if not(returnOutput) then
response.write out
out = ""
end if
replaceInstance = out
oInstanceConfig.RemoveAll
oInstanceEvents.RemoveAll
end function
''
' Replace all <textarea> elements available in the document with editor instances.
'
' @param className (string) If set, replace all textareas with class className in the page.
'
' Example 1: replace all <textarea> elements in the page.
' @code
' editor = new CKEditor
' editor.replaceAll empty
' @endcode
'
' Example 2: replace all <textarea class="myClassName"> elements in the page.
' @code
' editor = new CKEditor
' editor.replaceAll 'myClassName'
' @endcode
'
function replaceAll(className)
dim out, js, customConfig
out = ""
if not(initialized) then
out = out & init()
end if
set customConfig = configSettings()
js = returnGlobalEvents()
if (customConfig.Count=0) then
if (isEmpty(className)) then
js = js & "CKEDITOR.replaceAll();"
else
js = js & "CKEDITOR.replaceAll('" & className & "');"
end if
else
js = js & "CKEDITOR.replaceAll( function(textarea, config) {\n"
if not(isEmpty(className)) then
js = js & " var classRegex = new RegExp('(?:^| )' + '" & className & "' + '(?:$| )');\n"
js = js & " if (!classRegex.test(textarea.className))\n"
js = js & " return false;\n"
end if
js = js & " CKEDITOR.tools.extend(config, " & (new JSON)( empty, customConfig, false ) & ", true);"
js = js & "} );"
end if
out = out & script(js)
if not(returnOutput) then
response.write out
out = ""
end if
replaceAll = out
oInstanceConfig.RemoveAll
oInstanceEvents.RemoveAll
end function
''
' A Dictionary that holds the %CKEditor configuration for all instances
' For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
'
' Example usage:
' @code
' editor.config("height") = 400
' // Use @@ at the beggining of a string to ouput it without surrounding quotes.
' editor.config("width") = "@@screen.width * 0.8"
' @endcode
Public Property Let Config( configKey, configValue )
oAllInstancesConfig.Add configKey, configValue
End Property
''
' Configuration options for the next instance
'
Public Property Let instanceConfig( configKey, configValue )
oInstanceConfig.Add configKey, configValue
End Property
''
' Adds event listener.
' Events are fired by %CKEditor in various situations.
'
' @param eventName (string) Event name.
' @param javascriptCode (string) Javascript anonymous function or function name.
'
' Example usage:
' @code
' editor.addEventHandler "instanceReady", "function (ev) { " & _
' " alert('Loaded: ' + ev.editor.name); " & _
' "}"
' @endcode
'
public sub addEventHandler(eventName, javascriptCode)
if not(oAllInstancesEvents.Exists( eventName ) ) then
oAllInstancesEvents.Add eventName, Array()
end if
dim listeners, size
listeners = oAllInstancesEvents( eventName )
size = ubound(listeners) + 1
redim preserve listeners(size)
listeners(size) = javascriptCode
oAllInstancesEvents( eventName ) = listeners
' '' Avoid duplicates. fixme...
' if (!in_array($javascriptCode, $this->_events[$event])) {
' $this->_events[$event][] = $javascriptCode;
' }
end sub
''
' Clear registered event handlers.
' Note: this function will have no effect on already created editor instances.
'
' @param eventName (string) Event name, if set to 'empty' all event handlers will be removed.
'
public sub clearEventHandlers( eventName )
if not(isEmpty( eventName )) then
oAllInstancesEvents.Remove eventName
else
oAllInstancesEvents.RemoveAll
end if
end sub
''
' Adds event listener only for the next instance.
' Events are fired by %CKEditor in various situations.
'
' @param eventName (string) Event name.
' @param javascriptCode (string) Javascript anonymous function or function name.
'
' Example usage:
' @code
' editor.addInstanceEventHandler "instanceReady", "function (ev) { " & _
' " alert('Loaded: ' + ev.editor.name); " & _
' "}"
' @endcode
'
public sub addInstanceEventHandler(eventName, javascriptCode)
if not(oInstanceEvents.Exists( eventName ) ) then
oInstanceEvents.Add eventName, Array()
end if
dim listeners, size
listeners = oInstanceEvents( eventName )
size = ubound(listeners) + 1
redim preserve listeners(size)
listeners(size) = javascriptCode
oInstanceEvents( eventName ) = listeners
' '' Avoid duplicates. fixme...
' if (!in_array($javascriptCode, $this->_events[$event])) {
' $this->_events[$event][] = $javascriptCode;
' }
end sub
''
' Clear registered event handlers.
' Note: this function will have no effect on already created editor instances.
'
' @param eventName (string) Event name, if set to 'empty' all event handlers will be removed.
'
public sub clearInstanceEventHandlers( eventName )
if not(isEmpty( eventName )) then
oInstanceEvents.Remove eventName
else
oInstanceEvents.RemoveAll
end if
end sub
''
' Adds global event listener.
'
' @param event (string) Event name.
' @param javascriptCode (string) Javascript anonymous function or function name.
'
' Example usage:
' @code
' editor.addGlobalEventHandler "dialogDefinition", "function (ev) { " & _
' " alert('Loading dialog: ' + ev.data.name); " & _
' "}"
' @endcode
'
public sub addGlobalEventHandler( eventName, javascriptCode)
if not(oGlobalEvents.Exists( eventName ) ) then
oGlobalEvents.Add eventName, Array()
end if
dim listeners, size
listeners = oGlobalEvents( eventName )
size = ubound(listeners) + 1
redim preserve listeners(size)
listeners(size) = javascriptCode
oGlobalEvents( eventName ) = listeners
' // Avoid duplicates.
' if (!in_array($javascriptCode, $this->_globalEvents[$event])) {
' $this->_globalEvents[$event][] = $javascriptCode;
' }
end sub
''
' Clear registered global event handlers.
' Note: this function will have no effect if the event handler has been already printed/returned.
'
' @param eventName (string) Event name, if set to 'empty' all event handlers will be removed .
'
public sub clearGlobalEventHandlers( eventName )
if not(isEmpty( eventName )) then
oGlobalEvents.Remove eventName
else
oGlobalEvents.RemoveAll
end if
end sub
''
' Prints javascript code.
'
' @param string js
'
private function script(js)
script = "<script type=""text/javascript"">" & _
"//<![CDATA[" & vbcrlf & _
js & vbcrlf & _
"//]]>" & _
"</script>" & vbcrlf
end function
''
' Returns the configuration array (global and instance specific settings are merged into one array).
'
' @param instanceConfig (Dictionary) The specific configurations to apply to editor instance.
' @param instanceEvents (Dictionary) Event listeners for editor instance.
'
private function configSettings()
dim mergedConfig, mergedEvents
set mergedConfig = cloneDictionary(oAllInstancesConfig)
set mergedEvents = cloneDictionary(oAllInstancesEvents)
if not(isEmpty(oInstanceConfig)) then
set mergedConfig = mergeDictionary(mergedConfig, oInstanceConfig)
end if
if not(isEmpty(oInstanceEvents)) then
for each eventName in oInstanceEvents
code = oInstanceEvents( eventName )
if not(mergedEvents.Exists( eventName)) then
mergedEvents.Add eventName, code
else
dim listeners, size
listeners = mergedEvents( eventName )
size = ubound(listeners)
if isArray( code ) then
addedCount = ubound(code)
redim preserve listeners( size + addedCount + 1 )
for i = 0 to addedCount
listeners(size + i + 1) = code (i)
next
else
size = size + 1
redim preserve listeners(size)
listeners(size) = code
end if
mergedEvents( eventName ) = listeners
end if
next
end if
dim i, eventName, handlers, configON, ub, code
if mergedEvents.Count>0 then
if mergedConfig.Exists( "on" ) then
set configON = mergedConfig.items( "on" )
else
set configON = CreateObject("Scripting.Dictionary")
mergedConfig.Add "on", configOn
end if
for each eventName in mergedEvents
handlers = mergedEvents( eventName )
code = ""
if isArray(handlers) then
uB = ubound(handlers)
if (uB = 0) then
code = handlers(0)
else
code = "function (ev) {"
for i=0 to uB
code = code & "(" & handlers(i) & ")(ev);"
next
code = code & "}"
end if
else
code = handlers
end if
' Using @@ at the beggining to signal JSON that we don't want this quoted.
configON.Add eventName, "@@" & code
next
' set mergedConfig.Item("on") = configOn
end if
set configSettings = mergedConfig
end function
''
' Returns a copy of a scripting.dictionary object
'
private function cloneDictionary( base )
dim newOne, tmpKey
Set newOne = CreateObject("Scripting.Dictionary")
for each tmpKey in base
newOne.Add tmpKey , base( tmpKey )
next
set cloneDictionary = newOne
end function
''
' Combines two scripting.dictionary objects
' The base object isn't modified, and extra gets all the properties in base
'
private function mergeDictionary(base, extra)
dim newOne, tmpKey
for each tmpKey in base
if not(extra.Exists( tmpKey )) then
extra.Add tmpKey, base( tmpKey )
end if
next
set mergeDictionary = extra
end function
''
' Return global event handlers.
'
private function returnGlobalEvents()
dim out, eventName, handlers
dim handlersForEvent, handler, code, i
out = ""
if (isempty(CKEDITOR_returnedEvents)) then
set CKEDITOR_returnedEvents = CreateObject("Scripting.Dictionary")
end if
for each eventName in oGlobalEvents
handlers = oGlobalEvents( eventName )
if not(CKEDITOR_returnedEvents.Exists(eventName)) then
CKEDITOR_returnedEvents.Add eventName, CreateObject("Scripting.Dictionary")
end if
set handlersForEvent = CKEDITOR_returnedEvents.Item( eventName )
' handlersForEvent is another dictionary
' and handlers is an array
for i = 0 to ubound(handlers)
code = handlers( i )
' Return only new events
if not(handlersForEvent.Exists( code )) then
if (out <> "") then out = out & vbcrlf
out = out & "CKEDITOR.on('" & eventName & "', " & code & ");"
handlersForEvent.Add code, code
end if
next
next
returnGlobalEvents = out
end function
''
' Initializes CKEditor (executed only once).
'
private function init()
dim out, args, path, extraCode, file
out = ""
if (CKEDITOR_initComplete) then
init = ""
exit function
end if
if (initialized) then
CKEDITOR_initComplete = true
init = ""
exit function
end if
args = ""
path = ckeditorPath()
if (timestamp <> "") and (timestamp <> "%" & "TIMESTAMP%") then
args = "?t=" & timestamp
end if
' Skip relative paths...
if (instr(path, "..") <> 0) then
out = out & script("window.CKEDITOR_BASEPATH='" & path & "';")
end if
out = out & "<scr" & "ipt type=""text/javascript"" src=""" & path & ckeditorFileName() & args & """></scr" & "ipt>" & vbcrlf
extraCode = ""
if (timestamp <> mTimeStamp) then
extraCode = extraCode & "CKEDITOR.timestamp = '" & timestamp & "';"
end if
if (extraCode <> "") then
out = out & script(extraCode)
end if
CKEDITOR_initComplete = true
initialized = true
init = out
end function
private function ckeditorFileName()
ckeditorFileName = "ckeditor.js"
end function
''
' Return path to ckeditor.js.
'
private function ckeditorPath()
if (basePath <> "") then
ckeditorPath = basePath
else
' In classic ASP we can't get the location of this included script
ckeditorPath = "/ckeditor/"
end if
' Try to check if that folder contains the CKEditor files:
' If it's a full URL avoid checking it as it might point to an external server.
if (instr(ckeditorPath, "://") <> 0) then exit function
dim filename, oFSO, exists
filename = server.mapPath(basePath & ckeditorFileName())
set oFSO = Server.CreateObject("Scripting.FileSystemObject")
exists = oFSO.FileExists(filename)
set oFSO = nothing
if not(exists) then
response.clear
response.write "<h1>CKEditor path validation failed</h1>"
response.write "<p>The path "" & ckeditorPath & "" doesn't include the CKEditor main file (" & ckeditorFileName() & ")</p>"
response.write "<p>Please, verify that you have set it correctly and/or adjust the 'basePath' property</p>"
response.write "<p>Checked for physical file: "" & filename & ""</p>"
response.end
end if
end function
End Class
' URL: http://www.webdevbros.net/2007/04/26/generate-json-from-asp-datatypes/
'**************************************************************************************************************
'' @CLASSTITLE: JSON
'' @CREATOR: Michal Gabrukiewicz (gabru at grafix.at), Michael Rebec
'' @CONTRIBUTORS: - Cliff Pruitt (opensource at crayoncowboy.com)
'' - Sylvain Lafontaine
'' - Jef Housein
'' - Jeremy Brown
'' @CREATEDON: 2007-04-26 12:46
'' @CDESCRIPTION: Comes up with functionality for JSON (http://json.org) to use within ASP.
'' Correct escaping of characters, generating JSON Grammer out of ASP datatypes and structures
'' Some examples (all use the <em>toJSON()</em> method but as it is the class' default method it can be left out):
'' <code>
'' <%
'' 'simple number
'' output = (new JSON)("myNum", 2, false)
'' 'generates {"myNum": 2}
''
'' 'array with different datatypes
'' output = (new JSON)("anArray", array(2, "x", null), true)
'' 'generates "anArray": [2, "x", null]
'' '(note: the last parameter was true, thus no surrounding brackets in the result)
'' % >
'' </code>
'' @REQUIRES: -
'' @OPTIONEXPLICIT: yes
'' @VERSION: 1.5.1
'**************************************************************************************************************
class JSON
'private members
private output, innerCall
'**********************************************************************************************************
'* constructor
'**********************************************************************************************************
public sub class_initialize()
newGeneration()
end sub
'******************************************************************************************
'' @SDESCRIPTION: STATIC! takes a given string and makes it JSON valid
'' @DESCRIPTION: all characters which needs to be escaped are beeing replaced by their
'' unicode representation according to the
'' RFC4627#2.5 - http://www.ietf.org/rfc/rfc4627.txt?number=4627
'' @PARAM: val [string]: value which should be escaped
'' @RETURN: [string] JSON valid string
'******************************************************************************************
public function escape(val)
dim cDoubleQuote, cRevSolidus, cSolidus
cDoubleQuote = &h22
cRevSolidus = &h5C
cSolidus = &h2F
dim i, currentDigit
for i = 1 to (len(val))
currentDigit = mid(val, i, 1)
if ascw(currentDigit) > &h00 and ascw(currentDigit) < &h1F then
currentDigit = escapequence(currentDigit)
elseif ascw(currentDigit) >= &hC280 and ascw(currentDigit) <= &hC2BF then
currentDigit = "\u00" + right(padLeft(hex(ascw(currentDigit) - &hC200), 2, 0), 2)
elseif ascw(currentDigit) >= &hC380 and ascw(currentDigit) <= &hC3BF then
currentDigit = "\u00" + right(padLeft(hex(ascw(currentDigit) - &hC2C0), 2, 0), 2)
else
select case ascw(currentDigit)
case cDoubleQuote: currentDigit = escapequence(currentDigit)
case cRevSolidus: currentDigit = escapequence(currentDigit)
case cSolidus: currentDigit = escapequence(currentDigit)
end select
end if
escape = escape & currentDigit
next
end function
'******************************************************************************************************************
'' @SDESCRIPTION: generates a representation of a name value pair in JSON grammer
'' @DESCRIPTION: It generates a name value pair which is represented as <em>{"name": value}</em> in JSON.
'' the generation is fully recursive. Thus the value can also be a complex datatype (array in dictionary, etc.) e.g.
'' <code>
'' <%
'' set j = new JSON
'' j.toJSON "n", array(RS, dict, false), false
'' j.toJSON "n", array(array(), 2, true), false
'' % >
'' </code>
'' @PARAM: name [string]: name of the value (accessible with javascript afterwards). leave empty to get just the value
'' @PARAM: val [variant], [int], [float], [array], [object], [dictionary]: value which needs
'' to be generated. Conversation of the data types is as follows:<br>
'' - <strong>ASP datatype -> JavaScript datatype</strong>
'' - NOTHING, NULL -> null
'' - INT, DOUBLE -> number
'' - STRING -> string
'' - BOOLEAN -> bool
'' - ARRAY -> array
'' - DICTIONARY -> Represents it as name value pairs. Each key is accessible as property afterwards. json will look like <code>"name": {"key1": "some value", "key2": "other value"}</code>
'' - <em>multidimensional array</em> -> Generates a 1-dimensional array (flat) with all values of the multidimensional array
'' - <em>request</em> object -> every property and collection (cookies, form, querystring, etc) of the asp request object is exposed as an item of a dictionary. Property names are <strong>lowercase</strong>. e.g. <em>servervariables</em>.
'' - OBJECT -> name of the type (if unknown type) or all its properties (if class implements <em>reflect()</em> method)
'' Implement a <strong>reflect()</strong> function if you want your custom classes to be recognized. The function must return
'' a dictionary where the key holds the property name and the value its value. Example of a reflect function within a User class which has firstname and lastname properties
'' <code>
'' <%
'' function reflect()
'' . set reflect = server.createObject("scripting.dictionary")
'' . reflect.add "firstname", firstname
'' . reflect.add "lastname", lastname
'' end function
'' % >
'' </code>
'' Example of how to generate a JSON representation of the asp request object and access the <em>HTTP_HOST</em> server variable in JavaScript:
'' <code>
'' <script>alert(<%= (new JSON)(empty, request, false) % >.servervariables.HTTP_HOST);</script>
'' </code>
'' @PARAM: nested [bool]: indicates if the name value pair is already nested within another? if yes then the <em>{}</em> are left out.
'' @RETURN: [string] returns a JSON representation of the given name value pair
'******************************************************************************************************************
public default function toJSON(name, val, nested)
if not nested and not isEmpty(name) then write("{")
if not isEmpty(name) then write("""" & escape(name) & """: ")
generateValue(val)
if not nested and not isEmpty(name) then write("}")
toJSON = output
if innerCall = 0 then newGeneration()
end function
'******************************************************************************************************************
'* generate
'******************************************************************************************************************
private function generateValue(val)
if isNull(val) then
write("null")
elseif isArray(val) then
generateArray(val)
elseif isObject(val) then
dim tName : tName = typename(val)
if val is nothing then
write("null")
elseif tName = "Dictionary" or tName = "IRequestDictionary" then
generateDictionary(val)
elseif tName = "IRequest" then
set req = server.createObject("scripting.dictionary")
req.add "clientcertificate", val.ClientCertificate
req.add "cookies", val.cookies
req.add "form", val.form
req.add "querystring", val.queryString
req.add "servervariables", val.serverVariables
req.add "totalbytes", val.totalBytes
generateDictionary(req)
elseif tName = "IStringList" then
if val.count = 1 then
toJSON empty, val(1), true
else
generateArray(val)
end if
else
generateObject(val)
end if
else
'bool
dim varTyp
varTyp = varType(val)
if varTyp = 11 then
if val then write("true") else write("false")
'int, long, byte
elseif varTyp = 2 or varTyp = 3 or varTyp = 17 or varTyp = 19 then
write(cLng(val))
'single, double, currency
elseif varTyp = 4 or varTyp = 5 or varTyp = 6 or varTyp = 14 then
write(replace(cDbl(val), ",", "."))
else
' Using @@ at the beggining to signal JSON that we don't want this quoted.
if left(val, 2) = "@@" then
write( mid( val, 3 ) )
else
write("""" & escape(val & "") & """")
end if
end if
end if
generateValue = output
end function
'******************************************************************************************************************
'* generateArray
'******************************************************************************************************************
private sub generateArray(val)
dim item, i
write("[")
i = 0
'the for each allows us to support also multi dimensional arrays
for each item in val
if i > 0 then write(",")
generateValue(item)
i = i + 1
next
write("]")
end sub
'******************************************************************************************************************
'* generateDictionary
'******************************************************************************************************************
private sub generateDictionary(val)
innerCall = innerCall + 1
if val.count = 0 then
toJSON empty, null, true
exit sub
end if
dim key, i
write("{")
i = 0
for each key in val
if i > 0 then write(",")
toJSON key, val(key), true
i = i + 1
next
write("}")
innerCall = innerCall - 1
end sub
'******************************************************************************************************************
'* generateObject
'******************************************************************************************************************
private sub generateObject(val)
dim props
on error resume next
set props = val.reflect()
if err = 0 then
on error goto 0
innerCall = innerCall + 1
toJSON empty, props, true
innerCall = innerCall - 1
else
on error goto 0
write("""" & escape(typename(val)) & """")
end if
end sub
'******************************************************************************************************************
'* newGeneration
'******************************************************************************************************************
private sub newGeneration()
output = empty
innerCall = 0
end sub
'******************************************************************************************
'* JsonEscapeSquence
'******************************************************************************************
private function escapequence(digit)
escapequence = "\u00" + right(padLeft(hex(ascw(digit)), 2, 0), 2)
end function
'******************************************************************************************
'* padLeft
'******************************************************************************************
private function padLeft(value, totalLength, paddingChar)
padLeft = right(clone(paddingChar, totalLength) & value, totalLength)
end function
'******************************************************************************************
'* clone
'******************************************************************************************
private function clone(byVal str, n)
dim i
for i = 1 to n : clone = clone & str : next
end function
'******************************************************************************************
'* write
'******************************************************************************************
private sub write(val)
output = output & val
end sub
end class
%>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/ckeditor.asp | Classic ASP | gpl3 | 30,817 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('placeholder','en',{placeholder:{title:'Placeholder Properties',toolbar:'Create Placeholder',text:'Placeholder Text',edit:'Edit Placeholder',textMissing:'The placeholder must contain text.'}});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/plugins/placeholder/lang/en.js | JavaScript | gpl3 | 374 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('uicolor','en',{uicolor:{title:'UI Color Picker',preview:'Live preview',config:'Paste this string into your config.js file',predefined:'Predefined color sets'}});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/plugins/uicolor/lang/en.js | JavaScript | gpl3 | 343 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('uicolor','he',{uicolor:{title:'בחירת צבע ממשק משתמש',preview:'תצוגה מקדימה',config:'הדבק את הטקסט הבא לתוך הקובץ config.js',predefined:'קבוצות צבעים מוגדרות מראש'}});
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/plugins/uicolor/lang/he.js | JavaScript | gpl3 | 421 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/plugins/dialog/dialogDefinition.js | JavaScript | gpl3 | 152 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!--
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function doLoadScript( url )
{
if ( !url )
return false ;
var s = document.createElement( "script" ) ;
s.type = "text/javascript" ;
s.src = url ;
document.getElementsByTagName( "head" )[ 0 ].appendChild( s ) ;
return true ;
}
var opener;
function tryLoad()
{
opener = window.parent;
// get access to global parameters
var oParams = window.opener.oldFramesetPageParams;
// make frameset rows string prepare
var sFramesetRows = ( parseInt( oParams.firstframeh, 10 ) || '30') + ",*," + ( parseInt( oParams.thirdframeh, 10 ) || '150' ) + ',0' ;
document.getElementById( 'itFrameset' ).rows = sFramesetRows ;
// dynamic including init frames and crossdomain transport code
// from config sproxy_js_frameset url
var addScriptUrl = oParams.sproxy_js_frameset ;
doLoadScript( addScriptUrl ) ;
}
</script>
</head>
<frameset id="itFrameset" onload="tryLoad();" border="0" rows="30,*,*,0">
<frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="2" src="" name="navbar"></frame>
<frame scrolling="auto" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="0" src="" name="mid"></frame>
<frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="bot"></frame>
<frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="spellsuggestall"></frame>
</frameset>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/plugins/wsc/dialogs/tmpFrameset.html | HTML | gpl3 | 1,935 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function gup( name )
{
name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ;
var regexS = '[\\?&]' + name + '=([^&#]*)' ;
var regex = new RegExp( regexS ) ;
var results = regex.exec( window.location.href ) ;
if ( results )
return results[ 1 ] ;
else
return '' ;
}
var interval;
function sendData2Master()
{
var destination = window.parent.parent ;
try
{
if ( destination.XDTMaster )
{
var t = destination.XDTMaster.read( [ gup( 'cmd' ), gup( 'data' ) ] ) ;
window.clearInterval( interval ) ;
}
}
catch (e) {}
}
function onLoad()
{
interval = window.setInterval( sendData2Master, 100 );
}
</script>
</head>
<body onload="onLoad()"><p></p></body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/plugins/wsc/dialogs/ciframe.html | HTML | gpl3 | 1,120 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Changelog — CKEditor</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
#footer hr
{
margin: 10px 0 15px 0;
height: 1px;
border: solid 1px gray;
border-bottom: none;
}
#footer p
{
margin: 0 10px 10px 10px;
float: left;
}
#footer #copy
{
float: right;
}
</style>
</head>
<body>
<h1>
CKEditor Changelog
</h1>
<h3>
CKEditor 3.5.2</h3>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/7168">#7168</a> : [IE9] Destroying an editor instance throws an error.</li>
<li><a href="http://dev.ckeditor.com/ticket/7169">#7169</a> : [IE9] Menu item has incorrect height.</li>
<li><a href="http://dev.ckeditor.com/ticket/7178">#7178</a> : [IE9] Read-only attributes do not work in IE9.</li>
<li><a href="http://dev.ckeditor.com/ticket/7181">#7181</a> : [IE9] Toolbar items are not aligned in v2 and Office2003 skins.</li>
<li><a href="http://dev.ckeditor.com/ticket/7174">#7174</a> : [IE9] Elements path does not load correctly when the editor is switched back from Source to WYSIWYG.</li>
</ul>
<h3>
CKEditor 3.5.1</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/6107">#6107</a> : It is now possible to remove block styles using Styles and Paragraph Format drop-down lists.</li>
<li><a href="http://dev.ckeditor.com/ticket/5590">#5590</a> : Remove Format command works in collapsed selections.</li>
<li><a href="http://dev.ckeditor.com/ticket/5755">#5755</a> : The <code><a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.dialog_buttonsOrder">dialog_buttonsOrder</a></code> option now works in Internet Explorer.</li>
<li><a href="http://dev.ckeditor.com/ticket/6869">#6869</a> : The <code>data-cke-nostyle</code> attribute (which was introduced for escaping the element from been influenced by the style system since 3.5) is deprecated in favor of the new <code>data-nostyle</code> attribute.</li>
<li>Revised sample pages with code examples and clarifications.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5855">#5855</a> : Updating a link multiple times generates wrong <code>href</code> attribute.</li>
<li><a href="http://dev.ckeditor.com/ticket/6166">#6166</a> : Error on Maximize command, when the toolbar button is not shown.</li>
<li><a href="http://dev.ckeditor.com/ticket/6607">#6607</a> : Table cell "merge down" and "merge right" commands work only once.</li>
<li><a href="http://dev.ckeditor.com/ticket/6228">#6228</a> : Merge down does not work, throwing a JavasSript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/6625">#6625</a> : BIDI: Mixed LTR/RTL direction causes incorrect behavior.</li>
<li><a href="http://dev.ckeditor.com/ticket/6881">#6881</a> : IFrame capitalization is now consistent throughout labels.</li>
<li><a href="http://dev.ckeditor.com/ticket/6686">#6686</a> : BIDI: [FF] When we apply explicit language direction to a numbered/bulleted list, the corresponding language direction toolbar icon is not highlighted.</li>
<li><a href="http://dev.ckeditor.com/ticket/6566">#6566</a> : It is now possible to exit a blockquote using <code>ENTER_BR</code>.</li>
<li><a href="http://dev.ckeditor.com/ticket/6868">#6868</a> : Partial (invalid) list structure crashes the editor on load.</li>
<li><a href="http://dev.ckeditor.com/ticket/6804">#6804</a> : Buggy behavior when editing the <code>legend</code> element inside a <code>fieldset</code>.</li>
<li><a href="http://dev.ckeditor.com/ticket/6724">#6724</a> : [IE7] Nested list display bug on empty list item.</li>
<li><a href="http://dev.ckeditor.com/ticket/6715">#6715</a> : List items do not create paragraphs after the list placed in a table cell is removed.</li>
<li><a href="http://dev.ckeditor.com/ticket/6695">#6695</a> : [Webkit] Display bug after the editor is restored from the full screen mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/6661">#6661</a> : [IE] Pre-formatted style does not preserve applied text direction.</li>
<li><a href="http://dev.ckeditor.com/ticket/6655">#6655</a> : Using the editor resize grip causes small visual offsets.</li>
<li><a href="http://dev.ckeditor.com/ticket/6604">#6604</a> : The <code>div</code> element should be used as a formatting block in <code>ENTER_BR</code>.</li>
<li><a href="http://dev.ckeditor.com/ticket/6249">#6249</a> : BIDI: List item bullets are off viewport with RTL text direction.</li>
<li><a href="http://dev.ckeditor.com/ticket/6610">#6610</a> : BIDI: <code>ENTER_BR</code> change direction in one line out of multiple.</li>
<li><a href="http://dev.ckeditor.com/ticket/6872">#6872</a> : [IE] Link target field is not populated properly when no target is set.</li>
<li><a href="http://dev.ckeditor.com/ticket/6880">#6880</a> : Samples: Added a user-friendly message for users on servers without PHP support.</li>
<li><a href="http://dev.ckeditor.com/ticket/6628">#6628</a> : Setting <code><a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enterMode">config.enterMode</a></code> from PHP fails.</li>
<li><a href="http://dev.ckeditor.com/ticket/6278">#6278</a> : Comments were moved above the <code>br</code> tags.</li>
<li><a href="http://dev.ckeditor.com/ticket/6687">#6687</a> : Empty tag should be removed in inline-style format.</li>
<li><a href="http://dev.ckeditor.com/ticket/6645">#6645</a> : Allow to configure whether " (double quotes) characters should be encoded in the contents.</li>
<li><a href="http://dev.ckeditor.com/ticket/6336">#6336</a> : IE: (double)clicking an <code>input type="submit"</code> button submitted the form.</li>
<li><a href="http://dev.ckeditor.com/ticket/6646">#6646</a> : Context menu was not working for text inputs present in the initial content.</li>
<li><a href="http://dev.ckeditor.com/ticket/6641">#6641</a> : Copying and pasting links inside the editor was not working.</li>
<li><a href="http://dev.ckeditor.com/ticket/4208">#4208</a> : The <code><a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.disableObjectResizing">disableObjectResizing</a></code> setting now works in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/6242">#6242</a> : [IE] Editing existing links with <code>href</code> of a relative path mangles containing text.</li>
<li><a href="http://dev.ckeditor.com/ticket/5930">#5930</a> : [IE] Style definitions are no longer lowercased.</li>
<li><a href="http://dev.ckeditor.com/ticket/5361">#5361</a> : Preview window's title should reflect the title tag in full page mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/5522">#5522</a> : [IE] In versions < 8 or compatibility mode, <code>type="text"</code> was missing in text fields.</li>
<li><a href="http://dev.ckeditor.com/ticket/6126">#6126</a> : [IE] Avoid problems if there are two buttons named "submit".</li>
<li><a href="http://dev.ckeditor.com/ticket/6791">#6791</a> : [IE7] Editor did not show up when the name of a replaced textarea matched the name of a <code>meta</code> tag in the page.</li>
<li><a href="http://dev.ckeditor.com/ticket/5684">#5684</a> : [FF] When <code><a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.forcePasteAsPlainText">forcePasteAsPlainText</a></code> is used, the cursor disappears after paste.</li>
<li><a href="http://dev.ckeditor.com/ticket/6390">#6390</a> : Prevent toolbar dialog window buttons from being clicked twice.</li>
<li><a href="http://dev.ckeditor.com/ticket/6684">#6684</a> : [Webkit] Toolbar buttons are not wrapping correctly when the editor is displayed inside a table.</li>
<li><a href="http://dev.ckeditor.com/ticket/6703">#6703</a> : [IE] editor <code>focus</code> event not fired in an instance, when a dialog window closes.</li>
<li><a href="http://dev.ckeditor.com/ticket/6873">#6873</a> : Difficult to drag the resize grip of the spell checker dialog window.</li>
<li><a href="http://dev.ckeditor.com/ticket/6896">#6896</a> : [Webkit] Unable to paste into source area when the editor is maximized.</li>
<li><a href="http://dev.ckeditor.com/ticket/6020">#6020</a> : The state of the Cut, Copy, and Paste toolbar now matches the state of the context menu buttons.</li>
<li><a href="http://dev.ckeditor.com/ticket/5256">#5256</a> : JavaScript error thrown when percent (%) sign is used in image URL.</li>
<li><a href="http://dev.ckeditor.com/ticket/6577">#6577</a> : [FF] Selection error when an element containing the editor instance is hidden.</li>
<li><a href="http://dev.ckeditor.com/ticket/5500">#5500</a> : [IE] <code>value</code> attribute of text input dialog window field was missing.</li>
<li><a href="http://dev.ckeditor.com/ticket/6665">#6665</a> : [IE] <code>name</code> field of Link dialog window was missing.</li>
<li><a href="http://dev.ckeditor.com/ticket/6639">#6639</a> : Line-breaks inside pasted list item from Microsoft Word break the list structure.</li>
<li><a href="http://dev.ckeditor.com/ticket/6909">#6909</a> : [IE] GIF icons of toolbar button from custom plugins are not diplayed in zoom level 100%.</li>
<li><a href="http://dev.ckeditor.com/ticket/6860">#6860</a> : [FF] Double-clicking the placeholder element in order to open a Placeholder dialog window throws a JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/6630">#6630</a> : Empty <code>pre</code> elements are output differently in various browsers.</li>
<li><a href="http://dev.ckeditor.com/ticket/6568">#6568</a> : Insert table row/column does not work with spanning.</li>
<li><a href="http://dev.ckeditor.com/ticket/6735">#6735</a> : Inaccurate read-only selection detection.</li>
<li><a href="http://dev.ckeditor.com/ticket/6728">#6728</a> : BIDI: Change direction does not work with list nested inside a blockquote.</li>
<li><a href="http://dev.ckeditor.com/ticket/6432">#6432</a> : Inserting a table in place of a fully selected list results in a JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/6438">#6438</a> : [IE] Performance enhancement when typing inside an element with many child nodes.</li>
<li><a href="http://dev.ckeditor.com/ticket/6970">#6970</a> : [IE] Dialog window shadows were presented inaccurately.</li>
<li><a href="http://dev.ckeditor.com/ticket/6672">#6672</a> : [IE] Unnecessary <code>br</code> element is no longer inserted after a form.</li>
<li><a href="http://dev.ckeditor.com/ticket/7087">#7087</a> : [FF] Sometimes it was not possible to move cursor out of link at the end of block.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/6981">#6981</a> : English (GB);</li>
<li><a href="http://dev.ckeditor.com/ticket/6991">#6991</a> : Finnish;</li>
<li><a href="http://dev.ckeditor.com/ticket/6357">#6357</a> : French;</li>
<li><a href="http://dev.ckeditor.com/ticket/7055">#7055</a> : Polish;</li>
<li><a href="http://dev.ckeditor.com/ticket/7068">#7068</a> : German;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.5</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4090">#4090</a> : Full Adobe AIR support.</li>
<li><a href="http://dev.ckeditor.com/ticket/5084">#5084</a> : Dialog windows are now resizable with a grip located in the footer.</li>
<li><a href="http://dev.ckeditor.com/ticket/5755">#5755</a> : Introduced the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.dialog_buttonsOrder">dialog_buttonsOrder</a> setting, making it possible to control the buttons order.</li>
<li><a href="http://dev.ckeditor.com/ticket/4648">#4648</a> : Added the new iFrame plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/6010">#6010</a> : The Automatic option of the font/background color panel now represents the real color.</li>
<li><a href="http://dev.ckeditor.com/ticket/5654">#5654</a> : New "placeholder" plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/6334">#6334</a> : CKEditor now uses <a href="http://www.w3.org/TR/2010/WD-html5-20101019/elements.html#embedding-custom-non-visible-data-with-the-data-attributes">HTML5's data-* attributes</a> for its internal attributes.</li>
<li><a href="http://dev.ckeditor.com/ticket/6103">#6103</a> : It's now possible to control the styling of inline read-only elements with the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.disableReadonlyStyling">disableReadonlyStyling</a> setting. It's also possible to avoid inline-styling any element by setting its "data-cke-nostyle" attribute to "1".</li>
<li><a href="http://dev.ckeditor.com/ticket/5404">#5404</a> : <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.fillEmptyBlocks">fillEmptyBlocks</a> configuration option of v2 is now available.</li>
<li><a href="http://dev.ckeditor.com/ticket/5367">#5367</a> : New <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertText">CKEDITOR.editor#insertText</a> method (check api.html sample page for usages) is now provided to insert plain text into editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/5367">#5915</a> : New <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.removeDialogTabs">removeDialogTabs</a> configuration option to hide certain dialog tabs.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4821">#4821</a> : Icons in the toolbar were distorted with IE and zoom != 100%.</li>
<li><a href="http://dev.ckeditor.com/ticket/5587">#5587</a> : Visual improvements in dialogs, reinforce field label on separate line.</li>
<li><a href="http://dev.ckeditor.com/ticket/4652">#4652</a> : Now it's able to disable editor context menu by simply removing the "contextmenu" plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/5599">#5599</a> : Labels of "specialchar" dialog are now translated.</li>
<li><a href="http://dev.ckeditor.com/ticket/6419">#6419</a> : [IE] List creation by merging problem.</li>
<li><a href="http://dev.ckeditor.com/ticket/6502">#6502</a> : Removed IE6 image preloading, which was used to defect the duplicate request of background images.</li>
<li><a href="http://dev.ckeditor.com/ticket/6822">#6822</a> : Added labels to fake objects.</li>
<li><a href="http://dev.ckeditor.com/ticket/6898">#6898</a> : [IE6] Toolbar icons becomes invisible in RTL.</li>
<li>Updated the following language files:<ul>
<li>Hebrew</li>
</ul></li>
</ul>
<h3>
CKEditor 3.4.3</h3>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/6554">#6554</a> : [Webkit] cannot type after inserting Page Break.</li>
<li><a href="http://dev.ckeditor.com/ticket/6569">#6569</a> : Indentation now complies with text direction of the only item.</li>
<li><a href="http://dev.ckeditor.com/ticket/6579">#6579</a> : The jQuery adapter was not working properly and was turned on in incompatible environments.</li>
<li><a href="http://dev.ckeditor.com/ticket/6644">#6644</a> : Restrict <code>onmousedown</code> handler to the toolbar area.</li>
<li><a href="http://dev.ckeditor.com/ticket/6656">#6656</a> : Panelbutton's buttons became active when clicking on Source.</li>
<li><a href="http://dev.ckeditor.com/ticket/6248">#6248</a> : Whitespaces (<code>nbsp</code> elements) were incorrectly added into empty table cells and list items.</li>
<li><a href="http://dev.ckeditor.com/ticket/6575">#6575</a> : Tabs disappearing in Link dialog window after a specific sequence of actions.</li>
<li><a href="http://dev.ckeditor.com/ticket/6510">#6510</a> : Margin mirroring does not respect style configuration.</li>
<li><a href="http://dev.ckeditor.com/ticket/6471">#6471</a> : BIDI: Pressing Decrease Indent in an RTL bulleted list causes incorrect behaviour.</li>
<li><a href="http://dev.ckeditor.com/ticket/6479">#6479</a> : BIDI: Language direction is not being preserved when pressing Enter after a Paragraph Format was applied.</li>
<li><a href="http://dev.ckeditor.com/ticket/6670">#6670</a> : BIDI: Indent & List icons are not reversed when we apply RTL direction to a paragraph with any of Paragraph Formatting options.</li>
<li><a href="http://dev.ckeditor.com/ticket/6640">#6640</a> : Floating panels are now being closed when switching modes.</li>
<li><a href="http://dev.ckeditor.com/ticket/4790">#4790</a> : Remove list with multiple items in <code>enterBr</code> doesnot preserve line breaks.</li>
<li><a href="http://dev.ckeditor.com/ticket/6297">#6297</a> : Floated inline elements are not taking part in behavior of blocks anymore.</li>
<li><a href="http://dev.ckeditor.com/ticket/6171">#6171</a> : [Firefox] Opening rich content drop-down list scrolls host page to the top when editor has a vertical scrollbar.</li>
<li><a href="http://dev.ckeditor.com/ticket/6330">#6330</a> : List markers from MS Word with Roman numbering are not preserved.</li>
<li><a href="http://dev.ckeditor.com/ticket/6720">#6720</a> : Attribute protection might detect wrong elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/6580">#6580</a> : [IE9] Flash dialog window does not get filled up.</li>
<li><a href="http://dev.ckeditor.com/ticket/6447">#6447</a> : Decreasing indentation of a list with <code>indentClasses</code> config does not work.</li>
<li><a href="http://dev.ckeditor.com/ticket/5894">#5894</a> : Adding custom buttons at the bottom of a dialog window does not cause it to expand to include its contents.</li>
<li><a href="http://dev.ckeditor.com/ticket/6513">#6513</a> : Wrong ARIA attributes created on list options of Styles drop-down list.</li>
<li><a href="http://dev.ckeditor.com/ticket/6150">#6150</a> : [Safari] Color dialog window was broken.</li>
<li><a href="http://dev.ckeditor.com/ticket/6747">#6747</a> : Full screen layout issue caused by page element focus outside editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/6779">#6779</a> : Clicking the <code>body</code> element on elements path turns the selection on and off immediately.</li>
<li><a href="http://dev.ckeditor.com/ticket/6781">#6781</a> : [IE7] Dialog windows are broken with RTL, Office 2003 and v2 skins.</li>
<li><a href="http://dev.ckeditor.com/ticket/6798">#6798</a> : [IE7] Dialog window buttons disappearing in RTL after dragging.</li>
<li><a href="http://dev.ckeditor.com/ticket/6806">#6806</a> : [IE7] Dialog window buttons invisible on focus.</li>
<li><a href="http://dev.ckeditor.com/ticket/6588">#6588</a> : Copy and paste adds <code><span></code> if SCAYT is enabled.</li>
<li><a href="http://dev.ckeditor.com/ticket/6673">#6673</a> : IE Target combo for Image Link shown as blank even when we select <code><not set></code> as an option.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/6756">#6756</a> : Hungarian;</li>
<li><a href="http://dev.ckeditor.com/ticket/6794">#6794</a> : Japanese;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.4.2</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5024">#5024</a> : Added a sample that shows how to output HTML that is valid for Flash.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5237">#5237</a> : English text in dialogs' title was flipped when using RTL language (office2003 and v2 skins).</li>
<li><a href="http://dev.ckeditor.com/ticket/6289">#6289</a> : Deleting nested table removed the parent cell.</li>
<li><a href="http://dev.ckeditor.com/ticket/6341">#6341</a> : The editor contents now have the text cursor.</li>
<li><a href="http://dev.ckeditor.com/ticket/6153">#6153</a> : Chrome: tab focus is wrong.</li>
<li><a href="http://dev.ckeditor.com/ticket/6261">#6261</a> : Focus and infinite loop between multiple editors.</li>
<li><a href="http://dev.ckeditor.com/ticket/6170">#6170</a> : Dedicated class names are removed from floating panels when opening another panel.</li>
<li><a href="http://dev.ckeditor.com/ticket/6339">#6339</a> : Autogrow plugin now doesn't work on maximized editors.</li>
<li><a href="http://dev.ckeditor.com/ticket/6237">#6237</a> : BIDI: Applying same language direction to all paragraphs not working.</li>
<li><a href="http://dev.ckeditor.com/ticket/6353">#6353</a> : [IE] Resize was broken with office2003 and v2 skins.</li>
<li><a href="http://dev.ckeditor.com/ticket/6375">#6375</a> : Avoiding errors when hiding the editor after the blur event.</li>
<li><a href="http://dev.ckeditor.com/ticket/6133">#6133</a> : Styled paragraphs result on buggy list creation.</li>
<li><a href="http://dev.ckeditor.com/ticket/5074">#5074</a> : Link target is not removed when changing to popup.</li>
<li><a href="http://dev.ckeditor.com/ticket/6408">#6408</a> : [IE] Autogrow now works correctly on Quirks.</li>
<li><a href="http://dev.ckeditor.com/ticket/6420">#6420</a> : [IE] The table properties dialog now correctly retrieves the caption text.</li>
<li><a href="http://dev.ckeditor.com/ticket/6141">#6141</a> : It was impossible to outdent a list when indentOffset was set to 0.</li>
<li><a href="http://dev.ckeditor.com/ticket/6377">#6377</a> : FF width and height are not shown for smiley in Image properties dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5399">#5399</a> : Lists pasted from Word do not maintain their nesting.</li>
<li><a href="http://dev.ckeditor.com/ticket/6225">#6225</a> : [FF] Cannot transform several lines to list with enterMode BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/6467">#6467</a> : [FF] It is now possible to disable the plugin command on "mode" event.</li>
<li><a href="http://dev.ckeditor.com/ticket/6461">#6461</a> : Attributes are now being kept when changing block formatting.</li>
<li><a href="http://dev.ckeditor.com/ticket/6226">#6226</a> : BIDI: Language direction applied to a Paragraph is removed when we apply one of Paragraph formatting options.</li>
<li><a href="http://dev.ckeditor.com/ticket/5395">#5395</a> : [Opera] Native context menu incorrectly opened after Opera 10.2.</li>
<li><a href="http://dev.ckeditor.com/ticket/6444">#6444</a> : [Opera] Close panels and dialogs don't return focus to wysiwyg frame.</li>
<li><a href="http://dev.ckeditor.com/ticket/6332">#6332</a> : IE: V2 skin bottom dialog's border broken.</li>
<li><a href="http://dev.ckeditor.com/ticket/5646">#5646</a> : Parser incorrectly removes inline element when there's only one comment node enclosed.</li>
<li><a href="http://dev.ckeditor.com/ticket/6189">#6189</a> : Minor code size reduction.</li>
<li><a href="http://dev.ckeditor.com/ticket/5045">#5045</a> : uiColor behaved wrong if multiple editors were used with period in their names.</li>
<li><a href="http://dev.ckeditor.com/ticket/5766">#5766</a> : Config entry "ignoreEmptyParagraph" should only remove one single empty paragraph in document.</li>
<li><a href="http://dev.ckeditor.com/ticket/5931">#5931</a> : Unable to apply inline style because of nested elements with same style name.</li>
<li><a href="http://dev.ckeditor.com/ticket/6083">#6083</a> : Dialog close sometimes cause collapsed editor selection before the insertion.</li>
<li><a href="http://dev.ckeditor.com/ticket/6253">#6253</a> : BIDI: creating a Numbered/Bulleted list causing improper behavior on bidi.</li>
<li><a href="http://dev.ckeditor.com/ticket/4023">#4023</a> : [Opera] Maximize plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/6403">#6403</a> : [Opera] Font name options are not correctly marked in dropdown list.</li>
<li><a href="http://dev.ckeditor.com/ticket/4534">#4534</a> : [Opera] Arrow key to navigate through combo list has side effects of window scrolling.</li>
<li><a href="http://dev.ckeditor.com/ticket/6534">#6534</a> : [Opera] Menu key brings up both CKEditor and browser context menu.</li>
<li><a href="http://dev.ckeditor.com/ticket/6534">#6534</a> : [Opera] Menu key brings up both CKEditor and browser context menu.</li>
<li><a href="http://dev.ckeditor.com/ticket/6416">#6416</a> : [IE9] Unable to make text selection with mouse in source area.</li>
<li><a href="http://dev.ckeditor.com/ticket/6417">#6417</a> : [IE9] Context menu opens at the upper-left corner always.</li>
<li><a href="http://dev.ckeditor.com/ticket/6501">#6501</a> : [IE9] Context menu item layout is broken.</li>
<li><a href="http://dev.ckeditor.com/ticket/6099">#6099</a> : BIDI: when we apply explicit language direction to Numbered/Bulleted List the corresponding BIDI Tool bar icon is not highlighted in the Toolbar.</li>
<li><a href="http://dev.ckeditor.com/ticket/6100">#6100</a> : BIDI: when we change Table language direction indentation of text in Table cells is not applied correctly.</li>
<li><a href="http://dev.ckeditor.com/ticket/6376">#6376</a> : BIDI: buttons should not toggle the base language direction.</li>
<li><a href="http://dev.ckeditor.com/ticket/6235">#6235</a> : BIDI: Applying direction to multi-paragraph selection within a div.</li>
<li><a href="http://dev.ckeditor.com/ticket/6187">#6187</a> : [IE6] Multi-instance loading produces 404s on background images.</li>
<li><a href="http://dev.ckeditor.com/ticket/5446">#5446</a> : Setting config.filebrowserImageBrowseUrl results in displaying also Browser Server on links.</li>
<li><a href="http://dev.ckeditor.com/ticket/5626">#5626</a> : CKeditor 3.2.1 : html content attached makes ckeditor crash the browser FF/IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/6508">#6508</a> : BiDi: Margin mirroring logic doesn't honor CSS direction.</li>
<li><a href="http://dev.ckeditor.com/ticket/6043">#6043</a> : BIDI: When we apply RTL direction to a right aligned Paragraph, Paragraph is not moved to the left & Alignment of Paragraph is not changed.</li>
<li><a href="http://dev.ckeditor.com/ticket/6485">#6485</a> : BIDI: When direction is applied on partial selected list, the style is been incorrectly applied to the entire list.</li>
<li><a href="http://dev.ckeditor.com/ticket/6087">#6087</a> : Cursor of input fields in dialog isn't visible in RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/5595">#5595</a> : Extra leading spaces added in preformatted block.</li>
<li><a href="http://dev.ckeditor.com/ticket/6094">#6094</a> : Match full word option doesn't stop on block boundaries.</li>
<li><a href="http://dev.ckeditor.com/ticket/5730">#5730</a> : [Safari] Continual pastes (holding paste key) breaks document contents.</li>
<li><a href="http://dev.ckeditor.com/ticket/5850">#5850</a> : [IE] Inline style misbehaviors at the beginning of numbered/bulleted list.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/6427">#6427</a> : Ukrainian;</li>
<li><a href="http://dev.ckeditor.com/ticket/6464">#6464</a> : Finnish;</li>
<li>Hebrew;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.4.1</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5308">#5308</a> : Introduced the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.filebrowserWindowFeatures">filebrowserWindowFeatures</a> setting, making it possible to have custom window features in the file browser window.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/6027">#6027</a> : Modifying Table Properties by selecting more than one cell caused issues.</li>
<li><a href="http://dev.ckeditor.com/ticket/6146">#6146</a> : IE: Floating panels were being opened in the wrong place in RTL pages with horizontal scrollbars.</li>
<li><a href="http://dev.ckeditor.com/ticket/6055">#6055</a> : The timestamp is now added only once to each loaded file.</li>
<li><a href="http://dev.ckeditor.com/ticket/6097">#6097</a> : The bookmarks now use the right name.</li>
<li><a href="http://dev.ckeditor.com/ticket/5717">#5717</a> : Removed the scayt_contextMenuOntop setting and the SCAYT context menu options are always on top.</li>
<li><a href="http://dev.ckeditor.com/ticket/5956">#5956</a> : [FF] It was impossible to create an editor inside an hidden container.</li>
<li><a href="http://dev.ckeditor.com/ticket/5753">#5753</a> : It was impossible to have a default value for the name field in the select dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/6041">#6041</a> : BIDI: Direction of Increase Indent & Decrease Indent icons are not reversed after changing Lang direction to RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/6138">#6138</a> : List indentation is not working.</li>
<li><a href="http://dev.ckeditor.com/ticket/5649">#5649</a> : Image dialog too wide when many styles are set.</li>
<li><a href="http://dev.ckeditor.com/ticket/5715">#5715</a> : Cell color picker dialog returns focus to document.</li>
<li><a href="http://dev.ckeditor.com/ticket/6108">#6108</a> : Fixed div style.</li>
<li><a href="http://dev.ckeditor.com/ticket/5336">#5336</a> : Remove object style.</li>
<li><a href="http://dev.ckeditor.com/ticket/6155">#6155</a> : [[FF]] Modifying Table Header Properties by selecting first Row, causing several issues.</li>
<li><a href="http://dev.ckeditor.com/ticket/6163">#6163</a> : Focus not going to Tabs in Image dialog when we went to Edit the Image.</li>
<li><a href="http://dev.ckeditor.com/ticket/6177">#6177</a> : IE we can't start Numbered/Bulleted list on a Empty page.</li>
<li><a href="http://dev.ckeditor.com/ticket/5413">#5413</a> : Browser error after pasting html table in CKEditor.</li>
<li><a href="http://dev.ckeditor.com/ticket/6034">#6034</a> : Horizontal Alignment applied to Table cell is not updated correctly in the Toolbar.</li>
<li><a href="http://dev.ckeditor.com/ticket/6112">#6112</a> : BIDI: Alignment set to text in Table cell is not shown in the Tool bar when we press Enter to start a new Paragraph.</li>
<li><a href="http://dev.ckeditor.com/ticket/6117">#6117</a> : BIDI: Language direction is changing when we come out of Numbered/Bulleted list.</li>
<li><a href="http://dev.ckeditor.com/ticket/6182">#6182</a> : Language Direction field on the Advanced tab of Table Properties dialog has a fixed pixel width.</li>
<li><a href="http://dev.ckeditor.com/ticket/5487">#5487</a> : Fullpage writer problem with line-break.</li>
<li><a href="http://dev.ckeditor.com/ticket/6197">#6197</a> : The CKEDITOR.loader base path auto-detection was not working with the _source folder.</li>
<li><a href="http://dev.ckeditor.com/ticket/6240">#6240</a> : Font Names & Font Sizes should be shown Left Align even for RTL Languages.</li>
<li><a href="http://dev.ckeditor.com/ticket/5975">#5975</a> : Page-break should have proper Alt Text instead of Unknown object. so that JAWS reads it properly.</li>
<li><a href="http://dev.ckeditor.com/ticket/6255">#6255</a> : Inserting a page break as the first node triggered an error.</li>
<li><a href="http://dev.ckeditor.com/ticket/6188">#6188</a> : [IE7] Automatic color button had the wrong cursor.</li>
<li><a href="http://dev.ckeditor.com/ticket/6129">#6129</a> : The show blocks' labels are now shown in the right for RTL languages.</li>
<li><a href="http://dev.ckeditor.com/ticket/5421">#5421</a> : &shy; entity not converted when config.entities=false.</li>
<li><a href="http://dev.ckeditor.com/ticket/5769">#5769</a> : xhtml code generation problem &nbsp; instead of &#160; (htmlentities, entities,entities_additional,..., configuration).</li>
<li><a href="http://dev.ckeditor.com/ticket/4472">#4472</a> : [FF3] Browser window scrolls to loaded CKEditor.</li>
<li><a href="http://dev.ckeditor.com/ticket/6230">#6230</a> : Fixed invalid parameter count for setTimeout function call.</li>
<li><a href="http://dev.ckeditor.com/ticket/5335">#5335</a> : Several lines' formatted data will be merged to one line when we apply Numbers/Bullets.</li>
<li><a href="http://dev.ckeditor.com/ticket/5353">#5353</a> : wrong width of editor after resize() called in Firefox 3.6.</li>
<li><a href="http://dev.ckeditor.com/ticket/5778">#5778</a> : [IE] Unwanted scroll on first mouse right-click.</li>
<li><a href="http://dev.ckeditor.com/ticket/5218">#5218</a> : [FF] Copy/paste of an image from same domain changed URL to relative URL.</li>
<li><a href="http://dev.ckeditor.com/ticket/6265">#6265</a> : Popup window properties were visible in the link dialog's target tab when nothing was selected.</li>
<li><a href="http://dev.ckeditor.com/ticket/6075">#6075</a> : [FF] Newly created links didn't fill in information on edit.</li>
<li><a href="http://dev.ckeditor.com/ticket/6183">#6183</a> : The toolbar panels options sometimes had the contents' link color.</li>
<li><a href="http://dev.ckeditor.com/ticket/6192">#6192</a> : [WebKit] Inserting smileys was not working because of editor focus issues.</li>
<li><a href="http://dev.ckeditor.com/ticket/6178">#6178</a> : [WebKit] Inserting elements by code was failing if the editor didn't receive the focus first.</li>
<li><a href="http://dev.ckeditor.com/ticket/6179">#6179</a> : [WebKit] The Image dialog was not working if the editor didn't receive the focus first.</li>
<li><a href="http://dev.ckeditor.com/ticket/4657">#4657</a> : [Opera] Styles where not working with collapsed selections.</li>
<li><a href="http://dev.ckeditor.com/ticket/5839">#5839</a> : "Insert row after" was removing the ids of the elements from the clicked row.</li>
<li><a href="http://dev.ckeditor.com/ticket/6315">#6315</a> : DIV plugin TT #2885 regression.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/6246">#6246</a> : Chinese Simplified;</li>
<li><a href="http://dev.ckeditor.com/ticket/6256">#6256</a> : Dutch;</li>
<li><a href="http://dev.ckeditor.com/ticket/6271">#6271</a> : English;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.4</h3>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/6118">#6118</a> : Initial focus is now set to the tabs in the table properties dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/6135">#6135</a> : The dialogadvtab plugin now uses the correct label.</li>
<li><a href="http://dev.ckeditor.com/ticket/6125">#6125</a> : Focus was lost after applying commands in Opera.</li>
<li><a href="http://dev.ckeditor.com/ticket/6137">#6137</a> : The table dialog was missing the default width value on second opening.</li>
</ul>
<h3>
CKEditor 3.4 Beta</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5909">#5909</a> : New BiDi feature, making it possible to switch the base language direction of block elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/5268">#5268</a> : Introducing the "tableresize" plugin, which makes it possible to resize tables columns by mouse drag. It's not enabled by default, so it must be enabled in the configurations file.</li>
<li><a href="http://dev.ckeditor.com/ticket/979">#979</a> : New <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enableTabKeyTools">enableTabKeyTools</a> configuration to allow using the TAB key to navigate through table cells.</li>
<li><a href="http://dev.ckeditor.com/ticket/4606">#4606</a> : Introduce the "autogrow" plugin, which makes the editor resize automatically, based on the contents size.</li>
<li><a href="http://dev.ckeditor.com/ticket/5737">#5737</a> : Added support for the <a href="http://www.w3.org/TR/html5/editing.html#contenteditable">HTML5 contenteditable attribute</a>, making it possible to define read only regions into the editor contents.</li>
<li><a href="http://dev.ckeditor.com/ticket/5418">#5418</a> : New "Advanced" tab introduced on the Table Properties dialog. It's based on the new dialogadvtab plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/6082">#6082</a> : Introduced the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.useComputedState">useComputedState</a> setting, making it possible to control whether toolbar features, like alignment and direction, should reflect the "computed" selection states, even when the effective feature value is not applied.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5911">#5911</a> : BiDi: List items should support and retain correct base language direction</li>
<li><a href="http://dev.ckeditor.com/ticket/5689">#5689</a> : Make it possible to run CKEditor inside of Firefox chrome.</li>
<li><a href="http://dev.ckeditor.com/ticket/6042">#6042</a> : It wasn't possible to align a paragraph with the dir attribute to the opposite direction.</li>
<li><a href="http://dev.ckeditor.com/ticket/6058">#6058</a> : Fixed a small style glitch with file upload fields in IE+Quirks.</li>
</ul>
<h3>
CKEditor 3.3.2</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5882">#5882</a> : Introduce the dialog#selectPage event, replicating the OnDialogTabChange feature available in FCKeditor 2.</li>
<li><a href="http://dev.ckeditor.com/ticket/5927">#5927</a> : The native controls in ui.dialog.elements can be styled with the controlStyle definition.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/1644">#1644</a> : Removed references to cursor:hand in the stylesheets.</li>
<li><a href="http://dev.ckeditor.com/ticket/5411">#5411</a> : Anchor, hidden fields and Page-Break objects can no longer be resized.</li>
<li><a href="http://dev.ckeditor.com/ticket/5456">#5456</a> : Initial focus incorect in api_dialog sample page.</li>
<li><a href="http://dev.ckeditor.com/ticket/5628">#5628</a> : Incorrect <pre> siblings merging.</li>
<li><a href="http://dev.ckeditor.com/ticket/5829">#5829</a> : Adding validation for start number field in list style dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5845">#5845</a> : Context menu on empty list item loses selection.</li>
<li><a href="http://dev.ckeditor.com/ticket/5860">#5860</a> : [IE] > in attribute values are incorrectly escaped.</li>
<li><a href="http://dev.ckeditor.com/ticket/5905">#5905</a> : SCAYT is not any more enabled by default.</li>
<li><a href="http://dev.ckeditor.com/ticket/5736">#5736</a> : Improved the text generated for mailto: links if no text was selected.</li>
<li><a href="http://dev.ckeditor.com/ticket/4779">#4779</a> : Adjust resize_minWidth and resize_minHeight if smaller than actual dimensions.</li>
<li><a href="http://dev.ckeditor.com/ticket/5687">#5687</a> : Navigation through colors is now compatible with RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/4615">#4615</a> : [IE] Text fields are no longer disrupted in dialog with RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/5887">#5887</a> : The number of columns in the smileys table is now configurable via the smiley_columns setting.</li>
<li><a href="http://dev.ckeditor.com/ticket/5100">#5100</a> : It was possible to drag&drop some elements like context menu items or dropdown entries.</li>
<li><a href="http://dev.ckeditor.com/ticket/5933">#5933</a> : Text color and background color panels don't have scrollbars anymore under office2003 and v2 skins.</li>
<li><a href="http://dev.ckeditor.com/ticket/5943">#5943</a> : An error is no longer generated when using percent or pixel values in the image dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5951">#5951</a> : Avoid problems with security systems due to the usage of UniversalXPConnect.</li>
<li><a href="http://dev.ckeditor.com/ticket/5441">#5441</a> : Avoid errors if the editor instance is removed from the DOM before calling its destroy() method.</li>
<li><a href="http://dev.ckeditor.com/ticket/4997">#4997</a> : Provide better access to the native input in the ui.dialog.file element.</li>
<li><a href="http://dev.ckeditor.com/ticket/5914">#5914</a> : Modified the Smileys dialog to make active only the images and not their borders.</li>
<li><a href="http://dev.ckeditor.com/ticket/5565">#5565</a> : The scrollbar does not behaves erratically when opening a rich combo in RTL page.</li>
<li><a href="http://dev.ckeditor.com/ticket/5843">#5843</a> : In CKEditor 3.3: When we set the focus in the 'instanceReady' event, FF3.6 is giving js error.</li>
<li><a href="http://dev.ckeditor.com/ticket/5902">#5902</a> : paste and pastetext dialogs cannot be skinned easily.</li>
<li><a href="http://dev.ckeditor.com/ticket/5959">#5959</a> : Dialog auto focus does not check for hidden tabs.</li>
<li><a href="http://dev.ckeditor.com/ticket/5415">#5415</a> : Undo not working when we change the Table Properties for the table on a saved page.</li>
<li><a href="http://dev.ckeditor.com/ticket/5435">#5435</a> : IE: we can't start Numbered/Bulleted list in Tables by Clicking on Insert/Remove Numbers/Bullets Icon.</li>
<li><a href="http://dev.ckeditor.com/ticket/5832">#5832</a> : The JQuery adapter sample is not working properly with SSL.</li>
<li><a href="http://dev.ckeditor.com/ticket/5728">#5728</a> : Text field & Upload Button in Upload Tab of Image Properties dialog are not shown Properly in Arabic.</li>
<li><a href="http://dev.ckeditor.com/ticket/5436">#5436</a> : IE: Cursor goes to next Table Cell after we insert a Smiley in the Table Cell.</li>
<li><a href="http://dev.ckeditor.com/ticket/5580">#5580</a> : Maximize does not work properly in the Office 2003 and V2 skins.</li>
<li><a href="http://dev.ckeditor.com/ticket/5495">#5495</a> : The link dialog was breaking the undo system on some situations.</li>
<li><a href="http://dev.ckeditor.com/ticket/5775">#5775</a> : Required field's label to contain a CSS class to allow it to be styled differently.</li>
<li><a href="http://dev.ckeditor.com/ticket/5999">#5999</a> : Table dialog rows and columns fields are now marked as required.</li>
<li><a href="http://dev.ckeditor.com/ticket/5693">#5693</a> : baseHref detection in the flash dialog now works correctly.</li>
<li><a href="http://dev.ckeditor.com/ticket/5690">#5690</a> : Table cell's width attribute is now respected properly.</li>
<li><a href="http://dev.ckeditor.com/ticket/5819">#5819</a> : Introducing the new removeFormatCleanup event and making sure remove format doesn't break the showborder plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/5558">#5558</a> : After pasting on WebKit based browsers the editor now scrolls to the end of the pasted content.</li>
<li><a href="http://dev.ckeditor.com/ticket/5799">#5799</a> : Correct plugin dependencies for the liststyle plugin with contextMenu and dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5436">#5436</a> : IE: The cursor was moving to the wrong position when inserting inline elements at the end of cells on tables.</li>
<li><a href="http://dev.ckeditor.com/ticket/5984">#5984</a> : Firefox: CTRL+HOME was creating an unwanted empty paragraph at the start of the document.</li>
<li><a href="http://dev.ckeditor.com/ticket/5634">#5634</a> : IE: It was needed to click twice in the editor to make it editable on some situations.</li>
<li><a href="http://dev.ckeditor.com/ticket/5338">#5338</a> : Pasting from Open Office could lead on error.</li>
<li><a href="http://dev.ckeditor.com/ticket/5224">#5224</a> : Some invalid markup could break the editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/5455">#5455</a> : It was not possible to remove formatting from pasted content on specific cases.</li>
<li><a href="http://dev.ckeditor.com/ticket/5735">#5735</a> : IE: The editor was having focus issues when the previous selection got hidden by scroll operations.</li>
<li><a href="http://dev.ckeditor.com/ticket/5563">#5563</a> : Firefox: The disableObjectResizing and disableNativeTableHandles settings stopped working.</li>
<li><a href="http://dev.ckeditor.com/ticket/5781">#5781</a> : Firefox: Editing was not possible in an empty document.</li>
<li><a href="http://dev.ckeditor.com/ticket/5293">#5293</a> : Firefox: Unwanted BR tags were being left in the editor output when it should be empty.</li>
<li><a href="http://dev.ckeditor.com/ticket/5280">#5280</a> : IE: Scrollbars where reacting improperly when clicking in the bar space.</li>
<li><a href="http://dev.ckeditor.com/ticket/5840">#5840</a> : Some dialog access keys are conflicting with "Ctrl + A", select all text behavior on text input.</li>
<li><a href="http://dev.ckeditor.com/ticket/6059">#6059</a> : Changing list type didn't preserve the list's attributes.</li>
<li><a href="http://dev.ckeditor.com/ticket/5193">#5193</a> : In Firefox, the element path options had the text cursor instead of the arrow.</li>
<li><a href="http://dev.ckeditor.com/ticket/6073">#6073</a> : The list context menu was showing the wrong option when in a mixed list hierarchy.</li>
<li><a href="http://dev.ckeditor.com/ticket/6074">#6074</a> : The Insert Table Column command was duplicating the selected column cells ids.</li>
<li><a href="http://dev.ckeditor.com/ticket/6066">#6066</a> : The toolbar combos had the text cursor instead of the arrow.</li>
<li><a href="http://dev.ckeditor.com/ticket/6062">#6062</a> : The toolbar buttons had the text cursor instead of the arrow.</li>
<li><a href="http://dev.ckeditor.com/ticket/6068">#6068</a> : [IE7] A few labels were hidden in a RTL language.</li>
<li><a href="http://dev.ckeditor.com/ticket/6000">#6000</a> : Safari and Chrome where scrolling the contents to the top when moving the focus to the editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/6090">#6090</a> : IE: Textarea with selection inside causes Link dialog issues.</li>
<li><a href="http://dev.ckeditor.com/ticket/5079">#5079</a> : Page break in lists move to above the list when you switch from WYSIWYG to HTML mode and back.</li>
<li>Updated the following language files:<ul>
<li>Chinese Simplified;</li>
<li>Hebrew;</li>
<li><a href="http://dev.ckeditor.com/ticket/5962">#5962</a> : German;</li>
<li><a href="http://dev.ckeditor.com/ticket/5645">#5645</a> : Portuguese;</li>
<li><a href="http://dev.ckeditor.com/ticket/5797">#5797</a> : Turkish;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.3.1</h3>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5780">#5780</a> : Text selection lost when opening some of the dialogs.</li>
<li><a href="http://dev.ckeditor.com/ticket/5787">#5787</a> : Liststyle plugin wasn't packaged into the core (CKEDITOR.resourceManager.load exception).</li>
<li><a href="http://dev.ckeditor.com/ticket/5637">#5637</a> : Fix wrong nesting that generated "<head> must be a child of <html>" warning in Webkit.</li>
<li><a href="http://dev.ckeditor.com/ticket/5790">#5790</a> : Internal only attributes output on fullpage <html> tag.</li>
<li><a href="http://dev.ckeditor.com/ticket/5761">#5761</a> : [IE] Color dialog matrix buttons are barely clickable in quirks mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/5759">#5759</a> : [IE] Clicking on the scrollbar and then on the host page causes error.</li>
<li><a href="http://dev.ckeditor.com/ticket/5772">#5772</a> : List style dialog is missing tab page ids.</li>
<li><a href="http://dev.ckeditor.com/ticket/5782">#5782</a> : [FF] Wysiwyg mode is broken by 'display' style changes on editor's parent DOM tree.</li>
<li><a href="http://dev.ckeditor.com/ticket/5801">#5801</a> : [IE] contentEditable="false" doesn't apply in effect on inline-elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/5794">#5794</a> : Empty find matching twice results in JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/5732">#5732</a> : If it isn't possible to connect to the SCAYT servers the dialogs might hang in Firefox. Fix for Firefox>=3.6.</li>
<li><a href="http://dev.ckeditor.com/ticket/5807">#5807</a> : [FF2] New page command results in uneditable document.</li>
<li><a href="http://dev.ckeditor.com/ticket/5807">#5807</a> : [FF2] SCAYT plugin is disabled in Firefox2 due to selection interference.</li>
<li><a href="http://dev.ckeditor.com/ticket/5772">#5772</a> : [IE] Some numbered list style types are not supported by IE6/7 and causes JavaScript error.</li>
</ul>
<h3>
CKEditor 3.3</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/635">#635</a> : The properties dialog will now open when double clicking on objects.</li>
<li><a href="http://dev.ckeditor.com/ticket/3893">#3893</a> : It's now possible to indent/outdent lists when selecting the first list item.</li>
<li><a href="http://dev.ckeditor.com/ticket/4968">#4968</a> : The <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.contentsLangDirection">contentsLangDirection</a> setting now has a default value 'ui' which inherit language direction from the editor UI language.</li>
<li><a href="http://dev.ckeditor.com/ticket/4649">#4649</a> : The color picker dialog is now accessible.</li>
<li><a href="http://dev.ckeditor.com/ticket/3593">#3593</a> : The editing area is now enabled by contentEditable="true" instead of designMode="on" to allow creating uneditable content elements in all browsers.</li>
<li><a href="http://dev.ckeditor.com/ticket/4056">#4056</a> : Hidden fields will now be displayed as fake element just like in FCKeditor 2.</li>
</ul>
<h3>
CKEditor 3.2.2</h3>
<p>
New features:</p>
<ul>
<li>The SCAYT spell checker is now enabled by default through the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.scayt_autoStartup">autoStartup</a> setting.</li>
<li><a href="http://dev.ckeditor.com/ticket/5631">#5631</a> : The SCAYT context menu options can now be reorganized through the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.scayt_contextMenuItemsOrder">scayt_contextMenuItemsOrder</a> setting.</li>
<li><a href="http://dev.ckeditor.com/ticket/4231">#4231</a> : Introducing the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.resize_dir">resize_dir setting</a>, to be able to restrict manual resizing of the editor to only one direction (horizontal/vertical).</li>
<li><a href="http://dev.ckeditor.com/ticket/5479">#5479</a> : Introducing the classic ASP integration files and samples.</li>
<li><a href="http://dev.ckeditor.com/ticket/5024">#5024</a> : Added samples (<a href="http://nightly.ckeditor.com/latest/ckeditor/_samples/output_html.html">HTML</a> and <a href="http://nightly.ckeditor.com/latest/ckeditor/_samples/output_xhtml.html">XHTML</a>) to show how to output HTML using fonts and other attributes instead of styles.</li>
<li><a href="http://dev.ckeditor.com/ticket/4358">#4358</a> : Introduced the List Properties dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5485">#5485</a> : Adding the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.contentsLanguage">contentsLanguage</a> configuration option to be able to set the language for the editor contents.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5330">#5330</a> : Corrected detection of CTRL and META keys in Macs for the context menu.</li>
<li><a href="http://dev.ckeditor.com/ticket/5434">#5434</a> : Fixed access denied issues with IE when accessing web sites through IPv6 IP addresses.</li>
<li><a href="http://dev.ckeditor.com/ticket/4476">#4476</a> : [IE] Inaccessible empty list item contains sub list.</li>
<li><a href="http://dev.ckeditor.com/ticket/4881">#4881</a> : [IE] Selection range broken because of cutting a single control type element from it.</li>
<li><a href="http://dev.ckeditor.com/ticket/5505">#5505</a> : Image dialog throw JavaScript error when click close dialog before preview area is loading.</li>
<li><a href="http://dev.ckeditor.com/ticket/5144">#5144</a> : [Chrome] Paste in Webkit sometimes leaves extra 'div' element.</li>
<li><a href="http://dev.ckeditor.com/ticket/5021">#5021</a> : [Firefox] Typing in empty document start from second line when <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enterMode">enterMode</a> = CKEDITOR.ENTER_BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/5416">#5416</a> : [IE] Delete table throws a error when <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enterMode">enterMode</a> = CKEDITOR.ENTER_BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/4459">#4459</a> : [IE] Select element is penetrating the maximized editor in IE6.</li>
<li><a href="http://dev.ckeditor.com/ticket/5559">#5559</a> : [IE] The first call to <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#setData">setData</a> is affected by iframe cache when loading the wysiwyg mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/5567">#5567</a> : [IE] Remove inline styles in some case doesn't join identical siblings.</li>
<li><a href="http://dev.ckeditor.com/ticket/5450">#5450</a> : [FireFox] Press ENTER on 'replace' button result wrong.</li>
<li><a href="http://dev.ckeditor.com/ticket/5121">#5121</a> : Recognizes the <br /> tag as a separator when apply block styles and <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enterMode">enterMode</a> = CKEDITOR.ENTER_BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/5575">#5575</a> : <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replaceAll">CKEDITOR.replaceAll</a> should consider all kind of white spaces between class names.</li>
<li><a href="http://dev.ckeditor.com/ticket/5582">#5582</a> : Prevent the default behavior when click the 'x' button to close dialog box.</li>
<li><a href="http://dev.ckeditor.com/ticket/5584">#5584</a> : ENTER key with <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.forceEnterMode">forceEnterMode</a> turns on doesn't inherit current block attributes.</li>
<li><a href="http://dev.ckeditor.com/ticket/4797">#4797</a> : [Opera] Press ENTER key in dialog fields to close throws JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/5578">#5578</a> : Add flash fake element align property when switch mode (source to wysiwyg).</li>
<li><a href="http://dev.ckeditor.com/ticket/5577">#5577</a> : Update delete column behavior when choose multiple cells in the same column.</li>
<li><a href="http://dev.ckeditor.com/ticket/5512">#5512</a> : Open context menu with SHIFT+F10 doesn't get correct editor selection.</li>
<li><a href="http://dev.ckeditor.com/ticket/5433">#5433</a> : English protocol text directions in Link dialog are not incorrect in 'rtl' UI languages.</li>
<li><a href="http://dev.ckeditor.com/ticket/5553">#5553</a> : Paste dialog clipboard area text direction is incorrect for 'rtl' content languages.</li>
<li><a href="http://dev.ckeditor.com/ticket/4734">#4734</a> : Font size resets when font name is changed in an empty numbered list.</li>
<li><a href="http://dev.ckeditor.com/ticket/5237">#5237</a> : English text in dialogs' title is flipped when using RTL language.</li>
<li><a href="http://dev.ckeditor.com/ticket/3257">#3257</a> : Create list doesn't keep blocks as headings.</li>
<li><a href="http://dev.ckeditor.com/ticket/5111">#5111</a> : [Firefox] JAWS doesn't respect PC cursor mode (application role) on toolbar.</li>
<li><a href="http://dev.ckeditor.com/ticket/5530">#5530</a> : Page break for printing can't be removed with undo.</li>
<li><a href="http://dev.ckeditor.com/ticket/5381">#5381</a> : Unable to place cursor between two paragraphs in body.</li>
<li><a href="http://dev.ckeditor.com/ticket/5568">#5568</a> : [IE6/7] Selecting a entire table cell changes the original range.</li>
<li><a href="http://dev.ckeditor.com/ticket/5623">#5623</a> : [Firefox] Apply style that edges another inline style result incorrect.</li>
<li><a href="http://dev.ckeditor.com/ticket/5586">#5586</a> : [Firefox] Maximize the second editor ruins full screen mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/5617">#5617</a> : HTML filter system does not allow two 'text' filter rules.</li>
<li><a href="http://dev.ckeditor.com/ticket/5663">#5663</a> : General memory clean up after destroying last instance.</li>
<li><a href="http://dev.ckeditor.com/ticket/5461">#5461</a> : [IE] Fix Paste from Word dialog doesn't accept imput problem.</li>
<li><a href="http://dev.ckeditor.com/ticket/5676">#5676</a> : Make color buttons use RRGGBB instead of RGB for better compatibility with IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/4948">#4948</a> : [Safari] Select the first/last cell of table to open context menu may lead to undetected table.</li>
<li><a href="http://dev.ckeditor.com/ticket/5591">#5591</a> : [Firefox] Select a list item makes selected element broken.</li>
<li><a href="http://dev.ckeditor.com/ticket/5667">#5667</a> : Pasting in a RTL page content causes shows up the horizontal scrollbar.</li>
<li><a href="http://dev.ckeditor.com/ticket/5688">#5688</a> : Duplicate ids are used in dialog definition.</li>
<li><a href="http://dev.ckeditor.com/ticket/5719">#5719</a> : [IE] 'change' dialog event should not be triggered when dialog is already closed.</li>
<li><a href="http://dev.ckeditor.com/ticket/5747">#5747</a> : [IE] Error thrown when IE input field editing mode is turned on.</li>
<li><a href="http://dev.ckeditor.com/ticket/5516">#5516</a> : IE8: Toolbar buttons have higher bottom padding.</li>
<li><a href="http://dev.ckeditor.com/ticket/5402">#5402</a> : SHIFT-ENTER could now be used to exit from preformat block.</li>
<li>SCAYT plugin related:<ul>
<li><a href="http://dev.ckeditor.com/ticket/4836">#4836</a> : Using SCAYT result in fragile elements when applying inline styles.</li>
<li><a href="http://dev.ckeditor.com/ticket/5425">#5425</a> : [Opera] Disable SCAYT plugin for Opera browser.</li>
<li><a href="http://dev.ckeditor.com/ticket/5632">#5632</a> : SCAYT word marker is not visible on text with background-color set.</li>
<li><a href="http://dev.ckeditor.com/ticket/4125">#4125</a> : Remove Format command incorrectly removes SCAYT word markers.</li>
<li><a href="http://dev.ckeditor.com/ticket/5671">#5671</a> : SCAYT bootstrap script could be added multiple times unnecessarily.</li>
<li><a href="http://dev.ckeditor.com/ticket/5573">#5573</a> : SCAYT move cursor position after insert element into marked word text.</li>
<li><a href="http://dev.ckeditor.com/ticket/5546">#5546</a> : SCAYT interferes with undo/redo commands.</li>
<li><a href="http://dev.ckeditor.com/ticket/5570">#5570</a> : [IE] First enabling SCAYT blind cursor in editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/5741">#5741</a> : Enable SCAYT cause error in multiple editor instances.</li>
<li><a href="http://dev.ckeditor.com/ticket/5744">#5744</a> : Remove editor with SCAYT enabled in source mode throws error.</li>
</ul></li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/5432">#5432</a> : Dutch;</li>
<li><a href="http://dev.ckeditor.com/ticket/5619">#5619</a> : Finnish;</li>
<li><a href="http://dev.ckeditor.com/ticket/5515">#5515</a> : Hebrew;</li>
<li><a href="http://dev.ckeditor.com/ticket/5588">#5588</a> : Turkish;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.2.1</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4478">#4478</a> : Enable the SelectAll command in source mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/5150">#5150</a> : Allow names in the CKEDITOR.config.colorButton_colors setting.</li>
<li><a href="http://dev.ckeditor.com/ticket/4810">#4810</a> : Adding configuration option for image dialog preview area filling text.</li>
<li><a href="http://dev.ckeditor.com/ticket/536">#536</a> : Object style now could be applied on any parent element of current selection.</li>
<li><a href="http://dev.ckeditor.com/ticket/5290">#5290</a> : Unified stylesSet loading removing dependencies from the styles combo.
Now the configuration entry is named 'config.stylesSet' instead of config.stylesCombo_stylesSet and the default location
is under the 'styles' plugin instead of 'stylescombo'.</li>
<li><a href="http://dev.ckeditor.com/ticket/5352">#5352</a> : Allow to define the stylesSet array in the config object for the editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/5302">#5302</a> : Adding config option "forceEnterMode".</li>
<li><a href="http://dev.ckeditor.com/ticket/5216">#5216</a> : Extend CKEDITOR.appendTo to allow a data parameter for the initial value.</li>
<li><a href="http://dev.ckeditor.com/ticket/5024">#5024</a> : Added sample to show how to output XHTML and avoid deprecated tags.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5152">#5152</a> : Indentation using class attribute doesn't work properly.</li>
<li><a href="http://dev.ckeditor.com/ticket/4682">#4682</a> : It wasn't possible to edit block elements in IE that had styles like width, height or float.</li>
<li><a href="http://dev.ckeditor.com/ticket/4750">#4750</a> : Correcting default order of buttons layout in dialogs on Mac.</li>
<li><a href="http://dev.ckeditor.com/ticket/4932">#4932</a> : Fixed collapse button not clickable on simple toolbar.</li>
<li><a href="http://dev.ckeditor.com/ticket/5228">#5228</a> : Link dialog is automatically changes protocol when URLs that starts with '?'.</li>
<li><a href="http://dev.ckeditor.com/ticket/4877">#4877</a> : Fixed CKEditor displays source code in one long line (IE quirks mode + office2003 skin).</li>
<li><a href="http://dev.ckeditor.com/ticket/5132">#5132</a> : Apply inline style leaks into sibling words which are seperated spaces.</li>
<li><a href="http://dev.ckeditor.com/ticket/3599">#3599</a> : Background color style on sized text displayed as narrow band behind.</li>
<li><a href="http://dev.ckeditor.com/ticket/4661">#4661</a> : Translation missing in link dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5240">#5240</a> : Flash alignment property is not presented visually on fake element.</li>
<li><a href="http://dev.ckeditor.com/ticket/4910">#4910</a> : Pasting in IE scrolls document to the end.</li>
<li><a href="http://dev.ckeditor.com/ticket/5041">#5041</a> : Table summary attribute can't be removed with dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5124">#5124</a> : All inline styles cannot be applied on empty spaces.</li>
<li><a href="http://dev.ckeditor.com/ticket/3570">#3570</a> : SCAYT marker shouldn't appear inside elements path bar.</li>
<li><a href="http://dev.ckeditor.com/ticket/4553">#4553</a> : Dirty check result incorrect when editor document is empty.</li>
<li><a href="http://dev.ckeditor.com/ticket/4555">#4555</a> : Unreleased memory when editor is created and destroyed.</li>
<li><a href="http://dev.ckeditor.com/ticket/5118">#5118</a> : Arrow keys navigation in RTL languages is incorrect.</li>
<li><a href="http://dev.ckeditor.com/ticket/4721">#4721</a> : Remove attribute 'value' of checkbox in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/5278">#5278</a> : IE: Add validation to check for bad window names of popup window.</li>
<li><a href="http://dev.ckeditor.com/ticket/5171">#5171</a> : Dialogs contains lists don't have proper voice labels.</li>
<li><a href="http://dev.ckeditor.com/ticket/4791">#4791</a> : Can't place cursor inside a form that end with a checkbox/radio.</li>
<li><a href="http://dev.ckeditor.com/ticket/4479">#4479</a> : StylesCombo doesn't reflect the selection state until it's first opened.</li>
<li><a href="http://dev.ckeditor.com/ticket/4717">#4717</a> : 'Unlink' and 'Outdent' command buttons should be disabled on editor startup.</li>
<li><a href="http://dev.ckeditor.com/ticket/5119">#5119</a> : Disabled command buttons are not being properly styled when focused.</li>
<li><a href="http://dev.ckeditor.com/ticket/5307">#5307</a> : Hide dialog page cause problem when there's two tab pages remain.</li>
<li><a href="http://dev.ckeditor.com/ticket/5343">#5343</a> : Active list item ARIA role is wrongly placed.</li>
<li><a href="http://dev.ckeditor.com/ticket/3599">#3599</a> : Background color style applying to text with font size style has been narrowly rendered.</li>
<li><a href="http://dev.ckeditor.com/ticket/4711">#4711</a> : Line break character inside preformatted text makes it unable to type text at the end of previous line.</li>
<li><a href="http://dev.ckeditor.com/ticket/4829">#4829</a> : [IE] Apply style from combo has wrong result on manually created selection.</li>
<li><a href="http://dev.ckeditor.com/ticket/4830">#4830</a> : Retrieving selected element isn't always right, especially selecting using keyboard (SHIFT+ARROW).</li>
<li><a href="http://dev.ckeditor.com/ticket/5128">#5128</a> : Element attribute inside preformatted text is corrupted when converting to other blocks.</li>
<li><a href="http://dev.ckeditor.com/ticket/5190">#5190</a> : Template list entry shouldn't gain initial focus open templates list dialog opens.</li>
<li><a href="http://dev.ckeditor.com/ticket/5238">#5238</a> : Menu button doesn't display arrow icon in high-contrast mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/3576">#3576</a> : Non-attributed element of the same name with the applied style is incorrectly removed.</li>
<li><a href="http://dev.ckeditor.com/ticket/5221">#5221</a> : Insert table into empty document cause JavaScript error thrown.</li>
<li><a href="http://dev.ckeditor.com/ticket/5242">#5242</a> : Apply 'automatic' color option of text color incorrectly removes background-color style.</li>
<li><a href="http://dev.ckeditor.com/ticket/4719">#4719</a> : IE does not escape attribute values properly.</li>
<li><a href="http://dev.ckeditor.com/ticket/5170">#5170</a> : Firefox does not insert text into styled element properly.</li>
<li><a href="http://dev.ckeditor.com/ticket/4026">#4026</a> : Office2003 skin has no toolbar button borders in High Contrast in IE7.</li>
<li><a href="http://dev.ckeditor.com/ticket/4348">#4348</a> : There should have exception thrown when 'CKEDITOR_BASEPATH' couldn't be figured out automatically.</li>
<li><a href="http://dev.ckeditor.com/ticket/5364">#5364</a> : Focus may not be put into dialog correctly when dialog skin file is loading slow.</li>
<li><a href="http://dev.ckeditor.com/ticket/4016">#4016</a> : Justify the layout of forms select dialog in Chrome and IE7.</li>
<li><a href="http://dev.ckeditor.com/ticket/5373">#5373</a> : Variable 'pathBlockElements' defines wrong items in CKEDITOR.dom.elementPath.</li>
<li><a href="http://dev.ckeditor.com/ticket/5082">#5082</a> : Ctrl key should be described as Cmd key on Mac.</li>
<li><a href="http://dev.ckeditor.com/ticket/5182">#5182</a> : Context menu is not been announced correctly by ATs.</li>
<li><a href="http://dev.ckeditor.com/ticket/4898">#4898</a> : Can't navigate outside table under the last paragraph of document.</li>
<li><a href="http://dev.ckeditor.com/ticket/4950">#4950</a> : List commands could compromise list item attribute and styles.</li>
<li><a href="http://dev.ckeditor.com/ticket/5018">#5018</a> : Find result highlighting remove normal font color styles unintentionally.</li>
<li><a href="http://dev.ckeditor.com/ticket/5376">#5376</a> : Unable to exit list from within a empty block under list item.</li>
<li><a href="http://dev.ckeditor.com/ticket/5145">#5145</a> : Various SCAYT fixes.</li>
<li><a href="http://dev.ckeditor.com/ticket/5319">#5319</a> : Match whole word doesn't work anymore after replacement has happened.</li>
<li><a href="http://dev.ckeditor.com/ticket/5363">#5363</a> : 'title' attribute now presents on all editor iframes.</li>
<li><a href="http://dev.ckeditor.com/ticket/5374">#5374</a> : Unable to toggle inline style when the selection starts at the linefeed of the previous paragraph.</li>
<li><a href="http://dev.ckeditor.com/ticket/4513">#4513</a> : Selected link element is not always correctly detected when using keyboard arrows to perform such selection.</li>
<li><a href="http://dev.ckeditor.com/ticket/5372">#5372</a> : Newly created sub list should inherit nothing from the original (parent) list, except the list type.</li>
<li><a href="http://dev.ckeditor.com/ticket/5274">#5274</a> : [IE6] Templates preview image is displayed in wrong size.</li>
<li><a href="http://dev.ckeditor.com/ticket/5292">#5292</a> : Preview in font size and family doesn't work with custom styles.</li>
<li><a href="http://dev.ckeditor.com/ticket/5396">#5396</a> : Selection is lost when use cell properties dialog to change cell type to header.</li>
<li><a href="http://dev.ckeditor.com/ticket/4082">#4082</a> : [IE+Quirks] Preview text in the image dialog is not wrapping.</li>
<li><a href="http://dev.ckeditor.com/ticket/4197">#4197</a> : Fixing format combo don't hide when editor blur on Safari.</li>
<li><a href="http://dev.ckeditor.com/ticket/5401">#5401</a> : The context menu break layout with Office2003 and V2 skin on IE quirks mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4825">#4825</a> : Fixing browser context menu is opened when clicking right mouse button twice.</li>
<li><a href="http://dev.ckeditor.com/ticket/5356">#5356</a> : The SCAYT dialog had issues with Prototype enabled pages.</li>
<li><a href="http://dev.ckeditor.com/ticket/5266">#5266</a> : SCAYT was disturbing the rendering of TH elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/4688">#4688</a> : SCAYT was interfering on checkDirty.</li>
<li><a href="http://dev.ckeditor.com/ticket/5429">#5429</a> : High Contrast mode was being mistakenly detected when loading the editor through Dojo's xhrGet.</li>
<li><a href="http://dev.ckeditor.com/ticket/5221">#5221</a> : Range is mangled when making collapsed selection in an empty paragraph.</li>
<li><a href="http://dev.ckeditor.com/ticket/5261">#5261</a> : Config option 'scayt_autoStartup' slow down editor loading.</li>
<li><a href="http://dev.ckeditor.com/ticket/3846">#3846</a> : Google Chrome - No Img properties after inserting.</li>
<li><a href="http://dev.ckeditor.com/ticket/5465">#5465</a> : ShiftEnter=DIV doesn't respect list item when pressing ENTER at end of list item.</li>
<li><a href="http://dev.ckeditor.com/ticket/5454">#5454</a> : After replaced success, the popup window couldn't be closed and a js error occured.</li>
<li><a href="http://dev.ckeditor.com/ticket/4784">#4784</a> : Incorrect cursor position after delete table cells.</li>
<li><a href="http://dev.ckeditor.com/ticket/5149">#5149</a> : [FF] Cursor disappears after maximize when the editor has focus.</li>
<li><a href="http://dev.ckeditor.com/ticket/5220">#5220</a> : DTD now shows tolerance to <style> appear inside content.</li>
<li><a href="http://dev.ckeditor.com/ticket/5440">#5440</a> : Mobile browsers (iPhone, Android...) are marked as incompatible as they don't support editing features.</li>
<li><a href="http://dev.ckeditor.com/ticket/5504">#5504</a> : [IE6/7] 'Paste' dialog will always get opened even when user allows the clipboard access dialog when using 'Paste' button.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/5326">#5326</a> : Catalan;</li>
<li><a href="http://dev.ckeditor.com/ticket/5370">#5370</a> : Faroese;</li>
<li><a href="http://dev.ckeditor.com/ticket/5392">#5392</a> : Finnish;</li>
<li><a href="http://dev.ckeditor.com/ticket/4580">#4580</a> : Hungarian;</li>
<li><a href="http://dev.ckeditor.com/ticket/5301">#5301</a> : Norwegian;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.2</h3>
<p>
New features:</p>
<ul>
<li>Several accessibility enhancements:<ul>
<li><a href="http://dev.ckeditor.com/ticket/4502">#4502</a> : The editor accessibility is now totally based on <a href="http://www.w3.org/WAI/intro/aria">WAI-ARIA</a>.</li>
<li><a href="http://dev.ckeditor.com/ticket/5015">#5015</a> : Adding accessibility help dialog plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/5014">#5014</a> : Keyboard navigation compliance with screen reader suggested keys.</li>
<li><a href="http://dev.ckeditor.com/ticket/4595">#4595</a> : Better accessibility in the Templates dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/3389">#3389</a> : Esc/Arrow Key now works for closing sub menu.</li>
</ul></li>
<li><a href="http://dev.ckeditor.com/ticket/4973">#4973</a> : The Style field in the Div Container dialog is now loading the styles defined in the default styleset used by the Styles toolbar combo.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/5049">#5049</a> : Form Field list command in JAWS incorrectly lists extra fields.</li>
<li><a href="http://dev.ckeditor.com/ticket/5008">#5008</a> : Lock/Unlock ratio buttons in the Image dialog was poorly designed in High Contrast mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/3980">#3980</a> : All labels in dialogs now use <label> instead of <div>.</li>
<li><a href="http://dev.ckeditor.com/ticket/5213">#5213</a> : Reorganization of some entries in the language files to make it more consistent.</li>
<li><a href="http://dev.ckeditor.com/ticket/5199">#5199</a> : In IE, single row toolbars didn't have the bottom padding.</li>
</ul>
<h3>
CKEditor 3.1.1</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4399">#4399</a> : Improved support for external file browsers by allowing executing a callback function.</li>
<li><a href="http://dev.ckeditor.com/ticket/4612">#4612</a> : The text of links is now updated if it matches the URL to which it points to.</li>
<li><a href="http://dev.ckeditor.com/ticket/4936">#4936</a> : New localization support for the Welsh language.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4272">#4272</a> : Kama skin toolbar was broken in IE+Quirks+RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/4987">#4987</a> : Changed the url which is called by the Browser Server button in the Link tab of Image Properties dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/5030">#5030</a> : The CKEDITOR.timestamp wasn't been appended to the skin.js file.</li>
<li><a href="http://dev.ckeditor.com/ticket/4993">#4993</a> : Removed the float style from images when the user selects 'not set' for alignment.</li>
<li><a href="http://dev.ckeditor.com/ticket/4944">#4944</a> : Fixed a bug where nested list structures with inconsequent levels were not being pasted correctly from MS Word.</li>
<li><a href="http://dev.ckeditor.com/ticket/4637">#4637</a> : Table cells' 'nowrap' attribute was not being loaded by the cell property dialog. Thanks to pomu0325.</li>
<li><a href="http://dev.ckeditor.com/ticket/4724">#4724</a> : Using the mouse to insert a link in IE might create incorrect results.</li>
<li><a href="http://dev.ckeditor.com/ticket/4640">#4640</a> : Small optimizations for the fileBrowser plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/4583">#4583</a> : The "Target Frame Name" field is now visible when target is set to 'frame' only.</li>
<li><a href="http://dev.ckeditor.com/ticket/4863">#4863</a> : Fixing iframedialog's height doesn't stretch to 100% (except IE Quirks).</li>
<li><a href="http://dev.ckeditor.com/ticket/4964">#4964</a> : The BACKSPACE key positioning was not correct in some cases with Firefox.</li>
<li><a href="http://dev.ckeditor.com/ticket/4980">#4980</a> : Setting border, vspace and hspace of images to zero was not working.</li>
<li><a href="http://dev.ckeditor.com/ticket/4773">#4773</a> : The fileBrowser plugin was overwriting onClick functions eventually defined on fileButton elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/4731">#4731</a> : The clipboard plugin was missing a reference to the dialog plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/5051">#5051</a> : The about plugin was missing a reference to the dialog plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/5146">#5146</a> : The wsc plugin was missing a reference to the dialog plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/4632">#4632</a> : The print command will now properly break on the insertion point of page break for printing.</li>
<li><a href="http://dev.ckeditor.com/ticket/4862">#4862</a> : The English (United Kingdom) language file has been renamed to en-gb.js.</li>
<li><a href="http://dev.ckeditor.com/ticket/4618">#4618</a> : Selecting an emoticon or the lock and reset buttons in the image dialog fired the onBeforeUnload event in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/4678">#4678</a> : It was not possible to set tables' width to empty value.</li>
<li><a href="http://dev.ckeditor.com/ticket/5012">#5012</a> : Fixed dependency issues with the menu plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/5040">#5040</a> : The editor will not properly ignore font related settings that have extra item separators (semi-colons).</li>
<li><a href="http://dev.ckeditor.com/ticket/4046">#4046</a> : Justify should respect config.enterMode = CKEDITOR.ENTER_BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/4622">#4622</a> : Inserting tables multiple times was corrupting the undo system.</li>
<li><a href="http://dev.ckeditor.com/ticket/4647">#4647</a> : [IE] Selection on an element within positioned container is lost after open context-menu then click one menu item.</li>
<li><a href="http://dev.ckeditor.com/ticket/4683">#4683</a> : Double-quote character in attribute values was not escaped in the editor output.</li>
<li><a href="http://dev.ckeditor.com/ticket/4762">#4762</a> : [IE] Unexpected vertical-scrolling behavior happens whenever focus is moving out of editor in source mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4772">#4772</a> : Text color was not being applied properly on links.</li>
<li><a href="http://dev.ckeditor.com/ticket/4795">#4795</a> : [IE] Press 'Del' key on horizontal line or table result in error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4824">#4824</a> : [IE] <br/> at the very first table cell breaks the editor selection.</li>
<li><a href="http://dev.ckeditor.com/ticket/4851">#4851</a> : [IE] Delete table rows with context-menu may cause error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4951">#4951</a> : Replacing text with empty string was throwing errors.</li>
<li><a href="http://dev.ckeditor.com/ticket/4963">#4963</a> : Link dialog was not opening properly for e-mail type links.</li>
<li><a href="http://dev.ckeditor.com/ticket/5043">#5043</a> : Removed the possibility of having an unwanted script tag being outputted with the editor contents.</li>
<li><a href="http://dev.ckeditor.com/ticket/3678">#3678</a> : There were issues when editing links inside floating divs with IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/4763">#4763</a> : Pressing ENTER key with text selected was not deleting the text in some situations.</li>
<li><a href="http://dev.ckeditor.com/ticket/5096">#5096</a> : Simple ampersand attribute value doesn't work for more than one occurrence.</li>
<li><a href="http://dev.ckeditor.com/ticket/3494">#3494</a> : Context menu is too narrow in some translations.</li>
<li><a href="http://dev.ckeditor.com/ticket/5005">#5005</a> : Fixed HTML errors in PHP samples.</li>
<li><a href="http://dev.ckeditor.com/ticket/5123">#5123</a> : Fixed broken XHTML in User Interface Languages sample.</li>
<li><a href="http://dev.ckeditor.com/ticket/4893">#4893</a> : Editor now understands table cell inline styles.</li>
<li><a href="http://dev.ckeditor.com/ticket/4611">#4611</a> : Selection around <select> in editor doesn't cause error anymore.</li>
<li><a href="http://dev.ckeditor.com/ticket/4886">#4886</a> : Extra BR tags were being created in the output HTML.</li>
<li><a href="http://dev.ckeditor.com/ticket/4933">#4933</a> : Empty tags with BR were being left in the DOM.</li>
<li><a href="http://dev.ckeditor.com/ticket/5127">#5127</a> : There were errors when removing dialog definition pages through code.</li>
<li><a href="http://dev.ckeditor.com/ticket/4767">#4767</a> : CKEditor was not working when ckeditor_source.js is loaded in the <body> .</li>
<li><a href="http://dev.ckeditor.com/ticket/5062">#5062</a> : Avoided security warning message when loading the wysiwyg area in IE6 under HTTPS.</li>
<li><a href="http://dev.ckeditor.com/ticket/5135">#5135</a> : The TAB key will now behave properly when in Source mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4988">#4988</a> : It wasn't possible to use forcePasteAsPlainText with Safari on Mac.</li>
<li><a href="http://dev.ckeditor.com/ticket/5095">#5095</a> : Safari on Mac deleted the current selection in the editor when Edit menu was clicked.</li>
<li><a href="http://dev.ckeditor.com/ticket/5140">#5140</a> : In High Contrast mode, arrows were now been displayed for menus with submenus.</li>
<li><a href="http://dev.ckeditor.com/ticket/5163">#5163</a> : The undo system was not working on some specific cases.</li>
<li><a href="http://dev.ckeditor.com/ticket/5162">#5162</a> : The ajax sample was throwing errors when loading data.</li>
<li><a href="http://dev.ckeditor.com/ticket/4999">#4999</a> : The Template dialog was not generating an undo snapshot.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/5006">#5006</a> : Dutch;</li>
<li><a href="http://dev.ckeditor.com/ticket/5039">#5039</a> : Finnish;</li>
<li><a href="http://dev.ckeditor.com/ticket/5148">#5148</a> : Hebrew;</li>
<li><a href="http://dev.ckeditor.com/ticket/5071">#5071</a> : Russian;</li>
<li><a href="http://dev.ckeditor.com/ticket/5147">#5147</a> : Spanish;</li>
</ul></li>
</ul>
<h3>
CKEditor 3.1</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4067">#4067</a> : Introduced the full page editing support (from <html> to </html>).</li>
<li><a href="http://dev.ckeditor.com/ticket/4228">#4228</a> : Introduced the Shared Spaces feature.</li>
<li><a href="http://dev.ckeditor.com/ticket/4379">#4379</a> : Introduced the new powerful pasting system and word cleanup procedure, including enhancements to the paste as plain text feature.</li>
<li><a href="http://dev.ckeditor.com/ticket/2872">#2872</a> : Introduced the new native PHP API, the first standardized server side support.</li>
<li><a href="http://dev.ckeditor.com/ticket/4210">#4210</a> : Added CKEditor plugin for jQuery.</li>
<li><a href="http://dev.ckeditor.com/ticket/2885">#2885</a> : Added 'div' dialog and corresponding context menu options.</li>
<li><a href="http://dev.ckeditor.com/ticket/4574">#4574</a> : Added the table merging tools and corresponding context menu options.</li>
<li><a href="http://dev.ckeditor.com/ticket/4340">#4340</a> : Added the email protection option for link dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4463">#4463</a> : Added inline CSS support in all places where custom stylesheet could apply.</li>
<li><a href="http://dev.ckeditor.com/ticket/3881">#3881</a> : Added color dialog for 'more color' option in color buttons.</li>
<li><a href="http://dev.ckeditor.com/ticket/4341">#4341</a> : Added the 'showborder' plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/4549">#4549</a> : Make the anti-cache query string configurable.</li>
<li><a href="http://dev.ckeditor.com/ticket/4708">#4708</a> : Added the 'htmlEncodeOutput' config option.</li>
<li><a href="http://dev.ckeditor.com/ticket/4342">#4342</a> : Introduced the bodyId and bodyClass settings to specify the id and class. to be used in the editing area at runtime.</li>
<li><a href="http://dev.ckeditor.com/ticket/3401">#3401</a> : Introduced the baseHref setting so it's possible to set the URL to be used to resolve absolute and relative URLs in the contents.</li>
<li><a href="http://dev.ckeditor.com/ticket/4729">#4729</a> : Added support to fake elements for comments.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4707">#4707</a> : Fixed invalid link is requested in image preview.</li>
<li><a href="http://dev.ckeditor.com/ticket/4461">#4461</a> : Fixed toolbar separator line along side combo enlarging the toolbar height.</li>
<li><a href="http://dev.ckeditor.com/ticket/4596">#4596</a> : Fixed image re-size lock buttons aren't accessible in high-contrast mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4676">#4676</a> : Fixed editing tables using table properties dialog overwrites original style values.</li>
<li><a href="http://dev.ckeditor.com/ticket/4714">#4714</a> : Fixed IE6 JavaScript error when editing flash by commit 'Flash' dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/3905">#3905</a> : Fixed 'wysiwyg' mode causes unauthenticated content warnings over SSL in FF 3.5.</li>
<li><a href="http://dev.ckeditor.com/ticket/4768">#4768</a> : Fixed open context menu in IE throws js error when focus is not inside document.</li>
<li><a href="http://dev.ckeditor.com/ticket/4822">#4822</a> : Fixed applying 'Headers' to existing table does not work in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/4855">#4855</a> : Fixed toolbar doesn't wrap well for 'v2' skin in all browsers.</li>
<li><a href="http://dev.ckeditor.com/ticket/4882">#4882</a> : Fixed auto detect paste from MS-Word is not working for Safari.</li>
<li><a href="http://dev.ckeditor.com/ticket/4882">#4882</a> : Fixed unexpected margin style left behind on content cleaning up from MS-Word.</li>
<li><a href="http://dev.ckeditor.com/ticket/4896">#4896</a> : Fixed paste nested list from MS-Word with measurement units set to cm is broken.</li>
<li><a href="http://dev.ckeditor.com/ticket/4899">#4899</a> : Fixed unable to undo pre-formatted style.</li>
<li><a href="http://dev.ckeditor.com/ticket/4900">#4900</a> : Fixed ratio-lock inconsistent between browsers.</li>
<li><a href="http://dev.ckeditor.com/ticket/4901">#4901</a> : Fixed unable to edit any link with popup window's features in Firefox.</li>
<li><a href="http://dev.ckeditor.com/ticket/4904">#4904</a> : Fixed when paste happen from dialog, it always throw JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4905">#4905</a> : Fixed paste plain text result incorrect when content from dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4889">#4889</a> : Fixed unable to undo 'New Page' command after typing inside editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/4892">#4892</a> : Fixed table alignment style is not properly represented by the wrapping div.</li>
<li><a href="http://dev.ckeditor.com/ticket/4918">#4918</a> : Fixed switching mode when maximized is showing background page contents.</li>
</ul>
<h3>
CKEditor 3.0.2</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4343">#4343</a> : Added the configuration option 'browserContextMenuOnCtrl' so it's possible to enable the default browser context menu by holding the CTRL key.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4552">#4552</a> : Fixed float panel doesn't show up since editor instanced been destroyed once.</li>
<li><a href="http://dev.ckeditor.com/ticket/3918">#3918</a> : Fixed fake object is editable with Image dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4053">#4053</a> : Fixed 'Form Properties' missing from context menu when selection collapsed inside form.</li>
<li><a href="http://dev.ckeditor.com/ticket/4401">#4401</a> : Fixed customized by removing 'upload' tab page from 'Link dialog' cause JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4477">#4477</a> : Adding missing tag names in object style elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/4567">#4567</a> : Fixed IE throw error when pressing BACKSPACE in source mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4573">#4573</a> : Fixed 'IgnoreEmptyPargraph' config doesn't work with the config 'entities' is set to 'false'.</li>
<li><a href="http://dev.ckeditor.com/ticket/4614">#4614</a> : Fixed attribute protection fails because of line-break.</li>
<li><a href="http://dev.ckeditor.com/ticket/4546">#4546</a> : Fixed UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.</li>
<li><a href="http://dev.ckeditor.com/ticket/4609">#4609</a> : Fixed flash object is lost when loading data from outside editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/4625">#4625</a> : Fixed editor stays visible in a div with style 'visibility:hidden'.</li>
<li><a href="http://dev.ckeditor.com/ticket/4621">#4621</a> : Fixed clicking below table caused an empty table been generated.</li>
<li><a href="http://dev.ckeditor.com/ticket/3373">#3373</a> : Fixed empty context menu when there's no menu item at all.</li>
<li><a href="http://dev.ckeditor.com/ticket/4473">#4473</a> : Fixed setting rules on the same element tag name throws error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4514">#4514</a> : Fixed press 'Back' button breaks wysiwyg editing mode is Firefox.</li>
<li><a href="http://dev.ckeditor.com/ticket/4542">#4542</a> : Fixed unable to access buttons using tab key in Safari and Opera.</li>
<li><a href="http://dev.ckeditor.com/ticket/4577">#4577</a> : Fixed relative link url is broken after opening 'Link' dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4597">#4597</a> : Fixed custom style with same attribute name but different attribute value doesn't work.</li>
<li><a href="http://dev.ckeditor.com/ticket/4651">#4651</a> : Fixed 'Deleted' and 'Inserted' text style is not rendering in wysiwyg mode and is wrong is source mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4654">#4654</a> : Fixed 'CKEDITOR.config.font_defaultLabel(fontSize_defaultLabel)' is not working.</li>
<li><a href="http://dev.ckeditor.com/ticket/3950">#3950</a> : Fixed table column insertion incorrect when selecting empty cell area.</li>
<li><a href="http://dev.ckeditor.com/ticket/3912">#3912</a> : Fixed UIColor not working in IE when page has more than 30+ editors.</li>
<li><a href="http://dev.ckeditor.com/ticket/4031">#4031</a> : Fixed mouse cursor on toolbar combo has more than 3 shapes.</li>
<li><a href="http://dev.ckeditor.com/ticket/4041">#4041</a> : Fixed open context menu on multiple cells to remove them result in only one removed.</li>
<li><a href="http://dev.ckeditor.com/ticket/4185">#4185</a> : Fixed resize handler effect doesn't affect flash object on output.</li>
<li><a href="http://dev.ckeditor.com/ticket/4196">#4196</a> : Fixed 'Remove Numbered/Bulleted List' on nested list doesn't work well on nested list.</li>
<li><a href="http://dev.ckeditor.com/ticket/4200">#4200</a> : Fixed unable to insert 'password' type filed with attributes.</li>
<li><a href="http://dev.ckeditor.com/ticket/4530">#4530</a> : Fixed context menu couldn't open in Opera.</li>
<li><a href="http://dev.ckeditor.com/ticket/4536">#4536</a> : Fixed keyboard navigation doesn't work at all in IE quirks mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4584">#4584</a> : Fixed updated link Target field is not updating when updating to certain values.</li>
<li><a href="http://dev.ckeditor.com/ticket/4603">#4603</a> : Fixed unable to disable submenu items in contextmenu.</li>
<li><a href="http://dev.ckeditor.com/ticket/4672">#4672</a> : Fixed unable to redo the insertion of horizontal line.</li>
<li><a href="http://dev.ckeditor.com/ticket/4677">#4677</a> : Fixed 'Tab' key is trapped by hidden dialog elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/4073">#4073</a> : Fixed insert template with replace option could result in empty document.</li>
<li><a href="http://dev.ckeditor.com/ticket/4455">#4455</a> : Fixed unable to start editing when image inside document not loaded.</li>
<li><a href="http://dev.ckeditor.com/ticket/4517">#4517</a> : Fixed 'dialog_backgroundCoverColor' doesn't work on IE6.</li>
<li><a href="http://dev.ckeditor.com/ticket/3165">#3165</a> : Fixed enter key in empty list item before nested one result in collapsed line.</li>
<li><a href="http://dev.ckeditor.com/ticket/4527">#4527</a> : Fixed checkbox generate invalid 'checked' attribute.</li>
<li><a href="http://dev.ckeditor.com/ticket/1659">#1659</a> : Fixed unable to click below content to start editing in IE with 'config.docType' setting to standard compliant.</li>
<li><a href="http://dev.ckeditor.com/ticket/3933">#3933</a> : Fixed extra <br> left at the end of document when the last element is a table.</li>
<li><a href="http://dev.ckeditor.com/ticket/4736">#4736</a> : Fixed PAGE UP and PAGE DOWN keys in standards mode are not working.</li>
<li><a href="http://dev.ckeditor.com/ticket/4725">#4725</a> : Fixed hitting 'enter' before html comment node produces a JavaScript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4522">#4522</a> : Fixed unable to redo when typing after insert an image with relative url.</li>
<li><a href="http://dev.ckeditor.com/ticket/4594">#4594</a> : Fixed context menu goes off-screen when mouse is at right had side of screen.</li>
<li><a href="http://dev.ckeditor.com/ticket/4673">#4673</a> : Fixed undo not available straight away if shift key is used to enter first character.</li>
<li><a href="http://dev.ckeditor.com/ticket/4690">#4690</a> : Fixed the parsing of nested inline elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/4450">#4450</a> : Fixed selecting multiple table cells before apply justify commands generates spurious paragraph in Firefox.</li>
<li><a href="http://dev.ckeditor.com/ticket/4733">#4733</a> : Fixed dialog opening sometimes hang up Firefox and Safari.</li>
<li><a href="http://dev.ckeditor.com/ticket/4498">#4498</a> : Fixed toolbar collapse button missing tooltip.</li>
<li><a href="http://dev.ckeditor.com/ticket/4738">#4738</a> : Fixed inserting table inside bold/italic/underline generates error on ENTER_BR mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/4246">#4246</a> : Fixed avoid XHTML deprecated attributes for image styling.</li>
<li><a href="http://dev.ckeditor.com/ticket/4543">#4543</a> : Fixed unable to move cursor between table and hr.</li>
<li><a href="http://dev.ckeditor.com/ticket/4764">#4764</a> : Fixed wrong exception message when CKEDITOR.editor.append() to non-existing elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/4521">#4521</a> : Fixed dialog layout in IE6/7 may have scroll-bar and other weird effects.</li>
<li><a href="http://dev.ckeditor.com/ticket/4709">#4709</a> : Fixed inconsistent scroll-bar behavior on IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/4776">#4776</a> : Fixed preview page failed to open when relative URl contains in document.</li>
<li><a href="http://dev.ckeditor.com/ticket/4812">#4812</a> : Fixed 'Esc' key not working on dialogs in Opera.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/4346">#4346</a> : Dutch;</li>
<li><a href="http://dev.ckeditor.com/ticket/4837">#4837</a> : Finnish;</li>
<li><a href="http://dev.ckeditor.com/ticket/4371">#4371</a> : Hebrew;</li>
<li><a href="http://dev.ckeditor.com/ticket/4371">#4607</a> <a href="http://dev.ckeditor.com/ticket/4713">#4713</a> : Japanese;</li>
<li><a href="http://dev.ckeditor.com/ticket/4660">#4660</a> : Norwegian.</li>
</ul></li>
</ul>
<h3>
CKEditor 3.0.1</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/4219">#4219</a> : Added fallback mechanism for config.language.</li>
<li><a href="http://dev.ckeditor.com/ticket/4194">#4194</a> : Added support for using multiple css style sheets within the editor.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/3898">#3898</a> : Added validation for URL value in Image dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/3528">#3528</a> : Fixed Context Menu issue when triggered using Shift+F10.</li>
<li><a href="http://dev.ckeditor.com/ticket/4028">#4028</a> : Maximize control's tool tip was wrong once it is maximized.</li>
<li><a href="http://dev.ckeditor.com/ticket/4237">#4237</a> : Toolbar is chopped off in Safari browser 3.x.</li>
<li><a href="http://dev.ckeditor.com/ticket/4241">#4241</a> : Float panels are left on screen while editor is destroyed.</li>
<li><a href="http://dev.ckeditor.com/ticket/4274">#4274</a> : Double click event is incorrect handled in 'divreplace' sample.</li>
<li><a href="http://dev.ckeditor.com/ticket/4354">#4354</a> : Fixed TAB key on toolbar to not focus disabled buttons.</li>
<li><a href="http://dev.ckeditor.com/ticket/3856">#3856</a> : Fixed focus and blur events in source view mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/3438">#3438</a> : Floating panels are off by (-1px, 0px) in RTL mode.</li>
<li><a href="http://dev.ckeditor.com/ticket/3370">#3370</a> : Refactored use of CKEDITOR.env.isCustomDomain().</li>
<li><a href="http://dev.ckeditor.com/ticket/4230">#4230</a> : HC detection caused js error.</li>
<li><a href="http://dev.ckeditor.com/ticket/3978">#3978</a> : Fixed setStyle float on IE7 strict.</li>
<li><a href="http://dev.ckeditor.com/ticket/4262">#4262</a> : Tab and Shift+Tab was not working to cycle through CTRL+SHIFT+F10 context menu in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/3633">#3633</a> : Default context menu isn't disabled in toolbar, status bar, panels...</li>
<li><a href="http://dev.ckeditor.com/ticket/3897">#3897</a> : Now there is no image previews when the URL is empty in image dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4048">#4048</a> : Context submenu was lacking uiColor.</li>
<li><a href="http://dev.ckeditor.com/ticket/3568">#3568</a> : Dialogs now select all text when tabbing to text inputs.</li>
<li><a href="http://dev.ckeditor.com/ticket/3727">#3727</a> : Cell Properties dialog was missing color selection option.</li>
<li><a href="http://dev.ckeditor.com/ticket/3517">#3517</a> : Fixed "Match cyclic" field in Find & Replace dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4368">#4368</a> : borderColor table cell attribute haven't worked for none-IE</li>
<li><a href="http://dev.ckeditor.com/ticket/4203">#4203</a> : In IE quirks mode + toolbar collapsed + source mode editing block height was incorrect.</li>
<li><a href="http://dev.ckeditor.com/ticket/4387">#4387</a> : Fixed: right clicking in Kama skin can lead to a javascript error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4397">#4397</a> : Wysiwyg mode caused the host page scroll.</li>
<li><a href="http://dev.ckeditor.com/ticket/4385">#4385</a> : Fixed editor's auto adjusting on DOM structure were confusing the dirty checking mechanism.</li>
<li><a href="http://dev.ckeditor.com/ticket/4397">#4397</a> : Fixed regression of [3816] where turn on design mode was causing Firefox3 to scroll the host page.</li>
<li><a href="http://dev.ckeditor.com/ticket/4254">#4254</a> : Added basic API sample.</li>
<li><a href="http://dev.ckeditor.com/ticket/4107">#4107</a> : Normalize css font-family style text for correct comparision.</li>
<li><a href="http://dev.ckeditor.com/ticket/3664">#3664</a> : Insert block element in empty editor document should not create new paragraph.</li>
<li><a href="http://dev.ckeditor.com/ticket/4037">#4037</a> : 'id' attribute is missing with Flash dialog advanced page.</li>
<li><a href="http://dev.ckeditor.com/ticket/4047">#4047</a> : Delete selected control type element when 'Backspace' is pressed on it.</li>
<li><a href="http://dev.ckeditor.com/ticket/4191">#4191</a> : Fixed: dialog changes confirmation on image dialog appeared even when no changes have been made.</li>
<li><a href="http://dev.ckeditor.com/ticket/4351">#4351</a> : Dash and dot could appear in attribute names.</li>
<li><a href="http://dev.ckeditor.com/ticket/4355">#4355</a> : 'maximize' and 'showblock' commands shouldn't take editor focus.</li>
<li><a href="http://dev.ckeditor.com/ticket/4504">#4504</a> : Fixed 'Enter'/'Esc' key is not working on dialog button.</li>
<li><a href="http://dev.ckeditor.com/ticket/4245">#4245</a> : 'Strange Template' now come with a style attribute for width.</li>
<li><a href="http://dev.ckeditor.com/ticket/4512">#4512</a> : Fixed styles plugin incorrectly adding semicolons to style text.</li>
<li><a href="http://dev.ckeditor.com/ticket/3855">#3855</a> : Fixed loading unminified _source files when ckeditor_source.js is used.</li>
<li><a href="http://dev.ckeditor.com/ticket/3717">#3717</a> : Dialog settings defaults can now be overridden in-page through the CKEDITOR.config object.</li>
<li><a href="http://dev.ckeditor.com/ticket/4481">#4481</a> : The 'stylesCombo_stylesSet' configuration entry didn't work for full URLs.</li>
<li><a href="http://dev.ckeditor.com/ticket/4480">#4480</a> : Fixed scope attribute in th.</li>
<li><a href="http://dev.ckeditor.com/ticket/4467">#4467</a> : Fixed bug to use custom icon in context menus. Thanks to george.</li>
<li><a href="http://dev.ckeditor.com/ticket/4190">#4190</a> : Fixed select field dialog layout in Safari.</li>
<li><a href="http://dev.ckeditor.com/ticket/4518">#4518</a> : Fixed unable to open dialog without editor focus in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/4519">#4519</a> : Fixed maximize without editor focus throw error in IE.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/3947">#3947</a> : Arabic;</li>
<li><a href="http://dev.ckeditor.com/ticket/4466">#4466</a> : Czech;</li>
<li><a href="http://dev.ckeditor.com/ticket/4363">#4363</a> : Danish;</li>
<li><a href="http://dev.ckeditor.com/ticket/4346">#4346</a> : Dutch;</li>
<li><a href="http://dev.ckeditor.com/ticket/4371">#4371</a> <a href="http://dev.ckeditor.com/ticket/4456">#4456</a> : Hebrew;</li>
<li><a href="http://dev.ckeditor.com/ticket/4382">#4382</a> : Polish.</li>
</ul></li>
</ul>
<h3>
CKEditor 3.0</h3>
<p>
New features:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/3188">#3188</a> : Introduce
<pre> formatting feature when converting from other blocks.</li>
<li><a href="http://dev.ckeditor.com/ticket/4445">#4445</a> : editor::setData now support an optional callback parameter.</li>
</ul>
<p>
Fixed issues:</p>
<ul>
<li><a href="http://dev.ckeditor.com/ticket/2856">#2856</a> : Fixed problem with inches in Paste From Word plugin.</li>
<li><a href="http://dev.ckeditor.com/ticket/3929">#3929</a> : Using Paste dialog,
the text is pasted into current selection</li>
<li><a href="http://dev.ckeditor.com/ticket/3920">#3920</a> : Mouse cursor over characters in
Special Character dialog now is correct</li>
<li><a href="http://dev.ckeditor.com/ticket/3882">#3882</a> : Fixed an issue
with PasteFromWord dialog in which default values was ignored</li>
<li><a href="http://dev.ckeditor.com/ticket/3859">#3859</a> : Fixed Flash dialog layout in Webkit</li>
<li><a href="http://dev.ckeditor.com/ticket/3852">#3852</a> : Disabled textarea resizing in dialogs</li>
<li><a href="http://dev.ckeditor.com/ticket/3831">#3831</a> : The attempt to remove the contextmenu plugin
will not anymore break the editor</li>
<li><a href="http://dev.ckeditor.com/ticket/3781">#3781</a> : Colorbutton is now disabled in 'source' mode</li>
<li><a href="http://dev.ckeditor.com/ticket/3848">#3848</a> : Fixed an issue with Webkit in witch
elements in the Image and Link dialogs had wrong dimensions.</li>
<li><a href="http://dev.ckeditor.com/ticket/3808">#3808</a> : Fixed UI Color Picker dialog size in example page.</li>
<li><a href="http://dev.ckeditor.com/ticket/3658">#3658</a> : Editor had horizontal scrollbar in IE6.</li>
<li><a href="http://dev.ckeditor.com/ticket/3819">#3819</a> : The cursor was not visible
when applying style to collapsed selections in Firefox 2.</li>
<li><a href="http://dev.ckeditor.com/ticket/3809">#3809</a> : Fixed beam cursor
when mouse cursor is over text-only buttons in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/3815">#3815</a> : Fixed an issue
with the form dialog in which the "enctype" attribute is outputted as "encoding".</li>
<li><a href="http://dev.ckeditor.com/ticket/3785">#3785</a> : Fixed an issue
in CKEDITOR.tools.htmlEncode() which incorrectly outputs &nbsp; in IE8.</li>
<li><a href="http://dev.ckeditor.com/ticket/3820">#3820</a> : Fixed an issue in
bullet list command in which a list created at the bottom of another gets merged to the top.
</li>
<li><a href="http://dev.ckeditor.com/ticket/3830">#3830</a> : Table cell properties dialog
doesn't apply to all selected cells.</li>
<li><a href="http://dev.ckeditor.com/ticket/3835">#3835</a> : Element path is not refreshed
after click on 'newpage'; and safari is not putting focus on document also.
</li>
<li><a href="http://dev.ckeditor.com/ticket/3821">#3821</a> : Fixed an issue with JAWS in which
toolbar items are read inconsistently between virtual cursor modes.</li>
<li><a href="http://dev.ckeditor.com/ticket/3789">#3789</a> : The "src" attribute
was getting duplicated in some situations.</li>
<li><a href="http://dev.ckeditor.com/ticket/3591">#3591</a> : Protecting flash related elements
including '<object>', '<embed>' and '<param>'.
</li>
<li><a href="http://dev.ckeditor.com/ticket/3759">#3759</a> : Fixed CKEDITOR.dom.element::scrollIntoView
logic bug which scroll even element is inside viewport.
</li>
<li><a href="http://dev.ckeditor.com/ticket/3773">#3773</a> : Fixed remove list will merge lines.
</li>
<li><a href="http://dev.ckeditor.com/ticket/3829">#3829</a> : Fixed remove empty link on output data.</li>
<li><a href="http://dev.ckeditor.com/ticket/3730">#3730</a> : Indent is performing on the whole
block instead of selected lines in enterMode = BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/3844">#3844</a> : Fixed UndoManager register keydown on obsoleted document</li>
<li><a href="http://dev.ckeditor.com/ticket/3805">#3805</a> : Enabled SCAYT plugin for IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/3834">#3834</a> : Context menu on table caption was incorrect.</li>
<li><a href="http://dev.ckeditor.com/ticket/3812">#3812</a> : Fixed an issue in which the editor
may show up empty or uneditable in IE7, 8 and Firefox 3.</li>
<li><a href="http://dev.ckeditor.com/ticket/3825">#3825</a> : Fixed JS error when opening spellingcheck.</li>
<li><a href="http://dev.ckeditor.com/ticket/3862">#3862</a> : Fixed html parser infinite loop on certain malformed
source code.</li>
<li><a href="http://dev.ckeditor.com/ticket/3639">#3639</a> : Button size was inconsistent.</li>
<li><a href="http://dev.ckeditor.com/ticket/3874">#3874</a> : Paste as plain text in Safari loosing lines.</li>
<li><a href="http://dev.ckeditor.com/ticket/3849">#3849</a> : Fixed IE8 crashes when applying lists and indenting.</li>
<li><a href="http://dev.ckeditor.com/ticket/3876">#3876</a> : Changed dialog checkbox and radio labels to explicit labels.</li>
<li><a href="http://dev.ckeditor.com/ticket/3843">#3843</a> : Fixed context submenu position in IE 6 & 7 RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/3864">#3864</a> : [FF]Document is not editable after inserting element on a fresh page.</li>
<li><a href="http://dev.ckeditor.com/ticket/3883">#3883</a> : Fixed removing inline style logic incorrect on Firefox2.</li>
<li><a href="http://dev.ckeditor.com/ticket/3884">#3884</a> : Empty "href" attribute was duplicated on output data.</li>
<li><a href="http://dev.ckeditor.com/ticket/3858">#3858</a> : Fixed the issue where toolbars
break up in IE6 and IE7 after the browser is resized.</li>
<li><a href="http://dev.ckeditor.com/ticket/3868">#3868</a> : [chrome] SCAYT toolbar options was in reversed order.</li>
<li><a href="http://dev.ckeditor.com/ticket/3875">#3875</a> : Fixed an issue in Safari where
table row/column/cell menus are not useable when table cells are selected.</li>
<li><a href="http://dev.ckeditor.com/ticket/3896">#3896</a> : The editing area was
flashing when switching forth and back to source view.</li>
<li><a href="http://dev.ckeditor.com/ticket/3894">#3894</a> : Fixed an issue where editor failed to initialize when using the on-demand loading way.</li>
<li><a href="http://dev.ckeditor.com/ticket/3903">#3903</a> : Color button plugin doesn't read config entry from editor instance correctly.</li>
<li><a href="http://dev.ckeditor.com/ticket/3801">#3801</a> : Comments at the start of the document was lost in IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/3871">#3871</a> : Unable to redo when undos to the front of snapshots stack.</li>
<li><a href="http://dev.ckeditor.com/ticket/3909">#3909</a> : Move focus from editor into a text input control is broken.</li>
<li><a href="http://dev.ckeditor.com/ticket/3870">#3870</a> : The empty paragraph
desappears when hitting ENTER after "New Page".</li>
<li><a href="http://dev.ckeditor.com/ticket/3887">#3887</a> : Fixed an issue in which the create
list command may leak outside of a selected table cell and into the rest of document.</li>
<li><a href="http://dev.ckeditor.com/ticket/3916">#3916</a> : Fixed maximize does not enlarge editor width when width is set.</li>
<li><a href="http://dev.ckeditor.com/ticket/3879">#3879</a> : [webkit] Color button panel had incorrect size on first open.</li>
<li><a href="http://dev.ckeditor.com/ticket/3839">#3839</a> : Update Scayt plugin to reflect the latest change from SpellChecker.net.</li>
<li><a href="http://dev.ckeditor.com/ticket/3742">#3742</a> : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .</li>
<li><a href="http://dev.ckeditor.com/ticket/3671">#3671</a> : Fixed body fixing should be applied to the real type under fake elements.</li>
<li><a href="http://dev.ckeditor.com/ticket/3836">#3836</a> : Fixed remove list in enterMode=BR will merge sibling text to one line.</li>
<li><a href="http://dev.ckeditor.com/ticket/3949">#3949</a> : Fixed enterKey within pre-formatted text introduce wrong line-break.</li>
<li><a href="http://dev.ckeditor.com/ticket/3878">#3878</a> : Whenever possible,
dialogs will not present scrollbars if the content is too big for its standard
size.</li>
<li><a href="http://dev.ckeditor.com/ticket/3782">#3782</a> : Remove empty list in table cell result in collapsed cell.</li>
<li>Updated the following language files:<ul>
<li><a href="http://dev.ckeditor.com/ticket/4183">#4183</a> : Basque;</li>
<li><a href="http://dev.ckeditor.com/ticket/3837">#3837</a> : Brazilian Portuguese;</li>
<li><a href="http://dev.ckeditor.com/ticket/4171">#4171</a> : Catalan;</li>
<li><a href="http://dev.ckeditor.com/ticket/4115">#4115</a> : Chinese (Simplified);</li>
<li><a href="http://dev.ckeditor.com/ticket/4179">#4179</a> : Chinese (Traditional);</li>
<li><a href="http://dev.ckeditor.com/ticket/4102">#4102</a> : Croatian;</li>
<li><a href="http://dev.ckeditor.com/ticket/4105">#4105</a> : French;</li>
<li><a href="http://dev.ckeditor.com/ticket/4104">#4104</a> : German;</li>
<li><a href="http://dev.ckeditor.com/ticket/4116">#4116</a> : Italian;</li>
<li><a href="http://dev.ckeditor.com/ticket/4091">#4091</a> : Japanese;</li>
<li><a href="http://dev.ckeditor.com/ticket/4120">#4120</a> : Polish;</li>
<li><a href="http://dev.ckeditor.com/ticket/3987">#3987</a> : Spanish;</li>
<li><a href="http://dev.ckeditor.com/ticket/4089">#4089</a> : Ukrainian;</li>
<li><a href="http://dev.ckeditor.com/ticket/4166">#4166</a> : Vietnamese.</li>
</ul></li>
<li><a href="http://dev.ckeditor.com/ticket/3984">#3984</a> : [IE]The pre-formatted style is generating error.</li>
<li><a href="http://dev.ckeditor.com/ticket/3946">#3946</a> : Fixed unable to hide contextmenu.</li>
<li><a href="http://dev.ckeditor.com/ticket/3956">#3956</a> : Fixed About dialog in Source Mode for IE.</li>
<li><a href="http://dev.ckeditor.com/ticket/3953">#3953</a> : Fixed keystroke for close Paste dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/3951">#3951</a> : Reset size and lock ratio options were not accessible in Image dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/3921">#3921</a> : Fixed Container scroll issue on IE7.</li>
<li><a href="http://dev.ckeditor.com/ticket/3940">#3940</a> : Fixed list operation doesn't stop at table.</li>
<li><a href="http://dev.ckeditor.com/ticket/3891">#3891</a> : [IE] Fixed 'automatic' font color doesn't work.</li>
<li><a href="http://dev.ckeditor.com/ticket/3972">#3972</a> : Fixed unable to remove a single empty list in document in Firefox with enterMode=BR.</li>
<li><a href="http://dev.ckeditor.com/ticket/3973">#3973</a> : Fixed list creation error at the end of document.</li>
<li><a href="http://dev.ckeditor.com/ticket/3959">#3959</a> : Pasting styled text from word result in content lost.</li>
<li><a href="http://dev.ckeditor.com/ticket/3793">#3793</a> : Combined images into sprites.</li>
<li><a href="http://dev.ckeditor.com/ticket/3783">#3783</a> : Fixed indenting command in table cells create collapsed paragraph.</li>
<li><a href="http://dev.ckeditor.com/ticket/3968">#3968</a> : About dialog layout was broken with IE+Standards+RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/3991">#3991</a> : In IE quirks, text was not visible in v2 and office2003 skins.</li>
<li><a href="http://dev.ckeditor.com/ticket/3983">#3983</a> : In IE, we'll now
silently ignore wrong toolbar definition settings which have extra commas being
left around.</li>
<li>Fixed the following test cases:<ul>
<li><a href="http://dev.ckeditor.com/ticket/3992">#3992</a> : core/ckeditor2.html</li>
<li><a href="http://dev.ckeditor.com/ticket/4138">#4138</a> : core/plugins.html</li>
<li><a href="http://dev.ckeditor.com/ticket/3801">#3801</a> : plugins/htmldataprocessor/htmldataprocessor.html</li>
</ul></li>
<li><a href="http://dev.ckeditor.com/ticket/3989">#3989</a> : Host page horizontal scrolling a lot when on having righ-to-left direction.</li>
<li><a href="http://dev.ckeditor.com/ticket/4001">#4001</a> : Create link around existing image result incorrect.</li>
<li><a href="http://dev.ckeditor.com/ticket/3988">#3988</a> : Destroy editor on form submit event cause error.</li>
<li><a href="http://dev.ckeditor.com/ticket/3994">#3994</a> : Insert horizontal line at end of document cause error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4074">#4074</a> : Indent error with 'indentClasses' config specified.</li>
<li><a href="http://dev.ckeditor.com/ticket/4057">#4057</a> : Fixed anchor is lost after switch between editing modes.</li>
<li><a href="http://dev.ckeditor.com/ticket/3644">#3644</a> : Image dialog was missin radio lock.</li>
<li><a href="http://dev.ckeditor.com/ticket/4014">#4014</a> : Firefox2 had no dialog button backgrounds.</li>
<li><a href="http://dev.ckeditor.com/ticket/4018">#4018</a> : Firefox2 had no richcombo text visible.</li>
<li><a href="http://dev.ckeditor.com/ticket/4035">#4035</a> : [IE6] Paste dialog size was too small.</li>
<li><a href="http://dev.ckeditor.com/ticket/4049">#4049</a> : Kama skin was too wide with config.width.</li>
<li>The following released files now doesn't require the _source folder<ul>
<li><a href="http://dev.ckeditor.com/ticket/4086">#4086</a> : _samples/ui_languages.html</li>
<li><a href="http://dev.ckeditor.com/ticket/4093">#4093</a> : _tests/core/dom/document.html</li>
<li><a href="http://dev.ckeditor.com/ticket/4094">#4094</a> : Smiley plugin file</li>
<li><a href="http://dev.ckeditor.com/ticket/4097">#4097</a> : No undo/redo support for fontColor and backgroundColor buttons.</li>
</ul></li>
<li><a href="http://dev.ckeditor.com/ticket/4085">#4085</a> : Paste and Paste from Word dialogs were not well styled in IE+RTL.</li>
<li><a href="http://dev.ckeditor.com/ticket/3982">#3982</a> : Fixed enterKey on empty list item result in weird dom structure.</li>
<li><a href="http://dev.ckeditor.com/ticket/4101">#4101</a> : Now it is possible to close dialog before gets focus.</li>
<li><a href="http://dev.ckeditor.com/ticket/4075">#4075</a> : [IE6/7]Fixed apply custom inline style with "class" attribute failed.</li>
<li><a href="http://dev.ckeditor.com/ticket/4087">#4087</a> : [Firefox]Fixed extra blocks created on create list when full document selected.</li>
<li><a href="http://dev.ckeditor.com/ticket/4097">#4097</a> : No undo/redo support for fontColor and backgroundColor buttons.</li>
<li><a href="http://dev.ckeditor.com/ticket/4111">#4111</a> : Fixed apply block style after inline style applied on full document error.</li>
<li><a href="http://dev.ckeditor.com/ticket/3622">#3622</a> : Fixed shift enter with selection not deleting highlighted text.</li>
<li><a href="http://dev.ckeditor.com/ticket/4092">#4092</a> : [IE6] Close button was missing for dialog without multiple tabs.</li>
<li><a href="http://dev.ckeditor.com/ticket/4003">#4003</a> : Markup on the image dialog was disrupted when removing the border input.</li>
<li><a href="http://dev.ckeditor.com/ticket/4096">#4096</a> : Editor content area was pushed down in IE RTL quirks.</li>
<li><a href="http://dev.ckeditor.com/ticket/4112">#4112</a> : [FF] Paste dialog had scrollbars in quirks.</li>
<li><a href="http://dev.ckeditor.com/ticket/4118">#4118</a> : Dialog dragging was
occasionally behaving strangely .</li>
<li><a href="http://dev.ckeditor.com/ticket/4077">#4077</a> : The toolbar combos
were rendering incorrectly in some languages, like Chinese.</li>
<li><a href="http://dev.ckeditor.com/ticket/3622">#3622</a> : The toolbar in the v2
skin was wrapping improperly in some languages.</li>
<li><a href="http://dev.ckeditor.com/ticket/4119">#4119</a> : Unable to edit image link with image dialog.</li>
<li><a href="http://dev.ckeditor.com/ticket/4117">#4117</a> : Fixed dialog error when transforming image into button.</li>
<li><a href="http://dev.ckeditor.com/ticket/4058">#4058</a> : [FF] wysiwyg mode is sometimes not been activated.</li>
<li><a href="http://dev.ckeditor.com/ticket/4114">#4114</a> : [IE] RTE + IE6/IE7 Quirks = dialog mispositoned.</li>
<li><a href="http://dev.ckeditor.com/ticket/4123">#4123</a> : Some dialog buttons were broken in IE7 quirks.</li>
<li><a href="http://dev.ckeditor.com/ticket/4122">#4122</a> : [IE] The image dialog
was being rendered improperly when loading an image with long URL.</li>
<li><a href="http://dev.ckeditor.com/ticket/4144">#4144</a> : Fixed the white-spaces at the end of <pre> is incorrectly removed.</li>
<li><a href="http://dev.ckeditor.com/ticket/4143">#4143</a> : Fixed element id is lost when extracting contents from the range.</li>
<li><a href="http://dev.ckeditor.com/ticket/4007">#4007</a> : [IE] Source area overflow from editor chrome.</li>
<li><a href="http://dev.ckeditor.com/ticket/4145">#4145</a> : Fixed the on demand
("basic") loading model of the editor.</li>
<li><a href="http://dev.ckeditor.com/ticket/4139">#4139</a> : Fixed list plugin regression of [3903].</li>
<li><a href="http://dev.ckeditor.com/ticket/4147">#4147</a> : Unify style text normalization logic when comparing styles.</li>
<li><a href="http://dev.ckeditor.com/ticket/4150">#4150</a> : Fixed enlarge list result incorrect at the inner boundary of block.</li>
<li><a href="http://dev.ckeditor.com/ticket/4164">#4164</a> : Now it is possible to paste text
in Source mode even if forcePasteAsPlainText = true.</li>
<li><a href="http://dev.ckeditor.com/ticket/4129">#4129</a> : [FF]Unable to remove list with Ctrl-A.</li>
<li><a href="http://dev.ckeditor.com/ticket/4172">#4172</a> : [Safari] The trailing
<br> was not been always added to blank lines ending with &nbsp;.</li>
<li><a href="http://dev.ckeditor.com/ticket/4178">#4178</a> : It's now possible to
copy and paste Flash content among different editor instances.</li>
<li><a href="http://dev.ckeditor.com/ticket/4193">#4193</a> : Automatic font color produced empty span on Firefox 3.5.</li>
<li><a href="http://dev.ckeditor.com/ticket/4186">#4186</a> : [FF] Fixed First open float panel cause host page scrollbar blinking.</li>
<li><a href="http://dev.ckeditor.com/ticket/4227">#4227</a> : Fixed destroy editor instance created on textarea which is not within form cause error.</li>
<li><a href="http://dev.ckeditor.com/ticket/4240">#4240</a> : Fixed editor name containing hyphen break editor completely.</li>
<li><a href="http://dev.ckeditor.com/ticket/3828">#3828</a> : Malformed nested list is now corrected by the parser.</li>
</ul>
<h3>
CKEditor 3.0 RC</h3>
<p>
Changelog starts at this release.</p>
<div id="footer">
<hr />
<p>
CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003-2011, <a href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/CHANGES.html | HTML | gpl3 | 123,612 |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
// Compressed version of core/ckeditor_base.js. See original for instructions.
/*jsl:ignore*/
if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.5.2',revision:'6450',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(':/')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf(':/')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();
/*jsl:end*/
// Uncomment the following line to have a new timestamp generated for each
// request, having clear cache load of the editor code.
// CKEDITOR.timestamp = ( new Date() ).valueOf();
// Set the script name to be loaded by the loader.
CKEDITOR._autoLoad = 'core/ckeditor_basic';
// Include the loader script.
document.write(
'<script type="text/javascript" src="' + CKEDITOR.getUrl( '_source/core/loader.js' ) + '"></script>' );
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/ckeditor_basic_source.js | JavaScript | gpl3 | 1,530 |
<?php
/*
* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* \brief CKEditor class that can be used to create editor
* instances in PHP pages on server side.
* @see http://ckeditor.com
*
* Sample usage:
* @code
* $CKEditor = new CKEditor();
* $CKEditor->editor("editor1", "<p>Initial value.</p>");
* @endcode
*/
class CKEditor
{
/**
* The version of %CKEditor.
*/
const version = '3.5.2';
/**
* A constant string unique for each release of %CKEditor.
*/
const timestamp = 'B1GG4Z6';
/**
* URL to the %CKEditor installation directory (absolute or relative to document root).
* If not set, CKEditor will try to guess it's path.
*
* Example usage:
* @code
* $CKEditor->basePath = '/ckeditor/';
* @endcode
*/
public $basePath;
/**
* An array that holds the global %CKEditor configuration.
* For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
*
* Example usage:
* @code
* $CKEditor->config['height'] = 400;
* // Use @@ at the beggining of a string to ouput it without surrounding quotes.
* $CKEditor->config['width'] = '@@screen.width * 0.8';
* @endcode
*/
public $config = array();
/**
* A boolean variable indicating whether CKEditor has been initialized.
* Set it to true only if you have already included
* <script> tag loading ckeditor.js in your website.
*/
public $initialized = false;
/**
* Boolean variable indicating whether created code should be printed out or returned by a function.
*
* Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function.
* @code
* $CKEditor = new CKEditor();
* $CKEditor->returnOutput = true;
* $code = $CKEditor->editor("editor1", "<p>Initial value.</p>");
* echo "<p>Editor 1:</p>";
* echo $code;
* @endcode
*/
public $returnOutput = false;
/**
* An array with textarea attributes.
*
* When %CKEditor is created with the editor() method, a HTML <textarea> element is created,
* it will be displayed to anyone with JavaScript disabled or with incompatible browser.
*/
public $textareaAttributes = array( "rows" => 8, "cols" => 60 );
/**
* A string indicating the creation date of %CKEditor.
* Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
*/
public $timestamp = "B1GG4Z6";
/**
* An array that holds event listeners.
*/
private $events = array();
/**
* An array that holds global event listeners.
*/
private $globalEvents = array();
/**
* Main Constructor.
*
* @param $basePath (string) URL to the %CKEditor installation directory (optional).
*/
function __construct($basePath = null) {
if (!empty($basePath)) {
$this->basePath = $basePath;
}
}
/**
* Creates a %CKEditor instance.
* In incompatible browsers %CKEditor will downgrade to plain HTML <textarea> element.
*
* @param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element).
* @param $value (string) Initial value (optional).
* @param $config (array) The specific configurations to apply to this editor instance (optional).
* @param $events (array) Event listeners for this editor instance (optional).
*
* Example usage:
* @code
* $CKEditor = new CKEditor();
* $CKEditor->editor("field1", "<p>Initial value.</p>");
* @endcode
*
* Advanced example:
* @code
* $CKEditor = new CKEditor();
* $config = array();
* $config['toolbar'] = array(
* array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
* array( 'Image', 'Link', 'Unlink', 'Anchor' )
* );
* $events['instanceReady'] = 'function (ev) {
* alert("Loaded: " + ev.editor.name);
* }';
* $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events);
* @endcode
*/
public function editor($name, $value = "", $config = array(), $events = array())
{
$attr = "";
foreach ($this->textareaAttributes as $key => $val) {
$attr.= " " . $key . '="' . str_replace('"', '"', $val) . '"';
}
$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
if (!$this->initialized) {
$out .= $this->init();
}
$_config = $this->configSettings($config, $events);
$js = $this->returnGlobalEvents();
if (!empty($_config))
$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
else
$js .= "CKEDITOR.replace('".$name."');";
$out .= $this->script($js);
if (!$this->returnOutput) {
print $out;
$out = "";
}
return $out;
}
/**
* Replaces a <textarea> with a %CKEditor instance.
*
* @param $id (string) The id or name of textarea element.
* @param $config (array) The specific configurations to apply to this editor instance (optional).
* @param $events (array) Event listeners for this editor instance (optional).
*
* Example 1: adding %CKEditor to <textarea name="article"></textarea> element:
* @code
* $CKEditor = new CKEditor();
* $CKEditor->replace("article");
* @endcode
*/
public function replace($id, $config = array(), $events = array())
{
$out = "";
if (!$this->initialized) {
$out .= $this->init();
}
$_config = $this->configSettings($config, $events);
$js = $this->returnGlobalEvents();
if (!empty($_config)) {
$js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");";
}
else {
$js .= "CKEDITOR.replace('".$id."');";
}
$out .= $this->script($js);
if (!$this->returnOutput) {
print $out;
$out = "";
}
return $out;
}
/**
* Replace all <textarea> elements available in the document with editor instances.
*
* @param $className (string) If set, replace all textareas with class className in the page.
*
* Example 1: replace all <textarea> elements in the page.
* @code
* $CKEditor = new CKEditor();
* $CKEditor->replaceAll();
* @endcode
*
* Example 2: replace all <textarea class="myClassName"> elements in the page.
* @code
* $CKEditor = new CKEditor();
* $CKEditor->replaceAll( 'myClassName' );
* @endcode
*/
public function replaceAll($className = null)
{
$out = "";
if (!$this->initialized) {
$out .= $this->init();
}
$_config = $this->configSettings();
$js = $this->returnGlobalEvents();
if (empty($_config)) {
if (empty($className)) {
$js .= "CKEDITOR.replaceAll();";
}
else {
$js .= "CKEDITOR.replaceAll('".$className."');";
}
}
else {
$classDetection = "";
$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
if (!empty($className)) {
$js .= " var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
$js .= " if (!classRegex.test(textarea.className))\n";
$js .= " return false;\n";
}
$js .= " CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
$js .= "} );";
}
$out .= $this->script($js);
if (!$this->returnOutput) {
print $out;
$out = "";
}
return $out;
}
/**
* Adds event listener.
* Events are fired by %CKEditor in various situations.
*
* @param $event (string) Event name.
* @param $javascriptCode (string) Javascript anonymous function or function name.
*
* Example usage:
* @code
* $CKEditor->addEventHandler('instanceReady', 'function (ev) {
* alert("Loaded: " + ev.editor.name);
* }');
* @endcode
*/
public function addEventHandler($event, $javascriptCode)
{
if (!isset($this->events[$event])) {
$this->events[$event] = array();
}
// Avoid duplicates.
if (!in_array($javascriptCode, $this->events[$event])) {
$this->events[$event][] = $javascriptCode;
}
}
/**
* Clear registered event handlers.
* Note: this function will have no effect on already created editor instances.
*
* @param $event (string) Event name, if not set all event handlers will be removed (optional).
*/
public function clearEventHandlers($event = null)
{
if (!empty($event)) {
$this->events[$event] = array();
}
else {
$this->events = array();
}
}
/**
* Adds global event listener.
*
* @param $event (string) Event name.
* @param $javascriptCode (string) Javascript anonymous function or function name.
*
* Example usage:
* @code
* $CKEditor->addGlobalEventHandler('dialogDefinition', 'function (ev) {
* alert("Loading dialog: " + ev.data.name);
* }');
* @endcode
*/
public function addGlobalEventHandler($event, $javascriptCode)
{
if (!isset($this->globalEvents[$event])) {
$this->globalEvents[$event] = array();
}
// Avoid duplicates.
if (!in_array($javascriptCode, $this->globalEvents[$event])) {
$this->globalEvents[$event][] = $javascriptCode;
}
}
/**
* Clear registered global event handlers.
* Note: this function will have no effect if the event handler has been already printed/returned.
*
* @param $event (string) Event name, if not set all event handlers will be removed (optional).
*/
public function clearGlobalEventHandlers($event = null)
{
if (!empty($event)) {
$this->globalEvents[$event] = array();
}
else {
$this->globalEvents = array();
}
}
/**
* Prints javascript code.
*
* @param string $js
*/
private function script($js)
{
$out = "<script type=\"text/javascript\">";
$out .= "//<![CDATA[\n";
$out .= $js;
$out .= "\n//]]>";
$out .= "</script>\n";
return $out;
}
/**
* Returns the configuration array (global and instance specific settings are merged into one array).
*
* @param $config (array) The specific configurations to apply to editor instance.
* @param $events (array) Event listeners for editor instance.
*/
private function configSettings($config = array(), $events = array())
{
$_config = $this->config;
$_events = $this->events;
if (is_array($config) && !empty($config)) {
$_config = array_merge($_config, $config);
}
if (is_array($events) && !empty($events)) {
foreach ($events as $eventName => $code) {
if (!isset($_events[$eventName])) {
$_events[$eventName] = array();
}
if (!in_array($code, $_events[$eventName])) {
$_events[$eventName][] = $code;
}
}
}
if (!empty($_events)) {
foreach($_events as $eventName => $handlers) {
if (empty($handlers)) {
continue;
}
else if (count($handlers) == 1) {
$_config['on'][$eventName] = '@@'.$handlers[0];
}
else {
$_config['on'][$eventName] = '@@function (ev){';
foreach ($handlers as $handler => $code) {
$_config['on'][$eventName] .= '('.$code.')(ev);';
}
$_config['on'][$eventName] .= '}';
}
}
}
return $_config;
}
/**
* Return global event handlers.
*/
private function returnGlobalEvents()
{
static $returnedEvents;
$out = "";
if (!isset($returnedEvents)) {
$returnedEvents = array();
}
if (!empty($this->globalEvents)) {
foreach ($this->globalEvents as $eventName => $handlers) {
foreach ($handlers as $handler => $code) {
if (!isset($returnedEvents[$eventName])) {
$returnedEvents[$eventName] = array();
}
// Return only new events
if (!in_array($code, $returnedEvents[$eventName])) {
$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
$returnedEvents[$eventName][] = $code;
}
}
}
}
return $out;
}
/**
* Initializes CKEditor (executed only once).
*/
private function init()
{
static $initComplete;
$out = "";
if (!empty($initComplete)) {
return "";
}
if ($this->initialized) {
$initComplete = true;
return "";
}
$args = "";
$ckeditorPath = $this->ckeditorPath();
if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") {
$args = '?t=' . $this->timestamp;
}
// Skip relative paths...
if (strpos($ckeditorPath, '..') !== 0) {
$out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
}
$out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
$extraCode = "";
if ($this->timestamp != self::timestamp) {
$extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
}
if ($extraCode) {
$out .= $this->script($extraCode);
}
$initComplete = $this->initialized = true;
return $out;
}
/**
* Return path to ckeditor.js.
*/
private function ckeditorPath()
{
if (!empty($this->basePath)) {
return $this->basePath;
}
/**
* The absolute pathname of the currently executing script.
* Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,
* $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.
*/
if (isset($_SERVER['SCRIPT_FILENAME'])) {
$realPath = dirname($_SERVER['SCRIPT_FILENAME']);
}
else {
/**
* realpath - Returns canonicalized absolute pathname
*/
$realPath = realpath( './' ) ;
}
/**
* The filename of the currently executing script, relative to the document root.
* For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar
* would be /test.php/foo.bar.
*/
$selfPath = dirname($_SERVER['PHP_SELF']);
$file = str_replace("\\", "/", __FILE__);
if (!$selfPath || !$realPath || !$file) {
return "/ckeditor/";
}
$documentRoot = substr($realPath, 0, strlen($realPath) - strlen($selfPath));
$fileUrl = substr($file, strlen($documentRoot));
$ckeditorUrl = str_replace("ckeditor_php5.php", "", $fileUrl);
return $ckeditorUrl;
}
/**
* This little function provides a basic JSON support.
* http://php.net/manual/en/function.json-encode.php
*
* @param mixed $val
* @return string
*/
private function jsEncode($val)
{
if (is_null($val)) {
return 'null';
}
if ($val === false) {
return 'false';
}
if ($val === true) {
return 'true';
}
if (is_scalar($val))
{
if (is_float($val))
{
// Always use "." for floats.
$val = str_replace(",", ".", strval($val));
}
// Use @@ to not use quotes when outputting string value
if (strpos($val, '@@') === 0) {
return substr($val, 2);
}
else {
// All scalars are converted to strings to avoid indeterminism.
// PHP's "1" and 1 are equal for all PHP operators, but
// JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
// we should get the same result in the JS frontend (string).
// Character replacements for JSON.
static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
$val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
return $val;
}
return '"' . $val . '"';
}
}
$isList = true;
for ($i = 0, reset($val); $i < count($val); $i++, next($val))
{
if (key($val) !== $i)
{
$isList = false;
break;
}
}
$result = array();
if ($isList)
{
foreach ($val as $v) $result[] = $this->jsEncode($v);
return '[ ' . join(', ', $result) . ' ]';
}
else
{
foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
return '{ ' . join(', ', $result) . ' }';
}
}
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/ckeditor_php5.php | PHP | gpl3 | 16,038 |
<?php
/*
* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* \brief CKEditor class that can be used to create editor
* instances in PHP pages on server side.
* @see http://ckeditor.com
*
* Sample usage:
* @code
* $CKEditor = new CKEditor();
* $CKEditor->editor("editor1", "<p>Initial value.</p>");
* @endcode
*/
class CKEditor
{
/**
* The version of %CKEditor.
* \private
*/
var $version = '3.5.2';
/**
* A constant string unique for each release of %CKEditor.
* \private
*/
var $_timestamp = 'B1GG4Z6';
/**
* URL to the %CKEditor installation directory (absolute or relative to document root).
* If not set, CKEditor will try to guess it's path.
*
* Example usage:
* @code
* $CKEditor->basePath = '/ckeditor/';
* @endcode
*/
var $basePath;
/**
* An array that holds the global %CKEditor configuration.
* For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
*
* Example usage:
* @code
* $CKEditor->config['height'] = 400;
* // Use @@ at the beggining of a string to ouput it without surrounding quotes.
* $CKEditor->config['width'] = '@@screen.width * 0.8';
* @endcode
*/
var $config = array();
/**
* A boolean variable indicating whether CKEditor has been initialized.
* Set it to true only if you have already included
* <script> tag loading ckeditor.js in your website.
*/
var $initialized = false;
/**
* Boolean variable indicating whether created code should be printed out or returned by a function.
*
* Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function.
* @code
* $CKEditor = new CKEditor();
* $CKEditor->returnOutput = true;
* $code = $CKEditor->editor("editor1", "<p>Initial value.</p>");
* echo "<p>Editor 1:</p>";
* echo $code;
* @endcode
*/
var $returnOutput = false;
/**
* An array with textarea attributes.
*
* When %CKEditor is created with the editor() method, a HTML <textarea> element is created,
* it will be displayed to anyone with JavaScript disabled or with incompatible browser.
*/
var $textareaAttributes = array( "rows" => 8, "cols" => 60 );
/**
* A string indicating the creation date of %CKEditor.
* Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
*/
var $timestamp = "B1GG4Z6";
/**
* An array that holds event listeners.
* \private
*/
var $_events = array();
/**
* An array that holds global event listeners.
* \private
*/
var $_globalEvents = array();
/**
* Main Constructor.
*
* @param $basePath (string) URL to the %CKEditor installation directory (optional).
*/
function CKEditor($basePath = null) {
if (!empty($basePath)) {
$this->basePath = $basePath;
}
}
/**
* Creates a %CKEditor instance.
* In incompatible browsers %CKEditor will downgrade to plain HTML <textarea> element.
*
* @param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element).
* @param $value (string) Initial value (optional).
* @param $config (array) The specific configurations to apply to this editor instance (optional).
* @param $events (array) Event listeners for this editor instance (optional).
*
* Example usage:
* @code
* $CKEditor = new CKEditor();
* $CKEditor->editor("field1", "<p>Initial value.</p>");
* @endcode
*
* Advanced example:
* @code
* $CKEditor = new CKEditor();
* $config = array();
* $config['toolbar'] = array(
* array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
* array( 'Image', 'Link', 'Unlink', 'Anchor' )
* );
* $events['instanceReady'] = 'function (ev) {
* alert("Loaded: " + ev.editor.name);
* }';
* $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events);
* @endcode
*/
function editor($name, $value = "", $config = array(), $events = array())
{
$attr = "";
foreach ($this->textareaAttributes as $key => $val) {
$attr.= " " . $key . '="' . str_replace('"', '"', $val) . '"';
}
$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
if (!$this->initialized) {
$out .= $this->init();
}
$_config = $this->configSettings($config, $events);
$js = $this->returnGlobalEvents();
if (!empty($_config))
$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
else
$js .= "CKEDITOR.replace('".$name."');";
$out .= $this->script($js);
if (!$this->returnOutput) {
print $out;
$out = "";
}
return $out;
}
/**
* Replaces a <textarea> with a %CKEditor instance.
*
* @param $id (string) The id or name of textarea element.
* @param $config (array) The specific configurations to apply to this editor instance (optional).
* @param $events (array) Event listeners for this editor instance (optional).
*
* Example 1: adding %CKEditor to <textarea name="article"></textarea> element:
* @code
* $CKEditor = new CKEditor();
* $CKEditor->replace("article");
* @endcode
*/
function replace($id, $config = array(), $events = array())
{
$out = "";
if (!$this->initialized) {
$out .= $this->init();
}
$_config = $this->configSettings($config, $events);
$js = $this->returnGlobalEvents();
if (!empty($_config)) {
$js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");";
}
else {
$js .= "CKEDITOR.replace('".$id."');";
}
$out .= $this->script($js);
if (!$this->returnOutput) {
print $out;
$out = "";
}
return $out;
}
/**
* Replace all <textarea> elements available in the document with editor instances.
*
* @param $className (string) If set, replace all textareas with class className in the page.
*
* Example 1: replace all <textarea> elements in the page.
* @code
* $CKEditor = new CKEditor();
* $CKEditor->replaceAll();
* @endcode
*
* Example 2: replace all <textarea class="myClassName"> elements in the page.
* @code
* $CKEditor = new CKEditor();
* $CKEditor->replaceAll( 'myClassName' );
* @endcode
*/
function replaceAll($className = null)
{
$out = "";
if (!$this->initialized) {
$out .= $this->init();
}
$_config = $this->configSettings();
$js = $this->returnGlobalEvents();
if (empty($_config)) {
if (empty($className)) {
$js .= "CKEDITOR.replaceAll();";
}
else {
$js .= "CKEDITOR.replaceAll('".$className."');";
}
}
else {
$classDetection = "";
$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
if (!empty($className)) {
$js .= " var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
$js .= " if (!classRegex.test(textarea.className))\n";
$js .= " return false;\n";
}
$js .= " CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
$js .= "} );";
}
$out .= $this->script($js);
if (!$this->returnOutput) {
print $out;
$out = "";
}
return $out;
}
/**
* Adds event listener.
* Events are fired by %CKEditor in various situations.
*
* @param $event (string) Event name.
* @param $javascriptCode (string) Javascript anonymous function or function name.
*
* Example usage:
* @code
* $CKEditor->addEventHandler('instanceReady', 'function (ev) {
* alert("Loaded: " + ev.editor.name);
* }');
* @endcode
*/
function addEventHandler($event, $javascriptCode)
{
if (!isset($this->_events[$event])) {
$this->_events[$event] = array();
}
// Avoid duplicates.
if (!in_array($javascriptCode, $this->_events[$event])) {
$this->_events[$event][] = $javascriptCode;
}
}
/**
* Clear registered event handlers.
* Note: this function will have no effect on already created editor instances.
*
* @param $event (string) Event name, if not set all event handlers will be removed (optional).
*/
function clearEventHandlers($event = null)
{
if (!empty($event)) {
$this->_events[$event] = array();
}
else {
$this->_events = array();
}
}
/**
* Adds global event listener.
*
* @param $event (string) Event name.
* @param $javascriptCode (string) Javascript anonymous function or function name.
*
* Example usage:
* @code
* $CKEditor->addGlobalEventHandler('dialogDefinition', 'function (ev) {
* alert("Loading dialog: " + ev.data.name);
* }');
* @endcode
*/
function addGlobalEventHandler($event, $javascriptCode)
{
if (!isset($this->_globalEvents[$event])) {
$this->_globalEvents[$event] = array();
}
// Avoid duplicates.
if (!in_array($javascriptCode, $this->_globalEvents[$event])) {
$this->_globalEvents[$event][] = $javascriptCode;
}
}
/**
* Clear registered global event handlers.
* Note: this function will have no effect if the event handler has been already printed/returned.
*
* @param $event (string) Event name, if not set all event handlers will be removed (optional).
*/
function clearGlobalEventHandlers($event = null)
{
if (!empty($event)) {
$this->_globalEvents[$event] = array();
}
else {
$this->_globalEvents = array();
}
}
/**
* Prints javascript code.
* \private
*
* @param string $js
*/
function script($js)
{
$out = "<script type=\"text/javascript\">";
$out .= "//<![CDATA[\n";
$out .= $js;
$out .= "\n//]]>";
$out .= "</script>\n";
return $out;
}
/**
* Returns the configuration array (global and instance specific settings are merged into one array).
* \private
*
* @param $config (array) The specific configurations to apply to editor instance.
* @param $events (array) Event listeners for editor instance.
*/
function configSettings($config = array(), $events = array())
{
$_config = $this->config;
$_events = $this->_events;
if (is_array($config) && !empty($config)) {
$_config = array_merge($_config, $config);
}
if (is_array($events) && !empty($events)) {
foreach ($events as $eventName => $code) {
if (!isset($_events[$eventName])) {
$_events[$eventName] = array();
}
if (!in_array($code, $_events[$eventName])) {
$_events[$eventName][] = $code;
}
}
}
if (!empty($_events)) {
foreach($_events as $eventName => $handlers) {
if (empty($handlers)) {
continue;
}
else if (count($handlers) == 1) {
$_config['on'][$eventName] = '@@'.$handlers[0];
}
else {
$_config['on'][$eventName] = '@@function (ev){';
foreach ($handlers as $handler => $code) {
$_config['on'][$eventName] .= '('.$code.')(ev);';
}
$_config['on'][$eventName] .= '}';
}
}
}
return $_config;
}
/**
* Return global event handlers.
* \private
*/
function returnGlobalEvents()
{
static $returnedEvents;
$out = "";
if (!isset($returnedEvents)) {
$returnedEvents = array();
}
if (!empty($this->_globalEvents)) {
foreach ($this->_globalEvents as $eventName => $handlers) {
foreach ($handlers as $handler => $code) {
if (!isset($returnedEvents[$eventName])) {
$returnedEvents[$eventName] = array();
}
// Return only new events
if (!in_array($code, $returnedEvents[$eventName])) {
$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
$returnedEvents[$eventName][] = $code;
}
}
}
}
return $out;
}
/**
* Initializes CKEditor (executed only once).
* \private
*/
function init()
{
static $initComplete;
$out = "";
if (!empty($initComplete)) {
return "";
}
if ($this->initialized) {
$initComplete = true;
return "";
}
$args = "";
$ckeditorPath = $this->ckeditorPath();
if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") {
$args = '?t=' . $this->timestamp;
}
// Skip relative paths...
if (strpos($ckeditorPath, '..') !== 0) {
$out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
}
$out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
$extraCode = "";
if ($this->timestamp != $this->_timestamp) {
$extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
}
if ($extraCode) {
$out .= $this->script($extraCode);
}
$initComplete = $this->initialized = true;
return $out;
}
/**
* Return path to ckeditor.js.
* \private
*/
function ckeditorPath()
{
if (!empty($this->basePath)) {
return $this->basePath;
}
/**
* The absolute pathname of the currently executing script.
* Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,
* $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.
*/
if (isset($_SERVER['SCRIPT_FILENAME'])) {
$realPath = dirname($_SERVER['SCRIPT_FILENAME']);
}
else {
/**
* realpath - Returns canonicalized absolute pathname
*/
$realPath = realpath( './' ) ;
}
/**
* The filename of the currently executing script, relative to the document root.
* For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar
* would be /test.php/foo.bar.
*/
$selfPath = dirname($_SERVER['PHP_SELF']);
$file = str_replace("\\", "/", __FILE__);
if (!$selfPath || !$realPath || !$file) {
return "/ckeditor/";
}
$documentRoot = substr($realPath, 0, strlen($realPath) - strlen($selfPath));
$fileUrl = substr($file, strlen($documentRoot));
$ckeditorUrl = str_replace("ckeditor_php4.php", "", $fileUrl);
return $ckeditorUrl;
}
/**
* This little function provides a basic JSON support.
* http://php.net/manual/en/function.json-encode.php
* \private
*
* @param mixed $val
* @return string
*/
function jsEncode($val)
{
if (is_null($val)) {
return 'null';
}
if ($val === false) {
return 'false';
}
if ($val === true) {
return 'true';
}
if (is_scalar($val))
{
if (is_float($val))
{
// Always use "." for floats.
$val = str_replace(",", ".", strval($val));
}
// Use @@ to not use quotes when outputting string value
if (strpos($val, '@@') === 0) {
return substr($val, 2);
}
else {
// All scalars are converted to strings to avoid indeterminism.
// PHP's "1" and 1 are equal for all PHP operators, but
// JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
// we should get the same result in the JS frontend (string).
// Character replacements for JSON.
static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
$val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
return $val;
}
return '"' . $val . '"';
}
}
$isList = true;
for ($i = 0, reset($val); $i < count($val); $i++, next($val))
{
if (key($val) !== $i)
{
$isList = false;
break;
}
}
$result = array();
if ($isList)
{
foreach ($val as $v) $result[] = $this->jsEncode($v);
return '[ ' . join(', ', $result) . ' ]';
}
else
{
foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
return '{ ' . join(', ', $result) . ' }';
}
}
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/ckeditor/ckeditor_php4.php | PHP | gpl3 | 16,070 |
<?php
$db_host = '127.0.0.1';
$db_name = 'apis';
$db_user = 'apis';
$db_pass = 'G2WvPRsxGEr77wEd';
define("SINA_AKEY", '961495784');
define("SINA_SKEY", '47d9d806a1dc04cc758be6f7213465bc');
define("ENCRYPTION_KEY", 'HustGNGisVeryGelivable');
define("LONGURL_KEY", 'true');
$base_url = 'http://'.$_SERVER['HTTP_HOST'];
if ($directory = trim(dirname($_SERVER['SCRIPT_NAME']), '/\,'))
$base_url .= '/'.$directory;
define('BASE_URL', $base_url.'/');
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/config.inc.php | PHP | gpl3 | 457 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>管理中心 - 歪伯乐微招聘 - 微博招聘、求职、简历信息,一站聚合、管理、定制</title>
<link rel="icon" href="favicon_big.png" sizes="48x48">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="css/themes/base/jquery.ui.all.css" rel="Stylesheet" type="text/css" />
<link href="css/share.css" rel="stylesheet" type="text/css" />
<link href="css/manager.css" rel="stylesheet" type="text/css" />
<link href="css/popupBox.css" rel="stylesheet" type="text/css" />
<link href="css/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script src="script/jquery-1.5.1.js" type="text/javascript"></script>
<script src="ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="ckfinder/ckfinder.js" type="text/javascript"></script>
<script src="script/jquery.query-2.1.7.js" type="text/javascript"></script>
<script src="script/jquery.cookie.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.resizable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.dialog.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.datepicker.js" type="text/javascript"></script>
<script src="script/ui/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<script src="script/share.js" type="text/javascript"></script>
<script src="script/DMshare.js" type="text/javascript"></script>
<script src="script/manager.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22822126-1']);
_gaq.push(['_setDomainName', '.ybole.com']);
_gaq.push(['_trackPageview']);
$(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
});
</script>
</head>
<body>
<div id="header">
<div class="left" id="links">
<a class="left first" href="/">歪伯乐招聘网</a> <a class="left" href="http://t.sina.com.cn/2020566725">
歪伯乐招聘官方微博</a> <a class="left logined" id="my-microbloging">我的微博</a>
</div>
<div class="right" id="infos">
<a class="left selected logined" id="name" href="/"></a><a class="left orange logined"
href="/manager" id="manager-center">管理中心</a> <a class="left jobs" id="jobs-publish-quick">
发布求职信息</a><a class="left recruitment" id="recruitment-publish-quick">发布招聘信息</a><a
class="left admin" href="/admin">管理员入口</a> <a class="left logined" href="logout/">退出</a>
<a class="left logouted" id="sina-login" href="login/"></a>
</div>
</div>
<div id="logo-search">
<a id="logo" class="left" href="/">测试版</a>
<div id="search-bar" class="left">
<a class="left" id="sort" onclick="ShowSorts()" name="0">全部分类▼</a>
<input class="left" id="search-text" type="text" value="职位关键字,如:北京 产品经理 阿里巴巴" />
<a class="left" id="search-button"></a>
</div>
</div>
<div id="company" class="inner">
<span class="left company-name">热门企业:</span>
<div class="left" id="companies">
<div id="companies-inner">
<a class="company-name first" onclick="HotCompany(this)">新浪</a><a class="company-name"
onclick="HotCompany(this)">腾讯</a><a class="company-name" onclick="HotCompany(this)">百度</a><a
class="company-name" onclick="HotCompany(this)">淘宝</a><a class="company-name" onclick="HotCompany(this)">搜狐</a><a
class="company-name" onclick="HotCompany(this)">创新工场</a><a class="company-name" onclick="HotCompany(this)">凡客</a><a
class="company-name" onclick="HotCompany(this)">支付宝</a><a class="company-name" onclick="HotCompany(this)">奇艺</a><a
class="company-name" onclick="HotCompany(this)">联想</a><a class="company-name" onclick="HotCompany(this)">华为</a><a
class="company-name" onclick="HotCompany(this)">街旁</a><a class="company-name" onclick="HotCompany(this)">中兴</a>
<a class="company-name" onclick="HotCompany(this)">网龙</a><a class="company-name"
onclick="HotCompany(this)">网易</a><a class="company-name" onclick="HotCompany(this)">戴尔</a><a
class="company-name" onclick="HotCompany(this)">人民网</a><a class="company-name" onclick="HotCompany(this)">小米科技</a><a
class="company-name" onclick="HotCompany(this)">金山</a></div>
</div>
<div class="left" id="company-control">
<a class="left company-control" id="company-control-left">◀</a> <a class="left company-control"
id="company-control-right">▶</a>
</div>
</div>
<div id="manager-title" class="inner">
<span class="left manager-title">管理中心</span> <span class="left manager-title-tag recruitment">
我是招聘者</span> <span class="left manager-title-tag jobs">我是求职者</span>
</div>
<div id="manager-content" class="inner">
<div id="content-left" class="left">
<div id="manager-control">
<a class="manager-control left jobs manager-control-choose" onclick="ShowNormal(0)">
我发布的信息</a> <a class="manager-control left jobs" onclick="ShowApply(0)">申请记录</a>
<a class="manager-control left jobs" onclick="ShowFavourite(0)">职位收藏</a> <a class="manager-control left jobs"
onclick="ShowProfile()" id="myprofile">个人简历</a> <a class="manager-control left recruitment manager-control-choose"
onclick="ShowNormal(0)">我发布的信息</a><a class="manager-control left recruitment" onclick="ShowApplys(0)">收到的职位申请</a><a
class="manager-control left recruitment" onclick="ShowFavourite(0)">职位收藏</a>
</div>
<a id="jobs-publish-button" class="publish-button jobs left"></a><a id="recruitment-publish-button"
class="publish-button recruitment left"></a>
</div>
<div id="content-middle" class="left">
<div id="blogs">
<div id="content-middle-delete">
<span id="blogs-count" class="left"></span>
<!--<a class="right">删除全部</a>-->
</div>
<div id="blogsinner">
</div>
<div id="pages">
</div>
</div>
<div id="profile">
<div id="profile-title">
<span class="left" id="title">编辑个人简历</span><span class="right" id="lasttime">最后更新:2011年3月18日</span></div>
<div class="profile-detail-title">
<span class="left">个人信息</span><!--<a class="right">修 改</a>-->
</div>
<div class="profile-content" id="info-content">
<div id="info-content-left" class="left">
<span class="info-content-title left">姓名:</span>
<input class="info-content-words left" type="text" title="姓名" value="姓名" id="u-name" />
<span class="info-content-title left">性别:</span>
<div class="left" style="height: 30px; line-height: 30px; width: 170px; padding-left: 30px">
<input type="radio" title="性别" value="男" name="dsex" checked="checked" />男
<input type="radio" title="性别" value="女" name="dsex" style="margin-left: 10px;" />女</div>
<span class="info-content-title left">出生日期:</span>
<input class="info-content-words left" type="text" title="" value="1980-01-01" id="birthday" />
<span class="info-content-title left">现居地:</span>
<input class="info-content-words left" type="text" title="现居地" value="现居地" id="n-positon" />
<span class="info-content-title left">户口地:</span>
<input class="info-content-words left" type="text" title="户口地" value="户口地" id="o-positon" />
<span class="info-content-title left">手机:</span>
<input class="info-content-words left" type="text" title="手机" value="手机" id="m-phone" />
<span class="info-content-title left">邮件:</span>
<input class="info-content-words left" type="text" title="邮件" value="邮件" id="email" />
</div>
<div id="info-content-right" class="left">
<div id="info-pic">
<img id="headpic" alt="" height="94" width="94" src="images/Thumb.gif" />
<!--<div>
<a>更改头像</a></div>-->
</div>
<div id="info-pic-control">
<input type="checkbox" checked="checked" />在简历中显示</div>
</div>
</div>
<div style="height: 20; line-height: 20px; color: #3e82af;">
Tips:可以将您的简历从Word文档直接粘贴至下面的编辑器中</div>
<div>
<textarea id="profile-detail"></textarea>
</div>
<!--<div class="profile-detail-title">
<span class="left">教育经历</span> <a class="right">添 加</a>
</div>
<div class="profile-content" id="education-info">
<div class="education-item education-header">
<span class="school left">毕业学校</span> <span class="time left">就读时间</span> <span class="education left">
学历</span> <span class="major left">专业</span>
</div>
<div class="education-item education-item-over">
<span class="school left">华中科技大学</span> <span class="time left">2007-09到2011-06</span>
<span class="education left">本科</span> <span class="major left">计算机</span>
</div>
</div>
<div class="profile-detail-title">
<span class="left">语言能力</span> <a class="right">添 加</a> <a
class="right">隐 藏</a>
</div>
<div class="profile-detail-title">
<a class="right">添 加</a> <a class="right">隐 藏</a>
</div>
<div class="profile-detail-title">
<a class="right">添 加</a> <a class="right">隐 藏</a>
</div>-->
</div>
</div>
<div id="content-right" class="left">
<div id="ads">
<!--<div id="right-title">
推广企业</div>
<div class="ad-title">
<a>某某互联网公司</a></div>
<div class="ad-content">
北京,招聘产品经理,待遇从优</div>
<div class="ad-address">
<a>http://sinaurl.cn/YLKd</a></div>
<div class="ad-title">
<a>某某互联网公司</a></div>
<div class="ad-content">
北京,招聘产品经理,待遇从优</div>
<div class="ad-address">
<a>http://sinaurl.cn/YLKd</a></div>
<div class="ad-title">
<a>某某互联网公司</a></div>
<div class="ad-content">
北京,招聘产品经理,待遇从优</div>
<div class="ad-address">
<a>http://sinaurl.cn/YLKd</a></div>-->
</div>
<div id="profile-control">
<a id="profile-preview" class="left"></a><a id="profile-save" class="left"></a>
</div>
</div>
</div>
<div class="clear">
</div>
<div id="footer" class="inner">
<div id="footerlinks">
<a href="/help">网站帮助</a> | <a href="/feedback">意见反馈</a> | <a>联系我们</a></div>
<div id="copyright">
CopyRight © 2011-2012 <a>歪伯乐招聘网</a> Co. All Right Reserved. 鄂ICP证100111号<br />
Powered by:GNG</div>
</div>
<div id="sorts" class="absolute">
<div id="sorts-tag">
<a id="sorts-name" class="left">全部分类</a>
</div>
<div id="sorts-content">
</div>
</div>
<div id="cover">
</div>
<div id="jobs-publish" class="absolute">
<div id="jobs-publish-title">
<span class="left">发布求职信息</span> <a class="right"></a>
</div>
<div id="jobs-publish-content">
<div id="jobs-publish-remain">
还可输入136个字</div>
<div id="jobs-publish-text">
<textarea>#求职#</textarea>
</div>
<div id="jobs-publish-tags-hot">
</div>
<div id="jobs-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="recruitment-publish" class="absolute">
<div id="recruitment-publish-title">
<span class="left">发布招聘信息</span> <a class="right"></a>
</div>
<div id="recruitment-publish-content">
<div id="recruitment-publish-remain">
还可输入136个字</div>
<form action="tweet/post/2" name="postform" id="RecruitmentForm" method="post" enctype="multipart/form-data" target="hf">
<div id="recruitment-publish-text">
<textarea name="text">#招聘#</textarea>
</div>
<div id="recruitment-publish-tags-hot">
</div>
<div id="recruitment-publish-file"><span class="left">上传图片</span><input type="file" name="upload" id="file" /></div>
</form>
<div id="recruitment-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="confirmBox_del" class="popBox confirmBox popBoxwd3" style="display: none;">
<div class="line0">
<span class="popboxicon icon_ques"></span>确认删除这条信息?
</div>
<div class="line1">
<a class="popboxicon btn_ok" onclick="Delete()">确认</a> <a class="popboxicon btn_cal"
onclick="$('#confirmBox_del').hide();">取消</a>
</div>
</div>
<div id="confirmBox_ok" class="popBox confirmBox popBoxwd3" style="display: none;">
<div class="line0">
<span class="popboxicon icon_ok"></span>信息保存成功!
</div>
<div class="line1">
<a class="popboxicon btn_ok" onclick="$('#confirmBox_ok').hide();">确认</a> <a class="popboxicon btn_cal"
onclick="$('#confirmBox_ok').hide();">取消</a>
</div>
</div>
<div id="popBox_publishok" class="popBox popBoxwd1" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
信息发布提示</h4>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_tip">
</div>
<div class="font_tip">
信息发布成功!</div>
</div>
<div class="line2">
<div class="font_tip2" style="line-height: 18px;">
信息已同步到新浪微博,本信息将在稍后显示<br>
在本网站中,请不要重复发布。</div>
</div>
<div class="line3">
<a class="popboxicon btn_ikown" onclick="$('#popBox_publishok').hide();">好的,我知道了</a></div>
</div>
</div>
<form id="ResumeForm" action="resume/preview" method="post" target="_blank">
<input type="hidden" name="name" id="h-name" />
<input type="hidden" name="sex" id="h-sex" />
<input type="hidden" name="date_birth" id="date_birth" />
<input type="hidden" name="live_in_now" id="live_in_now" />
<input type="hidden" name="live_in" id="live_in" />
<input type="hidden" name="cellphone" id="cellphone" />
<input type="hidden" name="email" id="h-email" />
<input type="hidden" name="show_avatar" id="h-avatar" />
<input type="hidden" name="content" id="h-content" />
</form>
<div id="popBox_apply0" class="popBox popBoxwd1 absolute" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
职位申请</h4>
</div>
<div class="popboxicon btn_close">
<a class="left" style="height: 100%; width: 100%;" onclick="$('#popBox_apply0').hide();">
</a>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_err">
</div>
<div class="font_tip">
还没完善简历?</div>
</div>
<div class="line2">
<div class="font_tip2">
提示:完整的简历会加大您录取的概率哟!</div>
</div>
<div class="line3">
<a class="popboxicon btn_goresume"></a>
</div>
</div>
</div>
<div id="popBox_apply1" class="popBox popBoxwd2 absolute" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
职位申请</h4>
</div>
<div class="popboxicon btn_close">
<a class="left" style="height: 100%; width: 100%;" onclick="$('#popBox_apply1').hide();">
</a>
</div>
</div>
<div class="popBox_main">
<div class="line0">
<span class="font_tip2 fl" id="at-name">@赶集网</span><span class="fr">还可输入<span class="font_tip3"
id="remain-number">115</span>个字</span>
</div>
<div id="text_apply" class="line1">
<textarea rows="4" id="resumeinput" onkeydown="UpdateResumeText(this)" onkeyup="UpdateResumeText(this)"></textarea></div>
<div class="line3">
<div class="add_resume">
<input type="radio" name="def_resume" checked="checked" />
<a href="" target="_blank" class="font_tip2 udl" id="default-resume">默认简历</a> <span>
(<span class="font_tip2">*</span>系统将自动为您附上您的简历)</span>
</div>
<div id="btn_publish" class="popboxicon btn_publish">
<a class="left" style="height: 100%; width: 100%;" onclick="SentResume()"></a>
</div>
</div>
</div>
</div>
<div id="LFlower" style="display: none; position: absolute;
z-index: 3000;"></div>
<iframe id="hf" name="hf" style="display:none;"></iframe>
<div id="error-info" title="错误">
<p id="errormsg">
</p>
</div>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/manager.html | HTML | gpl3 | 21,652 |
<?php
include_once('common.inc.php');
func_register(array(
'avatar' => array(
'callback' => 'deal_avatar',
'security' => 'true',
),
));
function resizeavatar($url, $size)
{
if($size == "big")
$url = str_replace("/50/","/180/", $url);
return $url;
}
function get_avatar($id, $size)
{
connect_db();
$view = "SELECT avatar_url FROM userinfo WHERE user_id='$id'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
if($row[0])
return resizeavatar($row[0], $size);
$me = sina_get_credentials();
$avatar = $me['profile_image_url'];
$view = "UPDATE userinfo SET avatar_url='".$avatar."' WHERE user_id='$id'";
$list = mysql_query($view);
return resizeavatar($avatar, $size);
}
function avatar_show()
{
include_once("login.inc.php");
$args = func_get_args();
$id = $args[2];
if($id == "current")
$id = get_current_user_id();
$size = get_post('size');
echo get_avatar($id, $size);
}
function deal_avatar($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'avatar_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/avatar.inc.php | PHP | gpl3 | 1,331 |
<?php
include_once('common.inc.php');
func_register(array(
'feedback' => array(
'callback' => 'deal_feedback',
),
));
function feedback_post($query)
{
include_once('login.inc.php');
if(user_is_authenticated())
{
$id1 = ', user_id';
$id2 = ', \''.get_current_user_id().'\'';
}
else
$id1 = $id2 = "";
$question = get_post('question');
$description = get_post('description');
$email = get_post('email');
include_once("uuid.inc.php");
$v4uuid = str_replace("-", "", UUID::v4());
connect_db();
$add = "INSERT INTO feedback (
feedback_id, question, description, post_datetime, email$id1)
VALUES ('$v4uuid', '$question', '$description', '".date('Y-m-d H:i:s')."', '$email'$id2)";
$added = mysql_query($add) or die("Could not add entry!");
echo "0";
}
function get_feedbacks($num, $page, $count = false)
{
if($count)
$limit = "";
else
{
if(!$page)
$page = "0";
$page = intval($page) * $num;
$limit = " LIMIT $page , $num";
}
connect_db();
$view = "SELECT * from feedback, (SELECT nickname, user_id FROM userinfo) as ui WHERE ui.user_id = feedback.user_id OR ISNULL(feedback.user_id) GROUP BY feedback.feedback_id ORDER BY post_datetime DESC$limit";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
$result[$i++] = $row;
if($page === "count")
return $i;
return $result;
}
function feedback_count()
{
user_ensure_admin();
$args = func_get_args();
$key = $args[2];
$content = '';
$results = get_feedbacks(10, "", true);
echo $results;
}
function feedback_show()
{
user_ensure_admin();
$args = func_get_args();
$page = get_post('page');
$content = '';
$results = get_feedbacks(10, $page);
foreach($results as $r)
{
if($r['user_id'])
$nick = $r['nickname'];
else
$nick = "游客";
$content .= '<div class="item" id="'.$r['feedback_id'].'">
<div class="item-delete">
<a class="right"></a>
</div>
<div class="left item-pic">
<img alt="" width="50" height="50">
</div>
<div class="left item-content">
<div class="item-blog">
<a class="item-blog-name">'.$nick.'</a><a class="item-blog-title">'.$r['question'].'</a>
</div>
<div class="item-blog-content close">
'.$r['description'].'
</div>
<div class="item-other">
<span class="left item-time">'.time_tran($r['post_datetime']).'</span>
<a class="left item-position">'.$r['email'].'</a>
<a class="right item-control last delete">删除</a>
</div>
</div>
<div class="clear">
</div>
</div>';
}
echo $content;
}
function deal_feedback($query)
{
$key = (string) $query[1];
if(!$key)
$key = "post";
$function = 'feedback_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/feedback.inc.php | PHP | gpl3 | 3,693 |
<?php
date_default_timezone_set('Asia/Chongqing');
/*
* Code based on:
* Abraham Williams (abraham@abrah.am) http://abrah.am
*/
/* Load OAuth lib. You can find it at http://oauth.net */
/**
* @ignore
*/
class OAuthException extends Exception {
// pass
}
/**
* @ignore
*/
class OAuthConsumer {
public $key;
public $secret;
function __construct($key, $secret) {
$this->key = $key;
$this->secret = $secret;
}
function __toString() {
return "OAuthConsumer[key=$this->key,secret=$this->secret]";
}
}
/**
* @ignore
*/
class OAuthToken {
// access tokens and request tokens
public $key;
public $secret;
/**
* key = the token
* secret = the token secret
*/
function __construct($key, $secret) {
$this->key = $key;
$this->secret = $secret;
}
/**
* generates the basic string serialization of a token that a server
* would respond to request_token and access_token calls with
*/
function to_string() {
return "oauth_token=" .
OAuthUtil::urlencode_rfc3986($this->key) .
"&oauth_token_secret=" .
OAuthUtil::urlencode_rfc3986($this->secret);
}
function __toString() {
return $this->to_string();
}
}
/**
* @ignore
*/
class OAuthSignatureMethod {
public function check_signature(&$request, $consumer, $token, $signature) {
$built = $this->build_signature($request, $consumer, $token);
return $built == $signature;
}
}
/**
* @ignore
*/
class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
function get_name() {
return "HMAC-SHA1";
}
public function build_signature($request, $consumer, $token) {
$base_string = $request->get_signature_base_string();
//print_r( $base_string );
$request->base_string = $base_string;
$key_parts = array(
$consumer->secret,
($token) ? $token->secret : ""
);
//print_r( $key_parts );
$key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
$key = implode('&', $key_parts);
return base64_encode(hash_hmac('sha1', $base_string, $key, true));
}
}
/**
* @ignore
*/
class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
public function get_name() {
return "PLAINTEXT";
}
public function build_signature($request, $consumer, $token) {
$sig = array(
OAuthUtil::urlencode_rfc3986($consumer->secret)
);
if ($token) {
array_push($sig, OAuthUtil::urlencode_rfc3986($token->secret));
} else {
array_push($sig, '');
}
$raw = implode("&", $sig);
// for debug purposes
$request->base_string = $raw;
return OAuthUtil::urlencode_rfc3986($raw);
}
}
/**
* @ignore
*/
class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod {
public function get_name() {
return "RSA-SHA1";
}
protected function fetch_public_cert(&$request) {
// not implemented yet, ideas are:
// (1) do a lookup in a table of trusted certs keyed off of consumer
// (2) fetch via http using a url provided by the requester
// (3) some sort of specific discovery code based on request
//
// either way should return a string representation of the certificate
throw Exception("fetch_public_cert not implemented");
}
protected function fetch_private_cert(&$request) {
// not implemented yet, ideas are:
// (1) do a lookup in a table of trusted certs keyed off of consumer
//
// either way should return a string representation of the certificate
throw Exception("fetch_private_cert not implemented");
}
public function build_signature(&$request, $consumer, $token) {
$base_string = $request->get_signature_base_string();
$request->base_string = $base_string;
// Fetch the private key cert based on the request
$cert = $this->fetch_private_cert($request);
// Pull the private key ID from the certificate
$privatekeyid = openssl_get_privatekey($cert);
// Sign using the key
$ok = openssl_sign($base_string, $signature, $privatekeyid);
// Release the key resource
openssl_free_key($privatekeyid);
return base64_encode($signature);
}
public function check_signature(&$request, $consumer, $token, $signature) {
$decoded_sig = base64_decode($signature);
$base_string = $request->get_signature_base_string();
// Fetch the public key cert based on the request
$cert = $this->fetch_public_cert($request);
// Pull the public key ID from the certificate
$publickeyid = openssl_get_publickey($cert);
// Check the computed signature against the one passed in the query
$ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
// Release the key resource
openssl_free_key($publickeyid);
return $ok == 1;
}
}
/**
* @ignore
*/
class OAuthRequest {
private $parameters;
private $http_method;
private $http_url;
// for debug purposes
public $base_string;
public static $version = '1.0a';
public static $POST_INPUT = 'php://input';
function __construct($http_method, $http_url, $parameters=NULL) {
@$parameters or $parameters = array();
$this->parameters = $parameters;
$this->http_method = $http_method;
$this->http_url = $http_url;
}
/**
* attempt to build up a request from what was passed to the server
*/
public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
$scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
? 'http'
: 'https';
@$http_url or $http_url = $scheme .
'://' . $_SERVER['HTTP_HOST'] .
':' .
$_SERVER['SERVER_PORT'] .
$_SERVER['REQUEST_URI'];
@$http_method or $http_method = $_SERVER['REQUEST_METHOD'];
// We weren't handed any parameters, so let's find the ones relevant to
// this request.
// If you run XML-RPC or similar you should use this to provide your own
// parsed parameter-list
if (!$parameters) {
// Find request headers
$request_headers = OAuthUtil::get_headers();
// Parse the query-string to find GET parameters
$parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
// It's a POST request of the proper content-type, so parse POST
// parameters and add those overriding any duplicates from GET
if ($http_method == "POST"
&& @strstr($request_headers["Content-Type"],
"application/x-www-form-urlencoded")
) {
$post_data = OAuthUtil::parse_parameters(
file_get_contents(self::$POST_INPUT)
);
$parameters = array_merge($parameters, $post_data);
}
// We have a Authorization-header with OAuth data. Parse the header
// and add those overriding any duplicates from GET or POST
if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
$header_parameters = OAuthUtil::split_header(
$request_headers['Authorization']
);
$parameters = array_merge($parameters, $header_parameters);
}
}
return new OAuthRequest($http_method, $http_url, $parameters);
}
/**
* pretty much a helper function to set up the request
*/
public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
@$parameters or $parameters = array();
$defaults = array("oauth_version" => OAuthRequest::$version,
"oauth_nonce" => OAuthRequest::generate_nonce(),
"oauth_timestamp" => OAuthRequest::generate_timestamp(),
"oauth_consumer_key" => $consumer->key);
if ($token)
$defaults['oauth_token'] = $token->key;
$parameters = array_merge($defaults, $parameters);
return new OAuthRequest($http_method, $http_url, $parameters);
}
public function set_parameter($name, $value, $allow_duplicates = true) {
if ($allow_duplicates && isset($this->parameters[$name])) {
// We have already added parameter(s) with this name, so add to the list
if (is_scalar($this->parameters[$name])) {
// This is the first duplicate, so transform scalar (string)
// into an array so we can add the duplicates
$this->parameters[$name] = array($this->parameters[$name]);
}
$this->parameters[$name][] = $value;
} else {
$this->parameters[$name] = $value;
}
}
public function get_parameter($name) {
return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
}
public function get_parameters() {
return $this->parameters;
}
public function unset_parameter($name) {
unset($this->parameters[$name]);
}
/**
* The request parameters, sorted and concatenated into a normalized string.
* @return string
*/
public function get_signable_parameters() {
// Grab all parameters
$params = $this->parameters;
// remove pic
if (isset($params['pic'])) {
unset($params['pic']);
}
if (isset($params['image']))
{
unset($params['image']);
}
// Remove oauth_signature if present
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
if (isset($params['oauth_signature'])) {
unset($params['oauth_signature']);
}
return OAuthUtil::build_http_query($params);
}
/**
* Returns the base string of this request
*
* The base string defined as the method, the url
* and the parameters (normalized), each urlencoded
* and the concated with &.
*/
public function get_signature_base_string() {
$parts = array(
$this->get_normalized_http_method(),
$this->get_normalized_http_url(),
$this->get_signable_parameters()
);
//print_r( $parts );
$parts = OAuthUtil::urlencode_rfc3986($parts);
return implode('&', $parts);
}
/**
* just uppercases the http method
*/
public function get_normalized_http_method() {
return strtoupper($this->http_method);
}
/**
* parses the url and rebuilds it to be
* scheme://host/path
*/
public function get_normalized_http_url() {
$parts = parse_url($this->http_url);
$port = @$parts['port'];
$scheme = $parts['scheme'];
$host = $parts['host'];
$path = @$parts['path'];
$port or $port = ($scheme == 'https') ? '443' : '80';
if (($scheme == 'https' && $port != '443')
|| ($scheme == 'http' && $port != '80')) {
$host = "$host:$port";
}
return "$scheme://$host$path";
}
/**
* builds a url usable for a GET request
*/
public function to_url() {
$post_data = $this->to_postdata();
$out = $this->get_normalized_http_url();
if ($post_data) {
$out .= '?'.$post_data;
}
return $out;
}
/**
* builds the data one would send in a POST request
*/
public function to_postdata( $multi = false ) {
//echo "multi=" . $multi . '`';
if( $multi )
return OAuthUtil::build_http_query_multi($this->parameters);
else
return OAuthUtil::build_http_query($this->parameters);
}
/**
* builds the Authorization: header
*/
public function to_header() {
$out ='Authorization: OAuth realm=""';
$total = array();
foreach ($this->parameters as $k => $v) {
if (substr($k, 0, 5) != "oauth") continue;
if (is_array($v)) {
throw new OAuthException('Arrays not supported in headers');
}
$out .= ',' .
OAuthUtil::urlencode_rfc3986($k) .
'="' .
OAuthUtil::urlencode_rfc3986($v) .
'"';
}
return $out;
}
public function __toString() {
return $this->to_url();
}
public function sign_request($signature_method, $consumer, $token) {
$this->set_parameter(
"oauth_signature_method",
$signature_method->get_name(),
false
);
$signature = $this->build_signature($signature_method, $consumer, $token);
//echo "sign=" . $signature;
$this->set_parameter("oauth_signature", $signature, false);
}
public function build_signature($signature_method, $consumer, $token) {
$signature = $signature_method->build_signature($this, $consumer, $token);
return $signature;
}
/**
* util function: current timestamp
*/
private static function generate_timestamp() {
//return 1273566716;
//echo date("y-m-d H:i:s");
return time();
}
/**
* util function: current nonce
*/
private static function generate_nonce() {
//return '462d316f6f40c40a9e0eef1b009f37fa';
$mt = microtime();
$rand = mt_rand();
return md5($mt . $rand); // md5s look nicer than numbers
}
}
/**
* @ignore
*/
class OAuthServer {
protected $timestamp_threshold = 300; // in seconds, five minutes
protected $version = 1.0; // hi blaine
protected $signature_methods = array();
protected $data_store;
function __construct($data_store) {
$this->data_store = $data_store;
}
public function add_signature_method($signature_method) {
$this->signature_methods[$signature_method->get_name()] =
$signature_method;
}
// high level functions
/**
* process a request_token request
* returns the request token on success
*/
public function fetch_request_token(&$request) {
$this->get_version($request);
$consumer = $this->get_consumer($request);
// no token required for the initial token request
$token = NULL;
$this->check_signature($request, $consumer, $token);
$new_token = $this->data_store->new_request_token($consumer);
return $new_token;
}
/**
* process an access_token request
* returns the access token on success
*/
public function fetch_access_token(&$request) {
$this->get_version($request);
$consumer = $this->get_consumer($request);
// requires authorized request token
$token = $this->get_token($request, $consumer, "request");
$this->check_signature($request, $consumer, $token);
$new_token = $this->data_store->new_access_token($token, $consumer);
return $new_token;
}
/**
* verify an api call, checks all the parameters
*/
public function verify_request(&$request) {
$this->get_version($request);
$consumer = $this->get_consumer($request);
$token = $this->get_token($request, $consumer, "access");
$this->check_signature($request, $consumer, $token);
return array($consumer, $token);
}
// Internals from here
/**
* version 1
*/
private function get_version(&$request) {
$version = $request->get_parameter("oauth_version");
if (!$version) {
$version = 1.0;
}
if ($version && $version != $this->version) {
throw new OAuthException("OAuth version '$version' not supported");
}
return $version;
}
/**
* figure out the signature with some defaults
*/
private function get_signature_method(&$request) {
$signature_method =
@$request->get_parameter("oauth_signature_method");
if (!$signature_method) {
$signature_method = "PLAINTEXT";
}
if (!in_array($signature_method,
array_keys($this->signature_methods))) {
throw new OAuthException(
"Signature method '$signature_method' not supported " .
"try one of the following: " .
implode(", ", array_keys($this->signature_methods))
);
}
return $this->signature_methods[$signature_method];
}
/**
* try to find the consumer for the provided request's consumer key
*/
private function get_consumer(&$request) {
$consumer_key = @$request->get_parameter("oauth_consumer_key");
if (!$consumer_key) {
throw new OAuthException("Invalid consumer key");
}
$consumer = $this->data_store->lookup_consumer($consumer_key);
if (!$consumer) {
throw new OAuthException("Invalid consumer");
}
return $consumer;
}
/**
* try to find the token for the provided request's token key
*/
private function get_token(&$request, $consumer, $token_type="access") {
$token_field = @$request->get_parameter('oauth_token');
$token = $this->data_store->lookup_token(
$consumer, $token_type, $token_field
);
if (!$token) {
throw new OAuthException("Invalid $token_type token: $token_field");
}
return $token;
}
/**
* all-in-one function to check the signature on a request
* should guess the signature method appropriately
*/
private function check_signature(&$request, $consumer, $token) {
// this should probably be in a different method
$timestamp = @$request->get_parameter('oauth_timestamp');
$nonce = @$request->get_parameter('oauth_nonce');
$this->check_timestamp($timestamp);
$this->check_nonce($consumer, $token, $nonce, $timestamp);
$signature_method = $this->get_signature_method($request);
$signature = $request->get_parameter('oauth_signature');
$valid_sig = $signature_method->check_signature(
$request,
$consumer,
$token,
$signature
);
if (!$valid_sig) {
throw new OAuthException("Invalid signature");
}
}
/**
* check that the timestamp is new enough
*/
private function check_timestamp($timestamp) {
// verify that timestamp is recentish
$now = time();
if ($now - $timestamp > $this->timestamp_threshold) {
throw new OAuthException(
"Expired timestamp, yours $timestamp, ours $now"
);
}
}
/**
* check that the nonce is not repeated
*/
private function check_nonce($consumer, $token, $nonce, $timestamp) {
// verify that the nonce is uniqueish
$found = $this->data_store->lookup_nonce(
$consumer,
$token,
$nonce,
$timestamp
);
if ($found) {
throw new OAuthException("Nonce already used: $nonce");
}
}
}
/**
* @ignore
*/
class OAuthDataStore {
function lookup_consumer($consumer_key) {
// implement me
}
function lookup_token($consumer, $token_type, $token) {
// implement me
}
function lookup_nonce($consumer, $token, $nonce, $timestamp) {
// implement me
}
function new_request_token($consumer) {
// return a new token attached to this consumer
}
function new_access_token($token, $consumer) {
// return a new access token attached to this consumer
// for the user associated with this token if the request token
// is authorized
// should also invalidate the request token
}
}
/**
* @ignore
*/
class OAuthUtil {
public static $boundary = '';
public static function urlencode_rfc3986($input) {
if (is_array($input)) {
return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
} else if (is_scalar($input)) {
return str_replace(
'+',
' ',
str_replace('%7E', '~', rawurlencode($input))
);
} else {
return '';
}
}
// This decode function isn't taking into consideration the above
// modifications to the encoding process. However, this method doesn't
// seem to be used anywhere so leaving it as is.
public static function urldecode_rfc3986($string) {
return urldecode($string);
}
// Utility function for turning the Authorization: header into
// parameters, has to do some unescaping
// Can filter out any non-oauth parameters if needed (default behaviour)
public static function split_header($header, $only_allow_oauth_parameters = true) {
$pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
$offset = 0;
$params = array();
while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
$match = $matches[0];
$header_name = $matches[2][0];
$header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];
if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) {
$params[$header_name] = OAuthUtil::urldecode_rfc3986($header_content);
}
$offset = $match[1] + strlen($match[0]);
}
if (isset($params['realm'])) {
unset($params['realm']);
}
return $params;
}
// helper to try to sort out headers for people who aren't running apache
public static function get_headers() {
if (function_exists('apache_request_headers')) {
// we need this to get the actual Authorization: header
// because apache tends to tell us it doesn't exist
return apache_request_headers();
}
// otherwise we don't have apache and are just going to have to hope
// that $_SERVER actually contains what we need
$out = array();
foreach ($_SERVER as $key => $value) {
if (substr($key, 0, 5) == "HTTP_") {
// this is chaos, basically it is just there to capitalize the first
// letter of every word that is not an initial HTTP and strip HTTP
// code from przemek
$key = str_replace(
" ",
"-",
ucwords(strtolower(str_replace("_", " ", substr($key, 5))))
);
$out[$key] = $value;
}
}
return $out;
}
// This function takes a input like a=b&a=c&d=e and returns the parsed
// parameters like this
// array('a' => array('b','c'), 'd' => 'e')
public static function parse_parameters( $input ) {
if (!isset($input) || !$input) return array();
$pairs = explode('&', $input);
$parsed_parameters = array();
foreach ($pairs as $pair) {
$split = explode('=', $pair, 2);
$parameter = OAuthUtil::urldecode_rfc3986($split[0]);
$value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';
if (isset($parsed_parameters[$parameter])) {
// We have already recieved parameter(s) with this name, so add to the list
// of parameters with this name
if (is_scalar($parsed_parameters[$parameter])) {
// This is the first duplicate, so transform scalar (string) into an array
// so we can add the duplicates
$parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);
}
$parsed_parameters[$parameter][] = $value;
} else {
$parsed_parameters[$parameter] = $value;
}
}
return $parsed_parameters;
}
public static function build_http_query_multi($params) {
if (!$params) return '';
//print_r( $params );
//return null;
// Urlencode both keys and values
$keys = array_keys($params);
$values = array_values($params);
//$keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
//$values = OAuthUtil::urlencode_rfc3986(array_values($params));
$params = array_combine($keys, $values);
// Parameters are sorted by name, using lexicographical byte value ordering.
// Ref: Spec: 9.1.1 (1)
uksort($params, 'strcmp');
$pairs = array();
self::$boundary = $boundary = uniqid('------------------');
$MPboundary = '--'.$boundary;
$endMPboundary = $MPboundary. '--';
$multipartbody = '';
foreach ($params as $parameter => $value) {
//if( $parameter == 'pic' && $value{0} == '@' )
if( in_array($parameter,array("pic","image")) && $value{0} == '@' )
{
$url = ltrim( $value , '@' );
$content = file_get_contents( $url );
$filename = reset( explode( '?' , basename( $url ) ));
$mime = self::get_image_mime($url);
$multipartbody .= $MPboundary . "\r\n";
$multipartbody .= 'Content-Disposition: form-data; name="' . $parameter . '"; filename="' . $filename . '"'. "\r\n";
$multipartbody .= 'Content-Type: '. $mime . "\r\n\r\n";
$multipartbody .= $content. "\r\n";
}
else
{
$multipartbody .= $MPboundary . "\r\n";
$multipartbody .= 'content-disposition: form-data; name="'.$parameter."\"\r\n\r\n";
$multipartbody .= $value."\r\n";
}
}
$multipartbody .= $endMPboundary;
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
// Each name-value pair is separated by an '&' character (ASCII code 38)
// echo $multipartbody;
return $multipartbody;
}
public static function build_http_query($params) {
if (!$params) return '';
// Urlencode both keys and values
$keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
$values = OAuthUtil::urlencode_rfc3986(array_values($params));
$params = array_combine($keys, $values);
// Parameters are sorted by name, using lexicographical byte value ordering.
// Ref: Spec: 9.1.1 (1)
uksort($params, 'strcmp');
$pairs = array();
foreach ($params as $parameter => $value) {
if (is_array($value)) {
// If two or more parameters share the same name, they are sorted by their value
// Ref: Spec: 9.1.1 (1)
natsort($value);
foreach ($value as $duplicate_value) {
$pairs[] = $parameter . '=' . $duplicate_value;
}
} else {
$pairs[] = $parameter . '=' . $value;
}
}
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
// Each name-value pair is separated by an '&' character (ASCII code 38)
return implode('&', $pairs);
}
public static function get_image_mime( $file )
{
$ext = strtolower(pathinfo( $file , PATHINFO_EXTENSION ));
switch( $ext )
{
case 'jpg':
case 'jpeg':
$mime = 'image/jpg';
break;
case 'png';
$mime = 'image/png';
break;
case 'gif';
default:
$mime = 'image/gif';
break;
}
return $mime;
}
}
/**
* 新浪微博操作类
*
* @package sae
* @author Easy Chen
* @version 1.0
*/
class WeiboClient
{
/**
* 构造函数
*
* @access public
* @param mixed $akey 微博开放平台应用APP KEY
* @param mixed $skey 微博开放平台应用APP SECRET
* @param mixed $accecss_token OAuth认证返回的token
* @param mixed $accecss_token_secret OAuth认证返回的token secret
* @return void
*/
function __construct( $akey , $skey , $accecss_token , $accecss_token_secret )
{
$this->oauth = new WeiboOAuth( $akey , $skey , $accecss_token , $accecss_token_secret );
}
/**
* 最新公共微博
*
* @access public
* @return array
*/
function public_timeline()
{
return $this->oauth->get('http://api.t.sina.com.cn/statuses/public_timeline.json');
}
/**
* 最新关注人微博
*
* @access public
* @return array
*/
function friends_timeline()
{
return $this->home_timeline();
}
/**
* 最新关注人微博
*
* @access public
* @return array
*/
function home_timeline()
{
return $this->oauth->get('http://api.t.sina.com.cn/statuses/home_timeline.json');
}
/**
* 最新 @用户的
*
* @access public
* @param int $page 返回结果的页序号。
* @param int $count 每次返回的最大记录数(即页面大小),不大于200,默认为20。
* @return array
*/
function mentions( $page = 1 , $count = 20 )
{
return $this->request_with_pager( 'http://api.t.sina.com.cn/statuses/mentions.json' , $page , $count );
}
/**
* 发表微博
*
* @access public
* @param mixed $text 要更新的微博信息。
* @return array
*/
function update( $text )
{
// http://api.t.sina.com.cn/statuses/update.json
$param = array();
$param['status'] = $text;
return $this->oauth->post( 'http://api.t.sina.com.cn/statuses/update.json' , $param );
}
/**
* 发表图片微博
*
* @access public
* @param string $text 要更新的微博信息。
* @param string $text 要发布的图片路径,支持url。[只支持png/jpg/gif三种格式,增加格式请修改get_image_mime方法]
* @return array
*/
function upload( $text , $pic_path )
{
// http://api.t.sina.com.cn/statuses/update.json
$param = array();
$param['status'] = $text;
$param['pic'] = '@'.$pic_path;
return $this->oauth->post( 'http://api.t.sina.com.cn/statuses/upload.json' , $param , true );
}
/**
* 获取单条微博
*
* @access public
* @param mixed $sid 要获取已发表的微博ID
* @return array
*/
function show_status( $sid )
{
return $this->oauth->get( 'http://api.t.sina.com.cn/statuses/show/' . $sid . '.json' );
}
/**
* 删除微博
*
* @access public
* @param mixed $sid 要删除的微博ID
* @return array
*/
function delete( $sid )
{
return $this->destroy( $sid );
}
/**
* 删除微博
*
* @access public
* @param mixed $sid 要删除的微博ID
* @return array
*/
function destroy( $sid )
{
return $this->oauth->post( 'http://api.t.sina.com.cn/statuses/destroy/' . $sid . '.json' );
}
/**
* 个人资料
*
* @access public
* @param mixed $uid_or_name 用户UID或微博昵称。
* @return array
*/
function show_user( $uid_or_name = null )
{
return $this->request_with_uid( 'http://api.t.sina.com.cn/users/show.json' , $uid_or_name );
}
/**
* 关注人列表
*
* @access public
* @param bool $cursor 单页只能包含100个关注列表,为了获取更多则cursor默认从-1开始,通过增加或减少cursor来获取更多的关注列表
* @param bool $count 每次返回的最大记录数(即页面大小),不大于200,默认返回20
* @param mixed $uid_or_name 要获取的 UID或微博昵称
* @return array
*/
function friends( $cursor = false , $count = false , $uid_or_name = null )
{
return $this->request_with_uid( 'http://api.t.sina.com.cn/statuses/friends.json' , $uid_or_name , false , $count , $cursor );
}
/**
* 粉丝列表
*
* @access public
* @param bool $cursor 单页只能包含100个粉丝列表,为了获取更多则cursor默认从-1开始,通过增加或减少cursor来获取更多的粉丝列表
* @param bool $count 每次返回的最大记录数(即页面大小),不大于200,默认返回20。
* @param mixed $uid_or_name 要获取的 UID或微博昵称
* @return array
*/
function followers( $cursor = false , $count = false , $uid_or_name = null )
{
return $this->request_with_uid( 'http://api.t.sina.com.cn/statuses/followers.json' , $uid_or_name , false , $count , $cursor );
}
/**
* 关注一个用户
*
* @access public
* @param mixed $uid_or_name 要关注的用户UID或微博昵称
* @return array
*/
function follow( $uid_or_name )
{
return $this->request_with_uid( 'http://api.t.sina.com.cn/friendships/create.json' , $uid_or_name , false , false , false , true );
}
/**
* 取消关注某用户
*
* @access public
* @param mixed $uid_or_name 要取消关注的用户UID或微博昵称
* @return array
*/
function unfollow( $uid_or_name )
{
return $this->request_with_uid( 'http://api.t.sina.com.cn/friendships/destroy.json' , $uid_or_name , false , false , false , true);
}
/**
* 返回两个用户关系的详细情况
*
* @access public
* @param mixed $uid_or_name 要判断的用户UID
* @return array
*/
function is_followed( $uid_or_name )
{
$param = array();
if( is_numeric( $uid_or_name ) ) $param['target_id'] = $uid_or_name;
else $param['target_screen_name'] = $uid_or_name;
return $this->oauth->get( 'http://api.t.sina.com.cn/friendships/show.json' , $param );
}
/**
* 用户发表微博列表
*
* @access public
* @param int $page 页码
* @param int $count 每次返回的最大记录数,最多返回200条,默认20。
* @param mixed $uid_or_name 指定用户UID或微博昵称
* @return array
*/
function user_timeline( $page = 1 , $count = 20 , $uid_or_name = null )
{
if( !is_numeric( $page ) )
return $this->request_with_uid( 'http://api.t.sina.com.cn/statuses/user_timeline.json' , $page );
else
return $this->request_with_uid( 'http://api.t.sina.com.cn/statuses/user_timeline.json' , $uid_or_name , $page , $count );
}
/**
* 获取私信列表
*
* @access public
* @param int $page 页码
* @param int $count 每次返回的最大记录数,最多返回200条,默认20。
* @return array
*/
function list_dm( $page = 1 , $count = 20 )
{
return $this->request_with_pager( 'http://api.t.sina.com.cn/direct_messages.json' , $page , $count );
}
/**
* 发送的私信列表
*
* @access public
* @param int $page 页码
* @param int $count 每次返回的最大记录数,最多返回200条,默认20。
* @return array
*/
function list_dm_sent( $page = 1 , $count = 20 )
{
return $this->request_with_pager( 'http://api.t.sina.com.cn/direct_messages/sent.json' , $page , $count );
}
/**
* 发送私信
*
* @access public
* @param mixed $uid_or_name UID或微博昵称
* @param mixed $text 要发生的消息内容,文本大小必须小于300个汉字。
* @return array
*/
function send_dm( $uid_or_name , $text )
{
$param = array();
$param['text'] = $text;
if( is_numeric( $uid_or_name ) ) $param['user_id'] = $uid_or_name;
else $param['screen_name'] = $uid_or_name;
return $this->oauth->post( 'http://api.t.sina.com.cn/direct_messages/new.json' , $param );
}
/**
* 删除一条私信
*
* @access public
* @param mixed $did 要删除的私信主键ID
* @return array
*/
function delete_dm( $did )
{
return $this->oauth->post( 'http://api.t.sina.com.cn/direct_messages/destroy/' . $did . '.json' );
}
/**
* 转发一条微博信息。
*
* @access public
* @param mixed $sid 转发的微博ID
* @param bool $text 添加的转发信息。
* @return array
*/
function repost( $sid , $text = false )
{
$param = array();
$param['id'] = $sid;
if( $text ) $param['status'] = $text;
return $this->oauth->post( 'http://api.t.sina.com.cn/statuses/repost.json' , $param );
}
/**
* 对一条微博信息进行评论
*
* @access public
* @param mixed $sid 要评论的微博id
* @param mixed $text 评论内容
* @param bool $cid 要评论的评论id
* @return array
*/
function send_comment( $sid , $text , $cid = false )
{
$param = array();
$param['id'] = $sid;
$param['comment'] = $text;
if( $cid ) $param['cid '] = $cid;
return $this->oauth->post( 'http://api.t.sina.com.cn/statuses/comment.json' , $param );
}
/**
* 发出的评论
*
* @access public
* @param int $page 页码
* @param int $count 每次返回的最大记录数,最多返回200条,默认20。
* @return array
*/
function comments_by_me( $page = 1 , $count = 20 )
{
return $this->request_with_pager( 'http://api.t.sina.com.cn/statuses/comments_by_me.json' , $page , $count );
}
/**
* 最新评论(按时间)
*
* @access public
* @param int $page 页码
* @param int $count 每次返回的最大记录数,最多返回200条,默认20。
* @return array
*/
function comments_timeline( $page = 1 , $count = 20 )
{
return $this->request_with_pager( 'http://api.t.sina.com.cn/statuses/comments_timeline.json' , $page , $count );
}
/**
* 单条评论列表(按微博)
*
* @access public
* @param mixed $sid 指定的微博ID
* @param int $page 页码
* @param int $count 每次返回的最大记录数,最多返回200条,默认20。
* @return array
*/
function get_comments_by_sid( $sid , $page = 1 , $count = 20 )
{
$param = array();
$param['id'] = $sid;
if( $page ) $param['page'] = $page;
if( $count ) $param['count'] = $count;
return $this->oauth->get('http://api.t.sina.com.cn/statuses/comments.json' , $param );
}
/**
* 批量统计微博的评论数,转发数,一次请求最多获取100个。
*
* @access public
* @param mixed $sids 微博ID号列表,用逗号隔开
* @return array
*/
function get_count_info_by_ids( $sids )
{
$param = array();
$param['ids'] = $sids;
return $this->oauth->get( 'http://api.t.sina.com.cn/statuses/counts.json' , $param );
}
/**
* 对一条微博评论信息进行回复。
*
* @access public
* @param mixed $sid 微博id
* @param mixed $text 评论内容。
* @param mixed $cid 评论id
* @return array
*/
function reply( $sid , $text , $cid )
{
$param = array();
$param['id'] = $sid;
$param['comment'] = $text;
$param['cid '] = $cid;
return $this->oauth->post( 'http://api.t.sina.com.cn/statuses/reply.json' , $param );
}
/**
* 返回用户的发布的最近20条收藏信息,和用户收藏页面返回内容是一致的。
*
* @access public
* @param bool $page 返回结果的页序号。
* @return array
*/
function get_favorites( $page = false )
{
$param = array();
if( $page ) $param['page'] = $page;
return $this->oauth->get( 'http://api.t.sina.com.cn/favorites.json' , $param );
}
/**
* 收藏一条微博信息
*
* @access public
* @param mixed $sid 收藏的微博id
* @return array
*/
function add_to_favorites( $sid )
{
$param = array();
$param['id'] = $sid;
return $this->oauth->post( 'http://api.t.sina.com.cn/favorites/create.json' , $param );
}
/**
* 删除微博收藏。
*
* @access public
* @param mixed $sid 要删除的收藏微博信息ID.
* @return array
*/
function remove_from_favorites( $sid )
{
return $this->oauth->post( 'http://api.t.sina.com.cn/favorites/destroy/' . $sid . '.json' );
}
function verify_credentials()
{
return $this->oauth->get( 'http://api.t.sina.com.cn/account/verify_credentials.json' );
}
function update_avatar( $pic_path )
{
$param = array();
$param['image'] = "@".$pic_path;
return $this->oauth->post( 'http://api.t.sina.com.cn/account/update_profile_image.json' , $param , true );
}
// =========================================
/**
* @ignore
*/
protected function request_with_pager( $url , $page = false , $count = false )
{
$param = array();
if( $page ) $param['page'] = $page;
if( $count ) $param['count'] = $count;
return $this->oauth->get($url , $param );
}
/**
* @ignore
*/
protected function request_with_uid( $url , $uid_or_name , $page = false , $count = false , $cursor = false , $post = false )
{
$param = array();
if( $page ) $param['page'] = $page;
if( $count ) $param['count'] = $count;
if( $cursor )$param['cursor'] = $cursor;
if( $post ) $method = 'post';
else $method = 'get';
if( is_numeric( $uid_or_name ) )
{
$param['user_id'] = $uid_or_name;
return $this->oauth->$method($url , $param );
}elseif( $uid_or_name !== null )
{
$param['screen_name'] = $uid_or_name;
return $this->oauth->$method($url , $param );
}
else
{
return $this->oauth->$method($url , $param );
}
}
}
/**
* 新浪微博 OAuth 认证类
*
* @package sae
* @author Easy Chen
* @version 1.0
*/
class WeiboOAuth {
/**
* Contains the last HTTP status code returned.
*
* @ignore
*/
public $http_code;
/**
* Contains the last API call.
*
* @ignore
*/
public $url;
/**
* Set up the API root URL.
*
* @ignore
*/
public $host = "http://api.t.sina.com.cn/";
/**
* Set timeout default.
*
* @ignore
*/
public $timeout = 30;
/**
* Set connect timeout.
*
* @ignore
*/
public $connecttimeout = 30;
/**
* Verify SSL Cert.
*
* @ignore
*/
public $ssl_verifypeer = FALSE;
/**
* Respons format.
*
* @ignore
*/
public $format = 'json';
/**
* Decode returned json data.
*
* @ignore
*/
public $decode_json = TRUE;
/**
* Contains the last HTTP headers returned.
*
* @ignore
*/
public $http_info;
/**
* Set the useragnet.
*
* @ignore
*/
public $useragent = 'Sae T OAuth v0.2.0-beta2';
/* Immediately retry the API call if the response was not successful. */
//public $retry = TRUE;
/**
* Set API URLS
*/
/**
* @ignore
*/
function accessTokenURL() { return 'http://api.t.sina.com.cn/oauth/access_token'; }
/**
* @ignore
*/
function authenticateURL() { return 'http://api.t.sina.com.cn/oauth/authenticate'; }
/**
* @ignore
*/
function authorizeURL() { return 'http://api.t.sina.com.cn/oauth/authorize'; }
/**
* @ignore
*/
function requestTokenURL() { return 'http://api.t.sina.com.cn/oauth/request_token'; }
/**
* Debug helpers
*/
/**
* @ignore
*/
function lastStatusCode() { return $this->http_status; }
/**
* @ignore
*/
function lastAPICall() { return $this->last_api_call; }
/**
* construct WeiboOAuth object
*/
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
$this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
$this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
$this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
} else {
$this->token = NULL;
}
}
/**
* Get a request_token from Weibo
*
* @return array a key/value array containing oauth_token and oauth_token_secret
*/
function getRequestToken($oauth_callback = NULL) {
$parameters = array();
if (!empty($oauth_callback)) {
$parameters['oauth_callback'] = $oauth_callback;
}
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
$token = OAuthUtil::parse_parameters($request);
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
/**
* Get the authorize URL
*
* @return string
*/
function getAuthorizeURL($token, $sign_in_with_Weibo = TRUE , $url) {
if (is_array($token)) {
$token = $token['oauth_token'];
}
if (empty($sign_in_with_Weibo)) {
return $this->authorizeURL() . "?oauth_token={$token}&oauth_callback=" . urlencode($url);
} else {
return $this->authenticateURL() . "?oauth_token={$token}&oauth_callback=". urlencode($url);
}
}
/**
* Exchange the request token and secret for an access token and
* secret, to sign API calls.
*
* @return array array("oauth_token" => the access token,
* "oauth_token_secret" => the access secret)
*/
function getAccessToken($oauth_verifier = FALSE, $oauth_token = false) {
$parameters = array();
if (!empty($oauth_verifier)) {
$parameters['oauth_verifier'] = $oauth_verifier;
}
$request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters);
$token = OAuthUtil::parse_parameters($request);
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
/**
* GET wrappwer for oAuthRequest.
*
* @return mixed
*/
function get($url, $parameters = array()) {
$response = $this->oAuthRequest($url, 'GET', $parameters);
if ($this->format === 'json' && $this->decode_json) {
return json_decode($response, true);
}
return $response;
}
/**
* POST wreapper for oAuthRequest.
*
* @return mixed
*/
function post($url, $parameters = array() , $multi = false) {
$response = $this->oAuthRequest($url, 'POST', $parameters , $multi );
if ($this->format === 'json' && $this->decode_json) {
return json_decode($response, true);
}
return $response;
}
/**
* DELTE wrapper for oAuthReqeust.
*
* @return mixed
*/
function delete($url, $parameters = array()) {
$response = $this->oAuthRequest($url, 'DELETE', $parameters);
if ($this->format === 'json' && $this->decode_json) {
return json_decode($response, true);
}
return $response;
}
/**
* Format and sign an OAuth / API request
*
* @return string
*/
function oAuthRequest($url, $method, $parameters , $multi = false) {
if (strrpos($url, 'http://') !== 0 && strrpos($url, 'http://') !== 0) {
$url = "{$this->host}{$url}.{$this->format}";
}
// echo $url ;
$request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
$request->sign_request($this->sha1_method, $this->consumer, $this->token);
switch ($method) {
case 'GET':
//echo $request->to_url();
return $this->http($request->to_url(), 'GET');
default:
return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata($multi) , $multi );
}
}
/**
* Make an HTTP request
*
* @return string API results
*/
function http($url, $method, $postfields = NULL , $multi = false) {
$this->http_info = array();
$ci = curl_init();
/* Curl settings */
curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);
curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);
curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
curl_setopt($ci, CURLOPT_HEADER, FALSE);
switch ($method) {
case 'POST':
curl_setopt($ci, CURLOPT_POST, TRUE);
if (!empty($postfields)) {
curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);
//echo "=====post data======\r\n";
//echo $postfields;
}
break;
case 'DELETE':
curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
if (!empty($postfields)) {
$url = "{$url}?{$postfields}";
}
}
$header_array = array();
/*
$header_array["FetchUrl"] = $url;
$header_array['TimeStamp'] = date('Y-m-d H:i:s');
$header_array['AccessKey'] = SAE_ACCESSKEY;
$content="FetchUrl";
$content.=$header_array["FetchUrl"];
$content.="TimeStamp";
$content.=$header_array['TimeStamp'];
$content.="AccessKey";
$content.=$header_array['AccessKey'];
$header_array['Signature'] = base64_encode(hash_hmac('sha256',$content, SAE_SECRETKEY ,true));
*/
//curl_setopt($ci, CURLOPT_URL, SAE_FETCHURL_SERVICE_ADDRESS );
//print_r( $header_array );
$header_array2=array();
if( $multi )
$header_array2 = array("Content-Type: multipart/form-data; boundary=" . OAuthUtil::$boundary , "Expect: ");
foreach($header_array as $k => $v)
array_push($header_array2,$k.': '.$v);
curl_setopt($ci, CURLOPT_HTTPHEADER, $header_array2 );
curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );
//echo $url."<hr/>";
curl_setopt($ci, CURLOPT_URL, $url);
$response = curl_exec($ci);
$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);
$this->http_info = array_merge($this->http_info, curl_getinfo($ci));
$this->url = $url;
//echo '=====info====='."\r\n";
//print_r( curl_getinfo($ci) );
//echo '=====$response====='."\r\n";
//print_r( $response );
curl_close ($ci);
return $response;
}
/**
* Get the header info to store.
*
* @return int
*/
function getHeader($ch, $header) {
$i = strpos($header, ':');
if (!empty($i)) {
$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));
$value = trim(substr($header, $i + 2));
$this->http_header[$key] = $value;
}
return strlen($header);
}
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/sinaoauth.inc.php | PHP | gpl3 | 53,769 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="keywords" content="免费发布微博招聘、求职信息,免费定制微职位、微简历" />
<meta name="description" content="歪伯乐专业聚合微博碎片化职位和简历,为招聘企业提供职位发布和管理、简历搜索和过滤等服务,为求职者提供简历编制和发送、职位搜索和定制等服务,是微招聘时代的新平台" />
<meta name="google-site-verification" content="u38PD1jd9z3R0dAL6Syq-FDaxSZ_qzL6mrxhp-yEhw4" />
<link rel="icon" href="favicon_big.png" sizes="48x48">
<link rel="shortcut icon" href="/favicon.ico" />
<title>歪伯乐微招聘 - 微博招聘、求职、简历信息,一站聚合、管理、定制</title>
<link rel="stylesheet" href="ybole_index.css">
<script src="script/jquery-1.5.2.js" type="text/javascript" ></script>
<script src="script/ybole_index.js" type="text/javascript" ></script>
<script type="text/javascript">
function showCg(){
var divdetail = document.getElementById("categorydetail");
if (divdetail.style.display=="block"){divdetail.style.cssText = "display: none;"; }
else { divdetail.style.cssText = "display: block;"; }
}
</script>
<script type="text/javascript">
function retclick(text){
document.getElementById("categoryname").setAttribute("value",text);}
function Search()
{
var cate=$("#categoryname").val();
switch (cate)
{
case "全部分类":
cate=0;
break;
case "互联网":
cate=1;
break;
case "移动互联网":
cate=2;
break;
case "网络游戏":
cate=3;
break;
case "电子商务":
cate=4;
break;
case "软件·电信":
cate=5;
break;
case "新媒体":
cate=6;
break;
case "投资·银行":
cate=7;
break;
case "其他":
cate=8;
break;
}
var text=$("#searchinput").val();
if (text != "输入职位关键词:职位名 工作地 公司名") {
location = "/?search=" + encodeURIComponent(text) + "&cat=" + cate;
}
}
function KeySearch(event)
{
if (event.which==13)
{
var cate=$("#categoryname").val();
switch (cate)
{
case "全部分类":
cate=0;
break;
case "互联网":
cate=1;
break;
case "移动互联网":
cate=2;
break;
case "网络游戏":
cate=3;
break;
case "电子商务":
cate=4;
break;
case "软件·电信":
cate=5;
break;
case "新媒体":
cate=6;
break;
case "投资·银行":
cate=7;
break;
case "其他":
cate=8;
break;
}
var text=$("#searchinput").val();
if (text != "输入职位关键词:职位名 工作地 公司名") {
location = "/?search=" + encodeURIComponent(text) + "&cat=" + cate;
}
}
}
</script>
</head>
<body>
<div id="index_top">
<div class="layout_mid">
<div class="ybole_logo fl"></div>
<div class="searcharea fr" id="searcharea" style="border:'2px solid #000000';color:black;">
<input type="text" class="search_info fl" id="searchinput" value="输入职位关键词:职位名 工作地 公司名" onblur="if(this.value=='')this.value='输入职位关键词:职位名 工作地 公司名';" onfocus="if(this.value=='输入职位关键词:职位名 工作地 公司名')this.value=''" style="left: 0px; top: 5px; width: 350px" />
<input type="submit" value="" class="bg btn_search fr" onclick="Search()" onkeypress="KeySearch(event)"/>
<input type="button" value="全部分类" class="bg jobcategory fr" id="categoryname" onclick="showCg()" />
<div class="categorydetail" id="categorydetail">
<div class="arrow1"></div>
<div class="arrow2"></div>
<div class="detailbox">
<ul>
<li><input type="radio" name="radiocategory" value="全部分类" checked="checked" onclick="retclick(this.value)"/>全部分类</li>
<li><input type="radio" name="radiocategory" value="互联网" onclick="retclick(this.value)"/>互联网</li>
<li><input type="radio" name="radiocategory" value="移动互联网" onclick="retclick(this.value)"/>移动互联网</li>
<li><input type="radio" name="radiocategory" value="网络游戏" onclick="retclick(this.value)"/>网络游戏</li>
<li><input type="radio" name="radiocategory" value="电子商务" onclick="retclick(this.value)"/>电子商务</li>
<li><input type="radio" name="radiocategory" value="软件·电信" onclick="retclick(this.value)"/>计算机软件·电信</li>
<li><input type="radio" name="radiocategory" value="新媒体" onclick="retclick(this.value)"/>新媒体</li>
<li><input type="radio" name="radiocategory" value="风投·银行" onclick="retclick(this.value)"/>风险投资·投资银行</li>
<li><input type="radio" name="radiocategory" value="其他" onclick="retclick(this.value)"/>其他</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="index_wrap">
<div class="layout_mid">
<div id="index_info" class="bg fl">
<input type="button" value="" class="bg index_login" onclick="javascript:window.location='/login'"/>
</div>
<div id="index_msgs" class="fl">
<div class="bg fl bglt"></div>
<div class="fl bgmid">
<ul class="list_msgs" id="itemfirst">
</ul>
</div>
<div class="bg fl bgrt"></div>
<div class='bottom_cover'></div>
<div class="bg msg_newnum">今日新增:<a id="number"></a>个职位</div>
</div>
<div id="index_hotnews">
<div class="title">热招中...</div>
<div class="hotjobs"></div>
<ul class="hotcompanys">
<a><li id="cp1"></li></a>
<a><li id="cp2"></li></a>
<a><li id="cp3"></li></a>
<a><li id="cp4"></li></a>
<a><li id="cp5"></li></a>
</ul>
</div>
</div>
</div>
<div class="layout_mid">
<div id="index_foot">
<ul>
<li><a>网站帮助</a> | <a>意见反馈</a> | <a>联系我们 </a></li>
<li>CopyRight © 2011-2012 歪伯乐</li>
</ul>
</div>
</div>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/uindex.html | HTML | gpl3 | 6,298 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>网站帮助 - 歪伯乐微招聘 - 微博招聘、求职、简历信息,一站聚合、管理、定制</title>
<link rel="icon" href="favicon_big.png" sizes="48x48">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="css/themes/base/jquery.ui.all.css" rel="Stylesheet" type="text/css" />
<link href="css/share.css" rel="stylesheet" type="text/css" />
<link href="css/help_feedback.css" rel="stylesheet" type="text/css" />
<link href="css/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script src="script/jquery-1.5.1.js" type="text/javascript"></script>
<script src="script/jquery.cookie.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.resizable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.dialog.js" type="text/javascript"></script>
<script src="script/share.js" type="text/javascript"></script>
<script src="script/help_feedback.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22822126-1']);
_gaq.push(['_setDomainName', '.ybole.com']);
_gaq.push(['_trackPageview']);
$(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
});
</script>
</head>
<body>
<div id="header">
<div class="left" id="links">
<a class="left first" href="/">歪伯乐招聘网</a> <a class="left" href="http://t.sina.com.cn/2020566725">
歪伯乐招聘官方微博</a> <a class="left logined" id="my-microbloging">我的微博</a>
</div>
<div class="right" id="infos">
<a class="left selected logined" id="name" href="/"></a><a class="left orange logined"
href="/manager" id="manager-center">管理中心</a> <a class="left jobs" id="jobs-publish-quick">
发布求职信息</a><a class="left recruitment" id="recruitment-publish-quick">发布招聘信息</a><a
class="left admin" href="/admin">管理员入口</a> <a class="left logined" href="logout/">退出</a>
<a class="left logouted" id="sina-login" href="login/"></a>
</div>
</div>
<div id="logo-search">
<a id="logo" class="left" href="/">测试版</a>
</div>
<div id="content" class="inner">
<div class="left" id="content-left">
<div>
<a href="/help" style="text-decoration: underline;">网站帮助</a></div>
<div>
<a href="/feedback">意见反馈</a></div>
</div>
<div class="left" id="content-middle">
<div class="left" id="inner-content">
<p>
<strong>关于我们</strong></p>
<p>
<strong>1.歪伯乐招聘网是什么?</strong></p>
<p>
歪伯乐招聘网(yBole.com) 是一款全新的微博招聘求职聚合和撮合平台,致力于创建崭新的社交招聘应用服务。</p>
<p style="margin-left: 21pt;">
<strong>对招聘者:</strong>歪伯乐不仅提供了免费、快捷发布招聘信息并同步到新浪微博的服务,同时提供给招聘企业展示自身企业文化和交流的社交渠道,并能快速挖掘应聘者背景,提高招聘的精准度和有效性。</p>
<p style="margin-left: 21pt;">
<strong>对求职者:</strong>歪伯乐同步微博,每天聚合最鲜活的职位,提供个性化职位定制服务。</p>
<p>
<strong>2.支持的微博平台</strong></p>
<p>
目前歪伯乐招聘网支持新浪微博平台。随着接口的开放,我们支持的微博将会越来越多。</p>
<p>
<strong>3.目前微博开放的绑定协议</strong></p>
<p>
Basic Authentication 和Oauth协议。</p>
<p>
<strong>4.账号安全与保密</strong></p>
<p>
对于OAuth协议,我们只是关联到您的微博网站进行相应的认证,对于Basic认证,采用加密的方式,不会对您的账号安全构成任何威胁。</p>
</div>
</div>
</div>
<div class="clear">
</div>
<div id="footer" class="inner">
<div id="footerlinks">
<a href="/help">网站帮助</a> | <a href="/feedback">意见反馈</a> | <a>联系我们</a></div>
<div id="copyright">
CopyRight © 2011-2012 <a>歪伯乐招聘网</a> Co. All Right Reserved. 鄂ICP证100111号<br />
Powered by:GNG</div>
</div>
<div id="cover">
</div>
<div id="jobs-publish" class="absolute">
<div id="jobs-publish-title">
<span class="left">发布求职信息</span> <a class="right"></a>
</div>
<div id="jobs-publish-content">
<div id="jobs-publish-remain">
还可输入136个字</div>
<div id="jobs-publish-text">
<textarea>#求职#</textarea>
</div>
<div id="jobs-publish-tags-hot">
</div>
<div id="jobs-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="recruitment-publish" class="absolute">
<div id="recruitment-publish-title">
<span class="left">发布招聘信息</span> <a class="right"></a>
</div>
<div id="recruitment-publish-content">
<div id="recruitment-publish-remain">
还可输入136个字</div>
<form action="tweet/post/2" name="postform" id="RecruitmentForm" method="post" enctype="multipart/form-data" target="hf">
<div id="recruitment-publish-text">
<textarea name="text">#招聘#</textarea>
</div>
<div id="recruitment-publish-tags-hot">
</div>
<div id="recruitment-publish-file"><span class="left">上传图片</span><input type="file" name="upload" id="file" /></div>
</form>
<div id="recruitment-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="popBox_publishok" class="popBox popBoxwd1" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
信息发布提示</h4>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_tip">
</div>
<div class="font_tip">
信息发布成功!</div>
</div>
<div class="line2">
<div class="font_tip2" style="line-height: 18px;">
信息已同步到新浪微博,本信息将在稍后显示<br>
在本网站中,请不要重复发布。</div>
</div>
<div class="line3">
<a class="popboxicon btn_ikown" onclick="$('#popBox_publishok').hide();">好的,我知道了</a></div>
</div>
</div>
<div id="LFlower" style="display: none; position: absolute;
z-index: 3000;"></div>
<iframe id="hf" name="hf" style="display:none;"></iframe>
<div id="error-info" title="错误">
<p id="errormsg">
</p>
</div>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/help.html | HTML | gpl3 | 8,799 |
<?php
include_once('common.inc.php');
func_register(array(
'cate' => array(
'callback' => 'theme_cat',
),
));
$current_theme = false;
function theme()
{
global $current_theme;
$args = func_get_args();
$function = array_shift($args);
$function = 'theme_'.$function;
if ($current_theme) {
$custom_function = $current_theme.'_'.$function;
if (function_exists($custom_function))
$function = $custom_function;
}
elseif (!function_exists($function))
return "<p>Error: theme function <b>$function</b> not found.</p>";
return call_user_func_array($function, $args);
}
function theme_template($template)
{
$page = file_get_contents($template);
#FIXME: Should use flexible theme functions here
echo $page;
}
function theme_external_link($url, $content = null)
{
if (!$content)
{
return "<a class='item-blog-link' href='".long_url($url)."' target='_blank'>".$url."</a>";
}
else
{
return "<a class='item-blog-link' href='$url' target='_blank'>$content</a>";
}
}
function parselink($out)
{
require_once("autolink.inc.php");
$autolink = new Twitter_Autolink();
$out = $autolink->autolink($out);
return $out;
}
function parsekeywordforpreg($str)
{
#$str = str_replace("++", "\\+\\+", $str);
$str = str_replace("+", "\\+", $str);
$str = str_replace("*", "\\*", $str);
$str = str_replace("?", "\\?", $str);
$str = str_replace("/", "\\/", $str);
$str = str_replace(".", "\\.", $str);
#$str = str_replace("\\", "\\/", $str);
return $str;
}
function parsekeyword($keyword, $out)
{
$keyword = explode(" ",$keyword);
foreach($keyword as $key)
{
if(!$key)
continue;
if($key === "c" or $key === "C")
$key = "C++";
if($key and $key !== "all" and strlen($key) >= 2)
{
#$out = preg_replace('/(>.*?)('.$key.')(.*?<)/i', '${1}<span class=\'highlight\'>${2}</span>${3}', $out);
#$out = preg_replace('/('.parsekeywordforpreg($key).')/i', '<span class=\'highlight\'>${1}</span>', $out);
#$out = preg_replace('$href=\\"([^<]*)(<span[^>]+>([^<]*)</span>([^"]*))+\\"$i',
# 'href="${1}${3}${4}"', $out);
#$out = preg_replace('$title=\\"([^<]*)(<span[^>]+>([^<]*)</span>([^"]*))\\"$i',
# 'title="${1}${3}${4}"', $out);
#out = preg_replace('$class=\\"([^<]*)(<span[^>]+>([^<]*)</span>([^"]*))\\"$i',
# 'title="${1}${3}${4}"', $out);
preg_match_all('$<[^>]+>[^<]*</[^>]+>$', $out, $links);
$notlink = preg_split('$<[^>]+>[^<]*</[^>]+>$', $out);
$out = "";
foreach($notlink as $str)
$out .= preg_replace('/('.parsekeywordforpreg($key).')/i', '<span class=\'highlight\'>${1}</span>', $str).array_shift($links[0]);
}
}
return $out;
}
function theme_page($title, $content) {
ob_start('ob_gzhandler');
header('Content-Type: text/html; charset=utf-8');
echo $content;
//exit();
}
function theme_cat()
{
include_once("common.inc.php");
$content = "";
$result = get_categories();
$i = 0;
foreach($result as $r)
{
if($i%2==0)
$pre = " sorts-item-alternative";
else
$pre = "";
$content .= '<div class="sorts-item'.$pre.'">
<a id='.$i++.'>'.$r['name'].'</a></div>';
}
echo $content;
}
function theme_left()
{
include_once("login.inc.php");
$content = "";
if(user_is_authenticated())
{
$content .= theme("follow");
$content .= theme("history");
}
$content .= theme("hot");
return $content;
}
function theme_google_analytics()
{
global $GA_ACCOUNT;
if (!$GA_ACCOUNT) return '';
$googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
return "<img src='{$googleAnalyticsImageUrl}' />";
}
function theme_login()
{
include_once("login.inc.php");
$content = "";
if(user_is_authenticated())
$content .= '<a class="left selected logined" id="name">'.$GLOBALS['user']['nickname'].'</a> <a class="left orange logined">
信息管理</a> <a class="left logined jobs" id="jobs-publish-quick">发布求职信息</a><a class="left logined recruitment"
id="recruitment-publish-quick">发布应聘信息</a> <a class="left logined" href="'.BASE_URL.'logout">退出</a>';
else
$content .= '<a class="left logouted" id="sina-login" href="'.BASE_URL.'sina_login"></a>';
return $content;
}
function time_tran($the_time){
$now_time = date("Y-m-d H:i:s",time());
$now_time = strtotime($now_time);
$show_time = strtotime($the_time);
$dur = $now_time - $show_time;
if($dur < 0)
return $the_time;
elseif($dur < 60)
return $dur.'秒前';
elseif($dur < 3600)
return floor($dur/60).'分钟前';
elseif($dur < 86400)
return floor($dur/3600).'小时前';
elseif($dur < 259200) //3天内
return floor($dur/86400).'天前';
else
return $the_time;
}
function theme_mini($result)
{
$content = "";
foreach($result as $r)
{
$jg = parselink(str_replace(array("<", ">"), array("<", ">"), $r['content']));
if(strstr($r['source'], '<'))
$source = str_replace("<a ", '<a target="_blank" class="left microblog-item-position"', $r['source']);
else
$source = '<a class="left microblog-item-position" target="_blank">'.$r['source'].'</a>';
$content .= '
<li class="index_listitem">
<div class="fl item_pic"><img alt="" width="50" height="50" src="'.$r['profile_image_url'].'" /></div>
<div class="fl item_content">
<a class="nickname" target="_blank" href="'.BASE_URL.'profile/'.$r['post_screenname'].'">
'.$r['post_screenname'].':</a>'.$jg.'
<p class="">
<span class="fl" style="color: #a2a2a2;">'.time_tran($r['post_datetime']).' '.$source.'</span><span class="fr" style="color: #ea7f37;">申请该职位 | 收藏</span>
</p>
</div>
</li>';
}
echo $content;
}
function theme_result($result, $keyword = '', $admin = false)
{
include_once("login.inc.php");
include_once("hot.inc.php");
if(user_is_authenticated())
{
include_once("like.inc.php");
$allfav = get_likes(32767, "");
include_once("apply_sent.inc.php");
$allapp = get_sent_applies(32767, "");
}
$content = "";
foreach($result as $r)
{
if($keyword)
$jg = parsekeyword($keyword, parselink(str_replace(array("<", ">"), array("<", ">"), $r['content'])));
#$jg = parselink(parsekeyword($keyword, $r['content']));
else
$jg = parselink(str_replace(array("<", ">"), array("<", ">"), $r['content']));
$tags = get_tags($r['tweet_id']);
if(strstr($r['source'], '<'))
$source = str_replace("<a ", '<a target="_blank" class="left microblog-item-position"', $r['source']);
else
$source = '<a class="left microblog-item-position" target="_blank">'.$r['source'].'</a>';
$content .= '<div class="microblog-item" id="'.strtotime($r['post_datetime']).'">
<div class="left microblog-item-pic">
<a target="_blank" href="'.BASE_URL.'profile/'.$r['post_screenname'].'"><img alt="" width="50" height="50" src="'.$r['profile_image_url'].'"/></a>
</div>
<div class="left microblog-item-content">
<div class="microblog-item-blog">
<a class="microblog-item-blog-name" target="_blank" href="'.BASE_URL.'profile/'.$r['post_screenname'].'">'
.$r['post_screenname'].'</a>:'.$jg.'
</div>';
if($r['thumbnail'])
$content .= '
<div><a onclick="ShowMiddlePic(\''.str_replace("/thumbnail/", "/bmiddle/", $r['thumbnail']).'\')"><img src="'.$r['thumbnail'].'" /></a></div>';
$content .= '
<div class="microblog-item-other">
<a target="_blank" href="http://api.t.sina.com.cn/'.$r['user_site_id'].'/statuses/'.$r['tweet_site_id'].'" class="left microblog-item-time">'.time_tran($r['post_datetime']).'</a> '.$source;
if($admin)
$content .= '<a class="right item-control last delete" onclick="DeleteTweet(\''.$r['tweet_id'].'\', this)">删除</a>';
else
{
if(user_is_authenticated())
{
$fav = 0;
$app = 0;
foreach($allfav as $f)
if($f['tweet_id'] == $r['tweet_id'])
{
$fav = 1;
break;
}
foreach($allapp as $f)
if($f['tweet_id'] == $r['tweet_id'])
{
$app = 1;
break;
}
if(!$fav)
$content .= '<a class="right microblog-item-control like" onclick="JobLike(this,\''.$r['tweet_id'].'\')">收藏</a><a class="right microblog-item-control unlike"
style="display: none;" onclick="JobUnLike(this,\''.$r['tweet_id'].'\')">取消收藏</a> ';
else
$content .= '<a class="right microblog-item-control like" style="display: none;" onclick="JobLike(this,\''.$r['tweet_id'].'\')">收藏</a><a class="right microblog-item-control unlike"
onclick="JobUnLike(this,\''.$r['tweet_id'].'\')">取消收藏</a> ';
$role = get_current_user_role();
if($role == 1)
{
if($r['type'] != 1 and !$app)
$content .= '<a class="right microblog-item-control microblog-item-apply apply" onclick="JobApply(this,\''.$r['tweet_id'].'\',\''.$r['post_screenname'].'\')">
申请该职位</a><a class="right microblog-item-control microblog-item-apply unapply" style="display: none;" onclick="JobUnApply(this,\''.$r['tweet_id'].'\')">
取消申请</a>';
elseif($app)
$content .= '<a class="right microblog-item-control microblog-item-apply apply" style="display: none;" onclick="JobApply(this,\''.$r['tweet_id'].'\',\''.$r['post_screenname'].'\')">
申请该职位</a><a class="right microblog-item-control microblog-item-apply unapply" onclick="JobUnApply(this,\''.$r['tweet_id'].'\')">
取消申请</a>';
}
}
if($tags)
{
$content.='</div><div class="microblog-item-other1">
<span class="left microblog-item-relate">相关职位:</span> ';
foreach($tags as $t)
$content.='<a class="left keyword microblog-item-relate" onclick="SearchContent(false, \''.$t.'\', 0, 0)">'.$t.'</a>';
}
}
$content .= '
</div>
</div>
</div>';
}
return $content;
}
function theme_rss($result)
{
header('Content-Type: application/xml; charset=utf-8');
$content = '<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>'.$GLOBALS['search'].'最新职位订阅-歪伯乐</title>
<link>'.BASE_URL.'search/'.$GLOBALS['search'].'</link>
<description>Latest 10 threads of all jobs</description>
<copyright>Copyright(C) 歪伯乐</copyright>
<generator>YBole by GNG.</generator>
<lastBuildDate>'.date(DATE_RSS).'</lastBuildDate>
<ttl>30</ttl>
<image>
<url>'.BASE_URL.'images/logo.gif</url>
<title>'.$GLOBALS['search'].'最新职位订阅-歪伯乐</title>
<link>'.BASE_URL.'search/'.$GLOBALS['search'].'</link>
</image>';
foreach($result as $r)
$content .= '<item>
<title>'.$r['post_screenname'].":".mb_substr($r['content'], 0, 15, "utf8").'...</title>
<link>http://api.t.sina.com.cn/'.$r['user_site_id'].'/statuses/'.$r['tweet_site_id'].'</link>
<description><![CDATA['.$r['content'].']]></description>
<pubDate>'.date(DATE_RSS, strtotime($r['post_datetime'])).'</pubDate>
</item>';
$content .= '
</channel>
</rss>';
echo $content;
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/theme.inc.php | PHP | gpl3 | 12,802 |
<?php
include_once('common.inc.php');
func_register(array(
'search' => array(
'callback' => 'deal_search',
),
'history' => array(
'callback' => 'deal_search_history',
'security' => 'true',
),
));
function theme_search($key, $content)
{
/*if($title=='首页')
{
$GLOBALS['search'] = "淘宝";
include_once("common.inc.php");
$counts = get_counts();
$pre = '<div id="radio">
本周新增职位'.$counts['tweets_thisweek'].'个,今日新增职位'.$counts['tweets_today'].'个</div>
<div id="microblogs">';
}
else
{
$GLOBALS['search'] = $key;
$pre = '<div id="search-result-outer">
<div id="search-result">
<div class="left">
#<a class="keyword">'.$key.'</a>#的搜索结果</div>';
#include_once("follow.inc.php");
$pre .= '<a id="search-result-concern" class="left"></a>';
$pre .= '<a id="search-result-rss" class="right">
</a>
</div>
</div>';
}
$content = $pre.$content;*/
theme('page', $key, $content);
}
function get_search_result($key, $num, $cate, $time, $page, $count = false)
{
connect_db();
$tag = false;
$relevance = "";
$order = "ORDER BY tweets.post_datetime DESC";
if($key === "c" or $key === "C")
$key = "C++";
if($key and $key != "all")
{
$view = "SELECT * FROM tags WHERE name = '$key' LIMIT 1";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$key = " AND tweets.tweet_id IN (SELECT tweet_id FROM tag_relationship WHERE tag_id IN (SELECT tag_id FROM tags WHERE name = '$key'))";
$tag = true;
}
}
if($key and $key != "all" and !$tag)
{
#$key = explode(" ",$key);
#$key = "%".implode("%",$key)."%";
#$key = " AND (tweets.content LIKE '$key' OR tweets.post_screenname LIKE '$key')";
if(mb_strlen($key, "utf8") > 3)
{
#$relevance = ",MATCH(tweets.post_screenname,tweets.content) AGAINST ('$key' IN NATURAL LANGUAGE MODE) AS relevance";
$key = " AND MATCH(tweets.post_screenname,tweets.content) AGAINST ('$key' IN NATURAL LANGUAGE MODE) > 5";
#$order = "ORDER BY relevance DESC";
}
else
$key = " AND MATCH(tweets.post_screenname,tweets.content) AGAINST ('$key' IN BOOLEAN MODE)";
}
elseif(!$tag)
$key = "";
if($cate and $cate!="0")
{
#$cate1 = ",(SELECT tweet_id from cat_relationship WHERE cat_id='$cate') AS cate";
#$cate2 = " AND tweets.tweet_id=cate.tweet_id";
$cate1 = "";
$cate2 = " AND tweets.tweet_id IN (SELECT tweet_id from cat_relationship WHERE cat_id='$cate')";
}
else
{
#$cate1 = ",(SELECT tweet_id from cat_relationship WHERE cat_id!=8) AS cate";
#$cate2 = " AND tweets.tweet_id=cate.tweet_id";
$cate1 = $cate2 = "";
}
$limit = " LIMIT 0 , $num";
$content = "*";
if($count)
{
$content = "COUNT(tweets.tweet_id)";
$limit = "";
$time = "";
}
elseif($page)
{
$page = intval($page) * $num;
$limit = " LIMIT $page , $num";
$time = "";
}
elseif($time)
{
if(intval($time) > 0)
$fuhao = ">";
else
{
$fuhao = "<";
$time = strval(0 - intval($time));
}
$time = " AND tweets.post_datetime".$fuhao."\"".date('Y-m-d H:i:s', $time)."\"";
}
$view = "SELECT $content$relevance FROM tweets$cate1 WHERE tweets.deleted = 0$key$cate2$time $order $limit";
#return array(array('content' => $view));
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
{
$result[$i++] = $row;
if($i == $num)
break;
}
return $result;
}
function search_mini()
{
$data = get_search_result("", 10, "", "", "");
theme('mini', $data);
}
function search_show()
{
$args = func_get_args();
$cate = $args[2];
$time = get_post('time');
$page = get_post('page');
$key = trim(get_post('search'));
$admin = get_post('admin');
if($key and $key != "all")
{
include_once('login.inc.php');
if(user_is_authenticated())
search_history_add("", "", $cate);
}
$data = get_search_result($key, 10, $cate, $time, $page);
if(!$page and !$time and !$admin)
{
search_count("", "", $cate);
echo ',';
include_once('follow.inc.php');
if($key and $key != "all")
following_exist("", "", $key);
else
echo '0';
echo ',';
}
$content = theme('result', $data, $key, $admin);
theme('search', $key, $content);
}
function search_count()
{
$args = func_get_args();
$cate = $args[2];
$key = trim(get_post('search'));
connect_db();
$view = "SELECT * FROM searches WHERE search = '$key' AND cat_id = '$cate' LIMIT 1";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$now_time = date("Y-m-d H:i:s",time());
$now_time = strtotime($now_time);
if($row['resultcounttime'])
$save_time = strtotime($row['resultcounttime']);
if(isset($save_time) and $now_time - $save_time < 3600)
{
theme('page', 'count', $row['resultnum']);
return;
}
}
$data = get_search_result($key, 10, $cate, "", "",true);
$view = "UPDATE searches SET resultnum = '".$data[0][0]."', resultcounttime = '".date("Y-m-d H:i:s",time())."' WHERE search = '$key' AND cat_id = '$cate'";
$list = mysql_query($view);
theme('page', 'count', $data[0][0]);
}
function search_rss()
{
$args = func_get_args();
$cate = $args[2];
$key = $args[3];
if(!$key)
die("Invalid argument!");
$data = get_search_result($key, 10, $cate, "", "");
$GLOBALS['search'] = $key;
theme('rss', $data);
}
function deal_search($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'search_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
function get_search_history($num)
{
include_once('login.inc.php');
$id = get_current_user_id();
connect_db();
$view = "SELECT * FROM searchhistory WHERE user_id='$id' AND deleted=0 ORDER BY add_time DESC";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
{
$result[$i++] = $row;
if($i == $num)
break;
}
return $result;
}
function search_history_show()
{
$args = func_get_args();
$key = intval($args[2]);
$data = get_search_history($key);
$content = '';
foreach($data as $h)
{
$search = mb_substr($h['search'], 0, 20, "utf8");
if($search != $h['search'])
$search .= '...';
$content .= '<div class="history-item" onmouseover="HistoryMouseOver(this)" onmouseout="HistoryMouseOut(this)" onclick="HistoryClick(\''.$h['cat_id'].'\',\''.$h['search'].'\')">
<a>'.$search.'</a></div>';
}
$content .= '</div>';
echo $content;
}
function search_history_delete()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM searchhistory WHERE user_id='$id' AND history_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$view = "UPDATE searchhistory SET deleted='1' WHERE user_id='$id' AND history_id='$key'";
$list = mysql_query($view) or die("Delete error!");
}
else
{
print $key;
die(": Non-exist Error!");
}
}
function search_history_deleteall()
{
include_once('login.inc.php');
$id = get_current_user_id();
connect_db();
$view = "UPDATE searchhistory SET deleted='1' WHERE user_id='$id'";
$list = mysql_query($view) or die("Delete error!");
header("Location: ".BASE_URL);
}
function search_history_add()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$cat = $args[2];
if(!$cat)
$cat = 0;
$key = get_post('search');
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM searchhistory WHERE cat_id='$cat' AND user_id='$id' AND search='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
search_history_delete("", "", $row['history_id']);
}
include_once("uuid.inc.php");
$v4uuid = str_replace("-", "", UUID::v4());
$current_datetime = date('Y-m-d H:i:s');
$view = "INSERT INTO searchhistory(history_id, search, user_id, deleted, add_time, cat_id) VALUES ('$v4uuid', '$key', '$id', '0', '$current_datetime', '$cat')";
$list = mysql_query($view) or die("Insert error!");
$view = "SELECT * FROM searches WHERE search='$key' AND cat_id='$cat'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$currentnum = intval($row['count']) + 1;
$view = "UPDATE searches SET count = '$currentnum' WHERE search='$key' AND cat_id='$cat'";
#echo $currentnum.$key.$cat;
$list = mysql_query($view) or die("Update count error!");
}
else
{
$view = "INSERT INTO searches(search, cat_id, count) VALUES('$key', '$cat', '1')";
$list = mysql_query($view) or die("Insert count error!");
}
}
function deal_search_history($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'search_history_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/search.inc.php | PHP | gpl3 | 10,181 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta name="keywords" content="免费发布微博招聘、求职信息,免费定制微职位、微简历" />
<meta name="description" content="歪伯乐专业聚合微博碎片化职位和简历,为招聘企业提供职位发布和管理、简历搜索和过滤等服务,为求职者提供简历编制和发送、职位搜索和定制等服务,是微招聘时代的新平台" />
<meta name="google-site-verification" content="u38PD1jd9z3R0dAL6Syq-FDaxSZ_qzL6mrxhp-yEhw4" />
<title>歪伯乐微招聘 - 微博招聘、求职、简历信息,一站聚合、管理、定制</title>
<link rel="icon" href="favicon_big.png" sizes="48x48">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="css/share.css" rel="stylesheet" type="text/css" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<link href="css/popupBox.css" rel="stylesheet" type="text/css" />
<link href="css/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="feed/CSS/feed.css" rel="stylesheet" media="all" />
<script src="script/jquery-1.5.1.js" type="text/javascript"></script>
<script src="script/jquery.query-2.1.7.js" type="text/javascript"></script>
<script src="script/jquery.cookie.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.mouse.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.position.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="script/ui/jquery.ui.dialog.js" type="text/javascript"></script>
<script type="text/javascript" src="feed/feed.js" charset="UTF-8"></script>
<script src="script/share.js" type="text/javascript"></script>
<script src="script/default.js" type="text/javascript"></script>
<script src="script/DMshare.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22822126-1']);
_gaq.push(['_setDomainName', '.ybole.com']);
_gaq.push(['_trackPageview']);
$(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
$("#search-result-rss").addfeed();
});
</script>
</head>
<body>
<div id="header">
<div class="left" id="links">
<a class="left first" href="/">歪伯乐招聘网</a> <a class="left" href="http://t.sina.com.cn/2020566725">
歪伯乐招聘官方微博</a> <a class="left logined" id="my-microbloging">我的微博</a>
</div>
<div class="right" id="infos">
<a class="left selected logined" id="name" href="/"></a><a class="left orange logined"
href="/manager" id="manager-center">管理中心</a> <a class="left jobs" id="jobs-publish-quick">
发布求职信息</a><a class="left recruitment" id="recruitment-publish-quick">发布招聘信息</a><a
class="left admin" href="/admin">管理员入口</a> <a class="left logined" href="logout/">退出</a>
<a class="left logouted" id="sina-login" href="login/"></a>
</div>
</div>
<div id="logo-search">
<a id="logo" class="left" href="/">测试版</a>
<div id="search-bar" class="left">
<a class="left" id="sort" onclick="ShowSorts()" name="0" title="全部分类">全部分类▼</a>
<input class="left" id="search-text" type="text" value="职位关键字,如:北京 产品经理 阿里巴巴" />
<a class="left" id="search-button"></a>
</div>
</div>
<div id="company" class="inner">
<span class="left company-name">热门企业:</span>
<div class="left" id="companies">
<div id="companies-inner">
<a class="company-name first" onclick="HotCompany(this)">新浪</a><a class="company-name"
onclick="HotCompany(this)">腾讯</a><a class="company-name" onclick="HotCompany(this)">百度</a><a
class="company-name" onclick="HotCompany(this)">淘宝</a><a class="company-name" onclick="HotCompany(this)">搜狐</a><a
class="company-name" onclick="HotCompany(this)">创新工场</a><a class="company-name" onclick="HotCompany(this)">凡客</a><a
class="company-name" onclick="HotCompany(this)">支付宝</a><a class="company-name" onclick="HotCompany(this)">奇艺</a><a
class="company-name" onclick="HotCompany(this)">联想</a><a class="company-name" onclick="HotCompany(this)">华为</a><a
class="company-name" onclick="HotCompany(this)">街旁</a><a class="company-name" onclick="HotCompany(this)">中兴</a><a
class="company-name" onclick="HotCompany(this)">网龙</a><a class="company-name" onclick="HotCompany(this)">网易</a><a
class="company-name" onclick="HotCompany(this)">戴尔</a><a class="company-name" onclick="HotCompany(this)">人民网</a><a
class="company-name" onclick="HotCompany(this)">小米科技</a><a class="company-name" onclick="HotCompany(this)">金山</a></div>
</div>
<div class="left" id="company-control">
<a class="left company-control" id="company-control-left">◀</a> <a class="left company-control"
id="company-control-right">▶</a>
</div>
</div>
<div id="content" class="inner">
<div id="left" class="left">
<div id="blank">
</div>
<div class="left-title first logined">
<span class="left-title-text left" id="concern-title">我的关注</span> <a class="right left-title-pic"
id="concern-pic"></a>
</div>
<div id="concern" class="logined">
</div>
<div class="left-title logined">
<span class="left left-title-text">搜索历史</span> <a class="right left-title-pic" id="history-pic"
onmouseover="HistoryPicMouseOver(this)" onmouseout="HistoryPicMouseOut(this)"
onclick="HistoryPicClick()"></a>
</div>
<div id="history" class="logined">
</div>
<div id="hot">
</div>
</div>
<div id="right" class="left">
<div id="radio">
</div>
<div id="microblogs">
<div id="search-result-outer">
<div id="search-result">
<div class="left">
</div>
<a id="search-result-rss" class="right"></a><a id="search-result-concern" class="right search-result-concern"
onmouseover="SearchConcernMouseOver(this)" onmouseout="SearchConcernMouseOut(this)"
onmousedown="SearchConcernMouseDown(this)" onclick="SearchConcernClick()"></a>
</div>
</div>
<div id="fresh-outer">
<div id="fresh">
</div>
</div>
<div id="fresh-blogs" style="display: none; border-bottom: 1px #dedede solid">
</div>
<div id="blogs">
</div>
<div id="flower" style="text-align: center; display: none;">
<img src="images/loading.gif" alt="" />正在加载中...
</div>
<div id="pages">
</div>
<!--
<div id="backTop" class="absolute">
<a>▲回到顶部</a>
</div>
-->
</div>
</div>
</div>
<div id="footer" class="inner">
<div id="footerlinks">
<a href="/help">网站帮助</a> | <a href="/feedback">意见反馈</a> | <a>联系我们</a></div>
<div id="copyright">
CopyRight © 2011-2012 <a>歪伯乐招聘网</a> Co. All Right Reserved. 鄂ICP证100111号<br />
Powered by:GNG</div>
</div>
<div id="sorts" class="absolute">
<div id="sorts-tag">
<a id="sorts-name" class="left" onclick="HideSorts()">全部分类▼</a>
</div>
<div id="sorts-content">
</div>
</div>
<div id="popBox_apply0" class="popBox popBoxwd1 absolute" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
职位申请</h4>
</div>
<div class="popboxicon btn_close">
<a class="left" style="height: 100%; width: 100%;" onclick="$('#popBox_apply0').hide();">
</a>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_err">
</div>
<div class="font_tip">
还没完善简历?</div>
</div>
<div class="line2">
<div class="font_tip2">
提示:完整的简历会加大您录取的概率哟!</div>
</div>
<div class="line3">
<a class="popboxicon btn_goresume"></a>
</div>
</div>
</div>
<div id="popBox_apply1" class="popBox popBoxwd2 absolute" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
职位申请</h4>
</div>
<div class="popboxicon btn_close">
<a class="left" style="height: 100%; width: 100%;" onclick="$('#popBox_apply1').hide();">
</a>
</div>
</div>
<div class="popBox_main">
<div class="line0">
<span class="font_tip2 fl" id="at-name">@赶集网</span><span class="fr">还可输入<span class="font_tip3"
id="remain-number">115</span>个字</span>
</div>
<div id="text_apply" class="line1">
<textarea rows="4" id="resumeinput" onkeydown="UpdateResumeText(this)" onkeyup="UpdateResumeText(this)"></textarea></div>
<div class="line3">
<div class="add_resume">
<input type="radio" name="def_resume" checked="checked" />
<a href="" target="_blank" class="font_tip2 udl" id="default-resume">默认简历</a> <span>
(<span class="font_tip2">*</span>系统将自动为您附上您的简历)</span>
</div>
<div id="btn_publish" class="popboxicon btn_publish">
<a class="left" style="height: 100%; width: 100%;" onclick="SentResume()"></a>
</div>
</div>
</div>
</div>
<div id="popBox_publishok" class="popBox popBoxwd1" style="display: none;">
<div class="boxtitle">
<div class="popboxicon">
<h4>
信息发布提示</h4>
</div>
</div>
<div class="popBox_main">
<div class="line1">
<div class="popboxicon img_tip">
</div>
<div class="font_tip">
信息发布成功!</div>
</div>
<div class="line2">
<div class="font_tip2" style="line-height: 18px;">
信息已同步到新浪微博,本信息将在稍后显示<br>
在本网站中,请不要重复发布。</div>
</div>
<div class="line3">
<a class="popboxicon btn_ikown" onclick="$('#popBox_publishok').hide();">好的,我知道了</a></div>
</div>
</div>
<div id="error-info" title="错误">
<p id="errormsg">
</p>
</div>
<div id="cover">
</div>
<div id="role-choose" class="absolute role-jobs">
<a id="role-jobs" class="absolute"></a><a id="role-recruitment" class="absolute">
</a><a id="role-confirm" class="absolute"></a>
</div>
<div id="jobs-publish" class="absolute">
<div id="jobs-publish-title">
<span class="left">发布求职信息</span> <a class="right"></a>
</div>
<div id="jobs-publish-content">
<div id="jobs-publish-remain">
还可输入136个字</div>
<div id="jobs-publish-text">
<textarea>#求职#</textarea>
</div>
<div id="jobs-publish-tags-hot">
</div>
<div id="jobs-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="recruitment-publish" class="absolute">
<div id="recruitment-publish-title">
<span class="left">发布招聘信息</span> <a class="right"></a>
</div>
<div id="recruitment-publish-content">
<div id="recruitment-publish-remain">
还可输入136个字</div>
<form action="tweet/post/2" name="postform" id="RecruitmentForm" method="post" enctype="multipart/form-data" target="hf">
<div id="recruitment-publish-text">
<textarea name="text">#招聘#</textarea>
</div>
<div id="recruitment-publish-tags-hot">
</div>
<div id="recruitment-publish-file"><span class="left">上传图片</span><input type="file" name="upload" id="file" /></div>
</form>
<div id="recruitment-publish-confirm">
<a class="right"></a><span class="right">本信息将同步发送到新浪微博</span>
</div>
</div>
</div>
<div id="backTop" class="absolute">
<a>▲回到顶部</a>
</div>
<div id="manager-tips" class="absolute">
<a class="right" onclick="CloseMTips()"></a>
</div>
<div id="concern-tips" class="absolute">
<a class="right" onclick="CloseCTips()"></a>
</div>
<div id="apply-tips" class="absolute">
<a class="right" onclick="CloseATips()"></a>
</div>
<div id="LPic" style="display: none; position: absolute;
z-index: 3000;">
</div>
<div id="LFlower" style="display: none; position: absolute;
z-index: 3000;"></div>
<iframe id="hf" name="hf" style="display:none;"></iframe>
</body>
</html>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/default.html | HTML | gpl3 | 15,620 |
.feed a:hover
{
text-decoration:none;
}
.feed .addbox{ position:absolute; display:block; border:#D9E9EF solid 3px; background:#FFFFFF; width:192px; z-index:998; font-size:12px;}
.feed .bgfrm{filter: alpha(opacity=0);-moz-opacity:0;opacity: 0;}
.feed .addshow{ width:155px; height:auto;}
.feed .addh{ height:20px; background:#EDF5F8;}
.feed .addh .addt{ padding-left:6px; line-height:20px; color:#666666;}
.feed .addbottom{ height:14px; height:18px; background:#EDF5F8; text-align:right; padding:0 6px 0 0; text-align:left; display:none;}
.feed .flist li, .feed .flist .li{white-space:nowrap; overflow:hidden; color:#666; font-weight:normal; text-align:left;!important}
.feed .flist a{ display:block; height:16px; width:70px}
.feed .flist a:link,
.feed .flist a:visited{ color:#666; text-decoration:none;}
.feed .flist a:hover{ color:#7EB937; text-decoration:none;}
.addbottom a:link,
.addbottom a:visited{ color:#0083B1; text-decoration:none;}
.feed_0{ background:url(../images/feed/0.gif) no-repeat left;}
.feed_1{ background:url(../images/feed/1.gif) no-repeat left;}
.feed_2{ background:url(../images/feed/2.gif) no-repeat left;}
.feed_3{ background:url(../images/feed/3.gif) no-repeat left;}
.feed_4{ background:url(../images/feed/4.gif) no-repeat left;}
.feed_5{ background:url(../images/feed/5.gif) no-repeat left;}
.feed_6{ background:url(../images/feed/6.gif) no-repeat left;}
.feed_7{ background:url(../images/feed/7.gif) no-repeat left;}
.feed_8{ background:url(../images/feed/8.gif) no-repeat left;}
.feed_9{ background:url(../images/feed/9.gif) no-repeat left;}
.feed_10{ background:url(../images/feed/10.gif) no-repeat left;}
.feed_11{ background:url(../images/feed/11.gif) no-repeat left;}
.feed_12{ background:url(../images/feed/12.gif) no-repeat left;}
.feed_13{ background:url(../images/feed/13.gif) no-repeat left;}
.feed_14{ background:url(../images/feed/14.gif) no-repeat left;}
.feed_15{ background:url(../images/feed/15.gif) no-repeat left;}
.feed_16{ background:url(../images/feed/16.gif) no-repeat left;}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/feed/CSS/feed.css | CSS | gpl3 | 2,069 |
$.fn.addfeed = function(options){
options = options || {};
//绑定每个按钮
return this.each(function() {
if (!$(this).attr("class").match(/(^|\s)feed($|\s)/)) $(this).addClass("feed");
$$addfeed.initBtn(this);
});
};
var $$addfeed = {
timeDelayout:420,
feeds:{
"rss":{id:0, name:"Rss订阅"},
"google":{id:1, name:"谷歌阅览器"},
"zhuaxia":{id:2, name:"抓虾"},
"xianguo":{id:3, name:"鲜果"},
//"qq":{id:4, name:"QQ邮箱"},
"yahoo":{id:5, name:"雅虎"},
"inezha":{id:7, name:"哪吒"},
"Email":{id:8, name:"邮天下"},
"youdao":{id:9, name:"有道"},
"feige":{id:10, name:"飞鸽"},
"bloglines":{id:12, name:"Bloglines"},
},
e:encodeURIComponent,
gotourl:function(url,argStr){
open(url + argStr, 'addthis');
return false;
},
windowOffset:function(){
var info={width:0,height:0,left:0,top:0,right:0,bottom:0};
if(window.innerWidth&&window.innerWidth.constructor==Number){
info.width=window.innerWidth; //窗口可见宽度
info.height=window.innerHeight;
info.left=window.pageXOffset; //页面滚动的宽度
info.top=window.pageYOffset;
}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
info.width=document.documentElement.clientWidth;
info.height=document.documentElement.clientHeight;
info.left=document.documentElement.scrollLeft;
info.top=document.documentElement.scrollTop;
}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
info.width=document.body.clientWidth;
info.height=document.body.clientHeight;
info.left=document.body.scrollLeft;
info.top=document.body.scrollTop;
}
info.right=info.left+info.width;
info.bottom=info.top+info.height;
return info;
},
showposition:function(dropdown,fgdiv,bgfrm,btn){//参数为jQuery对象
if(!$.boxModel){
fgdiv.css("width", (fgdiv.get(0).clientWidth+parseInt(fgdiv.css("padding-left"))+parseInt(fgdiv.css("padding-right"))+(parseInt(fgdiv.css("border-left-width"))?parseInt(fgdiv.css("border-left-width")):0)+(parseInt(fgdiv.css("border-right-width"))?parseInt(fgdiv.css("border-right-width")):0))+"px");
}
dropdown.css("width", fgdiv.get(0).offsetWidth+"px");
bgfrm.css("width", fgdiv.get(0).offsetWidth+"px");
dropdown.css("height", fgdiv.get(0).offsetHeight+"px");
bgfrm.css("height", fgdiv.get(0).offsetHeight+"px");
var info_btn=btn.offset();
var info_window=$$addfeed.windowOffset();
var info_dropdown=dropdown.offset();
var left=0,top=0;
if(info_window.right-info_btn.left<=dropdown.width()){
left=info_btn.left+btn.width() - dropdown.width(); //left=btn.width() - dropdown.width();
}else{
left=info_btn.left; //left=0;
}
if(info_window.bottom-info_btn.top-(btn.find("*").height()||16)<=dropdown.height()){
top= info_btn.top-dropdown.height(); //top= -dropdown.height();
}else{
top=info_btn.top+btn.height(); //top=btn.height();
}
dropdown.css("left", left+"px");
dropdown.css("top", top+"px");
info_btn = info_window = info_dropdown = left = top = null;
},
showThisItem:function(thisItem){
$(".feed .addbox").hide();
$(thisItem).find(".addbox").show();
},
initBtn:function(btn){ //btn{locked, argStr, mouse_over, boxmouseover, boxmouseout, timeOut, addthis, addbox, u , t, e}
//btn为dom对象
btn.mouse_over=function(jbtn, e){
if(btn.locked){$$addfeed.showThisItem(btn.addthis); return false;} //
btn.locked=true; //btn mouseover首次事件
//if ($$addfeed.isMouseLeaveOrEnter(e||event, btn)) {
//$$addfeed.timeOnOver = setTimeout(function(){
//获取配置
var btn_i = $(btn).attr("i")? "|"+$(btn).attr("i")+"|" : "";//alert(btn_i);
if ($(btn).attr("href")&&$(btn).attr("href")!=document.location+"#"&&$(btn).attr("href")!=document.location&&$(btn).attr("href")!="#") {
btn.u = $(btn).attr("href");
} else {
btn.u = $("link[type='application/rss+xml'], link[type='application/atom+xml']").attr("href");
//alert(btn.u);
}
btn.e = $(btn).attr("e") ? $(btn).attr("e") : "mouseover";
btn.argStr = $$addfeed.e(btn.u);
btn.addthis = btn;
$(".addbox").hide();
$$addfeed.showThisItem(btn.addthis);
//生成.addbox html
$(btn).append('<div class="addbox"></div>');
var addbox=$(btn).find("div.addbox").get(0);
btn.addbox = addbox;
var html= "";
html += '<iframe class="bgfrm" frameborder="0" tabindex="-1" src="javascript:;" style="display:block;position:absolute;z-index:-1;"></iframe>';
html += '<div class="addshow"><div class="addh"><div class="addt">订阅到:</div></div><div class="addbody"><div class="flist" style="position:inherit; margin:0 0 3px 0; padding:6px; width:172px;">';
for(var key in $$addfeed.feeds){
if (!btn_i || (btn_i && btn_i.indexOf("|"+$$addfeed.feeds[key].id+"|")>=0)) {
html+='<div class="li" style=" float:left; display:inline; position:inherit; margin:0 0 0 3px; padding:0; line-height:16px; height:22px; border:none; background:none; font-size:12px;"><a class="feed_'+ $$addfeed.feeds[key].id +'" item="'+ $$addfeed.feeds[key].id +'" href="#"> </a></div>';
}
}
html += '</div><div style="clear:both;line-height:0"></div></div>';
html += '<div class="addbottom">by GNG</a></div>';
html += '</div>';
$(addbox).html(html);
//alert($(addbox).html());
$$addfeed.showposition($(addbox), $(addbox).find(".addshow"), $(addbox).find(".bgfrm"), $(btn));
//addbox.style.display="block";
$(addbox).find(".flist .li a").click(function(evt){
if (Number($(this).attr("item"))==0) {
open(btn.u, 'addfeed');
}
else {
a = $.attr(this,"item")
switch(a){
case "1":
$$addfeed.gotourl("http://www.google.com/reader/view/feed/",btn.argStr);
break;
case "2":
$$addfeed.gotourl("http://www.zhuaxia.com/add_channel.php?url=",btn.argStr);
break;
case "3":
$$addfeed.gotourl("http://xianguo.com/subscribe?url=",btn.argStr);
break;
//case "4":
// $$addfeed.gotourl("http://mail.qq.com/cgi-bin/feed?u=",btn.argStr);
// break;
case "5":
$$addfeed.gotourl("http://add.my.yahoo.com/rss?url=",btn.argStr);
break;
case "7":
$$addfeed.gotourl("http://inezha.com/add?url=",btn.argStr);
break;
case "8":
$$addfeed.gotourl("http://www.emailrss.cn/?rss=",btn.argStr);
break;
case "9":
$$addfeed.gotourl("http://reader.youdao.com/b.do?url=",btn.argStr);
break;
case "10":
$$addfeed.gotourl("http://www.pageflakes.com/subscribe.aspx?url=",btn.argStr);
break;
case "12":
$$addfeed.gotourl("http://www.bloglines.com/sub/",btn.argStr);
break;
case "15":
$$addfeed.gotourl("http://rss.hexun.com/sub/",btn.argStr);
break;
case "16":
$$addfeed.gotourl("http://9.douban.com/reader/subscribe?url=",btn.argStr);
break;
}
}
//$.cancelEvent(evt||event);
//隐藏addbox
$(btn.addbox).hide();
return false;
});
//绑定事件
$(btn.addthis).mouseover(function(evt){
if ($$addfeed.isMouseLeaveOrEnter(evt||event, btn.addthis)) {
if (btn.e=="click") {
clearTimeout(btn.timeOut);
} else if (btn.e=="mouseover"){
btn.boxmouseover(evt);
clearTimeout(btn.timeOut);
}
}
});
$(btn.addthis).mouseout(function(evt){
if ($$addfeed.isMouseLeaveOrEnter(evt||event, btn.addthis)) {
btn.timeOut = setTimeout(btn.boxmouseout, $$addfeed.timeDelayout);
}
});
btn_i = btn_t = btn_u = btn_d = addbox = html = null;
//},$$addfeed.timeDelayOver);
//} //end else
//}
};
btn.boxmouseover=function(evt){
$$addfeed.showposition($(btn.addbox), $(btn.addbox).find(".addshow"), $(btn.addbox).find(".bgfrm"), $(btn));
$(btn.addbox).show();
};
btn.boxmouseout=function(evt){
$(btn.addbox).fadeOut();
};
if ($(btn).attr("e")=="click") {
$(btn).click(function(evt){
btn.mouse_over(btn, evt); return false;
});
} else {
$(btn).click(function(evt){
return false;
}).mouseover(function(evt){
btn.mouse_over(btn, evt);
});
}
},
isMouseLeaveOrEnter: function(e, handler) {
if (e.type != 'mouseout' && e.type != 'mouseover') return false;
var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
while (reltg && reltg != handler)
reltg = reltg.parentNode;
return (reltg != handler);
}
};
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/feed/feed.js | JavaScript | gpl3 | 9,180 |
<?php
include_once('common.inc.php');
func_register(array(
'like' => array(
'callback' => 'deal_like',
'security' => 'true',
),
));
function like_count()
{
include_once('login.inc.php');
$row = get_likes(0, 0, true);
echo $row[0][0];
}
function get_likes($num, $page, $count = false)
{
include_once('login.inc.php');
$id = get_current_user_id();
if($count)
{
$select = "COUNT(tweets.tweet_id)";
$limit = "";
}
else
{
$select = "tweets.*";
if(!$page)
$page = "0";
$page = intval($page) * $num;
$limit = " LIMIT $page , $num";
}
connect_db();
$view = "SELECT $select from tweets, (SELECT * FROM favorites WHERE user_id='$id' AND deleted=0) as favorites WHERE tweets.deleted=0 AND tweets.tweet_id=favorites.tweet_id ORDER BY tweets.post_datetime DESC$limit";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
$result[$i++] = $row;
return $result;
}
function like_show()
{
$args = func_get_args();
if(get_post('page'))
$page = intval(get_post('page'));
else
$page = "";
$content = '';
include_once("theme.inc.php");
$favorites = get_likes(10, $page);
include_once("apply_sent.inc.php");
$allapp = get_sent_applies(32767, "");
foreach($favorites as $f)
{
$content .= '<div class="item" id="'.$f['tweet_id'].'">
<div class="item-delete">
<a class="right"></a>
</div>
<div class="left item-pic">
<img src="'.$f['profile_image_url'].'" alt="" width="50" height="50" />
</div>
<div class="left item-content">
<div class="item-blog">
<a class="item-blog-name">'.$f['post_screenname'].'</a>:'.$f['content'].'
</div>
<div class="item-other">
<a target="_blank" href="http://api.t.sina.com.cn/'.$r['user_site_id'].'/statuses/'.$r['tweet_site_id'].'" class="left item-time">'.time_tran($f['post_datetime']).'</a> '.$source.'
<a class="right item-favourite item-action delete">取消收藏</a> ';
if($f['type'] != 1)
{
$app = 0;
foreach($allapp as $r)
if($f['tweet_id'] == $r['tweet_id'])
{
$app = 1;
break;
}
if(!$app)
$content .= '<a class="right item-favourite item-doapply apply" onclick="JobApply(this,\''.$f['tweet_id'].'\',\''.$f['post_screenname'].'\')">
申请该职位</a><a class="right item-favourite item-doapply unapply" style="display: none;" onclick="JobUnApply(this,\''.$f['tweet_id'].'\')">
取消申请</a>';
else
$content .= '<a class="right item-favourite item-doapply apply" style="display: none;" onclick="JobApply(this,\''.$f['tweet_id'].'\',\''.$f['post_screenname'].'\')">
申请该职位</a><a class="right item-favourite item-doapply unapply" onclick="JobUnApply(this,\''.$f['tweet_id'].'\')">
取消申请</a>';
}
$content .= '
</div>
</div>
<div class="clear">
</div>
</div>';
}
echo $content;
}
function like_delete()
{
include_once('login.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM favorites WHERE user_id='$id' AND tweet_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$view = "UPDATE favorites SET deleted='1' WHERE user_id='$id' AND tweet_id='$key'";
$list = mysql_query($view) or die("Delete error!");
}
else
{
print $key;
die(": Non-exist Error!");
}
}
function like_exist()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM favorites WHERE user_id='$id' AND tweet_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
echo "1";
else
echo "0";
}
function like_add()
{
include_once('login.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM favorites WHERE user_id='$id' AND tweet_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
die("Dulplicate Error!");
#like_delete("", "", $key);
$view = "INSERT INTO favorites(tweet_id, user_id, deleted) VALUES ('$key', '$id', '0')";
$list = mysql_query($view) or die("Insert error!");
}
function theme_like($content)
{
theme('page', "收藏", $content);
}
function deal_like($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'like_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/like.inc.php | PHP | gpl3 | 5,928 |
<?php
/**
* Twitter Autolink Class
*
* Based on code by Matt Sanford, http://github.com/mzsanford
From http://github.com/mzsanford/twitter-text-php/blob/master/src/Twitter/Autolink.php
This file is
Copyright 2010 Mike Cochrane
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
Modified by Terence Eden for Dabr
*/
class Twitter_Autolink {
/* HTML attribute to add when noFollow is true (default) */
const NO_FOLLOW_HTML_ATTRIBUTE = " rel=\"nofollow\"";
/* Default CSS class for auto-linked URLs */
protected $urlClass = "item-blog-link";
/* Default CSS class for auto-linked list URLs */
protected $listClass = "item-blog-link";
/* Default CSS class for auto-linked username URLs */
protected $usernameClass = "item-blog-link";
protected $hashtagClass = "tag";
protected $emailClass = "email";
/* Default CSS class for auto-linked hashtag URLs */
/* Default href for username links (the username without the @ will be appended) */
//protected $usernameUrlBase = "http://twitter.com/";
/* Default href for list links (the username/list without the @ will be appended) */
//protected $listUrlBase = "http://twitter.com/";
/* Default href for hashtag links (the hashtag without the # will be appended) */
//protected $hashtagUrlBase = "http://twitter.com/search?q=%23";
protected $noFollow = true;
function __construct() {
}
public function autolink($tweet) {
return $this->autoLinkUsernamesAndLists($this->autoLinkURLs($this->autoLinkHashtags($this->autoLinkEmail($tweet))));
}
public function autoLinkHashtags($tweet) {
// TODO Match latin chars with accents
/*return preg_replace('$(^|[^0-9A-Z&/]+)([##]+)([0-9A-Z_]*[A-Z_]+[a-z0-9_üÀ-ÖØ-öø-ÿ]*)$iu',
'${1}<a href="' . $this->get_base() . 'hash/' . '${3}" title="#${3}" class="' . $this->urlClass . ' ' . $this->hashtagClass . '">${2}${3}</a>',
$tweet);*/
$t = preg_replace('$([##])([a-z0-9\-\+_\/\x{4e00}-\x{9fa5}]{1,20})([##])$iu',
'<a title="${2}" class="' . $this->urlClass . ' ' . $this->hashtagClass . '">${1}${2}${3}</a>',
$tweet);
return $t;
}
public function autoLinkEmail($tweet) {
$t = preg_replace('/([a-zA-Z0-9_\-\.]+)([@|@|#]|\[at\])([a-zA-Z0-9_\-]+([.][a-zA-Z0-9_\-]+)*[.][a-zA-Z]{2,4})/',
'<a class="' . $this->urlClass . ' ' . $this->emailClass . '" href="mailto:${1}@${3}">${1}${2}${3}</a>', $tweet);
return $t;
}
public function autoLinkURLs($tweet) {
$URL_VALID_PRECEEDING_CHARS = "(?:[^/\"':!=]|^|\\:)";
$URL_VALID_DOMAIN = "(?:[\\.-]|[^\\p{P}\\s])+\\.[a-z]{2,}(?::[0-9]+)?";
$URL_VALID_URL_PATH_CHARS = "[a-z0-9!\\*'\\(\\);:&=\\+\\$/%#\\[\\]\\-_\\.,~@]";
// Valid end-of-path chracters (so /foo. does not gobble the period).
// 1. Allow ) for Wikipedia URLs.
// 2. Allow =&# for empty URL parameters and other URL-join artifacts
$URL_VALID_URL_PATH_ENDING_CHARS = "[a-z0-9\\)=#/]";
$URL_VALID_URL_QUERY_CHARS = "[a-z0-9!\\*'\\(\\);:&=\\+\\$/%#\\[\\]\\-_\\.,~]";
$URL_VALID_URL_QUERY_ENDING_CHARS = "[a-z0-9_&=#]";
$VALID_URL_PATTERN_STRING = '$(' . // $1 total match
"(" . $URL_VALID_PRECEEDING_CHARS . ")" . // $2 Preceeding chracter
"(" . // $3 URL
"(https?://|www\\.)" . // $4 Protocol or beginning
"(" . $URL_VALID_DOMAIN . ")" . // $5 Domain(s) and optional port number
"(/" . $URL_VALID_URL_PATH_CHARS . "*" . // $6 URL Path
$URL_VALID_URL_PATH_ENDING_CHARS . "?)?" .
"(\\?" . $URL_VALID_URL_QUERY_CHARS . "*" . // $7 Query String
$URL_VALID_URL_QUERY_ENDING_CHARS . ")?" .
")" .
')$i';
return preg_replace_callback($VALID_URL_PATTERN_STRING,
array(get_class($this), 'replacementURLs'),
$tweet);
}
/**
* Callback used by autoLinkURLs
*/
private function replacementURLs($matches) {
$replacement = $matches[2];
//Workaround for [smile]
if (substr($matches[3], -1, 1) == "[")
{
$matches[3] = substr($matches[3], 0, -1);
$append = "[";
}
else
$append = "";
if (substr($matches[3], 0, 7) == 'http://' || substr($matches[3], 0, 8) == 'https://') {
$replacement .= '<a class="' . $this->urlClass . '" href="' . $matches[3] . '" target="_blank">' . $matches[3] . '</a>';
} else {
$replacement .= '<a class="' . $this->urlClass . '" href="http://' . $matches[3] . '" target="_blank">' . $matches[3] . '</a>';
}
$replacement .= $append;
return $replacement;
}
public function autoLinkUsernamesAndLists($tweet) {
$notuser = preg_split('$([@|@])([a-z0-9\-_\x{4e00}-\x{9fa5}]{1,20})$iu', $tweet);
preg_match_all('$([@|@])([a-z0-9\-_\x{4e00}-\x{9fa5}]{1,20})$iu', $tweet, $users);
$out = "";
foreach($notuser as $str)
{
preg_match('/[a-z0-9_]$/iu', $str, $tmpmatch);
$user = array_shift($users[2]);
$atstr = array_shift($users[1]);
if($tmpmatch)
$out .= $str.$atstr.$user;
else
$out .= $str.'<a class="' . $this->urlClass . ' ' . $this->usernameClass . '" href="'. $this->get_base() . 'profile/'. $user . '" target="_blank">' . $atstr . $user . '</a>';
}
return $out;
#return preg_replace_callback('$([^a-z0-9_]|^)([@|@])([a-z0-9\-_\x{4e00}-\x{9fa5}]{1,20})$iu',//(/[a-z][a-z0-9\x80-\xFF-]{0,79})?$iu',
#return preg_replace_callback('$([@|@])([a-z0-9\-_\x{4e00}-\x{9fa5}]{1,20})$iu',//(/[a-z][a-z0-9\x80-\xFF-]{0,79})?$iu',
#array($this, 'replacementUsernameAndLists'),
#$tweet);
}
/**
* Callback used by autoLinkUsernamesAndLists
*/
private function replacementUsernameAndLists($matches) {
#$replacement = $matches[0];
$replacement .= $matches[1];
#$replacement = '';
if (isset($matches[4])) {
/* Replace the list and username */
#$replacement .= '<a class="' . $this->urlClass . ' ' . $this->listClass . '" href="' . $this->get_base() .'lists/'. $matches[3] . $matches[4] . '" target="_blank">' . $matches[2] . $matches[3] . $matches[4] . '</a>';
$replacement .= '<a class="' . $this->urlClass . ' ' . $this->listClass . '" href="' . $this->get_base() .'lists/'. $matches[2] . $matches[3] . '" target="_blank">' . $matches[1] . $matches[2] . $matches[3] . '</a>';
} else {
/* Replace the username */
$replacement .= '<a class="' . $this->urlClass . ' ' . $this->usernameClass . '" href="' . $this->get_base() . 'profile/' . $matches[3] . '" target="_blank">' . $matches[2] . $matches[3] . '</a>';
#$replacement .= '<a class="' . $this->urlClass . ' ' . $this->usernameClass . '" href="' . $this->get_base() . 'profile/' . $matches[2] . '" target="_blank">' . $matches[1] . $matches[2] . '</a>';
}
return $replacement;
}
private function get_base()
{
return BASE_URL;
}
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/autolink.inc.php | PHP | gpl3 | 8,178 |
<?php
include_once('common.inc.php');
func_register(array(
'apply_sent' => array(
'callback' => 'deal_apply_sent',
'security' => 'true',
),
));
function get_sent_applies($num, $page, $count = false)
{
include_once('login.inc.php');
$id = get_current_user_id();
if($count)
{
$select = "COUNT(*)";
$limit = "";
}
else
{
if(!$page)
$page = "0";
$select = "*";
$page = intval($page) * $num;
$limit = " LIMIT $page , $num";
}
connect_db();
$view = "SELECT $select from tweets,(SELECT * FROM applications WHERE user_id='$id' AND deleted=0 GROUP BY tweet_id) AS ap WHERE ap.tweet_id = tweets.tweet_id AND tweets.deleted=0 ORDER BY tweets.post_datetime DESC$limit";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
$result[$i++] = $row;
return $result;
}
function apply_sent_add()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM applications WHERE user_id='$id' AND tweet_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
die('Dulplicate Error');
$view = "INSERT INTO applications(resume_id, tweet_id, user_id, apply_time) VALUES ('$id', '$key', '$id', '".date('Y-m-d H:i:s')."')";
$list = mysql_query($view) or die("Insert error!");
$content = get_post('text');
$view = "SELECT tweet_site_id FROM tweets WHERE tweet_id='$key'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$tweet_site_id = $row[0];
include_once("sinaoauth.inc.php");
$c = new WeiboClient(SINA_AKEY, SINA_SKEY, $GLOBALS['user']['sinakey']['oauth_token'], $GLOBALS['user']['sinakey']['oauth_token_secret']);
$content = $content.' 我在歪伯乐的简历:http://www.ybole.com/resume/show/'.$id;
$msg = $c -> send_comment($tweet_site_id, $content);
if ($msg === false || $msg === null){
echo "Error occured";
return false;
}
if (isset($msg['error_code']) && isset($msg['error'])){
echo ('Error_code: '.$msg['error_code'].'; Error: '.$msg['error'] );
return false;
}
}
}
function apply_sent_count()
{
$num = get_sent_applies(0, "", true);
$r = $num[0][0];
if($r)
echo $r;
else
echo '0';
}
function apply_sent_show()
{
include_once("theme.inc.php");
$args = func_get_args();
if(get_post('page'))
$page = intval(get_post('page'));
else
$page = "";
$content = '';
$applies = get_sent_applies(10, $page);
foreach($applies as $f)
{
if(strstr($f['source'], '<'))
$source = str_replace("<a ", '<a class="left microblog-item-position"', $f['source']);
else
$source = '<a class="left microblog-item-position">'.$f['source'].'</a>';
if($f['deleted'])
$temp = " job-closed";
else
$temp = "";
$content .= '<div class="item'.$temp.'" id="'.$f['tweet_id'].'">
<div class="item-delete">
<a class="right"></a>
</div>
<div class="left item-pic">
<img src="'.$f['profile_image_url'].'" alt="" width="50" height="50" />
</div>
<div class="left item-content">
<div class="item-blog">
<a class="item-blog-name">'.$f['post_screenname'].'</a>:'.$f['content'].'
</div>
<div class="item-other">
<span class="left item-time">'.time_tran($f['post_datetime']).'</span> '.$source;
if($f['deleted'])
$content .= '<span class="right item-apply item-apply-info">已关闭</span>';
elseif($f['view_time'])
$content .= '<span class="right item-apply item-apply-info">'.time_tran($f['view_time']).'</span>';
else
$content .= '<span class="right item-apply item-apply-info">未读</span>';
$content .= '<span class="right item-apply item-apply-name">状态:</span> <span class="right item-apply item-apply-info">'.time_tran($f['apply_time']).'</span> <span class="right item-apply item-apply-name">
申请于:</span>';
$content .= '
</div>
</div>
<div class="clear">
</div>
</div>';
}
echo $content;
}
function apply_sent_delete()
{
include_once('login.inc.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM applications WHERE user_id='$id' AND tweet_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
{
$view = "UPDATE applications SET deleted='1' WHERE user_id='$id' AND tweet_id='$key'";
$list = mysql_query($view) or die("Delete error!");
}
else
{
print $key;
die(": Non-exist Error!");
}
}
function apply_sent_exist()
{
include_once('login.php');
$id = get_current_user_id();
$args = func_get_args();
$key = $args[2];
if(!$key)
die('Invalid Argument!');
connect_db();
$view = "SELECT * FROM applications WHERE user_id='$id' AND tweet_id='$key' AND deleted='0'";
$list = mysql_query($view);
$row = mysql_fetch_array($list);
if($row)
echo "1";
else
echo "0";
}
function deal_apply_sent($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'apply_sent_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/apply_sent.inc.php | PHP | gpl3 | 6,325 |
<?php
include_once('common.inc.php');
func_register(array(
'apply_received' => array(
'callback' => 'deal_apply_received',
'security' => 'true',
),
));
function get_received_tweets($num, $page, $count = false)
{
include_once('login.inc.php');
$id = get_current_user_id();
if($count)
{
$limit = "";
$select = "COUNT(DISTINCT tweets.tweet_id)";
$groupby = "";
}
else
{
if(!$page)
$page = "0";
$select = "*";
$page = intval($page) * $num;
$limit = " LIMIT $page , $num";
$groupby = " GROUP BY tweets.tweet_id";
}
connect_db();
$view = "SELECT $select from tweets, (SELECT * FROM applications WHERE deleted=0) AS ap, (SELECT * from accountbindings WHERE user_id = '$id') AS ab WHERE tweets.deleted=0 AND tweets.tweet_id=ap.tweet_id AND tweets.user_site_id = ab.user_site_id AND tweets.site_id = ab.site_id$groupby ORDER BY tweets.post_datetime DESC$limit";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
$result[$i++] = $row;
return $result;
}
function get_received_applies($tweet_id, $num, $page, $count = false)
{
include_once('login.inc.php');
$id = get_current_user_id();
if($count)
{
$limit = "";
$select = "COUNT(*)";
}
else
{
if(!$page)
$page = "0";
$select = "*";
$page = intval($page) * $num;
$limit = " LIMIT $page , $num";
}
connect_db();
$view = "SELECT $select from applications AS ap, (SELECT * FROM tweets WHERE tweet_id='$tweet_id' AND deleted=0) AS tweets, (SELECT user_site_id, site_id from accountbindings WHERE user_id = '$id') AS ab WHERE tweets.deleted=0 AND ap.deleted=0 AND ap.tweet_id='$tweet_id' AND tweets.user_site_id = ab.user_site_id AND tweets.site_id = ab.site_id ORDER BY tweets.post_datetime DESC$limit";
$list = mysql_query($view);
$result = array();
$i = 0;
while($row = mysql_fetch_array($list))
$result[$i++] = $row;
return $result;
}
function received_apply_show_tweet()
{
$args = func_get_args();
$tweet_id = $args[2];
$page = get_post('page');
$content = '';
$applies = get_received_applies($tweet_id, 10, $page);
foreach($applies as $r)
{
if($r['view_time'])
$readinfo = "(已阅)";
else
$readinfo = "";
$content .= '<div id="'.$r['resume_id'].'">
<span class="left">申请自:</span><a class="left item-applys-name">'.get_nick_by_id($r['user_id']).'</a><span class="left item-applys-time">于'.time_tran($r['apply_time']).$readinfo.'</span><a
class="right item-applys-read">查看简历</a></div>';
}
echo $content;
}
function received_apply_count_tweet($tweet_id)
{
$content = '';
$applies = get_received_applies($tweet_id, 10, "", true);
return $applies[0][0];
}
function received_apply_count()
{
$content = '';
$applies = get_received_tweets(10, "", true);
$r = $applies[0][0];
if($r)
echo $r;
else
echo '0';
}
function received_apply_show()
{
include_once("theme.inc.php");
$key = get_post('page');
$content = '';
$results = get_received_tweets(10, $key);
foreach($results as $r)
{
if(strstr($r['source'], '<'))
$source = str_replace("<a ", '<a target="_blank" class="left microblog-item-position"', $r['source']);
else
$source = '<a class="left microblog-item-position" target="_blank">'.$r['source'].'</a>';
$g = received_apply_count_tweet($r['tweet_id']);
$content .= '<div class="item item-noclose" id="'.$r['tweet_id'].'">
<div class="item-delete">
<a class="right"></a>
</div>
<div class="left item-pic">
<a target="_blank" href="'.BASE_URL.'profile/'.$r['post_screenname'].'"><img alt="" width="50" height="50" src="'.$r['profile_image_url'].'"/></a>
</div>
<div class="left item-content">
<div class="item-blog">
<a class="microblog-item-blog-name" target="_blank" href="'.BASE_URL.'profile/'.$r['post_screenname'].'">'
.$r['post_screenname'].'</a>:'.parselink($r['content']).'
</div>
<div class="item-other">
<span class="left item-time">'.time_tran($r['post_datetime']).'</span> '.$source.'
<a class="right item-control last applys" id="'.$g.'">
申请数('.$g.')</a>
</div>
<div class="item-applys close"></div><div class="item-page"></div>';
$content .= '
</div>
<div class="clear">
</div>
</div>';
}
echo $content;
}
function deal_apply_received($query)
{
$key = (string) $query[1];
if(!$key)
$key = "show";
$function = 'received_apply_'.$key;
if (!function_exists($function))
die("Invalid Argument!");
return call_user_func_array($function, $query);
}
?>
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/apply_received.inc.php | PHP | gpl3 | 5,576 |
.fl
{
float: left;
}
.fr
{
float: right;
}
.udl
{
text-decoration: underline;
}
.popBox
{
height: 198px;
background-color: white;
font-family: 宋体, 微软雅黑;
font-size: 12px;
box-shadow: 0px 0px 10px #777777;
-moz-box-shadow: 0px 0px 10px #777777;
-webkit-box-shadow: 0px 0px 10px #777777;
border: 1px #bdbdbd solid;
}
.confirmBox
{
padding-top:15px;
height: 68px;
}
.popboxicon
{
background: url('../images/popboximg.png') no-repeat scroll -999em 0 transparent;
background-position: -236px 0px;
width: 120px;
height: 30px;
overflow: hidden;
vertical-align: middle;
color: #7191a3;
font-weight: normal;
float: left;
}
.popboxicon h4
{
margin: 8px auto auto 15px;
font-size: 14px;
font-weight: normal;
width: 250px;
}
.popBoxwd1, .wd282
{
width: 282px;
}
.popBoxwd2, .wd480
{
width: 480px;
}
.popBoxwd3, .wd195
{
width: 195px;
}
.boxtitle
{
height: 30px;
background-color: #cde1ec;
}
.btn_close
{
background-position: -267px -127px;
width: 15px;
height: 15px;
position: relative;
float: right;
top: 8px;
right: 6px;
}
.popBox_main
{
margin: 5px 20px 5px 20px;
_margin: 5px 10px 5px 10px;
height: 75%;
}
#popBox_apply0 .popBox_main .line1
{
height: 40px;
line-height: 40px;
margin-top: 20px;
}
.img_err
{
background-position: 0px 0px;
width: 31px;
height: 33px;
float: left;
}
.font_tip
{
font-family: 微软雅黑;
font-size: 20px;
color: #668594;
display: inline-block;
float: left;
font-weight: 600;
padding-left: 20px;
}
#popBox_apply0 .popBox_main .line2
{
margin-top: 15px;
}
.font_tip2
{
color: #f09953;
text-align: center;
line-height: 30px;
}
#popBox_apply0 .popBox_main .line3
{
margin-top: 5px;
}
#popBox_apply0 .popBox_main .line3 a
{
background-position: 0px -33px;
width: 245px;
height: 41px;
}
#popBox_apply0 .popBox_main .line3 a:hover
{
background-position: 0px -74px;
width: 245px;
height: 41px;
}
#popBox_apply1 .popBox_main .line0
{
line-height: 24px;
}
#popBox_apply1 .popBox_main .line1
{
width: 433px;
height: 80px;
border: 3px #cde1ec solid;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
display: inline-block;
}
#popBox_apply1 .popBox_main textarea
{
overflow: hidden;
width: auto;
border: 0px solid;
width: 99%;
height: 96%;
word-warp: break-word;
_height: 75px;
}
.font_tip3
{
font-family: Constantia;
font-size: 26px;
line-height: 26px;
}
.btn_publish
{
background-position: -246px -36px; /*激活状态下背景图片的位移是-246px -73px*/
width: 120px;
height: 37px;
position: relative;
top: -30px;
_top: -21px;
left: 310px;
}
.able
{
background-position: -246px -73px;
}
#confirmBox_del .line0
{
margin: 3px 20px 3px 20px;
display: inline-block;
line-height: 20px;
text-align: center;
}
.icon_ques
{
background-position: -65px 1px;
width: 18px;
height: 18px;
margin-right: 5px;
}
#confirmBox_del .line1
{
margin: 1px 20px 1px 20px;
_margin: 5px 10px 5px 10px;
}
a.btn_ok
{
background-position: -114px -116px;
width: 73px;
height: 27px;
float: left;
color: #527417;
text-align: center;
line-height: 25px;
}
a:hover.btn_ok
{
background-position: -188px -116px;
}
a.btn_cal
{
background-position: -89px -5px;
width: 73px;
height: 27px;
float: right;
color: #666666;
text-align: center;
line-height: 25px;
}
a:hover.btn_cal
{
background-position: -162px -5px;
}
.icon_ok
{
background-position: -65px -17px;
width: 18px;
height: 17px;
margin-right: 5px;
}
#confirmBox_ok .line0
{
margin: 5px 20px 5px 20px;
display: inline-block;
line-height: 20px;
text-align: center;
}
#confirmBox_ok .line1
{
margin: 1px 20px 1px 20px;
_margin: 5px 10px 5px 10px;
}
.img_tip
{
background-position: -35px 0px;
width: 31px;
height: 33px;
vertical-align: middle;
float: left;
}
#popBox_publishok .popBox_main .line1
{
height: 40px;
line-height: 40px;
margin-top: 20px;
}
#popBox_publishok .popBox_main .line2
{
margin-top: 15px;
}
#popBox_publishok .popBox_main .line3
{
margin-left: 50px;
margin-top: 8px;
text-align: center;
line-height: 27px;
}
.btn_ikown
{
background-position: -4px -116px;
width: 110px;
height: 27px;
color: #527417;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/css/popupBox.css | CSS | gpl3 | 4,918 |
div#content
{
margin-top: 10px;
}
div#left
{
width: 300px;
}
div#blank
{
width: 300px;
height: 1px;
}
div#left div.left-title
{
height: 24px;
line-height: 24px;
margin-bottom: 3px;
margin-top: 20px;
}
div#left div.left-title-first
{
height: 24px;
line-height: 24px;
margin-bottom: 3px;
margin-top: 0px;
}
div#left span.left-title-text
{
height: 24px;
line-height: 24px;
font-family: 微软雅黑, 宋体;
font-weight: bold;
font-size: 16px;
color: #4e88af;
margin-left: 5px;
}
div#left a.left-title-pic
{
height: 24px;
width: 24px;
margin-right: 5px;
background-position: center center;
background-repeat: no-repeat;
}
div#left a#concern-pic
{
background-image: url('../images/concern-rss.jpg');
display: none;
}
div#left div.concern-item
{
height: 25px;
line-height: 25px;
margin-top: 5px;
cursor: pointer;
}
div#left a.concern-item-delete
{
width: 25px;
height: 25px;
background-image: url('../images/concern-delete.jpg');
background-position: center center;
background-repeat: no-repeat;
}
div#left div.concern-item-content
{
width: 275px;
height: 25px;
font-size: 15px;
font-family: 微软雅黑, 宋体;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#left div.concern-item-content
{
background-color: #cae4e9;
color: #659abe;
}
div#left div.concern-item-over div.concern-item-content
{
background-color: #7cb5da;
color: #ffffff;
}
div#left div.concern-item-over a.concern-item-delete
{
visibility: visible;
}
div#left div.concern-item-content-new
{
font-weight: bold;
}
div#left a.concern-item-content-info
{
margin-left: 5px;
}
div#left a.concern-item-content-number
{
margin-right: 5px;
}
div#left a#history-pic
{
background-image: url('../images/history-clear.jpg');
background-position: center center;
background-repeat: no-repeat;
}
div#left div.history-item
{
cursor: pointer;
height: 24px;
line-height: 24px;
width: 270px;
margin-left: 25px;
color: #5a7b92;
margin-top: 5px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
padding-left: 5px;
}
div#left div.history-item-over
{
background-color: #e7f1f5;
}
div#left span.left-title-time
{
margin-right: 5px;
color: #979797;
}
div#left div#hot-content
{
width: 275px;
margin-left: 25px;
display: block;
white-space: pre-line;
}
div#left a.hot-content-item
{
height: 20px;
line-height: 20px;
margin-left: 3px;
margin-top: 3px;
background-color: #eaf2f9;
color: #5a7b92;
padding: 2px 8px;
white-space: nowrap;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#right
{
margin-left: 25px;
width: 620px;
}
div#right div#radio
{
height: 20px;
width: 600px;
background-color: #fff2dc;
background-image: url('../images/radio-piv.jpg');
background-repeat: no-repeat;
background-position: 5px center;
color: #ff9646;
line-height: 20px;
padding-left: 20px;
letter-spacing: 3px;
}
div#right div#microblogs
{
width: 592px;
border: 1px #ebeff7 solid;
background-color: #ffffff;
margin-top: 10px;
padding: 5px 13px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#right div#search-result-outer
{
border: 1px #d7e7ef solid;
background-color: #ffffff;
width: 588px;
padding: 1px;
display: none;
overflow: hidden;
}
div#right div#search-result
{
background-color: #d7e7ef;
width: 563px;
line-height: 28px;
background-image: url('../images/search-result-pic.jpg');
background-position: 5px center;
background-repeat: no-repeat;
padding-left: 25px;
letter-spacing: 3px;
font-size: 14px;
overflow: hidden;
}
div#right a#search-result-concern
{
height: 24px;
width: 94px;
margin-top: 2px;
margin-right: 30px;
}
div#right a.search-result-concern
{
background-image: url('../images/search-result-concern.jpg');
}
div#right a.search-result-concern-over
{
background-image: url('../images/search-result-concern-over.jpg');
}
div#right a.search-result-concern-click
{
background-image: url('../images/search-result-concern-click.jpg');
}
div#right a.search-result-concern-have
{
background-image: url('../images/search-result-concern-have.jpg');
}
div#right a#search-result-rss
{
height: 28px;
width: 28px;
background-image: url('../images/search-result-rss.jpg');
background-repeat: no-repeat;
}
div#right div.microblog-item
{
margin-top: 5px;
border-bottom: 1px #a3a3a3 dashed;
padding-left: 5px;
padding-top: 5px;
padding-bottom: 5px;
overflow: hidden;
}
div#right div.microblog-item-pic
{
height: 50px;
width: 50px;
padding: 2px;
border: 1px #ececec solid;
background-color: #ffffff;
}
div#right div.microblog-item-content
{
width: 530px;
}
div#right div.microblog-item-blog
{
width: 530px;
line-height: 20px;
padding: 0 5px;
font-size: 14px;
word-wrap: break-word;
}
div#right a.microblog-item-blog-name
{
color: #6f93ab;
}
div#right a.item-blog-link
{
color: #0084b4;
}
div#right div.microblog-item-other
{
height: 24px;
line-height: 24px;
}
div#right div.microblog-item-other1
{
height: 24px;
line-height: 24px;
border-top: 1px #dedede dashed;
}
div#right a.microblog-item-time
{
color: #7ba5d7;
padding: 0 5px;
}
div#right a.microblog-item-time
{
color: #a3a3a3;
padding: 0 5px;
}
div#right a.microblog-item-position
{
color: #7ba5d7;
margin: 0 10px;
}
div#right a.microblog-item-relate
{
margin: 0 5px;
}
div#right a.microblog-item-control
{
color: #ea7f37;
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
}
div#right a.microblog-item-control1
{
color: #7ba5d7;
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
}
div#right a.microblog-item-apply
{
border-right: 1px #ea7f37 solid;
}
div#right div#relative
{
height: 26px;
width: 600px;
background-color: #e2edf2;
margin-top: 5px;
line-height: 26px;
}
div#right div#relative span
{
margin-left: 5px;
}
div#right div#relative a
{
margin: 0 5px;
color: #688bb5;
}
div#right div#pages
{
height: 21px;
margin-top: 5px;
}
div#right a.page-number
{
height: 21px;
padding: 0 6px;
line-height: 21px;
text-align: center;
border: 1px #5c738f solid;
color: #5c738f;
margin: 0 2px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#right a.page-number-current
{
background-color: #a4c8f4;
}
div#right a.page-control
{
height: 21px;
padding: 0 6px;
line-height: 21px;
text-align: center;
border: 1px #5c738f solid;
background-color: #a4c8f4;
color: #5c738f;
margin: 0 2px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#right div#pages span
{
height: 21px;
line-height: 21px;
text-align: center;
}
div#role-choose
{
display: none;
width: 552px;
height: 372px;
background-color: #ffffff;
}
div.role-jobs
{
background-image: url('../images/role-background-jobs.jpg');
}
div.role-recruitment
{
background-image: url('../images/role-background-recruitment.jpg');
}
a#role-jobs
{
width: 170px;
height: 190px;
border: 3px transparent solid;
border-radius: 5px 5px;
}
a#role-jobs:hover
{
border: 3px #425d7a solid;
}
a#role-recruitment
{
width: 166px;
height: 190px;
border: 3px transparent solid;
border-radius: 5px 5px;
}
a#role-recruitment:hover
{
border: 3px #678432 solid;
}
a#role-confirm
{
width: 173px;
height: 46px;
}
div#right div#fresh-outer
{
height: 28px;
border: 1px #fff2dc solid;
background-color: #fff2dc;
width: 588px;
padding: 1px;
display: none;
}
div#right div#fresh
{
height: 28px;
background-color: #fff2dc;
width: 563px;
line-height: 28px;
background-position: 5px center;
background-repeat: no-repeat;
padding-left: 10px;
letter-spacing: 3px;
cursor: pointer;
color: #ff9646;
}
div#backTop
{
width: 20px;
height: 100px;
line-height: 20px;
text-align: center;
background-color: #d7e7ef;
display: none;
letter-spacing: 2px;
}
div#backTop:hover
{
cursor: pointer;
}
div#backTop a:hover
{
text-decoration: none;
}
.clear
{
clear: both;
padding: 0;
margin: 0;
}
a.keyword
{
color: #2972a4;
}
.microblog-item a.keyword
{
font-weight: normal;
}
div#msgBox_noresume
{
font-family: 宋体, 微软雅黑;
font-size: 14px;
color: black;
height: 179px;
width: 308px;
position: absolute;
display: none;
}
div#msgBox_noresume .bg
{
height: 179px;
width: 308px;
float: left;
}
div#msgBox_noresume .bg .lt
{
background-image: url('../images/bg_msgboxlt.png');
background-repeat: no-repeat;
width: 12px;
height: 100%;
float: left;
}
div#msgBox_noresume .bg .md
{
background-image: url('../images/bg_msgboxmd.png');
background-repeat: repeat-x;
width: 284px;
height: 100%;
float: left;
}
div#msgBox_noresume .bg .rt
{
background-image: url('../images/bg_msgboxrt.png');
background-repeat: no-repeat;
width: 12px;
height: 100%;
float: left;
}
div#msgBox_noresume .boxcontent
{
float: left;
padding: 10px;
}
div#msgBox_noresume .title
{
width: 277px;
height: 35px;
color: white;
margin-top: 5px;
}
div#msgBox_noresume a .btn_cross
{
background-color: #819cba;
width: 18px;
height: 18px;
font-family: "Lucida Sans Regular" , "Dingbats";
font-size: medium;
float: right;
text-align: center;
color: white;
}
div#msgBox_noresume .content
{
width: 260px;
height: 50px;
padding: 8px;
font-size: 14px;
}
div#msgBox_noresume .msgBtn
{
background-image: url('../images/msgBtn_noresume.gif');
background-repeat: no-repeat;
background-position: center;
width: 260px;
height: 28px;
}
div#msgBox_resume
{
font-family: 宋体, 微软雅黑;
font-size: 14px;
color: black;
position: absolute;
display: none;
}
div#msgBox_resume .boxcontent
{
position: relative;
top: 0px;
left: 0px;
float: left;
padding: 10px;
}
div#msgBox_resume a
{
text-decoration: none;
cursor: pointer;
}
div#msgBox_resume .bg
{
height: 218px;
}
div#msgBox_resume .bg .lt
{
background-image: url('../images/bg_msgboxlt2.png');
background-repeat: no-repeat;
width: 12px;
height: 100%;
float: left;
}
div#msgBox_resume .md
{
background-image: url('../images/bg_msgboxmd2.png');
background-repeat: repeat-x;
width: 519px;
height: 100%;
float: left;
}
div#msgBox_resume .bg .rt
{
background-image: url('../images/bg_msgboxrt2.png');
background-repeat: no-repeat;
width: 12px;
height: 100%;
float: left;
}
div#msgBox_resume .title
{
width: 500px;
height: 35px;
color: white;
}
div#msgBox_resume a .btn_cross
{
background-color: #819cba;
width: 18px;
height: 18px;
font-family: "Lucida Sans Regular" , "Dingbats";
font-size: medium;
float: right;
text-align: center;
color: white;
margin-top: 3px;
}
div#msgBox_resume .content
{
width: 510px;
font-size: 12px;
}
div#msgBox_resume .content .info
{
color: #6f93ab;
line-height: 25px;
height: 25px;
}
div#msgBox_resume .content a
{
color: #f07f24;
text-decoration: underline;
}
div#msgBox_resume .content span
{
color: red;
}
div#msgBox_resume .content .mdline
{
width: 516px;
height: 0px;
margin-top: 8px;
margin-bottom: 8px;
border-bottom: #b0d4f0 1px dashed;
}
div#msgBox_resume .msgBtn
{
background-image: url('../images/msgBtn_resume.gif');
background-repeat: no-repeat;
background-position: right;
width: 190px;
height: 28px;
float: right;
margin-right: 5px;
}
div#manager-tips
{
height: 34px;
width: 173px;
background-image: url('../images/manager-tips.png');
display: none;
}
div#manager-tips a
{
height: 14px;
width: 14px;
margin-top: 15px;
margin-right: 5px;
}
div#concern-tips
{
height: 25px;
width: 171px;
background-image: url('../images/concern-tips.png');
display: none;
}
div#concern-tips a
{
height: 14px;
width: 14px;
margin-top: 6px;
margin-right: 5px;
}
div#apply-tips
{
height: 34px;
width: 193px;
background-image: url('../images/apply-tips.png');
display: none;
}
div#apply-tips a
{
height: 14px;
width: 14px;
margin-top: 6px;
margin-right: 5px;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/css/default-bak.css | CSS | gpl3 | 14,118 |
div#manager-title
{
height: 30px;
line-height: 30px;
margin-top: 20px;
}
div#manager-title span.manager-title
{
width: 57px;
background-image: url('../images/manager-pic.jpg');
background-repeat: no-repeat;
background-position: 5px center;
height: 30px;
color: #df7902;
padding-left: 25px;
}
div#manager-title span.manager-title-tag
{
width: 116px;
background-image: url('../images/manager-title-tag.jpg');
background-repeat: no-repeat;
height: 30px;
text-align: center;
font-weight: bold;
color: #000000;
letter-spacing: 1px;
}
div#manager-content
{
background-image: url('../images/manager-content.jpg');
background-repeat: no-repeat;
padding-top: 10px;
overflow: hidden;
}
div#content-left
{
width: 164px;
padding-top: 20px;
}
div#manager-control
{
width: 164px;
height: 160px;
background-color: #ebf1fe;
}
a.manager-control
{
width: 139px;
height: 37px;
border-bottom: 1px #ccddf0 dashed;
line-height: 37px;
text-align: left;
font-size: 18px;
font-family: 微软雅黑, 宋体;
color: #3e82af;
padding-left: 25px;
}
a.manager-control-choose
{
background-image: url('../images/manager-control-background.jpg');
background-repeat: no-repeat;
}
a.publish-button
{
height: 37px;
width: 137px;
margin-top: 20px;
margin-left: 10px;
}
a#jobs-publish-button
{
background-image: url('../images/jobs-publish-button.jpg');
}
a#recruitment-publish-button
{
background-image: url('../images/recruitment-publish-button.jpg');
}
div#content-middle
{
width: 610px;
border: 1px #e5eaf7 solid;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
background-color: #ffffff;
padding: 10px;
}
div#content-middle-delete
{
height: 15px;
line-height: 15px;
}
div#content-middle-delete a
{
padding: 0 0 0 20px;
background-image: url('../images/manager-conten-middle-deletet.jpg');
background-repeat: no-repeat;
}
div.item
{
width: 607px;
overflow: hidden;
margin-top: 5px;
border-bottom: 1px #dedede dashed;
padding-left: 5px;
padding-top: 5px;
padding-bottom: 5px;
}
div.item-over
{
background-image: url('../images/item-over-background.jpg');
background-repeat: no-repeat;
}
div.item-delete
{
height: 17px;
}
div.item-delete a
{
width: 17px;
height: 17px;
}
div.item-pic
{
height: 50px;
width: 50px;
padding: 2px;
border: 1px #ececec solid;
background-color: #ffffff;
}
div.item-content
{
width: 530px;
}
div.item-blog
{
width: 530px;
line-height: 20px;
padding: 0 5px;
font-size: 14px;
overflow: hidden;
}
a.item-blog-name
{
color: #6f93ab;
font-weight: bold;
}
a.item-blog-link
{
color: #0084b4;
}
div.item-blog-content
{
margin-top: 5px;
line-height: 20px;
font-size: 14px;
display: none;
word-wrap: break-word;
}
div.item-other
{
height: 24px;
line-height: 24px;
}
div.item-applys
{
margin-top: 5px;
line-height: 24px;
display: none;
}
div.item-applys span.item-applys-time
{
margin-left: 5px;
}
div.item-applys a.item-applys-name
{
color: #7ba5d7;
}
div.item-applys a.item-applys-read
{
color: #7ba5d7;
}
div.item-applys div
{
height: 24px;
padding: 0 20px;
}
span.item-time
{
color: #a3a3a3;
padding: 0 5px;
}
a.item-position
{
color: #7ba5d7;
margin: 0 10px;
}
a.item-control
{
color: #7ba5d7;
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
border-left: 1px #7ba5d7 solid;
}
a.last
{
border-left: none;
}
span.item-apply
{
letter-spacing: 2px;
}
span.item-apply-name
{
color: #7ba5d7;
margin-left: 10px;
}
span.item-apply-info
{
color: #2281a4;
margin-right: 10px;
}
span.item-apply-info-read
{
color: #ea7f37;
}
a.item-favourite
{
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
}
a.item-action
{
color: #2281a4;
}
a.item-doapply
{
color: #ea7f37;
}
div#pages
{
height: 21px;
margin-top: 20px;
}
a.page-number
{
height: 21px;
padding: 0 6px;
line-height: 21px;
text-align: center;
border: 1px #5c738f solid;
color: #5c738f;
margin: 0 2px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
a.page-number-current
{
background-color: #a4c8f4;
}
a.page-control
{
height: 21px;
padding: 0 6px;
line-height: 21px;
text-align: center;
border: 1px #5c738f solid;
background-color: #a4c8f4;
color: #5c738f;
margin: 0 2px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#pages span
{
height: 21px;
line-height: 21px;
text-align: center;
}
div#content-right
{
background-color: #ebf1fe;
width: 166px;
overflow: hidden;
}
div#right-title
{
height: 40px;
line-height: 40px;
text-align: center;
letter-spacing: 2px;
color: #949494;
}
div.ad-title
{
line-height: 20px;
color: #7ba5d7;
padding: 0 10px;
letter-spacing: 1px;
padding-top: 10px;
}
div.ad-content
{
line-height: 20px;
color: #949494;
padding: 0 10px;
letter-spacing: 1px;
}
div.ad-address
{
line-height: 20px;
color: #7ba5d7;
padding: 0 10px;
letter-spacing: 1px;
padding-bottom: 10px;
}
div#profile
{
display: none;
}
div#profile-title
{
height: 30px;
line-height: 30px;
padding: 0px 10px;
}
div#profile-title span#title
{
color: #3e82af;
font-size: 16px;
font-family: 微软雅黑, 宋体;
}
div#profile-title span#lasttime
{
color: #999999;
}
div.profile-detail-title
{
height: 47px;
background-image: url('../images/profile-title-background.jpg');
background-repeat: repeat-x;
}
div.profile-detail-title span
{
color: #585858;
margin-top: 15px;
font-size: 14px;
margin-left: 10px;
font-weight: bold;
letter-spacing: 2px;
line-height: 30px;
}
div.profile-detail-title a
{
height: 25px;
width: 82px;
line-height: 25px;
text-align: center;
background-image: url('../images/profile-title-button.jpg');
background-repeat: no-repeat;
margin-top: 15px;
margin-right: 20px;
color: #496a8a;
}
div.profile-detail-title a:hover
{
text-decoration: none;
}
div.profile-content
{
overflow: hidden;
padding: 10px 0;
}
div#info-content-left
{
width: 400px;
}
div#info-content-right
{
width: 210px;
}
span.info-content-title
{
color: #b2b2b2;
height: 30px;
line-height: 30px;
width: 150px;
text-align: right;
}
input.info-content-words
{
color: #585858;
height: 16px;
line-height: 16px;
width: 200px;
margin-left: 30px;
margin-top: 7px;
margin-bottom: 7px;
border: 1px #ffffff solid;
}
input.info-content-words:hover
{
border: 1px #b2b2b2 solid;
}
input.info-content-words-focus
{
border: 1px #b2b2b2 solid;
}
div#info-pic
{
height: 94px;
width: 94px;
margin-left: 53px;
margin-top: 20px;
border: 5px #ebf1fe solid;
border-radius: 5px 5px;
}
div#info-pic div
{
line-height: 24px;
background-color: #dbeaf6;
height: 24px;
text-align: center;
}
div#info-pic-control
{
line-height: 24px;
height: 24px;
text-align: center;
margin-top: 15px;
color: #585858;
}
div#info-pic-control
{
line-height: 24px;
height: 24px;
text-align: center;
margin-top: 15px;
color: #585858;
}
div.education-item
{
height: 30px;
line-height: 30px;
color: #585858;
border-bottom: 1px #dcebf6 dashed;
}
div.education-item-over
{
background-color: #e4eff9;
}
div.education-item span.school
{
width: 100px;
margin-left: 60px;
}
div.education-item span.time
{
width: 120px;
}
div.education-item span.education
{
width: 80px;
}
div.education-item span.major
{
width: 80px;
}
div.education-header
{
color: #b2b2b2;
}
div#profile-control
{
display: none;
}
div#profile-control a
{
height: 36px;
width: 142px;
margin-top: 20px;
margin-left: 14px;
}
a#profile-preview
{
background-image: url('../images/profile-preview.jpg');
background-repeat: no-repeat;
}
a#profile-save
{
background-image: url('../images/profile-save.jpg');
background-repeat: no-repeat;
}
div.microblog-item
{
margin-top: 5px;
border-bottom: 1px #dedede dashed;
padding-left: 5px;
padding-top: 5px;
padding-bottom: 5px;
overflow: hidden;
}
div.microblog-item-pic
{
height: 50px;
width: 50px;
padding: 2px;
border: 1px #ececec solid;
background-color: #ffffff;
}
div.microblog-item-content
{
width: 530px;
}
div.microblog-item-blog
{
width: 530px;
line-height: 20px;
padding: 0 5px;
font-size: 14px;
}
a.microblog-item-blog-name
{
color: #6f93ab;
font-weight: bold;
}
a.item-blog-link
{
color: #0084b4;
}
div.microblog-item-other
{
height: 24px;
line-height: 24px;
}
div.microblog-item-other1
{
height: 24px;
line-height: 24px;
border-top: 1px #a3a3a3 dashed;
}
a.microblog-item-time
{
color: #7ba5d7;
padding: 0 5px;
}
a.microblog-item-time
{
color: #a3a3a3;
padding: 0 5px;
}
a.microblog-item-position
{
color: #7ba5d7;
margin: 0 10px;
}
a.microblog-item-relate
{
margin: 0 5px;
}
a.microblog-item-control
{
color: #ea7f37;
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
}
a.microblog-item-control1
{
color: #7ba5d7;
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
}
a.microblog-item-apply
{
border-right: 1px #ea7f37 solid;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/css/admin.css | CSS | gpl3 | 10,651 |
body
{
font-size: 12px;
background-color: #f2f6fe;
background-image: url('../images/background.jpg');
background-repeat: repeat-x;
overflow-y: scroll;
font-family: Arial, Helvetica, sans-serif, 宋体 !important;
}
body, a, input, span, img
{
margin: 0;
padding: 0;
}
a
{
text-decoration: none;
cursor: pointer;
color: inherit;
}
a:hover
{
text-decoration: underline;
}
a, input, img, textarea
{
outline: none;
}
img
{
border: none;
}
div#header
{
width: 962px;
height: 31px;
background-color: #d1e9f1;
line-height: 31px;
margin: auto;
}
div#links
{
padding-left: 10px;
}
div#links a
{
color: #5a7b92;
padding: 0 10px;
border-right: 1px #5a7b92 solid;
height: 12px;
margin-top: 10px;
line-height: 14px;
}
div#links a.last
{
border-right: none;
}
div#infos
{
padding-right: 10px;
}
div#infos a.logined
{
padding: 0 10px;
color: #5a7b92;
}
div#infos a.selected
{
background-color: #eaf1fe;
}
div#infos a.orange
{
color: #df7902;
}
div#infos a#sina-login
{
height: 22px;
width: 114px;
background-image: url('../images/sina-login.jpg');
margin-top: 4px;
}
div#logo-search
{
height: 100px;
width: 962px;
margin: auto;
}
div#logo-search a#logo
{
height: 71px;
width: 172px;
background-image: url('../images/logo-beta.jpg');
margin-top: 17px;
margin-left: 60px;
text-align: right;
padding-right: 9px;
line-height: 24px;
color: #697686;
}
div#logo-search a#logo:hover
{
text-decoration: none;
}
div#logo-search div#search-bar
{
background-image: url('../images/search-bar.jpg');
height: 52px;
width: 606px;
margin-top: 38px;
margin-left: 20px;
}
div#logo-search div#search-bar a.sort
{
height: 14px;
line-height: 14px;
color: #ebf1fe;
margin-top: 19px;
}
div#logo-search div#search-bar a#sort
{
margin-left: 15px;
width: 60px;
text-align: center;
}
div#logo-search div#search-bar a#sort-triangle
{
margin-left: 2px;
}
div#logo-search div#search-bar input#search-text
{
font-size: 16px;
line-height: 24px;
border: none;
background: none;
height: 24px;
width: 370px;
color: #adadad;
margin-top: 14px;
margin-left: 20px;
font-weight: bold;
}
div#logo-search div#search-bar a#search-button
{
height: 32px;
width: 92px;
margin-left: 24px;
margin-top: 8px;
}
div#sorts
{
height: 289px;
width: 294px;
display: none;
}
div#sorts-tag
{
width: 77px;
height: 35px;
background-color: #f8fcff;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
line-height: 35px;
text-align: center;
color: #527299;
padding-left: 5px;
border: 1px #9c9c9c solid;
border-bottom: none;
}
a#sorts-name
{
width: 60px;
text-align: center;
}
div#sorts-content
{
width: 294px;
background-color: #f8fcff;
border-top-right-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
padding-top: 10px;
border: 1px #9c9c9c solid;
border-top: none;
}
div.sorts-item
{
height: 30px;
line-height: 30px;
font-size: 14px;
padding-left: 10px;
letter-spacing: 2px;
color: #527299;
}
div.sorts-item-alternative
{
background-color: #f0f5fe;
}
div.sorts-item-over
{
color: #ef7a0d;
text-decoration: underline;
}
div#company
{
height: 38px;
background-image: url('../images/company-background.jpg');
background-repeat: repeat-x;
}
div#company span.company-name
{
height: 14px;
line-height: 14px;
color: #496a8a;
margin-top: 13px;
margin-left: 20px;
}
div#company div#companies
{
width: 840px;
height: 38px;
overflow: hidden;
white-space: nowrap;
line-height: 38px;
position: relative;
}
div#company div#companies-inner
{
position: relative;
height: 38px;
}
div#company a.company-name
{
height: 14px;
color: #496a8a;
margin-top: 13px;
padding-left: 10px;
padding-right: 10px;
border-right: 1px #b0c2d7 solid;
}
div#company a.last
{
border-right: none;
}
div#company div#company-control
{
height: 38px;
width: 40px;
}
div#company a.company-control
{
height: 38px;
width: 20px;
line-height: 38px;
text-align: center;
color: #334a5a;
font-size: 18px;
}
div#cover
{
background-color: #000000;
position: absolute;
top: 0px;
left: 0px;
display: none;
}
div#jobs-publish
{
display: none;
height: 307px;
width: 559px;
border: 5px #717171 solid;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
}
div#jobs-publish-title
{
height: 31px;
width: 559px;
background-color: #91d078;
background-image: url('../images/jobs-publish-pic.jpg');
background-repeat: no-repeat;
background-position: 15px center;
}
div#jobs-publish-title span
{
height: 31px;
line-height: 31px;
color: #ffffff;
font-size: 18px;
font-family: 微软雅黑, 宋体;
letter-spacing: 8px;
padding-left: 45px;
}
div#jobs-publish-title a
{
height: 16px;
width: 16px;
background-image: url('../images/jobs-publish-close.jpg');
margin-top: 7px;
margin-right: 7px;
}
div#jobs-publish-content
{
height: 276px;
width: 559px;
background-color: #dff4dc;
}
div#jobs-publish-remain
{
height: 40px;
width: 549px;
text-align: right;
color: #577a4a;
letter-spacing: 2px;
line-height: 40px;
padding-right: 10px;
}
div#jobs-publish-text
{
height: 103px;
width: 559px;
background-image: url('../images/jobs-publish-text.jpg');
background-repeat: no-repeat;
background-position: 12px center;
}
div#jobs-publish-text textarea
{
height: 94px;
width: 526px;
margin-top: 4px;
margin-left: 17px;
border: none;
background-color: #f5f5f5;
line-height: 20px;
letter-spacing: 1px;
font-size: 14px;
}
div#jobs-publish-tags
{
margin-top: 10px;
height: 28px;
width: 559px;
background-image: url('../images/jobs-publish-tags.jpg');
background-repeat: no-repeat;
background-position: 85px center;
}
div#jobs-publish-tags span#jobs-publish-tags-title
{
margin-left: 15px;
height: 28px;
line-height: 28px;
color: #577a4a;
letter-spacing: 4px;
width: 70px;
text-align: center;
}
div#jobs-publish-tags span#jobs-publish-tags-ps
{
margin-left: 12px;
height: 28px;
line-height: 28px;
color: #8c8c8c;
letter-spacing: 1px;
text-align: center;
}
div#jobs-publish-tags input
{
width: 320px;
margin-top: 7px;
margin-left: 6px;
border: none;
background-color: #f5f5f5;
}
div#jobs-publish-tags-hot
{
margin-top: 10px;
width: 559px;
overflow: hidden;
}
div#jobs-publish-tags-hot span#jobs-publish-tags-hot-title
{
margin-left: 15px;
height: 28px;
line-height: 28px;
color: #577a4a;
letter-spacing: 4px;
width: 70px;
text-align: center;
}
div#jobs-publish-tags-hot a.jobs-publish-tags-hot-item
{
white-space: nowrap;
height: 24px;
line-height: 24px;
padding: 0 5px;
margin: 2px 5px;
background-color: #91d078;
color: #ffffff;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#jobs-publish-confirm
{
margin-top: 10px;
height: 36px;
width: 529px;
padding-right: 30px;
}
div#jobs-publish-confirm span
{
color: #577a4a;
line-height: 36px;
height: 36px;
margin-right: 30px;
letter-spacing: 1px;
}
div#jobs-publish-confirm a
{
height: 36px;
width: 115px;
background-image: url('../images/jobs-publish-confirm.jpg');
}
div#recruitment-publish
{
display: none;
height: 307px;
width: 559px;
border: 5px #717171 solid;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
}
div#recruitment-publish-title
{
height: 31px;
width: 559px;
background-color: #7cb5da;
background-image: url('../images/recruitment-publish-pic.jpg');
background-repeat: no-repeat;
background-position: 15px center;
}
div#recruitment-publish-title span
{
height: 31px;
line-height: 31px;
color: #ffffff;
font-size: 18px;
font-family: 微软雅黑, 宋体;
letter-spacing: 8px;
padding-left: 45px;
}
div#recruitment-publish-title a
{
height: 16px;
width: 15px;
background-image: url('../images/recruitment-publish-close.jpg');
margin-top: 7px;
margin-right: 7px;
}
div#recruitment-publish-content
{
height: 276px;
width: 559px;
background-color: #e2edf2;
}
div#recruitment-publish-remain
{
height: 40px;
width: 549px;
text-align: right;
color: #435c79;
letter-spacing: 2px;
line-height: 40px;
padding-right: 10px;
}
div#recruitment-publish-text
{
height: 103px;
width: 559px;
background-image: url('../images/recruitment-publish-text.jpg');
background-repeat: no-repeat;
background-position: 12px center;
}
div#recruitment-publish-text textarea
{
height: 94px;
width: 526px;
margin-top: 4px;
margin-left: 17px;
border: none;
background-color: #f5f5f5;
}
div#recruitment-publish-tags
{
margin-top: 10px;
height: 28px;
width: 559px;
background-image: url('../images/recruitment-publish-tags.jpg');
background-repeat: no-repeat;
background-position: 85px center;
}
div#recruitment-publish-tags span#recruitment-publish-tags-title
{
margin-left: 15px;
height: 28px;
line-height: 28px;
color: #435c79;
letter-spacing: 4px;
width: 70px;
text-align: center;
}
div#recruitment-publish-tags span#recruitment-publish-tags-ps
{
margin-left: 12px;
height: 28px;
line-height: 28px;
color: #8c8c8c;
letter-spacing: 1px;
text-align: center;
}
div#recruitment-publish-tags input
{
width: 320px;
margin-top: 7px;
margin-left: 6px;
border: none;
background-color: #f5f5f5;
}
div#recruitment-publish-tags-hot
{
margin-top: 10px;
width: 559px;
overflow: hidden;
}
div#recruitment-publish-tags-hot span#recruitment-publish-tags-hot-title
{
margin-left: 15px;
height: 28px;
line-height: 28px;
color: #435c79;
letter-spacing: 4px;
width: 70px;
text-align: center;
}
div#recruitment-publish-tags-hot a.recruitment-publish-tags-hot-item
{
height: 24px;
line-height: 24px;
padding: 0 5px;
margin: 2px 5px;
background-color: #7cb5da;
color: #ffffff;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#recruitment-publish-confirm
{
margin-top: 10px;
height: 36px;
width: 529px;
padding-right: 30px;
}
div#recruitment-publish-confirm span
{
color: #435c79;
line-height: 36px;
height: 36px;
margin-right: 30px;
letter-spacing: 1px;
}
div#recruitment-publish-confirm a
{
height: 36px;
width: 114px;
background-image: url('../images/recruitment-publish-confirm.jpg');
}
div#footer
{
margin-top: 30px;
letter-spacing: 1px;
}
div#footer a
{
color: #5c738f;
}
div#footerlinks
{
height: 20px;
line-height: 20px;
text-align: center;
}
div#copyright
{
line-height: 20px;
text-align: center;
}
.left
{
float: left;
}
.right
{
float: right;
}
.absolute
{
position: absolute;
}
.inner
{
width: 962px;
margin: auto;
}
.logined
{
display: none;
}
.logouted
{
display: none;
}
.jobs
{
display: none;
}
.recruitment
{
display: none;
}
.highlight
{
color: #ff0000;
}
.admin
{
display: none;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/css/share-bak.css | CSS | gpl3 | 12,632 |
div#content
{
margin-top: 10px;
overflow: hidden;
}
div#left
{
width: 300px;
overflow: hidden;
}
div#left div.left-title
{
height: 24px;
line-height: 24px;
margin-bottom: 3px;
margin-top: 20px;
}
div#left div.first
{
margin-top: 0px;
}
div#left span.left-title-text
{
height: 24px;
line-height: 24px;
font-family: 微软雅黑, 宋体;
font-size: 16px;
color: #4e88af;
margin-left: 5px;
}
div#left a.left-title-pic
{
height: 24px;
width: 24px;
margin-right: 5px;
background-position: center center;
background-repeat: no-repeat;
}
div#left a#concern-pic
{
background-image: url('../images/concern-rss.jpg');
display: none;
}
div#left a#concern-pic
{
background-image: url('../images/concern-rss.jpg');
display: none;
}
div#left div.concern-item
{
height: 25px;
line-height: 25px;
margin-top: 5px;
cursor: pointer;
}
div#left a.concern-item-delete
{
width: 25px;
height: 25px;
background-image: url('../images/concern-delete.jpg');
background-position: center center;
background-repeat: no-repeat;
}
div#left div.concern-item-content
{
width: 275px;
height: 25px;
font-size: 15px;
font-family: 微软雅黑, 宋体;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#left div.concern-item-content
{
background-color: #cae4e9;
color: #659abe;
}
div#left a.concern-item-delete
{
visibility: hidden;
}
div#left div.concern-item-over div.concern-item-content
{
background-color: #7cb5da;
color: #ffffff;
}
div#left div.concern-item-over a.concern-item-delete
{
visibility: visible;
}
div#left div.concern-item-content-new
{
font-weight: bold;
}
div#left a.concern-item-content-info
{
margin-left: 5px;
}
div#left a.concern-item-content-number
{
margin-right: 5px;
}
div#left a#history-pic
{
background-image: url('../images/history-clear.jpg');
background-position: center center;
background-repeat: no-repeat;
}
div#left div.history-item
{
cursor: pointer;
height: 24px;
line-height: 24px;
width: 270px;
margin-left: 25px;
color: #5a7b92;
margin-top: 5px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
padding-left: 5px;
}
div#left div.history-item-over
{
background-color: #e7f1f5;
}
div#left span.left-title-time
{
margin-right: 5px;
color: #979797;
}
div#left div#hot-content
{
width: 275px;
margin-left: 25px;
display: block;
white-space: pre-line;
}
div#left a.hot-content-item
{
height: 20px;
line-height: 20px;
margin-left: 3px;
margin-top: 3px;
background-color: #eaf2f9;
color: #5a7b92;
padding: 2px 8px;
white-space: nowrap;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#left a:hover
{
text-decoration: none;
}
div#right
{
margin-left: 25px;
width: 620px;
}
div#right div#radio
{
height: 20px;
width: 600px;
background-color: #fff2dc;
background-image: url('../images/radio-piv.jpg');
background-repeat: no-repeat;
background-position: 5px center;
color: #ff9646;
line-height: 20px;
padding-left: 20px;
letter-spacing: 3px;
}
div#right div#microblogs
{
width: 592px;
border: 1px #ebeff7 solid;
background-color: #ffffff;
margin-top: 10px;
padding: 5px 13px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
overflow: hidden;
}
div#right div#search-result-outer
{
border: 1px #d7e7ef solid;
background-color: #ffffff;
width: 588px;
padding: 1px;
display: none;
overflow: hidden;
}
div#right div#search-result
{
background-color: #d7e7ef;
width: 563px;
line-height: 28px;
background-image: url('../images/search-result-pic.jpg');
background-position: 5px center;
background-repeat: no-repeat;
padding-left: 25px;
letter-spacing: 2px;
overflow: hidden;
}
div#right a#search-result-concern
{
height: 25px;
width: 67px;
margin-top: 2px;
margin-right: 10px;
}
div#right a.search-result-concern
{
background-image: url('../images/search-result-concern.jpg');
}
div#right a.search-result-concern-over
{
background-image: url('../images/search-result-concern-over.jpg');
}
div#right a.search-result-concern-click
{
background-image: url('../images/search-result-concern-click.jpg');
}
div#right a.search-result-concern-have
{
background-image: url('../images/search-result-concern-have.jpg');
}
div#right a#search-result-rss
{
height: 28px;
width: 28px;
background-image: url('../images/search-result-rss.jpg');
background-repeat: no-repeat;
}
div#right div.microblog-item
{
width: 582px;
margin-top: 5px;
border-bottom: 1px #a3a3a3 dashed;
padding: 5px;
overflow: hidden;
}
div#right div.microblog-item-pic
{
height: 50px;
width: 50px;
padding: 2px;
border: 1px #ececec solid;
background-color: #ffffff;
}
div#right div.microblog-item-content
{
width: 525px;
}
div#right div.microblog-item-blog
{
width: 515px;
line-height: 20px;
padding: 0 5px;
font-size: 14px;
word-wrap: break-word;
}
div#right a.microblog-item-blog-name
{
color: #6f93ab;
}
div#right a.item-blog-link
{
color: #0084b4;
}
div#right div.microblog-item-other
{
width: 525px;
height: 24px;
line-height: 24px;
}
div#right div.microblog-item-other1
{
width: 525px;
height: 24px;
line-height: 24px;
border-top: 1px #dedede dashed;
}
div#right a.microblog-item-time
{
color: #a3a3a3;
padding: 0 5px;
}
div#right a.microblog-item-position
{
color: #7ba5d7;
margin: 0 10px;
}
div#right span.microblog-item-relate
{
color: #a3a3a3;
padding: 0 5px;
}
div#right a.microblog-item-relate
{
margin: 0 5px;
}
div#right a.microblog-item-control
{
color: #ea7f37;
letter-spacing: 2px;
padding: 0 10px;
line-height: 14px;
height: 14px;
margin-top: 5px;
}
div#right a.microblog-item-apply
{
border-right: 1px #ea7f37 solid;
}
div#right div#pages
{
height: 21px;
margin-top: 5px;
}
div#right a.page-number
{
height: 21px;
padding: 0 6px;
line-height: 21px;
text-align: center;
border: 1px #5c738f solid;
color: #5c738f;
margin: 0 2px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#right a.page-number-current
{
background-color: #a4c8f4;
}
div#right a.page-control
{
height: 21px;
padding: 0 6px;
line-height: 21px;
text-align: center;
border: 1px #5c738f solid;
background-color: #a4c8f4;
color: #5c738f;
margin: 0 2px;
border-top-left-radius: 3px 3px;
border-top-right-radius: 3px 3px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
div#right div#pages span
{
height: 21px;
line-height: 21px;
text-align: center;
}
a.keyword
{
color: #2972a4;
}
div#role-choose
{
display: none;
width: 552px;
height: 372px;
background-color: #ffffff;
background-image: url('../images/role-background.jpg');
background-repeat: no-repeat;
z-index:200;
}
div.role-jobs
{
background-position: 0 0;
}
div.role-recruitment
{
background-position: 0 -372px;
}
a#role-jobs
{
width: 170px;
height: 190px;
border: 3px transparent solid;
border-radius: 5px 5px;
}
a#role-jobs:hover
{
border: 3px #425d7a solid;
}
a#role-recruitment
{
width: 166px;
height: 190px;
border: 3px transparent solid;
border-radius: 5px 5px;
}
a#role-recruitment:hover
{
border: 3px #678432 solid;
}
a#role-confirm
{
width: 173px;
height: 46px;
}
div#right div#fresh-outer
{
height: 28px;
border: 1px #fff2dc solid;
background-color: #fff2dc;
width: 588px;
padding: 1px;
display: none;
}
div#right div#fresh
{
height: 28px;
background-color: #fff2dc;
width: 563px;
line-height: 28px;
background-position: 5px center;
background-repeat: no-repeat;
padding-left: 10px;
letter-spacing: 3px;
cursor: pointer;
color: #ff9646;
}
div#backTop
{
width: 20px;
height: 100px;
line-height: 20px;
text-align: center;
background-color: #d7e7ef;
display: none;
letter-spacing: 2px;
}
div#backTop:hover
{
cursor: pointer;
}
div#backTop a:hover
{
text-decoration: none;
}
div#manager-tips
{
height: 34px;
width: 173px;
background-image: url('../images/manager-tips.png');
display: none;
}
div#manager-tips a
{
height: 14px;
width: 14px;
margin-top: 15px;
margin-right: 5px;
}
div#concern-tips
{
height: 25px;
width: 171px;
background-image: url('../images/concern-tips.png');
display: none;
}
div#concern-tips a
{
height: 14px;
width: 14px;
margin-top: 6px;
margin-right: 5px;
}
div#apply-tips
{
height: 34px;
width: 193px;
background-image: url('../images/apply-tips.png');
display: none;
}
div#apply-tips a
{
height: 14px;
width: 14px;
margin-top: 6px;
margin-right: 5px;
}
| 0f523140-f3b3-4653-89b0-eb08c39940ad | trunk/src/html/css/default.css | CSS | gpl3 | 10,072 |